投资组合代理(谷歌ADK POC)
具有 Google ADK 和 MCP 集成的专业证券跟踪代理。
功能(第1阶段-只读)
- 所有职位的投资组合概览
- 通过Yahoo Finance实时课程
- 职位详情与绩效
- MCP Server for julia-server 集成
设置
# 1. Virtual Environment erstellen
cd /Users/ingosuckow/Documents/GitHub/portfolio-agent-adk
python3 -m venv venv
source venv/bin/activate
# 2. Dependencies installieren
pip install -r requirements.txt
# 3. Data Verzeichnis erstellen
mkdir -p data
# 4. Positionen aus config.yaml laden
python main.py --seed
# 5. Test: Portfolio Übersicht
python main.py --overview用法
命令行界面
# Portfolio Übersicht
python main.py --overview
# Einzelner Kurs
python main.py --quote AAPL
# Position Details
python main.py --position MSFT
# Interaktiver Modus
python main.py -iMCP 服务器(用于 Julia 服务器)
# MCP Server starten (stdio)
python mcp_server.pyjulia服务器集成
在 julia-server/config/settings.yaml 添加 :
mcp_client:
servers:
portfolio_agent:
type: stdio
command: /Users/ingosuckow/Documents/GitHub/portfolio-agent-adk/venv/bin/python
args:
- /Users/ingosuckow/Documents/GitHub/portfolio-agent-adk/mcp_server.py
env:
PORTFOLIO_CONFIG: /Users/ingosuckow/Documents/GitHub/portfolio-agent-adk/config.yamlMCP工具
| 工具 | 描述 |
|---|---|
portfolio_overview 完整的投资组合概述 | |
stock_price 个别股票价格。 | |
position_details | 职位与绩效 |
stock_prices 多门课程(Batch) |
建筑
portfolio-agent-adk/
├── config.yaml # Konfiguration + Positionen
├── schema.sql # SQLite Schema
├── interfaces.py # Repository Interfaces (Ports)
├── portfolio_tools.py # SQLite + Yahoo Implementierung
├── mcp_server.py # MCP Server (stdio)
├── main.py # CLI Entry Point
├── requirements.txt # Dependencies
└── data/
└── portfolio.db # SQLite Datenbank配置
位置在 config.yaml 自定义 :
portfolio:
positions:
- symbol: AAPL
shares: 50
buy_price: 178.50
buy_date: "2025-03-15"
currency: USD然后 python main.py --seed 执行 。
第二阶段(Phase 2+)
- \[ \] 写作操作(添加/删除位置)
- \[ \] 警报(课程通知)
- \[\]经纪人-API集成
- \[\]性能历史
IBKR快速入门
有关直接访问经纪人(账户+头寸)的信息,请参阅:
docs/IBKR_API_USAGE.mdscripts/ibkr_snapshot.pyscripts/import_ibkr_positions.py
