At least you now realise it is not impossible to do it without CBT. Once you 
start thinking and working on your own solution, you will find that things like 
incorrect number of trades can also be fixed. I hope you will also realise that 
the solution lies within the user, and and not necessarily with Tomasz.

I believe this is also Tomasz's point.
 

 . --- In [email protected], "ang_60" <ima_c...@...> wrote:
>
> --- In [email protected], "Paul Ho" <paul.tsho@> wrote:
> >
> > 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.
> 
> 
> 
> Many thanks Paul, 
> you are very generous and your code indeed matches Buy and Sell as needed.
> Also, your suggestion above regarding multiple trades on the same bar does 
> allow to calculate the total P&L of the test, but the total number of trades 
> (and all statistics calculated on them) will be wrong.
> 
> But nevertheless, your code is a very nice departure after all this chatting.
> 
> Greetings,
> 
> Angelo.
>


Reply via email to