input : R(0.002),BeginTime(0915),EndTime(1245);
var :TH(0),TL(0),mkp(0),ax(0),ay(0);
if date <> date[1] then begin mkp=0;ax=0;ay=0;end;if time=BeginTime then beginTH=highd(0);TL=lowd(0);end;
if BeginTime < Time and Time < EndTime then begin if MarketPosition = 0 and ax < 2 and high > TH*(1+R) then buy next bar at (highest(h,1)+1) stop; if MarketPosition = 0 and ay < 2 and low < TL*(1-R) then sellshort next bar at lowest(l,1)-1 stop; end;
mkp=marketposition;
if mkp[1] <> 1 and mkp=1 then ax=ax+1;
if mkp[1] <> -1 and mkp=-1 then ay=ay+1;
if marketposition =1 then beginsell next bar at entryprice-50 stop ; if time>1339 then sell next bar on market;end;
if marketposition =-1 then begin buytocover next bar at entryprice+50 stop ; if time>1339 then buytocover next bar market;end;
setexitonclose;
<==以上是改完後的結果喔!XD