通达信指标公式源码概况:

指标类别: 通达信指标公式

授权方式: 免费版

指标评级: ★★★★★

指标分类: 策略

画线方法: 副图

  通达信筹码分布指标公式源码

INPUT:t(21,13,250),tt(21,1,100);  

{DRAWGBK(EMA((C+L+H)/3,6)>EMA(EMA((C+L+H)/3,6),5),  

COLORRGB(100,50,0),COLORRGB(100,100,0),0);{涨变红}  

DRAWGBK(EMA((C+L+H)/3,6)<EMA(EMA((C+L+H)/3,6),5),  

COLORRGB(0,110,0),COLORRGB(0,0,0),0);{跌变绿}  

{量价重心-筹码分布}  

W00:=COST(1);W10:=COST(10);W20:=COST(20);  

W30:=COST(30);W40:=COST(40);W50:=COST(50);  

W60:=COST(60);W70:=COST(70);W80:=COST(80);  

W90:=COST(90);W100:=COST(99);  

W5:=COST(5);W15:=COST(15);W25:=COST(25);  

W35:=COST(35);W45:=COST(45);W55:=COST(55);  

W65:=COST(65);W75:=COST(75);W85:=COST(85);W95:=COST(95);  

C5:=W5-W00;  

C10:=W10-W5;C15:=W15-W10;C20:=W20-W15;C25:=W25-W20;  

C30:=W30-W25;C35:=W35-W30;C40:=W40-W35;C45:=W45-W40;C50:=W5  

0-W45;  

C55:=W55-W50;C60:=W60-W55;C65:=W65-W60;C70:=W70-W65;C75:=W7  

5-W70;  

C80:=W80-W75;C85:=W85-W80;C90:=W90-W85;C95:=W95-W90;C100:=W  

100-W95;  

ZX:=MIN(C5,MIN(C10,MIN(C15,MIN(C20,MIN(C25,MIN(C30,MIN(C35,MIN(C4  

0,MIN(C45,MIN(C50,MIN(C55,MIN(C60,MIN(C65,MIN(C70,MIN(C75,MIN(C80,  

MIN(C85,MIN(C90,MIN(C95,C100)))))))))))))))))))LINETHICK0;  

FILLRGN(ZX=C5,W00,W5)COLORGRAY;  

FILLRGN(ZX=C10,W10,W5)COLORGRAY;FILLRGN(ZX=C15,W15,W10)  

COLORGRAY;FILLRGN(ZX=C20,W20,W15)COLORGRAY;  

FILLRGN(ZX=C25,W25,W20)COLORGRAY;FILLRGN(ZX=C30,W30,W25)  

COLORGRAY;FILLRGN(ZX=C35,W35,W30)  

COLORGRAY;FILLRGN(ZX=C40,W40,W35)COLORGRAY;  

FILLRGN(ZX=C45,W45,W40)COLORGRAY;FILLRGN(ZX=C50,W50,W45)  

COLORGRAY;FILLRGN(ZX=C55,W55,W50)  

COLORGRAY;FILLRGN(ZX=C60,W60,W55)COLORGRAY;  

FILLRGN(ZX=C65,W65,W60)COLORGRAY;FILLRGN(ZX=C70,W70,W65)  

COLORGRAY;FILLRGN(ZX=C75,W75,W70)  

COLORGRAY;FILLRGN(ZX=C80,W80,W75)COLORGRAY;  

FILLRGN(ZX=C85,W85,W70)COLORGRAY;FILLRGN(ZX=C90,W90,W85)  

COLORGRAY;FILLRGN(ZX=C95,W95,W90)  

COLORGRAY;FILLRGN(ZX=C100,W100,W95)COLORGRAY;  

{三日转向}  

Ay:=HHV(H,3);  

By:=LLV(L,3);  

kc:=c;  

kh:=h;  

kl:=l;  

fori=1todatacountdo  

IFkh[i]>ay[i-1]andkc[i]>kc[i-1]ThenE[i]:=By[i];  

ELSEIFkl[i]<by[i-1]andkc[i]<kc[i-1]ThenE[i]:=Ay[i];  

ELSEE[i]:=E[i-1];  

PARTLINE(C,E),LINETHICK3,ColorC3C7C8;}//转向  

