N:=20;
A1:=REF(H,N)=HHV(H,2*N+1);
B1:=FILTER(A1,N);
C1:=BACKSET(B1,N+1);
D1:=FILTER(C1,N);
R11:=BACKSET(ISLASTBAR,BARSLAST(D1)+1); S11:=R11>REF(R11,1);
DRAWLINE(D1,H,S11,H,1),COLORGREEN,CROSSDOT;
A2:=REF(L,N)=LLV(L,2*N+1);
B2:=FILTER(A2,N);
C2:=BACKSET(B2,N+1);
D2:=FILTER(C2,N);
T11:=BACKSET(ISLASTBAR,BARSLAST(D2)+1);
U11:=T11>REF(T11,1);
DRAWLINE(D2,L,U11,L,1),COLORRED,CIRCLEDOT;
M:=INTPART(3*N/5);
A12:=REF(H,M)=HHV(H,2*M+1);
B12:=FILTER(A12,M);
C12:=BACKSET(B12,M+1);
D12:=FILTER(C12,M);
R112:=BACKSET(ISLASTBAR,BARSLAST(D12)+1);
S112:=R112>REF(R112,1);
DRAWLINE(D12,H,S112,H,1),COLORGREEN,POINTDOT;
A22:=REF(L,M)=LLV(L,2*M+1);
B22:=FILTER(A22,M);
C22:=BACKSET(B22,M+1);
D22:=FILTER(C22,M); T112:=BACKSET(ISLASTBAR,BARSLAST(D22)+1);
U112:=T112>REF(T112,1);
DRAWLINE(D22,L,U112,L,1),COLORRED,POINTDOT;
{價(jià)值線}MA2:MA(C,2),COLORCYAN;
均價(jià):=(2*C+(C+H+L+O)/4+O)/4;
R:=(2*L+3*均價(jià))/5;R1:=(2*H+3*均價(jià))/5;
M5:MA((R+R1)/2,5),COLORWHITE;
M15:=MA((R+R1)/2,15);
M25:=MA((R+R1)/2,25),COLORYELLOW;
M35:=MA((R+R1)/2,35);
M45:=MA((R+R1)/2,45);
M55:=MA((R+R1)/2,55);
M65:=MA((R+R1)/2,65);
M75:=MA((R+R1)/2,75);
M85:=MA((R+R1)/2,85);
M95:=MA((R+R1)/2,95);
M105:=MA((R+R1)/2,105);
M115:=MA((R+R1)/2,115);
M125:=MA((R+R1)/2,125),COLORGREEN;
工作線:EMA((M5+M15+M25)/3,5),COLORYELLOW;
價(jià)值線:EMA((M5+M15+M25+M35+M45+M55+M65+M75+M85+M95+M105+M115+M125)/13,25),COLORRED,LINETHICK2;
乾坤線:=EMA(價(jià)值線-(EMA((R+R1)/2,2)-價(jià)值線),3),COLORAAAA00;
IF(價(jià)值線<乾坤線,價(jià)值線,DRAWNULL),COLORAAAA00,LINETHICK2;
IF(價(jià)值線>乾坤線,價(jià)值線,DRAWNULL),COLORRED;
{洗盤殺入線}
T1:=CONST(LLVBARS(LOW,10));
T1HIGH:=CONST(REF(HIGH,T1));
CC:=CONST(CURRBARSCOUNT);
T2:=CONST(BARSLAST((CURRBARSCOUNT >(CC+T1)) AND (HIGH>T1HIGH)));
T2HIGH:=CONST(REF(HIGH,T2));
T3:=CONST(BARSLAST((CURRBARSCOUNT >(CC+T2)) AND (HIGH>T2HIGH)));
T3HIGH:=CONST(REF(HIGH,T3));
洗盤殺入線:DRAWLINE(CURRBARSCOUNT=T3+1, T3HIGH, ISLASTBAR, T3HIGH, 1),LINETHICK3,COLOR0000FF;
DRAWTEXT(ISLASTBAR, T3HIGH, ' 洗盤殺入線')LINETHICK1,COLORYELLOW;
{三線法}
MA15:=MA(CLOSE,15),COLORYELLOW;
MA43:MA(CLOSE,43),COLORMAGENTA;
MA210:MA(CLOSE,210),COLORCYAN,LINETHICK1;
MA318:MA(CLOSE,318),COLORLIMAGENTA,LINETHICK1;
阻力:REFDATE(REF(HHV(H,22),1),DATE),COLORGRAY,;
{發(fā)信號這一天的收盤價(jià)為基準(zhǔn)往左畫水平線,跨度40個交易日}
AA:=HHV(C,22);
BB:=REF(AA,1);
CC1:=CROSS(C,BB);
DD:=FILTER(CC1,20);
DRAWICON(CURRBARSCOUNT<=240 AND DD,L*0.98,1);
DRAWLINE(CURRBARSCOUNT<=240,C,REF(DD,1),REF(C,1),1),COLORLIGREEN,LINETHICK2;
DRAWTEXT(CROSS(REF(ZIG(3,19),1),ZIG(3,19)),HIGH*1.01,'莊'), ,COLORYELLOW;
DRAWTEXT(CROSS(ZIG(3,19),REF(ZIG(3,19),1)),LOW*0.99,'陳'), ,COLORRED;
{波段第55天畫線}
VAR3:=HHVBARS(ZIG(3, 19)>REF(ZIG(3,19),1) AND REF(ZIG(3,19), 1)< REF(ZIG(3,19), 2),0);
Z54:=FILTER(VAR3=54,55);
IF(VAR3=54,HHV(H,0),DRAWNULL),STICK,COLORYELLOW;
第55天:DRAWLINE(CURRBARSCOUNT<=2400,C,REF(Z54,1),REF(C,1),1),COLORYELLOW,LINETHICK2;