Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

MetaTrader 5 Expert Advisor | Hedge any positions

MetaTrader Experts, Indicators, Scripts and Libraries

Author of the idea - Sam

Code mq5 by: barabashkakvn

The EA works on hedge accounts only!

The EA tracks all positions regardless of the symbol or magic number.

As soon as a position (opened by another EA or manually) features a loss exceeding or equal to Losing, an opposite position is opened. The volume of the opened position is calculated considering Lot coefficient.

For each position (opened by another EA or manually), the "Hedge any positions" EA opens an opposite position ONLY ONCE.

Please note that the EA simply sets the opposite position once without Stop Loss and Take Profit.

22823