OptiNod Academy

Slippage, Fees, and Liquidity: The Trading Costs Backtests Hide

Measure fees, spread, and slippage at the intended order size. Compare their total with the strategy’s edge without double-counting execution costs.

Fees can be checked before you trade. To judge whether an edge survives execution, also measure the spread and slippage at your intended order size.


Separate exchange fees from execution costs. Fees are the amounts charged by the venue. The bid-ask spread is the gap between the best buy and sell quotes. Slippage is the difference between a chosen reference price and the actual fill; specify whether that reference is the midpoint, the best quote, or a signal price. Liquidity describes the available depth and how it changes. It affects execution costs, but it is not a separate charge to add to fees and slippage. If measured slippage already uses the midpoint as its reference, it includes the spread component; adding the spread again would double-count it.


Subtracting fees alone from a backtest does not establish a realistic live expectancy. In this article, 0.04% per side and approximately 0.08% per round trip are illustrative fee assumptions, with equal entry and exit notionals. They are not a universal fee schedule. Actual rates depend on the venue, product, maker or taker status, volume tier, and discounts. Execution costs also depend on the asset, order size, timing, and market conditions.


The practical step is to compare the strategy’s gross edge with measured total costs using a consistent reference price. Slippage can exceed fees, but it does not always do so. A market order may consume several price levels when available depth is small relative to its size. The same signal can therefore have different net results across venues and order sizes, even when the quoted fee rates match.


Fees and execution costs, with liquidity affecting the size of the spread and slippage
Fees and execution costs, with liquidity affecting the size of the spread and...

Liquidity affects the execution-price difference; it is not a separate charge.


Check Fee Rates and Measure Slippage Separately


A published fee schedule lets you estimate the fee from the applicable rate and executed notional. Check both entry and exit, since maker and taker treatment can differ. With an assumed 0.04% rate on each side and unchanged notional, the round-trip fee is 0.08%, or 8bp. One basis point is 0.01%. The rate is an input to verify for the intended trade, not a property shared by every asset or exchange.


Execution costs need a reference price as well as a size. If a market buy cannot fill entirely at the best ask observed before submission, later fills may occur at higher asks. The average fill then has adverse slippage relative to that best ask. A sell can similarly fill below the observed best bid. Quotes can move while an order travels, so slippage relative to the chosen reference can also be favorable. Use adverse execution scenarios when testing how much cost the strategy can withstand.


Suppose a hypothetical short-term strategy earns a gross average of 0.15% per round trip on a fixed notional basis. Subtracting the illustrative 0.08% fee leaves 0.07%. If additional round-trip execution costs, not already included in the gross result, are 0.10%, the net estimate becomes −0.03%. This arithmetic is useful only when all percentages use the same basis and the spread has not been counted twice.


Market Orders Consume Order Book Depth


An order book is the list of buy and sell orders stacked at each price level. A market buy fills from the lowest ask upward until the full size is filled. If the quantity at the best ask is smaller than your order, the order moves to the next ask, and the average fill price is finalized above the displayed price.


Consider a fully hypothetical asset A, with a best ask of $100 and 2,000 units available at that price. A 500-unit market buy fills at $100 if the book does not change and those units remain available. Its $50,000 fill has zero book-walking slippage relative to the observed best ask. It still crosses the spread and incurs any applicable fee. These numbers describe a constructed example, not a current market snapshot.


Now take hypothetical asset B, also with a best ask of $100, but only 100 units there and 900 units at $101. With no intervening book changes, the same 500-unit buy takes 100 units at $100 and 400 at $101. The average fill is $100.80 and the executed notional is $50,400. The adverse slippage relative to the initial best ask is 0.80%, or 80bp, before fees and any spread component measured from the midpoint. This difference follows from the stated depth; daily turnover alone cannot determine it.


How a market order consumes successive book levels, pushing the average fill price above the displayed price
How a market order consumes successive book levels, pushing the average fill price...

Measure the Spread Instead of Inferring It From Volume


