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 GTakeProfit

MetaTrader Experts, Indicators, Scripts and Libraries

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

//+----------------------------------------------+
//| Enumeration for profit calculation options   |
//+----------------------------------------------+
enum TakeMode
{
ENUM_PERCENT, //profit in percentage
ENUM_CARRENCY //profit in the deposit currency
};
//+----------------------------------------------+
//| Input parameters of the EA indicator         |
//+----------------------------------------------+
input TakeMode LMode=ENUM_PERCENT; //profit calculation method
input double TakeProfit=100.0; //take profit
//+----------------------------------------------+
16760

Best MetaTrader Indicators + Profitable Expert Advisors