HH:=HHV(HIGH,2); LL:=LLV(LOW,2); H1:=IFELSE(HH<REF(HH,1)&&LL<REF(LL,1)&&REF(OPEN,1)>CLOSE&&OPEN>CLOSE&&(HHV(OPEN,0)-CLOSE)>0,REF(HH,0),0); L1:=IFELSE(LL>REF(LL,1)&&HH>REF(HH,1)&&REF(OPEN,1)<CLOSE&&OPEN<CLOSE&&(CLOSE-LLV(OPEN,0))>0,REF(LL,0),0); H2:VALUEWHEN(H1>0,H1); L2:VALUEWHEN(L1>0,L1); K1:=IFELSE(CLOSE>H2,-3,IFELSE(CLOSE<L2,1,0)); K2:=VALUEWHEN(K1<>0,K1); G:=IFELSE(K2=1,L2,H2); G1:=VALUEWHEN(ISLASTBAR,G); DRAWNUMBER(L>0,G1,G1,2,COLORYELLOW); MID:=MA(CLOSE,2); TMP2:=STD(CLOSE,2); T:=MID+2*TMP2; B:=MID-2*TMP2; DE:=MA((CLOSE-LLV(LOW,45))/(HHV(HIGH,45)-LLV(LOW,45))*100,2); TMP:=K2; W1:=K2; W2:=OPEN-CLOSE; DRAWLINE(W1>0,HIGH,1,CLOSE,COLORGREEN); DRAWLINE(W1>0,OPEN,1,LOW,COLORGREEN); DRAWLINE(W1<=0,HIGH,1,CLOSE,COLORRED); DRAWLINE(W1<=0,OPEN,1,LOW,COLORRED); DRAWLINE(W2>0,HIGH,W1<=0,OPEN,COLORMAGENTA); DRAWLINE(W2>0,CLOSE,W1<=0,LOW,COLORMAGENTA); DRAWLINE(W2>0,HIGH,W1>0,OPEN,COLORCYAN); DRAWLINE(W2>0,CLOSE,W1>0,LOW,COLORCYAN); STICKLINE(W1>0,OPEN,CLOSE,COLORGREEN,1); STICKLINE(W1<=0,OPEN,CLOSE,COLORRED,1); STICKLINE(W2>0&&W1<=0,OPEN,CLOSE,COLORMAGENTA,0); STICKLINE(W2>0&&W1>0,OPEN,CLOSE,COLORCYAN,0); DRAWTEXT(CROSS(TMP,0),HIGH,'賣'); DRAWTEXT(TMP>0&&CROSS(CLOSE,B)&&L2<H2,LOW,'減'); DRAWTEXT(CROSS(0,TMP),LOW,'買'); DRAWTEXT(TMP<0&&CROSS(T,CLOSE)&&L2>H2,HIGH,'減'); DRAWTEXT(TMP<0&&CROSS(DE,95.3),HIGH,'平'); DRAWTEXT(TMP>0&&CROSS(3.3,DE),LOW,'平'); |