input:n(11,1,20,1);
input:m(35,5,120,5);
longcond:=ref(close,1)-ref(close,n)>=m*mindiff;
longprice:=open;
shortcond:=ref(close,n)-ref(close,1)>=m*mindiff;
shortprice:=open;
if holding=0 then begin
if longcond then
buy(1,1,limitr,longprice);
end
if holding=0 then begin
if shortcond then
buyshort(1,1,limitr,shortprice);
end
if holding>0 then begin
if time=closetime(0) then
sell(1,holding,limitr,close);
end
if holding<0 then begin
if time=closetime(0) then
sellshort(1,holding,limitr,close);
end
收益:asset,noaxis,colormagenta;
次数:totaltrade,linethick0;
胜率:percentwin,linethick0;
连亏:maxseqloss,linethick0;
连赢:maxseqwin,linethick0;