Strategy Lifecycle Flow
AQE owns a StrategyState and runs the strategy in a predictable order:
on_start(ctx)for one-time startup.universe(ctx)for static or inline symbol selection.- registered universe models for modular symbol selection.
- asset metadata loading for the final merged universe.
init(ctx, asset)once for each tradable asset.- per-bar history updates, indicators, alpha models, strategy callbacks, and insight pipes.
on_teardown(ctx)for shutdown cleanup.
Lifecycle logic blocks wrap the generated or inline strategy lifecycle methods. Universe models contribute symbols to the final universe.
Current Backtest Flow
Section titled “Current Backtest Flow”The runtime backtest flow follows the implementation in StrategyState::run_backtest:
// 1. strategy.on_start(ctx)// 2. load_universe() -> strategy.universe() -> broker.get_ticker_info()// 3. alpha.start() per alpha// 4. load_init() -> OnInit lifecycle logic -> strategy.init per asset// 5. alpha.init(asset) per alpha per asset// 6. broker.load_backtest_data()// 7. loop: broker step -> on_bar() -> optional insight generation -> run_insight_pipeline()// 8. strategy.on_teardown(ctx)// 9. return BacktestResultsGenerated AQS projects follow the same runtime order. The difference is that AQS generates parts of the strategy body from the node graph before AQE executes the strategy.
Essential cookies and storage
We use essential cookies and storage for sign-in, account security, colour theme preferences, this notice, and required PostHog internal usage, session quality, and reliability metrics. We do not use advertising cookies.
