OPEN-SOURCE SCRIPT
Anchored Cumulative Average

Anchored Cumulative Price Average
Overview
The Anchored Cumulative Price Average plots the arithmetic mean of price values calculated from a user-defined start date and time.
Instead of using a fixed lookback length, the average continuously incorporates every completed candle since the anchor point, producing a stable reference level that evolves as new data becomes available.
The indicator supports custom source selection, optional higher-timeframe calculation, and an optional High / Low average mode, making it suitable for contextual market analysis across multiple time horizons.
How It Works
• A start date and time define the anchor point.
• From that moment forward, the script accumulates price values and divides them by the total number of candles included.
• The result is a cumulative (since-anchor) average, not a rolling moving average.
• When a higher timeframe is selected, calculations are performed only when a new HTF candle completes, ensuring consistent aggregation.
This approach creates an average that reflects the market’s mean price relative to a specific event, session, or structural point.
Inputs
• Calculation Timeframe
Choose the timeframe used for the calculation. Leaving this empty uses the chart timeframe.
• Start Date / Time
Defines the anchor point from which the average begins.
Source
Select the price input used for the average:
• Close, Open, High, Low
• HL2, HLC3, OHLC4
• High & Low (plots separate averages for highs and lows)
How to Use
• Anchor the indicator to a session open, swing point, news event, or structural shift.
• Observe how price interacts with the cumulative average as more data is added.
• Use the High & Low mode to visualize mean price boundaries instead of a single central line.
• Apply a higher timeframe to view broader contextual averages while remaining on a lower-timeframe chart.
Common Use Cases
• Contextual reference for mean price since a specific date or event
• Market structure and balance analysis
• Session-based or event-anchored price evaluation
• Multi-timeframe alignment and bias assessment
• Visual support tool alongside discretionary analysis
Notes
• This indicator does not predict price or generate trade signals.
• It is designed as a contextual analysis tool and should be used in conjunction with other forms of market analysis.
• The plotted values will change as new candles form after the anchor point.
Overview
The Anchored Cumulative Price Average plots the arithmetic mean of price values calculated from a user-defined start date and time.
Instead of using a fixed lookback length, the average continuously incorporates every completed candle since the anchor point, producing a stable reference level that evolves as new data becomes available.
The indicator supports custom source selection, optional higher-timeframe calculation, and an optional High / Low average mode, making it suitable for contextual market analysis across multiple time horizons.
How It Works
• A start date and time define the anchor point.
• From that moment forward, the script accumulates price values and divides them by the total number of candles included.
• The result is a cumulative (since-anchor) average, not a rolling moving average.
• When a higher timeframe is selected, calculations are performed only when a new HTF candle completes, ensuring consistent aggregation.
This approach creates an average that reflects the market’s mean price relative to a specific event, session, or structural point.
Inputs
• Calculation Timeframe
Choose the timeframe used for the calculation. Leaving this empty uses the chart timeframe.
• Start Date / Time
Defines the anchor point from which the average begins.
Source
Select the price input used for the average:
• Close, Open, High, Low
• HL2, HLC3, OHLC4
• High & Low (plots separate averages for highs and lows)
How to Use
• Anchor the indicator to a session open, swing point, news event, or structural shift.
• Observe how price interacts with the cumulative average as more data is added.
• Use the High & Low mode to visualize mean price boundaries instead of a single central line.
• Apply a higher timeframe to view broader contextual averages while remaining on a lower-timeframe chart.
Common Use Cases
• Contextual reference for mean price since a specific date or event
• Market structure and balance analysis
• Session-based or event-anchored price evaluation
• Multi-timeframe alignment and bias assessment
• Visual support tool alongside discretionary analysis
Notes
• This indicator does not predict price or generate trade signals.
• It is designed as a contextual analysis tool and should be used in conjunction with other forms of market analysis.
• The plotted values will change as new candles form after the anchor point.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.