Using the Strategy Tester
Use TradingView’s Strategy Tester to evaluate your strategy’s performance with an overview, detailed metrics, and a full list of trades.
Already on the chart?
This page assumes the strategy is already added. If it isn't, follow Run on TradingView first (Copy Code → Pine Editor → Add to chart), then come back here.
Prerequisite: use a Strategy, not an Indicator
- Your Pine Script must be a strategy to access TradingView’s backtester.
- In Pine Script, strategies are declared with
strategy(...)(indicators useindicator(...)and won’t show the Strategy Tester). - If the Strategy Tester tab does not appear after adding to chart, you’re likely running an indicator.
1) Open Strategy Tester
- Click the Strategy Tester tab (it appears next to Pine Editor once a strategy is on the chart).
- Review the Overview for high-level results (net profit, win rate, drawdown, etc.).
- Open Performance Summary for detailed metrics and risk/return statistics.
- Check List of Trades to see every entry/exit, timestamps, and P/L.
Iterate quickly
- Want to tweak logic or parameters? Return to HorizonAI, adjust your prompt, click Copy Code, then paste and Add to chart again.
- Rerun the backtest and compare results in the Strategy Tester.
Troubleshooting
No Strategy Tester tab? Your script is likely an indicator. It must be declared with strategy(...). See Run on TradingView after regenerating as a strategy.
Compile errors? See Pine Script Warnings, or paste the error into HorizonAI.
Poor results? Use realistic commission and slippage in the strategy Settings. Common backtesting mistakes.
Related guides
- Run on TradingView: add the script to the chart first
- Backtest with the Chrome extension: same tester, results back in the chat
- Backtesting in Horizon: prove the idea before you export
- Backtesting Metrics Explained