variable:n=0;
ma60:ma(c,60);
if holding=0 and cross(ma60,c) and n=0 then begin
buyshort(1,1,limitr,close);
n:=1;
end
if holding=0 and cross(c,ma60) and n=0 then begin
buy(1,1,limitr,close);
n:=1;
end
if cross(c,ma60) then sellshort(1,0,limitr,close);
if cross(ma60,c) then sell(1,0,limitr,lcose);
if holding=0 and cross(c,ma60) and n=1 and exitbars>20 then buy(1,1,limitr,close);
if holding=0 and cross(ma60,c) and n=1 and exitbars>20 then buyshort(1,1,limitr,close);