A TypeScript/Node.js application for simulating stock trading portfolios and analyzing performance metrics.
- Import trades from CSV/JSON files
- Fetch real market data from Nordnet API
- Simulate portfolio performance over time
- Calculate comprehensive performance metrics (returns, Sharpe ratio, drawdown, etc.)
- Generate charts and visualizations
- Export results to JSON/CSV
- PostgreSQL persistence for historical simulations
- Node.js >= 20.0.0
- pnpm >= 9.0.0
- PostgreSQL database
pnpm installCopy .env.example to .env and configure:
cp .env.example .envEdit .env with your database and Nordnet API credentials.
pnpm db:migratepnpm buildpnpm trade-sim simulate ./examples/trades.csv# Run in watch mode
pnpm dev
# Run tests
pnpm test
# Run tests with UI
pnpm test:ui
# Type check
pnpm type-check
# Lint
pnpm lint
# Format
pnpm formatSee docs/ for detailed documentation.
MIT