当前位置:网站首页>How to choose stocks? Which indicator strategy is reliable? Quantitative analysis and comparison of strategic benefits of ASI, VR, arbr, DPO and trix indicators
How to choose stocks? Which indicator strategy is reliable? Quantitative analysis and comparison of strategic benefits of ASI, VR, arbr, DPO and trix 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 ASI、VR、ARBR、DPO、TRIX 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
sma It is the calculation function of smooth moving index
_ma Is a function of the moving average
_md Is a function of the standard deviation
_ema Is a function of the exponential moving average
ASI indicators
def asi(df, n=5):
_asi = pd.DataFrame()
_asi['date'] = df.date
_m = pd.DataFrame()
_m['a'] = (df.high - df.close.shift()).abs()
_m['b'] = (df.low - df.close.shift()).abs()
_m['c'] = (df.high - df.low.shift()).abs()
_m['d'] = (df.close.shift() - df.open.shift()).abs()
_m['r'] = _m.apply(lambda x: x.a + 0.5 * x.b + 0.25 * x.d if max(x.a, x.b, x.c) == x.a else (
x.b + 0.5 * x.a + 0.25 * x.d if max(x.a, x.b, x.c) == x.b else x.c + 0.25 * x.d
), axis=1)
_m['x'] = df.close - df.close.shift() + 0.5 * (df.close - df.open) + df.close.shift() - df.open.shift()
_m['k'] = np.maximum(_m.a, _m.b)
_asi['si'] = 16 * (_m.x / _m.r) * _m.k
_asi["asi"] = _ma(_asi.si, n)
return _asi
VR indicators
def vr(df, n=5):
_vr = pd.DataFrame()
_vr['date'] = df.date
_vr['vr_'] = df.volume / _ma(df.volume, n).shift(1)
_vr['rr_'] = (df.close - df.close.shift(1)) / df.close.shift(1) * 100
return _vr
ARBR indicators
def arbr(df, n=26):
_arbr = pd.DataFrame()
_arbr['date'] = df.date
_arbr['ar'] = (df.high - df.open).rolling(n).sum() / (df.open - df.low).rolling(n).sum() * 100
_arbr['br'] = (df.high - df.close.shift(1)).rolling(n).sum() / (df.close.shift() - df.low).rolling(n).sum() * 100
return _arbr
DPO indicators
def dpo(df, n=20, m=6):
_dpo = pd.DataFrame()
_dpo['date'] = df['date']
_dpo['dpo'] = df.close - _ma(df.close, int(n / 2 + 1))
_dpo['madpo'] = _ma(_dpo.dpo, m)
return _dpo
TRIX indicators
def trix(df, n=12, m=20):
_trix = pd.DataFrame()
_trix['date'] = df.date
tr = _ema(_ema(_ema(df.close, n), n), n)
_trix['trix'] = (tr - tr.shift()) / tr.shift() * 100
_trix['trma'] = _ma(_trix.trix, m)
return _trix
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
ARBR indicators Excellent performance , stay 600031、002564、000591 The performance of these stocks is better than the holding strategy , And the performance of the other seven stocks is not bad . But it is necessary to study this indicator in the whole A The performance of the stock market needs to consider thousands of stocks and data of more than ten years
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 !
边栏推荐
- Mysql database password modification
- 牌好不好无法预料
- Oceanbase is the leader in the magic quadrant of China's database in 2021
- Why is there always a space (63 or 2048 sectors) in front of the first partition when partitioning a disk
- .net core 抛异常对性能影响的求证之路
- Unity calls alertdialog
- Leetcode weekly -- April to May
- Hard (magnetic) disk (II)
- Druid reports an error connection holder is null
- MCU serial port interrupt and message receiving and sending processing -- judge and control the received information
猜你喜欢

Comparison of disk partition modes (MBR and GPT)
![[JS component] simulation framework](/img/f2/8d5bb7e0db55a87ce76c09fae03694.jpg)
[JS component] simulation framework

(01). Net Maui actual construction project

.net core 抛异常对性能影响的求证之路

Canvas game 2048 free map size

Programming training 1

Common skills for quantitative investment - drawing 2: drawing the moving average
![[sca-cnn interpretation] spatial and channel wise attention](/img/4b/bdcdab17d531481bf0222a96ace065.png)
[sca-cnn interpretation] spatial and channel wise attention
![[003] embedded learning: creating project templates - using stm32cubemx](/img/18/43dfa98f1711e8e544828453e36812.jpg)
[003] embedded learning: creating project templates - using stm32cubemx

Undirected graph -- computing the degree of a node in compressed storage
随机推荐
Win10 home vs pro vs enterprise vs enterprise LTSC
The grass is bearing seeds
gpu加速pytorch能用吗?
Canvas game 2048 free map size
Mongodb array operation
[JS component] calendar
通过抓包下载钉钉直播回放
Biological unlocking - Fingerprint entry process
Can GPU acceleration pytorch work?
Arduino interrupt
[JS component] floating text
Mysql批量插入数据时如何解决重复问题?
pytorch是什么?解释pytorch的基本概念
Kotlin collaboration, the life cycle of a job
[003] embedded learning: creating project templates - using stm32cubemx
With a market value of more than trillion yuan and a sales volume of more than 100000 yuan for three consecutive months, will BYD become the strongest domestic brand?
Pipeline pipeline project construction
Druid reports an error connection holder is null
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
Aunt learning code sequel: ability to sling a large number of programmers