I am having problems retrieving 14 days historical data from IB. I recently made the switch from MATLAB to Python so I have a lot of catching up to do. Where do I go wrong? All help is appreciated.
import sys import pandas as pd from time import sleep, strftime from ib.ext.Contract import Contract #Make connection conn = Connection.create(port=7496, clientId=999) conn.connect() def var2(msg): print(msg) conn.register(var2, message.historicalData) def var3(msg): print(msg) if __name__ == '__main__': #conn = ibConnection() conn.register(var2, 'UpdateAccountValue') conn.register(var3, message.tickSize, message.tickPrice) conn.connect() def inner(): qqqq = Contract() qqqq.m_secType = "STK" qqqq.m_symbol = "ABN" qqqq.m_currency = "EUR" qqqq.m_exchange = "AEB" endtime = strftime('%Y%m%d %H:%M:%S') conn.reqHistoricalData(1,qqqq,endtime,"14 D","1 min","BID",1,1) data = reqHistoricalData conn.disconnect()