UP:=DRAWLINE(L=LLV(L,BARSLAST(CROSS(NMA,RMA))+1) AND L=LLV(L,D) AND RMA =NMA,L,H=HHV(H,BARSLAST(CROSS(RMA,NMA))+1) AND H=HHV(H,D) AND RMA =NMA,H,0);
DOWN:=DRAWLINE(H=HHV(H,BARSLAST(CROSS(RMA,NMA))+1) AND H=HHV(H,D) AND RMA =NMA,H,L=LLV(L,BARSLAST(CROSS(NMA,RMA))+1) AND L=LLV(L,D) AND RMA =NMA,L,0);
BUY:IF((UP 0 AND DOWN='-')=0,1,IF((DOWN 0 AND UP='-')=0,-1,0)),COLORSTICK,LINETHICK1;
BTM:(H REF(H,1) AND L REF(L,1) AND REF(H,1) REF(H,2) AND REF(L,1) REF(L,2) AND REF(H,3) REF(H,2) AND REF(L,3) REF(L,2) AND C =MAX(REF(H,1),REF(H,3)) AND BUY=0),LINETHICK0;
DRAWICON((H REF(H,1) AND L REF(L,1) AND REF(H,1) REF(H,2) AND REF(L,1) REF(L,2) AND REF(H,3) REF(H,2) AND REF(L,3) REF(L,2) AND C =MAX(REF(H,1),REF(H,3)) AND BUY=0),1,11);