我一个后台策略,对模拟账户myaccount分别做多ru00,做空al00,设置好手数,下单时设置手数的一半,真的很奇怪啊,模拟账户里面设置的是1000万,不会是金额不够用,下面是代码,问题在哪里呢?
tbuy (1,everylotsstrong1,mkt,0,0,myaccount,’ru00’);
tbuyshort(1,everylotsweak1, mkt,0,0,myaccount,’al00’);
everylotsstrong1:=intpart(mycash/(s1price*mul[s1]*bail[s1])); //强品种下单手数
everylotsweak1: =intpart(mycash/(w1price*mul[w1]*bail[w1])); //弱品种下单手数
drawnumber(1,low-10,everylotsstrong1,7);
drawnumber(1,low-20,everylotsweak1,7);
tbuy (tbuyholdingex(myaccount,vari[s1],1)=0,everylotsstrong1,mkt,0,0,myaccount,vari[s1]); //对强品种下单
tbuyshort(tsellholdingex(myaccount,vari[w1],1)=0,everylotsweak1, mkt,0,0,myaccount,vari[w1]); //对弱品种下单
在图标上 明明显示是 2手和4手,可模拟交易时却只成交1手和2手
用debugfileout输出仓位变量看看