NRUNO Trading Automation Wiki · Question 57

What does barstate.isconfirmed do for TradingView alerts?

Pine Script & TradingView AlertsLast reviewed: 25 Aug 2026
Short answer

barstate.isconfirmed is true on historical bars and on the closing update of a realtime bar. It can be used to delay a chart-timeframe signal until bar confirmation, but TradingView notes that it does not work as a confirmation mechanism inside request.security().

What this means in practice

barstate.isconfirmed is true on historical bars and on the closing update of a realtime bar. It can be used to delay a chart-timeframe signal until bar confirmation, but TradingView notes that it does not work as a confirmation mechanism inside request.security(). This page is specifically about “What does barstate.isconfirmed do for TradingView alerts?”, so each scenario below is explained by its own mechanism instead of sharing one generic diagnosis.

Real-world scenarios

Scenario A — 15m close confirmation

Inspect the mechanism named by “Scenario A — 15m close confirmation” directly. Record its input, the state immediately before it and the first observable output that differs from the intended result. For Scenario A — 15m close confirmation on question 57, use that evidence specifically to answer “What does barstate.isconfirmed do for TradingView alerts?”; keep it separate from the evidence for the other scenarios on this page.

Scenario B — Realtime intrabar condition

Inspect the TradingView alert log during the still-open candle. Realtime recalculation can make the condition true several times; add explicit intrabar state or a per-bar guard if the strategy intends only one logical action. For Scenario B — Realtime intrabar condition on question 57, use that evidence specifically to answer “What does barstate.isconfirmed do for TradingView alerts?”; keep it separate from the evidence for the other scenarios on this page.

Scenario C — HTF request incorrectly uses isconfirmed

Inspect the mechanism named by “Scenario C — HTF request incorrectly uses isconfirmed” directly. Record its input, the state immediately before it and the first observable output that differs from the intended result. For Scenario C — HTF request incorrectly uses isconfirmed on question 57, use that evidence specifically to answer “What does barstate.isconfirmed do for TradingView alerts?”; keep it separate from the evidence for the other scenarios on this page.

What to check

  • active server-side TradingView alert instance
  • saved symbol, timeframe and inputs
  • realtime versus confirmed-bar behavior
  • exact message emitted by the active alert

Practical rule

For “What does barstate.isconfirmed do for TradingView alerts?”, change only the first layer whose evidence no longer matches the intended action. Preserve signal identity, timestamps and final cTrader state, and reproduce execution-affecting changes on demo before live use.

Decision summary

Direct answer: barstate.isconfirmed is true on historical bars and on the closing update of a realtime bar. It can be used to delay a chart-timeframe signal until bar confirmation, but TradingView notes that it does not work as a confirmation mechanism inside request.security().

Next action: Match the observed evidence to one scenario above, test that mechanism independently on demo and keep the result traceable with one signal ID.

Primary sources

Need a TradingView → cTrader execution route?

NRUNO routes your TradingView instructions to cTrader. Your strategy and signal logic remain yours.