What is wrong with this code

#1
I am trying to code a simple breakout strategy in afl and this is my code

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 );
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.
 

Similar threads