股票均线数值-股票均线数值是什么意思

2023-07-08 入门知识 0次阅读 admin
股票均线数值.jpg

关于股票均线数值的问题,我们总结了以下几点,给你解答:

股票均线数值


股票均线数值


# 均线数值
ma_list = [5, 10, 20, 30, 60]
# 均线数据
ma_data = {}
for ma in ma_list:
ma_data['MA_' + str(ma)] = talib.MA(close, timeperiod=ma)
# 将均线数据添加至数据框
df = df.assign(**ma_data)
return df

# 计算macd
def get_macd(df):
close = df['close'].values
# 计算macd
macd, signal, hist = talib.MACD(close, fastperiod=12, slowperiod=26, signalperiod=9)
# 将macd数据添加至数据框
df = df.assign(MACD=macd, Signal=signal, Hist=hist)
return df

# 计算kdj
def get_kdj(df):
high = df['high'].values
low = df['low'].values
close = df['close'].values
# 计算kdj
k, d = talib.STOCH(high, low, close, fastk_period=9, slowk_period=3, slowd_period=3)
j = 3 * k - 2 * d
# 将kdj数据添加至数据框
df = df.assign(K=k, D=d, J=j)
return df

# 计算cci
def get_cci(df):
high = df['high'].values
low = df['low'].values
close = df['close'].values
# 计算cci
cci = talib.CCI(high, low, close, timeperiod=14)
# 将cci数据添加至数据框
df = df.assign(CCI=cci)
return df

# 计算rsi
def get_rsi(df):
close = df['close'].values
# 计算rsi
rsi = talib.RSI(close, timeperiod=14)
# 将rsi数据添加至数据框
df = df.assign(RSI=rsi)
return df

# 计算wr
def get_wr(df):
high = df['high'].values
low = df['low'].values
close = df['close'].values
# 计算wr
wr = talib.WILLR(high, low, close, timeperiod=14)
# 将wr数据添加至数据框
df = df.assign(WR=wr)
return df

# 计算boll
def get_boll(df):
close = df['close'].values
# 计算boll
up, mid, low = talib.BBANDS(close, timeperiod=20, nbdevup=2, nbdevdn=2, matype=0)
# 将boll数据添加至数据框
df = df.assign(UPPER=up, MID=mid, LOWER=low)
return df

# 计算dmi
def get_dmi(df):
high = df['high'].values
low = df['low'].values
close = df['close'].values
# 计算dmi
plus_di, minus_di, adx = talib.ADX(high, low, close, timeperiod=14)
# 将dmi数据添加至数据框
df = df.assign(PLUS_DI=plus_di, MINUS_DI=minus_di, ADX=adx)
return df

# 计算obv
def get_obv(df):
close = df['close'].values
volume = df['volume'].values
# 计算obv
obv = talib.OBV(close, volume)
# 将obv数据添加至数据框
df = df.assign(OBV=obv)
return df

# 计算roc
def get_roc(df):
close = df['close'].values
# 计算roc
roc = talib.ROC(close, timeperiod=10)
# 将roc数据添加至数据框
df = df.assign(ROC=roc)
return df

# 计算atr
def get_atr(df):
high = df['high'].values
low = df['low'].values
close = df['close'].values
# 计算atr
atr = talib.ATR(high, low, close, timeperiod=14)
# 将atr数据添加至数据框
df = df.assign(ATR=atr)
return df

# 计算sar
def get_sar(df):
high = df['high'].values
low = df['low'].values
# 计算sar
sar = talib.SAR(high, low, acceleration=0.02, maximum=0.2)
# 将sar数据添加至数据框
df = df.assign(SAR=sar)
return df

# 计算trix
def get_trix(df):
close = df['close'].values
# 计算trix
trix = talib.TRIX(close, timeperiod=30)
# 将trix数据添加至数据框
df = df.assign(TRIX=trix)
return df

# 计算vr
def get_vr(df):
high = df['high'].values
low = df['low'].values
close = df['close'].values
volume = df['volume'].values
# 计算vr
vr = talib.ATR(high, low, close, timeperiod=26) / talib.SMA(volume, timeperiod=26) * 100
# 将vr数据添加至数据框
df = df.assign(VR=vr)
return df

# 计算cr
def get_cr(df):
high = df['high'].values
low = df['low'].values
close = df['close'].values
# 计算cr
cr = talib.NATR(high, low, close, timeperiod=14) / talib.ATR(high, low, close, timeperiod=14) * 100
# 将cr数据添加至数据框
df = df.assign(CR=cr)
return df

# 计算dma
def get_dma(df):
close = df['close'].values
# 计算dma
dif = talib.SMA(close, timeperiod=10) - talib.SMA(close, timeperiod=50)
dma = talib.SMA(dif

股票均线数值是什么意思


股票均线数值是什么意思

均线,Moving Average,简称MA,原本的意思是移动平均,由于我们将其制作成线形,所以一般称之为移动平均线,简称均线。
它是将某一段时间的收盘价之和除以该周期。 比如日线MA5指5天内的收盘价除以5 。
均线代表持仓成本线,有5、10、20、30、60、120日、。。。等等均线。
股票里的均线就是在设定的单位时间里计算出来的那些数值在连续状态下呈现的线段。它反映变化趋势。

股票均线数值今天大于昨天数值,在第一次标注


股票均线数值今天大于昨天数值,在第一次标注

股票专业分析不要均线系统,公式用于炒股绝对的垃松居超部圾,仅凭这两样不赔死没理由


猜你感兴趣: 股票均线数值