• Get access

OrderTicket() not an integer

To add comments, please log in or register
sam
42
sam  
When I execute my EA I get the following message

"2006.03.30 08:30:16 ea EURUSD,M30: ticket for OrderModify function must be an integer"

but my order modify code is OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop, OrderTakeProfit(),0,Red);

So I'm guessing OrderTicket() is not returning an integer... how can I fix that?
RickD
1226
RickD  
Try the following code:
int ticket = OrderTicket(); Print("ticket=", ticket); OrderModify(ticket, OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Red);
sam
42
sam  
Thanks, I put it in the code, let's see if it works now.

PS: Something I forgot to mention is that the orders can be modified during backtests but not when trading live or demo...
To add comments, please log in or register