N:=30;
TR : MAX(MAX((HIGH-LOW),ABS(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW)),NODRAW;
ATR : MA(TR,N),NODRAW;
A1:=HHV(CLOSE,N)-3*ATR;
A2:=REF(A1,1);
A3:=IF(REF(CLOSE,1) A2,MAX(A1,A2),A1);
B1:=LLV(CLOSE,N)+3*ATR;
B2:=REF(B1,1);
B3:=IF(REF(CLOSE,1) B2,MIN(B1,B2),B1);
FLAG:=IF(CLOSE B2,1,IF(CLOSE A2,-1,1));
LONGWAVE:IF(FLAG=1,A3,NULL),COLORRED,LINETHICK2;
SHORTWAVE:IF(NOT(FLAG=1),B3,NULL),COLORGREEN,LINETHICK2;
COND1:=FLAG=1 AND REF(FLAG,1)=-1;
=FLAG=-1 AND REF(FLAG,1)=1;
//云析赢指标公式网:www.yunxi518.com
DRAWICON(COND1,A3*0.998, ICO4
DRAWICON(COND2,B3*1.002, ICO5
DRAWNUMBER(ISLASTBAR FLAG=1,A3,A3,0,COLORRED),VALIGN0,FONTSIZE25;
DRAWNUMBER(ISLASTBAR NOT(FLAG=1),B3,B3,0,COLORGREEN),FONTSIZE25;
DRAWCOLORKLINE(C LONGWAVE,COLORRED,1);
DRAWCOLORKLINE(C LONGWAVE ISDOWN,COLORRED,0);
DRAWCOLORKLINE(C SHORTWAVE,COLORGREEN,1);
DRAWCOLORKLINE(C SHORTWAVE ISDOWN,COLORGREEN,0);