Run a backtest (bills one credit; idempotency supported)

post/v1/backtests

Request

  • Base URL: https://app.texttoquant.com/api
  • URL: https://app.texttoquant.com/api/v1/backtests
  • Auth: one of:
    • API key in header x-api-key
    • HTTP bearer

Headers

Idempotency-Keystring

Replay safe retries: same key + same body → the original run, no second credit.

Request body

parsedQueryParsedQuery required

The structured strategy returned by POST /v1/parse: pass verbatim to POST /v1/backtests.

savedIndicatorMappingobject

parsedName → saved indicator name (explicit timeConstraint dates required).

customIndicatorHintsstring[]
idempotency_keystring
waitboolean

false → 202 immediately after enqueue; poll /status.

Response

Run finished within the sync window

successtrue required
dataBacktestRow required

A saved run: scalar metrics (total_return, sharpe_ratio, max_drawdown, win_rate, …), grade, effective params (timeframe, stop_loss, fees_bps, …), edit lineage (strategy_session_id, iteration_label). winning_trades / losing_trades: on runs saved before 2026-08-30 the stored counts can be 0 beside a real win_rate; such rows are served with counts approximated as round(win_rate × total_trades / 100) and carry trade_counts_approximated: true. Rows with persisted counts never carry the field.

Changes

No recorded changes to this operation across all 1 revision of this API.