Backtesting on Tektii
Tektii runs your strategy against historical market data on a hosted platform at api.tektii.com. You package a strategy as a Docker image, register it as a version, then run scenarios — backtests over a chosen instrument set and time window — and read the results. Nothing runs on your machine: the platform executes the run in the cloud and stores the output.
Backtesting is a separate concern from going live. When you're ready to trade a strategy against a broker, that's the Trading Gateway — a component you self-host. This section is only about backtesting on the hosted platform.
How a backtest works
A backtest moves through four stages: config → scenario → states → results.
- Config — A config is a reusable saved preset: the instrument subscriptions, the time window, position mode, initial capital, and the cost model. Save it once and run it many times. See Scenario Config for every field.
- Scenario — A scenario is a single run of that config against a specific strategy version. Submitting a run is asynchronous — it returns immediately with an id.
- States — A scenario advances
QUEUED → PENDING → RUNNING, then settles in one terminal state:COMPLETE,FAILED, orCANCELLED. You poll until it's terminal. (The success state isCOMPLETE, notCOMPLETED.) The full state machine is in the Commands Reference. - Results — A
COMPLETEscenario has results: return, drawdown, Sharpe, and per-trade stats. See the Results Reference for the full schema, or view them as charts in the web app.
Two ways to drive it
The CLI and Claude Code are peers — the same hosted API underneath, so pick whichever fits your workflow. Both authenticate with the same API key.
The tektii CLI
The command-line path — scriptable and CI-friendly.
- Install — macOS, Linux, or Windows.
- Authenticate — set up your API key.
- Write Workflow — push a Docker image (or start from a platform template) as a new version.
- Read Workflow — list strategies, run scenarios, and download results.
- Commands Reference — every command and flag.
Claude Code (MCP)
The conversational path — register a version, kick off a backtest, and read the results entirely in chat.
- Use with Claude Code — connect the Tektii MCP server and run the full loop from a prompt.
Configure and constrain a run
These reference pages cover what goes into a config and the platform's boundaries:
- Scenario Config — every configurable field, with CLI and MCP examples.
- Available Instruments — the catalog of instruments you can subscribe to.
- Execution & Costs — how fills, spread, commission, slippage, and funding are modelled.
- Plan Limits — per-plan quotas on runs, history, and concurrency.
Run into problems? See Troubleshooting.