How to Import Past Trades into TradeLyser
Your journal and analytics are only as good as the history behind them. Sync Trades brings in today's orders, so trades from before you connected your broker need a separate step. Depending on your broker, that is either Sync History, which pulls past trades straight from the broker API, or a file import of the tradebook you download from your broker. Either way it usually takes 5 to 15 minutes.
Once your history is in you can:
- See win rate, expectancy and P&L by symbol across months of real trades, not just the last few days.
- Review and tag past trades in the Daily Journal and Trades Log.
- Close out positions that were opened before you connected, so they don't sit in Open Positions.
What you need
| Requirement | Details |
|---|---|
| A TradeLyser account for your broker | Added from Accounts → Add Account |
| For Sync History | A Dhan, ICICI or Upstox account using Auto Sync, logged in (not showing Re-auth required) |
| For a file import | The trade file from your broker, or a filled-in TradeLyser CSV template |
Which method does my broker use?
| Broker | Sync History | Broker file import | Range |
|---|---|---|---|
| Upstox | Yes | Generic parser | Sync History covers the last 3 financial years |
| Dhan | Yes | Dedicated parser | Sync History: up to 5 days per request |
| ICICI | Yes | Generic parser | Sync History: up to 5 days per request |
| Zerodha | No | Dedicated parser (Console Tradebook) | Whatever your tradebook file covers |
| Fyers | No | Dedicated parser | Whatever your file covers |
| 5paisa | No | Dedicated parser | Whatever your file covers |
| NeoStox | No | Dedicated parser | Whatever your file covers |
| RMoney | No | Dedicated parser (Portfolio Statement) | Whatever your file covers |
| Angel One, Groww, Kotak Neo, Motilal Oswal, Flattrade, Finvasia and others | No | Generic parser, or the TradeLyser CSV template | Whatever your file covers |
"Generic parser" means TradeLyser tries to read the file's columns automatically. If it doesn't recognise your file, fill in the TradeLyser CSV template instead.
On any other broker, Sync History appears greyed out in the account menu. That isn't an error: use a file import instead. Sync History also needs the account's import method to be Auto Sync.
Step 1: Log in to your broker
- Open Accounts and find your Dhan, ICICI or Upstox account.
- If the card shows Re-auth required, open the ⋯ actions menu and choose Re-Auth, then log in to your broker.
Skip to Import past trades from a broker file if your broker isn't Dhan, ICICI or Upstox.
Step 2: Open Sync History
- Open the ⋯ actions menu on the account.
- Choose Sync History. The Sync History page opens and shows the Account and Broker it will sync.

Step 3: Choose a date range
- Click Date Range (it reads Select From and To dates).
- Pick a start and end date on the calendar, or use Quick Select: Today, This week, This month, Last 30 days, Last month or YTD. Upstox accounts also get Last 3 FYs.
- Keep within your broker's limit:
- Dhan and ICICI: up to 5 days per request. For a longer period, run several 5-day requests one after another.
- Upstox: anywhere in the last 3 Indian financial years (from 1 April). Dates outside that window can't be selected.
Step 4: Start the sync
- Click Sync trades.
- You see Sync started and are taken to your sync history list, where you can follow its status. The sync runs in the background, and large ranges can take a minute or more.
- When it completes, click the refresh icon in the TradeLyser header so every page picks up the trades.
Trades already stored for the account (same broker order ID) are skipped automatically, so it is safe to run Sync History again over dates you've already covered.
History is matched into trades using the account's calculation method (FIFO, LIFO or WA). The calculation method and import method can't be changed after the account is created. If you need a different method, add a new account before importing years of history.
Import past trades from a broker file
For Zerodha, Fyers, 5paisa, Angel One, Groww and every other broker, past trades come from a file:
- Download your trade history from your broker's reports section for the dates you need. Prefer a tradebook or executed-trades report over a P&L or tax report, because TradeLyser needs each buy and sell.
- In TradeLyser, open the ⋯ actions menu on the account and choose Import Trade.
- Drag in the file. On Select File TradeLyser shows the detected format, plus a Step-by-step Guide for exporting from your broker.
- Check the rows on Preview Data and click Map Data.
- Review the mapped orders and click Import Trades.
If the file isn't recognised, copy your trades into the TradeLyser template and use Import Template from the same menu. Full walkthroughs: Import trades from CSV, Import Zerodha trade history, Import Dhan trades and Import Groww trades.
To avoid duplicates, end the file's date range on the day before you started syncing the account.
Troubleshooting historical imports
| Problem | Fix |
|---|---|
| Sync History is greyed out | Your broker isn't Dhan, ICICI or Upstox, or the account uses File Upload. Use Import Trade instead. If it also shows (Trade limit reached), your plan's trade-import limit is used up. |
| Date range too large (ICICI), or a long Dhan range fails | Dhan and ICICI accept up to 5 days per request. Split the period into 5-day ranges. |
| Date range not allowed (Upstox) | Pick dates within the last 3 financial years. Import anything older from a file. |
| Sync failed with a login or token message | Use Re-Auth on the account, then run Sync History again. |
| Sync finished but trades don't show | Select the account in the header account selector, widen the date range and click the header refresh icon. |
| Positions from before your history stay open | The opening order is older than what you imported. Import an earlier range, or close the position manually from Open Positions. |
| Duplicates after a file import | The file overlapped dates you had already synced. See Missing trades. |
Frequently asked questions
How do I import old trades into TradeLyser?
Dhan, ICICI and Upstox accounts can use Sync History for a date range. For every other broker, download your tradebook and import it with Import Trade.
Can I sync Zerodha history through the API?
No. Sync History isn't available for Zerodha. Download your tradebook from Zerodha Console and import it. See Import Zerodha trade history.
How far back can I sync Upstox trades?
Sync History covers the last 3 Indian financial years for Upstox.
Why can I only sync 5 days at a time for Dhan or ICICI?
That is the limit per Sync History request for these brokers. Run several requests to cover a longer period. Orders already imported are skipped.
Does Sync History run automatically?
No. You start each Sync History request yourself. Day-to-day trades come in when you run Sync Trades.