System test report window

NEW BACKTESTER REPORT

Exposure % - 'Market exposure of the trading system calculated on bar by bar basis. Sum of bar exposures divided by number of bars. Single bar exposure is the value of open positions divided by portfolio equity.

Net Risk Adjusted Return % - Net profit % divided by Exposure %

Annual Return % - Compounded Annual Return % (CAR) - this is

Risk Adjusted Return % - Annual return % divided by Exposure %

Avg. Profit/Loss - (Profit of winners + Loss of losers)/(number of trades)

Avg. Profit/Loss % - '(% Profit of winners + % Loss of losers)/(number of trades)

Avg. Bars Held - sum of bars in trades / number of trades

Max. trade drawdown - The largest peak to valley decline experienced in any single trade

Max. trade % drawdown - The largest peak to valley percentage decline experienced in any single trade

Max. system drawdown - The largest peak to valley decline experienced in portfolio equity

Max. system % drawdown - The largest peak to valley percentage decline experienced in portfolio equity

Recovery Factor - Net profit divided by Max. system drawdown

CAR/MaxDD - Compound Annual % Return divided by Max. system % drawdown

RAR/MaxDD - Risk Adjusted Return divided by Max. system % drawdown

Profit Factor - Profit of winners divided by loss of losers

Payoff Ratio - Ratio average win / average loss

Standard Error - Standard error measures chopiness of equity line. The lower the better.

Risk-Reward Ratio - Measure of the relation between the risk inherent in a trading the system compared to its potential gain. Higher is better. Calculated as slope of equity line (expected annual return) divided by its standard error.

Ulcer Index - Square root of sum of squared drawdowns divided by number of bars

Ulcer Performance Index - (Annual profit - Tresury notes profit)/Ulcer Index'>Ulcer Performance Index. Currently tresury notes profit is hardcoded at 5.4. In future version there will be user-setting for this.

Sharpe Ratio of trades - Measure of risk adjusted return of investment. Above 1.0 is good, more than 2.0 is very good. More information http://www.stanford.edu/~wfsharpe/art/sr/sr.htm . Calculation: first average percentage return and standard deviation of returns is calculated. Then these two figures are annualized by multipling them by ratio (NumberOfBarsPerYear)/(AvgNumberOfBarsPerTrade). Then the risk free rate of return is subtracted (currently hard-coded 5) from annualized average return and then divided by annualized standard deviation of returns.

K-Ratio - Detects inconsistency in returns. Should be 1.0 or more. The higher K ratio is the more consistent return you may expect from the system. Linear regression slope of equity line multiplied by square root of sum of squared deviations of bar number divided by standard error of equity line multiplied by square root of number of bars. More information: Stocks & Commodities V14:3 (115-118): Measuring System Performance by Lars N. Kestner

OLD BACKTESTER REPORT

This window (accessible from Report button in Automatic analysis window) provides very useful information about the performance of a trading system under the test. The information included here can be customized using system test settings dialog.

Explanation of values:

Total net profit: This is total profit/loss realized by the test. Includes the closed-out value of the open position (if there is any).
Return on account: This is total profit/loss as a percentage of initial investment.
Total commissions paid: The amount of commissions paid during trades.
Open position gain/loss: The closed-out value of open position that existed at the end of the test.
Buy-and-hold profit: The total profit/loss realized by buy-and-hold strategy (including commission).
Buy-and-hold % return: The total buy-and-hold strategy return as a percentage of initial investment.
Bars in test: The number of bars tested (Overall summary shows sum of number of bars in all symbols).
Days in test: The number of days between first bar date and last bar date (overall summary shows arithmetic average of number of days accross the population of symbols under test)
System to buy-and-hold index: An index showing how much better/worse is the system compared to buy-and-hold strategy. A value of 0% means that system gives the same profit as buy-and-hold strategy. A value of 200% means that system gives 200% more profit than buy-and-hold strategy. A value of -50% means that system gives a half of the gains of buy-and-hold strategy.
Annual system % return: Calculated compound annual percentage return of the system (*see the note)
Annual B&H % return: Calculated compound annual percentage return of the buy and hold strategy (*see the note)
System drawdown: The largest equity dip experienced by the system (relative to the initial investment).
B&H drawdown:
The largest equity dip experienced by the buy and hold strategy (relative to the initial investment).

