Waiting a long time for IB to backfill
I using IB for live trade but the waiting time for backfill is very long(~20 minutes+),
I need daily bars of the last year for my strategy to start so its not many bars but still, I wait a long time,
here is my code :
I have a list of strategies(one in the added example) the symbols are read from csv file(2 in this case), then IB is registered and operated, nothing fancy.
feed_folder = 'quotes'
constituents = 
cerebro = bt.Cerebro() ibstore = bt.stores.IBStore(host='127.0.0.1', port=8002, clientId=33,notifyall=True) cerebro.broker = ibstore.getbroker() lookback = datetime.timedelta(days=200) strategies = [RiskPair_NN] for strategy in strategies: strats = cerebro.addstrategy(strategy=strategy, timeframe=datetime.timedelta(days=1),optimizing=False, feed_folder=feed_folder, start_date=datetime.datetime.now() - lookback,\ end_date=datetime.datetime.now()) symbol_list = ['SPY'] for strategy in strategies: with open(strategy.get_symbol_list_filename(), 'r') as f: reader = csv.reader(f) for ticker in reader: if len(ticker): symbol_list.append(ticker) symbol_list = set(symbol_list) for ticker in symbol_list: ib_dataname = ticker+'-STK-SMART-USD' data = ibstore.getdata(dataname=ib_dataname, name=ticker, clientId=33, reverse=False) cerebro.adddata(data) cerebro.run()
Can anyone share if they have to wait a long time too? can something be done about this?
You probably want to activate the
debugoption of the store and see which messages are delivered.
Can you please specify how to activate the option? and how can I know from the messages what is slowing me down?
Can you please specify how to activate the option?
Docs - Interactive Brokers - See the store options
and how can I know from the messages what is slowing me down?
I don't work for IB. It is just a guess that there may be something meaningful.