← Back to Home

📄 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 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

Fyers CSV Format

Export from: Fyers Web → Reports → Trade Report → Download CSV

Expected columns:

Symbol,Side,Segment,Order Type,Qty,Price,Trade Value,Trade No,Order No,Exchange,Exchange Order No,OMS Order No,Trade Time,Expiry,Strike Price,Option Type

Example row:

NSE:HDFCBANK-EQ,BUY,EQ,LIMIT,10,1650.50,16505.00,T123456,O789012,NSE,="1100000040500546",="250123000100001",2026-01-23 09:45:06,,0.00,
How to export from Fyers:
1. Login to Fyers Web
2. Go to Reports → Trade Report
3. Select date range (max 1 year at a time)
4. Click Download/Export as CSV

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 ColumnAccepted 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

FieldTypeDescription
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

FieldTypeDescription
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

ScenarioUse
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)
← Back to Home