start_regime_analysis
Analyze one stock, or check one chosen pair of stocks.
One stock: HMM regime detection, Hurst exponent, Bollinger/Keltner
squeeze, Monte Carlo forward simulation.
A pair (`ticker` and `ticker_b`, e.g. KO and PEP): whether the two
hold together for spread trading. The QuanterLab pairs check rates
the evidence that the two prices hold together as strong, mixed or
weak, with a score out of a hundred, from the Engle-Granger and
Johansen cointegration tests, the spread's half-life, how much the
hedge ratio moves, and how often the two stocks share a market
regime. It is the check to run when someone asks "is X / Y a
tradable pair?" about any two stocks; `start_pairs_scan` searches a
whole index for pairs instead.
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.
An analysis takes about 30 seconds to 2 minutes. The call returns
`{task_id, status, kind, dashboard_url}`; `get_regime_analysis_progress`
reports progress and, when it has finished, carries `result`: for one
stock, the regime now and how long it has run, volatility against the
stock's own history, how the stock behaves (trending, mean reverting
or a random walk), its trend and its drops, rounded; for a pair, how
strong the evidence is that the two hold together and the check's
score, the cointegration tests as p-value bands, the spread's
half-life, the hedge ratio's variation, the correlation, and how often
the two shared a regime, rounded.
Unlike `start_regime_optimization`, which uses HMM regimes to
grid-search trading thresholds, this analysis is descriptive.
Args:
ticker: Stock symbol (uppercased). Required.
ticker_b: Optional second ticker; with it the analysis checks the
pair (`ticker` / `ticker_b`) for spread trading.
mode: Optional. `'volatility'` runs only the squeeze module.
years: Lookback window in years (default 2).
params: Optional dict overriding module-specific knobs. Most
useful: `hmm_enabled` / `hurst_enabled` / `squeeze_enabled` /
`mc_enabled` (disable modules); `hmm_states`; `mc_simulations`.
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 analysis written up as
a QuanterLab report (the market states and their spells, or for a pair the checks of whether the two
hold together). 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 | ||
| years | No | ||
| params | No | ||
| ticker | Yes | ||
| question | No | ||
| ticker_b | No |