[amibroker] Custom Backtester: can I display equity()?

 

Hello,

I have a system where I would like to display the equity value returned by Equity() in the Backtester report.

While I can display any value it doesn't want to display the value returned by Equity(). How would I be able to do this? I copy my test code below.

Many thanks for your help!
Herman

SetCustomBacktestProc( "" );

if( Status( "action" ) == actionPortfolio )
{
    bo = GetBacktesterObject();
    bo.Backtest();

    PctBHProfit = StaticVarGet( "PctBHProfit" );
    _TRACE( "Action BH: " + PctBHProfit );
    bo.AddCustomMetric( "BH %Profit", PctBHProfit );

    Test = StaticVarGet( "Test" );
    _TRACE( "Test: " + Test );
    bo.AddCustomMetric( "Test", Test );

}

Buy = Status( "firstbarinRange" );
Sell = Status( "LastbarInRange" );;
Short = Cover = 0;
BuyPrice = Open;
SellPrice = Close;

Eq = Equity();
InitialEquity = GetOption( "InitialEquity" );
PctBHProfit = ( Eq / InitialEquity - 1 ) * 100;
StaticVarSet( "PctBHProfit", PctBHProfit );

Test = 9999;
StaticVarSet( "Test", Test );


__._,_.___

Posted by: psytek@bell.net
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)
**** 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/


.

__,_._,___


EmoticonEmoticon