N:=80;
M1:=8;
M2:=8;
N2:=12;
高:=REF(HHV(H,N),1);
低:=REF(LLV(L,N),1);
H1:=高-(高-低)/3;
H2:=高-(高-低)*2/3;
H3:=H2-(高-低)/6;
顶点:REFDATE(高,DATE),COLORWHITE;
第1支撑点:REFDATE(H1,DATE),COLORYELLOW;
第2支撑点:REFDATE(H2,DATE),COLORMAGENTA;
极限点:REFDATE(H3,DATE),COLORMAGENTA;
低点:REFDATE(低,DATE),COLORWHITE;
DRAWTEXT(ISLASTBAR,顶点,'顶点'),COLORWHITE;
DRAWTEXT(ISLASTBAR,第1支撑点,'第1支撑点'),COLORYELLOW;
DRAWTEXT(ISLASTBAR,第2支撑点,'第2支撑点'),COLORYELLOW;
DRAWTEXT(ISLASTBAR,极限点,'极限点'),COLORYELLOW;
DRAWTEXT(ISLASTBAR,低点,'低点'),COLORWHITE;
【箱顶】:PEAK(HIGH,10,1)*0.8*(1+M1/100),COLORGREEN;
【箱底】:PEAK(HIGH,10,1)*0.8*(1-M2/100),COLORGREEN;
【箱高】:100*(【箱顶】-(【箱顶】-【箱底】)*0.5),NODRAW;
{BIAS}
LC:=REF(CLOSE,1);
DRAWTEXT(CROSS((CLOSE-MA(CLOSE,N2))/MA(CLOSE,N2)*100,MA((CLOSE-MA(CLOSE,N2))/MA(CLOSE,N2)*100,N2)),LOW,'-----买入'),COLORYELLOW;
DRAWTEXT(CROSS(MA((CLOSE-MA(CLOSE,N2))/MA(CLOSE,N2)*100,N2),(CLOSE-MA(CLOSE,N2))/MA(CLOSE,N2)*100),HIGH,'-----逃顶'),COLORYELLOW;