Trade Statistics: Wins, Losses, Payoff and Expectancy
The metrics in the last two lessons describe the account. This lesson’s describe the trades: how many there were, how often they worked, how big the wins were against the losses, and how long each one tied up capital. They are the numbers that tell you what kind of thing your rule actually is, and one of them — the expectancy — is present in the report under a name almost nobody looks for.
By the end you should be able to reconstruct Avg. Profit/Loss, Payoff Ratio and
Profit Factor from the Winners and Losers blocks with a calculator, and to say how much
weight the sample size will carry.
Where these numbers live
Section titled “Where these numbers live”The statistics page groups them into an all-trades line, a Winners block and a Losers block, each reported separately for All, Long and Short trades. The programmatic metric names are documented exactly; the report’s own row labels for the Winners and Losers blocks are not enumerated in the User’s Guide, so this course gives you the documented strings and asks you to read the on-screen labels off your own report.
| Metric string | What it holds |
|---|---|
"AllQty" |
Number of all trades |
"AllAvgProfitLoss" |
Report row Avg. Profit/Loss |
"AllAvgProfitLossPercent" |
Report row Avg. Profit/Loss % |
"AllAvgBarsHeld" |
Report row Avg. Bars Held |
"WinnersQty", "WinnersPercent" |
Count and percentage of winning trades |
"WinnersAvgProfit", "WinnersAvgProfitPercent" |
Average win, in currency and percent |
"WinnersLargestWin", "WinnersLargestWinBars" |
Biggest single win and its length |
"WinnersMaxConsecutive" |
Longest run of consecutive winners |
"LosersQty", "LosersPercent" |
Count and percentage of losing trades |
"LosersAvgLoss", "LosersAvgLossPercent" |
Average loss, in currency and percent |
"LosersLargestLoss", "LosersLargestLossBars" |
Biggest single loss and its length |
"LosersMaxConsecutive" |
Longest run of consecutive losers |
The sample size comes first
Section titled “The sample size comes first”"AllQty" is the number of trades, and it decides how much any of the other numbers can
support. This is not a philosophical point; it is arithmetic you can do.
For a proportion such as a win rate, the standard error under the simplest possible assumption — independent trades, each a coin flip with the same probability — is the square root of p(1−p)/n. At a 50 per cent win rate:
| Trades | Standard error of the win rate |
|---|---|
| 30 | 9.1 percentage points |
| 214 | 3.4 percentage points |
| 300 | 2.9 percentage points |
With 30 trades, a reported win rate of 50 per cent is consistent with a true rate anywhere in a range roughly 18 percentage points wide. There is no analysis you can perform on that sample that will rescue it.
Small samples also break specific metrics in specific ways. Profit Factor is undefined
when there are no losing trades at all, and enormous when there is one small one. A
spectacular ratio computed on eleven trades is a property of the sample, not of the rule.
A worked report block
Section titled “A worked report block”The rest of this lesson uses one set of illustrative figures. They are invented so the arithmetic can be checked line by line; they are not a result.
| Reported figure | Value |
|---|---|
| Number of all trades | 214 |
| Winners, count and per cent | 89, 41.59 |
| Losers, count and per cent | 125, 58.41 |
Average win ("WinnersAvgProfit") |
1,180 |
Average loss ("LosersAvgLoss") |
−620 |
| Total profit of winners | 105,020 |
| Total loss of losers | −77,500 |
Net Profit |
27,520 |
Avg. Bars Held |
31.4 |
Win rate
Section titled “Win rate”AmiBroker’s win rate is "WinnersPercent": 89 of 214 trades, or 41.59 per cent. The old
backtester’s row for the same idea was called Percent profitable.
There is no metric named “Win Rate”, “Hit Rate” or “Success Rate” anywhere in the
report. If you write “win rate” in your notes, you are using shorthand for
"WinnersPercent", and it is worth knowing that is what you are doing.
The next lesson is entirely about why this number, read on its own, tells you almost nothing. For now, note only that 41.59 per cent is neither good nor bad until you know what the winners and losers were worth.
Average win, average loss and Payoff Ratio
Section titled “Average win, average loss and Payoff Ratio”Payoff Ratio is the ratio of the average win to the average loss. Metric string
"PayoffRatio"; the old backtester called it Ratio avg win/avg loss. It is colour-coded:
below 1 bad, 1 to 2 neutral, above 2 good.
Payoff Ratio = 1,180 / 620 = 1.903The average winner is a little under twice the average loser. Note what the ratio does
not contain: how often each occurs. A Payoff Ratio of 3.0 on a rule that wins one time
in ten is a losing rule. Payoff Ratio and "WinnersPercent" are two halves of one
statement and neither is readable alone.
Profit Factor
Section titled “Profit Factor”Profit Factor is the profit of winners divided by the loss of losers. Metric string
"ProfitFactor".
Profit Factor = 105,020 / 77,500 = 1.355Every 1.00 of losses was accompanied by 1.355 of gains. It is the whole-sample version of
the same relationship Payoff Ratio expresses per trade, and unlike Payoff Ratio it
already has the frequency of winners baked in: it is Payoff Ratio multiplied by the
ratio of winner count to loser count. Here, 1.903 × (89/125) = 1.355, which is a useful
identity to know because it tells you immediately that these are not two independent
pieces of evidence.
Expectancy, which is in the report under another name
Section titled “Expectancy, which is in the report under another name”AmiBroker has no report row named “Expectancy”. What it has is:
Avg. Profit/Loss— (Profit of winners + Loss of losers) ÷ (number of trades), which the User’s Guide notes is “also known as Expectancy ($)”;Avg. Profit/Loss %— the same computation on percentage profits, “also known as Expectancy (%)”.
Note the exact form: Avg. Profit/Loss, with a slash, a period after “Avg”, and no space
around the slash. Both are colour-coded bad below zero, good above.
With our figures:
Avg. Profit/Loss = ( 105,020 + (−77,500) ) / 214 = 27,520 / 214 = 128.60That is the expected profit per trade, in currency, and it is simply Net Profit divided
by the number of trades.
The formulation everyone writes, and why it is not always right
Section titled “The formulation everyone writes, and why it is not always right”The version that appears in every trading book is:
Expectancy = %Winners × AvgWin − %Losers × AvgLoss = 0.4159 × 1,180 − 0.5841 × 620 = 490.76 − 362.14 = 128.62which agrees with Avg. Profit/Loss to a rounding error. AmiBroker’s own documentation
uses exactly this formula in its first custom-metric example, and it adds the warning that
matters: it only equals the dollar-weighted expectancy under constant position size.
With compounding or variable sizing, larger trades weigh more than smaller ones, and the
simple formula produces an over-optimistic answer.
The guide gives two alternatives for that case. One iterates the trades and sums the percentage profit of each — the profit per 100 invested — then divides by the number of trades, which removes the size weighting entirely. The other expresses each trade as an R-multiple, the profit divided by the amount risked on that trade, which is meaningful whenever a maximum-loss stop defines the risk. Both require the custom backtester interface, which Part 36 introduces; the arithmetic, though, you can now do by hand from a trade list exported to a spreadsheet.
Avg. Bars Held
Section titled “Avg. Bars Held”Avg. Bars Held is the sum of bars in trades divided by the number of trades. Metric
string "AllAvgBarsHeld".
It has one counting rule that surprises people: entering today and exiting tomorrow
counts as a two-bar trade. The count is inclusive of the entry bar, so Avg. Bars Held
is not “the average number of days between entry and exit” — it is one more than that,
on daily data with no gaps.
Its real value is as a cost multiplier. A shorter holding period means more round trips
for the same capital, and every round trip pays the spread and the commission. Two rules
with the same Avg. Profit/Loss and holding periods of five and fifty bars are not
comparable propositions: the fast one has to overcome roughly ten times the cost drag, and
it is the one whose result will be most sensitive to whether your cost assumption was
right. The trade list’s Profit/bar column is the per-trade version of the same idea.
Avg. Bars Held also tells you something about the evidence. A system holding for 200
bars gets far fewer independent observations out of the same history than one holding for
5, so two systems with the same trade count are not carrying the same weight of evidence
if their holding periods differ by an order of magnitude.
The Winners and Losers blocks hold counts, averages, largest values and consecutive runs,
with documented metric strings and asymmetric names, and every loser figure is negative.
Payoff Ratio is the average win over the average loss; Profit Factor is total winnings
over total losses, and equals Payoff Ratio scaled by the ratio of counts.
Avg. Profit/Loss is the expectancy per trade, and it is Net Profit divided by the
trade count, but the textbook formula behind it holds exactly only under constant
position size.
Avg. Bars Held counts the entry bar and is the number that decides how much your cost
assumption matters.
Every one of these numbers depends on the sample being big enough to mean anything, which is why the trade count came first. The next lesson takes the one statistic in this group that is most often quoted alone, and shows what happens when it is.
Check your understanding
Sources for this lesson
3 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 — How to add user-defined metricsamibroker.com/guide/a_custommetrics.html2026-08-31
- 03AmiBroker User's Guide — Portfolio Backtester Interface Reference§ Stats object and Trade objectamibroker.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.