Markus - I don't think that you, and maybe Mike, are seeing what I'm trying to point out. I referred you to SetPositionSize() help because it details the encoding of shares in PosSize in the signal object in the CBT. Specically that is (-2000-shares).
When you traverse the signal objects in the CBT, you can do your own calculation of shares from cash or whatever, and replace the sig.PosSize value before calling the mid or low level routines to process trades. Stated simply, you can set the number of shares yourself directly in the CBT from your own calculation. If that is what you're after, give me a short time and I'll whip up an example if you don't see this. -- Bruce --- In [email protected], Markus Witzler <funny...@...> wrote: > > Hello Bruce, > > the reason I must use CBT is that I can´t use Setpositionsize > (...spsshares), since I need to compute adequate number of shares by > referring to actual cash position. > > "spsShares" doesn´t allow - according to cust. support- for calling current > cash or equity position to compute "spsshares". Thus the need for using CBT. > > Normally, everyone seems to compute sig.possize (and implied number of shares > is a result thereof). I want to compute shares and the position size (in > money terms) should be the implied result - thus the other way around. > > The reason for this is that i want to follow along a coding excercise I was > given. And I´m not sure that -if I only specify sig.possize and not sharesize > (i.e. trade.shares)- that AB may screw up (i.e. round up or down in some > cases) when I don´t realize that. > > Take for instance into account that AB ALWAYS rounds DOWN if fraction of > shares occur. > > I, myself, want to have control if rounding occurs or not and HOw it occurs > (up or down). That could sometimes mean I´m rounding up when AB would round > down. > > This is not because I´m particularly picky since this issue influences the > outcome of the backtest only slightly. It´s only that I want to accurately > reproduce the results of the excercise I was given. > > In actual trading, there shouldn´t be any problem determining sig.possize in > signal list and leave it up to AB to (maybe) rounding up or down potential > fractional shares. > > If you have any clue that might help, please fell free to step in. > > Thanks for your contribution > > Markus > ________________________________________________________________ > Neu: WEB.DE Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate > für nur 19,99 Euro/mtl.!* http://produkte.web.de/go/02/ >
