当前位置: 网站首页 > 股票软件公式 > 通达信公式 > 文章 当前位置: 通达信公式 > 文章

通达信源码精选:资金抄底,资金主图,量能副图

点击: 次    来源:顶尖财经    作者:股市狙击 - 小 + 大

1、资金抄底

LC := REF(CLOSE,1);
RSI1:=SMA(MAX(CLOSE-LC,0),3,1)/SMA(ABS(CLOSE-LC),3,1)*100;
RSI2:=SMA(MAX(CLOSE-LC,0),5,1)/SMA(ABS(CLOSE-LC),5,1)*100;
RSI3:=SMA(MAX(CLOSE-LC,0),8,1)/SMA(ABS(CLOSE-LC),8,1)*100;
相对强弱:=0.5*RSI1+0.31*RSI2+0.19*RSI3;
WAVE1:=SMA(100*(CLOSE-LLV(LOW,8))/(HHV(HIGH,8)-LLV(LOW,8)),3,1);
WAVE2:=SMA(100*(CLOSE-LLV(LOW,8))/(HHV(HIGH,8)-LLV(LOW,8)),5,1);
WAVE3:=SMA(100*(CLOSE-LLV(LOW,8))/(HHV(HIGH,8)-LLV(LOW,8)),8,1);
短线波段:=0.5*WAVE1+0.31*WAVE2+0.19*WAVE3;
机会区:20,POINTDOT,COLORRED;
风险区:80,POINTDOT,COLORGREEN;
风险系数:0.5*相对强弱+0.5*短线波段,COLORYELLOW;CD1:=IF(风险系数<20 AND CLOSE>OPEN AND DDX>0,1,0);
CD2:=IF(风险系数<20 AND LOW>=REF(LOW,1) AND CLOSE>LOW AND DDX>0,1,0);
CD3:=IF(REF(风险系数,1)<20 AND 风险系数>REF(风险系数,1),1,0);
LBUY:=(CD1=1 OR CD2=1 OR CD3=1);
X:=(LBUY AND COUNT(LBUY,3)=1);




2、资金主图


本公式是仿造同名的L2行情公式,需要L2行情支持
各数据的计算公式均出自于网络各个指标,我只是将他们由零碎的拼成了一个还能称得主图指标的指标。

{资金主图}
{需要LEVEL-2行情}
买线:=EMA(C,2);
卖线:=EMA(SLOPE(C,21)*20+C,60);
BU:=CROSS(买线,卖线);
SEL:=CROSS(卖线,买线);
DRAWICON(BU,L-0.1,1);
DRAWICON(SEL,H+0.1,2);
STICKLINE(买线>=卖线,LOW,HIGH,0.0,1),COLORRED;
STICKLINE(买线>=卖线,CLOSE,OPEN,2,1),COLORRED;
STICKLINE(买线<卖线,LOW,HIGH,0.0,1),COLORCYAN;
STICKLINE(买线<卖线,CLOSE,OPEN,2,1),COLORCYAN;
操盘线:MA(CLOSE,9),COLORYELLOW;
界点线:MA(CLOSE,20),COLORMAGENTA;
高:=REF(HHV(H,80),3);
低:=REF(LLV(L,80),3);
H19:=高-(高-低)*0.191;
H38:=高-(高-低)*0.382;
H中:=高-(高-低)*0.5;
H61:=高-(高-低)*0.618;
H80:=高-(高-低)*0.809;
顶点:REFDATE(高,DATE),POINTDOT,COLORWHITE;
疯牛:=REFDATE(H19,DATE),POINTDOT,COLORYELLOW;
突破:REFDATE(H38,DATE),POINTDOT,COLORMAGENTA;
平衡:REFDATE(H中,DATE),POINTDOT,COLORRED;
回落:REFDATE(H61,DATE),POINTDOT,COLORGREEN;
低点:=REFDATE(低,DATE),POINTDOT,COLORWHITE;
DRAWTEXT(ISLASTBAR,顶点,顶点),COLORWHITE;
DRAWTEXT(ISLASTBAR,低点,低点),COLORWHITE;
{主图资金模块}
超B:=L2_AMO(0,2)/1000.0;
大B:=L2_AMO(1,2)/10000.0;
中B:=L2_AMO(2,2)/10000.0;
小B:=L2_AMO(3,2)/10000.0;
超S:=L2_AMO(0,3)/10000.0;
大S:=L2_AMO(1,3)/10000.0;
中S:=L2_AMO(2,3)/10000.0;
小S:=L2_AMO(3,3)/10000.0;
TESTSKIP(NOT(超B OR 大B OR 中B OR 小B OR 超S OR 大S OR 中S OR 小S)!=0);
JGV:=(L2_VOL(0,0) - L2_VOL(0,1))*VOL/100000000,COLORRED;
DHV:=(L2_VOL(1,0) - L2_VOL(1,1))*VOL/100000000,COLORFF00FF;
ZHV:=(L2_VOL(2,0) - L2_VOL(2,1))*VOL/100000000,COLOR00FFFF;
SHV:=(L2_VOL(3,0) - L2_VOL(3,1))*VOL/100000000,COLORFFFFFF;
大量博弈:=(JGV+DHV),COLORYELLOW,NODRAW;
 
