Skip to content
GetProfitable
Search

Net profit versus expectancy

Lesson 19 · about 11 min

The Strategy Tester opens on a big green or red number: net profit. It is the least useful figure on the panel. Net profit depends on the start date, the initial capital, the sizing rule and one or two lucky trades as much as on the rules you wrote. The numbers worth reading are per-trade and relative, and the tester has most of them if you know which tab to open.

The tabs

  • Overview: net profit, equity curve, drawdown curve, a few headline ratios.
  • Performance Summary: the full table: gross profit and loss, number of trades, percent profitable, average trade, average winner and loser, ratio of average win to average loss, largest win and loss, profit factor, max drawdown, commission paid, and more, split by long and short.
  • List of Trades: every entry and exit with date, price, quantity, profit, cumulative profit and run-up and drawdown per trade. This is where you verify the strategy did what you meant.
  • Properties: the settings the run used, including initial capital, commission, slippage and the date range. Check it before believing anything.

From net profit to expectancy

Expectancy, from the risk-management course, is the average result per trade: (win rate × average winner) − (loss rate × average loser). The tester gives you every input:

  • Percent profitable = win rate.
  • Avg winning trade and avg losing trade, in currency.
  • Avg trade = net profit ÷ number of trades, which is expectancy in currency directly.

In R, divide by the average dollars risked per trade. A strategy that risks 1% of $10,000 on every trade has 1R ≈ $100, so an average trade of $35 is +0.35R. If your sizing is risk-based (module 6), 1R is constant in percent terms and this conversion is honest. With percent-of-equity sizing, R varies per trade and the average is only approximate.

Profit factor = gross profit ÷ gross loss. Above 1 is profitable before the costs you forgot; 1.3 to 2.0 is a typical range for a real system with many trades; above 3 on a large sample deserves suspicion, not celebration.

Ratio of average win to average loss with percent profitable together tell you the shape of the system. A 35% win rate with a 3:1 ratio and a 70% win rate with a 0.5:1 ratio can have the same expectancy and feel completely different to trade.

Putting the numbers on the chart

The strategy.* namespace exposes the same statistics to the script, so a table can show them beside the equity curve:

//@version=6
strategy("Stats table demo", overlay=true, initial_capital=10000,
     default_qty_type=strategy.percent_of_equity, default_qty_value=10,
     commission_type=strategy.commission.percent, commission_value=0.05)
fast = ta.ema(close, 9)
slow = ta.ema(close, 21)
if ta.crossover(fast, slow)
    strategy.entry("Long", strategy.long)
if ta.crossunder(fast, slow)
    strategy.close("Long")

var table t = table.new(position.bottom_right, 2, 6, bgcolor=color.new(color.black, 60), border_width=1)
row(int r, string k, string v) =>
    table.cell(t, 0, r, k, text_color=color.white, text_size=size.small)
    table.cell(t, 1, r, v, text_color=color.white, text_size=size.small)

if barstate.islast
    trades  = strategy.closedtrades
    wins    = strategy.wintrades
    losses  = strategy.losstrades
    winRate = trades > 0 ? wins * 100.0 / trades : 0.0
    avgWin  = wins > 0 ? strategy.grossprofit / wins : 0.0
    avgLoss = losses > 0 ? strategy.grossloss / losses : 0.0
    avgTrade = trades > 0 ? strategy.netprofit / trades : 0.0
    pf = strategy.grossloss > 0 ? strategy.grossprofit / strategy.grossloss : 0.0
    row(0, "Trades", str.tostring(trades))
    row(1, "Win rate", str.tostring(winRate, "#.#") + "%")
    row(2, "Avg win / loss", str.tostring(avgWin, "#.##") + " / " + str.tostring(avgLoss, "#.##"))
    row(3, "Avg trade", str.tostring(avgTrade, "#.##"))
    row(4, "Profit factor", str.tostring(pf, "#.##"))
    row(5, "Max DD", str.tostring(strategy.max_drawdown, "#.##"))

