Build a paper trading simulator

Builds a risk-free trading practice app with virtual cash, a trade journal, performance stats and AI pattern review.

Task: Build a paper trading simulation platform called "Paper", a realistic, risk-free place to learn trading and investing. Context: The app is for people who want to practice trading with virtual money and learn from their own decisions. It is for learning, with no real money involved, and it is not investment advice. It is built with React, the chosen market data API, [LLM API] and recharts. A portfolio starts with [starting cash, default $100,000] in virtual cash, with real-time stock and ETF prices from [Yahoo Finance or Alpha Vantage]. Trades are market and limit orders, with 0.1% slippage on market orders and a commission of $1 per trade. The performance dashboard shows a daily P&L chart, total return, annualized return, win rate, average gain and loss, Sharpe ratio and current sector exposure, all updated with each trade. The trade journal is required when a position is closed, with three fields of at most 200 characters each (what was my thesis, what happened, what will I do differently), and a position cannot be closed without it. For the behavioral analysis, [LLM API] reads the last 20 journal entries once a month and names recurring patterns, for example exiting winners early near round-number prices. An optional leaderboard for friend groups resets weekly and ranks by risk-adjusted return and not raw P&L. Rules: - Use a terminal-inspired design, data dense, with no decorative elements. - Build in stages that each run on their own: portfolio and trades first, then the dashboard, then the journal, behavioral analysis and leaderboard. Result: The file structure and data model, the key code per feature, then 3 lines on how to run it.

Based on a prompt by mmanisaligil

Updated