runmode:0;
input:length(20,1,100,1);
input:numatrs(1);
entertime:=time>=093500 and time<=145500;
exittime:=time>=150000;
tprice:=(high+low+close)/3;
avgvalue:=ma(tprice,length);
shiftvalue:=numatrs*ma(tr,length);
upperband:=avgvalue+shiftvalue;
lowerband:=avgvalue-shiftvalue;
longcond:=entertime and high>=trimprice(ref(upperband,1));
longprice:=max(trimprice(ref(upperband,1)),open);
shortcond:=entertime and low<=trimprice(ref(lowerband,1));
shortprice:=min(trimprice(ref(lowerband,1)),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 exittime then
sell(1,holding,limitr,close);
end
if holding<0 then begin
if exittime then
sellshort(1,holding,limitr,close);
end
收益:(asset-500000)/500000,noaxis,colormagenta;
次数:totaltrade,linethick0;
胜率:percentwin,linethick0;
连亏:maxseqloss,linethick0;
连赢:maxseqwin,linethick0;
牛,怎么不加个止损进去