Skip to content
Backtesting

Modeling fees, slippage, and turnover in backtests.

Separate costs already inside ETF prices from portfolio-level management fees, financing rates, commissions, and slippage using ENSEMBLE's fee overlay.

By Updated 2 min read

A gross backtest tells you whether a strategy had signal before friction. A net-of-cost view tells you whether the strategy survives contact with real markets, advisory fees, and portfolio turnover.

Before labeling any historical return "net of costs," separate what is already embedded in market prices from what must be modeled at the portfolio layer.

What is already in prices vs. what must be modeled

Cost layerAlready in ETF prices?How to model in ENSEMBLE
Underlying ETF expense ratiosYes (reflected in daily NAV and adjusted market prices)Do not subtract again; compare fund expenses during asset screening
Internal ETF leverage financingYes (embedded in leveraged or return-stacked ETF total returns)Do not double-count with financing_rate unless portfolio weights exceed 100%
Advisory / model management feeNoSet management_fee in the Business fee overlay (e.g., 0.0075 for 75 bps/year)
Portfolio margin / financing above 100%NoSet financing_rate on gross portfolio exposure above 100%
Brokerage commissionsNoSet commission_bps on two-sided traded notional
Bid-ask spread & market impact (slippage)NoSet slippage_bps on two-sided traded notional
Account-level taxesNoEvaluate turnover and ETF tax wrappers separately

How turnover multiplies small cost assumptions

Two-sided turnover counts both the sell leg and the buy leg. Rotating 100% of a portfolio from SPY into BIL is 200% two-sided turnover (100% sold + 100% bought).

Compare how 10 basis points of two-sided slippage (slippage_bps = 10, reasonable for liquid ETFs during stressed volatility) affects two very different strategies:

  • Quarterly 60/40 static model (~15% annual two-sided turnover): 0.15 * 10 bps = 1.5 bps/year drag. Negligible.
  • Fast daily or monthly rotation model (~400% annual two-sided turnover): 4.00 * 10 bps = 40 bps/year drag, rising to 120 bps/year if trading wider-spread thematic or small-cap ETFs at 30 bps of slippage.

This is why fast lookbacks and tight signal thresholds routinely look great gross of costs and mediocre once realistic turnover friction is applied.

Using ENSEMBLE's fee overlay (include=fees)

On the Business plan, you can request a net-of-fee view on any saved model history or retained run through the web UI, REST API, CLI, or MCP without re-running the backtest:

# Inspect net-of-fee returns alongside gross returns via REST API
curl "https://api.ensemble.markets/v1/runs/RUN_ID?include=history,fees&management_fee=0.005&slippage_bps=5&commission_bps=1" \
  -H "Authorization: Bearer YOUR_API_KEY"

The API returns the fees block aligned with dates, preserving both the exact assumptions object and the daily net returns series so an advisor or committee reviewer can audit gross versus net returns transparently.

For time-varying spreads, asset-specific bid-ask costs, or tiered brokerage schedules, write those rules explicitly inside your Python model script and emit custom diagnostics so every assumption lives in versioned code.

Start researching with your agent

Use the workflow below to build a saved allocation model, compare turnover across rebalance schedules, and inspect cost sensitivity over matching windows.

Start with this request

Use ENSEMBLE to confirm my connected account. Build a saved allocation model with 60% SPY and 40% TLT, rebalanced monthly. Check asset coverage and available credit first. Show the saved inputs, historical results, drawdowns and allocations, then retain a quarterly-rebalancing test over matching dates without replacing the original result.

Frequently asked questions

Do I need to subtract ETF expense ratios manually in an ENSEMBLE backtest?
No. Observed ETF and mutual-fund total-return prices already reflect each fund's internal expense ratio. Adding an extra fee for fund expenses on top of ETF prices would double-count them.
What fee parameters does ENSEMBLE's Business fee overlay support?
On Business, requesting the fees view (include=fees) overlays four flat portfolio-level assumptions on gross returns: management_fee (annual fraction, such as 0.01 for 1%), financing_rate (annual fraction on gross exposure above 100%), commission_bps (basis points of two-sided traded notional), and slippage_bps (basis points of two-sided traded notional).
Does applying a fee overlay rerun my model or change stored gross results?
No. The fee overlay computes daily net returns alongside the stored gross returns block without overwriting the underlying run. You can inspect gross and net figures side by side under different fee assumptions.
Are taxes included in ENSEMBLE's standard fee overlay?
No. Tax outcomes depend on individual lot selection, holding periods, account type (IRA vs. taxable), wash sales, and jurisdiction. Treat backtest returns as pre-tax unless you build custom tax-drag diagnostics explicitly inside your model script.

Backtests are illustrative. Past performance does not guarantee future results. ENSEMBLE is a software platform, not an investment adviser.

Part of Backtest a portfolio. Keep the model behind it..

Continue this research with your agent.Connect to agents