You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| 13 | PUR RATE {BASE} | FX rate on the purchase date (SELL rows only) |
48
+
| 14 | RATE {BASE} | FX rate on the transaction date |
49
+
| 15 | PUR {BASE} | Purchase price in base currency (SELL rows only) |
50
+
| 16 | PRICE {BASE} | Price in base currency (BUY and SELL rows only) |
51
+
| 17 | DIV {BASE} | Dividend amount in base currency (DIVIDEND and WHT rows) |
52
+
| 18 | INT {BASE} | Interest amount in base currency (INTEREST rows only) |
53
+
| 19 | P&L {BASE} | Realized P&L in base currency (SELL rows only) |
54
+
| 20 | STCG {BASE} | Short-term capital gain in base currency (SELL rows held < 365 days) |
55
+
| 21 | LTCG {BASE} | Long-term capital gain in base currency (SELL rows held >= 365 days) |
56
+
57
+
`{BASE}` is replaced with the `--base-currency` value (e.g., `PUR RATE USD`, `DIV CAD`).
56
58
57
59
## Sort order
58
60
59
61
Rows are sorted by transaction date ascending, then by type, then by symbol. This produces a chronological view of all investment activity.
60
62
61
63
## Totals row
62
64
63
-
In table output, a totals row sums INCOME {BASE}, P&L {BASE}, STCG {BASE}, and LTCG {BASE} across all rows. This gives a quick summary of total income received, total realized gains/losses, and the STCG/LTCG split for the period.
65
+
In table output, a totals row sums DIV {BASE}, INT {BASE}, P&L {BASE}, STCG {BASE}, and LTCG {BASE} across all rows. This gives a quick summary of total dividends, total interest, total realized gains/losses, and the STCG/LTCG split for the period.
64
66
65
67
## Income handling
66
68
@@ -69,7 +71,7 @@ Income data comes from two sources:
69
71
-**Flex Query CashTransactions** -- Dividends, interest, and withholding tax from the IBKR Flex Query are converted to Income protos and persisted in the data directory during download.
70
72
-**Activity Statement CSVs** -- Dividends, interest, and withholding tax from Activity Statement CSV files are read at command time and merged with Flex Query income data.
71
73
72
-
Each income record has a type (DIVIDEND, INTEREST, or WHT), an amount in native currency, a symbol, an account, and a date. WHT amounts are negative (they represent tax withheld). The INCOME column in the output shows the amount, and the TYPE column distinguishes between the three income types.
74
+
Each income record has a type (DIVIDEND, INTEREST, or WHT), an amount in native currency, a symbol, an account, and a date. WHT amounts are negative (they represent tax withheld). Dividends and WHT populate the DIVIDEND column; interest populates the INTEREST column. The TYPE column distinguishes the specific income type within each column.
Copy file name to clipboardExpand all lines: book/src/tax-reporting.md
+19-16Lines changed: 19 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,7 +78,7 @@ The CSV does not include a totals row. To compute totals, sum P&L {BASE}, STCG {
78
78
79
79
## Transaction list: column reference
80
80
81
-
This file has 19 columns. Each row is one transaction event in chronological order.
81
+
This file has 21 columns. Each row is one transaction event in chronological order.
82
82
83
83
| # | Column Header | Description |
84
84
|---|---------------|-------------|
@@ -91,16 +91,18 @@ This file has 19 columns. Each row is one transaction event in chronological ord
91
91
| 7 | PUR PRICE | Cost basis per share in native currency. Only populated for SELL rows. |
92
92
| 8 | DATE | Transaction date (YYYY-MM-DD) |
93
93
| 9 | PRICE | Price per share in native currency. Only populated for BUY and SELL rows. |
94
-
| 10 | INCOME | Income amount in native currency. Only populated for DIVIDEND, INTEREST, and WHT rows. WHT values are negative. |
95
-
| 11 | P&L | Realized P&L in native currency. Only populated for SELL rows. |
96
-
| 12 | PUR RATE {BASE} | FX rate on the purchase date. Only populated for SELL rows. |
97
-
| 13 | RATE {BASE} | FX rate on the transaction date. Populated for all rows. |
98
-
| 14 | PUR {BASE} | Purchase price per share in base currency. Only populated for SELL rows. |
99
-
| 15 | PRICE {BASE} | Price per share in base currency. Only populated for BUY and SELL rows. |
100
-
| 16 | INCOME {BASE} | Income amount in base currency. Only populated for DIVIDEND, INTEREST, and WHT rows. |
101
-
| 17 | P&L {BASE} | Realized P&L in base currency. Only populated for SELL rows. |
102
-
| 18 | STCG {BASE} | Short-term capital gain in base currency. SELL rows held < 365 days. |
103
-
| 19 | LTCG {BASE} | Long-term capital gain in base currency. SELL rows held >= 365 days. |
94
+
| 10 | DIVIDEND | Dividend amount in native currency. Only populated for DIVIDEND and WHT rows. WHT values are negative, reducing the dividend total. |
95
+
| 11 | INTEREST | Interest amount in native currency. Only populated for INTEREST rows. |
96
+
| 12 | P&L | Realized P&L in native currency. Only populated for SELL rows. |
97
+
| 13 | PUR RATE {BASE} | FX rate on the purchase date. Only populated for SELL rows. |
98
+
| 14 | RATE {BASE} | FX rate on the transaction date. Populated for all rows. |
99
+
| 15 | PUR {BASE} | Purchase price per share in base currency. Only populated for SELL rows. |
100
+
| 16 | PRICE {BASE} | Price per share in base currency. Only populated for BUY and SELL rows. |
101
+
| 17 | DIV {BASE} | Dividend amount in base currency. Only populated for DIVIDEND and WHT rows. |
102
+
| 18 | INT {BASE} | Interest amount in base currency. Only populated for INTEREST rows. |
103
+
| 19 | P&L {BASE} | Realized P&L in base currency. Only populated for SELL rows. |
104
+
| 20 | STCG {BASE} | Short-term capital gain in base currency. SELL rows held < 365 days. |
105
+
| 21 | LTCG {BASE} | Long-term capital gain in base currency. SELL rows held >= 365 days. |
104
106
105
107
### Transaction types
106
108
@@ -123,22 +125,23 @@ SELL rows use FIFO lot matching (identical to the transaction sale list), so a s
123
125
124
126
Not all columns are populated for every row type. In particular:
125
127
126
-
-**BUY**: PRICE and PRICE {BASE} are populated. PUR DATE, PUR PRICE, INCOME, and P&L columns are blank.
128
+
-**BUY**: PRICE and PRICE {BASE} are populated. PUR DATE, PUR PRICE, DIVIDEND, INTEREST, and P&L columns are blank.
127
129
-**SELL**: All columns may be populated, including purchase info from the matched buy lot.
128
-
-**DIVIDEND / INTEREST / WHT**: INCOME and INCOME {BASE} are populated. QTY, PRICE, and P&L columns are blank.
129
-
-**SPLIT / MERGER / SPINOFF / TRANSFER_IN / TRANSFER_OUT**: QTY is populated. PRICE, INCOME, and P&L columns are blank. These are informational rows.
130
+
-**DIVIDEND / WHT**: DIVIDEND and DIV {BASE} are populated. WHT values are negative. QTY, PRICE, INTEREST, and P&L columns are blank.
131
+
-**INTEREST**: INTEREST and INT {BASE} are populated. QTY, PRICE, DIVIDEND, and P&L columns are blank.
132
+
-**SPLIT / MERGER / SPINOFF / TRANSFER_IN / TRANSFER_OUT**: QTY is populated. PRICE, DIVIDEND, INTEREST, and P&L columns are blank. These are informational rows.
130
133
131
134
### Totals
132
135
133
-
The CSV does not include a totals row. To compute totals, sum INCOME {BASE}, P&L {BASE}, STCG {BASE}, and LTCG {BASE} across all rows. This gives total income (dividends + interest - withholding tax), total realized gains/losses, and the STCG/LTCG split.
136
+
The CSV does not include a totals row. To compute totals, sum DIV {BASE}, INT {BASE}, P&L {BASE}, STCG {BASE}, and LTCG {BASE} across all rows. This gives total dividends (net of WHT), total interest, total realized gains/losses, and the STCG/LTCG split.
134
137
135
138
## FX rate methodology
136
139
137
140
For cross-currency trades, native prices are converted to the base currency using date-specific FX rates:
138
141
139
142
-**Purchase price in base currency** = native purchase price multiplied by the FX rate on the purchase date.
140
143
-**Sale price in base currency** = native sale price multiplied by the FX rate on the sale date.
141
-
-**Income in base currency** = native income amount multiplied by the FX rate on the payment date.
144
+
-**Dividend/interest in base currency** = native amount multiplied by the FX rate on the payment date.
142
145
-**P&L in base currency** = `(sale price in base - purchase price in base) * quantity`.
143
146
144
147
This means the base-currency P&L captures both the underlying price movement of the security and the FX movement between the purchase and sale dates.
0 commit comments