- You already know why, the ticket number is invalid. Probably you are trying to modify an already closed order. You never check the OrderCloseTime.
- I don't recommend storing ticket numbers. Use a OrderSelect loop instead, you don't need to check and have recovery handled.EA's 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.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello,
I have this error in OrderModify fuction when run my code, can you help me?
Thanks