strategy.grossloss and strategy.max_drawdown are reported as positive numbers. Multiplying by 100.0 before dividing keeps the win-rate arithmetic in floats, so the result is a percentage rather than a truncated count.

Reading a report honestly

Go through this order every time:

  1. Properties: are commission and slippage non-zero? Is the date range the one you think?
  2. Number of trades: fewer than about 100 means the rest is noise (next lesson).
  3. Avg trade relative to costs: if avg trade is $35 and commission plus slippage per round trip is $20, the edge is mostly cost.
  4. Largest winning trade as a share of net profit: if one trade is 40% of the total, remove it mentally and re-read.
  5. Percent profitable and win/loss ratio: can you trade this shape? A 30% win rate is arithmetic on paper and eight losses in a row in practice.
  6. Only then, the equity curve.

Key idea: Read the tester per trade: avg trade (expectancy in currency), profit factor, win rate with the win/loss ratio, and the largest trade's share of the total. Net profit is the output of those numbers and the sizing rule, not evidence on its own.

The long/short split

The Performance Summary splits every statistic into long and short. Many "profitable" strategies are one profitable side and one side that loses slightly less than the first makes. Reading the split usually tells you to drop a side or to give it different rules.

Try it: Run any strategy from module 6 and fill in a table by hand: trades, win rate, average winner, average loser, expectancy, profit factor, largest trade as a percent of net profit. Then compute expectancy in R using your risk per trade. Compare with the on-chart table above.

Recap

  • Net profit depends on start date, capital and sizing; per-trade statistics describe the rules.
  • Expectancy in currency is avg trade; in R, divide by average dollars risked; profit factor is gross profit over gross loss.
  • Win rate and win/loss ratio together describe the shape of the system and how it will feel.
  • Check Properties, trade count, avg trade versus costs, and the largest trade's share before the equity curve.
  • strategy.closedtrades, strategy.wintrades, strategy.grossprofit, strategy.netprofit and strategy.max_drawdown put the same numbers in a table.

See it drawn

Original diagrams for the ideas on this page. Illustrative, not real market data.

The spread of outcomes behind an expectancyA histogram of forty trades: a tall block of small losses on the left, a low spread of larger wins on the right, and a line marking the average outcome.NUMBER OF TRADES051024 LOSSES, AVG −$20016 WINS, AVG +$600EXPECTANCY +$120−$400−$200$0+$200+$400+$600+$800PROFIT OR LOSS PER TRADEexpectancy = (40% × $600) − (60% × $200) = +$120 per trade
Expectancy: the average trade. Forty trades sorted by outcome: 24 small losses and 16 larger wins. Weighting each side by how often it happens gives the average result per trade, marked here by the dashed line at +$120.
An equity curve and its drawdownAn account balance rising over a year, falling from a peak to a trough, then climbing back to the old peak.ACCOUNT EQUITY$20k$12k$8k024681012TIME (MONTHS)PEAK $16,000TROUGH $12,000DRAWDOWN−25%RECOVERY
Equity curve and drawdown. An account balance plotted month by month. The fall from the $16,000 peak to the $12,000 trough is a 25% drawdown, and the shaded area lasts until the balance climbs back to the old peak.
The win rate needed to break evenA falling curve: the more a winning trade pays relative to the amount risked, the smaller the share of trades that must win to break even.BREAKEVEN WIN RATE0%20%40%60%80%1:11:21:31:41:5REWARD-TO-RISK RATIO1:1 needs 50%1:2 needs 33.3%1:3 needs 25%breakeven win rate = 1 ÷ (1 + reward-to-risk)above the curve, wins more than cover losses
The win rate needed to break even. How often a method must win just to stay level, for each reward-to-risk ratio. At 1:1 half the trades must win, at 1:2 a third, and at 1:3 a quarter, because each win covers more losses.