TradingView Strategy Tester: What the Backtest Is Actually Measuring
Learn how TradingView Strategy Tester uses Pine Script strategy orders, historical bars, costs, position sizing, and execution assumptions to produce backtest results.
Reviewed and updated September 24, 2026
TradingView Strategy Tester does not evaluate a trading idea in the abstract. It evaluates the orders produced by a Pine Script strategy across the available historical bars under the strategy's configured assumptions.
That distinction matters. If the Pine Script implements a different rule than the one you intended, the Strategy Tester can produce a precise-looking report for the wrong system.
What Strategy Tester needs
The script must use strategy() and submit simulated orders with strategy order functions. Indicators can display signals but do not create the trade history required for a strategy report.
Once orders exist, TradingView's broker emulator processes those simulated orders using chart data and the strategy's configuration.
Metrics to read together
- Net profit or return: the aggregate historical result under the selected assumptions.
- Maximum drawdown: the largest historical decline measured by the report.
- Trade count: how much historical evidence the headline metrics are based on.
- Profit factor: gross simulated profit relative to gross simulated loss.
- Win rate: useful context, but meaningless without average winner, average loser, and trade count.
- Individual trades: the fastest way to verify that the strategy is actually entering and exiting where the rules say it should.
Execution assumptions can change the result
Historical results depend on when the strategy calculates, when orders can fill, what price information is available, whether intrabar detail is used, and what commission or slippage is modeled.
Two scripts with the same high-level idea can produce materially different backtests if one enters on a different bar, ignores costs, or handles stops differently.
Common Strategy Tester mistakes
- Reading return without trade count. A large percentage based on very few trades can be fragile.
- Ignoring costs. Commission and slippage can materially affect active strategies.
- Optimizing many variables at once. Repeatedly tuning history can create a result that fits the sample rather than a durable rule.
- Testing different rules than the code you plan to use. Keep one canonical strategy specification.
- Trusting a smooth chart before checking individual trades. First verify that the order behavior is faithful to the intended system.
A better workflow
Start by writing the entry, exit, risk, timeframe, and execution logic in explicit language. Generate the Pine Script from those rules. Then verify a sample of historical trades against the specification before interpreting the performance report.
If you refine the strategy, preserve the original version. Comparing V1 with V2 is more informative than repeatedly overwriting parameters until the historical result looks attractive.
How Terrane uses the same idea
Terrane is designed around a structured strategy specification before the final TradingView code. The same approved rule set is used for the generated Pine Script and historical research so it is easier to inspect what the result actually represents.