Detailed command examples for the backtesting CLI live here so run.py can
stay a small entry point instead of a large in-file manual.
- Install dependencies:
pip install -r requirements.txt - Download cached data:
python run.py --download ES NQ YM RTY CL GC YM SI - Validate cache:
python run.py --validate-datapython run.py --validate-data YM --tf 5m - Run a backtest:
python run.py --backtest --strategy sma_pullback --symbol ES --tf 1h - Open the dashboard:
python run.py --dashboard
Current examples:
sma_pullbackfor trend-following pullback entriesict_obwith aliasict_order_block- additional strategies are discoverable through
python run.py --help
Preloaded in instrument_specs; unknown symbols fall back to generic defaults.
ES,NQ,YM,RTYfor US equity index futuresCL,NGfor energyGC,SI,PLfor metals (PLdata quality may be poor)ZC,ZBfor grains and bonds6Efor CME FX futures
python run.py --download 6E 6B 6J 6A 6C 6S
python run.py --validate-data
python run.py --validate-data YM
python run.py --validate-data YM --tf 5mpython run.py --backtest --strategy channel_breakout --symbol 6A --tf 30m --dashboard
python run.py --backtest --strategy rfp_fractal --symbol NQ --tf 1h --dashboardpython run.py --wfo --strategy three_bar_mr --symbol YM --tf 1hpython run.py --portfolio-backtest --dashboard
python run.py --portfolio-backtest --portfolio-config path/to/config.yamlpython run.py batch --strategies diamond_breakout --symbol ES NQ YM RTY CL NG GC SI 6E 6B 6J 6A 6C 6S --tf 5m 30m 1h
python run.py batch --strategies kc_breakout --symbol ES NQ YM --tf 1m 5mpython run.py wfo-batch --strategies sma_pullback ict_ob --symbol ES --tf 1h
python run.py wfo-batch --strategies sma_pullback --symbol ES NQ CL GC YM RTY --tf 1hpython run.py --dashboard
python run.py --dashboard --dashboard-port 8080- Strategy IDs and aliases are interchangeable on the CLI.
--tfuses the same timeframe labels as cache filenames, such as30m,1h,4h, and1D.batchandwfo-batchaccept multiple--symboland--tfvalues.--workers Noverrides the process-pool size for batch modes.- Settings can be overridden with
QUANT_BACKTEST_environment variables or a local.envfile.