atreyuxtrading / atreyu-backtrader-api

Atreyu's integration of IB Native API with backtrader
BSD 2-Clause "Simplified" License
93 stars 62 forks source link

clientId needs to be changed every time. #13

Open ypxie opened 1 year ago

ypxie commented 1 year ago

data = IBData(host='127.0.0.1', port=7497, clientId=2, name="GOOG", # Data name dataname='GOOG', # Symbol name secType='STK', # SecurityType is STOCK exchange='SMART',# Trading exchange IB's SMART exchange currency='USD', # Currency of SecurityType fromdate = dt.datetime(2016, 1, 1), todate = dt.datetime(2018, 1, 1), historical=True, what='TRADES', )

The code will hang on there on second run if clientId is not changed

hkdavid2008 commented 1 year ago

I got the below message when I try to get historical data: AttributeError: 'BarData' object has no attribute 'wap', the issue is located the below line: self.wrapper.historicalData(reqId, bar)