Skip to content
Platform

Find & understand

Discover companiesFrom the market to your shortlistStock ScreenerSee a shortlist take shapeCompany researchUnderstand the business behind a stock

Test & prepare

Reality CheckPut an investing rule in perspectivePlan your riskWork out what is at stake

Keep developing

Review & learnReflect on decisions and build knowledgeAll workspace toolsFind your next starting point
Reality CheckAcademyPricing
Sign inGet started free
  1. Academy
  2. /
  3. Backtesting, statistics, costs and validation
  4. /
  5. Modelling costs: the term that decides everything

Lesson 94 of 120 · Advanced · 16 min read

Modelling costs: the term that decides everything

Run the AAPL rule with modeled costsFree, no account needed.

On this page

· 12 sections
  1. Why costs are the spine, not the trim
  2. The six components of a realistic cost model
  3. Spread: what immediacy costs
  4. Impact: the cost you create yourself
  5. Commissions, statutory fees and the costs on the confirmation
  6. Borrow and financing: the costs of holding
  7. Building a cost model you can defend
  8. Working it through
  9. Where this goes wrong in practice
  10. What to do with this
  11. Knowledge check
  12. Glossary
Back to top

What you will be able to do

  • Explain why a zero-cost backtest answers a different question rather than an optimistic one
  • Name and model all six cost components: spread, impact, commission, statutory fees, borrow and financing
  • Model impact against participation rather than against a currency amount, and derive a capacity limit from it
  • Separate execution costs charged per leg from holding costs charged per day
  • Report a breakeven cost so a result can be checked against a measured figure rather than an assumed one

Read these first

  • Measuring slippage in Orders, execution, slippage and microstructure
  • Effective vs quoted spread in Orders, execution, slippage and microstructure
  • Liquidity and depth in Orders, execution, slippage and microstructure
  • Hidden costs in Orders, execution, slippage and microstructure

A backtest that models zero cost is not an optimistic version of your strategy. It is the answer to a different question, and that question is not one anybody can trade. Cost is not a haircut applied at the end; it is the term that decides which ideas survive, and it is the single place where the orders and execution track feeds directly into validation. This is the longest lesson in the track for a reason.

Why costs are the spine, not the trim

Consider what a cost model actually does to a result. If a rule produces an average of forty basis points per round trip and the round trip costs eight, the rule is worth studying. If it costs thirty-eight, the rule is a rounding error. If it costs forty-five, the rule is a way to lose money slowly with a great deal of activity. The gross number did not change across those three sentences. Only the cost assumption did, and it decided the entire outcome.

Now notice that cost scales with turnover while edge, in most constructions, does not scale nearly as fast. Double the trading frequency of a rule and you roughly double the cost. You rarely double the edge. This is why cost is not a detail that shifts a result slightly: it is the term that selects between strategy families. High-frequency ideas need extraordinary gross edges to clear it. Low-turnover ideas can survive on very modest ones. A person who models cost at zero cannot see that distinction at all, and will consistently be drawn to the rules that trade the most, because those are the ones with the most apparent opportunities.

The practical consequence is a reordering of the work. Estimate the round-trip cost for your instruments and your size before you write the strategy, and use it to determine what gross edge would even be worth hunting. That number is a floor, and it tells you immediately whether a class of idea is reachable. Hunting for a three basis point effect in a market where your round trip costs twelve is not ambitious; it is arithmetic that has already failed.

Zero cost answers a different question

A frictionless backtest tells you whether the signal contains information. That is worth knowing, but it is a research finding, not a strategy. Never present or interpret a frictionless result as a statement about what could have been earned.

The six components of a realistic cost model

A complete cost model has six terms. Most amateur models have one - commission - which is very often the smallest of the six. The execution track measures several of these directly; here they are assembled into something a simulator can apply.

  1. Spread. The price of immediacy. What crossing from the midpoint to the far side costs you, per side.
  2. Impact. The additional cost created by your own order consuming depth, which grows with size relative to available liquidity.
  3. Commissions. Whatever your broker charges, per share or per order, including any exchange rebate or fee passed through.
  4. Statutory and regulatory fees. Small, mandatory, asymmetric between buys and sells, and easy to forget entirely.
  5. Borrow. The cost of locating and holding a short position, which ranges from negligible to prohibitive and is not constant over time for a given name.
  6. Financing. Interest on borrowed capital, and the carry embedded in leveraged or derivative exposure.

The first two are execution costs, charged per trade. The last two are holding costs, charged per unit of time. Commissions and statutory fees are explicit and appear on the confirmation. A model that mixes these categories into one flat number per trade will be badly wrong for any strategy whose holding period differs from the one the number was calibrated on, which is most of them.

