How to Backtest TradingView Strategies Outside TradingView

Last updated: 28 October 2026

//@version=5strategy("My idea") fast = ta.sma(close, 20)if ta.crossover(...)strategy.entry(...) Independent backtest Your data. Your dates. Your costs.

Can you backtest a TradingView strategy outside TradingView? Yes. You can export the results, convert your Pine Script strategy to Python, or paste it into a free web-based Pine Script backtester that runs it on your own historical data. This guide explains why traders look for a TradingView backtesting alternative, the three main ways to do it, what each one costs you in effort and accuracy, and the mistakes that make an outside backtest misleading.

Quick answerTo backtest a TradingView strategy outside TradingView, you either (1) download the trades from the strategy report as a CSV file and analyse them yourself, (2) rewrite or convert the Pine Script into Python and run it with a backtesting library, or (3) paste the Pine Script into an online backtester such as PineBacktest. Option 3 is the quickest. Option 2 gives the most control.

Why backtest a TradingView strategy outside TradingView?

TradingView is excellent for building and visualising Pine Script strategies, but many traders want a second place to test them. The common reasons are:

Pine Script strategyExport thetrades CSVCheck resultsConvert toPythonFull controlPaste into aweb backtesterFastest start

Method 1: Export your TradingView backtest results

The simplest route does not re-run anything. TradingView's help centre explains that you can open the strategy report and click Download to get a CSV file, and that each tab exports separately: the List of Trades tab exports the trades, and the Performance Summary tab exports the metrics (TradingView Help Center). The help page does not say which plans include the export, so check your own account.

What you can do with it: open the trades in a spreadsheet or Python and calculate your own statistics, such as the longest losing streak, results by weekday or hour, or the equity curve after extra costs.

The limit: this only re-analyses the trades TradingView already produced. It does not test the strategy on new data, so it cannot tell you whether the original run was affected by data gaps, repainting or look-ahead. It is a good first step, not a second opinion.

Method 2: Convert Pine Script to Python

If you are comfortable with code, you can rewrite the logic in Python and run it with a backtesting library such as backtesting.py, vectorbt or backtrader, or with your own pandas code. You then control the data, the costs and the order-fill rules completely.

What you gain: unlimited data, parameter optimisation, custom reports and full transparency about what each trade did.

What it costs: time, and a real risk of translation errors. Pine Script and Python do not behave identically: indicator warm-up periods, how orders are filled on the next bar, and how higher-timeframe data is requested can all differ. A rewritten strategy that produces different numbers is not necessarily wrong, but you need to understand why before you trust either result. Test with a very simple strategy first and compare trade by trade.

Some tools convert Pine Script to Python for you. They save time but rarely support every Pine feature, so always review the generated code and compare a few trades against TradingView by hand.

Method 3: Use a free web-based Pine Script backtester

The fastest option is a web backtester that runs Pine Script directly. On PineBacktest you paste a TradingView strategy, choose a dataset and timeframe, pick a date range and get the trades, equity curve, drawdown and statistics. There is nothing to install and no sign-up.

  1. Open the PineBacktest tester and paste your Pine Script strategy.
  2. Pick a dataset (Nifty, BankNifty, or the forex pairs EURUSD, GBPUSD, USDJPY, AUDUSD and EURJPY) and a timeframe. Higher timeframes are built by aggregating the 1-minute candles.
  3. Choose the From and To dates. The pickers only allow dates that exist in the selected file.
  4. Set capital, position size, commission and slippage, then run.
  5. Compare the result with what you saw in TradingView.

It also has a Python mode for strategies written in Python and a rule builder for simple strategies without code, and it reports look-ahead issues so a hopeful-looking result is less likely to be an artefact.

Not every Pine feature is supportedNo outside tool replicates all of TradingView. If a script uses a feature the tester does not support, you will see an error rather than a quiet wrong answer. Results can also differ slightly from TradingView because the price data and the order-fill details are not identical.

Which method should you choose?

Many traders use all three: prototype in Pine Script, sanity-check on a web backtester, then move the survivors into Python.

Why your results can differ from TradingView

It is normal for a strategy to give different numbers in two tools. The usual reasons are:

When two tools disagree, do not pick the better-looking number. Find out why they differ, using a very simple strategy so you can compare individual trades.

Checklist for a trustworthy outside backtest

Frequently asked questions

Can I backtest a TradingView strategy without a TradingView subscription?

Yes. A free web backtester such as PineBacktest runs Pine Script without a TradingView account. You supply the script and choose from the data it provides.

Can I convert Pine Script to Python?

Yes, by hand or with a converter. Always review the result and compare a few trades with TradingView, because small differences in indicators and order fills are common.

What is the best free TradingView backtesting alternative?

It depends on your skills. A web backtester is the quickest, Python libraries give the most control, and exporting the trades CSV is the simplest way to analyse existing results. Try more than one before relying on a single number.

Can I export TradingView backtest results to Excel or CSV?

TradingView's help centre says the strategy report has a Download button that exports a CSV file, separately for the List of Trades and Performance Summary tabs. Check your plan for availability.

Why does my backtest show different results outside TradingView?

Usually because of different data, order-fill rules, costs, date ranges or repainting. Compare a simple strategy trade by trade to find the cause.

Does backtesting guarantee profit?

No. A backtest only describes the past. It can remove weak ideas but cannot prove a strategy will work in future.

New to this? Start with our complete beginner's guide to backtesting a TradingView strategy, then test your own Pine Script on PineBacktest.

This article is educational and is not financial advice. Trading carries a risk of loss, and past performance does not guarantee future results. Tool features and plan details change, so confirm them in each product's current documentation.

← Back to all articlesTry the backtester

More to read

How to Backtest a TradingView Strategy: Complete Beginner's GuideFake profit videos and repainted strategies: how to spot them before you lose money