gspt1:=55;
gspt2:=13;
gspt3:=CLOSE< REF(LLV(L,gspt1),1);
gspt4:=CLOSE>REF(HHV(H,gspt1),1);
gspt5:=BARSLAST(gspt4)< BARSLAST(gspt3);
gspt6:=BARSLAST(gspt3)< BARSLAST(gspt4);
gspt7:=CLOSE< REF(LLV(L,gspt2),1);
gspt8:=CLOSE>REF(HHV(H,gspt2),1);
gspt9:=BARSLAST(gspt8)< BARSLAST(gspt7);
gspt10:=BARSLAST(gspt7)< BARSLAST(gspt8);
STICKLINE(NOT(gspt9) AND gspt6 && CLOSE>OPEN,OPEN,CLOSE,COLORGREEN,1);
STICKLINE(NOT(gspt9) AND gspt6 && CLOSE<=OPEN,OPEN,CLOSE,COLORGREEN,0);
DRAWLINE(NOT(gspt9) AND gspt6,HIGH,CLOSE>OPEN,CLOSE,COLORGREEN);
DRAWLINE(NOT(gspt9) AND gspt6,LOW,CLOSE>OPEN,OPEN,COLORGREEN);
DRAWLINE(NOT(gspt9) AND gspt6,HIGH,CLOSE<=OPEN,LOW,COLORGREEN);
STICKLINE(gspt9 AND gspt6 && CLOSE>OPEN,OPEN,CLOSE,RGB(162,58,205),1),COLORRED;
STICKLINE(gspt9 AND gspt6 && CLOSE<=OPEN,OPEN,CLOSE,RGB(162,58,205),0),COLORRED;
DRAWLINE(gspt9 AND gspt6,HIGH,CLOSE>OPEN,CLOSE,RGB(162,58,205)),COLORRED;
DRAWLINE(gspt9 AND gspt6,LOW,CLOSE>OPEN,OPEN,RGB(162,58,205)),COLORRED;
DRAWLINE(gspt9 AND gspt6,HIGH,CLOSE<=OPEN,LOW,RGB(162,58,205)),COLORRED;
STICKLINE(NOT(gspt10) AND gspt5 && CLOSE>OPEN,OPEN,CLOSE,COLORRED,1);
STICKLINE(NOT(gspt10) AND gspt5 && CLOSE<=OPEN,OPEN,CLOSE,COLORRED,0);
DRAWLINE(NOT(gspt10) AND gspt5,HIGH,CLOSE>OPEN,CLOSE,COLORRED);
DRAWLINE(NOT(gspt10) AND gspt5,LOW,CLOSE>OPEN,OPEN,COLORRED);
DRAWLINE(NOT(gspt10) AND gspt5,HIGH,CLOSE<=OPEN,LOW,COLORRED);
STICKLINE(gspt10 AND gspt5 && CLOSE>OPEN,OPEN,CLOSE,COLORGREEN,1);
STICKLINE(gspt10 AND gspt5 && CLOSE<=OPEN,OPEN,CLOSE,COLORGREEN,0);
DRAWLINE(gspt10 AND gspt5,HIGH,CLOSE>OPEN,CLOSE,COLORGREEN);
DRAWLINE(gspt10 AND gspt5,LOW,CLOSE>OPEN,OPEN,COLORGREEN);
DRAWLINE(gspt10 AND gspt5,HIGH,CLOSE<=OPEN,LOW,COLORGREEN);
gspt11:=55;
gspt12:=EMA(CLOSE,gspt11);
gspt13:=EMA(CLOSE,gspt11);
gspt14:=(EMA(CLOSE,gspt11)+MA(CLOSE,gspt11)+MA(CLOSE,2*gspt11))/3;
gspt15:=BARSLAST(CROSS(gspt12,gspt14));
gspt16:=BARSLAST(CROSS(gspt14,gspt12));
gspt17:=gspt15< gspt16 AND REF(gspt10 AND gspt5 ,1) AND NOT(gspt10) AND gspt5;
gspt18:=gspt15>gspt16 AND REF(gspt9 AND gspt6,1) AND NOT(gspt9) AND gspt6;
DRAWICON(gspt17 ,L ,1 );
DRAWICON(gspt18 ,H ,2 );