Tongdaxin’s magical nine-turn indicator formula upgraded version, reversing the red and green K lines and changing color

In the previous article, I introduced the principle of the magic nine-turn indicator formula. The principle is not complicated. Compare the closing price of the day with the closing price four days ago. If the conditions of greater than or less than are met for nine consecutive days, a formula is formed. Magical Nine Turns. The previous indicator formula does not use the future function and only displays the numbers 9-13. This article writes a magical nine-turn indicator that displays 9 numbers. In addition, based on the principle of the magic nine turns, the reversal red and green K-line discoloration indicator is written. In many cases, it may not be reversed when it reaches 9, or even when it reaches 13. If it is not reversed, the numbers can continue forever. However, if there are many numbers, marking the digital K-line will be messy and not very meaningful. Therefore, it can be displayed by inverting the color of the K-line, and finally the two indicator formulas will be integrated into one indicator.

1. Magical nine-turn main chart indicator formula (with future function)

Idea: After 9 is formed, use the future function BACKSET to change the result of the previous K line, and label it with numbers to avoid too much clutter. Although the future function is used, it is only displayed after 9 appears, which relatively reduces the impact of the future function.

A:=C>REF(C,4);

TA:=BARSLASTCOUNT(A);

GJ:=TA=9;{高九}

NA:=BACKSET(GJ,9)*TA;

DRAWTEXT(BETWEEN(TA,1,9) AND NA>0,H,VAR2STR(NA,0)),DRAWABOVE,COLORMAGENTA;

STICKLINE(GJ,C,O,1,0),COLORGREEN;

DRAWICON(GJ,H*1.015,12);

B:=C<REF(C,4);

TB:=BARSLASTCOUNT(B);

DJ:=TB=9;{low nine}

NB:=BACKSET(DJ,9)*TB;

DRAWTEXT(BETWEEN(TB,1,9) AND NB>0,L*0.99,VAR2STR(NB,0)),COLORLIBLUE;

STICKLINE(DJ,C,O,1,0),COLORRED;

DRAWICON(DJ,L*0.985,11);

2. Reversal red-green K-line discoloration indicator formula (no future function)

Idea: If the closing price of the day is continuously greater than or less than the closing price four days ago, the color of the K line will not change. If equal, continue the color of the previous K line. Until the previous conditions are not met, the reversal begins and a new 1 is generated, and the K-line color switches from red to green. It draws on the principle of the magical nine turns, but it is no longer nine turns.

A:=C>REF(C,4);

TA:=BARSLASTCOUNT(A);

GJ:=TA=9;

STICKLINE(A,H,L,0,1),COLORRED;

STICKLINE(A,C,O,3,1),COLORRED;

B:=C<REF(C,4);

TB:=BARSLASTCOUNT(B);

DJ:=TB=9;

STICKLINE(B,H,L,0,0),COLORCYAN;

STICKLINE(B,C,O,3,0),COLORCYAN;

D:=C=REF(C,4);

STICKLINE(D AND REF(A,1),H,L,0,1),COLORRED;

STICKLINE(D AND REF(A,1),C,O,3,1),COLORRED;

STICKLINE(D AND REF(B,1),H,L,0,0),COLORCYAN;

STICKLINE(D AND REF(B,1),C,O,3,0),COLORCYAN;

3. Magical nine turns combined with reversal of red and green K lines to change color

The magic nine-turn main chart indicator formula does not display the number until 9 is formed. Before 9 is formed, it is not displayed on the chart, which is a bit inconvenient. In addition to the K-line discoloration, the first discolored K-line is 1, which is relatively clear.

A:=C>REF(C,4);

TA:=BARSLASTCOUNT(A);

GJ:=TA=9;

NA:=BACKSET(GJ,9)*TA;

DRAWTEXT(BETWEEN(TA,1,9) AND NA>0,H,VAR2STR(NA,0)),DRAWABOVE,COLORMAGENTA;

DRAWICON(GJ,H*1.015,12);

B:=C<REF(C,4);

TB:=BARSLASTCOUNT(B);

DJ:=TB=9;

NB:=BACKSET(DJ,9)*TB;

DRAWTEXT(BETWEEN(TB,1,9) AND NB>0,L*0.99,VAR2STR(NB,0)),COLORLIBLUE;

DRAWICON(DJ,L*0.985,11);

STICKLINE(A,H,L,0,1),COLORRED;

STICKLINE(A,C,O,3,1),COLORRED;

STICKLINE(B,H,L,0,0),COLORCYAN;

STICKLINE(B,C,O,3,0),COLORCYAN;

D:=C=REF(C,4);

STICKLINE(D AND REF(A,1),H,L,0,1),COLORRED;

STICKLINE(D AND REF(A,1),C,O,3,1),COLORRED;

STICKLINE(D AND REF(B,1),H,L,0,0),COLORCYAN;

STICKLINE(D AND REF(B,1),C,O,3,0),COLORCYAN;

STICKLINE(GJ,C,O,1,0),COLORGREEN;

STICKLINE(DJ,C,O,1,0),COLORRED;

Related Reading:

The principle of the magical nine-turn indicator and the stock selection formula, there is no future function, the numbers do not disappearicon-default.png?t=N7T8https://blog.csdn.net/m0_74754828/article/details/133948749 a>

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

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

おすすめ

転載: blog.csdn.net/m0_74754828/article/details/135018903