start_regime_optimization
Run QuanterLab's regime-aware threshold optimization.
Adaptive threshold optimization via HMM regime detection plus
per-regime grid search. Long-running (typically 2-10 min). Returns
`{task_id, status, kind, dashboard_url}`; `get_regime_optimization_progress`
reports progress and, when the run has finished, carries `result`.
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.
Args:
ticker: Asset to analyze.
base_config: Strategy template, the same shape as
`start_backtest`'s arguments (entry/exit indicators and
conditions).
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 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.
duration: Historical window (default '5y').
n_regimes: 0 to pick the number of regimes automatically (default),
or 2-4.
mode: 'all' (default) | 'static' | 'per_regime' | 'dynamic_mean' |
'regression', the optimizers QuanterLab's regime page offers.
objective: Metric to maximize per regime: 'sharpe' (default) |
'total_return_pct' | 'profit_factor'.
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.
A run of more than 500 backtests (in every outer window, the grid on all its days, the grid again for
each market state, and one test) runs nothing and answers with QuanterLab's note and the nearest versions
that run whole, one tap each. The default grid of 4 by 4 runs whole on the default five years.
When the run has finished, its progress answer also carries `report_url`: the run written up as a
QuanterLab report (the setting each market state picked, the rules side by side against holding the
stock). The call waits for the run while it is likely to finish inside it; 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 and the report link. A run started here needs no `show_report_card`.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | all | |
| ticker | Yes | ||
| param_x | Yes | ||
| param_y | Yes | ||
| duration | No | 5y | |
| question | No | ||
| n_regimes | No | ||
| objective | No | sharpe | |
| timeframe | No | 1d | |
| grid_steps | No | ||
| base_config | Yes | ||
| outer_opt_bars | No | ||
| outer_step_bars | No | ||
| outer_test_bars | No |