---
title: "Submit Walkforward Backtest"
method: POST
path: "/v1/backtests/walkforward"
---

# Submit Walkforward Backtest

`POST /v1/backtests/walkforward`

## Request

- Base URL: `https://api.quantradin.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.quantradin.com/v1/backtests/walkforward`
- Auth: none declared

#38 WALK-FORWARD RE-OPTIMIZATION: enqueue a walk-forward run of ONE
strategy. Body = the spec (inline `strategy_spec` or a saved
`strategy_id`) + `walkforward: {"folds": K (2..6), "optimize":
[{"path": "entry.when.<...>", "grid": [...]}]}` (≤3 tuned paths, ≤125
combinations — bigger grids are refused in plain words).

The engine splits the backtest window into K sequential folds; each
fold f is graded OUT-OF-SAMPLE with the grid combination that had the
best EV on folds 1..f-1 ONLY (fold 1 only ever trains). The result is
the stitched OOS equity curve, the per-fold table {fold, window,
chosen_params, is_ev, oos_ev} and the honest headline "walk-forward
OOS EV" — every sub-window graded by run_backtest itself, never a
second scoring path. Advisory like every engine read; the single-run
verdict machinery is untouched.

Auth: same resolution as POST /v1/backtests (session cookie wins, else
X-Vega-Key). Polled via the SAME GET /v1/backtests/{run_id}; the row's
kind is 'walkforward'.

## Headers

- `x-vega-key` string, nullable

## Request body

- WalkforwardBacktestRequest: POST /v1/backtests/walkforward (#38) — the spec (inline or a saved strategy_id) plus the walkforward config {"folds": 2..6, "optimize": [{"path", "grid"}]}. The config's bounds/paths are validated in vega_engine.validate.validate_walkforward (plain-words refusals).
  - `strategy_spec` object, nullable
  - `strategy_id` integer, nullable
  - `walkforward` object, required

## Response `200`

Successful Response

- WalkforwardBacktestQueued
  - `run_id` string, required
  - `status` string
  - `kind` string

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/quantradin/apis/vega-api.md) · [All operations](https://skmtc.dev/quantradin/apis/vega-api/llms.txt) · [OpenAPI document](https://skmtc.dev/quantradin/apis/vega-api/revisions/47add154ef38?raw)
