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

[amibroker] Re: Question on Position Size



PureBytes Links

Trading Reference Links

Al,

I have clipped a couple of notes that Tomasz published on this
subject... hope they help.

Phsst

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


The size of the position in the code below is NOT fixed at 2%.
It is neither 2% of your initial equity.

The position size term is:
PositionSize =  -2 * BuyPrice/(2*ATR(10));

It means 2% of CURRENT portfolio equity ****ADJUSTED*** by
BuyPrice/(2*ATR(10))
factor.

Current porftolio equity is available cash + value of all open positions.

Now if your CURRENT portfolio equity is 10000
and BuyPrice (say you have set trade price to OPEN) is 15.00
and last 10 day average true range (ATR) is 4.5 then resulting
position size 
would be:

-2 * 15 / ( 2 * 4.5 ) = -2 * 1.666 = -3.333

That means 3.33% of current equity.

This is what I called that this is 2% ADJUSTED by volatility factor.

If stock had low volatility 10 day ATR would be 1.5 then you would get
-2 * 15 / 1.5 = 
- 20 -> 20% of equity 

The adjustment I mentioned increases the size of position
if volatilty (risk) of stock is low.
-----------------------------------------------
For similar results you may use also:

PositionSize = -2 * BuyPrice / (20*ATR(10) );

(would be then 2.5% of equity for MSFT for that day).

but anyway feel free to experiment :-)
----------------------------------------------

--- In amibroker@xxxxxxxxxxxxxxx, "Al Venosa" <advenosa@xxxx> wrote:
> Hi, all:
> 
> I'm embarrassed to ask this simple question, but it has so far
stumped me. It has to do with the positionsize function. Suppose I'm
using the following positionsize statement with an initial equity of
$100,000:
> 
> PositionSize = -2; //invest 2% of current equity in each trade or $2000
> 
> Now, suppose I wanted to add a term to the right side of the above
equation, such as increasing the position size by adding 5% of profits
to future purchases after making $10,000. I first define net equity,
then define the % of profits to be added:
> 
> E=Equity(1);
> NetE = E-100000; //net profit
> E1=iif(NetE>=10000,0.05*NetE,0);
> 
> What would the new positionsize statement be? Obviously, it would not be
> 
> PositionSize = -2 + E1;
> 
> because algebraically, the right side of the equation is -2 + 500 or
498. I guess what I am asking is, how does Amibroker know that a
negative number actually means a percent of current equity, and how
does one add to that amount if he wants to increase his bet size? 
> 
> Al Venosa
> advenosa@xxxx
> 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.525 / Virus Database: 322 - Release Date: 10/9/2003


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

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