Create backtest
run_id and initial status.
Request body
List of ticker symbols to backtest (1-100 symbols)Example:
["AAPL", "MSFT", "GOOGL"]Backtest start date and time in ISO 8601 formatExample:
"2023-01-01T00:00:00Z"Backtest end date and time in ISO 8601 formatExample:
"2023-12-31T23:59:59Z"Data resolution for the backtestOptions:
tick, second, minute, hour, dayStarting capital for the backtest (must be > 0 and ≤ 1 trillion)Example:
1000000.0Currency code (3-5 uppercase letters)Example:
"USD", "EUR", "GBP"Timezone for date/time interpretation (max 64 chars)Example:
"America/New_York", "Europe/London"Response
Unique identifier for the backtest run
Current state of the backtestValues:
queued, running, completed, failedCompletion progress (0.0 to 1.0)
Timestamp when the backtest was created
Timestamp when the backtest started running (null if not started)
Timestamp when the backtest finished (null if not finished)
Error message if state is
failed (null otherwise)List backtests
Query parameters
Filter by backtest stateOptions:
queued, running, completed, failedMaximum number of results to return (1-200)
Response
Returns an array of backtest status objects (same schema as create backtest response).Get backtest
Path parameters
Unique identifier of the backtest run
Response
Returns a backtest status object (same schema as create backtest response).Get results
Path parameters
Unique identifier of the backtest run
Response
Unique identifier for the backtest run
Key performance metrics as key-value pairsCommon metrics:
total_return: Total return percentagesharpe_ratio: Risk-adjusted return metricmax_drawdown: Maximum peak-to-trough declinewin_rate: Percentage of profitable tradesprofit_factor: Gross profit divided by gross loss
Array of equity data points over timeEach point contains:
timestamp: Date/time of the data pointequity: Portfolio value at that timecash: Cash balancepositions: Total value of positions
Array of executed tradesEach trade contains:
symbol: Ticker symboltimestamp: Execution timeside:buyorsellquantity: Number of shares/unitsprice: Execution pricecommission: Commission paid
Array of position exposure snapshots over time
Array of log messages from the backtest execution
Stream backtest
Path parameters
Unique identifier of the backtest run
Query parameters
API key for WebSocket authentication (alternative to header-based auth)
Resume from events after this ID (for reconnection)
Authentication
WebSocket connections support three authentication methods:- Query parameter:
?api_key=your-api-key - Authorization header:
Authorization: Bearer your-api-key - Custom header:
X-API-Key: your-api-key
Event types
The WebSocket emits events with the following structure:Unique sequential ID for this event
Backtest run identifier
Event typeValues:
log, progress, metric, stateWhen the event occurred
Event-specific data
logevents:{"message": "..."}progressevents:{"progress": 0.45}metricevents:{"name": "sharpe_ratio", "value": 1.23}stateevents:{"state": "running", "previous_state": "queued"}
Connection lifecycle
- Client connects with authentication credentials
- Server validates API key and checks if run exists
- Server sends any events after
last_event_id(backlog replay) - Server subscribes client to live events
- Client receives events as they occur
- Connection closes when:
- Client disconnects
- Authentication fails (policy violation)
- Run not found
- Server error
Error handling
WebSocket connections close with specific codes:1008 Policy Violation- Authentication failed or run not found1000 Normal Closure- Clean disconnect