Back

Running 'Options Historical Data' sample request from documentation generates different results in research notebook?

Hi, I am new to the platform so apologies for what I assume is an obtuse question...

When I attempt to duplicate this sample query in the Options Historical Data section of documentation: 

goog = qb.AddOption("GOOG")
goog.SetFilter(-2, 2, timedelta(0), timedelta(180))
option_history = qb.GetOptionHistory(goog.Symbol, datetime(2017, 1, 11, 10, 10),
datetime(2017, 1, 13, 12, 10))
print (option_history.GetExpiryDates())

I do not get the same results as in the sample.

Sample result:

[datetime.datetime(2017, 1, 20, 0, 0), datetime.datetime(2017, 2, 17, 0, 0)]

My result:

[datetime.datetime(2017, 1, 20, 0, 0), datetime.datetime(2017, 2, 17, 0, 0),
datetime.datetime(2017, 3, 17, 0, 0), datetime.datetime(2017, 6, 16, 0, 0)]

Could anyone please let me know where I am going wrong?

Thank you!

Update Backtest







(P.S. Also, why does even the sample in documentation not return the dates 1/27/2017, 2/3/2017, and 2/10/2017? I see in the data explorer that data for these dates does indeed exist.)

Thank you!

0

I have solved my issues and this thread can be deleted/closed (sorry, couldn't figure out how myself).

With regard to my original post, it appears the documentation is just incorrect and timedelta(180) is not what is producing those results.

With regard to my follow up comment, I now realize that the default time period returned is monthly, and found the solution to get shorter time periods in this post: 

https://www.quantconnect.com/forum/discussion/4552/weekly-options-in-notebook

Thank you.

1

Thanks Jason! Always good when people answer their own questions. Can you please report the issue with documentation to support@quantconnect.com (where is the issue?) and we'll push a fix.

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