OPEN-SOURCE SCRIPT

Cumulative Price Average

The Cumulative Price Average (CPA) indicator calculates and plots the overall average of candlestick prices, providing a smoothed representation of the market's long-term price trend. This is achieved by aggregating the averages of each candle (Open, High, Low, Close) and dynamically updating the overall average as new candles are added.

Key Features

Long-Term Price Perspective: Displays the cumulative average of all candles from the start of the chart.
Trend Visualization: Smooths out short-term price fluctuations to highlight the overall trend.
Dynamic Updates: The average adjusts with each new bar for real-time analysis.

Usage

Trend Analysis:
Identify long-term bullish or bearish trends by observing the slope of the CPA line.

Support/Resistance:
The CPA line can act as a dynamic support or resistance level for the price.

Price Comparison:
Compare the current price to the CPA to assess whether the market is overbought or oversold relative to its historical average.

This indicator is especially useful for traders seeking to incorporate a historical perspective into their analysis, providing insights into the broader market behavior beyond short-term volatility.
Moving AveragesTrend AnalysisVolatility

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?

Disclaimer