ref(close,enterbars+2)
那就用全局变量去记录
你开仓几次就设几个全局变量
若是开仓2次
variable:a=0,b=0;
if 开1仓条件 then begin
buy()
a:=ref(close,1);
end
if 开2条件 then begin
buy()
b:=ref(close,1);
end
if 平1条件 then begin
sell()
a:=0;
end
if 平2条件 then begin
sell()
b:=0;
end