To backtest a crypto strategy on TradingView, add a strategy script to your chart, set its properties to match how you would really trade (capital, size, commission, slippage), and open the strategy report below the chart. Judge the result on net profit, max drawdown, profit factor, the number of trades and the size of wins against losses. Then run the same settings on other coins and timeframes, and forward test before any real money goes in.
This guide walks through each step. As the worked example we use the published TradingView report of our own Price Action strategy, including the parts that don't flatter it.
- Only strategy scripts produce a strategy report. An indicator has to be tested by hand, for example with Bar Replay.
- Costs are off by default: TradingView applies no commission and zero slippage until you set them.
- Read five numbers first: total P&L, max drawdown, profit factor, number of trades, and average win against average loss.
- One chart is one sample. The settings that made +56.05% on Bitcoin's 4-hour chart had a median of +10.9% across 40 coins on the same timeframe, and 9 of the 40 lost money.
- Forward test on live data, with paper trading or a small size, before you trust a backtest with real money.
What a TradingView backtest does
A backtest replays a set of trading rules over past prices and records the trades they would have made. On TradingView this works only for scripts written as strategies (Pine Script strategy() scripts). They place simulated orders, and TradingView's broker emulator fills them and builds the strategy report in the panel below the chart, the panel many traders still call the Strategy Tester. An indicator only draws on the chart, so it has no report.
Two details shape every result, both from the Pine Script strategy docs:
- By default a strategy runs once at the close of each bar, and the emulator fills a new order at the open of the following bar. A signal on a 4-hour candle trades at the next candle's open, not at the close you saw.
- Past bars store only their open, high, low and close. The emulator has to assume how price moved inside each candle, which matters when a stop and a target both sit inside the same candle.
If your setup is an indicator or a discretionary idea, you can still test it by hand with Bar Replay, which plays past candles one bar at a time. It trains your eye, but it won't give you a report.
Step 1: Start with fixed rules that don't repaint
A backtest can only test rules a computer can follow without you: where to enter, where the stop goes, where to take profit and how big the position is. If any of these is "it depends", write down what it depends on first.
Then make sure the script doesn't repaint, meaning its past signals change after the fact. A repainting strategy shows trades on history that it could never have taken live. TradingView's support page on repainting lists the usual causes: strategies calculated on every tick, data pulled from a higher timeframe with request.security, and variables such as barstate, timenow and bar_index.
A simple check that needs no code: note the signals on a live chart, reload it a day later and see whether any past signal has moved or vanished. Our Price Action strategy, for example, draws a pattern only after its last turning point is confirmed and judges breakouts on candle closes only, so its past signals stay where they were.
Step 2: Set the properties to match real trading
Open the strategy's settings and go to the Properties tab. This is where most backtests go wrong, because the defaults are kinder than any exchange.
| Setting | TradingView default | Set it to | Our published charts |
|---|---|---|---|
| Commission | None | Your exchange's fee per side | 0.05% (Price Action), 0.1% (Smart DCA) |
| Slippage | 0 ticks | A few ticks on a liquid pair | 5 ticks |
| Initial capital | Set by the script | The amount you would really trade | 10,000 USDT |
| Margin | 100%, so no leverage | The leverage you would really use | Price Action caps leverage in its inputs; Smart DCA uses none |
| Pyramiding | Set by the script | Room for every planned entry | 0 (Price Action), 25 (Smart DCA) |
| Bar detalization | Default, 4 ticks per bar | High, if your plan offers it | High on Smart DCA |
TradingView applies no commission and zero slippage unless you set them. A strategy that trades often can look profitable at zero cost and lose money once real fees are in, so set both before you read a single number.
Commission. Use your own exchange's rate. As of November 2026, Binance lists 0.1% per side for a regular user on spot, and uses 0.02% for limit (maker) orders and 0.05% for market (taker) orders as the regular-user rates on USDⓈ-M futures. Our Price Action chart charges 0.05% per side and our Smart DCA chart 0.1%. Use the taker rate if your strategy enters with market orders.
Slippage. It is set in ticks, and the emulator fills market and stop orders that many ticks worse than the intended price. Don't overdo it either: TradingView's docs warn that "adding excessive simulated slippage can produce unrealistically worse testing results."
Margin. The defaults mean 1:1, no leverage. If you will trade futures with leverage, set the same margin here and check the report's margin-call rows. TradingView warns that unrealistic margin settings "can cause very misleading backtest results."
Bar detalization. The Default mode simulates four ticks per bar from its open, high, low and close. High, a Premium feature, uses lower-timeframe data for a finer path inside each candle. It matters most for strategies with many orders close together, like a DCA ladder.
Leverage and size deserve their own planning. Our guide on how to calculate position size shows how to size each trade from the amount you are willing to lose.
Step 3: Test enough history and enough trades
A result from one calm year says little about a crash. Try to cover a bull market, a bear market and a sideways stretch. Our Smart DCA chart runs from March 2018 to October 2026. Its longest cycle lasted 612 days, from November 2021 to July 2023. In that time Bitcoin fell 77% at its worst, and the open loss reached 17% of the account. A test that started in 2023 would never have shown that.
How far back your test reaches depends on your plan. According to TradingView's help center, a chart loads up to 5,000 intraday bars by default, 10,000 on Essential and Plus, 20,000 on Premium and 40,000 on Ultimate. On a 4-hour chart, 5,000 bars is about 2.3 years; on a 1-hour chart, under 7 months. Deep Backtesting, for Premium and higher plans, runs the strategy on all available history for the symbol, up to two million bars and one million trades. Its results appear only in the report, not on the chart.
Then count the trades correctly. TradingView lists one row per exit, so a position that closes half at a first target and the rest later shows up as two rows. Our Price Action report has 115 rows, but they come from 58 positions. The fewer positions you have, the more one or two trades can flip the result.
Step 4: Read the report, five numbers first
The report has dozens of figures. Start with these five. Here they are from our published Price Action chart: Bitcoin perpetual futures on Binance, 4-hour candles, 19 October 2019 to 24 October 2026, 10,000 USDT starting capital, 0.05% commission and 5 ticks of slippage.
| What to read | Price Action, BTCUSDT.P 4h | What it tells you |
|---|---|---|
| Total P&L | +5,604.79 USDT (+56.05%) | What was left after every fee, open trades included (none were open here). This report paid 322.42 USDT in commission. |
| Max drawdown | 6.03% intrabar, 4.08% close to close | The deepest fall from a previous high: what you would have had to sit through. |
| Profit factor | 2.491 | Gross profit divided by gross loss. Below 1 the strategy lost money. |
| Number of trades | 115 rows from 58 positions | How much evidence sits behind the other numbers. |
| Percent profitable, with average win and loss | 71.30%; average win 114.20 USDT, average loss 113.92 USDT | Whether the wins are big enough, and frequent enough, to pay for the losses. |
Use the intrabar drawdown. TradingView's main drawdown figure counts open trades at their worst price inside each candle. The close-to-close figure only looks at candle closes, so it is milder. On our Smart DCA chart the gap is wide: 17.77% intrabar against 10.29% close to close.
Read the win rate together with the size of wins and losses. On this chart the average win and the average loss are almost the same size. So the profit comes from winning more often: 82 wins of about 114 USDT make roughly 9,364 USDT of gross profit, against 33 losses of about 114 USDT, roughly 3,759 USDT. Divide one by the other and you get the profit factor of 2.49. A strategy with a 40% win rate can do just as well if its average win is much bigger than its average loss. Neither number means much without the other.
Two more checks before you move on. Look at the largest loss: here it was 210.97 USDT, equal to the planned risk of one trade (-1.0R, fees included), which shows the stops did their job. And look at the margin calls row: it should read 0. A strategy that only survives on paper because the emulator forgave a margin call won't survive a real account.
Every row of this report is on the Price Action results page, and our backtest methodology explains how each figure is counted.
Step 5: Run the same settings on other coins and timeframes
One chart is one sample, and the chart you test first is often the one the strategy was built on. So keep every setting the same, change only the symbol, and write down each result, including the bad ones.

