Do your own quantitative trading software (33) Xiaobai quantitative actual combat 7-investment philosophy and Tongdaxin formula backtest (1)

Do your own quantitative trading software (33) Xiaobai quantitative actual combat 7-Investment philosophy and Tongdaxin formula backtest (1)
What is an investment philosophy? Let's tell you a short story first.
Once upon a time, there was a Zheng Guoren who planned to go to the market to buy a pair of shoes to wear. He first measured the length of his feet and made a ruler. But before leaving, he was careless and forgot the ruler on the stool at home. He went to the market and found a place to sell shoes. I was about to buy shoes, but found that the ruler was forgotten at home, so he said to the shoe seller: "I forgot the size of my shoes at home. I will buy the ruler when I get home." To run home. He ran home in a hurry, took the ruler, and ran to the market in a panic. By this time, it was getting late and the market had already dispersed. He ran twice in vain, but did not buy shoes. When others knew about it, they thought it was weird, so they asked him; "Why don't you try your shoes with your own feet, but you just want to go home to get a ruler?" The Zheng Guoren who bought shoes said: "I would rather believe I don’t believe my feet
even with a good ruler.” Stock operations are also related to mentality. As the saying goes, when the mind is born, the law is born, and when the mind is destroyed, the law is destroyed. In the stock market, the beating of stock prices is like the beating of people's hearts. Market followers are often unable to bear the excitement in their hearts, and are desperate for themselves. Fall into the trap of the main force. Heartbeat is the root cause of perceptual operation. This is a misunderstanding of some investors, who believe that stocks are based on a feeling. Feeling good, going smoothly, feeling bad, passive everywhere.
Other investors have fallen into another misunderstanding, believing that stock trading is a technology. Investment must be made in accordance with technical indicators, such as buying in golden forks, selling dead forks, and so on. Those who think they are smart are still making up and making up their own.
The former belongs to perceptual operation, while the latter belongs to rational operation, both of which are biased. We say that the acquired mental methods and techniques are the integration of sensibility and reason. Rather than blind impulse and rigid methods. The real feeling should be based on good theoretical and practical skills, and it is a quick response to market opportunities. It is a kind of selfless sincere intuition that removes the greed and fear of human nature, rather than moving casually along with feelings. The wrong feeling is the psychological hint conveyed to the participants by the main force in the psychological warfare. It is a passive strain under the stimulation of the wrong appearance. This feeling is subject to greed, fear, and fluke human weakness. It is false and unreliable. Such investors often attribute their mistakes to some objective reasons when summing up their experience, and avoid self-analysis. Although rational operation overcomes the weakness of the mind, it has fallen into a logical misunderstanding. Constantly using various indicators and formulas to verify the future trend of stock prices, there is always no correct answer.
In short, the rational restriction is added to the sense, and the spirituality of the sense is given to the logic, so that the mind and the technique are merged into one. This is exactly one of the analysis and judgment methods that we have been exploring. The fusion of mind and technique is the realm of masters, a kind of transcendence of human nature and reason.
We call the analytical method that combines mental and technical methods as "investment philosophy."
In the previous article, we introduced the main entry and exit indicators of Paixiu to avoid investors being fooled. Make quantitative trading software by yourself (28) Xiaobai Quantitative Practice 2-Turn Red, Buy, Turn Green, Sell
The principle of this indicator I have written in my book " Reading Cheats ". Buy this book to give a good comment, and join the readers to get a set of " Pixiu Indicators ".
The book " Reading Cheats " introduces the macro and micro reasons of stock price fluctuations. In order to improve the accuracy of stock selection and buying, this article introduces the theoretical basis for improving the success rate of indicators from the micro-factors.
The theoretical basis of technical analysis is based on three reasonable market assumptions: (1) Market behavior covers all information; (2) Prices move along trends; (3) History will repeat itself. Based on the above three assumptions, we will discuss the stock market from a micro perspective.
Throughout the world, everything is material, and the material world always has its natural laws, which is just a matter of what we know and don’t know. Even if Newton did not discover universal gravitation, universal gravitation still exists objectively. People's understanding of things is progressive.
Using scientific research methods, scientists have discovered that all things are composed of molecules, molecules are composed of atoms, and atoms are composed of nuclei and electrons. The theory of the microstructure of matter. There are three main points: ①All objects are composed of a large number of molecules, and there are gaps between the molecules. ②The molecule is in a state of non-stop and irregular movement. This movement is called thermal movement. ③There are interacting gravitational and repulsive forces between molecules.
Numerous objective facts (such as Brownian motion, diffusion phenomena, etc.) have proved the correctness of the theory of molecular motion. It can explain the structure and characteristics of various different substances, as well as all thermal phenomena, and connect the macroscopic phenomenon and microscopic nature of matter.
We can regard stock price changes as molecular movements, and stock price changes also contain knowledge of physics and geometry. Therefore, the rise and fall of stock prices are all caused by changes in its internal factors. This is how we began to explore the cause and effect of stock price changes. After readers understand these causal factors, they will have a new understanding of the rise and fall of stock prices. No longer will be constrained by confusing rises and falls, and analyze stocks objectively and comprehensively.
Because stock price fluctuations have physical characteristics, stock price operations have "physical characteristics". " Kanpan Cheats " introduces many micro-physical and geometric properties, we extract one to explain to everyone.
Stock price fluctuations have physical characteristics, and the most obvious physical characteristic in performance is the "gravity" of stock prices. Since stock prices have gravity, it is not difficult for us to understand the inertia of stock price fluctuations.
To make an analogy, the acceleration of a car is like a rise in the stock market; a deceleration of a car is like a fall in the stock market. When the car accelerates, we always lean back; when the car decelerates, we always lean forward, and it is always difficult for us to maintain balance. Why? It is because of the inertial effect of body weight. Our body is subject to the effects of physical inertia, what about our psychology? Is there also a psychological inertia? The answer is yes.
Therefore, the direction of stock price movement can be analyzed from material and psychological effects. Psychological inertia is that history will repeat and stock prices will trend.
What is the material effect of the stock price movement direction? It is the weight of the stock price, so it can be imagined that we can lift a heavy "shot" in our hands without exerting any effort?
Insert picture description here
So who raised the stock price? It is "money", it is "funds" and it is "volume".
According to the analysis technique given by the author's master " Pixiu Zhang ":
Pixiu Zhang: Whether the stock price can rise depends on whether the strength is enough. How much effort is enough? Look at the 113-day average volume line of trading volume. Regardless of the negative volume and the positive volume, as long as it continues above the 113-day average volume line, this stock will have a show.
Me: Why is it 113, not 110? Is it 120?
Pai Yao Zhang: 113 is the quality, and the other numbers are composite numbers. The main force is to deceive the line on the 10th and 20th. Look at the 5th and 20th, it is not the same as being deceived.
Me: Dizzy, I didn't learn mathematics well.
Let's see if the effect is accurate.
Insert picture description here
Before the rise of 603698 Aerospace Engineering, the trading volume continued to exceed the 113-day average volume line.
Insert picture description here
For 603698 Aerospace Engineering, the trading volume continued to exceed the 113 daily average volume line, and the stock price rose.
Insert picture description here
603222 Jimin Pharmaceuticals trended before the crash, and the trading volume could not continue to be greater than the 113 average volume line, obviously not enough.
Insert picture description here
603222 Jimin Pharmaceutical trend.
Insert picture description here
The same is true for the Shanghai market. Heavy volume will rise, while shrinking volume will fall.
Based on the above concept, we add volume analysis to our indicators to improve the indicator winning rate. In order to be able to predict the forecast volume of the day in the intraday market, I used C++ to make forecast volume indicators on analysts and Feihu in 1999.
Use the self-compiled indicators in "Do your own quantitative trading software (27) Xiaobai Quantitative Actual Combat 1 Transformation of Weapons and Display " as a backtest formula.
The description of Tongdaxin's indicator conditions is as follows. We will not make an indicator. This is just a filter condition for buying points. The focus is on the implementation of Python backtesting.