{均线}  

zq:=DATATYPE;  

j:=(c*2+h+l)/4;  

m:ema(ma(j,3),3),colorffffff;  

mm:ema(m,t),color00ffff;  

PARTLINE(m>ref(m,1),m),ColorE9D3F8,LINETHICK2;  

PARTLINE(mm>ref(mm,1),mm),Color0089FF,LINETHICK2;  

{{黄金分割}  

n1:=sysparam(3);  

n:=n1-sysparam(2)+1;  

hh:=hhv(H,n);  

ll:=llv(L,n);  

最高:=hh[n1];  

最低:=ll[n1];  

低:最低+(最高-最  

低)*0.191,POINTDOT,PRECISION2,LINETHICK3,ColorFF8900;  

中:最低+(最高-最低)*0.5,LINEDOT,PRECISION2,COLORMAGENTA;  

高:最低+(最高-最低)*0.809,LINEDOT,PRECISION2,COLORRED;  

{南山K线}  

qp1:=wma(c,2);//短加权均线  

bb1:=ema(qp1,2);//平滑  

qp0:=ma(bb1,3);//平均  

qp2:=wma((h+c+o)/3,18);//长加权均线  

dd3:=qp0>=qp2andc>qp2;//短>长,且收>长  

dd4:=qp0<qp2;//短<长  

dd5:=qp0>qp2;//短>长  

STICKLINE((dd4ordd5)ando<=c,h,l,0.5,0),Color00cc99;//跌势阳线  

STICKLINE((dd4ordd5)ando<=c,c,o,7,0),Color00cc99;//跌势阳线  

STICKLINE((dd4ordd5)ando>=c,h,l,0.5,0),Color3F8C3A;//跌势阴线  

STICKLINE((dd4ordd5)ando>=c,c,o,7,0),Color3F8C3A;//跌势阴线  

STICKLINE((dd3orc>qp2)ando<=c,c,o,7,0),Colorred;//涨势阳线  

STICKLINE((dd3orc>qp2)ando<=c,h,l,0.5,0),Colorred;//涨势阳线  

STICKLINE((dd3orc>qp2)ando>=c,c,o,7,0),Colorff33ff;//涨势阴线  

STICKLINE((dd3orc>qp2)ando>=c,h,l,0.5,0),Colorff33ff;//涨势阴线  

STICKLINE(MA(C,13)>OandC>MA(C,13)andO<c,O,C,8,0),coloryellow;//生  

命线  

STICKLINE(MA(C,13)>OandC>MA(C,13),H,L,0.8,1),coloryellow;}//生命线  

{个股大盘开关}  

上证:=STRCMP(STKLABEL,'1A0001');  

深证:=STRCMP(STKLABEL,'399001');  

sb:=(上证=1and深证=1)or(上证=-1and深证=-1);//市场识别  

{箱体}  

a:=BARPOS;  

a1:=SYSPARAM(1);  

a2:=SYSPARAM(2);  

a3:=SYSPARAM(3);  

a4:=SYSPARAM(4);  

a5:=SYSPARAM(5);  

b:=DATACOUNT;  

gd:=(a4-a5)/5;  

g1:=hhv(h,tt);  

gh:=g1[a1];  

gg:=h=gh;  

d2:=llv(l,tt*2);  

dl2:=d2[a1];  

dd2:=l=dl2;  

d3:=llv(l,tt*4);  

dl3:=d3[a1];  

dd3:=l=dl3;  

DRAWLINE(dd3,gh*0.98,gg,gh*0.98,0),color00babd,LINEDOT;  

zx:=(dl2+gh)/2;  

DRAWLINE(dd3,zx,gg,zx,0),color00babd,LINEDOT;  

DRAWLINE(dd3,zx,gg,gh*0.98,0),color00babd,LINEDOT;  

STICKLINE(dd3,zx*0.98,dl2,0,0),color00babd,LINEDOT;  

DRAWLINE(dd3,dl2,gg,dl2,0),color00babd,LINEDOT;  

{移动式120日均线}  

