Runtime lifecycle
Use this lifecycle for a strategy:Rules that apply to every market
- Load full history in
init_market_data, not on every bar. - Initialize custom
contextfields before reading them. - Keep
handle_datafocused on signal checks and orders. - Do not use future data or future-return fields to create a signal.
- Do not call chat tools such as
set_backtest_paramsorrun_backtestfrom strategy source. - Check for missing data and return explicitly instead of hiding errors.
Market-specific differences
For minute strategies, the backtest frequency is
1M. The history API may use a different spelling such as 1m; do not confuse the task frequency with the data query period.
