Curious about how the SMA MultiHedge works? Let’s break it down in simple terms:
Understanding the Basics
- Start with GBPUSD as your Base Symbol. If the SMA is trending upwards, it's time to take action.
- Open a long position on GBPUSD while simultaneously hedging with a short on EURUSD to minimize risk. You can also hedge with a long on USDCHF.
Here’s how the EA (Expert Advisor) simplifies your trading:
- Set available hedge symbols to 3 by default: EURUSD, USDCHF, and USDJPY. If you don’t want to hedge with USDJPY, just change "HedgeH3" to false.
- To follow the same direction as GBPUSD, ensure "H3.followBase" is set to true (default). If you prefer the opposite direction, set "H3.followBase" to false and use "H3.LotsRatio" = 2. This will double the lot size for GBPUSD.
- Hedging between GBPUSD and USDJPY will only execute if their correlation exceeds the "H3.Expect.CorRelation" threshold.
- If you’re aiming for a correlation of -0.90, orders will only be sent when the correlation dips below -0.90. Conversely, for a target of 0.90, orders will be triggered only when the correlation is above 0.90.
- Each hedge operates independently using unique MagicNo, MagicNo+1, and MagicNo+2. Remember to change "MagicNo" to a different number, like 318, if you want to trade another pair as your Base Symbol.
Closing Your Hedges
- Hedges will close automatically when the overall profit exceeds your "Expect.Profit" target. And don’t stress about swaps; this EA calculates swap profits automatically.
- If your hedge makes a profit from swaps, the EA will only close the hedge when you hit the "Expect.Profit" target.
- However, if the hedge isn’t profitable from swaps, it will close once the total profit (real + swap) reaches your "Expect.Profit".
Keep in mind, testing this type of EA via backtesting isn’t feasible, so I’m currently in the forward testing phase. Here’s a snapshot of my progress:

Happy trading!
Related Posts
- Creating a Stochastic-Based EA for Hammer and Hanging Man Patterns in MetaTrader 5
- Harnessing MQL5 Wizard for Trading Signals: 3 Black Crows & 3 White Soldiers with MFI
- Creating an Expert Advisor for Dark Cloud Cover and Piercing Line Patterns with CCI Confirmation
- Leveraging MQL5 Wizard: Crafting Trade Signals with Meeting Lines and Stochastic
- Mastering Bullish and Bearish Harami Patterns with Stochastic in MT5