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

RE: [amibroker] Re: Position size based on equity



PureBytes Links

Trading Reference Links

Ok, thank you Tomasz.

I knew about using a negative value for position size but I wanted to vary
that number as the portfolio grows.  It doesn't make sense for my test to
use use 10% of equity at $100,000 and still use 10% at $500,000.

I understand that this is not yet possible but is there another way to
reduce the position size or increase the number of positions as porfolio
equity grows ?

Thanks,

HB

-----Original Message-----
From: Tomasz Janeczko [mailto:amibroker@xxxxxx] 
Sent: Thursday, January 13, 2005 17:08
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] Re: Position size based on equity



Hello,

Quick answer to:
>> How do I set my position size (positionsize) based on current
>> portfoliio equity ?
is: USE negative position size to refer to percentage of current equity.


As to:
> On any bar, isn't Equity() equal to the current portfolio equity ?  

Of course it is not current portfolio equity.

Equity() gives single-security equity value and it was there
BEFORE portfolio-level backtester was implemented and works exactly
as it was working in pre-4.50 versions (backward compatibility)

Portfolio-level equity is stored in ~~~EQUITY artificial ticker
in "Close" price field.

PortfolioEquity = Foreign("~~~EQUITY", "C"); 

To perform portfolio-level backtest AmiBroker first
scans all symbols for signals (when your formula is executed
for each symbol) (stage 1 )and after that it performs portfolio-level
backtest which produces ~~~EQUITY (i.e. portfolio level equity) (stage 2).
So portfolio-level equity is available AFTER backtest.

Currently there is only one way to use "current portfolio equity"
to do position sizing from your formula, i.e. using negative position size
that refer to PERCENTAGE of current portfolio 
equity.

PositionSize = -25; // use 25% of CURRENT PORTFOLIO EQUITY

This is possible because of the fact that AmiBroker interprets
negative position sizes at stage 2 of the backtest when it knows
what portfolio equity is.

Future versions of AmiBroker will provide control over stage 2
but right now I do not provide any further details.

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "hmab1" <hbahlool@xxxxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Thursday, January 13, 2005 9:40 PM
Subject: [amibroker] Re: Position size based on equity


> 
> 
> 
> On any bar, isn't Equity() equal to the current portfolio equity ?  
> If not, then that would explain everything.
> 
> Otherwise, after another day of trying to figure this out, I'm still 
> stumped !
> 
> HB
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "hmab1" <hbahlool@xxxx> wrote:
>> 
>> Hello,
>> 
>> How do I set my position size (positionsize) based on current 
>> portfoliio equity ?
>> 
>> I've tried the following but it doesn't seem to work. 
>> 
>> PositionSize = IIf(Equity()< x, possize1 ,possize2)
>> 
>> For some reason, it keeps using possize1 even after portfolio 
> equity 
>> goes above x.
>> 
>> Thanks
>> HB
> 
> 
> 
> 
> 
> 
> Check AmiBroker web page at:
> http://www.amibroker.com/
> 
> Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> Yahoo! Groups Links
> 
> 
> 
> 
> 
> 
> 
>



Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links



 





------------------------ Yahoo! Groups Sponsor --------------------~--> 
In low income neighborhoods, 84% do not own computers.
At Network for Good, help bridge the Digital Divide!
http://us.click.yahoo.com/EpW3eD/3MnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.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/