0
Ich versuche, historische Daten für den Bestand mit reqHistoricalData
zu erhalten. Ich möchte 1 Jahr zurückschauen, aber meine Funktion druckt nur Daten dieser Woche aus.Wie erhalte ich historische Aktienkurse von Interactive Broker mit `ibpy`?
conn.connect()
conn.reqCurrentTime()
oid=cid #cid = 105
contract = make_contract2(265598, 'STK', 'SMART', 'SMART', 'USD') #AAPL
endtime = strftime('%Y%m%d %H:%M:%S')
conn.reqHistoricalData(1,contract,endtime,"1 Y","1 day","TRADES",1,1)
time.sleep(5)
conn.cancelHistoricalData(1);
sleep(5)
print('disconnecting')
time.sleep(1) #Simply to give the program time to print messages sent from IB
conn.disconnect()
Kann jemand helfen?