- OpenBacktesting
- Python Backtesting Framework and Strategy Guide
OpenBacktesting: Python backtesting framework¶
Write a Python strategy, run it on historical OHLC data, and inspect trades and performance. This manual is for people using the framework.
Run your first backtest → — a complete script using bundled data, with no data download or application integration required.
Choose your next task¶
How the pieces fit¶
- Prepare a pandas DataFrame containing one asset's bars.
- Define a
Strategy: register indicators ininit(), read the current bar and place orders innext(). - Construct
Backtest(data, MyStrategy, ...)and call.run(...). - Read statistics and execution tables, or export a Portfolio report.
Order tracks a request, Trade tracks one filled lot, and Position summarizes open exposure. An order normally executes at the next bar's open. Indicator values can be invalid during initial history; your strategy checks them before acting.
Tutorials and scope¶
First backtest · Trading rules · Indicator recipes · Runnable examples
The engine models one asset and one settlement currency per run. The core package exports plotting data without a chart renderer; the optional Studio supplies the local web interface. There is no live-trading connection. See supported boundaries before interpreting results.