Spread: what immediacy costs

The quoted spread is the distance between the best bid and the best offer. Crossing it costs you approximately half of it relative to the midpoint, per side, so a full round trip that crosses on both entry and exit pays approximately one full quoted spread.

Approximately, because the price you actually receive is not necessarily at the quote. The relevant measure is the effective spread: twice the signed distance from your fill to the midpoint that prevailed when your order arrived. Divide the effective spread by the quoted spread and you have a ratio that tells you whether you are systematically doing better or worse than the visible quote. That ratio, and the disclosure regime that makes it comparable across venues, is the subject of the execution track's lesson on effective versus quoted spread.

Three mistakes when putting spread into a simulator

  • Using a single average spread for a whole universe. Spreads differ by an order of magnitude between a large index fund and a small illiquid name. A pooled average describes neither and flatters exactly the names where cost matters most.
  • Using a central estimate when the strategy selects the tail. If the rule trades on volatility spikes, gaps or news, it is trading precisely when spreads are widest. Calibrating on the median of all minutes and applying it to the minutes the rule actually trades understates the cost systematically, and it understates it most in the situations the rule was built for.
  • Assuming a passive order avoids the spread. A resting order that fills has often been filled because someone with better information wanted the other side. That is adverse selection, and it converts an apparent spread saving into a realised loss.

The third point is the one that separates a naive model from a defensible one. Passive execution does not remove cost; it changes its form from a visible spread into an invisible selection effect plus the opportunity cost of the orders that never filled. A simulator that fills every limit order the moment price touches it, and charges nothing for it, has assumed away both.

Impact: the cost you create yourself

Impact is the part of the cost caused by your own order. It is the difference between what the trade would have cost at negligible size and what it cost at yours.

The mechanism is straightforward. The book holds a finite quantity at each price. An order larger than the quantity at the best price consumes it and continues into the next level, and the next. Your average fill is therefore worse than the top of the book, and the gap grows with size. Beyond the mechanical part, a large order also signals something, and other participants adjust their quotes in response, so the price you are walking into moves away from you.

Two properties matter for modelling. Impact is not linear in size - it grows more slowly than proportionally in most empirical work, which means a rough square-root shape is a far better default than a flat per-share charge. And impact has a temporary and a permanent part: some of the price move reverts after you stop trading and some does not. For a strategy that trades in and out, the permanent part is charged twice in a sense, because it moves the price against you on the way in and you are then unwinding into a market you have already moved.

The variable to model against

Do not model impact against a currency amount. Model it against participation: your order size as a fraction of the available depth or of the instrument's typical volume over the window you are trading in. A hundred thousand dollars is nothing in a large index fund and is the entire book in a small name. Participation is the variable that behaves consistently across instruments, and it is also the variable you can control, which makes it the right one to have in the model.

The most important consequence of taking impact seriously is that capacity becomes a property of the strategy. A rule that works at small size and fails at large size is not a failed rule; it is a rule with a capacity limit, and knowing that limit before you scale is far cheaper than discovering it after. A backtest with no impact term has no capacity limit at all, which is immediately recognisable as false and yet is the default in most frameworks.

Commissions, statutory fees and the costs on the confirmation

The explicit costs are the easiest to model correctly and the ones most often modelled as the whole story.

Commissions vary by broker, by instrument and by structure. A per share charge and a per order charge behave completely differently as size changes: the per order charge dominates for small trades and becomes negligible for large ones, while the per share charge is scale invariant. Model whichever structure you actually pay, and include any pass-through of venue fees and rebates if your broker passes them through.

Statutory and regulatory fees are small per trade and have two properties that make them worth modelling explicitly rather than folding into an average. They are typically charged on sales only, not purchases, which makes them asymmetric between the two legs of a round trip. And the rate is set administratively and changes periodically, so a fixed constant in your code will silently drift from reality. Both properties are minor in magnitude and both matter for a high-turnover rule, because a small asymmetric charge repeated thousands of times is not small.

Currency and settlement

If the instrument settles in a currency other than your account's, there is a conversion cost on each leg, and it is frequently far larger than the commission. It is also frequently invisible, because it appears as a rate rather than as a fee. Any test involving foreign listings needs this term explicitly, and the honest version uses your broker's actual conversion spread rather than the interbank rate.

Borrow and financing: the costs of holding

The two time-based costs are where a naive per-trade model breaks most completely, because they scale with holding period rather than with turnover.

Borrow

