Hello,

when i do a backtest the OnData function is triggert abd everything works as normal.

however when i go to live traiding it does not get executed somehow.

I tried it out with this example code but “test 1” and “test 2” are not getting logged, only “innit” gets logged.

class DeterminedFluorescentYellowHorse(QCAlgorithm):

   def Initialize(self):
       self.SetStartDate(2021, 5, 5)  # Set Start Date
       self.SetCash(100000)  # Set Strategy Cash
       self.AddEquity("SPY", Resolution.Minute)
       
       self.Log("innit")


   def OnData(self, data):
       '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
           Arguments:
               data: Slice object keyed by symbol containing the stock data
       '''
       
       self.Log("Test 1")

       if not self.Portfolio.Invested:
           self.SetHoldings("SPY", 1)
           self.Log("Test 2")

i did research for almost 8 hours now but i cant find the reason why it is not working.

can someone help me what the reason could be?

could the problem be the live server?