Execution model
Separate strategy calculation from simulated order fills.
Understand when PineScript API evaluates a strategy, how market, stop, and limit orders are simulated, and how warm-up and trade windows work.
Public execution defaults
The close-only model determines when strategy logic runs. It does not mean that every order can only fill at the next bar open.
Calculation timing
Strategy logic is evaluated once after a chart-timeframe bar is complete. The public mode disables recalculation on live ticks and immediately after simulated fills, so unfinished-bar signals are not presented as confirmed historical decisions.
Fill timing
New market orders
A market order created from a completed-bar calculation fills at the next available simulated price by default.
Pending stop and limit orders
An order placed earlier may fill inside a later bar when that bar's OHLC range reaches the order price.
On-close processing
When supported and enabled, on-close order processing changes the fill timing. The resolved setting is recorded with the run.
No tick sequence
Without Bar Magnifier, the emulator does not know the actual intrabar tick path or whether the high or low happened first.
Trade window and indicator warm-up
The date range controls when new entries are allowed; it does not truncate indicator history. Earlier bars may load for moving-average, ATR, RSI, and other initialization. New entries are blocked before the start and after the end of the window, and an open position may be force-closed immediately after the window ends under the engine policy.