Some things in the post may need a bit of clarification, to try to discern where the problem may be (should there be)
python ibtest.py --port 8099 --clientId 1 --data0 IBUS500-CFD-SMART --timeframe Minutes --compression 1 --what BID --broker --rtbar
This is for sure running a modified version of backtrader, because as discussed in another thread, the
CFD notation is not supported. But for the sake of a fruitful post, let's assume the modification wer properly done and only for the contract parsing part.
sends endtime in GMT to reqHistoricaData and assuming the exchange as DAX (CET)
The command above is not querying the
DAX, but something else. If
IBUS500-CFD-SMART also uses a
CET timezone is unknown but unlikely, because this
CFD seems to track the
EST timezone would be more probable.
Time gap between historical and live data
... last few lines of the data showing difference where historic data ends (actually its hours behind) and current prices.
Data0, 0056, 736338.704861, 2017-01-09T16:55:00.000000, 2277.12, 2277.13, 2276.87, 2276.87, -1, 0, 2277.12
Data0, 0057, 736338.705556, 2017-01-09T16:56:00.000000, 2276.87, 2276.88, 2276.87, 2276.87, -1, 0, 2277.02
***** DATA NOTIF: LIVE
Data0, 0058, 736338.705845, 2017-01-09T16:56:25.000000, 2272.93, 2272.93, 2272.93, 2272.93, -1, 0, 2276.182
Data0, 0059, 736338.705903, 2017-01-09T16:56:30.000000, 2272.93, 2272.93, 2272.93, 2272.93, -1, 0, 2275.344
The output above shows only a gap between
1-minute bar which comes from the historical download) and
2017-01-09T16:56:25. It doesn't seem to be hours behind. The obvious difference is that:
- The timeframe and compression have been set to
1 and this has been used to download the historical data.
- The sample has not been requested to further resample (with
--resample) incoming data and delivers the
5-seconds bars it receives