Hull Moving Average vs Candle
Sep 24, 2020

The Hull Moving Average vs Candle indicator provides a systematic crossover strategy that compares a Hull Moving Average (HMA) against the price values of a higher timeframe candle to identify trend shifts and potential entry points. This tool aims to filter out market noise by using a reactive moving average alongside anchor points from broader time resolutions.
Usage
The Usage section describes how the script can be used to identify market trends and execute strategy entries. The primary logic revolves around the relationship between the Hull Moving Average and a specific price source from a user-defined higher timeframe.
- Bullish Bias: When the HMA value is greater than the selected price source of the previous higher timeframe candle (e.g., Daily Open), the script indicates a buying opportunity. In the strategy version, a long position is initiated when the price and HMA are both above the higher timeframe reference.
- Bearish Bias: When the HMA value is lower than the selected price source of the previous higher timeframe candle, the script indicates a selling opportunity. A short position is initiated when the price and HMA are both below the higher timeframe reference.
- Visual Interpretation: The indicator features an on-chart cloud that fills the space between the higher timeframe candle line and the HMA line. A green fill typically represents bullish conditions, while a red fill represents bearish conditions.
This tool is versatile across various timeframes. A common approach is to use a larger HMA period for small timeframes (e.g., 1-minute to 15-minute charts) and a smaller HMA period for larger timeframes (e.g., 4-hour or Daily charts) to maintain balance between reactivity and trend following.
Details
The script utilizes the ta.hma function, which is designed to reduce lag while improving smoothness compared to a standard SMA or EMA. By incorporating request.security, the indicator fetches data from a different resolution—defaulting to the Daily ("D") timeframe.
To prevent repainting, the strategy utilizes the "Open" price source for the higher timeframe candle. This ensures that the reference point is locked in at the start of the higher timeframe period, providing a stable baseline for comparison against the real-time HMA calculations. The strategy logic also includes momentum filters, requiring the current price to be higher or lower than the previous bar's price to confirm the direction of the entry.
Settings
- Hull MA Period: Determines the length used to calculate the Hull Moving Average. Higher values result in a smoother, slower line, while lower values increase sensitivity.
- Candle Resolution: Sets the higher timeframe from which the reference price is pulled (e.g., Daily, Weekly, or Monthly).
- Source of Price: Selects the specific price point (Open, High, Low, Close, etc.) used for both the HMA calculation and the higher timeframe reference.
FAQ
How do I interpret the colored cloud on my chart?
The cloud represents the gap between the Hull Moving Average and the anchor candle price. When the HMA is above the anchor price, the cloud turns green, signaling a potential uptrend. When the HMA is below, it turns red, signaling a potential downtrend.
Can this indicator be used for automated trading?
Yes, the script includes built-in alert conditions for Long, Short, and Exit signals which can be connected to external bots or API services for automated execution.
How do I access the Hull Moving Average vs Candle indicator?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.