I have created some algo trading scripts and tested it against IB API which went on for a couple of days. I have checked the trade log and surprisingly found that some SLD executions were completed at previous days closing price (!) at times like 14:00, 16:00 etc. At the time of SLD exec, the price obviously did not exist, and was not even close. All of them were executed on IBKRATS. For example: bot purchases STK A at $100, 11:00 AM Monday STK A closes $110 Monday STK A is $90 TUESDAY 14:55 bot sells STK A at $110 at TUESDAY 15:00 (Mondays closing price) Severity: It happens many times and it's present in my IB trade log in the TWS as well compromising all testing. IB customer service never responded. I need some advice please: Am I completely missing something here? What is this phenomenon? Has anyone experienced such? How can I avoid sending an ORDER to the IBKRATS exchange? Additional example: The JSON is an extract from the reqExecutions API call which result is stored in my db. It shows that DCP was sold 13 aug 22h, outside trading hours at IBKRATS, at the exact closing price of 12 aug 15.34 which seems impossible. { "createdAt" : ISODate("2020-08-13T20:00:21.451Z"), "updatedAt" : ISODate("2020-08-13T20:00:21.451Z"), "symbolname" : "DCP", "side" : "SLD", "conId" : 37074230, "permId" : 420835838, "exec_ts" : 1597348819, "secType" : "STK", "exec" : { "orderId" : 874, "execId" : "00012ec5.5f35212b.01.01", "time" : "20200813 22:00:19", "exchange" : "IBKRATS", "side" : "SLD", "shares" : "100", "price" : 15.34, "permId" : 420835838, "clientId" : 0, "liquidation" : 0, "cumQty" : 100, "avgPrice" : 15.34, "orderRef" : { "strategy" : "intrastk", "order_ts" : 1597338538, "cost" : 14.59, "lmt" : 14.63, }, "evRule" : "", "evMultiplier" : NaN }, "contract" : { "conId" : 37074230, "symbol" : "DCP", "secType" : "STK", "expiry" : "", "strike" : 0, "right" : "", "multiplier" : "", "exchange" : "IBKRATS", "currency" : "USD", "localSymbol" : "DCP", "tradingClass" : "DCP" }, "shares" : 100, "price" : 15.34 }
There is a parameter in the order ticket where you set if you want an order to be filled outside the RTH - regular trading hours or not. You can also set your order destination to the primary exchange of a ticker which for DCP would be NYSE rather then to IBKR (SMART). SMART is default setting.
The paper trading accounts on IB is NOT meant to be accurate just so you know. It's intended to get you familiar with the functionalities of the software and that's all. It won't be 100% accurate in terms of trade reporting.
Thanks for the advices. Not using SMART will yield slower or timed out (in terms of slow filling) orders. There should be a mechanism to simply exclude IBKRATS from the SMART routing exchange list. Also testing TWS is one thing, but I still wonder how pro quant devs using IB API can test their algos with bogus data. Or pro quant devs are not using IB for simulation at all...