大宗净流入:=(超B+大B)-(超S+大S),COLORRED,NODRAW;
净流入:=(超B+大B+中B+小B)-(超S+大S+中S+小S);
大宗进:=(超B)+(大B);
大宗出:=(超S)+(大S);
非大宗进:=(中B)+(小B);
非大宗出:=(中S)+(小S);
成交总量:=(超B+大B+中B+小B+超S+大S+中S+小S),NODRAW;
 
{右上角横柱}
主买A:=ACTINVOL,COLORRED,NODRAW;
主卖A:=ACTOUTVOL,COLORGREEN,NODRAW;
主买:主买A*100/(主买A+主卖A),NODRAW,COLORRED;
主卖:主卖A*100/(主买A+主卖A),NODRAW,COLORGREEN;
 
大单流入:=(超B+大B)/(超B+大B+超S+大S)*100,NODRAW;
大单流入限制:=IF((超B+大B+超S+大S)=0,0,大单流入);
DRAWRECTREL(650,60,885,120,RGB(0,100,0));
DRAWRECTREL(650,60,885,120,RGB(0,150,150));
DRAWRECTREL(650,60,650+CONST(大单流入限制*235/100),120,RGB(200,0,50));
DRAWTEXT_FIX(1,0.565,0.06,0,STRCAT(STRCAT('大单流入比    ',CON2STR(大单流入限制,2)),'%')),COLORYELLOW;
 
大单强度:=(超B+大B-超S-大S)/成交总量*100,COLORYELLOW,NODRAW;
大单强度限制:=IF(大单强度<=0,ABS(大单强度),IF(大单强度>=100,100,大单强度));
DRAWRECTREL(650,130,885,190,RGB(0,100,0));
DRAWRECTREL(650,130,885,190,RGB(0,250,50));
DRAWRECTREL(650,130,650+CONST(大单强度限制*235/100),190,RGB(175,50,250));
DRAWTEXT_FIX(1,0.565,0.136,0,STRCAT(STRCAT('大单强度比    ',CON2STR(大单强度,2)),'%')),COLORYELLOW;
 
总流入比:=(超B+大B+中B+小B)/(超B+大B+中B+小B+超S+大S+中S+小S)*100,NODRAW;
DRAWRECTREL(650,200,885,260,RGB(0,100,0));
DRAWRECTREL(650,200,885,260,RGB(0,150,150));
DRAWRECTREL(650,200,650+CONST(总流入比*235/100),260,RGB(200,0,50));
DRAWTEXT_FIX(1,0.565,0.206,0,STRCAT(STRCAT('资金流入比    ',CON2STR(总流入比,2)),'%')),COLORYELLOW;
 
