vr指标两根线-vr指标两条线

2023-04-17 技术指标 0次阅读 admin
vr指标两根线.jpg

关于vr指标两根线的问题,我们总结了以下几点,给你解答:

vr指标两条线


vr指标两条线

相对强弱指标RSI又叫力度指标,其英文全称为“Relative Strength Index”,由威尔斯·魏尔德﹝Welles Wilder﹞所创造的,是目前股市技术分析中比较常用的中短线指标。 威廉指标WR又叫威廉超买超卖指标,简称威廉指标,是由拉瑞·威廉(Larry William)在1973年发明的,是目前股市技术分析中比较常用的短期研判指标。 VR指标又叫成交率比率指标、数量指标或容量指标,其英文全称为“Volume Ratio”,是重点研究量与价格间的关系的一种短期技术分析工具。
这些指标,你可以直接百度,都应该有百科。 学指标最简单的方法就是, 仔细观察一些股票的历史图形, 找相似形。 在大涨..大跌..等等 的时候 指标是处于什么形态。

再看看别人怎么说的。

vr指标两根线


vr指标两根线


:param data:
:return:
"""
data['vr'] = (data['volume'] / data['volume'].rolling(window=5).mean()).rolling(window=2).mean()
data['vr_ma'] = data['vr'].rolling(window=5).mean()
return data


def get_macd(data):
"""
计算macd指标
:param data:
:return:
"""
data['ema12'] = data['close'].ewm(span=12).mean()
data['ema26'] = data['close'].ewm(span=26).mean()
data['diff'] = data['ema12'] - data['ema26']
data['dea'] = data['diff'].ewm(span=9).mean()
data['macd'] = 2 * (data['diff'] - data['dea'])
return data


def get_kdj(data):
"""
计算kdj指标
:param data:
:return:
"""
low_list = data['low'].rolling(window=9).min()
low_list.fillna(value=data['low'].expanding().min(), inplace=True)
high_list = data['high'].rolling(window=9).max()
high_list.fillna(value=data['high'].expanding().max(), inplace=True)
data['rsv'] = (data['close'] - low_list) / (high_list - low_list) * 100

data['k'] = data['rsv'].ewm(com=2).mean()
data['d'] = data['k'].ewm(com=2).mean()
data['j'] = 3 * data['k'] - 2 * data['d']
return data


def get_boll(data):
"""
计算布林线指标
:param data:
:return:
"""
data['ma20'] = data['close'].rolling(window=20).mean()
data['std20'] = data['close'].rolling(window=20).std()
data['up'] = data['ma20'] + 2 * data['std20']
data['down'] = data['ma20'] - 2 * data['std20']
return data


def get_cci(data):
"""
计算cci指标
:param data:
:return:
"""
data['tp'] = (data['high'] + data['low'] + data['close']) / 3
data['ma14'] = data['tp'].rolling(window=14).mean()
data['std14'] = data['tp'].rolling(window=14).std()
data['cci'] = (data['tp'] - data['ma14']) / (0.015 * data['std14'])
return data


def get_roc(data):
"""
计算roc指标
:param data:
:return:
"""
data['roc'] = (data['close'] - data['close'].shift(12)) / data['close'].shift(12)
return data


def get_rsi(data):
"""
计算rsi指标
:param data:
:return:
"""
data['diff'] = data['close'].diff()
data['up'] = data['diff'][data['diff'] > 0].fillna(0)
data['down'] = -data['diff'][data['diff'] < 0].fillna(0)
data['up_ma'] = data['up'].rolling(window=6).mean()
data['down_ma'] = data['down'].rolling(window=6).mean()
data['rs'] = data['up_ma'] / data['down_ma']
data['rsi'] = 100 - (100 / (1 + data['rs']))
return data


def get_obv(data):
"""
计算obv指标
:param data:
:return:
"""
data['diff'] = data['close'].diff()
data['obv'] = data['volume']
data.loc[data['diff'] > 0, 'obv'] = data['volume']
data.loc[data['diff'] < 0, 'obv'] = -data['volume']
data['obv_ma'] = data['obv'].rolling(window=30).mean()
return data


def get_wr(data):
"""
计算wr指标
:param data:
:return:
"""
data['wr1'] = 100 * (data['high'].rolling(window=10).max() - data['close']) / (
data['high'].rolling(window=10).max() - data['low'].rolling(window=10).min())
data['wr2'] = 100 * (data['high'].rolling(window=6).max() - data['close']) / (
data['high'].rolling(window=6).max() - data['low'].rolling(window=6).min())
return data


def get_sar(data):
"""
计算sar指标
:param data:
:return:
"""
data['sar'] = data['high']
data['sar_up'] = True
data['sar_down'] = False
data['sar_up_e'] = 0.02
data['sar_down_e'] = 0.02
data['sar_up_af'] = 0.2
data['sar_down_af'] = 0.2
for i in range(2, len(data)):
if data.loc[i, 'sar_up']:
data.loc[i, 'sar'] = data.loc[i - 1, 'sar'] + data.loc[i - 1, 'sar_up_e'] * (
data.loc[i - 1, 'high'] - data.loc[i - 1, 'sar'])
if data.loc[i, 'low'] < data.loc[i, 'sar']:
data.loc[i, 'sar_up'] = False
data.loc[i, 'sar_down'] = True
data.loc[i, 'sar_down_e'] = 0.02
data.loc[i, 'sar'] = data.loc[i - 1, 'high']
else:
data.loc[i, 'sar'] = data.loc[i - 1, 'sar'] - data.loc[i - 1, 'sar_down_e'] * (
data.loc[i - 1, 'sar'] - data.loc[i - 1, 'low'])
if data.loc[i, 'high'] > data.loc[i, 'sar']:
data.loc[i, 'sar_up'] = True
data.loc[i, 'sar_down'] = False
data.loc[i, 'sar_up_e'] = 0.02
data.loc[i, 'sar'] = data.loc[i - 1, 'low']
if data.loc[i, 'sar_up']:
data.loc[i, 'sar_up_e'] = min(data.loc[i, 'sar_up_e'] + data.loc[i, 'sar_up_af'], 0.2)
else:
data.loc[i, 'sar_down_e'] = min(data.loc[i, 'sar_down_e'] + data.loc[i, 'sar_down_af'], 0.2)
return data


def get_all_index(data):
"""
计算所有指标
:param data:
:return:
"""
data = get_ma(data)
data = get_ema(data)
data = get_bias(data)
data = get_dmi(data)
data = get_vr(data)

VR指标两根线怎么改为一根线


VR指标两根线怎么改为一根线

通达信在原动马投爱元永磁军对vr指标基础上添加了一根vr的6日均线.也就是mavr黄色线.
白色vr线跟同花顺来自中的vr线是一样的.

猜你感兴趣: vr指标两根线