Question about stats from the Backtest Report

I'm missing a useful piece of math here as I look at this issue and hope some of the sharper forum-lurkers can help.

The "Avg P/L %" in the report is that same as expectancy:
(% winners * % profit ) - (% losers * % loss). That makes sense. In my personal example, this is 16.7%.

When I copy the individual trade data to Excel and calculate the average profit per trade directly from the trade data I get a lower number. In this case it's 15.0%.

My question is this: What explains the difference between those 2 numbers? It shouldn't be compounding, I don't think as that's in the CAGR number so not sure what.

MANY thanks for the help folks!

You don't actually say how you calculated the value in Excel. However, I think you'll find that if you simply average all the values in the % Profit column, it will match the Avg % P/L in the backtest report. You don't even have to do any work... just select Column I (if you're using the default column order) and Excel will automatically show you the average in the status bar at the bottom of the window.

Used the AVERAGE function and the results are different (see my original post) which prompted me to post about this.

Any ideas?

And which values did you average? I have never seen an instance where averaging the values in the % Profit column gave a different result than Avg % P/L reported in the Backtest Report.

First you did NOT POST any evidence ANY number nothing at all.

Unfortunately your question does not provide ANY details to give you an answer. Please follow this advice: How to ask a good question

As a general remark, it is important to note that AmiBroker calculations are always done with full precision offered by floating point hardware on the CPU. The display however is rounded to something like one or two decimal places. When you copy-paste ROUNDED individual trade numbers to Excel you are NOT performing the same calculation because you are NOT using correct numbers, but rounded ones. Sometimes using rounded numbers may lead to huge errors. Imagine you have two trades one has 0.01499 profit other has -0.0059 gain (losing trade). If you calculate average using full precision you get 0.00909. If you round that result you get 0.01 average.
Now if you take profits rounded to 2 decimal places BEFORE calculating average you would end up getting (0.01 - 0.01)/2 = 0. That is what your Excel would show. 100% incorrect result.

People are fooled by their assumptions that rounding to say 2 decimal places would not introduce errors higher than 0.01 but this is HUGE mistake in thinking.

1 Like

Tomasz, your comments about the importance of non-rounded results here are helpful and important.

I tested the same system but on only a few years of data (rather than 14 in the original test) and the average in Excel does match the "Avg P/L %" in the Backtest report. In the test going out 14 years, there are 6000+ trades though so it seems very feasible that the rounding issue would produce a notable different after that many trades.

Thanks for the help.

1 Like

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