Back

Optionchain is empty

Here is my code. It is directly from the tutorial but doesnt work. In the logs I get an "test" but no "ok", because there is no data! Tried with different ticker symbols.

 

from BasicTemplateLibrary import BasicTemplateLibrary

class Main(QCAlgorithm):
    
    def Initialize(self):
       
        self.SetStartDate(2018, 12, 1)  #Set Start Date
        self.SetEndDate(2018, 12, 30)  #Set End Date
        self.SetCash(50000)  #Set Strategy Cash
        equity = self.AddEquity("GOOG", Resolution.Daily)
        option = self.AddOption("GOOGL", Resolution.Minute)
        self.symbol = option.Symbol
        self.Debug("test")
        x = BasicTemplateLibrary()
        
        
    def OnData(self,slice):
        
        for i in slice.OptionChains:
            self.Debug("ok")
            
 

Update Backtest







0

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.


Hi Rupert,

There is nothing wrong with your code. Currently our data for options stop on 2018-11-30, and that's the reason you have empty option chain with your start date setting.

We will publish our up-to-date option data in just a few days. Meanwhile, you could implement your algorithm with end date earlier 2018-11-30 for these days. Hope it helps!

1

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.


Update Backtest





0

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.


Loading...

This discussion is closed