高:=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;