Hello Angelo,

 sorry I missed your reply to my post.
My system is a bit different from what you're trying to do, basiccally what I 
wanted was to scale into positions. 
The system I used with "backtestRegularRawMulti" had entry conditions at fixed 
price intervals(same as sigscalein) the only difference is that if I had a buy 
order and a sell order in the same bar, with sigscalein the sell was allways 
executed first, which was not what I wanted.
For example: I had entries at 0.5 intervals.
Buy at 10; 10.5; 11; 11.5 and exit at 12 for example. If one bar opens at 10.6 
and closes at 12.4 I want to enter at 11, 11.5 and exit at 12, but with 
sigscalein the sell is allways executed first.
Of course, for this I have to calculate average entry price  depending on the 
number of "entries" happening in one bar.
 
Nevertheless I tried running your code with backtestRegularRawMulti mode and 
there are two trades at the same bar.

hope this helps

--- In [email protected], "ang_60" <ima_c...@...> wrote:
>
> 
> 
> 
> 
> --- In [email protected], "Pmxgs" <pmxgs@> wrote:
> >
> > Hello,
> > 
> > I also had the same issue and I found that if you choose 
> > SetBacktestMode( backtestRegularRawMulti ) AB allows you to do what you 
> > want, without using Custom backtester.
> > By doing this, as the previous user said "you can never be sure of the 
> > order of the trades", but if you are willing to accept this assumption 
> > it'll do what you want.
> > 
> 
> 
> Hello pmxgs,
> 
> I tried your suggestion on the type of system commented here (that is, acting 
> on the breakout of the previous bar's range), around this code(these are just 
> trials, so I don't care about the chronological order of the trades):
> 
> "
> SetBacktestMode(backtestRegularRawMulti);
> Buy = Cover= H > Ref(H, -1);
> Sell= Short = L < Ref(L, -1);
> BuyPrice=CoverPrice = Max(O, Ref(H, -1));
> SellPrice = ShortPrice = Min (O, Ref(L, -1));
> "
> 
> but I still get just 1 trade per bar.
> 
> Are you using some other settings?
> 
> If it is not too much pain, could you give just a rough example of an AFL 
> code taking 2 trades per bar?
> 
> Greetings,
> 
> Angelo.
>


Reply via email to