All indicators

MACD Enhanced Strategy MTF with Stop Loss

Oct 7, 2024

Static chart image
SignalsOscillatorsTrailing-StopVolatility

The MACD Enhanced Strategy MTF with Stop Loss indicator provides an advanced approach to momentum trading by combining multi-timeframe (MTF) analysis with a custom scoring system and dynamic volatility-based stop losses. It aims to filter market noise and align trades with broader trends to improve entry accuracy and risk management.

Usage

The strategy evaluates market conditions by calculating a weighted score based on MACD movements across both the current and a higher timeframe (HTF). Users can interpret the signals as follows:

  • Long Entry: Triggered when the combined multi-timeframe result transitions into a positive value.
  • Short Entry: Triggered when the combined multi-timeframe result transitions into a negative value.

The indicator automatically selects a logical higher timeframe based on your current chart period (e.g., a 1-minute chart will reference the 5-minute timeframe). This ensures that entries are supported by a higher-level trend, reducing the likelihood of being caught in minor counter-trend fluctuations.

Details

The core of this strategy is a custom scoring function that assigns values to three specific components of the MACD:

  1. Indicator Direction: Points are awarded based on whether the MACD line is rising or falling.
  2. Histogram Momentum: The direction of the MACD histogram is scored to capture changes in momentum.
  3. Signal Crossovers: Significant weight is given to the relationship between the MACD line and its signal line.

The final "Result" is a weighted average of these scores from the current timeframe and the selected HTF. Additionally, the strategy includes an adaptive stop-loss mechanism based on the Average True Range (ATR). This trailing stop adjusts according to market volatility, helping to protect capital during erratic price swings.

Settings

MACD Parameters

  • MACD Fast Length: The period for the shorter EMA used in the MACD calculation.
  • MACD Slow Length: The period for the longer EMA used in the MACD calculation.
  • MACD Signal Length: The period for the EMA of the MACD line.

Scoring Weights

  • Cross Score: The weight assigned when the MACD crosses its signal line.
  • Indicator Direction Score: The weight assigned based on the slope of the MACD line.
  • Histogram Direction Score: The weight assigned based on the slope of the histogram.

Stop Loss & Logic

  • Show Stop Loss Line: Toggles the visibility of the dynamic stop loss line on the chart.
  • Stop Loss Factor: A multiplier applied to the ATR to determine the distance of the stop loss.
  • Stop Loss Period: The lookback period used for the ATR calculation.
  • Lookahead: Enables or disables the use of higher timeframe lookahead in calculations.

FAQ

How do I use the multi-timeframe feature?

The strategy automatically determines the most appropriate higher timeframe based on your current chart. You do not need to manually select it, but you should ensure your chart has enough historical data for the HTF calculations to resolve.

How does the stop loss function work?

The stop loss is dynamic and uses the Average True Range (ATR) multiplied by the "Stop Loss Factor." It trails the price to lock in potential gains while expanding or contracting based on market volatility.

How can I get access to this tool?

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.