All indicators

Hull Moving Average Crossover Strategy

Sep 17, 2018

Static chart image
Dynamic OverlaysSignalsMoving Averages

The Hull Moving Average Crossover Strategy tool provides a quantitative framework for backtesting trend-following signals based on the responsive Hull Moving Average (HMA) calculation to identify momentum shifts.

Usage

The Usage section describes how the script can be used, examples should be provided in this section. This section also focuses on how main settings affect the indicator interpretation and output.

The strategy identifies potential entry and exit points by analyzing the relationship between two specific periods of HMA-derived calculations. It is primarily used to capture mid-to-long-term trends while minimizing the lag typically associated with standard moving averages.

  • Long Entries: The strategy enters a long position when the primary HMA calculation (n1) crosses above the secondary calculation (n2) and the internal momentum factor (longcross1) exceeds its previous threshold (longcross2).
  • Short Entries: The strategy enters a short position when the primary HMA calculation (n1) falls below the secondary calculation (n2) and the momentum factor indicates a downward shift.
  • Visual Cues: The script colors the price bars and background to represent the current trend bias. Green highlights indicate bullish momentum, while red highlights indicate bearish momentum. Circles and "X" labels appear on the chart to signify specific crossover events and potential trend exhaustion.

Details

The Hull Moving Average (HMA) is designed to be extremely fast and smooth by utilizing the square root of the period for the final Weighted Moving Average (WMA) smoothing. This script specifically calculates the difference between a WMA of half the period and a full-period WMA to increase responsiveness.

The "Strategy" version of this tool includes execution logic that allows users to see simulated performance metrics, such as Net Profit and Drawdown, within the Strategy Tester tab. It employs a specific momentum calculation comparing current and historical values (offset by several bars) to filter out choppy price action and ensure the crossover has sufficient velocity.

Settings

  • HullMA cross: Determines the length used for the HMA calculations. A smaller value increases sensitivity to price changes, while a larger value filters out more market noise.
  • Source: Defines the price data used for the calculations (e.g., OHLC4, Close, Open). Using OHLC4 provides a smoothed average of the entire bar's range.

FAQ

How do I use the Hull Moving Average Crossover Strategy? You can apply the script to any chart and adjust the "HullMA cross" length to suit your specific timeframe. The strategy will automatically simulate trades based on the crossover logic, which you can review in the Strategy Tester.

What is the difference between this strategy and the indicator version? The strategy version is designed for backtesting performance and includes automated buy/sell labels on the chart. The indicator version is optimized for setting up custom alerts without the simulated trade overhead.

How can I access this script? 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.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.