Exponential Hull Momentum [BackQuant]Exponential Hull Momentum
Overview
Exponential Hull Momentum is a normalized momentum oscillator built from an Exponential Hull Moving Average -style transformation. Its purpose is to measure whether smoothed directional pressure is pushing toward the upper or lower end of its own recent range, while keeping the response faster and cleaner than a plain moving-average oscillator.
At a high level, the script does three things:
Builds a fast, low-lag smoothed series using an Exponential Hull-style calculation.
Normalizes that series against its own rolling high-low range so the output fits into a bounded oscillator-style scale centered around zero.
Optionally smooths the oscillator with a selectable moving average so you can use a secondary signal line or regime filter.
The final result is an oscillator that tries to answer:
Is momentum pushing toward the strong positive end of its recent range?
Is momentum collapsing toward the negative end?
Is the current move still expanding, or is it rolling over relative to its own smoothed state?
What this indicator is actually measuring
This indicator is not measuring raw returns, not measuring RSI-style up/down closes, and not measuring volatility. It is measuring the position of a low-lag smoothed price transform within its own recent rolling range .
That distinction matters.
It means:
Positive values indicate the Exponential Hull series is in the upper half of its recent normalized range.
Negative values indicate it is in the lower half of its recent normalized range.
Extreme positive values suggest strong upward momentum persistence.
Extreme negative values suggest strong downward momentum persistence.
Because it is normalized, the oscillator is less about absolute price level and more about relative momentum state .
Where the “Hull” idea comes from
The Hull Moving Average family exists to solve a classic moving-average problem:
If you smooth more, you reduce noise but increase lag.
If you smooth less, you reduce lag but increase noise.
Alan Hull’s core idea was to combine moving averages in a way that compensates for lag before applying a final smoothing stage. The classic HMA uses weighted moving averages. This script uses the same structural idea, but with EMAs instead , producing an Exponential Hull-style moving average .
So instead of a classic HMA, the script constructs:
A fast EMA on half-length input.
A slower EMA on full-length input.
A lag-compensated intermediate value using 2 * fast - slow.
A final EMA smoothing pass using sqrt(length).
This is why it is called Exponential Hull Momentum . The “Hull” part refers to the lag-reduction structure, the “Exponential” part comes from using EMA instead of WMA.
The EHMA calculation step by step
The core function is:
EHMA(_src, _length) =
EMA( 2 * EMA(_src, _length / 2) - EMA(_src, _length), round(sqrt(_length)) )
Let’s break that down.
1) Fast EMA on half length
EMA(_src, _length / 2)
This reacts quickly to recent price changes.
2) Slow EMA on full length
EMA(_src, _length)
This is smoother and more delayed.
3) Lag compensation
2 * fastEMA - slowEMA
This is the critical step. It pushes the result toward the faster average while subtracting part of the slower lagging component. Conceptually, it behaves like a “de-lagged” smoother. It is related in spirit to reduced-lag constructions like DEMA and TEMA, though implemented in a Hull-style framework.
4) Final smoothing
EMA(lag_compensated_series, sqrt(length))
This final pass cleans up the compensated series so it remains usable as a smooth momentum engine rather than a noisy de-lagged line.
So the oscillator’s underlying subject is not raw price, but this EHMA subject series .
Why use EHMA instead of a plain EMA or raw price
A raw price oscillator is often too noisy. A plain EMA oscillator is smoother, but can still lag too much. EHMA tries to balance:
Faster reaction than a standard EMA.
Cleaner shape than a raw de-lagged transform.
More sensitivity to directional bursts.
That makes it useful for momentum work, especially when you want:
Earlier momentum regime shifts.
Cleaner trend-state transitions.
A bounded oscillator rather than an overlay line.
Normalization: turning the EHMA into an oscillator
After computing the EHMA subject, the script normalizes it using its own rolling lowest and highest values over a user-defined normalization period:
lowest = lowest(subject, norm_period)
highest = highest(subject, norm_period)
plotosc = (subject - lowest) / (highest - lowest) - 0.50
This transforms the EHMA series into a bounded range centered around zero.
Interpretation:
If subject is near the rolling highest, plotosc approaches +0.5.
If subject is near the rolling lowest, plotosc approaches -0.5.
If subject is near the middle of the rolling range, plotosc is near 0.
So the oscillator is essentially:
Where is the current EHMA value sitting within its recent high-low envelope?
Why normalization matters
Without normalization, the EHMA value itself would still be in price units, which makes comparison harder across:
Different assets,
Different timeframes,
Different price regimes.
Normalization gives you a common scale:
-0.5 to +0.5, centered at 0
That makes the output much easier to use as a momentum state tool.
What the oscillator values mean
Near +0.5
The EHMA subject is pressing against the upper end of its rolling range. This usually means:
Strong bullish momentum,
Persistent upward movement in the smoothed series,
A possible “stretched” positive momentum condition.
Near -0.5
The EHMA subject is pressing against the lower end of its rolling range. This usually means:
Strong bearish momentum,
Persistent downward movement,
A possible stretched downside state.
Near 0
The EHMA subject is near the midpoint of its recent range. This can mean:
Momentum is neutral,
Momentum is transitioning,
The market is compressing or chopping relative to recent structure.
Important nuance about the oscillator scale
This is not a z-score . It is not measuring “standard deviations from mean.” It is a min-max style range normalization . That means:
The output depends on the recent highest and lowest subject values.
If the rolling range changes sharply, oscillator sensitivity can change too.
The same oscillator value does not imply the same statistical rarity across all contexts.
It is best read as a relative range-position momentum oscillator , not as a probabilistic metric.
Signal line / moving average layer
The script optionally applies a second smoothing layer directly to the oscillator:
sig_ma = MA(plotosc, malen, matype)
You can choose from many MA types:
SMA
EMA
DEMA
TEMA
RMA
WMA
HMA
T3
ALMA
LINREG
VWMA
This signal line is not required for the core oscillator to work. It is a secondary interpretation layer that can be used for:
Momentum confirmation,
Cross-based entry logic,
Smoothing out the oscillator for regime filtering,
Visual comparison between raw momentum and smoothed momentum.
The script note suggests that if you want to use the MA more like a signal histogram, you can change its style to columns in the style menu.
Why a selectable MA matters
Different traders want different signal characteristics:
SMA/EMA for classic smoothing,
DEMA/TEMA for lower lag,
HMA/T3/ALMA for smoother trend-state filtering,
LINREG for slope-sensitive behavior,
VWMA if you want volume-weighted smoothing.
This makes the indicator more flexible without changing the core EHMA oscillator.
Color gradient logic
The oscillator columns are colored using thresholded intensity zones rather than a continuous gradient function. The color changes as the oscillator moves further away from zero.
For positive values:
Weak positive: lighter cyan/green tones.
Moderate positive: stronger green.
Strong positive: bright green.
Extreme positive near +0.5: intense bright green.
For negative values:
Weak negative: orange/red tint.
Moderate negative: deeper red.
Strong negative: bright red.
Extreme negative near -0.5: intense red.
This means the plot does two jobs at once:
Direction from sign,
Relative momentum intensity from color saturation.
So even without reading the value numerically, you can see whether momentum is:
Barely positive,
Strongly positive,
Barely negative,
Or deeply negative.
Static levels and what they mean
The script draws fixed zones:
+0.5 and +0.4
-0.4 and -0.5
0 midline
These create:
An upper “overbought / strong positive momentum” zone from 0.4 to 0.5
A lower “oversold / strong negative momentum” zone from -0.4 to -0.5
A midline at 0 separating positive from negative momentum territory
Important:
These are momentum extreme zones , not traditional RSI overbought/oversold zones.
Strong trends can stay pinned near +0.5 or -0.5 for long periods.
Extreme readings do not automatically mean reversal.
The fill between the upper and lower static boundaries just makes those zones easier to identify visually.
Midline logic
The zero line is the most important structural level in the oscillator:
Above 0 = EHMA is in the upper half of its recent range, positive momentum regime.
Below 0 = EHMA is in the lower half of its recent range, negative momentum regime.
The alert conditions are built on this exact logic:
Long alert on crossover above 0
Short alert on crossunder below 0
So the core directional interpretation is midline-based.
How to interpret the indicator in practice
1) Momentum regime
The cleanest use is as a regime filter:
Above 0: positive momentum bias.
Below 0: negative momentum bias.
This alone can already be useful for:
Filtering entries,
Avoiding countertrend setups,
Aligning with the dominant smoothed momentum state.
2) Momentum intensity
The closer the oscillator moves toward +0.5 or -0.5, the stronger the recent momentum relative to its own normalized range.
This can help distinguish:
Weak trend drift,
Healthy trend continuation,
Momentum surge / expansion,
Potential exhaustion zones.
3) Transition behavior
Watch how the oscillator behaves around 0:
Fast thrust through 0 often signals a fresh momentum shift.
Repeated chop around 0 often signals indecision or sideways conditions.
A flattening oscillator after an extreme reading often shows momentum deterioration before price fully turns.
4) Using the moving average signal
If enabled, the MA of the oscillator can help identify:
When raw momentum is accelerating away from smoothed momentum,
When momentum is rolling over,
Whether the oscillator move is broad and sustained or only a short burst.
A common interpretation:
Oscillator above signal MA and above zero = strong bullish momentum structure.
Oscillator below signal MA and below zero = strong bearish momentum structure.
Divergence between oscillator and signal MA = momentum fading or transitioning.
What makes this different from RSI or stochastic-style oscillators
This script is structurally different from standard oscillators.
Compared to RSI
RSI is based on the ratio of average up closes to down closes. It measures directional internal strength of return behavior.
EHMA Momentum instead:
Starts from a low-lag smoothed price transform,
Then asks where that transform sits in its recent range.
So it is more “structure-relative momentum” than “up/down return balance.”
Compared to Stochastic
Stochastic asks where price closes relative to recent high-low range.
EHMA Momentum asks where the EHMA-smoothed subject sits relative to its own recent subject range.
That means:
It is less raw than stochastic,
More smoothed,
Potentially less noisy,
And more focused on directional structure than candle location.
Parameter behavior
Exponential Hull Calculation Period (len)
Controls how the EHMA subject is built.
Very low values make the subject extremely reactive.
Higher values smooth the subject more and reduce sensitivity.
Since the default is very small, this script is designed to be sharp and responsive by nature.
Normalization Period (norm_period)
Controls the rolling high-low range used to normalize the subject.
Higher values create a broader historical range and smoother normalization.
Lower values make the oscillator adapt faster, but it can become more jumpy and “range-reset” more often.
Signal MA Period and Type
Controls how smooth the optional secondary line is.
Shorter MA = faster cross behavior.
Longer MA = slower, steadier confirmation.
Strengths of this approach
Fast response because of the Exponential Hull construction.
Easy interpretation because of bounded normalized output.
Works well as a regime filter via the zero line.
Intensity is visually clear from both height and color.
Flexible because of optional multi-type signal smoothing.
Limitations and what to watch for
Because the oscillator is min-max normalized, extreme values can persist in strong trends.
A rolling highest/lowest normalization can make the oscillator “reset” as old extremes leave the window.
On very low lengths, the EHMA can become highly reactive and potentially noisy.
Zero-line crosses can whipsaw in sideways markets, especially if normalization is too short.
So this tool is best used with context:
Trend structure,
Market regime,
Higher timeframe bias,
Or combined with the signal MA and price action.
Summary
Exponential Hull Momentum is a normalized momentum oscillator built from an EMA-based Hull-style smoothing engine. It first creates a low-lag Exponential Hull series, then normalizes that series within its own rolling high-low range so the output oscillates around zero between roughly -0.5 and +0.5. Positive values indicate the EHMA subject is pressing into the upper half of its recent range, negative values indicate the lower half, and the distance from zero reflects relative momentum strength. Static zones highlight extreme positive and negative momentum states, while an optional multi-type moving average can be used as a secondary signal or smoothing layer.
Chỉ báo







