Explainers / Is TradingView backtesting accurate?
Is TradingView backtesting accurate?
TradingView's Strategy Tester does what it says it does: it replays your strategy over past bars and fills orders by a fixed set of rules. The arithmetic is not the problem. The problem is the assumptions, most of which are set by whoever wrote the strategy, and several of which are generous by default.
So the honest answer is: a TradingView backtest is as accurate as its settings. Here is what the tester assumes, and a six-step check you can run on any strategy.
How the Strategy Tester fills an order
On historical bars, TradingView only knows each bar's open, high, low and close. It does not know the order in which those prices happened. So it uses a rule:
- A strategy calculates after the bar closes. A market order placed then fills at the next bar's open.
- Inside a bar, it assumes a path: if the open is nearer the high, it assumes open, high, low, close. Otherwise open, low, high, close.
- It assumes no gaps inside a bar. A stop or limit inside the bar's range is treated as filled at its price.
That rule is reasonable. It is also a guess. On a bar where both your stop and your target sit inside the range, the tester decides which came first from the open alone, not from what actually happened.
Six things that make a backtest look better than it was
- Costs set to zero. Commission and slippage are whatever the author typed into the strategy, and that is often zero. Open the strategy's Settings → Properties and read them. On a strategy that trades often, costs are usually the single biggest difference between a backtest and an account statement.
- Limit fills at the exact price. By default a limit order fills if price merely touches it. In live markets a touch often does not fill you. The "Requested price and 1 tick beyond" setting is the stricter choice.
- The intrabar guess. Tight stops and targets on large bars are where the open-high-low-close assumption matters most. Bar Magnifier (below) reduces this.
- Heikin Ashi, Renko and other synthetic charts. TradingView's own manual calls results on these "typically unrealistic", because fills use prices that never traded. Run the test on standard candles, or make sure the strategy uses
fill_orders_on_standard_ohlc. - Repainting. If the strategy uses a higher-timeframe value without a one-bar offset, or recalculates on every tick, history can contain signals that were not available at the time. See What is repainting on TradingView?.
- Too few trades, and too many settings tried. Twenty trades is an anecdote. And if the settings were chosen by trying many combinations, the best one will look better on the past than it will on the future.
What Bar Magnifier and Deep Backtesting change
- Bar Magnifier replaces the intrabar guess with lower-timeframe data (for example, 10-minute bars inside a 60-minute chart). It can also let a stop exit on the same bar as the entry. It is capped at 200,000 lower-timeframe bars, so on long histories the earliest trades can still use the guess.
- Deep Backtesting tests a longer history and keeps every trade in the list (the default keeps per-trade detail for the latest 9,000 trades). More history is more evidence, not more accuracy: it does not change any of the fill assumptions above.
A quick check for any strategy
- Properties tab: commission, slippage, order size, and initial capital. Set costs to what your broker actually charges plus a tick or two of slippage.
- Limit fill setting: switch to "Requested price and 1 tick beyond" and see what changes.
- Chart type: standard candles.
- Bar Magnifier on (if your plan has it). If results move a lot, the original relied on the intrabar guess.
- Number of trades in the summary. Fewer than about 100 is too few to tell much.
- Bar Replay through a few signals to check they appeared at the time (see the repainting guide).
If the results survive all six, you have a backtest that is honest about its own assumptions. That still is not a forecast.
Our free TradingView script Cost Hurdle shows the cost a strategy has to clear before it earns anything, on your chart.
Where it fails
- Real fills depend on liquidity and your broker, which no backtest models: partial fills, queue position, spreads that widen at the open and on news.
- Bar Magnifier is still bars, just smaller ones. It reduces the intrabar guess; it does not remove it.
- Settings differ by plan and change over time. We describe the tester as documented on the date above; check your own Properties tab.
- An honest backtest of a weak idea is still a weak idea. Accuracy and usefulness are different questions.
Educational content only. Not financial advice. Nothing here is a recommendation to buy or sell anything.
Also explained: Repaint checker, VWAP, Supertrend, RSI, UT Bot Alerts, Nadaraya-Watson Envelope, Squeeze Momentum, What is repainting on TradingView?, Chandelier Exit, WaveTrend Oscillator, QQE MOD, Pivot highs and lows, Hull Suite, Range Filter, Twin Range Filter, HalfTrend, ZigZag++, SSL Hybrid, CM MacD Ultimate MTF, Volume Profile / Fixed Range, ADX and DI, Support Resistance Channels, Market Structure Break & Order Block, Order Block Finder, Pivot Point SuperTrend, Trendlines with Breaks [LuxAlgo], Divergence for Many Indicators, TradingView script selling terms, Support and Resistance Levels with Break, Liquidity Swings [LuxAlgo], Pine Script errors, Breakout Probability (Expo), Did ChatGPT or Claude write your Pine Sc, Lorentzian Classification, SuperTrend AI (Clustering), Machine Learning Adaptive SuperTrend, Dynamic Swing Anchored VWAP, Support and Resistance Power Channel by , Support and Resistance (High Volume Boxe, Trendline Breakouts With Targets by Char, Breakout Finder by LonesomeTheBlue
Get the next teardown by email
One short email when a new teardown or free tool goes live, about twice a month. No signals, no hype. Unsubscribe in one click.
Almost done. Check your inbox and click the confirmation link.
Sent with Kit. Your address is used only for these emails. Privacy
No TradingView account yet? This affiliate link gives you a $15 coupon toward a paid plan, and we earn a commission if you buy one. The free plan is enough to follow this page.