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):

  1. Log in to mStock Web or the mStock app
  2. Go to ReportsTrade History
  3. Select a date range (mStock supports up to ~2 years in one export)
  4. 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
No conversion needed. Import the .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):

  1. Log in to Fyers Web or the Fyers app
  2. Go to OrdersOrder Book
  3. Click the download/export icon (usually top-right)
  4. Select a date range — maximum is 1 year (Jan 1 to Dec 31)
  5. 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, 2023
  • 2024: Jan 1, 2024 → Dec 31, 2024
  • 2025: Jan 1, 2025 → Dec 31, 2025
  • 2026: 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.

Only "Executed" orders are imported. Cancelled, rejected, and pending orders are skipped automatically during parsing.

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
Symbolsymbol, tradingsymbol, scrip, stock
Side (Buy/Sell)side, buy_sell, transaction_type, type
Quantityqty, quantity, traded_qty
Priceprice, average_price, trade_price, rate
Date/Timedate, 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:

After import, a summary dialog shows:

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_idStringUnique identifier for the trade
tradingsymbolStringStock symbol (e.g., "HDFCBANK-EQ")
quantityNumberNumber of shares
average_priceNumberPrice per share
transaction_typeString"BUY" or "SELL"
order_timestampStringDate/time of trade

Optional Fields

Field Type Description
order_idStringBroker's order ID
exchangeStringNSE, BSE, etc.
productStringCNC, MIS, NRML, etc.
brokerStringSource broker name
lastFetchedDateStringYYYY-MM-DD of last API fetch
Important: Importing a trade cache file replaces all existing trades for the selected account. If you want to merge trades instead, use "Import CSV Trades", which deduplicates by trade_id.

When to Use Which

Scenario Use
First time setting up — want historical trades from brokerImport CSV Trades
Moving to a new phone — want all data from old phoneExport Trade Cache → Import Trade Cache
Adding trades from a broker that doesn't have API accessImport CSV Trades
Restoring from cloud backupRestore Trades (in Cloud Backup section)
Merging trades from multiple CSV exportsImport CSV Trades (multiple times — deduplicates)