通达信多空监控A 有机构资金进出 买入逃顶信号副图指标公式

[复制链接]
查看119 | 回复0 | 2021-8-26 22:03:49 | 显示全部楼层 |阅读模式

以下是通达信多空监控A 有机构资金进出 买入逃顶信号副图指标公式(无源码的请下载附件导入)

多空监控A

有机构资金进出,买入逃顶信号,

作为日线副图或者 分时副图,都可以使用。

STICKLINE((VOL > 0),VOL,0,2.6,1),COLOR666666;
JJ:=(HIGH+LOW+CLOSE)/3;
QJ0:=VOL/IF(HIGH=LOW,4,HIGH-LOW);
主买2:=ABS(QJ0*(JJ-MIN(CLOSE,OPEN)));
STICKLINE(主买2,0,主买2,2.5,0),COLORCBC0FF;
主卖2:=ABS(QJ0*(MIN(OPEN,CLOSE)-LOW));
STICKLINE(主卖2,0,-主卖2,2.5,0),COLORFF9900;
散买2:=ABS(QJ0*(HIGH-MAX(OPEN,CLOSE)));
STICKLINE(散买2,主买2,主买2+散买2,2.5,0),COLOR888888;
散卖2:=ABS(QJ0*(MAX(CLOSE,OPEN)-JJ));
STICKLINE(散卖2,-主卖2,-主卖2-散卖2,2.5,0),COLOR888888;
资金异动:=VOL/MA(VOL,55)*100,COLORYELLOW;
STICKLINE(资金异动>100 ,0,主买2+散买2,0.01,0),COLORYELLOW,NODRAW;
VAR1:=VOL/((H-L)*2-ABS(C-O));
主买1:=IF(C>O,VAR1*(H-L),IF(C<O,VAR1*((H-O)+(C-L)),VOL/2)),COLORRED,NODRAW;
主卖1:=IF(C>O,0-VAR1*((H-C)+(O-L)),IF(C<O,0-VAR1*(H-L),0+V/2)),COLOR00FF00,NODRAW;
AA1:=VOL<REF(LLV(VOL,20),1);
STICKLINE(AA1,(-主卖2-散卖2),(主买2+散买2),1.1,1),COLORYELLOW,NODRAW;
AA2:=VOL<REF(LLV(VOL,60),1);
STICKLINE(AA2,(-主卖2-散卖2),(主买2+散买2),1.1,1),COLORCD0000,NODRAW;
AA3:=VOL<REF(LLV(VOL,100),1);
STICKLINE(AA3,(-主卖2-散卖2),(主买2+散买2),1.0,1),COLORGREEN,NODRAW;
 
 
买卖差:=(主买1+主卖1);
STICKLINE((买卖差<0),0,买卖差,2.5,0),COLORGREEN,LINETHICK1;
STICKLINE((买卖差>0),0,买卖差,2.5,0),COLORRED,LINETHICK1;
 
FJ:0,COLORRED,NODRAW;
DDXA:=主买1+主卖1;
DX:=MA(DDXA,5)*5;
DDX1:SMA(DX,2,1),COLORGREEN,LINETHICK1;
B:=DDX1 <REF(DDX1,1);
IF( B -1, DDX1 ,DRAWNULL)COLORRED,LINETHICK2;
DDX2:SMA(DX,3,1),COLORYELLOW,LINETHICK1;
 
 
超B:=L2_AMO(0,2)/10000.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);
净流入:=(超B+大B+中B+小B)-(超S+大S+中S+小S);
超大单:=(超B)-(超S);
大单:=(大B)-(大S);
中单:=(中B)-(中S);
小单:=(小B)-(小S);
 
DAZHI:=CONST(MAX(ABS(净流入),MAX(ABS(超大单),MAX(ABS(大单),MAX(ABS(中单),ABS(小单)))))),NODRAW;
 
近2净入:=SUM(净流入,2);
近2超:=SUM(超大单,2);
近2大:=SUM(大单,2);
近2中:=SUM(中单,2),;
近2小:=SUM(小单,2);
 
