OPEN-SOURCE SCRIPT

Cumulative Moving Average

Updated
For a given candle, the cumulative moving average is equal to the price averaged over all preceding candles.



N.B. In this script, the daily price is calculated from (high + low) / 2.
Release Notes
Update:

  • Added upper and lower bounds. These are user-defined multiples of the cumulative average. Can be configured under settings to suit your asset.
Release Notes
Added step interval 0.05
Release Notes
CMA works best on larger time frames with many data candles, however so long as amount of data is comparable, the values are the same between timeframes.
Release Notes
deleted
Moving Averages

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?


Also on:

Disclaimer