Hello im trying to use a strategy that works with daily returns, when there is a divergence of returns then we buy and sell, its just academic, but at the moment im trying to apply returns and model it its not running goos saying 

Runtime error: float object has no attribute shift. If anyone can help me would be great. Thanks!!e 'shift'

THE CODE

 

import numpy as np
import pandas as pd
class WTIBRENTSpread(QCAlgorithm):
   def Initialize(self):
       self.SetStartDate(2022, 1, 1)
       self.SetCash(10000)
       self.symbols = ["CDNS","SNPS"]
       for symbol in self.symbols:
           data = self.AddEquity(symbol, Resolution.Hour)
       
   def OnData(self, data):
       symbol1 = self.Symbol(self.symbols[0])
       symbol2 = self.Symbol(self.symbols[1])
       
       if symbol1 in data.Keys and symbol2 in data.Keys and data[symbol1] and data[symbol2]:
           x = data[symbol1].Price
           y = data[symbol2].Price
           
           price_1=x/x.shift(1)-1
           price_1=y/y.shift(1)-1

           if x != 0 and y != 0:
               spread=price1-price2
               self.spread.Add(spread)
       if self.spread.IsReady:
           if (self.Time.date() - self.Securities[symbol1].GetLastData().Time.date()).days < 5 and (self.Time.date() - self.Securities[symbol2].GetLastData().Time.date()).days < 5:
               
               if spread > 15:
                   self.SetHoldings(symbol1, -1)
                   self.SetHoldings(symbol2, 1)
                   
               elif spread < 15:
                   self.SetHoldings(symbol1, 1)
                   self.SetHoldings(symbol2, -1)
           else:
               self.Liquidate()