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

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

授权方式: 免费版

指标评级: ★★★★★

指标分类: 策略

画线方法: 副图

一、主力成交量买卖指标公式

  

主力成交量:=vol/((HIGH-LOW)*2-ABS(CLOSE-OPEN));  

成交量:主力成交量,VOLSTICK;  

主力指标公式:=IF(CLOSE>OPEN,主力成交量*(HIGH-LOW),IF(CLOSE<OPEN,主力成交量*((HIGH-OPEN)+(CLOSE-LOW)),VOL/2));  

ffdd1:=(IF(CLOSE>OPEN,0-主力成交量*((HIGH-CLOSE)+(OPEN-LOW)),IF(CLOSE<OPEN,0-主力成交量*(HIGH-LOW),0-VOL/2)))*-1;  

ffdd2:=(主力指标公式+ffdd1),VOLSTICK;  

ffdd3:=主力指标公式-ffdd1>0;  

ffdd4:=主力成交量-ffdd2>0;  

STICKLINE(主力指标公式,0,VOL,0.8,0),COLORRED;  

STICKLINE(ffdd3,0,VOL,0.8,0),COLORYELLOW;  

STICKLINE(ffdd4,0,VOL,0.8,0),COLORMAGENTA;  

ffdd5:0,COLORYELLOW;ffdd6:0,COLORRED;短主力指标公式:0,COLORMAGENTA;  

公布正版通达信主动买卖成交量公式  

万手:VOL/10000,LINETHICK0;  

AA:=IF(CURRBARSCOUNT=1ANDPERIOD=5,VOL*240/FROMOPEN,DRAWNULL);  

预测:AA/10000;  

主动买量:=ACTINVOL;  

主买量:主动买量/10000,COLORRED,NODRAW;  

主动卖量:=-ACTOUTVOL;  

主卖量:主动卖量/10000,COLORLIBLUE,NODRAW;  

主买净量:主买量+主卖量,COLORMAGENTA,NODRAW;  

主买比:主买量/(主买量-主卖量)*100,COLORYELLOW,NODRAW;  

主动量比:(主买量-主卖量)/万手*100,COLORLIBLUE,NODRAW;  

净买量比:主买净量/万手*100,COLORLIBLUE,NODRAW;  

净买量:=ACTINVOL-ACTOUTVOL;  

持币:IF(SAR(10,2,20)>=H,SAR(10,2,20),DRAWNULL),CIRCLEDOT,COLORBLUE;  

持股:IF(SAR(10,2,20)<=L,SAR(10,2,20),DRAWNULL),CIRCLEDOT,COLORRED;  

上涨家:INDEXADV,COLOR0080FF,NODRAW;  

下跌家:INDEXDEC,COLORGREEN,NODRAW;  

STICKLINE(CLOSE=REF(CLOSE,1),0,VOL,3.5,1),COLORWHITE;  

STICKLINE(CLOSE>REF(CLOSE,1),0,VOL,3.5,1),COLORRED;  

STICKLINE(CLOSE<REF(CLOSE,1),0,VOL,3.5,1),COLORGREEN;  

STICKLINE(CURRBARSCOUNT=1ANDPERIOD=5,AA,1,3.5,0),COLOR00FFFF;  

STICKLINE(CURRBARSCOUNT=1ANDPERIOD=5,AA,1,3.2,0),COLOR007777;  

STICKLINE(CURRBARSCOUNT=1ANDPERIOD=5,AA,1,2.7,0),COLOR009999;  

STICKLINE(CURRBARSCOUNT=1ANDPERIOD=5,AA,1,2.1,0),COLOR00BBBB;  

STICKLINE(CURRBARSCOUNT=1ANDPERIOD=5,AA,1,1.5,0),COLOR00DDEE;  

STICKLINE(CURRBARSCOUNT=1ANDPERIOD=5,AA,1,0.9,0),COLOR66FFFF;  

STICKLINE(CURRBARSCOUNT=1ANDPERIOD=5,AA,1,0.2,0),COLORFFFFFF;  

STICKLINE(主动卖量<=0,0,-主动卖量,3.2,0),COLOR990000;  

STICKLINE(主动卖量<=0,0,-主动卖量,2.7,0),COLORCC0000;  

STICKLINE(主动卖量<=0,0,-主动卖量,2.1,0),COLORFF4400;  

STICKLINE(主动卖量<=0,0,-主动卖量,1.5,0),COLORFF8800;  

STICKLINE(主动卖量<=0,0,-主动卖量,0.9,0),COLORFFCC00;  

STICKLINE(主动卖量<=0,0,-主动卖量,0.2,0),COLORCYAN;  

STICKLINE(主动买量>=0,-主动卖量,主动买量-主动卖量,3.2,0),COLOR000033;  

STICKLINE(主动买量>=0,-主动卖量,主动买量-主动卖量,2.7,0),COLOR000066;  

STICKLINE(主动买量>=0,-主动卖量,主动买量-主动卖量,2.1,0),COLOR000099;  

STICKLINE(主动买量>=0,-主动卖量,主动买量-主动卖量,1.5,0),COLOR0000CC;  

STICKLINE(主动买量>=0,-主动卖量,主动买量-主动卖量,0.9,0),COLOR0000FF;  

STICKLINE(主动买量>=0,-主动卖量,主动买量-主动卖量,0.2,0),COLORCC66FF;  

STICKLINE(净买量<=0,0,净买量,3.2,0),COLOR003300;  

STICKLINE(净买量<=0,0,净买量,2.7,0),COLOR006600;  

STICKLINE(净买量<=0,0,净买量,2.1,0),COLOR009900;  

STICKLINE(净买量<=0,0,净买量,1.5,0),COLOR00CC00;  

STICKLINE(净买量<=0,0,净买量,0.9,0),COLOR00FF00;  

STICKLINE(净买量<=0,0,净买量,0.2,0),COLORGREEN;  

