Viral MACD Strategy (3.5 million+ views) — Recreated and Automated - MetaTrader 4 Expert



This Expert Advisor is based on a simple MACD strategy that combines various technical conditions. It is designed to test how the strategy performs in a real trading environment.
Standard MACD crossover (buy if the main line crosses the signal line below zero, sell if the main line crosses the signal line above zero) parameters are:
• Fast EMA: 12
• Slow EMA: 26
• Signal line:
200-period moving average for trend filtering. If the price is above the moving average, only buying is allowed, and if the price is below the moving average, only selling is allowed.
This strategy also uses price action: a buy trade requires a support level to be hit, while a sell trade requires the price to be above a resistance level. This is achieved through the custom Box.mq4 indicator, which is a custom indicator that shows support and resistance levels. It’s important to note that support and resistance levels are subjective.
Risk management for this strategy is as follows. For sell trades, the stop loss is always set above the MA; for buy trades, the stop loss is always set below the MA. The SL level will be calculated based on the input parameter named SLPointDistanceFromMA. The trade's take profit is 1.5 times the trade's stop loss.
MACD and support/resistance signals do not need to occur at the same time. The SignalValidity input defines the number of candles for which these conditions remain valid.



Attachment download
📎 tradinglab_best_macd_strategy.mq4 (5.13 KB)
📎 expertfunctions.mqh (7.1 KB)
📎 box.mq4 (9.29 KB)
Source: MQL5 #62000
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •