In all my replay testing and demo trading with IB I did not see any issues. All worked as it should.
I did hit a weird situation this morning around 8:30 am. The strategy submitted stop limit at 8:31, and it was executed at 8:33:01 and immediately closed that same second at 8:33:01. The reason why it was closed is because that same second strategy (or something else) submitted stop loss and profit target several points below my filled order price, and as the result of profit target being below market, the broker closed the position immediately. Normally strategy puts stop loss few point below and take profit few points above entry order (for Longs).
This definitely looks like a bug, and I would normally try to figure out what part of my code caused it. Here is the strange part.
I have the following code in my strategy: TraceOrders = true; This code adds every order that strategy submits to Output window.
The 2 weird (below filled order price) stop loss and profit target orders, that I mentioned above, are visible in control center Log tab, but they are not in Output window.
So the questions if they are not in output window and my strategy did not submit them, where did they come from?
This only happened once, in all other trades everything worked as it should.
Thanks,
redduke
Comment