All indicators

72s Strat: Backtesting Adaptive HMA+ pt.1

Apr 19, 2021

Static chart image
SignalsOscillatorsChannelsMoving AveragesVolatility

The 72s Strat: Backtesting Adaptive HMA+ pt.1 indicator provides a comprehensive backtesting framework for the Adaptive Hull Moving Average (HMA+) model to help users optimize trend-following strategies. It aims to validate entry and exit logic based on market volatility, slope degrees, and RSI-filtered signals to improve risk management and profitability across different timeframes.

Usage

The Usage section describes how the script can be used to evaluate and refine trading strategies based on the Adaptive HMA+ logic.

Entry Conditions

The strategy generates signals based on the slope and volatility of the Adaptive HMA+:

  • Standard Buy/Sell: Triggered when the HMA+ slope exceeds a specific degree (exiting the "flat" zone) and price is on the correct side of the average.
  • OverBuy/OverSell: Specific signals triggered when the RSI is in extreme zones, suggesting a high-volatility momentum entry.
  • 2nd Order: If enabled, the script can enter a secondary position with different exit rules (using a faster minor HMA+) to capture extended moves.

Exit Conditions

The script utilizes several layers of exit logic to protect capital:

  • RSI Exit: Positions can be closed when the RSI crosses back into neutral territory or hits overbought/oversold thresholds.
  • Trailing Minimum Profit: A unique feature where the algo checks if a minimum ATR-based profit has been reached before allowing a basic exit condition to trigger.
  • Adaptive HMA+ Exit: Positions close when price crosses over or under the minor HMA+ or the primary HMA+ line.

Details

The script is built around the concept of an "Adaptive" HMA, where the period of the moving average adjusts dynamically based on market volatility (ATR). When the market is "charged" (fast ATR > slow ATR), the period shortens to remain reactive; during low volatility, the period lengthens to avoid whipsaws.

The "Distance Zone" feature acts as an ATR-based envelope. This zone helps filter entries by ensuring price is within a specific distance from the HMA+ baseline, preventing entries too far from the average (mean reversion protection).

Settings

Orders

  • Order Size (in Lot): Sets the quantity for each trade.
  • Base Minimum Profit Before Exit (ATR): A multiplier of the ATR that defines the minimum profit required before the strategy is allowed to trigger a standard exit.
  • Default Target Profit (ATR): The multiplier used to set a hard take-profit level.
  • Use StopLoss: Toggles the stop-loss functionality.
  • Base StopLoss Point: Provides options for SL placement, including Distance Zones, Last High/Low, or ATR only.
  • Maximum StopLoss (ATR): A safety-net setting that caps the maximum allowable loss per trade.
  • Activate 2nd order...: Enables doubling of positions with specialized exit rules (requires pyramiding to be set to at least 2).

Adaptive HMA+ Period

  • Minimum/Maximum: Defines the range within which the moving average period can adapt.

Market Movement

  • Flat Market Slope: Defines the degree of the HMA+ slope below which the market is considered sideways (yellow/neutral zone).
  • ATR Fast/Slow: These settings determine the "charged" state of the market based on volatility comparisons.

Distance Zone

  • Show Adaptive HMA+ Distance Zone: Toggles the visibility of the ATR envelopes.
  • Distance (Envelope) Multiplier: Adjusts the width of the distance zones to filter signals.

Minor Adaptive HMA+ Period

  • Minimum/Maximum: Defines the range for the secondary, faster HMA+ used for secondary exits.

FAQ

How do I adjust the strategy for high-spread symbols? You should adjust the commission and slippage settings in the "Properties" tab to reflect your broker's actual trading costs, as the backtest results depend heavily on these factors.

Why are there no signals appearing on my chart? Ensure your "Distance Zone" and "Flat Market" settings are not too restrictive for the current volatility of the asset. If the slope never exceeds the "Flat" threshold, no signals will trigger.

How can I get access to the 72s Strat: Backtesting Adaptive HMA+ pt.1? 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.