Multi-agent stock analysis system using LangGraph with technical, fundamental, sentiment, and macro analysis to generate trading decisions with risk assessment
A sophisticated multi-agent trading system that analyzes stocks using specialized AI agents for technical analysis, fundamentals, sentiment, macro context, and risk management to generate comprehensive trading decisions.
This skill helps you analyze stocks using a multi-agent architecture orchestrated by LangGraph. The system employs multiple specialized agents that work together to provide comprehensive stock analysis and trading recommendations.
1. **Initialize Python Environment**
```bash
poetry install
poetry shell
```
2. **Configure Environment Variables**
Create a `.env` file with:
```
GEMINI_API_KEY=your_gemini_api_key
# Optional OpenAI-compatible API configuration
# Optional Algogene API configuration
```
3. **Setup Frontend (Optional)**
```bash
cd frontend/
npm install
```
The system follows a multi-phase workflow:
**Basic stock analysis:**
```bash
poetry run python src/main.py --ticker STOCK_CODE
```
**Analysis with detailed reasoning:**
```bash
poetry run python src/main.py --ticker STOCK_CODE --show-reasoning
```
**Backtesting:**
```bash
poetry run python src/backtester.py --ticker STOCK_CODE --start-date YYYY-MM-DD --end-date YYYY-MM-DD
```
**Start backend server:**
```bash
poetry run python run_with_backend.py
```
**Start frontend (in separate terminal):**
```bash
cd frontend/
npm start
```
The backend provides REST API endpoints for:
**Agent Implementation**: `src/agents/`
**Tools & Utilities**: `src/tools/`
**Backend API**: `backend/`
**Frontend**: `frontend/`
**Code formatting:**
```bash
poetry run black src/ backend/
poetry run isort src/ backend/
```
**Linting:**
```bash
poetry run flake8 src/ backend/
```
**Testing:**
```bash
poetry run pytest
```
**Frontend testing:**
```bash
cd frontend/
npm test
```
**Production build:**
```bash
cd frontend/
npm run build
```
1. Set environment variables in `.env`
2. Activate Poetry environment: `poetry shell`
3. Run analysis: `poetry run python src/main.py --ticker 600519 --show-reasoning`
4. Review agent reasoning and final trading recommendation
5. Check logs in `logs/` directory for detailed execution traces
For web interface:
1. Start backend: `poetry run python run_with_backend.py`
2. Start frontend: `cd frontend/ && npm start`
3. Navigate to http://localhost:3000
4. Enter stock ticker and view real-time analysis results
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/ai-trading-agent-analysis/raw