Moving Average of calculated dataseries
Author: genelong
Creation Date: 4/6/2013 1:40 PM
profile picture

genelong

#1
I'm trying to plot a line which is a moving average of a calculation; that is, I run each bar through a simple formula, then I want to take the moving average of the results.

So far I can create a new dataseries and plot the calculated values, but I would like to plot the moving average of those values instead (or in addition). How can I program it to do that?

Here is my code so far:

CODE:
Please log in to see this code.
profile picture

LenMoz

#2
It's simpler than you'd think...

CODE:
Please log in to see this code.


Function SMA.Series takes a DataSeries argument which you have already created.
profile picture

genelong

#3
Many thanks!
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).