How imports work
How the app recognizes a broker file, which rows it skips and why, what a second upload does, and how imported, hand-entered and synced trades differ.
This page explains what happens behind the Import Data window. For the clicks themselves, see Import a broker file.
Supported brokers and file types
The app reads the trade history export of Questrade, Desjardins Online Brokerage (DISNAT), RBC Direct Investing, tastytrade and Charles Schwab, plus its own format: the template from Download Template XLSX and files made with Export Trades.
The file can be CSV, XLSX, JSON or XML, up to 50 MB. For an XLSX file, only the first sheet is read. A ZIP file is not a broker file: it's a full MyTraderDash backup.
Of these, only tastytrade files (and the tastytrade sync) carry the time of each trade; the others give dates. The time decides the order of same-day trades when pairing buys and sales, see Trades and positions.
How the broker is recognized
The app looks at the file's column headings, not its name and not the broker of the account:
- It first checks whether the headings match the broker of the account you picked.
- If not, it tries every broker it knows. Some files have a few lines of account details before the headings (RBC has eight); the app knows where each broker's headings are.
- If exactly one broker matches, the file is read as that broker's file. The preview shows Detected broker format with its name.
- If none matches, or more than one does, the file is unsupported.
So a Questrade file imported into an account set up as Schwab is still read correctly, as Questrade, and its trades go into the account you picked.
Unsupported files
When no broker matches, you see Unsupported — logged to help us add support under the drop box. Nothing is imported and nothing in your data changes. We're notified, and a copy of the file is kept for 30 days so support for that format can be added, then deleted automatically. Files the app can read are imported, not kept.
What you can do instead:
- Make sure it's the activity or transactions export, not a statement, holdings or tax file.
- Copy your trades into the template and import that.
- Enter the trades with Add a trade by hand.
The preview: nothing is saved yet
When you pick a file, the app reads it and shows the Import Preview. At this point nothing is written. The app:
- reads every row and decides whether it's a trade, a dividend, an option expiry, a transfer or something to skip;
- looks up each ticker, so the counts are right before you confirm;
- gives each row a confidence score. Rows it isn't sure about are counted as Low Confidence:
they are imported, but tagged
needs-attentionso you can check them; - lists rows that are identical on the same day: they are imported as separate trades (see Importing the same trades again);
- spots transfers in or out of the account and asks you about any it can't work out (see Transfers between accounts).
Rows that are skipped
A broker file holds much more than trades.
Cash records. Rows that move money without being a trade or a dividend are kept as cash records and counted under Cash Records in the preview: deposits and withdrawals, transfers between accounts, interest earned or paid, account fees and the GST/HST on them, currency conversions, securities lending income, and tax withheld on a dividend (a row of its own at most brokers, linked to its dividend when it's paid the same day). They aren't trades, so they don't change any position or P&L; the tax report credits the withholding (see Foreign tax credit). Importing the same file again doesn't add them twice. Drop Trades and Delete All Trades remove them too.
Skipped rows. Everything else that isn't a trade or a dividend is skipped and counted under Will Skip. The Skipped Rows list shows them by reason, using short codes. The codes differ a little between brokers; the common ones are:
| Code | What the rows are |
|---|---|
MONEY_MOVEMENT, CASH_TRANSFER | A cash movement of a kind the app doesn't recognise yet, or with no amount |
NON_TRADE_ACTION: … | Questrade activity that isn't a trade (the activity type follows the colon) |
BALANCE_ADJUSTMENT | Balance corrections by the broker with no amount |
CANCELLED | A trade the broker cancelled, and the cancellation itself |
SPLIT, SYMBOL_CHANGE, CORPORATE_ACTION | Corporate events. Splits are applied from market data instead |
UNKNOWN_TYPE, UNSUPPORTED_ACTION | A kind of row the app doesn't handle yet |
NO_SYMBOL, NO_DATE, EMPTY_ROW | Rows missing what a trade needs |
UNPAIRED_JOURNAL | One half of a share move between listings whose other half isn't in the file |
OPTION_PARSE_FAILED | An option row whose contract couldn't be read |
UNRESOLVABLE_TICKER | A ticker no market data provider knows |
For UNRESOLVABLE_TICKER, a Know what this is? link next to each ticker lets you tell us what
the ticker is now (after a merger or a name change, for example).
Download Issue Rows saves the skipped and low-confidence rows to a CSV file, with the original columns, so you can see exactly which lines they were.
Importing the same trades again
Each trade has an identity made of its account, date, ticker, type (buy, sell, dividend…), quantity, price and fees (plus the strike and expiration for an option). When a row's identity is already in that account, it is the same trade:
- New identity: the trade is added and counted as Inserted.
- Identity already there, nothing new: the trade is left as it is and counted as Unchanged. Importing the same file twice is all Unchanged.
- Identity already there, a value changed (the file's quantity, fees, date…): the existing trade is updated in place and counted as Updated. The result window's Download lists each one with the fields that changed. Your grouping and dividend choices stay attached to the trade.
- A trade you added by hand, or whose price you changed: left alone. It counts as Skipped in the result.
So you can safely import overlapping files: a new export that repeats last month's trades only adds what's new. Two consequences worth knowing:
- Edits to the date, quantity or fees of an imported trade (without a price change) are replaced by the file's values when that file is imported again.
- Two rows in one file that are identical in every one of those details (two separate fills of the same size and price on the same day, from a broker that gives only the date) are kept as separate trades, and the preview lists them. Importing the file again still adds nothing: the app counts the copies of each row and finds the same ones again. A later file with fewer copies of that day (exported before the day ended) adds nothing; one with more adds the missing fills.
A trade you deleted comes back if you import a file that still contains it.
What happens after the import
As soon as the trades are saved, the app rebuilds everything that depends on them, for the whole workspace:
- Transfers and journals between accounts and listings are paired.
- Trades are grouped into positions (Trades and positions).
- Option assignments and exercises are linked to their share trades.
- Dividends are matched to positions (Dividends).
- Strategies are detected (Strategy detection).
- Tags are refreshed (Tags and labels).
Then the app fetches prices for open positions that don't have one yet. If any are missing, Done opens the Loading Market Data page; see Prices and market data.
Imported, hand-entered and synced trades
| Kind | How it gets in | What an import does to it |
|---|---|---|
| Imported | From a broker file | Left alone when the same row comes again; updated when the file's values differ |
| Added by hand | Add Trade on the Trade Log | Never changed by an import |
| Synced | From a connected brokerage (Accounts & Data) | Each sync adds new transactions only; trades already there are left as they are |
| Added by the system | Created by the app itself to make the pairing work | Rebuilt on every recalculation |
A trade added by hand is stored exactly like the same trade imported from a file, and goes through the same grouping. If the account already has a trade with the same identity, Add Trade refuses it with "This trade is already in this account".
The system's own trades (such as a $0 stand-in for a buy that isn't in your history) are explained in Trades and positions.
Related
- Import a broker file: the import step by step.
- Connect a brokerage: syncing instead of importing.
- Data issues: what to do with what the import couldn't place.