{"repo":"ml4t/backtest","free":true,"listed":false,"github":"https://github.com/ml4t/backtest","clone":"git clone https://github.com/ml4t/backtest.git","description":"Event-driven backtesting engine with realistic execution, portfolio, and risk modeling.","language":"Python","stars":22,"topics":["algorithmic-trading","backtesting","event-driven","execution-modeling","finance","machine-learning-for-trading","ml4t","portfolio","python","quantitative-finance"],"license":"MIT","category":"trading","readme_excerpt":"ml4t-backtest Event-driven backtesting engine for quantitative trading strategies with realistic execution modeling. Part of the ML4T Library Ecosystem This library is one of six interconnected libraries supporting the machine learning for trading workflow described in Machine Learning for Trading: Together they cover data infrastructure, feature engineering, modeling, signal evaluation, strategy backtesting, and live deployment. What This Library Does Backtesting requires accurate simulation of order execution, position tracking, and risk management. ml4t-backtest provides: - Event-driven architecture with point-in-time correctness (no look-ahead bias) - Exit-first order processing matching real broker behavior - Configurable execution modes (same-bar or next-bar fills) - Quote-aware execution and marking with price , bid, ask, midpoint, and side-aware sources - Position-level risk rules (stop-loss, take-profit, trailing stops) - Portfolio-level constraints (max positions, drawdown limits) - Cash, margin, and crypto account policies - First-class trade, fill, and portfolio-state export for audit and downstream analysis - 40+ behavioral knobs for framework-specific parity The same Strategy class used in backtesting works unchanged in ml4t-live for production deployment. Installation Quick Start Each Engine instance is single-use. Create a new instance for every independent run. bar[\"price\"] follows FeedSpec.price col when you provide one, so the same strategy works for close-","default_branch":null,"files":null,"tree":[],"storefront":"/r/ml4t","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/ml4t/backtest/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}