Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

MetaTrader 5 Expert Advisor | Popular MACD Strategy from Viral YouTube Video (3.5M+ Views)

This Expert Advisor is a custom implementation of a MACD-based trading strategy popularized by a widely viewed YouTube video claiming up to 86% win rate. The strategy has been reconstructed based on the logic shown in the video, combining several technical elements:

📌 Strategy Components:

  • MACD Crossovers
    Standard MACD settings (Fast: 12, Slow: 26, Signal: 9) are used to detect momentum shifts:

    • Buy: MACD line crosses above signal line while both are below zero

    • Sell: MACD line crosses below signal line while both are above zero

  • Trend Filter
    A 200-period moving average filters trades:

    • Only buys are allowed above the MA

    • Only sells are allowed below the MA

  • Support/Resistance Condition
    Trades are only allowed if price has recently touched a key support or resistance level. These levels are detected using a custom SupportResistance indicator (included as external dependency), based on the relative highs/lows of the last 10 and 20 candles.

  • Signal Validity Window
    To avoid missing setups due to timing mismatch, the EA uses a configurable time window to "remember" support/resistance and MACD signals ( SignalValidity parameter).

  • Risk Management

    • Stop loss is placed a fixed number of points from the 200 MA

    • Take profit is automatically calculated as 1.5× the stop loss distance


⚙️ Input Parameters

Parameter Description
SignalValidity (int) Number of candles a signal remains valid after appearing (default: 7)
Lotsize (double) Trade volume for each order
SLPointDistanceFromMA (int) Distance (in points) between the MA and the stop loss level

MetaTrader Experts, Indicators, Scripts and Libraries

MetaTrader Experts, Indicators, Scripts and Libraries


61998

Best MetaTrader Indicators + Profitable Expert Advisors