A chart becomes visually final after the candle closes. During the candle, price and indicator values can cross, reverse, and disappear. If an EA acts on that moving state, its decision may not be visible in the same form later.
Six reviewed briefs explicitly referred to a new-bar or candle-close event. The repeated engineering need was a stable boundary: decide once, with information that can be reconstructed afterward.
When the EA makes its decision
An open candle can still change. The closed-candle path waits for the final bar, reads it once, and then sends a valid setup to the risk controls.
- 01Open candleValues may change on every tick and a visible state can disappear before close.
- 02Close eventThe candle receives a final time, price range, and indicator state for that bar.
- 03SnapshotThe EA reads the selected closed bars and records one synchronized decision.
- 04Next actionA valid setup proceeds to risk permission; an invalid one waits for another event.
What it solves
Closed-bar logic prevents the EA from treating a temporary intrabar cross as a final signal. It also makes historical and live decisions easier to compare because both can refer to the same completed bar.
It works best with an explicit one-decision-per-bar rule. Without that guard, the first tick of the new candle may still trigger repeated evaluation or duplicate orders after a restart.
What it does not solve
Waiting for the close introduces delay and may produce a worse entry. It does not prevent slippage, gaps, repainting of older history, bad data, or a weak strategy. It only fixes the information boundary used for the decision.
For higher timeframes, the policy must be stated separately. A lower candle can close while the current higher candle remains open. Reading higher bar zero at that moment is still intrabar logic.
A complete rule
A complete sentence looks more like this: on the first valid tick of a new lower-timeframe candle, read the last completed candle from every required timeframe, evaluate once, and ignore further ticks until the next permitted event.
The exact timeframes and conditions change by strategy. The value comes from saying when information becomes final and when the system is allowed to act.
Questions you may have
Does closed-bar logic prevent repainting?
It prevents acting on changes within the selected open bar. It cannot stop an indicator from recalculating older bars if that is how the indicator is designed.
Is closed-bar logic suitable for scalping?
Sometimes, but the delay may matter more. The choice should match the strategy horizon and be tested with realistic execution.