Skip to content
All library documents

Hull Moving Average Trend Strategy with Backtest Controls

Article Strategy library · Author: ChaoZhang

Summary

This strategy turns a Hull moving average indicator into a directional trading system. It compares the current Hull value with a value from two bars earlier: a higher reading triggers a long entry and a lower reading triggers a short entry. The script offers three Hull variants—HMA, EHMA, and THMA—and lets users select the price source and lookback length. Its plots can show the Hull line as a colored band and optionally color candles by trend.

The inputs include a desired trade direction and start and stop dates for backtesting, although the published code’s date filter always returns true, so those dates do not actually restrict entries. The accompanying settings describe a short BTC/USDT futures test, but no performance results are provided. Position sizing uses 100 percent of equity, with no commission or slippage in the strategy configuration. The document therefore explains a configurable trend signal and its implementation, but does not establish profitability or account for realistic execution costs.

Key ideas

  • The system enters long when the Hull value exceeds its value two bars earlier and short when it falls below that comparison.
  • Users can choose among HMA, EHMA, and THMA calculations and configure the input price and lookback length.
  • The chart can display a trend-colored Hull band and optionally color candles to match the trend.
  • Although start and stop dates are configurable, the code’s date-check function always permits trades.
  • The published backtest settings contain no reported performance metrics and configure zero commission and slippage.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.