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

[amibroker] Re: Portfolio trading



PureBytes Links

Trading Reference Links

Terry,

Thanks for continuing to help me find my way through this. I did use 
a watchlist.

I think I have found the problem and why checking "allow position 
size shrinking" fixes it. Here is my "guess":

Assume 2 positions, 50% in each . When buy #1 is made, the program 
calculates the number of shares and then multiples shares times 
todays price. This number sometimes multiplies out to be slightly 
greater than 50% of the equity (by pennies). Then when it tries to 
buy #2, there is not enough equity (there is less than the 50%) so 
it skips the second buy. This is why checking "allow position 
sizing" allows you to buy #2.

It all has to do with rounding error.

I have checked my detailed log on the trades and the numbers seem to 
confirm the above speculation. When the Shares times Price for buy 
#1 is slightly less than 50% of the total equity, then Buy #2 
occurs. When the Shares times Price for buy #1 are slightly greater 
than 50% of the total equity, then buy #2 doesn't occur. That's 
why "allow position size shrinking" fixes the problem. It allows buy 
#2 to occur at slightly less than 50% of the total equity.

This should be fixable in code by allowing some band of error for 
the last buy in a series of buys. Or by allowing the mistake to be 
in the number of shares (out there beyond the decimal point), not in 
the equity used to buy those shares.

I have sent my speculations on to Marcin and am awaiting his reply.

Thanks,

Bill

--- In amibroker@xxxxxxxxxxxxxxx, "Terry" <MagicTH@xxxx> wrote:
>
> One more thought...you either must select "all symbols" or use a
> Watchlist containing the symbols you want to trade.
> 
> --
> Terry
> 
> -----Original Message-----
> From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] 
On
> Behalf Of emp62
> Sent: Wednesday, February 01, 2006 02:05
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: Re: [amibroker] Portfolio trading
> 
> assuming you have your settings right like Terry explains in some 
cases
> it 
> will not take all positions you expect it will. For instance if the
> amount 
> of $$ you allocate to 1 stock is less than (min. Shares setting) x
> (Share 
> Price). In this case it will not take a position in that stock and 
it
> will 
> skip all other positions it had to take on that day if they are 
lower in
> 
> rank to this position. So if GOOG is on the top of the rank and you
> expect 
> your system to enter 10 stocks then you might have a problem if 
Min.
> Shares 
> is set to e.g. 200,
> 
> Ed
> 
> 
> 
> ----- Original Message ----- 
> From: "billbarack" <wbarack@xxxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Tuesday, January 31, 2006 10:58 PM
> Subject: [amibroker] Portfolio trading
> 
> 
> >I am looking at the details of a simple portfolio trading system 
that
> > has posqty = 2. At times, when a buy is signaled, it only buys 
one
> > fund and leaves the second position is cash. My Positions score 
os ROC
> > (Close,15).
> >
> > Any thoughts as to what may be happening? Why doesn't it buy the
> > second position?
> >
> > Bill
> >
> >
> >
> >
> >
> >
> > 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 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 other support material please check also:
> http://www.amibroker.com/support.html
> 
>  
> Yahoo! Groups Links
>






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

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 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/

<*> 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/