Download MetaTrader 5

Why pending order delete it self

To add comments, please log in or register
Anders Hasle Nielsen
60
Anders Hasle Nielsen  

I add pending orders. Add two hours for expire. After it add the pending it delete it again after few seconds. Nothing in the code close any kind of order. Any idea why?

 In journal it just says pending order #... was deleted 

Alain Verleyen
Moderator
34443
Alain Verleyen  
hasle1975:

I add pending orders. Add two hours for expire. After it add the pending it delete it again after few seconds. Nothing in the code close any kind of order. Any idea why?

 In journal it just says pending order #... was deleted 

Probably because your expiry was wrong ? How did you set it ?
Anders Hasle Nielsen
60
Anders Hasle Nielsen  
Alain Verleyen:
Probably because your expiry was wrong ? How did you set it ?
No. I also tried without any. 
Anders Hasle Nielsen
60
Anders Hasle Nielsen  
hasle1975:
No. I also tried without any. 
TimeClose = TimeCurrent() + 60* 60 * 1;
Anders Hasle Nielsen
60
Anders Hasle Nielsen  
Alain Verleyen:
Probably because your expiry was wrong ? How did you set it ?
ticket=OrderSend(Symbol(),OP_BUYSTOP,Lotsize,PriceOpen,3,SL,LIMIT,"comment",5,TimeClose,clrGreen);
Alain Verleyen
Moderator
34443
Alain Verleyen  
hasle1975:
ticket=OrderSend(Symbol(),OP_BUYSTOP,Lotsize,PriceOpen,3,SL,LIMIT,"comment",5,TimeClose,clrGreen);

Seems ok.

Next possibility, you have a code running which removes the pending.

What is written in the log ? (Experts and Journal).

To add comments, please log in or register