Back

Historic Implied Volatility in Research Notebook

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

Update Backtest







0

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.


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

0

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.


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

0

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

1

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.


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.

0

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

0

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.


Update Backtest





0

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.


Loading...

This discussion is closed