Overall Statistics
Total Trades
10
Average Win
10.16%
Average Loss
-4.73%
Compounding Annual Return
-17.926%
Drawdown
28.900%
Expectancy
-0.371
Net Profit
-9.329%
Sharpe Ratio
-0.362
Probabilistic Sharpe Ratio
11.983%
Loss Rate
80%
Win Rate
20%
Profit-Loss Ratio
2.15
Alpha
-0.047
Beta
0.549
Annual Standard Deviation
0.266
Annual Variance
0.071
Information Ratio
-0.026
Tracking Error
0.258
Treynor Ratio
-0.176
Total Fees
$52.37
Estimated Strategy Capacity
$11000000.00
Lowest Capacity Asset
BGU U7EC123NWZTX
# region imports
from AlgorithmImports import *
# endregion

class DeterminedApricotSalmon(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2022, 3, 3)
        self.SetEndDate(2022, 8, 31) 
        self.SetCash(100000)  # Set Strategy Cash
        self.spxl = self.AddEquity("SPXL", Resolution.Daily)
        self.AddEquity("SPY", Resolution.Daily)
        self.AddEquity("UVXY", Resolution.Daily)
        self.sma = self.SMA("SPY", 200, Resolution.Daily, Field.Close)

    def OnEndOfDay(self, symbol):
        if not self.Portfolio.Invested:
            if (self.Securities["SPY"].Close > self.sma.Current.Value):
                #self.Liquidate("SPY")
                self.SetHoldings("SPXL", 1.0)
                #self.SetHoldings("UVXY", .2)

        elif self.Portfolio.Invested:
            if (self.Securities["SPY"].Close <= self.sma.Current.Value):
                #self.SetHoldings("SPY", 1.0)
                self.SetHoldings("SPXL", 0)
                #self.Liquidate("UVXY")