Risk Metrics: Drawdown and Its Relatives
Return tells you where a system finished. Drawdown tells you what it did on the way, and it is the half of the report that decides whether a person could actually have held the position long enough to collect the return. AmiBroker reports six numbers in this family, and the fastest way to misread all six is to assume they all divide by the same thing. They do not. Two of them divide by a currency amount, two by a percentage, and one is not a ratio at all.
By the end of this lesson you will be able to reconstruct each of them from the others,
explain why Recovery Factor and CAR/MaxDD can point in opposite directions on the same
report, and name the one property of drawdown that the report does not measure.
Max. system drawdown and Max. system % drawdown
Section titled “Max. system drawdown and Max. system % drawdown”Max. system drawdown is the largest peak-to-valley decline experienced in portfolio
equity, in account currency. Max. system % drawdown is the same decline as a
percentage. Their metric strings are "MaxSystemDrawdown" and
"MaxSystemDrawdownPercent".
Portfolio equity is available cash plus the value of every simultaneously open position, so these figures include unrealised losses on positions you were still holding. That is the right definition: an account that is 20 per cent underwater on open positions is 20 per cent underwater regardless of whether anything has been sold.
Max. system % drawdown is reported as a negative number, and it is colour-coded:
worse than −30 per cent is flagged bad, −30 to −10 per cent neutral, −10 to 0 per cent
good.
The drawdown you lived through was worse than the one in the report
Section titled “The drawdown you lived through was worse than the one in the report”The modern portfolio backtester computes system and trade drawdowns from the close price only, regardless of the settings. The old backtester let you choose Open, Close or the High–Low range as the basis. The guide notes that the current behaviour is “subject to change”, which is a documentation phrase worth taking seriously: re-check it against your own build before you make a strong claim about it.
The practical consequence is that intra-bar excursions do not appear. If your equity fell 28 per cent during a day and closed the day 22 per cent down, the report knows about 22. Someone watching the account knew about 28. On daily bars this gap is usually modest; on weekly or monthly bars it can be large; in a fast decline it is at its largest exactly when it matters most.
Max. trade drawdown and Max. trade % drawdown
Section titled “Max. trade drawdown and Max. trade % drawdown”These are the same idea applied to a single trade: the largest peak-to-valley decline
experienced in any one trade, in currency and in percent. Metric strings
"MaxTradeDrawdown" and "MaxTradeDrawdownPercent".
The percentage basis changed between engines and this trips people up. In the old
backtester, Max. % trade drawdown was computed against total equity. In the modern
portfolio backtester it is computed against the actual trade value at the entry point.
The same trade reports very different percentages under the two engines, and a figure
quoted from an old forum post is not comparable with yours.
Max. trade % drawdown is a close relative of MAE, the maximum adverse excursion shown
per trade in the trade list, which is also expressed in percent. They are not the same
statistic — MAE is per trade and appears as a column, this is the worst single value
across all trades and appears as a report row — but they answer the same kind of question:
how far against you did a position go before it resolved?
Reading the two together is informative. A system whose Max. trade % drawdown is large
but whose Max. system % drawdown is small is telling you that individual positions went
badly wrong and diversification or position sizing absorbed it. A system where the two are
close is telling you that its trades move together, which is a concentration problem
wearing a disguise.
Three ratios, three different denominators
Section titled “Three ratios, three different denominators”Here is the group that causes the most confusion, laid out with one set of illustrative figures so the arithmetic is visible. These numbers are invented to make the relationships legible; they are not a result.
Assume a five-year test starting with 100,000:
| Reported figure | Value |
|---|---|
Net Profit |
62,000 |
Net Profit % |
62.00 |
Annual Return % |
10.13 |
Exposure % |
62.0 |
Max. system drawdown |
24,500 |
Max. system % drawdown |
−22.4 |
From those, the three ratios follow:
| Ratio | Definition | Arithmetic | Value | Colour band |
|---|---|---|---|---|
Recovery Factor |
Net Profit ÷ Max. system drawdown |
62,000 ÷ 24,500 | 2.53 | good (above 2) |
CAR/MaxDD |
Annual Return % ÷ Max. system % drawdown |
10.13 ÷ 22.4 | 0.45 | bad (below 1) |
RAR/MaxDD |
Risk Adjusted Return % ÷ Max. system % drawdown |
16.34 ÷ 22.4 | 0.73 | bad (below 1) |
Two of those say the system is poor and one says it is good, from the same report. Nothing is broken. They measure different things:
Recovery Factordivides a total, non-annualised profit by a currency drawdown. Run the same system for ten years instead of five andNet Profitroughly doubles while the worst drawdown probably does not, soRecovery Factorroughly doubles too. It is not comparable across tests of different lengths, and it flatters long tests.CAR/MaxDDdivides an annualised percentage by a percentage. The length of the test is already handled by the annualisation, so it is far more portable. This is why it is AmiBroker’s default optimization target for walk-forward testing.RAR/MaxDDdivides the exposure-adjusted return by the same drawdown. Because RAR has already been divided byExposure %, a system with tiny exposure produces an enormousRAR/MaxDD. It answers a different question, not a better version of the same one.
A note on the sign
Section titled “A note on the sign”Max. system % drawdown is printed as a negative number, while CAR/MaxDD and
RAR/MaxDD are colour-coded on thresholds of 1 and 2 and described as “good if greater
than 2”. The magnitude of the drawdown is therefore what enters the ratio. Confirm the
sign convention on your own report the first time you use these numbers rather than
assuming it from this page.
The names AmiBroker does not use
Section titled “The names AmiBroker does not use”CAR/MaxDD is AmiBroker’s version of what the wider industry calls the MAR ratio or
the Calmar ratio. AmiBroker reports neither name, and the definitions used elsewhere
differ in detail — Calmar is conventionally computed over a rolling three-year window, for
instance. Do not write “Calmar 0.45” in your notes on the strength of an AmiBroker report.
Note also the spelling trap. The HTML report row reads CAR/MaxDD. The programmatic
metric string, the optimization result-list column and the walk-forward Optimization
target drop-down all read CAR/MDD. Same number, two spellings, and typing the wrong one
into the walk-forward target field simply does not match anything.
Ulcer Index and Ulcer Performance Index
Section titled “Ulcer Index and Ulcer Performance Index”Ulcer Index is defined as the square root of the sum of squared drawdowns divided by the
number of bars. Metric string "UlcerIndex". Lower is better, and it is not colour-coded.
The squaring and the per-bar averaging are what make it interesting: it responds to how long the account spent underwater as well as to how far down it went. Two five-bar sequences of percentage drawdown make the point:
| Bar | Series A | Series B |
|---|---|---|
| 1 | 0 | 0 |
| 2 | −5 | −10 |
| 3 | −10 | 0 |
| 4 | −4 | 0 |
| 5 | 0 | 0 |
Both have a worst drawdown of −10. Series A gives (0 + 25 + 100 + 16 + 0) ÷ 5 = 28.2, and the square root of that is 5.31. Series B gives (0 + 100 + 0 + 0 + 0) ÷ 5 = 20, whose square root is 4.47. Identical maximum drawdown, different Ulcer Index, because A stayed down for three bars and B for one.
Ulcer Performance Index is defined as (Annual profit − Treasury notes profit) ÷ Ulcer
Index. Metric string "UlcerPerformanceIndex"; the settings dialog abbreviates it to UPI.
Using the figures above with the default rate of 5.4:
UPI = ( 10.13 − 5.4 ) / 5.31 = 0.89Because a rate is subtracted from the numerator, UPI can be negative for a system that made money. A profitable system that earned less than the assumed rate has a negative UPI, which is a statement about the comparison, not a sign that the system lost.
The documentation has not caught up here
Section titled “The documentation has not caught up here”Both metric pages still say the Treasury-notes figure is “hardcoded at 5.4” and that “in a
future version, there will be a user setting for this”. That version has arrived: the
setting is not absent — Settings → Report contains Risk-free rates, with two editable
fields, and the description does not reflect that.
- The field labelled
UPI:defaults to 5.4 and feedsUlcer Performance Index. - The field labelled
Risk-free rate for Sharpe ratio:is not used here — it defaults to 5 and feedsSharpe Ratio of tradesonly.
Change either and the corresponding metric moves. Two reports produced on machines with different values there are not comparable, and nothing on the report says so.
The thing the report does not measure: how long
Section titled “The thing the report does not measure: how long”Search the documented metric list for a drawdown duration and you will not find one. AmiBroker reports how deep the worst decline was, in currency and in percent, and how deep the worst single trade went. It does not report how many bars the account spent below a previous peak, how long the longest such stretch was, or how long the worst drawdown took to recover.
That is a real gap, because depth and duration are experienced completely differently:
- A 25 per cent decline that recovers in four months is a bad quarter.
- A 25 per cent decline that takes four years to recover is most of a decade of your investing life in which the strategy gave you nothing, while asking you to keep taking every signal it generated.
Those two produce an identical Max. system % drawdown. They produce a different
Ulcer Index, which is the only built-in metric that responds to duration at all, and it
does so implicitly rather than in units anyone can act on.
To get the duration you have to compute it. The last lesson in this part builds a formula
that reads portfolio equity from the special ~~~EQUITY symbol after a backtest and
reports both the deepest decline and the longest stretch spent below a previous peak.
Max. system drawdown and Max. system % drawdown measure the worst peak-to-valley
decline in portfolio equity, on close prices only, with the percentage reported negative.
Max. trade drawdown does the same for a single trade, with the modern engine basing the
percentage on the trade’s entry value. Recovery Factor divides total profit by the
currency drawdown; CAR/MaxDD and RAR/MaxDD divide annualised returns by the
percentage drawdown; and the first of those flatters long tests while the last flatters
low-exposure ones. Ulcer Index and Ulcer Performance Index bring duration in
indirectly, and depend on a rate setting that the documentation still describes as fixed.
And the report is silent on how long you would have had to wait. That silence is the subject the final lesson picks up.
Check your understanding
Sources for this lesson
4 verified · checked 2026-08-31
- 01AmiBroker User's Guide — System test report window§ New backtester reportamibroker.com/guide/w_report.html2026-08-31
- 02AmiBroker User's Guide — Portfolio-level backtestingamibroker.com/guide/h_portfolio.html2026-08-31
- 03AmiBroker User's Guide — System test settings window§ Report tabamibroker.com/guide/w_settings.html2026-08-31
- 04AmiBroker User's Guide — Portfolio Backtester Interface Reference§ Stats object metric namesamibroker.com/guide/a_custombacktest.html2026-08-31
Every technical claim on this page was checked against the official AmiBroker documentation on the date shown. Where the course disagrees with folklore, the source is how you can tell which one to trust.