Hi there,
I've been trying to get live trading working for a zipline algo that has been successfully run in the backtest environment. I receive an error when trying to initiate tick collection from Interactive Brokers, using the code suggested in the Usage guide. I recreated the problem in a Jupyter notebook, using the zipline kernel and run_pipeline to generate the assets. My code:
output = run_pipeline(pipe, start_date="2020-07-01", end_date="2020-07-07", bundle='usstock-minute')
assets = output.index.get_level_values(1)
sids = [assets[i].real_sid for i in range(0, 6)]
qtr.collect_market_data("all-stk-etf-tick",
sids=sids)
print(sids)
['FIBBG000C2V3D6', 'FIBBG00B3T3HD3', 'FIBBG00LPXX872', 'FIBBG000V2S3P6', 'FIBBG000BDYRW6', 'FIBBG005P7Q881']
And the error I get:
2020-07-28 00:16:20 quantrocket.realtime: INFO Collecting market data for 6 securities in all-stk-etf-tick
2020-07-28 00:16:22 quantrocket.realtime: WARNING ibg1 client 10395 got IBKR error code 320: Error reading request:Message id 0. Unable to parse data. java.lang.NumberFormatException: For input string: "1715006.0"
2020-07-28 00:16:22 quantrocket.realtime: ERROR Traceback (most recent call last):
2020-07-28 00:16:22 quantrocket.realtime: ERROR File "sym://qrocket_realtime_collect_ibkr_workers_py", line 16, in wrapped
2020-07-28 00:16:22 quantrocket.realtime: ERROR File "sym://qrocket_realtime_collect_ibkr_market_data_py", line 79, in run
2020-07-28 00:16:22 quantrocket.realtime: ERROR File "sym://qrocket_realtime_collect_ibkr_market_data_py", line 119, in subscribe
2020-07-28 00:16:22 quantrocket.realtime: ERROR File "sym://qrocket_realtime_collect_ibkr_models_py", line 130, in get_request
2020-07-28 00:16:22 quantrocket.realtime: ERROR File "sym://qrocket_realtime_collect_ibkr_models_py", line 68, in _get_contract
2020-07-28 00:16:22 quantrocket.realtime: ERROR AttributeError: 'float' object has no attribute 'split'
2020-07-28 00:16:22 quantrocket.realtime: ERROR
2020-07-28 00:16:22 quantrocket.realtime: INFO Exiting IBKR market data collection due to errors
And here is the how the tick db was created:
qtr.create_ibkr_tick_db('all-stk-etf-tick',
universes='all-stk-etf',
fields=['LastPrice', 'Volume',
'BidPrice', 'AskPrice', 'BidSize', 'AskSize'])
I've successfully initiated tick collection from jupyter notebooks, so it doesn't seem to be a problem with the connection. Any ideas?