◆ New — Strategy Validator, Code Fixer & Prop Compliance Checker are live. Try one free →
Home / Learn / TradingView Strategy Tester Explained: Every Metric, Honestly
TradingView

TradingView Strategy Tester Explained: Every Metric, Honestly

A metric-by-metric walkthrough of the TradingView Strategy Tester — net profit, profit factor, max drawdown, percent profitable, Sharpe, average trade and the rest — including which numbers are easy to game, which rest on unrealistic fill assumptions, and why almost none of them mean much on a small trade count. This is educational material only, not financial advice; every figure in the tester describes the past under simulation assumptions, and trading carries a real risk of loss.

What do the numbers in the TradingView Strategy Tester mean?

The Strategy Tester panel is the report card of TradingView's broker emulator: it replays your strategy() script against historical bars, simulates fills under the properties you declared (commission, slippage, sizing), and summarises the resulting trade list as performance metrics. Every number in it is therefore two things at once — a summary of your logic's historical behaviour, and a product of the simulation's assumptions. Reading the panel well means keeping both in view.

The panel has several tabs. Overview shows the equity curve and headline figures: net profit, total closed trades, percent profitable, profit factor, max drawdown, average trade, and average bars in trades. Performance Summary expands this into the full table — gross profit and gross loss, buy-and-hold comparison, Sharpe and Sortino ratios, largest win and loss, commission paid, and long/short breakdowns in separate columns. List of Trades is the raw record: every entry and exit with prices, bar times, position size, and per-trade profit — this is the tab that gets audited, because aggregate metrics can hide what individual fills reveal. Properties restates the settings the run used: initial capital, commission, slippage, fill timing. Check it first, not last; a beautiful summary computed under zero costs is answering a question you did not mean to ask.

One framing before the definitions: the tester reports description, not expectation. Nothing in the panel — however green — is evidence about future performance, and this article is educational only. The sections below define the core metrics, then get to the honest part: which ones can be gamed, which assume fills you will not get live, and how large a sample you need before any of them stabilise.

The core metrics, defined precisely

Net profit is gross profit minus gross loss minus commission — the equity curve's end point relative to its start, in currency and as a percent of initial capital. It is dominated by your largest trades, which is why it should never be read without the trade list.

Gross profit / gross loss are the summed wins and summed losses separately. Their ratio is the profit factor: gross profit divided by gross loss. A profit factor of 1.0 is breakeven before rounding; below 1.0 the strategy lost money. Because it is a ratio of sums, one outlier win can hold an otherwise-losing system above 1.0.

Max drawdown is the largest peak-to-trough decline of the equity curve, including open-position losses measured intrabar. It is a single worst episode, not a typical one — and it is sample-length dependent: longer tests mechanically discover deeper drawdowns.

Percent profitable is winners divided by closed trades. It says nothing alone: a 90% win rate with small wins and rare large losses can lose money overall, which is why it must be read against the ratio of average win to average loss.

Average trade is net profit divided by trade count — arguably the most important single figure, because it is the number that commission and slippage attack directly. If average trade is smaller than a realistic round-trip cost, the strategy has no simulated edge at all.

Sharpe and Sortino ratios are computed from periodic (monthly) returns of the equity curve, so a two-year backtest gives them roughly two dozen data points — an estimate with enormous uncertainty. Buy & hold return benchmarks against simply holding the symbol; a strategy that trails it took trading risk for less than doing nothing. Commission paid, largest win/loss, and avg # bars in trades complete the picture — the last one tells you whether the strategy's holding period even matches your intent.

Which metrics are gameable?

Every aggregate metric can be pushed around by design choices that add nothing real. Knowing the standard tricks is the fastest way to read a published backtest critically — including your own.

Percent profitable is the easiest to inflate. Use a wide stop and a tight target and most trades close as small winners, with occasional large losses carrying all the risk. The panel shows an impressive win rate while average win shrinks relative to average loss. Always read percent profitable jointly with the avg-win/avg-loss ratio; either alone is close to meaningless.

Profit factor bends to outliers. Because it is a ratio of summed wins to summed losses, a single lucky trade — one trend catch, one gap — can carry the whole figure. Sort the List of Trades by profit and mentally delete the top one or two trades; if the profit factor collapses, the metric was describing an anecdote.

