Hi, can anyone please tell me why is this code not giving any output? Thanks.

#region imports

from AlgorithmImports import *

#endregion

class SMAFuturesTradingAlgo(QCAlgorithm):

   def Initialize(self):

        self.SetBrokerageModel(BrokerageName.Zerodha)

        self.SetAccountCurrency("INR")

        self.SetStartDate(2017, 1, 1)

        #self.SetEndDate(2017, 5, 19)

        self.SetCash(100000)

        equity = self.AddIndex("NIFTY")

        future = self.AddFuture(Futures.Indices.Nifty50)

        future.SetFilter(TimeSpan.Zero, TimeSpan.FromDays(60))

        self.sma5 = self.SMA(equity.Symbol, 5)

        self.sma9 = self.SMA(equity.Symbol, 9)

 

    def OnData(self, data):

        if self.Portfolio.Invested:

            return       

        for chain in data.FutureChains:

            contracts = [contract for contract in chain.Value if contract.Expiry > self.Time + timedelta(days=5)]

            sorted_contracts = sorted(contracts, key=lambda x: x.Expiry)

            if len(sorted_contracts) == 0:

                continue

            contract = sorted_contracts[0]

            quantity = 2 if self.sma5 > self.sma9 else -2

            self.MarketOrder(contract.Symbol, quantity)

 

    def OnEndOfDay(self):

        self.Liquidate()