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 | Exp GStopLoss

MetaTrader Experts, Indicators, Scripts and Libraries

This Expert Advisor closes all positions if the total loss exceeds a predefined limit. In fact, this is a global stop loss for all positions simultaneously.

//+----------------------------------------------+
//| Enumeration for loss calculation options     |
//+----------------------------------------------+
enum LossMode
{
ENUM_PERCENT, //losses in percentage
ENUM_CARRENCY //losses in deposit currency
};
//+----------------------------------------------+
//| Input parameters of the EA indicator         |
//+----------------------------------------------+
input LossMode LMode=ENUM_PERCENT; //loss calculation method
input double StopLoss=20.0; //stop loss
//+----------------------------------------------+
16759

Best MetaTrader Indicators + Profitable Expert Advisors