MA5:MA(C,5);
MA10:MA(C,10);
A1:=H REF(H,1) AND L REF(L,1){向上};
A2:=H REF(H,1) AND L REF(L,1){向下};
A3:=H REF(H,1) AND L REF(L,1){向左包含};
A4:=H REF(H,1) AND L REF(L,1){被左包含};
A5:=REF(H,1) REF(H,2) AND REF(L,1) REF(L,2){向上};
A6:=REF(H,1) REF(H,2) AND REF(L,1) REF(L,2){向下};
B0:=A3 OR A4;
H1:=IF(A5 AND B0,MAX(H,REF(H,1)),H){向上的高点};
L1:=IF(A5 AND B0,MAX(L,REF(L,1)),L){向上的低点};
H2:=IF(A6 AND B0,MIN(H,REF(H,1)),H){向下的高点};
L2:=IF(A6 AND B0,MIN(L,REF(L,1)),L){向下的低点};
BH:=IF(A5 AND B0,H1,IF(A6 AND B0,H2,H)){K线合并的高点};
BL:=IF(A5 AND B0,L1,IF(A6 AND B0,L2,L)){K线合并的低点};
B1:=H REF(BH,1) AND L REF(BL,1){向上};
B2:=H REF(BH,1) AND L REF(BL,1){向下};
B3:=H REF(BH,1) AND L REF(BL,1){向左包含};
B4:=H REF(BH,1) AND L REF(BL,1){被左包含};
B5:=REF(BH,1) =REF(BH,2) AND REF(BL,1) =REF(BL,2){向上};
B6:=REF(BH,1) =REF(BH,2) AND REF(BL,1) =REF(BL,2){向下};
C0:=B3 OR B4;
H3:=IF(B5 AND C0,MAX(H,REF(BH,1)),H){向上的高点};
L3:=IF(B5 AND C0,MAX(L,REF(BL,1)),L){向上的低点};
H4:=IF(B6 AND C0,MIN(H,REF(BH,1)),H){向下的高点};
L4:=IF(B6 AND C0,MIN(L,REF(BL,1)),L){向下的低点};
CH:=IF(B5 AND C0,H3,IF(B6 AND C0,H4,H)){合并后的高点};
CL:=IF(B5 AND C0,L3,IF(B6 AND C0,L4,L)){合并后的低点};
C1:=H REF(CH,1) AND L REF(CL,1){向上};
C2:=H REF(CH,1) AND L REF(CL,1){向下};
C3:=H REF(CH,1) AND L REF(CL,1){向左包含};
C4:=H REF(CH,1) AND L REF(CL,1){被左包含};
C5:=REF(CH,1) =REF(CH,2) AND REF(CL,1) =REF(CL,2){向上};
C6:=REF(CH,1) =REF(CH,2) AND REF(CL,1) =REF(CL,2){向下};
D0:=C3 OR C4{当前K线有包含};
H5:=IF(C5 AND D0,MAX(H,REF(CH,1)),H){向上的高点};
L5:=IF(C5 AND D0,MAX(L,REF(CL,1)),L){向上的低点};
H6:=IF(C6 AND D0,MIN(H,REF(CH,1)),H){向下的高点};
L6:=IF(C6 AND D0,MIN(L,REF(CL,1)),L){向下的低点};
HH:=IF(C5 AND D0,H5,IF(C6 AND D0,H6,H)){合并后的高点};
LL:=IF(C5 AND D0,L5,IF(C6 AND D0,L6,L)){合并后的低点};
LLL:=REF(HH,1) HH AND REF(LL,1) LL AND REF(HH,1) =REF(HH,2) AND REF(LL,1) =REF(LL,2);
DFH:=IF((C5 OR C6) AND D0,HH,H);
DFL:=IF((C5 OR C6) AND D0,LL,L);
KLL:=LLV(L,5);
HKJ:=REF(LL,1)=KLL;
XG:=REF(DFL,2) =REF(DFL,1) AND REF(DFL,1) DFL AND
REF(DFH,2) =REF(DFH,1) AND REF(DFH,1) DFH ;
K1:=BARSLAST(CROSS(XG,0.5));
K2:=REF(REF(K1,1),K1)+K1+1;
K3:=BACKSET(CURRBARSCOUNT=1,5);
AA:=IF(K3=1 AND CROSS(XG,0.5),C,DRAWNULL);
BB:=IF(K3=1 AND CROSS(LLL,0.5),C,DRAWNULL);
STICKLINE(BB,C,O,3,1),COLORGREEN;
STICKLINE(AA,C,O,3,1),COLORYELLOW;
成交金额:=AMOUNT/100000000.0,;
换手率:=IF((SETCODE==0||SETCODE==1),100*VOL,VOL)/(FINANCE(7)/100);
DRAWTEXT_FIX(1,0.65,0.95,0,'换手率:'),COLORRED;
DRAWNUMBER_FIX(1,0.7,0.95,0,CONST(换手率)),COLORRED;
DRAWTEXT_FIX(1,0.65,0.9,0,'成交额:'),COLORRED;
DRAWNUMBER_FIX(1,0.7,0.9,0,CONST(成交金额)),COLORRED;