MT4 fails to sync executed pending Orders during fast moving market and recognizes it a pending order that cant be deleted. It occurs occasionally during fast moving market.
Sometimes I notice an open pending order that could't be deleted by EA and the market have passed that price. If i try deleting it manually is says ''invalid '',but when i restart MT4 it appears to be an open trade. Can any help me or i'm experiencing the same issue ?
This code creates new pending Orders
This code check for order status
Forum on trading, automated trading systems and testing trading strategies
Please EDIT your post and use the SRC button when you post code.
= OrderDelete( OrderTicket() );
It should look something like this...
if(avgSpread > maxSpread|| MathAbs(rateChange) < VelocityTrigger * _Point)
for(int j=0;j<2 && !OrderDelete(OrderTicket());j++) // extra attempt if first one fails
Print(__FUNCTION__," <!!!> ",ErrorDescription(GetLastError()));
Thanks i will check it out
I will try to apply that and it resolves it
I tried it but same issue occurred with two trades.
the below image shows the pending trades
I tried it but still same issue occured.
this image shows the pending trades
after i closed the terminal, and restarted it. It showed the open trades and closed it immediately. because the TP have already passed.