I cannot fire a sitmultaneous long/short order in IB API, is there a problem with my code?
The code will only fire sell order for GOOG stock but not the buy order for MSFT stock
Hello Woo,
From the code, it appears that you are not increasing the order_id for each order. IB API requires you to specify a unique order id in the increasing order for each order you place.
Here, you are initiating the order id with 0, and then calling the start function which tries to place orders using the same order id given by the nextValidId().
Also, please check the error you are getting when placing the MSFT order.
Thanks.