# OpenBacktesting > Python framework for historical, bar-by-bar backtesting with indicators, orders, trades, optimization, and portfolio reports. Each run models one asset and one settlement currency. The package exports plotting data but does not include a chart renderer or live-trading connection. Read the quickstart and limitations before adapting examples. Indicators may be invalid during warmup; check validity before using values. Follow the Markdown links below. The indicator catalog links to each indicator's parameters, outputs, and runnable example. ## Start here - [Python Backtesting Framework and Strategy Guide](https://docs.openbacktesting.com/index.md): Build and test Python trading strategies with OpenBacktesting. Learn historical backtesting, technical indicators, order execution, optimization, and portfolio reports. - [Your first backtest](https://docs.openbacktesting.com/quickstart/index.md): This example buys one unit when a fast EMA crosses above a slow EMA, closes it on the reverse crossing, and prints performance and trades. It uses bundled historical GOOG data. - [Runnable examples](https://docs.openbacktesting.com/examples/index.md): Start with the first backtest for a complete copyable script. The examples below are included in a source checkout or source distribution. An installed wheel includes sample data… - [Supported boundaries](https://docs.openbacktesting.com/limitations/index.md): The engine backtests one asset in one settlement currency per run, with linear margin and contract multiplier 1. MultiBacktest runs independent accounts; a Portfolio report… ## Guides - [Write a strategy](https://docs.openbacktesting.com/guides/author/index.md): Start with the complete EMA crossover strategy. A strategy subclasses Strategy; you provide init() and next(), and Backtest supplies the account and data. - [Prepare and read market data](https://docs.openbacktesting.com/guides/data/index.md): Pass one asset's chronological OHLC bars as a pandas DataFrame. Exact columns are Open, High, Low, Close, and optional Volume. Prices must be finite and positive; index values… - [Use indicators in a strategy](https://docs.openbacktesting.com/guides/indicators/index.md): Register formulas in init() through self.ta. Consume their current values in next() only after checking the selected channel's validity. The complete indicator strategy… - [Configure strategy parameters](https://docs.openbacktesting.com/guides/inputs/index.md): Declare fields with inputs.int, float, bool, string, price, time, session, color, or enum. Each needs a unique title and default. Read it in the strategy as a normal self… - [Compare and save parameter runs](https://docs.openbacktesting.com/guides/optimizer/index.md): Choose Backtest.optimize when you want the highest-scoring result. Choose runtime.optimize when you want a persistent report for every candidate and later ranking/filtering. - [Add strategy visuals](https://docs.openbacktesting.com/guides/plotting/index.md): The framework collects plotting declarations and exports their data. It does not include a chart renderer. The complete plotting example adds an EMA, an RSI pane, a level, and… - [Read backtest results](https://docs.openbacktesting.com/guides/results/index.md): Backtest.run, run_inputs, and runtime.run return a pandas Series. Start with summary statistics, then inspect trades and the equity curve to understand the run. - [Run a strategy](https://docs.openbacktesting.com/guides/runtime/index.md): For a Python script or notebook, construct Backtest(data, MyStrategy, ...) and call run(...). For a reusable strategy file carrying default settings, declare @backtest(...) and… - [Understand order execution](https://docs.openbacktesting.com/guides/trading/index.md): A submitted Order is a request, a filled Trade is a lot, and Position aggregates the currently open lots. The trading reference contains order parameters and examples for… ## API reference - [Maintainer API inventory](https://docs.openbacktesting.com/reference/classification/index.md): This inventory supports API auditing. Start with the user manual for usage. - [Colors](https://docs.openbacktesting.com/reference/colors/index.md): Import Color and colors from openbacktesting. Colors are immutable RGBA values used by plotting and color inputs. - [Backtest: run and optimize](https://docs.openbacktesting.com/reference/core/index.md): Use Backtest to run a Strategy subclass against one asset's historical data. Import both from openbacktesting. Start with the complete first backtest if you do not have a… - [Market data, timeframes, and instruments](https://docs.openbacktesting.com/reference/data/index.md): Backtest accepts a pandas DataFrame for one asset. Load and clean your data before constructing the backtest. - [Account snapshots and execution events](https://docs.openbacktesting.com/reference/events/index.md): Use snapshots to inspect current account state and callbacks to react to actual order changes. These values are created by the framework and are read-only. - [Reusable strategies and analysis helpers](https://docs.openbacktesting.com/reference/helpers/index.md): Import helpers from openbacktesting.lib. Use the base strategies to reuse signal execution or trailing-stop behavior, and the functions for resampling or analyzing results. - [Indicators: calculate, compose, and read values](https://docs.openbacktesting.com/reference/indicator-api/index.md): Use self.ta inside Strategy.init() for built-in indicators, self.ind for a custom function, and indicators.compute for a calculation outside a backtest. Browse the indicator… - [Indicator catalog](https://docs.openbacktesting.com/reference/indicators/index.md): Choose from 244 callable indicators. Each page contains a complete example, parameter meanings, and named outputs. - [Strategy parameters](https://docs.openbacktesting.com/reference/inputs/index.md): Use openbacktesting.inputs to declare configurable class attributes. Read the resolved values as self.length, self.enabled, etc. inside your strategy. Parameters are read-only… - [Saved parameter experiments](https://docs.openbacktesting.com/reference/optimizer/index.md): Use runtime.optimize to save a complete Portfolio for every parameter combination to a local SQLite file. Reopen that file to rank, filter, or inspect reports without rerunning… - [Plot declarations and export](https://docs.openbacktesting.com/reference/plotting/index.md): self.plotting describes strategy visuals: lines, histograms, levels, fills, markers, and bar colors. The package exports their data; it does not open or render an interactive… - [Portfolio: read and save a complete report](https://docs.openbacktesting.com/reference/portfolio/index.md): Backtest.run() returns a pandas statistics Series. The openbacktesting.portfolio module exports a complete report as plain values, suitable for JSON, applications, and later… - [Decorated strategies and runtime](https://docs.openbacktesting.com/reference/runtime/index.md): Use @backtest plus runtime.run when a strategy file should carry its default execution settings. For a script or notebook that constructs the run itself, Backtest is the shorter… - [Strategy: define trading logic](https://docs.openbacktesting.com/reference/strategy/index.md): Subclass openbacktesting.Strategy and implement init() and next(). Pass the class to Backtest; the framework creates instances. A strategy normally computes indicators once and… - [Orders, positions, and trades](https://docs.openbacktesting.com/reference/trading/index.md): An Order is a request; a Trade is one filled lot; Position summarizes all open lots. Obtain them from self.buy/sell, self.trades, and self.position. Do not construct these… ## Optional - [Provenance and validation records](https://docs.openbacktesting.com/build-info/index.md): The current distribution and import identity is openbacktesting, version 0.2.0. Read this manual as Markdown or build the documentation site with uv run --locked --group docs… - [Deploy the documentation to Cloudflare Pages](https://docs.openbacktesting.com/deployment/index.md): The documentation builds to a static site with navigation, page outlines, and browser-side full-text search. No application server or search service is required. - [Core development and validation](https://docs.openbacktesting.com/development/index.md): Public behavior changes require corresponding updates to guides, API references, runnable examples, and validation. Runtime source lives under src/openbacktesting/, divided into… - [Extraction acceptance record](https://docs.openbacktesting.com/extraction-verification/index.md): Independent package extraction and acceptance completed on 2026-10-12. Validation covered macOS ARM64 and Python 3.12.12; this record does not imply acceptance of other Python… - [Full documentation](https://docs.openbacktesting.com/llms-full.txt): Combined manual and runnable example sources; large context. - [Sitemap](https://docs.openbacktesting.com/sitemap.xml): Canonical HTML documentation URLs.