The 2 TradingView Settings That Make a Backtest Honest (Free)

Commission and slippage: how to turn them on in TradingView, and what they did to a popular free strategy (+227% became -94%).

Share

Most backtests you see online leave two settings at zero: commission and slippage. Every real trade pays both. Here's how to turn them on in TradingView, in the settings or with one line of code, and what happened when I did it to a popular free strategy.

Heads up: your backtest will probably look worse. That's the point. You want to know what a strategy would have made after costs, not before.

How to turn them on

  1. Open your strategy on the chart, click the gear (Settings) next to its name, and open the Properties tab.
  2. Set Commission to what your broker or exchange charges per order (a % or a dollar amount per contract) and Slippage to 1-2 ticks. Click OK and the Strategy Tester updates.
  3. Want it baked into the script so it's always on? Tap Copy code below and add the settings inside your script's strategy(...) line.
Real-cost settings for strategy()
// Add these settings inside your strategy(...) line, before the closing ")".
// Then change the numbers to what YOUR broker or exchange charges.
//
// Before: strategy("My Strategy", overlay = true)
// After:  strategy("My Strategy", overlay = true, commission_type = strategy.commission.percent, commission_value = 0.1, slippage = 1)

commission_type = strategy.commission.percent, commission_value = 0.1, slippage = 1

// commission_value = 0.1 means 0.1% on every order: the entry and the exit.
// slippage = 1 moves every market and stop fill 1 tick against you.
//
// Futures? Charge a dollar amount per contract instead (use your broker's fee):
// commission_type = strategy.commission.cash_per_contract, commission_value = 2.50, slippage = 1

What to put in

  • Crypto: your exchange's fee per trade, as a %. A common spot fee is 0.1% per side; check your own fee tier.
  • US stocks and ETFs: commission is $0 at most big brokers, but you still pay the spread. Use 1-2 ticks of slippage.
  • Futures: your broker's fee per contract, per side, from its fee schedule, plus 1 tick of slippage.

The more a strategy trades, the more these numbers matter. A strategy that trades a few times a year barely notices them. One that trades every day can live or die on them.

What fees did to a popular free strategy

I took one of the most-boosted free strategies on TradingView, a 15-minute Bitcoin strategy, and ran it on its default settings on BINANCE:BTCUSDT from August 2017 to November 2026.

  • No costs: +227%, from 1,999 trades with a 70% win rate.
  • With a 0.1% fee per side: the same 1,999 trades came out at -94%. The fees added up to $197,655 on a $100,000 account.
  • One tick of slippage barely changed it ($839 in total). The fee did the damage.

Even with no costs at all, it made far less than simply buying and holding Bitcoin over the same years. A backtest without costs isn't a result. It's a best case.

Want more free tools like this?

I share trading tools, scripts and walkthroughs on Instagram at @tctradinglab and on YouTube at TC Trading.

Don't have TradingView yet? Get it here. That's an affiliate link, so I may earn a commission at no extra cost to you.

Not financial advice. A backtest shows how rules would have done, not how they will do. Test anything before you trade it with real money.