Is ordertype value retained once order is closed?

 
I'm pretty certain the answer is no, since the reference specifies order property operation types are for the OrderSend() function, but I was wondering if you can select a closed order using the OrderSelect() function (MODE_HISTORY), then get a return value of the order operation type using OrderType().    Basically what i'm asking is: does the closed order retain the OrderType() value it had when it was still open/in the market (either a 0 or a 1), or does that get "wiped out" once the order is closed?
 
Of course, you can.
 
William Roeder #:
Of course, you can.

Thanks! So orders retain their operational value (0 or 1) even after the order is no longer in the market?

 
Erik Volk #:

Thanks! So orders retain their operational value (0 or 1) even after the order is no longer in the market?

If you really wanna be sure, just code a simple program and Print() your Values.

void OnTick()
{
   //- Previous Count Memory & New Count
   static int Ticket              = 0;
   static int OrdersTotalPrevious = 0; 
          int OrdersTotalCurrent  = OrdersTotal();

   //- Send Test Order
   if(OrdersTotalCurrent == 0){
      Ticket = OrderSend(_Symbol,OP_BUY,0.02,Ask,30,Ask - 0.0005, Ask + 0.0005,"TEST",0,0,clrNONE);
      if(Ticket <= 0)
      {
         Print("Could not send Order.");
      }
   }
   
   //- Compare Previous Count to New Count
   if(OrdersTotalCurrent < OrdersTotalPrevious)
   {
      //- Print Out Value to Answer your Question
      if(OrderSelect(Ticket,SELECT_BY_TICKET)){
         int Type = OrderType();
         Print("Closed Ticket Type: ",(string)Type);
         ExpertRemove();
      }
   }
   
   //- Save Count for Next Event
   OrdersTotalPrevious = OrdersTotalCurrent;
}
Print - Common Functions - MQL4 Reference
Print - Common Functions - MQL4 Reference
  • docs.mql4.com
Print - Common Functions - MQL4 Reference