Hello, I am inexperienced at coding is anybody willing to help me get a program to work as intended?

Want the program to open one buy order if there are no open positions, buy every 5% drop from the current first open orders fill price, and close orders when at a 5% profit. Hope its not an easily fixable mistake!

 

# region imports
from AlgorithmImports import *

# endregion

class EmotionalSkyBlueCamel(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2005, 1, 1)
        self.SetEndDate(2023, 1, 1)
        self.SetCash(100000)
        self.svxy = self.AddEquity("SVXY", Resolution.Hour).Symbol
        
        

    
    def OnData(self, data):
        
        AccountBalance = self.Portfolio.TotalPortfolioValue
        price = self.Securities[self.svxy].Price

        UnrealizedProfit = self.Portfolio.TotalUnrealisedProfit
        OrderAmount = int((self.Portfolio.TotalPortfolioValue / 100 * 5) / price)
        Price5PC = 0
        PC = 0

        
        

        if not self.Portfolio.Invested and not self.Transactions.GetOpenOrders(self.svxy):
            Quantity =  self.CalculateOrderQuantity(self.svxy, .3)

            Price5PC = price * .95
            PC = price
            self.MarketOrder("SVXY", Quantity)
            self.LimitOrder("SVXY", Quantity * -1, price*1.05) 
            
        

        if Price5PC > price:
            Quantity =  self.CalculateOrderQuantity(self.svxy, .3)

            self.MarketOrder("SVXY", Quantity)
            self.LimitOrder("SVXY", Quantity * -1, price*1.05)
            Price5PC = Price5PC - (PC * .95)