I developed an strategy and for some reasons I need to know the OrderId in advance, and one of my reasons is to control if my trade has ended or not. When developing and runing in playback I hadn't this issue, but when using it in my production account I noted that the Id of the order is different of the Id in my trade, making it impossible for me to update the orders if I have to.
The code that I used to create the order was this one
and after that I do the submission with this code
The other utility for the orderId is to create the Stop Loss order and the Target Order, so I have one of this for each entry, so I'm using the order id of the entry as the oco id of the target and stop loss and in the next image you can see that the ids are different.
Entry - 1 -> ID: 8491912 | Targe -> OCO_ID: 56b8a81
How can I solve this issue? I can't use the methods available, because it may not return a order object.

Comment