Skip to content

Quant Concepts · Vol 8 of 8

Backtest fees and slippage: how much profit survives trading costs

A backtest can gain before trading costs and lose after them. The number of trades helps explain why.

The short answer

Backtest fees and slippage are costs a simulation can skip. For a market order, the cost from the midpoint between bid and ask is half the spread, any further move to the fill price, and commission. A better fill reduces the cost. Even with zero commission, repeatedly crossing the spread can eat up a gain.

Key ideas

  • Frequent trading multiplies a small cost. Across 2,000 simulated paths, a fast rule's median result went from +122% before costs to -42% at 0.10% per side (each entry or exit); a slower version, trading far less, went from +114% to +101%.
  • The break-even cost follows from two numbers. With one flat cost per side on an account that reinvests, the cost at which profit reaches zero comes from the growth before costs and the count of entries and exits. Under a fee schedule with steps, the answer is a bracket between two tested settings.
  • A fee can be read from a schedule; the rest is an estimate. The spread, slippage and funding move with the market.

Which trading costs does a backtest have to count, and how big are they?

TradingView's strategy tester charges nothing unless told to: "If not specified, the strategy applies no commission to filled orders," and for slippage, "The default argument is 0." A real order pays some or all of these:

  • Commissions and exchange fees. These are billed and published, often as a maker fee for an order that waits in the book and a taker fee for one that trades at once.
  • The bid-ask spread. The gap between the best price to sell at (bid) and to buy at (ask); a market order crosses it, buying at the ask or selling at the bid, and pays about half of it on each side from the midpoint. One broker says it widens around market openings, news and volatile periods.
  • Slippage. Here, the part of a fill beyond the quoted bid or ask, from delay, a moving price or the order's size; on one order it can be zero or favorable. TradingView's manual uses the word for the whole gap between expected and actual fill and calls it "impossible to simulate precisely."
  • Market impact. A larger order moves the price itself, roughly with the square root of its size relative to the day's volume (Toth and coauthors, 2011): at the same volatility and daily volume, doubling an order raises the impact per unit by about 41%.
  • Holding costs. Funding payments between longs and shorts on perpetual futures (contracts with no expiry date), and overnight financing at a broker. Taxes are left out.

Each cost is counted once here, from the midpoint. An order that crosses the spread pays half the spread plus any move beyond the quote, or one observed midpoint-to-fill gap, which already holds the half-spread. A buy filled at 100.01 against a midpoint of 100.00 and an ask of 100.01 has paid 0.01%; adding a half-spread would charge 0.02%. The commission comes on top.

The rows are dated examples, not a ranking or a recommendation. Schedules differ by account, region and volume and change often; each page showed the same figure when read again on 2026-11-19.

VenueProductTier or accountFigureRead on
BinanceCrypto spotRegular user, standard spot rate0.100% maker, 0.100% taker2026-11-18
BinanceUSDT-margined perpetual futuresRegular user, standard rate0.0200% maker, 0.0500% taker2026-11-18
BybitSpot and perpetual futuresVIP 0, standard rate (may vary by region)Spot 0.1000% maker and taker; perpetuals 0.0200% maker, 0.0550% taker2026-11-18
Binance.USUS crypto spotTier 1 pairs, base rate below $500 million in 30-day volume0% maker, 0.02% taker2026-11-18
Interactive BrokersUS stocks, whole-share ordersIBKR Pro FixedUSD 0.005 a share, minimum USD 1.00 an order, maximum 1% of trade value2026-11-18
Interactive BrokersUS futures, standard USD contract scheduleUp to 1,000 contracts a month; micro and CME Bitcoin futures priced separatelyUSD 0.85 a contract, exchange and regulatory fees extra2026-11-18
CME GroupE-mini S&P 500 futureContract specificationOne tick: 0.25 index points = $12.502026-11-18
OANDA (US)EUR/USDAccount type not stated24-hour time-weighted average spread (one EUR/USD pip = 0.0001 USD per euro): 1.68 pips over the last month, 1.66 pips over three months2026-11-19

