Hello, I have some questions about the attached algo that use multiple symbols to trade options before Earnings Dates. In the EarningsDates.py file, there is a dictionary with all Earnings Dates for 14 symbols.
The logic of the algo, is to buy cheap put options before Earning Dates, with the hope of price increment after Earnings. For this reason, I check for symbols that are 1 day before earnings dates(in the SymbolDate function), and for these symbols, the algo look for contracts with price 0.05(selectOption function).
The problem is that within backetsting period, the algo send orders only for 3 symbols(SBUX,MCD,YUM), but for others symbols that have Earning Date the next day, it doesn't look for contracts to buy. It seems that the chain for all symbols dont have these symbols. Specifically the symbols are EAT with earning date 2018-01-30, BLMN with earning date 2018-02-22, WING with earning date of 2018-02-22 and PZZA with earning date of 2018-02-27.
The contracts are "put", and on the Initializate funtion I have added all symbols and options with Minute Resolution.
Thank you
Rahul Chowdhury
Hey Nicolas,
When you are using options universe to filter your options, you are limiting the option chain to only weekly contracts with the
.WeeklysOnly()
. However not all stocks/ETFs have weekly contracts available, generally only the most popular do. You should instead useoption.SetFilter(-10, +10, timedelta(0), timedelta(30))
That way all the options will appear in the OptionChains.I simplified and made some changes to your code to make it functional.
Nicolas Ferrari
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!