ββββββ ββ ββ βββββ βββ ββ ββββββββ ββ ββ βββ βββ
ββ ββ ββ ββ ββ ββ ββββ ββ ββ ββ ββ ββββ ββββ
ββ ββ ββ ββ βββββββ ββ ββ ββ ββ ββ ββ ββ ββββ ββ
ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ
ββββββ ββββββ ββ ββ ββ ββββ ββ ββββββ ββ ββ
ββ TRADE AI
An AI-native institutional trading operating system.
Multi-agent decisioning. Explainable AI. Real-time risk intelligence.
Built for the terminal. Runs in your browser.
| Service | Link |
|---|---|
| π₯οΈ Frontend Dashboard | https://quantumtrade2.vercel.app/ |
| βοΈ Backend API | https://quantumtrade-backend.onrender.com |
| π Swagger Docs | https://quantumtrade-backend.onrender.com/docs |
π‘ Fully deployed version of QuantumTrade AI with live market simulation + AI copilot enabled.
QuantumTrade AI is a full-stack, production-grade trading intelligence platform that brings institutional-level tooling to individual investors. It combines a six-agent AI ensemble, a live market data pipeline, a quantitative backtesting engine, a portfolio risk suite, and a conversational AI copilot β all running locally, instantly, with zero setup friction.
No paid APIs. No login walls. No bloat. Just open it and trade smarter.
The core of QuantumTrade is a MetaAgent β a weighted ensemble of six independent sub-agents that each analyse the market from a different lens and vote on a final decision.
| Agent | Strategy |
|---|---|
| Momentum | Trend direction + MACD crossover signal |
| Mean Reversion | RSI extremes + Bollinger Band position |
| Volatility | ATR-filtered regime suppression |
| Sentiment | Tape-implied sentiment from price action |
| Risk Manager | Hard veto on high-volatility regimes |
| Allocation | Regime-aware position sizing overlay |
Every decision comes with a confidence score, per-agent vote breakdown, feature importance weights, market regime classification, and a plain-English explanation.
Real-time OHLCV data via Yahoo Finance with automatic NSE/BSE routing. Type RELIANCE, TCS, INFY β no .NS suffix needed. The data pipeline resolves 50+ Nifty tickers automatically, with a synthetic fallback that keeps the app functional even when Yahoo rate-limits.
Supported: NSE Β· BSE Β· NASDAQ Β· NYSE Β· Crypto Β· Forex
A conversational AI analyst built into the dashboard. Ask it anything about your portfolio, market conditions, or investment strategy and get back institutional-quality, streaming responses word by word β complete with animated tool-call badges showing what it's "doing" behind the scenes.
The copilot understands nine analytical domains:
- Portfolio drop analysis & attribution
- Market crash / stress scenario modelling
- Sharpe ratio improvement pathways
- Sector exposure & concentration risk
- Full risk breakdown (beta, VaR, drawdown, Sortino)
- Stock purchase decision framework
- Diversification quality analysis
- Volatility regime assessment
- Portfolio optimisation (Mean-Variance, Black-Litterman concepts)
Replay the AI meta-agent's decisions against real historical data. Configure symbol, timeframe, initial capital (up to $1M), commission, and slippage β then get back:
- Equity curve β area chart with reference line at initial capital
- Drawdown chart β peak-to-trough loss over time
- Monthly returns heatmap β 24-month bar chart, green/red coloured
- Full trade log β every BUY/SELL with quantity, price, and fee
- Risk metrics β Sharpe, Sortino, CAGR, alpha, beta, profit factor, win rate, max drawdown
Upload your holdings via CSV or add them manually. The engine computes:
- Unrealised P&L with live prices fetched concurrently across all tickers
- Portfolio beta vs SPY benchmark
- Sharpe ratio on actual historical return distribution
- Sector & asset class exposure breakdown
- Correlation matrix across all holdings
- Four stress tests β 2008 crash, COVID shock, rate hike cycle, tech selloff
- Health score β composite rating with specific, actionable recommendations
All 48 tickers fetch in parallel. Cold cache takes ~4β6s. Warm cache (subsequent loads): instant.
Holdings-linked news from Yahoo Finance RSS, sentiment-scored in real time. Every article gets a keyword sentiment score (positive / negative / neutral) displayed as a micro-bar. The panel shows a live sentiment distribution bar across your entire portfolio and filters by sentiment category.
Set above/below threshold alerts on any supported symbol. Alerts are stored per-session and can be evaluated on-demand. Triggered alerts appear as a dismissible banner with the actual price vs target.
The dashboard surfaces the AI's reasoning at every level β confidence pulse (animated bar), feature importance chart, regime classification, per-agent vote percentages, and a full plain-English explanation for every decision. Nothing is a black box.
A scrolling event feed on the dashboard shows every market event, agent decision, and system message in real time β styled like a Bloomberg terminal, updating on every 12-second polling cycle.
An in-memory paper trading engine tracks position entries, exits, realised P&L, cash balance, and total equity against simulated fills with commission and slippage applied. The WebSocket endpoint pushes live portfolio snapshots to the frontend.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Frontend β
β Next.js 15 Β· TypeScript Β· Tailwind CSS Β· Framer Motion β
β Recharts Β· Zustand Β· cmdk Β· React Markdown β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Backend β
β FastAPI Β· SQLAlchemy 2 (async) Β· SQLite / PostgreSQL β
β Alembic Β· Pydantic v2 Β· Uvicorn β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β AI & Quant Engine β
β Custom 6-agent MetaAgent (NumPy + Pandas, no ML frameworks) β
β Mock AI copilot (45+ institutional responses, SSE streaming) β
β Backtesting engine with Sharpe, Sortino, alpha, beta, CAGR β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Data β
β Yahoo Finance (yfinance) Β· NSE/BSE auto-routing β
β In-memory cache (4h TTL for daily bars) β
β Synthetic fallback provider (always available) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
No API keys. No environment variables. No Docker. Just Python and Node.
cd quantumtrade
# Create and activate virtual environment
python -m venv venv
source venv/bin/activate # macOS / Linux
venv\Scripts\Activate.ps1 # Windows PowerShell
# Install dependencies
pip install -r backend/requirements.txt
# Start
python -m uvicorn backend.app.main:app --reload --port 8000β API live at http://localhost:8000
β Interactive docs at http://localhost:8000/docs β no auth token needed
cd quantumtrade/frontend
npm install
npm run devβ Dashboard at http://localhost:3000 β opens directly, no login
A sample CSV with 48 real holdings (35 NSE + 13 US stocks) is included:
quantumtrade/sample-portfolio.csv
Open the dashboard β Manage Portfolio β drag and drop the file.
quantumtrade/
β
βββ backend/app/
β βββ main.py Entry point, CORS, startup seeding
β βββ models.py SQLAlchemy ORM models
β βββ middleware/auth.py Demo mode β auto demo user, no JWT
β βββ routers/
β β βββ agents.py POST /api/decisions
β β βββ backtests.py POST /api/backtests/run
β β βββ chat.py POST /api/chat/stream (SSE)
β β βββ portfolio.py GET/POST /api/portfolio
β β βββ alerts.py CRUD /api/alerts
β β βββ news.py GET /api/news
β β βββ market_data.py GET /api/market-data/{symbol}
β β βββ websocket.py WS /ws/live
β βββ services/
β βββ mock_ai.py AI copilot β 9 categories, 45+ responses
β βββ portfolio_analytics.py Beta, Sharpe, stress tests, correlations
β βββ news.py Yahoo RSS + keyword sentiment scoring
β
βββ ml_engine/
β βββ meta_agent.py 6-agent ensemble decision engine
β
βββ data_pipeline/
β βββ providers.py NSE + Yahoo + Synthetic fallback chain
β βββ ingestion.py In-memory cached MarketDataService
β
βββ backtesting/
β βββ engine.py Historical strategy simulation
β βββ metrics.py Sharpe, Sortino, CAGR, alpha, beta
β
βββ paper_trading/
β βββ engine.py In-memory paper trading with P&L
β
βββ frontend/
β βββ app/
β β βββ page.tsx Main dashboard
β β βββ backtests/page.tsx Strategy backtesting lab
β β βββ alerts/page.tsx Price alert management
β βββ components/
β β βββ ai-chat-panel.tsx Streaming AI chat (SSE consumer)
β β βββ news-intelligence.tsx News feed with sentiment scoring
β β βββ portfolio-manager.tsx Holdings CRUD + CSV import
β β βββ agent-orchestration.tsx Agent vote visualisation
β β βββ explainability-panel.tsx Decision breakdown + feature importance
β βββ lib/
β β βββ quant-engine.ts Client-side quant analysis
β β βββ markets.ts Symbol universe + currency conversion
β β βββ config.ts API base URL (env var aware)
β βββ store/
β βββ use-dashboard-store.ts Zustand global state
β
βββ sample-portfolio.csv 48 real holdings ready to import
βββ alembic/ DB migrations (production use)
All endpoints are available at http://localhost:8000/docs with no authentication required.
| Method | Endpoint | Description |
|---|---|---|
GET |
/health |
Service health check |
GET |
/api/portfolio |
Get current holdings |
POST |
/api/portfolio/holdings |
Save holdings + return analytics |
GET |
/api/portfolio/analytics |
Full risk analytics |
POST |
/api/decisions |
Run AI meta-agent on a symbol |
POST |
/api/chat/stream |
SSE streaming AI chat |
GET |
/api/chat/history |
Load conversation history |
POST |
/api/backtests/run |
Run historical backtest |
GET |
/api/news |
Sentiment-scored news feed |
GET/POST/DELETE |
/api/alerts |
Price alert management |
POST |
/api/alerts/check |
Evaluate alerts against live prices |
WS |
/ws/live?symbol=X |
Live market tick WebSocket |
# Set in Vercel dashboard:
NEXT_PUBLIC_API_URL=https://your-backend.onrender.com
vercel --prod# Render auto-detects nixpacks.toml
# Set environment variable:
ALLOWED_ORIGINS=https://your-app.vercel.app
# Start command (already in render.json):
uvicorn backend.app.main:app --host 0.0.0.0 --port $PORTOptional environment variables for production:
DATABASE_URL=postgresql+asyncpg://... # Upgrade from SQLite
ANTHROPIC_API_KEY=sk-ant-... # Enable real Claude AI
ALLOWED_ORIGINS=https://yourapp.com # Restrict CORS
![]() Palash Kulkarni Author & Maintainer |
Built with obsessive attention to detail by Palash Kulkarni
No AI was harmed in the making of this AI trading platform.
