Is there any way I can get access to weekly options in a notebook?
The only way to have access to weekly options, that I know of, is that of using a Universe Selection Function. Unfortunately, I know no way to use a Universe Selection Function in a notebook: the examples provided only uses SetFilter().
Using a Universe Selection Function in a notebook would be very useful.
Many thanks!
Alexandre Catarino
Hi Joseph Cohen Bacchilega, we would expect that what you did would work or:
class MyQuantBook(QuantBook): def UniverseFunc(self, universe): return universe.IncludeWeeklys().Strikes(-2, 2).Expiration(timedelta(0), timedelta(365*2)) qb = MyQuantBook() spy = qb.AddOption("GOOG") spy.SetFilter(qb.UniverseFunc)
but neither works and throw the same exception that doesn't give us much information.
We are going to look into it. Thank you for the report.
Jack Simonson
Hi All,
We haven't resolved this yet but there is an issue open on GitHub which you can track here. Keep an eye on it for progress updates and we'll keep the community informed once we find a solution.
Frontline
Edit: solved
qb = QuantBook()
qb.AddEquity('GOOG', Resolution.Minute)
goog = qb.AddOption('GOOG')
def UniverseFunc(universe):
   return universe.IncludeWeeklys().Strikes(-2, 2).Expiration(timedelta(0), timedelta(60))
goog.SetFilter(UniverseFunc)
option_history = qb.GetOptionHistory(goog.Symbol, datetime(2017, 1, 4))
print(option_history.GetStrikes())
print(option_history.GetExpiryDates())
h = option_history.GetAllData()
Joseph Cohen Bacchilega
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!