def COPP(df, n):
M = df['close'].diff(int(n * 11 / 10) - 1)
N = df['close'].shift(int(n * 11 / 10) - 1)
ROC1 = M / N
M = df['close'].diff(int(n * 14 / 10) - 1)
N = df['close'].shift(int(n * 14 / 10) - 1)
ROC2 = M / N
Copp = pd.Series(pd.ewma(ROC1 + ROC2, span = n, min_periods = n), name = 'Copp' + str(n))
return Copp
#Keltner Channel
评论列表
文章目录