以文本方式查看主题

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

--  作者:lanchongms
--  发布时间:2012/10/31 16:45:32
--  后台下单求救
cc1:=stkindi(stklabel,\'股指1.hold\',0,17,0);  
cc2:=stkindi(stklabel,\'股指2.hold\',0,1,0);   

cc800988:=1*cc1 + 1*cc2;

order:=cc800988-holding;
if order>0 then begin
 pc:=min(abs(min(holding,0)),order);
 kc:=order-pc;
 sellshort(pc>0,pc,limitr,o);
 tsellshort(pc>0,pc,LMT,o);
 buy(kc>0,kc,limitr,o);
 tbuy(kc>0,kc,lmt,o); 
end
if order<0 then begin
 pc:=min(max(holding,0),abs(order));
 kc:=abs(order)-pc;
 sell(pc>0,pc,limitr,o);
 tsell(pc>0,pc,lmt,o); 
 buyshort(kc>0,kc,limitr,o); 
 tbuyshort(kc>0,kc,lmt,o);  
end

 

股指1.hold  ,hold表示引用的股指模型1的持仓
求救啊,这段代码后台怎么不会下单
代码的原理是,把两个模型的持仓合并起来下单,但在后台下单环节没反应 ,在图表显示的持仓正常

 

 


--  作者:jinzhe
--  发布时间:2012/10/31 17:05:31
--  
你好,可以参考http://www.weistock.com/bbs/dispbbs.asp?boardid=4&id=1246&page=1&star=1先对自己公式进行调试,输出条件变量的具体数值看看,然后观察是哪里不对