以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://222.73.7.161/bbs/index.asp)
--  公式模型编写问题提交  (http://222.73.7.161/bbs/list.asp?boardid=4)
----  如何改成后台  (http://222.73.7.161/bbs/dispbbs.asp?boardid=4&id=161909)

--  作者:代人发贴
--  发布时间:2018/3/7 17:13:14
--  如何改成后台
ss:=1;
 
sumsell2:=sum(sellVOL,1500);
sumbuy2:=sum(buyVOL,1500);
sumsell3:=sum(IF(SELLVOL>=ma(vol,500),sellVOL,0),500);
sumbuy3:=sum(IF(BUYVOL>=ma(vol,500),buyVOL,0),500);

up:=every(c>ref(c,1) and buyvol>70,2);
down:= EVERY(c<ref(c,1)and sellvol>70,2); 

DT:=  up and sumbuy2<sumsell2 and mod(c,100)<70 ;
KT:= down and sumbuy2>sumsell2 and mod(c,100)>30 ;// and c>ref(c,3)and c<ref(c,3)

//DT2:= every(c>ref(c,1) and buyvol>70,6)  and sumbuy2<sumsell2  ;
//KT2:= EVERY(c<ref(c,1)and sellvol>70,6) and sumbuy2>sumsell2 ;// and c>ref(c,3)and c<ref(c,3)
jx:=ma(c,2000);


--  作者:FireScript
--  发布时间:2018/3/7 17:28:04
--  
编写中,迟点在本帖下回复您。
--  作者:FireScript
--  发布时间:2018/3/9 10:16:29
--  

tbuy(count(dt,6) and tholding=0,ss,lmt,DYNAINFO( 34));//thisclose 后台不可用,替换成后台对手价
tbuyshort(count(dt,6) and tholding=0,ss,lmt,DYNAINFO( 28));
tsellshort(count(tenterbars(1)>1000 and sumbuy3>sumsell3 and every(c>jx,10)  and count(c<jx,500)>50 and c<tENTERPRICE-20 or c>tENTERPRICE+200,8)and count(kt,8)=0 or every(up and sumbuy2<sumsell2 ,3),ss,lmt,DYNAINFO( 34));
tsell( count(tenterbars(1)>1000 and sumbuy3<sumsell3 and every(c<jx,10) and count(c>jx,500)>50 and c>tENTERPRICE+20 or c<tENTERPRICE-200,8) and count(dt,8)=0 or every(down and sumbuy2>sumsell2 ,3),ss,lmt,DYNAINFO( 28));

tsell(time=185900,0,MKT);
tsellshort(time=185900,0,MKT);

 

前面条件不变,这里改成后台处理的模式。不过后台和图表交易机制上有一定差异,最好对这个有所理解。