MVR:=REF(MA(V,5),1);
FVR:=REF(V,1);
PVR:=(MVR+FVR)/2;
资金量能比:=V/(V+PVR)*100/FROMOPEN*240;
DRAWRECTREL(650,270,885,330,RGB(0,100,0));
DRAWRECTREL(650,270,885,330,RGB(0,250,50));
DRAWRECTREL(650,270,650+CONST(资金量能比*235/100),330,RGB(175,50,250));
DRAWTEXT_FIX(1,0.565,0.276,0,STRCAT(STRCAT('资金量能比    ',CON2STR(资金量能比,2)),'%')),COLORYELLOW;
 
{左上角横柱}
主力买力度:=LARGEINTRDVOL*100/VOL,NODRAW;
主力卖力度:=LARGEOUTTRDVOL*100/VOL,NODRAW;
买卖力度比:=IF(主力买力度/主力卖力度*100>=100,100,IF(主力买力度/主力卖力度*100<=0,0,主力买力度/主力卖力度*100));
DRAWRECTREL(95,60,330,120,RGB(0,75,200));
DRAWRECTREL(95,60,330,120,RGB(0,150,150));
DRAWRECTREL(95,60,95+CONST(买卖力度比*235/100),120,RGB(200,0,50));
DRAWTEXT_FIX(1,0.013,0.06,0,STRCAT(STRCAT('买卖力度比    ',CON2STR(主力买力度/主力卖力度*100,2)),'%')),COLORYELLOW;
 
大量资金比:=大量博弈/(ABS(JGV)+ABS(DHV)+ABS(ZHV)+ABS(SHV))*100,COLORYELLOW,NODRAW;
大量资金比限制:=IF(大量资金比=0,-100,大量资金比);
大量强度比:=IF(大量资金比>0,(大量资金比限制+100)/2,IF(大量资金比<0,100-ABS((大量资金比限制-100)/2),0)),COLORGREEN,NODRAW;
DRAWRECTREL(95,130,330,190,RGB(0,75,220));
DRAWRECTREL(95,130,330,190,RGB(0,250,50));
DRAWRECTREL(95,130,95+CONST(大量强度比*235/100),190,RGB(175,50,250));
DRAWTEXT_FIX(1,0.013,0.136,0,STRCAT(STRCAT('大量强度比    ',CON2STR(大量强度比,2)),'%')),COLORYELLOW;
 
主买C:=主买A*100/(主买A+主卖A),NODRAW,COLORRED;
DRAWRECTREL(95,200,330,260,RGB(0,75,200));
DRAWRECTREL(95,200,330,260,RGB(0,150,150));
DRAWRECTREL(95,200,95+CONST(主买C*235/100),260,RGB(200,0,50));
DRAWTEXT_FIX(1,0.013,0.206,0,STRCAT(STRCAT('主动买卖比    ',CON2STR(主买C,2)),'%')),COLORYELLOW;
 
机构参与度:=(超B+超S+大B+大S)/成交总量*100,COLORYELLOW,NODRAW;
DRAWRECTREL(95,270,330,330,RGB(0,75,220));
DRAWRECTREL(95,270,330,330,RGB(0,250,50));
DRAWRECTREL(95,270,95+CONST(机构参与度*235/100),330,RGB(175,50,250));
DRAWTEXT_FIX(1,0.013,0.276,0,STRCAT(STRCAT('机构参与度    ',CON2STR(机构参与度,2)),'%')),COLORYELLOW;
 
活跃度:=100*VOL/(FINANCE(7)/100)COLORYELLOW,NODRAW;
DRAWRECTREL(460,800,695,860,RGB(0,75,220));
DRAWRECTREL(460,800,695,860,RGB(0,250,50));
DRAWRECTREL(460,800,460+CONST(活跃度*235/100),860,RGB(255,147,38));
DRAWTEXT_FIX(1,0.41,0.81,0,STRCAT(STRCAT('活跃度    ',CON2STR(活跃度,2)),'%')),COLORYELLOW;
 
饱和度:=IF((AMOUNT/C)/(HHV(AMOUNT,20)/HHV(C,20))*100>100,100,(AMOUNT/C)/(HHV(AMOUNT,20)/HHV(C,20))*100);
DRAWRECTREL(460,870,695,930,RGB(0,75,220));
DRAWRECTREL(460,870,695,930,RGB(0,250,50));
DRAWRECTREL(460,870,460+CONST(饱和度*235/100),930,RGB(255,147,38));
DRAWTEXT_FIX(1,0.41,0.876,0,STRCAT(STRCAT('饱和度    ',CON2STR(饱和度,2)),'%')),COLORYELLOW;
 
