Data Import Guide
Understanding the two import options and their expected formats.
Import Options Overview
| Import CSV Trades | Import Trade Cache File | |
|---|---|---|
| Source | CSV exported from your broker | JSON file exported from this app |
| Format | Broker-specific CSV or XLSX | App's internal JSON format |
| Use case | First-time import of historical trades | Restoring a backup / syncing between devices |
| Deduplication | By trade_id (merges with existing) | Replaces entire cache for the account |
Import CSV Trades
Use this to import your trade history from a broker's CSV export. The app auto-detects the broker format.
Supported Formats
The app accepts .csv, .xlsx, and .xls files. Format is auto-detected based on file content.
mStock (Mirae Asset) XLSX Format
Export from: mStock app or website → Trade History report. The file is in .xlsx (Excel) format.
Expected columns:
Trade Date | Exchange | Buy / Sell | Scrip / Contract | Qty | Price | Trade Id
Example rows:
02-04-2026 NSEEQ Buy NATCOPHARM-EQ 77 1016.05 405081515 19-03-2026 NSEEQ Buy HDFCBANK-EQ 9 801.00 204639352
How to export from mStock (step by step):
- Log in to mStock Web or the mStock app
- Go to Reports → Trade History
- Select a date range (mStock supports up to ~2 years in one export)
- Click Download — the file arrives as
.xlsx
File details:
- The XLSX file contains metadata rows (company info, client details) at the top — the app skips these automatically
- Only the data rows below the "Trade Date" header are parsed
- Footer "NOTE:" rows are skipped automatically
- Both Buy and Sell trades are imported
.xlsx file directly — the app handles Excel format natively. No need to convert to CSV first.
Fyers CSV Format
Export from: Fyers Web → Order Book report. The orderbook CSV can be generated for a maximum of 1 year at a time.
Expected columns:
Name,Date & Time,Side,Product type,Status,Order type,Qty,Traded price,Limit price,Source,Exchange order ID,OMS order ID
Example row:
NSE:HDFCBANK-EQ,23-01-2024 12:41:51,BUY,CNC,Executed,LIMIT,10,"1,432.00","1,432.00",WEB,="1100000040500546",="250123000100001"
How to export from Fyers (step by step):
- Log in to Fyers Web or the Fyers app
- Go to Orders → Order Book
- Click the download/export icon (usually top-right)
- Select a date range — maximum is 1 year (Jan 1 to Dec 31)
- Download as CSV
Important — max 1 year per export. Fyers limits orderbook CSVs to 1 year. To import your full trade history, download one CSV per year:
2023: Jan 1, 2023 → Dec 31, 20232024: Jan 1, 2024 → Dec 31, 20242025: Jan 1, 2025 → Dec 31, 20252026: Jan 1, 2026 → Today
Then import each CSV into the app one by one. The app merges trades automatically — duplicates are skipped based on the order ID, so overlapping date ranges are safe.
Generic CSV Format
For brokers without a specific parser, the app tries to match columns by name. Your CSV should have headers containing these keywords:
| Required Column | Accepted Header Names |
|---|---|
| Symbol | symbol, tradingsymbol, scrip, stock |
| Side (Buy/Sell) | side, buy_sell, transaction_type, type |
| Quantity | qty, quantity, traded_qty |
| Price | price, average_price, trade_price, rate |
| Date/Time | date, trade_time, order_time, timestamp |
Example:
symbol,side,quantity,price,date HDFCBANK-EQ,BUY,10,1650.50,2026-01-23 09:45:06 RELIANCE-EQ,SELL,5,2450.00,2026-01-24 10:30:00
Tips:
- Column order doesn't matter — the app matches by header name
- Side must be "BUY" or "SELL" (case-insensitive)
- Date format: YYYY-MM-DD or YYYY-MM-DD HH:MM:SS
- Price should be per-share, not total trade value
What Gets Imported
Only executed trades are imported. The app skips:
- Cancelled or rejected orders
- Pending/open orders
- Rows with zero quantity or price
After import, a summary dialog shows:
- Trades parsed (successfully imported)
- Rows skipped (didn't match criteria)
- Warnings (partial data, format issues)
Import Trade Cache File
Use this to restore a backup previously exported from this app. The file is a JSON document with a specific structure.
Expected Format
{
"lastFetchedDate": "2026-05-25",
"trades": [
{
"trade_id": "T123456_O789012",
"order_id": "O789012",
"exchange": "NSE",
"tradingsymbol": "HDFCBANK-EQ",
"product": "CNC",
"average_price": 1650.50,
"quantity": 10,
"transaction_type": "BUY",
"order_timestamp": "2026-01-23 09:45:06",
"broker": "fyers"
},
{
"trade_id": "T234567_O890123",
"order_id": "O890123",
"exchange": "NSE",
"tradingsymbol": "RELIANCE-EQ",
"product": "CNC",
"average_price": 2450.00,
"quantity": 5,
"transaction_type": "SELL",
"order_timestamp": "2026-01-24 10:30:00",
"broker": "mstock"
}
]
}
Required Fields Per Trade
| Field | Type | Description |
|---|---|---|
trade_id | String | Unique identifier for the trade |
tradingsymbol | String | Stock symbol (e.g., "HDFCBANK-EQ") |
quantity | Number | Number of shares |
average_price | Number | Price per share |
transaction_type | String | "BUY" or "SELL" |
order_timestamp | String | Date/time of trade |
Optional Fields
| Field | Type | Description |
|---|---|---|
order_id | String | Broker's order ID |
exchange | String | NSE, BSE, etc. |
product | String | CNC, MIS, NRML, etc. |
broker | String | Source broker name |
lastFetchedDate | String | YYYY-MM-DD of last API fetch |
When to Use Which
| Scenario | Use |
|---|---|
| First time setting up — want historical trades from broker | Import CSV Trades |
| Moving to a new phone — want all data from old phone | Export Trade Cache → Import Trade Cache |
| Adding trades from a broker that doesn't have API access | Import CSV Trades |
| Restoring from cloud backup | Restore Trades (in Cloud Backup section) |
| Merging trades from multiple CSV exports | Import CSV Trades (multiple times — deduplicates) |