近3净入:=SUM(净流入,3);
近3超:=SUM(超大单,3);
近3大:=SUM(大单,3);
近3中:=SUM(中单,3),;
近3小:=SUM(小单,3);
 
 
 
流入:=ABS(超B+大B+中B+小B)*1000/VOL;
流出:=ABS(超S+大S+中S+小S)*1000/VOL;
近2流入:=ABS(SUM(超B,2)+SUM(大B,2)+SUM(中B,2)+SUM(小B,2))*1000/VOL;
近2流出:=ABS(SUM(超S,2)+SUM(大S,2)+SUM(中S,2)+SUM(小S,2))*1000/VOL;
近3流入:=ABS(SUM(超B,3)+SUM(大B,3)+SUM(中B,3)+SUM(小B,3))*1000/VOL;
近3流出:=ABS(SUM(超S,3)+SUM(大S,3)+SUM(中S,3)+SUM(小S,3))*1000/VOL;
 
净流买比:=流入*100/(流入+流出);
净流买比2:=近2流入*100/(近2流入+近2流出);
净流买比3:=近3流入*100/(近3流入+近3流出);
 
AAS:=CONST(MAX(ABS(流入),ABS(流出)))*4,NODRAW;
 
{ 当日 }
DRAWRECTREL(0,0,175,999.2,IF(120,RGB(10,0,0),0));
{DRAWTEXT_FIX(CURRBARSCOUNT=1,0.0,0.001,0,'单位(万元)'),COLORDDDDDD;}
DRAWRECTREL(5,ABS(CONST(880-(ABS(净流入)*450/DAZHI))),26,880,IF(CONST(净流入)>0,RGB(170,0,170),RGB(0,155,0)));
DRAWRECTREL(35,ABS(CONST(880-(ABS(超大单)*450/DAZHI))),60,880,IF(CONST(超大单)>0,RGB(240,130,140),RGB(23,125,255)));
DRAWRECTREL(70,ABS(CONST(880-(ABS(大单)*450/DAZHI))),95,880,IF(CONST(大单)>0,RGB(255,0,0),RGB(23,125,255)));
DRAWRECTREL(105,ABS(CONST(880-(ABS(中单)*450/DAZHI))),130,880,IF(CONST(中单)>0,RGB(255,0,0),RGB(23,125,255)));
DRAWRECTREL(140,ABS(CONST(880-(ABS(小单)*450/DAZHI))),165,880,IF(CONST(小单)>0,RGB(255,0,0),RGB(23,125,255)));
 
DRAWRECTREL(10,205,160,125,RGB(0,140,0));
DRAWRECTREL(10,195,160,135,RGB(0,160,0));
DRAWRECTREL(10,185,160,145,RGB(0,180,0));
DRAWRECTREL(10,175,160,155,RGB(0,210,0));
 
DRAWRECTREL(10,205,10+CONST(净流买比*160/100),125,RGB(140,0,0));
DRAWRECTREL(10,195,10+CONST(净流买比*160/100),135,RGB(160,0,0));
DRAWRECTREL(10,185,10+CONST(净流买比*160/100),145,RGB(180,0,0));
DRAWRECTREL(10,175,10+CONST(净流买比*160/100),155,RGB(210,0,0));
DRAWTEXT_FIX(1,0.05,0.01,0,STRCAT(STRCAT('净流买比',CON2STR(净流买比,2)),'%')),COLORYELLOW;
 
 
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.002,0.001,0,'当日'),COLORFFFFFF;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.005,1,0,'净流'),COLORFFFFFF;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.039,1,0,'超大'),COLOR00FFFF;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.074,1,0,'大单'),COLORRED;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.108,1,0,'中单'),COLORRED;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.143,1,0,'小单'),COLORGREEN;
 
 
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.005,0.79,0,CEILING(净流入)),COLORYELLOW;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.037,0.71,0,CEILING(超大单)),COLORYELLOW;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.073,0.63,0,CEILING(大单)),COLORYELLOW;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.107,0.55,0,CEILING(中单)),COLORYELLOW;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.142,0.47,0,CEILING(小单)),COLORYELLOW;
 
