September 29, 2026 · research

Your Backtest Spent the Same Cash Twice: A Guide to Portfolio Accounting

Your Backtest Spent the Same Cash Twice: A Guide to Portfolio Accounting

A portfolio backtest can report a smooth equity curve while spending the same dollar twice. It happens when the simulator treats equity, cash, collateral and buying power as interchangeable. They’re related, but they answer different questions: what the account owns, what it owes, and what it can commit to another order right now.

Say a strategy starts with $10,000 and buys $6,000 of an asset. It has $4,000 in free cash. If the backtest then sizes a second position as 100% of its $10,000 equity, it has committed $16,000 of exposure while recording only $10,000 of capital. That may be valid leverage under some account rules. It is not valid just because the sizing code used “equity.”

Wrong way one: treating equity as cash

This shortcut shows up in multi-asset strategies. Every signal sizes its order as a fraction of current portfolio value, and each order sees the full value. The portfolio loop calculates orders independently, then adds them together without reserving capital.

The wreckage is easy to miss in a backtest with liquid instruments and no margin calls. Returns look plausible; position weights, summed after the fact, sometimes add up to 140% or 180%. A live account may reject the later orders or carry leverage the strategy never meant to use.

Reserve cash as orders are formed. For a cash account, a $2,000 buy consumes $2,000 plus fees. For a margin account, calculate the required margin using the venue’s rules, then reduce available buying power by that amount. If several orders arrive together, define their priority. Otherwise the result can depend on which loop happened to run first.

Wrong way two: counting locked collateral as free buying power

On a derivatives venue, posting $1,000 of collateral doesn’t necessarily mean the account has $1,000 less equity. It does mean that collateral is committed to the open position. A common accounting shortcut deducts it from cash, then also deducts the position’s full notional from buying power. Another does the reverse and treats the collateral as both free cash and margin.

Either mistake distorts what the next order can do. The first can make a strategy look needlessly constrained; the second can approve orders the account can’t support. At 5× leverage, a $5,000 position might require roughly $1,000 of initial margin, but maintenance margin, fees, unrealized losses and venue-specific tiers change the usable amount. Notional is not the same thing as collateral.

Account quantityWhat it representsCan fund a new order?
EquityAccount value after liabilities and marked positionsOnly subject to margin and buying-power rules
Free cashCash not already spent, reserved or pledgedYes, within the instrument’s rules
Locked collateralFunds supporting an open position or orderUsually unavailable until released
Buying powerVenue-calculated capacity for additional ordersYes, up to the current limit

Model these as separate quantities, even if a particular venue makes some of them equal in a simple case. Then test what happens when a position loses money: equity falls, maintenance margin may rise as a share of notional, and available buying power can shrink faster than either number alone suggests.

Wrong way three: releasing cash when the signal exits

A backtest often frees capital the instant an exit signal appears. But an exit signal is not an execution. The order may be pending, partially filled, or cancelled; until the position actually closes, its margin and exposure remain. Even after a fill, fees and realized P&L affect what becomes available.

The wreckage tends to cluster during fast turnover. The simulator closes one trade, immediately spends the proceeds on another, then assumes both fills happened cleanly at their desired prices. In paper trading, the second order can be rejected while the first position is still open. Or the exit fills only in part, leaving the account with less free capital than the backtest expected.

Track pending orders and positions as commitments. Release capital on fills, not on intentions. A partially filled exit should release capital in proportion to the amount actually closed, after costs. That sounds fussy until two strategies compete for the same cash on a volatile day.

Make the ledger explicit

For each decision point, keep a ledger that updates in a fixed order: mark existing positions, calculate equity and margin, process fills and costs, recompute buying power, then size and reserve new orders. Record enough detail to reconcile every change in cash and position value.

One useful invariant: every accepted order must be fundable under the account model at the moment it is submitted. If the simulator can’t explain which cash or margin supports it, the backtest hasn’t demonstrated that the portfolio could hold it.

Run a small audit alongside the return calculation. Report peak gross exposure, minimum free cash, minimum margin headroom and the count of orders that would have exceeded buying power. A strategy that performs well only when capital is silently reused has a portfolio-sizing result, not a deployable backtest.

portfolio accountingbuying powerbacktestingmargincash management
← All posts