Multi-Agent Financial Market Analysis System
A sophisticated multi-agent AI system that combines news sentiment analysis, technical market indicators, and cross-verification logic to provide intelligent trading insights. Built for hackathon submission targeting Anthropic (Best Use of Claude) and Apify tracks.
TradrFin uses a 4-Agent Multi-Agent System to analyze financial markets:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Frontend Dashboard β
β (React + Tailwind CSS) β
βββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββββββββββββ
β β
βββββββββΌβββββββ βββββββΌβββββββββββ
β Backend API β β Apify Actor β
β (Node.js) β β (Sentiment) β
βββββββββ¬βββββββ βββββββ¬βββββββββββ
β β
βββββββββ¬ββββββββββββββββ¬βββββββ
β β
βββββββββββββΌββββββββββββββββΌββββββββββββββββ
β Multi-Agent System β
βββββββββββββββββββββββββββββββββββββββββββββ€
β Agent 1: News & Social Sentiment Agent β
β Agent 2: Asset Movement Diagnostics β
β Agent 3: Cross-Verification Agent β
β Agent 4: User-facing Advisor Agent β
βββββββββββββββββββββββββββββββββββββββββββββ
Purpose: Understand market mood from news and social signals
Inputs:
- Financial news headlines (Google News RSS, Reuters RSS)
- Market-wide sentiment indices
- Social sentiment data
Outputs:
- Overall sentiment: Bullish/Bearish/Neutral
- Sector-level sentiment (tech, finance, energy)
- Key drivers (inflation, earnings, geopolitics)
- Confidence score (0-1)
Data Sources:
- Finnhub News Sentiment API
- Google News RSS feeds
- Reuters RSS feeds
- Apify Actor for data collection
Implementation:
- Location:
agents/news_sentiment_agent/ - Uses Claude (Anthropic) for sentiment analysis
- Deployed as Apify Actor
Purpose: Analyze real market behavior through technical indicators
Inputs:
- Price candles (1d or 1h)
- Volume changes
- Volatility (ATR - Average True Range)
- Momentum indicators (RSI, MACD)
- Market indices (S&P500, NASDAQ, BTC)
Outputs:
- Market trend assessment (upward/downward/neutral)
- Momentum strength
- Volume analysis
- Asset-specific signals (AAPL, TSLA, GOOG, etc.)
Technical Indicators:
- Trend/Momentum: 20-day MA vs 50-day MA
- Volatility: ATR (Average True Range)
- Volume: Today's volume vs 5-day moving average
- RSI: 51-70 = bullish, 30-50 = neutral, <30 = oversold
Data Sources:
- yfinance (free tier)
- AlphaVantage (free tier)
- Finnhub (free tier)
Implementation:
- Location:
agents/decision agent/ - Precomputes indicators via
precompute_indicators.py - Analyzes historical data for multiple symbols
Purpose: Validate sentiment against actual price action - the "magic" that adds intelligence
Logic Examples:
Scenario 1: Contradiction Detection
Sentiment = Bullish
Price Trend = Down
Volume = Low
β Output: "Sentiment is positive but price action contradicts it.
Market may be in distribution or false hype."
Scenario 2: Contrarian Setup
Sentiment = Bearish
Price Trend = Up
Volatility = High
β Output: "Market is climbing despite fear.
Likely short squeeze or contrarian setup."
Outputs:
- Final combined sentiment (Bullish/Neutral/Bearish)
- Confidence score (0-1)
- Plain English explanation
- 3 key reasons for the assessment
Implementation:
- Location:
agents/decision agent/decision_agent.py - Uses Claude LLM for intelligent cross-verification
- Rule-based fallback mode available
Purpose: Transform all internal signals into actionable insights for users
Outputs:
- Clean, readable summary
- Actionable trading insights
- Visual signals (Green/Bullish, Red/Bearish, Yellow/Neutral)
- Beginner-friendly explanations
Implementation:
- Location:
backend/server.js(POST/api/chat) - Frontend:
frontend/src/pages/Advisor.jsx - Provides conversational interface
Market Sentiment: Bearish (score: 0.32)
Asset Trend: Bullish (score: 0.65)
Final Verdict: Neutral β conflicting signals
Confidence: 0.41
Explanation:
Headlines show strong concerns about inflation and slowing earnings.
BUT the S&P500 is in a short-term uptrend with strong buying volume.
This is often seen during short-covering or temporary relief rallies.
Recommendation:
Wait for confirmation before making large trades.
- React 19.2.0 - UI framework
- Vite - Build tool with Rolldown
- Tailwind CSS - Styling
- React Router - Navigation
- Recharts - Data visualization
- Node.js/Express - FinTech Dashboard API (port 5000)
- Python/FastAPI - Trading Simulation API (port 8000)
- MySQL - Cloud database for sentiment and market data
- Claude (Anthropic) - Sentiment analysis and decision-making
- Apify - News collection and data processing
- yfinance - Market data fetching
- Pandas - Data processing
- Apify Actor - News sentiment collection
- Python Agents - Decision making and execution
- FastAPI - Agent orchestration
- Node.js 16+
- Python 3.8+
- MySQL database (cloud or local)
- Anthropic API key
- Apify account (optional, for actor deployment)
-
Clone the repository:
git clone <repository-url> cd TradrFin
-
Setup Backend (Node.js):
cd backend npm installCreate
.envfile:DB_HOST=your-database-host.com DB_USER=your-username DB_PASSWORD=your-password DB_NAME=your-database-name DB_PORT=3306 DB_SSL=true PORT=5000
-
Setup Backend (Python):
cd backend pip install -r requirements.txt -
Setup Frontend:
cd frontend npm install -
Setup Sentiment Agent (Apify):
cd agents/news_sentiment_agent npm install -
Precompute Market Indicators:
cd agents/decision\ agent python precompute_indicators.py
Terminal 1 - Node.js Backend:
cd backend
npm start
# Server runs on http://localhost:5000Terminal 2 - Python FastAPI Backend:
cd backend
uvicorn app:app --reload --port 8000
# Server runs on http://localhost:8000
# API docs at http://localhost:8000/docsTerminal 3 - Frontend:
cd frontend
npm run dev
# App runs on http://localhost:5173TradrFin/
βββ agents/
β βββ decision agent/ # Agent 2 & 3: Market analysis & cross-verification
β β βββ decision_agent.py # Cross-verification logic with Claude
β β βββ execution_agent.py # Trade execution
β β βββ trading_simulator.py # Simulation engine
β β βββ precompute_indicators.py # Technical indicator computation
β βββ news_sentiment_agent/ # Agent 1: Sentiment collection (Apify Actor)
β βββ src/main.js # Apify Actor implementation
β βββ actor.json # Actor configuration
βββ backend/
β βββ server.js # Node.js API (Agent 4: Advisor)
β βββ app.py # FastAPI (Trading simulation)
β βββ requirements.txt # Python dependencies
βββ frontend/
β βββ src/
β β βββ pages/
β β β βββ Advisor.jsx # Agent 4 UI
β β β βββ Sentiment.jsx # Agent 1 visualization
β β β βββ Technicals.jsx # Agent 2 visualization
β β βββ components/ # Reusable components
β βββ package.json
βββ README.md
GET /api/health- Health checkGET /api/sentiment- Get sentiment analysis dataGET /api/market-data- Get market technical dataGET /api/transactions- Get transaction historyPOST /api/chat- AI chat endpoint (Agent 4)
GET /- API informationPOST /demo- Run trading simulationGET /portfolio- Get current portfolio stateGET /status- Get simulation statusGET /logs- List trading log files
See backend/README.md for detailed API documentation.
β
Multi-Agent Architecture - 4 specialized agents working together
β
Claude AI Integration - Advanced sentiment analysis and decision-making
β
Apify Actor - Scalable news collection and processing
β
Cross-Verification Logic - Validates sentiment against price action
β
Real-time Market Analysis - Technical indicators and trend detection
β
Interactive Dashboard - Beautiful React UI with real-time updates
β
Trading Simulation - Backtest strategies with historical data
β
Confidence Scoring - Transparent AI decision-making
- Agent 1 collects financial news and analyzes sentiment using Claude
- Agent 2 computes technical indicators (RSI, MACD, ATR, Volume)
- Agent 3 cross-verifies sentiment vs. price action, generates final signal
- Agent 4 presents insights in user-friendly format via chat interface
The system flags contradictions (e.g., bullish sentiment but bearish price action) and provides explanations, making it valuable for both beginners and experienced traders.
cd agents/news_sentiment_agent
apify run --input='{"query":"NVIDIA","maxNewsItems":10}'cd agents/decision\ agent
python test_decision_agent.pycd agents/decision\ agent
python test_backtester.pyThe system expects these tables in your MySQL database:
sentiment_agent- Sentiment analysis resultsmarket_data_agent- Technical market dataasset_movement_agent- Transaction records
/- Banking Dashboard/advisor- AI Financial Advisor (Agent 4)/sentiment- Market Sentiment Analysis (Agent 1)/technicals- Technical Analysis (Agent 2)/ai-invest- AI Investment Tools/history- Transaction History/transfers- Money Transfers
DB_HOST=your-database-host
DB_USER=your-username
DB_PASSWORD=your-password
DB_NAME=your-database-name
DB_PORT=3306
DB_SSL=true
PORT=5000ANTHROPIC_API_KEY=your-anthropic-api-key- β Agent 1: News & Social Sentiment (Apify Actor)
- β Agent 2: Asset Movement Diagnostics
- β Agent 3: Cross-Verification Agent
- β Agent 4: User-facing Advisor
- β Frontend Dashboard
- β Backend APIs
- β Trading Simulation
backend/README.md- Detailed backend API documentationfrontend/README.md- Frontend setup and structureagents/news_sentiment_agent/README.md- Apify Actor documentationagents/decision agent/DESIGN_PLAN.md- Agent design details
This is a hackathon project. For questions or improvements, please open an issue or submit a pull request.
This project is part of a hackathon submission.
- Best Use of Claude: Leverages Claude for intelligent sentiment analysis and cross-verification
- Apify Integration: Custom Apify Actor for scalable news collection
- Multi-Agent Design: 4 specialized agents working in harmony
- Real-world Application: Practical trading insights with confidence scoring
- Judge-friendly Output: Clear explanations and actionable recommendations
Built with β€οΈ for the hackathon