How to Import Dhan Trades into TradeLyser from a File
If you'd rather not connect the Dhan API, you can still journal every Dhan trade by importing a file. TradeLyser has a dedicated Dhan parser that recognises Dhan's trade file format, converts Dhan option names such as NIFTY 07 AUG 24600 CALL into a standard symbol, and skips orders that weren't executed. An import takes a few minutes.
Once imported you can:
- Review every Dhan trade in the trades log with P&L, fees and tax.
- Add notes, tags and ratings, and journal each trading day.
- Backfill months of Dhan history in one go, then keep it current with Auto Sync if you like.
Connect Dhan with Auto Sync instead. It needs only your Dhan Client ID and a Dhan login, and adds Sync History and Live Insights.
What you need
| Requirement | Where to get it |
|---|---|
| A Dhan trade file (CSV, XLS or XLSX) for the dates you want | Dhan's reports or statements section (Step 1 below) |
| A TradeLyser account with a Dhan account added | app.tradelyser.com, Accounts → Add Account |
The Dhan parser looks for Dhan's own column names: Date, Time, Buy/Sell, Name, Quantity/Lot, Trade Price and Status. Renaming columns, deleting the header row or re-saving the dates in a different format in Excel is the most common reason a Dhan file isn't recognised.
Step 1: Download your trades from Dhan
- Log in to web.dhan.co.
- Find your executed trades. Dhan's help centre lists them under the Profile icon → Journal by Dhan → Past Trades, where you can set a From – To date range. In the Dhan app they are under Profile → All Statements → All Exchange Transactions (Past Trades).
- Download the trade file for the date range from Dhan's reports or statements section. If you can't find a download option, Dhan's support team (help@dhan.co) can send you your trade history.
- Save the file without editing it.
Dhan changes its menus from time to time. If the names above don't match what you see, look for your trade history or past trades in Dhan's statements area.
Step 2: Add a Dhan account for file imports
Skip this step if you already have a Dhan account in TradeLyser.
- In TradeLyser, open Accounts and click Add Account.
- Choose Dhan and a calculation method. FIFO is recommended and matches how most Indian brokers report P&L.
- Choose File Upload as the import method, enter an account name and save.
The calculation method and import method cannot be changed after the account is created. If you need a different method later, add a second Dhan account.
Step 3: Import the Dhan file
- Choose Import Trade in the TradeLyser header, or from the ⋯ actions menu on your Dhan account.
- Select File: drag in the Dhan CSV or Excel file. TradeLyser detects the Dhan format and shows it on screen.
- Preview Data: check that the rows look right, then click Map Data.
- Map & Import: review the mapped orders, optionally choose to ignore fees, taxes or slippage, and click Import Trades.
Each execution counts towards your plan's monthly trade-import limit, and you'll see a warning when you are close to it.
What the Dhan parser reads
| Dhan column | How TradeLyser uses it |
|---|---|
| Date and Time | Combined into the order timestamp (IST). Dates in DD/MM/YYYY or YYYY-MM-DD are accepted. |
| Buy/Sell | B/Buy become BUY, S/Sell become SELL. |
| Name | The symbol. Options like NIFTY 07 AUG 24600 CALL are converted to compact symbols such as NIFTY25080724600CE (underlying, YYMMDD expiry, strike, CE/PE), using the year of the trade date. |
| Quantity/Lot | Quantity, either as a number (75) or quantity/lot (75/1). |
| Trade Price | Execution price. Rows with a zero price are skipped. |
| Status | Only rows marked Traded or Success are imported. Rejected or cancelled orders are skipped. |
| Order, Exchange, Segment, Trade Value | Stored as order type, product, exchange and segment details where present. |
Troubleshooting Dhan file imports
| Problem | Fix |
|---|---|
| The Dhan format isn't detected | Use the original file from Dhan with its header row intact. If it still isn't recognised, copy the rows into the TradeLyser CSV template and use Import Template. |
| Some rows are missing after import | Only executed rows (Traded or Success) are imported. Rows with zero quantity or price are skipped. |
| Option expiry has the wrong year | The year comes from the Date column. Check the file has a Date column and that Excel hasn't changed its format. |
| Trades appear twice | You imported overlapping date ranges, or imported days that Auto Sync already fetched. Delete the duplicates and import non-overlapping ranges. |
| Import is blocked | You have reached your plan's monthly trade-import limit. |
For more fixes, see CSV import errors.
Frequently asked questions
Can I import Dhan trades into a trading journal?
Yes. TradeLyser imports Dhan trade files with a dedicated Dhan parser, or connects to Dhan directly with Auto Sync.
How do I export my Dhan tradebook?
Dhan lists executed trades under Journal by Dhan → Past Trades on web.dhan.co, with a date range filter. Download the trade file for that range from Dhan's statements section, or ask Dhan support for your trade history.
Should I use a file import or Auto Sync for Dhan?
Use Auto Sync for daily trading: it fetches trades with one click and supports Live Insights. Use a file import for a one-off backfill, or if you don't want to connect your Dhan login.
Can I import an Excel file from Dhan?
Yes. The import wizard accepts CSV, XLS and XLSX files.