//Mini reversal
DEFPARAM CumulateOrders = True //
DEFPARAM Preloadbars = 1000
DEFPARAM Flatbefore = 080000
DEFPARAM Flatafter = 210000
DaysForbiddenEntry = OpenDayOfWeek = 5 OR OpenDayOfWeek = 0
x = 4// bar height
// Conditions to enter Long positions
c1 = Close[0] > Close[1] + (Open[1] - Close[1]) * 0.9
c2 = Close[0] < Open[2] - (Open[2] - Close[2]) * 0.9
c3 = (Open[3] - Close[3]) > x
c4 = (Open[2] - Close[2]) > x
c5 = (Open[1] - Close[1]) > x
c6 = Close[0] > Open[0]
Once Downstop = 1
Once Uptarget = 1
If c1 and c2 and c3 and c4 and c5 and c6 and not DaysForbiddenEntry then
BUY 10 lots at Market
Uptarget = abs(Open[1] - Close[0])
Downstop = Lowest[2](low) - 1
Set Target pProfit Uptarget
Endif
if onmarket then
Sell at Downstop stop
endif