VARIABLE:n=0,m=0;
ma15:ma(c,15);
hh:hhv(h,enterbars+1);
if c>ma15+5 then buy(holding=0,1,market);
if h-enterprice>=3 and h-enterprice<=10 then n:=1;
if l-enterprice<=3 and n=1 then begin
sell(holding>0,holding,market);
n:=0;
end
if h-enterprice>10 then m:=1;
if l-enterprice<=0.7*(hh-enterprice) and m=1 then begin
sell(holding>0,holding,market);
m:=0;
end
if enterprice-l>=15 then sell(holding>0,holding,market);