STICKLINE(净买量>=0,0,-净买量,3.2,0),COLOR000033;  

STICKLINE(净买量>=0,0,-净买量,2.7,0),COLOR000066;  

STICKLINE(净买量>=0,0,-净买量,2.1,0),COLOR000099;  

STICKLINE(净买量>=0,0,-净买量,1.5,0),COLOR0000CC;  

STICKLINE(净买量>=0,0,-净买量,0.9,0),COLOR0000FF;  

STICKLINE(净买量>=0,0,-净买量,0.2,0),COLORCC66FF;  

0;  

五日:MA(V,5),COLOR40FF00;  

三五日:MA(V,35),COLORYELLOW;  

一三五日:MA(V,135),COLOR0080FF;  

NOTEXT强:IF(五日>MA(五日,2),五日,DRAWNULL),COLORRED;  

换手率:MA(VOL/CAPITAL*100,5),COLORFFFFFF,NODRAW;  

虚拟成交量:IF(CURRBARSCOUNT=1ANDPERIOD=5,VOL*210/FROMOPEN,DRAWNULL),NODRAW;  

STICKLINE(CURRBARSCOUNT=1ANDPERIOD=5,虚拟成交量,0,2,-1),COLOR00C0C0;  

总量:VOL,NODRAW;  

TJ1:=H=LANDC>REF(C,1)ORC>REF(C,5)ORC>REF(C,9)ORC>REF(C,17);  

TJ2:=H=LANDC<REF(C,1)ORC<REF(C,5)ORC<REF(C,9)ORC<REF(C,17);  

EE:=IF(TJ1,0.0001,IF(TJ2,-0.0001,0)){对付一字涨停,并求极限};  

JGL_DTC:=(C-OPEN+EE)/(2*(H-L)+ABS(C-O)+3*0.0001);  

主买:VOL*(1+JGL_DTC)/2,COLORRED,NODRAW{主动买};  

主卖:VOL*(1-JGL_DTC)/2,COLORFFFF80,NODRAW{主动卖};  

MAVOL1:MA(V,5)COLORWHITE;  

MAVOL2:MA(V,55)COLORYELLOW;  

MAVOL3:MA(V,135)COLORGREEN;  

DG1:=(CROSS(MAVOL1,MAVOL2));DG2:=(CROSS(MAVOL1,MAVOL3));  

DRAWICON(DG1,VOL*1.05,1);  

DRAWICON(DG2,VOL*1.1,13);  

STICKLINE(C>=REF(C,1)ANDMAVOL1<MAVOL3ANDV<MAVOL1,VOL,0,7,0),COLOR333333;  

STICKLINE(C<REF(C,1)ANDMAVOL1<MAVOL3ANDV<MAVOL1,VOL,0,7,0),COLOR333333;  

STICKLINE(IF(BARSCOUNT(C)=1,C<O,C<REF(C,1)),0,VOL,2,0),COLOR880000;  

STICKLINE(IF(BARSCOUNT(C)=1,C<O,C<REF(C,1)),0,VOL,1,0),COLORBB0000;  

STICKLINE(IF(BARSCOUNT(C)=1,C<O,C<REF(C,1)),0,VOL,0.5,0),COLORDD0000;  

STICKLINE(IF(BARSCOUNT(C)=1,C<O,C<REF(C,1)),0,VOL,0.25,0)COLORFF0000;  

STICKLINE(IF(BARSCOUNT(C)=1,C>=O,C>=REF(C,1)),0,VOL,2,0),COLOR008800;  

STICKLINE(IF(BARSCOUNT(C)=1,C>=O,C>=REF(C,1)),0,VOL,1,0),COLOR00AA00;  

STICKLINE(IF(BARSCOUNT(C)=1,C>=O,C>=REF(C,1)),0,VOL,0.5,0),COLOR00DD00;  

STICKLINE(IF(BARSCOUNT(C)=1,C>=O,C>=REF(C,1)),0,VOL,0.25,0),COLOR00FF00;  

STICKLINE(主买>0,0,主买,2,0),COLOR000088;  

STICKLINE(主买>0,0,主买,1,0),COLOR0000AA;  

STICKLINE(主买>0,0,主买,0.5,0),COLOR0000DD;  

STICKLINE(主买>0,0,主买,0.25,0),COLOR0000FF;  

IF(VOL/MA(VOL,60)*100>100,VOL,VOL/0),STICK,COLORWHITE;  

量增价平转阳:=VOL>REF(V,1)ANDABS(C-REF(C,1))/REF(C,1)<=0.005;  

量增价升买入:=VOL>REF(V,1)ANDC>REF(C,1);  

量平价升续买:=ABS(VOL-REF(VOL,1))/REF(VOL,1)<=0.05ANDC>REF(C,1);  

量减价升持有:=VOL<REF(V,1)ANDC>REF(C,1);  

量减价平警戒:=VOL<REF(V,1)ANDABS(C-REF(C,1))/REF(C,1)<=0.005;  

量减价跌卖出:=VOL<REF(V,1)ANDC<REF(C,1);  

量平价跌续卖:=ABS(VOL-REF(VOL,1))/REF(VOL,1)<=0.05ANDC<REF(C,1);  

量增价跌弃卖:=VOL>REF(V,1)ANDC<REF(C,1);  

量梯级递增上:=VOL>REF(V,1)ANDREF(V,1)>REF(VOL,2);  

量梯级递减下:=VOL<REF(V,1)ANDREF(V,1)<REF(VOL,2);  

ZGD:=HHV(V,80)*1;  

ZGD2:=CONST(ZGD);  

情况1:=CONST(IF(量增价平转阳,1,0));  

情况2:=CONST(IF(量增价升买入,1,0));  

情况3:=CONST(IF(量平价升续买,1,0));  

情况4:=CONST(IF(量减价升持有,1,0));  

情况5:=CONST(IF(量减价平警戒,1,0));  

