Home System Trading Post

Mastering the MACD Strategy: Insights from a Viral YouTube Sensation

Attachments
61998.zip (6.06 KB, Download 0 times)


If you’re looking to enhance your trading game, you’ve probably heard buzz about the MACD strategy that’s been making waves on YouTube, racking up over 3.5 million views! This Expert Advisor (EA) is built around a straightforward MACD crossover strategy, complete with trend filtering and support/resistance validation. The beauty of this EA lies in its clarity—the code is well-commented, making it easy to follow along step by step.

Here’s a quick rundown of the key components of this strategy:

  • MACD Crossovers: This strategy employs standard MACD settings (Fast: 12, Slow: 26, Signal: 9) to identify shifts in momentum.

  • Trend Filter: A 200-period moving average acts as a gatekeeper—only buy trades are allowed when the price is above the MA, while sell trades are permitted only when the price dips below.

  • Support/Resistance Condition: Trades are only executed if the price has recently bounced off a significant support or resistance level. This is determined using a custom SupportResistance indicator, which analyzes the relative highs and lows of the last 10 and 20 candles.

  • Signal Validity Window: To prevent missing out on key setups, the EA has a configurable time window (SignalValidity parameter) that “remembers” support/resistance levels and MACD signals.

  • Risk Management: The stop loss is set a fixed number of points (as per user input) away from the 200 MA, while the take profit is automatically calculated to be 1.5 times the distance of the stop loss.


Input Parameters

Parameter Description
SignalValidity (int) Number of candles a signal remains valid after it appears (default: 7)
Lotsize (double) Volume of each trade order
SLPointDistanceFromMA (int) Distance (in points) between the MA and the stop loss


Backtest results on GBPJPY for the last 2 years


Visualization of the strategy


Input parameters



Related Posts

Comments (0)