Skip to main content
POST
/
v1
/
backtest
Post Backtest
curl --request POST \
  --url https://api.polyquantlab.com/v1/backtest \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "strategy": {},
  "event_type": "<string>",
  "ticker": "<string>",
  "since": "2023-11-07T05:31:56Z",
  "until": "2023-11-07T05:31:56Z",
  "market_limit": 50
}
'
{
  "job_id": "bt_8421ae0c",
  "status": "queued",
  "submitted_at": "2026-06-06T03:54:11+00:00",
  "strategy": {
    "type": "threshold_entry",
    "threshold": 0.3,
    "direction": "below",
    "side": "buy_yes"
  },
  "params": {
    "position_size": 7.5,
    "fill_mode": "walk_book",
    "max_fill_price": 0.985,
    "taker_fee_rate": 0.072
  },
  "universe": {
    "ticker": "BTC",
    "event_type": "5m",
    "market_limit": 50
  },
  "result": null,
  "error": null
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

wait_for_result
boolean
default:false

If true, hold the HTTP connection until the backtest finishes (up to 30 s) and return the completed result inline — like a synchronous endpoint. If 30 s isn't enough, you'll get a 504 with the job_id so you can poll GET /v1/backtest/{job_id} instead. Use false (default) for UI / long jobs.

Body

application/json
strategy
Strategy · object
required
Examples:
{
  "direction": "below",
  "side": "buy_yes",
  "size_usd": 100,
  "threshold": 0.3,
  "type": "threshold_entry"
}
{
  "lookback": 30,
  "size_usd": 100,
  "type": "mean_reversion",
  "z_threshold": 2
}
event_type
string | null
ticker
string | null
since
string<date-time> | null
until
string<date-time> | null
market_limit
integer
default:50
Required range: x <= 500

Response

Successful Response

job_id
string
required
status
enum<string>
required
Available options:
queued,
running,
complete,
failed
submitted_at
string<date-time>
required
strategy
object
required
params
object
required
universe
object
required
result
null
required
error
null
required