上证:=STRCMP(STKLABEL,'1A0001');  

深证:=STRCMP(STKLABEL,'399001');  

sb:=(上证=1and深证=1)or(上证=-1and深证=-1);//市场识别  

ssb:=IF(CAPITAL=0,sb=0,(sb=1orsb=-1));  

gxa4:=SYSPARAM(4);  

gxa5:=SYSPARAM(5);  

gd45:=(gxa4-gxa5)/5;  

总量:=sum(if(BETWEEN(c,gxa4-0*gd45,gxa4-5*gd45),v,0),120);  

总额:=sum(if(BETWEEN(c,gxa4-0*gd45,gxa4-5*gd45),AMOUNT,0),120);  

dp:=sum(c,120)/120;//个股  

df:=总额/总量/0.3;//大盘  

PARTLINE(a1<=a,if(ssb,dp[DATACOUNT],df[DATACOUNT])),colorffbbff,SHIF  

T3;//120日均线  

{实时}  

DRAWBKBMP(zq=1orzq=0,'lsxz');  

实时线:PARTLINE(zq=1orzq=0,c),colorffffff;  

r:=OPENMINUTES(TIME);  

fh:=IF(VOL=0,1,VOL);  

分均:PARTLINE(zq=1orzq=0,sum(fh*c,r)/sum(fh,R)),color00ffff;  

VERTLINE(IF(zq=1,r=120,0)),colorffff00,POINTDOT;  

VERTLINE(IF(zq=1,r=240,0)),colorred;  

go:=FORCAST(FORCAST(l,80),80);  

PARTLINE(zq=1,"zb.zb#day"),color00ff00;  

PARTLINE(zq=1orzq=0,go),colorred;  

{解盘}  

tj:=if(a>280,280,b);  

hh:=hhv(H,tj);  

ll:=llv(L,tj);  

zh:=hh[a1];{新改动的}  

zl:=ll[a1];{新改动的}  

gq:=(zh-zl)/5;  

ba1:=sum(if(between(c,zh-0*gq,zh-1*gq),v,0),tj);  

ba2:=sum(if(between(c,zh-1*gq,zh-2*gq),v,0),tj);  

ba3:=sum(if(between(c,zh-2*gq,zh-3*gq),v,0),tj);  

ba4:=sum(if(between(c,zh-3*gq,zh-4*gq),v,0),tj);  

ba5:=sum(if(between(c,zh-4*gq,zh-5*gq),v,0),tj);  

gd1:=C<zh-0*gqANDC>=zh-1*gq;//高  

gd2:=C<zh-1*gqANDC>=zh-2*gq;  

gd3:=C<zh-2*gqANDC>=zh-3*gq;//中  

gd4:=C<zh-3*gqANDC>=zh-4*gq;  

gd5:=C<zh-4*gqANDC>=zh-5*gq;//低  

{}  

STICKLINE(BACKSET(a=a3,gd1),zh-0*gq,zh-1*gq,1,0),COLOR0000ff,LINETHI  

CK3,SHIFT1;  

STICKLINE(BACKSET(a=a3,gd2),zh-1*gq,zh-2*gq,1,0),COLORff00ff,LINETHIC  

K3,SHIFT1;  

STICKLINE(BACKSET(a=a3,gd3),zh-2*gq,zh-3*gq,1,0),COLOR00ffff,LINETHIC  

K3,SHIFT1;  

STICKLINE(BACKSET(a=a3,gd4),zh-3*gq,zh-4*gq,1,0),COLORffbb00,LINETHI  

CK3,SHIFT1;  

STICKLINE(BACKSET(a=a3,gd5),zh-4*gq,zh-5*gq,1,0),COLOR00ff00,LINETHI  

CK3,SHIFT1;  

DRAWTEXT(BACKSET(a=a3,gd1),zh-0*gq,'价\n高\n'),color0000ff,SHIFT2;  

DRAWTEXT(BACKSET(a=a3,gd2),zh-1*gq,'价\n近\n高'),colorff00ff,SHIFT2;  

DRAWTEXT(BACKSET(a=a3,gd3),zh-2*gq,'价\n中\n'),color00ffff,SHIFT2;  

