All indicators

MACD + DMI Scalping with Volatility Stop

Sep 14, 2021

Static chart image
SignalsOscillatorsMoving AveragesTrailing-StopVolatility

The MACD + DMI Scalping with Volatility Stop tool is designed to identify high-probability trend-following entries while utilizing dynamic exit mechanisms to protect capital and lock in gains. By combining momentum and directional indicators with a volatility-based trailing stop, it aims to reduce false signals during sideways markets and provide timely exits before significant trend reversals.

Usage

This script is primarily used to identify long entries in trending markets. An entry signal is generated when the MACD histogram turns bullish (specifically when the MACD line crosses above the signal line) and the Directional Movement Index (DMI) confirms positive momentum (Positive DI > Negative DI).

For exits, the strategy employs a dual-layered approach:

  • Fixed Take Profit: A pre-defined percentage gain (default 3%) to capture profits quickly.
  • Volatility Stop: A dynamic trailing stop based on Average True Range (ATR) that adjusts to market volatility. If the price crosses below this stop, the position is closed to prevent further drawdown.

The script is particularly effective on medium-term timeframes such as the 3-hour or 4-hour charts, where trends are more established.

Details

The strategy addresses two common pitfalls in trend following: late exits and whipsaws. By requiring the DMI to show positive directional strength, it filters out low-volatility environments where MACD crossovers might otherwise produce false signals. The Volatility Stop calculation uses an ATR-based buffer to determine the trend's "breathing room," switching its orientation based on price interaction with the calculated stop level.

Settings

Core Parameters

  • Take Profit %: Sets the fixed percentage target for closing a profitable trade.
  • vStop Length: The lookback period for the ATR calculation used in the Volatility Stop.
  • vStop Source: The price source (e.g., Close, HL2) used for the stop calculation.
  • vStop Multiplier: The factor applied to the ATR to determine the distance of the trailing stop from the price.

Date Range

  • From/Thru Day/Month/Year: Defines the specific window for backtesting or active execution.
  • Show Date Range: Toggles the visibility of the date range constraints.

FAQ

How do I interpret the Volatility Stop line?

The line remains below the price during an uptrend (green) and moves above the price during a downtrend (red). A cross below the green line triggers an automatic exit signal.

What markets is this best suited for?

While originally tested on cryptocurrency (specifically Binance-listed assets), the logic is applicable to any trending market including stocks and forex.

How do I get access to MACD + DMI Scalping with Volatility Stop?

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.