{SV资金流}
{活跃资金流}
INPUT:N(7,1,100);
TODAY:="ddx.ddx"=0;{判断是否有正版数据}
TODAY1:=DYNAINFO(7)=CLOSE and DYNAINFO(10)=AMOUNT and (ORDER(1)=0 and ORDER(2)=0);;{判断是否有理想数据}
{条件}
主单买:=IF(TODAY,IF(TODAY1,"1DDEDATA@BIGORDER"(1,2),SELFDATA('特大买入')+SELFDATA('大单买入')),bigorder(1,2));
主单卖:=IF(TODAY,IF(TODAY1,"1DDEDATA@BIGORDER"(2,2),SELFDATA('特大卖出')+SELFDATA('大单卖出')),bigorder(2,2));
特单买:=IF(TODAY,IF(TODAY1,"1DDEDATA@BIGORDER"(1,3),SELFDATA('特大买入')),bigorder(1,3));
特单卖:=IF(TODAY,IF(TODAY1,"1DDEDATA@BIGORDER"(2,3),SELFDATA('特大卖出')),bigorder(2,3));
大单买:=IF(TODAY,IF(TODAY1,("1DDEDATA@BIGORDER"(1,2)-"1DDEDATA@BIGORDER"(1,3)),SELFDATA('大单买入')),(bigorder(1,2)-bigorder(1,3)));
大单卖:=IF(TODAY,IF(TODAY1,("1DDEDATA@BIGORDER"(2,2)-"1DDEDATA@BIGORDER"(2,3)),SELFDATA('大单卖出')),(bigorder(2,2)-bigorder(2,3)));
{计算}
主净:=主单买-主单卖;
净额:=(主净)*amount/10000;
多日净值:=sum(净额,N);
超大:=sum((特单买-特单卖) * VOL/CAPITAL * 100,1);
大户:=sum((大单买-大单卖)*100*v/CAPITAL,1);
主力:=(超大+大户);
资金动能:ma(主力,1),Color66CCFF,LINETHICK0;
多日资金动能:=SUM(资金动能,N);
{趋势}
partline(多日净值,多日净值>=ref(多日净值,1),rgb(255,0,0),多日净值
FILLRGN(多日净值,0,多日净值>0,RGB(200,0,100),多日净值<0,RGB(0,100,100));
drawmovetext(多日净值>0,NUMTOSTR(N)+'日内活跃资金净流入'+NUMTOSTR(多日净值)+'万元'),colorred;
drawmovetext(多日净值<=0,NUMTOSTR(N)+'日内活跃资金净流出'+NUMTOSTR(-多日净值)+'万元'),colorgreen;
DRAWFLAGTEXT(多日资金动能>0.2,多日资金动能,'<*t=0000FF*><*c=FFFFFF*><*p=95*>'+datestr(date)+' 多日活跃资金 能量趋势 '+NUMTOSTRN(多日资金动能,2)+''+'n'+'<*t=E7FFFF*><*c=0000FF*><*p=95*>'+'股价:低位注意主力拉升 高位注意主力派发'+'n'+'<*t=0092F7*><*c=FFFFFF*><*p=95*>'+'股价:横盘注意活跃资金 连红趋势是否收缩'+'n'+'<*t=E7FFFF*><*c=000000*><*p=95*>'+'结合:多日K线走势 股价高低位 判断多空方向');
DRAWFLAGTEXT(多日资金动能<=-0.2,多日资金动能,'<*t=008000*><*c=FFFFFF*><*p=95*>'+datestr(date)+' 多日活跃资金 能量趋势 '+NUMTOSTRN(多日资金动能,2)+''+'n'+'<*t=E7FFFF*><*c=008000*><*p=95*>'+'股价:高位注意主力逃顶 低位注意主力做底'+'n'+'<*t=0092F7*><*c=FFFFFF*><*p=95*>'+'股价:横盘注意活跃资金 连绿趋势是否收缩'+'n'+'<*t=E7FFFF*><*c=000000*><*p=95*>'+'结合:多日K线走势 股价高低位 判断多空方向');
drawmovetext(1,'活跃资金进出'+numtostr(净额)+'万元'),colorWhite;
月净值:sum(净额,30),linethick0,colorfaabec;
{输出}
连红:LAST(净额 > 0),LINETHICK0,COLOR0030FF,PRECIS0;{天}
连红最多:if(连红=0,0,hhv(净额,连红)),LINETHICK0,PRECIS2,COLOR6600FF;
连绿:LAST(净额 < 0),LINETHICK0,COLOR00FF30,PRECIS0;{天};
连绿最多:if(连绿=0,0,llv(净额,连绿)),LINETHICK0,PRECIS2,COLOR00ff00;
{红柱图}
STICKLINE(净额>0,0,净额,7,0), COLOR000033;
STICKLINE(净额>0,0,净额,6,0), COLOR000066;
STICKLINE(净额>0,0,净额,5,0), COLOR000088;
STICKLINE(净额>0,0,净额,4,0), COLOR0000BB;
STICKLINE(净额>0,0,净额,2.5,0), COLOR0000EE;
STICKLINE(净额>0,0,净额,1,0), COLOR0033FF;
{绿柱图}
STICKLINE(净额<0,0,净额,7,0),COLOR003300;
STICKLINE(净额<0,0,净额,6,0),COLOR006600;
STICKLINE(净额<0,0,净额,5,0),COLOR008800;
STICKLINE(净额<0,0,净额,4,0),COLOR00BB00;
STICKLINE(净额<0,0,净额,2.5,0),COLOR00EE00;
STICKLINE(净额<0,0,净额,1,0),COLOR00FF00;
DRAWTEXTREL(0,0,'SuperView-活跃资金流'),COLORYELLOW; |