Hi
i m newbie on EA development
ok ; fo pending orders my broker allow expiration duration after 250 min in minimum;
On my EA i want to set the pending order if wasn't executed in next 20min it will be removed ;
how can i do that
thank you
You can delete your pending orders using OrderDelete function.
before you delete any of them you need to select them using a loop.

- docs.mql4.com
thank yu Reza nasimi
but how can i set the condition if the pending order wans't executed in x duration ?
- Select the order.
- See if it is still pending.
- Compare the OrderOpenTime to TimeCurrent and delete if older than your 20 minutes.
For MT4
- Select the order.
- See if it is still pending.
- Compare the OrderOpenTime to TimeCurrent and delete if older than your 20 minutes.
thank you for the topic
i will try to code the fonction & i will update my result
For MT4
- Select the order.
- See if it is still pending.
- Compare the OrderOpenTime to TimeCurrent and delete if older than your 20 minutes.
}
so it's workin i puted 910 because i run my ea on 15min timeframe
i want to correct the return fonction because i got "empty controlled statement found" error
// zikokiko , Please use " code icon " to show your code void chekingOrders () { for(int buy=OrdersTotal()-1;buy>=0;buy++) { if(OrderSelect(buy,SELECT_BY_POS,MODE_TRADES)) if(OrderSymbol()==Symbol()) if(OrderMagicNumber()==magic) if(TimeCurrent()<OrderOpenTime()+910) ; } }
for(int buy=OrdersTotal()-1;buy>=0;buy++) // This loop seems wrong logic .
yes you'r right
i fix it for(int buy=OrdersTotal()-1;buy>=0;buy--)

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi
i m newbie on EA development
ok ; fo pending orders my broker allow expiration duration after 250 min in minimum;
On my EA i want to set the pending order if wasn't executed in next 20min it will be removed ;
how can i do that
thank you