N1:=8;
N2:=21; N3:=55; A1:(HHV(HIGH,N1)+LLV(LOW,N1))/2,COLORWHITE,LINETHICK2; A2:(HHV(HIGH,N2)+LLV(LOW,N2))/2,COLORGREEN,LINETHICK2; S1:REFX1(CLOSE,N2),COLORLIGHTBLUE,LINETHICK3; A3:REF((A1+A2)/2,N2),COLORYELLOW,LINETHICK1; A4:REF((HHV(HIGH,N3)+LLV(LOW,N3))/2,N2),COLORLIGHTGREY,LINETHICK1; STICKLINE(A4-A3>0,A3,A4,COLORGREEN,1); STICKLINE(A3-A4>0,A3,A4,COLORMAGENTA,1); HH2:=VALUEWHEN(A1>A2,A1); LL2:=VALUEWHEN(A2>A1,A2); K1:=IF(CLOSE>HH2,-3,IF(CLOSE<LL2,1,0)); K2:=VALUEWHEN(K1<>0,K1); G:=IF(K2=1,HH2,LL2); G1:=VALUEWHEN(ISLASTBAR,G); DRAWNUMBER(LOW>0,G1,G1,0,COLORCYAN); DRAWNUMBER(HIGH<0,G1,G1,0,COLORCYAN); W1:=K2; W2:=OPEN-CLOSE; HT:=IF(OPEN>CLOSE,OPEN,CLOSE); LT:=IF(OPEN<CLOSE,OPEN,CLOSE); DRAWLINE(W1=1,HIGH,W1=1,HT,COLORCYAN); DRAWLINE(W1=1,LOW,W1=1,LT,COLORCYAN); DRAWLINE(W1=-3,HIGH,W1=-3,HT,COLORRED); DRAWLINE(W1=-3,LOW,W1=-3,LT,COLORRED); STICKLINE(W1>0,OPEN,CLOSE,COLORCYAN,1); STICKLINE(W1<=0,OPEN,CLOSE,COLORRED,1); STICKLINE(W2>0&&W1<=0,OPEN,CLOSE,COLORRED,0); STICKLINE(W2>0&&W1>0,OPEN,CLOSE,COLORCYAN,0); DRAWTEXT(CROSS(W1<=0||W2>0&&W1<=0,0.5),H,'多'); DRAWTEXT(CROSS(W1>0||W2>0&&W1>0,0.5),H,'空'); |