Re: [amibroker] Re: position size based on all symbols

 

Actually, this is a little bit more complicated than that,

You need to take into account also the max open position limit and the number of exit signals for opened positions.



On 5/10/2016 9:48 PM, Aron Pipa aron@myafl.com [amibroker] wrote:
 

SetCustomBacktestProc( "" );

 

if( Status( "action" ) == actionPortfolio )

{

    bo = GetBacktesterObject();     //  Get backtester object

    bo.PreProcess();           //  Do pre-processing (always required)

 

    for( i = 0; i < BarCount; i++ )     //  Loop through all bars

    {

        n = bo.GetSignalQty( i , 1 );

 

        for( sig = bo.GetFirstSignal( i ); sig; sig = bo.GetNextSignal( i ) )

        {

            sig.PosSize = - 100 / n ;

        }

 

        bo.ProcessTradeSignals( i ); //  Process trades at bar (always required)

    }

 

    bo.PostProcess();         //  Do post-processing (always required)

}

 

 

From: pinaki_m77@yahoo.com [amibroker]
Sent: Tuesday, May 10, 2016 8:10 PM
To: amibroker@yahoogroups.com
Subject: [amibroker] Re: position size based on all symbols

 

 

My question was how do I find the value of this N.

 

__._,_.___

Posted by: Aron Pipa <aron@myafl.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (7)
**** 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/


.

__,_._,___

Related Posts


EmoticonEmoticon

:)
:(
=(
^_^
:D
=D
=)D
|o|
@@,
;)
:-bd
:-d
:p
:ng
:lv