All free tools

Trading metric

Trade Journal Statistics Calculator

Paste your trade results as a list of profit and loss values — one number per line, positive for wins, negative for losses. You get a full performance breakdown instantly: win rate, expectancy, profit factor, and max drawdown.

Win rate
46.67%
7 wins, 8 losses, 15 total trades
Profit factor
2.97
Profitable — gross profit exceeds gross loss
Expectancy per trade
94.67
1.052 R per trade
Net profit
1,420.00
Gross profit 2,140.00 — gross loss 720.00
Average win
305.71
Payoff ratio 3.40: 1
Average loss
90.00
Average losing trade (as a positive magnitude)
Max drawdown
12.54%
190.00 in the same units as your trades
Trades analysed
15
Sample is small — metrics are indicative only

What each metric means

Win rate is the share of trades that closed profitably. It tells you the shape of your distribution but nothing about the size of wins and losses, which is why it must always be read alongside the payoff ratio or expectancy. A 40% win rate can be excellent or terrible depending on those sizes.

Profit factor is gross profit divided by gross loss. Above 1.0 means the strategy made more than it lost in aggregate. The rule of thumb most systematic traders use is that a profit factor of 1.5 or above is worth investigating, and above 2.0 is strong — though sample size matters enormously. A profit factor of 3.0 on 10 trades is noise. On 300 trades it is a meaningful signal.

Expectancy is the average amount you make or lose per trade. It is the single number that predicts long-term performance because it combines win rate and payoff in one figure. Positive expectancy means the strategy adds value on average; negative means it subtracts it. For a deeper treatment, see the expectancy guide.

Max drawdown is the largest peak-to-trough decline in the running equity curve built from your trade list. It answers the most practically important question: how bad did it get? A strategy you cannot psychologically survive through its drawdown is one you will stop trading before the recovery arrives.

The payoff ratio is average win divided by average loss. Combined with the breakeven win rate — the minimum win rate needed to profit at this payoff ratio — it tells you whether your actual win rate is above or below the bar the strategy needs to clear. Use the breakeven win rate calculator to compute that threshold for any payoff ratio.

A note on sample size

All of these metrics describe the sample of trades you pasted. They say nothing about whether the future will resemble the past. A profit factor of 2.5 on 15 trades is not evidence of a robust edge — it is a small sample that could easily be luck. Most systematic traders want at least 50 trades before taking any metric seriously, and 200 or more before drawing strong conclusions. The tool flags small samples so the context is not lost in a row of encouraging-looking numbers.

What are TradingView and Pine Script?

TradingView is one of the most widely used charting and market-analysis platforms, where traders and analysts study price movement across stocks, crypto, forex, and futures on interactive charts. Pine Script is TradingView's own lightweight programming language, created so anyone can build custom tools that run directly on those charts.

People use Pine Script to build four main kinds of tools. Indicators calculate and plot values on the chart, exactly like the calculation above, but recomputed automatically on every bar. Strategies add explicit entry and exit rules and can be backtested against historical data in TradingView's Strategy Tester to see how they would have behaved. Screeners scan many symbols at once for conditions you define. Alerts notify you the moment a condition you specified occurs, so you do not have to watch the screen.

The value is precision and automation. Instead of eyeballing a chart, you describe exactly what you want measured, visualized, or notified about, and TradingView runs it consistently across any market and timeframe. That is why traders, analysts, and developers write Pine Script: it turns a manual charting idea into a repeatable tool. These tools are for tracking, visualizing, and testing market ideas; they do not tell you what to trade, and that decision always remains yours.

Writing that code by hand means learning Pine Script's syntax, its type system, and the exact names of hundreds of built-in functions. It is a real programming language, and small mistakes stop a script from compiling in the Pine Editor.

Turn this into Pine Script

You computed these statistics from a pasted list. When your rules are coded as a Pine Script strategy in TradingView, all of these metrics update live as trades close. The Pine Script code above builds a real-time dashboard directly on the chart using the strategy built-ins — the same numbers this tool calculated, running automatically on every new bar. Getting your rules into that strategy is where PineScripter comes in.

Pine Script v6
//@version=6
strategy("Trade statistics from Strategy Tester", overlay=true)

// ... your entry and exit rules here ...

// Pine Script's strategy built-ins give you the same statistics
// this tool computes from your pasted trade list.
// All of these update live as trades close.

winRate     = strategy.closedtrades > 0
    ? strategy.wintrades / strategy.closedtrades * 100 : na

avgWin      = strategy.wintrades  > 0
    ? strategy.grossprofit / strategy.wintrades  : na

avgLoss     = strategy.losstrades > 0
    ? strategy.grossloss   / strategy.losstrades : na

expectancy  = not na(avgWin) and not na(avgLoss)
    ? (winRate / 100) * avgWin - (1 - winRate / 100) * avgLoss : na

profitFactor = strategy.grossloss > 0
    ? strategy.grossprofit / strategy.grossloss : na

// Display key metrics as a table in the top-right corner
var table t = table.new(position.top_right, 2, 6, border_width=1,
    border_color=color.gray, bgcolor=color.new(color.black, 80))

if barstate.islast
    table.cell(t, 0, 0, "Metric",        text_color=color.gray,  text_size=size.small)
    table.cell(t, 1, 0, "Value",         text_color=color.gray,  text_size=size.small)
    table.cell(t, 0, 1, "Win rate",      text_color=color.white, text_size=size.small)
    table.cell(t, 1, 1, str.tostring(winRate, "#.##") + "%",
        text_color=color.white, text_size=size.small)
    table.cell(t, 0, 2, "Avg win",       text_color=color.white, text_size=size.small)
    table.cell(t, 1, 2, str.tostring(avgWin, "#.##"),
        text_color=color.green, text_size=size.small)
    table.cell(t, 0, 3, "Avg loss",      text_color=color.white, text_size=size.small)
    table.cell(t, 1, 3, str.tostring(avgLoss, "#.##"),
        text_color=color.red,   text_size=size.small)
    table.cell(t, 0, 4, "Expectancy",    text_color=color.white, text_size=size.small)
    table.cell(t, 1, 4, str.tostring(expectancy, "#.##"),
        text_color=expectancy >= 0 ? color.green : color.red, text_size=size.small)
    table.cell(t, 0, 5, "Profit factor", text_color=color.white, text_size=size.small)
    table.cell(t, 1, 5, str.tostring(profitFactor, "#.##"),
        text_color=color.white, text_size=size.small)

PineScripter is an AI built specifically for Pine Script. You describe what you want in plain English and it writes TradingView-ready v6 code. Because it is specialized on the Pine Script language and its exact function signatures, it tends to produce code that compiles far more reliably than general-purpose models like ChatGPT, which often invent functions that do not exist in Pine Script.

Related free calculators

From the blog

PineScripter is an AI developer tool that helps you write Pine Script code. It is not a financial advisor and will never offer financial, investment, or trading advice. Everything on this page, including the calculator and the explanations, is provided purely for educational and informational purposes. Any decision about how to interpret an indicator or trade a market is entirely your own. See our full disclaimer for more.