
runmode:0;
input:n(20,5,100,5);
a:=close-ref(close,n);
mi:=sma(a,n,1);
longcond:=cross(a,mi);
shortcond:=cross(mi,a);
if holding=0 then begin
if longcond then
buy(1,1,limitr,close);
end
if holding=0 then begin
if shortcond then
buyshort(1,1,limitr,close);
end
if holding>0 then begin
if shortcond then begin
sell(1,holding,limitr,close);
buyshort(1,1,limitr,close);
end
end
if holding<0 then begin
if longcond then begin
sellshort(1,holding,limitr,close);
buy(1,1,limitr,close);
end
end
盈亏:asset,noaxis,colormagenta;
次数:totaltrade,linethick0;
胜率:percentwin,linethick0;
连亏:maxseqloss,linethick0;
连赢:maxseqwin,linethick0;
[此贴子已经被作者于2011-10-3 11:22:48编辑过]