Overall Statistics
Total Trades
401
Average Win
1.08%
Average Loss
-0.87%
Compounding Annual Return
23.731%
Drawdown
22.900%
Expectancy
1.083
Net Profit
769.700%
Sharpe Ratio
1.642
Probabilistic Sharpe Ratio
93.093%
Loss Rate
7%
Win Rate
93%
Profit-Loss Ratio
1.24
Alpha
0.221
Beta
0.252
Annual Standard Deviation
0.154
Annual Variance
0.024
Information Ratio
0.657
Tracking Error
0.194
Treynor Ratio
1
Total Fees
$898.83
# Inspired by the theory here:
# https://seekingalpha.com/article/4299701-leveraged-etfs-for-long-term-investing
# https://www.quantconnect.com/forum/discussion/7708/using-levered-etfs-in-ira-10-years-24-cagr-1-56-sharpe/p1

class MultidimensionalTransdimensionalPrism(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2010, 2, 1)               # Earliest start date for all ETFs in universe 2/1/10
        self.SetEndDate(2020, 3, 27)
        self.SetCash(100000) 
        self.AddEquity("TQQQ", Resolution.Hour)    # 3x QQQ
        self.AddEquity("UBT", Resolution.Hour)     # 3x 20yr Treasury
        self.AddEquity("UST", Resolution.Hour)     # 3x 10yr Treasury
        self.AddEquity("TVIX", Resolution.Hour)
        self.tkr = ["TQQQ", "UBT", "UST", "TVIX"]
        
        self.Schedule.On(
            self.DateRules.MonthStart("UST"),
            self.TimeRules.AfterMarketOpen("UST", 150),
            self.Rebalance
        )
    def OnData(self, data):
        pass        
    def Rebalance(self):
        for stock in self.tkr:
            if stock =='TVIX':
                weight = 0.05
            else:
                weight = 0.315
            self.SetHoldings(stock, weight)