OrderClose() error 4108, unknown ticket 1 for OrderClose function
OrderSelect(1, SELECT_BY_TICKET
means select ticket no. 1 what of course i assume it doesn't exist
listep:
In the Strategy Tester . . . . NOT Live or Demo, the ticket number for the first Order is 1, after that is closed the next ticket number is 2, then 3, 4 etc. Don't mix up SELECT_BY_TICKET with SELECT_BY_POS
I'm getting this error when I backtest. I think there's a problem handing off the ticket to OrderClose() (obviously). I've just been throwing everything I can at it, but can't figure it out.
Any ideas? Here's (part of) my code:
I'm getting this error when I backtest. I think there's a problem handing off the ticket to OrderClose() (obviously). I've just been throwing everything I can at it, but can't figure it out.
Any ideas? Here's (part of) my code: