Skip to content

Add CSV export for trading history with date range picker#163

Open
rebel117 wants to merge 1 commit into
capofficial:mainfrom
rebel117:fix-14-export-trading-history
Open

Add CSV export for trading history with date range picker#163
rebel117 wants to merge 1 commit into
capofficial:mainfrom
rebel117:fix-14-export-trading-history

Conversation

@rebel117
Copy link
Copy Markdown

Summary

Adds a CSV export button to the trading history tab that lets users download their trade history within a selected date range.

What it does

  • "Export CSV" button appears above the history table when trades exist
  • Opens a modal with date range inputs (defaults to last 30 days)
  • Exports 16 columns: Order ID, Date, Side, Market, Price, Size, Margin, Leverage, Order Type, Status, PnL, Fee, Asset, Reduce Only, Reason, OCO Order
  • For large datasets (>500 rows), processing happens in a Web Worker to avoid blocking the UI
  • Downloads as cap-trading-history-START-to-END.csv

Files changed

  • src/components/modals/ExportHistory.svelte — new modal with date range picker and export logic
  • src/components/trade/account/History.svelte — export button above the table
  • src/components/layout/Modals.svelte — register ExportHistory modal
  • src/lib/export-worker.js — Web Worker for offloading large CSV generation

Closes #14

- New ExportHistory modal with date range selection (defaults to last 30 days)
- Web Worker processes large datasets off the main thread (>500 rows)
- Exports all trade fields: order ID, date, side, market, price, size,
  margin, leverage, order type, status, PnL, fee, and more
- Export button appears above history table when trades exist
- Downloads as cap-trading-history-START-to-END.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Export trading history

1 participant