Keith Watford #:
Ok I Understand. I thought OrderTicket() is storing the ticket number automatically.
OrderTicket() will not necessarily have a value until an order is selected.
If it has already been selected somewhere, why are you selecting it again?
You are selecting by ticket but you don't check if it has already been closed or not.
if(OrderSelect(OrderTicket(),SELECT_BY_TICKET))
MT4: You can not use any Trade Functions until you first select an order.

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
Hi everyone I had a problem when trying to close an open order, here's my code:
When I tried to close open order it return with error 4108 (invalid ticket). I tried to save the order ticket into variable ticketBuy and ticketSell but it change with error 4051(Invalid function parameter value). Is anyone knows how to fix this?