情况6:=CONST(IF(量减价跌卖出,1,0));  

情况7:=CONST(IF(量平价跌续卖,1,0));  

情况8:=CONST(IF(量增价跌弃卖,1,0));  

情况9:=CONST(IF(量梯级递增上,1,0));  

情况10:=CONST(IF(量梯级递减下,1,0));  

DRAWTEXT(情况1=1ANDCURRBARSCOUNT=60,ZGD2-(ZGD2*0.1),'量增价平'),COLORMAGENTA;  

DRAWTEXT(情况2=1ANDCURRBARSCOUNT=60,ZGD2-(ZGD2*0.4),'量增价升'),COLORMAGENTA;  

DRAWTEXT(情况3=1ANDCURRBARSCOUNT=60,ZGD2-(ZGD2*0.2),'量平价升'),COLORMAGENTA;  

DRAWTEXT(情况4=1ANDCURRBARSCOUNT=70,ZGD2-(ZGD2*0.3),'量减价升'),COLORMAGENTA;  

DRAWTEXT(情况5=1ANDCURRBARSCOUNT=70,ZGD2-(ZGD2*0.1),'量减价平'),COLORMAGENTA;  

DRAWTEXT(情况6=1ANDCURRBARSCOUNT=70,ZGD2-(ZGD2*0.3),'量减价跌'),COLORMAGENTA;  

DRAWTEXT(情况7=1ANDCURRBARSCOUNT=60,ZGD2-(ZGD2*0.2),'量平价跌'),COLORMAGENTA;  

DRAWTEXT(情况8=1ANDCURRBARSCOUNT=60,ZGD2-(ZGD2*0.4),'量增价跌'),COLORMAGENTA;  

DRAWTEXT(情况9=1ANDCURRBARSCOUNT=60,ZGD2-(ZGD2*0.5),'量梯递增'),COLORMAGENTA;  

DRAWTEXT(情况10=1ANDCURRBARSCOUNT=70,ZGD2-(ZGD2*0.5),'量梯递减'),COLORMAGENTA;

量:V,VOLSTICK;  

PJJ:=DMA((((HIGH+LOW)+(CLOSE*2))/4),0.9);  

JJ:=REF(EMA(PJJ,3),1);  

QJJ:=(VOL/(((HIGH-LOW)*2)-ABS((CLOSE-OPEN))));XVL:=(IF((CLOSE>OPEN),(QJJ*(HIGH-LOW)),IF((CLOSE<OPEN),(QJJ*((HIGH-OPEN)+(CLOSE-LOW))),(VOL/2)))+IF((CLOSE>OPEN)  

,(0-(QJJ*((HIGH-CLOSE)+(OPEN-LOW)))),IF((CLOSE<OPEN),(0-(QJJ*(HIGH-LOW))),(0-(VOL/2)))));  

ZLL:=(VOL/CAPITAL);  

HSL1:=IF((ZLL>10),10,ZLL);  

HSL:=((XVL/20)/1.15);  

进攻流量:=(((HSL*0.55)+(REF(HSL,1)*0.33))+(REF(HSL,2)*0.22));  

GJJ:=EMA(进攻流量,8);LLJX:=EMA(进攻流量,3);  

动态天量:=CONST(IF(V=HHV(V,20),V,REF(V,BARSLAST(V=HHV(V,20))))),COLOR00FF00,POINTDOT;  

STICKLINE(((HSL*0.4)>=0),动态天量+((HSL*0.4)+LLJX)*20,动态天量,3,0),COLORYELLOW;  

STICKLINE(((HSL*0.4)<0),动态天量+((HSL*0.4)+LLJX)*20,动态天量,3,0),COLOR00FF00;  

资金流入:=IF((HSL*0.4+LLJX)>0,(HSL*0.4+LLJX),DRAWNULL),COLORRED;  

资金流出:=IF((HSL*0.4+LLJX)<0,(HSL*0.4+LLJX),DRAWNULL),COLOR00FF00;  

资金收支:=(HSL*0.4+LLJX),LINETHICK0;  

万元:=AMOUNT/10000{0000},VOLSTICK,COLORFF00FF;  

资金净收支:IF((HSL*0.4+LLJX)>0,资金流入,资金流出),COLORWHITE,POINTDOT;  

收支比例%:IF((HSL*0.4+LLJX)>0,资金流入/万元*100,资金流出/万元*100),COLORYELLOW;  

连红天1:=BARSLASTCOUNT(资金净收支>0),,COLORA20FFD,NODRAW;  

连红天2:=IF(连红天1=0,REF(连红天1,1),连红天1),,COLORA20FFD,NODRAW;  

连红天3:=IF(连红天2=0,REF(连红天1,2),连红天2),,COLORA20FFD,NODRAW;  

连红天4:=IF(连红天3=0,REF(连红天1,3),连红天3),,COLORA20FFD,NODRAW;  

近期连红天:IF(连红天4=0,REF(连红天1,4),连红天4),,COLORYELLOW,NODRAW;  

三日资金:SUM(资金收支,3),COLORWHITE,NODRAW;  

五日资金:SUM(资金收支,5),COLORFF00FF,NODRAW;  

十日资金:SUM(资金收支,10),COLOR0000FF,NODRAW;  

资金流量:=LLJX,LINETHICK0,COLOR0000FF;  

STICKLINE((资金流量>0),动态天量+资金流量*20,动态天量,3,0),COLOR0000FF;  

STICKLINE((资金流量<0),动态天量+资金流量*20,动态天量,3,0),COLOR008000;

image.png

二、成交量看主力指标公式

  

VAR1:=(vol/(((HIGH-LOW)*2)-Abs((CLOSE-OPEN))));  

买盘:=IF((CLOSE>OPEN),(VAR1*(HIGH-LOW)),IF((CLOSE<OPEN),(VAR1*((HIGH-OPEN)+(CLOSE-LOW))),(VOL/2)));  

卖盘:=IF((CLOSE>OPEN),(0-(VAR1*((HIGH-CLOSE)+(OPEN-LOW)))),IF((CLOSE<OPEN),(0-(VAR1*(HIGH-LOW))),(0-(VOL/2))));  

买卖差:=(买盘+卖盘);  

stICKLINE((买卖差<0),0,买卖差,5,0),COLOR33FF33;  

JX1:=BARSSINCE(买盘);  

JY1:=IF(((121>JX1)AND(JX1>0)),JX1,120);  

JY2:=IF(((4>JX1)AND(JX1>0)),JX1,3);  

VAR30:=ma(VOL,JY2);  

神比:=(买盘/VAR30);  

鬼比:=(卖盘/VAR30);  

VAR2:=(HIGH-LOW);  

VAR3:=ABS((OPEN-CLOSE));  

VAR4:=(HIGH-IF((CLOSE>OPEN),CLOSE,OPEN));  

VAR5:=(IF((CLOSE>OPEN),OPEN,CLOSE)-LOW);  

VAR6:=((VAR3/VAR2)*VOL);  

VAR7:=((VAR4/VAR2)*VOL);  

VAR8:=((VAR5/VAR2)*VOL);  

VAR9:=IF(((VOL/CAPITAL)>0.001),1,EXP(ABS(LOG(((VOL/CAPITAL)*100)))));  

VARA:=(((CLOSE-MA(CLOSE,5))/MA(CLOSE,5))*100);  

VARB:=(((MA(CLOSE,5)>MA(CLOSE,10))AND(MA(CLOSE,10)>MA(CLOSE,30)))AND(MA(CLOSE,30)>MA(CLOSE,60)));VARC:=((MA(CLOSE,5)<MA(CLOSE,10))AND(MA(CLOSE,10)<MA(CLOSE,30)));  

VARD:=REF(CLOSE,1);  

VARE:=((SMA(MAX((CLOSE-VARD),0),6,1)/SMA(ABS((CLOSE-VARD)),6,1))*100);  

DRAWTEXT(((DATE>700101)ANDcrOSS(84,VARE)),HIGH,'■卖出'),COLORF2A3A4;  

VAR40:=((IF((((VAR6>=VAR7)AND(VAR6>=VAR8))AND(CLOSE>OPEN)),VAR6,买盘)+买盘)/2);  

VAR41:=((IF(((VAR7>VAR6)AND(VAR7>VAR8)),VAR7,买盘)+买盘)/2);  

VAR42:=((IF(((VAR8>VAR6)AND(VAR8>VAR7)),VAR8,买盘)+买盘)/2);  

VAR50:=((IF((((VAR6>=VAR7)AND(VAR6>=VAR8))AND(CLOSE<OPEN)),VAR6,卖盘)+卖盘)/2);  

三日上攻:=MA((((VAR40+VAR41)+VAR42)/3),JY2);  

三日下攻:=MA(VAR50,JY2);  

多头:STICKLINE((CLOSE>MA(CLOSE,30)),0,VOL,5,1),COLOR0000FF;  

空头:STICKLINE((CLOSE<MA(CLOSE,30)),0,VOL,5,1),COLOR00FF00;  

STICKLINE((((VAR6>=VAR7)AND(VAR6>=VAR8))AND(CLOSE>OPEN)),0,VAR6,4,0),COLOR00FFFF;  

STICKLINE((((VAR6>=VAR7)AND(VAR6>=VAR8))AND(CLOSE<OPEN)),0,VAR6,4,0),COLORFF0000;  

STICKLINE(((VAR8>VAR6)AND(VAR8>VAR7)),0,VAR8,4,0),COLORFFFFFF;  

STICKLINE(((VAR7>VAR6)AND(VAR7>VAR8)),0,VAR7,4,0),COLORFF00FF;  

STICKLINE((VOL>(MA(VOL,5)*2.5)),0,VOL,2,0);  

STICKLINE((买盘>0),买盘,0,2,0),COLOR0000FF;  

上攻均量:=MA(买盘,JY1);  

下攻均量:=MA(卖盘,JY1);  

DRAWTEXT(((((((((VAR7>VAR6)AND(VARA>2))AND(VAR9>VAR8))AND(CLOSE>MA(CLOSE,5)))AND(CLOSE>MA(CLOSE,30)))AND(HIGH>MA(CLOSE,60)))AND(VOL>MA(VOL,5)))AND(VAR7>=MA(VOL,5))),VOL,'▼出货');  

DRAWTEXT(((((((VAR8>VAR6)AND(VAR8>VAR7))AND(VARA<(0-2)))AND(CLOSE<MA(CLOSE,30)))AND(VAR8<(MA(VOL,5)/2)))AND(MA(VOL,5)<MA(VOL,10))),VOL,'●低进');  

DRAWTEXT((((((VAR6>(MA(VOL,5)*2))AND(VAR6>=VAR7))AND(VAR6>=VAR8))AND(CLOSE>OPEN))OR((VOL>(MA(VOL,5)*3))ANDVARB)),VOL,'◆强势');  

HSL:=DYNAINFO(37);  

DRAWTEXT_FIX(1,0.0,0.0,0,'白色烛,红芯长,庄家找底在振荡,俺也伺机建点仓'),COLORFFFFFF,LINETHICK1;  

DRAWTEXT_FIX(1,0.00,0.06,0,'黄色烛,红芯长;庄家进货强,俺也进货等起航'),COLORFFFFFF,LINETHICK1;  

DRAWTEXT_FIX(1,0.00,0.12,0,'粉色烛,红芯长,庄家高抛低吸操作忙,俺也去逐浪'),COLORFFFFFF,LINETHICK1;  

DRAWTEXT_FIX(1,0.00,0.18,0,'蓝色烛,红芯短,巨量绿尾长,庄家撤退,俺也清仓'),COLORFFFFFF,LINETHICK1;  

DRAWTEXT_FIX(1,0.00,0.24,0,'巨量绿,蓝烛长,趋势破,急离场;等着跌,莫手痒'),COLORFFFFFF,LINETHICK1;  

VOLUME:VOL,VOLSTICK;  

主力启动线:MA(VOLUME,5),COLORRED,LINETHICK2;  

主力洗盘线:MA(VOLUME,35),COLORYELLOW,LINETHICK2;  

资金异动线:MA(VOLUME,135),COLORBLUE,LINETHICK2;  

出击:STICKLINE(CROSS(主力启动线,资金异动线)OR((主力洗盘线>资金异动线)ANDCROSS(主力启动线,主力洗盘线)),0,VOL,2,0),COLORYELLOW;  

启动:STICKLINE(主力启动线>REF(主力启动线,1)AND(CROSS(VOL,主力启动线)AND(REF(VOL,1)<REF(资金异动线,1)ORREF(VOL,2)<REF(资金异动线,2))),0,VOL,3,0),COLORGREEN;  

V1:=CLOSE/REF(CLOSE,3)>=1.1;  

V2:=BACKSET(V1,2);  

V3:=REF(CLOSE,3)*1.1;  

V4:=CROSS(C,V3);  

OK:STICKLINE((V2ANDCOUNT(V2,2)=1),VOL,0,5,0),COLORRED;  

COND:(CROSS(主力启动线,资金异动线)OR((主力洗盘线>资金异动线)ANDCROSS(主力启动线,主力洗盘线)))  

OR(主力启动线>REF(主力启动线,1)AND(CROSS(VOL,主力启动线)AND(REF(VOL,1)<REF(资金异动线,1)ORREF(VOL,2)<REF(资金异动线,2))))  

OR(V2ANDCOUNT(V2,2)=1),LINETHICK0;  

A:=MA(-100*(HHV(HIGH,34)-CLOSE)/(HHV(HIGH,34)-LLV(LOW,34)),19);  

B:=-100*(HHV(HIGH,14)-CLOSE)/(HHV(HIGH,14)-LLV(LOW,14));  

D:=EMA(-100*(HHV(HIGH,34)-CLOSE)/(HHV(HIGH,34)-LLV(LOW,34)),4);  

长期线:=A+100;  

短期线:=B+100;  

中期线:=D+100;  

见顶:=((REF(中期线,1)>85ANDREF(短期线,1)>85ANDREF(长期线,1)>65)ANDCROSS(长期线,短期线));  

顶部区域:=(中期线<REF(中期线,1)ANDREF(中期线,1)>80)AND(REF(短期线,1)>95ORREF(短期线,2)>95)AND长期线>60AND短期线<83.5  

AND短期线<中期线AND短期线<长期线+4;  

顶部:=FILTER(顶部区域,4);  

STICKLINE({见顶OR}顶部,VOL,VOL*1.1,20,1),COLORBLUE,LINETHICK2;  

VAR6:=REF(CLOSE,1);  

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

STICKLINE(CROSS(84,VAR7),VOL,VOL*1.05,20,1),COLOR0099FF,LINETHICK2;  

均势一:=(((((((((CLOSE+REF(CLOSE,1))+REF(CLOSE,2))+REF(CLOSE,3))+REF(CLOSE,4))+REF(CLOSE,5))+REF(CLOSE,6))+REF(CLOSE,7))+REF(CLOSE,8))/9);  

均势二:=((((CLOSE+REF(CLOSE,1))+REF(CLOSE,2))+REF(CLOSE,3))/4);  

趋势一:=((((均势一-REF(均势一,1))/REF(均势一,1))*1000)+50);  

趋势二:=((((均势二-REF(均势二,1))/REF(均势二,1))*1000)+50);  

波段高位:=(CROSS(趋势一,趋势二)AND(COUNT((CLOSE>REF(HIGH,1)),12)>5));  

STICKLINE(波段高位,VOL,VOL*1.08,20,1),COLORGREEN,LINETHICK2;  

量:=VOL/((HIGH-LOW)*2-ABS(CLOSE-OPEN));  

VOLUME:量,VOLSTICK;  

买量:=IF(CLOSE>OPEN,量*(HIGH-LOW),IF(CLOSE<OPEN,量*((HIGH-OPEN)+(CLOSE-LOW)),VOL/2));  

卖量:=(IF(CLOSE>OPEN,0-量*((HIGH-CLOSE)+(OPEN-LOW)),IF(CLOSE<OPEN,0-量*(HIGH-LOW),0-VOL/2)))*-1;  

总量:=(买量+卖量),VOLSTICK;  

净量:=买量-卖量>0;  

短量:=量-总量>0;  

STICKLINE(买量,0,VOL,0.8,0),COLORRED;  

STICKLINE(净量,0,VOL,0.8,0),COLORYELLOW;  

STICKLINE(短量,0,VOL,0.8,0),COLORMAGENTA;  

拉升净买入黄色:0,COLORYELLOW;吸筹冲顶红色:0,COLORRED;短买量:0,COLORMAGENTA;

image.png

[源码注释]通达信公式动态翻译结果

输出牛熊线:以成交量(手)为权重收盘价+5日前的收盘价/收盘价*0.098的90日简单移动平均的动态移动平均,线宽为1,CIRCLEDOT,画黄色

小牛赋值:收盘价上穿牛熊线

当满足条件小牛时,在最低价位置书写文字,画红色,线宽为4

当满足条件是否最后一个周期时,在牛熊线位置书写文字,画黄色

MID赋值:(3*收盘价+最低价+开盘价+最高价)/6

输出操盘线:(20*MID+19*1日前的MID+18*2日前的MID+17*3日前的MID+16*4日前的MID+15*5日前的MID+14*6日前的MID+13*7日前的MID+12*8日前的MID+11*9日前的MID+10*10日前的MID+9*11日前的MID+8*12日前的MID+7*13日前的MID+6*14日前的MID+5*15日前的MID+4*16日前的MID+3*17日前的MID+2*18日前的MID+20日前的MID)/210,NODRAW

输出安全线:操盘线的11日简单移动平均,画深灰色,LINESTICK,线宽为1

输出MA20:收盘价的20日简单移动平均,NODRAW

输出趋势线:收盘价的6日简单移动平均 画绿色, 线宽为2

当满足条件趋势线>=MA20时,在收盘价和开盘价位置之间画柱状线,宽度为3,0不为0则画空心柱.,COLOR0000FF

当满足条件趋势线>=MA20时,在收盘价和开盘价位置之间画柱状线,宽度为0.5,0不为0则画空心柱.,COLORCC66FF

当满足条件MA20>趋势线时,在收盘价和开盘价位置之间画柱状线,宽度为3,0不为0则画空心柱.,COLORFF9900

当满足条件MA20>趋势线时,在收盘价和开盘价位置之间画柱状线,宽度为0.5,0不为0则画空心柱.,COLORFFCC00

大牛赋值:趋势线上穿MA20

死牛赋值:MA20上穿趋势线

当满足条件大牛时,在最低价位置书写文字,画黄色,线宽为4

当满足条件死牛时,在最高价位置书写文字,画白色 ,线宽为4

当满足条件趋势线上穿MA20时,在开盘价和收盘价位置之间画柱状线,宽度为2,0不为0则画空心柱.,COLOR00FFFF 

当满足条件MA20上穿趋势线时,在开盘价和收盘价位置之间画柱状线,宽度为2,0不为0则画空心柱.,COLOR00DD00

VAR2赋值:开盘价>收盘价的安全线日简单移动平均 AND 收盘价<收盘价的安全线日简单移动平均

当满足条件安全线上穿收盘价时,在开盘价和收盘价位置之间画柱状线,宽度为2,0不为0则画空心柱.,COLORFF0000

输出AMA3:如果趋势线/安全线日前的趋势线>0.997,返回趋势线,否则返回无效数,画蓝色,线宽为3

输出AMA4:如果趋势线/安全线日前的趋势线>1.001,返回趋势线,否则返回无效数,画红色,线宽为3

WH1赋值:如果最低价=9日内最低价的最低值,返回最低价,否则返回0

WH2赋值:上次WH1不等于0距今天数的最后一日取值设为常数

WH3赋值:如果WH2=0,返回最高价,否则返回WH2日前的最高价的最后一日取值设为常数

WH4赋值:WH2+1日前的上次最高价>WH3距今天数+WH2+1的最后一日取值设为常数

WH5赋值:如果WH4=0,返回最高价,否则返回WH4日前的最高价的最后一日取值设为常数

WH6赋值:WH4+1日前的上次最高价>WH5距今天数+WH4+1的最后一日取值设为常数

输出WH7:如果到最后交易的周期<=WH2+10,返回如果WH6=0,返回最高价,否则返回WH6日前的最高价的最后一日取值设为常数,否则返回无效数,画黄色,DOTLINE

当满足条件是否最后一个周期时,在WH7位置书写文字,画黄色

DP赋值:如果收盘价=大盘的收盘价,返回0,否则返回1

GJ赋值:成交额(元)/成交量(手)/100

推荐阅读:主力卖出指标公式

  

V1:=(C*2+H+L)/4*10;  

V2:=EMA(V1,13)-EMA(V1,34);  

V3:=EMA(V2,5);V4:=2*(V2-V3)*5.5;  

主力撤:IF(V4<=0,V4,0),COLORBLUE;  

主力进:IF(V4>=0,V4,0),COLORFF00FF;  

V5:=(HHV(INDEXH,8)-INDEXC)/(HHV(INDEXH,8)-LLV(INDEXL,8))*8;  

V6:=EMA(3*V5-2*SMA(V5,18,1),5);  

V7:=(INDEXC-LLV(INDEXL,8))/(HHV(INDEXH,8)-LLV(INDEXL,8))*10;  

V8:=(INDEXC*2+INDEXH+INDEXL)/4;  

V9:=EMA(V8,13)-EMA(V8,34);  

VA:=EMA(V9,3);  

VB:=(V9-VA)/2;  

大盘资金进场:IF(VB>=0,VB,0),COLORRED;  

大盘资金撤走:IF(VB<=0,VB,0),COLORGREEN;  

V11:=3*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1)-2*SMA(SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1),3,1);  

趋势线:EMA(V11,3);  

V12:=(趋势线-REF(趋势线,1))/REF(趋势线,1)*100;  

准备现金:STICKLINE(趋势线<=13,0,20,5,0),COLORCC9900;  

AA:=(趋势线<=13)ANDFILTER((趋势线<=13),15);  

DRAWTEXT(AA,30,'准备现金'),COLORCC9900;  

买入股票:STICKLINE(趋势线<=13ANDV12>13,0,50,5,0),COLOR0099FF;  

BB:=(趋势线<=13ANDV12>13)ANDFILTER((趋势线<=13ANDV12>13),10);  

DRAWTEXT(BB,60,'买入股票'),COLOR0099FF;  

卖临界:STICKLINE(趋势线>90AND趋势线>REF(趋势线,1),100,95,15,1),COLORFFFF00;  

见顶清仓:FILTER(趋势线>90AND趋势线<REF(趋势线,1)AND主力进<REF(主力进,1),8);  

DRAWTEXT(见顶清仓,90,'逃顶'),COLORYELLOW;  

CC:=(趋势线>=90ANDV12)ANDFILTER((趋势线>=90ANDV12),10);  

STICKLINE(大盘资金进场AND趋势线<13,0,30,10,0),COLORRED;  

STICKLINE(大盘资金撤走AND趋势线>90,0,30,10,0),COLORGREEN;  

STICKLINE(主力进AND趋势线<13,0,40,10,0),COLORFF00FF;  

STICKLINE(主力撤AND趋势线>90,0,40,10,0),COLORBLUE;  

