IB TWS and IB api live data inaccuracy

Posted By: marr

IB TWS and IB api live data inaccuracy - 11/23/20 23:43

I was testing the IB live data through IB api using zorro and compare the close price between TWS chart and the one printed on zorro

I came across with this result on TSLA

```
[Mon 20-11-23 20:53] (522.13)
[Mon 20-11-23 20:54] (521.96)
[Mon 20-11-23 20:55] (521.69)
[Mon 20-11-23 20:56] (521.06)
[Mon 20-11-23 20:57] (521.47)
[Mon 20-11-23 20:58] (521.49)
[Mon 20-11-23 20:59] (521.16)
Market closed on 11-23 21:00:00 (local 16:00)
Logout.. ok



On TWS chart
[Mon 20-11-23 20:53] 521.95
[Mon 20-11-23 20:54] 521.21
[Mon 20-11-23 20:55] 520.88
[Mon 20-11-23 20:56] 521.51
[Mon 20-11-23 20:57] 521.40
[Mon 20-11-23 20:58] 521.15
[Mon 20-11-23 20:59] 521.85
```

That was the last 6 one minute bars of the log as I observed that the two doesn't usually equal. Is this normal? how do I improve the live data stream on IB?
Posted By: jcl

Re: IB TWS and IB api live data inaccuracy - 11/24/20 08:39

Make sure to compare the same price. Prices can be ask, bid, or last.
Posted By: marr

Re: IB TWS and IB api live data inaccuracy - 11/24/20 10:03

The printed above was for closing price, tried to use priceClose() which shows the same as default on log and compare to the close price of each candle on TWS chart on same one min timeframe.

I found out the pricetype default on IB was bid/ask how do I enforce to use the Last? to match with the IB TWS
© 2024 lite-C Forums