HH1:=HHV(HIGH,4);
LL1:=LLV(LOW,4);
HH2:=HHV(H,4);
LL2:=LLV(L,4);
N1:=BARSLAST(CLOSE>REF(HH1,1));
N2:=BARSLAST(CLOSE<REF(LL1,1));
STICKLINE(N1<N2,OPEN,CLOSE,COLORRED,1);
STICKLINE(N2<N1,OPEN,CLOSE,COLORBLUE,1);
HT:= IFELSE (OPEN>CLOSE,OPEN,CLOSE);
LT:= IFELSE (OPEN<CLOSE,OPEN,CLOSE);
DRAWLINE(N1<N2,H,N1<N2,HT,COLORRED);
DRAWLINE(N1<N2,L,N1<N2,LT,COLORRED);
DRAWLINE(N2<N1,H,N2<N1,HT,COLORBLUE);
DRAWLINE(N2<N1,L,N2<N1,LT,COLORBLUE);
O2:=OPEN-CLOSE;
STICKLINE(O2>0&&N1<N2,OPEN,CLOSE,COLORRED,0);
STICKLINE(O2>0&&N1>N2,OPEN,CLOSE,COLORBLUE,0);
MID:MA(C,28);
TMP2:=STD(CLOSE,43);
TOP:MID+2*TMP2;
BOTTOM:MID-2*TMP2;
COND1:=IF(REF(L,3)=REF(L,1),L>REF(L,3),0)&&REF(L,2)>=REF(L,3)&&REF(L,3)<REF(L,4)&&REF(L,3)<REF(L,5);
COND2:=IF(L<>REF(L,2),L>REF(L,2),0)&&REF(L,1)>=REF(L,2)&&REF(L,2)<REF(L,3)&&REF(L,2)<REF(L,4);
DRAWLINE3(COND1,REF(L,SUMBARS(COND1||COND2,2)+1),3,1,REF(L,SUMBARS(COND1||COND2,2)+1),SUMBARS(COND1||COND2,2)+1,0),DOT,COLORLIGHTBLUE;
DRAWLINE3(COND2,REF(L,SUMBARS(COND1||COND2,2)+1),3,1,REF(L,SUMBARS(COND1||COND2,2)+1),SUMBARS(COND1||COND2,2)+1,0),DOT,COLORLIGHTBLUE;
COND3:=IF(REF(H,3)=REF(H,1),H<REF(H,3),0)&&REF(H,2)<=REF(H,3)&&REF(H,3)>REF(H,4)&&REF(H,3)>REF(H,5);
COND4:=IF(H<>REF(H,2),H<REF(H,2),0)&&REF(H,1)<=REF(H,2)&&REF(H,2)>REF(H,3)&&REF(H,2)>REF(H,4);
DRAWLINE3(COND3,REF(H,SUMBARS(COND3||COND4,2)+1),3,1,REF(H,SUMBARS(COND3||COND4,2)+1),SUMBARS(COND3||COND4,2)+1,0),DOT,COLORMAGENTA;
DRAWLINE3(COND4,REF(H,SUMBARS(COND3||COND4,2)+1),3,1,REF(H,SUMBARS(COND3||COND4,2)+1),SUMBARS(COND3||COND4,2)+1,0),DOT,COLORMAGENTA;
|