Backtesting.py is a Python backtesting engine for evaluating trading strategies against historical market data.
The tool addresses the need to test algorithmic trading strategies before deploying them with real capital. It works by simulating trades on historical OHLC candlestick data, executing strategy logic against past prices, and calculating performance metrics. The engine handles position management, trade accounting, and result analysis automatically, allowing developers to focus on strategy logic rather than simulation mechanics.
Backtesting.py suits traders and quantitative developers who want a lightweight, straightforward way to validate strategies without external dependencies on specific indicator libraries. The tool works with any financial instrument that has candlestick data and remains agnostic about which indicators you use, letting you bring your own from any library. It includes a built-in optimizer for parameter tuning and provides a library of composable base strategies to build upon. The README references alternatives but does not make direct comparisons.
The project maintains high code quality with comprehensive test coverage and fast execution performance. Documentation is thorough and accessible through both a project website and inline API references. The tool is actively maintained with responsive engagement on the discussion board, and contributors are directed to clear guidelines for reporting issues and submitting improvements.