Overall Statistics
Total Trades
7
Average Win
33.59%
Average Loss
-6.24%
Compounding Annual Return
76.889%
Drawdown
52.800%
Expectancy
3.253
Net Profit
57.245%
Sharpe Ratio
1.475
Probabilistic Sharpe Ratio
51.772%
Loss Rate
33%
Win Rate
67%
Profit-Loss Ratio
5.38
Alpha
0.708
Beta
1.393
Annual Standard Deviation
0.629
Annual Variance
0.396
Information Ratio
1.714
Tracking Error
0.449
Treynor Ratio
0.666
Total Fees
$12.95
# Go Long /NQ and /VX futures with different weighting.

class LeverageForTheLongRunDiversifiedWeekly(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2020,1, 1)  #Set Start Date
        #self.SetEndDate(2020,6,20)    #Set End Date
        self.SetCash(100000)           #Set Strategy Cash
        self.spy = self.AddEquity("SPY", Resolution.Minute).Symbol
        self.futureNQ  = self.AddFuture(Futures.Indices.NASDAQ100EMini) 
        self.futureNQ .SetFilter(30, 120)    # Get contracts from 30 days to 120 days out
        #self.futureVX  = self.AddFuture(Futures.Indices.VIX) 
        #self.futureVX .SetFilter(30, 120)    # Get contracts from 30 days to 120 days out
        self.Settings.FreePortfolioValuePercentage = 0.05
        
        self.rebalance = True                            # Flag to initate trades
        
        # Increment rebalance timer at every week start
        self.Schedule.On(self.DateRules.MonthStart("SPY"), self.TimeRules.AfterMarketOpen("SPY", 30), self.Rebalance)
        
        self.contract = None

    def OnData(self, data):
        if not (data.ContainsKey(self.spy) and data[self.spy] is not None and \
                self.rebalance):
            return

        for contracts in data.FutureChains.Values:
            sorted_contracts = sorted(contracts, key=lambda c: c.Expiry, reverse = True)
            if len(sorted_contracts) == 0 or \
               (self.contract is not None and sorted_contracts[0].Symbol == self.contract.Symbol):
                continue
            self.contract = sorted_contracts[0]
            self.SetHoldings(sorted_contracts[0].Symbol, 0.1, True)
            
        self.rebalance = False     # Reset rebalance timer
        
    def Rebalance(self):
        self.rebalance = True