ZenTrader

Learn · Guide · 4 min read

Backtesting Indian stocks on TradingView: the settings that change the result

TradingView's strategy tester charges nothing and fills perfectly unless you tell it otherwise. The commission, slippage and fill settings to use for NSE stocks, and what it can't test.

TradingView's strategy tester runs a Pine Script strategy over a chart's history and reports its trades, win rate, profit factor and drawdown. Unless the script or its settings say otherwise, a new test charges nothing and fills every order at the exact price. On Indian stocks that flatters every result, because STT alone is 0.1% on each side of a delivery trade.

Every setting below is in the strategy's Settings → Properties tab, or in the strategy() line of the script.

Enter commission per order

TradingView takes commission on every entry and every exit. Choose Percent and enter what one order costs you as a share of its value, with STT, stamp duty, exchange charges, the SEBI fee, GST, brokerage and the DP charge all included.

All charges included, one order costs about:

Trade size Zerodha, Dhan Fyers Groww, Angel One, Upstox
Delivery, ₹25,000 0.14% 0.24% 0.25%
Delivery, ₹1 lakh 0.12% 0.14% 0.15%
Delivery, ₹5 lakh 0.11% 0.12% 0.12%
Intraday, ₹25,000 0.05% 0.05% 0.11%
Intraday, ₹1 lakh 0.04% 0.04% 0.04%

Pick the row closest to your usual position. Small delivery trades cost more as a percentage because the DP charge and minimum brokerage are flat amounts. Rates are each broker's published rates for October 2026; broker comparisons has the workings. For your exact trade, the charges calculator gives the rupee figure; divide it by twice the trade value to get the per-order percentage.

TradingView has no setting for margin interest. If the strategy holds positions on MTF, work out the interest separately with the charges calculator.

Set slippage in ticks

Slippage is the gap between the price your rules see and the price you get. TradingView applies it to market and stop orders and measures it in ticks, the smallest price step of the symbol. To set it, decide what you expect to lose as a price, then divide by the tick size shown in the symbol's details. A breakout bought on a stop order in a thin stock slips far more than a large-cap bought at the open.

If you don't know your slippage, compare a few of your real fills from your contract notes with the prices on the chart. Even a small amount turns some strategies from profitable to losing, which is worth knowing before you trade them. See slippage.

Fill settings that make results look better than trading

Fill orders on bar close. This lets an order fill at the close of the bar that triggered it. In live trading you only know the close once the bar has ended, so TradingView itself warns that results with this setting can mislead. Leave it off.

Verify price for limit orders. By default a limit order fills as soon as price touches it. In real markets a touch often doesn't fill you. Setting this to a few ticks requires price to trade through your level first.

Recalculate on every tick. This changes nothing in the historical test, only on live bars, so it can't improve a backtest.

Bar Magnifier. On a daily chart TradingView can't tell whether a bar hit your stop or your target first. Bar Magnifier uses lower-timeframe bars to decide. It needs the Premium plan or higher.

Position size and capital

The default initial capital is 1,000,000 in the chart's currency, and orders are a fixed quantity unless you change them. Set capital to the money you would actually trade and the order size to a percentage of equity or a fixed rupee amount, so the drawdown and returns mean something for your account. The position size calculator turns a stop and a risk per trade into a share count.

What the tester can't do for a stock strategy

It tests one symbol at a time. A standard strategy trades the symbol on the chart. A breakout trader picks from hundreds of stocks with one pool of cash. Ten single-stock tests don't show how the strategy behaves when five signals arrive on the same day and the money runs out.

It tests the stocks you pick today. Choosing stocks from a current list leaves out every company that was delisted or collapsed during the test. That is survivorship bias, and it lifts results.

History is limited by plan. Basic shows 5,000 bars and the paid plans 10,000 to 40,000. On a daily chart 5,000 bars is about 20 years. On a 5-minute chart it is about 66 trading days, too few for most intraday strategies. Deep Backtesting, on Premium and higher, tests up to two million bars.

The trade list keeps the latest 9,000 trades in the default test range. Deep Backtesting keeps all of them.

Check the result before you trust it

Check how many trades the result rests on before trusting the win rate: how many trades a backtest needs works it out. Then put the win rate and average win into the strategy odds simulator to see the spread of outcomes and drawdowns the same numbers can produce. The backtest checklist covers the rest, and why backtests lie explains the common errors.

Before trusting a TradingView backtest: commission set per order, slippage set in ticks, bar-close fills off, capital and size set to your account, and enough trades.

Keep reading

This is general education about trading methods. It is not advice to buy or sell any security. TradingView links carry our partner ID, and TradingView pays us a fee if you take a paid plan through one.