JE:=VOL;  

JJ:=(HIGH+LOW+CLOSE)/3;  

QJ0:=VOL/IF(HIGH=LOW,4,HIGH-LOW);  

主买:=(QJ0*(JJ-MIN(CLOSE,OPEN)));  

主卖:=(QJ0*(MIN(OPEN,CLOSE)-LOW));  

TMP:=主买-主卖;  

主力活跃度:(主买+主卖)*10000/(2*FINANCE(7)),NODRAW;  

STICKLINE(TMP>0,0,主力活跃度,2,0),COLORRED;  

STICKLINE(TMP<0,0,主力活跃度,2,0),COLORGREEN;  

AA:=VOL/((HIGH-LOW)*2-ABS(CLOSE-OPEN));  

买量:=IF(CLOSE>OPEN,AA*(HIGH-LOW),IF(CLOSE<OPEN,AA*((HIGH-OPEN)+(CLOSE-LOW)),VOL/2)),LINETHICK0;  

卖量:=IF(CLOSE>OPEN,0-AA*((HIGH-CLOSE)+(OPEN-LOW)),IF(CLOSE<OPEN,0-AA*(HIGH-LOW),0-VOL/2)),LINETHICK0,COLORCYAN;  

主力净流入亿元:MA(买量+卖量/2,3)*AMO/V/100000000,COLORYELLOW,LINETHICK1;  

AA:=vol/((HIGH-LOW)*2-Abs(CLOSE-OPEN));  

买量:=IF(CLOSE>OPEN,AA*(HIGH-LOW),IF(CLOSE<OPEN,AA*((HIGH-OPEN)+(CLOSE-LOW)),VOL/2)),LINETHICK0,COLORRED;  

卖量:=IF(CLOSE>OPEN,0-AA*((HIGH-CLOSE)+(OPEN-LOW)),IF(CLOSE<OPEN,0-AA*(HIGH-LOW),0-VOL/2)),LINETHICK0,COLORGREEN;  

进出量:=买量+卖量,COLOR00FFFF;stICKLINE(进出量<0,0,进出量,1,0),COLORFF6600;  

STICKLINE(进出量<0,0,进出量,3,0),COLORFF9900;  

STICKLINE(进出量<0,0,进出量,1.5,0),COLORFFCC00;  

STICKLINE(进出量<0,0,进出量,0.5,0),COLORCYAN;  

STICKLINE(进出量>0,0,进出量,3,0),COLOR000099;  

STICKLINE(进出量>0,0,进出量,3,0),COLOR0000CC;  

STICKLINE(进出量>0,0,进出量,1.0,0),COLOR0000FF;  

STICKLINE(进出量>0,0,进出量,0.5,0),COLORCC66FF;N:=1;QJ0:=(HIGH+LOW+CLOSE)/3;  

QJ1:=IF(HIGH=LOW,1,HIGH-maX(OPEN,CLOSE));  

QJ2:=IF(HIGH=LOW,1,MAX(CLOSE,OPEN)-QJ0);  

QJ3:=IF(HIGH=LOW,1,MIN(OPEN,CLOSE)-LOW);  

QJ4:=IF(HIGH=LOW,1,QJ0-MIN(CLOSE,OPEN));  

QJ5:=VOL/(IF(HIGH=LOW,4,HIGH-LOW));  

QJ6:="macd.DIF">"MacD.DEA"AND"MACD.DEA"<0;  

QJ7:="kdj.K">"kdJ.D"AND"KDJ.D"<30;  

QJ8:="MACD.DIF"<"MACD.DEA";  

QJ9:="KDJ.K"<"KDJ.D"AND"KDJ.K">80;  

特大:QJ4*QJ5,NODRAW;大单:QJ3*QJ5,NODRAW;  

中单:QJ1*QJ5,NODRAW;小单:QJ2*QJ5,NODRAW;  

W1:=SUM(大单,N)+SUM(特大,N);W2:=SUM(小单,N)+SUM(中单,N);  

量振1:=特大>大单AND大单>小单;  

量振2:=特大<小单AND大单<小单;  

标振1:=QJ6ANDQJ7;  

标振2:=QJ8ANDQJ9;  

A:=W1-W2;A0:=IF(A>0,A,0);B0:=IF(A<0,A,0);  

STICKLINE(A0,0,A0,1,0),COLOR000044;主力持仓:EMA(100*(CLOSE-LLV(LOW,34))/(HHV(HIGH,34)-LLV(LOW,34)),3),COLORFF00FF;主力筹码集中度:WINNER(C)*100,COLORRED;  

量比:SUM(V,BArslAST(TIME=930)+1)/(BARSLAST(TIME=930)+1)/DYNAINFO(16);  

VAR2:=REF(LOW,1);  

VAR3:=SMA(ABS(LOW-VAR2),13,1)/SMA(MAX(LOW-VAR2,0),13,1)*100;  

VAR4:=EMA(IF(CLOSE*1.2,VAR3*13,VAR3/13),13);  

VAR5:=LLV(LOW,34);  

VAR6:=HHV(VAR4,34);  

VAR7:=IF(LLV(LOW,56),1,0);  

VAR8:=EMA(IF(LOW<=VAR5,(VAR4+VAR6*2)/2,0),3)/618*VAR7;  

VAR9:=EMA(CLOSE,5);  

VAR10:=(CLOSE-MA(CLOSE,34))/MA(CLOSE,34)*(10);  

VAR11:=EMA(IF(LOW<=VAR5,(VAR4+VAR6*2)/2,0),3)/618*VAR7*(-1);  

VAR12:=EMA(CLOSE,5)*(-1);STICKLINE(VAR12<REF(VAR12,1),0,VAR12*-1.92,3,1),COLORRED;  

减仓:IF(VAR12<REF(VAR12,1),VAR12,0),COLOR10E410,LINETHICK0;  

