For trading the equity curve, see below. I have not tried this but it is my 
understanding that you would use the Portfolio Equity special symbol instead of 
equity().

Portfolio Equity special symbol

After running portfolio-level backtest, AmiBroker writes the values of 
portfolio equity to special symbol "~~~EQUITY". This allows you to access 
portfolio-level equity of last backtest inside your formula. To do so, use 
Foreign function:

PortEquity = Foreign("~~~EQUITY", "C" );

This is exactly what for example built-in portfolio equity chart formula is 
doing.



--- In [email protected], "bean_pi314" <g...@...> wrote:
>
> Are you talking about a portfolio equity curve or the equity curve of an 
> individual security?  Unfortunately, I think equity() only works for 
> individual securities, not portfolio equity.  I have been looking into the 
> same issue with respect to portfolio equity, but am stuck as well.
> 
> -Greg
> 
> --- In [email protected], Rick Osborn <ricko@> wrote:
> >
> > Check the IIF function in the Help files.
> > 
> > The proper construct is
> > positionsize = IIF(equity() > ma(equity(), 20), -20, -10);
> > 
> >  Best Regards
> > Rick Osborn
> > 
> > 
> > 
> > 
> > ________________________________
> > From: Wolfgang Hader <faked@>
> > To: [email protected]
> > Sent: Fri, November 6, 2009 3:49:41 PM
> > Subject: [amibroker] Trading equity-curve in Amibroker
> > 
> >   
> > Hi all,
> > 
> > how can I code some like this in Amibroker
> > (I know the following code is wrong, but how can I do it correctly in 
> > Amiboker)?
> > 
> > iif(equity() > ma(equity(), 20), positionsize= -20, positionsize= -10);
> > 
> > Thank you,
> > BR
> >
>


Reply via email to