//+------------------------------------------------------------------+ //| Closer.mq4 | //| Apostol-Aristotel | //| http://www.apostol-aristotel.ru | //+------------------------------------------------------------------+ #property copyright "Apostol-Aristotel" #property link "http://www.apostol-aristotel.ru" extern double tp=5; // Êîëè÷åñòâî ïèïñîâ extern int magic=0; // Åñëè magic=0, òî çàêðûâàþòñÿ âñå ñäåëêè extern int slip=2; // Óðîâåíü ïðîñêàëüçûâàíèÿ äëÿ çàêðûòèÿ ñäåëîê //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ int start() { //---- for (int j = 0; j < OrdersTotal(); j++){ if (OrderSelect(j, SELECT_BY_POS)){ if (OrderSymbol() == Symbol()&& (OrderMagicNumber()==magic || magic==0)){ if((OrderType()==OP_BUY || OrderType()==OP_BUYSTOP || OrderType()==OP_BUYLIMIT) && Bid-OrderOpenPrice()>=tp*Point) OrderClose(OrderTicket(), OrderLots(),Bid,slip,0); if((OrderType()==OP_SELL || OrderType()==OP_SELLSTOP || OrderType()==OP_SELLLIMIT) && OrderOpenPrice()-Ask>=tp*Point) OrderClose(OrderTicket(), OrderLots(),Ask,slip,0); } } } //---- return(0); } //+------------------------------------------------------------------+
Sample
Analysis
Market Information Used:
Indicator Curves created:
Indicators Used:
Custom Indicators Used:
Order Management characteristics:
Checks for the total of open orders
It Closes Orders by itself
Other Features: