ss:=2;//交易手数为2手
if 平多条件 and holding>0 then begin
sell(1,0,market);
if numprofit(1)>=0 then ss:=2;
if numprofit(1)<0 then ss:=1;
end
if 平空条件 and holding<0 then begin
sellshort(1,0,market);
if numprofit(1)>=0 then ss:=2;
if numprofit(1)<0 then ss:=1;
end
variable:ss=2;//交易手数为2手
if 平多条件 and holding>0 then begin
sell(1,0,market);
if numprofit(1)>=0 then ss:=2;
if numprofit(1)<0 then ss:=1;
end
if 平空条件 and holding<0 then begin
sellshort(1,0,market);
if numprofit(1)>=0 then ss:=2;
if numprofit(1)<0 then ss:=1;
end
判断盈利之后,SS也跟着变了
SS要用全局变量,我前面重新定义了
需要把SS加入到SELL和SELLSHORT的语句里面去吗?