72s Strat: Backtesting Adaptive HMA+ pt.1

Apr 19, 2021

Static chart image
Signals
Oscillators
Channels
Moving Averages
Volatility

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 access on the following platforms
tradingviewSymbolTradingView
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

ninjatraderNinjaTrader
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

metatrader4MetaTrader 4/5
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

thinkorswimThinkorswim
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

Trading & investing are risky and many will lose money in connection with trading and investing activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.

Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.

Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.

As a provider of technical analysis tools and strategies, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content, tool, or platform feature we provide.

Charts used on this site are by TradingView in which the majority of our technical indicators are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.

Market data is provided by CBOE, CME Group, BarChart, Massive, CoinAPI. Select U.S. equities data is provided through Massive. CBOE BZX real-time U.S. equities data is licensed from CBOE and provided through BarChart. Real-time futures data is licensed from CME Group and provided through BarChart. Select cryptocurrency data, including major coins, is provided through CoinAPI. All data is provided “as is” and should be verified independently for trading purposes.

This does not represent our full Disclaimer. Please read our full disclaimer.

© 2026 LuxAlgo Global, LLC.