Strange stats in the backtest reports

Hello all,

It's good to be back to AmiBroker's communtity after more than 20 years of absence :slight_smile: When I came back to trading a few weeks ago, I was very pleased to notice that AmiBroker still existed. I really enjoy this software concept.

I'm writing today to point out strange stats in my report; I checked the max drawdown and loss / profit per month:

1 - Max drawdown
The below report displays a maximum drawdown of 47.96% a bit before the end of April:

When we check the trades, I can see that the maximum equity is on 02/01/2024 and minimum equity on 05/03/2024:

The maximum drawdown in that case is, from my calculation, 34.79%.
For your information, initial equity is always 10000 for all my backtests.

2 - Monthly loss / profit

In the same backtest, we can see that the month of April displays a loss of -0.7%:

When you check the trades (see above in point 1), you can notice that there was no trade initiated and only one closed in April. This latter one was closed for a loss of -5.82%.

Important note: The trade list is from the trade window, but I checked that it is the same as the report trade list.

I read a post in this forum discussing that topic, but it was closed without giving an answer. So, does anyone stumbled on this case and could explain this mystery?

Kind regards

System Drawdowns are NOT calculated from CLOSED trades, but from PORTFOLIO LEVEL EQUITY that is calculated EVERY BAR. Your trade experienced drawdown BIGGER than shown on the trade list because it was occurring IN THE MIDDLE of the trade and that is nowhere to be seen on closed trade list.
You should be looking at "DETAILED LOG" instead.

As manual says System test report window

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

As for per-month performance, it is AT THE CLOSE OF THE MONTH. It does not show what happened inside a month. You might have worst drawdown in the middle of the month and yet recover at the end.

To get better understanding of what is happening in your code and how functions work, use advice given here: How do I debug my formula?

2 Likes

Thank you for the explanation Tomasz. It's crystal clear.