Code: Select all
[IntrabarOrderGeneration = TRUE]
inputs: thetimea(180530),thetimeb(180540),rangevalue(6),profit(150),stoploss(250);
if time_s>thetimea and time_s<thetimeb then buy next bar at H[1]+rangevalue stop ;
if time_s>thetimea and time_s<thetimeb then sellshort next bar at L[1]-rangevalue stop;
if marketposition =-1 then
setprofittarget(profit);
setstoploss(stoploss);
if marketposition =1 then
setprofittarget(profit);
setstoploss(stoploss);