Overall Statistics
Total Trades
4
Average Win
13.60%
Average Loss
-0.04%
Compounding Annual Return
7984.249%
Drawdown
17.400%
Expectancy
162.366
Net Profit
158.754%
Sharpe Ratio
125.596
Probabilistic Sharpe Ratio
97.562%
Loss Rate
50%
Win Rate
50%
Profit-Loss Ratio
325.73
Alpha
109.457
Beta
2.589
Annual Standard Deviation
0.915
Annual Variance
0.836
Information Ratio
167.941
Tracking Error
0.672
Treynor Ratio
44.36
Total Fees
$17.56
class a(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2020, 4, 1)
        self.SetCash(30000)
        self.tqqq = self.AddEquity("TQQQ", Resolution.Hour)
        self.SetWarmup(50)
        self.b = 0
        self.c = 0
        self.Schedule.On(self.DateRules.EveryDay("TQQQ"), self.TimeRules.At(9, 30), self.EveryDayAfterMarketOpen)
        self.Schedule.On(self.DateRules.EveryDay("TQQQ"), self.TimeRules.At(16, 0), self.m)
        self.SetBenchmark("SPY")
    
    
    def OnData(self, data):
        return
                
    def EveryDayAfterMarketOpen(self):
        if not self.Portfolio["TQQQ"].Invested:
            self.SetHoldings("TQQQ", 1)
        if self.tqqq.Price > self.b*1.3:
            self.c = 1
            self.SetHoldings("TQQQ", -1)
            
            
            
    def m(self):
        self.b = self.tqqq.Price
        if self.c == 1:
            self.SetHoldings("TQQQ", 1)