TradingView backtesting guides

Trading Expectancy Calculator

Trading expectancy is the average result per trade: win probability times average win, minus loss probability times average loss. Subtract costs to estimate the net result. Use dollars or R to examine a sample, without treating its average as a forecast.

Enter one consistent sample

Use closed trades from the same period. Averages use positive magnitudes. Rates count all trades, including flats. Amounts must be between 0 and 1 trillion; a group with trades needs a positive average. Enter 0 for an absent group. Values beyond numeric precision are rejected.

Changing the unit relabels inputs; it does not convert them.

Cost is the average round trip across all trades: entry plus exit commission, spread and slippage not already in P&L. Keep it at 0 if those costs are already included.

Per-trade result

Enter valid inputs or load the worked example. Results update as you type. Empty inputs do not count as zero.

The tool holds average payoffs, flat rate and average cost fixed when solving for break-even. It does not model changes in fills, sizing, drawdown or the chance of ruin. An absent win/loss group supplies no evidence about its future payoff.

The expectancy formula, with flat trades included

Let p be winning trades divided by all closed trades, z the fraction with zero P&L before the extra costs entered, W the average winning amount, L the positive average losing amount, and C the average extra cost across all closed trades.

Loss probability q = 1 − p − z

Gross expectancy = p × W − q × L

Net expectancy = p × W − q × L − C

Break-even p = ((1 − z) × L + C) / (W + L)

These gross/net labels assume pre-cost inputs. With net trade results, the first formula already gives net expectancy: leave extra cost at zero unless estimating a missing cost. Without flat trades, z = 0. With flats, loss rate is not simply 100% minus win rate.

The probability-weighted formula follows CME Group's mathematical expectation lesson. Solving net expectancy = 0 gives the break-even formula above; it is an algebraic threshold, not a required trading target.

A 100-trade example you can reconcile

Assume 40 winners average $200, 60 losers average $100, and no flats. Commission is $2 on entry plus $2 on exit; spread and slippage add $4 per completed trade. Average round-trip cost is $8. These are hypothetical inputs, not observed returns.

CalculationResult
Winning P&L40 × $200 = $8,000
Losing P&L60 × −$100 = −$6,000
Gross expectancy($8,000 − $6,000) / 100 = $20
Total extra costs100 × $8 = $800
Net expectancy($2,000 − $800) / 100 = $12
Break-even win rate($100 + $8) / ($200 + $100) = 36%

Without costs the threshold is 33.33%. At $20 per trade in costs, this sample breaks even; at $25, it averages −$5. Its gross profit factor is 8,000 / 6,000 = 1.33. The $12 net expectancy answers a different question: the amount left per trade.

If 10 of the 60 losers instead close flat, hold W, L and C fixed: gross expectancy becomes 0.40 × $200 − 0.50 × $100 = $30, and net becomes $22. Those 10 flats still count in the denominator and still incur the assumed average cost.

R multiples and changing position sizes

Define R from each trade's initial planned monetary risk. With fixed $100 initial risk, the worked example has a 2R average winner, 1R average loser and 0.08R cost. Gross expectancy is 0.20R and net expectancy is 0.12R. Average loss is only equal to 1R if the recorded exits actually average that amount.

Variable sizing changes the comparison. A +$100 trade risking $100 is +1R; a −$200 trade risking $400 is −0.5R. Their mean is +0.25R, while dollar expectancy is −$50. Dividing −$50 by the $250 average risk gives −0.20, which is not mean R. Normalize each trade first; never mix currency and R inputs.

A positive mean still has sample uncertainty

The inputs above omit sample size and the spread of individual results, so the calculator cannot estimate confidence bounds. Two samples can share the same averages but have different tail losses. Check expectancy with and without the largest winner, report both, and investigate the difference instead of quietly dropping outliers.

For approximately independent observations where a t interval is appropriate, a 95% mean interval is x̄ ± t × s / √n. Using a hypothetical n = 100, mean net P&L of $12, standard deviation s = $150, and t = 1.984 gives $12 ± $29.76, or −$17.76 to $41.76. The interval includes zero. This is an illustrative uncertainty calculation, not an output inferred from the inputs above. See NIST's confidence limits for the mean.

Overlapping positions, clustered losses, heavy tails and selecting the best backtest can invalidate a naive interval. Separate training and untouched test periods, keep strategy rules fixed, and examine drawdown and losing sequences alongside expectancy. Historical results do not guarantee future returns. This tool provides calculations for education, not investment advice.

Reconcile TradingView results before comparing

  1. Choose one symbol, timeframe, date range, currency and definition of a closed trade. Keep simulated and actual fills separate.
  2. Review commission and slippage settings. TradingView models commission and slippage separately; include only missing costs in this calculator.
  3. Count winners, losers and flats against the same total. Divide total net P&L by all closed trades as the reference mean.
  4. Check partial exits and position sizing before comparing dollar or R results. Exclude open positions from a closed-trade mean.

TradingView documents its cost simulation settings and defines Average PnL using completed trades. Missing costs and inconsistent trade grouping are reasons to investigate a mismatch, not evidence that either figure predicts live performance.

Sources checked October 17, 2026. Formula extensions and numerical examples are derived on this page.

Trading expectancy questions

Check the trades behind the average

Pineify Trading Journal records trades and shows win/loss statistics for reviewing your sample. Keep execution notes and reconcile the average with total net P&L divided by closed trades, especially when some trades finish flat.

Explore Trading Journal

For a simulated sample, Backtest Deep Report accepts a TradingView List of trades CSV for further distribution and risk analysis. It expects trade records, not an OHLC price CSV. This calculator accepts summary inputs only; neither a report nor a journal establishes that an edge will persist.