Skip to main content

2 posts tagged with "analysis"

View All Tags

How to Import 5 Years of Historical Trades in One Click

· 9 min read
Karthik
Founder, TradeLyser

Your trading history is sitting in your broker account.

Years of data. Thousands of trades. Patterns waiting to be discovered.

But you're not learning from it because:

  • It's scattered across platforms
  • It's hard to analyze
  • You don't have time to organize it
  • You don't know where to start

Today, that changes.

Why Historical Data Matters

Insight #1: Discover Your Actual Edge

You think: "I'm good at breakout trading"

Your data might show: "You're actually profitable only on morning breakouts. Afternoon breakouts lose money."

Without historical data: Guessing
With historical data: Knowing

Insight #2: Identify Losing Patterns

Common discoveries:

  • "I lose money every Monday" (avoid Monday trading)
  • "My win rate drops after 2 PM" (stop trading afternoon)
  • "I'm profitable in stocks but lose in options" (focus on stocks)

These patterns are invisible without data.

Insight #3: Validate Strategies

You want to test a new strategy.

Without historical data:

  • Test live for 3 months
  • Risk real capital
  • Learn slowly

With historical data:

  • Backtest on 3 years in 30 minutes
  • Zero risk
  • Instant insights

Insight #4: Track Long-Term Growth

See your journey:

  • Year 1: -₹50,000 (learning)
  • Year 2: Break-even (improving)
  • Year 3: +₹2,50,000 (profitable)
  • Year 4: +₹5,80,000 (consistent)

Visual proof of progress = motivation


What Can You Import?

Equity Trades

  • Intraday
  • Delivery
  • CNC/NRML

F&O Trades

  • Futures
  • Call options
  • Put options
  • Strategies (spreads, straddles)

Historical Data Range

BrokerAPI HistoryManual CSV
Zerodha1 yearUnlimited
Upstox3 monthsUnlimited
Angel One1 yearUnlimited
Groww6 monthsUnlimited
ICICI DirectN/AUnlimited
OthersVariesUnlimited

Key: API has limits, but CSV import has no limit.


Method 1: API Historical Import

Step 1: Connect Broker

  1. TradeLyser → Broker Integration
  2. Select your broker
  3. Click Connect
  4. Authorize

Step 2: Select Date Range

Choose import period:

  • Last 1 month
  • Last 3 months
  • Last 6 months
  • Last 1 year (maximum via API)

Step 3: Start Import

  1. Click Import Historical Trades
  2. TradeLyser fetches data from broker
  3. Processing time: 2-5 minutes
  4. Done!

What gets imported:

  • All trades in selected period
  • Entry/exit prices
  • Quantities
  • Timestamps
  • P&L
  • Fees and taxes

Method 2: CSV Bulk Import

For trades older than API limit

Step 1: Download Trade History from Broker

Zerodha:

  1. Login to Kite/Console
  2. ReportsTrade Book
  3. Select date range (e.g., Jan 2020 - Dec 2024)
  4. Download as CSV or Excel

Upstox:

  1. Login to Upstox Pro
  2. ReportsTrade History
  3. Select "All Time" or custom range
  4. Download Excel Report

Angel One:

  1. Login to Angel One Web
  2. Back OfficeTrade Book
  3. Choose date range
  4. Export as CSV

ICICI Direct / HDFC:

  1. Login to trading platform
  2. Navigate to Reports/Trade Book
  3. Select maximum date range
  4. Download file

Step 2: Upload to TradeLyser

  1. TradeLyser → Data Import
  2. Click Upload CSV/Excel
  3. Select downloaded file
  4. Click Upload

Step 3: Map Columns

TradeLyser shows preview:

Your CSV columns → Map to TradeLyser fields:

Symbol → Instrument Name
Trade Date → Date
Buy/Sell → Direction
Qty → Quantity
Price → Price
Order No → Order ID
Brokerage → Fees

Smart mapping:

  • TradeLyser auto-detects standard formats
  • Usually requires minimal manual mapping

Step 4: Review & Confirm

