Back Testing Adding Additional columns

Is it possible to add additional columns in the backtest result list through AFL. For example generally there are columns for Symbol,Trade,Date,,Ex.price.... suppose I want to add my Target1 value as an additional column in the back test result window.

Yes it's possible. Read this:

I want to do the same in the Explore mode. Here is my code:

f ( Status( "action" ) == actionExplore ) 
    AddColumn( H, "High" );
    AddColumn( ATR(14), "ATR" );
    Filter = 1; 

It is easy to add any column using "AddColumn". But I cannot find how to get some values to populate in the list using "AddColumn".

For example, I want to add a column (in the explore) to add "Ex. Price", "Ex. date" same as what I got when I Backtest mode. Something like:

AddColumn( price, "Ex. Price" );
AddColumn( date, "Ex. Date" );

In general, how can I add any column of backtesting mode to Explore mode.


Do not use explore but backtest.:wink:

Else check out Equity function.


Filter = Buy OR Sell;
AddColumn( IIf(Sell, Sellprice, Null), "Ex. Price" );
AddColumn( IIf(Sell, Datetime(), Null), "Ex. Date", formatDateTime );

Hi codejunkie, thanks for your reply.

I am not sure if I understand your reply.
This gives the entry date and not the exit one

AddColumn( IIf(Sell, Datetime(), Null), "Ex. Date", formatDateTime );

If my system closes a trade either on SL or TP, then "SellPrice" cannot be restored by what you suggest!

what I need to add the columns which return Exit date, Profit, Shares and Trade.

I also add the "AddColumn" to my code, but couldn't manage to add any column on backtest while it works on Explore.
Thanks again,

@Oscar: Did you read the link above on custom metrics? Adding columns to the backtest output is done differently than adding columns to an exploration.

Also, @codejunkie is correct when he told you that if you want to see backtesting results then you should run a backtest, not an explore. There's a lot of additional work that goes on during a backtest to determine whether your entry signals really result in a new trade, when to exit and at what price, what the trade profit is including commissions, etc.

1 Like