if holding>0 and isdown then buy(1,1,limitr,close);
if holding<0 and isup then buyshort(1,1,limitr,close);
if 平多开空 then begin
sell(1,0,market);
开空语句;
end
if 平空开多 then begin
sellshort(1,0,market);
开多语句;
end
是的 if 里面不能有cross。比如:if cross(a,b) 这样的是可以的
但是
if cross(c,d) then begin
if cross(a,b) then cc:=ss;
end
这里面的第二个cross:cross(a,b) 则是不可以的,
所以对应的办法是写在外面,比如:
cond:=cross(a,b);
if cross(c,d) then begin
if cond then cc:=ss;
end
这样就可以了