Hi everyone
I'm trying to get implied volatility using the historic options data, though it doesn't appear to be in qb.getOptionsHistory. Is there a way to calcuate it using a formula from OptionPriceModels?
I'd like to make some charts to test a hyptothesis I have about the dispairty between implied volatility and historic volatility over time on different sector ETFs. I'm also still a little new to the interface and primarily use python.
Thanks
Ethan
Rahul Chowdhury
Hey Ethan,
IV data for Options History in research isn't currently available. We opened a feature request for them which you can follow on its GH issue page. For now, you can calculate the Implied volatility by solving the Black-Scholes Model pricing equation based on the option data available. There is a guide on how to do this in the Introduction to Options tutorial.
Best
Rahul
Ethan Otto
Thanks for responding Rahul,
I read the tutorial and I'm trying to use the GetOptionHistory but it's a little tricky. The resolution is in minutes but I only need days. Just getting the options data for a few days takes a couple of miniutes to load. Is there a way to adjust the resolution? Or obtain just the first minute of the first day directly?
Â
Regards
Ethan
Rahul Chowdhury
Hey Ethan,
Options data is only available in minute resolution. You can get daily resolution options data by using a consolidator. One way to consolidate in research is to manually update a consolidator with bar data from the history call.
consolidator = TradeBarConsolidator(timedelta(days=1)) consolidator.DataConsolidated += OnDataConsolidated for bar in history: consolidator.Update(bar)
and then storing those bars as they are produced.
def OnDataConsolidated(self, sender, bar): daily_bars.append(bar)
You can also access precise minute data for options by using a history call with precise start and end times for GetOptionHistory.
option_history = qb.GetOptionHistory(goog.Symbol, datetime(2017, 1, 11, 10, 10), datetime(2017, 1, 13, 12, 10)
Best
Rahul
KungFuPanda
Hi Rahul
I m trying to get daily options data. You used :
for bar in history :
    consolidator.Update(bar)
Â
what's history ? I tried using option_history but it didn't work.
Shile Wen
Hi KungFuPanda,
I assume this is related to the question you asked earlier here, so I will close this thread. However, if you are still experiencing issues, please start a new discussion.
Best,
Shile Wen
Ethan Otto
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!