Verify before going live
Always run these checks before your first live session.Recommended first command:
python scripts/onboarding.py --balance 500 --profile 1|2|3|4|5.
Onboarding sets your risk profile in config.json and can pull model files from R2.
For user setups, skip the optional first optimization prompt.Model compatibility check
True OOS backtest
Dry-run
The--dry flag is diagnostic-only. It runs the full logic — candle fetch, feature engineering, signal generation, filter pipeline — but keeps all external side effects disabled.
In --dry mode:
- No real orders are sent.
- No close/SLTP requests are sent.
- No Telegram messages are sent.
- Telegram command bot is not started.
- No Supabase writes are made.
- No runtime CSV/state files are written.
Go live
What happens on startup
- Loads config from
.env,config.json,ml_config.json - Checks
model_compat.jsonfor feature compatibility - Auto-pulls models from R2 if
models/ensemble_rf.onnxis missing - Connects to MT5 API (
/ping,/account) - Loads ONNX models into memory
- Measures MT5 API latency (local round-trip + broker latency)
- Sends a startup Telegram message with balance, API status, and active filters
- Starts the main loop (~60s cycle)
PM2 (recommended for production)
PM2 handles auto-restart on crash and reboot persistence.Start
Manage
What the main loop does
Every ~60 seconds:- Market open check — timezone-aware session filter
- Fetch 250 BTCUSD M15 bars from
/symbols/BTCUSD/rates - Feature engineering — computes all 56 features
- Inject live news — overwrites session/news features with live values
- Get signal — RF + XGBoost + LightGBM vote (requires ≥2/3 + conf ≥60%)
- Apply filters — ATR floor, news block, EMA trend, circuit breaker
- Execute —
POST /orderswith SL=0.8×ATR, TP=0.8×ATR, 2% equity risk - Monitor positions — position model checks open trades: HOLD / EXIT / ADD
- Notify (live only) — Telegram + Supabase sync
Log files
These are written during live runs (not in--dry mode):