Max. system drawdown: The largest point distance between equity peak value and the following trough value experienced by the system
Max. system % drawdown: The largest percentage distance between equity peak value and the following trough value experienced by the system
Max. B&H drawdown: The largest point distance between equity peak value and the following trough value experienced by the buy and hold strategy
Max. B&H % drawdown: The largest percentage distance between equity peak value and the following trough value experienced by the buy and hold strategy

Trade drawdown: The largest equity dip experienced by any single trade (relative to the trade's entry price).
Max. trade drawdown: The largest point distance between equity peak value and the following trough value experienced by any single trade
Max. trade % drawdown: The largest percentage distance between equity peak value and the following trough value experienced by any single trade

Total number of trades: The number of trades (winners + losers)
Percent profitable: The number of winning trades compared to total number of trades shown as a percentage
Profit of winners/Loss of losers: Total amount of money gained in winners/lost in losers.
Total # of bars in winners/losers: The number of bars spent during winning/losing trades
Largest winning/losing trade: The amount of biggest winner/loser
# of bars in largest winner/loser: The number of bars in the biggest winning/losing trade
Average winning/losing trade: The average of winning/losing trades (sum of winners/losers divided by a number of winning/losing trades)
Average # of bars in winners/losers: The average of number of bars in winning/losing trades (total number of bars in winners/losers divided by a number of winning/losing trades)
Max consec. winners/losers: The largest number of consecutive winning/losing trades.

Bars out of the market: The number of bars for which the system was completely out of the market (was neither long nor short). If you open and close the position during single day, even if you have no open position on market open and no position on close this day is NOT considered as out of the market.

Interest earned: The total interest earned between trades. Note that AmiBroker simulates O/N (overnight) deposits. This means that if you closed the position on Monday and opened the next one on Tuesday you earn interest for single O/N deposit.

Exposure: Shows how much you are exposed to the market. It is a ratio of bars in the market divided by total number of bars under test. (The number of bars in the market is given by total number of bars minus bars out of the market)

Risk adjusted ann. return: Shows annual return of the system (*see note) adjusted (divided) by market exposure. If your system gained 10% over one year with the exposure of 50% the adjusted return would be 20% (10%/0.5)

Ratio avg win/avg loss: The absolute value of the ratio of average winning trade to average losing trade
Profit factor: The absolute value of the ratio of the profit of winners to loss of losers
Avg. trade (win & loss): The average trade profit calculated as sum of winners and losers divided by the number of trades.

*Note: Calculation method used for annual percentage returns:

Most of the software (including two the most popular so-called professional packages) use very simple annualization method based on the following formula:

simple_annualized_percentage_return = percentage_return * ( 365 / days_in_test );

unfortunatelly this method is wrong and very misleading since it would tell you that annual return is 22% when your system earned 44% during two years. This value is too optimistic. In fact annual return in this case is only 20%: if your initial investment was 10000 you earn 20% during the first year so you then get 12000 and 20% the second year that gives you 14400 = ( 12000 * 120 % ). So after two years you earned 44% but annually it is only 20%.

AmiBroker is one of the few programs that calculates annual returns correctly and will give you correct value of 20% as shown in the example above. The formula that AmiBroker uses for annual return calculation is as follows:

correctly_annualized_perc_return = 100% * ( (final_value/initial_value) ^ ( 365 / days_in_test ) - 1 )

where x^y means rising x to the power of y.

Known differencies between statistics produced by 'old' and 'new' (portfolio) backtester

  Old backtester New (portfolio) backtester
System and trade drawdown calculations based on Open/Close/H-L range (worst case) selectable in settings Close price only (regardless of settings) - subject to change
Max. % trade drawdown Calculated based on total equity Calculated based on ACTUAL trade value at entry point.
Stats available for all trades only separately for long, short and all trades
PositionSizing Based on individual symbol equity

Based on portfolio equity.

PositionSize = -25;

will enter 25% of current porfolio equity

Trade statistics Include only closed trades, open trade is reported separately Include all trades (closed and those still open at the end of analysis period). Any open trades are closed out at 'close' price always.
Exposure calculated regardless of position size (no matter on what is position size if trade is taken for particular bar it assumes 100% exposure at that bar) calculations include now (in 4.43.0) the total amount of open positions compared to total portfolio equity. Exposure is calculated on bar by bar basis so if only 50% funds are in open trade, then exposure for this bar is 0.5. Then individual bar exposures are summed up and divided by number of bars to produce exposure figure. This way true market exposure is calculated.
Multiple security testing N independent accounts (multiple single equity) Portfolio equity common to all symbols under test