IBG1 fails / does not fetch historical data

I tested everything - from changing subscriptions to pro expensive ones / to changing paper and live IBKR accounts / to resetting settings - this code is like magic… worked in the past but not anymore / I am not 100% sure the problem is on IBKR side - the code below keeps returning this in logs:

quantrocket_history_1|Retrying historical data request for 3 Y of 1 day TRADES for VIX IND (sid IB13455763) ending 20201109 05:59:59 GMT after no response received from IBKR after 45 seconds (retry 9 of 10)
quantrocket_history_1|ibg1 client 3117 got IBKR error code 366: No historical data query found for ticker id:15
quantrocket_history_1|Issuing to ibg1 historical data request for 3 Y of 1 day TRADES for VXD IND (sid IB33716359) ending 20201109 05:59:59 GMT
quantrocket_history_1|Retrying historical data request for 3 Y of 1 day TRADES for VIX IND (sid IB13455763) ending 20201109 05:59:59 GMT after no response received from IBKR after 45 seconds (retry 9 of 10)
quantrocket_history_1|ibg1 client 3117 got IBKR error code 366: No historical data query found for ticker id:18
quantrocket_history_1|Issuing to ibg1 historical data request for 3 Y of 1 day TRADES for VIX IND (sid IB13455763) ending 20201109 05:59:59 GMT
<
Browsing forums, I had identical experience with IBKR to this post:


All same issues… no subscription permission, not historical data, removing any settings from
test.quantrocket.ibg.permissions.yml / helped with no subscription permission - might be Quantrocket issue…

The execution code is below… would very much appreciate your help, thank you in advance!

Create VIX Universe from IBKR

from quantrocket.master import *
from quantrocket.history import *
delete_universe(“vxd-unv”)

Create Univ. with VIX and VXD index data.

download_master_file(“vxd_unv.csv”, sids=[“IB33716359”,“IB13455763”])
create_universe(“vxd-unv”, infilepath_or_buffer=“vxd_unv.csv”, replace=True)

Create vix vix-1d database

db_name = “vxd-1d-db”
drop_db(db_name, db_name)
create_ibkr_db(db_name, universes=“vxd-unv”, bar_size=“1 day”, start_date=“2019-01-01”)

Collect data for vix-1d

collect_history(db_name, priority=True)
wait_for_collections(db_name, timeout=“15min”)

Test after data was collected:

from quantrocket import get_prices
from datetime import date, datetime, timedelta
try: end_date = get_datetime(‘US/Eastern’) - timedelta(days=1)
except: end_date = datetime.now() - timedelta(days=1)

Get Data:

start_date = end_date - timedelta(days=100)
vxd_df = get_prices(“vxd-1d-db”, start_date=start_date, end_date=end_date, sids=‘IB33716359’, fields=“Close”)
vix_df = get_prices(“vxd-1d-db”, start_date=start_date, end_date=end_date, sids=‘IB13455763’, fields=“Close”)
close = vxd_df.loc[‘Close’][‘IB33716359’] + vix_df.loc[‘Close’][‘IB13455763’]
close.columns = [‘Date’, ‘Close’]
close.tail(3)

Sometimes the IBKR API doesn’t return data on the weekends due to server maintenance. Most likely if you try now it will work fine.

thank you… it did work!
to be honest this thoguh - is a bit concernning… it is like magic… works one day/ does not another… and btw… I tested it last week during the week - and it did not work either - but then worked today :slight_smile: Brian have to ask - have you done anything on your end?

Not quite sure what you’re asking, but if you’re asking if I am withholding the real answer from you, no I am not.