To sell short you must borrow the instrument. That has a cost, and the cost is set by supply and demand for the loan, not by a schedule. For a widely held, easily borrowed name it may be trivial. For a name that many people want to short it can exceed any plausible edge, and it can change abruptly. It is also not merely a price: a borrow can become unavailable, and a loan already made can be recalled, which forces a close at a time you did not choose.

Three modelling implications follow. A short leg must carry a borrow charge per day held. The names that a short-selling rule most wants to short are, on average, the names with the highest borrow cost, so an average rate applied uniformly is biased in the wrong direction. And a backtest that assumes every name was shortable on every day is asserting something that was often false; the honest version filters to names with a recorded borrow availability, or at minimum excludes the very smallest and most heavily shorted names where availability is least likely.

Financing

Leverage costs interest. If a strategy holds more exposure than the account's capital, the excess is financed, and the rate is not zero. The same applies inside leveraged products: the financing is embedded in the product's return rather than charged to you separately, which makes it easy to omit and just as real. Where a strategy is market-neutral by construction, the short proceeds may offset part of the financing, and modelling that correctly requires knowing your own arrangement rather than assuming a textbook one.

The general rule: any cost that accrues with time must be applied per day held and not per trade. A rule holding for one day and a rule holding for two months face wildly different holding costs and identical execution costs, and a single blended figure per trade cannot represent both.

Building a cost model you can defend

A defensible model does not need to be sophisticated. It needs to be explicit, conservative, calibrated on the right conditions, and tested for sensitivity.

  1. Measure, do not assume. If you have your own fills, compute signed cost against arrival price in basis points, per instrument, per participation bucket. That is the input. If you have no fills, use published execution statistics for comparable instruments and be explicit that the figure is external.
  2. Calibrate on the conditions the rule trades in. Not the median minute of the median day. If the rule fires on gaps, measure spreads on gap mornings.
  3. Use a distribution, not a point. A single constant hides the fact that costs are right-skewed. At minimum know the median and an upper percentile, and check whether the result survives at the upper one.
  4. Make impact a function of participation. A square-root shape in participation is a reasonable default and is vastly better than a constant.
  5. Separate per-trade from per-day. Execution costs on each leg, holding costs on each day held.
  6. Round in the unfavourable direction. Where a figure is uncertain, choose the end that makes the strategy look worse. You are trying to find out whether the idea survives, not whether it can be made to appear to.
  7. Report the breakeven cost. The single most useful output of a cost model is not the net return; it is the round-trip cost at which the strategy's edge reaches zero. That number can be compared directly against a measured cost, and it turns an argument about assumptions into an arithmetic check.

Report the breakeven, always

Net return depends on your cost assumption and is therefore contestable. The breakeven cost does not depend on it at all. Quote the breakeven alongside every result and the conversation moves from whose assumption is right to whether the measured cost is above or below a fixed line.

Working it through

IllustrativeOne constructed rule, six cost components applied in sequence. Illustrative.

A rule holds a market-neutral pair for an average of 4 days, trades roughly 500 round trips a year across a mid-liquidity universe, and reports a gross edge of 34 basis points per round trip before any costs.

  • Spread. Median quoted spread in this universe is about 9 basis points, and the rule crosses on both legs of both sides. Charged at half the quoted spread per crossing, four crossings, that is about 18 basis points.
  • Impact. At 2 percent participation in the traded window, a square-root model puts impact near 4 basis points per round trip across both legs.
  • Commission. At the assumed schedule, about 1.5 basis points per round trip.
  • Statutory fees. Charged on the sale legs only, about 0.1 basis points.
  • Borrow. The short leg at an assumed 1.5 percent annualised over 4 days is about 1.6 basis points on that leg.
  • Financing. Net of short proceeds, assumed near zero for this constructed case.

Total modelled cost is about 25 basis points against a gross edge of 34, leaving 9 basis points. The breakeven cost is 34 basis points, which is only 36 percent above the modelled figure. That is a narrow margin, and it means the conclusion rests on the cost estimate being close to right rather than on the edge being large.

Two stress tests follow immediately. Charge the spread at an upper percentile rather than the median, roughly doubling that term, and the net edge goes negative. Raise the assumed borrow to a level typical of a hard-to-borrow name and the same happens. So the correct summary is not that this rule earns nine basis points. It is that this rule is profitable only under median cost conditions, in easily borrowed names, at low participation, and any one of those three failing removes the edge entirely. Those three conditions are now the strategy's real specification.