{2日  }
DRAWRECTREL(175,0,360,999.2,IF(120,RGB(10,0,0),0));
DRAWRECTREL(185,ABS(CONST(880-(ABS(近2净入)*50/DAZHI))),210,880,IF(CONST(近2净入)>0,RGB(180,0,180),RGB(000,155,000)));
DRAWRECTREL(220,ABS(CONST(880-(ABS(近2超)*50/DAZHI))),245,880,IF(CONST(近2超)>0,RGB(240,130,140),RGB(23,125,255)));
DRAWRECTREL(255,ABS(CONST(880-(ABS(近2大)*50/DAZHI))),280,880,IF(CONST(近2大)>0,RGB(255,0,0),RGB(23,125,255)));
DRAWRECTREL(290,ABS(CONST(880-(ABS(近2中)*50/DAZHI))),315,880,IF(CONST(近2中)>0,RGB(255,0,0),RGB(23,125,255)));
DRAWRECTREL(325,ABS(CONST(880-(ABS(近2小)*50/DAZHI))),350,880,IF(CONST(近2小)>0,RGB(255,0,0),RGB(23,125,255)));
 
DRAWRECTREL(205,205,340,145,RGB(0,155,0));
DRAWRECTREL(185,205,180+CONST(净流买比2*160/100),145,RGB(160,0,0));
DRAWTEXT_FIX(1,0.24,0.01,0,STRCAT(STRCAT('净流买比',CON2STR(净流买比2,2)),'%')),COLORYELLOW;
 
 
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.189,0.001,0,'2日'),COLORFFFFFF;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.189,1,0,'净流'),COLORFFFFFF;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.224,1,0,'超大'),COLOR00FFFF;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.259,1,0,'大单'),COLORRED;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.294,1,0,'中单'),COLORRED;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.329,1,0,'小单'),COLORGREEN;
 
 
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.187,0.790,0,CEILING(近2净入)),COLORYELLOW;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.223,0.710,0,CEILING(近2超)),COLORYELLOW;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.258,0.630,0,CEILING(近2大)),COLORYELLOW;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.294,0.550,0,CEILING(近2中)),COLORYELLOW;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.329,0.470,0,CEILING(近2小)),COLORYELLOW;
 
 
{ 3 }
DRAWRECTREL(360,0,545,999.3,IF(120,RGB(10,0,0),0));
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.376,0.001,0,'3日'),COLORFFFFFF;
DRAWRECTREL(370,ABS(CONST(880-(ABS(近3净入)*50/DAZHI))),395,880,IF(CONST(近3净入)>0,RGB(180,0,180),RGB(000,155,000)));
DRAWRECTREL(405,ABS(CONST(880-(ABS(近3超)*50/DAZHI))),430,880,IF(CONST(近3超)>0,RGB(240,130,140),RGB(23,125,255)));
DRAWRECTREL(440,ABS(CONST(880-(ABS(近3大)*50/DAZHI))),465,880,IF(CONST(近3大)>0,RGB(255,0,0),RGB(23,125,255)));
DRAWRECTREL(475,ABS(CONST(880-(ABS(近3中)*50/DAZHI))),500,880,IF(CONST(近3中)>0,RGB(255,0,0),RGB(23,125,255)));
DRAWRECTREL(510,ABS(CONST(880-(ABS(近3小)*50/DAZHI))),535,880,IF(CONST(近3小)>0,RGB(255,0,0),RGB(23,125,255)));
 
DRAWRECTREL(370,205,520,145,RGB(0,155,0));
{DRAWRECTREL(530,195,690,155,RGB(0,175,0));
DRAWRECTREL(530,185,690,165,RGB(0,195,0));
DRAWRECTREL(530,175,690,175,RGB(0,225,0));}
 
