Band Excavator Tongdaxin Index Compilation 4 Add trend analysis indicator module

Mondo Finance Updated on 2024-02-03

After a day of running around today, I finally returned to my hometown of Jiangxi, and I saw my father. I comforted, trusting in the light.

The band excavator indicator system has not yet been written, and it is planned to complete the basic functions before the New Year, and then teach my father how to use it.

My father said that my progress was slow, and that every day after the 20th lunar month in our village was a new year, and then talked about the customs of a village. It is said that there used to be a pair of old people, there were ten sons, once during the New Year, the ten sons called their parents in advance to go to their homes for the New Year, and when the Chinese New Year's Eve was over, the two old men waited at home for their sons to pick up, and as a result, the ten sons each thought that the old man was taken back by other brothers for New Year's dinner, and finally the old man was hungry at the time of Chinese New Year's Eve. So since then, the old man said that ten sons were divided into ten rooms, one son had one room, and from the 20th of the month of La, one son's family lived for one year, until the Chinese New Year's Eve. Therefore, our village is also divided into ten rooms, and our family is a descendant of six rooms, so our family is the 26th lunar month for the New Year. Counting the days, it seems that the progress is indeed slow.

Let's just do it, let's first establish the basic framework, I have already designed modules 1 to 3, and today I will continue to complete module 4, about trend analysis indicators.

There are many systems of trend analysis indicators, such as drawing trend lines, pressure support levels, top-bottom divergence, etc., and I chose the basis to be a similar "magic nine turns". There are many software, that is, there will be small numbers 1 9 and the like on the ** diagram. The basic logic is to compare the ** price of the day with the ** price of the historical n period, and the number of consecutive ** or **. According to the mean reversion theory, when continuous ** or **, there may be overbought or oversold in the short term, and the stock price has a tendency and momentum to revert.

Tongdaxin's source ** has a total of 30 lines, I have made a note after each line, and the parameter cycle has been used for 4 days, and there is no optimization for the time being. The screenshot of Tongdaxin** is as follows:

As can be seen from the source, only a small number is marked on the graph for consecutive **or **6 9 days. The following is a detailed explanation of the source ** of module 4.

Module 4: Trend Analysis Indicators}

a1:=c>ref(c,4);

If the ** price of the day is higher than 4 days ago, it is 1, otherwise it is 0, if you want to change the cycle, you only need to adjust the parameter 4}

a2:=ct1:=a2 and ref(a1,1);

From T1 to T9 is a recursive judgment of the current **, a bit like the magic of nine turns, let's look at them one by one, judging by the data of the past 6 trading days: compared with the ** price four days ago, the day is closed in the negative, the day before is the closing of the yang, and the conditions are 1, otherwise 0}

t2:=a2 and ref(t1,1);

Judging by the data of the past 7 trading days: the ** price of the last 3 days, compared with the ** price of their corresponding four days ago, closed the day before yesterday, closed in the negative, and closed in the negative on the same day}

t3:=a2 and ref(t2,1);

Judging by the data of the past 8 trading days: the ** price of the last 4 days is compared with the ** price of the corresponding four days ago, the first day closes positive, and then closes negative for 3 consecutive days}

t4:=a2 and ref(t3,1);

Judging by the data of the past 9 trading days: the ** price of the last 5 days is compared with the ** price of the corresponding four days ago, the first day closed positive, and then closed negative for 4 consecutive days}

t5:=a2 and ref(t4,1);

Judging by the data of the past 10 trading days: the ** price of the last 6 days, compared with the ** price of the corresponding four days ago, closed positive on the first day, and closed negative for 5 consecutive days}

t6:=a2 and ref(t5,1);

Judging by the data of the past 11 trading days: the ** price of the last 7 days, compared with the ** price of their corresponding four days ago, closed positive on the first day, and closed negative for 6 consecutive days}

t7:=a2 and ref(t6,1);

Judging by the data of the past 12 trading days: the ** price of the last 8 days, compared with the ** price of the corresponding four days ago, closed positive on the first day, and closed negative for 7 consecutive days}

t8:=a2 and ref(t7,1);

Judging by the data of the past 13 trading days: the ** price of the last 9 days is compared with the ** price of the corresponding four days ago, the first day closed positive, and then closed negative for 8 consecutive days}

