Input: f1(0.007),f2(0.016);
Vars: WHL(0),WH(0),WL(0);
WHL= (highw(0)+loww(0))* 0.5;
WH= WHL*(1+f1);
WL= WHL*(1-f2);
if time>=0900 and time<1300 and="" begin="" date="" entriestoday="" span="" then="">
If marketposition<= 1 and close cross over WH then
buy next bar at market;1300>
If marketposition>= -1 and close cross under WL then
sellshort next bar at market;
end;
if marketposition>0 then sell next bar at entryprice*(1-0.02) stop;
if marketposition<0 at="" bar="" buytocover="" entryprice="" next="" span="" stop="" then="">
if marketposition<>0 and _IsSettlementDay then begin
setexitonclose;
end;0>
留言