code: def macd(self, fastPeriod, slowPeriod, signalPeriod, array=False):
          
          macd, signal, hist = talib.MACD(self.close, fastPeriod,
                                          slowPeriod, signalPeriod)
          if array:
              return macd, signal, hist
          return macd[-1], signal[-1], hist[-1]
docs: MACD指标