Watch how to download trading robots for free
Find us on Twitter!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Experts

Popular MACD Strategy from Viral YouTube Video (3.5M+ Views) - expert for MetaTrader 5

Views:
4968
Rating:
(5)
Published:
Updated:
\MQL5\Indicators\ \MQL5\Include\
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance


This Expert Advisor is based on a MACD crossover strategy with trend filtering and support/resistance confirmation. The logic is built according to the most common interpretation of such strategies, using standard indicators. The code is full of comments explaining every line of code step by step.

The Strategy Components are simple:

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

  • Trend Filter:  A 200-period moving average filters trades: Only buys are allowed above the MA, and sells if the price is 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 (specified by the user) from the 200 MA.  and the 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


Backtest results on GBPJPY for the last 2 years


Visualization of the strategy


Input parameters



ServerTime ServerTime

A lightweight, customizable tool that displays server time on your chart for precise trading decisions.

Seven strategies in One expert Seven strategies in One expert

Name of expert is 'MultiStrategyEA'

BBMA ZoneZeroLoss (ZZL) Grandma Ally BBMA ZoneZeroLoss (ZZL) Grandma Ally

BBMA ZoneZeroLoss Histogram shows trading zones e.g. for "Reentry" setup for risk minimisation

Bull Bear Volume Bull Bear Volume

An indicator that provides a clear visualization of volume pressure on each side of the market