> ## Content Index
> Fetch the complete content index at: https://tctradinglab.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Win Rate Means Nothing Without This Number (Free TradingView Snippet)
- URL: https://tctradinglab.com/win-rate-expectancy/
- Published: 2026-11-25T16:57:16.000Z
- Updated: 2026-11-25T16:57:15.000Z
- Description: The formula that matters more than win rate, and a free snippet that shows it on any TradingView strategy.
- Author: Thomas Carvo

A strategy can win 90% of its trades and still lose money. Win rate tells you how often you're right. **Expectancy** tells you what each trade makes on average, and that's the number that decides whether a strategy makes money.

## The formula

**Expectancy per trade = (win rate × average win) − (loss rate × average loss)**

Say a strategy wins 90% of the time, makes $20 per win and loses $2,000 per loss:

0.9 × $20 − 0.1 × $2,000 = $18 − $200 = **−$182 per trade**.

Nine wins buy you dinner. One loss takes the rent.

## Add it to any TradingView strategy

1. Open your strategy in the Pine Editor.
2. Tap **Copy code** below and paste it at the very bottom of the script.
3. Save. A small table shows the trades, win rate, average win, average loss and expectancy per trade, from the Strategy Tester's own numbers.

Expectancy table for any strategy Copy code 

// ── Expectancy table (TC Trading) ─────────────────────────────
// Paste this at the very bottom of any strategy() script (Pine v5 or v6), then Save.
// It shows how many trades, the win rate, the average win and loss, and what each trade made on average.
var table tcExp = table.new(position.bottom_right, 2, 5, bgcolor = color.new(#0B1713, 5), border_color = color.new(#31E981, 60), border_width = 1)
if barstate.islastconfirmedhistory or barstate.islast
    tcN       = strategy.closedtrades
    tcWins    = strategy.wintrades
    tcLosses  = strategy.losstrades
    tcWinRate = tcN > 0 ? float(tcWins) / tcN : na
    tcAvgWin  = tcWins > 0 ? strategy.grossprofit / tcWins : na
    tcAvgLoss = tcLosses > 0 ? strategy.grossloss / tcLosses : na
    tcExpect  = tcN > 0 ? strategy.netprofit / tcN : na
    table.cell(tcExp, 0, 0, "Trades", text_color = color.white)
    table.cell(tcExp, 1, 0, str.tostring(tcN), text_color = color.white)
    table.cell(tcExp, 0, 1, "Win rate", text_color = color.white)
    table.cell(tcExp, 1, 1, str.tostring(tcWinRate * 100, "#.0") + "%", text_color = color.white)
    table.cell(tcExp, 0, 2, "Average win", text_color = color.white)
    table.cell(tcExp, 1, 2, str.tostring(tcAvgWin, "#,##0.00"), text_color = color.white)
    table.cell(tcExp, 0, 3, "Average loss", text_color = color.white)
    table.cell(tcExp, 1, 3, str.tostring(tcAvgLoss, "#,##0.00"), text_color = color.white)
    table.cell(tcExp, 0, 4, "Expectancy per trade", text_color = color.white)
    table.cell(tcExp, 1, 4, str.tostring(tcExpect, "#,##0.00"), text_color = tcExpect >= 0 ? #31E981 : #FF5C5C)

It works with Pine Script v5 and v6 strategies. If your script already has a table in the bottom-right corner, change `position.bottom_right` to another corner.

## What real data says

I tested three simple rule sets on SPY's full daily history, 1993 to 2026:

- A rule that **never closes a losing trade** (it only sells at +1%) won 178 of its 178 closed trades, a 100% win rate. While it waited, the account was down as much as 54%, and one trade took 4 years and 8 months to reach its +1%.
- On SPY, a rule that won 75% of its trades made more than one that won 44%. On QQQ it flipped: a 51% rule made more than a 68% one.
- None of the three beat simply buying and holding SPY over the same years.

Win rate on its own told me nothing. Expectancy, and how deep the losing trades went, told me what I needed to know.

## Want more free tools like this?

I share trading tools, scripts and walkthroughs on Instagram at [@tctradinglab](https://www.instagram.com/tctradinglab/?ref=tctradinglab.com) and on YouTube at [TC Trading](https://www.youtube.com/@tctrading?ref=tctradinglab.com).

*Don't have TradingView yet? [Get it here](https://tctradinglab.com/r/tradingview/). That's an affiliate link, so I may earn a commission at no extra cost to you.*

*Not financial advice. A backtest shows how rules would have done, not how they will do. Test anything before you trade it with real money.*