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
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:
- the initial capital and the position size (or the risk per trade);
- the commission, per order or per contract, as charged by your broker;
- the slippage, in ticks: the gap between the price you wanted and the price you got.
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.
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
| Metric | What it tells you | What to watch |
|---|---|---|
| Net profit | Total gain or loss over the period, in dollars and as a % of capital | Compare it with the risk taken |
| Profit factor | Gross profit ÷ gross loss | Above 1, the strategy made more than it lost over the period |
| Max drawdown | The largest drop in capital from a peak | Could you live through it with real money? |
| Winning trades | Share of trades closed in profit | Read it together with the average win and average loss |
| Number of trades | Sample size | Too 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.

Traps to avoid
- Over-optimisation: tweaking ten settings until the curve looks perfect on the past. The strategy then fits history… and much less the market to come. Test your settings on a different period from the one used to choose them.
- Repainting signals: a script that uses data not yet known at the time of the signal (for example the close of a higher-timeframe candle that has not finished) shows trades that were impossible live.
- Forgetting fees, or underestimating them.
- Mistaking a backtest for real results: execution, real slippage, outages, emotions… Past performance is not indicative of future results.
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.
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.