Mean vs. Median: Picking the Right Profit Summary Stat
Statistics & ExperimentsModel answerLast updated
Decide which central tendency metric best captures per-trade profitability in a live trading system, and justify the choice given skew, outliers, and stream constraints.
Context
You are building a real-time performance dashboard for an automated trading system that executes a large number of trades every hour across multiple instruments. Each completed trade produces a profit-and-loss (PnL) value. You need to surface a single "typical profit per trade" figure that strategy developers can act on without being misled.
Two colleagues disagree on how to compute it:
- Colleague A argues for the arithmetic mean, because it connects directly to total PnL and is easy to aggregate.
- Colleague B argues for the median, because extreme trades — large winners or sudden losses — distort the mean and make it hard to read the day-to-day behavior of the strategy.
What you are asked to do
-
Compare mean and median as estimators of "typical profit per trade." Address both their statistical properties and their practical meaning in a trading context.
-
Analyze a specific asymmetry. The system has a hard floor on losses — each trade is exited automatically once it hits a fixed maximum loss — but winning trades are allowed to run indefinitely. Describe what this does to the shape of the profit distribution, and explain how that shape change affects the usefulness of each metric.
-
Propose a concrete metric set for the dashboard. Rather than picking one number, recommend a small set of statistics that together give developers an honest, actionable picture. Address how each metric would be computed efficiently on a continuous data stream.
Assumptions and constraints
- The profit distribution is not assumed to be normal or even symmetric.
- The system processes a high volume of trades; computational cost and latency matter.
- Treat unusual trades as potentially real signals, not automatically as errors to discard.
- Focus on the properties that matter for both understanding typical behavior and detecting problems quickly.
Hints
Hint 1
Think about which statistic has a direct algebraic relationship to total PnL. Can you recover total PnL from the median? What about from the mean?
Hint 2
With a hard cap on losses but uncapped upside, sketch what the profit distribution looks like. Is it symmetric? What happens to the mean vs. median when 90% of trades hit the stop and 10% are large winners?
Hint 3
A single number can be honest about the center while hiding the shape. What two or three cheap additional statistics would reveal skew, tail risk, and data quality without adding much computation?
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
What this question is really testing
The interviewer wants to see three things: you know which statistic links to the business objective (total PnL), you understand how skew makes mean and median measure different things, and you can translate that understanding into a practical instrumentation decision on a live data stream.
The wrong answer is picking one or the other. The right answer is explaining that they answer different questions, then designing a metric set that uses each for what it is good at.
Step 1: The core trade-off
The mean is the only metric tied to PnL.
Expected value is linear, so:
$$\text{Total PnL} = N \cdot \bar{x}$$
The sample mean is an unbiased estimator of expected profit per trade, which is exactly the quantity the business is optimizing. You can aggregate means across time windows and instruments. The median has no such property — you cannot recover total PnL from medians, and medians from two non-overlapping windows do not combine into a meaningful single number.
The mean is also fragile.
Its breakdown point is zero: a single corrupted fill or an extreme event can pull it arbitrarily far. On a one-hour window with fat-tailed data, the standard error $\sigma / \sqrt{N}$ can be large and poorly estimated, especially if the tail index is below 2 (infinite variance regime). A dashboard driven solely by a noisy hourly mean will produce false alarms.
The median is robust but estimates the wrong thing when the distribution is skewed.
The median describes the typical individual trade well — its breakdown point is 50%, and it is insensitive to magnitude in the tails. Under normality it is less efficient than the mean (asymptotic relative efficiency ≈ 0.64), but that is a secondary concern. The deeper problem is that when mean ≠ median — which happens precisely when the distribution is skewed — they are estimating different parameters. Choosing between them is not just a robustness call; it is a choice about what you want to know.
Rule of thumb: if the distribution is symmetric, mean and median are close and the choice is mainly about efficiency versus robustness. Once significant skew is present, they diverge in meaning and you should report both.
Step 2: What a stop-loss does to the distribution
A hard loss floor clips the left tail. In practice this creates a soft boundary rather than a hard one — slippage, gaps, and execution latency let some trades exceed the stop — but the shape shift is real and significant:
- Loss magnitudes are bounded (roughly); gain magnitudes are not.
- The distribution becomes positively skewed: a long right tail, compressed left tail.
- In many trend-following strategies, the majority of trades hit the stop. Win rate can be below 50%, yet the strategy is profitable.
A concrete example: 90 trades stopped out at −$1, 10 winners at +$15.
| Metric | Value |
|---|---|
| Mean profit per trade | +$0.60 |
| Median profit per trade | −$1.00 |
| Win rate | 10% |
The median says the strategy loses on the typical trade. The mean correctly reflects that the strategy is profitable. A dashboard that highlights the median as the headline would push developers to abandon or retune a working system.
The opposite failure is equally dangerous. A strategy that collects small, frequent gains but occasionally suffers catastrophic losses — the "pennies in front of a steamroller" pattern — will show a healthy median while its mean, and its true expectation, is negative. The tail is the strategy in both cases. Discarding outliers means discarding the signal.
Step 3: Recommended metric set
Make the mean the headline and surround it with diagnostics that describe shape and flag risk.
Headline metric
- Mean PnL per trade, normalized by notional or in basis points so instruments are comparable.
- Attach a bootstrap confidence interval or ± one standard error. This tells developers when an hour of data is simply too thin to act on.
Shape diagnostics (cheap; computed with running sums)
- Median and win rate — describe the typical trade and hit ratio.
- Average winning trade and average losing trade — the payoff ratio.
- Gap between mean and median — a quick skew alarm. A large positive gap signals positive skew; watch for the steamroller pattern with a large negative gap.
Tail diagnostics
- 1st, 5th, 95th, 99th percentiles and the single worst trade.
- Tail contribution: what share of the hour's total PnL came from the top and bottom 1% of trades by size. If three trades account for 80% of the profit, developers need to know that before reacting to the mean.
Data quality layer
Flag statistically extreme trades for inspection — bad tick? erroneous fill? — but never silently remove them from the mean. Confirmed errors are corrected at the source; genuine outliers stay in.
Streaming and latency considerations
| Metric | Update cost | Windowing approach |
|---|---|---|
| Mean, variance, win rate | O(1) running sums | Ring buffer or 60 one-minute buckets; trivially mergeable across shards |
| Exact median / quantiles | O(log N) with two heaps or order-statistic tree | Fine at thousands of trades/hour per asset |
| Quantiles across many assets | O(log N) approximate | t-digest or KLL sketch; mergeable, bounded error, handles window expiry by dropping old buckets |
For most single-asset hourly windows, exact computation is feasible. The sketch approach pays off when aggregating across hundreds of instruments or when memory is constrained.
Common mistakes
- Choosing the median "because the data is non-normal" without noticing it no longer measures profitability.
- Labeling tail events as noise and winsorizing them out of a PnL headline number.
- Reporting a raw mean with no uncertainty estimate, then reacting to one-hour fluctuations that are within normal sampling variation.
- Assuming the stop-loss fully bounds losses; slippage and gap risk mean the left tail is compressed, not eliminated.
- Comparing raw dollar means across assets with very different notional sizes or volatility levels.
Follow-up angles
If asked about trimmed or winsorized means: these trade variance for bias. Under skew, a trimmed mean no longer estimates E[X], so there is no universally correct trim percentage for a PnL objective. If used, pick the level that minimizes estimated MSE against the full-sample mean via bootstrap, report it alongside the raw mean rather than instead of it, and document what was removed.
If asked about automated circuit breakers: the objective shifts from "describe typical performance" to "detect catastrophe fast," which inverts the robustness requirement. A median-based breaker ignores exactly the events it exists to catch. Use cumulative drawdown, maximum single-trade loss, and lower quantiles or expected shortfall over short windows instead. Sequential change-point detection (CUSUM) is a principled option for fast, online anomaly detection.