{紅線上綠線下}
HH:=HHV(HIGH,1)/5+HHV(HIGH,2)/5+HHV(HIGH,2)/5+HHV(HIGH,5)/5+HHV(HIGH,8)/5;
LL:=LLV(LOW,1)/5+LLV(LOW,2)/5+LLV(LOW,2)/5+LLV(LOW,5)/5+LLV(LOW,8)/5;
H1:=IF(H<REF(H,2)&&REF(H,1)<REF(H,2),REF(H,2),0);
L1:=IF(L>REF(L,2)&&REF(L,1)>REF(L,2),REF(L,2),0);
H2:=VALUEWHEN(H1>0,H1);
L2:=VALUEWHEN(L1>0,L1);
K1:=IF(CLOSE>H2,-3,IF(CLOSE<L2,1,0));
K2:=VALUEWHEN(K1<>0,K1);
GG:=IF(K2=1,H2,L2);
GG1:=VALUEWHEN(ISLASTBAR,GG);
DRAWTEXT(LL>0,GG1,VARCAT(' ',VAR2STR(GG1,2))),COLORGREEN;
TMP1:=K2;
W1:=K2;
W2:=OPEN-CLOSE;
HT:=IF(OPEN>CLOSE,OPEN,CLOSE);
LT:=IF(OPEN<CLOSE,OPEN,CLOSE);
STICKLINE(TMP1=1 && REF(TMP1,1)=1,GG,REF(GG,1),0,0),COLORLIGREEN;
STICKLINE(TMP1=-3 && REF(TMP1,1)=-3,GG,REF(GG,1),0,0),COLORFF00FF;
GLT:=1;
DRAWSL(GLT && K2=1,GG,0,1,0),COLORGREEN;
DRAWSL(GLT && K2=1 && NOT(REF(K2,1)=1) && ISLASTBAR,GG,0,1,1),COLORGREEN;
DRAWSL(GLT && K2=-3,GG,0,1,0),COLORRED;
DRAWSL(GLT && K2=-3 && NOT(REF(K2,1)=-3) && ISLASTBAR ,GG,0,1,1),COLORRED;
{DRAWTEXT(GLT && CROSS(TMP1,0),HH,'賣'),COLORGREEN;
DRAWTEXT(GLT && CROSS(0,TMP1),LL,'買'),COLORYELLOW;}
DRAWTEXT(GLT && CROSS(0,TMP1) AND CURRBARSCOUNT<=10,LL,'買'),COLORYELLOW;
DRAWTEXT(GLT && CROSS(TMP1,0) AND CURRBARSCOUNT<=10,HH,'賣'),COLORGREEN;
|