ShareCalc CSV Format
The ShareCalc CSV format lets you import transactions directly without using a broker-specific parser. Each line represents one transaction.
A header row is optional. Without one, columns are read positionally in the order below. With one, columns may appear in any order and optional columns may be omitted — see Header row.
A headerless row must have at least 4 columns. Trailing optional columns may be omitted, but note that asset and quantity columns are always paired: you cannot include one without the other, so column counts of 5, 7, 9, or 11 are invalid. The maximum is 19 columns.
Generally, numbers are always positive, but exceptions apply as detailed below. The base asset represents the asset the transaction operates on.
To import a CSV file, go to the Import section, select ShareCalc CSV as the file format, and follow the instructions on screen.
Schema
Column Definitions
The Header column gives the identity string used to name each column in an optional header row.
| # | Name | Header | Format |
|---|---|---|---|
| 0 | Transaction Type | transaction_type |
String |
| 1 | Date | date |
Date / Datetime |
| 2 | Base asset | base_asset |
Asset ID |
| 3 | Base quantity | base_quantity |
Decimal |
| 4 | Out asset | out_asset |
Asset ID |
| 5 | Out quantity | out_quantity |
Decimal |
| 6 | Fees asset | fees_asset |
Asset ID |
| 7 | Fees quantity | fees_quantity |
Decimal |
| 8 | Tax asset | tax_asset |
Asset ID |
| 9 | Tax quantity | tax_quantity |
Decimal |
| 10 | Accrued income asset | accrued_income_asset |
Asset ID |
| 11 | Accrued income quantity | accrued_income_quantity |
Decimal |
| 12 | Tax country | tax_country |
Country |
| 13 | Ex-date | ex_date |
Date |
| 14 | Settled date | settled_date |
Date |
| 15 | Extra | extra |
String |
| 16 | Financial Instituion Transaction ID | transaction_id |
String |
| 17 | Financial Instituion Account ID | account_id |
String |
| 18 | Note | note |
String |
Header row
You may include an optional header row as the first line of the file. It is detected automatically: if the first column of the first line is one of the identity strings above, that line is treated as a header rather than a transaction.
When a header is present:
- Columns may appear in any order.
- Optional columns may be omitted entirely (rather than left empty).
- Unknown columns are ignored, so you can point ShareCalc at an existing file (e.g. a broker export) and map only the columns you need — any other columns are skipped.
transaction_typeanddateare required.- A known column may not be repeated, and each data row must have exactly as many columns as the header.
Example
The following reordered file with a header is equivalent to a positional file containing the same transactions:
date,transaction_type,base_quantity,base_asset,out_quantity,out_asset,extra
2022/06/01 10:40:06,BUY,1000,AAPL,57276.25,GBP,
2024/07/15,CAP_DIST,,AAPL,50.00,GBP,mvalue=82.00
Unknown columns such as broker_ref below are ignored:
transaction_type,broker_ref,date,base_asset,base_quantity,out_asset,out_quantity
BUY,REF123,2022/06/01 10:40:06,AAPL,1000,GBP,57276.25
Transaction Types
The first column of every row is the transaction type code.
| CSV Value | Label | Category |
|---|---|---|
BUY |
Buy Trade | Trade |
SELL |
Sell Trade | Trade |
DIV |
Dividend | Attributed Income |
M_DIV |
Manufactured Dividend | Attributed Income |
N_DIV |
Notional Dividend | Attributed Income |
INT |
Interest | Attributed Income |
M_INT |
Manufactured Interest | Attributed Income |
INT_PAID |
Interest Paid | Attributed Income |
N_INT |
Notional Interest | Attributed Income |
PID |
Property Income Distribution | Attributed Income |
M_PID |
Manufactured Property Income Distribution | Attributed Income |
NGNL_TRANSFER |
No Gain/No Loss Transfer | No Gain/No Loss Transfer |
EQ |
Equalisation | Equalisation |
SPLIT |
Split | Share Reorganisation |
REV_SPLIT |
Reverse Split | Share Reorganisation |
BONUS |
Bonus Issue | Share Reorganisation |
SPIN_OFF |
Spin Off | Spin Off |
CAP_DIST |
Capital Distribution | Capital Distribution |
BROKER_INT |
Broker Interest | Unattributed Income |
BROKER_INT_PAID |
Broker Interest Paid | Unattributed Income |
WDL |
Withdrawal | Withdrawal and Deposits |
DEP |
Deposit | Withdrawal and Deposits |
FEE |
Fee | Fee |
FEE_REFUND |
Fee Refund | Fee |
OPT_EXERCISE |
Option Exercise | Option Assign/Exercise |
OPT_ASSIGN |
Option Assignment | Option Assign/Exercise |
OPT_EXERCISE_CASH |
Cash Option Exercise | Option Cash Assign/Exercise |
OPT_ASSIGN_CASH |
Cash Option Assignment | Option Cash Assign/Exercise |
OPT_EXPIRE |
Option Expiry | Option Expire |
BOND_MATURITY |
Bond Maturity | Bond Maturity |
See the Transactions page for a description of each type.
Column 15: Extra
Column 15 contains semicolon-separated flags and key=value pairs. It can be left empty if none apply.
| Key | Format | Description |
|---|---|---|
mvalue= |
Decimal | Market value per unit |
ratio= |
out:in |
Reorganisation ratio |
u_qty= |
Decimal | Underlying quantity |
oc= |
O,C,OC |
Open/close flag. O: open position, C: close position, OC: close previous position and open new position in opposite direction |
E |
flag | Tax exempt |
Examples
mvalue=0.2;oc=C
ratio=2:1
Field Formats
| Format | Description |
|---|---|
| Asset ID | String identifying the asset. ShareCalc will try and find the asset using the symbol and ISIN fields in your DB |
| Decimal | Numeric value |
| Date | YYYY/MM/DD |
| Datetime | YYYY/MM/DD HH:MM:SS<UTC offset> or YYYY/MM/DD HH:MM:SS or YYYY/MM/DD HH:MM or YYYY/MM/DD HH:MM<UTC offset> or Date (time will be set to midnight) |
| Country | HMRC self assessment country code, similar to ISO 3166 alpha-3 (e.g. GBR, USA) |
Transaction Categories
Trade
Types: BUY, SELL
| # | Name | Req | Notes |
|---|---|---|---|
| 0 | Type | required | |
| 1 | Date | required | |
| 2 | Base asset | required | Asset traded |
| 3 | Base quantity | required | |
| 4 | Out asset | required | Consideration |
| 5 | Out quantity | required | |
| 6 | Fees asset | optional | |
| 7 | Fees quantity | optional | negative allowed for liquidity rebate |
| 8 | Tax asset | optional | Transaction tax |
| 9 | Tax quantity | optional | |
| 10 | Accrued income asset | optional | For gilts |
| 11 | Accrued income quantity | optional | positive/negative |
| 12 | Tax country | empty | |
| 13 | Ex-date | empty | |
| 14 | Settled date | optional | required when accrued income exists |
| 15 | Extra | optional | oc=, E |
| 16 | Transaction ID | optional | |
| 17 | Account ID | optional | |
| 18 | Note | optional |
Examples
BUY,2022/06/01 10:40:06,AAPL,1000,GBP,57276.25,GBP,1.25
SELL,2023/08/01 15:22:42,AAPL,200,USD,100,,,,,,,,,,,,,
No Gain/No Loss Transfer
Types: NGNL_TRANSFER
A no gain/no loss transfer is a quantity-only disposal; the deemed proceeds are derived from the matched acquisition, so no consideration is entered.
| # | Name | Req | Notes |
|---|---|---|---|
| 0 | Type | required | |
| 1 | Date | required | |
| 2 | Base asset | required | Asset transferred |
| 3 | Base quantity | required | |
| 4 | Out asset | empty | |
| 5 | Out quantity | empty | |
| 6 | Fees asset | empty | |
| 7 | Fees quantity | empty | |
| 8 | Tax asset | empty | |
| 9 | Tax quantity | empty | |
| 10 | Accrued income asset | empty | |
| 11 | Accrued income quantity | empty | |
| 12 | Tax country | empty | |
| 13 | Ex-date | empty | |
| 14 | Settled date | empty | |
| 15 | Extra | optional | E |
| 16 | Transaction ID | optional | |
| 17 | Account ID | optional | |
| 18 | Note | optional |
Examples
NGNL_TRANSFER,2022/07/01 14:22:42,AAPL,60,,,,,,,,,,,,,,,
Attributed Income
Types: DIV, M_DIV, N_DIV, INT, M_INT, N_INT, INT_PAID, PID, M_PID
For PID and M_PID the base asset must be a UK REIT and the withholding tax must be 20% of the gross distribution.
| # | Name | Req | Notes |
|---|---|---|---|
| 0 | Type | required | |
| 1 | Date | required | |
| 2 | Base asset | required | Underlying |
| 3 | Base quantity | empty | |
| 4 | Out asset | required | |
| 5 | Out quantity | required | |
| 6 | Fees asset | optional | |
| 7 | Fees quantity | optional | |
| 8 | Tax asset | optional | Withholding tax |
| 9 | Tax quantity | optional | |
| 10 | Accrued income asset | empty | |
| 11 | Accrued income quantity | empty | |
| 12 | Tax country | required | |
| 13 | Ex-date | optional | required for notional |
| 14 | Settled date | optional | empty for notional |
| 15 | Extra | optional | E |
| 16 | Transaction ID | optional | |
| 17 | Account ID | optional | |
| 18 | Note | optional |
Examples
M_DIV,2022/06/05,BND,,USD,100,,,,,,,USA,2022/06/02,,,,,
DIV,2022/06/05,VTI,,USD,100,,,USD,10,,,USA,2022/06/02,,,,,
Unattributed Income
Types: BROKER_INT, BROKER_INT_PAID
| # | Name | Req | Notes |
|---|---|---|---|
| 0 | Type | required | |
| 1 | Date | required | |
| 2 | Base asset | empty | |
| 3 | Base quantity | empty | |
| 4 | Out asset | required | |
| 5 | Out quantity | required | |
| 6 | Fees asset | empty | |
| 7 | Fees quantity | empty | |
| 8 | Tax asset | optional | Withholding tax |
| 9 | Tax quantity | optional | |
| 10 | Accrued income asset | empty | |
| 11 | Accrued income quantity | empty | |
| 12 | Tax country | required | |
| 13 | Ex-date | empty | |
| 14 | Settled date | empty | |
| 15 | Extra | optional | E |
| 16 | Transaction ID | optional | |
| 17 | Account ID | optional | |
| 18 | Note | optional |
BROKER_INT,2022/09/03 12:40:00,,,USD,36,,,USD,12,,,USA,,,,,,
BROKER_INT_PAID,2022/07/03 12:40:00,,,GBP,2
Equalisation
Types: EQ
| # | Name | Req | Notes |
|---|---|---|---|
| 0 | Type | required | |
| 1 | Date | required | |
| 2 | Base asset | required | |
| 3 | Base quantity | empty | |
| 4 | Out asset | required | |
| 5 | Out quantity | required | |
| 6 | Fees asset | empty | |
| 7 | Fees quantity | empty | |
| 8 | Tax asset | empty | |
| 9 | Tax quantity | empty | |
| 10 | Accrued income asset | empty | |
| 11 | Accrued income quantity | empty | |
| 12 | Tax country | empty | |
| 13 | Ex-date | required | |
| 14 | Settled date | empty | |
| 15 | Extra | optional | E |
| 16 | Transaction ID | optional | |
| 17 | Account ID | optional | |
| 18 | Note | optional |
Examples
EQ,2022/06/05,FUND,,GBP,42,,,,,,,,2022/06/02,,,,,
Share Reorganisation
Types: SPLIT, REV_SPLIT, BONUS
| # | Name | Req | Notes |
|---|---|---|---|
| 0 | Type | required | |
| 1 | Date | required | |
| 2 | Base asset | required | |
| 3 | Base quantity | required | Quantity change. Negative when short |
| 4 | Out asset | empty | |
| 5 | Out quantity | empty | |
| 6 | Fees asset | empty | |
| 7 | Fees quantity | empty | |
| 8 | Tax asset | empty | |
| 9 | Tax quantity | empty | |
| 10 | Accrued income asset | empty | |
| 11 | Accrued income quantity | empty | |
| 12 | Tax country | empty | |
| 13 | Ex-date | empty | |
| 14 | Settled date | empty | |
| 15 | Extra | required | ratio= |
| 16 | Transaction ID | optional | |
| 17 | Account ID | optional | |
| 18 | Note | optional |
Examples
Holding 100 shares of AAPL; after a 2-for-1 split the quantity increases by 100.
SPLIT,2022/06/14 16:00:00,AAPL,100,,,,,,,,,,,,ratio=2:1,,,
Holding 200 shares of AAPL; after a 2-for-1 split the quantity decreases by 100.
REV_SPLIT,2022/06/14 16:00:00,AAPL,100,,,,,,,,,,,,ratio=1:2,,,
Holding 1000 shares of AAPL; after a 5-for-1 bonus issue, the quantity increases by 5000.
BONUS,2022/06/14 16:00:00,AAPL,5000,,,,,,,,,,,,ratio=5:1,,,
Spin Off
Types: SPIN_OFF
| # | Name | Req | Notes |
|---|---|---|---|
| 0 | Type | required | |
| 1 | Date | required | |
| 2 | Base asset | required | |
| 3 | Base quantity | empty | |
| 4 | Out asset | required | Spun off asset |
| 5 | Out quantity | required | |
| 6 | Fees asset | empty | |
| 7 | Fees quantity | empty | |
| 8 | Tax asset | empty | |
| 9 | Tax quantity | empty | |
| 10 | Accrued income asset | empty | |
| 11 | Accrued income quantity | empty | |
| 12 | Tax country | empty | |
| 13 | Ex-date | empty | |
| 14 | Settled date | empty | |
| 15 | Extra | optional | E |
| 16 | Transaction ID | optional | |
| 17 | Account ID | optional | |
| 18 | Note | optional |
Examples
Spin off 500 shares of CHILD and SOURCE is valued at £0.4 per share.
SPIN_OFF,2022/07/01 10:40:06,SOURCE,,CHILD,500,,,,,,,,,,mvalue=0.4,,,
Capital Distribution
Types: CAP_DIST
| # | Name | Req | Notes |
|---|---|---|---|
| 0 | Type | required | |
| 1 | Date | required | |
| 2 | Base asset | required | |
| 3 | Base quantity | empty | |
| 4 | Out asset | required | |
| 5 | Out quantity | required | |
| 6 | Fees asset | empty | |
| 7 | Fees quantity | empty | |
| 8 | Tax asset | empty | |
| 9 | Tax quantity | empty | |
| 10 | Accrued income asset | empty | |
| 11 | Accrued income quantity | empty | |
| 12 | Tax country | empty | |
| 13 | Ex-date | empty | |
| 14 | Settled date | empty | |
| 15 | Extra | optional | E, mvalue= |
| 16 | Transaction ID | optional | |
| 17 | Account ID | optional | |
| 18 | Note | optional |
Examples
£50 capital distribution from AAPL, where AAPL is valued at £82.00 per share.
CAP_DIST,2024-07-15,AAPL,,GBP,50.00,,,,,,,,,,mvalue=82.00
Withdrawal and Deposits
Types: DEP, WDL
| # | Name | Req | Notes |
|---|---|---|---|
| 0 | Type | required | |
| 1 | Date | required | |
| 2 | Base asset | empty | |
| 3 | Base quantity | empty | |
| 4 | Out asset | required | |
| 5 | Out quantity | required | |
| 6 | Fees asset | optional | |
| 7 | Fees quantity | optional | |
| 8 | Tax asset | empty | |
| 9 | Tax quantity | empty | |
| 10 | Accrued income asset | empty | |
| 11 | Accrued income quantity | empty | |
| 12 | Tax country | empty | |
| 13 | Ex-date | empty | |
| 14 | Settled date | empty | |
| 15 | Extra | optional | E |
| 16 | Transaction ID | optional | |
| 17 | Account ID | optional | |
| 18 | Note | optional |
Examples
WDL,2022/07/04 12:40:00,,,GBP,200
Fee
Types: FEE, FEE_REFUND
| # | Name | Req | Notes |
|---|---|---|---|
| 0 | Type | required | |
| 1 | Date | required | |
| 2 | Base asset | empty | |
| 3 | Base quantity | empty | |
| 4 | Out asset | required | |
| 5 | Out quantity | required | |
| 6 | Fees asset | empty | |
| 7 | Fees quantity | empty | |
| 8 | Tax asset | empty | |
| 9 | Tax quantity | empty | |
| 10 | Accrued income asset | empty | |
| 11 | Accrued income quantity | empty | |
| 12 | Tax country | empty | |
| 13 | Ex-date | empty | |
| 14 | Settled date | empty | |
| 15 | Extra | optional | E |
| 16 | Transaction ID | optional | |
| 17 | Account ID | optional | |
| 18 | Note | optional |
Examples
FEE,2022/07/04 12:40:00,,,GBP,2,,,,,,,,,,,,,
Option Exercise and Assignment
Types: OPT_EXERCISE, OPT_ASSIGN
| # | Name | Req | Notes |
|---|---|---|---|
| 0 | Type | required | |
| 1 | Date | required | |
| 2 | Base asset | required | |
| 3 | Base quantity | required | |
| 4 | Out asset | required | |
| 5 | Out quantity | required | |
| 6 | Fees asset | optional | |
| 7 | Fees quantity | optional | |
| 8 | Tax asset | optional | Transaction tax |
| 9 | Tax quantity | optional | |
| 10 | Accrued income asset | optional | for underlying trade |
| 11 | Accrued income quantity | optional | |
| 12 | Tax country | empty | |
| 13 | Ex-date | empty | |
| 14 | Settled date | optional | required when accrued income exists |
| 15 | Extra | required | u_qty=, E (underlying quantity required) |
| 16 | Transaction ID | optional | |
| 17 | Account ID | optional | |
| 18 | Note | optional |
Examples
OPT_ASSIGN,2022/06/20 13:13:21,MY_OPTION,40,USD,125,USD,1.25,,,,,,,,u_qty=10,,,
Option Cash Excercise and Assignment
Types: OPT_EXERCISE_CASH, OPT_ASSIGN_CASH,
| # | Name | Req | Notes |
|---|---|---|---|
| 0 | Type | required | |
| 1 | Date | required | |
| 2 | Base asset | required | |
| 3 | Base quantity | required | |
| 4 | Out asset | required | |
| 5 | Out quantity | required | |
| 6 | Fees asset | optional | |
| 7 | Fees quantity | optional | |
| 8 | Tax asset | optional | Transaction tax |
| 9 | Tax quantity | optional | |
| 10 | Accrued income asset | empty | |
| 11 | Accrued income quantity | empty | |
| 12 | Tax country | empty | |
| 13 | Ex-date | empty | |
| 14 | Settled date | empty | |
| 15 | Extra | optional | E |
| 16 | Transaction ID | optional | |
| 17 | Account ID | optional | |
| 18 | Note | optional |
Examples
OPT_ASSIGN_CASH,2022/06/20 13:20:21,MY_OPTION,60,USD,150,USD,1.25,,,,,,,,,,,
Option Expire
Types: OPT_EXPIRE
| # | Name | Req | Notes |
|---|---|---|---|
| 0 | Type | required | |
| 1 | Date | required | |
| 2 | Base asset | required | |
| 3 | Base quantity | required | |
| 4 | Out asset | empty | |
| 5 | Out quantity | empty | |
| 6 | Fees asset | empty | |
| 7 | Fees quantity | empty | |
| 8 | Tax asset | empty | |
| 9 | Tax quantity | empty | |
| 10 | Accrued income asset | empty | |
| 11 | Accrued income quantity | empty | |
| 12 | Tax country | empty | |
| 13 | Ex-date | empty | |
| 14 | Settled date | empty | |
| 15 | Extra | optional | E |
| 16 | Transaction ID | optional | |
| 17 | Account ID | optional | |
| 18 | Note | optional |
Examples
OPT_EXPIRE,2022/07/01 15:13:21,MY_OPTION,100,,,,,,,,,,,,,,,
Bond Maturity
Types: BOND_MATURITY
| # | Name | Req | Notes |
|---|---|---|---|
| 0 | Type | required | |
| 1 | Date | required | |
| 2 | Base asset | required | Bond |
| 3 | Base quantity | required | |
| 4 | Out asset | required | Currency |
| 5 | Out quantity | required | Redemption |
| 6 | Fees asset | empty | |
| 7 | Fees quantity | empty | |
| 8 | Tax asset | empty | |
| 9 | Tax quantity | empty | |
| 10 | Accrued income asset | empty | |
| 11 | Accrued income quantity | empty | |
| 12 | Tax country | empty | |
| 13 | Ex-date | empty | |
| 14 | Settled date | empty | |
| 15 | Extra | empty | |
| 16 | Transaction ID | optional | |
| 17 | Account ID | optional | |
| 18 | Note | optional |
Examples
BOND_MATURITY,2023/07/01 16:20:00,ASSET,900,GBP,9200,,,,,,,,,,,,,