Where this goes wrong in practice

  • Modelling commission only. The single visible component is very often the smallest of the six.
  • Applying one flat cost per trade to every instrument. Spreads vary by an order of magnitude and the average flatters the expensive names.
  • Calibrating on average conditions for a rule that trades extreme ones. Costs are highest exactly when the signal fires.
  • Omitting impact entirely. This asserts infinite capacity, which is plainly false and removes any ability to find the size limit before the market does.
  • Charging holding costs per trade rather than per day. Breaks completely as soon as the holding period changes.
  • Assuming every name was shortable and at an average borrow rate. The names a short rule wants are the ones where both assumptions fail.
  • Assuming a passive order avoids the cost. It converts spread into adverse selection plus unfilled opportunity, neither of which the simulator sees.
  • Tuning the cost assumption until the result survives. At that point the cost model is an output of the strategy rather than an input to it.

What to do with this

  1. Estimate the round-trip cost first, before writing the rule, and use it to decide what gross edge is worth hunting.
  2. Model all six components - spread, impact, commission, statutory fees, borrow, financing - even where some are small, so that a change in the strategy cannot silently make a small one large.
  3. Calibrate spread and impact per instrument and per participation bucket, in the conditions the rule actually trades.
  4. Split execution costs per leg from holding costs per day so the model stays correct when the holding period changes.
  5. Report the breakeven cost next to every result and compare it against a measured figure rather than an assumed one.
  6. Re-run at an upper-percentile cost and treat any result that does not survive as conditional on benign execution.
  7. Freeze the cost model before the strategy work and change it only with a written reason that has nothing to do with the result it produces.

Read a cost assumption beside an actual test

Reality Check compares a daily rule before and after modeled costs; it does not measure your broker's fills. Use the tested-rules library to inspect what each documented study charges and leaves out.

Read the QQQ opening-range breakout study and the SPY overnight study with this checklist: are costs charged per leg or per round trip, which holding costs apply, and how much additional cost would erase the result? An intraday entry and a close-to-open holding window need their own execution assumptions, even on liquid index ETFs.

Examples and common mistakes

Worked example

IllustrativeSix cost components applied to one constructed market-neutral pair rule
Six cost components applied to one constructed market-neutral pair rule - illustrative figures, not a performance record.
ComponentBasisCost per round tripCharged per
Spreadhalf the 9 bp quoted spread, four crossings18.0 bpleg
Impactsquare-root model at 2 percent participation4.0 bpleg
Commissionassumed broker schedule1.5 bpleg
Statutory feessale legs only0.1 bpleg
Borrow1.5 percent annualised over 4 days on the short leg1.6 bpday held
Financingnet of short proceeds in this construction0.0 bpday held

Total modelled cost of about 25 basis points against a gross edge of 34 leaves 9 basis points, and the breakeven cost is 34, only about 36 percent above the modelled figure. Charging the spread at an upper percentile instead of the median, or raising borrow to a hard-to-borrow level, takes the net edge negative. So the honest summary is not that this construction earns 9 basis points; it is that it is profitable only at median spreads, in easily borrowed names, at low participation, and those three conditions are the strategy's real specification.

How this goes wrong in practice

  • Modelling commission only, when the single visible component is very often the smallest of the six
  • Applying one flat cost per trade across instruments whose spreads differ by an order of magnitude
  • Calibrating on average conditions for a rule that fires precisely when spreads are widest
  • Omitting impact entirely, which asserts infinite capacity and hides the size limit until the market finds it
  • Charging borrow and financing per trade rather than per day held
  • Assuming every name was shortable, and at an average borrow rate, when a short rule wants the names where both fail
  • Assuming a passive order avoids cost, when it converts spread into adverse selection plus unfilled opportunity
  • Adjusting the cost assumption until the strategy survives, which makes cost an output rather than an input

Checklist

  • A round-trip cost estimate produced before the strategy work, used to decide what edge is worth hunting
  • All six components present in the model, including the ones currently small
  • Spread and impact calibrated per instrument and per participation bucket, in the conditions the rule trades
  • Execution costs charged per leg and holding costs charged per day
  • A breakeven cost reported beside every result
  • A re-run at an upper-percentile cost, with any result that fails it labelled conditional
  • The cost model frozen before the strategy work and changed only for a reason unrelated to the result

Knowledge check

Question 1 of 3Why does modelling cost at zero systematically bias a researcher towards high-turnover strategies?
Question 2 of 3Impact should be modelled as a function of which variable?
Question 3 of 3What is the practical advantage of reporting a breakeven cost alongside a result?

Exercise

Take one instrument you actually trade and build a six-component round-trip cost estimate for it at your typical size: half the quoted spread per crossing, an impact term based on your participation, your real commission schedule, statutory fees on the sale leg, a borrow rate if you would ever short it, and financing if you use leverage. Then take any rule you are considering and compute its breakeven cost. Write both numbers on one line and decide, before running anything further, whether the gap between them is large enough for the idea to be worth testing.

