OPEN-SOURCE SCRIPT
Aggiornato Candle % High/Low Bar + HL Order + MA by Barty&PitPapcio

What does the indicator show?
The "Candle % High/Low Bar + HL Order + MA by Barty&PitPapcio" indicator displays the percentage deviation of each candle’s high and low relative to its open price. The zero line represents the candle’s open — bars above zero show upward movement from the open (to high), bars below zero show downward movement (to low).
Additionally, the indicator plots a dot above or below each bar indicating which came first during the candle — the high or the low — based on data from a lower timeframe two steps below the current chart (for example, on a 1-hour chart it uses 15-minute data).
Finally, the indicator calculates and plots a user-selectable moving average (EMA, SMA, or WMA) of these "first high or low" signals, helping identify trends whether the first move is more often upwards or downwards.
Where do the data come from?
Percentage values are calculated directly from the current chart’s candles:
The timing of the first high or low for each candle is retrieved from a lower timeframe, stepping down two levels from the current timeframe (e.g. from 1H to 15 min), providing better precision in detecting the order of highs and lows that may be blurred on higher timeframes.
Additional features:
Suggested strategy for technical analysis support
Lots of love, Bartosz
The "Candle % High/Low Bar + HL Order + MA by Barty&PitPapcio" indicator displays the percentage deviation of each candle’s high and low relative to its open price. The zero line represents the candle’s open — bars above zero show upward movement from the open (to high), bars below zero show downward movement (to low).
Additionally, the indicator plots a dot above or below each bar indicating which came first during the candle — the high or the low — based on data from a lower timeframe two steps below the current chart (for example, on a 1-hour chart it uses 15-minute data).
Finally, the indicator calculates and plots a user-selectable moving average (EMA, SMA, or WMA) of these "first high or low" signals, helping identify trends whether the first move is more often upwards or downwards.
Where do the data come from?
Percentage values are calculated directly from the current chart’s candles:
- highPerc=(High−Open)/Open×100%,
- lowPerc=(Low−Open)/Open×100%
The timing of the first high or low for each candle is retrieved from a lower timeframe, stepping down two levels from the current timeframe (e.g. from 1H to 15 min), providing better precision in detecting the order of highs and lows that may be blurred on higher timeframes.
Additional features:
- Full customization of colors for bars, dots, zero line, grid, and thicknesses.
- Background grid with adjustable scale and style.
- Safety checks for missing lower timeframe data.
- A moving average smoothing the sequence of first high/low signals to reveal directional tendencies.
Suggested strategy for technical analysis support
- Identify dominant candle direction: If the dot often appears above the bar (first high), it indicates buying pressure; if below (first low), selling pressure dominates.
- Use percentage deviations: Large percent bars indicate heightened volatility and potential reversal points.
- Moving average on order signals: The EMA of high/low first signals smooths the noise, showing the dominant trend in the sequence of price moves, useful for filtering other signals.
- Combine with other tools: This indicator can act as a directional filter on multiple timeframes, synergizing well with momentum indicators, RSI, or support/resistance levels to confirm move strength.
Lots of love, Bartosz
Note di rilascio
What was changed in the script:Modified: Moving Average (MA) Calculation
- Previous version:
The moving average was calculated using the values 1 or -1, depending on whether the High or Low came first on a lower timeframe.
1 for High first
-1 for Low first
These values formed the hlSeries array used in the moving average calculation. - New version (current):
The moving average is now calculated using the actual percentage movement:- If High was first → use % to High (highPerc)
- If Low was first → use % to Low (lowPerc)
- These values are stored in the new hlPerc series.
- If High was first → use % to High (highPerc)
This change makes the moving average curve more meaningful and visible, since it's now based on the actual magnitude of candle movement rather than a flat binary -1/1 pattern.
Why the change matters:
- The previous method made the MA line too flat and not reflective of real volatility or strength.
- Now the MA responds to the size of price movement — not just the direction.
- It helps you detect trends in how strong the first movement tends to be (up or down) across candles.
What does the indicator show?
The "Candle % High/Low Bar + HL Order + MA by Barty&PitPapcio" indicator displays the percentage deviation of each candle’s high and low relative to its open price. The zero line represents the candle’s open — bars above zero show upward movement from the open (to high), bars below zero show downward movement (to low).
Additionally, the indicator plots a dot above or below each bar indicating which came first during the candle — the high or the low — based on data from a lower timeframe one step below the current chart (for example, on a 1-hour chart it uses 30-minute data).
Finally, the indicator calculates and plots a user-selectable moving average (EMA, SMA, or WMA) of these "first high or low" signals, helping identify trends whether the first move is more often upwards or downwards.
Where do the data come from?
Percentage values are calculated directly from the current chart’s candles:
- highPerc=(High−Open)/Open×100%,
- lowPerc=(Low−Open)/Open×100%
The timing of the first high or low for each candle is retrieved from a lower timeframe, stepping down two levels from the current timeframe (e.g. from 1H to 15 min), providing better precision in detecting the order of highs and lows that may be blurred on higher timeframes.
Additional features:
- Full customization of colors for bars, dots, zero line, grid, and thicknesses.
- Background grid with adjustable scale and style.
- Safety checks for missing lower timeframe data.
- A moving average smoothing the sequence of first high/low signals to reveal directional tendencies.
- Suggested strategy for technical analysis support
- Identify dominant candle direction: If the dot often appears above the bar (first high), it indicates buying pressure; if below (first low), selling pressure dominates.
- Use percentage deviations: Large percent bars indicate heightened volatility and potential reversal points.
- Moving average on order signals: The EMA of high/low first signals smooths the noise, showing the dominant trend in the sequence of price moves, useful for filtering other signals.
- Combine with other tools: This indicator can act as a directional filter on multiple timeframes, synergizing well with momentum indicators, RSI, or support/resistance levels to confirm move strength.
Lots of love, Bartosz
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.