ShareCalc CSV Format
The ShareCalc CSV format lets you import transactions directly without using a broker-specific parser. Each line represents one transaction. There is no header row.
A 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
| # | Name | Format |
|---|---|---|
| 0 | Transaction Type | String |
| 1 | Date | Date / Datetime |
| 2 | Base asset | Asset ID |
| 3 | Base quantity | Decimal |
| 4 | Out asset | Asset ID |
| 5 | Out quantity | Decimal |
| 6 | Fees asset | Asset ID |
| 7 | Fees quantity | Decimal |
| 8 | Tax asset | Asset ID |
| 9 | Tax quantity | Decimal |
| 10 | Accrued income asset | Asset ID |
| 11 | Accrued income quantity | Decimal |
| 12 | Tax country | Country |
| 13 | Ex-date | Date |
| 14 | Settled date | Date |
| 15 | Extra | String |
| 16 | Financial Instituion Transaction ID | String |
| 17 | Financial Instituion Account ID | String |
| 18 | Note | String |
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 |
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,,,,,,,,,,,,,
Attributed Income
Types: DIV, M_DIV, N_DIV, INT, M_INT, N_INT, INT_PAID
| # | 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,,,,,,,,,,,,,