Free lesson · Statistics
Expected value: measure the payoff before choosing the risk
Open interactive lessonPractice calculationsExplore labs
Start with the idea
Expected value is a probability-weighted sum. Average win and loss are conditional averages, not the largest outcomes. Variance adds a second dimension: how dispersed those payoffs are. Compute both in consistent dollars or returns, then subtract costs before interpreting expectancy.
Symbols, units & horizon
- X, xᵢ: payoff random variable and observed payoff i
- p: win probability, with loss probability 1−p
- W, L: positive average win and loss amounts
- c: fixed currency cost per trade
- E[X]: expected payoff
- p_BE: break-even win probability
- n: sample count, at least 2
- x̄: sample mean
- s², s: sample variance and SD
- σ²: population variance
- Σ: add over all observations
When and why to use this
Use expectancy to compare candidate entry/exit rules; use dispersion to understand unstable estimates and position sizing. A high win rate matters only in combination with payoff size and loss severity.
A trading strategy is a machine that turns repeated decisions into a distribution of outcomes. Every other statistic on this page describes some feature of that distribution. The first feature, and the one that decides whether you have a business or a hobby, is its expected value.
Derive expectancy and break-even win rate
- For outcomes +W and −L with probabilities p and 1−p, . Distribute the minus sign to get .
- With fixed cost c per trade, set . Expand: , so .
W=$300, L=$120, p=.35 gives $27 gross EV. With $3 cost, net EV=$24 and break-even p=123/420=29.286%.
Read it as a weighted average of what happens: how often you win times how much, minus how often you lose times how much. A 40% win rate is fine if wins are three times losses; a 70% win rate is a slow bleed if the occasional loss wipes out five wins.
A strategy wins 35% of the time. Average win is $300, average loss is $120. What is EV per trade, in dollars?
. Positive, despite losing nearly two trades in three. Win rate on its own tells you almost nothing.
Mean vs median: which outcome is typical?
The mean is EV measured from data. The median is the middle outcome. Their difference can reveal asymmetry, although it is not a complete description of the distribution. A trend-following sample may have a negative median and a positive mean because of a few large winners. Inspect the full payoff distribution and uncertainty instead of judging only the typical trade.
Variance and standard deviation: the price of the mean
Two strategies with the same EV are not the same strategy. Variance measures how far outcomes scatter around the mean; its square root, the standard deviation (population , sample estimate ), is in the same units as the P&L so you can reason about it.
Compute variance and explain n−1
- First compute . Deviations sum to zero, so after n−1 deviations the last is determined. This lost degree of freedom motivates the sample correction.
- Expand squares to obtain . Divide by n−1 and take the square root for SD. Under IID finite variance, the expected squared-deviation sum is .
For 1,2,3: mean 2, squared deviations 1,0,1; s²=2/2=1 and s=1. The population variance of this fixed three-point distribution would instead divide by 3.
Applied to returns instead of dollars, standard deviation is called volatility. Volatility targeting uses it directly, while other sizing rules use a fuller payoff or covariance model. Volatility does not capture every kind of risk.
Why might a strategy with a higher EV be the worse strategy to trade?
Because EV is paid out over time and you have to survive the path. A higher-EV strategy with a much larger produces deeper drawdowns for the same capital, which either forces you to size smaller (cutting the realised EV) or risks ruin before the mean shows up. What you can compound is EV relative to , which is what the Sharpe ratio measures.
Python implementation
Self-contained teaching example. Python 3.10+; dependencies and input conventions are shown in the code and notation. Run in your own Python environment.
from statistics import mean, variance, stdev
def expectancy(p, win, loss, cost=0):
if not 0 <= p <= 1 or win <= 0 or loss <= 0:
raise ValueError("Valid probability and positive payoffs required")
return p*win-(1-p)*loss-cost, (loss+cost)/(win+loss)
def dispersion(values):
return mean(values), variance(values), stdev(values)
print(expectancy(.35, 300, 120, 3))
print(dispersion([1, 2, 3]))Continue learning
Statistics & Probability — all lessons- Start with counts, probabilities and averages
- Random outcomes, sample averages and the limits of the bell curve
- Conditional probability: update a belief with evidence
- Prediction markets: probability, price and net expected value
- Expected value: measure the payoff before choosing the risk
- Correlation: how many strategies do you really have?
- Conditional probability and Bayes: where the edge actually lives
- The central limit theorem: sampling means under explicit assumptions
- Estimation uncertainty and Bayesian updating
Quantitative finance and development glossary · Python resources and libraries · Research sources and limitations