I am trying to code a simple breakout strategy in afl and this is my code
my logic is
if current close > highest close before 2 days buy and sell if current close < highest close before 2 days.
when backtesting (10 years data) this code nothing happens, no results. i dont know where i made a mistake.
x=optimize( "Periods", 2, 1, 25, 1 );
hh=HHV(C,x);
Buy = (Close>hh );
Sell = Close<hh;
buy = ExRem( buy, sell );
sell = ExRem( sell, buy );
hh=HHV(C,x);
Buy = (Close>hh );
Sell = Close<hh;
buy = ExRem( buy, sell );
sell = ExRem( sell, buy );
if current close > highest close before 2 days buy and sell if current close < highest close before 2 days.
when backtesting (10 years data) this code nothing happens, no results. i dont know where i made a mistake.