TRADEFLAGS 交易提示 TERMINAL · LIVE · · 27 PACKAGES · 4 PRICING TIERS · FREE TIER
*DELAYED 15M*
SPY 732.92 +0.14%
NDX 27065.43 +1.27%
HSI 22739.92 +0.20%
HSCE 7658.83 +0.19%
VIX 21.96 -7.77%
VHSI 20.80 -2.39%
UST10Y 4.97 +1bp
USDJPY 159.62 +0.10%
BTC 59520.43 -0.73%
GOLD 3621.50 -0.87%
WTI 82.46 -0.06%
DXY 104.38 +0.35%
TRADEFLAGS 交易提示 · QUANTITATIVE DATA INFRASTRUCTURE AI AGENT READY
TF> list packages

Hidden Markov Regime — the VHSI's Four States

A four-state Gaussian-mixture Hidden Markov Model reads the HKEX Volatility Index (VHSI) and, without any supervision, separates it into four regimes — from panic to calm. It is the same model from the author's 2022 paper on the VIX, refitted daily for Hong Kong, and it is how we measure what kind of market we are in rather than only whether it is up or down.

Hidden Markov regime probabilities of the VHSI, 2014–2026, with the VHSI level overlaid

The VHSI's four regimes, 2014–2026. The stacked bands are the model's posterior probability of each state on every trading day (they sum to one); the dark line is the VHSI level itself. Bear (red) spikes line up with the panics the reader already knows — the 2015 China sell-off, early-2018 volmageddon, March 2020, September 2021 Evergrande, and the 2024 stimulus surge.

What a Hidden Markov Model is

A Hidden Markov Model assumes the thing you care about — the market's regime — is a hidden state that you cannot observe directly, and that it emits an observable signal, in this case the VHSI's daily log-return. You fit a model that, given the observed returns, recovers both the most likely regime on each day and the probability of being in each of the four regimes. Because the states are learned, not pre-labelled, the model discovers "panic" and "calm" on its own from the data.

The four states

Four Gaussian states make up a mixture distribution over VHSI log-returns. After fitting, the states are sorted by μ·σ² (mean times variance) — the paper's Eq. (12) — which orders them from most to least stressed without any hand-labelling. From 2014 to 2026 the Hong Kong model spent its time as follows:

How we fit it

The model is fitted with the Baum–Welch expectation-maximisation algorithm, ten random restarts per fit keeping the highest log-likelihood, exactly as the paper specifies. We run an anchored expanding walk-forward: a seed window of 2006–2013, then one model refit every 20 out-of-sample days, each fit using all data up to that day. From the day's posterior and the transition matrix we also compute a one-step-ahead forecast — the expected VHSI log-return E[μ] and its standard deviation E[σ] for the next day (the paper's Eqs. 13–15).

Reading the chart

What the data shows

The model validates against the obvious: the probability of the bear state tracks the VHSI level with a correlation of +0.31 over the full 2014–2026 sample — when volatility is high, the model is in bear, and vice versa. The regime is not the same thing as the index: the VHSI can rise into a melt-up rally (2024) and fall into a grinding sell-off, and the four states separate those cases because they are learned from the VHSI's own distribution, not from the HSI's direction. As of the most recent close (2026-11-27) the model reads bull — posterior 0.43 bull, 0.54 trans-bull — the calm end of the spectrum.

How it is used

Query it via the MCP

The daily regime, posteriors and step-ahead forecast are exposed as one tool: hmm_regime__state. It returns the latest day by default, or a date range with start/end. One call:

hmm_regime__state → { hk_vhsi_regime, hk_vhsi_prob_bear…bull, hk_vhsi_exp_mean_logret, hk_vhsi_exp_std_logret }

FAQ

What is a Hidden Markov Model?

A statistical model where the market's true regime is a hidden state inferred from an observable signal — here the VHSI's daily log-return. It recovers the most likely regime each day and the probability of each regime, without the states being labelled in advance.

Why the VHSI and not the HSI?

Volatility regimes are cleaner to separate than price regimes — the VHSI's distribution has a fat, clearly multi-modal shape that a Gaussian mixture can parse. The four states distinguish panic from melt-up from calm in a way an index level cannot.

Are the four states fixed labels?

The count is fixed at four (chosen by BIC, per the paper), but the states themselves are re-learned on every refit and sorted by μ·σ². The labels bear/trans_bear/trans_bull/bull are applied after the sort so they keep a consistent meaning across refits.

How fresh is the data?

The model is rebuilt every weekday after the VHSI closes, in an anchored expanding walk-forward, so the latest day's posterior and step-ahead forecast are always current through the prior close.

Is this a buy or sell signal?

No. It is a regime reading — a description of what kind of market we are in, plus a probabilistic one-step-ahead view. It is an input to position sizing and risk, not a recommendation to trade.

Who it is for

Portfolio managers sizing risk, volatility traders, and anyone who wants a disciplined read on the HK market's regime rather than a reactive one — for allocation, vol-targeting and risk overlays.

References

Query this series via the TradeFlags API / MCP →