Hi,
I'm working on an option strategy. noticed option chain is missing for few days for Ticket = Ph
Am I missing any thing?
//Intialize
SetStartDate(2019, 01, 3);
SetEndDate(2019, 01,30);
SetCash(1000000);
AddEquity(ticker, Resolution.Minute);
var option = AddOption(ticker, Resolution.Minute);
option.SetFilter(u => u.Strikes(-7, 7).Expiration(TimeSpan.FromDays(45), TimeSpan.FromDays(90)));
//OnData
OptionChain callChain;
if (slice.OptionChains.TryGetValue(stock.OptionSymbol, out callChain))
{
// data missing for few dates like Jan 11,14
}
Kbsaravana
Please help to resolve this. I see options data are missing for most of dates. its polutes my back testing, Am I missing anything?
Rahul Chowdhury
Hi Saravana,
You are filtering for options that are expiring between 1.5 and 3 months in the future. Some stocks have a limited variety of expirations for their option chains, depending on their options cycle. It may also be possible that options for PH with expirations more than 45 days ahead are not liquid, which leads to a lack of data.
If you set your filter to
option.SetFilter(u => u.Strikes(-7, 7).Expiration(TimeSpan.FromDays(0), TimeSpan.FromDays(90)));
You'll see that plenty of contracts are available.
Best
Rahul
Kbsaravana
Thanks a lot for the catch. its working after fixing that.!
Kbsaravana
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!