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

[amibroker] Re: Backtest: specifying position size in terms of compounded capital c,ount



PureBytes Links

Trading Reference Links

Thanks Graham, I see it now.
The -1 on the numerator signifies the equity risk percentage.

Paul


--- In amibroker@xxxxxxxxxxxxxxx, Graham <kavemanperth@xxx> wrote:
>
> PositionSize = Max( -1/ShareRisk*BuyPrice, -10 );
> 
> example
> Buyprice = 20.00
> Sharerisk = 1.00 (5%)
> Equity Risk = 1%
> 
> PositionSize = Max( -1*20.00/1.00, -10) = Max( -20,-10 ) = -10; ie 10%
> equity size, because it exceeds your 10% limit
> 
> example
> Buyprice = 20.00
> Sharerisk = 4.00 (20%)
> Equity Risk = 1%
> 
> PositionSize = Max( -1*20.00/4.00, -10) = Max( -5,-10 ) = -5; ie 5%
equity
> size
> 
> 
> The larger the stop amount, the smaller the trade size
> 
> 
> 
> 
> -- 
> Cheers
> Graham
> AB-Write >< Professional AFL Writing Service
> Yes, I write AFL code to your requirements
> http://www.aflwriting.com
> 
> 
> 
> On 06/05/07, Paul Ho <paultsho@xxx> wrote:
> >
> >  Its probably easlier to use setpositionsize(), look up the help file
> >
> >  ------------------------------
> > *From:* amibroker@xxxxxxxxxxxxxxx
[mailto:amibroker@xxxxxxxxxxxxxxx] *On
> > Behalf Of *polomorabe
> > *Sent:* Sunday, 6 May 2007 7:18 PM
> > *To:* amibroker@xxxxxxxxxxxxxxx
> > *Subject:* [amibroker] Re: Backtest: specifying position size in
terms of
> > compounded capital c,ount
> >
> >  Thanks for the reply Graham.
> >
> > However, it doesn't work.
> >
> > For example, if the risk per share is 0.01, and the price is 1.46 (as
> > it was recently for IVAN), then your formula gives
> > MAX( -146, -10 )
> > which I don't suppose is what you mean.
> >
> > I'm trying to do something like this. Position size is calculated such
> > that the position risk is either 1% of capital, or 10% of capital. But
> > during the backtest, this formula uses the initial capital, not the
> > current capital.
> >
> > ShareRisk = BuyPrice - Ref(L,-1);
> > PositionRisk = 0.01 * Capital;
> > PositionSize = Min( ( PositionRisk/ShareRisk ) * BuyPrice,
> > Capital * 0.1 );
> >
> > Any ideas?
> > Paul
> >
> > --- In amibroker@xxxxxxxxxxxxxxx <amibroker%40yahoogroups.com>, Graham
> > <kavemanperth@> wrote:
> > >
> > > Try this
> > >
> > > PositionSize = Max( -1/ShareRisk*BuyPrice, -10 );
> > >
> > > --
> > > Cheers
> > > Graham
> > > AB-Write >< Professional AFL Writing Service
> > > Yes, I write AFL code to your requirements
> > > http://www.aflwriting.com
> > >
> > >
> > > On 06/05/07, polomorabe <paul.moore@> wrote:
> > > > Hello,
> > > >
> > > > I noticed in the User Manual that using a negative value for
> > > > PositionSize specifies the percentage of current capital per
trade.
> > > > How can I combine this with defining the maximum risk per trade?
> > > >
> > > > For example, the following specifies the position size as the
> > minimum of:
> > > > - the value of 1% of the initial capital
> > > > - the share risk of 0.1% of the initial capital.
> > > > How can it be specified as a percentage of the compounded capital
> > amount?
> > > >
> > > > Many thanks,
> > > > Paul
> > > >
> > > > // Setup portfolio
> > > > Capital = 100000;
> > > > SetOption("InitialEquity", Capital );
> > > > SetOption( "MaxOpenPositions", 10 );
> > > > SetOption( "CommissionMode", 3 );
> > > > SetOption( "CommissionAmount", 0.01 );
> > > > ShareRisk = BuyPrice - Ref(L,-1);
> > > > PositionRisk = 0.01 * Capital;
> > > > PositionSize = Min(( PositionRisk/ShareRisk ) * BuyPrice, Capital
> > * 0.1);
> > > >
> > > >
> > >
> >
> > 
> >
>




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/