Count the later candles
The right-side window determines how long you wait for this pattern.

The right-side window determines how long you wait for this pattern.
The earlier marker can appear only after confirmation.
Match the log to the completed confirmation candle.
The Pine function ta.pivothigh uses a left-side and right-side window. The chart below uses five left-side bars and compares two versus five right-side bars. The 9:45 a.m. ET candle reaches 6,004.00 and all neighboring highs in these windows are lower. With two right bars, the qualifying window ends at 9:55. With five, it ends at 10:10.
This example labels candles by their close. On a TradingView five-minute chart, the candle that ends at 9:55 is normally labeled by its 9:50 open. Confirm the chart’s displayed time zone and match the alert event to the end of that candle. A watchlist or saved chart marker alone cannot establish when an alert fired.
Synthetic MES 5-minute candles. Times are bar closes in ET.
Marker 1 is the 9:45 high at 6,004.00. With two right-side bars, marker 2 at the 9:55 close is the first confirmation. The 9:50 close leaves one bar still to check.
Paste the example into Pine Editor on a standard intraday chart. By default, the teal point plots the confirmed pivot price on the candle that confirmed it. Turn on Also mark the earlier pivot if you want an orange point at the historical high too. The negative offset changes the plotted location while the alert condition still checks the current completed bar.
For a replay check, stop between the pivot and the confirmation candle. Advance through the right-side bars. When that window completes, both plot locations can appear at once if the earlier marker is enabled. The earlier location alone can make a finished chart look more predictive than it was.
//@version=6
indicator("Pivot confirmation audit", overlay = true)
leftBars = input.int(5, "Left bars", minval = 1)
rightBars = input.int(2, "Right bars", minval = 1)
markPivot = input.bool(false, "Also mark the earlier pivot")
pivotValue = ta.pivothigh(high, leftBars, rightBars)
confirmed = barstate.isconfirmed and not na(pivotValue)
confirmedPrice = confirmed ? pivotValue : na
plot(confirmedPrice, "Confirmed on this bar", color = color.teal, linewidth = 3, style = plot.style_circles)
plot(markPivot ? confirmedPrice : na, "Earlier pivot location", color = color.orange, linewidth = 3, style = plot.style_circles, offset = -rightBars)
alertcondition(confirmed, "Pivot high confirmed", "A pivot high was confirmed at bar close.")To check alerts, use a live chart and select the indicator’s Pivot high confirmed condition, with Once per bar close. In the synthetic two-bar example, the candidate closing at 9:45 would count at the 9:55 close. Save the expected bar time, then compare the live event time in Alerts Log.
If you change the right-bars setting or script, create the replacement alert with the intended symbol, interval, and inputs. Use Chart Replay to inspect marker order and the live Alerts Log to inspect notification timing. A marker offset never moves the alert event into the past.
Platform details on this page were checked against these official resources.
Compare the pivot location and confirmation time when the highs tie or differ by one tick.
Compare a potential pivot with a leg that clears the reversal threshold.
Check the same delayed confirmation using Strength 2 and Strength 5.
Replace its saved script and input configuration.
Check when a marker first appears rather than reading a finished chart.
A script can apply a negative plot offset after it confirms the pivot. The marker points to the extreme’s location. The decision timestamp is the confirmation bar.
For the close-confirmed method here, both bars after the candidate must finish. On a five-minute chart without gaps, that takes ten minutes after the candidate closes.
Futures trading contains substantial risk and is not suitable for every investor. TradeReign is a trading-discipline and rule-enforcement application. It does not provide trading advice, trade signals, investment recommendations, or performance guarantees.
TradeReign is not a broker-dealer, futures commission merchant, or investment advisor.
Futures trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Only risk capital - money that can be lost without jeopardizing financial security or lifestyle - should be used for trading. Past performance is not necessarily indicative of future results.