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

Reply via email to