“The signal appeared on this candle” is incomplete. A specification needs three separate times: when the condition is confirmed, when the simulation fills an order and when an alert is emitted.
Clock 1: signal confirmation
An open candle can change before it closes. A condition that is true intrabar may no longer be true at the close. TradingView describes several forms of repainting; not every changing visual is misleading, but the intended behavior must be clear.
For a closed-bar design, require confirmation at the intended timeframe. Higher-timeframe data needs separate treatment: confirming the chart bar alone does not establish that the higher-timeframe candle has closed. Document the data request and its timing. TradingView's repainting guide ↓
Clock 2: simulated order execution
A signal marker and a simulated fill are different events. With default strategy timing, an order created at a bar's close is eligible to fill on a later tick, commonly the next bar's open. Settings can change this behavior, so keep them with the results rather than assuming a screenshot explains them.
Conceptual sequence, not a latency measurement. Commission and slippage assumptions also belong in the strategy settings.
Clock 3: alert emission
An alert event has its own condition and frequency. TradingView's alert documentation distinguishes script alert calls and strategy order-fill events. Decide which event the message represents. An alert saying “condition confirmed” should not be presented as proof that a broker filled an order.
For any external execution workflow, keep identifiers and timestamps in the message, and define how the receiving system handles duplicates, stale events and rejection. Those are integration requirements, not features supplied by a chart marker.
Turn timing into acceptance examples
- A condition appears intrabar, then disappears before close: should an alert exist?
- A condition is confirmed, but the next bar opens at another price: which price belongs in the simulation?
- A higher-timeframe value is still changing: can the rule act on it?
- The same event arrives twice at a receiver: what prevents a duplicate action?
Write the expected answers before coding. This makes “matches the strategy” a reviewable statement instead of a visual impression.
Primary references
References reviewed 28 October 2026. Original exercises and project-specific observations are identified separately.
Keep exploring
Explore Pine Script development ↗Educational engineering and research guidance. Examples do not establish a profitable or live-ready trading strategy.