By trying to delete pending orders from ticket number I got the error message "OrderDelete error 4108"
By trying to delete pending orders from ticket number I got the error message "OrderDelete error 4108"
Here is my code:
from mql help
error 4108 = invalid ticket
from mql help
error 4108 = invalid ticket
Hi Eugenio,
If you look at the code of my function before to call OrderDelete() I am checking that the ticket is existing and it is related to a pending order. So I do not understand why I get this error message.
Regards,
Dorian
Hi Eugenio,
If you look at the code of my function before to call OrderDelete() I am checking that the ticket is existing and it is related to a pending order. So I do not understand why I get this error message.
Regards,
Dorian
Hi Eugenio,
If you look at the code of my function before to call OrderDelete() I am checking that the ticket is existing and it is related to a pending order. So I do not understand why I get this error message.
Regards,
Dorian
OrderSelect function select order in open orders list but also in history orders list.
Add controll
if( OrderCloseTime() > 0 ) return false;
after OrderSelect call
Thank you Eugenio and Alain. I thought the Order type value changed when the order is already deleted.
Regards,
Dorian
- Order type changes when it opens.
- Don't use the ticket. EAs must be coded to recover. If the power fails, OS crashes, terminal or chart is accidentally closed, on the next tick, any static/global ticket variables will have been lost. You will have an open order but don't know it, so the EA will never try to close it, trail SL, etc. How are you going to recover? Use a OrderSelect loop to recover, or persistent storage (GV+flush or files) of ticket numbers required.
OrderSelect function select order in open orders list but also in history orders list.
Add controll
after OrderSelect call
HistoryOrderSelect() does not exist in MQL4
HistoryOrderSelect() does not exist in MQL4
I mean for mql5
This is the MQL4 and MT4 sub forum.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
By trying to delete pending orders from ticket number I got the error message "OrderDelete error 4108"
Here is my code: