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

Re: [amibroker] CBT: Force full investment



PureBytes Links

Trading Reference Links

In advanced backtest code you exit the trades, update the values, then
enter signals with amended posSize

-- 
Cheers
Graham Kav
AFL Writing Service
http://www.aflwriting.com


On 01/02/2008, vlanschot <vlanschot@xxxxxxxxx> wrote:
> Perhaps somebody has a straightforward way to solve the following, or
> point out the error in my interpretation of AFL/CBT:
>
> My system keeps a constant number of 50 positions, based on a ranking
> (although I do not use rotational trading.) At the start the
> positions are equally weighted, i.e. PositionSize is defined as 2%.
> As time moves on, some do very well, and reach, say, a weight of 3%
> of equity. When the exit signal arrives, these positions are replaced
> by new ones, but now back to the 2% of equity as defined in
> PositionSize.
>
> The resulting problem is that at times I find I have too much cash
> left. Now, I know that I can rebalance open positions (by scaling
> in/out, for example via TJ's code
> http://www.amibroker.com/kb/2006/03/06/re-balancing-open-positions/).
> However, apart from the extra costs involved, I have found that there
> is no way to determine/access the amount of cash BEFORE
> entering/rebalancing the new positions. In other words, bo.Cash gives
> you the amount of cash "at the end of the bar". You can, of course,
> use the amount of cash of the previous bar, but you keep lagging the
> actual trades.
>
> In short, I would like to force the backtester to always make the
> system fully invested (except for round lots, etc.) It would be
> great, for example, if there would be an option to automatically
> assign the amount of cash which becomes available from the first
> exited trade to the first new trade, etc. In my system this is very
> applicable, as I always have other trades to replace the exited one.
>
> Any thoughts/suggestions welcome. If none, I'll forward this to
> support.
>
> Thx.
>
> PS
>
>
>
> Please note that this group is for discussion between users only.
>
> To get support from AmiBroker please send an e-mail directly to
> SUPPORT {at} amibroker.com
>
> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> http://www.amibroker.com/devlog/
>
> For other support material please check also:
> http://www.amibroker.com/support.html
>
> Yahoo! Groups Links
>
>
>
>


Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

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

For other support material please check also:
http://www.amibroker.com/support.html
 
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/