VAR1:=1;
VAR2:=((((2*CLOSE)+HIGH)+LOW) / 4);
VAR4:=LLV(LOW,5);
VAR5:=HHV(HIGH,4);
X_1:=1.2*LLV(CLOSE,300);
STICKLINE(CLOSE<X_1 AND CLOSE>=OPEN,OPEN,CLOSE,3,0),COLORGREEN;
STICKLINE(CLOSE<X_1 AND CLOSE>=OPEN,LOW,HIGH,0.5,0),COLORGREEN;
C1:=(EMA((((VAR2-VAR4)/(VAR5-VAR4))*100),4)*VAR1),COLORRED,LINETHICK2;
C2:=(EMA(((0.667*REF(C1,1))+(0.333*C1)),2)*VAR1),COLORFFFFFF,LINETHICK2;
X_2:=1.5*LLV(CLOSE,300);
STICKLINE(RANGE(CLOSE,X_1,X_2) AND CLOSE>=OPEN,OPEN,CLOSE,3,0),COLORRED;
STICKLINE(RANGE(CLOSE,X_1,X_2) AND CLOSE>=OPEN,LOW,HIGH,0.5,0),COLORRED;
AA:=C1>=C2 ;
BB:=C2>C1 ;
DRAWICON(CROSS(C1,C2),L-0.1,1);
DRAWICON(CROSS(C2,C1),H+0.1,2);
X_3:=1.8*LLV(CLOSE,300);
STICKLINE(RANGE(CLOSE,X_2,X_3) AND CLOSE>=OPEN,OPEN,CLOSE,3,0),COLORMAGENTA;
STICKLINE(RANGE(CLOSE,X_2,X_3) AND CLOSE>=OPEN,LOW,HIGH,0.5,0),COLORMAGENTA;
STICKLINE(AA,C,O,2,0),COLORRED;
STICKLINE(AA,H,L,0.5,0),COLORRED;
STICKLINE(BB,C,O,2,0),COLOR00FF00;
STICKLINE(BB,H,L,0.5,0),COLOR00FF00;
STICKLINE(AA,CLOSE,OPEN,2.5,0),COLOR000099;
STICKLINE(AA,CLOSE,OPEN,1.5,0),COLOR0000CC;
X_4:=REF(CLOSE,1);
X_5:=IF((CLOSE-X_4)*100/X_4>=10-0.01*100/X_4,1,0);
STICKLINE(X_5,OPEN,CLOSE,2,0),COLORYELLOW;
STICKLINE(AA,CLOSE,OPEN,1.5,0),COLOR0000FF;
STICKLINE(AA,CLOSE,OPEN,0.5,0),COLORCC66FF;
STICKLINE(BB,CLOSE,OPEN,2.5,0),COLORFF7700;
STICKLINE(BB,CLOSE,OPEN,2.2,0),COLORFF9900;
STICKLINE(BB,CLOSE,OPEN,1.5,0),COLORFFBB00;
STICKLINE(BB,CLOSE,OPEN,0.5,0),COLORCYAN;
DRAWTEXT(CROSS(CLOSE,X_1),X_1,15),COLORYELLOW;
DRAWTEXT(CROSS(CLOSE,X_2),X_2,16),COLORYELLOW;
DRAWTEXT(CROSS(CLOSE,X_3),X_3,17),COLORYELLOW;
DRAWTEXT(CROSS(CLOSE,2*LLV(CLOSE,300)),2*LLV(CLOSE,300),18),COLORYELLOW;