Preview shows:

  • Total trades found: 2,847
  • Date range: Jan 1, 2020 - Dec 31, 2024
  • Instruments: 247 unique
  • Estimated P&L: +₹4,23,450

Check:

  • Do numbers look correct?
  • Any duplicate data?
  • Any obvious errors?

If yes: Click Confirm Import

Step 5: Processing

TradeLyser processes:

  • Pairs buy/sell transactions
  • Calculates P&L for each trade
  • Identifies strategies
  • Tags by instrument type
  • Calculates all metrics

Time: 5-10 minutes for 5 years of data

Step 6: Verification

After import:

  1. Check total P&L matches broker statements
  2. Spot-check random trades for accuracy
  3. Verify trade count is reasonable

If discrepancies:

  • Run reconciliation tool
  • Check for duplicate imports
  • Contact support with sample data

Handling Multiple Years

Strategy: Year-by-Year Import

For very large histories (10+ years):

Instead of: One file with 10,000 trades

Do: Split into years:

  • 2020.csv (import)
  • 2021.csv (import)
  • 2022.csv (import)
  • etc.

Benefits:

  • Easier to verify each year
  • Easier to fix errors
  • Less overwhelming

Dealing with Old Data

Question: Should I import trades from 10 years ago?

Considerations:

Import old data if:

  • ✅ You want complete history
  • ✅ Long-term trend analysis
  • ✅ Nostalgic value

Skip old data if:

  • ✗ Your strategy has completely changed
  • ✗ Different market era (not relevant)
  • ✗ Too much effort for limited value

Recommendation: Import last 3-5 years (sweet spot)


What Happens After Import?

Immediate Analysis Available

1. Performance Dashboard

See instantly:

  • Total P&L (all time)
  • Win rate
  • Profit factor
  • Average win vs average loss
  • Best/worst trades
  • Monthly performance
  • Yearly trends

2. Time-Based Insights

Discover:

  • Best trading days (day of week)
  • Best trading hours
  • Best/worst months
  • Seasonal patterns

3. Instrument Analysis

Learn:

  • Which stocks/indices you're best at
  • Which sectors favor you
  • Equity vs F&O performance
  • Options vs futures results

4. Strategy Breakdown

If you tagged strategies:

  • Strategy A win rate: 68%
  • Strategy B win rate: 45% (stop using!)
  • Strategy C: Not enough data

5. Mistake Patterns

AI identifies:

  • Repeated errors
  • Loss patterns
  • Rule violations
  • Improvement opportunities

Analyzing Historical Data

Question #1: What's My Real Win Rate?

Navigate to: Dashboard → Statistics

See:

  • Overall: 58%
  • By year:
    • 2020: 42% (learning)
    • 2021: 51% (improving)
    • 2022: 59% (consistent)
    • 2023: 64% (mastery)
    • 2024: 62% (maintaining)

Insight: You've grown significantly. Stay the course.

Question #2: When Do I Trade Best?

Navigate to: Reports → Time Analysis

Heatmap shows:

9:30-10:30 AM:  Win Rate 68% ✅ Trade here
10:30-12:00 PM: Win Rate 54% ⚠️ Okay
12:00-2:00 PM: Win Rate 45% ⚠️ Be careful
2:00-3:30 PM: Win Rate 38% ❌ Avoid

Action: Focus morning trading only.

Question #3: What's My Best Setup?

Navigate to: Strategies → Performance

If tagged:

Breakout (trending): 72% WR, +₹3.2L
Pullback: 61% WR, +₹1.8L
Mean Reversion: 48% WR, -₹0.4L ❌

Action: Stop mean reversion, focus breakouts.

Question #4: Do I Have Any Bad Habits?

Use Elysia AI:

Ask: "What patterns do you see in my losing trades?"

Elysia might find:

  • "You move stops 34% of the time (usually leads to bigger losses)"
  • "You trade more frequently after wins (overconfidence)"
  • "You hold losers 3x longer than winners (loss aversion)"

Action: Create rules to prevent each.

Question #5: How Do I Compare?

Navigate to: Insights → Benchmarking (Pro)

