How to backtest on TradingView properly
TradingView's Strategy Tester is a great tool, but its default settings flatter almost every strategy. Five settings and two habits make it honest.
Step 1: add real costs
Open the strategy's Settings → Properties. Set Commission to what your broker really charges (for example 0.05-0.1% per side for crypto perps or futures CFDs, or your exact brokerage for Indian F&O plus taxes), and set Slippage to a few ticks. Zero costs is the single biggest reason backtests look better than reality.
Step 2: fill on the next bar
Make sure the strategy decides on a bar's close and fills on the next bar's open. Avoid settings or code that fill at the same close used to make the decision - that is look-ahead and creates impossible results.
Step 3: no repainting
If the script uses request.security() for higher timeframes, make sure it does not use future data (avoid look-ahead on). Indicators that change their past values ('repaint') make backtests worthless. A quick test: note today's signals, come back tomorrow and see if yesterday's signals moved.
Step 4: size like you will trade
Use the order size you'll really use (a fixed % of equity or fixed contracts), not 100% of equity, and keep pyramiding off unless you really add to positions.
Step 5: get enough history and trades
Use the longest history your plan allows and aim for 100+ trades. Under 30 trades, results mean little. If your timeframe gives too few trades, test the same rules on several markets.
Habit 1: write down every version you try
Each new setting you test increases the chance that the best one is just lucky. Keep a simple list of versions. Judge the final pick on a date range you did not use while tuning.
Habit 2: read the right numbers
| Number | What healthy looks like |
|---|---|
| Total closed trades | 100+ (30 is the bare minimum) |
| Profit factor | 1.3+ after costs; check it still holds at +0.2% cost |
| Max drawdown | One you could live through twice |
| Percent profitable | Only meaningful next to average win vs average loss |
| Largest losing trade | Not bigger than your daily loss limit |
Exporting your trades for a second opinion
In the Strategy Tester open List of trades. If your plan shows a download/export button, export it as CSV; otherwise copy the table into a spreadsheet. That file is all an independent review needs - no code, no access to your account.
Frequently asked questions
- Is TradingView's backtest accurate?
- The engine is fine; the default settings are optimistic. Add real commission and slippage, fill on the next bar, avoid repainting indicators and get 100+ trades.
- Why do my live results differ from the Strategy Tester?
- Usually costs, fills, repainting, skipped signals or a strategy tuned to the past. Compare live and backtest trade by trade for the same dates.
- Can I backtest indicator strategies reliably?
- You can measure them, but in our study of 6,144 indicator-style backtests their statistics predicted the next two years only slightly better than a coin flip. Treat them with extra caution and paper-trade first.
- What file do I need for an independent review?
- The Strategy Tester's List of trades (CSV), plus how many versions you tested. Nothing else.
Want your own strategy checked?
Send your trade list. You get a plain-English PDF: verdict, 10 checks, a position size for your chosen risk, a daily stop and a 30-trade paper-test plan. Free in the beta: run it yourself in the Workspace.