order not getting expire

 

order is created but its not expiring after 1 min 



input ENUM_TIMEFRAMES orderexpiration = PERIOD_M1;

    datetime expirrry = TimeTradeServer () + PeriodSeconds (orderexpiration);

   MqlTradeRequest neueOrder={0};
   MqlTradeResult result={0};      
    neueOrder.symbol       = _Symbol;
   neueOrder.type         = ORDER_TYPE_BUY_STOP;
   neueOrder.action       = TRADE_ACTION_PENDING;
   neueOrder.type_filling = ORDER_FILLING_IOC;
   neueOrder.type_time    = ORDER_TIME_SPECIFIED;
   neueOrder.volume       = 0.1;
   neueOrder.price        = price;
   neueOrder.sl           = 0;  
   neueOrder.tp           = 0;
   neueOrder.magic        = 0;

   neueOrder.expiration   = expirrry;
   
   OrderSend(neueOrder,result);
 

I don't understand what I am doing wrong here 


but I bet its related to datetime expirrry = 

 
abhi163:

I don't understand what I am doing wrong here 


but I bet its related to datetime expirrry = 

You need to check SYMBOL_EXPIRATION_MODE to see if this is allowed for your symbol.
 
Alain Verleyen:
You need to check SYMBOL_EXPIRATION_MODE to see if this is allowed for your symbol.


this ?

 
Alain Verleyen:
You need to check SYMBOL_EXPIRATION_MODE to see if this is allowed for your symbol.
  int expiration=(int)SymbolInfoInteger(_Symbol,SYMBOL_EXPIRATION_MODE);
     if (expiration == true)
     Print("Pending Order Expiration is allowed on this symbol");
     else
     {
      Print("Pending Order Expiration is NOT allowed on this symbol"); 
     }

i tested this 

(USDCAD,H4) Pending Order Expiration is NOT allowed on this symbol