Guide

Backtesting a strategy on TradingView

Updated November 25, 2026 · 4 min read

A backtest replays a strategy on historical data to see how it would have behaved. Done well, it is the best way to get to know a method before risking money on it. Done badly, it produces flattering, misleading results. Here is the method, step by step, in TradingView’s Strategy Tester.

Contents
  1. The Strategy Tester
  2. The right chart
  3. Realistic settings
  4. Enough history
  5. Reading the report
  6. Checking on the chart
  7. Traps to avoid
  8. With FloEdge

The Strategy Tester in a nutshell

On TradingView, only a strategy (a Pine Script script that places simulated orders) can be backtested: an indicator displays information but places no orders. When a strategy is added to the chart, the Strategy Tester at the bottom of the screen computes its trades on the loaded candles and shows a report: net profit, profit factor, drawdown, list of trades…

Step 1: the right chart

Test the strategy on the symbol, broker and timeframe it was designed for. On gold, prices differ slightly from one broker to another: the same script can give different results on two XAUUSD charts.

Step 2: realistic settings

In the strategy’s properties, check:

Without fees, a backtest almost always looks too good, especially for a strategy that trades often with small targets. TradingView fills simulated orders at chart prices and does not simulate the gap between bid and ask (the spread): to account for it, build it into the commission or the slippage.

Diagram of a simulated trade and its costsA candle gives the signal at its close; the order is filled slightly higher on the next candle: that is slippage. The stop and target are drawn on either side of the fill price. Commission, slippage and spread all belong in the backtest. fill price signal price slippage stop target Commission on entry and on exit Slippage fill price ≠ intended price Spread not simulated: add it to the fees
Diagram of a simulated trade and its costsA candle gives the signal at its close; the order is filled slightly higher on the next candle: that is slippage. The stop and target are drawn on either side of the fill price. Commission, slippage and spread all belong in the backtest. fill price signal price slippage stop target Commission on entry and on exit Slippage fill price ≠ intended price Spread not simulated: add it to the fees
Diagram: a simulated trade is never filled at the exact signal price. Commission, slippage and spread shrink every win and deepen every loss: a backtest without fees almost always looks too good.

Step 3: enough history

A result on 20 trades proves nothing: a few lucky trades are enough to tip it. Aim for at least a hundred trades, over several months and different market conditions (trend, range, high volatility). The number of candles loaded depends on the timeframe and on your TradingView plan; Deep Backtesting goes further back in history, depending on the plan.

Step 4: reading the report

MetricWhat it tells youWhat to watch
Net profitTotal gain or loss over the period, in dollars and as a % of capitalCompare it with the risk taken
Profit factorGross profit ÷ gross lossAbove 1, the strategy made more than it lost over the period
Max drawdownThe largest drop in capital from a peakCould you live through it with real money?
Winning tradesShare of trades closed in profitRead it together with the average win and average loss
Number of tradesSample sizeToo few trades: a fragile result

A high win rate is not enough: a strategy that wins $1 eight times and loses $5 twice is a losing strategy.

Step 5: check on the chart

The report does not tell the whole story. Scroll through the chart and look at the trades one by one: entry, stop, target. Bar Replay replays the market candle by candle: it is the way to check that signals really appear at the time shown and do not change afterwards.

XAUUSD 1-minute chart with FloEdge S/R: long entry in a support zone, stop and target boxes, Take Profit hit
Real example on the XAUUSD 1-minute chart, October 1, 2026: a long entry in a support zone, with the Take Profit hit 14 minutes later. Every backtest trade shows up on the chart like this, with its entry, stop and target. The strategy also has losing trades.

Traps to avoid

With FloEdge

The 8 FloEdge strategies (S/R, FVG/iFVG, VWAP, Scalp, ADX, Breakout, Precision and VWAD) can be backtested in TradingView’s Strategy Tester. The figures published on this site come from the 12-month Deep Backtesting, with each strategy’s default settings and the fees stated on each page; you can rerun the backtest yourself, with your own settings.

Compare the 8 strategies

This guide is educational: it is not investment advice. Trading involves a risk of capital loss. The examples are real cases chosen to illustrate an idea, not a promise of results.