Results 1 to 1 of 1
 1 Attachment(s)    

Thread: cacus_MACCImo_v2 (orderopentime)

  1. #1

    Default cacus_MACCImo_v2 (orderopentime)

    Can someone please add this code to this EA,
    so EA would close open order after specific length of time.

    You need to check the OrderOpenTime() function.

    Code:
    Total = Orderstotal();

    for (int i = 0; i < Total; i++)
    {
    OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
    if(OrderMagicNumber() == MagicNumber && OrderSymbol() == Symbol() && (OrderType() == OP_BUY || OrderType == OP_SELL))
    {
    Print("The trade was opened "+TimeCurrent() - OrderOpenTime()+" seconds ago.");
    }
    }
    Attached Files Attached Files

Tags for this Thread

add, time

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •