VAR1:=(4*CLOSE+OPEN)/5;
VAR2:=(8*VAR1+7*REF(VAR1,1)+6*REF(VAR1,2)+5*REF(VAR1,3)+4*REF(VAR1,4)+3*REF(VAR1,5)+2*REF(VAR1,6)+REF(VAR1,8))/36;
VAR3:=(HHV(VAR2,2)+HHV(VAR2,4)+HHV(VAR2,8))/3;
VAR4:=(LLV(VAR2,2)+LLV(VAR2,4)+LLV(VAR2,8))/3;
VAR5:=(HHV(VAR3,2)+HHV(VAR3,4)+HHV(VAR3,8))/3;
VAR6:=(LLV(VAR4,2)+LLV(VAR4,4)+LLV(VAR4,8))/3;
VAR7:=(LLV(VAR2,2)+LLV(VAR2,4)+LLV(VAR2,8))/3;
IF(VAR2<=REF(VAR2,1),VAR2,DRAWNULL),COLORGREEN,LINETHICK3;
IF(VAR2>=REF(VAR2,1),VAR2,DRAWNULL),COLORRED,LINETHICK3;
STICKLINE(VAR5>VAR2,VAR5,VAR2,0,0),COLORBLACK;
DRAWKLINE(HIGH,OPEN,LOW,CLOSE);
DRAWTEXT(REF(VAR6,1)=REF(VAR2,1) AND VAR6<VAR2,LOW*0.97,1),COLORRED;
DRAWTEXT(REF(VAR7,1)=REF(VAR2,1) AND VAR7<VAR2,LOW*0.93,1),COLORYELLOW;
DRAWTEXT(REF(VAR5,1)=REF(VAR2,1) AND VAR5>VAR2,HIGH*1.05,2),COLORGREEN;
VAR8:=REF(CLOSE,1)*1.1-CLOSE<0.01 AND HIGH=CLOSE;
VAR9:=CROSS(CLOSE,VAR5) AND VAR8;
DRAWTEXT(VAR9,LOW,3),COLORWHITE;
STICKLINE(VAR9,CLOSE,OPEN,3.2,0),COLOR0077FF;
STICKLINE(VAR9,CLOSE,OPEN,2.5,0),COLOR0099FF;
STICKLINE(VAR9,CLOSE,OPEN,1.9,0),COLOR00BBFF;
STICKLINE(VAR9,CLOSE,OPEN,1.2,0),COLOR00DDFF;
STICKLINE(VAR9,CLOSE,OPEN,0.3,0),COLORYELLOW;