By default, the AmiBroker backtester will only allow you to hold one open position per symbol. If you want to allow multiple open positions, then you can use SetBacktestMode( backtestRegularRawMulti ); See reference: http://www.amibroker.com/guide/afl/afl_view.php?id=350
--- In [email protected], "zanhero" <[EMAIL PROTECTED]> wrote: > > I've been trying the whole day to write a code in afl, with no succes... > here is the code I wrote: > > Cond1 = DayOfWeek () == 1 ; > Cond2 = DayOfWeek () == 2 ; > Cond3 = DayOfWeek () == 3 ; > Cond4 = DayOfWeek () == 4 ; > Cond5 = DayOfWeek () == 5 ; > Cond777 = Cond1 OR Cond2 OR Cond3 OR Cond4 OR Cond5; > SetOption("MaxOpenPositions", 5 ); > > //buy > Buy = Ref ( Close , -1 ) > Ref ( Open , -1) > AND Cond777; > Sell = DayOfWeek() == 5; > > //short > Short = Ref ( Close , -1 ) < Ref ( Open , -1) > AND Cond777; > Cover = DayOfWeek() == 5; > > > I cannot get more then one open positions, i don't know why, and every > way i've been trying to write my ideas in afl, i get bizzare results. > my system is really simple: buy if the previous bar was up, short if > the previous bar was down, sell/cover at the Friday's close. > Can anyone help me? >