The bid-ask spread is the difference between the best bid and best ask. Liquidity and volatility affect it, but high daily turnover does not guarantee a tight spread at the instant of your order. A small market buy typically crosses to the ask, while a small market sell crosses to the bid. The spread definition follows Investor.gov’s bid and ask glossary.


For a hypothetical midpoint of $100, let the bid be $99.95 and the ask $100.05. Buying at the ask and immediately selling at the bid, with enough depth and no quote movement, loses $0.10 per unit: one full spread, or 10bp relative to the midpoint, not 20bp. Each side contributes a half-spread relative to the midpoint. If entry and exit spreads differ, the approximate round-trip spread cost is half the entry spread plus half the exit spread; spreads of 10bp and 20bp contribute about 15bp in total. If your midpoint-based slippage already measures these differences, do not add them again.


Volume counts traded units; turnover measures their monetary value. Turnover is useful for comparing activity across assets, but it is a historical total, not the depth available now. A large daily total can coexist with a thin book at a particular venue or time. Compare the spread, available depth at your intended size, and observed fills as well as turnover. For derivatives, check how the venue defines contract quantity and notional.


Order book depth and spread affect the price available for a particular order size
Order book depth and spread affect the price available for a particular order size

Weight Each Trade’s Cost by Its Notional


Frequency alone does not turn a cost rate into an account loss percentage. Calculate fees from executed notional × fee rate. Calculate execution-price differences from quantity × the difference between the fill and reference price, using a sign that makes adverse fills a positive cost. Equivalently, multiply a slippage rate by the reference notional used to derive that rate. In the asset B example, the cost is $50,000 × 0.80% = $400, not $50,400 × 0.80%. Sum these monetary costs, then divide by initial equity when expressing them as a percentage of initial equity. A simplified round-trip calculation uses notional × round-trip cost rate only when the rates share that notional basis and the entry and exit notionals are assumed equal. Otherwise calculate each side separately.


Assume 10 completed round trips per day over 22 days: 220 round trips. At 0.10% per round trip, total cost is 22% of initial equity only if every trade uses a fixed notional equal to that initial equity, entry and exit notionals are equal, and the calculation ignores price changes and compounding. At a fixed notional of 10% of initial equity, the same costs are 2.2%. Two round trips with the full-equity notional cost 0.2%, so the frequency and cost ratio is 220 ÷ 2 = 110 times. These are cumulative cost totals under fixed assumptions, not forecasts of the account’s return.


Keep margin separate from notional. In a simplified leveraged position, using margin equal to 10% of equity at 10× leverage produces notional equal to 100% of equity. A notional-based fee is then charged on that larger amount. A fee-only backtest may omit meaningful execution costs, but the amount omitted must be measured rather than assumed to be half of the total. Inspect cost totals alongside actual position sizing before attributing an equity-curve decline to trading frequency.


How per-trade cost accumulates with frequency, dragging a high-frequency strategy's equity curve down
How per-trade cost accumulates with frequency, dragging a high-frequency strategy's...

If the Edge Is Smaller Than the Cost, Expectancy Is Negative


Breakeven cost is the gross average return that execution costs and fees can consume before the estimated net expectancy reaches zero. Use gross returns and costs with matching units and position-size treatment. A positive historical net estimate is a candidate for further testing; it does not guarantee future profit. When returns are already calculated from actual fills, do not subtract the same execution difference again.


For equal-sized hypothetical trades, a 60% win rate with an average gain and loss of 0.30% gives 60% × 0.30% − 40% × 0.30% = 0.06% gross expectancy. Subtracting the illustrative 0.08% round-trip fee gives −0.02%. An additional 0.05% round-trip execution cost reduces it to −0.07%. Zero slippage cannot make this already fee-negative example profitable. If a fee-only backtest reports a positive result under these stated assumptions, check the inputs, loss signs, whether returns already include fees, the fee basis, and position sizes.


For that 0.06% gross edge, measured total round-trip costs must be below 0.06% merely to leave a positive point estimate. No asset name guarantees that condition. A hypothetical 0.50% total cost makes the estimate negative, while a hypothetical 3% gross average has 2.50% left after the same cost. The latter arithmetic still needs validation across market conditions and does not establish that a thinly traded asset is suitable.


