Back

Problems getting option data

I want to calculate a daily volatility surface in the research environment. But its hard for me to get option data. I only want to calculate one to five volatility surface per day but

opt_hist = qb.GetOptionHistory(opt.Symbol, datetime(2017, 1, 11, 10, 10), datetime(2017, 1, 12, 10, 10))

gives a bulk of options and ticker prices for every minute. It is also an unindexable object. So opt_hist[0] doesnt work. How to extract and sort options in the Research environment?

If I set

qb.GetOptionHistory(opt.Symbol, datetime(2017, 1, 11, 10, 10), datetime(2017, 1, 11, 10, 15))

I also get options for date(2017, 1, 12). Also when I restart the kernel. This is strange.

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.


Hi Rupert,

To get all data of the option history requested, we could use `option_history.GetAllData()`. More information is here. The type of it is pandas.DataFrame, and you could find ways to sort it here. Here I've sorted then by askclose, and showing only first 5 rows of the DataFrame.

Hope it helps!

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