Back to Blog
    Trading Education
    #tradingview
    #how-to
    #backtesting

    How to Backtest a Strategy on TradingView

    NickTradesNickTrades
    September 10, 20264 min read
    Share:
    How to Backtest a Strategy on TradingView


    How to Backtest a Strategy on TradingView

    TradingView has a built-in Strategy Tester. It is genuinely useful and extremely easy to fool yourself with, so the settings matter more than the result.

    Run your first backtest

  1. Open the Indicators dialog and search for a strategy (they carry a "strategy" label, e.g. Supertrend Strategy).

  2. Add it to the chart.

  3. Open the Strategy Tester tab at the bottom of the screen.

  4. Read the Overview, Performance Summary and List of Trades tabs.
  5. Trade markers appear on the chart, so you can click any trade in the list and jump to it.

    Set the properties honestly

    Open the strategy's settings and go to the Properties tab. This is where most backtests go wrong.

  6. Initial capital — set it to what you would actually trade.

  7. Order size — a fixed percentage of equity is more realistic than a fixed contract count.

  8. Commission — enter your broker's real fee. Zero commission is a fantasy.

  9. Slippage — add at least 1-2 ticks. Intraday, add more.

  10. Recalculate: after order is filled / on every tick — leave these off unless you understand the consequences. They make results look better than reality.

  11. Margin for long/short positions — set it if you use leverage, so margin calls appear.
  12. Read the numbers that matter

  13. Net profit on its own means nothing without drawdown next to it.

  14. Max drawdown — the number that decides whether you could actually hold this through a bad run.

  15. Profit factor — gross profit divided by gross loss. Below 1.2 is fragile; above 3 on a small sample usually means curve-fitting.

  16. Total closed trades — under 100 trades, treat the results as an anecdote.

  17. Percent profitable — a high win rate with a terrible average loss is a losing system.
  18. The traps

    Repainting. If the script uses future data or recalculates on historical bars, its backtest is fiction. Forward-test on live bars before believing it.

    Curve-fitting. Tuning inputs until the equity curve is beautiful on one symbol produces a strategy that works on exactly that symbol, in exactly that period. Test on other markets and other date ranges.

    Survivor bias on limited history. The free plan restricts how far back strategies can calculate. A backtest that only covers a bull market has not been tested.

    Ignoring the bar-magnifier problem. On higher timeframes the tester assumes an order fill sequence within the candle. Intrabar reality can differ.

    A sensible testing routine

    ```text

  19. Backtest on 3+ years and 3+ symbols.

  20. Note results. Change nothing.

  21. Forward-test on a demo account for 4-6 weeks.

  22. Compare live results to backtest expectations.

  23. Only then risk money, at the smallest size that matters.

  24. ```

    Frequently Asked Questions

    Does TradingView have a backtesting tool?

    Yes. The Strategy Tester panel runs any Pine Script strategy over historical data and reports net profit, drawdown, profit factor and the full trade list.

    Is TradingView backtesting accurate?

    It is accurate to the settings you give it. Without realistic commission and slippage, and with recalculation options enabled, results are optimistic. It also cannot see intrabar order sequence on higher timeframes.

    Can I backtest indicators, not just strategies?

    Not directly — indicators do not place orders. You either convert the logic into a strategy script or step through history manually using Bar Replay.

    How much history do I need for a valid backtest?

    Enough for at least 100 trades, across more than one type of market. Three years covering a trend, a range and a crash is a reasonable target.

    Verified results instead of a blank tester

    SimpleAlgo publishes its own backtest results across major markets rather than asking you to build the test yourself, and the signals are non-repainting, so what you see on history is what fires live. Access starts from $5.77/week on the annual plan, with a 7-day money-back guarantee. See the results.

    NickTrades

    NickTrades

    Founder of SimpleAlgo and professional trader sharing insights on trading strategies, market analysis, and product updates.

    Related Articles