This repository has been archived by the owner on Mar 14, 2024. It is now read-only.
Historical option data for non-expired contracts #446
Unanswered
Khrizz9000
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Have you been able to request historical data for other underlyings such as SPX or AAPL Stock? I don't know exactly what your familiarity is with the library and IBKR. If so, you should be able to simply create the contract object for the underlying you wish (the unexpired option contract) and the request historical data on it. I've recreated a MRE below that does just this getting a 1 day duration of 1-minute data: contract = Option(
symbol='SPX', lastTradeDateOrContractMonth='20220304',
strike=4400, right='C', exchange='CBOE',
multiplier=100, currency='USD')
bars = ib.reqHistoricalData(
contract=contract, endDateTime='20220228 16:00:00 EST', durationStr='1 D', barSizeSetting='1 min',
whatToShow='TRADES', useRTH=True) After converting the data to a pandas dataframe via
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
I would like to get historical data (ideally hourly or less) for non-expired option contracts. TWS API should provide that data (source: https://www.tradersinsight.news/ibkr-quant-news/historical-options-futures-data-using-tws-api/). I have not found a way to get that data using the beautiful ib_insync lib. Is there a way to do that? If so, how?
Thx in advance
Beta Was this translation helpful? Give feedback.
All reactions