See:

Your Win Rate: 62%
Peer Average: 54%
Top 10%: 68%

Your Profit Factor: 2.1
Peer Average: 1.4
Top 10%: 2.8

Status: Above average, room to grow

Advanced: Backtesting Strategies

Once historical data is imported:

Test New Strategy on Old Data

Example: "What if I only traded mornings?"

  1. Filter: Trades between 9:30-12:00 PM
  2. View results:
    • Trades: 847 (from 2,453 total)
    • Win rate: 64% (vs 58% overall)
    • P&L: +₹3.8L (from +₹4.2L total)
  3. Analysis: 90% of profit from 35% of trades!

Conclusion: Should focus morning only.

Test Rule Changes

Example: "What if I always took 50% profit at +1R?"

  1. Go to Strategy Optimizer
  2. Select strategy
  3. Apply rule: "Exit 50% at 1R target"
  4. Backtest on historical trades

Results:

  • Original: +₹4.2L profit
  • With 50% rule: +₹5.1L profit (+21%)

Conclusion: Implement this rule going forward.


Common Import Issues & Fixes

Issue #1: Duplicate Trades

Symptoms: Same trade appears twice

Causes:

  • Imported CSV + API sync both imported same period
  • Re-uploaded same file

Fix:

  1. TradeLyser → ToolsDuplicate Detection
  2. Select resolution method:
    • Keep API version (more accurate)
    • Keep CSV version (if API has issues)
    • Manual review (you choose)
  3. Run de-duplication

Issue #2: P&L Doesn't Match Broker

Causes:

  • Different calculation method (FIFO vs LIFO)
  • Missing trades
  • Currency trades not included
  • Dividends not in trade data

Fix:

  1. Run reconciliation report
  2. Identify discrepancies
  3. Adjust settings or add missing trades manually

Issue #3: Can't Map Columns

Symptoms: CSV format not recognized

Solution:

  • Use custom mapping (manual)
  • Or reformat CSV to match template
  • Or contact support for help

Issue #4: Import Fails

Causes:

  • File too large (>50MB)
  • Corrupted file
  • Unsupported format

Fix:

  • Split file into smaller chunks
  • Re-download from broker
  • Convert to standard CSV format

Best Practices

Practice #1: Import Everything

Don't cherry-pick good periods

Import:

  • Good years AND bad years
  • Winning AND losing trades
  • All instruments

Why: Complete data = accurate insights

Practice #2: Verify After Import

Spend 15 minutes checking:

  • Total trade count reasonable?
  • P&L roughly matches memory?
  • Date ranges correct?
  • No obvious duplicates?

Practice #3: Add Context to Old Trades

Even historical trades can be enhanced:

Add:

  • Strategy tags (if you remember)
  • Notes (for significant trades)
  • Ratings (for quality of execution)

Don't worry about being perfect—add what you can.

Practice #4: Create Historical Baseline

Before making any changes:

  1. Import all historical data
  2. Generate baseline report
  3. Save it

This becomes your "before" comparison.

After 3 months of improvements:

  • Compare new results vs historical baseline
  • Measure actual progress

The Bottom Line

Your trading history is goldmine of insights.

But only if you can access and analyze it.

Manual analysis:

  • Days of work
  • Error-prone
  • Incomplete
  • Never happens

TradeLyser import:

  • 10 minutes of work
  • Automated analysis
  • Complete insights
  • Happens today

5 years of data.
10 minutes to import.
Lifetime of insights.


Take Action Now

Today (30 minutes):

  1. Download trade history from broker
  2. Upload to TradeLyser
  3. Run initial analysis

This Weekend:

  1. Deep dive into historical patterns
  2. Identify top 3 insights
  3. Create rules based on findings

This Month:

  1. Test strategy adjustments
  2. Measure improvement vs historical baseline
  3. Refine based on data

👉 Import Historical Trades Now
👉 Download: CSV Import Template
👉 Next: Strategy Comparison - Which Setup Works Best?


How far back does your trading history go? Discovered any surprises in your data? Share below.