DRAWTEXT(BACKSET(a=a3,gd4),zh-3*gq,'价\n近\n低'),colorffbb00,SHIFT2;  

DRAWTEXT(BACKSET(a=a3,gd5),zh-4*gq,'价\n低\n'),color00ff00,SHIFT2;  

{}  

zu:=MAX(ba1,MAX(ba2,MAX(ba3,MAX(ba4,ba5))));  

STICKLINE(zu=ba1anda=a3,zh-0*gq,zh-1*gq,1,0),COLOR0000ff,SHIFT1;  

STICKLINE(zu=ba2anda=a3,zh-1*gq,zh-2*gq,1,0),COLORff00ff,SHIFT1;  

STICKLINE(zu=ba3anda=a3,zh-2*gq,zh-3*gq,1,0),COLOR00ffff,SHIFT1;  

STICKLINE(zu=ba4anda=a3,zh-3*gq,zh-4*gq,1,0),COLORffbb00,SHIFT1;  

STICKLINE(zu=ba5anda=a3,zh-4*gq,zh-5*gq,1,0),COLOR00ff00,SHIFT1;  

DRAWTEXT(zu=ba1anda=a3,zh-0.6*gq,'密\n集\n高'),color0000ff,SHIFT2;  

DRAWTEXT(zu=ba2anda=a3,zh-1.6*gq,'密\n集\n近\n高  

'),colorff00ff,SHIFT2;  

DRAWTEXT(zu=ba3anda=a3,zh-2.6*gq,'密\n集\n中'),color00ffff,SHIFT2;  

DRAWTEXT(zu=ba4anda=a3,zh-3.6*gq,'密\n集\n近\n低  

'),colorffbb00,SHIFT2;  

DRAWTEXT(zu=ba5anda=a3,zh-4.6*gq,'密\n集\n低'),color00ff00,SHIFT2;  

EXPLAIN(1,'—–280天内堆积筹码  

—–'),COLORMAGENTA;{—————————————————————}  

EXPLAINEX(zu=ba1,'▲高位密集筹码:',ba1/FINANCE(7),2,0),color0000ff;  

EXPLAINEX(zu=ba2,'▲近高位密集筹码:',ba2/FINANCE(7),2,0),colorff00ff;  

EXPLAINEX(zu=ba3,'▲中位密集筹码:',ba3/FINANCE(7),2,0),color00ffff;  

EXPLAINEX(zu=ba4,'▲近低位密集筹码:',ba4/FINANCE(7),2,0),colorffbb00;  

EXPLAINEX(zu=ba5,'▲低位密集筹码:',ba5/FINANCE(7),2,0),color00ff00;  

sc1:=IF(zu=ba1,1,0);  

sc2:=IF(zu=ba2,1,0);  

sc3:=IF(zu=ba3,1,0);  

sc4:=IF(zu=ba4,1,0);  

sc5:=IF(zu=ba5,1,0);  

EXPLAINEX(sc1=0,'高位区堆积筹码%:',ba1/FINANCE(7),2,0);  

EXPLAINEX(sc2=0,'近高位堆积筹码%:',ba2/FINANCE(7),2,0);  

EXPLAINEX(sc3=0,'中位区堆积筹码%:',ba3/FINANCE(7),2,0);  

EXPLAINEX(sc4=0,'近低位堆积筹码%:',ba4/FINANCE(7),2,0);  

EXPLAINEX(sc5=0,'低位区堆积筹码%:',ba5/FINANCE(7),2,0);  

{}  

时段:=a3-a1;  

zb:=sum(v,时段)/FINANCE(7);  

yb:=refx(sum(v,b-a1)/FINANCE(7),b-a1+1);  

EXPLAIN(1,'——–左右量统计——–'),color00ffff;  

EXPLAINEX(1,'统计K棒天数:',时段*2,0,0),colorffffff;  

EXPLAINEX(1,'左边量:',zb,2,0),color00ff00;  

EXPLAINEX(1,'右边量:',yb,2,0),color00ffff;  

EXPLAINEX(1,'左右量比:',zb/yb,2,0),colorffff00;  

image.png

通达信最新版筹码分布指标

A:=(3*C+L+O+H)/6;

X:=(20*A+19*REF(A,1)+18*REF(A,2)+17*REF(A,3)+16*REF(A,4)+15*REF(A,5)+

14*REF(A,6)+13*REF(A,7)+12*REF(A,8)+11*REF(A,9)+10*REF(A,10)+9*REF(A,11)+8*REF(A,12)

+7*REF(A,13)+6*REF(A,14)+5*REF(A,15)+4*REF(A,16)+3*REF(A,17)+2*REF(A,18)+

REF(A,20))/210;

RCC:=DYNAINFO(3);

S2:=SMA(C,3,1);

S6:=SMA(C,5,1);

DK:=2*(S2-S6);

STICKLINE(DK>0,RCC,RCC+DK,0,1),COLORRED;

STICKLINE(DK<0,RCC,RCC+DK,0,1),COLORCYAN;

主力成本:EMA(X,13),COLORFF00FF,LINETHICK0;

短期底部:LLV(HIGH,30),LINETHICK2,COLORFFCC00;

IF(MA(C,3),MA(C,3),DRAWNULL),COLORYELLOW,LINETHICK2;

IF(MA(C,9),MA(C,9),DRAWNULL),COLORMAGENTA,LINETHICK2;

IF(MA(C,23.5),MA(C,23.5),DRAWNULL),COLORWHITE;

DRAWKLINE(HIGH,OPEN,LOW,CLOSE);

MA5:=MA(C,5);

MA10:=MA(C,10);

MA30:=MA(C,30);

FA:=BARSLAST(CROSS(MA10,MA5)) AND CROSS(MA5,MA10);

FB:=FA AND MA5>MA30 AND MA10>MA30 AND MA10>REF(MA10,1);

DRAWTEXT(FB,L-0.58,'★红牛'),COLORRED;

V1:=EMA(CLOSE,5);

V2:=EMA(EMA(CLOSE,90)*1.01,10);

DRAWTEXT(CROSS(V1,V2),V1+0.05,'牛起步'),COLOR00FF00;

VAR1:=LLV(LOW,21);

VAR2:=HHV(HIGH,21);

AK1:=EMA((((CLOSE – VAR1) / (VAR2 – VAR1)) * 100),5);

AK:=EMA((((CLOSE – VAR1) / (VAR2 – VAR1)) * 50),13);

AB:=CROSS(AK1,AK);

DRAWTEXT((AB = 1),(LOW * 0.99),'○牛窝'),COLORYELLOW;

AA1:=AMOUNT/V;

BB1:=L<AA1*0.9;

CC1:=(C-REF(C,1))/REF(C,1)*100>1.2;

DD1:=L<MA(C,5)*0.921;

EE1:=V<MA(V,5)*1.5;

老鼠仓:=BB1 AND CC1 AND DD1 AND EE1,LINETHICK0,COLOR0099FF;

DRAWTEXT(老鼠仓,L*0.99,'老鼠仓'),COLOR0099FF;

VAR3AA:=IF((CLOSE>REF(CLOSE,1)),88,0);

VAR4AA:=IF(((CLOSE)/(REF(CLOSE,1))>1.05) AND ((HIGH)/(CLOSE)<1.01) AND (VAR3AA>0),91,0);

DRAWTEXT(FILTER((VAR4AA>90),45),(LOW)*(0.93),'★大胆搏 '),COLOR00FFFF;

DRAWTEXT(FILTER((VAR4AA>90),35),(LOW)*(0.99000001),'★加仓'),COLOR00FFFF;

A1AA:=9;

A2AA:=(REF(CLOSE,A1AA+1)<CLOSE);

DRAWTEXT(FILTER((A2AA>-0.5),84),(HIGH)*(1.05),'小心变盘'),COLORFFFFFF;

VAR6:=REF(C,1);

VAR7:=SMA(MAX(C-VAR6,0),6,1)/SMA(ABS(C-VAR6),6,1)*100;

DRAWTEXT(CROSS(82,VAR7),H*1.01,'▼逃顶'),COLORYELLOW;

image.png

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。