Hi everyone.
I came up with this relatively simple strategy that gives nice results on EUR/USD and DAX on a 1 hour and 30 min timeframes.
The idea behind is the following:
I define the quantity of averagerange that represent the average of the last 3 days high/low range on price.
Walk forward results are attached
Best
Francesco
// Definition of code parameters
DEFPARAM CumulateOrders = False // Cumulating positions deactivated
period = 72 //1hr time frame -> 3 days average
///optimized parameters
a= 9 //exit after a bars
l=0.9//factor that defines break conditions
b=1.9//dynamic profit factor multiplier
///definition of pricerange -> average of the daily high/low range
notmonday = opendayofweek = 2 or opendayofweek = 3 or opendayofweek = 4 or opendayofweek = 5
if notmonday then
dailypricerange = Dhigh(1) - Dlow(1)
endif
if opendayofweek = 1 then
dailypricerange = Dhigh(2)-Dlow(2)
endif
averagerange = average[period](dailypricerange)
////////
atr= AverageTrueRange[1](close)
pr = averagerange*b //profit factor proportional to averagerange
///trading conditions
downsidevolbreak = (atr >= l*averagerange) and close<open
upsidevolbreak= (atr >= l*averagerange) and close >=open
IF downsidevolbreak THEN
sellshort 1 PERPOINT AT MARKET
ENDIF
IF upsidevolbreak THEN
buy 1 PERPOINT AT MARKET
ENDIF
///exit conditions
set target pprofit pr
if longonmarket and barindex-tradeindex >=a then
sell at market
endif
if shortonmarket and barindex-tradeindex >= a then
exitshort at market
endif