Perpetual futures exchange funding at set times. Eight hours is the default at Binance, though intervals vary by contract. At each settlement, longs pay a positive rate on their open position value; a negative rate pays them. At a constant +0.01% and unchanged value, a long pays 10.95% over 1,095 settlements. A position held four hours in every eight can cross every settlement or none. The rate is an interest part plus a market premium.

OANDA applies an annual rate, positive or negative, to position value at the 5 pm Eastern rollover, divided by 365 per rollover day. Wednesday usually counts for three days, weekends for none. At 1.15826, a long 100,000 EUR/USD at -3.00% incurs a $9.52 one-day debit, and about $28.56 when held over the Wednesday rollover, even if closed on Thursday. A positive rate gives a credit.

How does a small cost erase a profitable backtest?

This article's simulation runs one rule on 2,000 paths of synthetic hourly prices, three years each. Each bar's log return (the logarithm of its closing price divided by the previous close) is noise of 0.5% an hour plus two hidden trends that flip direction at random: 0.030% an hour, lasting about 1.5 days on average, and 0.020% an hour, lasting about 25 days. The trends are built in, so the rule has an edge before costs; the simulation says nothing about moving-average rules in real markets.

The rule is long when a short moving average is above a long one and flat otherwise: 6 and 24 hours for the fast version, 120 and 480 hours for the slow one. It fills at the next bar's open with the whole account, from $10,000. Each entry and exit pays one flat cost per side covering commission, spread, slippage and impact, the final close included. On the first path where both rules' results with no costs and at 0.10% fell in their respective middle halves, the fast rule makes 682 round trips in three years, 1,364 entries and exits, and turns $10,000 into $19,734 before costs.

Same trades, same prices: costs turn this backtest's gain into a lossLine chart of one simulated three-year backtest of the fast rule from $10,000. Without costs the account ends at $19,734, 97% up. The same 682 round trips, each entry and exit charged 0.10% of the account, end at $5,041, 50% down. The costs deducted add up to $9,347.Same trades, same prices: costs turn this backtest'sgain into a lossOne simulated backtest from $10,000 over three yearsIllustrative, simulated datanovalens.ioHourly prices with two hidden trends; a cost on every entry and exit.Fast rule: 6- and 24-hour moving averages, long or flat.$0k$5k$10k$15k$20k$25kStartYear 1Year 2Year 3Start $10,000No costs: +97%0.10% per side: -50%The same 682 roundtrips in both linesSame trades, same prices: costs turn this backtest's gain into a lossLine chart of one simulated three-year backtest of the fast rule from $10,000. Without costs the account ends at $19,734, 97% up. The same 682 round trips, each entry and exit charged 0.10% of the account, end at $5,041, 50% down. The costs deducted add up to $9,347.Same trades, same prices: coststurn this backtest's gain into alossOne simulated backtest, three yearsIllustrative, simulated datanovalens.ioA cost on every entry and every exit.Fast rule: 6- and 24-hour averages, long or flat.$0k$5k$10k$15k$20k$25kYear 1Year 2Year 3Start $10,000No costs+97%0.10% per side-50%The same 682 round trips in both lines
Figure 1. The fast rule (6- and 24-hour moving averages, long or flat) on one simulated path, before and after a cost of 0.10% on every entry and every exit. Illustrative, simulated; worked numbers.
Show the numbers
AccountEnd of year 1End of year 2End of year 3Change from the start
No costs$11,102$14,351$19,734+97%
0.10% per side$6,903$5,832$5,041-50%

The same ordered trades at each cost level:

Cost per sideFinal valueChange from the startCosts paid (sum of deductions)Below the no-cost final value
0$19,734+97%$0$0
0.02%$15,022+50%$3,285$4,712
0.05%$9,976-0.2%$6,568$9,758
0.10%$5,041-50%$9,347$14,693
0.20%$1,286-87%$10,666$18,448

