通达信公式源码概况:
指标类别:通达信公式
授权方式: 免费版
指标评级: ★★★★★
指标分类: 策略
画线方法: 副图
XZ:=IF(SSR 60,SSR,59);
H60:=HHV(H,60)=H;
V60:=HHV(V,60)=V;
HV60:=H60ANDV60;
WZ:=FILTERX(HV60,XZ);
H REF(H,BArslAst(WZ));
异动:(V*100/CAPITAL)/5,COLORLIGRAY,LINETHICK2;
:MA(,4)/MA(VOL,100),COLORRED;
游资:MA(VOL,9)/MA(VOL,100),COLORGREEN;
大户:MA(VOL,20)/MA(VOL,100),COLORMAGENTA;
:MA(VOL,30)/MA(VOL,100),COLORFFFFAD;
STICKLINE(主力 游资,主力,游资,4,0),LINETHICK1,COLORRED;
STICKLINE(游资 大户,游资,大户,4,0),LINETHICK1,COLORGREEN;
STICKLINE(大户 散户,大户,散户,4,0),LINETHICK1,COLORMAGENTA;
STICKLINE(散户 =0,散户,0,4,0),LINETHICK1,COLOR334455;
持股:DMA(AMOUNT/V/100,V/CAPITAL),NODRAW,COLORRED;
上市日期:FINANCE(42)/100,NODRAW,COLORYELLOW;
市盈率:CLOSE/(FINANCE(30)/FINANCE(1)),NODRAW,COLORYELLOW;
市净率:CLOSE/FINANCE(35),NODRAW;
量:MA(VOL,5)/MA(VOL,100),COLORWHITE,LINETHICK2;
CS:=(CLOSE-LLV(LOW,8))/(HHV(HIGH,8)-LLV(LOW,8));
价:(EMA(CS,3))*3,COLORRED,LINETHICK1;成交:=VOL;
均量3:MA(VOL,3),LAYER0,ColorYELLOW,LINETHICK2;
均量5:=MA(VOL,M1);
均量20:MA(VOL,M2),LAYER0,colorGREEN,LINETHICK2;
均量50:MA(VOL,50),COLORRED,LAYER0,LINETHICK2;
HS:=V/CAPITAL*100;
放量:=IF(CROSS(HS,N),1,0);
DRAWICON(放量ANDCROSS(均量5,均量20)and均量3 ref(均量3,1),vol,12),colorYELLOW,ALIGN1,VALIGN1,LINETHICK1;
JV:=(OPEN+CLOSE+HIGH+LOW)/4;
JG:=AMOUNT/VOL/100;
均价5:MA(JG,5),colorred;
均价20:MA(JG,20),colorff00ff;
持股:STICKLINE(均价20 JVand均价5 JV,0,V,8,0),colorred;
STICKLINE(均价20 JVand均价5 JV,0,V,8,0),Color041CEC;
STICKLINE(均价20 JVand均价5 JV,0,V,6.6,0),Color0F26FB;
STICKLINE(均价20 JVand均价5 JV,0,V,4.4,0),Color2439FB;
STICKLINE(均价20 JVand均价5 JV,0,V,2.2,0),Color485AFB;
STICKLINE(均价20 JVand均价5 JV,0,V,1,0),Color6473FB;
持币:STICKLINE(均价20 JVand均价5 JV,0,V,8,0),COLORFF7700;
STICKLINE(均价20 JVand均价5 JV,0,V,6.6,0),COLORFF8811;
STICKLINE(均价20 JVand均价5 JV,0,V,4.4,0),COLORFFAA22;
STICKLINE(均价20 JVand均价5 JV,0,V,3.3,0),COLORFFBB33;
STICKLINE(均价20 JVand均价5 JV,0,V,2,0),COLORFFDD44;
STICKLINE(均价20 JVand均价5 JV,0,V,0.8,0),COLORFFEE55;
警戒:STICKLINE(均价20 JVand均价5 JV,0,V,6,0),colorBB11AA;
STICKLINE(均价20 JVand均价5 JV,0,V,8,0),COLORBB11BB;
STICKLINE(均价20 JVand均价5 JV,0,V,6.6,0),COLORBB11AA;
STICKLINE(均价20 JVand均价5 JV,0,V,4.4,0),COLORCC22BB;
STICKLINE(均价20 JVand均价5 JV,0,V,3.3,0),COLORDD33BB;
STICKLINE(均价20 JVand均价5 JV,0,V,2,0),COLOREE44BB;
STICKLINE(均价20 JVand均价5 JV,0,V,0.8,0),COLORFF55BB;
关注:STICKLINE(均价20 JVand均价5 JV,0,V,6,0),color00BBFF;
STICKLINE(均价20 JVand均价5 JV,0,V,8,0),COLOR00AAFF;
STICKLINE(均价20 JVand均价5 JV,0,V,4.4,0),COLOR00CCFF;
STICKLINE(均价20 JVand均价5 JV,0,V,3.3,0),COLOR00DDFF;
STICKLINE(均价20 JVand均价5 JV,0,V,2,0),COLOR00EEFF;
STICKLINE(均价20 JVand均价5 JV,0,V,1.1,0),COLOR00FFFF;
DRAWTEXTABS(80,0, [和股价关系图示,黄线上交绿线,成交量放大,买入!红柱VOL持股,黄柱关注,紫柱警戒减仓,青柱空仓持币] ),LINETHICK1,colorYELLOW;
INPUT:N(5);
a0:=BARSCOUNT(c);a3:=SYSPARAM(3);a2:=SYSPARAM(2);
a4:=SYSPARAM(4);a5:=SYSPARAM(5);
nn0:=a3-a2;nn:=a0-a2;hh1:=(a4-a5)/10;
y0:=a0 vv0:=if(y0=1 and SYSPARAM(1) =a0,v,0);
c1:=if(BETWEEN(c,a4-0*hh1,a4-1*hh1),vv0,0);
c2:=if(BETWEEN(c,a4-1*hh1,a4-2*hh1),vv0,0);
c3:=if(BETWEEN(c,a4-2*hh1,a4-3*hh1),vv0,0);
c4:=if(BETWEEN(c,a4-3*hh1,a4-4*hh1),vv0,0);
c5:=if(BETWEEN(c,a4-4*hh1,a4-5*hh1),vv0,0);
c6:=if(BETWEEN(c,a4-5*hh1,a4-6*hh1),vv0,0);
c7:=if(BETWEEN(c,a4-6*hh1,a4-7*hh1),vv0,0);
c8:=if(BETWEEN(c,a4-7*hh1,a4-8*hh1),vv0,0);
c9:=if(BETWEEN(c,a4-8*hh1,a4-9*hh1),vv0,0);
c10:=if(BETWEEN(c,a4-9*hh1,a4-10*hh1),vv0,0);
v1:=STRTONUM(NUMTOSTR(if(ISLASTBAR,sum(c1,nn0),0),2));
v2:=STRTONUM(NUMTOSTR(if(ISLASTBAR,sum(c2,nn0),0),2));
v3:=STRTONUM(NUMTOSTR(if(ISLASTBAR,sum(c3,nn0),0),2));
v4:=STRTONUM(NUMTOSTR(if(ISLASTBAR,sum(c4,nn0),0),2));
v5:=STRTONUM(NUMTOSTR(if(ISLASTBAR,sum(c5,nn0),0),2));
v6:=STRTONUM(NUMTOSTR(if(ISLASTBAR,sum(c6,nn0),0),2));
v7:=STRTONUM(NUMTOSTR(if(ISLASTBAR,sum(c7,nn0),0),2));
v8:=STRTONUM(NUMTOSTR(if(ISLASTBAR,sum(c8,nn0),0),2));
v9:=STRTONUM(NUMTOSTR(if(ISLASTBAR,sum(c9,nn0),0),2));
v10:=STRTONUM(NUMTOSTR(if(ISLASTBAR,sum(c10,nn0),0),2));
av0:=max(v1,max(v2,max(v3,max(v4,max(v5,max(v6,max(v7,max(v8,max(v9,v10)))))))));
FILLRGN(v1/av0 =nn/nn0 and nn =0,a4-0*hh1,a4-1*hh1+0.05),colormagenta;
FILLRGN(v2/av0 =nn/nn0 and nn =0,a4-1*hh1,a4-2*hh1+0.05),colormagenta;
FILLRGN(v3/av0 =nn/nn0 and nn =0,a4-2*hh1,a4-3*hh1+0.05),colormagenta;
FILLRGN(v4/av0 =nn/nn0 and nn =0,a4-3*hh1,a4-4*hh1+0.05),colormagenta;
FILLRGN(v5/av0 =nn/nn0 and nn =0,a4-4*hh1,a4-5*hh1+0.05),colormagenta;
FILLRGN(v6/av0 =nn/nn0 and nn =0,a4-5*hh1,a4-6*hh1+0.05),colormagenta;
FILLRGN(v7/av0 =nn/nn0 and nn =0,a4-6*hh1,a4-7*hh1+0.05),colormagenta;
FILLRGN(v8/av0 =nn/nn0 and nn =0,a4-7*hh1,a4-8*hh1+0.05),colormagenta;
FILLRGN(v9/av0 =nn/nn0 and nn =0,a4-8*hh1,a4-9*hh1+0.05),colormagenta;
FILLRGN(v10/av0 =nn/nn0 and nn =0,a4-9*hh1,a4-10*hh1+0.05),colormagenta;
hh:=SYSPARAM(4);ll:=SYSPARAM(5);
x:=ll-(hh-ll+MINDIFF)/n;
y:=HHV(VOL,SYSPARAM(3)-SYSPARAM(2)+1);
yvb:=y[SYSPARAM(3)]/(ll-x+MINDIFF);
z:=VOL/yvb+x;
STICKLINE(CLOSE REF(CLOSE,1),x,z,7,1),Color0000FF;
STICKLINE(CLOSE =REF(CLOSE,1),x,z,7,0),ColorEAE000;
五日:MA(z,5);
十日:MA(z,10);
DRAWTEXT(BARPOS=SYSPARAM(2),HIGH,{STKNAME+ n +STKLABEL+ n +}BLKNAME)align4,COLORGREEN;
STICKLINE(C =O,C,O,7,0),COLORRED;
STICKLINE(C =O,C,O,4,0),COLORB0B0FF;
STICKLINE(C =O,C,O,2,0),COLORYELLOW;
STICKLINE(C =O,H,L,0,0),COLORYELLOW;
STICKLINE(C =O,C,O,7,0),COLORFF2020;
STICKLINE(C =O,C,O,4,0),COLORFF6600;
STICKLINE(C =O,C,O,2,0),COLORCYAN;
STICKLINE(C =O,H,L,0,0),COLORCYAN;
博弈线:=WMA(CLOSE,8),linethick3;
byx:=WMA(CLOSE,8),linethick3;
FILLRGN(byx ref(byx,1),byx,ref(byx,1)),COLORRED;
FILLRGN(byx ref(byx,1),byx,ref(byx,1)),COLORgreen;
Var1:=SYSPARAM(3)-SYSPARAM(2)+1;
Var2:=SYSPARAM(3)-BARPOS;
Var3:=HHV(HIGH,Var1);
Var4:=LLV(LOW,VaR1);
Var5:=REFX(Var3,Var2); //主图最高价
Var5:IF(SYSPARAM(3) SYSPARAM(1),SYSPARAM(6),Var5),COLORRED,POINTDOT;
Var6:REFX(Var4,Var2),COLORWHITE,POINTDOT; //主图最低价
黄191:(Var5-Var6)*0.191+Var6,COLORYELLOW,POINTDOT;
黄382:(Var5-Var6)*0.382+Var6,COLORYELLOW,POINTDOT;
黄500:(Var5-Var6)*0.500+Var6,COLORGREEN,POINTDOT;
黄618:(Var5-Var6)*0.618+Var6,COLORYELLOW,POINTDOT;
黄809:(Var5-Var6)*0.809+Var6,COLORYELLOW,POINTDOT;
A:=LOW=LLV(LOW,240);
A1:=BARSLAST(A);
VERTLINE(A1=30);
VERTLINE(A1=60);
VERTLINE(A1=90);
VERTLINE(A1=120);
VERTLINE(A1=150);
VERTLINE(A1=180);
VERTLINE(A1=210);
VERTLINE(A1=2400);
DRAWTEXT(A1=30,HIGH, 第一时间
DRAWTEXT(A1=60,HIGH, 第二时间
DRAWTEXT(A1=90,HIGH, 第三时间
DRAWTEXT(A1=120,HIGH, 第四时间
DRAWTEXT(A1=150,HIGH, 第五时间
DRAWTEXT(A1=180,HIGH, 第六时间
DRAWTEXT(A1=210,HIGH, 第七时间
DRAWTEXT(A1=240,HIGH, 第八时间
Varr1:=SMA(MAX(CLOSE-REF(CLOSE,1),0),6,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),6,1)*100;
DRAWICON(CROSS(82,Varr1),HIGH+0.108,2);VERTLINE(CROSS(82,varr1)),POINTDOT;
DRAWSL(CROSS(82,varr1),HHV(HIGH,1),0,8,1),colormagenta,POINTDOT;
b1:=(SYSPARAM(4)-SYSPARAM(5))/(SYSPARAM(3)-SYSPARAM(2));
DRAWSL(BARPOS=SYSPARAM(1),LOW,378*b1/100,0,0),COLORwhite,POINTDOT;
DRAWSL(BARPOS=SYSPARAM(1),LOW,188*b1/100,0,0),COLORwhite,POINTDOT;
DRAWSL(BARPOS=SYSPARAM(1),LOW,141*b1/100,0,0),COLORwhite,POINTDOT;
DRAWSL(BARPOS=SYSPARAM(1),LOW,95*b1/100,0,0),COLORwhite,POINTDOT;
DRAWSL(BARPOS=SYSPARAM(1),LOW,48*b1/100,0,0),COLORgreen,;
DRAWSL(BARPOS=SYSPARAM(1),LOW,24.5*b1/100,0,0),COLORwhite,POINTDOT;
DRAWSL(BARPOS=SYSPARAM(1),LOW,16.5*b1/100,0,0),COLORwhite,POINTDOT;
DRAWSL(BARPOS=SYSPARAM(1),LOW,13*b1/100,0,0),COLORwhite,POINTDOT;
DRAWSL(BARPOS=SYSPARAM(1),LOW,7*b1/100,0,0),COLORwhite,POINTDOT;
公式解读:
编写条件:
KDJ三次底的公式。
编写方法:
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,3,1);
D:=Sma(K,3,1);
J:=3*K-2*D;
A2:=BArslAst(REF(crOSS(K,D),1));
K底背离:=REF(C,A2+1) LLV(L,3)ANDREF(K,A2+1) KANDCROSS(K,D)ANDK
三次底背离:COUNT(K底背离,30)=3