Realized P&L Errors When Equity Positions Cross Corporate Actions
Summary
A platform user reports that a backtest transaction record can misstate realized profit and loss when a stock position passes through an ex-rights corporate action. The example compares transactions in Chinese equities before and after such an adjustment and argues that a calculation based only on the price difference multiplied by the quantity sold can produce an erroneous result when the share count and price basis have changed.
The suggested correction is to calculate proceeds and cost from each execution's own price and quantity, then compare the resulting amounts. The post is a specific bug report, not a general accounting specification or independently verified platform fix. It does not explain how commissions, distributed entitlements, taxes, or other corporate actions should enter the calculation, so those details require separate treatment when reconciling backtest P&L.
Key ideas
- Corporate actions can change share quantities and prices between entry and exit.
- A simple price difference multiplied by the sale quantity may misstate realized P&L after an adjustment.
- The post recommends comparing execution proceeds and cost using each fill's own price and quantity.
- The example is a user-reported backtest discrepancy rather than a verified fix.
- The treatment of fees and other corporate-action effects is not specified.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.