Overall Statistics
Total Trades
178
Average Win
9.49%
Average Loss
-2.69%
Compounding Annual Return
37.737%
Drawdown
50.700%
Expectancy
0.996
Net Profit
437.850%
Sharpe Ratio
0.915
Probabilistic Sharpe Ratio
24.322%
Loss Rate
56%
Win Rate
44%
Profit-Loss Ratio
3.52
Alpha
0.491
Beta
0.299
Annual Standard Deviation
0.539
Annual Variance
0.29
Information Ratio
0.871
Tracking Error
0.559
Treynor Ratio
1.651
Total Fees
$550.40
class MultidimensionalVentralAntennaArray(QCAlgorithm):

    def Initialize(self):
        self.SetCash(10000)  # Set Strategy Cash
        self.SetStartDate(2015, 1, 1)
        self.SetEndDate(2020, 4, 1)
        self.SetBenchmark("SPHB")
        
        self.spy = self.AddEquity("SPXL", Resolution.Daily)
        self.Securities["SPXL"].SetLeverage(2)
        
        # Measures the change in SPY prices between 2 minutes
        self.spyMomentum = self.MOMP("SPXL", 2, Resolution.Daily)
        
        self.SetRiskManagement(MaximumDrawdownPercentPerSecurity(0.005))
        
        
        for i in range(1, 31):
            self.Schedule.On(self.DateRules.On(2018, 12, i), \
                             self.TimeRules.AfterMarketOpen("SPXL", 1), \
                             self.SpecificTime)
                             
            self.Schedule.On(self.DateRules.On(2020, 1, i), \
                             self.TimeRules.AfterMarketOpen("SPXL", 1), \
                             self.SpecificTime)
                             
            self.Schedule.On(self.DateRules.On(2020, 3, i), \
                             self.TimeRules.AfterMarketOpen("SPXL", 1), \
                             self.SpecificTime)
            
        for i in range(1, 28):
            self.Schedule.On(self.DateRules.On(2020, 2, i), \
                             self.TimeRules.AfterMarketOpen("SPXL", 1), \
                             self.SpecificTime)
            

        for i in range(1, 30):
            self.Schedule.On(self.DateRules.On(2020, 4, i), \
                             self.TimeRules.AfterMarketOpen("SPXL", 1), \
                             self.SpecificTime)


    def OnData(self, data):
        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
            Arguments:
                data: Slice object keyed by symbol containing the stock data
        '''


        
        
        if self.spyMomentum.Current.Value > 0:
            self.SetHoldings("SPXL", 1.0)
            
        
            
            
    def SpecificTime(self):
        self.SetHoldings("SPXL", -1.0)