MAV113:=MA(V,113);
T1:=IF(REF(V,1)>REF(MAV113,1),1,0);
T2:=IF(REF(V,2)>REF(MAV113,2),1,0);
T3:=IF(预测V>MAV113,1,0);
TJ:=IF((T1+T2+T3)>=3,1,0);

The trading signal passability indicator is described as follows:

N:=24;
M:=2;
X:=25;
MID :  MA(CLOSE,N);
UPPER: MID + 2*STD(CLOSE,N),LINETHICK2;
LOWER: MID - 2*STD(CLOSE,N),LINETHICK2;
M1:(UPPER-MID)/2+MID;
M2:(MID-LOWER)/2+LOWER;
MM1:=EMA((OPEN+CLOSE*2+LOW+HIGH)/5,M);
MM2:=EMA(IF(MM1>=MID,MM1*(1+X/1000),MM1*(1-X/1000)),3);
MM:MM2,COLORYELLOW,LINETHICK3;

The blog is almost done, I will do a backtest of the Python code for everyone, and I will introduce it in the next article.
I found the article I wrote before on the portable hard disk and found the Go software I made with VFP software.
Seeing this software, I am generous, how did VFP let Microsoft abandon it? Otherwise, the world of Python is the world of VFP.
I uploaded the source code of the Go software I made with VFP software to the VFPer QQ group, and friends who are interested to download it.

Revitalization of VFP (old cars). Ⅰ. QQ group: 691863737
Revitalization of VFP (old cars). Ⅱ. QQ group: 914539613
Insert picture description here

Please continue to pay attention to my blog, my progress is your progress!

Guess you like

Origin blog.csdn.net/hepu8/article/details/112738875