Overall Statistics
Total Trades
1109
Average Win
0.49%
Average Loss
-0.06%
Compounding Annual Return
28.946%
Drawdown
22.700%
Expectancy
6.639
Net Profit
1209.143%
Sharpe Ratio
1.594
Probabilistic Sharpe Ratio
88.566%
Loss Rate
13%
Win Rate
87%
Profit-Loss Ratio
7.81
Alpha
0.203
Beta
0.829
Annual Standard Deviation
0.197
Annual Variance
0.039
Information Ratio
1.296
Tracking Error
0.139
Treynor Ratio
0.378
Total Fees
$1130.43
class StratMiniComptesMehdiK(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2010, 3, 1)
        self.SetCash(10000) 
        
        self.BaseWeight = 0.40
        
        self.LongEquityTraded = "TQQQ"
        self.LongBondTraded = "UBT"
        self.HedgingAssetTraded = "VXZ"
        self.EtfEquityLong = self.AddEquity(self.LongEquityTraded, Resolution.Hour)
        self.EtfBondLong = self.AddEquity(self.LongBondTraded, Resolution.Hour)
        self.AddEquity(self.HedgingAssetTraded, Resolution.Hour)
        
        self.tkr = [self.LongEquityTraded, self.LongBondTraded, self.HedgingAssetTraded]
        
        self.Schedule.On(
            self.DateRules.WeekStart(self.LongEquityTraded),
            self.TimeRules.AfterMarketOpen(self.LongEquityTraded, 30),
            self.Rebalance)
        
    def OnData(self, data):
        pass  
    
    def Rebalance(self):
        for stock in self.tkr:
            if stock == self.LongEquityTraded:
                weight = self.BaseWeight
            else:
                if stock == self.LongBondTraded:
                    weight = self.BaseWeight
                else:
                    weight = 1 - 2 * self.BaseWeight
            self.SetHoldings(stock, weight)