How are you receiving your price data to plot? Price feed? Static file? What 
you could do is create a function to loop through the array and perform the 
moving average calculation and add the result as an extra "column" in the 
array.  Are you plotting the full historic price data set?  If so, your MA will 
begin at the nth bar where n is your MA period setting.  eg.. a 20 day MA won't 
start until the 20th day into the data set.

If you're using a static dataset, you could do the calculation in Excel and 
then save the entire datset as XML and just bring that into flex and plot the 
MA from the existing values.

--- In [email protected], "cjsteury2" <cra...@...> wrote:
>
> Hi all,
> 
> I am stumped.
> 
> If I want to add an additional data series to a HLOC Chart that is a line 
> series of a simple 20 day moving average for the closing price ("Close") 
> value in an array collection (Array_Tickers)... how would I perform that 
> calculation in Flex?
> 
> <mx:lineSeries id=mavg 
>  dataprovider="Array_Tickers"
>  ySeries="Close" />
> 
> How would I calculate "Close" as {The SUM for the Value of "Close" for the 
> previous 20 days / divided by 20}...
>


Reply via email to