delete pending order after one min

 

I need expert delete pending order after,,,, Minutes

 
khaledellord:

I need expert delete pending order after,,,, Minutes

No problem to get it at Jobs
 
deVries:
No problem to get it at Jobs


this is my ea I need to add delete pending order after,,,, Minutes

like I min or 2 min or mor

Files:
 
Try the follow:
int Minutes_2delete = 1;

if (OrderType()>1&&TimeCurrent()-OrderOpenTime()>Minutes_2delete*60) OrderDelete(OrderTicket());

The rest you can add by yourself..


James

 

can any one add code to my ea

int Minutes_2delete = 1;

if (OrderType()>1&&TimeCurrent()-OrderOpenTime()>Minutes_2delete*60) OrderDelete(OrderTicket());

 
khaledellord: can any one add code to my ea
Lots of people here, but Since there are no slaves here, there are only two choices: learn to code or pay someone. We're not going to code it FOR you. We are willing to HELP you. Post your attempt and the nature of your problem.
 
Why don't you just use Expiration in the OrderSend:
OrderSend(string symbol, int cmd, double volume, double price, int slippage, double stoploss, double takeprofit, string comment=NULL, int magic=0, datetime expiration=0, color arrow_color=CLR_NONE)

With expiration = TimeCurrent()+60*minutes. Then the broker will delete it when the order expires.