New column i backtester

Hi!
Is it possible to add a column to the Backtester page?
I would like to add MA(10) / Close for the open day of the trade.

Best regards,
Leif Axelsson
Sweden

It is mandatory advice to search/read AB knowledge base first.

Majority of basic questions are answered there already.
http://www.amibroker.com/kb/2014/11/20/how-to-show-indicator-values-in-backtest-trade-list/

Further information in the manual as regards to adding custom metrics to trade list and report

/// Modified from:
/// @link http://www.amibroker.com/kb/2014/11/20/how-to-show-indicator-values-in-backtest-trade-list/
SetCustomBacktestProc( "" );
if ( Status( "action" ) == actionPortfolio )
{
    bo = GetBacktesterObject();
    // run default backtest procedure without generating the trade list
    bo.Backtest( True );

    // iterate through closed trades
    for ( trade = bo.GetFirstTrade( ); trade; trade = bo.GetNextTrade( ) )
    {
        // read Ratio values and display as custom metric
        symbolValue = StaticVarGet( trade.Symbol + "Ratio" );
        trade.AddCustomMetric( "Entry Ratio", Lookup( symbolValue, trade.EntryDateTime ) );
    }

    // iterate through open positions
    for ( trade = bo.GetFirstOpenPos( ); trade; trade = bo.GetNextOpenPos( ) )
    {
        // read Ratio values and display as custom metric
        symbolValue = StaticVarGet( trade.Symbol + "Ratio" );
        trade.AddCustomMetric( "Entry Ratio", Lookup( symbolValue, trade.EntryDateTime ) );
    }

    // generate trade list
    bo.ListTrades( );
}

SetTradeDelays(1,1,1,1);

// your trading system here
Buy = Cross( MACD(), Signal() );
Sell = Cross( Signal(), MACD() );

BuyPrice = SellPrice = Open;

// assign indicator values to ticker-specific variables
StaticVarSet( Name() + "Ratio", MA(C,10)/C);
1 Like

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.