📜  smma python 代码示例

📅  最后修改于: 2022-03-11 14:45:22.513000             🧑  作者: Mango

代码示例1
import btalib  #need to instal bta-lib, pip install bta-lib
smma=btalib.smma(df['close'],period=4) 
wma=btalib.wma(df['close'],period=70) # wma or smma values will start after "period" values 
#from 0 till the period value there would Nan values
df['WMA']=wma.df #wma.df is a reserved word not a name of dataframe
df['SMMA']=smma.df#same as step 3