How is backtesting done on TradingView?

Good day all, please has anyone backtested a strategy on TradingView before? Please share how its done

G
@godswillfx - 6 days ago

Yes, I’ve backtested plenty of strategies on TradingView. Here’s exactly how it’s done (two simple methods):

1. Automated backtesting (best for rule-based strategies):

- Open your chart.

- Click Pine Editor at the bottom.

- Write or paste a strategy script (starts with `strategy` not `indicator`).

- Define your entry/exit rules using `strategy.entry()` and `strategy.exit()`.

- Click Add to Chart

- Open the Strategy Tester tab at the bottom – it instantly shows net profit, win rate, max drawdown, trades list, etc.

- Tweak settings (commissions, slippage, initial capital) for realism.

2. Manual backtesting (no coding, great for discretionary rules):

- Open your chart.

- Click the Replay button (top toolbar).

- Pick a past start date or use “Random bar”.

- Play the chart forward bar-by-bar and manually apply your rules while noting results.

Free accounts only go back a limited number of bars. For deeper history, you’ll need a paid plan (or journal daily screenshots like the earlier tip).

Start simple, test on multiple timeframes/assets, and always include commissions/slippage. That’s it.