A sophisticated full-stack futures trading analysis platform powered by Claude AI, providing real-time market data, technical analysis, and intelligent fundamental analysis for futures contracts.
- Real-time Quotes: Live pricing for Crude Oil (CL=F), Gold (GC=F), and S&P 500 E-mini (ES=F)
- Interactive Charts: Candlestick charts with multiple timeframes and intervals
- Technical Analysis: RSI, MACD, EMA indicators with support/resistance levels
- Risk Management: Automated stop-loss and take-profit calculations
- Fundamental Analysis: AI-powered market analysis with bias determination
- Smart Caching: 15-minute cache system to optimize API costs
- Real-time Insights: Market drivers, catalysts, and risk factors
- Web Search Enhanced: Optional web search for latest market conditions
- Dark Theme: Modern, professional trading interface
- Unified Dashboard: Combined market data and analysis in one view
- Responsive Design: Works on desktop and mobile devices
- Real-time Updates: Live data streaming with WebSocket support
- Node.js with Express.js framework
- PostgreSQL database for data persistence
- Yahoo Finance API for real-time market data
- Claude AI API (Anthropic) for fundamental analysis
- WebSocket for real-time updates
- Docker containerization support
- React 18 with modern hooks
- Material-UI (MUI) for professional components
- Recharts for interactive financial charts
- Axios for API communication
- React Router for navigation
{
"backend": {
"express": "^4.18.2",
"yahoo-finance2": "^2.11.3",
"@anthropic-ai/sdk": "^0.17.1",
"pg": "^8.11.3",
"ws": "^8.14.2"
},
"frontend": {
"@mui/material": "^5.14.18",
"recharts": "^2.8.0",
"axios": "^1.6.0"
}
}- Node.js 18+ and npm
- PostgreSQL 12+
- Claude AI API key from Anthropic
git clone <repository-url>
cd trading-systemcd backend-node
npm install
# Environment Configuration
cp .env.example .env
# Edit .env with your database and API credentials:
# DATABASE_URL=postgresql://user:password@localhost:5432/trading_db
# ANTHROPIC_API_KEY=your_claude_api_keycd ../frontend
npm install
# Environment Configuration
cp .env.example .env
# Edit .env:
# REACT_APP_API_URL=http://localhost:8001/api/v1# Create PostgreSQL database
createdb trading_db
# Run migrations (auto-created on first startup)
cd backend-node
npm run dev# Terminal 1 - Backend
cd backend-node
npm run dev
# Terminal 2 - Frontend
cd frontend
npm start# Backend
cd backend-node
npm run build
npm start
# Frontend
cd frontend
npm run build
serve -s build# Full stack with Docker Compose
docker-compose up -dGET /api/v1/market/quotes # Get multiple quotes
GET /api/v1/market/price/:symbol # Get single quote
GET /api/v1/market/historical/:symbol # Historical data
GET /api/v1/market/contracts # Available contracts
GET /api/v1/analysis/technical/:symbol # Technical analysis
GET /api/v1/analysis/claude/:symbol/cached # Cached Claude analysis
POST /api/v1/analysis/claude/:symbol/generate # Fresh Claude analysis
POST /api/v1/analysis/claude/:symbol/enhanced # Enhanced with web search
POST /api/v1/analysis/claude/:symbol/selected-articles # Analyze user-selected articles
GET /api/v1/news/ # Get recent news with importance scoring
GET /api/v1/news/symbol/:symbol # Get symbol-specific news
POST /api/v1/news/refresh # Force refresh news from RSS feeds
GET /health # Health check
GET /api/v1/system/status # System status
- View real-time price charts with technical indicators
- Toggle between different timeframes (1d, 7d, 30d, 90d)
- Monitor current quotes with price changes
- Access technical analysis with RSI, MACD, support/resistance
- Manual Analysis Trigger: Click "Load News & Analysis" to fetch latest articles
- Selected Articles Analysis: Analyze only chosen articles for targeted insights
- Market Bias Detection: AI determines Bullish/Bearish/Neutral stance with confidence levels
- Key Data Points: Extract specific metrics and trading ranges from news
- Risk Assessment: Identify potential risk factors and market catalysts
- Detailed Reasoning: Claude explains its analysis logic and market interpretation
- Token Efficiency: Smart article selection reduces analysis costs significantly
- Monitor generated trading signals
- Track signal performance and accuracy
- Set up custom alert notifications
- Intelligent Article Ranking: Articles auto-sorted by importance score (CRITICAL/HIGH/MEDIUM/LOW)
- Manual Article Selection: Choose specific articles for Claude AI analysis with checkboxes
- Real-time Token Estimation: See token usage before analysis (8,000 token limit protection)
- Clickable Headlines: Direct links to original news sources
- Sentiment Analysis: Visual sentiment indicators with color-coded scoring
- Source Credibility: Premium sources (Bloomberg, Reuters) ranked higher
- Breaking News Detection: "BREAKING", "URGENT" keywords boost importance
- Cost Optimization: Only analyze selected articles, reducing API costs by up to 90%
# Database
DATABASE_URL=postgresql://user:pass@localhost:5432/trading_db
DB_POOL_SIZE=10
# Claude AI
ANTHROPIC_API_KEY=your_anthropic_api_key
# Server
PORT=8001
NODE_ENV=development
CORS_ORIGIN=http://localhost:3000
# Cache
REDIS_URL=redis://localhost:6379 # Optional
CACHE_TTL=900 # 15 minutesREACT_APP_API_URL=http://localhost:8001/api/v1
REACT_APP_WS_URL=ws://localhost:8001
REACT_APP_ENV=development{
'CL=F': 'Crude Oil WTI Futures',
'GC=F': 'Gold Futures',
'ES=F': 'S&P 500 E-mini Futures'
}- API Key Management: Secure handling of Claude AI credentials
- CORS Protection: Configurable origin restrictions
- Input Validation: Comprehensive data sanitization
- Rate Limiting: Built-in API rate limit management
- Error Handling: Graceful failure with fallback data
- 15-minute Claude analysis cache - Reduces API costs by 90%
- Smart Article Selection - User-controlled analysis reduces unnecessary API calls
- Importance-based News Ranking - Focus on high-value content first
- Database connection pooling - Efficient resource usage
- WebSocket connections - Real-time updates without polling
- Market Hours: 9:30 AM - 4:00 PM Eastern Time, Monday-Friday
- Price Updates: Every hour during market hours
- News Updates: Every hour (RSS feeds from Bloomberg, CNBC, Reuters)
- Claude Analysis: Every hour during market hours with fresh data
- Health Checks: Every 2 hours
- User-Controlled Analysis - Manual article selection prevents unnecessary API calls
- Token Limit Protection - Real-time validation prevents exceeding 8,000 token limits
- Efficient Article Filtering - Importance scoring focuses on high-value content
- Smart Caching - Database-based caching with intelligent expiry
- Fallback mechanisms - Graceful degradation when APIs are unavailable
cd backend-node
npm test
npm run test:coveragecd frontend
npm test
npm run test:coveragenpm run test:integration- Set
NODE_ENV=production - Configure production database
- Set up SSL certificates
- Configure reverse proxy (nginx)
- Set up monitoring and logging
- Configure backup strategies
# docker-compose.prod.yml
version: '3.8'
services:
app:
image: claude-trading:latest
environment:
- NODE_ENV=production
- DATABASE_URL=${DATABASE_URL}
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
- Use ESLint and Prettier for consistent formatting
- Follow semantic commit messages
- Write tests for new features
- Update documentation for API changes
- Anthropic for Claude AI API
- Yahoo Finance for market data
- Material-UI for React components
- PostgreSQL for reliable data storage
- β Intelligent Article Selection - Choose specific articles for Claude analysis
- β Importance-Based Ranking - CRITICAL/HIGH/MEDIUM/LOW scoring system
- β Real-time Token Estimation - Prevent API limit overages with live token counting
- β Manual Analysis Control - User-driven analysis reduces unnecessary API costs
- β Enhanced Sentiment Display - Visual sentiment indicators with color coding
- β Clickable News Headlines - Direct links to original article sources
- β Source Credibility Scoring - Premium sources ranked higher automatically
- β Breaking News Detection - Urgent keywords boost article importance
- β Unified Market & Analysis page
- β Real-time technical analysis with Yahoo Finance data
- β Claude AI fundamental analysis with smart caching
- β Professional dark theme UI
- β WebSocket real-time updates
- β Docker containerization support
- π Advanced charting with drawing tools
- π Real-time alerts and notifications
- π± Mobile app companion
- π€ Enhanced AI with multi-model support
- π Portfolio tracking and management
- π― Custom article filtering and search