Fees and Slippage in the TradingView Strategy Tester: How to Set Them
In the TradingView Strategy Tester, fees are declared with commission_type and commission_value in strategy() (or in the Properties tab), and slippage with slippage, expressed as a number of ticks and equal to 0 by default. A backtest without these two settings assumes free, perfect fills; the more often the strategy trades, the wider the gap with live trading.
Updated 17 October 2026. Research on past data, not investment advice.
Where costs are set
| Setting | Pine parameter | Unit | Default (TradingView docs) |
|---|---|---|---|
| Commission | commission_type, commission_value |
percent, cash per contract or per order | check your script's Properties tab |
| Slippage | slippage |
fixed number of ticks | 0 |
| Order fills | process_orders_on_close |
true / false | false: fill at the next open |
| Intrabar detail | use_bar_magnifier |
true / false | false |
A complete declaration:
//@version=5
strategy("My strategy", overlay=true,
initial_capital=10000,
commission_type=strategy.commission.percent,
commission_value=0.1, // 0.10% of the amount, on each side
slippage=0) // in ticks: see the conversion below
Values written in strategy() become the defaults of the Properties tab; a user can then change them by hand. If you share a script, declare them in code.
The ticks trap
TradingView slippage is a fixed number of ticks, not a percentage. On an expensive asset with a 0.01 tick, 2 ticks of slippage is 0.02 price units: practically nothing. To model a percentage slippage, convert:
ticks = price × slippage % ÷ tick size
Worked example: at a price of 60,000 and a 0.01 tick, 0.05% slippage is 60,000 × 0.0005 ÷ 0.01 = 3,000 ticks. Since price changes over the history, a fixed tick value underestimates slippage as price rises. Simple alternative: add your estimated slippage to the percentage commission (for example 0.10% fees + 0.05% slippage = commission_value=0.15). Crude, but proportional to the amount on every trade.
Limit orders fill at the requested price or better, according to the documentation: slippage does not penalise them, but live they may not fill at all.
What fees really cost
By simple arithmetic, for a strategy fully invested on every trade, the share of capital left after fees alone (before any market gain or loss):
| Round trips | 0.05% per side | 0.10% per side | 0.15% per side | 0.20% per side |
|---|---|---|---|---|
| 50 | 95.1% | 90.5% | 86.1% | 81.9% |
| 100 | 90.5% | 81.9% | 74.1% | 67.0% |
| 258 | 77.3% | 59.7% | 46.1% | 35.6% |
| 500 | 60.6% | 36.8% | 22.3% | 13.5% |
The number 258 is not random: it is the trade count of a Pine export we replayed in a real TradingView account at 0.10% per side, with a result identical to the cent between the two engines (trade-by-trade check). That test strategy lost 42.45%.
What fees do to a short signal
The smaller the average gain per trade, the more fees decide. In our RSI-below-30 study on BTC (one-hour bars, 2019-2026), the best gross cell was +0.027% per episode; with a 0.20% round trip it became −0.173%. Same method on Binance aggressive-buying spikes: mean net of fees −0.10% on the unseen period.
Rule of thumb: if your target gain per trade is the same order of size as round-trip fees, the strategy is structurally negative. A gross target below about 0.30% round trip should be recomputed net.
Fee stress: the question to ask every backtest
A backtest that only survives with exact fees is fragile: your real fees, slippage on a busy day or a change of fee tier is enough to flip it. By default the Strategy Arena Lab replays every frozen candidate at 2 times fees, then 3 times fees plus 5 basis points, without re-tuning it. In TradingView you can do the same by hand: double commission_value, rerun, compare.
| Net result at… | Reading |
|---|---|
| normal fees: positive; 2 × fees: positive | the margin covers an error in cost estimates |
| normal fees: positive; 2 × fees: negative | fragile gain, highly cost-dependent |
| normal fees: negative | the strategy does not pay its costs |
Put your strategy through a fee stress
- Test your Pine strategy for free: the Quick Check compares it with buy-and-hold, fees included.
- The free Lab for Windows: automatic fee stress, sealed period, Pine export with fees written in
strategy(). - Check the trades in TradingView: commissions included, trade by trade. Open TradingView (partner link).
For the full checklist, see how to tell if a TradingView backtest is reliable.
FAQ
What commission should I set in the Strategy Tester?
The one you really pay on your venue, per side, for your volume. Our studies use 0.10% per side (0.20% round trip). If in doubt, test at double as well.
Is TradingView slippage a percentage?
No: a fixed number of ticks. Convert a percentage with price × percentage ÷ tick size, or add it to the percentage commission.
Does a daily-bar strategy need slippage?
It matters less, because trades are rare and relative gaps small. It matters most on short timeframes and strategies that trade often.
Are funding costs on leveraged positions included?
The commission parameter does not model them. A long position held on a perpetual or margin contract has other costs, to estimate separately.
Sources
- TradingView Pine Script documentation, "Strategies" page (slippage in ticks, default 0; limit orders filled at the price or better;
process_orders_on_close;use_bar_magnifier), accessed 17 October 2026. - Strategy Arena: trade-by-trade reproducibility and RSI below 30, 13 October 2026.
- Erosion table: calculation (1 − fee)^(2 × round trips), fully invested position.
Disclosure: Strategy Arena takes part in the TradingView partner program. If you create a new account through our links and then subscribe on the web, we may earn a commission at no extra cost to you. It changes no number and no verdict in this article.
Research on past data, not investment advice. Past results do not guarantee future results.
⚠️ Disclaimer — This article is for informational and educational purposes only. It does not constitute investment advice or a buy/sell recommendation. Past performance does not guarantee future results. Strategy Arena is an educational simulator with virtual capital. Always do your own research before making investment decisions.