[转载]最新笔段公式源码(飞狐专用)
(2010-12-29 11:46:02)
标签:
转载 |
分类: 电脑技术 |
{特点:自动根据周期图,有选择地显示笔或者段的点位、时长、位差、振幅。 必须配合悟多DLL公式使用}
//
if DATAPERIOD=0 then minduan:="fbase.var3#min1";
if DATAPERIOD=1 then minduan:="fbase.var3#min5";
if DATAPERIOD=2 then minduan:="fbase.var3#min30";
if DATAPERIOD=3 then minduan:="fbase.var3#min60";
if DATAPERIOD=4 then minduan:="fbase.var3#day";
if DATAPERIOD=5 then minduan:="fbase.var3#day";
if DATAPERIOD=6 then minduan:="fbase.var3#week";
if DATAPERIOD=7 then minduan:="fbase.var3#month";
if DATAPERIOD=8 then minduan:="fbase.var3#year";
var1:="chzhshch@kxian";
var2:="chzhshch@bi";{处理笔关系}
var3:="chzhshch@duan";{处理段关系}
//
drawline(var3=1,h,var3=-1,l,0),colorblue;
drawline(var3=-1,l,var3=1,h,0),colorblue;
//
drawline(var2=1,h,var2=-1,l,0),linedot,coloryellow;
drawline(var2=-1,l,var2=1,h,0),linedot,coloryellow;
if DATAPERIOD<=1 then begin var2:="chzhshch@duan";{处理段1分钟的关系}end;
pre:=2; {设置小数点位数}
if STKTYPE=0 then
if STKTYPE=11 then pre:=3;
varx:=
if(dataperiod>2,var2,var3);
a1:=barslast(varx<>0);
a2:=ref(varx,a1);
aa1:=ref(a1+1,1);
aa2:=ref(a2,1);
a3:=if
(aa2>0,l-ref(h,aa1),h-ref(l,aa1)),linethick0;
a4:=if
(aa2>0,(l-ref(h,aa1))/l*100,(h-ref(l,aa1))/ref(l,aa1)*100);
// 计算笔段振幅
// 显示点位
drawnumber(varx=1,h,h,pre),pxup45,color3300ff,align0;
drawnumber(varx=-1,l,l,pre),pxdn45,colorffff00,align0;
// 显示力度
drawtext(varx=1,h,'+')colormagenta,pxup65,align2;
drawnumber(varx=1,h,a3,pre),colormagenta,pxup65;
drawnumber(varx=-1,l,a3,pre),colorgreen,pxdn65,align0;
// 显示幅度
drawtext(varx=1,h,'%')colormagenta,pxup5,align1;
drawnumber(varx=1,h,a4,pre),colorgreen,pxup5,align2;
drawtext(varx=-1,l,'%')colormagenta,pxdn5,align1;
drawnumber(varx=-1,l,a4,pre),colorblue,pxdn5,align2;
// 显示周期数
drawtext(varx=1,h,'T'),pxup25,coloryellow,align1;
drawnumber(varx=1,h,aa1,0),coloryellow,pxup25,align2;
drawtext(varx=-1,l,'T'),pxdn25,coloryellow,align1;
drawnumber(varx=-1,l,aa1,0),coloryellow,pxdn25,align2;
// 显示最后没完成的点位
aa9:=hhv(h,a1);
aa11:=llv(l,a1);
drawnumber(
drawnumber(
// 显示最后没完成的力度
drawtext(
drawnumber( islastbar and a2=-1,
aa9,a3,pre),align2,colormagenta,pxup65;
drawnumber( islastbar and a2=1,
aa11,a3,pre),align2,colorgreen,pxdn65;
// 显示最后没完成的幅度
drawtext(
drawnumber( islastbar and a2=-1,
aa9,a4,pre),align2,colorgreen,pxup5;
drawtext(
drawnumber( islastbar and a2=1,
aa11,a4,pre),align2,colorblue,pxdn5;
// 显示最后没完成的周期
drawtext(
drawnumber(islastbar and a2=-1,
drawtext(
drawnumber(islastbar and a2=1,
aa11,aa1,0),coloryellow,align2,pxdn25;
// 均线系统可以根据需要添加
ma5:ma(c,5);ma10:ma(c,10);
{
ma34:ma(c,34);ma55:ma(c,55);
ma89:ma(c,89);ma144:ma(c,144);
ma233:ma(c,233);ma377:ma(c,377);}

加载中…