calculate_acb
Calculate adjusted cost base and capital gains for Canadian trades using the CRA average-cost method, including superficial-loss rule detection.
Instructions
Compute adjusted cost base and capital gains for a set of trades (Canadian rules).
Runs the full calculation and returns: current holdings (shares, total ACB, ACB per share) per security; every disposition with proceeds, ACB, outlays, the gain before and after the superficial-loss rule, and whether it was a superficial loss; per-tax-year summaries with net and taxable capital gain; and any warnings.
Uses the CRA average-cost method (all shares of a security pool into one ACB; gains are computed against the average, not FIFO). Pass trades either inline as 'transactions' or as a file path in 'csv_path' (CSV or JSON). Each transaction is an object: date (YYYY-MM-DD), action ('buy' or 'sell'), security (ticker/symbol), shares, price (per share), and optionally commission, currency, fx_rate (trade-currency to CAD, e.g. 1.35 for USD), and note.
This is a calculation aid, not tax advice; verify results before filing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| csv_path | No | ||
| transactions | No |