{左下角竖柱}
DAZHIV:=CONST(MAX(ABS(大宗进),MAX(ABS(大宗出),MAX(ABS(非大宗进),ABS(非大宗出))))),NODRAW;
DRAWRECTREL(20,CONST(950-(ABS(净流入)*250/DAZHIV)),60,950,IF(CONST(净流入)>0,RGB(250,0,0),RGB(0,250,0)));
DRAWRECTREL(85,CONST(950-(ABS(大宗进)*250/DAZHIV)),125,950,IF(CONST(大宗进)>0,RGB(255,0,255),RGB(0,0,50)));
DRAWRECTREL(150,CONST(950-(ABS(大宗出)*250/DAZHIV)),190,950,IF(CONST(大宗出)>0,RGB(50,50,255),RGB(255,0,0)));
DRAWRECTREL(215,CONST(950-(ABS(非大宗进)*250/DAZHIV)),255,950,IF(CONST(非大宗进)>0,RGB(250,0,250),RGB(0,0,50)));
DRAWRECTREL(280,CONST(950-(ABS(非大宗出)*250/DAZHIV)),320,950,IF(CONST(非大宗出)>0,RGB(50,50,250),RGB(255,0,0)));
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.00,1,0,' 资金驱动    主力进     主力出     散户进     散户出'),COLORWHITE;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.02,0.68,0,'净流入'),COLORRED;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.02,0.88,0,INTPART(净流入)),COLORWHITE;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.085,0.88,0,INTPART(大宗进)),COLORWHITE;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.150,0.88,0,INTPART(大宗出)),COLORWHITE;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.215,0.88,0,INTPART(非大宗进)),COLORWHITE;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.278,0.88,0,INTPART(非大宗出)),COLORWHITE;
 
{画涨停板}
AA:=FRACPART(10*REF(CLOSE,1));
BB:=IF(AA>=0.5,AA+0.1,AA);
CC:=0.01*INTPART(10*REF(CLOSE,1))+0.01*ROUND(BB);
涨停板:=REF(CLOSE,1)+CC;
STICKLINE(CLOSE=涨停板,OPEN,CLOSE,1,0),COLORYELLOW;




3、量能副图

对比量比指标用于用于测度成交量放大程度或萎缩程度的指标。对比量比值越大,说明成交量较前期成交量放大程度越大,对比量比值越小,说明成交量较前期成交量萎缩程度越大,一般认为:( 股 民 学 院 : http://www.58188.net )

1.对比量比大于20可以认为成交量极度放大;
2.对比量比大于3,可以认为成交量显著放大;
3.对比量比小于0.2,可以认为成交量极度萎缩;
4.对比量比小于0.4,可以认为成交量显著萎缩。


 
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,COLORCYAN;
进出量:=买量+卖量,COLOR00FFFF;
STICKLINE(进出量<0,0,进出量,4,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,进出量,4,0),COLOR000099;
STICKLINE(进出量>0,0,进出量,3,0),COLOR0000CC;
STICKLINE(进出量>0,0,进出量,1.5,0),COLOR0000FF;
STICKLINE(进出量>0,0,进出量,0.5,0),COLORCC66FF;
五日内净流入:SUM(进出量,5),LINETHICK2,COLORBLUE;
IF(五日内净流入>REF(五日内净流入,1),五日内净流入,DRAWNULL),COLORRED,LINETHICK2;
连红天:BARSLASTCOUNT(进出量>0);
五日内翻红天:COUNT(进出量>0,5),COLORBROWN;
十日内翻红天:COUNT(进出量>0,10),COLORRED;
廿日内翻红天:COUNT(进出量>0,20),COLORBLUE;
六十日内翻红天:COUNT(进出量>0,60),COLORMAGENTA;


上一篇:通达信源码精选:麟龙公式全集源码分享

下一篇:通达信源码精选:四周期多彩MACD,全息九宫格,龙回头