Workflow
Architecture constraints
These are intentional. Do not propose changing them without a compelling reason.| Constraint | Why |
|---|---|
| No PyTorch / LSTM / deep learning | Hardware: Intel i3, 4 cores, 8 GB RAM. Training is already 2+ hours on CPU. |
No generic Exception(...) | Use typed exceptions from ml/exceptions.py for clean error handling. |
| No hardcoded thresholds | Everything reads from config.json or ml_config.json at runtime. |
| ONNX inference at runtime | 10–50× faster than sklearn/xgb/lgb native predict. |
| Warmstart by default | Incremental training preserves accumulated model knowledge. |
model_compat.json as source of truth | Single manifest for feature compatibility across all components. |
Code style
- Python 3.10+ type hints on new functions
- No docstrings on simple or obvious code
- No error handling for impossible conditions
- No backwards-compat shims — just change the code
- Validate only at system boundaries (user input, API responses)
What not to commit
Writing safe backtest changes
When modifyingbacktest/run.py, always verify parity with trading/bot.py:
- The backtester must simulate the exact same logic as the live bot
- Any filter added to the live bot must also be in the backtester
- SL/TP calculation must match exactly