TradeReign
Back to HomeEducation HubCompatibilityAboutDisclosures
TradingView Indicators

TradingView Pivot High Confirmation Right bars, plot offsets, and alert timing

A pivot high can appear on an earlier candle after TradingView has processed later candles. To review a signal accurately, record the bar where the high occurred and the later close when the right-side window was complete.

Quick Answer

For a close-confirmed Pine pivot high, wait for the candle at the end of the Right bars window to close. With two right bars, a pivot on a five-minute bar ending at 9:45 a.m. ET confirms at 9:55 if both subsequent highs stay below it in this example. A plot offset of −2 can display the confirmed value on the earlier candle.

Start 7-Day TrialCompare two and five right barsCopy the Pine example

When does a TradingView pivot high confirm?

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.

The pivot stays at 9:45 while confirmation moves

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.

Plot confirmation on the current bar in Pine

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.")

Check the alert time against the confirming bar

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.

Sources

Official References

Platform details on this page were checked against these official resources.

TradingView on plotting pivots in the pastExplains why a pivot is detected on a later bar and can be shown at its earlier location.TradingView Pine visual offsetsExplains negative offsets and the pivot examples.TradingView Pine alert conditionsExplains condition selection, alerts at bar close and the alert’s saved settings.
Related Guides

Keep Building the Rule System

Check equal swing highs in NinjaTrader

Compare the pivot location and confirmation time when the highs tie or differ by one tick.

Check a TradingView Zig Zag projection

Compare a potential pivot with a leg that clears the reversal threshold.

Compare NinjaTrader Swing Strength

Check the same delayed confirmation using Strength 2 and Strength 5.

Update an alert that still uses old Pine settings

Replace its saved script and input configuration.

Move through a historical chart bar by bar

Check when a marker first appears rather than reading a finished chart.

FAQ

Common Questions

Why does TradingView show a pivot on an earlier candle?

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.

Do two right bars mean a pivot confirms on the next candle?

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.

Risk Disclosure

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.