Installation¶
Requirements¶
- Python 3.12 or higher
- Polars
- PyYAML
- NumPy
- Pydantic
Install from PyPI¶
Or with uv:
Install from Source¶
Verify Installation¶
from ml4t.backtest import Engine, Strategy, DataFeed, BacktestConfig, run_backtest
from ml4t.backtest import StopLoss, TakeProfit, TrailingStop, RuleChain
print("ml4t-backtest installed successfully!")
Optional Dependencies¶
Trading calendars for session enforcement (skip weekends/holidays):
ml4t-diagnostic for post-backtest analysis (tearsheets, trade analytics):
Next Steps¶
- Quickstart -- build and run your first backtest