INPUT:N1(3,3,10,1),N2(5,5,20,1);
MA1:=EMA(CLOSE,N1);
MA2:=EMA(CLOSE,N2);
MADT:=MA1>=MA2;
MAKT:=MA1<MA2;
STICKLINE(MADT,HIGH,LOW,5,1),COLORRED;
STICKLINE(MAKT,HIGH,LOW,5,0),COLORCYAN;
XMADT:=CROSS(MA1,MA2);
XMAKT:=CROSS(MA2,MA1);
JCTT:=BARSLAST(XMADT);
SCTT:=BARSLAST(XMAKT);
JCGDTT:=BARSLAST(H=HHV(H,JCTT+1));
SCGDTT:=BARSLAST(L=LLV(L,SCTT+1));
DRAWICON(CROSS(BACKSET(XMAKT,JCGDTT+1),0.5),HIGH,11);
DRAWICON(CROSS(BACKSET(XMADT,SCGDTT+1),0.5),LOW,10);