TC1S:=IF(H=HHV(H,48),H,DRAWNULL);
TC2S:=CONST(BARSLAST(TC1S=H))+1;
UPPERS:=CONST(IF(TC2S=1,H,REF(H,TC2S-1)));
BC1S:=IF(L=LLV(L,48),L,DRAWNULL);
BC2S:=CONST(BARSLAST(BC1S=L))+1;
LOWERS:=CONST(IF(BC2S=1,L,REF(L,BC2S-1)));
LPS:=CURRBARSCOUNT<=BC2S AND L=LOWERS;
HPS:=CURRBARSCOUNT<=TC2S AND H=UPPERS;
AB1S:=EMA(((2*C+H+L)/4-LLV(LOW,30))/
(HHV(HIGH,30)-LLV(LOW,30))*100,8);
BA1S:=EMA(AB1S,5);{}
上轨:=REFDATE(REF(HHV(MAX(C,O),96),5),DATE);
下轨:=REFDATE(REF(LLV(MIN(C,O),96),5),DATE);
中轨:=((上轨)+(下轨))/2;
YXHX:=DATE>=REF(DATE,BARSLAST(IF(BC2S>TC2S,LPS,HPS)));
上沿:IF(AB1S>0 AND AB1S-BA1S<=0 AND YXHX,上轨,上轨),COLOR555555,DOTLINE;
中枢:IF(AB1S>0 AND AB1S-BA1S<=0 AND YXHX,中轨,中轨),COLOR555555,DOTLINE;
下沿:IF(AB1S>0 AND AB1S-BA1S<=0 AND YXHX,下轨,下轨),COLOR555555,DOTLINE;