Angelo, You can, for example, if you want to enter two trades on the same bar just sum to size of each system on that bar, and buyprice would be the weighted average of the buyprice of the two systems for that bar ie size[i] = size1[i] + size2[i]; Buyprice[i] = (size1[i] * Buyprice1[i] + size2[i] * Buyprice2[i])/size[i]; I have uploaded a simple example showing you how a simple two system multiplexer can be written.
http://www.amibroker.com/library/detail.php?id=1227 It is not based on your requirements, but nevertheless illustrate how you can pair up sell to their respective buy. It allows only 1 trades per symbol at any one time, same as the default in AB. But you can basically program any rules you want, such as yours. It would however involves sigscalein and sigscaleout as though. But once you understand loop programming, then it shouldnt be a huge problem, just a nice challenge. PS. You cant use applystop in designing your system, you have to write stops into the loops directly. You will notice that I havent use CBT in this example at all. Paul. --- In [email protected], "ang_60" <ima_c...@...> wrote: > > --- In [email protected], "Paul Ho" <paul.tsho@> wrote: > > > > my suggestion does not require any cbt it invlves writing a functions using > > afl loops. so if know how to write for loops then u can create this solution > > > > > > > > Hi Paul, > > I'm always for as simple as possible solutions, but I strongly doubt > this can be currently done without the use of the CBT. > > Just one reason: if all systems give a signal on the same bar/day, I'd expect > the backtesting to trade them all (given there's enough funds and according > to the posizion sizing rules) and not to use "PositionScore". That - I guess > - is the better proxy of what would have happened in real time. > > As far as I know (please correct me if I'm wrong), standard AFL only allows > for one entry trade for every bar. >
