当前位置:网站首页>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 .
Quantitative analysis of index strategy
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
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 !
边栏推荐
- 今日睡眠质量记录74分
- 通过抓包下载钉钉直播回放
- What is pytorch? Explain the basic concepts of pytorch
- 阿姨学代码续集:能力吊打大批程序员
- Illustrator tutorial, how to add dashes and arrows in illustrator?
- Static analysis of malicious code
- [JS component] floating text
- (01).NET MAUI实战 建项目
- The seventh finals of the Blue Bridge Cup
- The grass is bearing seeds
猜你喜欢
Deep learning model pruning
Static analysis of malicious code
Cve-2021-24078 vulnerability analysis
今日睡眠质量记录74分
五篇经典好文,值得一看(2)
Assembly language learning
Arduino control tm1637 common positive four digit nixie tube
Jenkins持续集成操作
Antdpro - protable realizes the linkage effect of two selection boxes
How many rounds of deep learning training? How many iterations?
随机推荐
[virtual machine] notes on virtual machine environment problems
MySQL query table field information
MySQL异常:com.mysql.jdbc.PacketTooBigException: Packet for query is too large(4223215 > 4194304)
单片机串口中断以及消息收发处理——对接受信息进行判断实现控制
ImportError: cannot import name &#039; get_ ora_ doc&#039; from partially initialized module
[JS component] previous queue prompt
The scope builder coroutinescope, runblocking and supervisorscope of kotlin collaboration processes run synchronously. How can other collaboration processes not be suspended when the collaboration pro
How many rounds of deep learning training? How many iterations?
Maybe we can figure out the essence of the Internet after the dust falls
Antdpro - protable realizes the linkage effect of two selection boxes
杂记:intel11代和12代移动版支持原生Thunderbolt4接口,桌面版不支持
What is the difference between pytorch and tensorflow?
Arduino uses esp8266+ lighting technology + Xiaoai audio to realize voice control switch
Undirected graph -- computing the degree of a node in compressed storage
ROS2之OpenCV人脸识别foxy~galactic~humble
pytorch和tensorflow有什么区别?
牌好不好无法预料
Rest at home today
Four startup modes of kotlin collaboration
kotlin 协程withContext切换线程