Hilbert Transform Trend-vs-Cycle Mode (TVM) is a financial concept covered in this article. The Real-Time Traffic Light for Trend or Chop
The goal of a successful trader is to make the best trades. Money is secondary.
A real-time traffic light that tells you when the market is trending and when it is just oscillating
Why it exists
Most indicators assume either a trend or a cycle, but markets keep flipping between the two. John Ehlers’ Trend-vs-Cycle Mode (TVM) switch—sometimes called the HT TrendMode—uses digital-signal-processing logic to make that distinction bar-by-bar:
-
Trend Mode → directional tools (moving-average crosses, breakouts) work best.
-
Cycle Mode → oscillators (RSI, stochastics) and mean-reversion edges dominate.
By gating strategies with this binary flag you can avoid trend-following signals in sideways chop and ignore whipsaw oscillators during strong runs.
How the algorithm decides
-
Detrend price with a two-pole SuperSmoother or high-pass filter to remove slow drift.
-
Generate Hilbert I/Q pair
It=st−3,Qt=0.0962 st+0.5769 st−2−0.5769 st−4−0.0962 st−6I_t=s_{t-3},\quad Q_t = 0.0962\s_t+0.5769\s_{t-2}-0.5769\s_{t-4}-0.0962\s_{t-6}It=st−3,Qt=0.0962st+0.5769st−2−0.5769st−4−0.0962st−6
- Compute instantaneous period
Pt=2πarctan2(Qt,It)−arctan2(Qt−1,It−1),clamp 6≤Pt≤50P_t=\frac{2\pi}{\arctan2(Q_t,I_t)-\arctan2(Q_{t-1},I_{t-1})}, \quad\text{clamp }6\le P_t\le50Pt=arctan2(Qt,It)−arctan2(Qt−1,It−1)2π,clamp 6≤Pt≤50
-
Measure phase advance per bar
Large, erratic phase jumps ⇒ market choppy; smooth, small changes ⇒ trending. -
Decision rule (Ehlers original):
Modet={TRENDif ∣Pt−Pt−1∣≤0.1 Pt−1 and Pt>15CYCLEotherwise\text{Mode}_t= \begin{cases} \textbf{TREND} & \text{if }|P_t-P_{t-1}|\le 0.1\P_{t-1} \text{ and } P_t>15\[4pt] \textbf{CYCLE} & \text{otherwise} \end{cases}Modet={TRENDCYCLEif ∣Pt−Pt−1∣≤0.1Pt−1 and Pt>15otherwise
Modern coders often tighten the tolerance (e.g., 0.07 × P) and require ADX > 20 confirmation before flipping to TREND.
Reading the output
The indicator is usually plotted as a binary ribbon or histogram:
-
+1 (green) = TREND mode – price progressing in a coherent direction.
-
0 (red) = CYCLE mode – price oscillating around a mean.
Because the logic updates every bar, the mode can switch quickly after a failed breakout or a volatility contraction → expansion event.
Practical trading integrations
| Strategy component | How TVM is used |
|---|---|
| Moving-average cross system | Execute crosses only when TVM = TREND; ignore in CYCLE. |
| RSI / Stochastic fades | Enable oscillator fades only when TVM = CYCLE. |
| Trailing stop width | Narrow ATR stop (1×) in TREND; wider (2×) in CYCLE. |
| Position sizing | Scale up (1.5 × normal) when TVM confirms TREND with ADX rising; scale down in CYCLE. |
Strengths
-
Self-adaptive – no fixed ATR or channel look-back; follows the dominant wavelength.
-
Reduces whipsaws – by shutting off the wrong-tool-for-the-job signals.
-
Ultra-lightweight – few arithmetic ops; runs on intraday-tick data without lag.
Limitations
-
First ≈ 50 bars unstable while Hilbert pair “spins up.”
-
Hyper-sensitive to erratic gaps or thin-volume instruments; pre-smooth or filter bad ticks.
-
Binary oversimplification – real markets can be mixed (slow trend + micro-cycles); pair TVM with volatility metrics (e.g., VHF, ATR) for nuance.
Take-away
The Hilbert Transform Trend-vs-Cycle Mode acts as a trading-style gearbox: when it flashes TREND, step on the momentum pedal; when it flips to CYCLE, downshift into mean-reversion tactics. Add this one-bit signal ahead of your existing rules and you’ll automatically adapt to the market’s prevailing rhythm instead of forcing the same strategy through every regime. Rock on and manage that risk!

Q · 01What is Hilbert Transform Trend-vs-Cycle Mode?+

