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

[amibroker] Re: Help: sum of position sizing per ticker


  • Date: Sun, 13 Dec 2009 20:32:18 -0000
  • From: "Fadut" <filipeadutra@xxxxxxxxx>
  • Subject: [amibroker] Re: Help: sum of position sizing per ticker

PureBytes Links

Trading Reference Links

Hi, TJ

You suggestion is being very useful for me since I can limit positions per security, reducing risk. Very interesting because the code can be adapted for percentage or value. I only change a bit putting status inside barssince ( BarsSince( Sell0F OR Status("firstbarintest"))).

Thank a lot for the help.

Filipe
=========================

--- In amibroker@xxxxxxxxxxxxxxx, Tomasz Janeczko <groups@xxx> wrote:
>
> Hello,
> 
> BarsSinceSell = BarsSince( Sell ) OR Status("firstbarintest" );
> NumberOfBuys = Sum( Buy, BarsSinceSell );
> 
> Buy = Buy AND NumberOfBuys <= 4; // prevent more than 4 buys
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com
> 
> 
> On 2009-12-13 02:19, Fadut wrote:
> > Hi, fellows. I have researched the list and checked the manual but I couldn't find the answer for this issue.  So, I ask help with position sizing.
> >
> > I am back-testing some strategies. In the formula I use backtestRegularRawMulti, which allow some buy signals before a sell signal. I use PositionSize function that defines an amount of portfolio equity per trade. However, I would like to limit the sum of position value PER security and didn't discover how to do it.
> >
> > For instance: I could have PositionSize = 2%, of portfolio equity for each trade, and in some way a limit of "Sum PositionSize PerTicker" = 8%, of portfolio equity . In this way, the system will allow at most 4 trades per ticker before next sell signal.
> >
> > How to implement this limit in AFL language?
> >
> > Thanks a lot
> >
> > Filipe
> >
> >
> >
> > ------------------------------------
> >
> > **** IMPORTANT PLEASE READ ****
> > This group is for the discussion between users only.
> > This is *NOT* technical support channel.
> >
> > TO GET TECHNICAL SUPPORT send an e-mail directly to
> > SUPPORT {at} amibroker.com
> >
> > TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
> > http://www.amibroker.com/feedback/
> > (submissions sent via other channels won't be considered)
> >
> > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> > http://www.amibroker.com/devlog/
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
>




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

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

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

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:
    amibroker-digest@xxxxxxxxxxxxxxx 
    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/