Documentation
How the engine works.
The same pages the app ships with, from a first backtest to the strategy API.
To the pagesThe same pages the app ships with. How to run a first backtest, what the fill model assumes, the strategy API, and where to look when a number does not add up.
>Read https://engine.orionquant.com/llms-full.txt, the OrionQuant Engine documentation. Write the strategy against the API it describes, and validate it before anything runs.
Works in Claude Code, Codex, Cursor or any agent that can fetch a page.
01
Introduction
- Getting StartedOrionQuant Backtesting Engine tests trading algorithms on historical market data. It is built twice from the same interface: a desktop app, where the Python engine, the data cache…
- The InterfaceFour places do the work. The sidebar picks a destination, the Test view runs things, the evaluation under the chart says what happened, and the command palette reaches any of it…
02
Markets
- Asset ClassesForex, indices, crypto and equities do not behave the same, and a run that applies forex assumptions to a stock produces a number that is wrong and looks fine. This page says how…
- Costs and FillsEvery cost the engine applies, how it is calculated, and where the model stops.
- Data and AccuracyWhere prices come from, which instruments each way can serve, what each accuracy tier actually replays, and what happens when the data is not there.
- Instruments and Custom SymbolsThe engine refuses to price a symbol it does not recognise. That is deliberate: a stock ticker priced as if it were a currency pair produces a result that looks fine and is…
- Worked ExamplesOne trade per asset class, end to end, with the arithmetic. Every figure comes from the contract spec the engine holds for that instrument and the formulas on Costs and Fills, so…
03
Running a test
- BacktestingThe engine is event driven. For each timestamp it releases the bar onto a time ordered queue and drains it fully before time advances. Orders created on a bar's close become…
- OptimizationAn optimization is many backtests over a grid or an evolving population of parameters. Flag the parameters to optimize, set their ranges, choose criteria, and run. Every pass uses…
- Portfolio RunsA portfolio run trades several instruments on one account. It is not several runs added together, and the difference is the point: separate runs never compete for margin and never…
- Charts and DrawingsThe chart in the Test view is the run. Candlesticks, the trades the strategy took, and the indicators it declared all appear on it once the run completes. Before that it is empty…
- TerminalThe Orion Financial Terminal shows the market and the macro picture around your instruments in panels, and every series it shows can be read by a strategy. It is coming soon: in…
04
Writing strategies
- Strategies APIA Python strategy subclasses Strategy and implements on_bar(self, ctx), called once per completed bar. The context releases data with no lookahead and is the only surface a…
- Indicators APIIndicators are computed causally by the engine, drawn on the chart, and readable by a strategy. The four built ins below have their own short calls; every indicator of the library…
- Indicator library86 indicators in 7 groups, each computed by the engine with no lookahead, drawn on the chart and read by a strategy by its id. Where TA-Lib has an indicator it follows TA-Lib's…
- Pine ScriptA Pine Script v5 or v6 strategy from TradingView runs here as it is, on every plan. The engine compiles it to its own strategy format, so it backtests, optimizes over its inputs,…
- BlocksA strategy built from blocks on a canvas, without code, on every plan. The blocks compile to the engine's own strategy format, the same one Pine compiles to, so a blocks strategy…
- RustA strategy can be written in Rust, with the whole language: your own structs, enums and traits, closures, iterators, Vec, HashMap and the rest of the standard collections, and the…
- Plugins APIA plugin is a manifest (plugin.json) plus a Python entry point. It runs in a sandbox inside the engine: it may import a vetted set of modules, reach the network through urllib,…
- Plugin library31 plugins written by OrionQuant as templates: data sources that fetch keyless public data before a run, indicators, strategy templates and exporters. None is switched on by…
- External DataA backtest can pull in data beyond price bars: an economic news calendar and any data a plugin fetches. Both are fetched when you tick Fetch external data (news and plugin feeds),…
- AI AssistantThe assistant answers questions about the code in front of you and about this documentation. It is a desktop feature: the key that answers lives in the main process, and the…
- Connect AI appsAn AI app such as Claude, ChatGPT or Cursor can work with OrionQuant in two ways, and they reach different things. AI apps on this computer reads this installation. AI apps in the…
05
Account and community
- CommunityThree views share one account: the Marketplace, the Forum and the Leaderboard. They need a session, so the guest preview cannot open them.
- Account and PlansThe account menu at the foot of the sidebar opens the account area. Profile is who you are and how you sign in, and Billing is what your account may do and what it costs.
06
