[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: Using CBI the first time



PureBytes Links

Trading Reference Links

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 amibroker@xxxxxxxxxxxxxxx, Markus Witzler <funnybiz@xxx> 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/
>




------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/