We did exactly this for Price Action: the same default settings on 40 coins, on the 1-hour, 2-hour and 4-hour charts. The coins were fixed by a rule before any result was seen: the largest by market cap on 28 October 2026 that trade on Binance as both spot and perpetual futures, listed there for at least two years, with stablecoins, wrapped tokens and real-world assets left out. 94 of the 120 tests were profitable, with a median net result of +10.7%. On the 4-hour chart alone, 31 of 40 coins made money, with a median of +10.9%.
Two things stand out:
- The published chart was the best case. Bitcoin was the top coin of the 40 on the 4-hour chart: +55.1% in our multi-coin tables, which end on 27 October 2026, against +56.05% on the TradingView report, which ends on 24 October. Ethereum, with the same settings on the same timeframe, lost 2.5%.
- Coins left out of tuning did worse. The defaults were tuned on 13 of the 40 coins. On the other 27, 60 of 81 tests were profitable, with a median of +7.5%, against +10.7% overall.
That second gap is the reason to test on data the rules have never seen. TradingView's own docs put it plainly: "A strategy that suffers from overfitting often fails to perform well on new, unseen data." Overfitting means tweaking settings until they fit the past instead of the market. Academic work on the probability of backtest overfitting (Bailey, Borwein, López de Prado and Zhu, 2017) argues that standard defences such as a hold-out test "tend to be unreliable and inaccurate" for investment backtests. A single clean check is not a guarantee, and the more settings you try, the more sceptical you should be of the best one.
In practice:
- Change one setting at a time, and keep a list of every variation you tried.
- Keep a few coins or a recent stretch of time aside, and look at them only once, at the end. If you re-tune after looking, they become tuning data too.
- Prefer settings that work reasonably well everywhere over settings that work brilliantly on one chart.
- Test more than one timeframe. Our post on the best timeframe for crypto trading compares 1h, 2h and 4h with the same rules.
Step 6: Forward test before real money
A backtest can't show everything. It assumes your orders were filled, so it misses thin order books and fast moves. Our Price Action results also leave out futures funding fees. The only way to see these costs is to trade forward, on live prices.
- Paper trading. TradingView's Paper Trading account fills orders on real-time data. Run the strategy's signals there for a few weeks.
- Small size. Trade the smallest position your exchange allows, so the fills and fees are real but the risk is small.
- Compare. After a few weeks, put your live trades next to what the backtest shows for the same period. Big differences usually come down to fills, fees, or a script that repaints.
Common backtesting mistakes
- Leaving commission and slippage at zero.
- Trusting a strategy that repaints, or never checking whether it does.
- Judging by win rate alone, without the size of wins and losses.
- Drawing conclusions from a handful of trades.
- Tuning settings on the same data you then judge them on.
- Testing with leverage you would never actually use, or ignoring margin calls.
FAQ
How accurate is TradingView backtesting?
It is only as accurate as its assumptions. The emulator fills orders at the next bar's open and has to guess the path inside each candle, and live trading adds slippage, liquidity and funding costs. With realistic properties and a script that doesn't repaint, it is a fair first filter, not proof.
How much history does a TradingView backtest use?
The bars your chart has loaded, which depend on your plan: from 5,000 intraday bars by default up to 40,000 on Ultimate. Deep Backtesting, on Premium and higher plans, uses all available history for the symbol.
Can I backtest an indicator on TradingView?
Not with the strategy report: only strategy scripts produce one. You can test an indicator's signals by hand with Bar Replay, or have the indicator rewritten as a strategy with fixed entry, stop and exit rules.
Why did my backtest results change after I reloaded the chart?
Usually because the script repaints, because the chart loaded a different number of bars, or because the historical data itself changed. TradingView's repainting page lists the common causes.
The bottom line
A good TradingView backtest has costs set, a script that doesn't repaint, enough trades to mean something, and a second opinion from coins and timeframes it was not tuned on. Read the drawdown and the profit factor before the headline return, and treat the best chart as the best case, not the typical one. Backtest results are past results and don't promise future ones. To see what a full report and a 40-coin test look like for one strategy, open the Price Action results page. Every coin is listed there, the losing ones included.



