当前位置:网站首页>How to choose stocks? Which indicator strategy is reliable? Quantitative analysis and comparison of strategic returns of vrsi, bbiboll, WR, bias and RSI indicators

How to choose stocks? Which indicator strategy is reliable? Quantitative analysis and comparison of strategic returns of vrsi, bbiboll, WR, bias and RSI indicators

2022-06-13 00:55:00 Your name is Yu yuezheng

Preface

From the stock market to the present , Many indicators have been developed , But when you use it, you will find , Due to the unknown fluctuation of the share price the next day , The indicators are not always accurate , There will always be miscalculations . For this inevitable situation , We can only try to quantify it 、 Calculate the yield after operation according to the strategy 、 Estimate the probability of misjudgment, etc

This article first selects VRSI、BBIBOLL、WR、BIAS、RSI Five indicators to quantify ( A total of More than 30 indicators , Due to the space problem, five kinds of ), Then use ten stocks to test the effectiveness of these five strategies The actual situation is that 3600+ Stock to calculate the effect of strategy , It is not convenient to display the results at present

disclaimer

Nothing in this vision and analysis should be interpreted as investment advice , Past performance does not necessarily indicate future results .



Data preparation

I chose 600519 Guizhou Moutai 、600031 Sany heavy industry 、002594 BYD 、601633 Great Wall motor 、002074 GuoXuan high tech 、300750 Ningde era 、300014 Yiwei lithium energy 、000591 The solar energy 、002475 State - precision 、600862 China Aviation hi tech These ten stocks 2020 year 1 month 1 Japan ~ 2021 year 1 month 15 Japan To test

Part of the code fragment

import pandas_datareader.data as web
import datetime

start = datetime.datetime(2020, 1, 1)
end = datetime.datetime(2021, 1, 15)
df = web.DataReader(ticker, "yahoo", start, end)


Index Introduction

VRSI indicators

sma It is the calculation function of smooth moving index

def vrsi(df, n=6):
    _vrsi = pd.DataFrame()
    _vrsi['date'] = df['date']
    px = df['volume'] - df['volume'].shift(1)
    px[px < 0] = 0
    _vrsi['vrsi'] = sma(px, n) / sma((df['volume'] - df['volume'].shift(1)).abs(), n) * 100
    return _vrsi

BBIBOLL indicators

_ma Is a function of the moving average ,_md Is a function of the standard deviation

def bbiboll(df, n=10, k=3):
    # pd.set_option('display.max_rows', 1000)
    _bbiboll = pd.DataFrame()
    _bbiboll['date'] = df.date
    _bbiboll['bbi'] = (_ma(df.close, 3) + _ma(df.close, 6) + _ma(df.close, 12) + _ma(df.close, 24)) / 4
    _bbiboll['boll_md'] = _md(_bbiboll.bbi, n)
    _bbiboll['upr'] = _bbiboll.bbi + k * _bbiboll.boll_md
    _bbiboll['dwn'] = _bbiboll.bbi - k * _bbiboll.boll_md
    return _bbiboll

WR indicators

_ema Is a function of the exponential moving average

def wr(df, n=14):
    _wr = pd.DataFrame()
    _wr['date'] = df['date']
    higest = df.high.rolling(n).max()
    _wr['wr'] = (higest - df.close) / (higest - df.low.rolling(n).min()) * 100
    return _wr

BIAS indicators

sma It is the calculation function of smooth moving index

def bias(df, n=12):
    _bias = pd.DataFrame()
    _bias['date'] = df.date
    _mav = df.close.rolling(n).mean()
    _bias['bias'] = (np.true_divide((df.close - _mav), _mav)) * 100
    return _bias

RSI indicators

_md Is a function of the standard deviation

def rsi(df, n=6):
    _rsi = pd.DataFrame()
    _rsi['date'] = df['date']
    px = df.close - df.close.shift()
    px[px < 0] = 0
    _rsi['rsi'] = sma(px, n) / sma((df['close'] - df['close'].shift()).abs(), n) * 100
    return _rsi


The final quantitative results

Due to the inconvenience of space and display , Do not show the visual buying and selling points and the fund change curve in the article

In order to understand the effect of the strategy most succinctly , The initial capital is set to 10000 element , And for the sake of simplicity, we don't consider the restriction that we must buy the whole hand , Every time 10000 Yuan to buy all , Test the effect of five index strategies at the same time 2020.1.1 Buy and hold until 2021.1.15 The strategy of , Compare the final funds to measure the effectiveness of the strategy

HOLD Line is a representation 2020.1.1 Buy and hold until 2021.1.15 The final fund of the strategy

 Insert picture description here

Data visualization is not shown here , After having data, you can draw and tabulate according to your habits ; More evaluation data are not shown

In the chart we notice
600031 This stock uses WR indicators The return of strategy is higher than that of holding strategy
also WR indicators The strategy is 601633 This one also has a better performance than the one who has always held the strategy
000591 This stock uses BIAS indicators The return of strategy is higher than that of holding strategy

Although in most cases, the effect of operating according to indicators is not as good as that of long-term holding strategy , But when the strategy does not hold shares, as a trader, of course, he will look for new opportunities , Generate revenue !

原网站

版权声明
本文为[Your name is Yu yuezheng]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202280557382649.html