Net profit rewards overfitting directly. It is the default optimisation target in TradingView's inputs optimisation, and the parameter set that maximises it on one history is precisely the set most fitted to that history's noise. Bailey, Borwein, López de Prado and Zhu formalised this as the probability of backtest overfitting: the more configurations you try, the better the best one looks by selection alone, with no skill required.

Sharpe is gameable by brevity and by selection. Short histories produce unstable Sharpe estimates, and picking the best of many tried strategies inflates the winner's Sharpe — the effect López de Prado and Bailey's deflated Sharpe ratio explicitly corrects for, and the same multiple-testing problem White's reality check and Hansen's SPA test address in the academic literature.

None of these tricks require dishonesty. They happen by default when you iterate on a strategy while watching the panel. The defence is structural — held-out data, few iterations, cost stress — not willpower.

Which numbers assume unrealistic fills?

Several tester figures rest on simulation assumptions that live trading will not honour, and it pays to know which ones inherit the most fantasy.

Everything inherits the cost settings. With default properties, commission and slippage are zero, so every currency figure — net profit, average trade, profit factor — is computed in a frictionless market. The Commission paid row telling you 0 is the tester quietly disclosing this. The fix is one line:

//@version=6
// Educational only — validate before trading; not financial advice.
strategy("Costed run", overlay = true,
     commission_type = strategy.commission.percent,
     commission_value = 0.05,
     slippage = 2)

Intrabar exits inherit a guessed path. Historical bars record OHLC, not the path price took between them. When a stop and a target both fall inside one bar, the emulator must assume which was touched first — and that assumption systematically flatters tight-stop/tight-target strategies, where the guess is invoked constantly. The bar magnifier feature substitutes lower-timeframe data for part of the guess; wide-stop strategies on higher timeframes invoke it rarely and are less exposed.

Limit orders inherit optimistic queue treatment. The emulator fills a limit the moment price touches it. Live, a touched limit may not fill at all. Strategies whose edge concentrates in passive fills therefore backtest better than they trade, and backtest_fill_limits_assumption (requiring penetration by N ticks) is only a partial correction.

Max drawdown inherits all of the above and adds gap risk. Live drawdowns include weekend gaps, slippage on stops in fast markets, and fills through your level — so the tester's worst episode is best read as a lower bound on what the same logic would have endured.

The practical habit: before admiring any metric, open the Properties tab and ask what world it was computed in.

How many trades before any of this means anything?

The quiet assumption behind every tester metric is that the trade sample is large enough for averages to be more signal than noise — and on most published backtests, it is not.

The statistics here are not exotic. The uncertainty of an estimated average trade shrinks with the square root of the number of trades: quadrupling the sample halves the noise. With a dozen trades, the average trade, win rate, and profit factor are all essentially anecdotes — a run of results that could plausibly reorder into a loss. There is no single magic threshold, because the required sample depends on how variable the individual trade outcomes are (a scalper's tight distribution stabilises faster than a trend-follower's fat-tailed one). But the direction is not negotiable: tens of trades support only weak statements, and confidence grows slowly, not linearly, as trades accumulate.

Sample size interacts viciously with the selection problem from earlier. Bailey and López de Prado's work on the deflated Sharpe ratio and minimum backtest length makes the point quantitatively: the more strategy variants you evaluated, the longer the track record you need before the best one's performance is distinguishable from luck. A high Sharpe from a short window, selected from many attempts, is close to the expected outcome under zero skill — which is why it is the standard shape of an overfit result.

So a reading order that keeps you honest: Properties tab first (what world was simulated?), trade count second (is there a sample here at all?), average trade against realistic round-trip cost third, then — only then — the headline metrics, with the outlier check on the trade list. ForexCodes' Audit automates the mechanical parts of that checklist for Pine strategies, but the posture matters more than the tooling: the tester is a description of one past under stated assumptions. It is not a forecast, nothing here is financial advice, and trading carries a real risk of loss.

Key takeaways

Educational only — not financial advice. Trading involves substantial risk of loss.

Catch the bug that compiles.Run auditGet Pro