Hi, Guys! Need some help trying to realize some simple stuff: buy AAPL stock if close > open*1.01, exit - first hour minimum.

First of all, got some bug.. don't understand why it happend, because part of backtesting was good, so I got some in and out orders.

Secondly, I don't understand why opening price differs from TradingView, it should be the same, beacause DataNormalizationMode ( set to Raw); 

But in Log: 2021-06-08 09:35:00 Open price: @126.6, in Tradinview: 127,;

8606_1637844190.jpg
class VirtualLightBrownAnguilline(QCAlgorithm):

    # 1 stock algo
    # 5 Minute resoultion
    # Buy if change from the open > 1%
    # Sell stop - 1 hour min
    # How to make it effective? 
    openingBar = None 
    
    def Initialize(self):
        self.SetStartDate(2021, 5, 24)  # Set Start Date
        self.SetCash(100000)  # Set Strategy Cash
        self.symbol = "AAPL"
        self.aapl = self.AddEquity(self.symbol, Resolution.Minute)
        self.Securities[self.symbol].SetDataNormalizationMode(DataNormalizationMode.Raw);
        self.SetBenchmark("SPY")
        self.fh1min = 0
        # self.SetBenchmark("QQQ")
        self.Consolidate(self.symbol, timedelta(minutes=5), self.OnDataConsolidated)
        
        
        
    def OnData(self, data):
        
        # if current price greater than open at 1% - open long position
        if not self.Portfolio.Invested:
            if (self.openingBar != None and data[self.symbol].Close > self.openingBar.Open*1.01):
                self.SetHoldings(self.symbol, 1)
        else: 
            # close if current price less than 1HMin. 
            if ((self.Time.hour==10 and self.Time.minute >=30) or 
             (self.Time.hour>10)):
                if (data[self.symbol].Low < self.fh1min):
                    self.Liquidate()
        
        # if not self.Portfolio.Invested:
        #    self.SetHoldings(self.aapl.Symbol, 1)
            
    #  Create a function OnDataConsolidator which saves the currentBar as bar 
    def OnDataConsolidated(self, bar):
        if bar.Time.hour == 9 and bar.Time.minute == 30:
            self.openingBar = bar
            self.fh1min = bar.Low
            self.Log("Open price: @" + str(self.openingBar.Open))
        else:
            if (bar.Time.hour == 9 and bar.Time.minute >30) or (bar.Time.hour==10 and bar.Time.minute <=30):
                if (bar.Low < self.fh1min):
                    fh1min = bar.Low