Glossary, tools and sources

Glossary

Effective spread
Twice the signed distance from your fill to the midpoint prevailing when the order arrived. The measured cost of crossing, as opposed to the quoted one.
Impact
The additional cost created by your own order consuming depth and signalling intent. Grows less than proportionally with size and has both a temporary and a permanent part.
Participation
Order size expressed as a fraction of available depth or of typical volume in the trading window. The variable impact responds to.
Borrow cost
The charge for borrowing an instrument in order to sell it short, set by supply and demand for the loan rather than by a schedule, and capable of changing abruptly.
Breakeven cost
The round-trip cost at which a rule's edge reaches zero. Independent of your cost assumption, and therefore the most checkable figure in a cost analysis.
Capacity
The size beyond which impact consumes a strategy's edge. A property of the strategy, invisible in any backtest with no impact term.

Use it in the app

  • Strategy test - one rule before and after modelled costs, no account needed
  • Tested rules - inspect each study's cost assumptions
  • QQQ opening-range breakout - inspect intraday execution assumptions
  • SPY overnight - inspect close-to-open execution assumptions
  • Backtesting - apply a cost model to a rule before believing it
  • Journal - measure your own realised costs against arrival price
  • Chart - inspect spread and depth in the conditions a rule trades
  • Rules vs buy and hold - popular trading rules tested against simply holding, after costs

Sources

  1. Section 31 Transaction Fees: Basic Information for Firms(opens in a new tab)

    US Securities and Exchange Commission. Retrieved 2026-08-31.

  2. Key Points About Regulation SHO(opens in a new tab)

    US Securities and Exchange Commission. Retrieved 2026-08-31.

  3. Disclosure of Order Execution Information, Release No. 34-99679 (2024 amendments to Rule 605)(opens in a new tab)

    US Securities and Exchange Commission. Retrieved 2026-08-31.

  4. Frequently Asked Questions: Rule 605 of Regulation NMS (April 1, 2026)(opens in a new tab)

    US Securities and Exchange Commission. Retrieved 2026-08-31.

Risk notice

This lesson is general educational information about modelling transaction costs in research. It is not investment advice, not a recommendation to buy or sell any security, and not tailored to your circumstances. Every figure shown is a constructed illustration and not a record of any account, broker schedule or system. Real costs vary by broker, instrument, size and market conditions, and a conservative model does not guarantee that realised costs will be lower. Trading involves risk of loss, including loss of the full amount invested.

Press when you have finished reading. Nothing is recorded until you do.

Next step

The link opens AAPL with one rule filled in: buy after the close crosses above its 20-day average, sell after it closes back below. Press Run, then compare the result before and after modeled costs with simply holding AAPL over the same dates. A past result is not a forecast.

Run the AAPL rule with modeled costs

No account needed. Saving stocks to your account requires free signup in the app; no card needed.

Previous lessonPoint-in-time data: what was known, and when14 minNext lessonOut of sample, holdouts and walk-forward testing14 min
Back to top

Test a trading rule against holding. Keep the evidence and build your research from there.

support@estockes.comSupport replies within 1-2 business days.

Product

  • Home
  • Pricing
  • Free tools
  • Calculators
    • Compounding
    • Position size
    • Risk and reward
    • Leveraged ETF decay
    • Day trading account checker
  • Academy - free course
  • Test a strategy
  • Strategies we tested
  • Compared with TradingView
  • Compared with Finviz
  • Compared with Investing.com
  • Test a rule without code
  • System status
  • What's new

Company

  • About
  • Contact
  • Support

Legal

  • Terms of Service
  • Privacy Policy
  • Refunds
  • Security
  • Data request
Review us on Trustpilot (opens in a new tab)

Share your honest experience.

Featured on LaunchBuffestockes on VibeRank
© 2026 estockes - estockes.com · Operated by Eylon Sabag · Prices in USD

estockes is a research and analytics tool, not a registered investment adviser, broker-dealer, or financial planner. Nothing here is investment, financial, legal, or tax advice. All content is for informational and educational purposes only. Trading involves substantial risk of loss; past performance does not guarantee future results. You trade at your own risk.

Mailing address (correspondence only)
800 N. King St, Suite 304-2048, Wilmington, DE 19801, USAThe operator is Eylon Sabag, an Israeli sole proprietor. This iPostal1 address receives correspondence; it is not a U.S. office or a separate U.S. company.
Previous lessonPoint-in-time data: what was known, and when14 min
Next lessonOut of sample, holdouts and walk-forward testing14 min