A backtest runs a trading rule over past prices and reports what would have happened. TradingView can do it on the free plan, and it’s a great way to learn how a strategy behaves. It’s also very easy to fool yourself with one. This guide shows how to run a backtest on the free plan, how to read the report, and the five most common ways a backtest lies.
Education, not investment advice. I’m not showing any backtest results here on purpose: a good-looking past result is not evidence that a strategy will make money. Any ticker mentioned is an example only. The TradingView link on this page is an affiliate link. Checked on TradingView on November 26, 2026. Disclosures.
In this guide
What a backtest is
An indicator draws something on a chart. A strategy goes one step further: it has rules for when to enter and exit, and TradingView’s backtesting engine (the “broker emulator”) pretends to place those orders on every bar of history. At the end you get a report with the trades it would have made and the resulting profit or loss.
That’s useful for one thing above all: understanding how a rule behaves. How often does it trade? How deep do its losing streaks get? Does it do anything differently from simply buying and holding? Those questions are worth asking. “Will this make me money?” is not one a backtest can answer.
What the free plan includes
Strategy backtesting is on every TradingView plan. The differences are in the report and the amount of history:
| Feature | Basic (free) | Essential and Plus | Premium and Ultimate |
|---|---|---|---|
| Run strategies on the chart | Yes | Yes | Yes |
| Basic report metrics | Yes | Yes | Yes |
| Advanced report metrics | No | Yes | Yes |
| Export trades (CSV) and report (XLSX) | No | Yes | Yes |
| Deep backtesting (full price history) | No | No | Yes |
| Tick-level order execution | No | No | Yes |
| Historical bars | 5,000 | 10,000 | 20,000 (Premium), 40,000 (Ultimate) |
Source: tradingview.com/pricing, “Compare plans,” checked November 26, 2026.
On a daily chart, 5,000 bars is roughly 20 years of trading days, which is plenty for learning. On short intraday timeframes it’s a few months or less, so test on daily or weekly charts while you learn. For what else is on the free plan, see Is TradingView Free?
How to run a backtest on the free plan
You need a strategy script. There are two easy ways to get one.
Option 1: use a built-in strategy
Click Indicators, metrics, and strategies at the top of the chart and look through the strategies TradingView ships with. Adding one to the chart runs the backtest automatically.
Option 2: have AI turn your indicator into a strategy
If you built the moving-average indicator in Episode 1, you can ask ChatGPT or Claude to turn it into a strategy:
Convert this Pine Script v6 indicator into a strategy for backtesting. Enter a long position when the 50-day SMA crosses above the 200-day SMA and exit when it crosses below. In the strategy() call, set commission to 0.1 percent per order and slippage to 2 ticks. Add comments in plain English. Output only the code. [paste your indicator code]
The commission and slippage numbers in that prompt are placeholders. Replace them with what your broker actually charges. The point is to never backtest with costs set to zero, which is the default in Pine Script.
Then run it
- Open the Pine Editor at the bottom of the chart, paste the strategy code, and click Add to chart.
- Switch to the daily timeframe on a symbol with a long history. SPY works as an example only.
- Open the strategy report panel at the bottom of the screen. If you see a message that trades are required, the strategy hasn’t made any trades with the current settings or date range.
- Open the strategy’s settings and check the Properties: initial capital, order size, commission and slippage. TradingView groups the order-fill settings in a “broker emulator” section at the bottom.
Read the report
TradingView’s help center describes the report’s Metrics tab, which opens with four key stats:
- Total PnL: the overall profit or loss over the test period.
- Max drawdown: the largest drop from a peak in the strategy’s equity. TradingView reports it in currency and as a percentage.
- Profitable trades: the share of closed trades that made money.
- Profit factor: gross profit divided by gross loss. Above 1 means winners outweighed losers in this test.
Under the key stats, the performance chart plots the strategy’s cumulative profit and loss. Turn on the Buy and Hold line, a gray dashed line showing what simply holding the symbol would have done over the same period. If your strategy spends most of the chart below that line, all that trading didn’t beat doing nothing.
The trade list matters more than the summary. Scroll through it. A total that comes from two lucky trades out of forty is a very different thing from steady results across forty.
Why backtests lie
Every one of these makes a backtest look better than reality. Most beginners hit at least two.
1. Overfitting
If you tweak the settings until the result looks great (a 47-day average instead of 50, a stop at 3.2% instead of 3%), you’re fitting the strategy to the past, including its noise. It will look brilliant on that history and usually worse on anything else. A simple check: tune the settings on one date range, then test on a later range you didn’t look at. If the result falls apart, it was overfit.
2. Look-ahead bias
A backtest can accidentally use information that wasn’t available at the time. Classic examples are a strategy that decides on a bar’s closing price but fills at a price from earlier in that bar, or a Pine Script that pulls data from another timeframe with look-ahead turned on. TradingView’s broker emulator has an order execution delay setting (“One tick”) that stops orders from filling on the same tick they were created, which is one guard against this.
3. Fees and slippage
Real trades cost money and rarely fill at the exact price on the chart. Pine Script strategies default to zero commission and zero slippage, so a strategy that trades often can look profitable only because it’s trading for free. TradingView’s broker emulator lets you set commission as a percent, a fixed amount per order, or per contract, and slippage as a number of ticks. For limit orders, the setting “Requested price and 1 tick beyond” only fills when price trades through your level, which is more conservative than assuming every touch fills.
4. Survivorship bias
If you backtest only on stocks that are popular today, you’re testing on the winners. The companies that failed or were delisted aren’t on your list, so the past looks kinder than it was.
5. Too few trades, one kind of market
Ten trades isn’t a sample. And a strategy tested only during a long rising market has never met a falling or sideways one. Check how many trades the report shows, and look at how the strategy did in different years, not just the total.
A backtest checklist
Before you believe a backtest, run through this:
- Commission and slippage set to realistic values, never zero.
- Compared against the Buy and Hold line.
- Enough trades to mean something, spread across different market conditions.
- Max drawdown you could actually sit through with real money.
- Settings tuned on one period and tested on another.
- Practiced with fake money before anything else, for example with TradingView paper trading.
If you want detailed metrics, exports, or deep backtesting over the full price history, those are on the paid plans; TradingView’s pricing page has the current details. You can learn every idea on this page on the free plan.
Frequently asked questions
Can you backtest on TradingView for free?
Yes. Strategy backtesting with basic report metrics is on every plan, including Basic. The free plan uses up to 5,000 historical bars.
What’s the difference between basic and advanced report metrics?
Basic shows the key stats for a strategy. TradingView describes the advanced metrics, which start on Essential, as “all backtesting metrics” for a complete picture, and Essential also adds CSV and XLSX exports.
Does TradingView include commission in backtests?
Only if the strategy sets it. Pine Script strategies default to zero commission and zero slippage, so set both in the strategy’s properties or in the strategy() call.
What is deep backtesting on TradingView?
A Premium and Ultimate feature that runs the backtest over the symbol’s full price history instead of only the bars loaded on the chart.
Does a profitable backtest mean a strategy works?
No. It means the rule would have made money on that particular history, with those settings and those cost assumptions. Overfitting, look-ahead bias, missing costs, and survivorship bias can all make a backtest look better than reality.
For one free-plan tool workflow each week, get The Trade Brief, a free Tuesday email.
