通达信资金买卖流向副图指标 源码分享 附图
N:=10;
超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;
净流入:=(超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;
近N净入:=SUM(净流入,N);
近N超:=SUM(超大单,N);
近N大:=SUM(大单,N);
近N中:=SUM(中单,N),;
近N小:=SUM(小单,N);
流入:=ABS(超B+大B+中B+小B)*1000/VOL;
流出:=ABS(超S+大S+中S+小S)*1000/VOL;
近N流入:=ABS(SUM(超B,N)+SUM(大B,N)+SUM(中B,N)+SUM(小B,N))*1000/VOL;
近N流出:=ABS(SUM(超S,N)+SUM(大S,N)+SUM(中S,N)+SUM(小S,N))*1000/VOL;
净流买比N:=近N流入*100/(近N流入+近N流出);
AAS:=CONST(MAX(ABS(流入),ABS(流出)))*4,NODRAW;
大宗进:=(超B)+(大B),NODRAW;
大宗出:=(超S)+(大S),NODRAW;
非大宗进:=(中B)+(小B),NODRAW;
非大宗出:=(中S)+(小S),NODRAW;
大宗进限制:=IF((超B+大B)=0,0,大宗进),NODRAW;
大宗出限制:=IF((超S+大S)=0,0,大宗出),NODRAW;
非大宗进限制:=IF(中B+小B=0,0,非大宗进),NODRAW;
非大宗出限制:=IF(中S+小S=0,0,非大宗出),NODRAW;
资金流向买:=大宗进限制+非大宗进限制;
资金流向卖:=大宗出限制+非大宗出限制;
近N资金流向买:=SUM(资金流向买,N);
近N资金流向卖:=SUM(资金流向卖,N);
{ 当日 }
DRAWRECTREL(0,0,990,999.2,IF(120,RGB(10,0,0),0));
DRAWRECTREL(50,255,950,195,RGB(0,140,0));
DRAWRECTREL(50,245,950,205,RGB(0,160,0));
DRAWRECTREL(50,235,950,215,RGB(0,180,0));
DRAWRECTREL(50,225,950,225,RGB(0,210,0));
DRAWRECTREL(50,255,50+CONST(净流买比N*900/100),195,RGB(140,0,0));
DRAWRECTREL(50,245,50+CONST(净流买比N*900/100),205,RGB(160,0,0));
DRAWRECTREL(50,235,50+CONST(净流买比N*900/100),215,RGB(180,0,0));
DRAWRECTREL(50,225,50+CONST(净流买比N*900/100),225,RGB(210,0,0));
DRAWTEXT_FIX(1,0.05,0.01,0,STRCAT(STRCAT('净流买比',CON2STR(净流买比N,2)),'%')),COLORYELLOW;
DRAWRECTREL(500,255,500,195,RGB(250,250,0));
DRAWRECTREL(60,CONST(700-IF((近N超)>0,(ABS(近N超)*250/DAZHI),0)),200,700,RGB(128,0,0));
DRAWRECTREL(60,700,200,CONST(700+IF((近N超)<0,(ABS(近N超)*250/DAZHI),0)),RGB(0,128,0));
DRAWRECTREL(300,CONST(700-IF((近N大)>0,(ABS(近N大)*250/DAZHI),0)),430,700,RGB(128,0,0));
DRAWRECTREL(300,700,430,CONST(700+IF((近N大)<0,(ABS(近N大)*250/DAZHI),0)),RGB(0,128,0));
DRAWRECTREL(600,CONST(700-IF((近N中)>0,(ABS(近N中)*250/DAZHI),0)),730,700,RGB(128,0,0));
DRAWRECTREL(600,700,730,CONST(700+IF((近N中)<0,(ABS(近N中)*250/DAZHI),0)),RGB(0,128,0));
DRAWRECTREL(820,CONST(700-IF((近N小)>0,(ABS(近N小)*250/DAZHI),0)),950,700,RGB(128,0,0));
DRAWRECTREL(820,700,950,CONST(700+IF((近N小)<0,(ABS(近N小)*250/DAZHI),0)),RGB(0,128,0));
DRAWRECTREL(60,699.8,950,700.2,RGB(255,0,0));
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N超)>0,0.05,0.900,0,'超大单'),COLORLIRED;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N超)<0,0.05,0.900,0,'超大单'),COLOR00FF00;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N超)=0,0.05,0.900,0,'超大单'),COLOR80FFFF;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N大)>0,0.35,0.900,0,'大单'),COLORLIRED;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N大)<0,0.35,0.900,0,'大单'),COLOR00FF00;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N大)=0,0.35,0.900,0,'大单'),COLOR80FFFF;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N中)>0,0.60,0.900,0,'中单'),COLORLIRED;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N中)<0,0.60,0.900,0,'中单'),COLOR00FF00;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N中)=0,0.60,0.900,0,'中单'),COLOR80FFFF;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N小)>0,0.85,0.900,0,'小单'),COLORLIRED;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N小)<0,0.85,0.900,0,'小单'),COLOR00FF00;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N小)=0,0.85,0.900,0,'小单'),COLOR80FFFF;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N超)>0,0.03,0.5,0,STRCAT(STRCAT(' ',CON2STR(近N超,1)),'万')),COLORLIRED;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N超)<0,0.03,0.5,0,STRCAT(STRCAT(' ',CON2STR(近N超,1)),'万')),COLOR00FF00;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N超)=0,0.03,0.5,0,STRCAT(STRCAT(' ',CON2STR(近N超,1)),' ')),COLORYELLOW;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N大)>0,0.25,0.5,0,STRCAT(STRCAT(' ',CON2STR(近N大,1)),'万')),COLORLIRED;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N大)<0,0.25,0.5,0,STRCAT(STRCAT(' ',CON2STR(近N大,1)),'万')),COLOR00FF00;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N大)=0,0.25,0.5,0,STRCAT(STRCAT(' ',CON2STR(近N大,1)),' ')),COLORYELLOW;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N中)>0,0.55,0.5,0,STRCAT(STRCAT(' ',CON2STR(近N中,1)),'万')),COLORLIRED;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N中)<0,0.55,0.5,0,STRCAT(STRCAT(' ',CON2STR(近N中,1)),'万')),COLOR00FF00;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N中)=0,0.55,0.5,0,STRCAT(STRCAT(' ',CON2STR(近N中,1)),' ')),COLORYELLOW;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N小)>0,0.80,0.5,0,STRCAT(STRCAT(' ',CON2STR(近N小,1)),'万')),COLORLIRED;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N小)<0,0.80,0.5,0,STRCAT(STRCAT(' ',CON2STR(近N小,1)),'万')),COLOR00FF00;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N小)=0,0.80,0.5,0,STRCAT(STRCAT(' ',CON2STR(近N小,1)),' ')),COLORYELLOW;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N净入)>0,0.93,0.01,1,STRCAT('10日净买: ',STRCAT(CON2STR(近N净入,1),'万'))) COLOR0000FF;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N净入)<0,0.93,0.01,1,STRCAT('10日净买: ',STRCAT(CON2STR(近N净入,1),'万'))) COLOR00FF00;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N净入)=0,0.90,0.01,1,STRCAT('10日净买: ',STRCAT(CON2STR(近N净入,1),'万'))) COLOR80FFFF;
DRAWTEXT_FIX(1,0.05,0.12,0,STRCAT(STRCAT('买入额:',CON2STR(近N资金流向买,1)),'万')),COLOR0000FF;
DRAWTEXT_FIX(1,0.50,0.12,0,STRCAT(STRCAT('卖出额:',CON2STR(近N资金流向卖,1)),'万')),COLOR00FF00;
来函数检测结果如下:
该公式没有未来函数
解密、定制、编写股票指标请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
N赋值:10
超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
净流入赋值:(超B+大B+中B+小B)-(超S+大S+中S+小S)
超大单赋值:(超B)-(超S)
大单赋值:(大B)-(大S)
中单赋值:(中B)-(中S)
小单赋值:(小B)-(小S)
DAZHI赋值:CONST(MAX(净流入的绝对值,MAX(ABS(超大单),MAX(ABS(大单),MAX(ABS(中单),ABS(小单)))))),NODRAW
近N净入:=N的净流入日累和
近N超:=N的超大单日累和
近N大:=N的大单日累和
近N中:=N的中单日累和,
近N小:=N的小单日累和
流入赋值:超B+大B+中B+小B的绝对值*1000/成交量
流出赋值:超S+大S+中S+小S的绝对值*1000/成交量
近N流入赋值:N的超B日累和+N的大B日累和+N的中B日累和+N的小B日累和的绝对值*1000/成交量
近N流出赋值:N的超S日累和+N的大S日累和+N的中S日累和+N的小S日累和的绝对值*1000/成交量
净流买比N赋值:近N流入*100/(近N流入+近N流出)
AAS赋值:CONST(MAX(流入的绝对值,ABS(流出)))*4,NODRAW
大宗进赋值:(超B)+(大B),NODRAW
大宗出赋值:(超S)+(大S),NODRAW
非大宗进赋值:(中B)+(小B),NODRAW
非大宗出赋值:(中S)+(小S),NODRAW
大宗进限制:=IF((超B+大B)=0,0,大宗进),NODRAW
大宗出限制:=IF((超S+大S)=0,0,大宗出),NODRAW
如果中B+小B=0返回0否则返回非大宗进
如果中S+小S=0返回0否则返回非大宗出
资金流向买赋值:大宗进限制+非大宗进限制
资金流向卖赋值:大宗出限制+非大宗出限制
近N资金流向买赋值:N的资金流向买日累和
近N资金流向卖赋值:N的资金流向卖日累和
{ 当日 }
DRAWRECTREL(0,0,990,999.2,IF(120,RGB(10,0,0),0))
DRAWRECTREL(50,255,950,195,RGB(0,140,0))
DRAWRECTREL(50,245,950,205,RGB(0,160,0))
DRAWRECTREL(50,235,950,215,RGB(0,180,0))
DRAWRECTREL(50,225,950,225,RGB(0,210,0))
DRAWRECTREL(50,255,50+CONST(净流买比N*900/100),195,RGB(140,0,0))
DRAWRECTREL(50,245,50+CONST(净流买比N*900/100),205,RGB(160,0,0))
DRAWRECTREL(50,235,50+CONST(净流买比N*900/100),215,RGB(180,0,0))
DRAWRECTREL(50,225,50+CONST(净流买比N*900/100),225,RGB(210,0,0))
DRAWTEXT_FIX(1,0.05,0.01,0,STRCAT(STRCAT('净流买比',CON2STR(净流买比N,2)),'%')),画黄色
DRAWRECTREL(500,255,500,195,RGB(250,250,0))
DRAWRECTREL(60,CONST(700-IF((近N超)>0,(近N超的绝对值*250/DAZHI),0)),200,700,RGB(128,0,0))
DRAWRECTREL(60,700,200,CONST(700+IF((近N超)<0,(近N超的绝对值*250/DAZHI),0)),RGB(0,128,0))
DRAWRECTREL(300,CONST(700-IF((近N大)>0,(近N大的绝对值*250/DAZHI),0)),430,700,RGB(128,0,0))
DRAWRECTREL(300,700,430,CONST(700+IF((近N大)<0,(近N大的绝对值*250/DAZHI),0)),RGB(0,128,0))
DRAWRECTREL(600,CONST(700-IF((近N中)>0,(近N中的绝对值*250/DAZHI),0)),730,700,RGB(128,0,0))
DRAWRECTREL(600,700,730,CONST(700+IF((近N中)<0,(近N中的绝对值*250/DAZHI),0)),RGB(0,128,0))
DRAWRECTREL(820,CONST(700-IF((近N小)>0,(近N小的绝对值*250/DAZHI),0)),950,700,RGB(128,0,0))
DRAWRECTREL(820,700,950,CONST(700+IF((近N小)<0,(近N小的绝对值*250/DAZHI),0)),RGB(0,128,0))
DRAWRECTREL(60,699.8,950,700.2,RGB(255,0,0))
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N超)>0,0.05,0.900,0,'超大单'),COLORLIRED
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N超)<0,0.05,0.900,0,'超大单'),COLOR00FF00
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N超)=0,0.05,0.900,0,'超大单'),COLOR80FFFF
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N大)>0,0.35,0.900,0,'大单'),COLORLIRED
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N大)<0,0.35,0.900,0,'大单'),COLOR00FF00
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N大)=0,0.35,0.900,0,'大单'),COLOR80FFFF
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N中)>0,0.60,0.900,0,'中单'),COLORLIRED
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N中)<0,0.60,0.900,0,'中单'),COLOR00FF00
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N中)=0,0.60,0.900,0,'中单'),COLOR80FFFF
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N小)>0,0.85,0.900,0,'小单'),COLORLIRED
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N小)<0,0.85,0.900,0,'小单'),COLOR00FF00
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N小)=0,0.85,0.900,0,'小单'),COLOR80FFFF
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N超)>0,0.03,0.5,0,STRCAT(STRCAT(' ',CON2STR(近N超,1)),'万')),COLORLIRED
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N超)<0,0.03,0.5,0,STRCAT(STRCAT(' ',CON2STR(近N超,1)),'万')),COLOR00FF00
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N超)=0,0.03,0.5,0,STRCAT(STRCAT(' ',CON2STR(近N超,1)),' ')),画黄色
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N大)>0,0.25,0.5,0,STRCAT(STRCAT(' ',CON2STR(近N大,1)),'万')),COLORLIRED
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N大)<0,0.25,0.5,0,STRCAT(STRCAT(' ',CON2STR(近N大,1)),'万')),COLOR00FF00
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N大)=0,0.25,0.5,0,STRCAT(STRCAT(' ',CON2STR(近N大,1)),' ')),画黄色
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N中)>0,0.55,0.5,0,STRCAT(STRCAT(' ',CON2STR(近N中,1)),'万')),COLORLIRED
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N中)<0,0.55,0.5,0,STRCAT(STRCAT(' ',CON2STR(近N中,1)),'万')),COLOR00FF00
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N中)=0,0.55,0.5,0,STRCAT(STRCAT(' ',CON2STR(近N中,1)),' ')),画黄色
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N小)>0,0.80,0.5,0,STRCAT(STRCAT(' ',CON2STR(近N小,1)),'万')),COLORLIRED
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N小)<0,0.80,0.5,0,STRCAT(STRCAT(' ',CON2STR(近N小,1)),'万')),COLOR00FF00
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N小)=0,0.80,0.5,0,STRCAT(STRCAT(' ',CON2STR(近N小,1)),' ')),画黄色
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N净入)>0,0.93,0.01,1,STRCAT('10日净买: ',STRCAT(CON2STR(近N净入,1),'万'))) COLOR0000FF
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N净入)<0,0.93,0.01,1,STRCAT('10日净买: ',STRCAT(CON2STR(近N净入,1),'万'))) COLOR00FF00
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(近N净入)=0,0.90,0.01,1,STRCAT('10日净买: ',STRCAT(CON2STR(近N净入,1),'万'))) COLOR80FFFF
DRAWTEXT_FIX(1,0.05,0.12,0,STRCAT(STRCAT('买入额:',CON2STR(近N资金流向买,1)),'万')),COLOR0000FF
DRAWTEXT_FIX(1,0.50,0.12,0,STRCAT(STRCAT('卖出额:',CON2STR(近N资金流向卖,1)),'万')),COLOR00FF00