HilbertPeriod
Background
Like the HomodyneDiscriminator,
HilbertPeriod measures the market's dominant cycle — the number of bars the
price is currently swinging over — and is also taken from John Ehlers' Rocket
Science for Traders. It uses the Hilbert-transform machinery to recover the
in-phase and quadrature components of price and reads the period from how fast the phase
rotates.
The difference from the homodyne version is responsiveness: HilbertPeriod
produces a slightly smoother, slower-reacting period. When you drive an adaptive
indicator from it, the result will be a touch slower than the same indicator driven by
the HomodyneDiscriminator. Choose it when you prefer the steadier period reading and can
accept a little more lag.
Function
HilbertPeriod(Price)
| Parameter | Description |
|---|---|
| Price | The price array the dominant-cycle period is measured from. It must not contain empty/null values at the left edge of the data. |
Returns a per-bar array of the dominant-cycle period in bars, smoothed and clamped to the 6–50 range.
Usage
periods = HilbertPeriod( Close );
myRSI = VariablePeriodRSI( Close, periods );
Plot( myRSI, "Adaptive RSI (Hilbert period)", colorRed );
If your adaptive indicator feels too sluggish, swap to
DominantCycle( Close ) (the low-lag homodyne reading) for a faster
period; if it feels too jumpy, HilbertPeriod is the steadier choice.