def _boll(self, data, n): """ 向量化运行的均值函数。 """ data = transform2ndarray(data) upper, middle, lower = talib.BBANDS(data, n, 2, 2) return (upper, middle, lower)
def _moving_average(self, data, n): """ 向量化运行的均值函数。 """ data = transform2ndarray(data) return talib.SMA(data, n)
def __init__(self, tracker, open, close, volume, name='volume', colorup='r', colordown='b', width=1): super(Volume, self).__init__(tracker, name) self.value = transform2ndarray(volume)