Unknown ticket error
- 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.
Hello,
I have this error in OrderModify fuction when run my code, can you help me?
Thanks