Backtesting a strategy in TradingView

If you have a strategy instead of an indicator — this is how you see the equity curve, drawdown and trade list.

Strategies are PineScripts that don't just draw lines but also simulate trades. TradingView has a built-in Strategy Tester that gives you performance metrics.

1

Paste strategy code

Paste the code in the Pine Editor (like the indicator workflow). Strategies typically begin with strategy("Name", ...) — for indicators it would be indicator(...). Save → "Add to chart".

2

Open the Strategy Tester

At the bottom of TradingView there is the "Strategy Tester" tab. Click it — you immediately see the equity curve, net profit, win rate, max drawdown and all simulated trades.

3

Set properties

In the Strategy Tester there's a gear icon → "Properties". Here you define:

  • Initial Capital: the simulated starting capital (e.g. 10,000)
  • Order Size: % of equity or fixed lot size per trade
  • Pyramiding: how many simultaneous trades are allowed
  • Commission & slippage: use realistic values — otherwise the backtests look too good
4

Test different timeframes & symbols

Change the timeframe at the top (e.g. from M15 to H1) and the symbol — the Strategy Tester recalculates automatically. That way you see whether the strategy only works on one specific setup or universally.

Important for backtesting: The TradingView backtester is good but not perfect. There are limits on the amount of historical data (significant in the free plan), and slippage / spread are not simulated as realistically as on MT5. Take the results as an indication, not the truth.
Ready to get started?

DISCOVER OUR PRODUCTS

Get in touch