Live Trading Differences in Initialization and Persistent Strategy State
Summary
The document explains two differences between backtests and simulated or live trading in a notebook-based platform. In the described live modes, the initialization function runs during each trading period, whereas a backtest runs it once. It also says ordinary context variables assigned on one day do not persist into later trading periods in live or simulated execution, even though a backtest may retain them across periods.
For values that must survive across trading days, the post recommends storing them in a dedicated extension area of the context object. It says other method usage is generally shared between modes, while cautioning that these lifecycle and state differences can change trading details. The explanation is platform-specific and does not show a complete strategy or provide a reproducible example beyond the variable-storage illustration. It gives no measured trading results or account of how persistence behaves across restarts.
Key ideas
- The platform runs initialization once per trading period in simulated and live modes, but once per backtest.
- Ordinary context variables may not persist from one live trading period to the next.
- The post recommends a dedicated context extension store for values that must carry across days.
- Differences in initialization and variable lifetime can alter execution behavior across modes.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.