Skip to content

Command-line research

Everything in the gauntlet and the multi-instrument engines is available as a command, for scripting and unattended research. Run from backend/ with uv run python -m <module> …. The registry imports fresh each invocation, so a brand-new strategy file works without restarting the worker. CLI runs write the same BacktestRun rows the UI does, so results show up on the Backtests and Research tabs.

Terminal window
uv run python -m ats.research --strategy ibs_reversion --symbols SPY,TLT,GLD

Runs the whole evidence ladder for a strategy: rule test → split optimize (train window only) → WFO → a final run feeding the deflated Sharpe. For an intraday strategy, point it at the intraday catalog and charge the measured spread:

Terminal window
uv run python -m ats.research --strategy intraday_orb --symbols QQQ,SPY,DIA \
--bar-spec 1-MINUTE-LAST --slippage-bps auto --start 2023-04-01 --end 2026-06-12

--slippage-bps auto resolves to each name’s measured half-spread (daily runs default to 0, byte-identical).

Terminal window
uv run python -m ats.sweep

Runs a cheap rule-test screen across the whole basket and both timeframes, then the deep gauntlet on the survivors, and prints a ready-first leaderboard. It publishes progress + ETA to Redis, which the UI shows as a sweep progress bar. This is the “test lots of strategies, walk away” command.

Command What it does Doc
python -m ats.research The full single-instrument ladder the gauntlet
python -m ats.sweep Adaptive, unattended screen + gauntlet across the basket above
python -m ats.cross_sectional Cross-sectional rank/hold over a universe multi-instrument
python -m ats.intraday_relval Session-aware intraday relative value multi-instrument
python -m ats.pairs A cointegrated pair (with hedge β options) multi-instrument
python -m ats.pair_screen Discover cointegrated pair candidates multi-instrument
python -m ats.portfolio Blend validated sleeves multi-instrument
python -m ats.portfolio_search Search subsets × allocators for held-out Sharpe multi-instrument
python -m ats.book Faithful shared-account book backtest multi-instrument
python -m ats.overnight Overnight-effect study
python -m ats.paper / ats.live The paper / live trading runners paper, live
python -m ats.crypto_paper The local crypto paper simulator paper

python -m ats.cli <command> handles account and operational tasks (run from backend/):

Command What it does
create-user --username <you> Create the single dashboard account (prompts for a password).
reset-password --username <you> Set a new password (the login screen’s “Forgot password?” points here).
alert-test Send a test Telegram alert using the .env credentials.
approve-live --strategy <key> --instrument <id> --note "…" Record the audited go-live sign-off (the live runner refuses to start without it). See live trading.
revoke-live --strategy <key> --instrument <id> Remove a go-live approval.
ingest --symbol <sym> … Pull daily bars from Tiingo into the catalog (CLI ingest).