At 0.10% per side the deductions add up to $9,346.52, while the final value ends $14,692.74 below the no-cost result, because each dollar paid also misses the growth after it. Vol 1's expectancy works the same way: each trade counts after its costs.

The break-even cost

The break-even cost is the cost per side at which profit is zero; in search results "break even" usually means moving a stop to the entry price. For an all-in account that reinvests, with one flat cost per side, it is c* = 1 - M^(-1/S), where M is the final value over the start before costs and S the number of entries and exits. On the drawn path M is 1.9734 and S is 1,364, so the break-even is 0.04982% per side.

This backtest's profit reaches zero at a cost of 0.05% per sideLine chart of one simulated backtest's profit after costs, in percent of the $10,000 start, against the cost per side from 0 to 0.25% in steps of 0.01%. The line starts at +97% with no costs, falls steeply at first and flattens as the account shrinks, and ends at -94%. An amber dot marks where it crosses zero: 0.05% per side.This backtest's profit reaches zero at a cost of0.05% per sideFast rule, same simulated path as Figure 1Illustrative, simulated datanovalens.ioThe same trades rerun at each cost; profit in percent of the start.-100%-50%0%+50%+100%00.05%0.10%0.15%0.20%0.25%Cost per side, % of trade valueProfit after costsNo costs: +97%At 0.25%: -94%Break-even cost: 0.05% per sideThis backtest's profit reaches zero at a cost of 0.05% per sideLine chart of one simulated backtest's profit after costs, in percent of the $10,000 start, against the cost per side from 0 to 0.25% in steps of 0.01%. The line starts at +97% with no costs, falls steeply at first and flattens as the account shrinks, and ends at -94%. An amber dot marks where it crosses zero: 0.05% per side.This backtest's profit reaches zeroat a cost of 0.05% per sideFast rule, same path as Figure 1Illustrative, simulated datanovalens.ioThe same trades rerun at each cost.-100%-50%0%+50%+100%00.10%0.20%Cost per side, % of trade valueProfit after costsNo costs: +97%At 0.25%: -94%Break-even cost:0.05% per side
Figure 2. The fast rule's result on the same simulated path, rerun with the cost per side stepped from 0 to 0.25%. In this continuous flat-cost model the dot is the exact break-even; the slow rule on the same path breaks even at about 2.0% per side. A backtest that loses before costs has no positive break-even: 267 of 2,000 fast-rule paths and 289 slow-rule paths. Illustrative, simulated; worked numbers.
Show the numbers
Cost per sideProfit after costs, % of the start
0.00%+97.3%
0.02%+50.2%
0.04%+14.3%
0.0498% (break-even)0%
0.05%-0.2%
0.06%-13.0%
0.08%-33.8%
0.10%-49.6%
0.15%-74.5%
0.20%-87.1%
0.25%-93.5%

Halving the compounded (geometric) average gross return per round trip gives nearly the same, 0.04986%. Halving a report's simple average trade gives 0.06426%, too high: two all-in trades of +20% and -18% average +1% and compound to -1.6%. Under a fee schedule with steps, profit can jump past zero between two tested settings, so rerunning gives a bracket. A negative break-even means a losing path would need a rebate to break even. Across all 2,000 paths the fast rule's median break-even is 0.059% per side (10th to 90th percentile: -0.009% to 0.133%) and the slow rule's 1.266%.

Why does trading more often cost more?

Across the 2,000 paths the fast rule makes a median 225 round trips a year and the slow rule 10.

