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

Re: [amibroker] Closed Equity ATC



PureBytes Links

Trading Reference Links

Hello,

You need to use mid-level CBT (ProcessSignals()) instead of high-level and generate
closed equity for each bar. Also if you are using old version of AmiBroker (pre 4.80)
you need either to remove atcFlagDefaults or upgrade.

See this:
http://www.amibroker.com/kb/2006/03/11/how-to-create-copy-of-portfolio-equity/

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "Glenn" <glennokb@xxxxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Monday, June 26, 2006 5:35 AM
Subject: [amibroker] Closed Equity ATC


> Hi,
> 
> Can anyone pick what the problem is here please?
> 
> The following code calculates the closed equity curve but the 
> addtocomposite is not happening! :)
> 
> Thanks.
> 
> if( Status("action" == actionPortfolio )
> {
>  bo = GetBacktesterObject();
>  bo.Backtest();
>  ClosedEquity = bo.Equity;
>    for( pos = bo.GetFirstOpenPos(); pos; pos = bo.GetNextOpenPos())
>      {
>      ClosedEquity = ClosedEquity - pos.GetProfit();
>      }
> AddToComposite(ClosedEquity,"~ClosedEquity","X",atcFlagEnableInPortfolio|
> atcFlagDefaults);
> }
> 
> 
> 
> 
> 
> 
> 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 other support material please check also:
> http://www.amibroker.com/support.html
> 
> 
> Yahoo! Groups Links
> 
> 
> 
> 
> 
> 
> 
>