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
//+———————————————-+
//| 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
//+———————————————-+