Similar median profit before costs, about 22 times the trades, a loss after costsBar chart in two pairs, each bar a median across 2,000 simulated paths in percent of the $10,000 start. Fast rule (225 round trips a year at the median): +122% before costs, -42% after 0.10% per side. Slow rule (10 a year): +114% before costs, +101% after. All bars start at zero; the fast rule's after-cost bar is the only one below it.Similar median profit before costs, about 22 timesthe trades, a loss after costsMedian of 2,000 simulated pathsIllustrative, simulated datanovalens.ioSame rule at two speeds in one simulated market; bars start at zero.Before costsAfter 0.10% per side-50%0%+50%+100%+122%-42%Fast rule225 round trips a year (median)+114%+101%Slow rule10 round trips a year (median)Similar median profit before costs, about 22 times the trades, a loss after costsBar chart in two pairs, each bar a median across 2,000 simulated paths in percent of the $10,000 start. Fast rule (225 round trips a year at the median): +122% before costs, -42% after 0.10% per side. Slow rule (10 a year): +114% before costs, +101% after. All bars start at zero; the fast rule's after-cost bar is the only one below it.Similar median profit before costs,about 22 times the trades, a lossafter costsMedian of 2,000 simulated pathsIllustrative, simulated datanovalens.ioSame rule at two speeds; bars start at zero.Before costsAfter 0.10% per side-50%0%+50%+100%+122%-42%Fast rule225 round tripsa year (median)+114%+101%Slow rule10 round tripsa year (median)
Figure 3. Each bar is a median across 2,000 simulated paths, taken separately. Fast and slow are the same rule; the number of trades differs. Illustrative, simulated; worked numbers.
Show the numbers
RuleRound trips a year, median (10th to 90th percentile)Median result before costsMedian result after 0.10% per sidePaths above the start before costsPaths above the start at 0.10% per side
Fast224.7 (218.0 to 232.3)+122%-42%86.7%22.4%
Slow10.0 (8.7 to 11.7)+114%+101%85.5%83.2%

At the same trade size, a year of fast trading at 0.20% per round trip (0.10% per side) costs about 45% of the trade value, against about 2% for the slow rule. The share of paths ending above $10,000:

Cost per sideFast rule: paths above the startSlow rule: paths above the start
086.7%85.5%
0.02%76.8%85.0%
0.05%56.5%84.2%
0.10%22.4%83.2%
0.20%0.9%80.6%

Stock-market research finds the same split by turnover. Novy-Marx and Velikov (2016) found that most of the anomalies they studied (return patterns that strategies trade) with one-sided monthly turnover below 50% continued to generate significant net spreads, "at least when designed to mitigate transaction costs," and few with higher turnover did. When an edge fades (Vol 5), the gross return per trade shrinks and even an unchanged cost takes a larger share.

How do backtests get costs wrong, and what does TradingView's tester offer?

  • Zero costs by default. The manual's daily Apple example grows 18.67% without commission and shows "a significantly reduced net profit" at 1% per order.
  • A fill on the signal bar's own close. A setting fills on the bar's close instead of the next open, which the help page calls "misleading" (Vol 7 covers timing).
  • Counting the spread twice. When the slippage setting already includes the half-spread, adding it separately charges it twice.
  • Every touched limit order filled. By default a limit order fills as soon as price reaches it, though in real trading "some limit orders might not fill"; a setting asks price to move one tick beyond.
  • Fixed slippage on market and stop orders. The tester adds a fixed number of ticks, so "some orders can fill outside the candle range in the simulation."
  • Funding and financing left out. The four TradingView pages saved on 2026-11-18, with two settings lists, describe no setting for funding, overnight financing, a varying spread, slippage that depends on volatility or size, or partial fills. That holds for those pages on that date; a script can add such costs by hand.
  • Recalculating right after a fill. On historical bars the high, low and close already hold their final values, so logic that reads them inside the bar "may produce misleading backtest results."

Commission can be a percentage, cash per order or cash per contract. Other settings cover slippage in ticks, limit-price verification and fill delay. On Premium and Ultimate plans, the bar magnifier reads shorter bars.

