Download MetaTrader 5
To add comments, please log in or register
The entire MQL5.community history on a single page!
Timo Schroeter
1580
Timo Schroeter 2016.10.22 15:41 

Hello,

int ticketId = OrderSend(...) always returns 1 for me inseatd of a (fake) ticket number. Is the the correct behaviour for backtests? I want to select the (just) opened order to read some information from it.

Marco vd Heijden
Moderator
4681
Marco vd Heijden 2016.10.22 16:30  
That's odd.
Timo Schroeter
1580
Timo Schroeter 2016.10.22 22:31  
Marco vd Heijden:
That's odd.
I tested it with the MA / MACD samples and it works fine. Must be a problem in front of the computer.
Buddha
6
Buddha 2016.10.23 09:05  
agreed, that is odd... but if you're using the Strategy Tester and running OrderSend() only once, then I think you will always get a ticket ID# of 1... if you alter that line of code to add another order and label your variables like "ticketId1 = OrderSend(...);" and "ticketId2 = OrderSend(...)" - do you get "1" and "2"? If so, then I suspect this might be culprit and if/when you run it through OnTick(), you should get a proper ID#.
/
To add comments, please log in or register