0
reqHistoricalData
を使用して、株式の履歴データを取得しようとしています。私は1年前を振り返りたいが、私の機能は今週からのデータだけをプリントアウトする。インタラクティブ・ブローカーから `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()
誰でも手助けできますか?週間(1年= 52週)の範囲にわたって