V3.0:增加了自定义的撑压线
V4.0:增加了DDX,DDY,DDZ,适用于专业版
注:自动划线用到未来函数
{V2.0:大幅度修正了黄金柱和将军柱的定义,增加了将军柱的绘线}
{V3.0:增加了自定义的撑压线}
{V4.0:增加了DDX,DDY,DDZ,适用于专业版}
MA(CLOSE,22),COLORRED;
{柱子区域}
HJZ:={黄金柱}
(CLOSE/REF(CLOSE,1) 1.03 OR CLOSE/OPEN 1.03) &&
VOL/REF(VOL,1) 1.9 &&
REFX(LLV(LOW,3),3) =(CLOSE+OPEN)/2 &&
NOT(HIGH=LOW) {&&
VOL REFX(HHV(VOL,3),3)};
JJZ:={将军柱}
REFX(LLV(LOW,3),3) =OPEN &&
REFX(LLV(LOW,3),3) CLOSE &&
CLOSE/OPEN 1.03 &&
NOT(HIGH=LOW) &&
VOL REFX(HHV(VOL,3),3)*0.8;
CYDZL:={长阴短柱}
CLOSE/REF(CLOSE,1) 0.98 &&
REF(CLOSE,1) REF(OPEN,1)*0.99 &&
VOL REF(VOL,1)*1.1 &&
CLOSE OPEN;
SJZ:={升级柱}
JJZ && REFX(JJZ,1) && NOT(HIGH=LOW);
YSZ:={元帅柱}
REFX(COUNT(HJZ OR SJZ,2)=2,1);
BLZ:={倍量柱}
VOL/REF(VOL,1)
{底部横线}
DRAWLINE(YSZ,LOW,REF(YSZ,1),REF(LOW,1),1),COLORD90000;
DRAWLINE(JJZ,LOW,REF(JJZ,1),REF(LOW,1),1),COLORFF0080;
DRAWLINE(HJZ OR SJZ,LOW,REF(HJZ OR SJZ,1),REF(LOW,1),1),COLOR0080FF;
{文字区}
DRAWTEXT( JJZ&& NOT(HJZ OR SJZ) ,LOW*0.88,'将'),COLORBD005F;
DRAWTEXT((HJZ OR SJZ) && NOT(YSZ) ,LOW*0.88,'金'),COLOR0078F0;
DRAWTEXT(YSZ,REF(LOW*0.88,1),'帅'),COLORD90000;
DRAWNUMBER(JJZ&& NOT(HJZ OR SJZ),LOW*0.96,LOW);
DRAWNUMBER((HJZ OR SJZ) && NOT(YSZ) ,LOW*0.96,LOW);
DRAWNUMBER(YSZ,LOW*0.96,LOW);
DRAWICON(BLZ,HIGH*1.05,26);
{DRAWICON(CYDZL,HIGH*1.05,27);}
{绘制颜色图}
STICKLINE(JJZ ,LOW,HIGH,0,0),COLORFF00FF;
STICKLINE(JJZ ,CLOSE,OPEN,3,0),COLORFF00FF;
STICKLINE(HJZ OR SJZ,LOW,HIGH,0,0),COLOR0080FF;
STICKLINE(HJZ OR SJZ,CLOSE,OPEN,3,0),COLOR0080FF;
STICKLINE(YSZ,LOW,HIGH,0,0),COLORD90000;
STICKLINE(YSZ,CLOSE,OPEN,3,0),COLORD90000;
{H1:=HIGH=HHV(HIGH,3) && HIGH=REFX(HHV(HIGH,3),2);
H2:=BARSLAST(H1);
H3:=REF(HIGH,H2);}
{涨停板统计}
ZTBTJ:=
CLOSE/REF(CLOSE,1) 1.099 &&
NOT(HIGH=LOW);
DTB:=
CLOSE/REF(CLOSE,1) 0.901;
{5.增加所属行业}
{右下角}
{振幅}
振幅:=(H-L)/REF(C,1)*100;
平均振幅:=REF(MA(振幅,5),1);
DRAWTEXT_FIX(ISLASTBAR,0.95,0.90,0,'行业'),COLOR000080;
DRAWTEXT_FIX(ISLASTBAR,0.95,0.95,0,HYBLOCK),COLOR000080;
DRAWNUMBER_FIX(ISLASTBAR,0.85,0.95,0,WINNER(CLOSE)*100),COLOR0000FF;
DRAWNUMBER_FIX(ISLASTBAR,0.90,0.95,0,平均振幅),COLORRED;
DRAWTEXT_FIX(ISLASTBAR,0.90,0.90,0,'五日振幅'),COLORRED;
DRAWTEXT_FIX(ISLASTBAR,0.85,0.90,0,'获利盘'),COLOR0000FF;
DRAWNUMBER_FIX(ISLASTBAR,0.85,0.95,0,WINNER(CLOSE)*100),COLOR0000FF;
DRAWTEXT_FIX(ISLASTBAR,0.95,0.80,0,'涨停板'),COLOR000080;
DRAWNUMBER_FIX(ISLASTBAR,0.95,0.85,0,COUNT(CLOSE/REF(CLOSE,1) 1.099,250)),COLOR000080;
{平底}
PINGDI:=LOW=REF(LOW,1);
DRAWICON(BACKSET(PINGDI,2),LOW*0.97,34);
DLZ:={地量柱}{www.9m8.cn 九毛八公式指标网}
VOL=REFX(LLV(VOL,21),10) && NOT(HIGH=LOW);
{STICKLINE(DLZ,LOW,HIGH,0,1),COLORFF5151;
STICKLINE(DLZ,CLOSE,OPEN,3,0),COLORFF5151;}
{假阴真阳区域}
均价:=AMOUNT/VOL/100,NODRAW;
隐性假阴真阳:=
O =C AND 均价 =REF(C,1) &&
VOL REF(VOL,1);
显性假阴真阳:=
O =C AND C =REF(C,1) &&
VOL REF(VOL,1);
DRAWICON(隐性假阴真阳 && NOT(显性假阴真阳),HIGH*1.05,29);
DRAWTEXT(隐性假阴真阳 && NOT(显性假阴真阳),HIGH*1.10,'隐');
DRAWICON(显性假阴真阳,HIGH*1.05,30);
DRAWTEXT(显性假阴真阳,HIGH*1.10,'显');
DRAWLINE(显性假阴真阳 && CURRBARSCOUNT 60,OPEN,REF(显性假阴真阳,1),REF(OPEN,1),1),COLOR008000;
DRAWLINE(隐性假阴真阳 && CURRBARSCOUNT 60,OPEN,REF(隐性假阴真阳,1),REF(OPEN,1),1),COLOR008000;
DRAWNUMBER((隐性假阴真阳 OR 显性假阴真阳) && CURRBARSCOUNT 60,HIGH*1.02,OPEN),COLOR408000;
{双胜区域}
{SSYIN:=
REF(CLOSE,1)/REF(OPEN,1) 1 &&
CLOSE OPEN &&
CLOSE REF(OPEN,1) &&
VOL REF(VOL,1);
SSYANG:=
REF(CLOSE,1)/REF(OPEN,1) 1 &&
CLOSE OPEN &&
CLOSE REF(OPEN,1) &&
VOL REF(VOL,1);
DRAWTEXT(SSYIN,LOW*0.95,'胜'),COLORRED;
DRAWTEXT(SSYANG,HIGH*1.05,'胜'),COLORGREEN;};
{黄金分割线}
{顶1:=REFDATE(HHV(H,黄金分割周期),DATE);
底1:=REFDATE(LLV(L,黄金分割周期),DATE);
H0:底1,COLOR0000FF;
H809:顶1-(顶1-底1)*0.191,COLOR0080FF;
H618:顶1-(顶1-底1)*0.382,COLORFF0000;
H50:顶1-(顶1-底1)*0.5,COLORBLACK;
H382:顶1-(顶1-底1)*0.618,COLORFF0000;
H191:顶1-(顶1-底1)*0.809,COLOR0080FF;
H6:顶1,COLOR0000FF;}
{趋势线}
A1:=REF(H,N)=HHV(H,2*N+1);
B1:=FILTER(A1,N);
C1:=BACKSET(B1,N+1);
D1:=FILTER(C1,N);{高点}
A2:=REF(L,N)=LLV(L,2*N+1);
B2:=FILTER(A2,N);
C2:=BACKSET(B2,N+1);
D2:=FILTER(C2,N);{低点}
E1:=(REF(LLV(L,2*N),1)+REF(HHV(H,2*N),1))/2; E2:=(H+L)/2;{高低点出现在同一K线上时可作取舍}
H1:=(D1 AND NOT(D2 AND E1 =E2)) OR ISLASTBAR OR BARSCOUNT(C)=1;
L1:=(D2 AND NOT(D1 AND E1 E2)); H2:=D1 AND NOT(D2 AND E1 =E2);
X111:=REF(BARSLAST(H1),1)+1;
F1:=BACKSET(H1 AND COUNT(L1,X111) 0,LLVBARS(IF(L1,L,10000),X111));
G1:=F1 REF(F1,1);
I1:=BACKSET(G1,2);
LD:=I1 REF(I1,1);{过滤后低点}
L2:=LD OR ISLASTBAR OR BARSCOUNT(C)=1;
X222:=REF(BARSLAST(L2),1)+1;
F2:=BACKSET(L2 AND COUNT(H2,X222) 0,HHVBARS(IF(H2,H,0),X222));
G2:=F2 REF(F2,1);
I2:=BACKSET(G2,2);
HD:=I2 REF(I2,1);{过滤后高点}
R1:=BACKSET(ISLASTBAR,BARSLAST(HD)+1); S1:=R1 REF(R1,1); {前一高}
T1:=BACKSET(ISLASTBAR,BARSLAST(LD)+1); U1:=T1 REF(T1,1); {前一低}
R2:=BACKSET(S1,REF(BARSLAST(HD),1)+2); S2:=R2 REF(R2,1); {前二高}
T2:=BACKSET(U1,REF(BARSLAST(LD),1)+2); U2:=T2 REF(T2,1); {前二低}
T3:=BACKSET(U2,REF(BARSLAST(LD),1)+2); U3:=T3 REF(T3,1); {前三低}
R3:=BACKSET(S2,REF(BARSLAST(HD),1)+2); S3:=R3 REF(R3,1); {前三高}
T4:=BACKSET(U3,REF(BARSLAST(LD),1)+2); U4:=T4 REF(T4,1); {前四低}
R4:=BACKSET(S3,REF(BARSLAST(HD),1)+2); S4:=R4 REF(R4,1); {前四高}
短期压力:DRAWLINE(S2,H,S1,H,1),LINETHICK2,COLORGREEN;
短期支撑:DRAWLINE(U2,L,U1,L,1),LINETHICK2,COLORRED;
Z1:=U2;
Z2:=U1;
X1:=S2;
X2:=S1;
Y11:=REF(LOW,BARSLAST(Z1));
Y22:=REF(LOW,BARSLAST(Z2));
Y33:=REF(HIGH,BARSLAST(X1));
Y44:=REF(HIGH,BARSLAST(X2));
X11:=BARSLAST(Z1);
X22:=BARSLAST(Z2);
X33:=BARSLAST(X1);
X44:=BARSLAST(X2);
XL:=(Y22-Y11)/ABS(X22-X11);
Y3:=XL*X11+Y11;
XL2:=-(Y33-Y44)/ABS(X44-X33);
Y4:=XL2*X33+Y33;
{右下角}{www.9m8.cn 九毛八公式指标网}
DRAWTEXT_FIX(ISLASTBAR,0.80,0.90,0,'EPT下'),COLOR0000FF;
DRAWNUMBER_FIX(ISLASTBAR,0.80,0.95,0,XL/Y11*1000),COLOR0000FF;
DRAWTEXT_FIX(ISLASTBAR,0.75,0.90,0,'EPT上'),COLOR00FF00;
DRAWNUMBER_FIX(ISLASTBAR,0.75,0.95,0,XL2/Y33*1000),COLOR00FF00;
DRAWNUMBER(ISLASTBAR,LOW*0.99,Y3),COLOR0080FF;
大单动向:= DDX.大单动向#DAY ,NODRAW;
DRAWTEXT_FIX(1,0.933,0.12,0,'DDX:'),COLORFF0080;
DRAWNUMBER_FIX(1,0.963,0.12,0,CONST(大单动向)),COLORFF0080;
涨跌动因:= DDY.涨跌动因#DAY ,NODRAW;
DRAWTEXT_FIX(1,0.933,0.17,0,'DDY: '),COLORFF00FF;
DRAWNUMBER_FIX(1,0.963,0.17,0,CONST(涨跌动因)),COLORFF00FF;
大单差分:= DDZ.大单差分#DAY ,NODRAW;
DRAWTEXT_FIX(1,0.933,0.22,0,'DDZ: '),COLORFF80FF;
DRAWNUMBER_FIX(1,0.963,0.22,0,CONST(大单差分)),COLORFF80FF;