How can a trader check a backtest's costs?

  1. Costs on and off. Comparing the same trades with a scheduled fee and stated slippage shows what the zero default leaves out.
  2. Growth per trade. The all-in formula above relates gross growth to entries and exits. QuantInsti, a trading course provider, calls comparing profit and cost per trade "the quickest sanity check there is."
  3. A range of costs. Reruns show where profit disappears, a check Enlightened Stock Trading describes. Whether the edge persists is a separate question (Vol 2 and Vol 3).
  4. Doubled costs. Raising the cost from 0.05% to 0.10% per side cut the share of profitable fast paths from 56.5% to 22.4%. The slow share fell from 84.2% to 83.2%.
  5. Fill assumptions. Changing limit-price verification, fill timing or bar detail can reveal profits that depend on assumed fills. A historical bar cannot establish a real order's place in the queue.
  6. Holding costs. Perpetual funding accrues at settlements crossed. Broker financing follows the broker's rollover calendar.
  7. Actual fills. Existing broker fills can be compared with simulated prices. Paper fills and unfilled orders supply no actual fill price. Perold (1988) called the paper-to-real portfolio gap implementation shortfall. Ernest Chan allowed 5 basis points (0.05%) a side. His backtest "looked wonderful" but live trading came "nowhere near the profitability of the backtest."

What does the research say?

  • Anomaly returns shrink once spreads, publication and era are counted. Chen and Velikov (2023) studied 204 stock-market anomalies. Once effective spreads, the decline after publication and the modern trading era are taken out, "the average anomaly's expected return is a measly 4 bps per month." That figure comes from the three adjustments together.
  • The most active individual investors earned the least. Barber and Odean (2000) followed 66,465 households from 1991 to 1996: those that traded most earned 11.4% a year net, 6.5 points below the market's 17.9%, and the authors trace the shortfall to "the cost of trading and the frequency of trading." Round trips above $1,000 then averaged about 3% in commissions and 1% in spread. In Taiwan, the 500 most active day traders by prior-year volume earned 13.1 basis points a day on their day trades before costs and lost about 6.8 after fees and sales tax, measured in 1993 to 2006 (Barber, Lee, Liu and Odean).
  • A large manager's measured costs were far lower than earlier estimates. Frazzini, Israel and Moskowitz (2018), who work for that manager, studied $1.7 trillion of its trades and found costs "an order of magnitude smaller than previous studies suggest."
  • Break-even cost is an old test for trading rules. Bessembinder and Chan (1998) found break-even per-side costs for classic rules on a US index of 0.39% over the full sample and 0.22% since 1975, "small compared to recent estimates of actual trading costs" then. Hudson and Urquhart (2021) found break-even costs for almost 15,000 crypto rules "substantially higher than those typically found in cryptocurrency markets," with no predictability left for Bitcoin out of sample.

Common mistakes

  • Testing on the zero defaults, with no commission and no slippage.
  • Assuming every order fills near its price. One slippage number covers market and stop orders in calm and fast markets alike, and by default every touched limit order counts as filled.
  • Reading the fee and ignoring the number of trades. At the same 0.10% per side, the simulated fast rule's median fell below the start and the slow rule's stayed far above it.
  • Leaving funding out of a position held across settlements. A long of constant value pays 10.95% over 1,095 settlements at +0.01% each; one that misses them all pays nothing in funding.
  • Choosing the cost level after seeing which one keeps the profit. The cost becomes one more tuned setting, the problem Vol 2 describes.

Rule of thumb

An edge is what is left of a backtest's growth after every entry and exit has paid its cost.

Sources

