Registered User Joined: 5/13/2007 Posts: 48
|
Good day, I am trying to figure out how to add the running total of an indicator for the last 'x' number of days. If I take an indicator such as Elder Force Index and plot it on a daily chart it returns the value for each day. But I would like to add the running total of the last 'x' number of days and plot it. Not an average of the last 'x' days, but a cumulative running total that only looks at the values for the last 'x' days and adds them up. Any ideas?
Thanks, Steve
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The simple moving average is just the sum of whatever is being averaged over those days divided by the period. So if you have the simple moving average, you can multiply it by the period to get the sum.
'|******************************************************************
'|*** StockFinder RealCode Indicator - Version 5.0 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Indicator:Sum of Elder Force Index
'|******************************************************************
'# Period = UserInput.Integer = 10
'# EFI = indicator.Library.Elder Force Index
Plot = Period * EFI.AVG(Period)
-Bruce Personal Criteria Formulas TC2000 Support Articles
|