EMA Cross Race Hedging - MetaTrader 5 Expert | MT5 EA Download - MetaTrader 5 Resources




Author of the idea : screenwriter , author of the MQL5 code : Balabashka Kon .
Search for the intersection of two moving averages based on two bars' data to generate a signal:

The current bar number can be specified in the trade bar : either bar #0 or bar #1 .
If Use MACD is set to true, the EA will also consider the position of the main MACD line relative to zero ( the trade bar range).
If the signal is generated when there are no open positions, a position is opened and a hedging level is placed at a distance of 4 hedging orders with a life equal to the expired pending order : a buy stop order is placed in the case of a buy position; a sell stop order is placed in the case of a sell position.
A position can be closed by an opposite signal if: Close the opposite position parameter is set to true. For example, if a buy signal is generated, the sell position will be closed.
Once a position is opened, Trailing Stop and Trailing Step will be enabled for them.
Example of testing EURUSD, M30:

Attachment download
📎 ema_cross_contest_hedged.mq5 (16.3 KB)
Source: MQL5 #19945
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •