An AI-powered market analysis tool that combines technical and fundamental analysis using agent-based architecture.
- Natural language interface for market analysis
- Technical analysis (momentum, trends, patterns)
- Fundamental analysis (valuation, financial health)
- Data from B3 (Brazilian stock exchange)
- Detailed reasoning from each analysis component
- Customizable date ranges for analysis
- Clone the repository:
git clone https://github.com/PedroDnT/ai-hedge-fund.git
cd ai-hedge-fund- Create and activate virtual environment:
# Create virtual environment
python -m venv venv
# Activate on Unix/macOS
source venv/bin/activate
# Activate on Windows
.\venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Set up environment variables:
# Create .env file with your API keys
echo "BEARER_TOKEN=your_token_here" > .envBasic usage:
python analyze.py "What's your technical analysis of PETR4?"With date range:
python analyze.py "How's PETR4 performing?" --start-date 2024-01-01 --end-date 2024-03-10Hide detailed reasoning:
python analyze.py "Analyze PETR4 fundamentals" --hide-reasoningfrom src.agent_orchestrator import analyze_prompt
# Simple usage
result = analyze_prompt("What's your technical analysis of PETR4?")
# Advanced usage
result = analyze_prompt(
prompt="How's PETR4 performing? Focus on valuation metrics.",
start_date="2024-01-01",
end_date="2024-03-10",
show_reasoning=True
)-
Technical Analysis:
- "What's the momentum and trend analysis for PETR4?"
- "Show me PETR4's technical indicators and price patterns"
- "Is PETR4 showing any bullish signals?"
-
Fundamental Analysis:
- "What's the valuation and financial health of PETR4?"
- "Analyze PETR4's profitability ratios"
- "How efficient is PETR4's operations?"
-
Combined Analysis:
- "Give me a complete analysis of PETR4"
- "Should I invest in PETR4? Consider all factors"
- "What's your outlook on PETR4?"
The system uses an agent-based architecture:
-
Market Data Agent:
- Fetches market data, financial statements, and company information
- Uses DadosDeMercado API for Brazilian market data
-
Technical Analysis Agent:
- Analyzes price patterns and momentum
- Calculates technical indicators (RSI, MACD, Bollinger Bands, OBV)
-
Fundamental Analysis Agent:
- Analyzes financial ratios and company health
- Evaluates valuation metrics and profitability
-
Orchestrator:
- Coordinates agents based on user prompts
- Combines analyses into coherent responses
- Provides natural language summaries
- Market Data: DadosDeMercado API
- Coverage: Brazilian stocks (B3)
- Data Types:
- Price data
- Financial statements
- Company information
- Market ratios
- Financial metrics
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.