TradingView backtesting guides

TradingView Deep Backtesting: coverage, limits and comparability

TradingView Deep Backtesting runs a strategy over a selected historical period beyond the chart dataset when that history is available. It requires Premium or higher. The report can differ from chart trades because the calculation starts on a different bar.

Official documentation checked October 17, 2026. Access and operation source

History ceiling

2 million bars

Actual coverage depends on symbol and timeframe.

Trade ceiling

1 million trades

A platform limit, not a target sample size.

Result location

Strategy Report

Chart markers remain the regular calculation.

Choose the period, then inspect the actual coverage

Open a strategy report and select the historical time range. Current TradingView instructions describe automatic Deep Backtesting activation with a pink indicator. After changing the strategy, use Update report; Reset to chart session returns to regular mode. See the current controls.

A requested date is not evidence that data exists. Daily and higher timeframes use the same available history as their charts. Intraday storage can cover a shorter period. If a selection exceeds two million bars, TradingView calculates on the most recent two million within that selection. Historical coverage rules.

A coverage calculation you can check

For a hypothetical uninterrupted 24-hour market, one-minute bars produce 1,440 bars per day. 2,000,000 ÷ 1,440 is about 1,389 days, or 3.8 years. This is only a ceiling calculation: listing dates, missing bars and stored-history limits can shorten the actual sample. It is not a promise of 3.8 years of minute data.

An empty selection produces a no-data error; a partly available selection may still calculate. Record the requested dates and the report's actual coverage separately. Changing timeframe changes the strategy experiment as well as its coverage, so do not compare a five-minute result with a daily result as though only history length changed.

Regular and deep calculation compared
CheckRegular backtestingDeep Backtesting
Calculation dataBars loaded in the chart dataset, including bars outside the visible viewport.Available history within the selected report period, subject to limits.
Calculation startThe first bar in the chart dataset.The start of available data in the selected period.
Where to inspect tradesChart markers and the regular strategy report.The deep report. Chart markers still belong to the regular run.
Date filter in PineRestricts orders on existing data; it cannot fetch older history.An additional order condition inside the selected calculation period.

Sources: calculation start and chart versus report trades. Deep Backtesting changes the historical calculation window. Bar Magnifier addresses intrabar fill simulation; it is a separate setting.

Compare three runs with identical parameters

This diagnostic experiment separates the calculation start from the dates on which orders are allowed. It is a reproducible procedure, not a published performance result. Use standard daily candles for COINBASE:BTCUSD and the script below. Confirm that your available history includes 2024 and 2025 before continuing.

  1. Keep the symbol, exchange, timeframe, candle type, source code and strategy properties fixed. The example uses EMA lengths 20 and 100, fixed size 0.01, initial capital 100,000, commission 0.1% and slippage of one tick. These are controlled example inputs, not recommended execution assumptions.
  2. Leave the entry inputs at January 1, 2025 through January 1, 2026 UTC, with the end excluded. The EMA calculations run on every available bar, even while entries are blocked.
  3. Run A, B and C below without editing the inputs. Refresh each report after its range changes. Save each report and its trade list with the run label.
  4. Compare first entry time, first exit time, total closed trades, net P&L and open-position status. Locate the earliest divergent trade before interpreting a difference in aggregate profit.
Three calculation windows with the same 2025 entry window
RunReport selectionWhat to record
A: regularReset to chart sessionRecord the chart dataset start and regular report. The viewport is not the test boundary.
B: deep, short warm-up2025-01-01 to 2026-01-10The EMAs start near the entry-window boundary. Record the first entry and total closed trades.
C: deep, earlier start2024-01-01 to 2026-01-10The added 2024 bars initialize the EMAs before entries are allowed. Keep both EMA lengths unchanged.

Pine Script v6 comparison strategy

//@version=6
strategy("Deep Backtesting comparison", overlay=true,
     initial_capital=100000, default_qty_type=strategy.fixed,
     default_qty_value=0.01, commission_type=strategy.commission.percent,
     commission_value=0.1, slippage=1, pyramiding=0)
fastLength = input.int(20, "Fast EMA", minval=1)
slowLength = input.int(100, "Slow EMA", minval=2)
entryStart = input.time(timestamp("01 Jan 2025 00:00 +0000"), "Entry start")
entryEnd = input.time(timestamp("01 Jan 2026 00:00 +0000"), "Entry end")
fast = ta.ema(close, fastLength)
slow = ta.ema(close, slowLength)
crossUp = ta.crossover(fast, slow)
crossDown = ta.crossunder(fast, slow)
entryWindow = time >= entryStart and time < entryEnd
if entryWindow and crossUp
    strategy.entry("Long", strategy.long)
if crossDown or time >= entryEnd
    strategy.close("Long")
plot(fast, "Fast EMA", color=color.blue)
plot(slow, "Slow EMA", color=color.orange)

Market orders use the broker emulator's default next-available-tick fills. The entry window gates order creation, not the fill timestamp. At the end boundary the script requests a close; the report extends to January 10 so a subsequent daily bar can fill it. Verify that the final position closed. The settings do not model every cost or execution constraint. Order execution documentation.

Interpret the difference without inventing a result

TradingView documents EMA and RMA dependence on the calculation start. Run C gives the averages pre-entry history; run B starts them at the entry boundary. Earlier initialization can change a crossover. A changed entry can then affect later positions, even after the averages have become close. Matching results are also possible: this experiment does not require a mismatch. Why start dates matter.

For a 100-period EMA, the weight of an initial-state difference after 300 updates is (99/101)300, about 0.00248. A hypothetical initial difference of 10 therefore shrinks to about 0.0248 if subsequent closes are identical. This arithmetic illustrates decay, not a universal warm-up length or a guarantee of matching trades.

If A has no 2025 bars, mark it unavailable instead of calling the result zero performance. If B and C disagree, inspect their first trades and settings. If they agree, retain that observation without concluding that every strategy is insensitive to its start date.

Keep parameter search separate from history selection

Once you have a comparable baseline, Pineify Strategy Optimizer can test selected input combinations and collect TradingView report results. For example, fast lengths 10, 20 and 30 with slow lengths 80 and 100 produce 3 × 2 = 6 combinations. Record all six under one fixed calculation window before changing the window.

TradingView still controls the available history and plan access. The extension applies parameters and waits for a report update; that does not establish compatibility with every account, report mode or TradingView UI revision. Check one combination against a manual run first, and stop if the report stays stale or a calculation fails.

For holdout evaluation, choose a separate period before inspecting its results, freeze the selected parameters and run it manually. Retuning after reading the holdout makes it part of the selection process. There is no universal profit-retention percentage that proves a strategy passed validation.

Analyze the exported sample

Pineify Backtest Deep Report imports a compatible TradingView trade-list CSV. Check its first and last trade, direction and closed-trade count against the intended report before analyzing it. A price-history OHLC export is not a substitute. Imported closed trades cannot reconstruct every intrabar equity observation.

Review the trade CSV analysis workflow
Explore Strategy Optimizer

Educational testing workflow, not investment advice. Historical simulations do not guarantee live results. Longer history cannot correct future-data leakage, unrealistic order fills or selection bias.

Deep Backtesting questions