t9:=a2 and ref(t8,1);

Judging by the data of the past 14 trading days: the ** price of the last 10 days, compared with the ** price of the corresponding four days ago, closed positive on the first day, and closed negative for 9 consecutive days}

drawtext(t6,l*0.995,'6'),colorgreen;

Write text, when T6 is satisfied, drop it below the lowest price of the day, and write a green number 6, which means that it has fallen for 6 consecutive days in 4 days}

drawtext(t7,l*0.995,'7'),colorgreen;

Write text, when T7 is satisfied, drop below the lowest price of the day, and write a green number 7, which means that it has fallen for 7 consecutive days in 4 days}

drawtext(t8,l*0.995,'8'),colorgreen;

Write text, when t8 is satisfied, drop below the lowest price of the day, write a green number 8, which means that it has fallen for 8 consecutive days in 4 days}

drawtext(t9,l*0.995,'9'),colorgreen;

Write text, when t9 is satisfied, drop it below the lowest price of the day, and write a green number 9, which means that it has fallen for 9 consecutive days compared to 4 days, so miserable, it should be oversold, right? }

b1:=cb2:=c>ref(c,4);

If the ** price of the day is higher than that of 4 days ago, it is 1, otherwise 0, and A1 is the same}

d1:=b2 and ref(b1,1);

From d1 to d9 is also a recursive judgment of the current **, which is the same as the logic of t1 to t9 above, but in reverse, t1 to t9 is to judge the consecutive fall, and d1 to d9 is to judge the number of days of continuous rise}

d2:=b2 and ref(d1,1);

The logic is the same as T2, compared with the ** price four days ago, to judge the last 3 trading days, whether the first day closed in the negative, and then closed in the positive for 2 consecutive days}

d3:=b2 and ref(d2,1);

The logic is the same as T3, compared with the ** price four days ago, to judge the last 4 trading days, whether the first day closed in the negative, and then closed in the positive for 3 consecutive days}

d4:=b2 and ref(d3,1);

The logic is the same as T4, compared with the ** price four days ago, to determine whether the last 5 trading days are in the negative on the first day, and then close in the positive for 4 consecutive days}

d5:=b2 and ref(d4,1);

The logic is the same as T5, compared with the ** price four days ago, to determine whether the last 6 trading days, whether the first day closed in the negative, and then closed in the positive for 5 consecutive days}

d6:=b2 and ref(d5,1);

The logic is the same as T6, compared with the ** price four days ago, to determine whether the last 7 trading days, whether the first day closed in the negative, and then closed in the positive for 6 consecutive days}

d7:=b2 and ref(d6,1);

The logic is the same as T7, compared with the ** price four days ago, to judge the last 8 trading days, whether the first day closed in the negative, and then closed in the positive for 7 consecutive days}

d8:=b2 and ref(d7,1);

The logic is the same as T8, compared with the ** price four days ago, to judge the last 9 trading days, whether the first day is negative, and then 8 consecutive days to close the yang}

d9:=b2 and ref(d8,1);

The logic is the same as T9, compared with the ** price four days ago, to judge the last 10 trading days, whether the first day closed in the negative, and then closed in the positive for 9 consecutive days}

drawtext(d6,h*1.008,'6'),coloryellow;

Write text, when d6 is satisfied, at the top of the day, write a yellow number 6, which means that it has risen 6 consecutive days ago}

drawtext(d7,h*1.008,'7'),coloryellow;

Write text, when d7 is satisfied, throw it at the top of the day, and write a yellow number 7, which means that it has risen 7 times in a row compared to 4 days ago}

drawtext(d8,h*1.008,'8'),coloryellow;

Write text, when d8 is satisfied, at the top of the day, write a yellow number 8, which means that it has risen 8 in a row compared to 4 days ago}

drawtext(d9,h*1.008,'9'),coloryellow;

Write text, when d9 is satisfied, throw it at the top of the day, and write a yellow number 9, which means that it has risen 9 times in a row compared to 4 days ago}

The main diagram shows the diagram as shown in the image below:

At this point, the framework of module four is completed, and the main chart indicator system is still short of the last module: the **stock price** indicator module, which will be completed before the 26th of the lunar month.

end】

Related Pages