if00用单引号不是双引号
老大,我都保存好几次了。
这是我完整的代码
if refcykg=1 and refc>pp and h>highestaftercross then
begin
// myenterprice:=max(highestaftercross,o);
myenterprice:=callstock("if00",vtclose);
if holding<0 then
begin
sellshort(1,holdingvol,limitr,myenterprice+hd*mindiff),ignorecheckprice,orderqueue;
holdingvol:=0;
buy(1,firstvol,limitr,myenterprice+hd*mindiff),ignorecheckprice,orderqueue;
holdingvol:=holdingvol+firstvol;
lastprice:=enterprice,noaxis;
end
end
上面代码不对。
是这个
if refcykg=1 and refc>pp and h>highestaftercross then
begin
// myenterprice:=max(highestaftercross,o);
myenterprice:=callstock('if00',vtclose);
if holding<0 then
begin
sellshort(1,holdingvol,limitr,myenterprice+hd*mindiff),ignorecheckprice,orderqueue;
holdingvol:=0;
buy(1,firstvol,limitr,myenterprice+hd*mindiff),ignorecheckprice,orderqueue;
holdingvol:=holdingvol+firstvol;
lastprice:=enterprice,noaxis;
end
end
myenterprice:=callstock('if00',vtclose);
你直接写这句,不要加前面那些前置的判断。看看有没数据
如果有数据,那么说明你的判断条件没满足所才导致的你上面代码里面的myenterrpcie没有数据
嘿嘿,是我没有把代码全部改过来,现在正常了。
再问一个问题,市价指令MARKET一定要等到下周期开盘吗?有没有本周期内的市价指令?意思就是说按信号出现时的市价去下单.