Transaction cost
A transaction cost is an explicit charge or implicit expense incurred in initiating, executing, processing, or settling a transaction.
Experimentation for Engineers
Execution cost is the expense incurred when carrying out a trade, including the difference between the intended and obtained transaction price and related charges.
- How it is used
- Guides exchange-routing decisions by serving as the business metric for an A/B test.
- How deep it goes
- Works through simulation, replication, randomized measurement, aggregate differences, standard errors, and z-score decisions.
- Examples
- Uses simulated ASDAQ and BYSE trades, including 12.28 versus 8.14 mips and 100-trade averages.
- What you can do after
- Operate/configure it by randomizing exchange measurements and rerouting trades when cost differences meet practical and statistical criteria.
Read how Experimentation for Engineers explains transaction cost →
Investing for Programmers
A transaction fee is a charge incurred when buying or selling a financial asset.
- How it is used
- Adjusts trading-strategy returns so backtests account for the cost of executing each buy or sell.
- How deep it goes
- Defines the charge and implements fixed per-transaction deductions, without modeling variable fee schedules or market frictions.
- Examples
- Uses a one-dollar-per-transaction assumption, Python backtests, and ETF-versus-direct-stock-purchase comparisons.
- What you can do after
- Apply it via a Python backtest to subtract estimated fees and judge whether strategy gains survive trading costs.
Read how Investing for Programmers explains transaction cost →
Build a Robo-Advisor with Python (From Scratch)
A transaction cost is an expense incurred when buying, selling, transferring, or modifying an asset or contract.
- How it is used
- Frames transaction costs as constraints on trading, rebalancing, tax-loss harvesting, and frequent investment activity.
- How deep it goes
- Quantifies spreads and commissions in a Python function, while treating taxes as a separate practical consequence of trading.
- Examples
- Uses frequent trading, portfolio rebalancing, housing upgrades, and a tax-loss-harvesting cost function as examples.
- What you can do after
- Evaluate/understand trades by comparing tax benefits with spread and commission costs.
Read how Build a Robo-Advisor with Python (From Scratch) explains transaction cost →
Financial AI in Practice
Trading expenses, including fees, slippage, and spreads, that reduce returns.
- How it is used
- Tests whether apparent market-prediction profits survive real-world trading friction.
- How deep it goes
- Names fees, slippage, and bid-ask spreads as costs that erode margins, without quantifying them.
- Examples
- Contrasts academic paper-trading studies that omit trading costs with strategies exposed to real capital losses.
- What you can do after
- Evaluate market-prediction claims by accounting for trading friction rather than relying on accuracy alone.
Read how Financial AI in Practice explains transaction cost →
Related concepts
- bid-ask spreaduses · The bid-ask spread is the difference between the highest price a buyer is willing to pay and the lowest price a seller is willing to accept for an asset.
- simulationmeasured by · A simulation is a modeled or controlled enactment of a system, process, or scenario used to examine or reproduce behavior under specified conditions.
- metrickind of · A metric is a quantitative measure used to characterize or assess a property, condition, behavior, performance, or outcome.
- meanmeasured by · A mean is a measure of central tendency, calculated as the arithmetic average of values or, for a random variable, as the probability-weighted average of its possible values.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.



