Tongdaxin's 50-day moving average stock ratio index formula to measure the strength of the market

In the book "Trading for a Living", the author Elder introduced the proportion of stocks on the 50-day moving average, which is used to measure the strength of the market and capture market turning points. The calculation method of the proportion indicator formula of the number of stocks on the 50-day moving average is very simple, dividing the number of stocks above its 50-day moving average by the total number of stocks. Assuming that there are 5,000 A-shares in Shanghai and Shenzhen, and 2,500 stock prices are higher than their 50-day moving average, then the proportion of stocks on the 50-day moving average is equal to 50%.

In theory, if all stock prices are above the 50-day moving average, the highest reading of the indicator is 100%; if all stock prices are below the 50-day moving average, the lowest reading of the indicator is 0%, so the indicator ranges from 0% to 100 % fluctuates between. But in fact, it will be close to the extreme value of 90% or 10% in extreme cases. In general, you can refer to the two horizontal lines of 75% and 25% to find market turning points. Although some signals of the indicator can catch the reversal in time, some signals are just a rebound or adjustment, and the market will continue to run in the original direction after that, so don't rely solely on this indicator to make decisions. (As shown below)

 

1. Judging whether it is above the 50-day moving average

Create a new technical indicator formula, the formula name is "50UP", and the following formulas need to refer to this formula. The variable UP judges whether it is above the 50-day moving average, and ALL is used to judge whether the closing price exists, in preparation for the following formula to count the number of stocks.

UP: C>MA(C,50);{Above the 50-day moving average}

ALL:C<>DRAWNULL;{closing price is not empty};

 

2. The ratio index formula of the number of stocks on the 50-day moving average

Calculate the number of stocks on the 50-day moving average and the total number of A shares in Shanghai and Shenzhen respectively, and divide them to get the proportion. The total number of Shanghai and Shenzhen A shares first thought of using the BLOCKSETNUM function, but the calculated total number of Shanghai and Shenzhen A shares is the current number, but with the implementation of the registration system, the number of stocks is increasing, and the previous proportion data is not accurate. Later, I thought of using DRAWNULL to judge whether there is a closing price, and the result is 1, and then use the INSUM function to accumulate.

UPNUM:=INSUM('Shanghai and Shenzhen A shares','50UP',1,0);{the number of stocks on the 50-day moving average}

ALLNUM:=INSUM('Shanghai and Shenzhen A shares','50UP',2,0);{Shanghai and Shenzhen A shares total number}

Proportion: UPNUM/ALLNUM*100; {the proportion of stocks on the 50-day moving average};

NOTEXT1:75;

NOTEXT2:25;

 

Loading the indicator to the sub-picture will be a bit stuck, but it is acceptable, much better than the NH-NL indicator. If the computer configuration is not high, you can use the extended data manager to calculate and load it to the sub-graph like the NH-NL indicator in the previous article.

Pay attention to Technical Pie and learn more knowledge about writing Tongdaxin indicator formulas. All rights reserved, please indicate the source.

Friendly reminder: This article is only for learning and exchanging technical indicator formulas, and does not constitute any investment advice. Investment is risky, and you need to be cautious when entering the market.

Guess you like

Origin blog.csdn.net/m0_74754828/article/details/132563311