How to use Flex Chart to draw moving average lines
This article mainly shows you "how to use Flex Chart to draw moving average lines". The content is simple and clear. I hope it can help you solve your doubts. Let me lead you to study and learn this article "how to use Flex Chart to draw moving average lines".
Use Flex Chart to draw moving average lines
The moving average usually refers to the arithmetic moving average, and the closing price of the last n days is usually used when calculating the moving average. We add the new closing price to the array day by day, and the last n + 1 closing price is removed. Then divide the new sum by n, and you get the average of the new day (n-balance mean).
So how to draw a moving average in Flex Chart? Take a look at the following methods:
PrivatefunctiongetMACollection (collection:ArrayCollection,offset:int): ArrayCollection {varnewCollection:ArrayCollection=newArrayCollection (); varlen:int=collection.length; for (vari:int=0;i