PDA

View Full Version : Livechart Stock Chart Program - check it out!


EmoMan
06-23-2005, 05:51 PM
Hi,

I like stock charts! They are neat and they display a LOT of data in an easy to read little space. A chart allows humans to visualize enormous amounts of data quickly and easily and lets the computer do all the thinking!

A LONG time ago I saw some great charting from quote.com when they use to have free livecharts with lots of little gizmos that you can put on it. They would update as the stock market moves. I thought it was awesome - but now livecharts is pretty weak and the only way to get those old charts is with Qcharts ($80/m !!!!) and they don't even have some great features like equivolume!! Whats that?!?!

Anyway - I decided to write my own charting program so that I could learn flash and have fun doing it! I wanted to see a nice equivolume (equicandle??) chart that I could read and didn't cost me anything or subscriptions and crap. The data is collected by downloading a csv table from yahoo.com (historical data once a day) and a simple webservice to grab the latest quote.

The chart actually grabs ENORMOUS data (about 5 - 6Kb) so that it can accurately calculate moving averages and unusual volume. The data is then passed through at least 4 loops (price scale calculations, candle drawing, moving average calculations, moving average drawing)

The benefits of it all is that the charts can be HUGE! I mean - nothing like you have ever seen gigantic (2000+ pixels wide and infinity high). It'll still have data and candles to display.

They also update in real-time like the old quote.com charts..

Great news is that the file size is small. The actual swf file is nothing more than a label component, some functions, and a movieclip of a dotted line.




Click here to check it out and tell me what you think! (http://www.optrading.com/chart.htm?sym=amat)


Its a chart of AMAT (Applied Materials).. The highlighted candle means unusual volume (the highest volume candle of the data). The two averages are 26 day (red?) and 12 day (blue?). Together these averages make up MACD.. for those who know anything about stock charts and tech junk ;)

Thanks!!

johnchen
01-03-2008, 04:47 PM
tried your link and got no permission. I do notice your post is two years ago.

Hear is my Question:

I am new to Flash but do have programming background. I am trying to create something like Yahoo Finance. Looked some ready-made tools like fusion chart but not exactly what I wanted so decided to learn Flash.

Q1: How do I draw the Candle? I can translate a price data (open, high, low, close) into in a box (rectangle) and two lines. i.e. I can loop through an array of price data and draw all the candles. But it seems to a little messy. Is there a better way.

Q2: I also want trap the mouse move event (just like Yahoo does) can the "this" (I don't know how to call it. Canvas? Stage? Frame?) listen to the mouse event?

Thanks

Joh n

ASWC
01-03-2008, 07:17 PM
you can catch any mouse event with Flash. Just look at the documentation.

johnchen
01-05-2008, 10:58 PM
OK, I tried the following:

this.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoving);
myButton.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoving);
function mouseMoving(e:MouseEvent):void
{

trace ("inside");

}

it workd for "myButton" (I see the trace.)

But "this" does not work. BTW, what is "this"? frame? stage? All I want to do get the mouse_MOVE event on the canvas.

Thanks

John

xwielder
01-07-2008, 11:41 AM
You might want to post this question in the ActionScript 3 section of these forums. People there would probably be able to answer you more quickly.

http://www.actionscript.org/forums/forumdisplay.php3?f=75

johnchen
01-08-2008, 09:54 PM
I am new to this and was not aware other sections.

Anyway, I figured out.

Just for people like me. Here is how.

use stage.addEventListener() instead of this.addEventListener()

to my surprise, the event is trigged even when mouse-moving on the child and the event's target is the child (display item). That is great so I don't need to add all the child to listen to the event.

Thanks

John

zeroin
05-24-2008, 10:03 AM
And how is it going?
I must say I spend almost a year to create something simmilar, you can check it here: http://www.amcharts.com/stock/