Overall Statistics
Total Trades
0
Average Win
0%
Average Loss
0%
Compounding Annual Return
0%
Drawdown
0%
Expectancy
0
Net Profit
0%
Sharpe Ratio
0
Probabilistic Sharpe Ratio
0%
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
0
Beta
0
Annual Standard Deviation
0
Annual Variance
0
Information Ratio
-0.808
Tracking Error
0.192
Treynor Ratio
0
Total Fees
$0.00
Estimated Strategy Capacity
$0
Lowest Capacity Asset
# Donchian Channel Slope (DCHS)

# -------------------------------------------------
STOCK = 'SPY'; DCH_UB = 20; DCH_LB = 20;  ROC = 18;
# -------------------------------------------------

class DonchianChannelSlope(QCAlgorithm):
    
    def Initialize(self):
        self.SetStartDate(2018, 1, 1) 
        self.SetEndDate(2021, 9, 17)   
        
        self.stock = self.AddEquity(STOCK, Resolution.Daily).Symbol
        self.SetWarmUp(DCH_UB, Resolution.Daily)
        self.dch = self.DCH(self.stock, DCH_UB, DCH_LB, Resolution.Daily)
        self.dch_slope = IndicatorExtensions.Of(RateOfChange(ROC), self.dch.UpperBand)
        

    def OnData(self, data):
        if self.IsWarmingUp or not self.dch_slope.IsReady: return
    
        self.Plot("DonchianChannelSlope", "dch_slope", self.dch_slope.Current.Value)
        self.Plot("DonchianChannelSlope", "zero", 0)