code: def QA_indicator_ROC(DataFrame, N=12, M=6):
      '变动率指标'
      C = DataFrame['close']
      roc = 100 * (C - REF(C, N)) / REF(C, N)
      ROCMA = MA(roc, M)
      DICT = {'ROC': roc, 'ROCMA': ROCMA}
  
      return pd.DataFrame(DICTf QA_indicator_ROC(DataFrame, N=12, M=6):
      '变动率指标'
      C = DataFrame['close']
      roc = 100 * (C - REF(C, N)) / REF(C, N)
      ROCMA = MA(roc, M)
      DICT = {'ROC': roc, 'ROCMA': ROCMA}
  
      return pd.DataFrame(DICT)
docs: 变动率指标