后台策略代码如下:
if tholding=0 then
begin
if buycond then
begin
tbuy(1,firstvol,mkt,0,0,'','if00'),ignorecheckprice;
cc:=cc+firstvol;
end
.....
end
else
beging
.....
end
为什么后台执行时一直在买开仓?这个程序在图表上运行一点问题都没有,除了把HOLDING变成THOLDING,BUY变成TBUY,其它一点没变。为什么在后台运行就错了呢?(我已经仔细看了日志,日志上记录就是不停的执行上面的语句)
贴下单日志,
我的策略就是监控指数,然后对主力合约下单的。
那应该怎么办?
buycc:=tbuyholdingex('','if00',1);
sellcc:=tsellholdingex('','if00',1);
if buycc=0 and sellcc=0 then
begin
if buycont then
begin
tbuy(1,firstvol,mkt,0,0,'','if00'),ignorecheckprice;
lastprice:=tenterprice,noaxis;
cc:=cc+firstvol;
end
....
end
我如果按上面写法指定商品为'if00‘,能不能达到监控指数,在主力合约上下单?
还一个问题。
在后台交易中,如果有多个策略同时对同一个商品监控,那么帐户里的持仓数量、开仓价格等等会不会互相影响?