TradingView pages and venue pages accessed 2026-11-18 and read again 2026-11-19; the OANDA spread page accessed 2026-11-19; papers and other pages accessed 2026-11-18.

  1. TradingView. Pine Script User Manual, "Strategies." https://www.tradingview.com/pine-script-docs/concepts/strategies/
  2. TradingView. Pine Script User Manual, FAQ, "Strategies." https://www.tradingview.com/pine-script-docs/faq/strategies/
  3. TradingView Help Center. "Strategy properties." https://www.tradingview.com/support/solutions/43000628599-strategy-properties/
  4. TradingView Help Center. "Broker emulator." https://www.tradingview.com/support/solutions/43000786181
  5. TradingView Help Center. "What is bar magnifier backtesting mode." https://www.tradingview.com/support/solutions/43000669285
  6. Binance. "Fee Rate," spot and USD-M futures. https://www.binance.com/en/fee/schedule; https://www.binance.com/en/fee/futureFee
  7. Binance. "Introduction to Binance Futures Funding Rates." https://www.binance.com/en/support/faq/introduction-to-binance-futures-funding-rates-360033525031
  8. Bybit Help Center. "Bybit Trading Fee Structure." https://www.bybit.com/en/help-center/article/Trading-Fee-Structure
  9. Binance.US. "Fees." https://www.binance.us/fees
  10. Interactive Brokers. "Commissions: Stocks" and "Commissions: Futures." https://www.interactivebrokers.com/en/pricing/commissions-stocks.php; https://www.interactivebrokers.com/en/pricing/commissions-futures.php
  11. CME Group. "E-mini S&P 500 contract specifications." https://www.cmegroup.com/markets/equities/sp/e-mini-sandp500.contractSpecs.html
  12. OANDA (US). "Historical spreads," "Spreads & margins" and "Financing fees." https://www.oanda.com/us-en/trading/historical-spreads/; https://www.oanda.com/us-en/trading/spreads-margin/; https://www.oanda.com/us-en/trading/financing-fees/
  13. Coinbase Help. "Advanced Trade fees." https://help.coinbase.com/en/coinbase/trading-and-funding/advanced-trade/advanced-trade-fees
  14. AQR. "Transactions Costs: Practical Application." https://www.aqr.com/-/media/AQR/Documents/Insights/White-Papers/AQR-Transactions-Costs---Practical-Application.pdf
  15. Perold (1988). "The Implementation Shortfall: Paper versus Reality." Journal of Portfolio Management 14(3), 4-9. https://doi.org/10.3905/jpm.1988.409150
  16. Novy-Marx and Velikov (2016). "A Taxonomy of Anomalies and Their Trading Costs." Review of Financial Studies 29(1), 104-147. https://doi.org/10.1093/rfs/hhv063
  17. Chen and Velikov (2023). "Zeroing In on the Expected Returns of Anomalies." Journal of Financial and Quantitative Analysis 58(3), 968-1004. https://doi.org/10.1017/S0022109022000874
  18. Frazzini, Israel and Moskowitz (2018). "Trading Costs." Working paper. https://www.aqr.com/Insights/Research/Working-Paper/Trading-Costs
  19. Barber and Odean (2000). "Trading Is Hazardous to Your Wealth: The Common Stock Investment Performance of Individual Investors." Journal of Finance 55(2), 773-806. https://doi.org/10.1111/0022-1082.00226
  20. Barber, Lee, Liu and Odean (2014). "The Cross-Section of Speculator Skill: Evidence from Day Trading." Journal of Financial Markets 18, 1-24 (working-paper version read). https://doi.org/10.1016/j.finmar.2013.05.006
  21. Bessembinder and Chan (1998). "Market Efficiency and the Returns to Technical Analysis." Financial Management 27(2), 5-17. https://doi.org/10.2307/3666289
  22. Hudson and Urquhart (2021). "Technical trading and cryptocurrencies." Annals of Operations Research 297, 191-220. https://doi.org/10.1007/s10479-019-03357-1
  23. Toth, Lemperiere, Deremble, de Lataillade, Kockelkoren and Bouchaud (2011). "Anomalous price impact and the critical nature of liquidity in financial markets." Physical Review X 1, 021006. https://arxiv.org/abs/1105.1694
  24. QuantInsti. "How Do Transaction Costs Affect Automated Trading Performance?" https://www.quantinsti.com/articles/transaction-costs-automated-trading/
  25. Enlightened Stock Trading. "Slippage in Trading." https://enlightenedstocktrading.com/slippage-in-trading/
  26. Chan (2015). "Beware of Low Frequency Data." http://epchan.blogspot.com/2015/04/beware-of-low-frequency-data.html

Simulations: computed for this article from synthetic data (no market data). Code, seeds and outputs are kept with the article's research pack.