KU 1:=IF (height =HHV (high, 3), 1, 0);
KD 1:=IF(LOW=LLV(LOW,3), 1,0);
UL:=IF(REF(KU 1, 2)= 1 and REF(KU 1, 1)=0.
And KU 1=0, REF (high, 2), REF (high, 2+BARSLAST(REF(KU 1, 2)= 1
And REF(KU 1, 1)=0 and ku1= 0));
DL:=IF(REF(KD 1, 2)= 1 and REF(KD 1, 1)=0 and KD 1=0, REF(LOW, 2), REF(LOW, 2)
And REF(KD 1, 1)=0 and KD1= 0));
HV:= H & gt; UL and H & gtREF(H,1);
LV:= L & lt; DL and L & ltREF(L,1);
GP:= bars last(HV);
DP:= bars last(LV);
IP:=IF(GP=0,DP,GP)& gt; 3;
HV 1:=HV and IP and H & gt=HHV(H, Barlast (LV));
LV 1:=LV and IP and L < = LLV (L, Barlast (HV));
DRAWLINE(LV 1, low, HV 1, high, 0), coloryellow, LINETHICK2.
DRAWLINE(HV 1, high, LV 1, low, 0), colormagenta, LINETHICK2.
///Join the central decision-making.
//Simplified version
n 1:= 10; N2:= 10; DISP:= 2; k:= 1;
P 1:=PEAK( 1,K*N 1, 1);
P2:=PEAK( 1,K*N 1,2);
WP 1:=PEAKBARS( 1,K*N 1, 1);
WP2:=PEAKBARS( 1,K*N 1,2);
T 1:= slot (2, K*N2,1);
T2:= slot (2, K*N2, 2);
WT 1:=TROUGHBARS(2,K*N2, 1);
WT2:=TROUGHBARS(2,K*N2,2);
TJ 1:= p 1 & gt; T 1 and p2 >; T2;
ZD:=MAX(T 1,T2);
ZG:=MIN(P 1,P2);
LL:=MIN(T 1,T2);
HH:=MAX(P 1,P2);
TJ2:= filter (ZG>;; ZD,2);
TJ3:=ZG=REF(ZG, Bastrast (TJ2)) or ZD=REF(ZD, Bastrast (TJ2));
TJ4:=TJ 1 and TJ2 and not (tj3);
TJ5:=BETWEEN(ZD, REF(ZD, REF (basrast (TJ4), 1)), REF(ZG, REF (basrast (TJ4),1));
TJ6:=BETWEEN(ZG, REF(ZD, REF (basrast (TJ4), 1)), REF(ZG, REF (basrast (TJ4),1));
TJ7:= ZG & gt; REF(ZG, ref (Baslaster (TJ4), 1)) and ZD < REF(ZD, ref (Baslast (TJ4),1));
TJ8:=TJ4 AND NOT(TJ5 or TJ6 or tj7);
ZSD:=IF(TJ8,ZD,REF(ZD, 1))。 //,coloryellow
ZSG:=IF(TJ8,ZG,REF(ZG, 1))。 //,colormagenta
ZSH:=IF(TJ8,HH,REF(HH, 1)); //,colorblue
ZSL:=IF(TJ8,LL,REF(LL, 1)); //,colorgreen
STICKLINE(TJ8,ZSH,ZSL,0,- 1),colormagenta
STICKLINE(TJ8,ZSD,ZSG,IF(DISP= 1,3,0), 1),colormagenta
DRAWTEXT(DISP=2,ZSH,)colorwhite
//Center height
Center height: ZSG, colormagenta
POLYLINE(DISP=2,REF(ZSG,BARSLAST(TJ8))),CIRCLEDOT,colormagenta
//Central Low Level:
Low in the middle: ZSD, yellow in color;
Polyline (DISP=2, REF(ZSD, BARSLAST(TJ8)), circular dot, coloryellow.
//Central highest:
Highest center: ZSH, red;
POLYLINE(DISP=2,REF(ZSH,BARSLAST(TJ8))),POINTDOT,colorred
//Central Minimum:
Lowest center: ZSL, colorgreen
POLYLINE(DISP=2,REF(ZSL,BARSLAST(TJ8))),POINTDOT,colorgreen
//High trend:
//QSGD 1:POLYLINE(DISP=3,ZIG( 1,K*N 1)),colorblue
//Low trend:
//QSDD 1:POLYLINE(DISP=3,ZIG(2,K*N2)),colorblue
MA5:MA(CLOSE,5),COLORFF00FF,line thick 1;
//COLORFF00FF,LINETHICK2
Good luck: = MA5 & gtREF(MA5,1);
What a terrible life: = ma5
//Judgment:
PARTLINE(MA5, good life, yellow color, poor life, blue color, MA5, color ff 00ff), line thickness 3;
//f 1:IF(MA5 & lt; REF(MA5, 1),MA5,NULL),colorwhite,LINETHICK2