一、先创建001.fnc,用做引用
c1:c;
o1:o;
h1:h;
l1:l;
rc:DYNAINFO(3);
j:AMOUNT;
上一日成交量:ref(v,1);
二、再创建:大盘分时.fcn
{指数叠加}
gqc:=DYNAINFO(3);{昨收}
gh:=DYNAINFO(5);{今最高}
gL:=DYNAINFO(6);{今最低}
gzdz:=max(gh-gqc,gqc-gL);{今涨跌最大值}
gf:=gzdz/gqc;{今涨跌最大幅度}
w:=gqc-gzdz;{最低位置}
shqc:=hhv(STKINDI('sh000001','001.rc#day'),0);{昨收}
shH:=hhv(STKINDI('sh000001','001.H1#day'),0);{今最高}
shL:=HHv(STKINDI('sh000001','001.L1#day'),0);{今最低}
shc:=STKINDI('sh000001','001.c1#min1');{今分时收盘}
shjh:=STKINDI('sh000001','001.j#min1');{今分时成交额}
szqc:=hhv(STKINDI('sz399001','001.rc#day'),0);{昨收}
szH:=hhv(STKINDI('sz399001','001.H1#day'),0);{今最高}
szL:=HHv(STKINDI('sz399001','001.L1#day'),0);{今最低}
szc:=STKINDI('sz399001','001.c1#min1');{今分时收盘}
szjh:=STKINDI('sz399001','001.j#min1');{今分时成交额}
cybqc:=hhv(STKINDI('sz399006','001.rc#day'),0);{昨收}
cybH:=hhv(STKINDI('sz399006','001.H1#day'),0);{今最高}
cybL:=HHv(STKINDI('sz399006','001.L1#day'),0);{今最低}
cybc:=STKINDI('sz399006','001.c1#min1');{今分时收盘}
cybjh:=STKINDI('sz399006','001.j#min1');{今分时成交额}
zqc:=if(STRCMP(MARKETLABEL,'SH')=0,shqc,if(STRCMP(STRLEFt(STKLABEL,1),'0')=0,szqc,cybqc));{昨收}
zc:=if(STRCMP(MARKETLABEL,'SH')=0,shc,if(STRCMP(STRLEFt(STKLABEL,1),'0')=0,szc,cybc));{今分时收盘}
zh:=if(STRCMP(MARKETLABEL,'SH')=0,shh,if(STRCMP(STRLEFt(STKLABEL,1),'0')=0,szh,cybh));{今最高}
zl:=if(STRCMP(MARKETLABEL,'SH')=0,shl,if(STRCMP(STRLEFt(STKLABEL,1),'0')=0,szl,cybl));{今最低}
zjh:=if(STRCMP(MARKETLABEL,'SH')=0,shjh,if(STRCMP(STRLEFt(STKLABEL,1),'0')=0,szjh,cybjh));{今分时成交额}
zzdz:=max(zh-zqc,zqc-zl);{大盘今涨跌最大值}
Z,:=zzdz/zqc;{大盘今涨跌最大幅度}
bl:=GF/Z,;{个股相对于大盘今涨跌最大比例}
s:=(zc/zqc-1)*bl*gqc+gqc;
POLYLINE(C,s),COLORMAGENTA;
大盘指数:zc,LINETHICK0,COLORMAGENTA,PRECIS2;
大盘涨跌%:(zc/zqc-1)*100,LINETHICK0,COLORMAGENTA,PRECIS2;
大盘成交(亿):zjh/10000/10000,LINETHICK0,COLORMAGENTA,PRECIS2;
指数成交额:=zjh/hhv(zjh,0)*gzdz*50+w;
STICKLINE(zc>=ref(zc,1),w,指数成交额,0.1,1),COLORRED;
STICKLINE(zc<ref(zc,1),w,指数成交额,0.1,1),COLORCYAN;
STICKLINE(c,w,w,10,1),COLORCYAN;
if STRCMP(STRLEFt(STKLABEL,1),'6')=0 then
wz:='叠加:上证指数 000001';
if STRCMP(STRLEFt(STKLABEL,1),'0')=0 then
wz:='叠加:深圳成指 399001';
if STRCMP(STRLEFt(STKLABEL,1),'3')=0 then
wz:='叠加:创业指数 399006';
DRAWTEXTABS( 2,3,wz),LINETHICK1,COLORMAGENTA;
{放量预测}
m:=if((time > 93000 and time <= 113000),(hour - 9)*60 + minute - 30,if((time > 130000 and time <= 150000),(hour - 13)*60 + minute + 120,240));
mday:=sum(v,0)*240/m;
换手:=mday*100/capital;
yv:="001.上一日成交量#day";
if barstatus = 2 then
begin
if mday < yv then
drawtextabs(150,3,'昨日成交:'+numtostrn(yv/CAPITAL*100,2)+'%,本日趋势:'+numtostrn(mday/CAPITAL*100,2)+'%。缩量。'),colorgreen;
if mday >= yv then
drawtextabs(150,3,'昨日成交:'+numtostrn(yv/CAPITAL*100,2)+'%,本日趋势:'+numtostrn(mday/CAPITAL*100,2)+'%。放量。'),colorred;
end;
|