STICKLINE(VAR9<REF(VAR9,1),0,VAR9*-1.92,3,1),COLORGREEN;  

增仓:IF(VAR9<REF(VAR9,1),VAR9*0.2,0),COLOR1010FF,LINETHICK0;  

STICKLINE(VAR8>REF(VAR8,1),0,VAR8,4,1),COLOR10FFFF,LINETHICK0;  

主力进场:IF(VAR8>REF(VAR8,1),VAR8*8,0),COLOR10FFFF,LINETHICK0;  

STICKLINE(VAR11>REF(VAR11,1),0,VAR11,4,1),COLORFFF810;  

洗盘:IF(VAR11>REF(VAR11,1),VAR11*8,0),COLORFFF810,LINETHICK0;  

主力持仓:LOW,COLORFF10FF,LINETHICK0;  

增减力度:VAR10*5,COLORWHITE;  

XL1:=MA(LOW,2)*0.96;  

XL2:=MA(LOW,26)*0.85;  

XL3:=REF(XL1,1)<XL2ANDREF(XL1,1)<XL1ANDREF(XL1,1)<REF(XL1,2);  

STICKLINE(XL3,0,VAR8*3,4,0),COLOR006EFF;  

DRAWTEXT(XL3,VAR8*2,'买'),COLOR006EFF;  

↑买:DRAWICON(XL3,VAR8*3,4),COLORRED;  

A:=IF((CLOSE>126.32),(AMOUNT/100000),VOL);  

主力:MA(A,4),NODRAW,COLOR00FFFF;  

游资:MA(A,8),NODRAW,COLOR00FF00;  

大户:MA(A,16),NODRAW,COLOR0000FF;  

散户:MA(A,32),NODRAW,COLORFFFF00;  

主动参与比例:=ROUND(((主力/(((主力+游资)+大户)+散户))*100)),NODRAW,COLOR00FFFF;  

游资参与比例:=ROUND(((游资/(((主力+游资)+大户)+散户))*100)),NODRAW,COLOR00FF00;  

大户参与比例:=ROUND(((大户/(((主力+游资)+大户)+散户))*100)),NODRAW,COLOR0000FF;  

散户参与比例:=ROUND(((散户/(((主力+游资)+大户)+散户))*100)),NODRAW,COLORFFFF00;  

STICKLINE((主力>0),0,主力,3,0),COLOR0000FF;  

STICKLINE((主力>0),0,主力,2.7.5,0),COLOR001BFF;  

STICKLINE((主力>0),0,主力,2.4,0),COLOR0035FF;  

STICKLINE((主力>0),0,主力,2.1,0),COLOR0050FF;  

STICKLINE((主力>0),0,主力,1.8,0),COLOR0062FF;  

STICKLINE((主力>0),0,主力,1.5,0),COLOR007AFF;  

STICKLINE((主力>0),0,主力,1.2,0),COLOR0089FF;  

STICKLINE((主力>0),0,主力,0.9,0),COLOR009CFF;  

STICKLINE((主力>0),0,主力,0.6,0),COLOR00C0FF;  

STICKLINE((主力>0),0,主力,0.3,0),COLOR00EAFF;  

STICKLINE((游资>0),0,游资,3,0),COLOR007F00;  

STICKLINE((游资>0),0,游资,2.7,3),COLOR008B00;  

STICKLINE((游资>0),0,游资,2.4,0),COLOR009500;  

STICKLINE((游资>0),0,游资,2.1,0),COLOR00A300;  

STICKLINE((游资>0),0,游资,1.8,0),COLOR00AF00;  

STICKLINE((游资>0),0,游资,1.5,0),COLOR00C000;  

STICKLINE((游资>0),0,游资,1.2,0),COLOR00CA00;  

STICKLINE((游资>0),0,游资,0.9,0),COLOR00DB00;  

STICKLINE((游资>0),0,游资,0.6,0),COLOR00FF00;  

STICKLINE((大户>0),0,大户,3,0),COLOR102088;  

STICKLINE((大户>0),0,大户,2.7,0),COLOR102099;  

STICKLINE((大户>0),0,大户,2.4,0),COLOR1020AA;  

STICKLINE((大户>0),0,大户,2.1,0),COLOR1020BB;  

STICKLINE((大户>0),0,大户,1.8,0),COLOR1020CC;  

STICKLINE((大户>0),0,大户,1.5,0),COLOR1020DD;  

STICKLINE((大户>0),0,大户,1.2,0),COLOR1020EE;  

STICKLINE((大户>0),0,大户,0.9,0),COLOR1020FF;  

STICKLINE((散户>0),0,散户,3,0),COLORFF7700;  

STICKLINE((散户>0),0,散户,2.7,0),COLORFF8800;  

STICKLINE((散户>0),0,散户,2.4,0),COLORFF9900;  

STICKLINE((散户>0),0,散户,2.1,0),COLORFFAA00;  

STICKLINE((散户>0),0,散户,1.8,0),COLORFFBB00;  

STICKLINE((散户>0),0,散户,1.5,0),COLORFFCC00;  

STICKLINE((散户>0),0,散户,1.2,0),COLORFFDD00;  

STICKLINE((散户>0),0,散户,0.9,0),COLORFFEE00;  

游资线:MA(A,180),COLORWHITE,DOTLINE,LINETHICK2;  

{选股公式:  

S1:=IF(CODELIKE('300'),0,1);  

S2:=IF(NAMELIKE('S'),0,1);  

S3:=IF(NAMELIKE('*'),0,1);  

S4:=DYNAINFO(17)>0;  

换手:=VOL/CAPITAL*100;  

放量:=EVERY(VOL>=REF(VOL,1),1);  

去掉:=S1ANDS2ANDS3ANDS4;  

CC:=(C-REF(C,1))/REF(C,1)>=(1/100);  

XG:VOL>REF(HHV(VOL,10),1)*2ANDCCAND去掉AND换手>=1.37AND放量;  

image.png

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