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 -2.621 Tracking Error 0.139 Treynor Ratio 0 Total Fees $0.00 |
class IndicatorTests(QCAlgorithm): def Initialize(self): # In addition to other initialize logic: self.SetStartDate(2020, 7, 1) self.AddEquity("SPY", Resolution.Daily) self.rsi = self.RSI("SPY", 14) # Creating a RSI self.rsiSMA = IndicatorExtensions.SMA(self.rsi, 3) # Creating the SMA on the RSI # alternatively self.rsiSMA2 = SimpleMovingAverage(3) self.rsi.Updated += self.UpdateSMA def UpdateSMA(self, sender, updated): self.rsiSMA2.Update(self.Time, updated.Value) def OnEndOfDay(self): if self.rsiSMA.IsReady: self.Plot("RSI SMA", "RSI", self.rsi.Current.Value) self.Plot("RSI SMA", "SMA of RSI", self.rsiSMA.Current.Value) self.Plot("RSI SMA", "SMA of RSI 2", self.rsiSMA2.Current.Value)