-
|
I'm currently at the point of paper trading in production. I'm running into an issue where run_stack_handler creates too many orders and I get more fills than the system expects. From the logs I see that stack_handler submits an order to IB of the correct size but ib_insync both an error and a warning. This is later followed by a warning from stack_handler "Order has been cancelled: not by algo." a few seconds later stack_handler submits an order again (I assume thinking the original order has been cancelled). The problem is that the order actually hasn't been cancelled and is still active on IB. This continues in a loop with multiple orders being submitted to IB and stack_handler thinking they are cancelled because ib_insync is telling it that. ib_insync is returning "Error 10349" which evidently is a market data subscription missing (it is because I was hoping to paper trade without paying the fees). I know I can probably fix this by paying for the subscriptions. But it seems to me that if an order remains active on IB, ib_insync should not indicate cancellation. What ultimately happens is the loop stops when an order is filled. However extra orders are still active on IB which then fill and causes stack_handler to crash and then my orders stacks are a mess. The above is what I think is happening. I've attached part of the logs where this is happening. My questions are as follows:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
See ib-api-reloaded/ib_async#190 Note: I am using ib_insync, but maybe we should consider switching if it looks like the ib_async fork is being actively maintained. I have not seen this issue though. Why not? Is it only related to paper trading? This probably won't solve your problem, but one thing I always change in the IB API settings (TWS or Gateway): Configure > Settings > API > Precautions > check "Bypass Order Precautions for API Orders". I vaguely recall that it was causing problems for me in the past, but I can't remember the details. |
Beta Was this translation helpful? Give feedback.
-
Interactive order stack is the right tool, but the exact steps will vary depending on your exact problem.
|
Beta Was this translation helpful? Give feedback.
See ib-api-reloaded/ib_async#190
Note: I am using ib_insync, but maybe we should consider switching if it looks like the ib_async fork is being actively maintained.
I have not seen this issue though. Why not? Is it only related to paper trading?
This probably won't solve your problem, but one thing I always change in the IB API settings (TWS or Gateway): Configure > Settings > API > Precautions > check "Bypass Order Precautions for API Orders". I vaguely recall that it was causing problems for me in the past, but I can't remember the details.