I have been trying to use OptionChainProvider.GetOptionContractList but its not working. It worked for a couple weeks, but now it doesn't work. Is this because i am on a free account?
According to: “https://www.quantconnect.com/docs/v2/our-platform/organizations/tier-features”
The Free tier provides cloud access to datasets for all of the asset classes in our Datasets Market.
So whats the problem?
private Symbol _equitySymbol;
public override void Initialize()
{
SetStartDate(2022, 1, 3);
SetEndDate(2022,1, 28);
SetCash(6000);
var e = AddEquity("PINS", Resolution.Minute, dataNormalizationMode: DataNormalizationMode.Raw);
_equitySymbol = e.Symbol;
AddOption(e.Symbol, Resolution.Minute);
SetWarmUp(TimeSpan.FromDays(100), Resolution.Minute);
}
public override void OnData(Slice data)
{
var optionContracts = OptionChainProvider.GetOptionContractList(_equitySymbol, data.Time).ToList();
if(optionContracts.Count() > 0)
{
//Its always 0 so we never hit this
}
}
Nico Xenox
Hey @stevenaziz1
I dont think the free tier has anything to do with it.
To print out the values in your optionsContracts you can simply do a for loop
Doing it like this might solve your problem
Also you could take a look at this here:
Matttmo57
StevenAziz1 is correct. Something recently broke with qb.OptionChainProvider.GetOptionContractList. I used this method for a year and yesterday I noticed it is suddenly not working. I need this for my algorithms, so it has left me stalled out. Check out the simple example below. It returns an empty list where it used to return a list of symbols.
StevenAziz1 - It doesn't have anything to do with free account. I have a paid account.
@Jared Broad - Can we please get an admin to fix qb.OptionChainProvider.GetOptionContractList !!!
StevenAziz1
Its working again!
Matttmo57
Yup, excellent. Thanks for the heads up!
StevenAziz1
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!