(来源:文华财经)
NG:=BACKSET(ISLASTBAR,BARSLAST(CROSS(TIME>=IFELSE(PERIOD=0&&EXIST(TIME>2400,DAYBARPOS),090000,0900)&&TIME<IFELSE(PERIOD=0&&EXIST(TIME>2400,DAYBARPOS),150000, 1500),0.5)||CROSS(TIME>=IFELSE(PERIOD=0&&EXIST(TIME>2400,DAYBARPOS),210000,2100)&&TIME<IFELSE(PERIOD=0&&EXIST(TIME>2400,DAYBARPOS),220000,2200),0.5))+1);////指标 2
MAP:=MA(C,2),NODRAW;//(C,2)
AAL:CROSS(TIME>=IF(PERIOD=0&&NOT(BARTYPE=1),120000, 1200)&&TIME<IF(PERIOD=0&&NOT(BARTYPE=1),140000, 1400),0.5),NODRAW;
MYY:=BACKSET(ISLASTBAR,SUMBARS(REFX1(DAYBARPOS=1,1)||REFX1(TIME=0900,1)||REFX(AAL,1)=1,2));
DD:=REFX(CROSSDOWN((ISUP||ISEQUAL)&&NG,0.5),1)||ISLASTBAR&&(ISUP||ISEQUAL)&&NG;
KK:=REFX(CROSSDOWN(ISDOWN&&NG,0.5),1)||ISLASTBAR&&ISDOWN&&NG;
HH:= BACKSET(DD,HHVBARS(H,BARSLASTCOUNT((ISUP||ISEQUAL)&&NG))+1);
HHH:=CROSS(HH=1,0.5)||HH=1&&BARSLASTCOUNT((ISUP||ISEQUAL)&&NG)=1;
LL:= BACKSET(KK,LLVBARS(L,BARSLASTCOUNT(ISDOWN&&NG))+1);
LLL:=CROSS(LL=1,0.5)||LL=1&&BARSLASTCOUNT(ISDOWN&&NG)=1;
AX:=BACKSET(ISLASTBAR,SUMBARS(HHH||LLL,4));//4
DRAWLINE1(HHH&&AX,H,LLL&&AX,L,0),COLORGREEN,LINETHICK2;
DRAWLINE1(LLL&&AX,L,HHH&&AX,H,0),COLORBLUE,LINETHICK2;