start_walkforward
Run a walk-forward optimization of an indicator rule.
No setting has to be settled before it runs: what the request leaves open (the stock or fund, the
rule, the two settings to search and their ranges, the window lengths) runs with sensible defaults, which
the result names in one short line; a change is a new run. `question` titles its report. The call waits
for the run while it is likely to finish inside it, then answers with the result; the run's card in the
chat shows the result or, for a longer run, how far it is, and fills in by itself, with the next steps as
choices. A run started here needs no `show_report_card`.
Walk-forward validates that a backtest's edge is not curve-fit by
sliding a rolling window: re-fits parameters on `opt_bars` then
applies them out-of-sample on the next `test_bars` and steps forward.
Every account runs it within a daily allowance; a refused call does not count, and get_started and
every run's answer give today's count.
A run takes about 1 to 5 minutes. The call returns `{task_id, status,
kind, dashboard_url}`; `get_walkforward_progress(task_id)` reports
progress and, when the run has finished, carries `result`: the
verdict on the windows the settings never saw, and for a run of a
year or longer a few rounded figures (their return and Sharpe next
to the tuned Sharpe, how many windows made money or never traded,
and simply holding the stock over the same stretch).
Args:
ticker: Stock or ETF symbol (uppercase).
base_config: The strategy, in the same shape as `start_backtest`'s
arguments (entry_indicator, entry_conditions, exit_indicator,
exit_conditions, ...), with conditions written
`{"column": "MACDh_12_26_9", "operator": ">", "value": 0}`.
The optimizer substitutes `param_x` and `param_y` into it
across the grid.
param_x / param_y: The two settings to grid over, each
`{"name": ..., "min": ..., "max": ...}` with an optional
"steps" (2-30; default `grid_steps`). "name" is one of:
"entry.length" a setting of the entry, exit or
confirmation indicator ("exit.fast")
"rsi.length" the same, found by the indicator's id
when exactly one lane uses it
"entry.conditions[0]" the number an entry, exit or
confirmation condition compares against
Indicator settings move in whole numbers: a decimal setting
(Bollinger's std) runs at each whole number inside its range
(a range holding fewer than two answers with QuanterLab's note
and the nearest version, one tap), and a rule of the same lane
written against the swept indicator's column (close above
EMA_20) runs written the other way round, the same rule; the
answer's `changed` says so in one line. A rule of another lane that reads the swept column is
refused with what to change.
opt_bars: In-sample window per fold (default 252 bars ≈ 1y daily),
at least 30.
test_bars: Out-of-sample window per fold (default 63 ≈ 3 months),
at least 30.
step_bars: Stride between folds. Defaults to `test_bars`.
objective: Per-fold metric the grid is tuned on:
'total_return_pct' (default) | 'sharpe' | 'profit_factor' |
'win_rate'.
grid_steps: Values per setting (default 3). The engine runs at
most 250 backtests (every grid point in every window, plus
a test run per window): five years of daily bars fit a
3x3 grid, ten years a 2x2 grid or a longer step_bars. A
larger request runs nothing and answers with QuanterLab's note
and the nearest walk-forwards that fit (`offers`, each with its
exact call).
duration: Total history to walk through (default '5y').
timeframe: '1d' (daily bars, the only timeframe this connector runs).
question: Optional. One sentence restating what the run should answer, not the person's
message: the title of the report the finished run becomes, and kept only as that.
When the run has finished, its progress answer also carries
`report_url`: the walk-forward written up as a QuanterLab report (the
unseen months against holding the stock, window by window, the
settings each window picked), which opens without a login.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ticker | Yes | ||
| param_x | Yes | ||
| param_y | Yes | ||
| duration | No | 5y | |
| opt_bars | No | ||
| question | No | ||
| objective | No | total_return_pct | |
| step_bars | No | ||
| test_bars | No | ||
| timeframe | No | 1d | |
| grid_steps | No | ||
| base_config | Yes |