Download MetaTrader 5

Experts: Close Master

To add comments, please log in or register
Automated-Trading
Admin
100933
Automated-Trading 2016.06.28 17:18 

Close Master:

EA that can delete pending orders, close open orders and close terminal at certain time.

Author: Il Anokhin

Max
335
Max 2016.06.29 05:44  
Date is written but where to input Time?
Il Anokhin
14001
Il Anokhin 2016.07.04 12:42  
Max:
Date is written but where to input Time?

it's 00:00:00 by default.

It can be changed on input window.

Vasyl Nosal
18636
Vasyl Nosal 2016.07.05 10:40  

1 point for your code.

1) If there will be no tick in needed time? Order wiill close with delay??? You need on timer with time shift.

2) Horrible. Write like this.

   if(TimeCurrent()>=CloseTime)
         {
          if(CloseOO==true)
          {
          int type=OrderType();
          if(type==OP_BUY) w=OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_BID),90);
          if(type==OP_SELL) w=OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_ASK),90);
          }
          if(DeletePO==true)
          {
          int type=OrderType();
          if(type==OP_BUYSTOP || type==OP_SELLSTOP || type==OP_BUYLIMIT || type==OP_SELLLIMIT) w=OrderDelete(OrderTicket());
          }
         }
To add comments, please log in or register