Auto time exit system
Results 1 to 2 of 2

Thread: Auto time exit system

  1. #1
    Hey guys, is it possible to programme a system which automatically shuts or exits your open commerce in a programmed period .example:you've got an open commerce but it's not yet hit some of your halt levels and you wish to give it a little time before you depart but sadly you can't hang around to observe the market.Can one get a system which is going to be able to leave the exchange for you in the programmed time when it wasn't hit your stop or goal

  2. #2
    I use this function in all of my EA's whenever I need it ... It works very well.

    If(Hour()==22 Minute()gt;50)
    DeleteAllOrders()

    ...
    ...
    ...

    emptiness DeleteAllOrders()
    int total = OrdersTotal();
    for(int I=total-1;igt;=0;I--)
    OrderSelect(I, SELECT_BY_POS);
    int form = OrderType();
    bool result = false;

    switch(type)
    case OP_BUY : outcome = OrderClose(OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_BID), 5, Red);
    split;

    case OP_SELL : outcome = OrderClose(OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_ASK), 5, Red);
    split;
    case OP_BUYLIMIT :
    case OP_BUYSTOP :
    case OP_SELLLIMIT :
    case OP_SELLSTOP : outcome = OrderDelete(OrderTicket());


    if(result == false)
    Alert(Order , OrderTicket() , failed to shut. Error: , GetLastError() );
    // Sleep(3000);



    return(0);

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.