Algo Trade Simulator
Lets strategies face real market data without letting simulated capital pretend to be real.
project overview
Algo Trade Simulator is a full-stack trading simulation platform for researching strategies against live market data without executing real trades. The platform streams live quotes and chart data from Yahoo Finance, trains SMA crossover strategies on historical data, generates realtime market signals, and manages simulated portfolios with persistent user sessions and analytics dashboards. Built with FastAPI, React + Vite, MongoDB, TypeScript, and OpenAI-assisted research tooling.
architecture
The FastAPI backend handles market data ingestion, strategy training, authentication, portfolio simulations, and analytics APIs. The React + Vite frontend provides live charts, watchlists, portfolio views, strategy dashboards, and simulation management. Market data is sourced from Yahoo Finance APIs. Strategy training runs SMA crossover backtests against five years of historical data and generates live predictions from the latest market regime. User accounts, sessions, and simulations persist through MongoDB using Motor (async), with an optional in-memory mode for zero-setup local development. A hybrid chatbot copilot combines OpenAI completions with heuristic fallbacks to answer research queries and generate simulations from natural-language prompts.
constraints
- market data dependency — the platform is downstream of a public quote API it does not control
- simulation honesty — signals come from the live regime, but execution stays simulated; the boundary is structural
- natural-language commands — the copilot must produce valid simulations from loose prompts or decline
tradeoffs
- a hybrid copilot (LLM + heuristic fallbacks) over LLM-only: deterministic parsers carry simulation creation after model-only extraction produced malformed simulations from loose prompts
- an in-memory store option over Mongo-always: zero-setup local runs at the cost of persistence
- one strategy family first (SMA crossover) over a strategy zoo: a complete train→signal→simulate loop before breadth
failure notes
- the copilot ships with configurable model fallbacks and heuristic paths — the design assumes the LLM route fails and routes around it
- the in-memory fallback exists because database connectivity is a real failure mode, not a hypothetical
infrastructure
fastapi · react + vite + typescript · mongodb (motor) · yahoo finance api · openai api
engineering reasoning
Designed to separate market ingestion, strategy evaluation, portfolio simulation, and AI-assisted workflows into independent services so failures in one subsystem do not block the rest of the platform. Heuristic fallbacks were added alongside LLM-based parsing after model-only flows produced malformed simulation requests from loose prompts.
future work
- > additional strategy families beyond SMA crossover
- > richer execution modeling (slippage, latency) on the simulated book