def add_MA(self, timeperiod=20, matype=0,
type='line', color='secondary', **kwargs):
"""Moving Average (customizable)."""
if not self.has_close:
raise Exception()
utils.kwargs_check(kwargs, VALID_TA_KWARGS)
if 'kind' in kwargs:
type = kwargs['kind']
name = 'MA({})'.format(str(timeperiod))
self.pri[name] = dict(type=type, color=color)
self.ind[name] = talib.MA(self.df[self.cl].values,
timeperiod, matype)
评论列表
文章目录