Stress-Test Costs When Liquidity Can Recede


Even assets with thick books in normal conditions can lose order book depth quickly during volatility shocks. When price moves rapidly in one direction, resting limit orders are either filled or canceled, and new liquidity cannot replenish the book as fast as orders remove it. At that moment, a market order of the same size consumes much deeper levels than usual, increasing slippage.


Use a hypothetical stress scenario instead of inferring execution from a daily candle. Suppose an order normally fits within the best quote, but just before a stop triggers, most of that quoted depth is canceled and the next available prices are farther away. The resulting market order can fill beyond the intended stop level. A rise in daily turnover alone cannot reveal which orders were canceled, how much depth was available, or why prices moved; those claims require order book and trade data.


Estimate adverse fills from observations at the venue and times the strategy actually trades, then test worse scenarios as sensitivity checks. Include gaps, fast markets, and any sessions where your own data shows weaker depth. Neither a normally narrow spread nor a large daily turnover guarantees the stop fill. Reduce size or reject a setup when plausible execution costs consume its estimated edge.


Use Trading Cost Filters Before Choosing Assets and Strategies


Build cost filters around the strategy’s estimated edge and measured execution at the intended size. There is no universal $10 million turnover floor or 10bp spread ceiling that makes a strategy viable. Numerical limits should come from the cost budget and venue data, and should be reassessed when market conditions change.


  • Trading activity and depth: Use turnover as context, then inspect the current book and observed fills at the intended venue, session, and size. Daily turnover is not a liquidity guarantee.
  • Spread budget: Compare the entry half-spread plus a realistic exit half-spread with the strategy’s cost budget. An unchanged 10bp spread contributes one full 10bp spread to an immediate round trip, before fees and further slippage.
  • Cost assumptions: Use the applicable fee schedule and measured execution costs for normal and adverse conditions. The article’s 0.08% fee and 0.05% additional round-trip cost are examples, not minimum requirements. Avoid adding spread to slippage that already includes it.
  • Breakeven check: Compare gross expectancy and total costs on the same notional basis, allowing room for estimation error. If plausible costs consume the edge, reject or redesign the setup.
  • Order size check: Estimate fills across the necessary price levels. Reducing size or using limit orders may change execution, but a limit order can remain unfilled; splitting an order does not guarantee a lower total cost.

A high-frequency strategy needs evidence that its small per-trade edge survives its total turnover. Frequency does not by itself require a larger slippage rate: size, spread, latency, and market conditions determine the execution assumption. Before entry, set a maximum all-in cost, an intended size, and an exit rule from the tested strategy. If the available depth or expected exit cost breaches that budget, the setup is invalid even when the signal itself remains unchanged.


Rerun Backtests With Realistic Cost Assumptions


Rerun the strategy with normal and adverse costs using the same price benchmark, fee basis, and sizing rules. A zero-slippage run can serve as a baseline, but it does not establish achievable execution. Check which spread and execution effects are already included in fill prices before applying additional deductions. Compare both net expectancy and monetary cost totals across the scenarios.


Bar prices do not show how much quantity was available at a given instant. TradingView supports a fixed number of slippage ticks and commission settings in its strategy tests. Fixed adverse fill adjustments are a sensitivity tool; they do not reproduce changing order book depth, latency, or partial fills. Verify the simulator’s order timing and fill assumptions, especially when testing fills at the signal candle’s close. See TradingView’s strategy documentation.


For the earlier hypothetical 220 round trips, raising all-in cost from 0.10% to 0.15% raises cumulative costs from 22% to 33% of initial equity only under the same fixed full-equity notional, unchanged-price, no-compounding assumptions. At fixed 10%-of-initial-equity notional, the comparison is 2.2% to 3.3%. For an actual strategy, sum the costs from its own entry and exit sizes instead. Accept a candidate only after its estimated edge survives the costs and adverse fill scenarios relevant to those orders.

Check your own backtest

Upload an optimization results CSV or a TradingView strategy trade list to see its performance metrics together with robustness checks. No sign-in is needed to analyze.

Analyze my results file Explore an example report