以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  请求金字塔老师指点  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=381)

--  作者:wtx128153
--  发布时间:2009/12/6 20:26:39
--  请求金字塔老师指点

BK :=(H>SF AND(TJ5+TJ52=2 AND SF>BB AND H>BB))and AA>BB and h>o   ,TFILTER;
SP :=L<BB AND AA<BB AND BB< CC AND MV>0 AND AO<REF(AO,1) and l<o,TFILTER;
SK :=(L<XF AND(TJ6+TJ62=2 AND XF<BB AND L<CC)) AND AA<BB and l<o ,TFILTER ;
BP :=H>BB AND AA>BB AND BB>CC AND MV>0 AND AO>REF(AO,1) and h>o,TFILTER;
tSELLSHORT(BP and THOLDING<0 AND NOT(tTYPE(1)=4) ,THOLDING,0);
tBUY(BK and  THOLDING =0  and NOT(tTYPE(1)=1),1,MKT);
tSELL(SP and THOLDING>0   AND NOT(tTYPE(1)=2),THOLDING,0);
tBUYSHORT(SK and THOLDING=0 and NOT(tTYPE(1)=3) ,1,MKT);

以上语句有错误吗?BK SP SK BP最后加过滤,TFILTER;可以吗?如果可以加的话,以上原码能不能程式化自动下单吗?如果不能自动化下单,那该怎么改?请老师指点并改成能下单的,急盼,谢谢!


--  作者:金字塔
--  发布时间:2009/12/6 20:57:42
--  
 

BK :=(H>SF AND(TJ5+TJ52=2 AND SF>BB AND H>BB)) and AA>BB and h>o ;
SP :=L<BB AND AA<BB AND BB< CC AND MV>0 AND AO<REF(AO,1) and l<o;
SK :=(L<XF AND(TJ6+TJ62=2 AND XF<BB AND L<CC)) AND AA<BB and l<o;
BP :=H>BB AND AA>BB AND BB>CC AND MV>0 AND AO>REF(AO,1) and h>o;
tSELLSHORT(BP and THOLDING<0,THOLDING,MKT);//
本身不可能无仓平仓
tBUY(BK and  THOLDING =0,1,MKT);//
表示持仓为0,才开仓,有过滤作用,指开一次仓

tSELL(SP and THOLDING>0,THOLDING,MKT); //本身不可能无仓平仓
tBUYSHORT(SK and THOLDING=0,1,MKT); //
表示持仓为0,才开仓,有过滤作用,指开一次仓

 

THOLDING =0   NOT(tTYPE(1)=1)重复

TFILTER在这里无效

[此贴子已经被作者于2009-12-6 21:03:01编辑过]