def chartEMA(self, n, color='red'): date = toDateTime(Data.getDates(self,self.interval,self.unit)) closep = Data.getCloses(self,self.interval,self.unit) ema = Indicators.ema(self,closep,n) self.p.line(date, ema, color=color)
def chartSMA(self, n, color='blue'): date = toDateTime(Data.getDates(self,self.interval,self.unit)) closep = Data.getCloses(self,self.interval,self.unit) sma = Indicators.sma(self,closep,n) self.p.line(date, sma, color=color)