I'm working on a strategy for trading options with short term expiration, and I need to ensure my universe only has symbols with options expiring in the current week.
How might one do this using coarse / fine selection?
If this is not possible, are there any websites out there that list stocks and their options expiration dates? I could use this information to manually filter symbols.
Louis Szeto
Hi .ekz.
I believe the filter in coarse / fine selection is only accepting timedelta function. Meanwhile, one way to do it is include filter of (timedelta(days=1), timedelta(days=7)), then use Expiry function to filter again.
Cheers
Louis
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.
.ekz.
Unfortunately, this would not work Louis Szeto . I need the filtering done at the universe level, before we subscribe to any data that comes through onData.
Also, we wouldn't filter on such a low level (looking at individual contract expiries). We aren't talking about a universe of Option contracts. We want to filter out companies.
The timetable of stocks options expirations is publicly available. Eg we know that TSLA has weekly options, as mentioned on the CBOE site. Ideally we should be able to access this information when filtering universes, the same way we can filter out companies that had recent earnings announcement. I'm hoping there is a way to could solve my problem, by filtering against something like: Company.nextExpiryDate. I'm just not sure what it is.
Hope my question is more clear now.
Varad Kabade
Hi .ekz.,
In the coarse universe selection function, we can use the OptionChainProvider to search for equities that have contracts expiring according to our requirements. In backtesting, we have to rely upon the use of the OptionChainProvider solely to search for these equities. In live trading, we can import a custom data source like this. See the attached backtest for a demonstration of backtesting.
Best,
Varad Kabade
.ekz.
Got it. I had thought of this, but I assumed there was a more performant approach.
I'll go this approach and see how it performs, but may end up creating a static data source of expiration schedules and load it into backtests via dropbox. We'll see.
Thanks Varad kabade
.ekz.
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!