Submit Backtest
submit_backtestSubmits a strategy for backtesting against historical OHLCV data. Returns immediately with an id and status — call get_backtest_result to fetch the outcome once it finishes. Testing the same strategy against many assets? Use submit_backtest_batch instead — one call per asset here adds up fast. Optionally accepts confirmationSources to only count a candidate Entry/Exit as a real trade once corroborated by a submit_confirmation_source result (multi-timeframe or cross-asset confirmation) — see the confirmationSources argument and submit_confirmation_source's own description.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| assetPair | No | e.g. "BTC-USDC". | |
| finalDate | No | ISO date string, e.g. "2025-06-01". | |
| initialDate | No | ISO date string, e.g. "2025-01-01". | |
| backtestApiKey | No | Your EmidLabs backtest API key (created in the Console). Not needed if this connector was added with a static 'x-api-key' header. | |
| backtestBaseUrl | No | Defaults to the public production API. Override only for self-hosted/staging use. | |
| confirmationSources | No | Optional. Each entry names a submit_confirmation_source result (same account only, must already be Completed) that every candidate Entry/Exit must be corroborated by before it's simulated as a trade — an unconfirmed candidate is dropped before trade simulation, never appears in get_backtest_trades or affects PnlR/WinRate/etc. See ConfirmedSignalsCount/UnconfirmedSignalsCount on get_backtest_result. A sourceId that doesn't exist, isn't Completed, or belongs to another account fails this submission immediately (unlike live, this is synchronous/batch — letting it through would produce a confusing zero-trade result with no explanation). | |
| strategySnapshotJson | No | The Strategy DSL object — every field below documents its own exact shape, this is just the execution model that ties them together. Entry fills at the close of the candle where decision.entry turns true (no lookahead). A position closes on the first of these to happen, checked in this order: stop-loss hit, take-profit hit, decision.exit turning true (a same-candle stop/take-profit always wins over exit). Multiple positions can be open at once by default — cap with configuration.maxOpenPositions. Results are measured in R-units (risk multiples); expectancyR (average R per trade) is the metric to optimize, not raw win rate or trade count. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | ||
| status | No |