Implemented comprehensive indicator management system for traders:
Backend (indicators.py):
- GET /api/indicators/available: All available indicators by category
- GET /api/indicators/categories: List of indicator categories
- GET /api/indicators/category/{category}: Indicators in specific category
- GET /api/indicators/{indicator_id}: Detailed indicator information
- GET /api/indicators/default: Recommended setup for gold trading
- GET /api/indicators/presets: 5 pre-configured trading setups
- POST /api/indicators/preset/{preset_id}/apply: Apply preset configuration
- POST /api/indicators/custom: Create custom indicator configuration
- GET /api/indicators/recommendations: Market condition-based recommendations
- POST /api/indicators/calculate/{indicator}: Calculate indicator values
- GET /api/indicators/alerts/golden-cross: Golden cross alerts
- GET /api/indicators/alerts/death-cross: Death cross alerts
- GET /api/indicators/alerts/divergence: Price/indicator divergence alerts
- GET /api/indicators/cheat-sheet: Quick reference guide
Indicator Categories:
1. Moving Averages: SMA, EMA, WMA with multiple periods
2. Oscillators: RSI, Stochastic, MACD, KDJ
3. Volatility: Bollinger Bands, ATR, Keltner Channels
4. Support/Resistance: Pivot Points, Fibonacci Retracement
5. Volume: OBV, CMF, Volume Profile
Pre-configured Presets:
- Scalping Setup (1-5 min): EMA 5/10, RSI, MACD, BB
- Swing Trading Setup (4h-1D): SMA 50/200, RSI, MACD, Pivot
- Position Trading Setup (1D+): SMA 50/200, RSI, BB, Fibonacci
- Volatility Focus: BB, ATR, Keltner Channel, OBV
- Momentum Focus: RSI, Stochastic, MACD, KDJ
Features:
- Market condition recommendations (trending/ranging/volatile/calm)
- Timeframe-specific setups (scalping/swing/position)
- Quick reference cheat sheet for all indicators
- Signal alerts: Golden/Death Cross, Divergences
- Indicator calculation engine for backtesting
Frontend (AdvancedIndicatorsPanel.tsx):
- Three main tabs: Presets, Custom Setup, Quick Guide
- Preset selector with one-click application
- Custom indicator builder with drag-select
- Category-based organization
- Type-based color coding
- Indicator details and parameters
- Selected indicators summary
- Pro tips and best practices
- Legend for indicator types
Integration:
- Added Indicators tab to main navigation
- Full TypeScript support
- Responsive layout for all screen sizes
- Real-time preset switching
- Custom configuration persistence
Trading Presets Include:
- Setup recommendations for different timeframes
- Indicator period suggestions
- Signal confirmation rules
- Best practices for each trading style
Note: Backend uses mock calculations. In production, integrate with:
- TA-Lib for technical analysis
- Real-time price data feeds
- WebSocket for live indicator calculations
🏆 Gold Trading Simulator
An AI-powered gold trading scenario simulator with professional-grade charting, analytics, and risk management tools.
📖 Documentation
All comprehensive documentation has been consolidated in the docs/ directory.
Quick Links
- 🚀 Quick Start Guide - Get running in 5 minutes
- 📋 Complete Documentation - Full project documentation
- 💡 Feature Overview - All features explained
- 📊 Daily Workflow - Trading best practices
✨ Key Features
- Real-time candlestick charts with WebSocket streaming
- AI-powered trade analysis using Claude/GPT-4
- 9+ technical indicators (SMA, EMA, RSI, MACD, Bollinger Bands, etc.)
- Advanced analytics (Win rate, Sharpe ratio, drawdown analysis)
- Risk management tools with position sizing
- Live financial news with AI summarization
- Customizable dashboard with 5+ presets
- 22+ professional UI components
🚀 Quick Start
Prerequisites
- Node.js 18+ and Python 3.11+
- Docker (for PostgreSQL)
- API Keys: Alpha Vantage (free) + OpenRouter (~$5)
Setup (5 minutes)
# 1. Clone and navigate
git clone <repository-url>
cd gold-trading-simulator
# 2. Start database
docker-compose up -d
# 3. Backend setup (Terminal 1)
cd backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
# Create backend/.env and add your API keys
python -m app.main
# 4. Frontend setup (Terminal 2)
cd frontend
npm install
npm run dev
Open browser: http://localhost:3000
👉 See QUICKSTART.md for detailed instructions
🏗️ Project Structure
gold-trading-simulator/
├── backend/ # FastAPI Python backend
│ ├── app/
│ │ ├── api/ # REST API endpoints
│ │ ├── services/ # Business logic
│ │ ├── streaming/ # WebSocket handlers
│ │ └── models/ # Database models
│ └── requirements.txt
├── frontend/ # React + TypeScript frontend
│ ├── src/
│ │ ├── components/ # 22+ UI components
│ │ ├── services/ # API clients
│ │ └── utils/ # Indicators & helpers
│ └── package.json
├── database/ # DB initialization
├── docs/ # 📚 Complete documentation
└── docker-compose.yml # PostgreSQL setup
🛠️ Technology Stack
Backend: FastAPI • PostgreSQL • SQLAlchemy • WebSockets • Pandas
Frontend: React 18 • TypeScript • Vite • TailwindCSS • Lightweight Charts
APIs: Alpha Vantage • OpenRouter AI
📡 API Endpoints
Market Data
GET /api/market/gold/current- Current priceGET /api/market/gold/historical- Historical dataGET /api/ohlcv/klines- Live OHLCV data
Trading
POST /api/trading/buy- Execute buyPOST /api/trading/sell- Execute sellGET /api/trading/portfolio- Portfolio status
AI Analysis
POST /api/ai/analyze- AI trade recommendationPOST /api/ai/summarize-news- News summary
News & Alerts
GET /api/news/headlines- Latest newsPOST /api/alerts/create- Create alert
Live Streaming
WS /api/stream/price- Real-time price updates
🎯 Use Cases
- Trading Education - Learn technical analysis and trading strategies
- Strategy Testing - Backtest and validate trading ideas
- Portfolio Management - Practice risk management and position sizing
- AI Integration - Explore AI-powered trading recommendations
- Full-Stack Demo - Showcase modern web development skills
📚 Full Documentation
For complete setup instructions, feature guides, customization options, and more:
Documentation Index
-
Setup & Configuration
-
Features & Capabilities
-
Usage Guides
-
Development
⚠️ Disclaimer
This is a simulation and educational tool. Not financial advice. Do not use for actual trading decisions. No real money involved.
📄 License
This is a demonstration project. Feel free to fork and modify for educational purposes.
Built with ❤️ using FastAPI, React, and modern web technologies