波1:=12;
A1:=REF(H,5)=HHV(H,2*6+1);
B1:=FILTER(A1,5);
C1:=BacKSET(B1,5+1);
D1:=FILTER(C1,5+1);
A2:=REF(L,5)=LLV(L,2*10+1);
B2:=FILTER(A2,5+1);
C2:=BACKSET(B2,5+1);
D2:=FILTER(C2,5);
E1:=(REF(LLV(L,2*3),1)+REF(HHV(H,2*3),1))/2;
E2:=(H+L)/2;
H1:=(D1 AND NOT(D2 AND E1>=E2)) OR BARstATUS=2 OR BARSCOUNT(C)=1;
L1:=(D2 AND NOT(D1 AND E1< E2));
H2:= D1 AND NOT(D2 AND E1>=E2);
X1:=REF(BArslAST(H1),1)+1;
F1:=BACKSET(H1 AND COUNT(L1,X1)>0,LLVBARS(IF(L1,L,10000),X1));
G1:=F1>REF(F1,1);
I1:=BACKSET(G1,2);
LD:=I1>REF(I1,1);
L2:=LD OR BARSTATUS=2 OR BARSCOUNT(CLOSE)=1;
X2:=REF(BARSLAST(L2),1)+1;
F2:=BACKSET(L2 AND COUNT(H2,X2)>0,HHVBARS(IF(H2,HIGH,0),X2));
G2:=F2>REF(F2,1);
I2:=BACKSET(G2,2);
HD:=I2>REF(I2,1);
DRAWLINE(LD,L,HD,H,0),COLORRED;
DRAWLINE(HD,H,LD,L,0),COLORGREEN;
J1:=BACKSET(BARSTATUS=2 ,MIN(BARSLAST(HD),BARSLAST(LD))+1);
J2:=J1>REF(J1,1);
DRAWLINE(J2,IF(HD,H,L),BARSTATUS=2 ,IF(BARSLAST(HD)>BARSLAST(LD),H,L),0),DOTLINE,COLORWHITE;{=========}
C點:=BARSLAST(LD);
DRAWTEXT(LD AND BARSLAST(HD)<BARSLAST(REF(LD,1)) ,L-0.1,'A'),COLORRED;
DRAWTEXT(HD,H+0.1,'B'),COLORGREEN;
ZT:(C/REF(C,1)>=1.0975 AND C=H) OR (C/REF(C,1)>=1.1975 AND C=H) NODRAW;
高:=5;
低:=10;
高選:=1;
低選:=1;
波2:=1;
PURC:=CONST(FINDHIGH(H,0,高*5,高選));
PLZ:=CONST(BARSLAST(PURC=H))+1;
頂X:=CONST(IF(PLZ=1,H,REF(H,PLZ-1)));
QQT:=CONST(FINDLOW(L,0,低*10,低選));
PLL:=CONST(BARSLAST(QQT=L))+1;
低X:=CONST(IF(PLL=1,L,REF(L,PLL-1)));
DRAWKLINE(H,O,L,C);
頂點:=頂X,COLORRED;
底點:=低X,COLORRED;
波動速率:=100*((頂X-低X)/(IF(PLL>PLZ,低X,頂X)))/(PLL-PLZ),NODRAW,COLORmaGENTA;
波動幅度:=((頂X-低X)/(IF(PLL>PLZ,低X,頂X)))*100;
波動價位:=(頂X-低X)*(IF(PLL>PLZ,1,-1));
BPURC:=CONST(FINDHIGH(H,0,(IF(波1>0,波1,IF(PLZ<PLL,高,低)))*5,波2));BPLZ:=CONST(BARSLAST(BPURC=H))+1;
BQQT:=CONST(FINDLOW (L,0,(IF(波1>0,波1,IF(PLZ<PLL,高,低)))*5,波2));BPLL:=CONST(BARSLAST(BQQT =L))+1;
BLC1:=CONST(FINDHIGH(H,0,(IF(波1>0,波1,IF(PLZ<PLL,高,低)))*5,波2));BLC2:=CONST(BARSLAST(BPURC=H))+1;
BLC頂X:=CONST(IF(BPLZ=1,H,REF(H,BPLZ-1)));
BLC3:=CONST(FINDLOW(L,0,(IF(波1>0,波1,IF(PLZ<PLL,高,低)))*5,波2));
B6C4:=CONST(BARSLAST(BQQT=L))+1;
BLC低X:=CONST(IF(BPLL=1,L,REF(L,BPLL-1)));
BASE:=IF(波動速率<0,BLC頂X,BLC低X),COLORRED;
BLCX:=IF(波動速率<0,-1,1);
BLCZ:=(頂點-底點)*(IF(PLL>PLZ,1,-1));
B12:=BASE+(BLCZ*0.775),COLORRED;
B14:=BASE+(BLCZ*0.868),COLORRED;
B200:=BASE+(BLCZ*1 ),COLORRED;
XZDD:=IF(PLL>PLZ,BPLL,BPLZ);
STICKLINE(CURRBARSCOUNT=XZDD ,BASE,B200,0,0),COLORGREEN;
STICKLINE(ZT,O,C,2,0),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=XZDD,B12 ,'---------------------------C1'),COLORC0FF7F;
DRAWTEXT(CURRBARSCOUNT=XZDD,B14 ,'---------------------------C2'),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=XZDD,B200,'---------------------------C3'),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=10,B12 ,CON2STR(B12 ,2)),COLORC0FF7F;
DRAWTEXT(CURRBARSCOUNT=10,B14 ,CON2STR(B14 ,2)),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=10,B200,CON2STR(B200,2)),COLORGREEN;