Selling half a winning position did not create half its profit
You buy 100 shares at £100 and the midprice rises to £102. The position shows a £200 gain. You sell 50 shares, but the sale executes at £101.90. Did you “realize half the £200” and still have £100 unrealized? Close, but not quite: the bid-side execution cost takes £5 from total economic value.
Rebuild the position from cash and inventory
Ignore fees, dividends and financing for one paragraph. The initial purchase costs £10,000, so cash changes by −£10,000 and inventory becomes 100 shares. At a £102 midprice, inventory is marked at £10,200. Total wealth relative to the pre-purchase cash position is therefore +£200.
Now sell 50 shares at £101.90. The sale brings in £5,095. Cumulative cash flow from the two trades is . Remaining inventory is 50 shares worth at the mid. Sum cash and marked inventory: . The position’s total economic P&L is £195 before other costs.
| Stage | Cumulative trade cash flow | Shares held | Mid-marked inventory | Total P&L |
|---|---|---|---|---|
| Just after buying at £100 | −£10,000 | 100 | £10,000 | £0 |
| Mid rises to £102 | −£10,000 | 100 | £10,200 | £200 |
| Sell 50 at £101.90 | −£4,905 | 50 | £5,100 | £195 |
Had those 50 shares sold at the £102 mid, total wealth would still be £200. Selling at £101.90 instead of the mark costs . This is an execution effect, not merely an accounting relabeling.
Realized and unrealized are a split of the total
Under a simple average-cost convention, the 50 sold shares have £100 cost basis each. Their realized trading gain is . The 50 remaining shares have marked unrealized gain . Together they equal £195. If you later sell the remaining shares, their execution price and fees determine the final cash outcome.
With multiple purchase prices, FIFO, average cost and other accepted lot conventions can assign different amounts to realized versus unrealized P&L after a partial sale. They do not change cash already received or the market value of what remains. Do not confuse a change in accounting label with a gain generated by the trade itself. Tax rules can make lot selection economically relevant, but that is a separate calculation and depends on jurisdiction and account details.
The self-financing update
Let be shares held just before a new trade, the prior mark, the new mark, the signed number of shares purchased at execution price , and explicit fees. Cash changes by . If wealth is cash plus shares marked at , then period P&L can be decomposed as
The first term is mark-to-market change on inventory already held. The second is the cost or benefit of trading away from the current mark. For the sale above, and , so the second term is −£5. The formula makes spread cost visible without using a realized/unrealized convention.
Marks require care. The midprice is not always the liquidation price for a large position. If the book is thin, a bid-side or impact-aware liquidation mark can give a lower value. A mark should also have a timestamp and source; stale marks can make P&L appear smooth and then jump when prices refresh. Return smoothing and Sharpe annualization discusses one consequence of stale marks.
Explicit fees belong in the same reconciliation. If the partial sale at £101.90 also costs £2 in fees, cash from the sale rises by only £5,093 and total P&L becomes £193. Under the simple cost-basis split, realized gain on the 50 sold shares is £93 after the fee and the remaining marked gain is £100. Changing the mark from £102 mid to a £101.80 liquidation value for the remaining 50 shares would reduce the reported total by another £10. The fee is an actual cash cost; the mark change is a valuation choice about the unsold inventory. Both matter, but they should be identified separately.
Make the ledger complete
Real portfolio P&L may include dividends, coupons, borrow fees, funding interest, FX conversion, corporate actions and tax or exchange fees. Add those as cash flows or value changes in a consistent currency. For a derivative, the relevant mark may be a model price rather than a traded mid, and model parameter changes can create P&L even if the underlying price barely moves. The simple share example is a foundation for reconciling the complete ledger, not a full accounting policy.
A reproducible daily report stores beginning cash and inventory, every fill and fee, ending inventory, ending marks, and external deposits or withdrawals. Reconcile the ending wealth to the prior wealth plus trading and market changes. If the realized and unrealized columns disagree with the cash-plus-inventory total, the report has an accounting problem before it has a trading insight.
Sell part of the position and reconcile P&L
The book bought 100 shares at £100. The sale fee applies only if at least one share is sold.
Practice
Execution priceIn the example, what would total P&L be if the partial sale executed at £101.80 instead of £101.90, with the same £102 mid mark?Show answer
The sale proceeds would be £5,090, £5 less than before. Remaining inventory stays marked at £5,100. Total P&L becomes £190 before explicit fees.
LabelsIf an accounting policy changes which purchase lot is assigned to a sale, must the cash-plus-marked-inventory total P&L change?Show answer
No. The split between realized and unrealized can change, but the actual trade cash flows and current inventory mark do not change solely because the cost-basis label changed.