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
}
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
}