Is TradingView backtesting accurate?
As accurate as its settings. The Strategy Tester replays your script's orders against the chart's candles, and its defaults decide the answer: no commission, no slippage, the moves inside each candle guessed from its open, high, low and close, and, in Pine v6, every order sized at 100% of equity under a margin rule that can skip entries. On an RSI(2) strategy on SPY from 2016 to 2026, the margin rule alone turned 90 trades into 34.
What it assumes by default
Each default below is from TradingView's own Pine manual, reference or pricing page. Most can be changed in the strategy() declaration or in the strategy's Settings, under Properties.
| Setting | Default | What it does | Fix |
|---|---|---|---|
| Commission | none | Every result is too kind. | Set commission_type and commission_value. |
| Slippage | none | Every order fills at the exact price. | Set slippage, or add a percent to the commission. |
| Order size and margin | 100% of equity, margin 100 | A long may spend only its own cash, so an entry that costs more at the fill is skipped. | Set margin_long = 0, or size under 100%. |
| Fill timing | next open | Orders made on a candle's close fill at the next candle's open: realistic. | Leave process_orders_on_close off. |
| Inside a candle | guessed | The path runs from the open to whichever extreme is nearer, then the other. A stop and a target inside one candle can fill in the wrong order. | Bar Magnifier on Premium and Ultimate, or a lower timeframe. |
| Limit orders | fill on touch | Filled as soon as price reaches the limit, which a thin market might not do. | Set backtest_fill_limits_assumption. |
| Chart type | the chart's own | On Heikin Ashi, Renko and other synthetic charts the orders fill at synthetic prices. | Test on standard candles. |
| History | the chart's candles | 5,000 on the Basic plan: twenty years of daily candles, a few months of 5-minute ones. | A paid plan, or Deep Backtesting from Premium. |
| A held-out period | none | The whole result is in sample: tuned and judged on the same data. | Test a later period by hand. |
Worked example: the margin default on one strategy
The RSI(2) pullback on SPY from the how-to, 4 January 2016 to 19 October 2026, run in our tester, which follows TradingView's order rules here. Once as built, with margin_long = 0, and once with Pine's default margin restored:
| Margin | Trades | Before costs | After costs |
|---|---|---|---|
| margin_long = 0 | 90 | +42.8% | +24.8% |
| Pine's default, 100 | 34 | +21.2% | +15.3% |
At 100% of equity the order size is worked out from the close of the candle that triggered it. When the next candle opens higher, the order costs more than the cash, and the default margin refuses it: 56 of the 90 entries went that way, and nothing in the result says so except the trade count. The before-and-after columns are the second default at work: the costs TradingView leaves at zero took 18 points of the 42.8.
How much history each plan gives
The Strategy Tester runs on the candles the chart has loaded. On daily candles even the Basic plan's 5,000 cover about twenty years. On intraday candles the limit bites:
| Plan | Candles | 5-minute candles cover |
|---|---|---|
| Basic | 5,000 | about 64 sessions |
| Essential and Plus | 10,000 | about 128 sessions |
| Premium | 20,000 | about 256 sessions |
| Ultimate | 40,000 | about 513 sessions |
Counted in regular US sessions of 78 five-minute candles. Deep Backtesting, from Premium, tests the whole history rather than what the chart has loaded.
Before you trust a TradingView backtest
- Costs are setcommission_type, commission_value and slippage in the declaration, at least what your broker and the spread cost.
- The margin cannot skip entriesmargin_long = 0, or an order size under 100% of equity. Count the trades against the entries you expect.
- Orders fill at the next openprocess_orders_on_close off, and entries read from candles that have closed.
- The chart is standard candlesNot Heikin Ashi, Renko or another synthetic type, unless fills use standard prices.
- There are enough tradesTwenty or more, over at least a year. Fewer, and the result could be luck either way.
- A later period was held outSettings chosen on the earlier part, the later part run once, unchanged.
Our free tester starts from the other side: costs on, next-open fills, and the last stretch held out and judged in one word. The details are in commission and slippage, explained and out-of-sample testing.
Questions
Usually the settings. By default a strategy pays no commission and no slippage, the path inside each candle is guessed from its open, high, low and close, and limit orders fill as soon as price touches them. Live, you pay the spread and fees, and fills are not guaranteed.
Not unless you set it. commission_value defaults to 0. Set commission_type and commission_value in the strategy() declaration, or in the strategy's Settings under Properties.
Often the margin. A Pine v6 strategy sizes each order at 100% of equity by default, and the default margin of 100 lets it spend only its own cash, so an order that costs a little more by the time it fills is skipped. Set margin_long = 0, or size the orders below 100%.
A setting on the Premium and Ultimate plans that fills a strategy's orders using a lower timeframe's candles instead of guessing the path inside each candle. Choose High in the strategy's bar detail setting, or add use_bar_magnifier = true to the declaration.
Sources, read on 20 October 2026: TradingView's Pine Script manual, “Strategies” (the broker emulator, intrabar assumptions, bar detail on Premium and Ultimate, limit orders, non-standard charts), the Pine Script v6 reference for strategy() (default order size and margin), its pricing page (historical candles per plan) and its help page on Deep Backtesting. The numbers are our engine's, on our daily data. TradingView belongs to its owner, and Alpha Charts is not affiliated with it.