def MassI(df):
Range = df['high'] - df['low']
EX1 = pd.ewma(Range, span = 9, min_periods = 8)
EX2 = pd.ewma(EX1, span = 9, min_periods = 8)
Mass = EX1 / EX2
MassI = pd.Series(pd.rolling_sum(Mass, 25), name = 'MassIndex')
return MassI
#Vortex Indicator
评论列表
文章目录