DRAWRECTREL(370,205,370+CONST(净流买比3*160/100),145,RGB(160,0,0));
{DRAWRECTREL(530,195,530+CONST(净流买比3*160/100),155,RGB(180,0,0));
DRAWRECTREL(530,185,530+CONST(净流买比3*160/100),165,RGB(200,0,0));
DRAWRECTREL(530,175,530+CONST(净流买比3*160/100),175,RGB(230,0,0));}
DRAWTEXT_FIX(1,0.43,0.01,0,STRCAT(STRCAT('净流买比',CON2STR(净流买比3,2)),'%')),COLORYELLOW;
 
 
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.376,1,0,'净流'),COLORFFFFFF;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.411,1,0,'超大'),COLOR00FFFF;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.446,1,0,'大单'),COLORRED;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.481,1,0,'中单'),COLORRED;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.516,1,0,'小单'),COLORGREEN;
 
 
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.372,0.79,0,CEILING(近3净入)),COLORYELLOW;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.407,0.71,0,CEILING(近3超)),COLORYELLOW;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.442,0.63,0,CEILING(近3大)),COLORYELLOW;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.477,0.55,0,CEILING(近3中)),COLORYELLOW;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.512,0.470,0,CEILING(近3小)),COLORYELLOW;
 
 
 
大宗净流入:=(超B+大B)-(超S+大S),NODRAW;
大宗流入比:=大宗净流入*1000000/AMOUNT,NODRAW;
 
DRAWRECTREL(10,220,160,300,RGB(0,100,0));
DRAWRECTREL(10,220,160,300,RGB(0,100,0));
DRAWRECTREL(10,220,90+CONST(大宗流入比*160/100),300,RGB(180,0,180));
DRAWTEXT_FIX(1,0.07,0.22,1,STRCAT(STRCAT('机构介入 :  ',CON2STR(大宗流入比,0)),' % ')),COLORYELLOW;
   
主买A:=ACTINVOL,COLORRED,NODRAW;
主卖A:=ACTOUTVOL,COLORGREEN,NODRAW;
主买:主买A*100/(主买A+主卖A),NODRAW,COLORRED;
主卖:主卖A*100/(主买A+主卖A),NODRAW,COLORGREEN;
DRAWRECTREL(10,300,160,390,RGB(0,100,0)),NODRAW;
DRAWRECTREL(10,300,160,390,RGB(0,100,0)),NODRAW;
DRAWRECTREL(10,300,10+CONST(主买*160/100),390,RGB(100,0,0)),NODRAW;
DRAWTEXT_FIX(1,0.08,0.305,1,STRCAT(STRCAT('主动买卖比 ',CON2STR(主买,2)),' %')),COLORYELLOW,NODRAW;
大宗进:=(超B)+(大B),NODRAW;
大宗出:=(超S)+(大S),NODRAW;
非大宗进:=(中B)+(小B),NODRAW;
非大宗出:=(中S)+(小S),NODRAW;
大宗进限制:=IF((超B+大B)=0,0,大宗进);
大宗出限制:=IF((超S+大S)=0,0,大宗出);
非大宗进限制:=IF(中B+小B=0,0,非大宗进);
非大宗出限制:=IF(中S+小S=0,0,非大宗出);
资金流向买:=大宗进限制+非大宗进限制;
资金流向卖:=大宗出限制+非大宗出限制;
流入比:=净流入*1000000/AMOUNT,NODRAW;
总流入比:=(超B+大B+中B+小B)/(超B+大B+中B+小B+超S+大S+中S+小S)*100,NODRAW;
DRAWRECTREL(10,310,160,390,RGB(0,100,0));
DRAWRECTREL(10,310,160,390,RGB(0,100,0));
DRAWRECTREL(10,310,10+CONST(总流入比*160/100),390,RGB(230,0,0));
DRAWTEXT_FIX(1,0.070,0.305,1,STRCAT(STRCAT('今日流向:   ',CON2STR(资金流向买,0)),' ')),COLORFFFFFF;
DRAWTEXT_FIX(1,0.13,0.305,1,STRCAT(STRCAT(' ',CON2STR(资金流向卖,0)),' ')),COLORFFFFFF;

1724500885.jpg

1724500885.jpg

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则