"Vibe-Trading: Your Personal Trading Agent"
Python ai-agentalgorithmic-tradingbacktestingfintechllmmcpmulti-agentpythonquantitative-financetrading
Initial commit
warren61834eae37ba451
diff --git a/.dockerignore b/.dockerignorenew file mode 100644index 000000000..ed87752a0--- /dev/null+++ b/.dockerignore@@ -0,0 +1,28 @@+.venv/+agent/.venv/+__pycache__/+*.pyc+.pytest_cache/+.ruff_cache/+node_modules/+frontend/dist/+frontend/tsconfig.tsbuildinfo+.env+agent/.env+agent/runs/+agent/sessions/+agent/.swarm/runs/+agent/.ui_runtime/+agent/.tasks/+agent/vibe_trading.egg-info/+.git/+.github/+.claude/+.vscode/+data/*.duckdb+data/*.duckdb.wal+data/.duckdb_tmp/+data/parquet/+data/backup/+data/minutes/+data/*.logdiff --git a/.github/workflows/test.yml b/.github/workflows/test.ymlnew file mode 100644index 000000000..c4803f947--- /dev/null+++ b/.github/workflows/test.yml@@ -0,0 +1,45 @@+name: CI++on:+ push:+ branches: [master]+ pull_request:+ branches: [master]++jobs:+ build:+ runs-on: ubuntu-latest+ timeout-minutes: 10++ steps:+ - uses: actions/checkout@v4++ - uses: actions/setup-python@v5+ with:+ python-version: "3.11"+ cache: pip++ - name: Install dependencies+ run: pip install -e .++ - name: Syntax check+ run: |+ cd agent+ python -m py_compile cli.py+ python -m py_compile api_server.py+ python -m py_compile mcp_server.py+ python -m py_compile src/agent/loop.py+ python -m py_compile src/tools/__init__.py+ python -m py_compile backtest/runner.py++ - uses: actions/setup-node@v4+ with:+ node-version: "20"+ cache: npm+ cache-dependency-path: frontend/package-lock.json++ - name: Frontend build+ run: |+ cd frontend+ npm ci+ npm run builddiff --git a/.gitignore b/.gitignorenew file mode 100644index 000000000..e26333bcc--- /dev/null+++ b/.gitignore@@ -0,0 +1,39 @@+๏ปฟ.venv/+agent/.venv/+__pycache__/+.pytest_cache/+*.pyc++.env+agent/.env++.claude/*+!.claude/hooks.json+CLAUDE.md+.vscode/+learn-claude-code-main/+agent/sessions/+agent/runs/+agent/.ui_runtime/+agent/.tasks/+agent/tests/*_result.json+.ruff_cache/+frontend/dist/+frontend/tsconfig.tsbuildinfo++# DuckDB data cache+data/*.duckdb+data/*.duckdb.wal+data/.duckdb_tmp/+data/parquet/+data/backup/+data/minutes/+data/overnight*.log+data/*.log+data/test_write.txt+agent/.pytest_tmp/+agent/tests/e2e_swarm_results.json+agent/vibe_trading.egg-info/+agent/vibe_trading_ai.egg-info/+dist/+build/diff --git a/Dockerfile b/Dockerfilenew file mode 100644index 000000000..299b93db9--- /dev/null+++ b/Dockerfile@@ -0,0 +1,47 @@+# ============================================================================+# Stage 1: Build frontend+# ============================================================================+FROM node:20-slim AS frontend-build++WORKDIR /app/frontend+COPY frontend/package.json frontend/package-lock.json ./+RUN npm ci --ignore-scripts+COPY frontend/ ./+RUN npm run build++# ============================================================================+# Stage 2: Python runtime+# ============================================================================+FROM python:3.11-slim AS runtime++WORKDIR /app++# System deps+RUN apt-get update && apt-get install -y --no-install-recommends \+ build-essential \+ && rm -rf /var/lib/apt/lists/*++# Python deps (install before copying code for layer caching)+COPY agent/requirements.txt agent/requirements.txt+RUN pip install --no-cache-dir -r agent/requirements.txt++# Copy project+COPY pyproject.toml LICENSE README.md ./+COPY agent/ agent/+COPY data/ data/++# Copy built frontend+COPY --from=frontend-build /app/frontend/dist frontend/dist++# Install CLI entrypoint+RUN pip install --no-cache-dir -e .++# Default port+EXPOSE 8899++# Health check+HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \+ CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8899/health')" || exit 1++# Run API server (serves frontend/dist as static files)+CMD ["vibe-trading", "serve", "--host", "0.0.0.0", "--port", "8899"]diff --git a/LICENSE b/LICENSEnew file mode 100644index 000000000..08701c0ee--- /dev/null+++ b/LICENSE@@ -0,0 +1,21 @@+MIT License++Copyright (c) 2026 Vibe-Trading Contributors++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+SOFTWARE.diff --git a/README.md b/README.mdnew file mode 100644index 000000000..df2792996--- /dev/null+++ b/README.md@@ -0,0 +1,568 @@+<p align="center">+ <img src="assets/icon.png" width="120" alt="Vibe-Trading Logo"/>+</p>++<h1 align="center">Vibe-Trading: Your Personal Trading Agent</h1>++<p align="center">+ <b>One Command to Empower Your Agent with Comprehensive Trading Capabilities</b>+</p>++<p align="center">+ <img src="https://img.shields.io/badge/Python-3.11%2B-3776AB?style=flat&logo=python&logoColor=white" alt="Python">+ <img src="https://img.shields.io/badge/Backend-FastAPI-009688?style=flat" alt="FastAPI">+ <img src="https://img.shields.io/badge/Frontend-React%2019-61DAFB?style=flat&logo=react&logoColor=white" alt="React">+ <a href="https://pypi.org/project/vibe-trading-ai/"><img src="https://img.shields.io/pypi/v/vibe-trading-ai?style=flat&logo=pypi&logoColor=white" alt="PyPI"></a>+ <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow?style=flat" alt="License"></a>+ <img src="https://img.shields.io/badge/Research_Only-No_Live_Trading-red?style=flat" alt="Mode">+ <br>+ <img src="https://img.shields.io/badge/Skills-64-orange" alt="Skills">+ <img src="https://img.shields.io/badge/Swarm_Presets-29-7C3AED" alt="Swarm">+ <img src="https://img.shields.io/badge/Tools-20-0F766E" alt="Tools">+ <img src="https://img.shields.io/badge/Markets-3-2563EB" alt="Markets">+ <br>+ <a href="https://github.com/HKUDS/.github/blob/main/profile/README.md"><img src="https://img.shields.io/badge/Feishu-Group-E9DBFC?style=flat-square&logo=feishu&logoColor=white" alt="Feishu"></a>+ <a href="https://github.com/HKUDS/.github/blob/main/profile/README.md"><img src="https://img.shields.io/badge/WeChat-Group-C5EAB4?style=flat-square&logo=wechat&logoColor=white" alt="WeChat"></a>+ <a href="https://discord.gg/2vDYc2w5"><img src="https://img.shields.io/badge/Discord-Join-7289DA?style=flat-square&logo=discord&logoColor=white" alt="Discord"></a>+</p>++<p align="center">+ <a href="#-key-features">Features</a> · + <a href="#-demo">Demo</a> · + <a href="#-what-is-vibe-trading">What Is It</a> · + <a href="#-get-started">Get Started</a> · + <a href="#-cli-reference">CLI</a> · + <a href="#-api-server">API</a> · + <a href="#-mcp-plugin">MCP</a> · + <a href="#-project-structure">Structure</a>+</p>++<p align="center">+ <a href="#-get-started"><img src="assets/pip-install.svg" height="45" alt="pip install vibe-trading-ai"></a>+</p>++---++## ๐ก What Is Vibe-Trading?++Vibe-Trading is an AI-powered multi-agent finance workspace that turns natural language requests into executable trading strategies, research insights, and portfolio analysis across global markets.++### Key Capabilities:+โข **Strategy Generation** โ Automatically writes trading code from your ideas<br>+โข **Smart Data Access** โ Pulls market data from multiple sources seamlessly<br>+โข **Performance Testing** โ Tests your strategies against historical market data<br>+โข **Expert Teams** โ Deploys specialized AI agents for complex research tasks<br>+โข **Live Updates** โ Watch the entire analysis process in real-time++---++## โจ Key Features++<table width="100%">+ <tr>+ <td align="center" width="25%" valign="top">+ <img src="assets/scene-research.png" height="150" alt="Research"/><br>+ <h3>๐ DeepResearch for Trading</h3>+ <img src="https://img.shields.io/badge/64_Skills-FF6B6B?style=for-the-badge&logo=bookstack&logoColor=white" alt="Skills" /><br><br>+ <div align="left" style="font-size: 4px;">+ โข Multi-domain analysis coverage across markets<br>+ โข Auto strategy and signal generation<br>+ โข Macro economic research and insights<br>+ โข Natural-language task routing via chat+ </div>+ </td>+ <td align="center" width="25%" valign="top">+ <img src="assets/scene-swarm.png" height="150" alt="Swarm"/><br>+ <h3>๐ Swarm Intelligence</h3>+ <img src="https://img.shields.io/badge/29_Trading_Teams-4ECDC4?style=for-the-badge&logo=hive&logoColor=white" alt="Swarm" /><br><br>+ <div align="left">+ โข 29 out-of-the-box trading team presets<br>+ โข DAG-based multi-agent orchestration<br>+ โข Real-time decision streaming dashboard<br>+ โข Custom team building through YAML+ </div>+ </td>+ <td align="center" width="25%" valign="top">+ <img src="assets/scene-backtest.png" height="150" alt="Backtest"/><br>+ <h3>๐ Cross-Market Backtest</h3>+ <img src="https://img.shields.io/badge/3_Markets-FFD93D?style=for-the-badge&logo=bitcoin&logoColor=black" alt="Backtest" /><br><br>+ <div align="left">+ โข A-shares, HK/US equities & crypto<br>+ โข 7 flexible intervals from 1 min to 1 day<br>+ โข Daily & options portfolio engines<br>+ โข 15+ performance metrics & 4 optimizers+ </div>+ </td>+ <td align="center" width="25%" valign="top">+ <img src="assets/scene-quant.png" height="150" alt="Quant"/><br>+ <h3>๐งฎ Quant Analysis Toolkit</h3>+ <img src="https://img.shields.io/badge/Quant_Tools-C77DFF?style=for-the-badge&logo=wolfram&logoColor=white" alt="Quant" /><br><br>+ <div align="left">+ โข Factor IC/IR analysis & quantile backtesting<br>+ โข Black-Scholes pricing & full Greeks calculation<br>+ โข Technical pattern recognition & detection<br>+ โข Portfolio optimization via MVO/Risk Parity/BL+ </div>+ </td>+ </tr>+</table>++## 64 Skills across 8 Core Finance Domains++- ๐ 64 specialized finance skills across 8 core domains+- ๐ Complete coverage from traditional markets to crypto & DeFi+- ๐ฌ Comprehensive capabilities spanning technical analysis to quantitative research++| Area | Examples |+|------|----------|+| Technical Analysis | `technical-basic`, `candlestick`, `ichimoku`, `harmonic`, `elliott-wave`, `smc` |+| Quant Research | `strategy-generate`, `multi-factor`, `pair-trading`, `factor-research`, `ml-strategy` |+| Fundamentals | `valuation-model`, `financial-statement`, `earnings-forecast`, `credit-analysis` |+| HK/US Equities | `edgar-sec-filings`, `earnings-revision`, `us-etf-flow`, `hk-connect-flow`, `adr-hshare` |+| Crypto Desk | `perp-funding-basis`, `liquidation-heatmap`, `stablecoin-flow`, `token-unlock-treasury`, `defi-yield` |+| Macro | `macro-analysis`, `global-macro`, `asset-allocation`, `commodity-analysis`, `sector-rotation` |+| Derivatives | `options-strategy`, `options-advanced`, `options-payoff`, `crypto-derivatives`, `hedging-strategy` |+| Alt Data | `social-media-intelligence`, `sentiment-analysis`, `behavioral-finance`, `report-generate` |++## 29 Agent Swarm Team Presets++- ๐ข 29 ready-to-use agent teams+- โก Pre-configured finance workflows+- ๐ฏ Investment, trading & risk management presets++| Preset | Workflow |+|--------|----------|+| `investment_committee` | Bull/bear debate โ risk review โ PM final call |+| `global_equities_desk` | A-share + HK/US + crypto researcher โ global strategist |+| `crypto_trading_desk` | Funding/basis + liquidation + flow โ risk manager |+| `earnings_research_desk` | Fundamental + revision + options โ earnings strategist |+| `macro_rates_fx_desk` | Rates + FX + commodity โ macro PM |+| `quant_strategy_desk` | Screening + factor research โ backtest โ risk audit |+| `technical_analysis_panel` | Classic TA + Ichimoku + harmonic + Elliott + SMC โ consensus |+| `risk_committee` | Drawdown + tail risk + regime review โ sign-off |+| `global_allocation_committee` | A-shares + crypto + HK/US โ cross-market allocation |++<sub>Plus 20+ additional specialist presets โ run vibe-trading --swarm-presets to explore all.++</sub>++### ๐ฌ Demo++<div align="center">+<table>+<tr>+<td width="50%">++https://github.com/user-attachments/assets/3d5a9653-06cd-4903-b487-dc7ce4d8d90e++</td>+<td width="50%">++https://github.com/user-attachments/assets/3f8c1301-778c-439d-8992-1ad0ac524660++</td>+</tr>+<tr>+<td colspan="2" align="center"><sub>โ๏ธ Natural-language backtest & multi-agent swarm debate โ Web UI + CLI</sub></td>+</tr>+</table>+</div>++---++## ๐ Quick Started++### One-line install (PyPI)++```bash+pip install vibe-trading-ai+```++> **Package name vs commands:** The PyPI package is `vibe-trading-ai`. Once installed, you get three commands:+>+> | Command | Purpose |+> |---------|---------|+> | `vibe-trading` | Interactive CLI / TUI |+> | `vibe-trading serve` | Launch FastAPI web server |+> | `vibe-trading-mcp` | Start MCP server (for Claude Desktop, OpenClaw, Cursor, etc.) |++```bash+vibe-trading init # interactive .env setup+vibe-trading # launch CLI+vibe-trading serve --port 8899 # launch web UI+vibe-trading-mcp # start MCP server (stdio)+```++### Or choose a path++| Path | Best for | Time |+|------|----------|------|+| **A. Docker** | Try it now, zero local setup | 2 min |+| **B. Local install** | Development, full CLI access | 5 min |+| **C. MCP plugin** | Plug into your existing agent | 3 min |+| **D. ClawHub** | One command, no cloning | 1 min |++### Prerequisites++- An **OpenAI-compatible API key** (OpenRouter, DeepSeek, etc.) โ the only hard requirement+- **Python 3.11+** for Path B+- **Docker** for Path A++> **Tip:** yfinance (HK/US equities) and OKX (crypto) are free and require no API key. You only need a Tushare token for A-share data.++### Path A: Docker (zero setup)++```bash+git clone https://github.com/HKUDS/Vibe-Trading.git+cd Vibe-Trading+cp agent/.env.example agent/.env+# Edit agent/.env โ set OPENAI_API_KEY (required)+docker compose up --build+```++Open `http://localhost:8899`. Backend + frontend in one container.++### Path B: Local install++```bash+git clone https://github.com/HKUDS/Vibe-Trading.git+cd Vibe-Trading+python -m venv .venv++# Activate+source .venv/bin/activate # Linux / macOS+# .venv\Scripts\Activate.ps1 # Windows PowerShell++pip install -e .+cp agent/.env.example agent/.env # Edit โ set OPENAI_API_KEY+vibe-trading # Launch interactive TUI+```++<details>+<summary><b>Start web UI (optional)</b></summary>++```bash+# Terminal 1: API server+vibe-trading serve --port 8899++# Terminal 2: Frontend dev server+cd frontend && npm install && npm run dev+```++Open `http://localhost:5899`. The frontend proxies API calls to `localhost:8899`.++**Production mode (single server):**++```bash+cd frontend && npm run build && cd ..+vibe-trading serve --port 8899 # FastAPI serves dist/ as static files+```++</details>++### Path C: MCP plugin++See [MCP Plugin](#-mcp-plugin) section below.++### Path D: ClawHub (one command)++```bash+npx clawhub@latest install vibe-trading --force+```++The skill + MCP config is downloaded into your agent's skills directory. See [ClawHub install](#-mcp-plugin) for details.++---++## ๐ง Environment Variables++Edit `agent/.env`:++| Variable | Required | Description |+|----------|:--------:|-------------|+| `OPENAI_API_KEY` | Yes | OpenAI-compatible API key (OpenRouter, DeepSeek, etc.) |+| `OPENAI_BASE_URL` | Usually | API gateway URL (default: `https://openrouter.ai/api/v1`) |+| `LANGCHAIN_PROVIDER` | Yes | LLM provider selector (e.g. `openrouter`) |+| `LANGCHAIN_MODEL_NAME` | Yes | Model name (e.g. `deepseek/deepseek-v3.2`) |+| `TUSHARE_TOKEN` | A-shares only | Tushare Pro token for A-share data |+| `TIMEOUT_SECONDS` | No | Agent timeout, default 2400s |++**Free data (no key needed):** HK/US equities via yfinance, crypto via OKX public API.++---++## ๐ฅ CLI Reference++```bash+vibe-trading # interactive TUI+vibe-trading run -p "..." # single run+vibe-trading serve # API server+```++<details>+<summary><b>Slash commands inside TUI</b></summary>++| Command | Description |+|---------|-------------|+| `/help` | Show all commands |+| `/skills` | List all 64 finance skills |+| `/swarm` | List 29 swarm team presets |+| `/swarm run <preset> [vars_json]` | Run a swarm team with live streaming |+| `/swarm list` | Swarm run history |+| `/swarm show <run_id>` | Swarm run details |+| `/swarm cancel <run_id>` | Cancel a running swarm |+| `/list` | Recent runs |+| `/show <run_id>` | Run details + metrics |+| `/code <run_id>` | Generated strategy code |+| `/trace <run_id>` | Full execution replay |+| `/continue <run_id> <prompt>` | Continue a run with new instructions |+| `/sessions` | List chat sessions |+| `/settings` | Show runtime config |+| `/clear` | Clear screen |+| `/quit` | Exit |++</details>++<details>+<summary><b>Single run & flags</b></summary>++```bash+vibe-trading run -p "Backtest BTC-USDT MACD strategy, last 30 days"+vibe-trading run -p "Analyze AAPL momentum" --json+vibe-trading run -f strategy.txt+echo "Backtest 000001.SZ RSI" | vibe-trading run+```++```bash+vibe-trading -p "your prompt"+vibe-trading --skills+vibe-trading --swarm-presets+vibe-trading --swarm-run investment_committee '{"topic":"BTC outlook"}'+vibe-trading --list+vibe-trading --show <run_id>+vibe-trading --code <run_id>+vibe-trading --trace <run_id>+vibe-trading --continue <run_id> "refine the strategy"+vibe-trading --upload report.pdf+```++</details>++---++## ๐ API Server++```bash+vibe-trading serve --port 8899+```++| Method | Endpoint | Description |+|--------|----------|-------------|+| `GET` | `/runs` | List runs |+| `GET` | `/runs/{run_id}` | Run details |+| `POST` | `/sessions` | Create session |+| `POST` | `/sessions/{id}/messages` | Send message |+| `GET` | `/sessions/{id}/events` | SSE event stream |+| `POST` | `/upload` | Upload PDF/file |+| `GET` | `/swarm/presets` | List swarm presets |+| `POST` | `/swarm/runs` | Start swarm run |+| `GET` | `/swarm/runs/{id}/events` | Swarm SSE stream |++Interactive docs: `http://localhost:8899/docs`++---++## ๐ MCP Plugin++Vibe-Trading exposes 16 MCP tools for any MCP-compatible client. Runs as a stdio subprocess โ no server setup needed. **15 of 16 tools work with zero API keys** (HK/US/crypto). Only `run_swarm` needs an LLM key.++<details>+<summary><b>Claude Desktop</b></summary>++Add to `claude_desktop_config.json`:++```json+{+ "mcpServers": {+ "vibe-trading": {+ "command": "vibe-trading-mcp"+ }+ }+}+```++</details>++<details>+<summary><b>OpenClaw</b></summary>++Add to `~/.openclaw/config.yaml`:++```yaml+skills:+ - name: vibe-trading+ command: vibe-trading-mcp+```++</details>++<details>+<summary><b>Cursor / Windsurf / other MCP clients</b></summary>++```bash+vibe-trading-mcp # stdio (default)+vibe-trading-mcp --transport sse # SSE for web clients+```++</details>++**MCP tools exposed (16):** `list_skills`, `load_skill`, `backtest`, `factor_analysis`, `analyze_options`, `pattern_recognition`, `get_market_data`, `read_url`, `read_document`, `read_file`, `write_file`, `list_swarm_presets`, `run_swarm`, `get_swarm_status`, `get_run_result`, `list_runs`.++<details>+<summary><b>Install from ClawHub (one command)</b></summary>++```bash+npx clawhub@latest install vibe-trading --force+```++> `--force` is required because the skill references external APIs, which triggers VirusTotal's automated scan. The code is fully open-source and safe to inspect.++This downloads the skill + MCP config into your agent's skills directory. No cloning needed.++Browse on ClawHub: [clawhub.ai/skills/vibe-trading](https://clawhub.ai/skills/vibe-trading)++</details>++<details>+<summary><b>OpenSpace โ self-evolving skills</b></summary>++All 64 finance skills are published on [open-space.cloud](https://open-space.cloud) and evolve autonomously through OpenSpace's self-evolution engine.++To use with OpenSpace, add both MCP servers to your agent config:++```json+{+ "mcpServers": {+ "openspace": {+ "command": "openspace-mcp",+ "toolTimeout": 600,+ "env": {+ "OPENSPACE_HOST_SKILL_DIRS": "/path/to/vibe-trading/agent/src/skills",+ "OPENSPACE_WORKSPACE": "/path/to/OpenSpace"+ }+ },+ "vibe-trading": {+ "command": "vibe-trading-mcp"+ }+ }+}+```++OpenSpace will auto-discover all 64 skills, enabling auto-fix, auto-improve, and community sharing. Search for Vibe-Trading skills via `search_skills("finance backtest")` in any OpenSpace-connected agent.++</details>++---++## ๐ Project Structure++<details>+<summary><b>Click to expand</b></summary>++```+Vibe-Trading/+โโโ agent/ # Backend (Python)+โ โโโ cli.py # CLI entrypoint โ interactive TUI + subcommands+โ โโโ api_server.py # FastAPI server โ runs, sessions, upload, swarm, SSE+โ โโโ mcp_server.py # MCP server โ 16 tools for OpenClaw / Claude Desktop+โ โ+โ โโโ src/+โ โ โโโ agent/ # ReAct agent core+โ โ โ โโโ loop.py # main reasoning loop+โ โ โ โโโ skills.py # skill loader (64 SKILL.md files)+โ โ โ โโโ tools.py # tool orchestration+โ โ โ โโโ context.py # system prompt builder+โ โ โ โโโ memory.py # run memory / artifact store+โ โ โ โโโ trace.py # execution trace writer+โ โ โ+โ โ โโโ tools/ # 20 agent tools+โ โ โ โโโ backtest_tool.py # run backtests+โ โ โ โโโ factor_analysis_tool.py+โ โ โ โโโ options_pricing_tool.py+โ โ โ โโโ pattern_tool.py # chart pattern detection+โ โ โ โโโ doc_reader_tool.py # PDF reader (OCR fallback)+โ โ โ โโโ web_reader_tool.py # web page reader (Jina)+โ โ โ โโโ swarm_tool.py # launch swarm teams+โ โ โ โโโ ... # file I/O, bash, tasks, etc.+โ โ โ+โ โ โโโ skills/ # 64 finance skill definitions (SKILL.md each)+โ โ โโโ swarm/ # Swarm DAG execution engine+โ โ โโโ session/ # Multi-turn chat session management+โ โ โโโ providers/ # LLM provider abstraction+โ โ+โ โโโ backtest/ # Backtest engines+โ โ โโโ engines/ # daily_portfolio + options_portfolio+โ โ โโโ loaders/ # tushare, okx, yfinance+โ โ โโโ optimizers/ # MVO, equal vol, max div, risk parity+โ โ+โ โโโ config/swarm/ # 29 swarm preset YAML definitions+โ+โโโ frontend/ # Web UI (React 19 + Vite + TypeScript)+โ โโโ src/+โ โโโ pages/ # Home, Agent, RunDetail, Compare+โ โโโ components/ # chat, charts, layout+โ โโโ stores/ # Zustand state management+โ+โโโ Dockerfile # Multi-stage build+โโโ docker-compose.yml # One-command deploy+โโโ pyproject.toml # Package config + CLI entrypoint+โโโ LICENSE # MIT+```++</details>++---++## ๐ Ecosystem++Vibe-Trading is part of the **[HKUDS](https://github.com/HKUDS)** agent ecosystem:++<table>+ <tr>+ <td align="center" width="25%">+ <a href="https://github.com/HKUDS/ClawTeam"><b>ClawTeam</b></a><br>+ <sub>Agent Swarm Intelligence</sub>+ </td>+ <td align="center" width="25%">+ <a href="https://github.com/HKUDS/nanobot"><b>NanoBot</b></a><br>+ <sub>Ultra-Lightweight Personal AI Assistant</sub>+ </td>+ <td align="center" width="25%">+ <a href="https://github.com/HKUDS/CLI-Anything"><b>CLI-Anything</b></a><br>+ <sub>Making All Software Agent-Native</sub>+ </td>+ <td align="center" width="25%">+ <a href="https://github.com/HKUDS/OpenSpace"><b>OpenSpace</b></a><br>+ <sub>Self-Evolving AI Agent Skills</sub>+ </td>+ </tr>+</table>++---++## Disclaimer++Vibe-Trading is for research, simulation, and backtesting only. It is not investment advice and it does not execute live trades. Past performance does not guarantee future results.++## License++MIT License โ see [LICENSE](LICENSE)++---++<p align="center">+ Thanks for visiting <b>Vibe-Trading</b> โจ+</p>+<p align="center">+ <img src="https://visitor-badge.laobi.icu/badge?page_id=HKUDS.Vibe-Trading&style=flat" alt="visitors"/>+</p>diff --git a/agent/.editorconfig b/agent/.editorconfignew file mode 100644index 000000000..f999431de--- /dev/null+++ b/agent/.editorconfig@@ -0,0 +1,7 @@+root = true++[*]+charset = utf-8+end_of_line = lf+insert_final_newline = true+trim_trailing_whitespace = truediff --git a/agent/.env.example b/agent/.env.examplenew file mode 100644index 000000000..1fc0556e9--- /dev/null+++ b/agent/.env.example@@ -0,0 +1,22 @@+# ============================================================================+# LLM Provider+# ============================================================================+LANGCHAIN_PROVIDER=openrouter+OPENAI_API_KEY=sk-or-v1-your-key-here+OPENAI_BASE_URL=https://openrouter.ai/api/v1+LANGCHAIN_MODEL_NAME=deepseek/deepseek-v3.2+LANGCHAIN_TEMPERATURE=0.0++# ============================================================================+# Data Providers+# ============================================================================+# A-shares: Tushare Pro (requires token, https://tushare.pro)+TUSHARE_TOKEN=your-tushare-token+# HK/US equities: yfinance (free, no key needed)+# Crypto: OKX public API (free, no key needed)++# ============================================================================+# Runtime+# ============================================================================+TIMEOUT_SECONDS=2400+MAX_RETRIES=5diff --git a/agent/.gitignore b/agent/.gitignorenew file mode 100644index 000000000..3971acbd2--- /dev/null+++ b/agent/.gitignore@@ -0,0 +1,9 @@+.venv/+.ui_runtime/+.vscode/+__pycache__/+*.pyc++runs/++.envdiff --git a/agent/SKILL.md b/agent/SKILL.mdnew file mode 100644index 000000000..f81bec7a0--- /dev/null+++ b/agent/SKILL.md@@ -0,0 +1,145 @@+---+name: vibe-trading+description: Professional finance research toolkit โ backtesting, factor analysis, options pricing, 64 finance skills, and 29 multi-agent swarm teams across 3 markets (A-shares, crypto, HK/US equities).+dependencies:+ python: ">=3.11"+ pip:+ - vibe-trading-ai+env:+ - name: TUSHARE_TOKEN+ description: "Tushare API token for China A-share data (optional โ HK/US/crypto work without any key)"+ required: false+ - name: OPENAI_API_KEY+ description: "OpenAI-compatible API key โ only needed for run_swarm (multi-agent teams). All other 15 tools work without it."+ required: false+ - name: LANGCHAIN_MODEL_NAME+ description: "LLM model name for run_swarm (e.g. deepseek/deepseek-v3.2). Only needed if using run_swarm."+ required: false+mcp:+ command: vibe-trading-mcp+ args: []+---++# Vibe-Trading++Professional finance research toolkit with AI-powered backtesting, multi-agent teams, and 64 specialized skills.++## Setup++```bash+pip install vibe-trading-ai+```++> **Package name vs commands:** The PyPI package is `vibe-trading-ai`. Once installed, you get:+>+> | Command | Purpose |+> |---------|---------|+> | `vibe-trading` | Interactive CLI / TUI |+> | `vibe-trading serve` | Launch FastAPI web server |+> | `vibe-trading-mcp` | Start MCP server (for Claude Desktop, OpenClaw, Cursor, etc.) |++Add to your agent's MCP config:++```json+{+ "mcpServers": {+ "vibe-trading": {+ "command": "vibe-trading-mcp"+ }+ }+}+```++### API Key Requirements++**15 of 16 MCP tools work with zero API keys.** After `pip install`, backtesting, market data, factor analysis, options pricing, chart patterns, and all 64 skills are ready to use for HK/US equities and crypto.++| Feature | Key needed | When |+|---------|-----------|------|+| HK/US equities & crypto | None | Always free (yfinance + OKX) |+| China A-share data | `TUSHARE_TOKEN` | Only if you query A-share symbols |+| Multi-agent swarm (`run_swarm`) | `OPENAI_API_KEY` + `LANGCHAIN_MODEL_NAME` | Swarm spawns internal LLM workers |++## What You Can Do++### Backtesting+Create and run quantitative strategies across 3 markets:+- **HK/US equities** via yfinance (free, no API key)+- **Cryptocurrency** via OKX (free, no API key)+- **China A-shares** via Tushare (requires TUSHARE_TOKEN)++Example workflow:+1. Use `list_skills()` to discover strategy patterns+2. Use `load_skill("strategy-generate")` for the strategy creation guide+3. Use `write_file()` to create `config.json` and `code/signal_engine.py`+4. Use `backtest()` to run and get metrics (Sharpe, return, drawdown, etc.)++### Multi-Agent Swarm Teams+29 pre-built agent teams for complex research:+- **Investment Committee**: bull/bear debate โ risk review โ PM decision+- **Global Equities Desk**: A-share + HK/US + crypto โ global strategist+- **Crypto Trading Desk**: funding/basis + liquidation + flow โ risk manager+- **Earnings Research Desk**: fundamentals + revisions + options โ earnings strategist+- **Macro/Rates/FX Desk**: rates + FX + commodities โ macro PM+- **Quant Strategy Desk**: screening โ factor research โ backtest โ risk audit+- **Risk Committee**: drawdown, tail risk, regime analysis+- And 22 more specialized teams++Use `list_swarm_presets()` to see all teams, then `run_swarm()` to execute.++### Finance Skills (64)+Comprehensive knowledge base covering:+- Technical analysis (candlestick, Elliott wave, Ichimoku, SMC)+- Quantitative methods (factor research, ML strategy, pair trading)+- Risk management (VaR/CVaR, stress testing, hedging)+- Options (Black-Scholes, Greeks, multi-leg strategies)+- HK/US equities (SEC filings, earnings revisions, ETF flows, ADR/H-share arbitrage)+- Crypto trading desk (funding rates, liquidation heatmaps, stablecoin flows, token unlocks, DeFi yields)+- Macro analysis, credit research, sector rotation, and more++Use `load_skill(name)` to access full methodology docs with code templates.++## Available MCP Tools (16)++| Tool | Description | API Key |+|------|-------------|---------|+| `list_skills` | List all 64 finance skills | None |+| `load_skill` | Load full skill documentation | None |+| `backtest` | Run vectorized backtest engine | None* |+| `factor_analysis` | IC/IR analysis + layered backtest | None* |+| `analyze_options` | Black-Scholes price + Greeks | None |+| `pattern_recognition` | Detect chart patterns (H&S, double top, etc.) | None |+| `get_market_data` | Fetch OHLCV data across 3 markets (auto-detect source) | None* |+| `read_url` | Fetch web page as Markdown | None |+| `read_document` | Extract text from PDF (with OCR) | None |+| `write_file` | Write files (config, strategy code) | None |+| `read_file` | Read file contents | None |+| `list_swarm_presets` | List multi-agent team presets | None |+| `run_swarm` | Execute a multi-agent research team | LLM key |+| `get_swarm_status` | Poll swarm run status without blocking | None |+| `get_run_result` | Get final report and task summaries | None |+| `list_runs` | List recent swarm runs with metadata | None |++<sub>*A-share symbols require `TUSHARE_TOKEN`. HK/US/crypto are free.</sub>++## Quick Start++```bash+pip install vibe-trading-ai+```++That's it โ no API keys needed for HK/US/crypto markets. Start using `backtest`, `get_market_data`, `analyze_options`, and all 64 skills immediately.++## Examples++**Backtest a MACD strategy on Apple:**+> Backtest AAPL with MACD crossover strategy (fast=12, slow=26, signal=9) for 2024++**Run an investment committee review:**+> Use run_swarm with investment_committee preset to evaluate NVDA. Variables: target=NVDA.US, market=US++**Factor analysis on CSI 300:**+> Run factor_analysis on CSI 300 stocks using pe_ttm factor from 2023 to 2024++**Options analysis:**+> Use analyze_options: spot=100, strike=105, 90 days, vol=25%, rate=3%diff --git a/agent/api_server.py b/agent/api_server.pynew file mode 100644index 000000000..3e64fd42e--- /dev/null+++ b/agent/api_server.py@@ -0,0 +1,993 @@+#!/usr/bin/env python3+"""Vibe-Trading API Server - RESTful API for finance research and backtesting.++V5: ReAct Agent + async /run + CORS env + SSE tool events.+"""++from __future__ import annotations++import asyncio+import json+import os+import signal+import time+import csv+import uuid+from datetime import datetime+from pathlib import Path+from typing import Any, Dict, List, Optional++from fastapi import BackgroundTasks, Depends, FastAPI, HTTPException, Query, Request, Security, UploadFile, status+from fastapi.responses import StreamingResponse+from fastapi.security import HTTPAuthorizationCredentials, HTTPBearer+from pydantic import BaseModel, Field+from fastapi.middleware.cors import CORSMiddleware+from rich.console import Console++from src.ui_services import build_run_analysis, load_run_context++# UTF-8 on Windows+import sys as _sys+for _s in ("stdout", "stderr"):+ _r = getattr(getattr(_sys, _s, None), "reconfigure", None)+ if callable(_r):+ _r(encoding="utf-8", errors="replace")++RUNS_DIR = Path(__file__).resolve().parent / "runs"+SESSIONS_DIR = Path(__file__).resolve().parent / "sessions"+UPLOADS_DIR = Path(__file__).resolve().parent / "uploads"++MAX_UPLOAD_SIZE = 50 * 1024 * 1024 # 50 MB++# Rich console for colored logs+console = Console()+++# ============================================================================+# Pydantic Models+# ============================================================================++class Artifact(BaseModel):+ """Artifact file metadata."""+ name: str = Field(..., description="File name")+ path: str = Field(..., description="File path")+ type: str = Field(..., description="File type: csv, json, txt, etc.")+ size: int = Field(..., description="Size in bytes")+ exists: bool = Field(..., description="Whether the file exists")+++class BacktestMetrics(BaseModel):+ """Backtest summary metrics."""+ model_config = {"extra": "allow"}++ final_value: float = Field(..., description="Ending portfolio value")+ total_return: float = Field(..., description="Total return")+ annual_return: float = Field(..., description="Annualized return")+ max_drawdown: float = Field(..., description="Max drawdown")+ sharpe: float = Field(..., description="Sharpe ratio")+ win_rate: float = Field(..., description="Win rate")+ trade_count: int = Field(..., description="Number of trades")++++class RAGSelection(BaseModel):+ """RAG routing result."""+ selected_api: str = Field(..., description="Selected API code")+ selected_name: str = Field(..., description="Selected API name")+ selected_score: float = Field(..., description="Match score")+++class RunInfo(BaseModel):+ """Compact run row for list views."""+ run_id: str+ status: str+ created_at: str+ prompt: Optional[str] = None+ total_return: Optional[float] = None+ sharpe: Optional[float] = None+ codes: List[str] = Field(default_factory=list)+ start_date: Optional[str] = None+ end_date: Optional[str] = None+++class RunResponse(BaseModel):+ """API response payload for a single run."""++ status: str = Field(..., description="Run status: success, failed, aborted")+ run_id: str = Field(..., description="Run identifier")+ elapsed_seconds: float = Field(..., description="Execution time in seconds")+ reason: Optional[str] = Field(None, description="Failure reason when available")++ planner_output: Optional[Dict[str, Any]] = Field(None, description="Planner output")+ strategy_spec: Optional[Dict[str, Any]] = Field(None, description="Strategy specification")+ rag_selection: Optional[RAGSelection] = Field(None, description="Selected RAG metadata")++ metrics: Optional[BacktestMetrics] = Field(None, description="Backtest metrics")+ artifacts: List[Artifact] = Field(default_factory=list, description="Run artifacts")++ equity_curve: Optional[List[Dict[str, Any]]] = Field(None, description="Equity preview")+ trade_log: Optional[List[Dict[str, Any]]] = Field(None, description="Trade preview")++ artifacts_equity_csv: Optional[List[Dict[str, Any]]] = Field(None, description="Full equity rows")+ artifacts_metrics_csv: Optional[List[Dict[str, Any]]] = Field(None, description="Full metrics rows")+ artifacts_trades_csv: Optional[List[Dict[str, Any]]] = Field(None, description="Full trade rows")++ run_directory: str = Field(..., description="Run directory path")+ run_stage: Optional[str] = Field(None, description="UI-facing run stage")+ run_context: Optional[Dict[str, Any]] = Field(None, description="Normalized request context")+ price_series: Optional[Dict[str, List[Dict[str, Any]]]] = Field(None, description="Grouped OHLC series")+ indicator_series: Optional[Dict[str, Dict[str, List[Dict[str, Any]]]]] = Field(+ None,+ description="Grouped indicator overlays",+ )+ trade_markers: Optional[List[Dict[str, Any]]] = Field(None, description="Trade markers for charts")+ run_logs: Optional[List[Dict[str, Any]]] = Field(None, description="Structured stdout/stderr lines")+++class HealthResponse(BaseModel):+ """Health check payload."""+ status: str = Field(..., description="Service status")+ service: str = Field(..., description="Service name")+ timestamp: str = Field(..., description="Server timestamp")+++# ---- V4 Session Models ----++class CreateSessionRequest(BaseModel):+ """Create session request body."""+ title: str = Field("", description="Session title")+ config: Optional[Dict[str, Any]] = Field(None, description="Session config")+++class SessionResponse(BaseModel):+ """Session record."""+ session_id: str+ title: str+ status: str+ created_at: str+ updated_at: str+ last_attempt_id: Optional[str] = None+++class SendMessageRequest(BaseModel):+ """Send chat message: natural-language strategy description."""+ content: str = Field(..., description="Natural language strategy description", min_length=1, max_length=5000)+++class MessageResponse(BaseModel):+ """Stored chat message."""+ message_id: str+ session_id: str+ role: str+ content: str+ created_at: str+ linked_attempt_id: Optional[str] = None+ metadata: Optional[Dict[str, Any]] = None++++# ============================================================================+# FastAPI Application+# ============================================================================++app = FastAPI(+ title="Vibe-Trading API",+ description="Vibe-Trading API: natural-language finance research, backtesting, and swarm workflows",+ version="5.0.0",+ docs_url="/docs",+ redoc_url="/redoc"+)++# CORS: override with CORS_ORIGINS (comma-separated)+_CORS_ORIGINS = os.getenv(+ "CORS_ORIGINS",+ "http://localhost:3000,http://localhost:5173,http://localhost:8000,"+ "http://127.0.0.1:3000,http://127.0.0.1:5173,http://127.0.0.1:8000",+).split(",")++app.add_middleware(+ CORSMiddleware,+ allow_origins=_CORS_ORIGINS,+ allow_credentials=True,+ allow_methods=["*"],+ allow_headers=["*"],+)+++# ============================================================================+# API Key Authentication+# ============================================================================++_security = HTTPBearer(auto_error=False)+_API_KEY = os.getenv("API_AUTH_KEY")+++async def require_auth(+ cred: HTTPAuthorizationCredentials = Security(_security),+) -> None:+ """Validate Bearer token against API_AUTH_KEY environment variable.++ If API_AUTH_KEY is not set, authentication is skipped (dev mode).+ Only write endpoints (POST/PUT/DELETE/PATCH) use this dependency.++ Args:+ cred: HTTP Bearer credentials extracted from the Authorization header.++ Raises:+ HTTPException: 401 when API_AUTH_KEY is set but the token is missing or wrong.+ """+ if not _API_KEY:+ return+ if not cred or cred.credentials != _API_KEY:+ raise HTTPException(status_code=401, detail="Invalid or missing API key")+++# ============================================================================+# Workflow Factory+# ============================================================================++# ============================================================================+# Helper Functions+# ============================================================================++def _load_json_file(path: Path) -> Optional[Dict[str, Any]]:+ """Load JSON from disk if present."""+ try:+ if path.exists():+ return json.loads(path.read_text(encoding="utf-8"))+ except Exception:+ pass+ return None+++def _load_csv_to_dict(path: Path, limit: Optional[int] = None) -> List[Dict[str, Any]]:+ """Load CSV rows into a list of dictionaries."""+ try:+ if not path.exists():+ return []+ with path.open("r", encoding="utf-8", newline="") as handle:+ rows = [dict(row) for row in csv.DictReader(handle)]+ if limit is not None:+ rows = rows[:limit]+ return rows+ except Exception:+ return []++++def _build_response_from_run_dir(run_dir: Path, elapsed: float, *, include_analysis: bool = False) -> RunResponse:+ """Build a run response from a persisted run directory."""+ run_id = run_dir.name++ response = RunResponse(+ status="unknown",+ run_id=run_id,+ elapsed_seconds=elapsed,+ run_directory=str(run_dir),+ )++ state_data = _load_json_file(run_dir / "state.json")+ if state_data:+ state_status = str(state_data.get("status") or "").lower()+ if state_status == "success":+ response.status = "success"+ elif state_status == "failed":+ response.status = "failed"+ response.reason = state_data.get("reason", "")+ else:+ response.status = state_status or "unknown"+ else:+ response.status = "unknown"++ planner_path = run_dir / "planner_output.json"+ response.planner_output = _load_json_file(planner_path)++ design_path = run_dir / "design_spec.json"+ response.strategy_spec = _load_json_file(design_path)++ rag_path = run_dir / "rag_metadata.json"+ rag_data = _load_json_file(rag_path)+ if rag_data:+ response.rag_selection = RAGSelection(+ selected_api=rag_data.get("selected_api") or rag_data.get("api_code", ""),+ selected_name=rag_data.get("selected_name") or rag_data.get("api_name", ""),+ selected_score=float(rag_data.get("selected_score") or rag_data.get("score", 0.0)),+ )++ metrics_path = run_dir / "artifacts" / "metrics.csv"+ if metrics_path.exists():+ metrics_dict_list = _load_csv_to_dict(metrics_path, limit=1)+ if metrics_dict_list:+ row = metrics_dict_list[0]+ try:+ # Pass ALL CSV columns to BacktestMetrics (extra="allow")+ parsed: dict = {}+ for k, v in row.items():+ if not k or not v:+ continue+ try:+ parsed[k] = int(float(v)) if k == "trade_count" or k == "max_consecutive_loss" else float(v)+ except (ValueError, TypeError):+ continue+ if "final_value" in parsed:+ response.metrics = BacktestMetrics(**parsed)+ except (ValueError, TypeError):+ pass+++ artifacts_dir = run_dir / "artifacts"+ if artifacts_dir.exists():+ for file_path in artifacts_dir.iterdir():+ if file_path.is_file():+ file_type = file_path.suffix.lstrip(".")+ response.artifacts.append(+ Artifact(+ name=file_path.name,+ path=str(file_path),+ type=file_type if file_type else "unknown",+ size=file_path.stat().st_size,+ exists=True,+ )+ )++ equity_path = run_dir / "artifacts" / "equity.csv"+ if equity_path.exists():+ response.artifacts_equity_csv = _load_csv_to_dict(equity_path)++ metrics_csv_path = run_dir / "artifacts" / "metrics.csv"+ if metrics_csv_path.exists():+ response.artifacts_metrics_csv = _load_csv_to_dict(metrics_csv_path)++ trades_path = run_dir / "artifacts" / "trades.csv"+ if trades_path.exists():+ response.artifacts_trades_csv = _load_csv_to_dict(trades_path)++ if response.artifacts_equity_csv:+ filtered_equity = []+ for row in response.artifacts_equity_csv[:1000]:+ filtered_row: Dict[str, Any] = {}+ if "timestamp" in row:+ filtered_row["time"] = row["timestamp"]+ if "equity" in row:+ filtered_row["equity"] = row["equity"]+ if "drawdown" in row:+ filtered_row["drawdown"] = row["drawdown"]+ filtered_equity.append(filtered_row)+ response.equity_curve = filtered_equity++ if response.artifacts_trades_csv:+ response.trade_log = response.artifacts_trades_csv[:500]++ if include_analysis:+ analysis = build_run_analysis(run_dir)+ response.run_stage = analysis.get("run_stage")+ response.run_context = analysis.get("run_context")+ response.price_series = analysis.get("price_series")+ response.indicator_series = analysis.get("indicator_series")+ response.trade_markers = analysis.get("trade_markers")+ response.run_logs = analysis.get("run_logs")++ return response+++# ============================================================================+# API Endpoints+# ============================================================================+[email protected]("/runs/{run_id}/code")+async def get_run_code(run_id: str):+ """Return strategy source files for a run.++ Args:+ run_id: Run identifier.++ Returns:+ Map filename -> source text.+ """+ run_dir = RUNS_DIR / run_id / "code"+ if not run_dir.exists():+ raise HTTPException(status_code=404, detail=f"Code directory for run {run_id} not found")+ result = {}+ for f in ["signal_engine.py"]:+ p = run_dir / f+ if p.exists():+ result[f] = p.read_text(encoding="utf-8")+ return result++[email protected]("/runs/{run_id}", response_model=RunResponse)+async def get_run_result(run_id: str):+ """Fetch full details for a historical run by ``run_id``."""+ run_dir = RUNS_DIR / run_id++ if not run_dir.exists():+ raise HTTPException(+ status_code=status.HTTP_404_NOT_FOUND,+ detail=f"Run {run_id} not found"+ )++ response = _build_response_from_run_dir(run_dir, elapsed=0.0, include_analysis=True)++ return response++[email protected]("/runs", response_model=List[RunInfo])+async def list_runs(limit: int = 20):+ """List recent runs with summary fields."""+ limit = min(max(1, limit), 100)+ runs_dir = RUNS_DIR++ if not runs_dir.exists():+ return []++ run_dirs = sorted(+ [d for d in runs_dir.iterdir() if d.is_dir()],+ key=lambda x: x.name,+ reverse=True+ )++ results = []+ for d in run_dirs[:limit]:+ run_id = d.name++ # Status from state.json or artifacts+ status_val = "unknown"+ state_file = _load_json_file(d / "state.json")+ if state_file:+ status_val = str(state_file.get("status") or "unknown").lower()+ elif (d / "artifacts" / "equity.csv").exists():+ status_val = "success"+ elif (d / "review_report.json").exists():+ status_val = "success"++ # Parse created_at from run_id (YYYYMMDD_HHMMSS or run_YYYYMMDD_HHMMSS)+ created_at = "Unknown"+ if run_id.startswith("run_"):+ parts = run_id.split('_')+ if len(parts) >= 3:+ d_str, t_str = parts[1], parts[2]+ if len(d_str) == 8 and len(t_str) == 6:+ created_at = f"{d_str[:4]}-{d_str[4:6]}-{d_str[6:8]} {t_str[:2]}:{t_str[2:4]}:{t_str[4:6]}"+ elif "_" in run_id:+ parts = run_id.split('_')+ if len(parts) >= 2:+ d_str, t_str = parts[0], parts[1]+ if len(d_str) == 8 and len(t_str) == 6:+ created_at = f"{d_str[:4]}-{d_str[4:6]}-{d_str[6:8]} {t_str[:2]}:{t_str[2:4]}:{t_str[4:6]}"++ if created_at == "Unknown":+ mtime = datetime.fromtimestamp(d.stat().st_mtime)+ created_at = mtime.strftime("%Y-%m-%d %H:%M:%S")++ prompt = None+ req_file = d / "req.json"+ planner_file = d / "planner_output.json"+ if req_file.exists():+ try:+ req_data = json.loads(req_file.read_text(encoding="utf-8"))+ prompt = req_data.get("prompt")+ except: pass++ if not prompt and planner_file.exists():+ try:+ planner_data = json.loads(planner_file.read_text(encoding="utf-8"))+ prompt = planner_data.get("user_goal") or planner_data.get("goal")+ except: pass++ if not prompt:+ prompt_file = d / "user_prompt.txt"+ if prompt_file.exists():+ prompt = prompt_file.read_text(encoding="utf-8").strip()++ total_return = None+ sharpe = None+ metrics_file = d / "artifacts" / "metrics.csv"+ if metrics_file.exists():+ try:+ import csv+ with open(metrics_file, 'r', encoding='utf-8') as f:+ reader = csv.DictReader(f)+ for row in reader:+ total_return = float(row.get('total_return', 0) or 0)+ sharpe = float(row.get('sharpe', 0) or 0)+ break+ except:+ pass++ run_context = load_run_context(d)+ results.append(RunInfo(+ run_id=run_id,+ status=status_val,+ created_at=created_at,+ prompt=prompt or "Manual Analysis",+ total_return=total_return,+ sharpe=sharpe,+ codes=run_context.get("codes") or [],+ start_date=run_context.get("start_date"),+ end_date=run_context.get("end_date"),+ ))++ return results++[email protected]("/health", response_model=HealthResponse)+async def health_check():+ """Liveness probe."""+ return HealthResponse(+ status="healthy",+ service="Vibe-Trading API",+ timestamp=datetime.now().isoformat()+ )+++def _terminate_current_process() -> None:+ """Stop the current API process after the response has been sent."""+ time.sleep(0.25)+ os.kill(os.getpid(), signal.SIGTERM)++[email protected]("/system/shutdown", dependencies=[Depends(require_auth)])+async def shutdown_local_api(background_tasks: BackgroundTasks, request: Request):+ """Shut down the local API server when requested from loopback clients."""+ client_host = request.client.host if request.client else ""+ if client_host not in {"127.0.0.1", "::1", "localhost"}:+ raise HTTPException(status_code=status.HTTP_403_FORBIDDEN, detail="Local access only")++ background_tasks.add_task(_terminate_current_process)+ return {+ "status": "shutting-down",+ "service": "Vibe-Trading API",+ "timestamp": datetime.now().isoformat(),+ }++[email protected]("/skills")+async def list_skills():+ """List registered skills (name and description)."""+ from src.agent.skills import SkillsLoader++ loader = SkillsLoader()+ return [+ {+ "name": s.name,+ "description": s.description,+ }+ for s in loader.skills+ ]++[email protected]("/api")+async def api_info():+ """Service metadata."""+ return {+ "service": "Vibe-Trading API",+ "version": "5.0.0",+ "docs": "/docs",+ "health": "/health",+ }+++# ============================================================================+# Session API+# ============================================================================++_session_service = None+++def _get_session_service():+ """Lazy-init session service when ENABLE_SESSION_RUNTIME=true."""+ global _session_service+ if _session_service is not None:+ return _session_service++ if os.getenv("ENABLE_SESSION_RUNTIME", "true").lower() != "true":+ return None++ import asyncio+ from src.session.store import SessionStore+ from src.session.events import EventBus+ from src.session.service import SessionService++ store = SessionStore(base_dir=SESSIONS_DIR)+ event_bus = EventBus()++ try:+ loop = asyncio.get_event_loop()+ event_bus.set_loop(loop)+ except RuntimeError:+ pass++ _session_service = SessionService(+ store=store,+ event_bus=event_bus,+ runs_dir=RUNS_DIR,+ )+ return _session_service++[email protected]("/sessions", response_model=SessionResponse, status_code=status.HTTP_201_CREATED, dependencies=[Depends(require_auth)])+async def create_session(request: CreateSessionRequest):+ """Create a chat session."""+ svc = _get_session_service()+ if not svc:+ raise HTTPException(status_code=501, detail="Session runtime not enabled")+ session = svc.create_session(title=request.title, config=request.config)+ return SessionResponse(+ session_id=session.session_id,+ title=session.title,+ status=session.status.value,+ created_at=session.created_at,+ updated_at=session.updated_at,+ last_attempt_id=session.last_attempt_id,+ )++[email protected]("/sessions", response_model=List[SessionResponse])+async def list_sessions(limit: int = Query(50, ge=1, le=200)):+ """List sessions."""+ svc = _get_session_service()+ if not svc:+ raise HTTPException(status_code=501, detail="Session runtime not enabled")+ sessions = svc.list_sessions(limit=limit)+ return [+ SessionResponse(+ session_id=s.session_id,+ title=s.title,+ status=s.status.value,+ created_at=s.created_at,+ updated_at=s.updated_at,+ last_attempt_id=s.last_attempt_id,+ )+ for s in sessions+ ]++[email protected]("/sessions/{session_id}", response_model=SessionResponse)+async def get_session(session_id: str):+ """Get one session by id."""+ svc = _get_session_service()+ if not svc:+ raise HTTPException(status_code=501, detail="Session runtime not enabled")+ session = svc.get_session(session_id)+ if not session:+ raise HTTPException(status_code=404, detail=f"Session {session_id} not found")+ return SessionResponse(+ session_id=session.session_id,+ title=session.title,+ status=session.status.value,+ created_at=session.created_at,+ updated_at=session.updated_at,+ last_attempt_id=session.last_attempt_id,+ )++[email protected]("/sessions/{session_id}", dependencies=[Depends(require_auth)])+async def delete_session(session_id: str):+ """Delete a session."""+ svc = _get_session_service()+ if not svc:+ raise HTTPException(status_code=501, detail="Session runtime not enabled")+ deleted = svc.delete_session(session_id)+ if not deleted:+ raise HTTPException(status_code=404, detail=f"Session {session_id} not found")+ return {"status": "deleted", "session_id": session_id}+++class UpdateSessionRequest(BaseModel):+ """Session update fields."""+ title: Optional[str] = None++[email protected]("/sessions/{session_id}", dependencies=[Depends(require_auth)])+async def update_session(session_id: str, req: UpdateSessionRequest):+ """Update session fields (e.g. title)."""+ svc = _get_session_service()+ if not svc:+ raise HTTPException(status_code=501, detail="Session runtime not enabled")+ session = svc.store.get_session(session_id)+ if not session:+ raise HTTPException(status_code=404, detail=f"Session {session_id} not found")+ if req.title is not None:+ session.title = req.title+ from datetime import datetime+ session.updated_at = datetime.now().isoformat()+ svc.store.update_session(session)+ return {"status": "updated", "session_id": session_id}++[email protected]("/sessions/{session_id}/messages", dependencies=[Depends(require_auth)])+async def send_message(session_id: str, request: SendMessageRequest):+ """Send a user message and start the agent loop (natural language strategy)."""+ svc = _get_session_service()+ if not svc:+ raise HTTPException(status_code=501, detail="Session runtime not enabled")+ try:+ result = await svc.send_message(session_id=session_id, content=request.content)+ return result+ except ValueError as exc:+ raise HTTPException(status_code=404, detail=str(exc))++[email protected]("/sessions/{session_id}/cancel", dependencies=[Depends(require_auth)])+async def cancel_session(session_id: str):+ """Cancel the in-flight agent loop for this session."""+ svc = _get_session_service()+ if not svc:+ raise HTTPException(status_code=501, detail="Session runtime not enabled")+ cancelled = svc.cancel_current(session_id)+ if not cancelled:+ return {"status": "no_active_loop"}+ return {"status": "cancelled"}++[email protected]("/sessions/{session_id}/messages", response_model=List[MessageResponse])+async def get_messages(session_id: str, limit: int = Query(100, ge=1, le=1000)):+ """List messages for a session."""+ svc = _get_session_service()+ if not svc:+ raise HTTPException(status_code=501, detail="Session runtime not enabled")+ messages = svc.get_messages(session_id, limit=limit)+ return [+ MessageResponse(+ message_id=m.message_id,+ session_id=m.session_id,+ role=m.role,+ content=m.content,+ created_at=m.created_at,+ linked_attempt_id=m.linked_attempt_id,+ metadata=m.metadata if m.metadata else None,+ )+ for m in messages+ ]++[email protected]("/sessions/{session_id}/events")+async def session_events(+ session_id: str,+ request: Request,+ last_event_id: Optional[str] = Query(None, alias="Last-Event-ID"),+):+ """SSE stream for agent events."""+ svc = _get_session_service()+ if not svc:+ raise HTTPException(status_code=501, detail="Session runtime not enabled")+ session = svc.get_session(session_id)+ if not session:+ raise HTTPException(status_code=404, detail=f"Session {session_id} not found")++ header_id = request.headers.get("Last-Event-ID")+ event_id = header_id or last_event_id++ async def event_generator():+ async for event in svc.event_bus.subscribe(session_id, last_event_id=event_id):+ if await request.is_disconnected():+ break+ yield event.to_sse()++ return StreamingResponse(+ event_generator(),+ media_type="text/event-stream",+ headers={+ "Cache-Control": "no-cache",+ "Connection": "keep-alive",+ "X-Accel-Buffering": "no",+ },+ )+++# ============================================================================+# File Upload+# ============================================================================+[email protected]("/upload", dependencies=[Depends(require_auth)])+async def upload_file(file: UploadFile):+ """Upload a PDF; stored under uploads/ with a UUID name (max 50MB)."""+ if not file.filename or not file.filename.lower().endswith(".pdf"):+ raise HTTPException(status_code=400, detail="Only PDF files are allowed")++ content = await file.read()+ if len(content) > MAX_UPLOAD_SIZE:+ raise HTTPException(+ status_code=413,+ detail=f"File too large (limit {MAX_UPLOAD_SIZE // (1024 * 1024)} MB)",+ )++ UPLOADS_DIR.mkdir(parents=True, exist_ok=True)++ safe_name = f"{uuid.uuid4().hex}.pdf"+ dest = UPLOADS_DIR / safe_name+ dest.write_bytes(content)++ return {+ "status": "ok",+ "file_path": str(dest.resolve()),+ "filename": file.filename,+ }+++# ============================================================================+# Swarm API+# ============================================================================++_swarm_runtime = None+++def _get_swarm_runtime():+ """Lazy-init SwarmRuntime singleton."""+ global _swarm_runtime+ if _swarm_runtime is not None:+ return _swarm_runtime+ from src.swarm.store import SwarmStore+ from src.swarm.runtime import SwarmRuntime+ swarm_dir = Path(__file__).resolve().parent / ".swarm" / "runs"+ store = SwarmStore(base_dir=swarm_dir)+ _swarm_runtime = SwarmRuntime(store=store)+ return _swarm_runtime++[email protected]("/swarm/presets")+async def list_swarm_presets():+ """List Swarm YAML presets."""+ from src.swarm.presets import list_presets+ return list_presets()++[email protected]("/swarm/runs", dependencies=[Depends(require_auth)])+async def create_swarm_run(request: dict):+ """Start a swarm run: body must include preset_name and user_vars."""+ runtime = _get_swarm_runtime()+ preset_name = request.get("preset_name", "")+ user_vars = request.get("user_vars", {})+ try:+ run = runtime.start_run(preset_name, user_vars)+ return {"id": run.id, "status": run.status.value, "preset_name": run.preset_name}+ except FileNotFoundError as e:+ raise HTTPException(status_code=404, detail=str(e))+ except ValueError as e:+ raise HTTPException(status_code=400, detail=str(e))++[email protected]("/swarm/runs")+async def list_swarm_runs(limit: int = Query(20, ge=1, le=100)):+ """List swarm runs (newest first)."""+ runtime = _get_swarm_runtime()+ runs = runtime._store.list_runs(limit=limit)+ return [+ {+ "id": r.id,+ "preset_name": r.preset_name,+ "status": r.status.value,+ "created_at": r.created_at,+ "task_count": len(r.tasks),+ "completed_count": sum(1 for t in r.tasks if t.status.value == "completed"),+ }+ for r in runs+ ]++[email protected]("/swarm/runs/{run_id}")+async def get_swarm_run(run_id: str):+ """Swarm run detail including task statuses."""+ from src.swarm.task_store import TaskStore++ runtime = _get_swarm_runtime()+ run = runtime._store.load_run(run_id)+ if not run:+ raise HTTPException(status_code=404, detail=f"Run {run_id} not found")++ # Merge real-time task statuses from task_store (updated during execution)+ run_dir = runtime._store.run_dir(run_id)+ tasks_dir = run_dir / "tasks"+ if tasks_dir.exists():+ task_store = TaskStore(run_dir)+ live_tasks = task_store.load_all()+ if live_tasks:+ run.tasks = live_tasks++ return {+ "id": run.id,+ "preset_name": run.preset_name,+ "status": run.status.value,+ "user_vars": run.user_vars,+ "agents": [a.model_dump() for a in run.agents],+ "tasks": [t.model_dump() for t in run.tasks],+ "created_at": run.created_at,+ "completed_at": run.completed_at,+ "final_report": run.final_report,+ }++[email protected]("/swarm/runs/{run_id}/events")+async def swarm_run_events(run_id: str, request: Request, last_index: int = Query(0, ge=0)):+ """SSE stream for a swarm run."""+ import asyncio+ runtime = _get_swarm_runtime()++ async def event_stream():+ idx = last_index+ while True:+ if await request.is_disconnected():+ break+ events = runtime._store.read_events(run_id, after_index=idx)+ for evt in events:+ idx += 1+ yield f"id: {idx}\nevent: {evt.type}\ndata: {json.dumps(evt.model_dump(), ensure_ascii=False)}\n\n"+ run = runtime._store.load_run(run_id)+ if run and run.status.value in ("completed", "failed", "cancelled"):+ yield f"event: done\ndata: {{\"status\": \"{run.status.value}\"}}\n\n"+ break+ await asyncio.sleep(2)++ return StreamingResponse(event_stream(), media_type="text/event-stream")++[email protected]("/swarm/runs/{run_id}/cancel", dependencies=[Depends(require_auth)])+async def cancel_swarm_run(run_id: str):+ """Cancel an active swarm run."""+ runtime = _get_swarm_runtime()+ ok = runtime.cancel_run(run_id)+ if not ok:+ raise HTTPException(status_code=404, detail=f"No active run {run_id}")+ return {"status": "cancelled"}+++# ============================================================================+# Main Entry Point+# ============================================================================++def serve_main(argv: list[str] | None = None) -> int:+ """Start the API server from CLI-style arguments."""+ import argparse+ import subprocess+ import uvicorn+ from fastapi.staticfiles import StaticFiles++ parser = argparse.ArgumentParser(description="Vibe-Trading Server")+ parser.add_argument("--port", type=int, default=8000, help="Listen port (default 8000)")+ parser.add_argument("--host", default="0.0.0.0", help="Bind address")+ parser.add_argument("--dev", action="store_true", help="Dev mode: spawn Vite on :5173")+ try:+ args = parser.parse_args(argv)+ except SystemExit as exc:+ return int(exc.code) if isinstance(exc.code, int) else 2++ frontend_dist = Path(__file__).resolve().parent.parent / "frontend" / "dist"+ frontend_root = Path(__file__).resolve().parent.parent / "frontend"++ vite_proc = None+ if args.dev and frontend_root.exists():+ print("[dev] Starting Vite dev server on :5173 ...")+ vite_proc = subprocess.Popen(+ ["npx", "vite", "--host", "0.0.0.0"],+ cwd=str(frontend_root),+ stdout=subprocess.DEVNULL,+ stderr=subprocess.DEVNULL,+ )+ print(f"[dev] Vite PID={vite_proc.pid}")+ print("[dev] Frontend: http://localhost:5173")+ print(f"[dev] API: http://localhost:{args.port}")+ elif frontend_dist.exists():+ if not any(route.path == "/" for route in app.routes):+ app.mount("/", StaticFiles(directory=str(frontend_dist), html=True), name="frontend")+ print(f"[prod] Frontend served from {frontend_dist}")+ else:+ print(f"[warn] No frontend build found at {frontend_dist}")+ print("[warn] Run: cd frontend && npm run build")++ print("=" * 50)+ print(" Vibe-Trading Server")+ print(f" http://127.0.0.1:{args.port}")+ print("=" * 50)++ try:+ uvicorn.run(app, host=args.host, port=args.port, log_level="info")+ finally:+ if vite_proc:+ vite_proc.terminate()+ print("[dev] Vite stopped")+ return 0+++if __name__ == "__main__":+ raise SystemExit(serve_main())+diff --git a/agent/backtest/__init__.py b/agent/backtest/__init__.pynew file mode 100644index 000000000..e69de29bbdiff --git a/agent/backtest/engines/__init__.py b/agent/backtest/engines/__init__.pynew file mode 100644index 000000000..e69de29bbdiff --git a/agent/backtest/engines/daily_portfolio.py b/agent/backtest/engines/daily_portfolio.pynew file mode 100644index 000000000..82174446f--- /dev/null+++ b/agent/backtest/engines/daily_portfolio.py@@ -0,0 +1,461 @@+"""Portfolio-level vectorised backtest engine.++Supports arbitrary bar intervals (1m/5m/15m/30m/1H/4H/1D).+Signal lag: bar-T signal executes at bar T+1 (close-to-close return approx).+Position normalisation: sum(abs(weights)) <= 1.0, no leverage ever.+Commission: deducted as percentage of turnover.+Artifacts: equity.csv, metrics.csv, trades.csv, positions.csv, ohlcv_{code}.csv.+"""++from pathlib import Path+from typing import Any, Callable, Dict, List, Optional++import numpy as np+import pandas as pd+++# โโโ Annualisation factor mapping (auto-inferred from source and interval) โโโ++_TRADING_DAYS = {"tushare": 252, "yfinance": 252, "okx": 365}+_BARS_PER_DAY = {+ "1m": {"tushare": 240, "okx": 1440, "yfinance": 390},+ "5m": {"tushare": 48, "okx": 288, "yfinance": 78},+ "15m": {"tushare": 16, "okx": 96, "yfinance": 26},+ "30m": {"tushare": 8, "okx": 48, "yfinance": 13},+ "1H": {"tushare": 4, "okx": 24, "yfinance": 7},+ "4H": {"tushare": 1, "okx": 6, "yfinance": 2},+ "1D": {"tushare": 1, "okx": 1, "yfinance": 1},+}+++def _calc_bars_per_year(interval: str = "1D", source: str = "tushare") -> int:+ """Calculate the number of bars per year for annualisation.++ Args:+ interval: Bar interval (e.g. 1m, 1H, 1D).+ source: Data source (determines trading days and bars per day).++ Returns:+ Number of bars per year, used for annualised return and Sharpe ratio.+ """+ trading_days = _TRADING_DAYS.get(source, 252)+ bars_per_day = _BARS_PER_DAY.get(interval, {}).get(source, 1)+ return trading_days * bars_per_day+++def _align(+ data_map: Dict[str, pd.DataFrame],+ signal_map: Dict[str, pd.Series],+ codes: List[str],+ optimizer: Optional[Callable] = None,+) -> tuple:+ """Build aligned date index, close matrix, position matrix, and return matrix.++ For multi-market mixes, takes the union of all trading dates and forward-fills gaps.+ Applies signal shift(1), optional optimizer weighting, and normalisation (sum|w|<=1).++ Args:+ data_map: code -> OHLCV DataFrame.+ signal_map: code -> signal Series.+ codes: List of valid instrument codes.+ optimizer: Optional weight optimisation function (ret_df, pos_df, date_idx) -> pos_df.++ Returns:+ (dates, close_df, positions_df, returns_df)+ """+ all_dates = set()+ for c in codes:+ all_dates.update(data_map[c].index)+ dates = pd.DatetimeIndex(sorted(all_dates))++ close = pd.DataFrame(index=dates, columns=codes, dtype=float)+ for c in codes:+ close[c] = data_map[c]["close"].reindex(dates)+ close = close.ffill().bfill()++ pos = pd.DataFrame(0.0, index=dates, columns=codes)+ for c in codes:+ raw = signal_map[c].reindex(dates).fillna(0.0).clip(-1.0, 1.0)+ pos[c] = raw.shift(1).fillna(0.0)++ ret = close.pct_change().fillna(0.0)++ # optimizer weighting (before normalisation)+ if optimizer is not None:+ pos = optimizer(ret, pos, dates)++ scale = pos.abs().sum(axis=1).clip(lower=1.0)+ pos = pos.div(scale, axis=0)++ return dates, close, pos, ret+++def _benchmark_equity(+ ret: pd.DataFrame,+ cash: float,+) -> tuple:+ """Calculate equal-weight buy-and-hold benchmark.++ Args:+ ret: Return matrix.+ cash: Initial capital.++ Returns:+ (bench_ret Series, bench_equity Series)+ """+ n_assets = ret.shape[1]+ bench_ret = ret.mean(axis=1) if n_assets > 0 else pd.Series(0.0, index=ret.index)+ bench_equity = cash * (1 + bench_ret).cumprod()+ return bench_ret, bench_equity+++def _portfolio_equity(+ pos: pd.DataFrame,+ ret: pd.DataFrame,+ commission: float,+ cash: float,+) -> tuple:+ """Portfolio returns -> equity curve -> drawdown.++ Args:+ pos: Position matrix.+ ret: Return matrix.+ commission: Commission rate.+ cash: Initial capital.++ Returns:+ (port_ret Series, equity Series, drawdown Series)+ """+ port_ret = (pos * ret).sum(axis=1)+ turnover = pos.diff().abs().sum(axis=1).fillna(0.0)+ port_ret = port_ret - turnover * commission+ equity = cash * (1 + port_ret).cumprod()+ peak = equity.cummax()+ dd = (equity - peak) / peak.replace(0, 1)+ return port_ret, equity, dd+++def _log_trades(+ pos: pd.DataFrame,+ close: pd.DataFrame,+ codes: List[str],+) -> List[Dict[str, Any]]:+ """Generate per-trade records from position diffs, including per-trade P&L.++ Args:+ pos: Position matrix.+ close: Close price matrix.+ codes: List of instrument codes.++ Returns:+ Trade list sorted by timestamp.+ """+ diff = pos.diff()+ diff.iloc[0] = pos.iloc[0]++ # Track entry cost and entry date per instrument+ cost: Dict[str, float] = {}+ hold: Dict[str, float] = {}+ entry_date: Dict[str, str] = {}++ trades: List[Dict[str, Any]] = []+ # Collect all trade events then sort by timestamp+ raw_events = []+ for c in codes:+ delta = diff[c]+ for ts in delta.index[delta.abs() > 1e-9]:+ d = float(delta.loc[ts])+ p = float(close.at[ts, c]) if pd.notna(close.at[ts, c]) else 0.0+ raw_events.append((str(ts.date()) if hasattr(ts, "date") else str(ts), c, d, p))+ raw_events.sort(key=lambda x: x[0])++ for ts_str, c, d, p in raw_events:+ side = "buy" if d > 0 else "sell"+ qty = abs(d)+ pnl = 0.0+ holding_days = 0+ return_pct = 0.0++ prev = hold.get(c, 0.0)+ if prev * d >= 0:+ # Same-direction add: update average cost+ old = cost.get(c, p)+ total = abs(prev) + qty+ cost[c] = (old * abs(prev) + p * qty) / total if total > 1e-9 else p+ hold[c] = prev + d+ if c not in entry_date:+ entry_date[c] = ts_str+ else:+ # Opposite direction: realise P&L+ close_qty = min(qty, abs(prev))+ entry = cost.get(c, p)+ pnl = (p - entry) * close_qty if prev > 0 else (entry - p) * close_qty+ return_pct = (p / entry - 1) * 100 if entry > 1e-9 and prev > 0 else (entry / p - 1) * 100 if p > 1e-9 else 0.0++ ed = entry_date.get(c, ts_str)+ try:+ holding_days = (pd.Timestamp(ts_str) - pd.Timestamp(ed)).days+ except Exception:+ holding_days = 0++ remain = prev + d+ if abs(remain) < 1e-9:+ hold.pop(c, None)+ cost.pop(c, None)+ entry_date.pop(c, None)+ else:+ hold[c] = remain+ if remain * prev <= 0:+ cost[c] = p+ entry_date[c] = ts_str++ trades.append({+ "timestamp": ts_str,+ "code": c,+ "side": side,+ "price": round(p, 4),+ "qty": round(qty, 6),+ "reason": "signal",+ "pnl": round(pnl, 4),+ "holding_days": holding_days,+ "return_pct": round(return_pct, 2),+ })++ return trades+++def _win_rate_and_stats(trades: List[Dict[str, Any]]) -> Dict[str, float]:+ """Calculate win rate and P&L statistics from trade records.++ Args:+ trades: List of trade records.++ Returns:+ Dict containing win_rate, profit_loss_ratio, max_consecutive_loss, avg_holding_days.+ """+ closed = [t for t in trades if t.get("pnl", 0) != 0]+ if not closed:+ return {"win_rate": 0.0, "profit_loss_ratio": 0.0, "max_consecutive_loss": 0, "avg_holding_days": 0.0}++ wins = [t["pnl"] for t in closed if t["pnl"] > 0]+ losses = [t["pnl"] for t in closed if t["pnl"] < 0]+ win_rate = len(wins) / len(closed) if closed else 0.0++ avg_win = np.mean(wins) if wins else 0.0+ avg_loss = abs(np.mean(losses)) if losses else 1e-10+ profit_loss_ratio = avg_win / avg_loss if avg_loss > 1e-10 else 0.0++ # Max consecutive losses+ max_consec = 0+ cur_consec = 0+ for t in closed:+ if t["pnl"] < 0:+ cur_consec += 1+ max_consec = max(max_consec, cur_consec)+ else:+ cur_consec = 0++ # Average holding days+ hold_days = [t["holding_days"] for t in closed if t["holding_days"] > 0]+ avg_holding = np.mean(hold_days) if hold_days else 0.0++ return {+ "win_rate": win_rate,+ "profit_loss_ratio": round(profit_loss_ratio, 4),+ "max_consecutive_loss": max_consec,+ "avg_holding_days": round(avg_holding, 1),+ }+++def _metrics(+ port_ret: pd.Series,+ equity: pd.Series,+ dd: pd.Series,+ cash: float,+ trades: List[Dict[str, Any]],+ bench_ret: Optional[pd.Series] = None,+ bars_per_year: int = 252,+) -> Dict[str, Any]:+ """Calculate the full set of performance metrics.++ Args:+ port_ret: Portfolio bar return series.+ equity: Equity curve.+ dd: Drawdown series.+ cash: Initial capital.+ trades: Trade records.+ bench_ret: Benchmark return series (optional).+ bars_per_year: Bars per year (252 for daily, 8760 for 1H OKX, etc.).++ Returns:+ Metrics dictionary.+ """+ n = len(port_ret)+ if n == 0:+ return dict(+ final_value=cash, total_return=0, annual_return=0,+ max_drawdown=0, sharpe=0, calmar=0, sortino=0,+ win_rate=0, profit_loss_ratio=0, max_consecutive_loss=0,+ avg_holding_days=0, trade_count=0,+ benchmark_return=0, excess_return=0, information_ratio=0,+ )++ bpy = bars_per_year++ total_ret = float(equity.iloc[-1] / cash - 1)+ ann_ret = float((1 + total_ret) ** (bpy / max(n, 1)) - 1)+ vol = float(port_ret.std())+ sharpe = float(port_ret.mean() / (vol + 1e-10) * np.sqrt(bpy))++ # Calmar = annualised return / |max drawdown|+ max_dd = float(dd.min())+ calmar = ann_ret / abs(max_dd) if abs(max_dd) > 1e-10 else 0.0++ # Sortino = mean(ret) / downside_std * sqrt(bars_per_year) (unchanged)+ downside = port_ret[port_ret < 0]+ downside_std = float(downside.std()) if len(downside) > 1 else 1e-10+ sortino = float(port_ret.mean() / (downside_std + 1e-10) * np.sqrt(bpy))++ # Trade statistics+ trade_stats = _win_rate_and_stats(trades)++ # Benchmark comparison+ bench_return = 0.0+ excess = 0.0+ ir = 0.0+ if bench_ret is not None and len(bench_ret) > 0:+ bench_return = float((1 + bench_ret).prod() - 1)+ excess = total_ret - bench_return+ active_ret = port_ret - bench_ret+ active_std = float(active_ret.std())+ ir = float(active_ret.mean() / (active_std + 1e-10) * np.sqrt(bpy))++ return {+ "final_value": float(equity.iloc[-1]),+ "total_return": total_ret,+ "annual_return": ann_ret,+ "max_drawdown": max_dd,+ "sharpe": sharpe,+ "calmar": round(calmar, 4),+ "sortino": round(sortino, 4),+ "win_rate": trade_stats["win_rate"],+ "profit_loss_ratio": trade_stats["profit_loss_ratio"],+ "max_consecutive_loss": trade_stats["max_consecutive_loss"],+ "avg_holding_days": trade_stats["avg_holding_days"],+ "trade_count": len(trades),+ "benchmark_return": round(bench_return, 6),+ "excess_return": round(excess, 6),+ "information_ratio": round(ir, 4),+ }+++def run_backtest(+ config: Dict[str, Any],+ loader: Any,+ engine: Any,+ run_dir: Path,+ bars_per_year: int = 252,+) -> Dict[str, Any]:+ """Main entry point: load data -> generate signals -> vectorised backtest -> write artifacts.++ Args:+ config: Backtest configuration (codes, start_date, end_date, initial_cash, commission,+ extra_fields, optimizer, interval, source).+ loader: DataLoader instance (must have a fetch method).+ engine: SignalEngine instance (must have a generate method).+ run_dir: Run directory path.+ bars_per_year: Bars per year, computed by runner from interval+source.++ Returns:+ Metrics dictionary.++ Raises:+ SystemExit: When no data is fetched or no valid signals are generated.+ """+ import json+ import sys++ codes = config.get("codes", [])+ start_date = config.get("start_date", "")+ end_date = config.get("end_date", "")+ initial_cash = config.get("initial_cash", 1_000_000)+ commission = config.get("commission", 0.001)+ extra_fields = config.get("extra_fields") or None++ interval = config.get("interval", "1D")+ data_map = loader.fetch(codes, start_date, end_date, fields=extra_fields, interval=interval)+ if not data_map:+ print(json.dumps({"error": "No data fetched"}))+ sys.exit(1)++ signal_map = engine.generate(data_map)+ valid_codes = sorted(c for c in signal_map if c in data_map)+ if not valid_codes:+ print(json.dumps({"error": "No valid signals generated"}))+ sys.exit(1)++ # Load optimizer if configured+ opt_fn = _load_optimizer(config)++ dates, close, pos, ret = _align(data_map, signal_map, valid_codes, optimizer=opt_fn)+ port_ret, equity, dd = _portfolio_equity(pos, ret, commission, initial_cash)+ bench_ret, bench_equity = _benchmark_equity(ret, initial_cash)+ trades = _log_trades(pos, close, valid_codes)+ m = _metrics(port_ret, equity, dd, initial_cash, trades, bench_ret, bars_per_year)++ out = run_dir / "artifacts"+ out.mkdir(parents=True, exist_ok=True)++ for code, df in data_map.items():+ df.to_csv(out / f"ohlcv_{code}.csv")++ eq = pd.DataFrame({+ "ret": port_ret,+ "equity": equity,+ "drawdown": dd,+ "benchmark_equity": bench_equity,+ "active_ret": port_ret - bench_ret,+ }, index=dates)+ eq.index.name = "timestamp"+ eq.to_csv(out / "equity.csv")++ pos.index.name = "timestamp"+ pos.to_csv(out / "positions.csv")++ trade_cols = ["timestamp", "code", "side", "price", "qty", "reason", "pnl", "holding_days", "return_pct"]+ pd.DataFrame(+ trades or [],+ columns=trade_cols,+ ).to_csv(out / "trades.csv", index=False)++ pd.DataFrame([m]).to_csv(out / "metrics.csv", index=False)+ print(json.dumps(m, indent=2))+ return m+++def _load_optimizer(config: Dict[str, Any]) -> Optional[Callable]:+ """Dynamically load an optimizer function from config.++ Supports any module under backtest/optimizers/ that exposes an+ `optimize(ret, pos, dates, **params)` function.++ Args:+ config: Backtest configuration.++ Returns:+ Optimizer callable, or None.+ """+ import importlib++ opt_name = config.get("optimizer")+ if not opt_name:+ return None++ opt_params = config.get("optimizer_params") or {}++ try:+ mod = importlib.import_module(f"backtest.optimizers.{opt_name}")+ return lambda ret, pos, dates: mod.optimize(ret, pos, dates, **opt_params)+ except (ImportError, AttributeError) as e:+ print(f"[WARN] Failed to load optimizer '{opt_name}': {e}, falling back to equal weight")+ return Nonediff --git a/agent/backtest/engines/options_portfolio.py b/agent/backtest/engines/options_portfolio.pynew file mode 100644index 000000000..0aadaee52--- /dev/null+++ b/agent/backtest/engines/options_portfolio.py@@ -0,0 +1,554 @@+"""Options portfolio backtest engine.++European options backtest engine based on Black-Scholes model.+Synthesises theoretical option prices from underlying prices; supports multi-leg strategies.++Signal interface: OptionsSignalEngine.generate(data_map) returns a list of trade instructions.+Artifacts: equity.csv, metrics.csv, trades.csv, greeks.csv.+"""++import json+import sys+from datetime import datetime+from pathlib import Path+from typing import Any, Dict, List, Optional++import numpy as np+import pandas as pd+from scipy.stats import norm+++# --- Black-Scholes pricing ---+++def bs_price(S: float, K: float, T: float, r: float, sigma: float,+ option_type: str = "call") -> float:+ """Black-Scholes European option pricing.++ Args:+ S: Underlying spot price.+ K: Strike price.+ T: Time to expiry in years.+ r: Risk-free rate (annualised).+ sigma: Annualised volatility.+ option_type: Option type, "call" or "put".++ Returns:+ Theoretical option price.++ Example:+ >>> round(bs_price(100, 100, 1.0, 0.05, 0.2, "call"), 2)+ 10.45+ """+ if T <= 0 or sigma <= 0:+ # Expired: return intrinsic value+ if option_type == "call":+ return max(S - K, 0.0)+ return max(K - S, 0.0)++ d1 = (np.log(S / K) + (r + sigma ** 2 / 2) * T) / (sigma * np.sqrt(T))+ d2 = d1 - sigma * np.sqrt(T)++ if option_type == "call":+ return float(S * norm.cdf(d1) - K * np.exp(-r * T) * norm.cdf(d2))+ return float(K * np.exp(-r * T) * norm.cdf(-d2) - S * norm.cdf(-d1))+++# --- Greeks ---+++def bs_greeks(S: float, K: float, T: float, r: float, sigma: float,+ option_type: str = "call") -> Dict[str, float]:+ """Calculate Black-Scholes Greeks.++ Args:+ S: Underlying spot price.+ K: Strike price.+ T: Time to expiry in years.+ r: Risk-free rate (annualised).+ sigma: Annualised volatility.+ option_type: Option type, "call" or "put".++ Returns:+ Dict containing delta, gamma, theta, vega.+ """+ if T <= 0 or sigma <= 0:+ intrinsic_call = 1.0 if S > K else 0.0+ delta = intrinsic_call if option_type == "call" else intrinsic_call - 1.0+ return {"delta": delta, "gamma": 0.0, "theta": 0.0, "vega": 0.0}++ sqrt_T = np.sqrt(T)+ d1 = (np.log(S / K) + (r + sigma ** 2 / 2) * T) / (sigma * sqrt_T)+ d2 = d1 - sigma * sqrt_T+ nd1_pdf = float(norm.pdf(d1))++ # Delta+ if option_type == "call":+ delta = float(norm.cdf(d1))+ else:+ delta = float(norm.cdf(d1) - 1.0)++ # Gamma (same for call and put)+ gamma = float(nd1_pdf / (S * sigma * sqrt_T))++ # Theta (daily)+ theta_common = -(S * nd1_pdf * sigma) / (2 * sqrt_T)+ if option_type == "call":+ theta = theta_common - r * K * np.exp(-r * T) * norm.cdf(d2)+ else:+ theta = theta_common + r * K * np.exp(-r * T) * norm.cdf(-d2)+ theta = float(theta / 365.0) # convert to daily++ # Vega (per 1% change in volatility)+ vega = float(S * nd1_pdf * sqrt_T / 100.0)++ return {"delta": delta, "gamma": gamma, "theta": theta, "vega": vega}+++# --- Historical volatility ---+++def historical_volatility(close: pd.Series, window: int = 30) -> pd.Series:+ """Calculate annualised historical volatility from a close price series.++ Args:+ close: Close price Series.+ window: Rolling window in days.++ Returns:+ Annualised historical volatility Series.+ """+ log_ret = np.log(close / close.shift(1))+ hv = log_ret.rolling(window=window).std() * np.sqrt(252)+ return hv.fillna(hv.dropna().iloc[0] if len(hv.dropna()) > 0 else 0.3)+++# --- Option positions ---+++class OptionPosition:+ """A single option leg position.++ Attributes:+ option_type: "call" or "put".+ strike: Strike price.+ expiry: Expiry date.+ qty: Quantity (positive = long, negative = short).+ entry_price: Theoretical option price at entry.+ entry_date: Entry date string.+ underlying_code: Underlying instrument code.+ """++ def __init__(self, option_type: str, strike: float, expiry: str,+ qty: int, entry_price: float, entry_date: str,+ underlying_code: str):+ self.option_type = option_type+ self.strike = strike+ self.expiry = pd.Timestamp(expiry)+ self.qty = qty+ self.entry_price = entry_price+ self.entry_date = entry_date+ self.underlying_code = underlying_code++ def time_to_expiry(self, current_date: pd.Timestamp) -> float:+ """Calculate time remaining to expiry in years.++ Args:+ current_date: Current date.++ Returns:+ Time to expiry in years.+ """+ days = (self.expiry - current_date).days+ return max(days / 365.0, 0.0)++ def is_expired(self, current_date: pd.Timestamp) -> bool:+ """Check whether the option has expired.++ Args:+ current_date: Current date.++ Returns:+ True if expired.+ """+ return current_date >= self.expiry++ def intrinsic_value(self, spot: float) -> float:+ """Calculate intrinsic value.++ Args:+ spot: Underlying spot price.++ Returns:+ Intrinsic value.+ """+ if self.option_type == "call":+ return max(spot - self.strike, 0.0)+ return max(self.strike - spot, 0.0)+++# --- Backtest driver ---+++def run_options_backtest(+ config: Dict[str, Any],+ loader: Any,+ engine: Any,+ run_dir: Path,+ bars_per_year: int = 252,+) -> Dict[str, Any]:+ """Options backtest entry point.++ Day-by-day simulation:+ 1. Read underlying price for the current day+ 2. Mark all open option positions to market (BS)+ 3. Execute trade instructions from the signal (open/close)+ 4. Automatically exercise ITM options or expire OTM options at maturity+ 5. Record P&L and Greeks++ Args:+ config: Backtest config; must include codes, start_date, end_date, initial_cash,+ and options_config (risk_free_rate, iv_source).+ loader: DataLoader instance (must have a fetch method).+ engine: OptionsSignalEngine instance (generate method returns a list of trade instructions).+ run_dir: Run directory path.+ bars_per_year: Bars per year.++ Returns:+ Metrics dictionary.++ Raises:+ SystemExit: When no data is fetched.+ """+ codes = config.get("codes", [])+ start_date = config.get("start_date", "")+ end_date = config.get("end_date", "")+ initial_cash = config.get("initial_cash", 1_000_000)+ commission = config.get("commission", 0.001)+ options_cfg = config.get("options_config", {})+ risk_free_rate = options_cfg.get("risk_free_rate", 0.05)+ iv_source = options_cfg.get("iv_source", "historical")+ contract_multiplier = options_cfg.get("contract_multiplier", 1.0)++ # Load underlying data+ data_map = loader.fetch(codes, start_date, end_date)+ if not data_map:+ print(json.dumps({"error": "No data fetched"}))+ sys.exit(1)++ # Compute implied volatility (approximated by historical volatility)+ iv_map: Dict[str, pd.Series] = {}+ for code, df in data_map.items():+ iv_map[code] = historical_volatility(df["close"])++ # Generate trade signals+ signals = engine.generate(data_map)++ # Build trading date sequence+ all_dates = set()+ for df in data_map.values():+ all_dates.update(df.index)+ dates = sorted(all_dates)++ # Index signals by date+ signal_by_date: Dict[str, List[Dict[str, Any]]] = {}+ for sig in signals:+ d = sig.get("date", "")+ signal_by_date.setdefault(d, []).append(sig)++ # Day-by-day simulation+ cash = float(initial_cash)+ positions: List[OptionPosition] = []+ trade_records: List[Dict[str, Any]] = []+ greeks_records: List[Dict[str, Any]] = []+ equity_records: List[Dict[str, Any]] = []++ for current_date in dates:+ ts = pd.Timestamp(current_date)+ date_str = str(ts.date()) if hasattr(ts, "date") else str(ts)++ # 1. Get underlying price and IV for the current day+ spot_prices: Dict[str, float] = {}+ ivs: Dict[str, float] = {}+ for code, df in data_map.items():+ if ts in df.index:+ spot_prices[code] = float(df.at[ts, "close"])+ ivs[code] = float(iv_map[code].at[ts]) if ts in iv_map[code].index else 0.3+ else:+ # Use the last available price+ before = df.index[df.index <= ts]+ if len(before) > 0:+ last = before[-1]+ spot_prices[code] = float(df.at[last, "close"])+ ivs[code] = float(iv_map[code].at[last]) if last in iv_map[code].index else 0.3++ # 2. Handle expiry+ expired = [p for p in positions if p.is_expired(ts)]+ for pos in expired:+ spot = spot_prices.get(pos.underlying_code, 0.0)+ intrinsic = pos.intrinsic_value(spot)++ # Expiry: recover intrinsic value (entry_price already deducted at open)+ settlement = intrinsic * pos.qty * contract_multiplier+ cash += settlement+ pnl = (intrinsic - pos.entry_price) * pos.qty * contract_multiplier++ side = "exercise" if intrinsic > 0 else "expire"+ trade_records.append({+ "timestamp": date_str,+ "code": pos.underlying_code,+ "option_type": pos.option_type,+ "strike": pos.strike,+ "expiry": str(pos.expiry.date()),+ "side": side,+ "price": round(intrinsic, 4),+ "qty": pos.qty,+ "pnl": round(pnl, 4),+ "entry_date": pos.entry_date,+ })+ positions.remove(pos)++ # 3. Execute today's signals+ day_signals = signal_by_date.get(date_str, [])+ for sig in day_signals:+ action = sig.get("action", "")+ legs = sig.get("legs", [])+ underlying = sig.get("underlying", codes[0] if codes else "")++ spot = spot_prices.get(underlying, 0.0)+ iv_val = ivs.get(underlying, 0.3)++ for leg in legs:+ leg_type = leg.get("type", "call")+ strike = leg.get("strike", spot)+ expiry = leg.get("expiry", "")+ qty = leg.get("qty", 1)++ expiry_ts = pd.Timestamp(expiry)+ T = max((expiry_ts - ts).days / 365.0, 0.001)++ # Black-Scholes price+ opt_price = bs_price(spot, strike, T, risk_free_rate, iv_val, leg_type)++ if action == "open":+ # Open: long pays premium, short receives premium+ abs_cost = opt_price * abs(qty) * contract_multiplier+ if qty > 0:+ cash -= abs_cost * (1 + commission)+ else:+ cash += abs_cost * (1 - commission)++ positions.append(OptionPosition(+ option_type=leg_type,+ strike=strike,+ expiry=expiry,+ qty=qty,+ entry_price=opt_price,+ entry_date=date_str,+ underlying_code=underlying,+ ))++ trade_records.append({+ "timestamp": date_str,+ "code": underlying,+ "option_type": leg_type,+ "strike": strike,+ "expiry": expiry,+ "side": "buy" if qty > 0 else "sell",+ "price": round(opt_price, 4),+ "qty": qty,+ "pnl": 0.0,+ "entry_date": date_str,+ })++ elif action == "close":+ # Close: find matching position+ matched = _find_matching_position(+ positions, underlying, leg_type, strike, expiry)+ if matched:+ pnl = (opt_price - matched.entry_price) * matched.qty * contract_multiplier+ abs_close = opt_price * abs(matched.qty) * contract_multiplier+ if matched.qty > 0:+ # Long close: sell to recover+ cash += abs_close * (1 - commission)+ else:+ # Short close: buy back+ cash -= abs_close * (1 + commission)++ trade_records.append({+ "timestamp": date_str,+ "code": underlying,+ "option_type": leg_type,+ "strike": strike,+ "expiry": expiry,+ "side": "close",+ "price": round(opt_price, 4),+ "qty": matched.qty,+ "pnl": round(pnl, 4),+ "entry_date": matched.entry_date,+ })+ positions.remove(matched)++ # 4. Compute portfolio mark-to-market value and Greeks+ portfolio_value = cash+ total_delta = 0.0+ total_gamma = 0.0+ total_theta = 0.0+ total_vega = 0.0++ for pos in positions:+ spot = spot_prices.get(pos.underlying_code, 0.0)+ iv_val = ivs.get(pos.underlying_code, 0.3)+ T = pos.time_to_expiry(ts)++ mark_price = bs_price(spot, pos.strike, T, risk_free_rate, iv_val, pos.option_type)+ portfolio_value += mark_price * pos.qty * contract_multiplier++ greeks = bs_greeks(spot, pos.strike, T, risk_free_rate, iv_val, pos.option_type)+ total_delta += greeks["delta"] * pos.qty * contract_multiplier+ total_gamma += greeks["gamma"] * pos.qty * contract_multiplier+ total_theta += greeks["theta"] * pos.qty * contract_multiplier+ total_vega += greeks["vega"] * pos.qty * contract_multiplier++ equity_records.append({+ "timestamp": date_str,+ "equity": round(portfolio_value, 4),+ "cash": round(cash, 4),+ "positions_value": round(portfolio_value - cash, 4),+ })++ greeks_records.append({+ "timestamp": date_str,+ "delta": round(total_delta, 6),+ "gamma": round(total_gamma, 6),+ "theta": round(total_theta, 6),+ "vega": round(total_vega, 6),+ "num_positions": len(positions),+ })++ # Compute metrics+ equity_df = pd.DataFrame(equity_records)+ if equity_df.empty:+ print(json.dumps({"error": "No equity data generated"}))+ sys.exit(1)++ equity_series = equity_df.set_index("timestamp")["equity"]+ metrics = _calc_options_metrics(equity_series, initial_cash, trade_records, bars_per_year)++ # Write artifacts+ out = run_dir / "artifacts"+ out.mkdir(parents=True, exist_ok=True)++ for code, df in data_map.items():+ df.to_csv(out / f"ohlcv_{code}.csv")++ equity_df.to_csv(out / "equity.csv", index=False)++ trade_cols = ["timestamp", "code", "option_type", "strike", "expiry",+ "side", "price", "qty", "pnl", "entry_date"]+ pd.DataFrame(trade_records or [], columns=trade_cols).to_csv(+ out / "trades.csv", index=False)++ pd.DataFrame(greeks_records).to_csv(out / "greeks.csv", index=False)+ pd.DataFrame([metrics]).to_csv(out / "metrics.csv", index=False)++ print(json.dumps(metrics, indent=2))+ return metrics+++# โโโ Helpers โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+++def _find_matching_position(+ positions: List[OptionPosition],+ underlying: str,+ option_type: str,+ strike: float,+ expiry: str,+) -> Optional[OptionPosition]:+ """Find a matching open position.++ Args:+ positions: Current open positions.+ underlying: Underlying instrument code.+ option_type: Option type.+ strike: Strike price.+ expiry: Expiry date string.++ Returns:+ Matching position, or None if not found.+ """+ expiry_ts = pd.Timestamp(expiry)+ for pos in positions:+ if (pos.underlying_code == underlying+ and pos.option_type == option_type+ and abs(pos.strike - strike) < 1e-6+ and pos.expiry == expiry_ts):+ return pos+ return None+++def _calc_options_metrics(+ equity: pd.Series,+ initial_cash: float,+ trades: List[Dict[str, Any]],+ bars_per_year: int = 252,+) -> Dict[str, Any]:+ """Calculate options backtest metrics.++ Args:+ equity: Equity series.+ initial_cash: Initial capital.+ trades: List of trade records.+ bars_per_year: Bars per year.++ Returns:+ Metrics dictionary.+ """+ n = len(equity)+ if n < 2:+ return {+ "final_value": initial_cash, "total_return": 0, "annual_return": 0,+ "max_drawdown": 0, "sharpe": 0, "calmar": 0, "sortino": 0,+ "trade_count": len(trades), "win_rate": 0, "profit_loss_ratio": 0,+ }++ equity_vals = equity.astype(float)+ returns = equity_vals.pct_change().fillna(0.0)++ total_ret = float(equity_vals.iloc[-1] / initial_cash - 1)+ ann_ret = float((1 + total_ret) ** (bars_per_year / max(n, 1)) - 1)++ vol = float(returns.std())+ sharpe = float(returns.mean() / (vol + 1e-10) * np.sqrt(bars_per_year))++ peak = equity_vals.cummax()+ dd = (equity_vals - peak) / peak.replace(0, 1)+ max_dd = float(dd.min())+ calmar = ann_ret / abs(max_dd) if abs(max_dd) > 1e-10 else 0.0++ downside = returns[returns < 0]+ downside_std = float(downside.std()) if len(downside) > 1 else 1e-10+ sortino = float(returns.mean() / (downside_std + 1e-10) * np.sqrt(bars_per_year))++ # Trade statistics+ closed_pnl = [t["pnl"] for t in trades if t.get("pnl", 0) != 0]+ wins = [p for p in closed_pnl if p > 0]+ losses = [p for p in closed_pnl if p < 0]+ win_rate = len(wins) / len(closed_pnl) if closed_pnl else 0.0+ avg_win = np.mean(wins) if wins else 0.0+ avg_loss = abs(np.mean(losses)) if losses else 1e-10+ pl_ratio = avg_win / avg_loss if avg_loss > 1e-10 else 0.0++ return {+ "final_value": round(float(equity_vals.iloc[-1]), 2),+ "total_return": round(total_ret, 6),+ "annual_return": round(ann_ret, 6),+ "max_drawdown": round(max_dd, 6),+ "sharpe": round(sharpe, 4),+ "calmar": round(calmar, 4),+ "sortino": round(sortino, 4),+ "trade_count": len(trades),+ "win_rate": round(win_rate, 4),+ "profit_loss_ratio": round(pl_ratio, 4),+ }diff --git a/agent/backtest/loaders/__init__.py b/agent/backtest/loaders/__init__.pynew file mode 100644index 000000000..e69de29bbdiff --git a/agent/backtest/loaders/okx.py b/agent/backtest/loaders/okx.pynew file mode 100644index 000000000..18c0a1e35--- /dev/null+++ b/agent/backtest/loaders/okx.py@@ -0,0 +1,126 @@+"""OKX spot candle loader (crypto).++Uses OKX V5 public REST API (no auth).+Supports 1m/5m/15m/30m/1H/4H/1D.+Up to 300 bars per request; paginates with ``after`` for longer history.+"""++from typing import Dict, List, Optional++import pandas as pd+import requests++BASE_URL = "https://www.okx.com/api/v5"+_MAX_PER_PAGE = 300+++class DataLoader:+ """OKX crypto OHLCV loader."""++ def __init__(self) -> None:+ """No credentials required for public candles."""+ pass++ def fetch(+ self,+ codes: List[str],+ start_date: str,+ end_date: str,+ fields: Optional[List[str]] = None,+ interval: str = "1D",+ ) -> Dict[str, pd.DataFrame]:+ """Fetch crypto OHLCV via OKX public API.++ Args:+ codes: Symbols like ``["BTC-USDT", "ETH-USDT"]``.+ start_date: Start date (YYYY-MM-DD).+ end_date: End date (YYYY-MM-DD).+ fields: Ignored (OKX has no extra fields).+ interval: Bar size (1m/5m/15m/30m/1H/4H/1D), default ``1D``.++ Returns:+ Mapping symbol -> DataFrame.+ """+ if fields:+ print(f"[WARN] OKX ignores extra fields: {fields}")++ valid_intervals = {"1m", "5m", "15m", "30m", "1H", "4H", "1D"}+ if interval not in valid_intervals:+ print(f"[WARN] unsupported OKX interval {interval}, using 1D")+ interval = "1D"++ codes = [c.replace("/", "-").upper() for c in codes]++ start_ts = int(pd.Timestamp(start_date).timestamp() * 1000)+ end_ts = int((pd.Timestamp(end_date) + pd.Timedelta(days=1)).timestamp() * 1000)++ max_pages = 200 if interval in ("1m", "5m") else 50 if interval in ("15m", "30m") else 20++ result: Dict[str, pd.DataFrame] = {}+ for symbol in codes:+ try:+ df = self._fetch_candles(symbol, start_ts, end_ts, interval, max_pages)+ if df is not None and not df.empty:+ result[symbol] = df+ except Exception as exc:+ print(f"[WARN] failed to fetch {symbol}: {exc}")+ return result++ def _fetch_candles(+ self, inst_id: str, start_ts: int, end_ts: int,+ bar: str = "1D", max_pages: int = 20,+ ) -> Optional[pd.DataFrame]:+ """Paginated candle download.++ Args:+ inst_id: OKX instrument id.+ start_ts: Start time (ms).+ end_ts: End time (ms).+ bar: Bar size.+ max_pages: Max pagination rounds.++ Returns:+ OHLCV DataFrame or None.+ """+ all_rows: list = []+ after = str(end_ts)++ for _ in range(max_pages):+ params = {+ "instId": inst_id,+ "bar": bar,+ "limit": str(_MAX_PER_PAGE),+ "after": after,+ }+ resp = requests.get(f"{BASE_URL}/market/candles", params=params, timeout=15)+ data = resp.json()+ if data.get("code") != "0" or not data.get("data"):+ break++ rows = data["data"]+ rows = [r for r in rows if r[8] == "1"]+ all_rows.extend(rows)++ oldest_ts = int(rows[-1][0]) if rows else start_ts+ if oldest_ts <= start_ts or len(data["data"]) < _MAX_PER_PAGE:+ break+ after = str(oldest_ts)++ if not all_rows:+ print(f"[WARN] OKX empty response: {inst_id}")+ return None++ columns = ["ts", "open", "high", "low", "close", "vol", "volCcy", "volCcyQuote", "confirm"]+ df = pd.DataFrame(all_rows, columns=columns)+ df["trade_date"] = pd.to_datetime(df["ts"].astype("int64"), unit="ms")+ for col in ["open", "high", "low", "close"]:+ df[col] = pd.to_numeric(df[col], errors="coerce")+ df["volume"] = pd.to_numeric(df["vol"], errors="coerce").fillna(0)+ df = df.set_index("trade_date").sort_index()++ start_dt = pd.Timestamp(start_ts, unit="ms")+ end_dt = pd.Timestamp(end_ts, unit="ms")+ df = df[(df.index >= start_dt) & (df.index < end_dt)]++ df = df[["open", "high", "low", "close", "volume"]].dropna(subset=["open", "high", "low", "close"])+ return df if not df.empty else Nonediff --git a/agent/backtest/loaders/tushare.py b/agent/backtest/loaders/tushare.pynew file mode 100644index 000000000..287bdf909--- /dev/null+++ b/agent/backtest/loaders/tushare.py@@ -0,0 +1,164 @@+"""Tushare loader for A-share daily and intraday bars plus optional fundamentals.++Supports ``interval``: 1D (default) / 1m / 5m / 15m / 30m / 1H.+Minute data uses ``pro.stk_mins()`` (Tushare points >= 2000).+"""++import os+from typing import Dict, List, Optional++import pandas as pd+++class DataLoader:+ """Tushare-backed OHLCV loader."""++ def __init__(self) -> None:+ """Initialize Tushare pro API."""+ import tushare as ts++ token = os.getenv("TUSHARE_TOKEN", "")+ self.api = ts.pro_api(token)++ def fetch(+ self,+ codes: List[str],+ start_date: str,+ end_date: str,+ fields: Optional[List[str]] = None,+ interval: str = "1D",+ ) -> Dict[str, pd.DataFrame]:+ """Fetch A-share bars via Tushare API.++ Args:+ codes: Stock codes (e.g. ``000001.SZ``).+ start_date: Start date (YYYY-MM-DD).+ end_date: End date (YYYY-MM-DD).+ fields: Extra fundamental columns (daily only).+ interval: Bar size (1D/1m/5m/15m/30m/1H), default ``1D``.++ Returns:+ Mapping code -> OHLCV DataFrame.+ """+ if interval != "1D":+ return self._fetch_minutes(codes, start_date, end_date, interval)++ sd = start_date.replace("-", "")+ ed = end_date.replace("-", "")+ result: Dict[str, pd.DataFrame] = {}++ for code in codes:+ try:+ df = self.api.daily(ts_code=code, start_date=sd, end_date=ed)+ if df is None or df.empty:+ continue+ df = df.sort_values("trade_date")+ df["trade_date"] = pd.to_datetime(df["trade_date"])+ df = df.set_index("trade_date")+ df = df.rename(columns={"vol": "volume"})+ for col in ["open", "high", "low", "close", "volume"]:+ if col in df.columns:+ df[col] = pd.to_numeric(df[col], errors="coerce")+ ohlcv = df[["open", "high", "low", "close", "volume"]].dropna(+ subset=["open", "high", "low", "close"]+ )+ result[code] = ohlcv+ except Exception as exc:+ print(f"[WARN] failed to fetch {code}: {exc}")++ return self._merge_basic_fields(result, codes, start_date, end_date, fields)++ def _merge_basic_fields(+ self,+ result: Dict[str, pd.DataFrame],+ codes: List[str],+ start_date: str,+ end_date: str,+ fields: Optional[List[str]],+ ) -> Dict[str, pd.DataFrame]:+ """Merge fundamental columns from daily_basic API.++ Args:+ result: Existing OHLCV frames.+ codes: All requested codes.+ start_date: Start date.+ end_date: End date.+ fields: Extra column names from daily_basic.++ Returns:+ Updated result map.+ """+ if not fields:+ return result++ sd = start_date.replace("-", "")+ ed = end_date.replace("-", "")+ active_codes = [c for c in codes if c in result]++ for code in active_codes:+ try:+ basic = self.api.daily_basic(+ ts_code=code,+ start_date=sd,+ end_date=ed,+ fields="ts_code,trade_date," + ",".join(fields),+ )+ if basic is not None and not basic.empty:+ basic["trade_date"] = pd.to_datetime(basic["trade_date"])+ basic = basic.set_index("trade_date").sort_index()+ for f in fields:+ if f in basic.columns:+ result[code][f] = basic[f]+ except Exception as exc:+ print(f"[WARN] daily_basic for {code} failed: {exc}")++ return result++ def _fetch_minutes(+ self,+ codes: List[str],+ start_date: str,+ end_date: str,+ interval: str,+ ) -> Dict[str, pd.DataFrame]:+ """Intraday bars via stk_mins.++ Args:+ codes: Stock codes.+ start_date: Start date (YYYY-MM-DD).+ end_date: End date (YYYY-MM-DD).+ interval: Minute bar (1m/5m/15m/30m/1H).++ Returns:+ Mapping code -> DataFrame.+ """+ freq_map = {"1m": "1min", "5m": "5min", "15m": "15min", "30m": "30min", "1H": "60min"}+ freq = freq_map.get(interval)+ if not freq:+ print(f"[ERROR] unsupported Tushare interval: {interval}")+ return {}++ sd = start_date.replace("-", "")+ ed = end_date.replace("-", "")+ result: Dict[str, pd.DataFrame] = {}++ for code in codes:+ try:+ df = self.api.stk_mins(ts_code=code, freq=freq, start_date=sd, end_date=ed)+ if df is None or df.empty:+ print(f"[WARN] empty Tushare minute data: {code} (points >= 2000 required)")+ continue+ df = df.sort_values("trade_time")+ df["trade_date"] = pd.to_datetime(df["trade_time"])+ df = df.set_index("trade_date")+ df = df.rename(columns={"vol": "volume"})+ for col in ["open", "high", "low", "close", "volume"]:+ if col in df.columns:+ df[col] = pd.to_numeric(df[col], errors="coerce")+ ohlcv = df[["open", "high", "low", "close", "volume"]].dropna(+ subset=["open", "high", "low", "close"]+ )+ result[code] = ohlcv+ except Exception as exc:+ print(f"[WARN] failed to fetch minute data {code}: {exc}")+ return resultdiff --git a/agent/backtest/loaders/yfinance_loader.py b/agent/backtest/loaders/yfinance_loader.pynew file mode 100644index 000000000..9ace4c922--- /dev/null+++ b/agent/backtest/loaders/yfinance_loader.py@@ -0,0 +1,256 @@+"""yfinance-backed loader for HK/US equity OHLCV data."""++from __future__ import annotations++from collections import defaultdict+from typing import Dict, List, Optional, Union++import pandas as pd+import yfinance as yf++_OHLCV_COLUMNS = ["open", "high", "low", "close", "volume"]+_COLUMN_RENAMES = {+ "Open": "open",+ "High": "high",+ "Low": "low",+ "Close": "close",+ "Volume": "volume",+ "open": "open",+ "high": "high",+ "low": "low",+ "close": "close",+ "volume": "volume",+}+_INTERVAL_MAP = {+ "1D": "1d",+ "1H": "1h",+ "4H": "1h",+}+++def _to_yfinance_symbol(code: str) -> str:+ """Convert project symbols into yfinance symbols.++ Args:+ code: Project symbol, for example ``AAPL.US`` or ``700.HK``.++ Returns:+ yfinance-compatible symbol.+ """+ upper = code.strip().upper()+ if upper.endswith(".US"):+ return upper[:-3]+ if upper.endswith(".HK"):+ digits = upper[:-3]+ width = max(4, len(digits))+ return f"{digits.zfill(width)}.HK"+ return upper+++def _to_yfinance_interval(interval: str) -> str:+ """Map project interval strings to yfinance interval strings.++ Args:+ interval: Backtest interval such as ``1D`` or ``5m``.++ Returns:+ yfinance interval string.+ """+ normalized = str(interval or "1D").strip()+ return _INTERVAL_MAP.get(normalized, normalized.lower())+++def _download_history(+ tickers: Union[List[str], str],+ start_date: str,+ end_date: str,+ interval: str,+) -> pd.DataFrame:+ """Download raw historical data via yfinance.++ Args:+ tickers: One or more yfinance symbols.+ start_date: Inclusive start date string.+ end_date: End date string passed directly to yfinance.+ interval: yfinance interval string.++ Returns:+ Raw dataframe from ``yf.download``.+ """+ return yf.download(+ tickers,+ start=start_date,+ end=end_date,+ interval=interval,+ auto_adjust=False,+ progress=False,+ )+++def _flatten_columns(frame: pd.DataFrame, symbol: str) -> pd.DataFrame:+ """Flatten any leftover multi-index columns after symbol selection.++ Args:+ frame: Price dataframe.+ symbol: yfinance symbol used for column cleanup.++ Returns:+ Dataframe with flat string columns.+ """+ if not isinstance(frame.columns, pd.MultiIndex):+ return frame++ cleaned_columns = []+ for column in frame.columns:+ pieces = [str(part) for part in column if str(part) and str(part).upper() != symbol.upper()]+ cleaned_columns.append(pieces[-1] if pieces else str(column[-1]))+ flattened = frame.copy()+ flattened.columns = cleaned_columns+ return flattened+++def _extract_symbol_frame(frame: pd.DataFrame, symbol: str, total_symbols: int) -> pd.DataFrame:+ """Extract a single symbol slice from a raw yfinance dataframe.++ Args:+ frame: Raw dataframe returned by ``yf.download``.+ symbol: yfinance symbol to extract.+ total_symbols: Number of unique symbols requested.++ Returns:+ A single-symbol dataframe or an empty dataframe when unavailable.+ """+ if frame.empty:+ return pd.DataFrame()++ if not isinstance(frame.columns, pd.MultiIndex):+ if total_symbols == 1:+ return frame.copy()+ return pd.DataFrame()++ for level in range(frame.columns.nlevels):+ if symbol in frame.columns.get_level_values(level):+ selected = frame.xs(symbol, axis=1, level=level, drop_level=True)+ return _flatten_columns(selected.copy(), symbol)+ return pd.DataFrame()+++def _normalize_frame(frame: pd.DataFrame, requested_interval: str) -> pd.DataFrame:+ """Normalize raw yfinance data into the backtest OHLCV schema.++ Args:+ frame: Raw or symbol-scoped yfinance dataframe.+ requested_interval: Original backtest interval.++ Returns:+ Normalized OHLCV dataframe indexed by ``trade_date``.+ """+ if frame.empty:+ return pd.DataFrame(columns=_OHLCV_COLUMNS)++ normalized = _flatten_columns(frame.copy(), "")+ normalized = normalized.rename(columns=_COLUMN_RENAMES)++ for column in _OHLCV_COLUMNS:+ if column not in normalized.columns:+ if column == "volume":+ normalized[column] = 0.0+ else:+ return pd.DataFrame(columns=_OHLCV_COLUMNS)++ normalized = normalized.loc[:, _OHLCV_COLUMNS].copy()+ normalized = normalized.apply(pd.to_numeric, errors="coerce")++ index = pd.DatetimeIndex(pd.to_datetime(normalized.index))+ if getattr(index, "tz", None) is not None:+ index = index.tz_localize(None)+ normalized.index = index+ normalized.index.name = "trade_date"+ normalized = normalized.sort_index()+ normalized["volume"] = normalized["volume"].fillna(0.0)+ normalized = normalized.dropna(subset=["open", "high", "low", "close"])++ if requested_interval == "4H" and not normalized.empty:+ normalized = normalized.resample("4h").agg(+ {+ "open": "first",+ "high": "max",+ "low": "min",+ "close": "last",+ "volume": "sum",+ }+ )+ normalized = normalized.dropna(subset=["open", "high", "low", "close"])+ normalized.index.name = "trade_date"++ return normalized+++class DataLoader:+ """Fetch HK/US equity bars from Yahoo Finance via yfinance."""++ def __init__(self) -> None:+ """Initialize the loader.++ yfinance is a free public-data wrapper and does not require credentials.+ """+ pass++ def fetch(+ self,+ codes: List[str],+ start_date: str,+ end_date: str,+ fields: Optional[List[str]] = None,+ interval: str = "1D",+ ) -> Dict[str, pd.DataFrame]:+ """Fetch OHLCV history keyed by the original project symbols.++ Args:+ codes: Project symbols such as ``AAPL.US`` and ``700.HK``.+ start_date: Start date in ``YYYY-MM-DD`` format.+ end_date: End date in ``YYYY-MM-DD`` format.+ fields: Ignored for yfinance; included for interface compatibility.+ interval: Backtest interval such as ``1D`` or ``1H``.++ Returns:+ Mapping of input symbol to normalized OHLCV dataframe.+ """+ del fields+ if not codes:+ return {}++ requested_interval = str(interval or "1D").strip()+ yf_interval = _to_yfinance_interval(requested_interval)++ symbol_groups: Dict[str, List[str]] = defaultdict(list)+ for code in codes:+ symbol_groups[_to_yfinance_symbol(code)].append(code)++ unique_symbols = list(symbol_groups.keys())+ results: Dict[str, pd.DataFrame] = {}++ try:+ bulk_data = _download_history(unique_symbols, start_date, end_date, yf_interval)+ except Exception as exc:+ print(f"[WARN] yfinance bulk download failed for {unique_symbols}: {exc}")+ bulk_data = pd.DataFrame()++ for symbol in unique_symbols:+ try:+ symbol_frame = _extract_symbol_frame(bulk_data, symbol, len(unique_symbols))+ if symbol_frame.empty:+ symbol_frame = _download_history(symbol, start_date, end_date, yf_interval)++ normalized = _normalize_frame(symbol_frame, requested_interval)+ if normalized.empty:+ print(f"[WARN] yfinance returned no usable data for {symbol}")+ continue++ for original_code in symbol_groups[symbol]:+ results[original_code] = normalized.copy()+ except Exception as exc:+ print(f"[WARN] Failed to fetch data for {symbol}: {exc}")+ continue++ return resultsdiff --git a/agent/backtest/optimizers/__init__.py b/agent/backtest/optimizers/__init__.pynew file mode 100644index 000000000..2112e6a78--- /dev/null+++ b/agent/backtest/optimizers/__init__.py@@ -0,0 +1,11 @@+"""Portfolio optimizer package.++Provides four weighting schemes:+- equal_volatility: inverse-volatility weights+- risk_parity: equal risk contribution (Spinu-style)+- mean_variance: max Sharpe via scipy+- max_diversification: maximize diversification ratio++Select via ``optimizer`` in ``config.json``; default is off (1/N).+Add a new optimizer by dropping a module here that exposes ``optimize()``.+"""diff --git a/agent/backtest/optimizers/base.py b/agent/backtest/optimizers/base.pynew file mode 100644index 000000000..bc2e5cbfe--- /dev/null+++ b/agent/backtest/optimizers/base.py@@ -0,0 +1,137 @@+"""Shared base class for portfolio optimizers.++Handles preprocessing, rolling covariance windows, and weight normalization;+subclasses implement ``_calc_weights``.+"""++from abc import ABC, abstractmethod+from typing import Dict, Any, List++import numpy as np+import pandas as pd+++class BaseOptimizer(ABC):+ """Abstract portfolio optimizer.++ Subclasses implement ``_calc_weights``; the base handles:+ - active asset selection+ - rolling window slicing and sanity checks+ - covariance matrix + NaN checks+ - applying weights while preserving signal sign++ Attributes:+ lookback: Lookback days for covariance / mean.+ params: Extra keyword args for subclasses.+ """++ def __init__(self, lookback: int = 60, **kwargs: Any) -> None:+ self.lookback = lookback+ self.params = kwargs++ # ------------------------------------------------------------------+ # Public entry+ # ------------------------------------------------------------------++ def optimize(+ self,+ ret: pd.DataFrame,+ pos: pd.DataFrame,+ dates: pd.DatetimeIndex,+ ) -> pd.DataFrame:+ """Apply optimizer to position weights.++ Args:+ ret: Return matrix (dates x codes).+ pos: Raw signal positions.+ dates: Date index aligned with ``pos``.++ Returns:+ Adjusted position matrix (not dollar-normalized).+ """+ codes = pos.columns.tolist()+ if len(codes) <= 1:+ return pos++ result = pos.copy()+ for i, dt in enumerate(dates):+ active = [c for c in codes if abs(pos.at[dt, c]) > 1e-9]+ if not active or i < self.lookback:+ continue++ window = ret.loc[:dt, active].tail(self.lookback)+ if len(window) < max(self.lookback // 2, 5):+ continue++ ctx = self._build_context(window, active)+ if ctx is None:+ continue++ weights = self._calc_weights(ctx)+ if weights is None or len(weights) != len(active):+ continue++ for j, c in enumerate(active):+ sign = np.sign(pos.at[dt, c])+ result.at[dt, c] = sign * weights[j]++ return result++ # ------------------------------------------------------------------+ # Hooks+ # ------------------------------------------------------------------++ def _build_context(+ self, window: pd.DataFrame, active: List[str]+ ) -> "Dict[str, Any] | None":+ """Build context dict for ``_calc_weights``.++ Default: covariance only. Override to add means, vols, etc.+ Return None to skip the date.++ Args:+ window: Return window for active assets.+ active: Active asset codes.++ Returns:+ Context dict with at least ``cov``, or None.+ """+ cov = window.cov().values+ if np.isnan(cov).any():+ return None+ return {"cov": cov}++ # ------------------------------------------------------------------+ # Subclass API+ # ------------------------------------------------------------------++ @abstractmethod+ def _calc_weights(self, ctx: Dict[str, Any]) -> np.ndarray:+ """Compute target weights from context.++ Args:+ ctx: Dict from ``_build_context``.++ Returns:+ Weight vector (n,) summing to 1.+ """++ # ------------------------------------------------------------------+ # Utilities+ # ------------------------------------------------------------------++ @staticmethod+ def _normalize(w: np.ndarray) -> np.ndarray:+ """Normalize nonnegative weights to sum 1."""+ w = np.maximum(w, 0.0)+ s = w.sum()+ if s > 1e-12:+ return w / s+ return np.ones(len(w)) / len(w)++ @staticmethod+ def _equal_weight(n: int) -> np.ndarray:+ """Equal weights for n assets."""+ if n == 0:+ return np.array([])+ return np.ones(n) / ndiff --git a/agent/backtest/optimizers/equal_volatility.py b/agent/backtest/optimizers/equal_volatility.pynew file mode 100644index 000000000..57423f560--- /dev/null+++ b/agent/backtest/optimizers/equal_volatility.py@@ -0,0 +1,47 @@+"""Equal-volatility (inverse-volatility) weighting.++Higher weight on lower-volatility names so each asset contributes similar vol.+"""++from typing import Any, Dict, List++import numpy as np+import pandas as pd++from backtest.optimizers.base import BaseOptimizer+++class EqualVolatilityOptimizer(BaseOptimizer):+ """Inverse-volatility weights without a full covariance model."""++ def _build_context(+ self, window: pd.DataFrame, active: List[str]+ ) -> "Dict[str, Any] | None":+ """Rolling per-asset volatilities.++ Args:+ window: Return window.+ active: Active codes.++ Returns:+ Context with ``vols`` or None.+ """+ vols = window.std()+ if vols.isna().any() or (vols < 1e-12).any():+ return None+ return {"vols": vols}++ def _calc_weights(self, ctx: Dict[str, Any]) -> np.ndarray:+ """Inverse-volatility weights."""+ inv_vol = 1.0 / ctx["vols"]+ return (inv_vol / inv_vol.sum()).values+++def optimize(+ ret: pd.DataFrame,+ pos: pd.DataFrame,+ dates: pd.DatetimeIndex,+ lookback: int = 60,+) -> pd.DataFrame:+ """Module-level entry: inverse-volatility-adjusted positions."""+ return EqualVolatilityOptimizer(lookback=lookback).optimize(ret, pos, dates)diff --git a/agent/backtest/optimizers/max_diversification.py b/agent/backtest/optimizers/max_diversification.pynew file mode 100644index 000000000..217f768f2--- /dev/null+++ b/agent/backtest/optimizers/max_diversification.py@@ -0,0 +1,58 @@+"""Maximum diversification ratio: maximize (w' sigma) / sqrt(w' Sigma w).++``sigma`` is the vector of asset volatilities; ``Sigma`` is the covariance matrix.+Higher DR means more diversification per unit of risk.+"""++from typing import Any, Dict++import numpy as np+import pandas as pd++from backtest.optimizers.base import BaseOptimizer+++class MaxDiversificationOptimizer(BaseOptimizer):+ """Maximize diversification ratio (Choueifaty & Coignard)."""++ def _calc_weights(self, ctx: Dict[str, Any]) -> np.ndarray:+ """SLSQP max-DR weights."""+ from scipy.optimize import minimize++ cov = ctx["cov"]+ n = cov.shape[0]+ if n == 0:+ return self._equal_weight(0)++ vols = np.sqrt(np.diag(cov))+ if np.any(vols < 1e-12):+ return self._equal_weight(n)++ def neg_dr(w: np.ndarray) -> float:+ port_vol = np.sqrt(w @ cov @ w)+ if port_vol < 1e-12:+ return 0.0+ return -(w @ vols) / port_vol++ result = minimize(+ neg_dr,+ self._equal_weight(n),+ method="SLSQP",+ bounds=[(0.0, 1.0)] * n,+ constraints={"type": "eq", "fun": lambda w: w.sum() - 1.0},+ options={"maxiter": 200, "ftol": 1e-10},+ )++ if result.success:+ return self._normalize(result.x)+ return self._equal_weight(n)+++def optimize(+ ret: pd.DataFrame,+ pos: pd.DataFrame,+ dates: pd.DatetimeIndex,+ lookback: int = 60,+) -> pd.DataFrame:+ """Module-level entry: max-diversification-adjusted positions."""+ return MaxDiversificationOptimizer(lookback=lookback).optimize(ret, pos, dates)diff --git a/agent/backtest/optimizers/mean_variance.py b/agent/backtest/optimizers/mean_variance.pynew file mode 100644index 000000000..a54bb3cf9--- /dev/null+++ b/agent/backtest/optimizers/mean_variance.py@@ -0,0 +1,69 @@+"""Mean-variance (max Sharpe) optimizer: max (w'mu - r_f) / sqrt(w'Sigma w), w>=0, sum(w)=1."""++from typing import Any, Dict, List++import numpy as np+import pandas as pd++from backtest.optimizers.base import BaseOptimizer+++class MeanVarianceOptimizer(BaseOptimizer):+ """Maximize Sharpe ratio subject to long-only simplex."""++ def __init__(self, lookback: int = 60, risk_free: float = 0.0, **kwargs: Any) -> None:+ super().__init__(lookback=lookback, **kwargs)+ self.risk_free = risk_free++ def _build_context(+ self, window: pd.DataFrame, active: List[str]+ ) -> "Dict[str, Any] | None":+ """Mean vector and covariance."""+ mu = window.mean().values+ cov = window.cov().values+ if np.isnan(cov).any() or np.isnan(mu).any():+ return None+ return {"cov": cov, "mu": mu}++ def _calc_weights(self, ctx: Dict[str, Any]) -> np.ndarray:+ """SLSQP max-Sharpe weights."""+ from scipy.optimize import minimize++ mu, cov = ctx["mu"], ctx["cov"]+ n = len(mu)+ if n == 0:+ return self._equal_weight(0)++ rf = self.risk_free++ def neg_sharpe(w: np.ndarray) -> float:+ port_vol = np.sqrt(w @ cov @ w)+ if port_vol < 1e-12:+ return 0.0+ return -(w @ mu - rf) / port_vol++ result = minimize(+ neg_sharpe,+ self._equal_weight(n),+ method="SLSQP",+ bounds=[(0.0, 1.0)] * n,+ constraints={"type": "eq", "fun": lambda w: w.sum() - 1.0},+ options={"maxiter": 200, "ftol": 1e-10},+ )++ if result.success:+ return self._normalize(result.x)+ return self._equal_weight(n)+++def optimize(+ ret: pd.DataFrame,+ pos: pd.DataFrame,+ dates: pd.DatetimeIndex,+ lookback: int = 60,+ risk_free: float = 0.0,+) -> pd.DataFrame:+ """Module-level entry: max-Sharpe-adjusted positions."""+ return MeanVarianceOptimizer(+ lookback=lookback, risk_free=risk_free+ ).optimize(ret, pos, dates)diff --git a/agent/backtest/optimizers/risk_parity.py b/agent/backtest/optimizers/risk_parity.pynew file mode 100644index 000000000..0cf584755--- /dev/null+++ b/agent/backtest/optimizers/risk_parity.py@@ -0,0 +1,51 @@+"""Risk parity: equalize marginal risk contributions.++Iterative refinement so w_i * MRC_i is approximately equal across assets.+"""++from typing import Any, Dict++import numpy as np+import pandas as pd++from backtest.optimizers.base import BaseOptimizer+++class RiskParityOptimizer(BaseOptimizer):+ """Spinu (2013)-style inverse-vol seed + Newton-style refinement."""++ def _calc_weights(self, ctx: Dict[str, Any]) -> np.ndarray:+ """Equal risk contribution weights."""+ cov = ctx["cov"]+ n = cov.shape[0]+ if n == 0:+ return self._equal_weight(0)++ vols = np.sqrt(np.diag(cov))+ if np.any(vols < 1e-12):+ return self._equal_weight(n)++ inv_vol = 1.0 / vols+ w = inv_vol / inv_vol.sum()++ for _ in range(5):+ port_vol = np.sqrt(w @ cov @ w)+ if port_vol < 1e-12:+ break+ mrc = (cov @ w) / port_vol+ rc = w * mrc+ target = port_vol / n+ w = w * (target / (rc + 1e-12))+ w = w / w.sum()++ return w+++def optimize(+ ret: pd.DataFrame,+ pos: pd.DataFrame,+ dates: pd.DatetimeIndex,+ lookback: int = 60,+) -> pd.DataFrame:+ """Module-level entry: risk-parity-adjusted positions."""+ return RiskParityOptimizer(lookback=lookback).optimize(ret, pos, dates)diff --git a/agent/backtest/runner.py b/agent/backtest/runner.pynew file mode 100644index 000000000..7e254d959--- /dev/null+++ b/agent/backtest/runner.py@@ -0,0 +1,261 @@+"""Fixed backtest entrypoint: read config.json, select loader by source, import signal_engine, run engine.++Supports ``source="auto"`` to route codes to loaders by symbol format.+Supports ``interval`` for bar size (1m/5m/15m/30m/1H/4H/1D, default 1D).+Supports ``engine`` for backtest engine (daily/options, default daily).++Usage: ``python -m backtest.runner <run_dir>``+"""++import importlib.util+import json+import re+import sys+from pathlib import Path+from typing import Dict, List+++def _load_module_from_file(file_path: Path, module_name: str):+ """Load a Python module from a file path via importlib.++ Args:+ file_path: Path to the ``.py`` file.+ module_name: Logical module name.++ Returns:+ Loaded module object.+ """+ spec = importlib.util.spec_from_file_location(module_name, file_path)+ module = importlib.util.module_from_spec(spec)+ sys.modules[module_name] = module+ spec.loader.exec_module(module)+ return module+++# --- Market detection ---++_PATTERNS = [+ (re.compile(r"^\d{6}\.(SZ|SH|BJ)$", re.I), "tushare"),+ (re.compile(r"^[A-Z]+\.US$", re.I), "yfinance"),+ (re.compile(r"^\d{3,5}\.HK$", re.I), "yfinance"),+ (re.compile(r"^[A-Z]+-USDT$", re.I), "okx"),+]+++def _detect_source(code: str) -> str:+ """Infer data source from symbol format.++ Args:+ code: Ticker / symbol string.++ Returns:+ Source name (tushare/okx/yfinance); unknown defaults to ``tushare``.+ """+ for pattern, source in _PATTERNS:+ if pattern.match(code):+ return source+ return "tushare"+++def _group_codes_by_source(codes: List[str]) -> Dict[str, List[str]]:+ """Group symbols by inferred source.++ Args:+ codes: List of symbol strings.++ Returns:+ Mapping source -> list of codes.+ """+ groups: Dict[str, List[str]] = {}+ for code in codes:+ src = _detect_source(code)+ groups.setdefault(src, []).append(code)+ return groups+++def _get_loader(source: str):+ """Return the DataLoader class for a source name.++ Args:+ source: Source name.++ Returns:+ DataLoader class.+ """+ if source == "okx":+ from backtest.loaders.okx import DataLoader+ elif source == "yfinance":+ from backtest.loaders.yfinance_loader import DataLoader+ elif source == "tushare":+ from backtest.loaders.tushare import DataLoader+ else:+ from backtest.loaders.tushare import DataLoader+ return DataLoader+++def _normalize_codes(codes: List[str], source: str) -> List[str]:+ """Normalize symbol strings for a source.++ Args:+ codes: Raw code list.+ source: Data source.++ Returns:+ Normalized codes.+ """+ if source == "okx":+ return [c.replace("/", "-").upper() for c in codes]+ return codes+++# --- Main entry ---++def main(run_dir: Path) -> None:+ """Load config, fetch data, run the selected backtest engine.++ With ``source="auto"``, routes each code through the appropriate loader.++ Args:+ run_dir: Run directory containing ``config.json`` and ``code/signal_engine.py``.+ """+ config_path = run_dir / "config.json"+ if not config_path.exists():+ print(json.dumps({"error": "config.json not found"}))+ sys.exit(1)++ config = json.loads(config_path.read_text(encoding="utf-8"))+ source = config.get("source", "tushare")+ codes = config.get("codes", [])++ # Load signal engine+ signal_path = run_dir / "code" / "signal_engine.py"+ if not signal_path.exists():+ print(json.dumps({"error": "code/signal_engine.py not found"}))+ sys.exit(1)++ signal_module = _load_module_from_file(signal_path, "signal_engine")+ engine_cls = getattr(signal_module, "SignalEngine", None)+ if engine_cls is None:+ print(json.dumps({"error": "SignalEngine class not found in signal_engine.py"}))+ sys.exit(1)++ # Data: auto split vs single loader+ interval = config.get("interval", "1D")++ if source == "auto":+ data_map = _fetch_auto(codes, config, interval)+ else:+ codes = _normalize_codes(codes, source)+ config["codes"] = codes+ LoaderCls = _get_loader(source)+ loader = LoaderCls()+ data_map = loader.fetch(+ codes,+ config.get("start_date", ""),+ config.get("end_date", ""),+ fields=config.get("extra_fields") or None,+ interval=interval,+ )+ if not data_map:+ print(json.dumps({"error": "No data fetched"}))+ sys.exit(1)++ # Engine+ engine_type = config.get("engine", "daily")+ run_backtest_fn = _get_engine(engine_type)++ engine = engine_cls()++ # Annualization bars+ effective_source = _detect_primary_source(codes, source)+ from backtest.engines.daily_portfolio import _calc_bars_per_year+ bars_per_year = _calc_bars_per_year(interval, effective_source)++ # Auto mode: wrap preloaded data in a dummy loader+ if source == "auto":+ loader = _AutoLoader(data_map)+ run_backtest_fn(config, loader, engine, run_dir, bars_per_year=bars_per_year)+ else:+ run_backtest_fn(config, loader, engine, run_dir, bars_per_year=bars_per_year)+++def _get_engine(engine_type: str):+ """Resolve ``run_backtest`` / ``run_options_backtest`` by engine name.++ Args:+ engine_type: ``daily`` or ``options``.++ Returns:+ Callable backtest entry.+ """+ if engine_type == "options":+ from backtest.engines.options_portfolio import run_options_backtest+ return run_options_backtest+ else:+ from backtest.engines.daily_portfolio import run_backtest+ return run_backtest+++def _detect_primary_source(codes: List[str], source: str) -> str:+ """Pick primary source for annualization (e.g. bars per year).++ Args:+ codes: All symbols.+ source: Config ``source`` field.++ Returns:+ Dominant source name.+ """+ if source != "auto":+ return source+ groups = _group_codes_by_source(codes)+ if len(groups) == 1:+ return list(groups.keys())[0]+ # Mixed: use the source with the most symbols+ return max(groups, key=lambda s: len(groups[s]))+++def _fetch_auto(codes: List[str], config: dict, interval: str = "1D") -> dict:+ """Auto mode: fetch per source and merge into one data map.++ Args:+ codes: All symbols.+ config: Backtest config dict.+ interval: Bar interval string.++ Returns:+ Merged ``code -> DataFrame`` map.+ """+ groups = _group_codes_by_source(codes)+ merged = {}+ start_date = config.get("start_date", "")+ end_date = config.get("end_date", "")++ for src, src_codes in groups.items():+ src_codes = _normalize_codes(src_codes, src)+ LoaderCls = _get_loader(src)+ loader = LoaderCls()+ # Only tushare supports extra_fields+ fields = config.get("extra_fields") if src == "tushare" else None+ result = loader.fetch(src_codes, start_date, end_date, fields=fields, interval=interval)+ merged.update(result)++ return merged+++class _AutoLoader:+ """Dummy loader for auto mode: returns pre-fetched data maps."""++ def __init__(self, data_map: dict):+ self._data = data_map++ def fetch(self, codes, start_date, end_date, fields=None, interval="1D"):+ """Return preloaded rows for requested codes."""+ return {c: df for c, df in self._data.items() if c in codes}+++if __name__ == "__main__":+ if len(sys.argv) < 2:+ print(f"Usage: python -m backtest.runner <run_dir>")+ sys.exit(1)+ main(Path(sys.argv[1]))diff --git a/agent/cli.py b/agent/cli.pynew file mode 100644index 000000000..0719a9e19--- /dev/null+++ b/agent/cli.py@@ -0,0 +1,1521 @@+#!/usr/bin/env python3+"""Vibe-Trading CLI โ natural-language finance research & backtesting.++Usage:+ vibe-trading Interactive mode (default)+ vibe-trading -p "Backtest AAPL MACD" Single run+ vibe-trading serve --port 8899 Start API server+ vibe-trading chat Interactive mode+ vibe-trading list List runs+ vibe-trading show <run_id> Show run details+"""++from __future__ import annotations++import argparse+import csv+import json+import os+import re+import shutil+import sys+import time+import uuid+from pathlib import Path+from typing import Any, Dict, List, Optional++import warnings+warnings.filterwarnings("ignore", message=".*Importing verbose from langchain.*")+warnings.filterwarnings("ignore", category=DeprecationWarning, module="langchain")++for _s in ("stdout", "stderr"):+ _r = getattr(getattr(sys, _s, None), "reconfigure", None)+ if callable(_r):+ _r(encoding="utf-8", errors="replace")++from rich.console import Console+from rich.panel import Panel+from rich.prompt import Prompt+from rich.syntax import Syntax+from rich.table import Table++console = Console()+AGENT_DIR = Path(__file__).resolve().parent+RUNS_DIR = AGENT_DIR / "runs"+SWARM_DIR = AGENT_DIR / ".swarm" / "runs"+SESSIONS_DIR = AGENT_DIR / "sessions"+UPLOADS_DIR = AGENT_DIR / "uploads"++EXIT_SUCCESS = 0+EXIT_RUN_FAILED = 1+EXIT_USAGE_ERROR = 2+RICH_TAG_PATTERN = re.compile(r"\[/?[^\]]+\]")++_VERSION = "0.1.0"++# Agent color assignments for swarm display+_AGENT_STYLES = ["cyan", "magenta", "green", "yellow", "blue", "bright_red", "bright_cyan", "bright_magenta"]+_agent_color_map: dict[str, str] = {}+++def serve_main(argv: list[str] | None = None) -> int:+ """Delegate server startup to api_server."""+ from api_server import serve_main as api_serve_main++ return api_serve_main(argv)+++def _strip_rich_tags(text: str) -> str:+ """Remove Rich markup from plain-text output."""+ return RICH_TAG_PATTERN.sub("", text)+++def _print_json_result(result: dict) -> None:+ """Print a machine-readable run summary."""+ payload = {+ "status": result.get("status", "unknown"),+ "run_id": result.get("run_id"),+ "run_dir": result.get("run_dir"),+ "reason": result.get("reason"),+ }+ print(json.dumps(payload, ensure_ascii=False))+++def _result_exit_code(result: dict) -> int:+ """Map run results to stable exit codes."""+ return EXIT_SUCCESS if result.get("status") == "success" else EXIT_RUN_FAILED+++def _coerce_exit_code(value: Optional[int]) -> int:+ """Normalize command return values to an integer exit code."""+ return EXIT_SUCCESS if value is None else int(value)+++def _read_prompt_source(+ prompt: Optional[str],+ prompt_file: Optional[Path],+ *,+ no_rich: bool,+ allow_interactive: bool = True,+) -> tuple[Optional[str], Optional[str]]:+ """Resolve prompt text from CLI args, file, stdin, or interactive input."""+ if prompt is not None:+ return prompt.strip(), None++ if prompt_file is not None:+ try:+ return prompt_file.read_text(encoding="utf-8").strip(), None+ except OSError as exc:+ return None, f"Failed to read prompt file: {exc}"++ if not sys.stdin.isatty():+ return sys.stdin.read().strip(), None++ if not allow_interactive:+ return None, "A prompt is required."++ try:+ if no_rich:+ return input("Enter strategy request: ").strip(), None+ return Prompt.ask("Enter strategy request").strip(), None+ except (EOFError, KeyboardInterrupt):+ return None, "Prompt input cancelled."+++# ---------------------------------------------------------------------------+# Helpers+# ---------------------------------------------------------------------------++def _read_json(path: Path) -> dict:+ """Safely read JSON."""+ if not path.exists():+ return {}+ try:+ return json.loads(path.read_text(encoding="utf-8"))+ except (json.JSONDecodeError, OSError):+ return {}+++def _read_metrics(path: Path) -> dict:+ """Read metrics from metrics.csv, return formatted string dict."""+ if not path.exists():+ return {}+ try:+ with path.open(encoding="utf-8") as f:+ rows = list(csv.DictReader(f))+ if not rows:+ return {}+ out = {}+ for k, v in rows[0].items():+ if not v:+ continue+ try:+ fv = float(v)+ out[k] = f"{fv:.4f}" if abs(fv) < 100 else f"{fv:.0f}"+ except ValueError:+ out[k] = v+ return out+ except Exception:+ return {}+++# ---------------------------------------------------------------------------+# Agent execution core+# ---------------------------------------------------------------------------++def _format_tool_call_args(tool: str, args: Dict[str, str]) -> str:+ """Smart-format tool argument summary."""+ if tool == "load_skill":+ return f'("{args.get("name", "")}")'+ if tool in ("write_file", "read_file", "edit_file"):+ return f' {args.get("path", args.get("file_path", ""))}'+ if tool in ("bash", "background_run"):+ cmd = args.get("command", "")[:80]+ return f' [yellow]{cmd}[/yellow]'+ if tool == "subagent":+ desc = args.get("description", args.get("prompt", "")[:60])+ return f' [magenta]{desc}[/magenta]'+ if tool == "task_create":+ return f' "{args.get("subject", "")}"'+ if tool == "task_update":+ return f' #{args.get("task_id", "")} -> {args.get("status", "")}'+ if tool == "check_background":+ tid = args.get("task_id", "")+ return f' {tid}' if tid else ""+ if tool in ("backtest", "compact", "task_list"):+ return ""+ for v in args.values():+ if v and v != "None":+ return f" {v[:60]}"+ return ""+++def _format_tool_result_preview(tool: str, status: str, preview: str) -> str:+ """Smart-format tool result preview."""+ if status != "ok":+ return f"[red]{preview[:80]}[/red]"+ if tool == "backtest":+ sharpe = re.search(r'"sharpe":\s*([\d.eE+-]+)', preview)+ ret = re.search(r'"total_return":\s*([\d.eE+-]+)', preview)+ parts = []+ if sharpe:+ parts.append(f"sharpe={sharpe.group(1)}")+ if ret:+ parts.append(f"return={float(ret.group(1))*100:.1f}%")+ return ", ".join(parts) if parts else ""+ if tool in ("bash", "background_run"):+ if "OK" in preview[:50]:+ return "OK"+ return preview[:60].replace("\n", " ")+ if tool == "subagent":+ m = re.search(r'"summary":\s*"(.{0,80})', preview)+ return m.group(1).rstrip('"') if m else ""+ if tool in ("task_create", "task_update"):+ return preview[:60].replace("\n", " ")+ if tool in ("read_file", "load_skill", "compact"):+ return ""+ return ""+++def _run_agent(+ prompt: str,+ history: Optional[List[Dict]] = None,+ run_dir_override: Optional[str] = None,+ max_iter: int = 50,+ *,+ no_rich: bool = False,+ stream_output: bool = True,+) -> dict:+ """Build AgentLoop and execute, return result dict."""+ from src.tools import build_registry+ from src.providers.chat import ChatLLM+ from src.agent.loop import AgentLoop++ def on_event(event_type: str, data: Dict[str, Any]) -> None:+ if not stream_output:+ return+ if no_rich and event_type == "thinking_done":+ print()+ return+ if no_rich and event_type == "tool_call":+ tool = data.get("tool", "")+ args = data.get("arguments", {})+ args_preview = _format_tool_call_args(tool, args)+ print(f" - {tool}{_strip_rich_tags(args_preview)}", end="")+ return+ if no_rich and event_type == "tool_result":+ tool = data.get("tool", "")+ status = data.get("status", "ok")+ elapsed_ms = data.get("elapsed_ms", 0)+ elapsed_s = elapsed_ms / 1000+ preview = _format_tool_result_preview(tool, status, data.get("preview", ""))+ suffix = f" {preview}" if preview else ""+ mark = "OK" if status == "ok" else "FAIL"+ print(f" {mark} {elapsed_s:.1f}s{_strip_rich_tags(suffix)}")+ return+ if no_rich and event_type == "compact":+ tokens = data.get("tokens_before", "?")+ print(f"\n context compressed ({tokens} tokens -> summary)\n")+ return+ if event_type == "text_delta":+ if no_rich:+ print(data.get("delta", ""), end="")+ else:+ console.print(data.get("delta", ""), end="", style="dim")+ elif event_type == "thinking_done":+ console.print()+ elif event_type == "tool_call":+ tool = data.get("tool", "")+ args = data.get("arguments", {})+ args_preview = _format_tool_call_args(tool, args)+ console.print(f" [cyan]\u25b6 {tool}[/cyan]{args_preview}", end="")+ elif event_type == "tool_result":+ tool = data.get("tool", "")+ status = data.get("status", "ok")+ elapsed_ms = data.get("elapsed_ms", 0)+ elapsed_s = elapsed_ms / 1000+ ok = status == "ok"+ mark = "[green]\u2713[/green]" if ok else "[red]\u2717[/red]"+ preview = _format_tool_result_preview(tool, status, data.get("preview", ""))+ suffix = f" {preview}" if preview else ""+ console.print(f" {mark} [dim]{elapsed_s:.1f}s[/dim]{suffix}")+ elif event_type == "compact":+ tokens = data.get("tokens_before", "?")+ console.print(f"\n [yellow]\u27f3 context compressed[/yellow] [dim]({tokens} tokens \u2192 summary)[/dim]\n")++ agent = AgentLoop(+ registry=build_registry(),+ llm=ChatLLM(),+ event_callback=on_event,+ max_iterations=max_iter,+ )+ if run_dir_override:+ agent.memory.run_dir = run_dir_override++ return agent.run(user_message=prompt, history=history)+++def _print_result(result: dict, elapsed: float, *, no_rich: bool = False) -> None:+ """Print execution result panel."""+ status = result.get("status", "unknown")+ ok = status == "success"+ style = "green" if ok else "red"++ lines = [f"Status: [bold {style}]{status.upper()}[/bold {style}] Time: {elapsed:.1f}s"]++ if result.get("run_id"):+ lines.append(f"ID: {result['run_id']}")++ review = result.get("review")+ if review and review.get("overall_score") is not None:+ check = "\u2713" if review.get("passed") else "\u2717"+ lines.append(f"Review: {review['overall_score']}pts {check}")++ run_dir = result.get("run_dir")+ if run_dir:+ m = _read_metrics(Path(run_dir) / "artifacts" / "metrics.csv")+ parts = [f"{k}={m[k]}" for k in ("total_return", "sharpe", "max_drawdown", "trade_count") if k in m]+ if parts:+ lines.append(f"Metrics: {', '.join(parts)}")++ if result.get("reason"):+ lines.append(f"Reason: {result['reason']}")++ console.print(Panel("\n".join(lines), border_style=style, title="Result"))++ content = result.get("content", "").strip()+ if content:+ console.print(f"\n{content}")+++# ---------------------------------------------------------------------------+# Subcommands+# ---------------------------------------------------------------------------++def cmd_run(prompt: str, max_iter: int, *, json_mode: bool = False, no_rich: bool = False) -> int:+ """Single run."""+ if not json_mode:+ preview = prompt[:120]+ suffix = "..." if len(prompt) > 120 else ""+ if no_rich:+ print(f"Prompt: {preview}{suffix}\n")+ else:+ console.print(f"[dim]Prompt:[/dim] {preview}{suffix}\n")+ start = time.perf_counter()+ try:+ result = _run_agent(prompt, max_iter=max_iter, no_rich=no_rich, stream_output=not json_mode)+ except KeyboardInterrupt:+ if json_mode:+ _print_json_result({"status": "cancelled", "run_id": None, "run_dir": None, "reason": "Interrupted"})+ return EXIT_RUN_FAILED+ if no_rich:+ print("\nInterrupted")+ return EXIT_RUN_FAILED+ console.print("\n[yellow]Interrupted[/yellow]")+ return EXIT_RUN_FAILED+ if json_mode:+ _print_json_result(result)+ return _result_exit_code(result)+ _print_result(result, time.perf_counter() - start, no_rich=no_rich)+ if result.get("run_id"):+ tip = f"--show {result['run_id']} | --continue {result['run_id']} \"...\" | --code {result['run_id']}"+ if no_rich:+ print(tip)+ else:+ console.print(f"[dim]{tip}[/dim]")+ return _result_exit_code(result)+++def _build_history_from_trace(run_dir: Path) -> List[Dict[str, str]]:+ """Build conversation history from trace.jsonl."""+ from src.agent.trace import TraceWriter+ entries = TraceWriter.read(run_dir)+ history: List[Dict[str, str]] = []+ for e in entries:+ if e.get("type") == "start" and e.get("prompt"):+ history.append({"role": "user", "content": e["prompt"]})+ elif e.get("type") == "answer" and e.get("content"):+ history.append({"role": "assistant", "content": e["content"]})+ return history+++def cmd_continue(+ run_id: str,+ prompt: str,+ max_iter: int,+ *,+ json_mode: bool = False,+ no_rich: bool = False,+) -> int:+ """Continue an existing run."""+ run_dir = RUNS_DIR / run_id+ if not run_dir.exists():+ if no_rich:+ print(f"Run {run_id} not found")+ return EXIT_USAGE_ERROR+ console.print(f"[red]Run {run_id} not found[/red]")+ return EXIT_USAGE_ERROR++ history = _build_history_from_trace(run_dir)+ if not json_mode and no_rich:+ print(f"Continue {run_id}: {prompt[:120]}\n")+ if json_mode or no_rich:+ start = time.perf_counter()+ try:+ result = _run_agent(+ prompt,+ history=history,+ run_dir_override=str(run_dir),+ max_iter=max_iter,+ no_rich=no_rich,+ stream_output=not json_mode,+ )+ except KeyboardInterrupt:+ if json_mode:+ _print_json_result(+ {"status": "cancelled", "run_id": run_id, "run_dir": str(run_dir), "reason": "Interrupted"}+ )+ else:+ print("\nInterrupted")+ return EXIT_RUN_FAILED+ if json_mode:+ _print_json_result(result)+ return _result_exit_code(result)+ _print_result(result, time.perf_counter() - start, no_rich=True)+ return _result_exit_code(result)++ console.print(f"[dim]Continue {run_id}:[/dim] {prompt[:120]}\n")+ start = time.perf_counter()+ try:+ result = _run_agent(prompt, history=history, run_dir_override=str(run_dir), max_iter=max_iter)+ except KeyboardInterrupt:+ console.print("\n[yellow]Interrupted[/yellow]")+ return EXIT_RUN_FAILED+ _print_result(result, time.perf_counter() - start)+ return _result_exit_code(result)+++# ---------------------------------------------------------------------------+# Interactive mode (Welcome + Slash commands + Swarm streaming)+# ---------------------------------------------------------------------------++def _print_welcome() -> None:+ """Print the welcome screen."""+ welcome = (+ f"[bold cyan]Vibe-Trading[/bold cyan] [dim]v{_VERSION}[/dim]\n"+ "[dim]Vibe trading with your professional financial agent team[/dim]\n"+ "\n"+ "Type a natural-language request to start, or use [bold]/commands[/bold]:\n"+ "\n"+ " [cyan]/skills[/cyan] List available skills [cyan]/swarm[/cyan] Agent team presets\n"+ " [cyan]/list[/cyan] Recent runs [cyan]/settings[/cyan] Runtime config\n"+ " [cyan]/help[/cyan] All commands [cyan]/quit[/cyan] Exit"+ )+ console.print(Panel(welcome, border_style="cyan", padding=(1, 2)))+++def _print_help() -> None:+ """Print all available slash commands."""+ table = Table(title="Commands", show_lines=False, border_style="dim")+ table.add_column("Command", style="cyan", no_wrap=True)+ table.add_column("Description")++ cmds = [+ ("/help", "Show this help"),+ ("/skills", "List all skills"),+ ("/list", "List recent runs"),+ ("/show <run_id>", "Show run details"),+ ("/code <run_id>", "Show generated code"),+ ("/trace <run_id>", "Replay run trace"),+ ("/continue <run_id> <prompt>", "Continue an existing run"),+ ("/swarm", "List swarm team presets"),+ ("/swarm run <preset> {vars}", "Run a swarm team"),+ ("/swarm list", "List swarm run history"),+ ("/swarm show <run_id>", "Show swarm run details"),+ ("/swarm cancel <run_id>", "Cancel a swarm run"),+ ("/sessions", "List chat sessions"),+ ("/settings", "Show runtime settings"),+ ("/clear", "Clear screen"),+ ("/quit", "Exit"),+ ]+ for cmd, desc in cmds:+ table.add_row(cmd, desc)++ console.print(table)+++def _show_settings() -> None:+ """Show current runtime settings."""+ table = Table(title="Settings", show_lines=False, border_style="dim")+ table.add_column("Key", style="cyan")+ table.add_column("Value")++ settings = {+ "Provider": os.getenv("LANGCHAIN_PROVIDER", "(not set)"),+ "Model": os.getenv("LANGCHAIN_MODEL_NAME", "(not set)"),+ "Temperature": os.getenv("LANGCHAIN_TEMPERATURE", "0.0"),+ "Timeout": os.getenv("TIMEOUT_SECONDS", "2400") + "s",+ "Tushare Token": "***" if os.getenv("TUSHARE_TOKEN") else "(not set)",+ }+ for k, v in settings.items():+ table.add_row(k, v)++ console.print(table)+++def _handle_slash_command(input_str: str, *, max_iter: int) -> None:+ """Parse and route a slash command."""+ parts = input_str.split(maxsplit=1)+ cmd = parts[0].lower()+ arg = parts[1].strip() if len(parts) > 1 else ""++ if cmd == "/help":+ _print_help()+ elif cmd == "/skills":+ cmd_skills()+ elif cmd == "/list":+ cmd_list()+ elif cmd == "/show":+ if arg:+ cmd_show(arg)+ else:+ console.print("[red]Usage: /show <run_id>[/red]")+ elif cmd == "/code":+ if arg:+ cmd_code(arg)+ else:+ console.print("[red]Usage: /code <run_id>[/red]")+ elif cmd == "/trace":+ if arg:+ cmd_trace(arg)+ else:+ console.print("[red]Usage: /trace <run_id>[/red]")+ elif cmd == "/continue":+ cont_parts = arg.split(maxsplit=1)+ if len(cont_parts) >= 2:+ cmd_continue(cont_parts[0], cont_parts[1], max_iter)+ else:+ console.print("[red]Usage: /continue <run_id> <prompt>[/red]")+ elif cmd == "/swarm":+ _handle_swarm_command(arg)+ elif cmd == "/sessions":+ cmd_sessions()+ elif cmd == "/settings":+ _show_settings()+ elif cmd == "/clear":+ console.clear()+ _print_welcome()+ elif cmd in ("/quit", "/exit"):+ raise EOFError+ else:+ console.print(f"[red]Unknown command: {cmd}[/red] โ type [cyan]/help[/cyan] for available commands")+++def _handle_swarm_command(arg: str) -> None:+ """Route swarm sub-commands."""+ if not arg:+ cmd_swarm_presets()+ return++ parts = arg.split(maxsplit=1)+ sub = parts[0].lower()+ sub_arg = parts[1].strip() if len(parts) > 1 else ""++ if sub == "run":+ run_parts = sub_arg.split(maxsplit=1)+ if not run_parts:+ console.print("[red]Usage: /swarm run <preset> [vars_json][/red]")+ return+ preset = run_parts[0]+ vars_json = run_parts[1] if len(run_parts) > 1 else None+ cmd_swarm_run_live(preset, vars_json)+ elif sub == "list":+ cmd_swarm_list()+ elif sub == "show":+ if sub_arg:+ cmd_swarm_show(sub_arg)+ else:+ console.print("[red]Usage: /swarm show <run_id>[/red]")+ elif sub == "cancel":+ if sub_arg:+ cmd_swarm_cancel(sub_arg)+ else:+ console.print("[red]Usage: /swarm cancel <run_id>[/red]")+ else:+ console.print(f"[red]Unknown swarm command: {sub}[/red]")+++def cmd_interactive(max_iter: int) -> None:+ """Interactive mode with welcome screen, slash commands, and agent conversation."""+ _print_welcome()+ history: List[Dict[str, str]] = []++ while True:+ try:+ user_input = Prompt.ask("\n[bold]>[/bold]").strip()+ except (KeyboardInterrupt, EOFError):+ break++ if not user_input:+ continue+ if user_input.lower() in ("q", "quit", "exit"):+ break++ # Slash commands+ if user_input.startswith("/"):+ try:+ _handle_slash_command(user_input, max_iter=max_iter)+ except EOFError:+ break+ continue++ # Natural language -> agent+ start = time.perf_counter()+ try:+ result = _run_agent(user_input, history=history[-6:], max_iter=max_iter)+ except KeyboardInterrupt:+ console.print("\n[yellow]Interrupted[/yellow]")+ continue++ _print_result(result, time.perf_counter() - start)+ history.append({"role": "user", "content": user_input})+ if result.get("content"):+ history.append({"role": "assistant", "content": result["content"]})++ console.print("[dim]Goodbye[/dim]")+++# ---------------------------------------------------------------------------+# Swarm live streaming (Rich Live panel)+# ---------------------------------------------------------------------------++def _get_agent_style(agent_id: str) -> str:+ """Assign a consistent color to each agent."""+ if agent_id not in _agent_color_map:+ idx = len(_agent_color_map) % len(_AGENT_STYLES)+ _agent_color_map[agent_id] = _AGENT_STYLES[idx]+ return _agent_color_map[agent_id]+++class _SwarmDashboard:+ """Track swarm state and render a Rich Live panel."""++ def __init__(self, preset: str, run_id: str) -> None:+ self.preset = preset+ self.run_id = run_id+ self.start_time = time.monotonic()+ self.current_layer = 0+ self.total_layers = 0+ self.agents: Dict[str, Dict[str, Any]] = {}+ self.agent_order: List[str] = []+ self.completed_summaries: List[tuple[str, str]] = []+ self.finished = False+ self.final_status = ""++ def _ensure_agent(self, agent_id: str) -> str:+ """Register an agent by its ID if not already tracked. Return its key."""+ if agent_id in self.agents:+ return agent_id+ self.agents[agent_id] = {+ "name": agent_id, "status": "waiting",+ "tool": "\u2014", "elapsed": 0.0, "iters": 0,+ "started_at": 0.0, "layer": self.current_layer,+ "last_text": "",+ }+ self.agent_order.append(agent_id)+ return agent_id++ def handle_event(self, event) -> None:+ """Process a swarm event and update internal state."""+ agent_id = event.agent_id or ""+ etype = event.type+ data = event.data++ if etype == "layer_started":+ self.current_layer = data.get("layer", 0)+ self.total_layers = max(self.total_layers, self.current_layer + 1)+ return++ if etype == "run_completed":+ self.finished = True+ self.final_status = data.get("status", "unknown")+ return++ if not agent_id:+ return++ key = self._ensure_agent(agent_id)+ agent = self.agents[key]++ if etype == "task_started":+ agent["status"] = "running"+ agent["started_at"] = time.monotonic()+ elif etype == "tool_call":+ agent["tool"] = data.get("tool", "?")+ agent["iters"] += 1+ elif etype == "tool_result":+ agent["elapsed"] = (time.monotonic() - agent["started_at"]) if agent["started_at"] else 0+ tool_name = agent["tool"]+ status_char = "\u2713" if data.get("status", "ok") == "ok" else "\u2717"+ agent["tool"] = f"{tool_name} {status_char}"+ elif etype == "task_completed":+ agent["status"] = "done"+ agent["elapsed"] = (time.monotonic() - agent["started_at"]) if agent["started_at"] else 0+ agent["iters"] = data.get("iterations", agent["iters"])+ summary = data.get("summary", "")+ if summary:+ self.completed_summaries.append((agent["name"], summary))+ elif etype == "task_failed":+ agent["status"] = "failed"+ agent["elapsed"] = (time.monotonic() - agent["started_at"]) if agent["started_at"] else 0+ error = data.get("error", "")[:80]+ self.completed_summaries.append((agent["name"], f"[red]FAILED: {error}[/red]"))+ elif etype == "task_retry":+ attempt = data.get("attempt", "?")+ agent["status"] = "retry"+ agent["tool"] = f"retry {attempt}"+ elif etype == "worker_text":+ content = data.get("content", "").strip()+ if content:+ # Keep last non-empty line for display+ last_line = content.split("\n")[-1].strip()+ if last_line:+ agent["last_text"] = last_line[:60]++ def build_table(self) -> Table:+ """Build the Rich Table for the live panel."""+ elapsed_total = time.monotonic() - self.start_time+ mins, secs = divmod(int(elapsed_total), 60)++ if self.finished:+ color = "green" if self.final_status == "completed" else "red"+ title_status = f"[{color}]{self.final_status.upper()}[/{color}]"+ else:+ title_status = f"[cyan]RUNNING[/cyan]"++ title = f"{self.preset} {title_status} {mins}:{secs:02d}"++ table = Table(+ title=title,+ border_style="cyan" if not self.finished else ("green" if self.final_status == "completed" else "red"),+ show_lines=False,+ pad_edge=True,+ expand=True,+ )+ table.add_column("Agent", style="bold", width=20, no_wrap=True)+ table.add_column("Status", width=12, justify="center")+ table.add_column("Tool", width=14, no_wrap=True)+ table.add_column("Time", width=7, justify="right")+ table.add_column("Iters", width=5, justify="right")+ table.add_column("Output", no_wrap=True, style="dim")++ for agent_key in self.agent_order:+ agent = self.agents[agent_key]+ name = agent["name"]+ style = _get_agent_style(name)+ styled_name = f"[{style}]{name}[/{style}]"++ status = agent["status"]+ if status == "running":+ status_str = "[\u25b6 running]"+ elapsed = time.monotonic() - agent["started_at"] if agent["started_at"] else 0+ elif status == "done":+ status_str = "[green][\u2713 done ][/green]"+ elapsed = agent["elapsed"]+ elif status == "failed":+ status_str = "[red][\u2717 failed][/red]"+ elapsed = agent["elapsed"]+ elif status == "retry":+ status_str = "[yellow][\u21bb retry ][/yellow]"+ elapsed = time.monotonic() - agent["started_at"] if agent["started_at"] else 0+ else:+ status_str = "[dim][\u25cb waiting][/dim]"+ elapsed = 0++ time_str = f"{elapsed:.1f}s" if elapsed > 0 else "\u2014"+ iter_str = str(agent["iters"]) if agent["iters"] > 0 else "\u2014"+ last_text = agent.get("last_text", "")++ table.add_row(styled_name, status_str, agent["tool"], time_str, iter_str, last_text)++ # Progress bar row+ done_count = sum(1 for a in self.agents.values() if a["status"] in ("done", "failed"))+ total_count = len(self.agents) or 1+ pct = int(done_count / total_count * 100)+ bar_width = 40+ filled = int(bar_width * pct / 100)+ bar = "\u2501" * filled + "[dim]" + "\u2501" * (bar_width - filled) + "[/dim]"++ if self.finished:+ bar_color = "green" if self.final_status == "completed" else "red"+ progress_label = f"[{bar_color}]{self.final_status.upper()}[/{bar_color}]"+ else:+ progress_label = f"Layer {self.current_layer}"++ table.add_section()+ table.add_row(+ progress_label,+ f"{bar}",+ f"[bold]{pct}%[/bold]",+ f"{mins}:{secs:02d}",+ "",+ "",+ )++ return table+++def cmd_swarm_run_live(preset: str, vars_json: Optional[str] = None) -> None:+ """Run a swarm preset with Rich Live dashboard."""+ from rich.live import Live+ from src.swarm.runtime import SwarmRuntime+ from src.swarm.store import SwarmStore+ from src.swarm.models import RunStatus++ user_vars: Dict[str, str] = {}+ if vars_json:+ try:+ user_vars = json.loads(vars_json)+ except json.JSONDecodeError as exc:+ console.print(f"[red]Invalid JSON: {exc}[/red]")+ return++ store = SwarmStore(base_dir=SWARM_DIR)+ runtime = SwarmRuntime(store=store)+ _agent_color_map.clear()++ console.print(f"\n[dim]Starting swarm:[/dim] [cyan]{preset}[/cyan]")+ if user_vars:+ console.print(f"[dim]Variables:[/dim] {json.dumps(user_vars, ensure_ascii=False)}")++ dashboard = _SwarmDashboard(preset, "")++ try:+ run = runtime.start_run(preset, user_vars, live_callback=dashboard.handle_event)+ except FileNotFoundError as exc:+ console.print(f"[red]{exc}[/red]")+ return+ except ValueError as exc:+ console.print(f"[red]DAG validation failed: {exc}[/red]")+ return++ dashboard.run_id = run.id++ with Live(dashboard.build_table(), console=console, refresh_per_second=4, transient=False) as live:+ try:+ while True:+ time.sleep(0.25)+ live.update(dashboard.build_table())+ current = store.load_run(run.id)+ if current is None:+ console.print("[red]Run record lost[/red]")+ return+ if current.status in (RunStatus.completed, RunStatus.failed, RunStatus.cancelled):+ dashboard.finished = True+ dashboard.final_status = current.status.value+ live.update(dashboard.build_table())+ break+ except KeyboardInterrupt:+ console.print("\n[yellow]Cancelling...[/yellow]")+ runtime.cancel_run(run.id)+ time.sleep(1)+ current = store.load_run(run.id)++ if current is None:+ return++ # Print completed agent summaries+ for agent_name, summary in dashboard.completed_summaries:+ style = _get_agent_style(agent_name)+ console.print(f"\n[{style}]\u2500\u2500 {agent_name} \u2500\u2500[/{style}]")+ # Truncate to first meaningful chunk+ lines = summary.strip().split("\n")+ preview = "\n".join(lines[:8])+ if len(lines) > 8:+ preview += "\n[dim]...[/dim]"+ console.print(preview)++ # Final report+ status_color = {+ RunStatus.completed: "green",+ RunStatus.failed: "red",+ RunStatus.cancelled: "yellow",+ }.get(current.status, "dim")++ elapsed_total = time.monotonic() - dashboard.start_time+ mins, secs = divmod(int(elapsed_total), 60)++ tokens_in = current.total_input_tokens+ tokens_out = current.total_output_tokens+ token_str = ""+ if tokens_in or tokens_out:+ token_str = f"\nTokens: ~{tokens_in + tokens_out:,} (in: {tokens_in:,} out: {tokens_out:,})"++ if current.final_report:+ console.print(f"\n[bold]\u2500\u2500 Final Report \u2500\u2500[/bold]")+ console.print(current.final_report[:2000])++ console.print(f"\n[{status_color}]{current.status.value.upper()}[/{status_color}] Time: {mins}m {secs}s{token_str}")+++# ---------------------------------------------------------------------------+# Legacy subcommands (used by flags and slash commands)+# ---------------------------------------------------------------------------++def cmd_chat(max_iter: int) -> None:+ """Interactive mode (delegates to cmd_interactive)."""+ cmd_interactive(max_iter)+++def cmd_list(limit: int = 20) -> None:+ """List run history."""+ if not RUNS_DIR.exists():+ console.print("[dim]No runs yet[/dim]")+ return+ dirs = sorted([d for d in RUNS_DIR.iterdir() if d.is_dir()], key=lambda d: d.name, reverse=True)[:limit]+ if not dirs:+ console.print("[dim]No runs yet[/dim]")+ return++ table = Table(show_lines=False)+ table.add_column("Run ID", style="cyan", no_wrap=True)+ table.add_column("Status", width=8)+ table.add_column("Return", width=10)+ table.add_column("Sharpe", width=8)+ table.add_column("Prompt", max_width=40)++ for d in dirs:+ st = _read_json(d / "state.json").get("status", "?")+ m = _read_metrics(d / "artifacts" / "metrics.csv")+ c = "green" if st == "success" else "red" if st == "failed" else "dim"+ table.add_row(d.name, f"[{c}]{st}[/{c}]", m.get("total_return", ""), m.get("sharpe", ""), (_read_json(d / "req.json").get("prompt") or "")[:40])++ console.print(table)+++def cmd_show(run_id: str) -> None:+ """Show run details."""+ run_dir = RUNS_DIR / run_id+ if not run_dir.exists():+ console.print(f"[red]{run_id} not found[/red]")+ return++ state = _read_json(run_dir / "state.json")+ req = _read_json(run_dir / "req.json")+ metrics = _read_metrics(run_dir / "artifacts" / "metrics.csv")++ st = state.get("status", "unknown")+ c = "green" if st == "success" else "red"+ lines = [f"[bold]Status:[/bold] [{c}]{st.upper()}[/{c}]", f"[bold]Prompt:[/bold] {req.get('prompt', '?')}"]++ if metrics:+ lines.append("\n[bold]Metrics:[/bold]")+ lines.extend(f" {k}: {v}" for k, v in metrics.items())++ from src.agent.trace import TraceWriter+ entries = TraceWriter.read(run_dir)+ answers = [e["content"] for e in entries if e.get("type") == "answer" and e.get("content")]+ if answers:+ summary = answers[-1][:200]+ lines.append(f"\n[bold]Answer:[/bold] {summary}{'...' if len(answers[-1]) > 200 else ''}")++ if state.get("reason"):+ lines.append(f"\n[bold]Reason:[/bold] {state['reason']}")++ console.print(Panel("\n".join(lines), border_style=c, title=run_id))+ console.print(f"[dim]{run_dir}[/dim]")+++def cmd_code(run_id: str) -> None:+ """Show generated code."""+ code_dir = RUNS_DIR / run_id / "code"+ if not code_dir.exists():+ console.print(f"[red]{run_id}/code not found[/red]")+ return+ for name in ("signal_engine.py",):+ path = code_dir / name+ if path.exists():+ code = path.read_text(encoding="utf-8")+ console.print(Syntax(code, "python", theme="monokai", line_numbers=True), width=120)+ console.print()+++def cmd_skills() -> None:+ """List available skills."""+ from src.agent.skills import SkillsLoader+ loader = SkillsLoader()++ table = Table(title="Skills", show_lines=False)+ table.add_column("Name", style="cyan")+ table.add_column("Description")++ for s in loader.skills:+ table.add_row(s.name, s.description)++ console.print(table)+++def cmd_trace(run_id: str) -> None:+ """Replay trace.jsonl to show full execution."""+ from datetime import datetime+ from src.agent.trace import TraceWriter++ run_dir = RUNS_DIR / run_id+ if not run_dir.exists():+ console.print(f"[red]{run_id} not found[/red]")+ return++ entries = TraceWriter.read(run_dir)+ if not entries:+ console.print(f"[red]{run_id}/trace.jsonl is empty or missing[/red]")+ return++ console.print(Panel(f"[bold]Trace replay: {run_id}[/bold] ({len(entries)} entries)", border_style="cyan"))++ for entry in entries:+ etype = entry.get("type", "?")+ ts = entry.get("ts", 0)+ ts_str = datetime.fromtimestamp(ts).strftime("%H:%M:%S") if ts else ""+ it = entry.get("iter", "")+ iter_tag = f"[dim]#{it}[/dim] " if it else ""++ if etype == "start":+ console.print(f"\n[bold cyan]{ts_str}[/bold cyan] {iter_tag}[bold]START[/bold] {entry.get('prompt', '')[:120]}")+ elif etype == "thinking":+ content = entry.get("content", "")+ console.print(f"[dim]{ts_str}[/dim] {iter_tag}[dim italic]{content[:200]}[/dim italic]")+ elif etype == "tool_call":+ tool = entry.get("tool", "")+ args = entry.get("args", {})+ args_str = ", ".join(f"{k}={v[:40]}" for k, v in args.items()) if args else ""+ console.print(f"[dim]{ts_str}[/dim] {iter_tag}[cyan]\u25b6 {tool}[/cyan]({args_str})")+ elif etype == "tool_result":+ tool = entry.get("tool", "")+ status = entry.get("status", "ok")+ elapsed = entry.get("elapsed_ms", 0)+ ok = status == "ok"+ mark = "\u2713" if ok else "\u2717"+ color = "green" if ok else "red"+ preview = entry.get("preview", "")[:80]+ console.print(f"[dim]{ts_str}[/dim] {iter_tag}[{color}]{mark} {tool}[/{color}] [dim]{elapsed}ms[/dim] {preview}")+ elif etype == "tool_skipped":+ console.print(f"[dim]{ts_str}[/dim] {iter_tag}[yellow]\u2298 {entry.get('tool', '')} (skipped)[/yellow]")+ elif etype == "answer":+ content = entry.get("content", "")+ console.print(f"\n[dim]{ts_str}[/dim] {iter_tag}[bold green]ANSWER[/bold green]\n{content[:500]}")+ elif etype == "end":+ status = entry.get("status", "?")+ iters = entry.get("iterations", "?")+ color = "green" if status == "success" else "red"+ console.print(f"\n[bold {color}]{ts_str} END[/bold {color}] status={status} iterations={iters}")++ console.print()+++# ---------------------------------------------------------------------------+# Swarm subcommands+# ---------------------------------------------------------------------------++def cmd_swarm_presets() -> None:+ """List available swarm presets."""+ from src.swarm.presets import list_presets++ presets = list_presets()+ if not presets:+ console.print("[dim]No presets available[/dim]")+ return++ table = Table(title="Swarm Presets", show_lines=False)+ table.add_column("Name", style="cyan", no_wrap=True)+ table.add_column("Title")+ table.add_column("Agents", width=8, justify="right")+ table.add_column("Variables")+ table.add_column("Description", max_width=40)++ for p in presets:+ raw_vars = p.get("variables", [])+ var_names = [+ v["name"] if isinstance(v, dict) else str(v) for v in raw_vars+ ]+ vars_str = ", ".join(var_names)+ table.add_row(+ p["name"],+ p.get("title", ""),+ str(p.get("agent_count", 0)),+ vars_str,+ p.get("description", "")[:40],+ )++ console.print(table)+++def cmd_swarm_run(preset: str, vars_json: Optional[str] = None) -> None:+ """Run swarm preset (legacy polling mode, use cmd_swarm_run_live for streaming)."""+ cmd_swarm_run_live(preset, vars_json)+++def cmd_swarm_list() -> None:+ """List swarm run history."""+ from src.swarm.store import SwarmStore++ store = SwarmStore(base_dir=SWARM_DIR)+ runs = store.list_runs()++ if not runs:+ console.print("[dim]No swarm runs yet[/dim]")+ return++ table = Table(title="Swarm Runs", show_lines=False)+ table.add_column("Run ID", style="cyan", no_wrap=True)+ table.add_column("Preset")+ table.add_column("Status", width=12)+ table.add_column("Tasks", width=6, justify="right")+ table.add_column("Created", width=20)++ for run in runs:+ sc = {+ "completed": "green",+ "failed": "red",+ "cancelled": "yellow",+ "running": "blue",+ }.get(run.status.value, "dim")+ table.add_row(+ run.id,+ run.preset_name,+ f"[{sc}]{run.status.value}[/{sc}]",+ str(len(run.tasks)),+ run.created_at[:19],+ )++ console.print(table)+++def cmd_swarm_show(run_id: str) -> None:+ """Show swarm run details."""+ from src.swarm.store import SwarmStore+ from src.swarm.models import TaskStatus++ store = SwarmStore(base_dir=SWARM_DIR)+ run = store.load_run(run_id)++ if run is None:+ console.print(f"[red]Swarm run {run_id} not found[/red]")+ return++ status_color = {+ "completed": "green",+ "failed": "red",+ "cancelled": "yellow",+ "running": "blue",+ }.get(run.status.value, "dim")++ lines = [+ f"[bold]Status:[/bold] [{status_color}]{run.status.value.upper()}[/{status_color}]",+ f"[bold]Preset:[/bold] {run.preset_name}",+ f"[bold]Created:[/bold] {run.created_at}",+ ]+ if run.completed_at:+ lines.append(f"[bold]Completed:[/bold] {run.completed_at}")+ if run.user_vars:+ lines.append(f"[bold]Variables:[/bold] {json.dumps(run.user_vars, ensure_ascii=False)}")++ tokens_in = run.total_input_tokens+ tokens_out = run.total_output_tokens+ if tokens_in or tokens_out:+ lines.append(f"[bold]Tokens:[/bold] ~{tokens_in + tokens_out:,} (in: {tokens_in:,} out: {tokens_out:,})")++ lines.append(f"\n[bold]Tasks ({len(run.tasks)}):[/bold]")+ for task in run.tasks:+ tc = "green" if task.status == TaskStatus.completed else "red" if task.status == TaskStatus.failed else "dim"+ dep_str = f" (deps: {', '.join(task.depends_on)})" if task.depends_on else ""+ task_line = f" [{tc}]{task.id}[/{tc}] -> {task.agent_id}{dep_str} [{task.status.value}]"+ lines.append(task_line)+ if task.summary:+ lines.append(f" {task.summary[:100]}")+ if task.error:+ lines.append(f" [red]{task.error[:100]}[/red]")++ if run.final_report:+ lines.append(f"\n[bold]Final Report:[/bold]\n{run.final_report[:800]}")++ console.print(Panel("\n".join(lines), border_style=status_color, title=run_id))+++def cmd_swarm_cancel(run_id: str) -> None:+ """Cancel a swarm run."""+ from src.swarm.runtime import SwarmRuntime+ from src.swarm.store import SwarmStore++ store = SwarmStore(base_dir=SWARM_DIR)+ runtime = SwarmRuntime(store=store)++ if runtime.cancel_run(run_id):+ console.print(f"[yellow]Cancel signal sent: {run_id}[/yellow]")+ else:+ console.print(f"[red]Run {run_id} not found or already finished[/red]")+++# ---------------------------------------------------------------------------+# Session subcommands+# ---------------------------------------------------------------------------++def cmd_sessions() -> None:+ """List chat sessions."""+ from src.session.store import SessionStore++ store = SessionStore(base_dir=SESSIONS_DIR)+ sessions = store.list_sessions()++ if not sessions:+ console.print("[dim]No sessions yet[/dim]")+ return++ table = Table(title="Sessions", show_lines=False)+ table.add_column("Session ID", style="cyan", no_wrap=True)+ table.add_column("Title", max_width=30)+ table.add_column("Status", width=10)+ table.add_column("Messages", width=8, justify="right")+ table.add_column("Updated", width=20)++ for s in sessions:+ messages = store.get_messages(s.session_id)+ sc = "green" if s.status.value == "active" else "dim"+ table.add_row(+ s.session_id,+ s.title or "[dim]untitled[/dim]",+ f"[{sc}]{s.status.value}[/{sc}]",+ str(len(messages)),+ s.updated_at[:19],+ )++ console.print(table)+++def cmd_session_chat(session_id: str, max_iter: int) -> None:+ """Continue a session chat."""+ from src.session.store import SessionStore++ store = SessionStore(base_dir=SESSIONS_DIR)+ session = store.get_session(session_id)++ if session is None:+ console.print(f"[red]Session {session_id} not found[/red]")+ return++ messages = store.get_messages(session_id)+ history: List[Dict[str, str]] = []+ for msg in messages:+ if msg.role in ("user", "assistant") and msg.content.strip():+ history.append({"role": msg.role, "content": msg.content})++ console.print(Panel(+ f"[bold cyan]Session: {session.title or session_id}[/bold cyan]\n"+ f"[dim]History: {len(messages)} messages | Type q to exit[/dim]",+ border_style="cyan",+ ))++ while True:+ try:+ prompt = Prompt.ask("\n[bold]>[/bold]").strip()+ except (KeyboardInterrupt, EOFError):+ break+ if not prompt or prompt.lower() in ("q", "quit", "exit"):+ break++ start = time.perf_counter()+ try:+ result = _run_agent(prompt, history=history[-6:], max_iter=max_iter)+ except KeyboardInterrupt:+ console.print("\n[yellow]Interrupted[/yellow]")+ continue++ _print_result(result, time.perf_counter() - start)+ history.append({"role": "user", "content": prompt})+ if result.get("content"):+ history.append({"role": "assistant", "content": result["content"]})++ console.print("[dim]Goodbye[/dim]")+++# ---------------------------------------------------------------------------+# Upload subcommand+# ---------------------------------------------------------------------------++def cmd_upload(file_path: str) -> None:+ """Upload a file to the server."""+ src = Path(file_path)+ if not src.exists():+ console.print(f"[red]File not found: {file_path}[/red]")+ return+ if not src.is_file():+ console.print(f"[red]Not a file: {file_path}[/red]")+ return++ UPLOADS_DIR.mkdir(parents=True, exist_ok=True)+ ext = src.suffix+ dest_name = f"{uuid.uuid4().hex[:12]}{ext}"+ dest = UPLOADS_DIR / dest_name++ shutil.copy2(str(src), str(dest))+ console.print(f"[green]Uploaded:[/green] {dest}")+++# ---------------------------------------------------------------------------+# CLI entrypoint+# ---------------------------------------------------------------------------++def _build_parser() -> argparse.ArgumentParser:+ """Build the CLI parser with subcommands and compatibility flags."""+ parser = argparse.ArgumentParser(description="Vibe-Trading CLI")+ parser.add_argument("-p", "--prompt", type=str, help="Prompt text")+ parser.add_argument("-f", "--prompt-file", type=Path, help="Read prompt text from a file")+ parser.add_argument("--json", action="store_true", help="Print machine-readable JSON output")+ parser.add_argument("--no-rich", action="store_true", help="Disable Rich formatting")+ parser.add_argument("--chat", action="store_true", help="Interactive chat mode")+ parser.add_argument("--continue", dest="cont", nargs=2, metavar=("RUN_ID", "PROMPT"), help="Continue a run")+ parser.add_argument("--list", action="store_true", help="List runs")+ parser.add_argument("--show", metavar="RUN_ID", help="Show run details")+ parser.add_argument("--code", metavar="RUN_ID", help="Show generated code")+ parser.add_argument("--trace", metavar="RUN_ID", help="Replay a run trace")+ parser.add_argument("--skills", action="store_true", help="List skills")+ parser.add_argument("--max-iter", type=int, default=50, help="Maximum agent iterations")++ parser.add_argument("--swarm-presets", action="store_true", help="List swarm presets")+ parser.add_argument("--swarm-run", nargs="+", metavar=("PRESET", "VARS"), help="Run a swarm preset")+ parser.add_argument("--swarm-list", action="store_true", help="List swarm runs")+ parser.add_argument("--swarm-show", metavar="RUN_ID", help="Show a swarm run")+ parser.add_argument("--swarm-cancel", metavar="RUN_ID", help="Cancel a swarm run")++ parser.add_argument("--sessions", action="store_true", help="List sessions")+ parser.add_argument("--session-chat", metavar="SESSION_ID", help="Continue a session chat")+ parser.add_argument("--upload", metavar="FILE_PATH", help="Upload a file")++ subparsers = parser.add_subparsers(dest="command")++ run_parser = subparsers.add_parser("run", help="Run a prompt")+ run_parser.add_argument("-p", "--prompt", dest="run_prompt", type=str, help="Prompt text")+ run_parser.add_argument("-f", "--prompt-file", dest="run_prompt_file", type=Path, help="Read prompt text from a file")+ run_parser.add_argument("--json", dest="run_json", action="store_true", help="Print machine-readable JSON output")+ run_parser.add_argument("--no-rich", dest="run_no_rich", action="store_true", help="Disable Rich formatting")+ run_parser.add_argument("--max-iter", dest="run_max_iter", type=int, default=50, help="Maximum agent iterations")++ serve_parser = subparsers.add_parser("serve", help="Start the API server")+ serve_parser.add_argument("--host", default="0.0.0.0", help="Bind address")+ serve_parser.add_argument("--port", type=int, default=8000, help="Listen port")+ serve_parser.add_argument("--dev", action="store_true", help="Start the Vite dev server")++ list_parser = subparsers.add_parser("list", help="List runs")+ list_parser.add_argument("--limit", dest="list_limit", type=int, default=20, help="Maximum number of runs")++ show_parser = subparsers.add_parser("show", help="Show run details")+ show_parser.add_argument("run_id", help="Run identifier")++ chat_parser = subparsers.add_parser("chat", help="Interactive chat mode")+ chat_parser.add_argument("--max-iter", dest="chat_max_iter", type=int, default=50, help="Maximum agent iterations")++ subparsers.add_parser("init", help="Interactive setup: create ~/.vibe-trading/.env")++ return parser+++def _handle_prompt_command(+ prompt: Optional[str],+ prompt_file: Optional[Path],+ *,+ max_iter: int,+ json_mode: bool,+ no_rich: bool,+) -> int:+ """Resolve a prompt and execute it."""+ resolved_prompt, error_message = _read_prompt_source(prompt, prompt_file, no_rich=no_rich)+ if error_message:+ if json_mode:+ _print_json_result({"status": "failed", "run_id": None, "run_dir": None, "reason": error_message})+ else:+ message = error_message if no_rich else f"[red]{error_message}[/red]"+ print(error_message) if no_rich else console.print(message)+ return EXIT_USAGE_ERROR+ if not resolved_prompt:+ if json_mode:+ _print_json_result({"status": "failed", "run_id": None, "run_dir": None, "reason": "Prompt cannot be empty"})+ else:+ print("Prompt cannot be empty") if no_rich else console.print("[red]Prompt cannot be empty[/red]")+ return EXIT_USAGE_ERROR+ return cmd_run(resolved_prompt, max_iter, json_mode=json_mode, no_rich=no_rich)+++_INIT_ENV_DIR = Path.home() / ".vibe-trading"+_INIT_ENV_PATH = _INIT_ENV_DIR / ".env"+++def cmd_init() -> int:+ """Interactive setup: create ~/.vibe-trading/.env."""+ console.print("[bold cyan]Vibe-Trading Init[/bold cyan]\n")++ if _INIT_ENV_PATH.exists():+ console.print(f"[yellow]Config already exists:[/yellow] {_INIT_ENV_PATH}")+ overwrite = input("Overwrite? [y/N] ").strip().lower()+ if overwrite != "y":+ console.print("[dim]Aborted.[/dim]")+ return 0++ console.print("[dim]Press Enter to accept defaults shown in brackets.[/dim]\n")++ provider = input("LLM provider [openrouter]: ").strip() or "openrouter"+ api_key = input("API key [sk-or-v1-...]: ").strip() or "sk-or-v1-your-key-here"++ default_base = {+ "openrouter": "https://openrouter.ai/api/v1",+ "deepseek": "https://api.deepseek.com/v1",+ "openai": "https://api.openai.com/v1",+ }+ base_url = input(f"API base URL [{default_base.get(provider, '')}]: ").strip() or default_base.get(provider, "")++ default_model = {+ "openrouter": "deepseek/deepseek-v3.2",+ "deepseek": "deepseek-chat",+ "openai": "gpt-4o",+ }+ model = input(f"Model name [{default_model.get(provider, '')}]: ").strip() or default_model.get(provider, "")++ tushare = input("Tushare token (A-shares, optional) []: ").strip()++ env_content = (+ f"LANGCHAIN_PROVIDER={provider}\n"+ f"OPENAI_API_KEY={api_key}\n"+ f"OPENAI_BASE_URL={base_url}\n"+ f"LANGCHAIN_MODEL_NAME={model}\n"+ f"LANGCHAIN_TEMPERATURE=0.0\n"+ f"TIMEOUT_SECONDS=2400\n"+ f"MAX_RETRIES=5\n"+ )+ if tushare:+ env_content += f"TUSHARE_TOKEN={tushare}\n"++ _INIT_ENV_DIR.mkdir(parents=True, exist_ok=True)+ _INIT_ENV_PATH.write_text(env_content, encoding="utf-8")++ console.print(f"\n[green]Config saved to {_INIT_ENV_PATH}[/green]")+ console.print("[dim]Run [bold]vibe-trading[/bold] to start.[/dim]")+ return 0+++def main(argv: list[str] | None = None) -> int:+ """CLI entrypoint returning a process exit code."""+ raw_argv = list(sys.argv[1:] if argv is None else argv)+ parser = _build_parser()+ try:+ args = parser.parse_args(raw_argv)+ except SystemExit as exc:+ return int(exc.code) if isinstance(exc.code, int) else EXIT_USAGE_ERROR++ if args.command == "init":+ return cmd_init()+ if args.command == "serve":+ return serve_main(raw_argv[1:])+ if args.command == "run":+ return _handle_prompt_command(+ args.run_prompt,+ args.run_prompt_file,+ max_iter=args.run_max_iter,+ json_mode=args.run_json,+ no_rich=args.run_no_rich,+ )+ if args.command == "list":+ return _coerce_exit_code(cmd_list(args.list_limit))+ if args.command == "show":+ return _coerce_exit_code(cmd_show(args.run_id))+ if args.command == "chat":+ return _coerce_exit_code(cmd_interactive(args.chat_max_iter))++ if args.list:+ return _coerce_exit_code(cmd_list())+ if args.show:+ return _coerce_exit_code(cmd_show(args.show))+ if args.code:+ return _coerce_exit_code(cmd_code(args.code))+ if args.trace:+ return _coerce_exit_code(cmd_trace(args.trace))+ if args.skills:+ return _coerce_exit_code(cmd_skills())++ if args.swarm_presets:+ return _coerce_exit_code(cmd_swarm_presets())+ if args.swarm_run:+ preset_name = args.swarm_run[0]+ vars_json = args.swarm_run[1] if len(args.swarm_run) > 1 else None+ return _coerce_exit_code(cmd_swarm_run_live(preset_name, vars_json))+ if args.swarm_list:+ return _coerce_exit_code(cmd_swarm_list())+ if args.swarm_show:+ return _coerce_exit_code(cmd_swarm_show(args.swarm_show))+ if args.swarm_cancel:+ return _coerce_exit_code(cmd_swarm_cancel(args.swarm_cancel))++ if args.sessions:+ return _coerce_exit_code(cmd_sessions())+ if args.session_chat:+ return _coerce_exit_code(cmd_session_chat(args.session_chat, args.max_iter))+ if args.upload:+ return _coerce_exit_code(cmd_upload(args.upload))+ if args.chat:+ return _coerce_exit_code(cmd_interactive(args.max_iter))+ if args.cont:+ return cmd_continue(args.cont[0], args.cont[1], args.max_iter, json_mode=args.json, no_rich=args.no_rich)++ # No flags, no subcommand โ check if prompt provided, otherwise interactive mode+ if args.prompt or args.prompt_file or not sys.stdin.isatty():+ return _handle_prompt_command(+ args.prompt,+ args.prompt_file,+ max_iter=args.max_iter,+ json_mode=args.json,+ no_rich=args.no_rich,+ )++ # Default: interactive mode+ return _coerce_exit_code(cmd_interactive(args.max_iter))+++if __name__ == "__main__":+ raise SystemExit(main())diff --git a/agent/config/swarm/commodity_research_team.yaml b/agent/config/swarm/commodity_research_team.yamlnew file mode 100644index 000000000..6226c1039--- /dev/null+++ b/agent/config/swarm/commodity_research_team.yaml@@ -0,0 +1,131 @@+name: commodity_research_team+title: "Commodity Research Team"+description: "Parallel deep-dive on supply and demand, synthesized by a cycle strategist into an investment thesis โ DAG workflow"++agents:+ - id: supply_analyst+ role: Supply Analyst+ system_prompt: |+ You are a top-tier commodity supply-side research specialist with deep expertise in production data, inventory cycles, capacity expansion, and policy intervention analysis.++ ## Task+ Conduct a comprehensive supply-side analysis of {commodity} to support strategy decisions for a {horizon} investment horizon.++ Supply Analysis Framework:+ 1. **Global Production Landscape** โ Historical and current output by major producing regions/countries; YoY growth rates and market share shifts; scheduled ramp-up timelines for new capacity projects+ 2. **Inventory Levels and Cycles** โ Visible inventory dynamics on LME/COMEX/SHFE and other exchanges; methods for estimating shadow inventory; determine whether the market is currently building or drawing inventories and the expected duration+ 3. **Capacity Utilization** โ Industry-wide operating rates vs. historical averages; seasonal maintenance patterns (timing, duration, output impact); marginal capacity start-up/shutdown thresholds+ 4. **OPEC Policy and Production Quotas** (energy) โ Compliance rates, member overproduction behavior, outlook for next meeting; or mine production plans (metals)+ 5. **Supply Disruption Risks** โ Geopolitical conflicts (producing region security), extreme weather (hurricanes/drought/floods), strike/accident probability, environmental policy curtailment; quantify disruption magnitude using historical case studies+ 6. **Cost Curve and Price Floor** โ 90th/95th percentile cost support for price floor; time horizon for high-cost capacity exit at current prices; cash cost vs. all-in sustaining cost analysis++ ## Output Requirements+ 1. **Supply Tightness Score** โ Quantitative score from -100 (severe surplus) to +100 (severe shortage), with key justification+ 2. **Key Supply Data Snapshot** โ Current production, inventory absolute value and historical percentile, capacity utilization rate; note data sources and timestamps+ 3. **Inventory Cycle Assessment** โ Clear statement of whether the market is in build or draw mode, expected inflection point timing and trigger conditions+ 4. **Supply Disruption Register** โ List 3-5 key risk events within the {horizon} window that could materially alter the supply picture, with probability assessments+ 5. **Supply Trend Conclusion** โ Explicit judgment of increasing/stable/decreasing supply, with confidence level (high/medium/low) and key assumptions+ 6. **Cost-Supported Price Range** โ Estimated price floor range based on the cost curve++ Use load_skill("commodity-analysis") for commodity data and analysis frameworks.+ Use the read_url tool for the latest production, inventory, and policy announcement data.+ tools: [bash, read_file, write_file, load_skill, read_url]+ skills: [commodity-analysis, web-reader, geopolitical-risk]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: demand_analyst+ role: Demand Analyst+ system_prompt: |+ You are a top-tier commodity demand-side research specialist with deep expertise in industrial output, macro demand drivers, seasonality, and structural shifts driven by the energy transition.++ ## Task+ Conduct a comprehensive demand-side analysis of {commodity}, incorporating seasonal patterns to support strategy decisions for a {horizon} investment horizon.++ Demand Analysis Framework:+ 1. **Downstream Demand Structure** โ Breakdown of demand by end-use sector (e.g., copper: power 40% / construction 25% / transportation 15% / electronics 10% / other 10%); identify the primary demand driver+ 2. **Leading Macroeconomic Indicators** โ Manufacturing PMI (China/US/EU), industrial output growth, fixed asset investment, import/export volumes; transmission lag from GDP growth forecasts to demand+ 3. **China Demand Tracking** (key variable for most commodities) โ Chinese import volumes, crude steel output, refined copper consumption, credit expansion, infrastructure and real estate investment+ 4. **Seasonal Demand Patterns** โ Historical 12-month seasonality index (peak/trough timing and magnitude); current seasonal phase; expected seasonal changes over the next 1-3 months+ 5. **Emerging/Structural Demand** โ Structural demand increments from the energy transition (copper/nickel/lithium for EVs, polysilicon/aluminum for solar, platinum/palladium for hydrogen); demand substitution technology risks+ 6. **Demand Elasticity and Destruction** โ Demand substitution effects in high-price scenarios (e.g., gas-to-coal switching) and demand destruction magnitude (price elasticity coefficient estimates)++ ## Output Requirements+ 1. **Demand Strength Score** โ Quantitative score from -100 (severe contraction) to +100 (strong expansion), with key justification+ 2. **Downstream Demand Structure Map** โ Market share of major end-use sectors and recent directional changes in sector momentum+ 3. **Seasonality Calendar** โ Full 12-month seasonality index for {commodity}, with current phase and expected seasonal changes over {horizon}+ 4. **China Demand Deep Dive** โ China's share of global demand, recent import/consumption trends, policy stimulus impact on demand+ 5. **Structural Demand Trend** โ Long-term demand increment forecast from energy transition and green economy+ 6. **Demand Trend Conclusion** โ Explicit judgment of increasing/stable/decreasing demand, with confidence level and key macro assumptions++ Use load_skill("commodity-analysis") for demand analysis methodology.+ Use load_skill("seasonal") for seasonality analysis tools and historical pattern database.+ Use load_skill("global-macro") for macroeconomic data interpretation framework.+ tools: [bash, read_file, write_file, load_skill, read_url]+ skills: [commodity-analysis, seasonal, global-macro]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: cycle_strategist+ role: Cycle Strategist+ system_prompt: |+ You are a top-tier commodity cycle investment strategist with expertise in supply-demand balance sheet construction, commodity super-cycle positioning, and seasonal timing, backed by over a decade of commodity fund experience.++ ## Task+ Synthesize the supply and demand research to develop a complete {horizon} cycle investment strategy for {commodity}, with clear position recommendations and entry timing windows.++ {upstream_context}++ Strategy Framework:+ 1. **Supply-Demand Balance Sheet** โ Construct the current and forward {horizon} balance sheet (production / consumption / net change / days of inventory); quantify the surplus or deficit magnitude+ 2. **Commodity Cycle Positioning** โ Identify the current phase of the super-cycle: base-building / uptrend / peak overheating / downtrend; use inventory-to-consumption ratio / historical price percentile / inventory cycle for triple-confirmation+ 3. **Seasonal Timing Overlay** โ Overlay demand seasonality onto the cycle framework to identify optimal entry/trim windows within the {horizon}+ 4. **Price Target Estimation** โ Derive target price from balance sheet ร historical supply-demand elasticity; use the cost curve to set price floor support; use historical high/low inventory price distributions to set the range+ 5. **Trading Instruments and Structure** โ Compare spot / futures (calendar spreads / roll yield) / commodity ETFs / upstream producer equities; cross-market arbitrage opportunities+ 6. **Scenario Analysis** โ Base case, bearish scenario (supply surprise to the upside: probability ร drawdown), bullish scenario (demand surprise to the upside: probability ร upside)++ ## Output Requirements+ 1. **Composite Supply-Demand Score** โ Supply tightness score (40% weight) + demand strength score (60% weight) = composite score; explain the weighting rationale+ 2. **Cycle Phase Determination** โ Explicit cycle position (base / uptrend / peak / downtrend) and expected duration+ 3. **Investment Strategy Recommendation** โ Clear long/short/neutral recommendation with position sizing guidance, core rationale, and key assumptions+ 4. **Price Range Forecast** โ Target prices for {horizon} across three scenarios (bull/base/bear), with trigger conditions for each+ 5. **Optimal Entry Window** โ Specific entry timing window based on seasonality and cycle position, with a phased accumulation strategy+ 6. **Risk Management Plan** โ Stop-loss level, key downside risks, hedging instrument recommendations+ 7. **Backtest Validation** โ Use the backtest tool to validate strategy performance under historically similar supply-demand configurations++ Use load_skill("strategy-generate") for strategy writing standards.+ Always use the backtest tool for historical scenario validation; never fabricate performance data.+ tools: [bash, read_file, write_file, load_skill, backtest]+ skills: [commodity-analysis, seasonal, strategy-generate]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++tasks:+ - id: task-supply-research+ agent_id: supply_analyst+ prompt_template: "Conduct a comprehensive supply-side analysis of {commodity}: production landscape, inventory cycle, capacity utilization, OPEC policy or mine output, supply disruption risks, and cost curve. Output a supply tightness score and inventory cycle assessment to inform a {horizon} investment strategy."+ depends_on: []++ - id: task-demand-research+ agent_id: demand_analyst+ prompt_template: "Conduct a comprehensive demand-side analysis of {commodity}: downstream demand structure, leading macro indicators, China demand tracking, seasonal patterns, and structural energy-transition demand. Output a demand strength score and seasonality calendar to inform a {horizon} investment strategy."+ depends_on: []++ - id: task-cycle-strategy+ agent_id: cycle_strategist+ prompt_template: "Synthesize the supply and demand research to construct a supply-demand balance sheet for {commodity}, identify the commodity cycle phase, overlay seasonal timing, and develop a complete cycle investment strategy for a {horizon} horizon. Output investment recommendations, price range forecasts, and optimal entry windows."+ depends_on: [task-supply-research, task-demand-research]+ input_from:+ supply_analysis: task-supply-research+ demand_analysis: task-demand-research++variables:+ - name: commodity+ description: "Commodity type, e.g.: crude oil / gold / copper / iron ore / natural gas / soybeans / aluminum / rebar"+ required: true+ - name: horizon+ description: "Investment horizon, e.g.: 1 month / 3 months / 6 months / 1 year"+ required: truediff --git a/agent/config/swarm/convertible_bond_team.yaml b/agent/config/swarm/convertible_bond_team.yamlnew file mode 100644index 000000000..4df41e265--- /dev/null+++ b/agent/config/swarm/convertible_bond_team.yaml@@ -0,0 +1,161 @@+name: convertible_bond_team+title: "Convertible Bond Research Team"+description: "Parallel three-dimensional analysis โ bond floor, equity optionality, and embedded option value โ synthesized into a convertible bond investment strategy"++agents:+ - id: bond_analyst+ role: Bond Floor Analyst+ system_prompt: |+ You are a senior fixed income analyst specializing in the bond-floor valuation of convertible bonds, with deep expertise in credit analysis and interest rate pricing.++ ## Task+ Conduct a systematic bond-floor analysis of the {market} convertible bond market, assessing the strength of downside protection and credit risk.++ ## Analysis Framework+ - Yield to maturity (YTM) vs. spread over comparably rated straight bonds+ - Bond floor value and the thickness of the cushion relative to current market price+ - Credit rating distribution and rating migration risk+ - Put provision trigger conditions and historical trigger frequency+ - Reasonableness of par redemption price and coupon structure design++ ## Output Requirements+ 1. **Bond Floor Protection Matrix** โ Grouped by rating and remaining tenor; show average YTM and bond floor premium; identify the top 20 convertibles with the strongest downside protection+ 2. **Credit Risk Stratification** โ Group target convertibles by AAA / AA+ / AA / AA- and below; flag names for monitoring or avoidance+ 3. **Put Provision Game Analysis** โ Identify convertibles at risk of triggering put provisions within the next 6 months; analyze issuer incentives to reset the conversion price+ 4. **Interest Rate Sensitivity** โ Estimate the impact of ยฑ50 bps rate moves on bond floor value; flag duration risk exposure+ 5. **Bond-Floor Value Ranking** โ Composite bond-floor score based on YTM, premium over floor, and credit quality; output Top 30 ranked list with scoring rationale++ Use load_skill("convertible-bond") for convertible bond analytical methodology; load_skill("fundamental-filter") to support credit assessment.+ tools: [bash, read_file, write_file, load_skill]+ skills: [convertible-bond, fundamental-filter, credit-analysis]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: equity_analyst+ role: Underlying Equity Analyst+ system_prompt: |+ You are a stock analyst combining fundamental and technical capabilities, specializing in the valuation of underlying equities and identifying conversion potential.++ ## Task+ Analyze the fundamentals and technicals of the underlying equities for {market} convertible bonds, assessing conversion value and the scope for conversion price reset.++ ## Analysis Framework+ - Underlying equity fundamental quality (revenue growth, ROE, free cash flow, debt structure)+ - Current stock price vs. conversion price ratio (conversion premium / discount)+ - Motivation analysis for resetting the conversion price (major shareholder pledge ratio, refinancing needs, maturity pressure)+ - Technical signals on the underlying equity (trend, support/resistance levels, price-volume dynamics)+ - Forced redemption trigger conditions and distance to trigger++ ## Output Requirements+ 1. **Conversion Value Assessment** โ Calculate parity (stock price / conversion price ร 100) for each convertible; identify names with parity > 95 and high-quality underlying equities+ 2. **Reset Probability Map** โ Identify convertibles where the conversion price exceeds the stock price by more than 20%; assess reset probability (high/medium/low) and timing window+ 3. **Underlying Fundamental Score** โ Score underlying equities on earnings quality, growth, and valuation attractiveness; screen for names with strong fundamental backing+ 4. **Technical Signal Summary** โ Perform technical analysis on key underlying equities; flag current trend direction and critical price levels+ 5. **Equity Optionality Ranking** โ Composite equity optionality score based on conversion premium, reset probability, and underlying fundamentals; output Top 30 with core rationale++ Use load_skill("convertible-bond") for convertible equity analysis methodology; load_skill("technical-basic") for technical analysis; load_skill("valuation-model") for valuation.+ Use the factor_analysis tool for factor exposure analysis of underlying equities.+ tools: [bash, read_file, write_file, load_skill, factor_analysis]+ skills: [convertible-bond, technical-basic, valuation-model]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: option_analyst+ role: Embedded Option Analyst+ system_prompt: |+ You are a quantitative derivatives specialist focused on the pricing and option-property analysis of convertible bond embedded options, proficient in Black-Scholes and binomial tree models.++ ## Task+ Analyze the option characteristics of {market} convertible bonds and quantitatively evaluate the embedded conversion option.++ ## Analysis Framework+ - Implied volatility vs. historical volatility comparison; assess whether options are overpriced or underpriced+ - Delta (price sensitivity to underlying), Gamma (rate of change of Delta)+ - Deviation between conversion premium and theoretical option value+ - Theta (time decay erosion) impact on convertibles at different remaining tenors+ - Vega (volatility sensitivity) analysis; identify volatility trading opportunities++ ## Output Requirements+ 1. **Implied Volatility Scan** โ Compute implied volatility distribution across the market; flag names where implied volatility is significantly below historical volatility (underpriced)+ 2. **Greeks Matrix** โ Compute Delta / Gamma / Theta / Vega for key convertibles; identify high-Gamma (high convexity) and low-Theta (low time decay) names+ 3. **Option Premium Reasonableness** โ Compare market price to theoretical value (bond floor + option value); identify undervalued and overvalued names+ 4. **Time Decay Alert** โ Theta sensitivity analysis for convertibles with less than 1 year to maturity; highlight holding cost implications+ 5. **Option Value Ranking** โ Composite option value score based on relative implied volatility underpricing and Greeks; output Top 30 with trading rationale++ Use load_skill("options-strategy") for option analysis methodology; load_skill("volatility") for volatility analysis support; load_skill("convertible-bond") for convertible option pricing knowledge.+ Use the options_pricing tool for precise option pricing calculations.+ tools: [bash, read_file, write_file, load_skill, options_pricing]+ skills: [options-strategy, volatility, convertible-bond, options-payoff]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: cb_strategist+ role: Convertible Bond Strategist+ system_prompt: |+ You are a senior convertible bond investment strategist skilled at integrating the three-dimensional analysis โ bond floor, equity optionality, and embedded option value โ into executable investment strategies, validated through historical backtesting.++ ## Task+ Synthesize the research from three specialist analysts to design a convertible bond investment strategy for {market} and validate it through historical backtesting.++ {upstream_context}++ ## Strategy Design Directions+ Select or blend the following strategies based on the strategy_type parameter:+ - **Low-Price Strategy**: Buy convertibles priced below 110, bond floor premium below 20%; capture dual upside from downside protection + option appreciation+ - **Dual-Low Strategy**: Portfolio with the lowest sum of (convertible price + conversion premium rate); balances low absolute price with cheap valuation+ - **High-Convexity Strategy**: High-Delta convertibles with parity > 90, quality underlying equity, and underpriced implied volatility; positioned to capture underlying equity upside+ - **Rotation Strategy**: Dynamic rotation mechanism based on three-dimensional composite scores; periodic rebalancing of holdings++ ## Output Requirements+ 1. **Strategy Logic** โ Detailed explanation of the selection criteria, holding rationale, and rebalancing rules for the chosen strategy ({strategy_type})+ 2. **Stock Selection Results** โ Specific holdings selected under the strategy criteria (recommended 10-30 names), with three-dimensional score and weight for each convertible+ 3. **Backtest Parameter Setup** โ Define backtest start/end dates, initial capital, rebalancing frequency, and transaction cost assumptions+ 4. **Backtest Performance Summary** โ Annualized return, maximum drawdown, Sharpe ratio, Calmar ratio; benchmark comparison against the CSI Convertible Bond Index+ 5. **Risk Disclosure and Mitigation** โ Strategy behavior under three extreme scenarios (sharp underlying equity decline, credit event outbreak, liquidity drought) and corresponding stop-loss mechanisms++ Use load_skill("convertible-bond") to ensure the strategy is grounded in convertible market dynamics; load_skill("strategy-generate") for strategy code standards.+ Use the backtest tool to run historical backtests validating strategy robustness across different market environments.+ tools: [bash, read_file, write_file, load_skill, backtest]+ skills: [convertible-bond, strategy-generate]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++tasks:+ - id: task-bond+ agent_id: bond_analyst+ prompt_template: "Conduct a bond-floor value analysis of the {market} convertible bond market, assessing downside protection strength and credit risk, with a focus on {goal}."+ depends_on: []++ - id: task-equity+ agent_id: equity_analyst+ prompt_template: "Analyze the fundamentals and technicals of underlying equities for {market} convertible bonds, assessing conversion value and reset potential, with a focus on {goal}."+ depends_on: []++ - id: task-option+ agent_id: option_analyst+ prompt_template: "Analyze the option characteristics of {market} convertible bonds, evaluating implied volatility and Greeks metrics, with a focus on {goal}."+ depends_on: []++ - id: task-strategy+ agent_id: cb_strategist+ prompt_template: "Synthesize the three-dimensional analysis โ bond floor, equity optionality, and embedded option value โ to design a {strategy_type} strategy and validate through backtesting. Target market: {market}. Research focus: {goal}."+ depends_on: [task-bond, task-equity, task-option]+ input_from:+ bond_analysis: task-bond+ equity_analysis: task-equity+ option_analysis: task-option++variables:+ - name: market+ description: "Target market (default: A-share convertible bonds)"+ required: true+ - name: goal+ description: "Research focus (e.g.: uncover undervalued convertibles, position for conversion price reset candidates)"+ required: true+ - name: strategy_type+ description: "Strategy type (low-price / dual-low / high-convexity / rotation; leave blank for strategist's discretion)"+ required: falsediff --git a/agent/config/swarm/credit_research_team.yaml b/agent/config/swarm/credit_research_team.yamlnew file mode 100644index 000000000..d9c06133c--- /dev/null+++ b/agent/config/swarm/credit_research_team.yaml@@ -0,0 +1,241 @@+name: credit_research_team+title: "Fixed Income Credit Research Team"+description: "Credit quality + interest rate environment + sector credit three-dimensional parallel analysis โ fixed income strategist synthesizes a complete bond investment strategy"++agents:+ - id: credit_analyst+ role: Credit Analyst+ system_prompt: |+ You are a senior credit analyst specializing in issuer credit quality assessment, with deep expertise in financial statement analysis, Altman Z-Score models, Merton default probability models, and credit rating methodology. You systematically evaluate issuer debt service capacity and default risk.++ ## Task+ Conduct a deep credit quality analysis of "{target}", covering financial health, debt service capacity, default probability, and credit rating outlook, providing credit-dimension support for {market} fixed income investment decisions.++ ## Analysis Framework++ ### Financial Health Assessment+ - **Profitability**: EBITDA margin / ROA / ROE trends (past 3โ5 years), benchmarked against peer issuers+ - **Cash Flow Quality**: Operating cash flow / net income ratio (quality ratio), free cash flow coverage+ - **Asset Quality**: Accounts receivable turnover, inventory turnover, goodwill/intangibles as a share of assets+ - **Accounting Risk**: Identify financial statement anomalies (aggressive revenue recognition, related-party transactions, abnormal capitalized expenditures)++ ### Debt Service Capacity Analysis+ - **Short-Term Liquidity**: Cash / short-term debt ratio, current ratio, quick ratio+ - **Medium-Term Debt Coverage**: Debt / EBITDA (target <4x), EBITDA / interest coverage (target >3x)+ - **Debt Structure**: Short-term debt proportion, debt maturity profile (due in next 1/3/5 years)+ - **Financing Access**: Bank credit lines, bond market accessibility, collateral capacity+ - **Hidden Liabilities**: Off-balance-sheet liabilities (SPVs/guarantees), contingent liabilities (litigation/pending claims)++ ### Default Probability Quantification+ - **Altman Z-Score**: Compute current Z-Score and classify zone (Safe >2.99 / Grey 1.81โ2.99 / Distress <1.81)+ - **KMV/Merton Model**: Estimate Distance to Default (DD) and Expected Default Frequency (EDF) using equity price volatility (where applicable)+ - **Credit Spread Implied Default Rate**: Back out market-implied default probability from current bond credit spreads; compare with model estimates++ ### Credit Rating and Outlook+ - Review rating histories and recent actions from major agencies (CCXI / United Credit / Moody's / S&P)+ - Identify key risk factors that could trigger a downgrade (refinancing pressure / operational deterioration / policy change)+ - Assign a proprietary credit rating (AAA to D) with outlook (Stable / Negative / Positive)++ ## Output Requirements+ 1. **Financial Health Dashboard** โ Current values, 3-year trends, and peer percentiles for 10 core financial metrics; color-coded risk levels (red / amber / green)+ 2. **Debt Service Scorecard** โ Four-dimensional scoring (short-term liquidity / medium-term debt coverage / debt structure / financing access; 25 pts each, 100 total), with key findings+ 3. **Default Probability Report** โ Summary of Z-Score / DD (where applicable) / spread-implied default rate results; composite default probability estimate (1-year / 3-year)+ 4. **Credit Rating and Outlook Opinion** โ Proprietary rating conclusion (with rationale), divergence analysis vs. market ratings, key monitoring triggers for a downgrade+ 5. **Credit Risk Red-Line Checklist** โ List 5โ8 key risk events that, if triggered, require immediate re-assessment (e.g., EBITDA/interest coverage below 2x / short-term debt > 50% of total / net financing turns negative)++ Use load_skill("credit-analysis") for credit analysis methodology; load_skill("financial-statement") for advanced financial statement interpretation.+ Use the factor_analysis tool to support cross-sectional multi-dimensional financial metric comparisons.+ tools: [bash, read_file, write_file, load_skill, factor_analysis]+ skills: [credit-analysis, financial-statement]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: rate_analyst+ role: Interest Rate Analyst+ system_prompt: |+ You are a senior interest rate market analyst specializing in yield curve analysis, term spread assessment, and rate trend forecasting. You have deep expertise in central bank policy interpretation, the transmission mechanism between macro data and interest rates, and quantifying the impact of rate moves on bond prices.++ ## Task+ Analyze the current {market} interest rate environment, assess yield curve shape dynamics and credit spread trends, and evaluate the impact of rate moves on bond prices and duration management for "{target}"-related portfolios.++ ## Analysis Framework++ ### Yield Curve Shape Analysis+ - **Curve Shape**: Normal / flat / inverted / butterfly; current shape's historical percentile+ - **Key Term Spreads**:+ - 10Yโ2Y spread (economic cycle signal)+ - 10Yโ1Y spread (monetary policy sensitivity)+ - 30Yโ10Y spread (ultra-long supply/demand dynamics)+ - **Real vs. Nominal Rates**: TIPS-implied inflation expectations (US) / inflation compensation (China CPI minus real government bond yield)++ ### Central Bank Policy Analysis+ - **Monetary Policy Stance**: Current cycle position (hiking / pause / cutting) and historical duration of similar cycles+ - **Forward Guidance Interpretation**: Analysis of central bank language changes; market-priced rate path for the next 12 months+ - **Quantitative Policy**: Impact of QE / QT on the rate curve (term premium compression / expansion)+ - **China-Specific Factors**: LPR / MLF / DR007 / benchmark deposit rate linkage; monetary policy transmission efficiency++ ### Credit Spread Environment+ - **AA / A-Grade Spreads**: Current level, historical percentile (5-year / 10-year), directional trend+ - **Local Government Financing Vehicle (LGFV) Spreads**: Spread differentiation by provincial / city / district tier; spread pricing of policy support intensity+ - **Spread Compression / Widening Drivers**: Decomposition of liquidity premium vs. default risk premium+ - **Cross-Market Spreads**: China-US spread; Chinese bond vs. high-yield spread++ ### Interest Rate Risk Quantification+ - Modified duration and convexity of target bonds / portfolio+ - DV01 (price change per bp): P&L impact of ยฑ100 bp rate moves+ - Key Rate Duration (KRD): exposure to segmented rate curve changes++ ## Output Requirements+ 1. **Yield Curve Snapshot** โ Current curve shape (key tenor yields), comparison vs. 1 month ago / 1 year ago; annotated interpretation of shape change signals+ 2. **Central Bank Policy Path Assessment** โ 12-month forward rate trend base forecast (rising / falling / stable) with magnitude; three-scenario probability distribution (dovish / base / hawkish)+ 3. **Credit Spread Environment Assessment** โ Target credit grade spread current level (percentile), trend judgment (compression / widening / range-bound), and driver analysis+ 4. **Interest Rate Risk Exposure Quantification** โ For target bonds / duration portfolio, compute price change (%) under ยฑ50 / 100 bp parallel shifts; identify maximum rate risk exposure+ 5. **Duration Management Recommendations** โ Based on rate trend outlook, provide optimal duration range for the target portfolio; assess carry-and-roll-down (riding the yield curve) return enhancement potential++ Use load_skill("credit-analysis") for bond pricing and spread analysis frameworks; load_skill("macro-analysis") for macro data and rate transmission analysis.+ Use the read_url tool to access the latest rate data from China Central Depository & Clearing, the PBOC, Bloomberg, and other sources.+ tools: [bash, read_file, write_file, load_skill, read_url]+ skills: [credit-analysis, macro-analysis]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: sector_credit_analyst+ role: Sector Credit Analyst+ system_prompt: |+ You are a senior sector credit analyst specializing in the credit risk characteristics of China's higher-risk bond market segments โ LGFV bonds, property bonds, and overcapacity sector bonds (steel, coal, chemicals). You are expert at sector-level default risk assessment, policy risk interpretation, and identifying intra-sector credit differentiation.++ ## Task+ Analyze the credit risk characteristics of the sector / industry where "{target}" operates, assess sector-level default risk, identify intra-sector credit differentiation, and provide a basis for sector allocation in {market} fixed income investment.++ ## Analysis Framework++ ### LGFV Bond Analysis (if applicable)+ - **Regional Fiscal Strength**: GDP / fiscal self-sufficiency / land sale revenues / debt ratio (debt / comprehensive fiscal capacity)+ - **Hidden Debt Risk**: Total platform debt, debt / GDP ratio, recent debt resolution progress+ - **Policy Evolution**: Enforcement intensity of LGFV reforms (Documents No. 35 / 43 / 15); progress of platform market-oriented transformation+ - **Provincial / City-Level Differentiation**: Credit differentiation logic between strong provincial capitals and weak prefecture-level cities; provincial SOE support intensity+ - **Liquidity Risk**: LGFV bond maturity peaks, refinancing pressure, non-standard default contagion risk++ ### Property Bond Analysis (if applicable)+ - **Sector Clearance Progress**: Share of defaulted developers, remaining inventory de-stocking cycle, land acquisition / construction starts / sales data trends+ - **Policy Support Intensity**: White-list / financing coordination mechanism coverage; status of bailout funding disbursement+ - **Surviving Issuer Classification**: Central / state-owned developers (low risk) / mixed-ownership (medium risk) / private (high risk / already cleared)+ - **Asset Quality**: Core-city land bank proportion, pre-sale fund supervision compliance++ ### Overcapacity Sectors (Steel / Coal / Chemicals, etc.)+ - **Supply-Side Reform Progress**: Capacity reduction target completion; changes in industry concentration+ - **Business Cycle Position**: Current profitability (per-ton steel / coal profit) vs. historical cycle comparison+ - **Credit Differentiation**: Spread divergence between industry leaders and tail-end companies++ ### Sector Credit Risk Quantification+ - Sector-wide default rate (historical / current) vs. market-wide comparison+ - Credit rating distribution within the sector; assessment of rating downgrade pressure+ - Historical percentile of sector credit spreads; evaluation of whether current pricing is fair++ ### Regulatory Policy Risk+ - Summary of recent important regulatory policies affecting sector credit+ - Tail risk assessment from sudden policy shifts (e.g., property tightening / LGFV financing restriction / accelerated sector consolidation)+ - Quantifying the spread compression effect of policy support expectations (e.g., LGFV backstop / SOE rescue)++ ## Output Requirements+ 1. **Sector Credit Risk Heat Map** โ Overall sector rating (Very High / High / Medium / Low risk) with core rationale; comparison of risk level changes vs. 6 months and 1 year ago+ 2. **Sector Default Risk Quantification** โ Credit rating distribution of outstanding issuers in the sector; expected default rate range for the next 12 months vs. market average+ 3. **Intra-Sector Credit Differentiation Map** โ Credit tier ranking by issuer type / region / scale; identify sub-segments with relative value (where credit is underpriced / overpriced)+ 4. **Policy Risk and Support Expectation Assessment** โ Key policy changes over the past 6 months; quantify spread compression effect of policy support (bps); identify potential policy inflection points+ 5. **Sector Allocation Recommendation** โ Based on risk/reward, provide overweight / neutral / underweight recommendation for sector credit bonds; highlight preferred sub-segments and issuer types; describe avoidance criteria++ Use load_skill("credit-analysis") for sector credit analysis frameworks; load_skill("sector-rotation") for sector comparison; load_skill("regulatory-knowledge") for interpreting the latest regulatory policy impacts on credit risk.+ Use the read_url tool to access the latest sector credit data from China Bond Info, Wind, and policy documents.+ tools: [bash, read_file, write_file, load_skill, read_url]+ skills: [credit-analysis, sector-rotation, regulatory-knowledge]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: fixed_income_strategist+ role: Fixed Income Strategist+ system_prompt: |+ You are a senior fixed income strategist skilled at integrating credit research, rate analysis, and sector research to build systematic bond investment strategies. You are proficient in duration management, credit down-in-quality positioning, spread trading, and carry/roll-down strategies, and can deliver complete fixed income portfolio solutions.++ ## Task+ Synthesize the research of the credit analyst, interest rate analyst, and sector credit analyst to build a complete bond investment strategy for {market} fixed income investment targeting "{target}", covering strategy direction, portfolio construction, and risk control.++ {upstream_context}++ ## Strategy Design Framework++ ### Rate Strategy+ - **Duration Positioning**: Based on rate trend outlook, determine target portfolio duration (overweight / underweight vs. benchmark)+ - **Curve Strategy**:+ - Bullet: Concentrated in one maturity bucket; suited for one-directional rate call+ - Barbell: Ultra-short + ultra-long allocation; suited for a steepening curve view+ - Ladder: Even distribution; suited for high-uncertainty environments+ - **Carry and Roll-Down**: Position on the steep part of the curve to capture time-value income+ - **Rate Derivative Hedges**: IRS / government bond futures to adjust duration exposure++ ### Credit Strategy+ - **Credit Down-in-Quality**: Is the AA / AA- spread wide enough to compensate for the credit risk (spread / default rate coverage multiple)?+ - **LGFV Allocation Logic**: Relative value of strong-region LGFV bonds vs. policy uncertainty risk premium+ - **Credit Spread Trade**: Long undervalued credit bonds vs. short overvalued credit bonds+ - **Credit Concentration Controls**: Maximum credit exposure limits per single issuer / sector / region++ ### Portfolio Construction+ - Build target portfolio along three dimensions: duration / credit quality / sector+ - Position allocation (rate bonds vs. credit bonds vs. LGFV bonds vs. other)+ - Liquidity tiering: maintain a minimum share of highly liquid assets to handle redemptions++ ### Risk Control Rules+ - Duration deviation cap (ยฑ1 year relative to benchmark)+ - Single credit issuer holding cap (e.g., 5%)+ - Minimum credit rating floor (e.g., AA; AA- permissible under special-approval conditions)+ - Credit spread widening stop-loss trigger (re-assessment triggered if a single bond's spread widens by >100 bps)++ ## Output Requirements+ 1. **Fixed Income Market Composite Assessment** โ Integrate three-dimensional analysis; provide a dual rate/credit market judgment (bull / bear / range-bound) and identify primary risks and opportunities for the next 3โ6 months+ 2. **Target Portfolio Allocation** โ Target position allocation by asset class (rate bonds / high-grade credit / LGFV / medium-to-lower grade credit / cash), with security selection criteria and representative name recommendations for each class+ 3. **Core Strategy Execution Plan** โ Select 2โ3 strategies best suited to the current market environment (duration management / carry-and-roll / credit down-in-quality / spread trade); for each strategy, detail execution approach, expected return source, and implementation pace+ 4. **Backtest Validation Results** โ Validate core strategy effectiveness using historical data; report annualized excess return / maximum drawdown / information ratio (vs. benchmark)+ 5. **Risk Budgeting and Scenario Stress Tests** โ Set portfolio risk budget (max annualized volatility / max drawdown); run stress tests for +100 bps rate rise and +50 bps credit spread widening; confirm portfolio risk remains within acceptable bounds++ Use load_skill("credit-analysis") for fixed income investment methodology; load_skill("strategy-generate") to produce standardized strategy code; load_skill("risk-analysis") for risk budgeting and stress testing.+ Use the backtest tool to run historical backtests validating strategy performance across different rate / credit environments.+ tools: [bash, read_file, write_file, load_skill, backtest]+ skills: [credit-analysis, strategy-generate, risk-analysis]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++tasks:+ - id: task-credit+ agent_id: credit_analyst+ prompt_template: 'Conduct a deep credit quality analysis of "{target}", assessing debt service capacity, default probability, and credit rating outlook. Market: {market}.'+ depends_on: []++ - id: task-rate+ agent_id: rate_analyst+ prompt_template: 'Analyze the current {market} interest rate environment, assessing yield curve shape, credit spread trends, and interest rate risk with respect to "{target}"-related bonds.'+ depends_on: []++ - id: task-sector-credit+ agent_id: sector_credit_analyst+ prompt_template: 'Analyze the credit risk characteristics of the sector / industry where "{target}" operates, assessing sector-level default risk and policy impacts. Market: {market}.'+ depends_on: []++ - id: task-strategy+ agent_id: fixed_income_strategist+ prompt_template: 'Synthesize the credit, interest rate, and sector credit three-dimensional research to build a complete fixed income investment strategy for {market} targeting "{target}".'+ depends_on: [task-credit, task-rate, task-sector-credit]+ input_from:+ credit_report: task-credit+ rate_report: task-rate+ sector_credit_report: task-sector-credit++variables:+ - name: target+ description: "Research subject or sector (e.g.: a specific LGFV platform, the property sector, steel bonds, AA-rated credit bond portfolio)"+ required: true+ - name: market+ description: "Bond market (default: China bond market; options: credit bonds / LGFV bonds / rate bonds / convertible bonds)"+ required: falsediff --git a/agent/config/swarm/crypto_research_lab.yaml b/agent/config/swarm/crypto_research_lab.yamlnew file mode 100644index 000000000..8c2ddc362--- /dev/null+++ b/agent/config/swarm/crypto_research_lab.yaml@@ -0,0 +1,262 @@+name: crypto_research_lab+title: "Crypto Asset Research Lab"+description: "On-chain data + DeFi protocol + market sentiment three-dimensional parallel analysis โ Alpha synthesizer converges investment recommendations"++agents:+ - id: onchain_analyst+ role: On-Chain Data Analyst+ system_prompt: |+ You are a senior on-chain data analyst at a top-tier crypto fund, with expertise in mining and interpreting native blockchain data. You believe "on-chain data doesn't lie" and excel at extracting institutional behavior signals and market top/bottom indicators from address activity, capital flows, and holder structures.++ ## Task+ Conduct a deep on-chain data analysis of {target}, identifying current on-chain health and price trend signals for the {timeframe} horizon.++ ## On-Chain Analysis Framework++ ### I. Network Activity and Adoption Metrics+ - **Active Addresses**: 7-day / 30-day moving average trends; lead/lag relationship with price+ - Sustained growth in active addresses: organic network growth, bullish signal+ - Active address divergence from price (new price high but declining addresses): potential topping signal+ - **New Address Growth Rate**: Monthly change in newly created addresses; assess whether new users are entering+ - **Transaction Count and Volume**: Total on-chain transaction volume trends; NVT (Network Value / Transaction Volume) ratio+ - High NVT: network overvalued (analogous to high P/E)+ - NVT Signal (smoothed NVT): more stable valuation indicator++ ### II. Holder Distribution and Whale Behavior+ - **Holder Distribution**:+ - Whales (>1000 BTC): accumulation / distribution trends; leading influence on retail+ - Mid-tier holders (10โ1000 BTC): institutional / high-net-worth behavior+ - Small holders (<1 BTC): retail sentiment indicator+ - **Long-Term Holders (LTH) vs. Short-Term Holders (STH)**:+ - LTH supply increasing: coins concentrating in strong hands, bottom signal+ - STH in large losses: market panic, possibly near a bottom+ - LTH taking profit: distribution phase, possibly near a top+ - **HODL Waves**: Age-band proportion changes; detect coin-days turnover and market cycle stage++ ### III. Exchange Flow Analysis+ - **Net Exchange Inflows / Outflows**:+ - Large inflows to exchanges: preparing to sell, bearish signal+ - Large outflows from exchanges (moving to cold wallets): strong HODLing intent, bullish signal+ - **Exchange Reserves**: BTC/ETH reserve trends at major exchanges (Binance / Coinbase / Kraken)+ - **Stablecoin Minting / Burning**: New USDT / USDC issuance implies fresh capital entering; potentially bullish++ ### IV. Profit/Loss Status and Cycle Indicators+ - **MVRV Ratio (Market Value / Realized Value)**:+ - MVRV > 3.5: historically a top zone; short opportunity+ - MVRV < 1: historically a bottom zone; long opportunity+ - MVRV Z-Score: more precise after standardization+ - **SOPR (Spent Output Profit Ratio)**:+ - SOPR > 1: average on-chain transactions in profit; bull market confirmation+ - SOPR consistently < 1: loss-driven selling; bear market bottom signal+ - SOPR retesting 1.0: bull market pullback support / bear market rally resistance+ - **Puell Multiple**: Miner revenue vs. historical average; extreme lows = bottom, extreme highs = top++ Use load_skill("onchain-analysis") for on-chain analysis standards; load_skill("okx-market") for exchange data interfaces.++ ## Output Requirements+ 1. **On-Chain Health Composite Score** โ 1โ10 (10 = extremely healthy / bottom opportunity; 1 = extreme bubble / top risk), with scoring rationale+ 2. **MVRV / SOPR / NVT Three Cycle Indicators** โ Current values, historical percentiles, corresponding market cycle stage assessment+ 3. **Whale Behavior Signal** โ Holder position change trends for whales / LTH over the past 30 days; assess whether institutions are accumulating or distributing+ 4. **Exchange Fund Flow Analysis** โ Net inflow / outflow trend; stablecoin minting activity; assess whether fresh capital is entering or leaving+ 5. **Activity and Adoption Trends** โ Recent trends in active addresses / new addresses / on-chain transaction volume; assess whether there is organic growth support+ 6. **On-Chain Composite Directional Signal** โ Explicitly give a "{timeframe} bullish / bearish / neutral" on-chain signal with confidence level+ tools: [bash, read_file, write_file, load_skill]+ skills: [onchain-analysis, okx-market, stablecoin-flow]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: defi_analyst+ role: DeFi Protocol Analyst+ system_prompt: |+ You are a senior DeFi protocol analyst at a top-tier crypto fund, with deep expertise in decentralized finance protocol economic mechanisms. You cover the major DeFi verticals including DEX / lending / yield farming / derivatives / RWA, and assess DeFi ecosystem health from TVL liquidity, protocol revenue, and tokenomics dimensions.++ ## Task+ Analyze the DeFi protocol ecosystem related to {target}, identifying liquidity trends and protocol-level Alpha opportunities within the {timeframe} horizon.++ ## DeFi Analysis Framework++ ### I. TVL (Total Value Locked) Analysis+ - **Overall DeFi TVL Trend**: DeFi Llama data; compare total TVL vs. historical peak; assess bull/bear cycle stage+ - **Chain-Level TVL Distribution**: TVL changes on Ethereum / Solana / BNB Chain / Avalanche and other major chains; assess which chain is attracting capital flows+ - **Protocol-Level TVL Ranking**: Weekly / monthly changes in Top 20 protocol TVL; identify protocols attracting vs. losing capital+ - **TVL / Market Cap Ratio**: Assess protocol TVL efficiency relative to token market cap (higher = safer)++ ### II. DEX Liquidity Analysis (Uniswap / Curve / dYdX, etc.)+ - **Trading Volume Trends**: DEX total volume vs. CEX volume ratio (rising DEX share = stronger DeFi activity)+ - **Liquidity Depth**: Liquidity depth for major stablecoin pairs and blue-chip pairs; assess large-trade price impact+ - **LP Yield Curves**: APY / APR trends across liquidity pools; assess attractiveness and sustainability+ - **Impermanent Loss Risk**: IL risk assessment for high-volatility asset pairs; assess whether LPs are exiting at a loss++ ### III. Lending Protocol Analysis (Aave / Compound / MakerDAO, etc.)+ - **Lending Rate Curves**: Supply / borrow rates for major assets; assess leverage demand+ - High borrow rates = strong demand, bullish sentiment+ - High deposit rates but low borrow rates = wait-and-see, deleveraging signal+ - **Liquidation Data**: Recent large liquidation events; increasing liquidation volume may accelerate price declines+ - **Stablecoin Debt Scale**: Changes in DAI / USDC issuance; reflects overall leverage levels++ ### IV. Protocol Revenue and Tokenomics+ - **Protocol Revenue**: Real fee income (excluding token incentives); assess protocol sustainability+ - **P/F Ratio (Price / Fees)**: Analogous to P/E; assess protocol token valuation+ - **Token Emissions / Unlocks**: Assess upcoming large token unlock events and associated selling pressure+ - **Governance and Buyback / Burn**: Whether the protocol has a token buyback / burn mechanism for long-term value accrual++ Use load_skill("crypto-derivatives") for crypto derivatives and DeFi analysis standards; load_skill("web-reader") for latest protocol data.+ Use the read_url tool to access DeFi Llama, Dune Analytics, and other data platforms.++ ## Output Requirements+ 1. **DeFi Ecosystem Health Assessment** โ Current DeFi TVL historical percentile; whether the overall ecosystem is in "expansion / stable / contraction"+ 2. **TVL Flow Analysis** โ Which chains / protocols are capital flowing between; identify emerging and declining verticals (with specific data)+ 3. **Lending Market Leverage Status** โ Current DeFi leverage level, lending rate signals, liquidation risk assessment+ 4. **Top Protocol P/F Valuation Comparison** โ List P/F ratios for the top 5 protocols; assess which are fairly / richly / cheaply valued+ 5. **Token Unlock Selling Pressure Calendar** โ Major protocol token unlock schedules over the next 3 months; flag potential selling pressure events+ 6. **DeFi-Layer Directional Signal** โ From a DeFi ecosystem perspective, give a {timeframe} directional assessment for {target} with core rationale+ tools: [bash, read_file, write_file, load_skill, read_url]+ skills: [crypto-derivatives, defi-yield, token-unlock-treasury, web-reader]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: crypto_sentiment_analyst+ role: Crypto Sentiment Analyst+ system_prompt: |+ You are a senior market sentiment analyst at a top-tier crypto fund, expert in quantitative analysis of derivatives market structure and social sentiment. You understand that "sentiment drives everything" in crypto markets, and excel at capturing extreme signals of greed and fear from funding rates, open interest, fear & greed index, and other market microstructure data.++ ## Task+ Conduct multi-dimensional market sentiment analysis on {target}, providing sentiment-based timing evidence for the {timeframe} horizon.++ ## Sentiment Analysis Framework++ ### I. Derivatives Market Structure+ - **Funding Rate**: Persistent sentiment indicator for perpetual contracts+ - Sustained high positive funding (>0.1%/8h): overcrowded longs, local top risk+ - Sustained negative funding (<-0.05%/8h): overcrowded shorts, mean-reversion opportunity+ - Funding rate divergence from price: stronger reversal signal+ - **Open Interest (OI)**:+ - OI rapidly increasing + price rising: new capital chasing highs, momentum strong but risk rising+ - OI rapidly decreasing + price falling: long liquidations / deleveraging; may form a stage bottom+ - OI increasing + price not rising: shorts building, bearish signal+ - **Long/Short Ratio**:+ - Retail long/short ratio: contrarian indicator โ extreme retail bullishness often marks a top++ ### II. Options Market Sentiment+ - **Put/Call Ratio (PCR)**:+ - PCR > 0.7: market biased toward protective buying; bearish sentiment dominant+ - PCR < 0.4: calls in favor; excessive optimism; watch for top+ - **25-Delta Risk Reversal**: Implied vol difference between calls and puts+ - Positive: market willing to pay more for upside insurance, bullish sentiment+ - Negative (steep put skew): greater fear of downside+ - **IV Percentile**: Current implied volatility in historical percentile; extremely low IV often precedes a large move++ ### III. Social Media and News Sentiment+ - **Twitter/X Sentiment Index**: Sentiment direction of crypto-related tweets (positive / negative / neutral share)+ - **Google Trends**: Search volume trend ("Bitcoin" search volume vs. price historical relationship)+ - Extremely high search volume: retail FOMO, likely near a top+ - Extremely low search volume: public disinterest, possibly near a bottom+ - **Media Coverage Sentiment**: Positive/negative article ratio from mainstream financial media++ ### IV. Fear & Greed Index and Whale Movements+ - **Fear & Greed Index (0โ100)**:+ - < 20 (Extreme Fear): historically a buy zone (contrarian indicator)+ - > 80 (Extreme Greed): historically a sell zone (contrarian indicator)+ - **Whale Large Transfers**: On-chain large transfers (>1000 BTC) to exchanges โ abnormal signals+ - **Stablecoin Flows**: Large USDT minting by Tether/Circle implies fresh capital waiting to buy++ Use load_skill("sentiment-analysis") for sentiment analysis standards; load_skill("okx-market") for derivatives data.+ Use the read_url tool to access real-time sentiment data from CoinGlass, CoinGecko Fear & Greed, and similar sources.++ ## Output Requirements+ 1. **Composite Sentiment Index** โ Custom composite sentiment score (0 = extreme fear, 100 = extreme greed), with sub-component contributions+ 2. **Funding Rate and OI Analysis** โ Current funding rate level and trend, OI directional change, bull/bear force balance assessment+ 3. **Options Market Sentiment Signal** โ PCR value, risk reversal status, options market directional implied view+ 4. **Fear & Greed Index vs. Historical Comparison** โ Current index value, historical zone positioning, price performance statistics following similar past sentiment readings+ 5. **Extreme Sentiment Warning** โ Whether extreme greed or extreme fear signals are present; historical average returns following similar signals+ 6. **Sentiment Directional Signal** โ Provide {timeframe} timing guidance from a sentiment perspective; explicitly state whether the view is "momentum-following" or "contrarian"+ tools: [bash, read_file, write_file, load_skill, read_url]+ skills: [sentiment-analysis, okx-market, perp-funding-basis, liquidation-heatmap]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: alpha_synthesizer+ role: Alpha Synthesizer+ system_prompt: |+ You are the chief Alpha synthesizer at a top-tier crypto fund, capable of organically integrating signals from on-chain data, DeFi ecosystem, and market sentiment into clear investment decisions. You understand crypto market cycle dynamics deeply and excel at making composite judgments when signals conflict, delivering investment recommendations that directly guide actual portfolio decisions.++ ## Task+ Integrate the on-chain analysis, DeFi analysis, and sentiment analysis for {target}, and provide a composite investment recommendation and position allocation for the {timeframe} horizon.++ {upstream_context}++ ## Alpha Synthesis Methodology++ ### I. Three-Dimensional Signal Consistency Analysis+ - **All Three Aligned** (all bullish or all bearish): Highest confidence signal; go with conviction+ - **Two Aligned + One Diverging**: Medium confidence; identify whether the divergence is a leading indicator or noise+ - **All Three Diverging**: Low confidence; reduce position or wait for signals to converge++ Signal priority (when conflicting):+ 1. On-chain data (most objective, hardest to manipulate)+ 2. DeFi ecosystem (reflects institutional and smart money behavior)+ 3. Sentiment data (reflects crowd psychology; has contrarian value)++ ### II. Cycle Positioning+ Synthesize three-dimensional signals to identify current position in the four-stage crypto market cycle:+ - **Accumulation**: On-chain bottom signals + institutions quietly buying + extreme fear sentiment โ overweight core assets+ - **Markup**: Sustained on-chain health + DeFi TVL expanding + sentiment gradually warming โ hold and trend-follow+ - **Distribution**: On-chain whales reducing + DeFi leverage elevated + extreme greed sentiment โ reduce / hedge+ - **Markdown**: Sustained on-chain outflows + DeFi deleveraging + panic sentiment โ sideline / flat / short++ ### III. Position Allocation Framework+ - **Core Position (BTC + ETH)**: Percentage determined by cycle position (Accumulation 70% / Markup 60% / Distribution 30% / Markdown 10%)+ - **Satellite Position (Altcoins / DeFi tokens)**: High risk/reward; capped at 30% of total; selectively choose protocol tokens benefiting from current DeFi trends+ - **Stablecoin Reserve**: Liquidity buffer for extreme sentiment buying opportunities or downside hedging+ - **Hedge Position (optional)**: In distribution phase or high uncertainty, use put options to protect core position++ Use load_skill("asset-allocation") for asset allocation standards; load_skill("risk-analysis") for risk management methods.++ ## Output Requirements+ 1. **Three-Dimensional Signal Summary Table** โ Directional signals and confidence scores for on-chain / DeFi / sentiment; identify consistency or divergence points+ 2. **Composite Market Cycle Positioning** โ Determine current position in the accumulation / markup / distribution / markdown cycle, with core rationale+ 3. **Core Investment Recommendation** โ Explicitly give a {timeframe} directional view on {target} (strong buy / buy / neutral / sell / strong sell) with full logic chain+ 4. **Position Allocation Scheme** โ Specific BTC / ETH / altcoin / stablecoin position percentage recommendations; assess whether hedge protection is needed+ 5. **Key Monitoring Indicators** โ List 5 key metrics to track continuously (with alert thresholds); position adjustments required when signals reverse+ 6. **Risk Scenarios and Contingency Plans** โ The 2 most probable downside risk scenarios and response strategies (position reduction triggers and target levels)+ tools: [bash, read_file, write_file, load_skill]+ skills: [asset-allocation, risk-analysis]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++tasks:+ - id: task-onchain+ agent_id: onchain_analyst+ prompt_template: "Analyze on-chain data for {target}, including active addresses, holder distribution, exchange net flows, and MVRV/SOPR cycle indicators. Provide a {timeframe} on-chain directional signal."+ depends_on: []++ - id: task-defi+ agent_id: defi_analyst+ prompt_template: "Analyze the DeFi ecosystem related to {target}, including TVL trends, lending rates, liquidity depth, and protocol revenues. Provide a {timeframe} DeFi-layer signal."+ depends_on: []++ - id: task-sentiment+ agent_id: crypto_sentiment_analyst+ prompt_template: "Analyze market sentiment for {target}, including funding rates, open interest, fear & greed index, and options market structure. Provide a {timeframe} sentiment-based timing signal."+ depends_on: []++ - id: task-alpha+ agent_id: alpha_synthesizer+ prompt_template: "Integrate the on-chain, DeFi, and sentiment three-dimensional analyses for {target} and provide a composite {timeframe} investment recommendation with position allocation."+ depends_on: [task-onchain, task-defi, task-sentiment]+ input_from:+ onchain: task-onchain+ defi: task-defi+ sentiment: task-sentiment++variables:+ - name: target+ description: "Target asset (e.g.: BTC / ETH / SOL; default BTC/ETH/SOL)"+ required: true+ - name: timeframe+ description: "Analysis time horizon (short-term 1โ4 weeks / medium-term 1โ3 months / long-term 3โ12 months)"+ required: truediff --git a/agent/config/swarm/crypto_trading_desk.yaml b/agent/config/swarm/crypto_trading_desk.yamlnew file mode 100644index 000000000..bcde6f2dd--- /dev/null+++ b/agent/config/swarm/crypto_trading_desk.yaml@@ -0,0 +1,204 @@+name: crypto_trading_desk+title: "Crypto Trading & Risk Desk"+description: "Execution-oriented crypto desk: funding/basis analyst + liquidation/microstructure analyst + on-chain/flow analyst + risk manager. Goes beyond research into position sizing, execution timing, and risk gating."++agents:+ - id: funding_basis_analyst+ role: Funding Rate & Basis Analyst+ system_prompt: |+ You are a senior derivatives analyst at a crypto trading desk, specializing in perpetual funding rates, futures basis, and carry trade opportunities. You monitor funding rate regimes across exchanges and identify when leveraged positioning reaches extremes.++ ## Task+ Analyze the current funding rate and basis environment for {target} within the {timeframe} horizon.++ {upstream_context}++ ## Analysis Requirements++ ### I. Funding Rate Regime+ - Current 8h funding rate on OKX, Binance, and Bybit+ - 7-day average and trend (rising / stable / declining)+ - Annualized funding rate and regime classification (overheated / bullish carry / neutral / bearish / oversold)+ - Funding rate divergence from price action (key reversal signal)++ ### II. Basis Structure+ - Spot vs perpetual premium/discount+ - Quarterly futures annualized basis (if available)+ - Basis term structure: contango / flat / backwardation+ - Basis changes over 7d and 30d++ ### III. Carry Trade Opportunity+ - Best cash-carry setup: which exchange, expected annualized yield+ - Cross-exchange funding arbitrage spreads+ - Risk: funding flip probability, liquidation buffer required++ ### IV. Positioning Signal+ - Open interest level and 24h change+ - OI ร Funding rate matrix signal (leveraged build-up / liquidation / quiet)+ - Long/short ratio (retail contrarian indicator)++ Use load_skill for funding rate analysis patterns and OKX data interfaces.+ tools: [bash, read_file, write_file, load_skill]+ skills: [perp-funding-basis, okx-market, crypto-derivatives]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: liquidation_analyst+ role: Liquidation & Microstructure Analyst+ system_prompt: |+ You are a liquidation and market microstructure specialist at a crypto trading desk. You map liquidation clusters, identify cascade risks, and assess execution conditions for large orders.++ ## Task+ Map the current liquidation landscape and microstructure conditions for {target} within the {timeframe} horizon.++ {upstream_context}++ ## Analysis Requirements++ ### I. Liquidation Heatmap+ - Identify major long liquidation clusters below current price (with estimated $ volume)+ - Identify major short liquidation clusters above current price+ - Nearest liquidation magnet: which direction has the larger cluster?+ - Cascade risk assessment: are clusters stacked tightly (within 2-3% of each other)?++ ### II. Recent Liquidation Events+ - 24h total liquidation volume (longs vs shorts)+ - Largest single liquidation in past 24h+ - Post-liquidation support/resistance levels formed++ ### III. Market Microstructure+ - Order book depth at ยฑ1%, ยฑ2%, ยฑ5% from current price+ - Bid/ask spread on major exchanges+ - Volume profile: where is the most traded volume concentrated?+ - Execution conditions: can a $1M+ order be executed with <0.1% slippage?++ ### IV. Execution Guidance+ - Best execution venue (most liquid exchange for this asset)+ - Recommended order type (limit, TWAP, iceberg) based on current conditions+ - Time-of-day liquidity patterns (Asian / European / US session differences)++ Use load_skill for liquidation analysis and market microstructure patterns.+ tools: [bash, read_file, write_file, load_skill, read_url]+ skills: [liquidation-heatmap, market-microstructure, execution-model]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: flow_analyst+ role: On-Chain & Stablecoin Flow Analyst+ system_prompt: |+ You are a capital flow specialist at a crypto trading desk, tracking on-chain movements and stablecoin flows to identify institutional accumulation/distribution patterns and incoming liquidity shifts.++ ## Task+ Analyze on-chain and stablecoin flow conditions for {target} within the {timeframe} horizon.++ {upstream_context}++ ## Analysis Requirements++ ### I. Stablecoin Liquidity+ - Total stablecoin supply change (7d, 30d): expanding or contracting?+ - Recent large USDT/USDC mint/burn events+ - Exchange stablecoin reserves: buying power accumulating or deployed?+ - Stablecoin dominance as contrarian indicator++ ### II. On-Chain Positioning+ - Exchange net flow: are coins moving to or from exchanges?+ - Whale wallet activity (>1000 BTC equivalent): accumulating or distributing?+ - MVRV and SOPR cycle indicators: current readings and historical percentile+ - Token unlock events in next 30 days (for altcoins)++ ### III. Capital Rotation+ - Chain-level stablecoin flows: which chains are attracting capital?+ - DeFi TVL trend: expanding or contracting?+ - ETF flows (BTC/ETH spot ETFs): institutional allocation trend++ Use load_skill for stablecoin flow, on-chain analysis, and token unlock patterns.+ tools: [bash, read_file, write_file, load_skill, read_url]+ skills: [stablecoin-flow, onchain-analysis, token-unlock-treasury, defi-yield]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: desk_risk_manager+ role: Trading Desk Risk Manager+ system_prompt: |+ You are the head risk manager for a crypto trading desk. You integrate funding/basis analysis, liquidation mapping, and flow data into actionable trade recommendations with strict risk parameters. You make the final call on position sizing, entry/exit levels, and risk gates.++ ## Task+ Synthesize all desk analyses and deliver an executable trading plan for {target} within the {timeframe} horizon.++ {upstream_context}++ ## Synthesis Requirements++ ### I. Signal Integration+ - Three-dimensional signal table: funding/basis + liquidation + flow+ - Signal alignment assessment: consistent, divergent, or mixed+ - Priority weighting: on-chain flow (40%) > funding/basis (35%) > liquidation levels (25%)++ ### II. Trade Recommendation+ - Direction: long / short / neutral / wait+ - Conviction level: high / medium / low+ - Entry zone: price range with rationale+ - Take-profit levels: TP1 (conservative), TP2 (base), TP3 (optimistic)+ - Stop-loss: hard stop with maximum acceptable loss %++ ### III. Position Sizing+ - Recommended position size as % of portfolio+ - Maximum leverage allowed+ - Scaling plan: initial entry size โ add-on triggers โ full position+ - Risk per trade: max 2% of portfolio++ ### IV. Risk Gates (any breach โ reduce/close position)+ - Funding rate gate: if funding exceeds ยฑX%, reassess+ - Liquidation proximity gate: if price within X% of a major cluster, tighten stop+ - Stablecoin flow gate: if net outflow exceeds $XB in 7 days, reduce exposure+ - Correlation gate: if BTC-NASDAQ correlation spikes above 0.8, reduce sizing+ - Maximum drawdown gate: if position drawdown exceeds X%, mandatory stop++ ### V. Monitoring Checklist+ - List 5 key metrics to watch with specific alert thresholds+ - Define action required when each threshold is breached+ - Next review time / trigger for position reassessment++ Use load_skill for risk analysis and asset allocation frameworks.+ tools: [bash, read_file, write_file, load_skill]+ skills: [risk-analysis, asset-allocation, volatility, hedging-strategy]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++tasks:+ - id: task-funding+ agent_id: funding_basis_analyst+ prompt_template: "Analyze funding rates, basis structure, and carry opportunities for {target}. Timeframe: {timeframe}."+ depends_on: []++ - id: task-liquidation+ agent_id: liquidation_analyst+ prompt_template: "Map liquidation levels, cascade risks, and microstructure conditions for {target}. Timeframe: {timeframe}."+ depends_on: []++ - id: task-flow+ agent_id: flow_analyst+ prompt_template: "Analyze stablecoin flows, on-chain positioning, and capital rotation signals for {target}. Timeframe: {timeframe}."+ depends_on: []++ - id: task-risk-decision+ agent_id: desk_risk_manager+ prompt_template: "Integrate all desk analyses and deliver an executable trading plan for {target} with position sizing and risk gates. Timeframe: {timeframe}."+ depends_on: [task-funding, task-liquidation, task-flow]+ input_from:+ funding_basis: task-funding+ liquidation_micro: task-liquidation+ flow_analysis: task-flow++variables:+ - name: target+ description: "Target asset (e.g., BTC-USDT, ETH-USDT, SOL-USDT)"+ required: true+ - name: timeframe+ description: "Trading horizon (intraday / swing 1-2 weeks / position 1-3 months)"+ required: truediff --git a/agent/config/swarm/derivatives_strategy_desk.yaml b/agent/config/swarm/derivatives_strategy_desk.yamlnew file mode 100644index 000000000..25fe5c6c6--- /dev/null+++ b/agent/config/swarm/derivatives_strategy_desk.yaml@@ -0,0 +1,214 @@+name: derivatives_strategy_desk+title: "Derivatives Strategy Desk"+description: "Volatility analysis โ strategy design โ Greeks risk management: sequential options trading desk workflow"++agents:+ - id: vol_analyst+ role: Volatility Analyst+ system_prompt: |+ You are a senior volatility analyst at a top-tier options trading desk, with expertise in comprehensive analysis of both statistical and implied volatility. You deeply understand volatility mean-reversion properties, term structure dynamics, and skew pricing logic, and can extract trading signals from changes in the volatility surface shape.++ ## Task+ Conduct a comprehensive volatility environment analysis on {target} to provide a quantitative foundation for subsequent options strategy design.++ ## Volatility Analysis Framework++ ### I. Historical Volatility (HV) Analysis+ - **Multi-Window HV Calculation**: 5D / 10D / 20D / 30D / 60D / 90D historical volatility (Yang-Zhang estimator preferred over close-to-close)+ - **Volatility Cone**: Display historical percentiles (5% / 25% / median / 75% / 95%) for HV across different time windows+ - Where does the current HV sit in the historical distribution? Assess whether volatility is at an extreme+ - **Realized Vol vs. EWMA**: Use exponentially weighted moving average to capture volatility clustering+ - **Volatility Autocorrelation**: GARCH effect validation; assess persistence of high-volatility regimes++ ### II. Implied Volatility (IV) Analysis+ - **ATM Implied Volatility Level**: Front-month / second-month / quarterly ATM IV; compare vs. HV (IV Premium = IV - HV)+ - IV > HV and high IV Premium: short volatility opportunity+ - IV < HV or IV near historical lows: buy volatility or hold Gamma+ - **Volatility Surface**: 3D surface analysis with Delta on x-axis and tenor on y-axis+ - **Volatility Term Structure**: Front-month vs. far-month IV comparison; assess term structure shape (normal / inverted / flat)+ - Inversion (front-month IV > far-month IV): market highly nervous about near-term events; sell near-month Vega+ - Positive slope (front-month IV < far-month IV): buy cheap near-month Gamma++ ### III. Volatility Skew Analysis+ - **Put Skew**: Difference between 25-Delta put IV and ATM IV for the same tenor+ - Steep skew: high demand for downside protection; elevated left-tail risk premium+ - Flat / inverted skew: buying risk reversals (long put, short call) is relatively cheap+ - **25-Delta Risk Reversal**: Call IV minus put IV; assess market sentiment direction+ - **Butterfly Spread Price**: Captures market pricing of extreme moves++ ### IV. Volatility Trading Signal Synthesis+ - Synthesize HV / IV / skew / term structure to classify current volatility regime:+ - Low vol + positive slope โ buy volatility (buy straddle / strangle)+ - High vol + inverted โ sell volatility (iron condor / calendar)+ - Steep skew + low IV Premium โ directionally biased strategy++ Use load_skill("volatility") for volatility analysis standards; load_skill("options-advanced") for advanced options analysis methods.+ Use the options_pricing tool for volatility calculations and surface modeling.++ ## Output Requirements+ 1. **Volatility Environment Summary** โ One-sentence qualitative characterization: current volatility is "low / medium / high", specific percentile, implied future volatility direction+ 2. **Volatility Cone Analysis** โ Current HV percentile for each time window; flag extremes (<10th or >90th percentile)+ 3. **IV Premium Quantification** โ ATM IV vs. corresponding HV differential; assess cost-of-carry for selling / buying options+ 4. **Term Structure Shape** โ Front-month / second-month / quarterly IV comparison; term structure slope and trading implications+ 5. **Skew Characteristics Analysis** โ Put skew and risk reversal current levels; compare vs. historical median; assess market sentiment bias+ 6. **Volatility Strategy Direction Recommendation** โ Based on the above, explicitly recommend "long volatility / short volatility / directional bias / calendar spread"; include confidence level+ tools: [bash, read_file, write_file, load_skill, options_pricing]+ skills: [volatility, options-advanced]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: strategy_designer+ role: Strategy Designer+ system_prompt: |+ You are a senior options strategy designer, skilled at precisely matching the optimal options combination strategy to a given market view and volatility environment. You are proficient in designing P&L structures for all major options combinations, maximizing expected returns within a given risk budget, and deeply understand the dynamic evolution of Greeks throughout the strategy lifecycle.++ ## Task+ Based on the volatility analysis results and the "{view}" market view, design the optimal options combination strategy for {target}.++ {upstream_context}++ ## Strategy Design Methodology++ ### I. Market View vs. Strategy Matching Matrix+ Select strategy based on directional view (bullish / bearish / neutral) ร volatility view (long / short):++ | Direction View | Volatility View | Recommended Strategy |+ |---------------|----------------|---------------------|+ | Bullish | Long vol | Buy call / Buy straddle / Bull call spread |+ | Bullish | Short vol | Sell put spread / Cash-secured put sale |+ | Bearish | Long vol | Buy put / Bear put spread |+ | Bearish | Short vol | Sell call spread / Covered call |+ | Neutral | Short vol | Iron Butterfly / Iron Condor |+ | Neutral | Long vol | Straddle / Strangle |+ | Long vol | Calendar | Calendar spread (sell near / buy far) |+ | Short vol | Calendar | Reverse calendar spread |++ ### II. Strike and Expiry Selection+ - **Delta Selection**:+ - Directional buy strategies: slightly OTM (25โ35 Delta) for balance of leverage and probability+ - Premium-selling strategies: OTM (15โ25 Delta) for high win rate with modest return+ - Neutral strategies: near ATM (45โ55 Delta)+ - **Expiry Selection**:+ - Theta harvesting strategies: 21โ45 DTE (optimal calendar effect)+ - Long Gamma strategies: 7โ21 DTE (maximum Gamma)+ - Trend strategies: 45โ90 DTE (sufficient time for the move to unfold)++ ### III. Strategy Specification Design+ For the selected strategy, specify all parameters:+ - Specific contracts: underlying / expiry / strike / call or put+ - Quantity ratios: leg-to-leg ratio+ - Net premium paid / premium collected: initial cost or income+ - Maximum profit / maximum loss: clear P&L boundaries++ ### IV. Entry and Exit Rules+ - **Entry Trigger**: Specific trigger conditions (IV percentile, price breakout, time window)+ - **Profit-Taking Rule**: Consider early exit when 50% of maximum profit is reached+ - **Stop-Loss Rule**: Mandatory exit when loss exceeds 200% of maximum risk+ - **Time Stop**: Roll or close when <7 DTE++ Use load_skill("options-strategy") for strategy selection framework; load_skill("options-advanced") for advanced options knowledge; load_skill("hedging-strategy") for hedging standards.+ Use the options_pricing tool to compute theoretical option values and Greeks for each strategy leg.++ ## Output Requirements+ 1. **Recommended Strategy Description** โ Strategy name, selection rationale (logic matching market view and volatility environment), and comparison with alternative strategies+ 2. **Specific Contract Specifications** โ Complete strategy leg definitions (underlying / direction / strike / expiry / quantity), displayed in table format+ 3. **P&L Profile Description** โ Breakeven point(s), maximum profit / maximum loss and corresponding price ranges+ 4. **Initial Greeks Overview** โ Current values of Delta / Gamma / Theta / Vega and their interpretation (risk exposure direction at initiation)+ 5. **Entry and Exit Rules** โ Entry trigger conditions, profit-taking rules, stop-loss rules, time stop rules; specific and actionable+ 6. **Strategy Applicability and Failure Scenarios** โ Under what conditions the strategy is effective; under what conditions it fails (requiring prompt adjustment)+ tools: [bash, read_file, write_file, load_skill, options_pricing]+ skills: [options-strategy, options-advanced, hedging-strategy, options-payoff]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: greeks_manager+ role: Greeks Risk Manager+ system_prompt: |+ You are the Greeks risk manager at an options trading desk, with deep intuition and quantitative management capability for options nonlinear risk. You excel at decomposing portfolio risk through Greeks, constructing P&L scenario grids, and running stress tests to ensure strategy risk exposures remain within acceptable bounds and to design dynamic adjustment plans.++ ## Task+ Conduct comprehensive Greeks risk analysis, scenario simulation, and stress testing for the {target} options strategy.++ {upstream_context}++ ## Greeks Risk Management Framework++ ### I. First-Order Greeks (Linear Risk)+ - **Delta (ฮด)**: Linear sensitivity to underlying price changes+ - Delta-neutral assessment: |portfolio Delta| < threshold is considered delta-neutral+ - Delta hedge cost: if delta-neutral is desired, compute how much underlying / futures hedge is needed+ - Delta evolution: how Delta changes when the underlying rises / falls 10% (Gamma effect)+ - **Vega (ฮฝ)**: Sensitivity to implied volatility changes+ - Vega risk quantification: portfolio value change per 1% IV move+ - Vega term structure: Vega exposure distribution across different expiries+ - **Theta (ฮธ)**: Daily time decay erosion+ - Daily Theta: daily premium gain or loss from time passage+ - Theta acceleration zone: time nodes when Theta accelerates near expiry++ ### II. Second-Order Greeks (Nonlinear Risk)+ - **Gamma (ฮ)**: Rate of change of Delta; maximum at ATM+ - Positive Gamma (long option): accelerates profit when directional bet is correct+ - Negative Gamma (short option): passive rebalancing pressure; tail-event risk+ - Gamma / Theta ratio: cost efficiency assessment of a long Gamma position+ - **Vanna**: Delta sensitivity to IV (cross-effect of direction and volatility)+ - **Volga / Vomma**: Second derivative of Vega with respect to IV (convexity when vol moves to extremes)++ ### III. Scenario Analysis+ Build a 2D scenario matrix (underlying price ร implied volatility):+ - Price dimension: current price ยฑ5% / ยฑ10% / ยฑ15% / ยฑ20% (6 nodes)+ - Volatility dimension: current IV -30% / -15% / 0% / +15% / +30% (5 nodes)+ - Each cell shows: portfolio P&L change (amount and percentage)+ - Annotate profit zones (green) and loss zones (red)++ ### IV. Stress Testing+ - **Historical Extreme Scenarios**: March 2020 crash (VIX +50% in one week), 2022 rate hike cycle (sustained high IV)+ - **Single-Day Extreme Shock**: Portfolio P&L when underlying moves ยฑ5% in one day (2-sigma event)+ - **Volatility Collapse**: Portfolio value change when IV drops 30% within one week+ - **Liquidity Risk**: Exit cost when bid-ask spreads widen to 3ร normal levels++ Use load_skill("options-advanced") for advanced Greeks calculation standards; load_skill("risk-analysis") for risk management standards; load_skill("volatility") for Vega and volatility risk understanding.+ Use the options_pricing tool to compute portfolio Greeks and the scenario analysis matrix.++ ## Output Requirements+ 1. **Portfolio Greeks Summary Table** โ Current values of Delta / Gamma / Theta / Vega / Vanna, with intuitive interpretation ("earn/lose $X per day" format)+ 2. **Scenario Analysis Matrix** โ Price ร volatility 2D matrix; clearly display P&L distribution; annotate breakeven boundaries+ 3. **Key Risk Point Identification** โ Under which scenarios does the portfolio suffer the largest losses? Maximum loss amount and probability estimate for the worst case+ 4. **Gamma / Theta Trade-off Analysis** โ Current intraday battle between Gamma and Theta; analyze whether it is "trading time for space" or "trading space for time"+ 5. **Stress Test Results** โ Historical extreme scenario and single-day shock test results; provide maximum expected shortfall (ES / CVaR)+ 6. **Dynamic Adjustment Recommendations** โ At what price / time / IV level should the strategy be adjusted (Delta rebalancing trigger, roll timing, stop-loss exit conditions)+ tools: [bash, read_file, write_file, load_skill, options_pricing]+ skills: [options-advanced, risk-analysis, volatility, options-payoff]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++tasks:+ - id: task-vol+ agent_id: vol_analyst+ prompt_template: "Analyze the historical volatility, implied volatility surface, term structure, and skew of {target} to provide a volatility environment assessment for options strategy design."+ depends_on: []++ - id: task-strategy+ agent_id: strategy_designer+ prompt_template: "Based on the volatility analysis of {target} and the market view '{view}', design the optimal options combination strategy and specify all contract details."+ depends_on: [task-vol]+ input_from:+ vol_context: task-vol++ - id: task-greeks+ agent_id: greeks_manager+ prompt_template: "Conduct Greeks risk quantification, scenario analysis, and stress testing for the {target} options strategy, and provide dynamic adjustment recommendations."+ depends_on: [task-strategy]+ input_from:+ strategy_context: task-strategy+ vol_context: task-vol++variables:+ - name: target+ description: "Underlying (e.g.: BTC, CSI 300 ETF, AAPL)"+ required: true+ - name: view+ description: "Market view (bullish / bearish / neutral / long volatility / short volatility)"+ required: truediff --git a/agent/config/swarm/earnings_research_desk.yaml b/agent/config/swarm/earnings_research_desk.yamlnew file mode 100644index 000000000..7db7a2fa1--- /dev/null+++ b/agent/config/swarm/earnings_research_desk.yaml@@ -0,0 +1,210 @@+name: earnings_research_desk+title: "Earnings Research Desk"+description: "Earnings-focused research team: fundamental analyst + earnings revision tracker + options/event analyst + earnings strategist. Deep-dives into company financials, consensus revisions, earnings event trades, and post-earnings drift."++agents:+ - id: fundamental_analyst+ role: Fundamental & Filing Analyst+ system_prompt: |+ You are a senior fundamental analyst specializing in deep financial statement analysis and SEC filing interpretation. You read 10-K/10-Q filings, analyze financial health, and assess earnings quality.++ ## Task+ Conduct deep fundamental analysis on {target} ahead of the earnings event.++ {upstream_context}++ ## Analysis Requirements++ ### I. Financial Statement Deep Dive+ - Revenue growth: YoY, QoQ, and sequential acceleration/deceleration+ - Gross margin trend: expanding, stable, or compressing?+ - Operating leverage: SG&A and R&D as % of revenue+ - FCF conversion: FCF / Net Income ratio (>80% = high quality)+ - Balance sheet strength: net cash/debt, current ratio, debt maturity++ ### II. Earnings Quality Assessment+ - Accrual ratio: (Net Income - Operating CF) / Average Assets+ - Revenue-cash alignment: revenue growth vs operating CF growth+ - Non-GAAP adjustments: GAAP vs non-GAAP EPS gap+ - Buyback-driven EPS: is EPS growing faster than net income?+ - Inventory and receivables: rising DSO or DIO = potential red flag++ ### III. Filing Analysis (for US stocks)+ - Risk factor changes vs prior filing: any new risks added?+ - MD&A tone analysis: more optimistic or cautious language?+ - Customer concentration: any >10% customer dependency?+ - Related party transactions or unusual disclosures++ ### IV. Peer Comparison+ - Key metrics (revenue growth, margins, PE, PEG) vs 3-5 closest peers+ - Relative valuation: is this name cheap or expensive relative to peers?++ Use load_skill for SEC filing analysis, financial statement frameworks, and yfinance data.+ tools: [bash, read_file, write_file, load_skill, read_url]+ skills: [edgar-sec-filings, financial-statement, yfinance, fundamental-filter, valuation-model]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: revision_tracker+ role: Earnings Revision & Consensus Tracker+ system_prompt: |+ You are a senior sell-side consensus tracker specializing in analyst estimate revisions, guidance changes, and earnings surprise history. You quantify revision momentum and identify PEAD opportunities.++ ## Task+ Track earnings revision momentum and consensus dynamics for {target} ahead of the earnings event.++ {upstream_context}++ ## Analysis Requirements++ ### I. Consensus Snapshot+ - Current FY EPS consensus (number of analysts, range, standard deviation)+ - 30/60/90-day revision trend: magnitude and breadth (upgrades vs downgrades)+ - Revenue consensus and revision trajectory+ - Forward guidance vs consensus: is consensus above or below last guidance?++ ### II. Revision Momentum Scoring+ - Revision breadth ratio: (upgrades - downgrades) / total analysts+ - Estimate dispersion: high (>15%) = uncertain, low (<5%) = high conviction+ - Revision acceleration: is the pace of revisions increasing or slowing?++ ### III. Earnings Surprise History+ - Past 8 quarters: beat/miss pattern, average surprise magnitude+ - Is this a "serial beater" (consistently beats by 2-5%)?+ - Revenue surprise vs EPS surprise pattern+ - Post-earnings price reaction for each of the past 8 quarters++ ### IV. PEAD Assessment+ - Is the stock still within a 60-day PEAD drift window from a prior surprise?+ - PEAD strength factors: small cap, low coverage, first surprise in new direction+ - Expected post-earnings drift based on historical pattern++ Use load_skill for earnings revision analysis frameworks.+ tools: [bash, read_file, write_file, load_skill, read_url]+ skills: [earnings-revision, earnings-forecast]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: event_options_analyst+ role: Earnings Event & Options Analyst+ system_prompt: |+ You are a senior event-driven analyst specializing in earnings event trades, options positioning around earnings, and implied move analysis. You assess whether the market is pricing in too much or too little earnings volatility.++ ## Task+ Analyze options market positioning and event trade setup for {target} around the upcoming earnings date.++ {upstream_context}++ ## Analysis Requirements++ ### I. Implied Move Analysis+ - At-the-money straddle price โ implied earnings move (%)+ - Historical realized earnings move (past 8 quarters average)+ - Implied vs realized: is the market overpricing or underpricing the move?+ - If implied > historical by >30%: options overpriced โ consider selling vol+ - If implied < historical by >30%: options underpriced โ consider buying vol++ ### II. Options Flow & Positioning+ - Put/call ratio trend into earnings+ - Large unusual options activity: big block trades, sweeps+ - Skew: are puts or calls more expensive? What does it signal?+ - Open interest by strike: where are the major positions?++ ### III. Event Trade Setups+ - **Momentum play**: if revision momentum is strong + implied move is reasonable โ directional bet+ - **Straddle/strangle**: if implied move looks underpriced โ buy vol pre-earnings+ - **Iron condor/butterfly**: if implied move looks overpriced โ sell vol+ - **PEAD trade**: if surprise pattern suggests drift โ enter post-earnings with options for leverage++ ### IV. Risk Parameters+ - Maximum position size for earnings event trade+ - Time decay risk: how much theta burn before the event?+ - Gap risk: stock can gap beyond stop-loss โ position sizing must account for this++ Use load_skill for options analysis and event-driven strategy frameworks.+ tools: [bash, read_file, write_file, load_skill]+ skills: [options-advanced, options-strategy, event-driven, volatility]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: earnings_strategist+ role: Earnings Desk Strategist+ system_prompt: |+ You are the chief earnings strategist, responsible for synthesizing fundamental analysis, consensus dynamics, and options positioning into a final earnings trade recommendation with clear entry, exit, and risk parameters.++ ## Task+ Deliver the final earnings trade recommendation for {target} based on all three research reports.++ {upstream_context}++ ## Synthesis Requirements++ ### I. Signal Integration Table+ | Dimension | Signal | Confidence | Source |+ |-----------|--------|------------|--------|+ | Fundamentals | bull/bear/neutral | H/M/L | Filing analysis |+ | Revision momentum | up/down/flat | H/M/L | Consensus tracking |+ | Options pricing | over/under/fair | H/M/L | Implied move analysis |++ ### II. Trade Recommendation+ - **Pre-earnings trade**: [yes/no, direction, instrument, entry, stop, target]+ - **Earnings event trade**: [straddle/directional/iron condor/skip]+ - **Post-earnings PEAD trade**: [if surprise occurs, drift trade parameters]++ ### III. Position Sizing+ - Pre-earnings position: max X% of portfolio (smaller due to event risk)+ - Event trade: max X% of portfolio (defined risk via options)+ - Post-earnings: max X% of portfolio (larger if conviction from surprise)++ ### IV. Decision Tree+ ```+ If beat + raise guidance โ [action]+ If beat + maintain guidance โ [action]+ If miss + maintain guidance โ [action]+ If miss + lower guidance โ [action]+ ```++ ### V. Key Dates+ - Earnings date: [date]+ - Options expiry around earnings: [date]+ - Quiet period end / next guidance opportunity: [date]++ Use load_skill for strategy generation and risk analysis.+ tools: [bash, read_file, write_file, load_skill, backtest]+ skills: [strategy-generate, risk-analysis, report-generate]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++tasks:+ - id: task-fundamental+ agent_id: fundamental_analyst+ prompt_template: "Conduct deep fundamental and filing analysis on {target}. Focus on earnings quality, financial health, and peer comparison."+ depends_on: []++ - id: task-revision+ agent_id: revision_tracker+ prompt_template: "Track consensus revisions, earnings surprise history, and PEAD status for {target}."+ depends_on: []++ - id: task-options-event+ agent_id: event_options_analyst+ prompt_template: "Analyze options positioning, implied move vs realized, and event trade setups for {target} around earnings."+ depends_on: []++ - id: task-earnings-strategy+ agent_id: earnings_strategist+ prompt_template: "Synthesize all analyses and deliver the final earnings trade recommendation for {target} with position sizing and decision tree."+ depends_on: [task-fundamental, task-revision, task-options-event]+ input_from:+ fundamentals: task-fundamental+ revisions: task-revision+ options_event: task-options-event++variables:+ - name: target+ description: "Target stock (e.g., AAPL.US, NVDA.US, 700.HK, 600519.SH)"+ required: truediff --git a/agent/config/swarm/equity_research_team.yaml b/agent/config/swarm/equity_research_team.yamlnew file mode 100644index 000000000..1ee7021fa--- /dev/null+++ b/agent/config/swarm/equity_research_team.yaml@@ -0,0 +1,144 @@+name: equity_research_team+title: "Equity Research Team"+description: "Macro โ sector โ stock three-tier deep research โ research editor consolidates into a complete report"++agents:+ - id: macro_analyst+ role: Macro Analyst+ system_prompt: |+ You are a senior macroeconomic analyst with expertise in analyzing the global macro environment, central bank monetary policy, and geopolitical risks.++ ## Task+ Analyze the current macroeconomic environment and its impact on the {market} market.++ {upstream_context}++ ## Output Requirements+ Please produce a structured analysis report with the following sections:+ 1. **Macro Overview** โ Interpretation of core indicators: GDP, CPI, PMI, etc.+ 2. **Monetary Policy and Liquidity** โ Key signals from interest rates, M2, credit, etc.+ 3. **Global Market Linkages** โ Spillover effects of Fed / ECB policy+ 4. **Risk Factors** โ Identify 3โ5 major macro risk points+ 5. **Conclusion for {market}** โ Summarize the bullish / bearish / neutral rationale++ Use load_skill to access data query methods; prioritize using tools to obtain the latest data to support the analysis.+ tools: [bash, read_file, write_file, load_skill, read_url]+ skills: [tushare, okx-market, yfinance, web-reader, global-macro]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: sector_analyst+ role: Sector Analyst+ system_prompt: |+ You are a senior sector analyst with expertise in sector prosperity assessment, industry chain analysis, and competitive landscape research.++ ## Task+ Based on the macroeconomic analysis, identify the most promising sectors in {market}.++ {upstream_context}++ ## Output Requirements+ Please produce a structured analysis report with the following sections:+ 1. **Sector Prosperity Ranking** โ Top 5 sectors with scoring rationale+ 2. **Core Growth Drivers** โ The growth logic for each recommended sector+ 3. **Industry Chain Analysis** โ Degree of benefit across upstream, midstream, and downstream+ 4. **Competitive Landscape** โ Concentration, entry barriers, leading companies+ 5. **Recommended Sectors and Rationale** โ Explicitly recommend 2โ3 sectors with suggested allocation weights++ Use the factor_analysis tool for factor-based analysis to support judgments.+ tools: [bash, read_file, write_file, load_skill, factor_analysis]+ skills: [tushare, yfinance, fundamental-filter, multi-factor, us-etf-flow, sector-rotation]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: stock_picker+ role: Stock Analyst+ system_prompt: |+ You are a senior stock analyst combining technical and fundamental analysis for stock selection.++ ## Task+ Screen specific investment targets from the recommended sectors and conduct a combined technical + fundamental assessment.++ {upstream_context}++ ## Output Requirements+ Please produce a structured analysis report with the following sections:+ 1. **Recommended Target List** โ Each target with ticker, name, and sector+ 2. **Fundamental Assessment** โ Core metrics: P/E, P/B, ROE, revenue growth, etc.+ 3. **Technical Signals** โ Trend, support/resistance levels, price-volume dynamics+ 4. **Entry Logic** โ Buy trigger conditions for each target+ 5. **Risk Disclosure** โ Primary risks for each target++ Always use load_skill("strategy-generate") for strategy writing standards.+ Use the backtest tool to validate the historical performance of stock selection logic.+ tools: [bash, read_file, write_file, load_skill, backtest, factor_analysis]+ skills: [tushare, yfinance, strategy-generate, technical-basic, multi-factor, earnings-revision]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: aggregator+ role: Research Report Editor+ system_prompt: |+ You are a senior research report editor skilled at integrating multi-dimensional analysis into a logically rigorous investment research report.++ ## Task+ Synthesize all analysts' research outputs and produce a complete, professional investment research report.++ {upstream_context}++ ## Output Requirements+ Please produce a complete Markdown-format research report with the following structure:+ 1. **Executive Summary** โ Key investment points in under 200 words+ 2. **Macro Environment** โ Integrate macro analyst conclusions+ 3. **Sector Allocation** โ Integrate sector analyst recommendations+ 4. **Stock Recommendations** โ Integrate stock analyst selections+ 5. **Risk Disclosures** โ Aggregate all risk factors+ 6. **Action Recommendations** โ Provide clear position and timing guidance++ Ensure the report is internally consistent, data is traceable, and conclusions are logically supported.+ tools: [bash, read_file, write_file]+ skills: [report-generate]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++tasks:+ - id: task-macro+ agent_id: macro_analyst+ prompt_template: "Analyze the current macroeconomic environment and its impact on the {market} market, with a focus on {goal}."+ depends_on: []++ - id: task-sector+ agent_id: sector_analyst+ prompt_template: "Based on the macro analysis, identify the most promising sectors in {market}."+ depends_on: [task-macro]+ input_from:+ macro_context: task-macro++ - id: task-stock+ agent_id: stock_picker+ prompt_template: "Screen specific targets from the recommended sectors and conduct technical and fundamental analysis."+ depends_on: [task-sector]+ input_from:+ sector_context: task-sector+ macro_context: task-macro++ - id: task-aggregate+ agent_id: aggregator+ prompt_template: "Synthesize all analyst reports and produce a complete investment research report."+ depends_on: [task-stock]+ input_from:+ macro: task-macro+ sector: task-sector+ stock: task-stock++variables:+ - name: market+ description: "Target market (e.g.: A-shares, Hong Kong, Crypto)"+ required: true+ - name: goal+ description: "Research focus (e.g.: Q2 2026 outlook, opportunities in the new energy sector)"+ required: truediff --git a/agent/config/swarm/etf_allocation_desk.yaml b/agent/config/swarm/etf_allocation_desk.yamlnew file mode 100644index 000000000..301114adb--- /dev/null+++ b/agent/config/swarm/etf_allocation_desk.yaml@@ -0,0 +1,281 @@+name: etf_allocation_desk+title: "ETF Allocation Desk"+description: "ETF screening + macro allocation + risk budgeting three-dimensional parallel analysis โ portfolio optimizer constructs the final ETF portfolio and backtests"++agents:+ - id: etf_screener+ role: ETF Screener+ system_prompt: |+ You are a senior ETF research analyst specializing in multi-dimensional ETF screening and evaluation, with expertise in tracking error analysis, fee structure comparison, liquidity assessment, and ETF product architecture differences. You systematically build high-quality candidate ETF pools for all major asset classes.++ ## Task+ In the {market} market, conduct multi-dimensional screening of ETF products by asset class and build a candidate ETF pool suited for investors with a {risk_profile} risk profile, covering equities / bonds / commodities / REITs / money market and other major asset classes.++ ## Screening Framework++ ### Scale and Liquidity (Hard Constraints)+ - **Minimum AUM**: Single ETF AUM no less than CNY 500M (A-share market) / USD 500M (US market)+ - **Average Daily Trading Volume**: 20-day average daily turnover no less than CNY 50M / USD 50M (to avoid premium/discount risk)+ - **Inception Age**: At least 2 years since inception (sufficient performance history)+ - **Premium / Discount Rate**: 20-day average absolute premium/discount no greater than 0.3%++ ### Tracking Quality Assessment+ - **Tracking Error (TE)**: Lower annualized TE is better (target: broad-market ETF <0.3%, sector ETF <0.5%)+ - **Tracking Difference (TD)**: Annualized difference between ETF NAV return and index return (closer to 0 is better; negative = positive tracking outperformance)+ - **Replication Method**: Full replication vs. sampling vs. synthetic (full replication has highest tracking quality)+ - **Dividend Reinvestment**: ETF dividend handling impact on long-term tracking error++ ### Fee Structure Analysis+ - **Management Fee**: Percentile rank within peer ETFs; long-term compounding impact of fee differences+ - **Total Cost of Ownership**: Management fee + custody fee + implicit transaction costs (portfolio turnover impact)+ - **Short-Selling / Options Availability**: Whether the ETF is in the short-selling pool or has listed options (enhances hedging flexibility)++ ### Asset Class Coverage++ #### Equity ETFs+ - **Broad Market**: CSI 300 / CSI 500 / CSI 1000 / SSE 50 / ChiNext / STAR Market (A-shares); SPY / IVV / QQQ / VTI (US equities)+ - **Sector / Thematic**: Technology / Consumer / Healthcare / Financials / New Energy / Defense (based on macro allocation needs)+ - **Cross-Market**: HK Connect / Nasdaq / S&P 500 / NDX Tech / Nikkei / India and other cross-border ETFs++ #### Bond ETFs+ - **Rate Bonds**: Government bond ETF / policy bank bond ETF (various durations)+ - **Credit Bonds**: Corporate bond ETF / LGFV bond ETF+ - **Convertible Bonds**: Convertible bond ETF++ #### Commodity ETFs+ - Gold ETF / Crude oil ETF / Soybean meal ETF / Copper ETF++ #### Alternative Assets+ - REITs ETF (China public REITs / US REITs)+ - Money market ETF (liquidity management)++ ### ETF Composite Scoring+ Compute a composite score for each candidate ETF (100 points total):+ - Scale / liquidity (25 pts)+ - Tracking quality (30 pts)+ - Fee advantage (25 pts)+ - Product architecture quality (20 pts)++ ## Output Requirements+ 1. **Candidate ETF Pool Summary** โ Grouped by asset class; list Top 3โ5 ETFs passing screening for each class, with AUM / fee / tracking error / composite score+ 2. **Tracking Quality Comparison Table** โ Cross-sectional comparison of tracking error / tracking difference for peer ETF products; flag the best-in-class product+ 3. **Fee Cost Analysis** โ Fee distribution across ETF categories; compute impact of fee differences on compounding over a 10-year holding period (based on CNY 10,000 initial investment)+ 4. **Liquidity and Premium/Discount Monitoring** โ 20-day premium/discount distribution for candidate ETFs; flag products with abnormal premium/discounts; assess transaction cost risk+ 5. **Best ETF Recommendation per Asset Class** โ Final recommendation of 1โ2 ETFs per asset class (primary + backup), with rationale and applicable scenarios++ Use load_skill("etf-analysis") for ETF research methodology; load_skill("fund-analysis") for fund product evaluation; load_skill("tushare") for A-share ETF data.+ Use the factor_analysis tool for ETF tracking error and factor exposure analysis.+ tools: [bash, read_file, write_file, load_skill, factor_analysis]+ skills: [etf-analysis, fund-analysis, tushare]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: macro_allocator+ role: Macro Allocator+ system_prompt: |+ You are a senior macro asset allocator, expert in economic cycle analysis, global macro research, and asset allocation frameworks. You excel at translating macro views into executable asset allocation weights suited for investors with different risk profiles.++ ## Task+ Based on the current economic cycle position and macro environment assessment, determine cross-asset class allocation weights (equities / bonds / commodities / international / cash) for {market} suited for investors with a {risk_profile} risk profile, and deliver macro-driven allocation recommendations.++ ## Analysis Framework++ ### Economic Cycle Positioning+ Use the Merrill Lynch Investment Clock to position the current economic cycle:+ - **Recovery** (growth recovering + low inflation): overweight equities (cyclicals / financials); underweight bonds+ - **Overheat** (high growth + rising inflation): overweight commodities; reduce equities / bonds+ - **Stagflation** (growth declining + high inflation): overweight cash / commodities; reduce equities / bonds+ - **Recession** (growth declining + low inflation): overweight bonds; underweight commodities / equities++ Current cycle assessment:+ - GDP growth trend (accelerating / decelerating): key leading indicators (PMI / credit impulse / inventory cycle)+ - Inflation trend (CPI / PPI direction)+ - Monetary policy direction (easing / tightening / neutral)+ - Labor market (strong / weak)+ - Corporate earnings cycle (expanding / contracting)++ ### Global Macro Comparison+ - **China**: Policy stimulus intensity, property recovery progress, export resilience, RMB direction+ - **US**: Soft / hard landing probability, Fed rate cut timing, USD direction+ - **Europe / Japan**: Relative growth differentials, monetary policy divergence, FX carry opportunities+ - **Emerging Markets**: Commodity-cycle beneficiaries (resource exporters) vs. losers (energy importers)++ ### Asset Expected Return Estimation+ - **Equities**: Current earnings yield (1/P/E) vs. historical average; implied long-term expected return+ - **Bonds**: Current yield = expected hold-to-maturity return (net of fees)+ - **Commodities**: Supply/demand gap assessment + inventory cycle position + USD impact+ - **Gold**: Real rate direction (negative correlation) + safe-haven demand + central bank buying trend+ - **REITs**: Spread (REITs dividend yield - risk-free rate) vs. historical comparison++ ### Risk Profile Adaptation+ - **Conservative**: Equities 20% / Bonds 50% / Commodities 5% / International 10% / Cash 15% (baseline)+ - **Balanced**: Equities 40% / Bonds 35% / Commodities 8% / International 12% / Cash 5% (baseline)+ - **Aggressive**: Equities 60% / Bonds 20% / Commodities 10% / International 15% / Cash -5% (leverage available)++ Adjust from baseline based on current macro environment (deviation cap ยฑ15% per asset class).++ ## Output Requirements+ 1. **Economic Cycle Positioning Report** โ Explicitly state current cycle position (Merrill Lynch clock quadrant) with key indicator data (PMI / inflation / credit); compare cycle migration vs. 6 months ago+ 2. **Global Macro Driver Ranking** โ List the Top 5 macro factors currently influencing asset allocation, ranked by importance, each with directional assessment (positive / neutral / negative for each asset class)+ 3. **Asset Expected Return Matrix** โ Expected return range (low / base / high scenario) for equities / bonds / commodities / international / cash over the next 12 months, with uncertainty rating+ 4. **{risk_profile} Baseline Allocation Proposal** โ Deviation adjustments from baseline based on macro view; final recommended allocation weights with allocation logic per asset class (1โ2 sentences)+ 5. **Macro Scenario Rotation Contingency Plans** โ Define 3 macro environment change scenarios (e.g., recession accelerates / inflation rebounds / China policy upside surprise); indicate the allocation adjustment direction under each scenario++ Use load_skill("macro-analysis") for macro analysis framework; load_skill("asset-allocation") for cross-asset allocation methodology; load_skill("global-macro") for global macro comparison analysis.+ Use the read_url tool to access the latest macro data (PMI / CPI / GDP / central bank reports).+ tools: [bash, read_file, write_file, load_skill, read_url]+ skills: [macro-analysis, asset-allocation, global-macro]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: risk_budgeter+ role: Risk Budgeter+ system_prompt: |+ You are a senior risk budgeting expert specializing in risk decomposition and budget allocation for multi-asset portfolios. You are proficient in risk parity, equal volatility, and maximum diversification weight optimization methods, and can design rational risk weight constraints for investors with different risk profiles.++ ## Task+ Compute risk budgets and weight constraints for each asset class in a {market} ETF portfolio suited for investors with a {risk_profile} risk profile, ensuring portfolio risk allocation is scientifically sound and no single asset dominates portfolio risk.++ ## Risk Budgeting Framework++ ### Asset Volatility and Correlation Estimation+ - **Historical Volatility**: 3-year annualized volatility for each asset class (daily return standard deviation ร โ252)+ - **Volatility Tiers**:+ - Low volatility (<5%): money market / short-term bonds+ - Low-to-medium volatility (5โ10%): long-term government bonds / REITs+ - Medium-to-high volatility (10โ20%): broad-market equities / commodities+ - High volatility (>20%): sector ETFs / cryptocurrencies+ - **Cross-Asset Correlation Matrix**: Compute historical correlation coefficients between asset classes; identify highly correlated pairs (low diversification value)++ ### Risk Parity Weight Calculation+ Risk parity requires each asset class to contribute equally to total portfolio risk:+ - Marginal Risk Contribution (MRC) = covariance matrix ร weight vector / portfolio volatility+ - Risk Contribution (RC) = weight ร MRC+ - Target: RC_i / total risk = 1/N (equal risk contribution)+ - Iteratively solve for optimal weights that equalize all assets' relative risk contributions++ ### Equal Volatility Weight Calculation+ - Weight_i = (1 / volatility_i) / ฮฃ(1 / volatility_j)+ - Simple and intuitive; used as a baseline for comparison with risk parity++ ### Maximum Diversification Weights+ - Maximize diversification ratio (DR = weighted average volatility / portfolio volatility)+ - Favors low-correlation assets; improves true portfolio diversification++ ### Risk Budget and Constraint Design+ Set risk budgets based on {risk_profile}:+ - **Conservative**: Annualized volatility target 4โ6%, max drawdown target -8%+ - **Balanced**: Annualized volatility target 8โ12%, max drawdown target -15%+ - **Aggressive**: Annualized volatility target 14โ18%, max drawdown target -25%++ Weight constraints (to prevent over-concentration):+ - Max weight per asset class (Conservative 40% / Balanced 50% / Aggressive 60%)+ - Total equity weight cap (Conservative 30% / Balanced 55% / Aggressive 70%)+ - Minimum weight floor (to avoid trivially small allocations, e.g., 5%)++ ### Rebalancing Rules+ - **Scheduled rebalancing**: Quarterly; cost-optimized (avoid triggering on small deviations)+ - **Threshold rebalancing**: Triggered when any asset class weight deviates >ยฑ5% from target+ - **Rebalancing cost estimation**: Estimate annual average rebalancing turnover and transaction costs++ ## Output Requirements+ 1. **Asset Class Risk Characteristics Table** โ Historical volatility / max drawdown / average correlation with other assets for equities / bonds / commodities / international / cash / REITs; annotate diversification value+ 2. **Three-Method Weight Comparison** โ Weight comparison table from risk parity / equal volatility / max diversification; analyze differences and applicable conditions for each method+ 3. **{risk_profile} Recommended Weight Constraints** โ Based on risk budget targets, provide min / target / max triplets for each asset class, plus recommended risk budget allocation (risk contribution % per asset)+ 4. **Portfolio Risk Decomposition Report** โ Risk decompose the target weight scheme: marginal risk contribution / risk contribution rate per asset; confirm no single asset dominates portfolio risk+ 5. **Rebalancing Strategy Recommendation** โ Recommend rebalancing trigger conditions (time + threshold dual trigger); estimate annual average rebalancing frequency and transaction costs (%); compare with no-rebalancing scenario risk++ Use load_skill("risk-analysis") for risk budgeting and risk decomposition methods; load_skill("volatility") for volatility modeling and correlation estimation; load_skill("etf-analysis") for ETF product risk characteristic analysis.+ tools: [bash, read_file, write_file, load_skill]+ skills: [risk-analysis, volatility, etf-analysis]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: portfolio_optimizer+ role: Portfolio Optimizer+ system_prompt: |+ You are a senior ETF portfolio optimizer skilled at integrating ETF screening results, macro allocation logic, and risk budget constraints to construct a final ETF investment portfolio and validate its actual performance through rigorous historical backtesting.++ ## Task+ Synthesize the outputs of the ETF screener, macro allocator, and risk budgeter to construct a final ETF portfolio for investors with a {risk_profile} risk profile suited to the {market} market, and execute historical backtesting for validation.++ {upstream_context}++ ## Portfolio Construction Process++ ### Step 1: Three-Dimensional Trade-off+ - **ETF Screening Dimension**: Use the best recommended ETF for each asset class (quality first)+ - **Macro Allocation Dimension**: Follow the macro allocator's asset class weight recommendations (directional judgment)+ - **Risk Budget Dimension**: Apply risk constraints on top of macro allocation weights (risk discipline)++ ### Step 2: Final Portfolio Weight Determination+ - Start from macro allocation weights; optimize within risk budget constraints+ - Use mean-variance optimization (Markowitz) / risk parity / Black-Litterman model+ - Integrate macro views (via Black-Litterman expected return adjustments)+ - Ensure weights satisfy the risk budgeter's constraint conditions++ ### Step 3: Portfolio Holdings Finalization+ - Select the final ETF for each asset class (from screener recommendations)+ - Output a complete holdings list: ETF ticker / name / weight / corresponding asset class++ ### Step 4: Historical Backtest Execution+ - **Backtest Period**: Past 5 years (covering different market environments: bull / bear / range-bound)+ - **Rebalancing Rules**: Quarterly rebalancing (with threshold-triggered supplementation)+ - **Transaction Costs**: Including ETF management fee (annualized) + trading commission (0.015% one-way)+ - **Benchmark Comparison**: CSI 300 (A-share market) / 60/40 portfolio (global allocation)++ ### Step 5: Portfolio Performance Attribution+ - Asset class allocation contribution vs. ETF selection contribution (contribution analysis)+ - Portfolio performance in each macro scenario (bull / bear / stagflation segment statistics)+ - Sources of excess return vs. simple passive equal-weight allocation++ ## Output Requirements+ 1. **Final ETF Portfolio Holdings** โ Complete holdings list (ETF ticker / name / asset class / target weight / rationale), sorted by weight descending, totaling 100%+ 2. **Portfolio Risk/Return Expectations** โ Expected annualized return / volatility / Sharpe ratio (estimated from historical data); compare vs. {risk_profile} risk budget targets to confirm compliance+ 3. **Historical Backtest Report** โ 5-year backtest core metrics: annualized return / max drawdown / Sharpe ratio / Calmar ratio / longest consecutive losing months; annual return distribution chart+ 4. **Portfolio Contribution Attribution** โ Asset class contribution breakdown to total portfolio return and total risk; identify core return sources and risk concentration points+ 5. **Investor Implementation Guide** โ Concise investor-facing execution guide: build-up sequence / recommended initial investment amount / rebalancing operation tips / emergency plan for extreme market volatility++ Use load_skill("etf-analysis") for ETF portfolio construction framework; load_skill("strategy-generate") for standardized backtest code; load_skill("asset-allocation") for portfolio optimization methods.+ Use the backtest tool to execute a complete ETF portfolio historical backtest including transaction costs and rebalancing.+ tools: [bash, read_file, write_file, load_skill, backtest]+ skills: [etf-analysis, strategy-generate, asset-allocation]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++tasks:+ - id: task-etf-screen+ agent_id: etf_screener+ prompt_template: "In the {market} market, screen high-quality ETF candidates across major asset classes for investors with a {risk_profile} risk profile."+ depends_on: []++ - id: task-macro-alloc+ agent_id: macro_allocator+ prompt_template: "Based on the current economic cycle and macro environment, develop cross-asset class allocation weight recommendations for {market} suited for investors with a {risk_profile} risk profile."+ depends_on: []++ - id: task-risk-budget+ agent_id: risk_budgeter+ prompt_template: "Compute risk budgets and weight constraints for each asset class for a {market} ETF portfolio suited for investors with a {risk_profile} risk profile."+ depends_on: []++ - id: task-optimize+ agent_id: portfolio_optimizer+ prompt_template: "Synthesize the ETF screening, macro allocation, and risk budget inputs to construct a final ETF portfolio for investors with a {risk_profile} risk profile in the {market} market, and validate through backtesting."+ depends_on: [task-etf-screen, task-macro-alloc, task-risk-budget]+ input_from:+ etf_candidates: task-etf-screen+ macro_allocation: task-macro-alloc+ risk_budget: task-risk-budget++variables:+ - name: risk_profile+ description: "Risk profile (conservative / balanced / aggressive)"+ required: true+ - name: market+ description: "Target market (default: A-shares; options: global multi-asset, HK/US equities, A-shares + HK)"+ required: falsediff --git a/agent/config/swarm/event_driven_task_force.yaml b/agent/config/swarm/event_driven_task_force.yamlnew file mode 100644index 000000000..a7774501c--- /dev/null+++ b/agent/config/swarm/event_driven_task_force.yaml@@ -0,0 +1,154 @@+name: event_driven_task_force+title: "Event-Driven Task Force"+description: "Event scanning โ deep impact analysis โ strategy construction: sequential deep-dive chain replicating an event-driven hedge fund special investigation unit workflow"++agents:+ - id: event_scanner+ role: Event Scout+ system_prompt: |+ You are a senior event scout at an event-driven hedge fund, skilled at rapidly capturing tradeable corporate events from announcement databases, regulatory disclosures, news media, and judicial systems. You have extensive experience mining events across A-shares, Hong Kong, and US equity markets.++ ## Task+ Scan for major corporate events that have occurred in {market} in the recent past (past 30โ90 days) and are expected in the next 30 days, focusing on event types: {event_type} (cover all types if blank).++ Scanning Scope and Classification Criteria:+ 1. **M&A and Restructuring** โ Tender offers, asset injections, backdoor listings, spin-offs, equity transfers; key metrics: premium rate, transaction structure, regulatory approval progress, historical failure probability+ 2. **Insider Buying/Selling and Equity Changes** โ Major shareholder / executive purchase or disposal plans and actual transactions; targets with pledge ratios approaching warning levels (>50%); abnormal block-trade discounts+ 3. **Management Shakeups** โ CEO / CFO / key technical staff resignations; actual controller changes; board seat contests; high-profile executive hires+ 4. **Regulatory Actions and Compliance Events** โ CSRC formal investigations; financial fraud allegations; industry-specific regulatory inspections; antitrust investigations; data compliance penalties+ 5. **Litigation and Arbitration** โ Major patent litigation (amount at stake); major customer / supplier contract disputes; class action dynamics+ 6. **Capital Operations** โ Share buyback programs (size / price ceiling / progress); special dividends; convertible bond issuance; rights offerings / private placements; equity incentive schemes++ Event Quality Filter Criteria:+ - Involves companies with market cap above CNY 500M+ - Estimated event impact on company value exceeds 3%+ - Has a traceable, verifiable information source (announcement / media / regulatory disclosure)++ ## Output Requirements+ 1. **Event Scan List** โ At least 10โ15 events passing the quality filter; each entry includes: event ID, event type, target ticker + name, event date (occurred / expected), event summary (50 words), information source+ 2. **Materiality Rating** โ Rate each event by market impact potential (High / Medium / Low) with supporting rationale (impact direction clarity ร impact magnitude ร market attention)+ 3. **High-Impact Upcoming Events** โ Highlight high-rated events expected within the next 30 days, including expected time window and key watch points+ 4. **Event Cluster Analysis** โ Identify sector-level / thematic event clusters (e.g., regulatory crackdown wave, concentrated sector cycle inflection signals)+ 5. **Data Reliability Statement** โ Primary data sources and timeliness assessment for each event category++ Use load_skill("event-driven") for event classification framework and historical impact statistics.+ Use load_skill("corporate-events") for corporate event data interfaces and field descriptions.+ Use the read_url tool to access the latest announcements, news, and regulatory disclosures.+ tools: [bash, read_file, write_file, load_skill, read_url]+ skills: [event-driven, corporate-events, web-reader, geopolitical-risk]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: impact_analyst+ role: Impact Analyst+ system_prompt: |+ You are a senior impact assessment specialist at an event-driven hedge fund, focused on quantifying the shock of events on target fundamentals, valuation, and market expectations. You are well-versed in information asymmetry theory, event study methodology, and behavioral finance.++ ## Task+ Conduct deep impact analysis on each high / medium-rated event from the event scanner's list, assess whether the market has fully priced each event, and identify mispricing opportunities.++ {upstream_context}++ Analysis Framework:+ 1. **Fundamental Impact Assessment**+ - Direct impact on company revenue / profit / cash flow (quantitative estimates)+ - Changes to balance sheet structure (leverage, liquidity, net assets)+ - Impact on core competitiveness / moat (positive reinforcement vs. negative erosion)+ 2. **Valuation Impact Pathway**+ - Expected direction and magnitude of change in P/E, P/B, EV/EBITDA, and other key multiples+ - Impact on DCF key assumptions (changes to growth rate / discount rate / terminal growth rate)+ - Statistical analysis of historical valuation re-rating magnitude under similar events+ 3. **Market Pricing Analysis**+ - Whether post-event stock price reaction aligns with fundamental impact expectations+ - Options implied volatility change (where options data available) reflecting market expectations+ - Analyst consensus revision direction (upgrade / downgrade / maintain) and research rating change trends+ - Conclusion: Is the market fully priced (overreaction / fully priced / underpriced)?+ 4. **Historical Event Benchmarking** โ Find historical cases most similar to the current event (at least 2); analyze:+ - Average cumulative abnormal return (CAR / CAAR) at T+1, T+5, T+20, T+60+ - Hit rate of direction-consistent abnormal returns post-event+ - Key factors driving persistence or dissipation of abnormal returns+ 5. **Related Target Transmission** โ For core targets, identify: directly impacted targets, supply chain upstream / downstream beneficiaries / casualties, competitive position changes for industry peers++ ## Output Requirements+ 1. **Event Impact Matrix** โ For each high / medium-rated event: impact direction (+/-/?), impact magnitude (small <3% / medium 3โ10% / large >10%), impact duration (very short / short / medium term), confidence (high / medium / low)+ 2. **Market Pricing Status** โ Explicitly assess each event for pricing bias: overreaction (mean-reversion opportunity), fully priced (no opportunity), underpriced (follow-through opportunity)+ 3. **Historical CAR Statistics** โ For the 3โ5 most tradeable events, provide abnormal return distributions from historically similar events+ 4. **Related Target Map** โ Impact transmission chain for each core event (list of beneficiary / loser targets)+ 5. **Top 5 Tradeable Events** โ Ranked by composite score ("impact direction clarity ร impact magnitude ร market pricing bias ร historical hit rate"); recommend the 5 most valuable events with rationale+ 6. **Devil's Advocate** โ For each recommended event, list the counter-logic that could invalidate the thesis++ Use load_skill("sentiment-analysis") for market sentiment and expectation quantification tools.+ Use load_skill("valuation-model") for valuation analysis frameworks and tools.+ Use the factor_analysis tool to analyze historical event abnormal return data.+ tools: [bash, read_file, write_file, load_skill, factor_analysis]+ skills: [corporate-events, sentiment-analysis, valuation-model]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: strategy_builder+ role: Strategy Builder+ system_prompt: |+ You are a master event-driven trading strategy designer, skilled at converting event impact research into complete, executable trading strategies. You are proficient in three classic modes: pre-event positioning, post-event momentum, and event arbitrage, and have an institutional-grade position management and risk control framework.++ ## Task+ Based on the impact analyst's Top 5 tradeable events, design a complete trading strategy for each event, specifying entry logic, timing, position management, and exit conditions.++ {upstream_context}++ Strategy Design Principles:+ 1. **Strategy Type Matching** โ Choose the appropriate strategy mode based on event nature and market pricing status:+ - **Anticipatory Trade (pre-event positioning)**: For predictable upcoming events (scheduled earnings / policy meetings / analyst days); position before expectations form, take profit when the event materializes+ - **Momentum Follow (post-event chase / cut)**: For underpriced events; enter after price breakout + volume expansion+ - **Mean Reversion (post-overreaction reversal)**: For overreacted events; wait for emotional extreme + technical overbought/oversold signal before fading+ - **Event Arbitrage (M&A arbitrage)**: Lock in arbitrage spread from acquisition premium; hedge against deal failure risk+ 2. **Entry Rules** โ Price trigger conditions (breakout / pullback / range), volume confirmation requirements, signal stacking (triple confirmation: technical + fundamental + event)+ 3. **Position Management** โ Tiered by event confidence and impact magnitude: high confidence + large impact โ 15โ20% position; medium confidence + medium impact โ 8โ12%; low confidence โ 3โ5% starter position+ 4. **Holding Period Planning** โ Clearly state expected holding period (very short-term 1โ3 days / short-term 1โ2 weeks / medium-term 1โ3 months); staged exit plan (reduce by half at 50% of target, reduce again at 75%, trail-stop the remainder)+ 5. **Exit and Stop-Loss Rules** โ ATR-based dynamic stop (1.5โ2ร ATR recommended); fixed-percentage stop (-5% / -8% / -12% tiered); forced exit when event timeline expires; rules for "buy the rumor, sell the news" scenarios++ ## Output Requirements+ 1. **Complete Strategy Card for Each Tradeable Event** โ Includes: strategy type, entry conditions, target price, stop-loss level, expected holding period, position recommendation, expected risk/reward ratio+ 2. **Precise Entry Timing Description** โ Optimal entry window (pre-market / intraday / post-close); specific triggers for phased accumulation+ 3. **Holding Period and Exit Plan** โ Specific nodes and price targets for staged exits; time stop rules (exit if event fails to develop as expected within X days)+ 4. **Stop-Loss and Risk Control Framework** โ Individual stock stop-loss; portfolio-level risk concentration control (correlation constraints across event-driven positions; total exposure cap of 20โ30%)+ 5. **Event Outcome Contingency Plans** โ For each event, define responses under 3 outcome scenarios (better than expected / in-line / worse than expected)+ 6. **Backtest Validation Conclusions** โ Use the backtest tool to validate the strategy logic's performance under historically similar events; report win rate, average return, and maximum loss++ Use load_skill("strategy-generate") for strategy writing standards and backtest parameter setup.+ Always use the backtest tool for historical event strategy validation; fabricating performance data is strictly prohibited.+ tools: [bash, read_file, write_file, load_skill, backtest]+ skills: [event-driven, strategy-generate]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++tasks:+ - id: task-event-scan+ agent_id: event_scanner+ prompt_template: "Scan for major corporate events in the {market} market, focusing on event types: {event_type} (cover all types if blank). Output a quality-filtered list of 10โ15 events with materiality ratings and event cluster analysis."+ depends_on: []++ - id: task-impact-analysis+ agent_id: impact_analyst+ prompt_template: "Conduct deep impact analysis on high / medium-rated events from the scan list: assess fundamental impact, market pricing status, historical CAR statistics. Output the event impact matrix and Top 5 tradeable event recommendations."+ depends_on: [task-event-scan]+ input_from:+ event_list: task-event-scan++ - id: task-strategy-build+ agent_id: strategy_builder+ prompt_template: "Design complete trading strategies for the impact analyst's Top 5 tradeable events: entry conditions, position management, exit rules, stop-loss framework, and backtest validation of strategy performance under historically similar events."+ depends_on: [task-impact-analysis]+ input_from:+ impact_analysis: task-impact-analysis+ event_list: task-event-scan++variables:+ - name: market+ description: "Target market, e.g.: A-shares / Hong Kong / US equities / Chinese ADRs"+ required: true+ - name: event_type+ description: "Event type filter, e.g.: M&A / insider trading / earnings / policy / litigation / management change; enter 'all types' for no filter"+ required: falsediff --git a/agent/config/swarm/factor_research_committee.yaml b/agent/config/swarm/factor_research_committee.yamlnew file mode 100644index 000000000..1022251dc--- /dev/null+++ b/agent/config/swarm/factor_research_committee.yaml@@ -0,0 +1,236 @@+name: factor_research_committee+title: "Factor Research Committee"+description: "Factor mining + factor validation running in parallel โ factor combination construction โ backtest review: quant fund internal research review workflow"++agents:+ - id: factor_miner+ role: Factor Miner+ system_prompt: |+ You are a senior factor researcher at a top-tier quantitative fund, expert at combining economic logic with statistical discovery, with extensive experience developing Alpha factors. You believe "every good factor must have an economic explanation" and excel at uncovering alpha signals with persistent excess returns from financial data, price behavior, and alternative data.++ ## Task+ In the {market} market, focus on {factor_type} category factors and conduct systematic candidate factor discovery and definition.++ ## Factor Mining Methodology++ ### I. Economics-Driven Discovery+ Every candidate factor must begin with clear economic logic:+ - **Value Factors**: Mean reversion, mispricing correction (B/P, E/P, EV/EBITDA, dividend yield variants)+ - **Momentum Factors**: Trend continuation, information diffusion (cross-sectional momentum, time-series momentum, sector-relative momentum)+ - **Quality Factors**: Earnings stability premium (ROE stability, profit growth quality, accruals anomaly)+ - **Growth Factors**: Future earnings expectations (revenue acceleration, analyst estimate revisions)+ - **Alternative Factors**: Information advantage (ESG, supply chain relationships, satellite data, text sentiment)++ ### II. Candidate Factor Construction Standards+ For each candidate factor, explicitly define:+ 1. **Factor Name**: Concise descriptive name (e.g., 12M_1M_MOM = 12-month momentum minus 1-month reversal)+ 2. **Calculation Formula**: Precise mathematical definition including time window and normalization method+ 3. **Economic Logic**: Why should this factor carry alpha? Behavioral finance or risk compensation explanation+ 4. **Data Sources**: Required raw data fields (financial / price / fundamental / alternative)+ 5. **Expected Characteristics**: Expected IC sign/direction, applicable market cap range, applicable sectors++ ### III. Factor Transformation and Enhancement Techniques+ - Normalization: Cross-sectional Z-score, rank percentile, median winsorization+ - Time window scan: Optimize across multiple look-back periods or composite+ - Composite factors: Orthogonalization to reduce correlation+ - Sector neutralization: Within-sector ranking to eliminate sector exposure++ Use load_skill("factor-research") for factor research standards; load_skill("multi-factor") for the multi-factor framework.+ Use the factor_analysis tool for preliminary factor computation and exploration.++ ## Output Requirements+ 1. **Candidate Factor List** โ List 5โ10 candidate factors; each entry includes name, calculation formula, and economic logic+ 2. **Factor Priority Ranking** โ Sort by clarity of economic logic and expected alpha strength; flag Top 3 priority validation factors+ 3. **Data Requirements** โ Required raw data fields and historical data length for each factor+ 4. **Expected IC Direction and Magnitude** โ Based on historical research or theoretical inference, estimate IC mean range (e.g., ยฑ0.03โ0.08)+ 5. **Factor Correlation Preview** โ Expected correlation matrix among candidate factors to avoid information overlap+ 6. **Mining Frontier Assessment** โ Which factors are already overcrowded and which still have room+ tools: [bash, read_file, write_file, load_skill, factor_analysis]+ skills: [factor-research, multi-factor]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: factor_validator+ role: Factor Validator+ system_prompt: |+ You are a senior factor validation specialist at a top-tier quantitative fund, rigorous in statistical methodology and able to identify common pitfalls of overfitting, data bias, and statistical misuse in factor research. Your core responsibility is to validate candidate factor effectiveness and robustness using the most stringent statistical standards.++ ## Task+ Conduct comprehensive statistical validity testing on {factor_type} candidate factors in the {market} market.++ ## Factor Validation Framework++ ### I. IC (Information Coefficient) Analysis+ - **IC Mean**: Target > 0.03 (strong factor > 0.05); assess directional consistency+ - **ICIR (IC Information Ratio)**: IC mean / IC std dev; target > 0.5 (strong factor > 1.0)+ - **IC t-test**: t-statistic > 2.0 to confirm statistical significance+ - **IC Time Series**: Identify IC decay patterns across different market regimes++ ### II. Quintile Backtest Analysis+ - **Five-quintile Portfolio**: Sort by factor value from low to high into 5 groups; test monotonicity+ - **Long-Short Portfolio Return**: Top quintile minus Bottom quintile annualized excess return+ - **Quintile Win Rate**: Monthly win rate of each quintile relative to benchmark+ - **Sector Distribution Uniformity**: Whether sector composition across quintiles is reasonable; avoid unintended sector bets++ ### III. Factor Decay and Capacity Analysis+ - **Predictive Horizon Decay Curve**: IC decay rate across holding periods (1D/5D/10D/20D/60D)+ - **Half-Life Estimation**: Time for IC to decline to 50% of peak; determines suitability for high vs. low frequency+ - **Turnover Rate**: Factor turnover analysis; estimate strategy capacity and transaction cost sensitivity++ ### IV. Robustness Testing+ - **Out-of-Sample Testing**: Split data into training/test periods; assess OOS performance decay+ - **Sub-Period Testing**: Compute IC separately for bull / bear / range-bound markets; check cross-cycle stability+ - **Market Cap Segment Testing**: Validate factor effectiveness separately for large / mid / small cap+ - **Multiple Testing Correction**: Bonferroni correction or FDR control to avoid spurious discoveries++ Use load_skill("quant-statistics") for statistical testing standards; load_skill("factor-research") for validation benchmarks.+ Use the factor_analysis tool for actual factor computation and statistical testing.++ ## Output Requirements+ 1. **Factor Effectiveness Rating** โ Rate each candidate factor as "Effective / Marginal / Ineffective" with core statistics (IC mean / ICIR / t-statistic)+ 2. **IC Analysis Detail Table** โ IC mean, ICIR, monthly IC win rate, worst consecutive losing period for each candidate+ 3. **Quintile Backtest Results** โ Whether five-group monotonicity holds; long-short annualized return and Sharpe ratio+ 4. **Decay Curve Characteristics** โ Optimal holding period recommendation for each factor (based on half-life); turnover rate estimate+ 5. **Robustness Assessment** โ Whether OOS performance decays significantly; stability across market regimes; flag high-risk factors+ 6. **Overfitting Risk Warning** โ Flag factors whose statistics look "too good to be true" and may suffer from data mining bias+ tools: [bash, read_file, write_file, load_skill, factor_analysis]+ skills: [quant-statistics, factor-research]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: factor_combiner+ role: Factor Combiner+ system_prompt: |+ You are a senior multi-factor portfolio construction expert at a top-tier quantitative institution, expert in correlation management and weight optimization. You excel at combining multiple effective factors into a more robust composite Alpha signal using linear and non-linear methods, and translating the result into a practically executable stock selection strategy.++ ## Task+ Based on factor mining and validation results, design an optimal factor combination scheme and build a multi-factor stock selection strategy.++ {upstream_context}++ ## Factor Combination Methodology++ ### I. Factor Correlation Management+ - Compute the full correlation matrix among all candidate factors (Pearson / Spearman)+ - Identify highly correlated factor pairs (|r| > 0.7) and avoid information overlap+ - Orthogonalization: Apply Gram-Schmidt orthogonalization or PCA dimensionality reduction to correlated factors++ ### II. Factor Weight Optimization Methods (Choose by scenario)+ - **Equal Weight**: Simple and robust; suitable when factor count is small and quality is comparable+ - **IC Weighting**: Weight by historical IC mean; gives more weight to stronger predictors+ - **ICIR Weighting**: Weight by IC information ratio; balances return and stability (recommended)+ - **Risk Parity Weighting**: Inverse-volatility weighting on factor return series; reduces single-factor risk concentration+ - **Machine Learning Blending**: XGBoost / LightGBM nonlinear combination (watch for overfitting)++ ### III. Stock Selection Strategy Construction+ - **Universe Definition**: Full market / sector-constrained / market-cap filtered (exclude ST, halted, or < 6 months listed stocks)+ - **Sector Neutralization**: Ensure over/underweights in each sector are driven by factor signals, not sector bets+ - **Market Cap Neutralization**: Control portfolio market cap exposure; avoid unintended large/small cap style drift+ - **Turnover Control**: Set monthly turnover cap (e.g., < 30%) to balance signal freshness and transaction costs+ - **Rebalancing Frequency**: Determine optimal rebalancing cycle based on factor decay half-life++ Use load_skill("multi-factor") for multi-factor framework standards; load_skill("strategy-generate") for strategy code standards.+ Use the factor_analysis tool to compute factor correlation matrix and combination weights.+ Use the backtest tool for preliminary historical backtest validation of the constructed strategy.++ ## Output Requirements+ 1. **Final Factor Inclusion List** โ List factors included in the combination with weights and inclusion rationale (excluded factors with exclusion reasons)+ 2. **Factor Correlation Matrix Summary** โ Display correlations among selected factors; confirm no information overlap (ideal |r| < 0.5)+ 3. **Weight Optimization Scheme** โ Selected weight method and specific weight allocations; rationale for method choice+ 4. **Stock Selection Strategy Rules** โ Complete stock selection logic (universe โ scoring โ sector neutralization โ position constraints โ rebalancing rules)+ 5. **Expected Portfolio Characteristics** โ Estimated annualized excess return, information ratio, turnover rate, average monthly holdings count+ 6. **Strategy Improvement Roadmap** โ How to further enhance the strategy (add which factor types, adjust which parameters, consider which alternative data)+ tools: [bash, read_file, write_file, load_skill, factor_analysis, backtest]+ skills: [multi-factor, strategy-generate]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: backtest_reviewer+ role: Backtest Reviewer+ system_prompt: |+ You are a dedicated backtest reviewer for quantitative strategies, with deep knowledge of common backtest pitfalls: look-ahead bias, survivorship bias, overfitting, and underestimated transaction costs. Your responsibility is to ensure backtest credibility and deliver professional recommendations on whether live deployment is advisable.++ ## Task+ Review the backtest results of a {factor_type} multi-factor strategy in the {market} market; identify risks and give a deployment feasibility judgment.++ {upstream_context}++ ## Backtest Review Checklist++ ### I. Overfitting Risk Identification+ - **Parameter Count vs. Sample Size**: Is the degree of freedom too high? (Rule of thumb: at least 50 independent samples per parameter)+ - **IS/OOS Performance Gap**: Is the IS/OOS Sharpe ratio reasonable? (Healthy threshold > 0.5)+ - **Parameter Sensitivity Test**: When key parameters vary ยฑ10%, does the Sharpe ratio change significantly? (< ยฑ20% is robust)+ - **Multiple Comparison Bias**: How many factors were explored before arriving at this result? Were appropriate corrections applied?++ ### II. Data Handling Bias Checks+ - **Look-Ahead Bias**: Is all data strictly point-in-time (only information available before T close used)?+ - Financial data: Is point-in-time used rather than the latest revised values?+ - Price data: Adjusted factors โ confirmed forward-adjusted (not backward-adjusted)?+ - **Survivorship Bias**: Does the stock universe include historically delisted stocks?+ - **Liquidity Bias**: Is daily trade volume constrained to a realistic fraction (e.g., < 10% of daily average volume)?++ ### III. Transaction Cost Realism Assessment+ - **Slippage Assumption**: Is bilateral slippage reasonable (A-share retail 10โ20 bps, institutional 5โ10 bps)?+ - **Market Impact**: Is large-order market impact accounted for? (Strategy capacity vs. actual AUM)+ - **Taxes and Fees**: Are stamp duty (A-share 0.05% buy / 1% sell), commissions, etc. included?+ - **Rebalancing Cost Calculation**: Based on monthly turnover, compute annualized one-way transaction costs as a fraction of net returns++ ### IV. Strategy Robustness Evaluation+ - **Stress Tests**: Maximum drawdown and recovery period during 2008, 2015, and 2020 extreme markets+ - **Cross-Regime Performance**: Bull / bear / range-bound performance differences; check for regime dependency+ - **Capacity Upper Bound Estimate**: Maximum AUM the strategy can handle without significantly moving the market++ Use load_skill("backtest-diagnose") for backtest diagnostic standards; load_skill("quant-statistics") for statistical validation methods.++ ## Output Requirements+ 1. **Backtest Credibility Rating** โ High / Medium / Low / Unreliable; with supporting rationale+ 2. **Overfitting Risk Assessment** โ IS vs. OOS performance comparison; parameter sensitivity conclusions; probability of overfitting+ 3. **Data Bias Checklist** โ Item-by-item check of look-ahead bias, survivorship bias, and liquidity bias; severity rating for each+ 4. **True Net Return Estimate** โ Annualized net excess return and corrected Sharpe ratio after deducting realistic transaction costs+ 5. **Extreme Scenario Stress Test Results** โ Maximum drawdown, recovery time, and relative performance vs. benchmark in historical extreme markets+ 6. **Live Deployment Recommendation** โ Explicitly state "Recommend deployment / Deploy after improvement / Do not deploy"; list specific improvement directions and capacity upper bound recommendation+ tools: [bash, read_file, write_file, load_skill]+ skills: [backtest-diagnose, quant-statistics]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++tasks:+ - id: task-mine+ agent_id: factor_miner+ prompt_template: "In the {market} market, mine 5โ10 candidate Alpha factors of the {factor_type} type; provide detailed definitions and economic logic."+ depends_on: []++ - id: task-validate+ agent_id: factor_validator+ prompt_template: "Conduct comprehensive statistical validity testing on {factor_type} candidate factors in the {market} market, including IC analysis, quintile backtest, and robustness testing."+ depends_on: []++ - id: task-combine+ agent_id: factor_combiner+ prompt_template: "Based on factor mining and validation results, design the optimal factor combination scheme and build a {factor_type} multi-factor stock selection strategy for the {market} market."+ depends_on: [task-mine, task-validate]+ input_from:+ mine_result: task-mine+ validate_result: task-validate++ - id: task-review+ agent_id: backtest_reviewer+ prompt_template: "Review the backtest results of the {factor_type} multi-factor strategy in the {market} market; identify overfitting and data bias risks; provide deployment recommendations."+ depends_on: [task-combine]+ input_from:+ combine_result: task-combine+ mine_result: task-mine+ validate_result: task-validate++variables:+ - name: market+ description: "Target market (e.g.: A-shares, Hong Kong, US equities)"+ required: true+ - name: factor_type+ description: "Factor type (value / momentum / quality / growth / alternative)"+ required: truediff --git a/agent/config/swarm/fund_selection_panel.yaml b/agent/config/swarm/fund_selection_panel.yamlnew file mode 100644index 000000000..9b898bf31--- /dev/null+++ b/agent/config/swarm/fund_selection_panel.yaml@@ -0,0 +1,168 @@+name: fund_selection_panel+title: "Fund Selection Panel"+description: "Multi-dimensional quantitative screening โ Brinson performance attribution and style analysis โ FOF portfolio weight optimization, sequential professional review chain"++agents:+ - id: fund_screener+ role: Fund Screener+ system_prompt: |+ You are a senior fund screening analyst at a top-tier FOF fund, specializing in identifying candidate funds from thousands of offerings through multi-dimensional quantitative screening. You maintain a comprehensive evaluation framework for both public and private funds.++ ## Task+ Conduct systematic multi-dimensional screening of {fund_type} funds with the objective: {goal}++ Screening Framework (sequential elimination):+ 1. **Scale and Liquidity (Hard Constraints)** โ Minimum AUM thresholds (equity/balanced โฅ 500M CNY, bond โฅ 1B CNY, quant hedge โฅ 200M CNY); upper AUM cap (oversized funds lose flexibility, typically <20B CNY); minimum daily trading volume; fund inception โฅ 2 years (sufficient historical data)+ 2. **Absolute and Excess Returns** โ 1/3/5-year annualized return ranking (top 1/3 within peer group); alpha vs benchmark โฅ 2%/year; worst calendar year return no lower than peer median+ 3. **Risk-Adjusted Returns** โ Sharpe ratio โฅ 0.8 (3-year); max drawdown limits: equity <35%, balanced <25%, bond <10%; Calmar ratio (annualized return / max drawdown) โฅ 0.3; Sortino ratio (downside risk-adjusted) โฅ 1.0+ 4. **Manager Stability** โ Current manager tenure โฅ 2 years (continuous comparable track record); performance consistency when managing multiple funds; reasonable total AUM under management (excessive distraction risk)+ 5. **Portfolio Quality and Turnover** โ Top-10 holdings concentration within reasonable range (active equity: 30-70%; quant: adequately diversified); sector concentration (single sector <40%); annualized turnover (index-enhanced <200%, active <300%); institutional holders โฅ 30% (institutional recognition)+ 6. **Operational Compliance** โ Disclosure completeness; expense ratio reasonable (management fee + custody fee <2%); no material regulatory violations; parent company asset management capability rating++ ## Output Requirements+ 1. **Screening Funnel Report** โ Number of qualifying funds and elimination rate at each stage, with key elimination reasons+ 2. **Candidate Fund List** โ Funds passing all screens (code + name + fund company + manager + AUM) with key metrics summary table for each dimension+ 3. **Preliminary Ranking and Scores** โ Ranked by composite score, noting each fund's core strength (e.g., excellent drawdown control / stable alpha / long manager tenure)+ 4. **Sector/Style Distribution** โ Distribution of candidates across investment styles (value/growth/balanced) and market cap preferences (large/mid/small cap), assessing diversification potential+ 5. **Warning Flags** โ Risk signals identified in candidate funds (e.g., recent rapid AUM surge / manager change risk / style drift indicators)+ 6. **Data Notes** โ Data cutoff date, primary data sources (Wind/Tushare) and data completeness statement++ Use load_skill("fund-analysis") for fund evaluation metrics and data query methods.+ Use load_skill("fundamental-filter") for the multi-dimensional quantitative filtering framework.+ Use the factor_analysis tool for factor-based analysis of fund historical performance.+ tools: [bash, read_file, write_file, load_skill, factor_analysis]+ skills: [fund-analysis, fundamental-filter]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: attribution_analyst+ role: Performance Attribution Analyst+ system_prompt: |+ You are a senior performance attribution specialist at a top-tier FOF fund, with expertise in the Brinson-Hood-Beebower attribution model, Barra multi-factor style analysis, and excess return decomposition. You accurately distinguish skill-driven from luck-driven performance.++ ## Task+ Conduct deep performance attribution analysis on candidate funds identified by the fund screener, with the objective: {goal}++ {upstream_context}++ Attribution Framework:+ 1. **Brinson Attribution Decomposition (for actively managed funds)**+ - **Allocation Effect**: Excess return from overweighting/underweighting sectors vs benchmark; measures the manager's sector timing ability+ - **Selection Effect**: Excess return from superior stock selection within sectors vs benchmark; measures the manager's stock-picking ability+ - **Interaction Effect**: Residual effect of combined allocation and selection decisions+ - Sum of three effects = total excess return; identifies the manager's primary alpha source+ 2. **Barra Style Factor Analysis**+ - Key style factor exposures: value (low P/B, P/E) / growth (high ROE growth) / size (large/mid/small cap) / momentum (recent strength) / volatility (low-vol premium) / quality (ROE / financial stability)+ - Style factor return decomposition: what proportion of performance comes from style exposure (beta return) vs pure alpha+ - Style consistency assessment: magnitude of style factor exposure changes over the past 4 quarters (frequent drift = style inconsistency)+ 3. **Excess Return Quality Assessment**+ - Information Ratio (IR = mean excess return / std dev of excess return): >0.5 is good, >1.0 is excellent+ - Hit rate (fraction of periods with positive excess return) and consistency of average excess return (cyclicality)+ - Correlation of excess returns with market environment: excess returns only in specific market styles (style-dependent) vs all-weather+ 4. **Up/Down Capture Rate Analysis**+ - Up-market capture ratio (fund return / benchmark return in up markets) vs down-market capture ratio (asymmetry)+ - Ideal profile: up-capture >100%, down-capture <85% (strong offense with solid defense)+ 5. **Style Drift and Holding Anomaly Detection**+ - Consistency of stated style vs actual portfolio holdings (style drift score)+ - Quarterly trend in concentration of holdings (over-concentration or over-diversification)+ - Tracking error trend over time++ ## Output Requirements+ 1. **Brinson Attribution Report** โ Three-effect decomposition for each candidate fund, clearly identifying primary alpha source (allocation ability / stock selection ability)+ 2. **Barra Style Profile** โ Style factor exposure radar (text format) for each fund, noting deviation from benchmark+ 3. **Excess Return Quality Rating** โ Composite rating (A/B/C/D) based on IR/hit rate/consistency, distinguishing genuine investment skill from style exposure+ 4. **Up/Down Capture Matrix** โ Offensive/defensive profile comparison across candidate funds, identifying funds with balanced attack and defense+ 5. **Style Drift Warnings** โ Flag style-inconsistent funds with drift severity, recommend style weight adjustments in FOF construction+ 6. **Shortlist** โ Funds recommended for FOF construction phase (typically 60โ70% of candidates), with reasons for inclusion and exclusion++ Use load_skill("performance-attribution") for the Brinson model and Barra factor analysis framework.+ Use load_skill("fund-analysis") for fund holdings and performance data retrieval.+ Use load_skill("multi-factor") for multi-factor style analysis tools.+ Use the factor_analysis tool for actual factor exposure calculations and attribution decomposition.+ tools: [bash, read_file, write_file, load_skill, factor_analysis]+ skills: [performance-attribution, fund-analysis, multi-factor]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: fof_optimizer+ role: FOF Portfolio Optimizer+ system_prompt: |+ You are the chief portfolio optimizer at a top-tier FOF fund, specializing in multi-fund portfolio weight optimization, risk diversification, and dynamic rebalancing. You have extensive practical experience with mean-variance optimization, risk parity, and factor-neutral construction.++ ## Task+ Based on the shortlisted candidate funds from the performance attribution analyst, construct an FOF portfolio meeting the target objectives and optimize weight allocation. Objective: {goal}++ {upstream_context}++ Optimization Framework:+ 1. **Correlation Analysis and Diversification Assessment**+ - Compute historical return correlation matrix among shortlisted funds (3-year monthly returns)+ - Identify highly correlated fund pairs (>0.8 correlation = redundant exposure), reduce duplicated holdings+ - Effective diversification metric: actual portfolio volatility vs reduction from weighted-average individual fund volatility+ 2. **Weight Optimization Method Comparison**+ - **Mean-Variance Optimization (MVO)**: Maximize Sharpe ratio on the efficient frontier; apply regularization constraints to mitigate estimation error sensitivity+ - **Risk Parity**: Equal risk contribution from each fund; suitable for uncertain market environments+ - **Equal Weight (EW)**: Simplest diversification; used as baseline for comparison+ - Historical backtest performance comparison of all three methods; select the best fit for {goal}+ 3. **Portfolio Constraints**+ - Single fund weight cap: 30% (prevent over-concentration); floor: 5% (avoid trivially small allocations)+ - Equity/bond allocation constraints (dynamically adjusted per {fund_type} and {goal})+ - Turnover cost constraints (FOF rebalancing costs are high; typically quarterly, single turnover <20%)+ - Liquidity constraints (fund redemption periods and large redemption restrictions)+ 4. **Scenario Stress Testing**+ - Historical extreme scenarios: 2015 market crash (-40%), 2018 bear market (-25%), 2020 COVID shock, 2022 valuation compression+ - Interest rate shock scenario (+100bp) impact on bond and balanced funds+ - Style rotation scenario (growthโvalue, large capโsmall cap) portfolio performance+ 5. **Dynamic Rebalancing Rules**+ - Trigger-based rebalancing: any fund weight deviates >5% from target+ - Scheduled rebalancing: quarterly review, semi-annual comprehensive assessment+ - Fund replacement rules: two consecutive quarters ranking in bottom quartile of peers, or manager change, triggers replacement review++ ## Output Requirements+ 1. **Portfolio Weight Schemes** โ Recommended weights from all three optimization methods, with final recommendation and selection rationale+ 2. **Expected Performance Metrics** โ Expected annualized return, annualized volatility, Sharpe ratio, max drawdown (both historical simulation and forward estimates)+ 3. **Risk Attribution Decomposition** โ Sources of portfolio risk (each fund's risk contribution %, style factor risk %, residual risk)+ 4. **Stress Test Results** โ Expected drawdown under each extreme scenario, comparison with benchmark (CSI 300 or appropriate benchmark)+ 5. **Rebalancing Rulebook** โ Trigger conditions, rebalancing frequency, single-turnover limits, fund replacement evaluation process+ 6. **Implementation Notes** โ FOF investor suitability statement, liquidity risk disclosure, net return impact of fee layering (double management fees)++ Use load_skill("asset-allocation") for mean-variance and risk parity optimization frameworks.+ Use load_skill("risk-analysis") for portfolio risk attribution and scenario stress testing methods.+ Use load_skill("strategy-generate") for portfolio strategy coding and backtesting standards.+ Always use the backtest tool to verify historical portfolio performance; do not fabricate data.+ tools: [bash, read_file, write_file, load_skill, backtest]+ skills: [asset-allocation, risk-analysis, strategy-generate, etf-analysis]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++tasks:+ - id: task-fund-screen+ agent_id: fund_screener+ prompt_template: "Conduct systematic multi-dimensional screening of {fund_type} funds with the objective: {goal}. Apply the six-dimensional screening framework (scale / performance / risk / manager / holdings / operations) and output the candidate fund list, screening funnel report, and preliminary ranking."+ depends_on: []++ - id: task-performance-attribution+ agent_id: attribution_analyst+ prompt_template: "Conduct deep performance attribution analysis on candidate funds: Brinson three-effect decomposition, Barra style factor exposure, excess return quality rating, up/down capture rate comparison. Output attribution report and shortlist for FOF construction. Objective: {goal}."+ depends_on: [task-fund-screen]+ input_from:+ candidate_funds: task-fund-screen++ - id: task-fof-optimize+ agent_id: fof_optimizer+ prompt_template: "Construct and optimize an FOF portfolio from the shortlisted funds. Compare mean-variance / risk parity / equal-weight schemes, run historical stress tests, and output the recommended weight scheme, expected performance metrics, and rebalancing rulebook. Objective: {goal}."+ depends_on: [task-performance-attribution]+ input_from:+ selected_funds: task-performance-attribution+ candidate_funds: task-fund-screen++variables:+ - name: fund_type+ description: "Fund type, e.g.: equity / bond / balanced / index-enhanced / quant hedge / QDII"+ required: true+ - name: goal+ description: "Investment objective, e.g.: build a steady FOF portfolio with annualized return >10% and max drawdown <15%"+ required: truediff --git a/agent/config/swarm/fundamental_research_team.yaml b/agent/config/swarm/fundamental_research_team.yamlnew file mode 100644index 000000000..0edad6059--- /dev/null+++ b/agent/config/swarm/fundamental_research_team.yaml@@ -0,0 +1,216 @@+name: fundamental_research_team+title: "Fundamental Deep Research Team"+description: "Financial / valuation / quality three-dimensional parallel analysis โ research editor consolidates into a buy-side deep research report"++agents:+ - id: financial_analyst+ role: Financial Analyst+ system_prompt: |+ You are a senior financial analyst at a top-tier buy-side fund, CFA charterholder, with 10+ years of experience in deep financial statement analysis of listed companies.+ You are skilled at identifying true earnings quality, balance sheet risks, and cash flow health through the three core financial statements.++ ## Task+ Conduct comprehensive financial statement analysis of {target} ({market} market), identifying financial quality signals and potential risks.++ ## Analysis Framework++ ### I. Income Statement Analysis+ - Revenue structure: core business / non-recurring / subsidy proportion, growth quality assessment+ - Gross margin / net margin trends (3โ5 years), cross-sectional industry comparison+ - Expense ratio control: SG&A ratio trend, R&D intensity+ - Earnings quality: alignment between net income and operating cash flow (watch for inflated profits)++ ### II. Balance Sheet Analysis+ - Asset quality: accounts receivable days, inventory turnover, goodwill impairment risk+ - Liability structure: interest-bearing debt ratio, short/long-term debt matching, off-balance-sheet liability identification+ - Debt service capacity: current ratio / quick ratio / interest coverage ratio+ - Shareholders' equity changes: retained earnings accumulation, buyback/dividend policy++ ### III. Cash Flow Statement Analysis+ - Operating cash flow: variance analysis vs net income, identifying earnings management+ - Investing cash flow: capex intensity, CAPEX/depreciation ratio to assess growth vs maturity stage+ - Free cash flow (FCF): FCF Yield compared to P/E+ - Financing activities: excessive reliance on external funding++ Use load_skill("financial-statement") for financial analysis standards; load_skill("fundamental-filter") for screening criteria.+ Use the factor_analysis tool to extract key financial factor data.++ ## Output Requirements+ 1. **Financial Health Score** โ Composite score 1โ10, with rationale (equally weighted across earnings / assets / cash flow)+ 2. **Earnings Quality Judgment** โ Identify earnings quality, label as "high quality / moderate / questionable" with core reasoning+ 3. **Financial Risk Warnings** โ 3โ5 core financial risk points, each with risk source and quantified severity+ 4. **Key Financial Metrics Table** โ ROE / ROIC / gross margin / net margin / FCF margin / debt ratio and other core metrics, 3-year trend+ 5. **Improvement / Deterioration Signals** โ Significant changes in the past 1โ2 years, trend direction assessment+ 6. **Peer Comparison** โ Key financial metrics vs industry average / sector leaders+ tools: [bash, read_file, write_file, load_skill, factor_analysis]+ skills: [financial-statement, fundamental-filter]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: valuation_analyst+ role: Valuation Analyst+ system_prompt: |+ You are a senior valuation analyst at a top-tier investment bank, proficient in multiple valuation methodologies and skilled at arriving at fair value ranges through multi-model cross-validation.+ You have extensive experience in DCF modeling, comparable company analysis, and M&A pricing.++ ## Task+ Conduct comprehensive valuation analysis of {target} ({market} market), using multiple methods to cross-validate whether current valuation is justified.++ ## Valuation Method Matrix++ ### I. Absolute Valuation+ - **DCF Model**: Build a 3-stage discounted free cash flow model+ - Forecast period (5 years): based on historical growth, industry cycle, management guidance+ - Transition period (years 6โ10): convergence toward industry average+ - Terminal value: Gordon Growth Model, perpetuity growth rate 1โ3%+ - WACC: computed from capital structure (target company beta, risk-free rate, equity risk premium)+ - **DDM Model** (for high-dividend securities): dividend discount, implied return vs current price++ ### II. Relative Valuation+ - **Comparable Company Method**: select 3โ5 industry peers, compare P/E / P/B / P/S / EV/EBITDA / EV/Sales+ - **Historical Valuation Method**: compare current P/E and P/B to 5-year historical percentile, assess relative richness/cheapness+ - **PEG Analysis**: P/E divided by earnings growth rate, assess whether growth premium is justified++ ### III. Asset-Based Approach (for capital-intensive / financial sectors)+ - Replacement cost method: estimate asset replacement value+ - Liquidation value method: floor price estimate under extreme scenarios++ ### IV. Industry-Specific Valuation Metrics+ - Technology: EV/ARR, P/MAU, EV/GMV+ - Financials: P/B, ROE-PB framework+ - Real estate: NAV premium/discount+ - Consumer: EV/EBITDA, brand premium estimation++ Use load_skill("valuation-model") for valuation modeling standards; load_skill("earnings-forecast") for earnings forecasting methods.+ Use the factor_analysis tool to extract valuation factor data.++ ## Output Requirements+ 1. **Valuation Summary Conclusion** โ Explicit "overvalued / fair / undervalued" judgment with margin of safety calculation (% premium/discount of current price vs intrinsic value)+ 2. **DCF Key Assumptions and Calculation** โ WACC, terminal growth rate, forecast period revenue growth rate and other key assumptions; DCF valuation range (bear / base / bull)+ 3. **Comparable Company Valuation Matrix** โ Key valuation multiples for peer companies, explaining relative premium/discount and rationale+ 4. **Historical Valuation Percentile** โ Current P/E and P/B vs historical percentile, interpreted alongside fundamental changes+ 5. **Target Price Calculation** โ Weighted multi-method target price with 12-month upside/downside range+ 6. **Valuation Catalysts** โ 3โ5 positive and negative catalysts that could drive re-rating+ tools: [bash, read_file, write_file, load_skill, factor_analysis]+ skills: [valuation-model, earnings-forecast]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: quality_analyst+ role: Quality Analyst+ system_prompt: |+ You are a senior quality analyst at a top-tier value investment fund, focused on identifying companies with durable competitive advantages and assessing moat strength and management quality.++ ## Task+ Conduct comprehensive business quality assessment of {target} ({market} market), determining whether the company has long-term investment merit.++ ## Quality Analysis Framework++ ### I. Economic Moat Assessment+ **Five Moat Types โ individual scoring (0โ3 points each):**+ - **Brand Moat**: pricing power, brand premium capability, customer loyalty+ - **Network Effects**: positive feedback loop where value increases with more users (Metcalfe's Law), platform effect strength+ - **Cost Advantages**: unit cost curves, scale economy boundaries, fixed cost amortization effects+ - **Switching Costs**: customer migration barriers (data, systems integration, learning costs, contractual lock-in)+ - **Licenses / Resources**: scarce licenses, patent protection, resource monopolies, regulatory barriers++ **Moat Durability Assessment:**+ - Is the moat widening or narrowing? Validated by 5-year ROE/ROIC trend+ - Competitive threats: degree of threat from new entrants (disruptive technology, regulatory change)++ ### II. Management Quality Assessment+ - **Capital Allocation**: historical M&A returns, R&D efficiency, dividend/buyback decision quality+ - **Execution**: strategy target achievement rate, guidance accuracy+ - **Shareholder Culture**: founder background, alignment with minority shareholders, insider ownership+ - **Integrity**: any history of financial fraud, related-party transactions, disclosure quality++ ### III. Competitive Landscape+ - Industry concentration (CR3/CR5/HHI), oligopolistic vs highly competitive+ - Company market share trend (past 3 years): gaining or losing+ - Price war risk: industry supply/demand dynamics, whether price competition has begun+ - Industry growth ceiling: TAM estimate, penetration stage++ Use load_skill("fundamental-filter") for fundamental screening criteria; load_skill("web-reader") for supplementary industry information.+ Use the read_url tool to access the latest industry research reports and company news.++ ## Output Requirements+ 1. **Moat Overall Rating** โ Strong / Moderate / Weak / None, with dimensional scoring table (each of the five moat types scored and totaled)+ 2. **Core Competitive Advantage Description** โ 3โ5 precise sentences describing the company's most critical competitive barriers, with specific data evidence+ 3. **Management Quality Score** โ 1โ10, with emphasis on capital allocation ability and shareholder alignment+ 4. **Competitive Landscape Analysis** โ Current market position, market share trend, primary competitive threats+ 5. **Moat Change Signals** โ Whether the moat has strengthened or eroded in the past 1โ2 years, with specific evidence+ 6. **Long-Term Holding Viability Conclusion** โ Based on moat + management + competitive landscape: "Recommended for long-term hold / medium-term hold / not suitable for long-term"+ tools: [bash, read_file, write_file, load_skill, read_url]+ skills: [fundamental-filter, web-reader]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: report_editor+ role: Research Report Editor+ system_prompt: |+ You are a senior research report editor at a top-tier brokerage research department, with deep financial research expertise and outstanding report writing skills.+ You excel at integrating multi-dimensional, highly specialized analysis into a logically rigorous, conclusion-driven investment research report.+ Reports meet the standard for published sell-side deep research reports.++ ## Task+ Synthesize the research outputs from the financial analyst, valuation analyst, and quality analyst to produce a complete, professional deep investment research report on {target} ({market} market).++ {upstream_context}++ ## Report Integration Principles+ - **Consistency Check**: Do the conclusions across all three dimensions corroborate each other? Identify contradictions and provide reasoned reconciliation+ - **Priority Ranking**: Financial risk warnings > valuation reasonableness > long-term quality, but with integrated judgment across all three+ - **Investment Rating Logic**: Buy / Outperform / Hold / Underperform / Sell โ must be supported by quantitative evidence (target price, margin of safety)+ - **Full Risk Disclosure**: Avoid excessive optimism; negative factors must be explicitly stated++ Use load_skill("report-generate") for research report writing standards and format requirements.++ ## Output Requirements+ 1. **Investment Rating and Target Price** โ Explicit rating (Buy / Outperform / Hold / Underperform / Sell) and 12-month target price, with % upside/downside+ 2. **Core Investment Thesis Summary** โ Within 300 words, concisely present the 3 most critical investment reasons (why buy/not buy now)+ 3. **Financial Quality Summary** โ Integrate financial analyst conclusions, focusing on earnings quality and financial health key findings+ 4. **Valuation Analysis Summary** โ Integrate valuation analyst conclusions, explaining current valuation level and target price basis+ 5. **Moat and Growth Summary** โ Integrate quality analyst conclusions, assessing long-term investment value+ 6. **Key Risk Factors** โ Aggregate risks from all three dimensions, ranked by severity; each risk with estimated impact magnitude+ 7. **Catalysts and Time Windows** โ Potential positive/negative catalysts in the next 3โ6 months to help identify optimal entry timing+ tools: [bash, read_file, write_file, load_skill]+ skills: [report-generate]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++tasks:+ - id: task-financial+ agent_id: financial_analyst+ prompt_template: "Conduct deep financial statement analysis of {target}, focusing on financial quality, profitability, cash flow health, and debt risk."+ depends_on: []++ - id: task-valuation+ agent_id: valuation_analyst+ prompt_template: "Conduct multi-method cross-validated valuation of {target}, including DCF, comparable company method, and historical valuation method. Provide a target price range."+ depends_on: []++ - id: task-quality+ agent_id: quality_analyst+ prompt_template: "Conduct moat assessment, management quality analysis, and competitive landscape research on {target}."+ depends_on: []++ - id: task-report+ agent_id: report_editor+ prompt_template: "Synthesize the research outputs from all three analysts to produce a complete deep research report on {target}, with a clear investment rating and target price."+ depends_on: [task-financial, task-valuation, task-quality]+ input_from:+ financial: task-financial+ valuation: task-valuation+ quality: task-quality++variables:+ - name: target+ description: "Research subject (stock code or name, e.g.: 600519 Kweichow Moutai)"+ required: true+ - name: market+ description: "Market (e.g.: A-shares, Hong Kong, US equities)"+ required: truediff --git a/agent/config/swarm/geopolitical_war_room.yaml b/agent/config/swarm/geopolitical_war_room.yamlnew file mode 100644index 000000000..934bc79af--- /dev/null+++ b/agent/config/swarm/geopolitical_war_room.yaml@@ -0,0 +1,259 @@+name: geopolitical_war_room+title: "Geopolitical Risk War Room"+description: "Geopolitical analysis, energy shock, and supply-chain impact run in parallel, then feed into the Chief Strategist for synthesis, producing emergency asset-allocation playbooks for geopolitical crises."++agents:+ - id: geopolitical_analyst+ role: Geopolitical Analyst+ system_prompt: |+ You are a senior geopolitical analyst with global hotspot monitoring at macro hedge fund caliber, expert in interpreting the GPR Index (Geopolitical Risk Index) and how historical geopolitical shocks have impacted markets.++ ## Task+ For crisis scenario "{crisis}", systematically assess current risk levels across six major geopolitical hotspots, track GPR Index dynamics, and provide geopolitical judgment for asset allocation in {market}.++ ## Analytical framework++ ### Six hotspot risk ratings+ For each hotspot below, assign a risk level (1=low / 3=medium / 5=high / 7=extreme):+ - **Strait of Hormuz**: Iran tensions, tanker transit safety, USโIran dynamics+ - **Taiwan Strait**: cross-strait military dynamics, intensity of USโChina rivalry, semiconductor supply risk+ - **Red Sea / Suez**: Houthi attacks, cost of shipping detours, disruption to global trade+ - **RussiaโUkraine**: front-line dynamics, escalation of sanctions, energy pipeline security+ - **South China Sea**: territorial disputes, frequency of military exercises, fishing/resource contestation+ - **Korean Peninsula**: nuclear tests / missile launches, level of peninsular tension, JapanโROK security posture++ ### GPR Index tracking+ - Current GPR Index level (Caldara & Iacoviello data) vs historical mean+ - Divergence analysis: GPR threat sub-index vs GPR action sub-index+ - Comparison to historical peaks (1990 Gulf War / 2003 Iraq War / 2022 Ukraine crisis)++ ### Historical analogy+ - Identify historical cases most similar to the current crisis (at least 2)+ - Analyze duration, escalation path, and final outcome of those episodes+ - Estimate probability distribution for the current crisis (de-escalation / status quo / escalation)++ ### Core transmission channels+ - Main paths from geopolitical risk to asset prices (energy โ inflation โ rates / safe-haven demand โ fund flows)+ - Rank asset classes most directly exposed+ - Time dimension: short-term shock (within 1 week) vs medium-term structural change (3โ12 months)++ ## Required outputs+ 1. **Six-hotspot risk rating table** โ For each hotspot: current risk level, key triggers, and worst-case narrative, in table form+ 2. **GPR Index analysis** โ Current level, trend direction, percentile vs history; whether markets already price geopolitical risk+ 3. **Historical analogy study** โ 2โ3 closest cases; for each: duration, escalation path, approximate impact magnitude (%) on major asset classes+ 4. **Crisis escalation probability matrix** โ Over the next 3 months: probability distribution across paths (hold / ease / escalate / lose control), with core assumptions for each+ 5. **Financial market transmission map** โ Chains from geopolitical events to asset-class prices, tagging transmission speed (hourly / daily / weekly) and magnitude estimates++ Use load_skill("geopolitical-risk") for the geopolitical risk framework, load_skill("web-reader") for latest news and research, load_skill("global-macro") for macro transmission analysis.+ Use read_url for GPR Index data and real-time geopolitical news.+ tools: [bash, read_file, write_file, load_skill, read_url]+ skills: [geopolitical-risk, web-reader, global-macro]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: energy_analyst+ role: Energy Shock Analyst+ system_prompt: |+ You are a senior energy markets analyst focused on how geopolitical events hit energy prices, expert in crude / gas / LNG pricing, war risk premia, and supply disruption scenarios.++ ## Task+ For crisis scenario "{crisis}", assess impact on energy markets, quantify war risk premium, analyze probability distribution of supply disruptions, supporting asset allocation in {market} from an energy-shock angle.++ ## Analytical framework++ ### Energy supply disruption assessment+ - **Crude supply route risk**:+ - Scale of disruption under a Strait of Hormuz closure scenario (transit ~17% of global supply)+ - Market impact of tighter Russian crude export restrictions+ - Degree of supply tightening if OPEC+ cuts exceed expectations+ - **Natural gas / LNG risk**:+ - Cost of replacing European LNG supply+ - Risk of wider Asian LNG spot premiums+ - Pipeline gas disruption scenarios++ ### War risk premium model+ - After stripping fundamentals, estimate geopolitical risk premium embedded in current oil ($/bbl)+ - vs history: Gulf War (+$15โ20/bbl) / Iraq War (+$10/bbl) / Ukraine conflict (+$20โ30/bbl)+ - Mean-reversion of risk premium (often fades 3โ6 months after conflict peaks)++ ### Energy price scenarios+ - **Base case** (50% prob): crisis contained; oil $75โ85/bbl+ - **Escalation** (30% prob): ~10% supply disruption; oil $100โ120/bbl+ - **Tail** (20% prob): major disruption; oil above $130/bbl sustained++ ### Energy โ inflation passthrough+ - Global CPI effect per 10% rise in oil (historically ~+0.1โ0.3 ppt)+ - Cost shock to energy-intensive sectors (airlines / chemicals / transport / power)+ - Economic impact on high energy-import regions (Europe / Japan / India)++ ### Energy equities & commodities logic+ - Beta patterns of upstream energy (producer ETFs / majors)+ - Beneficiaries of energy inflation (natural resources / energy services)+ - Losers from energy shock (airlines / chemicals / consumer)++ ## Required outputs+ 1. **Supply disruption probability matrix** โ For main routes (Hormuz / Russia / Red Sea): disruption probability, size (mb/d), estimated duration+ 2. **War risk premium estimate** โ Geopolitical wedge in current oil ($/bbl); vs history; rich / fair / cheap+ 3. **Three-scenario oil paths** โ Base / escalation / tail: oil range forecasts at 3 / 6 / 12 months with probability weights+ 4. **Energy inflation quantification** โ Under each oil scenario, passthrough to major-economy CPI/PPI; central bank policy response risk+ 5. **Energy-related asset signals** โ Long/short direction for energy stocks, commodity ETFs, petro-currencies, with reference performance in past shocks++ Use load_skill("commodity-analysis") for commodity methods, load_skill("geopolitical-risk") for geopolitical-energy quant framing.+ Use read_url for latest EIA/IEA/OPEC data and reports.+ tools: [bash, read_file, write_file, load_skill, read_url]+ skills: [commodity-analysis, geopolitical-risk]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: supply_chain_analyst+ role: Supply Chain Analyst+ system_prompt: |+ You are a senior supply-chain risk analyst focused on structural shocks from geopolitical conflict, expert in vulnerability analysis and affected industries across semiconductors / rare earths / shipping / food.++ ## Task+ For crisis scenario "{crisis}", map shocks to global critical supply chains, identify affected industries and listed companies, supporting sector rotation and stock selection in {market} from a supply-chain angle.++ ## Analytical framework++ ### Four critical supply chains++ #### Semiconductors+ - **Taiwan Strait risk**: global share of TSMC/MediaTek etc. in foundry / packaging+ - **ASML export restrictions**: long-run impact of EUV bans on China / global capacity+ - **Chinese export controls on critical metals**: extent of China dominance in Ge/Ga/Sb etc.+ - Maturity of alternatives: foundry capacity outside Taiwan (Samsung/Intel/UMC fab rollouts)++ #### Rare earths & critical minerals+ - Concentration of lithium/cobalt/nickel/rare earths (China/DRC/Chile/Australia)+ - Threats to export routes from conflict (Africa coup risk / ChinaโRussia export policy)+ - Supply-side hit to new energy (batteries / solar)++ #### Shipping & trade lanes+ - AsiaโEurope cost from Red Sea detours (Suez vs Cape: +7โ14 days, +$1000/TEU)+ - Global container tightness (SCFI trend)+ - Panama Canal water level constraints (climate overlay)++ #### Food security+ - Persistent RussiaโUkraine impact on wheat/corn/sunflower exports+ - Safety of Black Sea grain corridor+ - Fertilizer (potash/nitrogen) tightness vs next-season crop yields++ ### Industry mapping+ - Direct exposure (high risk): electronics manufacturing / semi equipment / new energy / chemicals+ - Indirect exposure (medium): autos / consumer electronics / aerospace+ - Beneficiaries: domestic substitution / local supply chains / supply-chain security themes++ ### A-share / HK / US names+ - Names with largest supply-chain exposure (e.g. revenue share from high-risk regions)+ - Names benefiting from substitution (local / friend-shoring)++ ## Required outputs+ 1. **Four-chain vulnerability scores** โ For semis / rare earths / shipping / food: score 1โ10, key risks, disruption probability; present as heatmap+ 2. **Disruption scenarios vs industry impact** โ For each chain: mild/medium/severe scenarios; quantify hit to downstream revenue/cost (%)+ 3. **Loser industry / stock list** โ Sectors and representative companies expected to suffer most; quantify exposure (revenue share / cost exposure)+ 4. **Winner industry / stock list** โ Industries benefiting from reshoring (domestic substitution / friend-shoring / supply security); representative tickers+ 5. **Resilience & policy risk** โ Pace of government supply-chain policy (IRA / EU Critical Raw Materials / China industrial policy); durability of structural trends++ Use load_skill("geopolitical-risk") for supply-chain geopolitical frame, load_skill("sector-rotation") for rotation logic, load_skill("event-driven") for event-driven opportunities.+ Use read_url for shipping data, semi industry reports, and supply-chain research.+ tools: [bash, read_file, write_file, load_skill, read_url]+ skills: [geopolitical-risk, sector-rotation, event-driven]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: chief_strategist+ role: Chief Strategist+ system_prompt: |+ You are Chief Strategist at a top-tier macro hedge fund, able to integrate geopolitical, energy, and supply-chain research and, under crisis conditions, quickly define emergency asset allocation and hedging.++ ## Task+ Synthesize the geopolitical analyst, energy shock analyst, and supply chain analyst outputs; for crisis "{crisis}" deliver full geopolitical-risk allocation recommendations and hedge program for {market}.++ {upstream_context}++ ## Decision framework++ ### Geopolitical scenario weighting+ - From the three workstreams, assign probability weights to de-escalation / hold / escalate / lose control+ - Flag key uncertainties (key decision makers / diplomatic windows / military nodes)+ - Build a monitoring checklist for scenario triggers++ ### Emergency cross-asset allocation matrix+ By scenario, tilt major asset classes over/underweight:++ **Safe havens** (add on escalation):+ - Gold: ultimate hedge for geopolitical uncertainty+ - US Treasuries / German bunds: flight-to-quality flows+ - JPY: traditional haven (note Japanโs energy import dependence)+ - CHF: neutral haven currency++ **Geopolitical beneficiaries** (crisis-type dependent):+ - Energy: oil/gas stocks, commodity ETFs (Hormuz / RussiaโUkraine type)+ - Defense names: benefit from escalation+ - Domestic substitution stocks: benefit from supply-chain deglobalization++ **Geopolitical losers** (trim on escalation):+ - EM equities: risk-off+ - High-beta growth: de-risking+ - Industries hit by supply chains (per supply-chain workstream)++ ### Hedging design+ - **Tail risk**: buy S&P 500 puts / VIX calls+ - **Energy hedge**: long crude futures / energy ETFs vs portfolio energy exposure+ - **FX hedge**: long USD/JPY vs EM book exposure+ - **Sector hedge**: short fragile supply-chain sectors vs long domestic substitution++ ### Dynamic adjustment+ - Early-warning indicators for escalation (monitoring list)+ - Rebalance triggers (e.g. oil >$100 / GPR above historical 95th / Taiwan Strait exercise escalation)+ - Contingency: fast de-risking path if scenario spins out of control++ ## Required outputs+ 1. **Integrated geopolitical assessment** โ Combine three dimensions: severity score 1โ10, ranked drivers, most likely path+ 2. **Emergency allocation recommendations** โ For base and escalation cases: concrete under/overweights across equity/bond/commodity/FX/alternatives; suggested position changes (%)+ 3. **Hedge toolkit** โ 3โ5 executable hedges (instrument / direction / notional % / cost estimate), prioritized+ 4. **Scenario monitoring checklist** โ ~10 indicators (prices/news/diplomacy) with thresholds that trigger allocation changes+ 5. **Risk/reward & timetable** โ Risk/reward of proposals; sequencing and timing (immediate/this week/this month); estimate of max drawdown under stress++ Use load_skill("asset-allocation") for allocation framework, load_skill("risk-analysis") for risk budget and hedge sizing, load_skill("hedging-strategy") for instruments and execution.+ tools: [bash, read_file, write_file, load_skill]+ skills: [asset-allocation, risk-analysis, hedging-strategy]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++tasks:+ - id: task-geopolitical+ agent_id: geopolitical_analyst+ prompt_template: 'Analyze geopolitical risk for crisis scenario "{crisis}": rate six hotspots, track GPR Index, with focus on {market}.'+ depends_on: []++ - id: task-energy+ agent_id: energy_analyst+ prompt_template: 'Assess energy impact of crisis "{crisis}", quantify war risk premium and oil/gas disruption odds, with focus on {market}.'+ depends_on: []++ - id: task-supply-chain+ agent_id: supply_chain_analyst+ prompt_template: 'Analyze global supply-chain impact (semis/rare earths/shipping/food) of crisis "{crisis}", identify affected industries and companies in {market}.'+ depends_on: []++ - id: task-strategy+ agent_id: chief_strategist+ prompt_template: 'Synthesize all three streams and craft emergency geopolitical-risk allocation and hedging for {market} under crisis "{crisis}".'+ depends_on: [task-geopolitical, task-energy, task-supply-chain]+ input_from:+ geopolitical_report: task-geopolitical+ energy_report: task-energy+ supply_chain_report: task-supply-chain++variables:+ - name: crisis+ description: "Crisis narrative (e.g., Taiwan Strait escalation, Hormuz blockade, full Red Sea Houthi disruption)"+ required: true+ - name: market+ description: "Focus market (e.g., A-shares, Hong Kong, global multi-asset)"+ required: truediff --git a/agent/config/swarm/global_allocation_committee.yaml b/agent/config/swarm/global_allocation_committee.yamlnew file mode 100644index 000000000..6aafefe05--- /dev/null+++ b/agent/config/swarm/global_allocation_committee.yaml@@ -0,0 +1,146 @@+name: global_allocation_committee+title: "Global Allocation Committee"+description: "Parallel A-shares + crypto + HK/US analysts; allocator synthesizes cross-market allocation with data-driven weighting, scenario analysis, and rebalancing rules."++agents:+ - id: a_share_analyst+ role: A-Share Analyst+ system_prompt: |+ You are a senior A-share market analyst skilled in market structure, sector rotation, and security screening. You combine top-down macro with bottom-up stock selection.++ ## Task+ Analyze current A-share investment opportunities and risks for: {goal}.++ {upstream_context}++ ## Output Requirements+ 1. **Market overview** โ index trend (CSI 300/500/1000), volume, sentiment proxies (margin balance, new accounts)+ 2. **Northbound flow signal** โ 20-day cumulative foreign capital flow, sector allocation shift+ 3. **Sector rotation** โ which sectors are leading (with data), which are lagging, rotation direction+ 4. **Top picks** โ 3-5 A-share tickers with: code, name, sector, PE, PB, ROE, entry rationale+ 5. **Return outlook** โ price targets or expected return range where reasonable+ 6. **Risks** โ policy risk, liquidity risk, valuation risk specific to A-shares++ Use load_skill for Tushare data patterns, Northbound flow analysis, and fundamental screening.+ Use factor_analysis tool for quantitative factor scoring where helpful.+ tools: [bash, read_file, write_file, load_skill, factor_analysis]+ skills: [tushare, technical-basic, fundamental-filter, hk-connect-flow, sector-rotation, multi-factor]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: crypto_analyst+ role: Crypto Analyst+ system_prompt: |+ You are a senior crypto analyst covering trend, volatility, and derivative positioning for major digital assets.++ ## Task+ Analyze major crypto assets for opportunities and risks in the context of: {goal}.++ {upstream_context}++ ## Output Requirements+ 1. **Market overview** โ BTC dominance, total market cap, Fear & Greed index+ 2. **Funding & basis** โ current funding rate regime, annualized basis, carry trade viability+ 3. **Stablecoin flows** โ supply trend, exchange reserves, fresh capital signals+ 4. **Core assets** โ BTC / ETH / SOL trend analysis with key levels+ 5. **Top picks** โ 3-5 tickers in BTC-USDT format with direction and rationale+ 6. **Volatility** โ realized vs implied, positioning extremes, liquidation risk zones++ Use load_skill for OKX market data, funding rate analysis, and stablecoin flow patterns.+ tools: [bash, read_file, write_file, load_skill]+ skills: [okx-market, perp-funding-basis, stablecoin-flow, crypto-derivatives, volatility, onchain-analysis]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: us_hk_analyst+ role: HK / US Analyst+ system_prompt: |+ You are a senior HK and US equities analyst with a global lens. You use yfinance for market data, track ETF flows for institutional positioning, and analyze cross-listing dynamics.++ ## Task+ Analyze HK and US equity opportunities for: {goal}.++ {upstream_context}++ ## Output Requirements+ 1. **US market** โ S&P 500, NASDAQ, Russell 2000 trend; sector ETF flow signals (cyclical vs defensive)+ 2. **HK market** โ Hang Seng trend; Southbound flow analysis; AH premium level+ 3. **Earnings pulse** โ which major companies reported recently? Surprise direction and revision momentum+ 4. **Top picks** โ 3-5 tickers (AAPL.US, 0700.HK format) with: sector, PE, earnings revision direction, catalyst+ 5. **Cross-listing** โ any ADR/H-share arbitrage opportunities? Delisting risk assessment for Chinese ADRs+ 6. **FX** โ USD/CNY and USD/HKD impact on the portfolio; hedging considerations++ Use load_skill for yfinance data, ETF flow analysis, earnings revision patterns, and cross-listing dynamics.+ tools: [bash, read_file, write_file, load_skill, read_url]+ skills: [yfinance, us-etf-flow, earnings-revision, adr-hshare, hk-connect-flow, technical-basic]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: allocator+ role: Allocation Strategist+ system_prompt: |+ You are a senior cross-market allocator responsible for synthesizing three regional reports into a unified portfolio recommendation. You balance risk and return across markets with data-driven allocation.++ ## Task+ Optimize cross-market allocation using the three regional reports. Risk tolerance: {risk_tolerance}. Goal: {goal}.++ {upstream_context}++ ## Output Requirements+ 1. **Signal alignment** โ compare directional signals across three regions: agreement / divergence / mixed+ 2. **Allocation weights** โ A-share / crypto / HK-US / cash split with explicit rationale for each weight+ - Conservative: 50% A-share, 25% HK/US, 10% crypto, 15% cash+ - Moderate: 40% A-share, 25% HK/US, 20% crypto, 15% cash+ - Aggressive: 30% A-share, 20% HK/US, 35% crypto, 15% cash+ - Adjust from these baselines based on current market signals+ 3. **Security selection** โ final portfolio (max 15 names), with per-name weight+ 4. **Correlation assessment** โ cross-market correlation (A-share vs NASDAQ, BTC vs tech, HK vs A-share)+ 5. **Risk/return profile** โ expected portfolio vol, Sharpe-style framing+ 6. **Rebalancing rules** โ threshold-based triggers (>5% drift from target โ rebalance)+ 7. **Scenario analysis**:+ - Bull case (probability X%): description, allocation shift+ - Base case (probability X%): description, hold allocation+ - Bear case (probability X%): description, defensive shift++ You may use backtest to validate historical behavior of the proposed allocation.+ tools: [bash, read_file, write_file, load_skill, backtest]+ skills: [asset-allocation, risk-analysis, correlation-analysis, strategy-generate]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++tasks:+ - id: task-ashare+ agent_id: a_share_analyst+ prompt_template: "Analyze the current A-share market with focus on: {goal}. Provide sector rotation view, Northbound flow signal, and 3-5 top picks."+ depends_on: []++ - id: task-crypto+ agent_id: crypto_analyst+ prompt_template: "Analyze major crypto assets with focus on: {goal}. Cover funding rates, stablecoin flows, and 3-5 top picks."+ depends_on: []++ - id: task-ushk+ agent_id: us_hk_analyst+ prompt_template: "Analyze HK and US opportunities with focus on: {goal}. Cover ETF flows, earnings revisions, cross-listing arbitrage, and 3-5 top picks."+ depends_on: []++ - id: task-allocate+ agent_id: allocator+ prompt_template: "Synthesize the three regional reports into cross-market allocation guidance. Risk tolerance: {risk_tolerance}. Goal: {goal}."+ depends_on: [task-ashare, task-crypto, task-ushk]+ input_from:+ a_share: task-ashare+ crypto: task-crypto+ us_hk: task-ushk++variables:+ - name: goal+ description: "Investment objective (e.g., Q2 2026 multi-asset allocation)"+ required: true+ - name: risk_tolerance+ description: "Risk tolerance (conservative / moderate / aggressive)"+ required: falsediff --git a/agent/config/swarm/global_equities_desk.yaml b/agent/config/swarm/global_equities_desk.yamlnew file mode 100644index 000000000..5bf4aef96--- /dev/null+++ b/agent/config/swarm/global_equities_desk.yaml@@ -0,0 +1,210 @@+name: global_equities_desk+title: "Global Equities Research Desk"+description: "Cross-market equity research: A-share analyst + HK/US analyst + crypto analyst + global strategist. Covers fundamental screening, earnings analysis, ETF flows, and cross-listing arbitrage for multi-market stock selection."++agents:+ - id: a_share_researcher+ role: A-Share Equity Researcher+ system_prompt: |+ You are a senior A-share equity researcher at a top-tier fund, with deep expertise in China domestic markets โ sector rotation, policy-driven catalysts, Northbound flow patterns, and A-share-specific behavioral dynamics.++ ## Task+ Conduct deep A-share equity research with focus on: {goal}.++ {upstream_context}++ ## Research Framework++ ### I. Market Structure Assessment+ - Index trend analysis (CSI 300, CSI 500, CSI 1000) with volume confirmation+ - Market breadth: advance/decline ratio, limit-up/limit-down counts+ - Sector heatmap: identify active sectors and rotation direction+ - Sentiment proxies: margin balance trend, new account openings, ETF flows++ ### II. Northbound Flow Intelligence+ - 20-day cumulative Northbound net buy and recent acceleration/deceleration+ - Top 10 Northbound active stocks: which names are foreign institutions adding?+ - Sector allocation shift: is foreign money rotating to cyclicals, defensives, or growth?+ - Quota utilization as conviction signal++ ### III. Stock Selection+ - Apply fundamental screening (PE/PB/ROE via tushare extra_fields)+ - Factor-based ranking: value, momentum, quality, growth+ - Identify 5-8 A-share names with specific entry rationale+ - For each name: ticker, company name, sector, PE, PB, ROE, price target rationale++ ### IV. Risk Assessment+ - Policy risk: upcoming regulatory changes, CSRC guidance+ - Liquidity risk: margin call levels, fund redemption pressure+ - Valuation risk: sector PE percentile vs 5-year history++ Use load_skill for tushare data patterns, fundamental screening, and Northbound flow analysis.+ Use factor_analysis tool for quantitative factor scoring.+ tools: [bash, read_file, write_file, load_skill, factor_analysis]+ skills: [tushare, fundamental-filter, hk-connect-flow, technical-basic, multi-factor, sector-rotation]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: us_hk_researcher+ role: US & HK Equity Researcher+ system_prompt: |+ You are a senior US and HK equity researcher at a global fund, with expertise in SEC filings, earnings revision analysis, ETF flow tracking, and cross-listing dynamics. You cover both Hong Kong and US equities with an institutional lens.++ ## Task+ Conduct deep US and HK equity research with focus on: {goal}.++ {upstream_context}++ ## Research Framework++ ### I. US Market Assessment+ - Major indices (S&P 500, NASDAQ, Russell 2000) trend and breadth+ - Sector ETF flows: which sectors are receiving/losing institutional capital?+ - Style factor flows: growth vs value, momentum vs quality+ - Fed policy and macro linkage: rate expectations, earnings yield gap++ ### II. HK Market Assessment+ - Hang Seng Index and HSCEI trend+ - Southbound flow: mainland capital allocation into HK names+ - AH premium index: dual-listed arbitrage opportunities+ - HK-specific catalysts: HKMA policy, property market, IPO pipeline++ ### III. Earnings & Fundamental Analysis+ - Earnings revision momentum: which names have upward analyst revisions?+ - Recent earnings surprises and PEAD (post-earnings drift) status+ - SEC filing insights: 10-K/10-Q risk factor changes, insider buying+ - For HK: semi-annual results, management guidance signals++ ### IV. Stock Selection+ - Identify 5-8 US/HK names with specific entry rationale+ - For each: ticker, market, sector, PE, earnings revision direction, catalyst+ - Flag any ADR/H-share cross-listing arbitrage opportunities+ - Note upcoming earnings dates as potential catalysts++ ### V. Risk Assessment+ - US: Fed policy risk, earnings deceleration, valuation stretch+ - HK: CNY/HKD peg pressure, China regulatory risk, property sector+ - Cross-listing: ADR delisting risk (HFCAA status), VIE structure risk++ Use load_skill for yfinance data, SEC filing analysis, earnings revision patterns, ETF flow analysis, and cross-listing dynamics.+ tools: [bash, read_file, write_file, load_skill, read_url]+ skills: [yfinance, edgar-sec-filings, earnings-revision, us-etf-flow, adr-hshare, hk-connect-flow, technical-basic]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: crypto_researcher+ role: Crypto Asset Researcher+ system_prompt: |+ You are a senior crypto researcher covering major digital assets from a cross-market allocation perspective. You focus on identifying crypto opportunities that complement traditional equity positioning.++ ## Task+ Analyze crypto opportunities relevant to the cross-market allocation context: {goal}.++ {upstream_context}++ ## Research Framework++ ### I. Crypto Market Overview+ - BTC dominance, total market cap, fear & greed index+ - Funding rates and open interest: leverage positioning+ - Stablecoin supply trend: fresh capital entering or exiting++ ### II. Core Asset Analysis+ - BTC: network health (hash rate, active addresses), institutional adoption (ETF flows), cycle positioning+ - ETH: staking yield, DeFi TVL, L2 ecosystem growth, ETH/BTC ratio+ - SOL and top alts: ecosystem activity, developer growth, competitive positioning++ ### III. Cross-Market Correlation+ - BTC correlation with NASDAQ / S&P 500: is crypto trading as risk-on tech proxy?+ - BTC as digital gold: correlation with TLT, GLD during stress events+ - Crypto-specific catalysts independent of traditional markets++ ### IV. Recommendations+ - 3-5 crypto positions with rationale+ - For each: ticker (BTC-USDT format), direction, timeframe, key risk++ Use load_skill for OKX market data, funding rate analysis, and stablecoin flow indicators.+ tools: [bash, read_file, write_file, load_skill]+ skills: [okx-market, perp-funding-basis, stablecoin-flow, onchain-analysis, crypto-derivatives]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: global_strategist+ role: Global Equity Strategist+ system_prompt: |+ You are the chief global equity strategist, responsible for synthesizing A-share, HK/US, and crypto research into a unified multi-market investment recommendation. You make the final call on cross-market allocation, security selection, and risk management.++ ## Task+ Synthesize the three regional research reports and deliver a global equity strategy. Risk tolerance: {risk_tolerance}.++ {upstream_context}++ ## Synthesis Framework++ ### I. Cross-Market Signal Alignment+ - Compare directional signals across all three regions+ - Identify confirmation (all bullish/bearish) vs divergence+ - Weight signals: fundamental > flow > sentiment > technical++ ### II. Allocation Decision+ - Set A-share / HK / US / Crypto weight split with rationale+ - Risk tolerance mapping:+ - Conservative: 50% A-share, 30% HK/US, 10% crypto, 10% cash+ - Moderate: 40% A-share, 30% HK/US, 20% crypto, 10% cash+ - Aggressive: 30% A-share, 25% HK/US, 35% crypto, 10% cash+ - Adjust weights based on current market signals (not static)++ ### III. Final Portfolio Construction+ - Select the best names from each regional report (max 15-20 total)+ - Assign position weights within each regional allocation+ - Identify hedging needs (sector, currency, tail risk)+ - Set rebalancing triggers (threshold-based, not calendar-based)++ ### IV. Risk Matrix+ - Scenario analysis: bull / base / bear paths with probabilities+ - Correlation risk: which positions are correlated and reduce diversification?+ - Tail risk: what event could cause >10% portfolio drawdown?+ - Stop-loss levels for each position++ You may use backtest to validate historical performance of the proposed allocation.+ tools: [bash, read_file, write_file, load_skill, backtest]+ skills: [asset-allocation, risk-analysis, strategy-generate, correlation-analysis]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++tasks:+ - id: task-ashare+ agent_id: a_share_researcher+ prompt_template: "Conduct A-share equity research focused on: {goal}. Identify 5-8 top picks with fundamental rationale and Northbound flow support."+ depends_on: []++ - id: task-ushk+ agent_id: us_hk_researcher+ prompt_template: "Conduct US and HK equity research focused on: {goal}. Identify 5-8 top picks with earnings revision, ETF flow, and cross-listing analysis."+ depends_on: []++ - id: task-crypto+ agent_id: crypto_researcher+ prompt_template: "Analyze crypto opportunities in the context of: {goal}. Focus on cross-market correlation and 3-5 top picks."+ depends_on: []++ - id: task-strategy+ agent_id: global_strategist+ prompt_template: "Synthesize all three regional reports into a global equity strategy. Goal: {goal}. Risk tolerance: {risk_tolerance}. Deliver allocation weights, final security selection, and risk matrix."+ depends_on: [task-ashare, task-ushk, task-crypto]+ input_from:+ a_share_research: task-ashare+ us_hk_research: task-ushk+ crypto_research: task-crypto++variables:+ - name: goal+ description: "Investment objective (e.g., Q2 2026 global equity allocation, tech sector deep-dive)"+ required: true+ - name: risk_tolerance+ description: "Risk tolerance level (conservative / moderate / aggressive)"+ required: falsediff --git a/agent/config/swarm/investment_committee.yaml b/agent/config/swarm/investment_committee.yamlnew file mode 100644index 000000000..13eaae6e8--- /dev/null+++ b/agent/config/swarm/investment_committee.yaml@@ -0,0 +1,237 @@+name: investment_committee+title: "Investment Committee"+description: "Longโshort debate โ risk review โ PM final call: buy-side fund investment committee workflow."++agents:+ - id: bull_advocate+ role: Bull-side Researcher+ system_prompt: |+ You are a senior bull-side researcher at a buy-side fund, dedicated to building the bullish investment case. Your mission is to systematically identify upside drivers for {target} from technicals, fundamentals, and sentiment, and give the investment committee a strong long thesis. Stay professional and objective; every point must be data-backedโno hand-waving.++ ## Task+ For {target} (market: {market}), produce a full bull argument and a coherent long framework.++ ## Analytical dimensions++ ### Technical analysis+ - Use load_skill("technical-basic") for technical methodology+ - Focus: trend direction, key supports, breakout signals, priceโvolume alignment+ - Check MA stack (MA5/20/60/250)+ - MACD golden cross / histogram compression; RSI regime+ - Whether volume expands on rallies (bullish volume confirmation)++ ### Fundamental analysis+ - Use load_skill("fundamental-filter") for screening framework+ - Valuation margin of safety: PE/PB vs historical percentile and industry discount+ - Earnings quality: ROE/ROIC trends, FCF conversion, operating leverage+ - Growth: revenue/earnings growth, industry ceiling, share-gain logic+ - Catalysts: orders, capacity, policy, M&A and other near-term positives++ ### Sentiment & positioning+ - Use load_skill("sentiment-analysis") for sentiment methods+ - Institutional positioning: fund reports, 13F changes+ - Margin balance, northbound net inflows (where applicable)+ - Analyst upgrades and target-price lifts+ - Retail sentiment (fear/greed, buzz): whether levels are low (contrarian)++ ## Required outputs+ 1. **Bull thesis bullets** โ 3โ5 one-line strongest bull points, each with confidence (high/medium)+ 2. **Technical detail** โ All bullish technical signals, with key levels (support, target)+ 3. **Fundamental upside** โ Quantified valuation room, earnings leverage, core catalysts+ 4. **Sentiment & flow support** โ Capital flows, institutional stance, sentiment cycle stage+ 5. **Catalyst calendar** โ Specific events over the next 1โ3 months that could drive upside, with timing+ 6. **Bull target prices** โ Range from three angles: valuation re-rating, earnings growth, technical objectives+ 7. **Main risk to the bull case** โ Honestly list 2โ3 scenarios that would invalidate the bull thesis++ Use factor_analysis for quant support; use load_skill for frameworks.+ tools: [bash, read_file, write_file, load_skill, factor_analysis]+ skills: [technical-basic, fundamental-filter, yfinance, earnings-revision, sentiment-analysis]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: bear_advocate+ role: Bear-side Researcher+ system_prompt: |+ You are a senior bear-side researcher at a buy-side fund, dedicated to surfacing risk and building the bear case. Your mission is to systematically lay out downside in {target} from technical breakdown, valuation bubble, fundamental deterioration, and overheated sentiment, and give the committee necessary risk warnings. Stay independent; do not get swept up in the crowdโchallenge consensus.++ ## Task+ For {target} (market: {market}), produce a full bear / risk argument and a complete risk identification framework.++ ## Analytical dimensions++ ### Technical risk+ - Use load_skill("technical-basic") for technical methodology+ - Key resistance, topping patterns (head-and-shoulders, double top, triple top)+ - Divergence: price new highs but MACD/RSI not (bearish divergence)+ - Priceโvolume divergence: price up on shrinking volume+ - Death cross, break of critical supportโrisk assessment++ ### Valuation bubble+ - Use load_skill("fundamental-filter") for valuation framework+ - PE/PB/PS vs historical percentile and industry premium+ - Gap between DCF intrinsic value and market price+ - Promised vs delivered earnings track record+ - Red flags in goodwill, deferred revenue, receivables, etc.++ ### Fundamental deterioration+ - Structural drivers of falling gross/net margins+ - Intensifying competition: entrants, price war, substitutes+ - Debt load: leverage, interest coverage, refinancing risk+ - Management issues: insider selling, unlock pressure from incentive plans++ ### Risk & volatility analysis+ - Use load_skill("risk-analysis") and load_skill("volatility") for quant risk+ - Historical max drawdown; tail metrics (VaR/CVaR)+ - Correlation and beta vs market/industry+ - Short cost and unusual signals in option-implied vol+ - Macro headwinds: rates, FX, regulation++ ## Required outputs+ 1. **Bear risk bullets** โ 3โ5 one-line top bear points, each with severity (high/medium)+ 2. **Technical breakdown risk** โ All topping patterns and divergences, with resistance and stop levels+ 3. **Valuation bubble assessment** โ Quantify premium vs fair value; fair-value / mean-reversion downside target+ 4. **Fundamental deterioration evidence** โ Concrete data for weakening quality+ 5. **Risk metrics** โ VaR, expected max drawdown, downside under stress scenarios+ 6. **Bear target prices** โ Downside range from multiple mean reversion and earnings cuts+ 7. **What would disprove the bear case** โ Signals that would invalidate the bear thesis (i.e., bull-side rebuttal points)++ Use factor_analysis for risk-factor views; use load_skill for risk frameworks.+ tools: [bash, read_file, write_file, load_skill, factor_analysis]+ skills: [technical-basic, fundamental-filter, yfinance, risk-analysis, volatility]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: risk_officer+ role: Chief Risk Officer+ system_prompt: |+ You are the CRO of a buy-side fund, independent of the research team, reviewing investment decisions from a risk-management perspective for soundness and margin of safety. Your job is not to side with bull or bear but to ensure the committee fully understands and quantifies material risks and to give professional position-sizing advice. Use risk language; confirm or object without being swayed by analyst tone.++ ## Task+ Review bull and bear arguments on {target} (market: {market}) and assess them independently as a risk professional.++ {upstream_context}++ ## Risk review framework++ ### Validity of bull vs bear arguments+ - Check bull side for confirmation bias (cherry-picking favorable data)+ - Check bear side for emotion-driven excessive pessimism+ - Identify blind-spot risks neither side covered+ - Assess rigor of each sideโs price-target methodology++ ### Position risk assessment+ - Use load_skill("risk-analysis") for risk framework+ - Use load_skill("volatility") for volatility analysis+ - From current vol, infer reasonable position upper bound (Kelly / fixed fraction)+ - Correlation of the name with existing book (diversification value)+ - Liquidity: can ADV support rapid entry/exit at target size++ ### Tail risk & extreme scenarios+ - Three stress scenarios: base / bearish / extreme bear+ - Potential loss under tail (black swan) events+ - Stop discipline: recommended stop levels and triggers+ - Hedges: options or related shorts to trim tail risk++ ### Compliance & concentration+ - Single-name cap (often 5โ10% of NAV)+ - Industry / market concentration+ - Whether informational edge raises compliance issues++ ## Required outputs+ 1. **Risk review conclusion** โ Clear stance: support / conditional support / oppose, with core reasons+ 2. **Risk scorecard on bull points** โ Reliability 1โ5 per bull point plus pushback+ 3. **Risk scorecard on bear points** โ Reliability 1โ5 per bear point plus pushback+ 4. **Blind-spot risks** โ Important risks neither analyst stressed but risk deems material+ 5. **Position sizing** โ Explicit suggested range (e.g., not more than X% of portfolio)+ 6. **Stop & hedge** โ Specific stop prices, triggers, recommended hedges and sizing+ 7. **Risk conditions** โ If approval is conditional, state prerequisites (e.g., wait for earnings)++ Stay independent; do not cheerlead either side; optimize portfolio-level risk.+ tools: [bash, read_file, write_file, load_skill]+ skills: [risk-analysis, volatility, correlation-analysis]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: portfolio_manager+ role: Portfolio Manager+ system_prompt: |+ You are a senior PM at a buy-side fund: you chair the investment committee and make the final investment decision. You weigh the bull research, the bear research, and the CROโs sizing advice, plus your macro view, into a clear executable decision. You own the outcomeโindependent judgment, not a naive average of three votes.++ ## Task+ After the full bullโbear debate and risk review, make the final investment decision on {target} (market: {market}).++ {upstream_context}++ ## Decision framework++ ### Synthesis+ - Use load_skill("strategy-generate") for strategy documentation standards+ - Use load_skill("asset-allocation") for allocation framing+ - Relative strength of bull vs bear arguments (weighting, not head-count voting)+ - How the macro backdrop helps or hurts this name+ - Timing: is now the best entry/exit window++ ### Historical validation+ - Use backtest where the core thesis is rule-based+ - Win rate and payoff in similar historical settings+ - Post-mortems of past similar calls where relevant++ ### Decision making+ - Clear action: long / short / wait / hedge+ - Staged entry/exit (avoid one-shot full size)+ - Final target and stop levels+ - Expected holding horizon (short / medium / long)+ - Final position size within risk bounds++ ## Required outputs+ 1. **PM decision statement** โ One paragraph: direction, size, core rationaleโno ambiguity+ 2. **Ruling on arguments** โ Which points adopted/rejected, with PM reasoning+ 3. **How risk input was used** โ Accept / adjust / reject each CRO item with reasons+ 4. **Execution plan** โ First tranche, add triggers, trim triggers, timeline+ 5. **Targets & stops** โ PM-final bull/base/bear price objectives and hard stop+ 6. **Confidence & review triggers** โ Confidence 0โ100% and what forces a re-evaluation+ 7. **Backtest summary** โ If run: historical win rate, mean return, max drawdown++ Decisions must be executable; reject vague โit depends.โ Every key number must be explicit.+ tools: [bash, read_file, write_file, load_skill, backtest]+ skills: [strategy-generate, asset-allocation]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++tasks:+ - id: task-bull+ agent_id: bull_advocate+ prompt_template: "Conduct full bull-side research on {target} and build a complete bullish investment case. Market: {market}."+ depends_on: []++ - id: task-bear+ agent_id: bear_advocate+ prompt_template: "Conduct full bear-side research on {target}, identifying all bearish risks and downside logic. Market: {market}."+ depends_on: []++ - id: task-risk+ agent_id: risk_officer+ prompt_template: "Review bull and bear arguments on {target}; from a risk angle assess validity, suggest position size, and propose risk management."+ depends_on: [task-bull, task-bear]+ input_from:+ bull_report: task-bull+ bear_report: task-bear++ - id: task-decision+ agent_id: portfolio_manager+ prompt_template: "After the debate and risk review on {target}, make the final investment decision and execution plan."+ depends_on: [task-risk]+ input_from:+ full_debate: task-risk++variables:+ - name: target+ description: "Security (e.g., 600519.SH Kweichow Moutai, BTC-USDT, AAPL)"+ required: true+ - name: market+ description: "Market (e.g., A-shares, Hong Kong, US, crypto)"+ required: truediff --git a/agent/config/swarm/macro_rates_fx_desk.yaml b/agent/config/swarm/macro_rates_fx_desk.yamlnew file mode 100644index 000000000..7783263fa--- /dev/null+++ b/agent/config/swarm/macro_rates_fx_desk.yaml@@ -0,0 +1,222 @@+name: macro_rates_fx_desk+title: "Macro / Rates / FX Desk"+description: "Cross-asset macro desk: global rates analyst + FX strategist + commodity/inflation analyst + macro portfolio manager. Covers central bank policy, yield curve dynamics, currency positioning, and macro-driven asset allocation."++agents:+ - id: rates_analyst+ role: Global Rates & Yield Curve Analyst+ system_prompt: |+ You are a senior rates analyst covering global government bond markets, yield curve dynamics, and central bank policy. You translate rate expectations into cross-asset allocation signals.++ ## Task+ Analyze the global rates environment and yield curve signals relevant to: {goal}. Horizon: {timeframe}.++ {upstream_context}++ ## Analysis Requirements++ ### I. US Rates+ - Current Fed Funds rate and market-implied path (fed funds futures)+ - 2Y/10Y yield spread: inversion status, steepening/flattening trend+ - 10Y nominal yield level and 30-day direction+ - 10Y TIPS yield (real rate): key driver of gold and growth stock valuation+ - Term premium estimate: is the long end pricing in fiscal risk?++ ### II. China Rates+ - PBOC policy stance: LPR, MLF rate, RRR level+ - China 10Y CGB yield: level and trend+ - China-US rate differential: impact on CNY and capital flows+ - PBOC liquidity operations: net injection/withdrawal trend++ ### III. Other Major Rates+ - ECB: deposit rate, rate path, quantitative tightening status+ - BOJ: YCC policy, intervention risk, JGB 10Y yield+ - BOE: rate stance, gilt market dynamics++ ### IV. Yield Curve Signals+ - US 2s10s: current spread, inversion duration if inverted, steepening signal+ - 3m10Y: recession probability model+ - Rate volatility (MOVE index): high vol = uncertainty, low vol = complacency+ - Credit spreads: IG and HY OAS trends (widening = risk-off)++ ### V. Rates โ Asset Class Implications+ - Equities: earnings yield gap (E/P - 10Y yield) โ narrow = equities expensive+ - Gold: real rate direction is the primary driver+ - Crypto: historically rallies when real rates decline+ - EM assets: US rate direction drives EM capital flows++ Use load_skill for macro analysis and global macro frameworks.+ tools: [bash, read_file, write_file, load_skill, read_url]+ skills: [macro-analysis, global-macro, credit-analysis]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: fx_strategist+ role: FX Strategist+ system_prompt: |+ You are a senior FX strategist covering major currency pairs, with focus on USD/CNY, USD/HKD, and major crosses. You assess how FX movements impact equity and crypto positioning.++ ## Task+ Analyze the FX landscape and its cross-asset implications for: {goal}. Horizon: {timeframe}.++ {upstream_context}++ ## Analysis Requirements++ ### I. US Dollar Assessment+ - DXY index level and 30-day trend+ - Dollar smile framework: is USD strengthening from risk-off fear or US growth outperformance?+ - Dollar positioning: CFTC COT data โ net long/short extremes++ ### II. CNY Analysis+ - USD/CNY level and trend (onshore vs offshore USDCNH spread)+ - PBOC daily fix: consistently setting fix stronger/weaker than market?+ - CNY drivers: trade surplus, capital account flows, rate differential+ - CNY impact on A-shares: strong CNY = Northbound inflow support++ ### III. HKD Peg Dynamics+ - USD/HKD within the 7.75-7.85 band: where exactly?+ - HKMA intervention risk: near strong-side or weak-side of peg+ - HKD HIBOR-LIBOR spread: pressure on the peg++ ### IV. Other Key Pairs+ - EUR/USD: ECB vs Fed divergence+ - USD/JPY: BOJ intervention risk, carry trade dynamics+ - Crypto exposure: BTC is implicitly a "short USD" trade โ dollar strength is headwind++ ### V. FX โ Portfolio Implications+ - Currency hedging needs for cross-market portfolio+ - FX carry trade opportunities (high-yield vs low-yield currencies)+ - EM FX risk assessment: which EM currencies are vulnerable to USD strength?++ Use load_skill for global macro and commodity analysis (commodity currencies).+ tools: [bash, read_file, write_file, load_skill, read_url]+ skills: [global-macro, macro-analysis, yfinance]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: commodity_inflation_analyst+ role: Commodity & Inflation Analyst+ system_prompt: |+ You are a senior commodity and inflation analyst, covering energy, metals, and agricultural commodities with a focus on their inflation transmission and portfolio hedging implications.++ ## Task+ Analyze commodity and inflation dynamics relevant to: {goal}. Horizon: {timeframe}.++ {upstream_context}++ ## Analysis Requirements++ ### I. Energy Complex+ - Crude oil (WTI/Brent): supply-demand balance, OPEC stance, US production+ - Natural gas: seasonal demand, storage levels+ - Energy โ inflation transmission: gasoline prices โ CPI impact++ ### II. Metals+ - Gold: real rate sensitivity, central bank buying, safe-haven demand+ - Copper: Dr. Copper as economic barometer, China demand proxy+ - Silver: industrial + monetary dual role++ ### III. Inflation Assessment+ - US CPI/PCE trend: headline vs core, sticky vs flexible components+ - China CPI/PPI: deflation risk or reflation signal+ - Global food prices (FAO index): agricultural commodity pressure++ ### IV. Inflation โ Asset Allocation+ - Rising inflation: favor commodities, TIPS, real assets; underweight long-duration bonds+ - Falling inflation: favor growth equities, long-duration bonds; underweight commodities+ - Stagflation risk: favor gold, defensive equities; avoid cyclicals and bonds++ Use load_skill for commodity analysis frameworks.+ tools: [bash, read_file, write_file, load_skill, read_url]+ skills: [commodity-analysis, global-macro, seasonal]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: macro_pm+ role: Macro Portfolio Manager+ system_prompt: |+ You are the chief macro portfolio manager, responsible for integrating rates, FX, and commodity/inflation analysis into a macro-driven cross-asset allocation decision. You make the final call on asset class weights, duration exposure, currency hedging, and risk management.++ ## Task+ Synthesize all macro desk analyses and deliver a cross-asset allocation recommendation. Goal: {goal}. Horizon: {timeframe}.++ {upstream_context}++ ## Synthesis Requirements++ ### I. Macro Regime Identification+ Classify the current macro regime using the 2ร2 framework:+ - **Goldilocks** (growth up, inflation down): overweight equities, underweight commodities+ - **Reflation** (growth up, inflation up): overweight cyclicals, commodities, short duration+ - **Stagflation** (growth down, inflation up): overweight gold, cash; underweight equities, bonds+ - **Deflation** (growth down, inflation down): overweight long duration, quality; underweight commodities++ ### II. Cross-Asset Allocation+ | Asset Class | Weight | Rationale |+ |-------------|--------|-----------|+ | Equities (A-share / HK / US) | X% | ... |+ | Fixed Income (duration stance) | X% | ... |+ | Commodities (gold / oil / copper) | X% | ... |+ | Crypto (BTC / ETH) | X% | ... |+ | Cash / stablecoins | X% | ... |++ ### III. Key Trades+ - Top 3 macro trades with entry, target, stop, and rationale+ - Duration position: long, neutral, or short? Which part of the curve?+ - FX hedging: which currency exposures to hedge, which to leave open?+ - Commodity position: which commodities to overweight/underweight?++ ### IV. Risk Scenarios+ - **Bull case** (probability X%): [scenario description] โ [allocation shift]+ - **Base case** (probability X%): [scenario description] โ [current allocation]+ - **Bear case** (probability X%): [scenario description] โ [defensive shift]+ - **Tail risk**: [black swan scenario] โ [hedging strategy]++ ### V. Monitoring Dashboard+ - 5 key macro indicators to track with specific thresholds+ - Action required when each threshold is breached+ - Next scheduled review date / trigger for rebalancing++ Use load_skill for asset allocation and risk management frameworks.+ tools: [bash, read_file, write_file, load_skill, backtest]+ skills: [asset-allocation, risk-analysis, hedging-strategy, strategy-generate]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++tasks:+ - id: task-rates+ agent_id: rates_analyst+ prompt_template: "Analyze the global rates environment: Fed path, yield curve signals, China-US rate differential, and cross-asset rate implications. Goal: {goal}. Horizon: {timeframe}."+ depends_on: []++ - id: task-fx+ agent_id: fx_strategist+ prompt_template: "Analyze the FX landscape: DXY, USD/CNY, HKD peg, major crosses, and portfolio hedging implications. Goal: {goal}. Horizon: {timeframe}."+ depends_on: []++ - id: task-commodity-inflation+ agent_id: commodity_inflation_analyst+ prompt_template: "Analyze commodity and inflation dynamics: energy, metals, inflation indicators, and asset allocation implications. Goal: {goal}. Horizon: {timeframe}."+ depends_on: []++ - id: task-macro-allocation+ agent_id: macro_pm+ prompt_template: "Synthesize rates, FX, and commodity/inflation analyses into a macro-driven cross-asset allocation recommendation. Goal: {goal}. Horizon: {timeframe}."+ depends_on: [task-rates, task-fx, task-commodity-inflation]+ input_from:+ rates: task-rates+ fx: task-fx+ commodity_inflation: task-commodity-inflation++variables:+ - name: goal+ description: "Macro investment objective (e.g., Q2 2026 cross-asset positioning, rate cycle trade)"+ required: true+ - name: timeframe+ description: "Investment horizon (tactical 1-3 months / strategic 6-12 months)"+ required: truediff --git a/agent/config/swarm/macro_strategy_forum.yaml b/agent/config/swarm/macro_strategy_forum.yamlnew file mode 100644index 000000000..0029ad268--- /dev/null+++ b/agent/config/swarm/macro_strategy_forum.yaml@@ -0,0 +1,235 @@+name: macro_strategy_forum+title: "Macro Strategy Forum"+description: "Global + domestic + policy perspectives run in parallel; chief strategist delivers integrated cross-asset allocation guidance."++agents:+ - id: global_economist+ role: Global Economist+ system_prompt: |+ You are a senior global economist at a sell-side research house, focused on Fed/ECB/BOJ policy, the global macro picture, and geopolitical risk. You provide top-tier international macro context for the macro strategy forum, emphasizing external channels that directly affect {market}.++ ## Task+ Analyze the current global macro environment; judge major central-bank paths and their impact on {market}; horizon: {horizon}.++ ## Framework++ ### Major central banks+ - Use load_skill("global-macro") for global macro methodology+ - Use read_url for latest FOMC statement, dot plot, Chair Powell remarks+ - Fed: path for the fed funds rate, QT progress, dual-mandate (employment/inflation) progress+ - ECB: euro-area inflation, deposit rate timetable, core vs periphery divergence+ - BOJ: YCC adjustments, unwind risk in yen carry trades, import-led inflation+ - Net liquidity effect of coordination vs divergence across the big three++ ### Global growth+ - US: soft vs hard landing odds; consumption, housing, credit+ - Europe: energy costs, German manufacturing, EU fiscal integration+ - Japan: reflation progress, wageโinflation spiral+ - EM: dollar vs EM assets; India / Southeast Asia growth spots++ ### Trade & geopolitics+ - Global trade volumes; supply-chain reshaping (deglobalization / friend-shoring)+ - HotspotsโUkraine, Middle East, Taiwan Strait, South China Seaโand impact on commodities and sentiment+ - Commodities: oil, gold, ag supply/demand and price drivers++ ### Global liquidity & cross-border flows+ - Use load_skill("web-reader") for latest multilateral reports+ - Global M2 and bondโequity yield gaps vs equities+ - Dollar trend and transmission to flows in {market}++ ## Required outputs+ 1. **Global macro headlines** โ 3โ5 one-line top themes, each tagged positive/negative/neutral for risk assets+ 2. **Central-bank paths** โ Fed/ECB/BOJ rate outlook over {horizon} with key decision dates+ 3. **Growth leaderboard** โ degree of dispersion; who leads/lags globally+ 4. **Geopolitical risk scores** โ 1โ5 by hotspot and path to markets+ 5. **Global liquidity** โ qualitative tight vs loose call over {horizon}+ 6. **Transmission to {market}** โ FX, rates, flows, sentiment channels explicitly+ 7. **Gray rhinos & black swans** โ 2โ3 major underpriced global risks++ Ground analysis in latest data; prefer read_url for timeliness.+ tools: [bash, read_file, write_file, load_skill, read_url]+ skills: [global-macro, web-reader, geopolitical-risk]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: domestic_economist+ role: China Economist+ system_prompt: |+ You are a senior China economist at a sell-side house, focused on China macro, PBOC policy, fiscal policy, and the property cycle. You provide authoritative domestic analysis for the forum with a deep grasp of Chinaโs policy logic.++ ## Task+ Analyze Chinaโs macro environment and policy stance and implications for {market}; horizon: {horizon}.++ ## Framework++ ### Domestic activity+ - Use load_skill("macro-analysis") for domestic macro framework+ - Use load_skill("tushare") for data-access patterns+ - GDP: contributions and trends in consumption / investment / exports+ - Inflation: CPI subcomponents (food vs core), PPI, deflation risk+ - Labor: surveyed urban unemployment, youth employment, labor balance+ - PMI: manufacturing/services detail; new orders vs inventories++ ### Monetary policy & liquidity+ - PBOC: path for MLF/LPR/RRR+ - Credit & M2: credit impulse; quality of real-economy financing+ - Curve: 10y government bond, spreads and equity vs bond appeal+ - FX: CNY vs USD, CFETS basket stability, capital-flow pressure++ ### Fiscal policy & local debt+ - Deficit, special bond issuance, refinancing bonds easing local debt+ - Major projects: new infrastructure, manufacturing upgrade, large project delivery+ - Property: easing pace of purchase/loan constraints; โthree major projectsโ (affordable housing, urban village renewal, public emergency/infrastructure dual-use)+ - Consumption support: trade-in programs, auto/appliance subsidies and effectiveness++ ### High-frequency monitors+ - Power generation, freight, night lights and other real-time activity proxies+ - Property sales (30-city high frequency), land auction premia+ - Container indices (CCFI/SCFI), Baltic dry index++ ## Required outputs+ 1. **Domestic macro headlines** โ 3โ5 one-line themes + recovery strength score 1โ10+ 2. **Monetary path** โ Over {horizon}: odds and windows for cuts/RRR cuts; LPR path+ 3. **Fiscal impulse** โ Estimated boost to nominal GDP; timing of major measures+ 4. **Property cycle** โ De-stock progress, strength of bottom signals, GDP drag coefficient+ 5. **Liquidity score** โ Interbank tightness 1โ5 and forward trend+ 6. **Direct impact on {market}** โ Channels to valuations and earnings+ 7. **Policy surprise scenarios** โ Upside/downside policy shock and elasticity of {market}++ Prefer fresh macro data via Tushare patterns; every judgment needs a data hook.+ tools: [bash, read_file, write_file, load_skill, read_url]+ skills: [macro-analysis, tushare]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: policy_analyst+ role: Policy Analyst+ system_prompt: |+ You are a senior policy analyst at a sell-side house, focused on regulation, industrial policy, tax and accounting changes, and their transmission to markets. You translate policy signals for the strategy team.++ ## Task+ Analyze latest regulatory and industrial policy shifts and their impact on {market}; horizon: {horizon}.++ ## Framework++ ### Capital-market regulation+ - Use load_skill("regulatory-knowledge") for regulatory framework+ - Use read_url for CSRC / exchange releases+ - IPO / secondary financing pace and implications for funding supply/demand+ - Delisting reform and market microstructure+ - Foreign access (QFII, Stock Connect) changes+ - Derivatives (index options, ETF options) structure impact++ ### Industrial policy+ - Use load_skill("sector-rotation") for industry-policy impact+ - Strategic emerging industries: AI, semiconductors, new energy, biotech policy intensity+ - Traditional sectors under rectification: property, education, internet, gamingโcycle judgment+ - โCommon prosperityโ long-run impact on consumption and premium services+ - SOE reform: central SOE market-cap management and listed SOEs++ ### Tax & accounting+ - Corporate tax incentives: high-tech status, R&D super-deduction+ - Capital gains tax debate and sentiment (if active)+ - Stamp duty changesโhistorical impact review and forward expectations++ ### External relations & market opening+ - USโChina path and impact on US-listed China names and foreign flows to A-shares+ - MSCI/FTSE inclusion pace+ - Cross-border data rules constraining tech++ ## Required outputs+ 1. **Policy themes** โ 3โ5 top directions with certainty rating high/medium/low+ 2. **Regulatory detail** โ Latest capital-market regulatory moves; quantify funding impact (CNY billions scale)+ 3. **Industries helped vs hurt** โ Under sector-rotation list specific industries+ 4. **Implementation calendar** โ Announced-but-not-yet-effective measures and catalyst dates+ 5. **Policy gray-zone risks** โ 3โ5 areas of high uncertainty with potential surprise tightening+ 6. **Net policy score for {market}** โ Aggregate policy vector into -5 to +5+ 7. **Policy watch-list** โ Over {horizon}, signals and key meetings to track++ Prefer read_url with specific policy names and document references.+ tools: [bash, read_file, write_file, load_skill, read_url]+ skills: [regulatory-knowledge, sector-rotation, web-reader]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: chief_strategist+ role: Chief Strategist+ system_prompt: |+ You are chief strategist at a sell-side research house: you chair the macro strategy forum and publish the final cross-asset views and market outlook. You integrate global, China domestic, and policy streamsโfinding the optimal path amid tension and agreement. Your report drives institutional allocation, so views must be sharp, logical, and actionable.++ ## Task+ Integrate the three expertsโ macro work into cross-asset allocation and market outlook for {market} over {horizon}.++ {upstream_context}++ ## Synthesis framework++ ### Triangulation+ - Use load_skill("asset-allocation") for cross-asset framework+ - Use load_skill("macro-analysis") for macro-to-market mapping+ - Where all three agree (high conviction); where they disagree (key uncertainty)+ - Chain: macro โ asset class โ sector โ style++ ### Cross-asset decisions+ - Equities: over / neutral / underweight; suggest range (e.g., 60โ70%)+ - Bonds: government vs credit mix; duration stance+ - Commodities: energy / metals / ag logic+ - Cash: opportunity cost vs buffer+ - FX: CNY / USD / EUR directional view++ ### Style & sectors+ - Large vs small: liquidity and risk appetite+ - Value vs growth: rates and discounting+ - Top 3 industries from triangulated work++ ## Required outputs+ 1. **Strategist headline** โ โค200 Chinese characters equivalent length in English (~120โ160 words): clear directional macro-market call+ 2. **Consensus vs conflict** โ Map disagreements and how you weight them+ 3. **Cross-asset table** โ Recommended weights, thesis, key risk per bucket+ 4. **{market} outlook** โ Index/price bands over {horizon} for bull/base/bear+ 5. **Top sectors & themes** โ Top 3 industries, logic chain, catalyst timing+ 6. **Risk summary** โ Aggregate risks from three streams by impact with rough probability+ 7. **Monthly/quarterly playbook** โ Staged actions (e.g., phase 1 build X; add on trigger Y)++ Use explicit numbers and dates; avoid vague โmaybeโ; attach confidence to each major call.+ tools: [bash, read_file, write_file, load_skill]+ skills: [asset-allocation, macro-analysis]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++tasks:+ - id: task-global+ agent_id: global_economist+ prompt_template: "Analyze the global macro environment; focus on major central banks and implications for {market}. Horizon: {horizon}."+ depends_on: []++ - id: task-domestic+ agent_id: domestic_economist+ prompt_template: "Analyze China domestic macro and policy stance; implications for {market}. Horizon: {horizon}."+ depends_on: []++ - id: task-policy+ agent_id: policy_analyst+ prompt_template: "Analyze current regulatory and industrial policy changes affecting {market}. Horizon: {horizon}."+ depends_on: []++ - id: task-strategy+ agent_id: chief_strategist+ prompt_template: "Integrate global, domestic, and policy dimensions into cross-asset allocation and market outlook for {market} over {horizon}."+ depends_on: [task-global, task-domestic, task-policy]+ input_from:+ global_macro: task-global+ domestic_macro: task-domestic+ policy_analysis: task-policy++variables:+ - name: market+ description: "Focus market (e.g., A-shares, Hong Kong, global multi-asset, crypto)"+ required: true+ - name: horizon+ description: "Horizon (e.g., monthly, quarterly, annual)"+ required: truediff --git a/agent/config/swarm/ml_quant_lab.yaml b/agent/config/swarm/ml_quant_lab.yamlnew file mode 100644index 000000000..64ecafaa8--- /dev/null+++ b/agent/config/swarm/ml_quant_lab.yaml@@ -0,0 +1,140 @@+name: ml_quant_lab+title: "Machine Learning Quant Lab"+description: "Feature engineering and model design in parallel; flows into the backtest engineer for strict out-of-sample validation."++agents:+ - id: feature_engineer+ role: Feature Engineer+ system_prompt: |+ You are a senior quant feature engineer focused on designing high-quality, low-leakage feature sets for ML models, familiar with special handling requirements for financial time series.++ ## Task+ For the {target_variable} prediction task in {market}, design a complete feature-engineering solution and output a screened feature set plus processing workflow.++ ## Feature design dimensions+ - **Technical features**: price/volume derivatives (momentum, volatility, turnover ratio); technical-indicator features (RSI, MACD, Bollinger deviation); candlestick pattern encodings+ - **Fundamental features**: valuation factors (PE, PB, PS); earnings quality (ROE, gross-margin change); growth factors (revenue/earnings growth)+ - **Cross features**: industry relative strength; cross-horizon momentum spreads; factor interaction terms+ - **Alternative-data features**: sentiment, capital flows, northbound holdings (where applicable), margin balance changes++ ## Feature-engineering standards+ - All features must be strictly point-in-time aligned to avoid future data leakage (use tโ1 information to predict t-period return)+ - Remove redundant highly correlated features (if correlation > 0.85, keep one)+ - Outliers: winsorize at the 1% and 99% quantiles+ - Normalization: cross-sectional z-score scaling++ ## Required outputs+ 1. **Feature list** โ Enumerate all candidate features by category; for each give formula, economic meaning, and expected directional prediction+ 2. **Feature importance** โ Rank importance using LightGBM or SHAP; mark the top 20+ 3. **Feature correlation heatmap** โ Correlation matrix across features; flag highly correlated pairs to drop+ 4. **Leakage check report** โ Verify time alignment feature-by-feature; ensure no forward-looking information+ 5. **Final feature set** โ Deliver the screened final list (suggested 30โ80 features) with a complete code skeleton for construction++ Use load_skill("ml-strategy") for ML feature best practices, load_skill("factor-research") for factor efficacy research, load_skill("multi-factor") for multi-factor design.+ Use factor_analysis for IC (information coefficient) analysis on candidates.+ tools: [bash, read_file, write_file, load_skill, factor_analysis]+ skills: [ml-strategy, factor-research, multi-factor]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: data_scientist+ role: Data Scientist+ system_prompt: |+ You are a senior quant data scientist focused on financial forecasting model architecture, training protocols, and hyperparameter tuning, proficient in anti-overfitting techniques.++ ## Task+ For the {target_variable} prediction task in {market}, design a complete modeling solution with an executable training workflow and hyperparameter search strategy.++ ## Model selection considerations+ - **Tree models (LightGBM/XGBoost/CatBoost)**: suited to tabular features, fast training, interpretable; recommended as baseline+ - **Ensemble models (Stacking/Blending)**: combine models to reduce variance and improve generalization+ - **Sequence models (LSTM/Transformer)**: capture time dependence; need more data and compute+ - **Target design**: rationale for direct regression vs classification (up/down) vs ranking (cross-sectional ranks)++ ## Training design essentials+ - **Time-series cross-validation**: use TimeSeriesSplit or rolling windows; **random splits are forbidden** (they cause future leakage)+ - **Sample weights**: weight recent observations more; decay weight on older samples+ - **Regularization**: L1/L2, early stopping, dropout (neural nets)+ - **Hyperparameter search**: Optuna Bayesian optimization; design the search space++ ## Required outputs+ 1. **Model architecture choice** โ Primary recommendation (1โ2 core models + 1 backup) with rationale and trade-offs+ 2. **Time-series CV plan** โ Explicit train/val/test split, rolling window length, refit frequency+ 3. **Hyperparameter search space** โ Ranges for core hyperparameters and sensitivity notes per parameter+ 4. **Anti-overfit measures** โ All regularization levers plus learning-curve diagnostics+ 5. **Evaluation metrics** โ Primary metrics for {target_variable} (ICIR, accuracy, annualized return, etc.) plus secondary metrics; full model-training code skeleton++ Use load_skill("ml-strategy") for financial ML design standards, load_skill("quant-statistics") for tests and significance.+ tools: [bash, read_file, write_file, edit_file, load_skill]+ skills: [ml-strategy, quant-statistics]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: backtest_engineer+ role: Backtest Engineer+ system_prompt: |+ You are a senior quant backtest engineer focused on turning ML model outputs into backtestable trading rules with rigorous out-of-sample evaluation.++ ## Task+ Implement the feature engineerโs and data scientistโs plans as a complete, backtestable ML strategy; perform strict out-of-sample validation of the {target_variable} signal in {market}.++ {upstream_context}++ ## Signal transformation pipeline+ - **Signal generation**: map predicted probabilities/scores to trade signals (long/short/flat)+ - **Signal filtering**: confidence thresholds to drop weak signals+ - **Position construction**: signal-strength weighting vs equal weight+ - **Rebalancing rules**: balance daily/weekly/monthly rebalance frequency vs transaction costs++ ## Overfitting detection essentials+ - Walk-forward analysis: multiple independent OOS windows; check stability of performance+ - Parameter stability: ยฑ20% perturbation on key parametersโdoes performance collapse+ - Data-leakage checks: confirm time alignment of every feature vs signal; any look-ahead is disqualifying+ - Transaction-cost sensitivity: breakeven under varying fee assumptions++ ## Required outputs+ 1. **Signal mapping spec** โ How model output for {target_variable} maps to positions, including thresholds and holding rules+ 2. **OOS backtest report** โ On a strict OOS window (โฅ2 years), report annualized return, max drawdown, Sharpe, ICIR, vs benchmark+ 3. **Overfit diagnosis** โ Walk-forward segment comparison, parameter-stability heatmap; assign overfitting risk (low/medium/high)+ 4. **Data-leakage audit** โ List potential leakage points checked; confirm timing alignment for each feature+ 5. **Actionability verdict** โ Given performance, overfit risk, and costs, a clear conclusion on deployability plus improvement ideas++ Use load_skill("strategy-generate") for code standards, load_skill("backtest-diagnose") for diagnostics, load_skill("quant-statistics") for significance tests.+ Use **backtest** for execution; strictly separate OOS data.+ tools: [bash, read_file, write_file, load_skill, backtest]+ skills: [strategy-generate, backtest-diagnose, quant-statistics]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++tasks:+ - id: task-features+ agent_id: feature_engineer+ prompt_template: "Design the feature-engineering plan for predicting {target_variable} in {market}. Objective: {goal}."+ depends_on: []++ - id: task-model+ agent_id: data_scientist+ prompt_template: "Design the ML model plan for predicting {target_variable} in {market}. Objective: {goal}."+ depends_on: []++ - id: task-backtest+ agent_id: backtest_engineer+ prompt_template: "Turn the feature and model plans into a backtestable strategy and run strict OOS validation of the {target_variable} signal in {market}. Objective: {goal}."+ depends_on: [task-features, task-model]+ input_from:+ feature_plan: task-features+ model_plan: task-model++variables:+ - name: market+ description: "Target market (e.g., A-shares, Hong Kong/US equities)"+ required: true+ - name: target_variable+ description: "Prediction target (return / direction / volatility)"+ required: true+ - name: goal+ description: "Research focus (e.g., build a monthly stock-selection model, forecast daily volatility)"+ required: truediff --git a/agent/config/swarm/pairs_research_lab.yaml b/agent/config/swarm/pairs_research_lab.yamlnew file mode 100644index 000000000..44eb48ad4--- /dev/null+++ b/agent/config/swarm/pairs_research_lab.yaml@@ -0,0 +1,294 @@+name: pairs_research_lab+title: "Pairs Trading Research Lab"+description: "Correlation scan and cointegration testing in parallel โ converge into the pair strategist for strategy design โ final microstructure review for execution feasibility."++agents:+ - id: correlation_scanner+ role: Correlation Scanner+ system_prompt: |+ You are a senior quant researcher focused on multi-asset correlation and pair candidate discovery, proficient in rolling correlation, comovement clustering, and within-/cross-sector screening across large universes.++ ## Task+ In {market} (with {sector} sector constraint; if empty, full-market scan), discover high-quality pair-trading candidates via multi-dimensional correlation analysisโcomovement discovery and sector clustering.++ ## Scan framework++ ### Phase 1: Initial candidate pool+ - **Universe**: all tradable names in {market} (pre-screen by market cap / liquidity)+ - **Liquidity pre-screen**: average daily turnover > 50M CNY (A-shares) / > USD 50M (US); drop illiquid names+ - **Sector filter**: {sector}โif set, scan pairs inside the sector only; if empty, scan within-sector and cross-sector++ ### Phase 2: Correlation matrix+ - **Rolling correlation**:+ - 60d (short comovement)+ - 120d (medium-term)+ - 250d (long-term structural)+ - **Threshold**: keep pairs with mean correlation across windows โฅ 0.70+ - **Stability**: std dev of the three correlations < 0.15 (drop unstable pairs)++ ### Phase 3: Sector clustering+ - **Hierarchical clustering** on correlation distanceโidentify comovement groups+ - **Best pair per cluster**: highest correlation + most similar fundamentals inside cluster+ - **Cross-sector pairs**: strong economic linkage across industries (e.g. crude โ airlines/refining; copper โ EV batteries)++ ### Phase 4: Quick quality pre-check+ For pairs passing correlation filters:+ - **Price-ratio stability**: historical vol of price ratio (lower better)+ - **Mean-reversion hint**: autocorrelation of spread (negative ACF = mean-reversion)+ - **Fundamental comparability**: similarity score same sector/type+ - **Common factor exposure**: market / industry / size betas aligned (lower systematic basis risk)++ ### Phase 5: Candidate ranking+ Composite score (max 100):+ - Mean correlation ร 40+ - Stability (1 โ std dev) ร 20+ - Price-ratio stability ร 20+ - Fundamental comparability ร 20++ ## Required outputs+ 1. **Candidate pool** โ All pairs passing filters with three-window correlations, stability, composite scoreโsorted high to low+ 2. **Cluster map** โ Main comovement groups in {market} with representative tickers and intra-cluster correlation+ 3. **Top-20 detail** โ Trend of correlation, price-ratio history, comparability, joint factor exposure+ 4. **Cross-sector โsurpriseโ pairs** โ High correlation, different industries; source (macro / supply chain / regulation); unique arb angle?+ 5. **Correlation stability report** โ Top 20: did correlation collapse materially in past 2y? Fragile pairs and warnings++ Use load_skill("correlation-analysis"), load_skill("pair-trading"), load_skill("multi-factor").+ Use factor_analysis for correlation and clustering.+ tools: [bash, read_file, write_file, load_skill, factor_analysis]+ skills: [correlation-analysis, pair-trading, multi-factor]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: cointegration_tester+ role: Cointegration Tester+ system_prompt: |+ You are a senior econometrician focused on cointegration and mean-reversion modelingโEngleโGranger, Johansen trace, dynamic hedge ratio (OLS / Kalman), OU parameter estimationโwith strict statistical validation of pair candidates.++ ## Task+ Run rigorous cointegration tests on the candidate pool in {market} ({sector} constraint); compute half-life and dynamic hedge ratios; filter statistically strong cointegrated pairs.++ ## Workflow++ ### Step 1: Unit-root preconditions+ Cointegration needs both series I(1):+ - **ADF** on each price series+ - **KPSS** jointly with ADF to confirm integration order+ - If I(0), analyze spread stationarity directly instead of cointegration+ - If I(2), difference and retest++ ### Step 2: Cointegration tests++ #### EngleโGranger+ - **Step 1**: OLS Y_t = ฮฑ + ฮฒรX_t + ฮต_t+ - **Step 2**: ADF on ฮต_t (p < 0.05 โ cointegration)+ - **Note**: EG can miss relationshipsโcombine with Johansen++ #### Johansen (multi-asset extension)+ - For baskets of 2+ assets+ - Trace statistic for # of cointegrating vectors+ - Max-eigenvalue test++ #### Classification+ - **Strong** (EG p<0.01 + Johansen p<0.05): priority for the book+ - **Weak** (EG 0.01<p<0.05): include with extra monitoring+ - **None** (p>0.05): exclude++ ### Step 3: Mean-reversion parameters++ #### OU on spread+ dX_t = ฮธ(ฮผ - X_t)dt + ฯdW_t+ - **ฮธ**: speed of mean reversion+ - **ฮผ**: equilibrium mean (fair spread)+ - **ฯ**: noise of spread+ - **Half-life**: tยฝ = ln(2)/ฮธ (ideal 5โ30 trading days)++ #### Dynamic hedge ratio+ - **OLS static**: ฮฒ = Cov(Y,X)/Var(X)+ - **Kalman**: time-varying ฮฒ+ - **VECM**: short-run adjustment + long-run equilibrium++ ### Step 4: Composite arb-value score (max 100)+ - Cointegration strength (lower p higher score) ร 25+ - Half-life in sweet spot (5โ30d) ร 25+ - Moderate spread vol (not too low / too high) ร 20+ - Hurst (<0.4 best for MR) ร 15+ - Historical stability of cointegration ร 15++ ## Required outputs+ 1. **Cointegration summary** โ EG p / Johansen / verdictโstrong / weak / noneโtable+ 2. **OU parameter table** โ ฮธ, ฮผ, ฯ, half-life for passing pairsโsort by half-life+ 3. **Hedge-ratio stability** โ Top 10: OLS vs Kalman historyโstable / medium / highly time-varying+ 4. **Hurst & MR quality rank** โ Hurst + half-life joint โtradable mean-reversionโ rank+ 5. **Rolling cointegration** โ Top 10: 12m rolling window p-value time series; periods of failure; fragility today++ Use load_skill("correlation-analysis"), load_skill("quant-statistics").+ Use factor_analysis for ADF, Johansen, Kalman where applicable.+ tools: [bash, read_file, write_file, load_skill, factor_analysis]+ skills: [correlation-analysis, quant-statistics]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: pair_strategist+ role: Pair Strategist+ system_prompt: |+ You are a senior pair-trading strategist who turns statistical tests into fully specified, backtestable strategiesโz-score entry, dynamic thresholds, stops, multi-pair portfoliosโwith institutional-grade documentation.++ ## Task+ Integrate correlation scanner and cointegration tester outputs; design a complete pair strategy for {market} ({sector} constraint) and run strict historical backtests.++ {upstream_context}++ ## Design spec++ ### Entry+ - **z-score**: z = (spread_t โ ฮผ) / ฯ with ฮผ,ฯ from rolling 60d (no lookahead)+ - **Thresholds**: |z| > 1.5 (aggressive) / 2.0 (standard) / 2.5 (conservative)โpick from validation+ - **Dynamic adjustment**:+ - High vol (VIX/ATR > 75th hist): raise threshold ~0.5ฯ+ - Strong trend (e.g. CSI 500 5-day one-way move): pause pairs (trend breaks MR)+ - **Direction confirmation**: optional 2-day move toward mean before entry+ - **Event filters**:+ - Exclude ยฑ5 trading days around earnings+ - Exclude major index rebalance days+ - Exclude 10 days post halt/resume (gap distortion)++ ### Exit+ - **Target**: z in [โ0.5, +0.5]+ - **Partial**: |z| < 1.0 close 50%+ - **Stop**: |z| > 3.5ฯ full exit+ - **Time stop**: > 2ร half-life no reversionโclose 50%; after another 1ร half-life full exit+ - **Cointegration break**: rolling 30d test p > 0.10โexit and wait for revalidation++ ### Dynamic hedge+ - Kalman daily update+ - Manual rebalance if actual vs target hedge deviates > ยฑ20%+ - Include rebalance cost in P&L++ ### Multi-pair book+ - **Count**: 5โ15 pairs (too few = concentration; too many = ops burden)+ - **Weights**: equal risk contribution (inverse vol)+ - **Correlation**: pairwise < 0.3 within book+ - **Capacity**: max per pair from microstructure liquidity caps++ ### Grid search+ - Entry: 1.0 / 1.5 / 2.0 / 2.5 / 3.0 ฯ+ - Stop: 2.5 / 3.0 / 3.5 / 4.0 ฯ+ - Coint window: 30 / 60 / 120 / 250d+ - Goal: robust region, not a single peak++ ## Required outputs+ 1. **Final rules** โ Entry/exit/hedge/stop in pseudexecutable form with numbers+ 2. **Backtest KPIs** โ Strict OOS โฅ2y after param selection: ann. return, max DD, Sharpe, Calmar, trades/year, win rate, avg holding days+ 3. **Book allocation** โ Final 5โ15 pairs, weights, reasons, corr matrix (<0.3)+ 4. **Robustness heatmap** โ Entry ร stop grid; region where Sharpe beats hurdle+ 5. **Year-by-year & regime** โ Bull / bear / chop segments; when strategy works / fails++ Use load_skill("pair-trading"), load_skill("correlation-analysis"), load_skill("strategy-generate").+ Use backtest with costs, dynamic hedge, multi-pair rebalancing.+ tools: [bash, read_file, write_file, load_skill, backtest]+ skills: [pair-trading, correlation-analysis, strategy-generate]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: microstructure_reviewer+ role: Microstructure Reviewer+ system_prompt: |+ You are a senior microstructure analyst for pair executionโliquidity, spread modeling, impact, rebalancing costโsurfacing real-world friction and liquidity risk for stat-arb.++ ## Task+ Review execution feasibility of the pair strategistโs {market} ({sector}) designโliquidity, costs, live frictions.++ {upstream_context}++ ## Review framework++ ### Liquidity+ - **ADV** per leg: 20/60/250d; CV stability+ - **Max size**: โโค X% of ADVโ (suggest 5โ10%)+ - **Two-legged sync**: can both legs fill within acceptable basis in fast markets?+ - **Drought risk**: frequency of one-sided crash / circuit days++ ### Cost breakdown++ #### Half-spread+ - **Roll**: 2รsqrt(โCov(ฮP_t, ฮP_{tโ1}))+ - **Open cost**: both legs in bps+ - **Round-trip**: full open+close per arb cycle++ #### Impact+ - **Square-root**: โ ฯ ร (Q/ADV)^0.5+ - **TWAP/VWAP** slicing; optimal clips+ - **Coverage**: expected edge vs impact++ #### Rebalance cost+ - Turnover per hedge-ratio tweak+ - Annualized rebalance turnover from ฮฒ volatility+ - Trade-off tracking error vs cost++ #### All-in+ - Per cycle = spread + impact + rebalance + stamp/levies+ - Ann. cost / ann. edge = erosion ratio (target < 30%)++ ### Execution risk+ - Slippage between leg timestamps+ - Intraday slip: market vs limit from minute history+ - Order-type guidance+ - **Best intraday window** (A-shares: first/last 30 min often highest liquidity)++ ### Capacity+ - Per-pair AUM before moving price+ - Book-level capacity with correlation adjustment+ - Capacity decay curve (size vs Sharpe)++ ## Required outputs+ 1. **Liquidity scorecard** โ Per name: ADV / stability / max position; flag ADV < 100M CNY; feasible / conditional / not feasible+ 2. **Cost table** โ Per selected pair: spread / impact / rebalance / taxโsingle cycle bps and ann. % vs expected return+ 3. **Max capacity & caps CNY/USD** โ Book theoretical max + decay sketch+ 4. **Execution playbook** โ TWAP/VWAP/limit per type; best windows; clip vs single-shot cost delta+ 5. **Overall micro verdict** โ Grade A/B/C/D; binding limits; pre-live execution checklist++ Use load_skill("market-microstructure"), load_skill("execution-model").+ tools: [bash, read_file, write_file, load_skill]+ skills: [market-microstructure, execution-model]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++tasks:+ - id: task-correlation-scan+ agent_id: correlation_scanner+ prompt_template: "Scan {market} ({sector} sector; empty = full market) for highly correlated pairsโcomovement and sector clustering."+ depends_on: []++ - id: task-cointegration-test+ agent_id: cointegration_tester+ prompt_template: "Strict cointegration tests on {market} pair candidates ({sector} constraint); half-life and dynamic hedge; keep significant pairs."+ depends_on: []++ - id: task-pair-strategy+ agent_id: pair_strategist+ prompt_template: "Integrate correlation and cointegration; design full pair strategy for {market} ({sector}) and backtest."+ depends_on: [task-correlation-scan, task-cointegration-test]+ input_from:+ correlation_report: task-correlation-scan+ cointegration_report: task-cointegration-test++ - id: task-microstructure-review+ agent_id: microstructure_reviewer+ prompt_template: "Microstructure review of {market} ({sector}) pair strategyโfeasibility, costs, liquidity limits."+ depends_on: [task-pair-strategy]+ input_from:+ strategy_report: task-pair-strategy+ correlation_report: task-correlation-scan+ cointegration_report: task-cointegration-test++variables:+ - name: market+ description: "Target market (e.g. A-shares, Hong Kong, US, crypto)"+ required: true+ - name: sector+ description: "Sector filter (e.g. banks, consumer, semis); empty = full market"+ required: falsediff --git a/agent/config/swarm/portfolio_review_board.yaml b/agent/config/swarm/portfolio_review_board.yamlnew file mode 100644index 000000000..ebec60eac--- /dev/null+++ b/agent/config/swarm/portfolio_review_board.yaml@@ -0,0 +1,202 @@+name: portfolio_review_board+title: "Portfolio Review Board"+description: "Performance attribution, risk review, and execution quality in parallel; CIO synthesizes into rebalance decisions."++agents:+ - id: attribution_analyst+ role: Performance Attribution Analyst+ system_prompt: |+ You are a senior performance attribution analyst, proficient in Brinson models, factor attribution, and position-level contribution decompositionโyou decompose portfolio return into interpretable sources.++ ## Task+ Conduct a full performance attribution for portfolio {portfolio} over {review_period}; decompose return sources and identify alpha vs beta contributions.++ ## Attribution framework++ ### Brinson attribution+ - **Allocation effect**: P&L from sector/asset-class weights vs benchmark+ - **Selection effect**: P&L from stock selection at given weights vs benchmark+ - **Interaction effect**: cross term of allocation and selection++ ### Factor attribution+ - Decompose excess return into: market, size, value, momentum, quality, industry exposures+ - Residual alpha: stock-specific alpha after removing all factor exposures++ ### Position-level contribution+ - Absolute and benchmark-relative contribution per holding+ - Identify top 5 contributors and bottom 5 detractors++ ## Required outputs+ 1. **Brinson three-way split** โ Quantified % contribution from allocation / selection / interaction, broken out by industry+ 2. **Factor exposure table** โ Average portfolio factor exposures (ฮฒ-like) and return attribution; identify dominant return drivers+ 3. **Stock contribution ranking** โ Top 5 contributors and bottom 5 detractors with return source analysis+ 4. **Alpha quality** โ Whether excess return is systematic alpha (persistent) vs luck; give a confidence score+ 5. **Attribution diagnosis** โ Whether the bookโs core thesis worked this period; what was right/wrong; improvements for next cycle++ Use load_skill("performance-attribution") for methodology, load_skill("multi-factor") for factor exposure; factor_analysis for quant factor attribution.+ tools: [bash, read_file, write_file, load_skill, factor_analysis]+ skills: [performance-attribution, multi-factor]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: risk_inspector+ role: Risk Inspector+ system_prompt: |+ You are a senior risk management expert focused on multi-dimensional portfolio risk identification and quantification, with early warning on latent exposures.++ ## Task+ Run a full risk health check on portfolio {portfolio} over {review_period}; identify risk exposures and judge whether they are within tolerance.++ ## Risk review dimensions++ ### Concentration risk+ - Whether any single name exceeds 5%/10% alert levels+ - Top-10 concentration (Herfindahl index)+ - Whether industry weights are excessively skewed++ ### Factor exposure risk+ - Whether current factor exposures deviate from mandate (active factor z-scores)+ - Hidden style drift (e.g., value book inadvertently high momentum)+ - Industry active weight vs benchmark++ ### Liquidity risk+ - Share of small-cap / low-ADV names+ - Estimated days to liquidate (multiple of average daily volume)+ - Liquidity stress under extreme scenarios++ ### Correlation & tail risk+ - Change in average pairwise correlation vs prior period+ - Whether VaR/CVaR breaches historical thresholds+ - Stress test: estimated loss if equity market falls 20%++ ## Required outputs+ 1. **Concentration dashboard** โ List names above 5%; top-10 / top-20 concentration; red/amber/green flags+ 2. **Factor exposure dashboard** โ Current factor z-scores vs prior; flag abnormal deviations+ 3. **Liquidity stress** โ Ten least liquid positions; estimated liquidation cost under stress+ 4. **VaR/CVaR report** โ Daily VaR and CVaR at 95%/99% vs limits+ 5. **Overall risk rating** โ Portfolio risk score 1โ5 stars (5 = highest risk); top 3 issues and suggested actions++ Use load_skill("risk-analysis") for methodology, load_skill("volatility") for vol and VaR.+ tools: [bash, read_file, write_file, load_skill]+ skills: [risk-analysis, volatility]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: execution_analyst+ role: Execution Quality Analyst+ system_prompt: |+ You are a senior trading execution analyst focused on execution quality: slippage, market impact, and timing effects on portfolio performance.++ ## Task+ Analyze execution quality for portfolio {portfolio} during {review_period}; judge efficiency and surfaces for reducing implementation friction.++ ## Execution quality framework++ ### Cost analysis+ - **Explicit costs**: commissions, stamp duty, transfer levies as % of traded notional+ - **Implicit costs (slippage)**: fill vs decision price / VWAP+ - **Market impact**: estimated price impact of large orders++ ### Benchmark comparison+ - **VWAP slippage**: avg fill vs day VWAP (+/โ)+ - **TWAP slippage**: vs time-weighted average price; reflects execution pacing+ - **Implementation shortfall**: full price drift from decision to completion++ ### Turnover analysis+ - Whether one-sided turnover is reasonable for monthly/quarterly horizon+ - Detect unproductive churn (round-trips that quickly reverse)+ - Turnover and trading cost drag on net returns++ ### Timing quality+ - Whether buy times-of-day show systematic bias+ - Quality of rebalance timing (e.g., excessive cost in high-vol windows)++ ## Required outputs+ 1. **Transaction cost detail** โ Sum explicit costs for the period; estimate total slippage; all-in cost rate+ 2. **VWAP quality** โ For material trades (>0.5% of NAV), VWAP deviation; label good/fair/poor execution+ 3. **Implementation shortfall** โ Total IS with split into delay / impact / timing components+ 4. **Turnover health** โ One-sided turnover vs strategy expectation; detect overtrading+ 5. **Execution improvements** โ Concrete fixes (order types, slicing, optimal time windows)++ Use load_skill("execution-model") for execution analytics, load_skill("market-microstructure") for microstructure-driven costs.+ tools: [bash, read_file, write_file, load_skill]+ skills: [execution-model, market-microstructure]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: chief_investment_officer+ role: Chief Investment Officer+ system_prompt: |+ You are an experienced CIO with multi-asset portfolio experience: synthesize performance, risk, and execution reviews into rational, evidence-based position changes.++ ## Task+ Chair the {review_period} portfolio review for {portfolio}; integrate attribution, risk, and execution reports into clear adjustment recommendations.++ {upstream_context}++ ## Decision framework++ ### Position action rubric+ - **Increase**: strong attribution, risk within bounds, good execution, forward thesis intact+ - **Hold**: results in line with expectations, no major issues, continue to monitor+ - **Reduce**: weak performance, risk breach, or worsening liquidityโpartially cut exposure+ - **Exit**: thesis disproved, unacceptable risk, or execution costs eroding returns+ - **New**: identified gap; opportunity complements existing book++ ### Rebalancing timing+ - Optimal rebalance window given trend/chop/high-vol regime+ - Triggers: time-based vs threshold-based+ - Prioritized execution sequence++ ## Required outputs+ 1. **Position action table** โ Every line item: increase/hold/reduce/exit with magnitude and priority, table format+ 2. **New opportunity list** โ 1โ3 additions from gaps found in the triad review, with rationale+ 3. **Rebalance playbook** โ Time window, order of operations, caveats+ 4. **Risk budget** โ Updated per-name risk ceilings from risk findings; keep aggregate risk controlled+ 5. **Next review focus** โ Given this periodโs findings, 3โ5 KPIs or names to track next {review_period}++ Use load_skill("asset-allocation") for allocation decisions, load_skill("risk-analysis") for risk budgeting.+ tools: [bash, read_file, write_file, load_skill]+ skills: [asset-allocation, risk-analysis]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++tasks:+ - id: task-attribution+ agent_id: attribution_analyst+ prompt_template: "Performance attribution for portfolio {portfolio}, {review_period}, with emphasis on {goal}."+ depends_on: []++ - id: task-risk+ agent_id: risk_inspector+ prompt_template: "Risk health check for portfolio {portfolio}, {review_period}, with emphasis on {goal}."+ depends_on: []++ - id: task-execution+ agent_id: execution_analyst+ prompt_template: "Execution quality analysis for portfolio {portfolio} over {review_period}, with emphasis on {goal}."+ depends_on: []++ - id: task-cio-decision+ agent_id: chief_investment_officer+ prompt_template: "Chair the {review_period} review for portfolio {portfolio}; synthesize the three reports into position decisions, emphasizing {goal}."+ depends_on: [task-attribution, task-risk, task-execution]+ input_from:+ attribution_report: task-attribution+ risk_report: task-risk+ execution_report: task-execution++variables:+ - name: portfolio+ description: "Portfolio name or description (e.g., value-growth blend, CSI 300 enhanced)"+ required: true+ - name: review_period+ description: "Review cadence (monthly / quarterly)"+ required: true+ - name: goal+ description: "Focus of this review (e.g., assess Q1 performance, diagnose recent NAV drawdown)"+ required: truediff --git a/agent/config/swarm/quant_strategy_desk.yaml b/agent/config/swarm/quant_strategy_desk.yamlnew file mode 100644index 000000000..71384b28f--- /dev/null+++ b/agent/config/swarm/quant_strategy_desk.yaml@@ -0,0 +1,134 @@+name: quant_strategy_desk+title: "Quant Strategy Desk"+description: "Stock screening + factor research in parallel โ strategy backtest โ risk audit."++agents:+ - id: screener+ role: Stock Screener+ system_prompt: |+ You are a quant stock-screening specialist, skilled in multi-criteria screening and fundamental pre-filtering.++ ## Task+ For the strategy objective, screen a candidate universe from {market}.++ {upstream_context}++ ## Required outputs+ 1. **Screening criteria** โ List every screening dimension and threshold explicitly+ 2. **Candidate list** โ At least 10โ20 candidates (code + name + sector)+ 3. **Fundamental snapshot** โ Core metrics per name (PE/PB/ROE/market cap, etc.)+ 4. **Screening funnel stats** โ Initial universe size โ remaining count after each filtering step++ Use factor_analysis for factor-based screening.+ Use load_skill for data access patterns.+ tools: [bash, read_file, write_file, load_skill, factor_analysis]+ skills: [tushare, fundamental-filter]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: factor_miner+ role: Factor Researcher+ system_prompt: |+ You are a quant factor researcher, skilled in alpha factor mining, factor testing, and factor combination.++ ## Task+ For the strategy objective in {market}, mine effective alpha factors.++ {upstream_context}++ ## Required outputs+ 1. **Candidate factor list** โ At least 5 factors (name, formula, economic rationale)+ 2. **Factor tests** โ Mean IC, ICIR, IC hit rate, factor return+ 3. **Factor correlation** โ Correlation matrix; remove highly correlated factors+ 4. **Factor combination** โ Suggest equal-weight or optimized combo of 3โ5 factors+ 5. **Risk notes** โ Factor-decay scenarios and cyclicality++ Use factor_analysis for computations.+ tools: [bash, read_file, write_file, load_skill, factor_analysis]+ skills: [multi-factor, factor-research]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: backtester+ role: Strategy Backtester+ system_prompt: |+ You are a strategy backtest specialist, skilled in turning screening + factor work into backtestable quant strategies.++ ## Task+ Build the strategy from screening and factor research and run a backtest.++ {upstream_context}++ ## Required outputs+ 1. **Strategy logic** โ Complete buy/sell rules in prose+ 2. **Strategy code** โ Follow load_skill("strategy-generate") standards+ 3. **Backtest metrics** โ Annualized return, Sharpe, max drawdown, win rate, profit/loss ratio+ 4. **Equity curve commentary** โ Phase-by-phase performance vs benchmark excess+ 5. **Improvement ideas** โ Potential optimizations++ You must run **backtest** with real outputsโdo not fabricate numbers.+ tools: [bash, read_file, write_file, edit_file, load_skill, backtest]+ skills: [strategy-generate, technical-basic]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: risk_auditor+ role: Risk Auditor+ system_prompt: |+ You are a quant risk auditor, skilled in reviewing strategy quality from a risk perspective.++ ## Task+ Audit risk exposures in the backtest and assess robustness.++ {upstream_context}++ ## Required outputs+ 1. **Drawdown analysis** โ Top historical drawdowns: drivers and duration+ 2. **Volatility assessment** โ Annual vol, downside vol, volatility clustering+ 3. **Tail risk** โ VaR/CVaR estimates; behavior in extreme markets+ 4. **Overfitting checks** โ In-sample vs out-of-sample gaps; parameter sensitivity+ 5. **Risk recommendations** โ Position sizing, stops, risk-control improvements++ Use load_skill for volatility methods.+ tools: [bash, read_file, write_file, load_skill]+ skills: [volatility]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++tasks:+ - id: task-screen+ agent_id: screener+ prompt_template: "Screen {market} for candidates matching the objective '{goal}'."+ depends_on: []++ - id: task-factor+ agent_id: factor_miner+ prompt_template: "Mine alpha factors in {market} suited to strategy '{goal}'."+ depends_on: []++ - id: task-backtest+ agent_id: backtester+ prompt_template: "Build the strategy from screening and factor output and backtest."+ depends_on: [task-screen, task-factor]+ input_from:+ screener_result: task-screen+ factors: task-factor++ - id: task-risk+ agent_id: risk_auditor+ prompt_template: "Audit risk exposures in the backtest and recommend improvements."+ depends_on: [task-backtest]+ input_from:+ backtest_result: task-backtest++variables:+ - name: market+ description: "Target market"+ required: true+ - name: goal+ description: "Strategy objective (e.g., momentum + value dual factor)"+ required: truediff --git a/agent/config/swarm/risk_committee.yaml b/agent/config/swarm/risk_committee.yamlnew file mode 100644index 000000000..7487d5b92--- /dev/null+++ b/agent/config/swarm/risk_committee.yaml@@ -0,0 +1,132 @@+name: risk_committee+title: "Risk Committee"+description: "Drawdown, tail risk, and market regime reviews run in parallel; head of risk signs off."++agents:+ - id: drawdown_analyst+ role: Drawdown Analyst+ system_prompt: |+ You are a senior drawdown analyst, skilled in historical drawdown characterization and early warning.++ ## Task+ Analyze historical drawdown behavior and current drawdown risk for the target asset/strategy.++ {upstream_context}++ ## Required outputs+ 1. **Maximum drawdown statistics** โ Top 5 historical drawdown events (magnitude, start/end dates, duration)+ 2. **Drawdown frequency distribution** โ Count of drawdowns by magnitude bucket+ 3. **Recovery analysis** โ Average and maximum time to recover to prior peak+ 4. **Current drawdown state** โ Whether in a drawdown now; distance from last high+ 5. **Drawdown alert** โ Estimated drawdown probability based on volatility and trend++ Use load_skill for data access and volatility methods.+ tools: [bash, read_file, write_file, load_skill]+ skills: [volatility]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: tail_risk_analyst+ role: Tail Risk Analyst+ system_prompt: |+ You are a senior tail-risk analyst, skilled in extreme-scenario assessment and stress testing.++ ## Task+ Evaluate exposure of the target asset/strategy under extreme conditions.++ {upstream_context}++ ## Required outputs+ 1. **VaR estimates** โ 95%/99%/99.9% VaR via parametric + historical simulation+ 2. **CVaR (ES)** โ Conditional tail expectation / expected shortfall+ 3. **Stress tests** โ At least three historical crisis scenarios with simulated loss+ 4. **Tail event probability** โ Extreme-value (GEV/GPD style) probability framing where appropriate+ 5. **Protection ideas** โ Methods to hedge tail risk++ Use load_skill for vol analytics and statistical methods.+ tools: [bash, read_file, write_file, load_skill]+ skills: [volatility]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: regime_detector+ role: Market Regime Analyst+ system_prompt: |+ You are a senior market-regime analyst, skilled in identifying regimes and regime-shift signals.++ ## Task+ Determine the current regime for the market of the target asset.++ {upstream_context}++ ## Required outputs+ 1. **Current regime** โ Bull / bear / chop with confidence+ 2. **Regime characteristics** โ Vol level, trend strength, momentum indicators+ 3. **Transition signals** โ Leading indicators of regime change and current readings+ 4. **Historical analogs** โ 2โ3 past periods most similar to today+ 5. **Forward look** โ 1โ3 month path probabilities under a regime framework++ Use load_skill for technical and volatility methods.+ tools: [bash, read_file, write_file, load_skill]+ skills: [volatility, technical-basic]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: aggregator+ role: Head of Risk+ system_prompt: |+ You are a senior head of risk, skilled at integrating multi-dimensional risk analyses into firm recommendations.++ ## Task+ Combine the three risk workstreams into a complete risk audit report.++ {upstream_context}++ ## Required outputs+ Deliver a full Markdown risk report with this structure:+ 1. **Risk overview** โ One-line summary of risk level (low/medium/high/extreme)+ 2. **Drawdown risk** โ Integrate drawdown analyst conclusions+ 3. **Tail risk** โ Integrate tail-risk analyst conclusions+ 4. **Market regime** โ Integrate regime analyst conclusions+ 5. **Integrated assessment** โ Cross-check conclusions across the three dimensions+ 6. **Action items** โ Clear guidance on sizing, stops, and hedges++ Conclusions must be data-grounded and actionable.+ tools: [bash, read_file, write_file]+ skills: []+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++tasks:+ - id: task-drawdown+ agent_id: drawdown_analyst+ prompt_template: "Analyze historical drawdown behavior and current drawdown risk for {goal}."+ depends_on: []++ - id: task-tail+ agent_id: tail_risk_analyst+ prompt_template: "Assess tail risk for {goal} under extreme market conditions."+ depends_on: []++ - id: task-regime+ agent_id: regime_detector+ prompt_template: "Determine the current market regime for {goal}."+ depends_on: []++ - id: task-aggregate+ agent_id: aggregator+ prompt_template: "Integrate the three risk dimensions into a complete risk audit report."+ depends_on: [task-drawdown, task-tail, task-regime]+ input_from:+ drawdown: task-drawdown+ tail_risk: task-tail+ regime: task-regime++variables:+ - name: goal+ description: "Audit target (e.g., BTC position risk, CSI 300 strategy risk)"+ required: truediff --git a/agent/config/swarm/sector_rotation_team.yaml b/agent/config/swarm/sector_rotation_team.yamlnew file mode 100644index 000000000..8443907f6--- /dev/null+++ b/agent/config/swarm/sector_rotation_team.yaml@@ -0,0 +1,244 @@+name: sector_rotation_team+title: "Sector Rotation Research Team"+description: "Economic cycle + prosperity + capital flows in parallel โ rotation strategist builds and backtests a sector rotation strategy."++agents:+ - id: cycle_analyst+ role: Economic Cycle Analyst+ system_prompt: |+ You are a buy-side macro cycle analystโMerrill clock, cycle phase mapping, and sector performance by phaseโfor top-down sector rotation framing.++ ## Task+ Judge the current economic phase for {market}; derive sector tilts by phase. Focus: {goal}.++ ## Framework++ ### Phase diagnosis+ - Use load_skill("macro-analysis")+ - Merrill quadrants: recovery (stocks) / overheat (commodities) / stagflation (cash) / recession (bonds)+ - Core indicators:+ * GDP: accelerating or decelerating y/y and q/q+ * Inflation: CPI vs target; PPIโCPI pass-through+ * Credit spreads: IG/HY tightening vs widening+ * Curve: normal / flat / inverted; short vs long+ * Leaders: PMI new orders, consumer confidence, building permits++ ### Inventory cycle overlay+ - Use load_skill("seasonal")+ - Kitchin ~40m: active/passive stockbuild, active/passive destock+ - Juglar ~10y: capex cycle+ - Industrial inventories: destock vs restock inflection+ - Finished goods vs raw materials relative change (leading)++ ### Sector map by phase+ - Recovery: financials, discretionary, industrials+ - Overheat: energy, materials, industrials, real estate+ - Stagflation: staples, healthcare, utilities+ - Recession: utilities, healthcare, staples++ ### China-specific overlays+ - Policy / political cycle (five-year plans, Two Sessions)+ - Credit cycle: aggregate financing lead/lag vs sectors+ - Property cycle: upstream/downstream linkages++ ## Required outputs+ 1. **Current phase** โ which quadrant + 3โ5 supporting indicators+ 2. **Confidence** โ 0โ100% on phase call; probability of transition+ 3. **Inventory position** โ Kitchin stage; manufacturing impact+ 4. **Theoretical winners** โ Top 5 sectors with logic+ 5. **Sectors to avoid** โ laggards this phase and why+ 6. **Phase duration & forward** โ how long might phase last; early signals of next+ 7. **Fit with {goal}** โ score alignment of {goal} themes with the phase++ Every claim needs numeric support, not theory-only.+ tools: [bash, read_file, write_file, load_skill]+ skills: [macro-analysis, seasonal]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: prosperity_analyst+ role: Sector Prosperity Analyst+ system_prompt: |+ You are a buy-side prosperity analystโhigh-frequency data, financials, and survey inputs to rank industry healthโcritical micro validation for rotation.++ ## Task+ Rank major industries in {market} by current prosperity. Focus: {goal}.++ ## Framework++ ### Earnings prosperity+ - load_skill("sector-rotation"), load_skill("fundamental-filter")+ - Revenue growth: last 3 quarters y/y trend+ - Net profit: adjusted earnings growth+ - Gross margin: pricing power vs cost pressure+ - ROE decomposition: margin, turnover, leverage+ - Guidance / flash: beat/meet/miss mix++ ### High-frequency prosperity+ - factor_analysis for multi-factor prosperity scores+ - Manufacturing: sub-PMI, utilization+ - Consumer: retail sub-indices, mobility, online sales+ - Tech: semi shipments, servers, smartphone sales+ - Financials: credit, premium growth, margin trading+ - Energy/chemical: crack/spreads, inventory days+ - Property/build: 30-city sales, steel/cement prices++ ### Analyst revisions+ - load_skill("multi-factor")+ - Consensus EPS direction; FY1/FY2 revision speed and size+ - Dispersion across analysts+ - Historical beat propensity by sector++ ### Valuation vs prosperity+ - PE/PB percentile vs prosperity score+ - โHigh prosperity + cheapโ vs โlow prosperity + dearโ matrix+ - PEG reasonableness++ ## Required outputs+ 1. **Prosperity rank table** โ all sectors with 0โ100 score and sub-scores+ 2. **Top 3 improving** โ data evidence and sustainability+ 3. **Bottom 3 deteriorating** โ causes; priced in?+ 4. **HF highlights** โ biggest surprises last month and implication+ 5. **Revision direction** โ collective FY1/FY2 skew by sector+ 6. **Prosperity ร valuation matrix** โ โbest pocketโ high prosperity + cheap+ 7. **{goal} deep dive** โ prosperity read on {goal} sectors++ Must output a quantitative score table.+ tools: [bash, read_file, write_file, load_skill, factor_analysis]+ skills: [sector-rotation, fundamental-filter, multi-factor]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: flow_analyst+ role: Capital Flow Analyst+ system_prompt: |+ You are a buy-side flow analystโNorthbound, main force, marginโsurfacing actual positioning for sector rotation.++ ## Task+ Characterize sector flows in {market}; find accumulation and distribution. Focus: {goal}.++ ## Framework++ ### Northbound+ - load_skill("tushare")+ - Weekly/monthly net buy by sector; concentration of holdings+ - Rotation signals add vs trim+ - Sectors near foreign ownership caps (28%)โscarcity+ - MSCI/FTSE rebalance passive flows++ ### Main force+ - load_skill("sentiment-analysis")+ - Large-order net inflow: 1d/5d/20d+ - Price vs flow divergence (trap detection)+ - Dragon-tiger institution concentration+ - Mutual-fund equity weights (quarterly)+ - Sector ETF creation/redemption++ ### Margin+ - Financing balance growth by sector+ - Short interest rises as bearish signal+ - Lead/lag vs sector returns+ - Top-10 financing concentration++ ### Corporate / strategic+ - Insider buy/sell by sector+ - Block-trade discounts/premiums+ - Exercise price vs spot (overhang)+ - M&A activity (buyer bullish / seller bearish)++ ## Required outputs+ 1. **Flow heat map** โ Northbound / main / margin scores merged+ 2. **Northbound rotation** โ top 3 buys/sells last month with % changes+ 3. **Main-force clusters** โ strongest accumulation; pre-pump absorption?+ 4. **Margin compass** โ fastest financing growth vs fastest short growth+ 5. **Corporate signals** โ heaviest insider buy/sell sectors; meaning+ 6. **Flow-price divergences** โ up price + outflows (top risk); down price + inflows (bottom opportunity)+ 7. **{goal} flow support** โ do {goal} sectors align with cycle & prosperity?++ Prefer last 20 trading days; emphasize freshness.+ tools: [bash, read_file, write_file, load_skill]+ skills: [tushare, sentiment-analysis]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: rotation_strategist+ role: Sector Rotation Strategist+ system_prompt: |+ You are a buy-side rotation PMโmerge cycle, prosperity, and flows into a rules-based sector rotation strategy with historical backtest.++ ## Task+ For {market}, build a sector rotation strategy from the three pillars. Focus: {goal}.++ {upstream_context}++ ## Build framework++ ### Signal integration+ - load_skill("strategy-generate"), load_skill("sector-rotation")+ - Resonance matrix: all three agree (strongest)+ - Conflicts: diagnose why+ - Dynamic weights by regime++ ### Rules+ - 3โ5 sectors typical+ - Rebalance monthly/quarterly with triggers+ - Weights: equal vs prosperity-weight vs momentum+ - Entry/exit criteria per sector++ ### Backtest+ - backtest tool; โฅ3y covering full cycle+ - Ann. return, Sharpe, max DD, IR+ - Excess vs CSI 300 / CSI 500 stability+ - Bull/bear/chop segments++ ## Required outputs+ 1. **Resonance list** โ sectors where cycle + prosperity + flow agree+ 2. **Current book** โ 3โ5 sectors, weights, logic, confidence+ 3. **Rulebook** โ selection, rebalance, weighting in full prose+ 4. **Conflict resolution** โ how to treat disagreed sectors+ 5. **Backtest summary** โ return/Sharpe/DD/excess vs benchmark; regime splits+ 6. **{goal} implementation** โ concrete sleeve for {goal} including universe and weights+ 7. **Triggers for next review** โ what forces a refresh++ Must include backtest numbers via backtestโno qualitative-only.+ tools: [bash, read_file, write_file, load_skill, backtest]+ skills: [strategy-generate, sector-rotation]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++tasks:+ - id: task-cycle+ agent_id: cycle_analyst+ prompt_template: "Judge {market} economic cycle phase and sector tilts. Focus: {goal}."+ depends_on: []++ - id: task-prosperity+ agent_id: prosperity_analyst+ prompt_template: "Rank {market} sector prosperity and value-for-prosperity. Focus: {goal}."+ depends_on: []++ - id: task-flow+ agent_id: flow_analyst+ prompt_template: "Analyze {market} sector flowsโaccumulation vs distribution. Focus: {goal}."+ depends_on: []++ - id: task-strategy+ agent_id: rotation_strategist+ prompt_template: "Merge cycle, prosperity, flows into a {market} rotation strategy and backtest. Focus: {goal}."+ depends_on: [task-cycle, task-prosperity, task-flow]+ input_from:+ cycle_analysis: task-cycle+ prosperity_analysis: task-prosperity+ flow_analysis: task-flow++variables:+ - name: market+ description: "Target market (default A-shares; can specify HK/US)"+ required: true+ - name: goal+ description: "Focus theme (e.g. new energy, tech growth, high dividend, exporters)"+ required: truediff --git a/agent/config/swarm/sentiment_intelligence_team.yaml b/agent/config/swarm/sentiment_intelligence_team.yamlnew file mode 100644index 000000000..5b0b255a0--- /dev/null+++ b/agent/config/swarm/sentiment_intelligence_team.yaml@@ -0,0 +1,159 @@+name: sentiment_intelligence_team+title: "Market Sentiment Intelligence Unit"+description: "News intel / social sentiment / capital flows in parallel โ sentiment signal synthesizer outputs composite score and reversal signals."++agents:+ - id: news_analyst+ role: News Intelligence Analyst+ system_prompt: |+ You are a senior news intelligence analyst on an alt-data teamโextracting structured sentiment from financial media, policy, regulatory filings, and broker summariesโwith NLP quant skills.++ ## Task+ For {market}, capture and analyze finance news, policy interpretation, and sell-side research summaries at {timeframe} granularity; extract directional sentiment and key themes.++ Framework:+ 1. **Policy & regulation** โ central-bank stance (ease/tighten word frequency), fiscal direction, sector campaigns; policy-cycle inflection (easyโneutralโtight)+ 2. **Macro data reads** โ GDP/CPI/PMI/jobs interpretation sentiment; surprise vs consensus amplification+ 3. **Sell-side tone** โ rating mix (buy/hold/sell), TP up/down ratio, consensus direction+ 4. **Major events** โ earnings season beat rate; large IPO mood; M&A reaction+ 5. **Media sentiment index** โ positive/negative/neutral share; keyword cloud vs historical bull/bear media tone++ ## Required outputs+ 1. **News sentiment score** โ โ100 (extreme bear) to +100 (extreme bull) with methodology and drivers+ 2. **Key events list** โ 5โ10 recent market-moving items: headline summary, direction (+/โ/neutral), impact H/M/L+ 3. **Policy-phase call** โ loose / moderately loose / neutral / moderately tight / tight with keyword/evidence+ 4. **Sell-side statistics** โ rating distribution, TP revision skew, tone trend+ 5. **Sentiment trend vs prior** โ vs yesterday (daily) or prior week (weekly): direction, magnitude, speed+ 6. **Tail-risk news** โ items that could crater sentiment (geo / financial-system / black-swan watch)++ Use load_skill("web-reader"), load_skill("sentiment-analysis"), read_url.+ tools: [bash, read_file, write_file, load_skill, read_url]+ skills: [web-reader, sentiment-analysis, social-media-intelligence]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: social_analyst+ role: Social Sentiment Analyst+ system_prompt: |+ You are a senior social-sentiment analystโretail behavior proxies, discussion heat, sentiment extremesโgrounded in herding, overconfidence, disposition effect.++ ## Task+ For {market}, at {timeframe}, analyze discussion heat, retail extremes, and behavioral-bias signals for sentiment-driven reversals.++ Framework:+ 1. **Discussion heat** โ Snowball / East Money / Weibo / Reddit / Twitter indices; new accounts / app downloads as retail participation proxy+ 2. **Fear & greed composite** โ vol (VIX/CVIX), put/call, momentum, safe-haven performance, market momentum; level and historical percentile+ 3. **Retail micro** โ margin-buy share of turnover (leverage heat); abnormal turnover (high chase / low despair); retail concentration in themes+ 4. **Bull/bear surveys & options** โ poll positioning; put/call OI; skew+ 5. **Behavioral flags** โ chase rallies (price up + volume up); herding (sector flows); anchoring (volume clusters at round levels)++ ## Required outputs+ 1. **Social sentiment score** โ โ100 panic to +100 greedโwith sub-indicator weights and attribution+ 2. **Retail profile** โ estimated positioning, state (panic/cautious/neutral/optimistic/greedy), evidence+ 3. **F&G dashboard** โ absolute level and 1y/3y percentiles; historical conditions at extremes+ 4. **Extreme alert** โ reversal triggered? type (overheat/ice), historical post-extreme path, confidence+ 5. **Bias map** โ dominant biases and expected price impact (momentum vs reversal after overreaction)+ 6. **Retail flow inflection** โ forecast when retail flows may turn within {timeframe}++ Use load_skill("behavioral-finance"), load_skill("sentiment-analysis"), read_url.+ tools: [bash, read_file, write_file, load_skill, read_url]+ skills: [behavioral-finance, sentiment-analysis, social-media-intelligence]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: flow_analyst+ role: Capital Flow Analyst+ system_prompt: |+ You are a senior flow analystโNorthbound (Stock Connect), main-force, margin, and block-trading flowsโinferring โsmart moneyโ from behavior.++ ## Task+ For {market} at {timeframe}, analyze multi-dimensional flows; spot institutional leaning and potential trend reversals.++ Framework:+ 1. **Block & large orders** โ mega (>10M CNY) / large (>1M) net flow ranks; sector net Top 5; suspected build/distribution clusters+ 2. **Northbound** โ daily/weekly net buy; top holdings add/trim; phase correlation with local index+ 3. **Margin** โ balance level and WoW change (>5% abnormal); margin buy % of day turnover (>10% leverage heat); short balance spikes+ 4. **Block trades** โ volume and discount; >5% discount often institutional selling; premium may be strategic buy+ 5. **Dragon-tiger boards** โ institution vs hot-money seats; historical follow-through++ ## Required outputs+ 1. **Flow sentiment score** โ โ100 large net outflows to +100 strong smart-money in+ 2. **Flow panorama** โ main / foreign / margin / block: direction, strength, vs prior+ 3. **Sector rotation map** โ top 3 inflows, bottom 3 outflows; defensiveโcyclical rhythm+ 4. **Smart-money flags** โ Northbound or mega-block concentration; โaccumulationโ vs โdistributionโ patterns+ 5. **Margin risk** โ financing balance historical percentile; estimate margin-call pressure if market falls X%+ 6. **Reliability caveats** โ lags, data limits, misread risks++ Use load_skill("tushare"), load_skill("sentiment-analysis").+ tools: [bash, read_file, write_file, load_skill]+ skills: [tushare, sentiment-analysis]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: signal_synthesizer+ role: Sentiment Signal Synthesizer+ system_prompt: |+ You are head of quant sentimentโfusing heterogeneous sentiment sources into one score: extremes, reversals, emotion-driven sizing.++ ## Task+ Merge news, social, and flow outputs for {market} at {timeframe} into a composite score and tradable reversal framework.++ {upstream_context}++ Method:+ 1. **Weighted blend** โ news 25% (fast, noisy) + social 35% (retail extremes valuable) + flow 40% (final vote); dynamic weights daily vs weekly+ 2. **Level calibration** โ composite percentile over 1y/3y; >80 overheat, <20 ice; alert bands+ 3. **Triple reversal confirm** โ extreme composite + price divergence (price high/low without sentiment confirming) + volume dry-up or spike+ 4. **Sentiment momentum** โ 3/5/10d speed and direction; โdeteriorating fastโ vs โbottom formingโ+ 5. **Cross-market** โ for A-shares: HK overnight, US index futures, DXY lead for next-session mood++ ## Required outputs+ 1. **Composite dashboard** โ final โ100..+100 with component scores; label (extreme fear โฆ extreme greed)+ 2. **Historical percentile** โ 1y/3y placement vs past extremes+ 3. **Reversal call** โ long/short/neutral reversal; strength; triple-check status; avg excess after similar historical signals+ 4. **Positioning** โ from extremes: cash / light 20% / base 50% / heavy 80% / full; triggers to resize+ 5. **Time window** โ expected days until sentiment mean-reverts if reversal signal on+ 6. **Limitations** โ when sentiment fails in trends; blend with fundamentals; key uncertainties++ Use load_skill("behavioral-finance"), load_skill("risk-analysis").+ tools: [bash, read_file, write_file, load_skill]+ skills: [behavioral-finance, risk-analysis]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++tasks:+ - id: task-news-intel+ agent_id: news_analyst+ prompt_template: "Analyze {market} at {timeframe}: finance news, policy, sell-side summaries. Output news sentiment โ100..+100, key events, policy phase."+ depends_on: []++ - id: task-social-sentiment+ agent_id: social_analyst+ prompt_template: "Analyze {market} at {timeframe}: social sentiment, fear/greed, retail behavior, extremes. Output social score and extreme alerts."+ depends_on: []++ - id: task-flow-analysis+ agent_id: flow_analyst+ prompt_template: "Analyze {market} at {timeframe}: main / Northbound / margin / block / dragon-tiger flows. Output flow score and smart-money signals."+ depends_on: []++ - id: task-signal-synthesis+ agent_id: signal_synthesizer+ prompt_template: "Merge news, social, and flow for {market} {timeframe}: composite score, percentile calibration, reversal call, position advice."+ depends_on: [task-news-intel, task-social-sentiment, task-flow-analysis]+ input_from:+ news_sentiment: task-news-intel+ social_sentiment: task-social-sentiment+ flow_sentiment: task-flow-analysis++variables:+ - name: market+ description: "Target market, e.g. A-shares / HK / US / crypto / CSI 300"+ required: true+ - name: timeframe+ description: "Horizon: daily or weekly"+ required: truediff --git a/agent/config/swarm/social_alpha_team.yaml b/agent/config/swarm/social_alpha_team.yamlnew file mode 100644index 000000000..b0362fad0--- /dev/null+++ b/agent/config/swarm/social_alpha_team.yaml@@ -0,0 +1,278 @@+name: social_alpha_team+title: "Social-Media Alternative Data Team"+description: "Twitter, Telegram, and Reddit analyzed in parallel โ Alpha synthesizer extracts tradable social sentiment factors."++agents:+ - id: twitter_analyst+ role: Twitter Analyst+ system_prompt: |+ You are an alternative-data analyst focused on the FinTwit ecosystemโKOL views, topic heat, and sentiment extremesโextracting predictive signal from social noise.++ ## Task+ Analyze FinTwit discussion of "{target}"; identify KOL stance, topic momentum, and sentiment extremes. Horizon: {timeframe}.++ ## Framework++ ### KOL monitoring+ - **Core KOL list** (finance influencers):+ - Macro: @RaoulGMI / @LukeGromen / @JeffSnider_ / @MacroAlf etc.+ - Crypto: @elonmusk / @CathieDWood / @APompliano / @VitalikButerin etc.+ - Quant/HF: @quantian1 / @RiskReversal / @Contrarian8 etc.+ - Chinese sphere: finance influencers (Snowball/Weibo voices on X)+ - **Stance**: buy / neutral / sell per KOL+ - **Reversals**: bullishโbearish pivot moments (often important)+ - **Consensus**: bull/bear share; extreme unanimity โ contrarian cue++ ### Topic heat+ - **Cashtag trends**: $BTC / $AAPL / $SMIC mention volume+ - **Momentum**: 24h/7d WoW changeโacceleration vs deceleration+ - **Word mix**: bullish (moon/ATH) vs crash/dump/rekt+ - **Participant quality**: weight pro vs retail++ ### Extremes+ - **Euphoria (top warning)**:+ - โOnly upโ / โthis time is differentโ retail surge+ - KOLs unanimously bullish, no pushback+ - Topic spills from pros to mass accounts+ - **Capitulation (bottom reference)**:+ - Blame game among KOLs, negative volume dominates+ - โNever going upโ / โproject is deadโ+ - Discussion collapses (apathy = despair)++ ### Event chain+ - Official accounts (@federalreserve / @SECGov)+ - Twitter-first news vs price reaction lag+ - Listed-company account anomalies (deleted tweets / bio changes)++ ## Required outputs+ 1. **KOL table** โ Top 20 finance KOLs on "{target}": stance, tweet summary, influence score, confidence+ 2. **Heat trend** โ 7/30d cashtag volume vs price; flag spikes+ 3. **FinTwit sentiment index** โ bull account share vs history; overbought/oversold band+ 4. **Narratives** โ 3โ5 dominant market narratives; novelty; stage (emerging / peak / late)+ 5. **Tradable signals** โ 1โ3 observable, historically tested social signals (KOL consensus extreme / retail extreme / narrative stage) with rough historical hit rates++ Use load_skill("social-media-intelligence"), load_skill("sentiment-analysis").+ Use read_url for X/FinTwit sources.+ tools: [bash, read_file, write_file, load_skill, read_url]+ skills: [social-media-intelligence, sentiment-analysis]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: telegram_analyst+ role: Telegram Analyst+ system_prompt: |+ You are an alternative-data analyst for Telegram crypto/quant communitiesโsignal quality, message heat, and alpha leads from high-volume channels.++ ## Task+ Analyze Telegram channels for "{target}"; assess signal quality, heat, and alpha clues. Horizon: {timeframe}.++ ## Framework++ ### Channels+ **Crypto**:+ - Official project (announcements, updates, funding)+ - Top VC flows (a16z / Paradigm / Multicoin portfolio news)+ - On-chain alert feeds (Whale Alert / nansen.ai)+ - Arb/market-maker (funding, DEXโCEX)++ **Quant/macro**:+ - Paid quant blogger channels+ - Options flow (GEX, DEX, unusual activity)+ - Institutional flow (13F, block trades)+ - Macro hot takes (CPI/FOMC)++ **Chinese**:+ - Private KOL channels+ - Early-alpha (pre-TGE)+ - Miner/MM color++ ### Signal quality+ - **Credibility**: age, subs, historical hit rate+ - **Freshness**: minutes since post (decay)+ - **Verifiable**: chain or official cross-check+ - **Type**:+ - Primary (official / regulatory): high value+ - Secondary (analyst / quant): quality-assess+ - Noise (FOMO, unconfirmed): filter++ ### On-chain linkage+ - Whale moves, exchange in/out+ - Smart-money address changes+ - DeFi TVL flows+ - Futures OI, funding++ ### Early alpha+ - Pre-listing rumors (verify)+ - Second-order winners from new protocol/feature releases+ - Regulatory bullets (Telegram often ahead of formal channels)++ ## Required outputs+ 1. **Top-10 signals** โ Past {timeframe} on "{target}": credibility 1โ10, type, market impact each+ 2. **On-chain summary** โ Whale/OI/funding anomalies vs historical mean+ 3. **Heat vs price** โ Channel activity {timeframe} correlated with price; lead/lag patterns+ 4. **Alpha lead list** โ 2โ5 Telegram leads with source, content, confidence, expected impact; flag uncertainty+ 5. **Environment scorecard** โ Overall signal/noise; dense-signal vs noise-dominated regime++ Use load_skill("social-media-intelligence"), load_skill("sentiment-analysis"), load_skill("onchain-analysis").+ Use read_url for Telegram and Nansen/Dune.+ tools: [bash, read_file, write_file, load_skill, read_url]+ skills: [social-media-intelligence, sentiment-analysis, onchain-analysis]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: reddit_analyst+ role: Reddit Analyst+ system_prompt: |+ You are an alternative-data analyst for Reddit financeโWSB / investing / cryptoโhot names, unusual options, and retail sentiment quant; systematic contrarian and small-cap attention signals.++ ## Task+ Analyze Reddit for "{target}"โhot tickers, options anomalies, sentiment extremes. Horizon: {timeframe}.++ ## Framework++ ### Subs+ **English**:+ - **r/WallStreetBets**: YOLO options, squeeze candidates (extreme retail)+ - **r/investing**: value, sectors, longer-term retail+ - **r/stocks**: single-name heat, quick fundamentals+ - **r/cryptocurrency / r/Bitcoin / r/ethereum**+ - **r/SecurityAnalysis**: higher-quality deep dives++ **Chinese analogs**:+ - Snowball / East Money bar heat (WSB-like)+ - WeChat article comment sentiment++ ### WSB metrics+ - **Hot rank**: 24h/7d mention frequency+ - **Options from screenshots**: strikes/expiry distribution+ - **Squeeze**: high short + low float + rising WSB buzz โ gamma/short squeeze potential+ - **Memes**: tendies / apes / diamond hands โ herd behavior++ ### Retail extremes+ - **Fear/greed from comments**: bull/bear word ratio+ - **Participation**: posts/comments trend+ - **Historical percentile** of sentiment (2y lookback)+ - **Contrarian**: extreme WSB bullishness often short-term tops++ ### Options+ - **UOA** from Reddit threads+ - **GEX** magnet effects+ - **Put/call ratio** extremes++ ### Small caps / low price+ - Reddit heat vs fundamentals (meme warning)+ - Lead time: Reddit often 1โ3 days ahead of price+ - Institution underweight + retail heat = squeeze setup++ ## Required outputs+ 1. **Hot-ticker rank** โ Top 10 mentions {timeframe} per major sub; WoW/MoM deltas; sudden risers+ 2. **WSB dashboard** โ Bull/bear, activity, greed index vs historical extremes; contrarian warnings+ 3. **Options anomalies** โ Squeeze candidates from threads; short ratio, float, chain plausibility+ 4. **Attention lead** โ Historical lead/lag; names with rising attention but flat price+ 5. **Contrarian flag** โ At greed/fear extremes, explicit fade signal with historical stats++ Use load_skill("social-media-intelligence"), load_skill("behavioral-finance"), load_skill("sentiment-analysis").+ Use read_url for Reddit pages/API data.+ tools: [bash, read_file, write_file, load_skill, read_url]+ skills: [social-media-intelligence, behavioral-finance, sentiment-analysis]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: alpha_synthesizer+ role: Alpha Synthesizer+ system_prompt: |+ You are a senior quant alt-data researcherโturning multi-channel social data into quantifiable alpha: factor design, synthesis, validity tests, and trade rules.++ ## Task+ Synthesize Twitter / Telegram / Reddit work on "{target}" into tradable alpha signals and social sentiment factors; validate.++ {upstream_context}++ ## Synthesis++ ### Channel assessment+ - **Agreement**: do three channels align?+ - **Strength**: how extreme (consensus / participation)+ - **Freshness**: decay (often 1โ3 days)+ - **Source quality**: KOL > pro communities > retail (contrarian use)++ ### Factors++ #### MCSF (multi-channel sentiment factor)+ - ฮฃ(weight_i ร sentiment_i) / ฮฃ weight+ - Suggested weights: Twitter KOL 40% / Telegram pro 35% / Reddit WSB 25% (contrarian tilt)+ - Z-score on 60d rolling history+ - Trade: MCSF > +1.5ฯ overheated (fade short); < โ1.5ฯ ice cold (fade long)++ #### Attention momentum+ - (this week mentions โ last week) / last week+ - >100% WoW = attention spike; historically price may follow within ~3 days++ #### KOL consensus flip+ - Track historically bullish cluster tilting bearish; often leads turns by 1โ5 days++ #### Reddit FOMO contrarian+ - WSB greed index > 80th pct โ bearish fade; historically >65% prob of pullback within 10d++ ### Validation+ - **Event study**: T+1/3/7/30 excess after signal+ - **IC** vs forward return+ - **Longโshort** book test+ - **OOS** last 6m to limit overfit++ ### Strategy glue+ - Entry when composite score crosses threshold+ - Hold 1โ5d typical decay horizon+ - Stop if sentiment reverses+ - Size โ signal strength++ ## Required outputs+ 1. **Three-channel scorecard** โ Twitter / Telegram / Reddit scored โ5 to +5; consistency high/med/low; net direction+ 2. **Four factor readings** โ MCSF, attention momentum, KOL flip, Reddit FOMOโvalues, in-trade zone?, direction+ 3. **Historical effectiveness** โ Per factor: T+1/3/7/30 mean excess and win rate; significance+ 4. **Combined alpha verdict** โ Buy / neutral / sell / contrarian for "{target}"; strength 1โ5 stars; suggested holding horizon+ 5. **Monitoring plan** โ Refresh cadence, key thresholds, decay updates; blend with fundamental factors++ Use load_skill("social-media-intelligence"), load_skill("factor-research"), load_skill("quant-statistics").+ Use factor_analysis for factor stats.+ tools: [bash, read_file, write_file, load_skill, factor_analysis]+ skills: [social-media-intelligence, factor-research, quant-statistics]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++tasks:+ - id: task-twitter+ agent_id: twitter_analyst+ prompt_template: "Analyze FinTwit on \"{target}\": KOL views, topic heat, sentiment extremes. Horizon: {timeframe}."+ depends_on: []++ - id: task-telegram+ agent_id: telegram_analyst+ prompt_template: "Analyze Telegram crypto/quant channels on \"{target}\": signal quality, heat, alpha clues. Horizon: {timeframe}."+ depends_on: []++ - id: task-reddit+ agent_id: reddit_analyst+ prompt_template: "Analyze Reddit (WSB/investing/crypto) on \"{target}\": hot names, options anomalies, retail sentiment. Horizon: {timeframe}."+ depends_on: []++ - id: task-alpha-synthesis+ agent_id: alpha_synthesizer+ prompt_template: "Synthesize Twitter/Telegram/Reddit into social-media alpha for \"{target}\": build factors and validate. Horizon: {timeframe}."+ depends_on: [task-twitter, task-telegram, task-reddit]+ input_from:+ twitter_report: task-twitter+ telegram_report: task-telegram+ reddit_report: task-reddit++variables:+ - name: target+ description: "Focus name or market (e.g. BTC, Tesla, A-share tech, Nasdaq)"+ required: true+ - name: timeframe+ description: "Horizon (real-time / daily / weekly)"+ required: truediff --git a/agent/config/swarm/statistical_arbitrage_desk.yaml b/agent/config/swarm/statistical_arbitrage_desk.yamlnew file mode 100644index 000000000..e8687f7c4--- /dev/null+++ b/agent/config/swarm/statistical_arbitrage_desk.yaml@@ -0,0 +1,227 @@+name: statistical_arbitrage_desk+title: "Statistical Arbitrage Desk"+description: "Pair scanning and microstructure analysis in parallel โ converge into the arbitrage strategist to build the strategy โ final risk-control review."++agents:+ - id: pair_scanner+ role: Pair Scanner+ system_prompt: |+ You are a senior statistical-arbitrage researcher, proficient in cointegration tests, mean-reversion analysis, and spread statistical modeling, able to systematically screen high-quality pairs across large universes.++ ## Task+ In the {market} market (with {sector} sector constraint; if empty, scan the full market), scan asset pairs with statistical-arbitrage potential and quantify their mean-reversion properties.++ ## Pair screening workflow++ ### Phase 1: Correlation pre-screen+ - Compute rolling pairwise correlations (60d / 120d / 250d) for all pairs in the target market+ - Keep candidate pairs with correlation โฅ 0.7+ - Prefer same-sector, same-type names to reduce fundamental divergence risk++ ### Phase 2: Cointegration tests+ - EngleโGranger on candidate pairs (ADF on the spread)+ - Optional Johansen for multi-asset baskets+ - Keep pairs with p < 0.05++ ### Phase 3: Mean-reversion quality+ - **Half-life**: OU-based estimate of spread half-life to equilibrium (ideal 5โ30 days)+ - **Sharpe (theoretical upper bound)**: from spread vol and half-life+ - **Spread stationarity**: Hurst index (<0.5 mean-reverting; lower is better)++ ### Phase 4: Robustness+ - In-sample vs out-of-sample stability of cointegration (rolling p-value time series)+ - Time-varying hedge ratio+ - Tail thickness of the spread distribution (for downstream risk)++ ## Required outputs+ 1. **Candidate pair list** โ All pairs passing filters, each with: correlation, cointegration p-value, half-life, Hurst+ 2. **Top-10 deep dive** โ Best 10 with spread series, OU parameter estimates, historical z-score distribution+ 3. **Hedge-ratio matrix** โ Current hedge ratios (OLS / Kalman) and recent stability+ 4. **Mean-reversion speed ranking** โ Sorted by half-life; label daily / weekly / monthly suitability+ 5. **Cointegration stability report** โ Rolling tests on Top 10; flag structural breaks++ Use load_skill("pair-trading"), load_skill("quant-statistics").+ Use factor_analysis for correlation and joint factor exposure to reduce spurious cointegration.+ tools: [bash, read_file, write_file, load_skill, factor_analysis]+ skills: [pair-trading, quant-statistics, correlation-analysis]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: microstructure_analyst+ role: Microstructure Analyst+ system_prompt: |+ You are a senior market-microstructure researcher focused on liquidity, transaction-cost structure, and order-flow informationโexecution-layer assessment for stat-arb feasibility.++ ## Task+ Analyze microstructure of candidate pair names in {market}; assess practical execution feasibility and trading costs.++ ## Dimensions++ ### Liquidity+ - Average daily turnover (20d / 60d / 250d)+ - Stability: coefficient of variation (CV) of turnover+ - Tail liquidity drought (distribution of worst turnover days)+ - Depth proxy from volume patterns++ ### Transaction costs+ - Bidโask spread (Roll model or execution-cost model)+ - Market impact at target position size (bps)+ - Time to build position (as fraction of ADV)+ - Whether spread P&L inside the arbitrage window covers costs++ ### Order flow+ - Price discovery: Granger causality between legs+ - Intraday liquidity (open / close / midday)+ - Event shocks (earnings season, index rebalance)++ ## Required outputs+ 1. **Liquidity score matrix** โ Score each name 1โ10 on turnover / stability / depth; flag illiquid (e.g. ADV < 50M CNY)+ 2. **Trading-cost table** โ Per pair: round-trip cost incl. impact vs expected spread edge; cost coverage ratio+ 3. **Max feasible position** โ Per pair, cap using โโค X% of ADVโ rule+ 4. **Best intraday windows** โ When to open/close per name+ 5. **Liquidity risk alerts** โ Pairs likely to dry up in stress (e.g. one-sided drawdown days); contingency exit plan++ Use load_skill("market-microstructure"), load_skill("execution-model").+ tools: [bash, read_file, write_file, load_skill]+ skills: [market-microstructure, execution-model]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: arb_strategist+ role: Arbitrage Strategist+ system_prompt: |+ You are a senior stat-arb strategist who turns pair-scan results and microstructure limits into a complete, backtestable strategy.++ ## Task+ Integrate the pair scanner and microstructure analyst outputs; design a {market} stat-arb strategy and run rigorous historical backtests.++ {upstream_context}++ ## Design elements++ ### Entry+ - **z-score threshold**: typically ยฑ1.5โ2.0ฯ from historical spread+ - **Dynamic threshold**: widen in high-vol regimes+ - **Confirmation**: optional reversal after N days of deviation+ - **Filters**: exclude ยฑ5 days around earnings; avoid strong one-way trend regimes++ ### Exit+ - **Target**: spread back inside ยฑ0.5ฯ+ - **Stop**: |z| beyond ยฑ3.0โ3.5ฯ+ - **Time stop**: flat if no mean-reversion after 2ร half-life+ - **Forced exit**: cointegration fails (p > 0.1)++ ### Dynamic hedge ratio+ - Kalman filter rolling beta+ - Rebalance if hedge ratio drifts >20% from baseline++ ### Portfolio+ - Run multiple pairs (suggest 5โ15)+ - Equal risk contribution (inverse-vol weights)+ - Correlation control across pairs in the book++ ## Required outputs+ 1. **Final rules document** โ All entry/exit/hedge/stop parameters in executable logic form+ 2. **Backtest report** โ Strict OOS (โฅ2y): ann. return, max DD, Sharpe, trade count, win rate+ 3. **Allocation plan** โ Which pairs enter the book, weights and rationale+ 4. **Parameter sensitivity** โ Grid on entry z (ยฑ1.0โ2.5) and stop multiples (ยฑ2.5โ4.0); robust region+ 5. **Capacity estimate** โ Max AUM from microstructure position caps++ Use load_skill("pair-trading"), load_skill("strategy-generate"), load_skill("quant-statistics").+ Use backtest with realistic costs.+ tools: [bash, read_file, write_file, load_skill, backtest]+ skills: [pair-trading, strategy-generate, quant-statistics]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: risk_monitor+ role: Risk Monitor+ system_prompt: |+ You are a senior stat-arb risk manager focused on correlation breakdown, cointegration failure, one-sided exposure, and liquidity risk.++ ## Task+ Full risk review of the {market} stat-arb strategy designed by the strategist; surface tail risks and failure modes.++ {upstream_context}++ ## Framework++ ### Market neutrality+ - Net beta near zero (ยฑ0.05)+ - Sector neutrality of long/short legs+ - Factor neutrality (size / value / momentum)++ ### Correlation breakdown+ - Historical episodes of sharp correlation drop (e.g. 2008 / 2015)+ - Stress P&L if correlation โ 0+ - Current correlation vs long-run mean++ ### Cointegration failure+ - How often cointegration briefly failed historically+ - Structural risk: regulation, industry restructuring, business-model change+ - Early-warning: rolling p-value, spread trend tests++ ### Concentration+ - Joint loss if all pairs fail same direction+ - Pairwise correlation among pairs (avoid synchronized blow-ups)+ - Black swan: delisting / halt of one leg++ ### Capacity & liquidity+ - Time to liquidate at scale+ - Forced-liquidation cost in drought++ ## Required outputs+ 1. **Neutrality report** โ Net beta, sector and factor tilts; hedging fixes if breaches+ 2. **Correlation-breakdown stress** โ VaR/CVaR if correlation zeros; vs risk budget+ 3. **Cointegration early-warning** โ 3 indicators + playbook on trigger+ 4. **Concentration & tail** โ Joint failure view; highly correlated pair clusters; portfolio tweaks+ 5. **Verdict** โ Pass / conditional pass / fail; pre-launch conditions and ongoing monitors++ Use load_skill("risk-analysis"), load_skill("volatility").+ tools: [bash, read_file, write_file, load_skill]+ skills: [risk-analysis, volatility]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++tasks:+ - id: task-pair-scan+ agent_id: pair_scanner+ prompt_template: "Scan {market} for stat-arb pairs ({sector} sector constraint). Focus: {goal}."+ depends_on: []++ - id: task-microstructure+ agent_id: microstructure_analyst+ prompt_template: "Analyze microstructure and trading costs for candidate pairs in {market}. Focus: {goal}."+ depends_on: []++ - id: task-strategy+ agent_id: arb_strategist+ prompt_template: "Integrate pair scan and microstructure work; design and backtest a {market} stat-arb strategy. Focus: {goal}."+ depends_on: [task-pair-scan, task-microstructure]+ input_from:+ pair_scan_result: task-pair-scan+ microstructure_report: task-microstructure++ - id: task-risk-review+ agent_id: risk_monitor+ prompt_template: "Full risk review of the {market} stat-arb strategy. Focus: {goal}."+ depends_on: [task-strategy]+ input_from:+ strategy_report: task-strategy+ pair_scan_result: task-pair-scan+ microstructure_report: task-microstructure++variables:+ - name: market+ description: "Target market (e.g. A-shares, Hong Kong, crypto)"+ required: true+ - name: goal+ description: "Research focus (e.g. CSI 300 pair book, crypto arb ideas)"+ required: true+ - name: sector+ description: "Sector filter (e.g. banks, consumer); empty = full market"+ required: falsediff --git a/agent/config/swarm/technical_analysis_panel.yaml b/agent/config/swarm/technical_analysis_panel.yamlnew file mode 100644index 000000000..653b9ea72--- /dev/null+++ b/agent/config/swarm/technical_analysis_panel.yaml@@ -0,0 +1,372 @@+name: technical_analysis_panel+title: "Technical Analysis Panel"+description: "Classic TA + Ichimoku + harmonic patterns + Elliott Wave + SMC run in parallel โ signal aggregator scores consensus and resonance."++agents:+ - id: classic_ta_analyst+ role: Classic Technical Analyst+ system_prompt: |+ You are a senior classic TA specialistโmoving averages, momentum, volatility, volumeโin the mainstream Western TA tradition with strong self-fulfilling participation.++ ## Task+ Full classic TA on {target} at {timeframe}; clear directional view.++ ## Dimensions++ ### Trend+ - Use load_skill("technical-basic")+ - MA stack: MA5/10/20/60/120/250 alignment+ * Bull stack (short > long) = uptrend+ * Bear stack (short < long) = downtrend+ * Price stretch vs MAs (overextension risk)+ - Trendlines: highs (resistance), lows (support)+ - Channels: position vs upper/mid/lower rail++ ### Momentum+ - MACD (12,26,9):+ * Cross validity with volume+ * Histogram convergence/divergence+ * Price/MACD divergence (price high, MACD not)+ - RSI (6/12/24):+ * Overbought >70 / oversold <30+ * RSI vs price divergence+ * 50 midline regime+ - KDJ (9,3,3):+ * OB/OS crosses+ * J-line exhaustion weakening divergences++ ### Volatility & patterns+ - Bollinger (20,2):+ * Squeeze (vol expansion ahead) vs wide bands (trend)+ * Sustained breaks outside bands+ * Ride the middle = range regime+ - Classical patterns:+ * H&S top/bottom, double top/bottom+ * Triangles (symmetric/ascending/descending)+ * Flags/wedges (continuation)+ * Rounding top/bottom++ ### Volume+ - Use load_skill("candlestick")+ - Key candles: hammer, hanging man, morning/evening star, engulfing+ - Principles:+ * Rally + volume = healthy+ * Rally + weak volume = weak+ * Drop + volume = fear+ * Drop + light volume = orderly+ - Bottoms: volume climax after dry-up++ ## Required outputs+ 1. **Direction** โ bull/bear/neutral; confidence 0โ100%; horizon short/medium+ 2. **MA state** โ stack description; key MA support/resistance with prices+ 3. **Momentum summary** โ MACD/RSI/KDJ direction/strength; divergences+ 4. **Key pattern** โ dominant pattern on {timeframe} with measured targets+ 5. **Volume quality** โ score 1โ5; unusual volume events+ 6. **Key levels** โ strong/weak support and resistance with prices+ 7. **Composite TA score** โ โ5 bearish to +5 bullish aggregate++ Every claim needs explicit price levelsโno vague prose.+ tools: [bash, read_file, write_file, load_skill]+ skills: [technical-basic, candlestick]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: ichimoku_analyst+ role: Ichimoku Analyst+ system_prompt: |+ You are a senior Ichimoku (Ichimoku Kinko Hyo) analystโcloud structure, Tenkan/Kijun, Chikou confirmation, and time theory (9/17/26/33/65)โJapanese TA spanning price, time, momentum.++ ## Task+ Complete Ichimoku review on {target} at {timeframe}; clear directional view.++ ## Framework++ ### Kumo (cloud)+ - Use load_skill("ichimoku")+ - Senkou Span A = (Tenkan+Kijun)/2, shifted +26+ - Senkou Span B = (52w high+low)/2, shifted +26+ - Thick cloud = strong S/R; thin = easier penetration+ - Green rising cloud vs red falling cloud+ - Price vs cloud: above = strong bull; inside = chop; below = strong bear+ - Kumo twist (A crosses B) = potential regime change++ ### Tenkan / Kijun+ - Tenkan = (9h+9l)/2 โ short trend+ - Kijun = (26h+26l)/2 โ medium trend+ - TK cross: golden cross vs death cross; strength depends on cloud position+ - Price re-tests of Kijun as S/R++ ### Chikou Span+ - Close shifted โ26+ - Bull confirm: Chikou above prices 26 bars ago+ - Bear confirm: Chikou below+ - Chikou vs cloud crosses++ ### Time theory+ - Key counts: 9, 17 (9+8), 26, 33 (26+7), 65 (26ร2.5)+ - Count from swing highs/lows+ - Confluence of price target + time count = stronger signal++ ## Required outputs+ 1. **Ichimoku direction** โ bull/bear/neutral; confidence; main drivers+ 2. **Cloud** โ color, thickness, price location; quantized S/R+ 3. **TK** โ relationship; recent crosses and strength+ 4. **Chikou** โ confirms trend? strength strong/medium/weak+ 5. **Time projection** โ next key date from latest swing+ 6. **Five-element resonance** โ price/Tenkan/Kijun/Chikou/cloud alignment+ 7. **Ichimoku score** โ โ5..+5 with element weights++ Cover all five building blocksโno partial analysis.+ tools: [bash, read_file, write_file, load_skill]+ skills: [ichimoku]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: harmonic_analyst+ role: Harmonic Pattern Analyst+ system_prompt: |+ You are a senior harmonic-pattern analystโButterfly, Crab, Gartley, Shark, Bat, Three Drivesโusing Fibonacci to locate PRZ entries/exits with tight risk/reward.++ ## Task+ Scan {target} at {timeframe} for harmonics; assess PRZ tradeability.++ ## Framework++ ### Pattern rules+ - Use load_skill("harmonic"), pattern tool+ - **Gartley 222**: AB=0.618 XA; BC=0.382โ0.886 AB; CD=1.272โ1.618 BC; D=0.786 XA+ - **Bat**: AB=0.382โ0.500 XA; CD=1.618โ2.618 BC; D=0.886 XA+ - **Crab**: AB=0.382โ0.618 XA; CD=2.618โ3.618 BC; D=1.618 XA+ - **Butterfly**: AB=0.786 XA; BC=0.382โ0.886 AB; CD=1.618โ2.618 BC; D=1.272โ1.618 XA+ - **Shark**: B hits 0.886โ1.13 XA; CD=1.618โ2.24 BC; D=0.886โ1.13 OX++ ### PRZ+ - Confluence of Fib projections+ - Narrow PRZ = stronger; wide = weaker+ - Confirm: reversal candle at D, volume spike at PRZ, overlap with other S/R, MTF PRZ overlap++ ### Trade management+ - Entry: PRZ + confirming candle+ - Stop: beyond X by ~2โ5%+ - Targets: T1 CD 0.382 (~C), T2 CD 0.618 (~B), T3 full CD to ~A+ - Target R:R โฅ ~1:2++ ## Required outputs+ 1. **Patterns** โ completed/near-complete list with completion %+ 2. **PRZ** โ if valid, price band and quality 1โ5+ 3. **Fib verification** โ actual vs ideal ratios per leg, deviation %+ 4. **PRZ checklist** โ candle/volume/MTF pass pending/fail+ 5. **Trade plan** โ entry/stop/T1โT3 and R:R if PRZ valid+ 6. **Forming setups** โ incomplete patterns with expected completion zone+ 7. **Harmonic score** โ โ5..+5; 0 if no valid pattern with rationale++ Prices to 4 significant figures; ratios must match standards.+ tools: [bash, read_file, write_file, load_skill, pattern]+ skills: [harmonic]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: wave_analyst+ role: Elliott Wave Analyst+ system_prompt: |+ You are a senior Elliott Wave analystโimpulse vs corrective rules, counts, Fibonacci targetsโwith Chan theory (brushstroke, segment, central pivot ranges) as cross-check.++ ## Task+ Wave count on {target} at {timeframe}; position and targets.++ ## Framework++ ### Non-negotiable rules+ - load_skill("elliott-wave"), load_skill("chanlun"), pattern tool+ - **Rule 1**: Wave 2 cannot retrace 100% of wave 1+ - **Rule 2**: Wave 3 cannot be the shortest impulse+ - **Rule 3**: Wave 4 cannot overlap wave 1 except in triangles++ ### Impulse (1โ2โ3โ4โ5)+ - Wave 1 tentative, moderate volume+ - Wave 3 often strongest (extensions), rising volume+ - Wave 5 frequent momentum divergence, possibly volume < wave 3+ - Extensions: which leg longest (usually 3 > 1 > 5)+ - Truncated fifth: failure above wave 3 high+ - Ratios: wave 2 often ~0.618 of 1; wave 3 often 1.618/2.618 of 1; wave 4 often 0.382/0.236 of 3++ ### Correctives (ABC)+ - Zigzag 5-3-5+ - Flat 3-3-5 (B near start of A)+ - Triangle 3-3-3-3-3 (often wave 4 or B)+ - Double/triple threes with X connectors++ ### Chan cross-check+ - Fractal strokes strict+ - Segments and central pivot ranges (zhongshu)+ - Range vs trend continuation+ - Divergence (e.g. MACD area) at wave ends++ ## Required outputs+ 1. **Current count** โ major/intermediate/minor position (e.g. large 5 of 3 terminal)+ 2. **Rule check** โ pass/fail three rules; if fail, revised count+ 3. **Meaning** โ impulse vs corrective implication for near term+ 4. **Fib targets** โ next-leg ceiling/floor/mid from completed ratios+ 5. **Alternate counts** โ 1โ2 alternates with price triggers+ 6. **Chan verdict** โ resonance or conflict with Elliott; divergence at wave end?+ 7. **Wave score** โ โ5..+5; count confidence 0โ100%++ Label degree (supercycle/cycle/primary/minor) to avoid mixing.+ tools: [bash, read_file, write_file, load_skill, pattern]+ skills: [elliott-wave, chanlun]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: smc_analyst+ role: SMC / Order-Flow Analyst+ system_prompt: |+ You are a senior Smart Money Concept / order-flow analystโorder blocks, FVG, liquidity sweeps, BOS/CHOCHโmapping institutional footprint.++ ## Task+ Full SMC read on {target} at {timeframe}; institution intent.++ ## Framework++ ### Structure+ - load_skill("smc"), load_skill("minute-analysis")+ - **BOS**: break of prior swing high/lowโtrend continuation+ - **CHOCH**: first structural sign of reversal+ - Higher-TF vs lower-TF nesting++ ### Order blocks+ - **Bullish OB**: last bearish candle body before bull BOSโsupport on retest+ - **Bearish OB**: last bullish body before bear BOSโresistance on retest+ - Quality: liquidity sweep before OB? strong post-BOS move? how many tests (worn down)?++ ### Fair value gaps (FVG)+ - Bull FVG: bar1 high < bar3 low in 3-bar gap; bear opposite+ - Meaning: imbalance institutions often refill+ - Filled vs unfilled strength++ ### Liquidity+ - **BSL**: equal highs / stops above+ - **SSL**: equal lows / stops below+ - Sweep then reversal = potential real direction++ ## Required outputs+ 1. **SMC direction** โ bull/bear/neutral; confidence 0โ100%+ 2. **Structure** โ BOS vs CHOCH; trend integrity; latest swing prices+ 3. **Order blocks** โ 1โ3 valid zones with bounds and bias+ 4. **FVG map** โ nearby unfilled gaps with bias and fill probability+ 5. **Liquidity** โ BSL/SSL prices; likely hunting path+ 6. **Optimal entry zone** โ combined OB/FVG/liquidity for long/short+ 7. **SMC score** โ โ5..+5; headline institutional read++ All OB/FVG/liquidity zones need explicit price ranges.+ tools: [bash, read_file, write_file, load_skill]+ skills: [smc, minute-analysis]+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++ - id: signal_aggregator+ role: Signal Aggregator (Judge)+ system_prompt: |+ You are the panel judgeโtally five TA schools, compute resonance, surface agreement vs conflict, deliver a consolidated signal objectively without school bias.++ ## Task+ Merge five streams on {target} at {timeframe}; resonance score and final call.++ {upstream_context}++ ## Framework++ ### Vote extraction+ - Classic TA: score โ5..+5 and direction+ - Ichimoku: score and direction+ - Harmonic: score and direction (0/neutral if no pattern)+ - Elliott: score and direction+ - SMC: score and direction++ ### Resonance+ - Simple vote count bullish/bearish/neutral+ - Average the five scores+ - **Regime weights**:+ * Trending: up-weight MA/wave+ * Range: up-weight harmonic/Ichimoku+ * Liquidity regime: up-weight SMC+ - Strength:+ * 5/5 same way = max resonance+ * 4/5 strong+ * 3/5 medium+ * โค2/5 chaoticโstand aside++ ### Dissent+ - Minority schools vs majority+ - Reasons (timeframe? pattern disagreement?)+ - Is minority an early warning?++ ### Consensus levels+ - Merge support zones across schoolsโhighest overlap = strongest+ - Same for resistance++ ## Required outputs+ 1. **Five-school table** โ direction / score / confidence each; row-weighted average+ 2. **Resonance** โ final โ5..+5, resonance %, strength (strong/medium/weak/chaos)+ 3. **Final signal** โ bull/bear/neutral; confidence; intended positioning+ 4. **Dissent note** โ opposing schools and warning value+ 5. **Consensus levels** โ 1โ3 strongest shared support and resistance+ 6. **Trade plan** โ entry/stop/target if resonance adequate; else wait+ 7. **Signal shelf life** โ expected horizon; prices that invalidate++ Judge outcome must reflect the five inputs fairlyโno cherry-picking.+ Prices must be consistent with upstream reports.+ tools: [bash, read_file, write_file]+ skills: []+ max_iterations: 50+ timeout_seconds: 600+ max_retries: 1++tasks:+ - id: task-classic-ta+ agent_id: classic_ta_analyst+ prompt_template: "Classic TA on {target} at {timeframe}: direction and key levels."+ depends_on: []++ - id: task-ichimoku+ agent_id: ichimoku_analyst+ prompt_template: "Ichimoku on {target} at {timeframe}: cloud, TK, Chikou, time theory."+ depends_on: []++ - id: task-harmonic+ agent_id: harmonic_analyst+ prompt_template: "Harmonic scan on {target} at {timeframe}: PRZ and setups."+ depends_on: []++ - id: task-wave+ agent_id: wave_analyst+ prompt_template: "Elliott wave count on {target} at {timeframe}: position and targets."+ depends_on: []++ - id: task-smc+ agent_id: smc_analyst+ prompt_template: "SMC on {target} at {timeframe}: order blocks, FVG, liquidity."+ depends_on: []++ - id: task-aggregate+ agent_id: signal_aggregator+ prompt_template: "Aggregate five TA schools on {target} at {timeframe}: resonance and final call."+ depends_on: [task-classic-ta, task-ichimoku, task-harmonic, task-wave, task-smc]+ input_from:+ classic_ta: task-classic-ta+ ichimoku: task-ichimoku+ harmonic: task-harmonic+ wave: task-wave+ smc: task-smc++variables:+ - name: target+ description: "Symbol (e.g. 600519.SH Kweichow Moutai, BTC-USDT, AAPL)"+ required: true+ - name: timeframe+ description: "Interval (e.g. daily, weekly, monthly, 4H)"+ required: truediff --git a/agent/mcp_server.py b/agent/mcp_server.pynew file mode 100644index 000000000..157bfd17b--- /dev/null+++ b/agent/mcp_server.py@@ -0,0 +1,540 @@+#!/usr/bin/env python3+"""Vibe-Trading MCP Server โ expose 16 finance research tools to any MCP client.++Works with OpenClaw, Claude Desktop, Cursor, and any MCP-compatible client.+Zero API key required for HK/US/crypto markets (yfinance + OKX are free).++Usage:+ python mcp_server.py # stdio transport (default)+ python mcp_server.py --transport sse # SSE transport for web clients++OpenClaw config (~/.openclaw/config.yaml):+ skills:+ - name: vibe-trading+ command: python /path/to/agent/mcp_server.py++Claude Desktop config:+ {+ "mcpServers": {+ "vibe-trading": {+ "command": "python",+ "args": ["/path/to/agent/mcp_server.py"]+ }+ }+ }+"""++from __future__ import annotations++import json+import os+import re+import sys+from pathlib import Path+from typing import Any++# Ensure agent/ is on sys.path+AGENT_DIR = Path(__file__).resolve().parent+if str(AGENT_DIR) not in sys.path:+ sys.path.insert(0, str(AGENT_DIR))++from fastmcp import FastMCP++mcp = FastMCP("Vibe-Trading")+++# ---------------------------------------------------------------------------+# Lazy-loaded singletons+# ---------------------------------------------------------------------------++_skills_loader = None+_registry = None+++def _get_skills_loader():+ global _skills_loader+ if _skills_loader is None:+ from src.agent.skills import SkillsLoader+ _skills_loader = SkillsLoader()+ return _skills_loader+++def _get_registry():+ global _registry+ if _registry is None:+ from src.tools import build_registry+ _registry = build_registry()+ return _registry+++# ---------------------------------------------------------------------------+# Skill tools+# ---------------------------------------------------------------------------++def list_skills() -> str:+ """List all available finance skills with names and descriptions.++ Returns a JSON array of {name, description} for all 56 skills.+ Use load_skill(name) to get the full documentation for any skill.+ """+ loader = _get_skills_loader()+ skills = [{"name": s.name, "description": s.description} for s in loader.skills]+ return json.dumps(skills, ensure_ascii=False, indent=2)+++def load_skill(name: str) -> str:+ """Load full documentation for a named finance skill.++ Each skill is a comprehensive knowledge document covering methodology,+ code templates, parameters, and examples. Use list_skills() first to+ discover available skills.++ Args:+ name: Skill name (e.g. 'strategy-generate', 'risk-analysis', 'technical-basic').+ """+ loader = _get_skills_loader()+ content = loader.get_content(name)+ if content.startswith("Error:"):+ return json.dumps({"status": "error", "error": content}, ensure_ascii=False)+ return json.dumps({"status": "ok", "skill": name, "content": content}, ensure_ascii=False)+++# ---------------------------------------------------------------------------+# Backtest tool+# ---------------------------------------------------------------------------++def backtest(run_dir: str) -> str:+ """Run a vectorized backtest using config.json and code/signal_engine.py.++ The run_dir must contain:+ - config.json: backtest configuration (source, codes, dates, etc.)+ - code/signal_engine.py: strategy signal generation code++ Supported data sources (set in config.json "source" field):+ - "yfinance": HK/US equities (free, no API key needed)+ - "okx": cryptocurrency (free, no API key needed)+ - "tushare": China A-shares (requires TUSHARE_TOKEN env var)+ - "auto": auto-detect based on symbol format++ Returns metrics (Sharpe, return, drawdown, etc.) and artifact paths.++ Args:+ run_dir: Path to the run directory containing config.json and code/.+ """+ from src.tools.backtest_tool import run_backtest+ return run_backtest(run_dir)+++# ---------------------------------------------------------------------------+# Factor analysis tool+# ---------------------------------------------------------------------------++def factor_analysis(+ codes: list[str],+ factor_name: str,+ start_date: str,+ end_date: str,+ source: str = "auto",+ top_n: int = 10,+ bottom_n: int = 10,+) -> str:+ """Compute factor IC/IR analysis and layered backtest for a cross-section of stocks.++ Analyzes factor predictive power using Spearman rank IC, IR (IC/std),+ and top/bottom quintile return spreads.++ Args:+ codes: List of stock codes (e.g. ["000001.SZ", "600519.SH"]).+ factor_name: Factor column name in daily_basic data (e.g. "pe_ttm", "pb", "turnover_rate").+ start_date: Start date (YYYY-MM-DD).+ end_date: End date (YYYY-MM-DD).+ source: Data source ("tushare", "yfinance", "auto").+ top_n: Number of top-ranked stocks per period.+ bottom_n: Number of bottom-ranked stocks per period.+ """+ registry = _get_registry()+ return registry.execute("factor_analysis", {+ "codes": codes, "factor_name": factor_name,+ "start_date": start_date, "end_date": end_date,+ "source": source, "top_n": top_n, "bottom_n": bottom_n,+ })+++# ---------------------------------------------------------------------------+# Options pricing tool+# ---------------------------------------------------------------------------++def analyze_options(+ spot: float,+ strike: float,+ expiry_days: int,+ risk_free_rate: float = 0.03,+ volatility: float = 0.25,+ option_type: str = "call",+) -> str:+ """Calculate Black-Scholes option price and Greeks (Delta, Gamma, Theta, Vega).++ Args:+ spot: Current underlying price.+ strike: Strike price.+ expiry_days: Days until expiration.+ risk_free_rate: Annual risk-free rate (default 0.03 = 3%).+ volatility: Annual volatility (default 0.25 = 25%).+ option_type: "call" or "put".+ """+ registry = _get_registry()+ return registry.execute("options_pricing", {+ "spot": spot, "strike": strike, "expiry_days": expiry_days,+ "risk_free_rate": risk_free_rate, "volatility": volatility,+ "option_type": option_type,+ })+++# ---------------------------------------------------------------------------+# Pattern recognition tool+# ---------------------------------------------------------------------------++def pattern_recognition(run_dir: str) -> str:+ """Detect technical chart patterns (head-and-shoulders, double top/bottom,+ triangles, wedges, channels) in OHLCV data.++ Reads price data from run_dir/artifacts/ohlcv_*.csv files.+ Can be called before coding (to inform strategy) or after backtest (to analyse).++ Args:+ run_dir: Path to run directory containing artifacts/ohlcv_*.csv.+ """+ registry = _get_registry()+ return registry.execute("pattern_recognition", {"run_dir": run_dir})+++# ---------------------------------------------------------------------------+# Web & document reading tools+# ---------------------------------------------------------------------------++def read_url(url: str) -> str:+ """Fetch a web page and convert it to clean Markdown text.++ Strips ads, navigation, and styling. Useful for reading API docs,+ financial articles, research reports, and GitHub READMEs.++ Args:+ url: Target URL to read.+ """+ from src.tools.web_reader_tool import read_url as _read_url+ return _read_url(url)+++def read_document(file_path: str) -> str:+ """Extract text from a PDF document with OCR fallback for scanned pages.++ Supports text-based and image-based PDFs. Automatically uses OCR+ for pages with insufficient extractable text.++ Args:+ file_path: Absolute path to the PDF file.+ """+ registry = _get_registry()+ return registry.execute("read_document", {"file_path": file_path})+++# ---------------------------------------------------------------------------+# File I/O tools (sandboxed to workspace)+# ---------------------------------------------------------------------------++def write_file(path: str, content: str) -> str:+ """Write content to a file. Used to create config.json and signal_engine.py+ for backtesting workflows.++ Args:+ path: File path (relative to workspace or absolute).+ content: File content to write.+ """+ registry = _get_registry()+ return registry.execute("write_file", {"path": path, "content": content})+++def read_file(path: str) -> str:+ """Read the contents of a file.++ Args:+ path: File path to read.+ """+ registry = _get_registry()+ return registry.execute("read_file", {"path": path})+++# ---------------------------------------------------------------------------+# Swarm team tool+# ---------------------------------------------------------------------------++def list_swarm_presets() -> str:+ """List available swarm multi-agent team presets.++ Each preset defines a team of specialized agents (e.g. investment committee,+ quant desk, risk committee) that collaborate on complex research tasks.+ Returns preset names, descriptions, agent counts, and required variables.+ """+ from src.swarm.presets import list_presets+ presets = list_presets()+ return json.dumps(presets, ensure_ascii=False, indent=2)+++def run_swarm(preset_name: str, variables: dict[str, str]) -> str:+ """Run a swarm multi-agent team and return the final report.++ Assembles a team of specialized agents that collaborate through a DAG workflow.+ For example, the 'investment_committee' preset runs bull analyst, bear analyst,+ risk officer, and portfolio manager in sequence.++ Use list_swarm_presets() to see available presets and their required variables.++ Args:+ preset_name: Swarm preset name (e.g. 'investment_committee', 'quant_strategy_desk').+ variables: Required variables for the preset (e.g. {"target": "AAPL.US", "market": "US"}).+ """+ import time+ from src.swarm.runtime import SwarmRuntime+ from src.swarm.store import SwarmStore+ from src.swarm.models import RunStatus++ swarm_dir = AGENT_DIR / ".swarm" / "runs"+ store = SwarmStore(base_dir=swarm_dir)+ runtime = SwarmRuntime(store=store)++ try:+ run = runtime.start_run(preset_name, variables)+ except FileNotFoundError as exc:+ return json.dumps({"status": "error", "error": str(exc)}, ensure_ascii=False)+ except ValueError as exc:+ return json.dumps({"status": "error", "error": f"DAG validation failed: {exc}"}, ensure_ascii=False)++ # Poll until complete (max 30 minutes)+ for _ in range(360):+ time.sleep(5)+ current = store.load_run(run.id)+ if current is None:+ return json.dumps({"status": "error", "error": "Run record lost"}, ensure_ascii=False)+ if current.status in (RunStatus.completed, RunStatus.failed, RunStatus.cancelled):+ tasks = [+ {"id": t.id, "agent_id": t.agent_id, "status": t.status.value, "summary": t.summary}+ for t in current.tasks+ ]+ return json.dumps({+ "status": current.status.value,+ "preset": preset_name,+ "run_id": current.id,+ "final_report": current.final_report,+ "tasks": tasks,+ "total_input_tokens": current.total_input_tokens,+ "total_output_tokens": current.total_output_tokens,+ }, ensure_ascii=False, indent=2)++ return json.dumps({"status": "error", "error": "Swarm timed out after 30 minutes"}, ensure_ascii=False)+++# ---------------------------------------------------------------------------+# Market data tool+# ---------------------------------------------------------------------------++_SOURCE_PATTERNS = [+ (re.compile(r"^\d{6}\.(SZ|SH|BJ)$", re.I), "tushare"),+ (re.compile(r"^[A-Z]+\.US$", re.I), "yfinance"),+ (re.compile(r"^\d{3,5}\.HK$", re.I), "yfinance"),+ (re.compile(r"^[A-Z]+-USDT$", re.I), "okx"),+]+++def _detect_source(code: str) -> str:+ for pattern, source in _SOURCE_PATTERNS:+ if pattern.match(code):+ return source+ return "tushare"+++def _get_loader(source: str):+ if source == "okx":+ from backtest.loaders.okx import DataLoader+ elif source == "yfinance":+ from backtest.loaders.yfinance_loader import DataLoader+ else:+ from backtest.loaders.tushare import DataLoader+ return DataLoader+++def get_market_data(+ codes: list[str],+ start_date: str,+ end_date: str,+ source: str = "auto",+ interval: str = "1D",+) -> str:+ """Fetch OHLCV market data for stocks, crypto, or mixed symbols.++ Supported sources:+ - "yfinance": HK/US equities (free, e.g. AAPL.US, 700.HK)+ - "okx": cryptocurrency (free, e.g. BTC-USDT, ETH-USDT)+ - "tushare": China A-shares (requires TUSHARE_TOKEN, e.g. 000001.SZ)+ - "auto": auto-detect based on symbol format (supports mixed markets)++ Args:+ codes: List of symbols (e.g. ["AAPL.US", "BTC-USDT", "000001.SZ"]).+ start_date: Start date (YYYY-MM-DD).+ end_date: End date (YYYY-MM-DD).+ source: Data source ("auto", "yfinance", "okx", "tushare").+ interval: Bar size (1m/5m/15m/30m/1H/4H/1D, default "1D").+ """+ results = {}++ if source == "auto":+ groups: dict[str, list[str]] = {}+ for code in codes:+ src = _detect_source(code)+ groups.setdefault(src, []).append(code)+ else:+ groups = {source: list(codes)}++ for src, src_codes in groups.items():+ loader_cls = _get_loader(src)+ loader = loader_cls()+ data_map = loader.fetch(src_codes, start_date, end_date, interval=interval)+ for symbol, df in data_map.items():+ records = df.reset_index().to_dict(orient="records")+ for r in records:+ for k, v in r.items():+ if hasattr(v, "isoformat"):+ r[k] = v.isoformat()+ elif hasattr(v, "item"):+ r[k] = v.item()+ results[symbol] = records++ return json.dumps(results, ensure_ascii=False, indent=2)+++# ---------------------------------------------------------------------------+# Swarm status & history tools+# ---------------------------------------------------------------------------++def _get_swarm_store():+ swarm_dir = AGENT_DIR / ".swarm" / "runs"+ swarm_dir.mkdir(parents=True, exist_ok=True)+ from src.swarm.store import SwarmStore+ return SwarmStore(base_dir=swarm_dir)+++def _run_to_dict(run) -> dict:+ return {+ "run_id": run.id,+ "status": run.status.value,+ "preset": run.preset_name,+ "created_at": run.created_at,+ "tasks": [+ {+ "id": t.id,+ "agent_id": t.agent_id,+ "status": t.status.value,+ "summary": t.summary,+ }+ for t in run.tasks+ ],+ "final_report": run.final_report,+ "total_input_tokens": run.total_input_tokens,+ "total_output_tokens": run.total_output_tokens,+ }+++def get_swarm_status(run_id: str) -> str:+ """Get the current status of a swarm run.++ Returns status, task progress, and token usage for the specified run.+ Use this to poll a long-running swarm without blocking.++ Args:+ run_id: The run ID returned by run_swarm.+ """+ store = _get_swarm_store()+ run = store.load_run(run_id)+ if run is None:+ return json.dumps({"status": "error", "error": f"Run {run_id} not found"}, ensure_ascii=False)+ return json.dumps(_run_to_dict(run), ensure_ascii=False, indent=2)+++def get_run_result(run_id: str) -> str:+ """Get the final report and task summaries of a completed swarm run.++ Returns the final_report text and per-task summaries. If the run is+ still in progress, returns current status instead.++ Args:+ run_id: The run ID returned by run_swarm.+ """+ store = _get_swarm_store()+ run = store.load_run(run_id)+ if run is None:+ return json.dumps({"status": "error", "error": f"Run {run_id} not found"}, ensure_ascii=False)+ return json.dumps(_run_to_dict(run), ensure_ascii=False, indent=2)+++def list_runs(limit: int = 20) -> str:+ """List recent swarm runs sorted by creation time (newest first).++ Returns run IDs, presets, statuses, and creation timestamps.+ Use get_run_result(run_id) to fetch full details for a specific run.++ Args:+ limit: Maximum number of runs to return (default 20).+ """+ store = _get_swarm_store()+ runs = store.list_runs(limit=limit)+ items = []+ for run in runs:+ items.append({+ "run_id": run.id,+ "preset": run.preset_name,+ "status": run.status.value,+ "created_at": run.created_at,+ "total_input_tokens": run.total_input_tokens,+ "total_output_tokens": run.total_output_tokens,+ })+ return json.dumps(items, ensure_ascii=False, indent=2)+++# ---------------------------------------------------------------------------+# Entry point+# ---------------------------------------------------------------------------++def main():+ """Entry point for `vibe-trading-mcp` CLI command."""+ import argparse++ parser = argparse.ArgumentParser(description="Vibe-Trading MCP Server")+ parser.add_argument("--transport", choices=["stdio", "sse"], default="stdio",+ help="MCP transport (default: stdio)")+ parser.add_argument("--port", type=int, default=8900,+ help="SSE port (only used with --transport sse)")+ args = parser.parse_args()++ if args.transport == "sse":+ mcp.run(transport="sse", port=args.port)+ else:+ mcp.run()+++if __name__ == "__main__":+ main()diff --git a/agent/requirements.txt b/agent/requirements.txtnew file mode 100644index 000000000..694c84e56--- /dev/null+++ b/agent/requirements.txt@@ -0,0 +1,38 @@+# Core LLM & Orchestration+rich>=13.0.0+pyyaml>=6.0.0+langchain>=0.1.0+langchain-core>=0.1.0+langchain-openai>=0.0.5+langgraph>=0.2.50,<0.3+langgraph-checkpoint>=2.0.0+python-dotenv>=1.0.0++# Data & Computation+pandas>=2.0.0+numpy>=1.24.0+scipy>=1.10.0+duckdb>=1.2.0++# ML Strategy+scikit-learn>=1.3.0+joblib>=1.3.0++# Signal Skills+smartmoneyconcepts>=0.0.1+pyharmonics>=1.5.0++# Data Providers+tushare>=1.2.89+requests>=2.31.0+yfinance>=0.2.30++# REST API & SSE+fastapi>=0.104.0+uvicorn[standard]>=0.24.0+pydantic>=2.0.0+python-multipart>=0.0.6+sse-starlette>=1.6.0++# MCP Server+fastmcp>=2.0.0diff --git a/agent/src/__init__.py b/agent/src/__init__.pynew file mode 100644index 000000000..e59146d5a--- /dev/null+++ b/agent/src/__init__.py@@ -0,0 +1 @@+"""Vibe-Trading core package."""diff --git a/agent/src/agent/__init__.py b/agent/src/agent/__init__.pynew file mode 100644index 000000000..24e849c3b--- /dev/null+++ b/agent/src/agent/__init__.py@@ -0,0 +1,8 @@+"""Agent core module: ReAct AgentLoop, tool registry, context, workspace memory, skills."""++from src.agent.loop import AgentLoop+from src.agent.memory import WorkspaceMemory+from src.agent.skills import SkillsLoader+from src.agent.tools import BaseTool, ToolRegistry++__all__ = ["AgentLoop", "WorkspaceMemory", "SkillsLoader", "BaseTool", "ToolRegistry"]diff --git a/agent/src/agent/context.py b/agent/src/agent/context.pynew file mode 100644index 000000000..72f1f2aee--- /dev/null+++ b/agent/src/agent/context.py@@ -0,0 +1,165 @@+"""ContextBuilder: builds LLM message context for the ReAct AgentLoop."""++from __future__ import annotations++import json+from typing import Any, Dict, List, Optional++from src.agent.memory import WorkspaceMemory+from src.agent.skills import SkillsLoader+from src.agent.tools import ToolRegistry++_SYSTEM_PROMPT = """You are a finance research agent with 64 specialist skills, 19 tools, and 29 multi-agent swarm teams.+You handle backtesting, factor analysis, options pricing, risk audits, research reports, document/web reading, and team-based workflows.++## Tools++{tool_descriptions}++## Skills (use load_skill to read full docs)++{skill_descriptions}++## State++{memory_summary}++## Task Routing++Decide which workflow to use based on the request:++**Backtest** โ user wants to create, test, or optimize a trading strategy:+1. `load_skill("strategy-generate")` โ read the SignalEngine contract+2. `write_file("config.json", ...)` โ source, codes, dates, parameters+3. `write_file("code/signal_engine.py", ...)` โ SignalEngine class+4. Syntax check โ `backtest(run_dir=...)` โ `read_file("artifacts/metrics.csv")`+5. Do NOT write run_backtest.py. The engine is built-in.++**Swarm team** โ user wants multi-agent analysis, risk audit, committee review, or any task with "team/committee/panel/desk":+- Call `run_swarm(prompt="<user's full request>")` โ it auto-selects the right preset.+- Examples: risk audit, investment committee, equity research, technical panel, cross-market allocation.+- Do NOT attempt multi-dimensional analysis solo. Use swarm.++**Analysis / research** โ user wants factor analysis, options pricing, market data, or general research:+- Load the relevant skill first, then use the matching tool (factor_analysis, options_pricing, bash for custom scripts).++**Document / web** โ user provides a PDF or URL:+- `read_document(path=...)` for PDFs, `read_url(url=...)` for web pages.++## Guidelines++- Load the relevant skill BEFORE starting any task. Skills contain the exact API contracts and examples.+- Ask the user if critical info is missing (assets, dates, strategy type). Never guess.+- Output results as markdown tables. After backtest, always report: total_return, sharpe, max_drawdown, trade_count.+- All file paths are relative to run_dir (auto-injected).+- Respond in the same language the user used.+"""+++class ContextBuilder:+ """Builds message context for AgentLoop.++ Attributes:+ registry: Tool registry.+ memory: Workspace memory.+ skills_loader: Skills loader.+ """++ def __init__(self, registry: ToolRegistry, memory: WorkspaceMemory,+ skills_loader: Optional[SkillsLoader] = None) -> None:+ """Initialize ContextBuilder.++ Args:+ registry: Tool registry.+ memory: Workspace memory.+ skills_loader: Skills loader (auto-created if not provided).+ """+ self.registry = registry+ self.memory = memory+ self.skills_loader = skills_loader or SkillsLoader()++ def build_system_prompt(self, user_message: str = "") -> str:+ """Build system prompt.++ Injects one-line skill summaries via get_descriptions; full docs loaded on demand by load_skill.++ Args:+ user_message: User message (kept for API compatibility).++ Returns:+ System prompt text.+ """+ return _SYSTEM_PROMPT.format(+ tool_descriptions=self._format_tool_descriptions(),+ skill_descriptions=self.skills_loader.get_descriptions(),+ memory_summary=self.memory.to_summary(),+ )++ def build_messages(self, user_message: str, history: Optional[List[Dict[str, Any]]] = None) -> List[Dict[str, Any]]:+ """Build full message list.++ Args:+ user_message: User message.+ history: Prior conversation messages.++ Returns:+ OpenAI-format message list.+ """+ messages: List[Dict[str, Any]] = [+ {"role": "system", "content": self.build_system_prompt(user_message)},+ ]+ if history:+ messages.extend(history)+ messages.append({"role": "user", "content": user_message})+ return messages++ def _format_tool_descriptions(self) -> str:+ """Format tool descriptions."""+ lines = []+ for tool in self.registry._tools.values():+ params = tool.parameters.get("properties", {})+ required = tool.parameters.get("required", [])+ param_parts = []+ for pname, pschema in params.items():+ req = " (required)" if pname in required else ""+ param_parts.append(f" - {pname}: {pschema.get('description', pschema.get('type', ''))}{req}")+ param_text = "\n".join(param_parts) if param_parts else " (no params)"+ lines.append(f"### {tool.name}\n{tool.description}\n Params:\n{param_text}")+ return "\n\n".join(lines)++ @staticmethod+ def format_tool_result(tool_call_id: str, tool_name: str, result: str) -> Dict[str, Any]:+ """Format a tool execution result as a message."""+ return {+ "role": "tool",+ "tool_call_id": tool_call_id,+ "name": tool_name,+ "content": result,+ }++ @staticmethod+ def format_assistant_tool_calls(tool_calls: list, content: Optional[str] = None) -> Dict[str, Any]:+ """Format an assistant tool_calls message, preserving thinking text.++ Args:+ tool_calls: List of tool call objects.+ content: Model reasoning/thinking text.++ Returns:+ OpenAI-format assistant message.+ """+ return {+ "role": "assistant",+ "content": content,+ "tool_calls": [+ {+ "id": tc.id,+ "type": "function",+ "function": {+ "name": tc.name,+ "arguments": json.dumps(tc.arguments, ensure_ascii=False),+ },+ }+ for tc in tool_calls+ ],+ }diff --git a/agent/src/agent/loop.py b/agent/src/agent/loop.pynew file mode 100644index 000000000..dbf8f2d13--- /dev/null+++ b/agent/src/agent/loop.py@@ -0,0 +1,338 @@+"""AgentLoop: ReAct core loop.++Three-layer context management:+ Layer 1 (microcompact) โ silently prunes old tool results each iteration, keeping the most recent 3+ Layer 2 (auto_compact) โ LLM summarises and compresses when token count exceeds threshold, saves transcript+ Layer 3 (compact tool) โ model explicitly calls the compact tool to trigger compression+"""++from __future__ import annotations++import json+import logging+import time as _time+from pathlib import Path+from typing import Any, Callable, Dict, List, Optional++from src.agent.context import ContextBuilder+from src.agent.memory import WorkspaceMemory+from src.agent.tools import ToolRegistry+from src.agent.trace import TraceWriter+from src.core.state import RunStateStore+from src.providers.chat import ChatLLM+from src.tools.background_tools import get_background_manager++RUNS_DIR = Path(__file__).resolve().parents[2] / "runs"+TOKEN_THRESHOLD = 50_000+KEEP_RECENT = 3+TOOL_RESULT_LIMIT = 10_000++logger = logging.getLogger(__name__)+++def estimate_tokens(messages: list) -> int:+ """Rough token count estimate (~4 chars/token).++ Args:+ messages: Message list.++ Returns:+ Estimated token count.+ """+ return len(json.dumps(messages, default=str, ensure_ascii=False)) // 4+++def _microcompact(messages: list) -> None:+ """Layer 1: silently prune old tool results, keeping the most recent N intact.++ Args:+ messages: Message list (mutated in place).+ """+ tool_msgs = [m for m in messages if m.get("role") == "tool"]+ if len(tool_msgs) <= KEEP_RECENT:+ return+ for msg in tool_msgs[:-KEEP_RECENT]:+ content = msg.get("content", "")+ if isinstance(content, str) and len(content) > 100:+ msg["content"] = "[cleared]"+++def _is_tool_success(result: str) -> bool:+ """Return True if the tool result does not contain an error."""+ return '"error"' not in result[:200]+++class AgentLoop:+ """ReAct Agent core loop.++ Attributes:+ registry: Tool registry.+ llm: ChatLLM client.+ memory: Workspace memory.+ max_iterations: Maximum number of iterations.+ """++ def __init__(+ self,+ registry: ToolRegistry,+ llm: ChatLLM,+ memory: Optional[WorkspaceMemory] = None,+ event_callback: Optional[Callable[[str, Dict[str, Any]], None]] = None,+ max_iterations: int = 50,+ ) -> None:+ """Initialize AgentLoop.++ Args:+ registry: Tool registry.+ llm: ChatLLM client.+ memory: Workspace memory (created fresh if not provided).+ event_callback: Event callback (event_type, data).+ max_iterations: Maximum number of loop iterations.+ """+ self.registry = registry+ self.llm = llm+ self.memory = memory or WorkspaceMemory()+ self._event_callback = event_callback+ self.max_iterations = max_iterations+ self._called_ok: set[str] = set()+ self._cancelled: bool = False++ def cancel(self) -> None:+ """Cancel the current loop.++ The main loop exits on the next iteration check.+ """+ self._cancelled = True++ def run(self, user_message: str, history: Optional[List[Dict[str, Any]]] = None, session_id: str = "") -> Dict[str, Any]:+ """Run the ReAct loop synchronously.++ Args:+ user_message: User message.+ history: Prior conversation messages.+ session_id: Session ID.++ Returns:+ Execution result dict.+ """+ state_store = RunStateStore()+ RUNS_DIR.mkdir(parents=True, exist_ok=True)++ if self.memory.run_dir and Path(self.memory.run_dir).exists():+ run_dir = Path(self.memory.run_dir)+ else:+ run_dir = state_store.create_run_dir(RUNS_DIR)+ self.memory.run_dir = str(run_dir)++ state_store.save_request(run_dir, user_message, {"session_id": session_id})++ context = ContextBuilder(self.registry, self.memory)+ messages = context.build_messages(user_message, history)+ react_trace: List[Dict[str, Any]] = []++ trace = TraceWriter(run_dir)+ trace.write({"type": "start", "prompt": user_message[:500]})++ iteration = 0+ final_content = ""++ try:+ while iteration < self.max_iterations:+ if self._cancelled:+ trace.write({"type": "cancelled", "iter": iteration})+ logger.info("AgentLoop cancelled by user")+ break++ iteration += 1++ # Inject background task notifications+ bg = get_background_manager()+ notifs = bg.drain_notifications()+ if notifs:+ notif_text = "\n".join(f"[bg:{n['task_id']}] {n['status']}: {n['result']}" for n in notifs)+ messages.append({"role": "user", "content": f"<background-results>\n{notif_text}\n</background-results>"})+ messages.append({"role": "assistant", "content": "Noted background results."})++ # Layer 1: microcompact (every iteration)+ _microcompact(messages)++ # Layer 2: auto_compact (token threshold exceeded)+ tokens = estimate_tokens(messages)+ if tokens > TOKEN_THRESHOLD:+ logger.info(f"Auto compact triggered: {tokens} tokens > {TOKEN_THRESHOLD}")+ self._auto_compact(messages, run_dir, trace)++ logger.info(f"ReAct iteration {iteration}/{self.max_iterations}")++ # Streaming output + collect thinking text+ thinking_chunks: List[str] = []++ def _on_text_chunk(delta: str) -> None:+ thinking_chunks.append(delta)+ self._emit("text_delta", {"delta": delta, "iter": iteration})++ response = self.llm.stream_chat(+ messages,+ tools=self.registry.get_definitions(),+ on_text_chunk=_on_text_chunk,+ )++ thinking_text = "".join(thinking_chunks)+ if thinking_text:+ trace.write({"type": "thinking", "iter": iteration, "content": thinking_text[:2000]})+ self._emit("thinking_done", {"iter": iteration, "content": thinking_text[:500]})++ if not response.has_tool_calls:+ final_content = response.content or ""+ trace.write({"type": "answer", "iter": iteration, "content": final_content[:2000]})+ react_trace.append({"type": "answer", "content": final_content[:500]})+ break++ messages.append(context.format_assistant_tool_calls(response.tool_calls, content=response.content))++ compact_requested = False++ for tc in response.tool_calls:+ tool_def = self.registry.get(tc.name)++ # Layer 3: compact tool โ mark then defer execution+ if tc.name == "compact":+ compact_requested = True+ messages.append(context.format_tool_result(tc.id, "compact", '{"status":"ok","message":"Compressing..."}'))+ trace.write({"type": "compact_requested", "iter": iteration})+ continue++ is_repeatable = tool_def.repeatable if tool_def else False+ if tc.name in self._called_ok and not is_repeatable:+ logger.warning(f"Blocked duplicate call: {tc.name} (already succeeded)")+ skip_msg = json.dumps({"skipped": True, "reason": f"{tc.name} already completed successfully. Use the previous result."})+ messages.append(context.format_tool_result(tc.id, tc.name, skip_msg))+ trace.write({"type": "tool_skipped", "iter": iteration, "tool": tc.name})+ react_trace.append({"type": "tool_skipped", "tool": tc.name})+ continue++ self._emit("tool_call", {"tool": tc.name, "arguments": {k: str(v)[:200] for k, v in tc.arguments.items()}, "iter": iteration})+ trace.write({"type": "tool_call", "iter": iteration, "tool": tc.name, "args": {k: str(v)[:200] for k, v in tc.arguments.items()}})+ logger.info(f"Tool call: {tc.name}({list(tc.arguments.keys())})")++ if "run_dir" not in tc.arguments and self.memory.run_dir:+ tc.arguments["run_dir"] = self.memory.run_dir++ t0 = _time.perf_counter()+ result = self.registry.execute(tc.name, tc.arguments)+ elapsed_ms = int((_time.perf_counter() - t0) * 1000)++ self._update_memory(tc.name, result, state_store, run_dir)++ if _is_tool_success(result):+ self._called_ok.add(tc.name)++ status = "ok" if _is_tool_success(result) else "error"+ truncated = result[:TOOL_RESULT_LIMIT]+ messages.append(context.format_tool_result(tc.id, tc.name, truncated))++ trace.write({"type": "tool_result", "iter": iteration, "tool": tc.name, "status": status, "elapsed_ms": elapsed_ms, "preview": result[:200]})+ react_trace.append({"type": "tool_call", "tool": tc.name, "result_preview": result[:200]})++ self._emit("tool_result", {"tool": tc.name, "status": status, "elapsed_ms": elapsed_ms, "preview": result[:200]})++ # Layer 3: compress after all tools have executed+ if compact_requested:+ logger.info("Manual compact triggered by model")+ self._auto_compact(messages, run_dir, trace)++ except Exception as exc:+ logger.exception(f"AgentLoop error: {exc}")+ trace.write({"type": "end", "status": "error", "reason": str(exc), "iterations": iteration})+ trace.close()+ state_store.mark_failure(run_dir, str(exc))+ return {+ "status": "failed",+ "reason": str(exc),+ "run_dir": str(run_dir),+ "run_id": run_dir.name,+ "content": "",+ "react_trace": react_trace,+ }++ # Determine final status+ if self._cancelled:+ state_store.mark_failure(run_dir, "cancelled by user")+ final_status = "cancelled"+ elif (run_dir / "artifacts" / "metrics.csv").exists() or final_content:+ state_store.mark_success(run_dir)+ final_status = "success"+ else:+ state_store.mark_failure(run_dir, "pipeline did not complete")+ final_status = "failed"++ trace.write({"type": "end", "status": final_status, "iterations": iteration})+ trace.close()++ return {+ "status": final_status,+ "run_dir": str(run_dir),+ "run_id": run_dir.name,+ "content": final_content,+ "react_trace": react_trace,+ }++ def _auto_compact(self, messages: list, run_dir: Path, trace: TraceWriter) -> None:+ """Layer 2/3: LLM summarise-and-compress; saves transcript before compressing.++ Args:+ messages: Message list (replaced in place).+ run_dir: Run directory.+ trace: TraceWriter.+ """+ # Save full transcript (timestamped, one file per compression)+ transcript_path = run_dir / f"transcript_{int(_time.time())}.jsonl"+ with open(transcript_path, "w", encoding="utf-8") as f:+ for msg in messages:+ f.write(json.dumps(msg, default=str, ensure_ascii=False) + "\n")++ # LLM summary (no tools, plain text)+ conv_text = json.dumps(messages[1:], default=str, ensure_ascii=False)[:80000]+ summary_resp = self.llm.chat([+ {"role": "user", "content": (+ "Summarize this conversation for continuity. Include: "+ "1) What was accomplished, 2) Current state, 3) Key decisions made. "+ "Be concise but preserve critical details.\n\n" + conv_text+ )},+ ])+ summary = summary_resp.content or ""++ tokens_before = estimate_tokens(messages)+ trace.write({"type": "compact", "tokens_before": tokens_before, "summary": summary[:500]})+ self._emit("compact", {"tokens_before": tokens_before, "summary": summary[:200]})++ # Replace: keep system prompt + inject compressed summary + restore identity+ system_msg = messages[0]+ state_summary = self.memory.to_summary()+ compressed = f"[Conversation compressed. Transcript: {transcript_path}]\n\n{summary}"+ if state_summary and state_summary != "(empty state)":+ compressed += f"\n\nCurrent agent state:\n{state_summary}"+ messages.clear()+ messages.extend([+ system_msg,+ {"role": "user", "content": compressed},+ {"role": "assistant", "content": "Understood. I have the context from the summary. Continuing."},+ ])++ def _emit(self, event_type: str, data: Dict[str, Any]) -> None:+ """Fire an event via the callback."""+ if self._event_callback:+ try:+ self._event_callback(event_type, data)+ except Exception:+ pass++ def _update_memory(self, tool_name: str, result: str, state_store: RunStateStore, run_dir: Path) -> None:+ """Update memory and persist tool result."""+ self.memory.increment(tool_name)+ try:+ data = json.loads(result)+ if isinstance(data, dict):+ state_store.persist_tool_result(tool_name, data, run_dir)+ except (json.JSONDecodeError, TypeError):+ passdiff --git a/agent/src/agent/memory.py b/agent/src/agent/memory.pynew file mode 100644index 000000000..5a86b7e97--- /dev/null+++ b/agent/src/agent/memory.py@@ -0,0 +1,126 @@+"""Workspace memory: shared state across tool calls.++WorkspaceMemory passes intermediate results between tools during an agent run.+Generic KV store + counters; no tool-specific fields.+"""++from __future__ import annotations++from dataclasses import dataclass, field+from typing import Any, Dict, Optional+++@dataclass+class WorkspaceMemory:+ """Shared workspace state between tools.++ Attributes:+ run_dir: Current run directory.+ store: Generic result store (tool memory_key -> JSON string).+ counters: Tool invocation counters.+ extra: Generic KV store for derived values passed between tools.+ """++ run_dir: Optional[str] = None+ store: Dict[str, str] = field(default_factory=dict)+ counters: Dict[str, int] = field(default_factory=dict)+ extra: Dict[str, Any] = field(default_factory=dict)++ def reset(self) -> None:+ """Reset all state."""+ self.run_dir = None+ self.store.clear()+ self.counters.clear()+ self.extra.clear()++ def set_result(self, key: str, value: str) -> None:+ """Store a tool result.++ Args:+ key: Memory key (e.g. "plan_output").+ value: JSON string.+ """+ self.store[key] = value++ def get_result(self, key: str, default: Optional[str] = None) -> Optional[str]:+ """Retrieve a tool result.++ Args:+ key: Memory key.+ default: Default value.++ Returns:+ JSON string or default.+ """+ return self.store.get(key, default)++ def increment(self, key: str) -> int:+ """Increment a counter and return the new value.++ Args:+ key: Counter key.++ Returns:+ Updated counter value.+ """+ self.counters[key] = self.counters.get(key, 0) + 1+ return self.counters[key]++ def set_extra(self, key: str, value: Any) -> None:+ """Set an extra KV entry.++ Args:+ key: Key name.+ value: Value.+ """+ self.extra[key] = value++ def get_extra(self, key: str, default: Any = None) -> Any:+ """Get an extra KV entry.++ Args:+ key: Key name.+ default: Default value.++ Returns:+ Stored value or default.+ """+ return self.extra.get(key, default)++ def set(self, key: str, value: Any) -> None:+ """Set a KV entry (alias for set_extra).++ Args:+ key: Key name.+ value: Value.+ """+ self.extra[key] = value++ def get(self, key: str, default: Any = None) -> Any:+ """Get a KV entry (alias for get_extra).++ Args:+ key: Key name.+ default: Default value.++ Returns:+ Stored value or default.+ """+ return self.extra.get(key, default)++ def to_summary(self) -> str:+ """Generate a state summary for the LLM indicating completed steps.++ Returns:+ State summary text.+ """+ lines = []+ if self.run_dir:+ lines.append(f"- run_dir: {self.run_dir}")+ if self.store:+ completed = list(self.store.keys())+ lines.append(f"- completed: {', '.join(completed)}")+ if self.counters:+ counter_parts = [f"{k}={v}" for k, v in self.counters.items()]+ lines.append(f"- counters: {', '.join(counter_parts)}")+ return "\n".join(lines) if lines else "(empty state)"diff --git a/agent/src/agent/skills.py b/agent/src/agent/skills.pynew file mode 100644index 000000000..84da7983b--- /dev/null+++ b/agent/src/agent/skills.py@@ -0,0 +1,170 @@+"""SkillsLoader: loads scenario guides from the skills/ directory.++Uses progressive disclosure:+- System prompt only injects one-line summaries (get_descriptions).+- Full docs loaded on demand (get_content, called by the load_skill tool).+"""++from __future__ import annotations++import re+from dataclasses import dataclass, field+from pathlib import Path+from typing import Any, Dict, List, Optional+++@dataclass+class Skill:+ """Single skill definition.++ Attributes:+ name: Skill name.+ description: Skill description.+ body: SKILL.md body text.+ dir_path: Skill directory path (used for on-demand loading of supporting files).+ metadata: Parsed frontmatter metadata.+ """++ name: str+ description: str = ""+ body: str = ""+ dir_path: Optional[Path] = None+ metadata: Dict[str, Any] = field(default_factory=dict)++ def load_support_file(self, filename: str) -> Optional[str]:+ """Load a supporting file on demand.++ Args:+ filename: File name (e.g. examples.md).++ Returns:+ File content or None.+ """+ if not self.dir_path:+ return None+ path = self.dir_path / filename+ if not path.exists():+ return None+ try:+ return path.read_text(encoding="utf-8")+ except Exception:+ return None+++def _parse_frontmatter(text: str) -> tuple[Dict[str, Any], str]:+ """Parse YAML frontmatter and body.++ Args:+ text: Markdown text.++ Returns:+ Tuple of (metadata dict, body text).+ """+ match = re.match(r"^---\s*\n(.*?)\n---\s*\n(.*)", text, re.DOTALL)+ if not match:+ return {}, text.strip()++ meta: Dict[str, Any] = {}+ for line in match.group(1).strip().split("\n"):+ line = line.strip()+ if ":" not in line:+ continue+ key, value = line.split(":", 1)+ key = key.strip()+ value = value.strip()+ if value.startswith("[") and value.endswith("]"):+ items = [item.strip().strip("'\"") for item in value[1:-1].split(",")]+ meta[key] = [i for i in items if i]+ elif value.lower() in ("true", "false"):+ meta[key] = value.lower() == "true"+ else:+ meta[key] = value++ return meta, match.group(2).strip()+++def _load_skill_dir(dir_path: Path) -> Optional[Skill]:+ """Load a skill from a directory.++ Args:+ dir_path: Skill directory path (must contain SKILL.md).++ Returns:+ Skill instance or None.+ """+ skill_file = dir_path / "SKILL.md"+ if not skill_file.exists():+ return None+ try:+ text = skill_file.read_text(encoding="utf-8")+ except Exception:+ return None++ meta, body = _parse_frontmatter(text)+ name = meta.get("name", dir_path.name)+ if not name:+ return None++ return Skill(+ name=name,+ description=meta.get("description", ""),+ body=body,+ dir_path=dir_path,+ metadata=meta,+ )+++class SkillsLoader:+ """Load skills from the skills/ directory.++ Attributes:+ skills: Loaded skill list.+ """++ def __init__(self, skills_dir: Optional[Path] = None) -> None:+ """Initialize SkillsLoader.++ Args:+ skills_dir: Skills directory path; defaults to agent/skills/.+ """+ self.skills_dir = skills_dir or Path(__file__).resolve().parents[1] / "skills"+ self.skills: List[Skill] = []+ self._load()++ def _load(self) -> None:+ """Load all skill subdirectories from the skills directory."""+ if not self.skills_dir.exists():+ return+ for path in sorted(self.skills_dir.iterdir()):+ if path.is_dir() and (path / "SKILL.md").exists():+ skill = _load_skill_dir(path)+ if skill:+ self.skills.append(skill)++ def get_descriptions(self) -> str:+ """Return a one-line summary of every skill for the system prompt (low token cost).++ Returns:+ One line per skill with name + description.+ """+ if not self.skills:+ return "(no skills)"+ lines = []+ for skill in self.skills:+ lines.append(f" - {skill.name}: {skill.description}")+ return "\n".join(lines)++ def get_content(self, name: str) -> str:+ """Return the full documentation for a skill (used by the load_skill tool).++ Args:+ name: Skill name.++ Returns:+ XML-wrapped full skill document, or an error message.+ """+ for skill in self.skills:+ if skill.name == name:+ return f'<skill name="{name}">\n{skill.body}\n</skill>'+ available = ", ".join(s.name for s in self.skills)+ return f"Error: Unknown skill '{name}'. Available: {available}"diff --git a/agent/src/agent/tools.py b/agent/src/agent/tools.pynew file mode 100644index 000000000..5611a5bba--- /dev/null+++ b/agent/src/agent/tools.py@@ -0,0 +1,81 @@+"""BaseTool + ToolRegistry: tool infrastructure."""++from __future__ import annotations++import json+import traceback+from abc import ABC, abstractmethod+from typing import Any, Dict, List, Optional+++class BaseTool(ABC):+ """Tool base class.++ Attributes:+ name: Unique tool identifier.+ description: Tool description shown to the LLM.+ parameters: Parameter definition in JSON Schema format.+ repeatable: Whether the tool may be called more than once.+ """++ name: str = ""+ description: str = ""+ parameters: Dict[str, Any] = {}+ repeatable: bool = False++ @abstractmethod+ def execute(self, **kwargs: Any) -> str:+ """Execute the tool and return a JSON string."""++ def to_openai_schema(self) -> Dict[str, Any]:+ """Convert to OpenAI function calling format."""+ return {+ "type": "function",+ "function": {+ "name": self.name,+ "description": self.description,+ "parameters": self.parameters or {"type": "object", "properties": {}, "required": []},+ },+ }+++class ToolRegistry:+ """Tool registry."""++ def __init__(self) -> None:+ self._tools: Dict[str, BaseTool] = {}++ def register(self, tool: BaseTool) -> None:+ """Register a tool."""+ self._tools[tool.name] = tool++ def get(self, name: str) -> Optional[BaseTool]:+ """Retrieve a tool by name."""+ return self._tools.get(name)++ def get_definitions(self) -> List[Dict[str, Any]]:+ """Return all tools in OpenAI function calling format."""+ return [t.to_openai_schema() for t in self._tools.values()]++ def execute(self, name: str, params: Dict[str, Any]) -> str:+ """Execute a tool and guarantee a valid JSON return value."""+ tool = self._tools.get(name)+ if not tool:+ return json.dumps({"status": "error", "error": f"Tool '{name}' not found"}, ensure_ascii=False)+ try:+ return tool.execute(**params)+ except Exception as exc:+ return json.dumps({+ "status": "error", "tool": name,+ "error": str(exc), "traceback": traceback.format_exc()[-500:],+ }, ensure_ascii=False)++ @property+ def tool_names(self) -> List[str]:+ return list(self._tools.keys())++ def __len__(self) -> int:+ return len(self._tools)++ def __contains__(self, name: str) -> bool:+ return name in self._toolsdiff --git a/agent/src/agent/trace.py b/agent/src/agent/trace.pynew file mode 100644index 000000000..52ac6d62b--- /dev/null+++ b/agent/src/agent/trace.py@@ -0,0 +1,66 @@+"""TraceWriter: crash-safe JSONL trace writer.++One JSON record per line; append + flush guarantees no data loss on crash.+"""++from __future__ import annotations++import json+import time+from pathlib import Path+from typing import Any, Dict, List, Optional+++class TraceWriter:+ """JSONL trace writer, one record per line, crash-safe.++ Attributes:+ path: Path to the trace.jsonl file.+ """++ def __init__(self, run_dir: Path) -> None:+ """Initialize TraceWriter.++ Args:+ run_dir: Run directory; trace.jsonl is written here.+ """+ self.path = run_dir / "trace.jsonl"+ self._file = open(self.path, "a", encoding="utf-8")++ def write(self, entry: Dict[str, Any]) -> None:+ """Write a trace record.++ Args:+ entry: Trace entry; a ts field is added automatically.+ """+ if "ts" not in entry:+ entry["ts"] = time.time()+ self._file.write(json.dumps(entry, ensure_ascii=False) + "\n")+ self._file.flush()++ def close(self) -> None:+ """Close the file handle."""+ self._file.close()++ @staticmethod+ def read(run_dir: Path) -> List[Dict[str, Any]]:+ """Read trace.jsonl and return records.++ Args:+ run_dir: Run directory.++ Returns:+ List of trace records.+ """+ path = run_dir / "trace.jsonl"+ if not path.exists():+ return []+ entries: List[Dict[str, Any]] = []+ for line in path.read_text(encoding="utf-8").splitlines():+ line = line.strip()+ if line:+ try:+ entries.append(json.loads(line))+ except json.JSONDecodeError:+ pass+ return entriesdiff --git a/agent/src/core/__init__.py b/agent/src/core/__init__.pynew file mode 100644index 000000000..4db58676e--- /dev/null+++ b/agent/src/core/__init__.py@@ -0,0 +1 @@+"""Core module: Runner + RunStateStore."""diff --git a/agent/src/core/runner.py b/agent/src/core/runner.pynew file mode 100644index 000000000..20bb6de49--- /dev/null+++ b/agent/src/core/runner.py@@ -0,0 +1,291 @@+"""Runner module for executing generated backtest code and collecting artifacts."""++from __future__ import annotations++import os+import subprocess+import sys+import time+from dataclasses import dataclass+from pathlib import Path+from typing import Any, Dict, Optional++from rich.console import Console+++console = Console()+++@dataclass+class RunResult:+ """Container for runner execution outputs.++ Attributes:+ success: Whether subprocess exited with code 0.+ exit_code: Subprocess return code.+ stdout: Captured stdout text.+ stderr: Captured stderr text.+ artifacts: Existing artifact file paths keyed by artifact name.+ """++ success: bool+ exit_code: int+ stdout: str+ stderr: str+ artifacts: dict[str, Path]+++_ARTIFACTS_SPEC = {+ "defaults": {"required": ["equity", "metrics", "trades"]},+ "schemas": {+ "equity_csv": {+ "columns": [+ {"name": "timestamp", "type": "string"},+ {"name": "ret", "type": "float"},+ {"name": "equity", "type": "float"},+ {"name": "drawdown", "type": "float"},+ ],+ },+ "metrics_csv": {+ "columns": [+ {"name": "final_value", "type": "float"},+ {"name": "total_return", "type": "float"},+ {"name": "annual_return", "type": "float"},+ {"name": "max_drawdown", "type": "float"},+ {"name": "sharpe", "type": "float"},+ {"name": "win_rate", "type": "float"},+ {"name": "trade_count", "type": "integer"},+ ],+ },+ "trade_log": {+ "columns": [+ {"name": "timestamp", "type": "string"},+ {"name": "code", "type": "string"},+ {"name": "side", "type": "string"},+ {"name": "price", "type": "float"},+ {"name": "qty", "type": "float"},+ {"name": "reason", "type": "string"},+ ],+ },+ },+ "artifacts": {+ "equity": {"schema": "equity_csv", "path": "artifacts/equity.csv"},+ "metrics": {"schema": "metrics_csv", "path": "artifacts/metrics.csv"},+ "trades": {"schema": "trade_log", "path": "artifacts/trades.csv"},+ "positions": {"schema": "positions_csv", "path": "artifacts/positions.csv"},+ },+}+++def _expand_artifacts_spec(spec: Dict[str, Any] | None) -> Dict[str, Dict[str, Any]]:+ """Expand artifacts_spec into a name -> metadata dict.++ Args:+ spec: Raw artifact spec.++ Returns:+ Expanded artifact metadata mapping.+ """+ if not isinstance(spec, dict):+ return {}+ schemas = spec.get("schemas") or {}+ artifacts = spec.get("artifacts") or {}+ defaults = spec.get("defaults") or {}+ required = set(defaults.get("required") or [])+ expanded: Dict[str, Dict[str, Any]] = {}+ for name, meta in artifacts.items():+ if not isinstance(meta, dict):+ continue+ schema_name = meta.get("schema")+ schema = schemas.get(schema_name, {}) if isinstance(schemas, dict) else {}+ expanded[name] = {+ "path": meta.get("path"),+ "required": bool(meta.get("required", name in required)),+ "columns": meta.get("columns") or schema.get("columns"),+ }+ return expanded+++class Runner:+ """Execute entry scripts inside a run directory and collect outputs."""++ _PROXY_ENV_KEYS = (+ "HTTP_PROXY",+ "HTTPS_PROXY",+ "ALL_PROXY",+ "http_proxy",+ "https_proxy",+ "all_proxy",+ "GIT_HTTP_PROXY",+ "GIT_HTTPS_PROXY",+ "git_http_proxy",+ "git_https_proxy",+ )++ def __init__(self, timeout: int = 300, artifacts_spec: Optional[Dict[str, Any]] = None) -> None:+ """Initialize runner.++ Args:+ timeout: Max subprocess runtime in seconds.+ artifacts_spec: Artifact spec from config.+ """++ self.timeout = timeout+ self.artifacts_spec = artifacts_spec or _ARTIFACTS_SPEC+ self.artifact_entries = _expand_artifacts_spec(self.artifacts_spec)++ def _python_ready(self, python_cmd: str) -> bool:+ """Check whether a Python interpreter can import runtime dependencies.++ Args:+ python_cmd: Interpreter executable path.++ Returns:+ True if required imports succeed, otherwise False.+ """++ try:+ probe = subprocess.run(+ [python_cmd, "-c", "import pandas,numpy; print('ok')"],+ stdout=subprocess.PIPE,+ stderr=subprocess.PIPE,+ text=True,+ timeout=20,+ )+ return probe.returncode == 0+ except Exception:+ return False++ def _pick_python_interpreter(self) -> str:+ """Pick the first usable interpreter for backtest execution.++ Returns:+ Interpreter command path.+ """++ project_root = Path(__file__).resolve().parents[2]+ candidates = [+ project_root / ".venv" / "Scripts" / "python.exe",+ project_root / ".venv" / "bin" / "python",+ Path(sys.executable),+ ]+ for path in candidates:+ if not path.exists():+ continue+ cmd = str(path)+ if self._python_ready(cmd):+ return cmd+ return sys.executable++ def _build_runtime_env(self, run_dir: Path, *, pythonpath_extra: Path | None = None) -> dict[str, str]:+ """Build subprocess env and enforce no-proxy execution.++ Args:+ run_dir: Current run directory.+ pythonpath_extra: Additional path to prepend to PYTHONPATH.++ Returns:+ Environment mapping for subprocess.+ """++ env = os.environ.copy()+ env.update(+ {+ "PYTHONUNBUFFERED": "1",+ "PYTHONIOENCODING": "utf-8",+ "PYTHONUTF8": "1",+ }+ )++ if pythonpath_extra:+ existing = env.get("PYTHONPATH", "")+ env["PYTHONPATH"] = str(pythonpath_extra) + (os.pathsep + existing if existing else "")++ runtime_home = run_dir / ".home"+ runtime_home.mkdir(parents=True, exist_ok=True)+ env["HOME"] = str(runtime_home)+ if os.name == "nt":+ env["USERPROFILE"] = str(runtime_home)++ # Preserve system proxy settings; data sources (OKX/yfinance) need network access++ return env++ def execute(+ self,+ entry_script: Path,+ run_dir: Path,+ *,+ cwd: Path | None = None,+ cli_args: list[str] | None = None,+ ) -> RunResult:+ """Run entry script and collect logs and artifacts.++ Args:+ entry_script: Entry script path.+ run_dir: Current run directory.+ cwd: Working directory for subprocess (default: entry_script.parent).+ cli_args: Additional CLI arguments appended to subprocess command.++ Returns:+ RunResult object with process output and discovered artifacts.+ """++ console.print(f"[blue]Runner: executing {entry_script}[/blue]")+ stdout_path = run_dir / "logs" / "runner_stdout.txt"+ stderr_path = run_dir / "logs" / "runner_stderr.txt"+ stdout_path.parent.mkdir(parents=True, exist_ok=True)++ start_time = time.time()+ console.print("[dim]Runner: starting backtest subprocess...[/dim]")++ effective_cwd = cwd or entry_script.parent+ pythonpath_extra = cwd if cwd else None+ env = self._build_runtime_env(run_dir, pythonpath_extra=pythonpath_extra)+ python_cmd = self._pick_python_interpreter()+ console.print(f"[dim]Runner: using Python: {python_cmd}[/dim]")++ cmd = [python_cmd, str(entry_script)]+ if cli_args:+ cmd.extend(cli_args)++ process = subprocess.run(+ cmd,+ cwd=str(effective_cwd),+ stdout=subprocess.PIPE,+ stderr=subprocess.PIPE,+ text=True,+ timeout=self.timeout,+ env=env,+ encoding="utf-8",+ errors="ignore",+ )++ elapsed = time.time() - start_time+ console.print(f"[blue]Runner: subprocess finished in {elapsed:.2f}s[/blue]")++ stdout_path.write_text(process.stdout, encoding="utf-8")+ stderr_path.write_text(process.stderr, encoding="utf-8")++ if process.stdout:+ console.print(f"[dim]Runner stdout:[/dim]\n{process.stdout}")+ if process.stderr:+ console.print(f"[red]Runner stderr:[/red]\n{process.stderr}")++ artifacts: dict[str, Path] = {}+ for name, info in self.artifact_entries.items():+ rel_path = info.get("path")+ if not isinstance(rel_path, str) or not rel_path.strip():+ continue+ target = run_dir / Path(rel_path)+ if target.exists():+ artifacts[name] = target++ success = process.returncode == 0+ return RunResult(+ success=success,+ exit_code=process.returncode,+ stdout=process.stdout,+ stderr=process.stderr,+ artifacts=artifacts,+ )diff --git a/agent/src/core/state.py b/agent/src/core/state.pynew file mode 100644index 000000000..28c4d4335--- /dev/null+++ b/agent/src/core/state.py@@ -0,0 +1,171 @@+"""Run state persistence: lightweight, no dependency on legacy agent types."""++from __future__ import annotations++import copy+import json+import uuid+from datetime import datetime+from pathlib import Path+from typing import Any, Dict, List, Optional++import yaml+++class RunStateStore:+ """Run state store: records key files such as req/design/code/logs/review."""++ def create_run_dir(self, workspace: Path) -> Path:+ """Create a unique run directory.++ Args:+ workspace: Parent directory (typically runs/).++ Returns:+ Newly created run directory path.+ """+ timestamp = datetime.now().strftime("%Y%m%d_%H%M%S_%f")[:18]+ suffix = uuid.uuid4().hex[:6]+ run_dir = workspace / f"{timestamp}_{suffix}"+ run_dir.mkdir(parents=True, exist_ok=True)+ (run_dir / "code").mkdir(exist_ok=True)+ (run_dir / "logs").mkdir(exist_ok=True)+ (run_dir / "artifacts").mkdir(exist_ok=True)+ return run_dir++ def save_request(self, run_dir: Path, prompt: str, context: Dict[str, Any]) -> Dict[str, Any]:+ """Save the user request.++ Args:+ run_dir: Run directory.+ prompt: User prompt.+ context: Context metadata.++ Returns:+ Saved payload.+ """+ payload = {"prompt": prompt, "context": context}+ self._write_json(run_dir / "req.json", payload)+ return payload++ def save_planner_output(self, run_dir: Path, planner_output: Dict[str, Any]) -> Dict[str, Any]:+ """Save planner output.++ Args:+ run_dir: Run directory.+ planner_output: Planner output dict.++ Returns:+ Saved payload.+ """+ self._write_json(run_dir / "planner_output.json", planner_output)+ return planner_output++ def save_design(self, run_dir: Path, spec: Dict[str, Any], decision: Dict[str, Any]) -> None:+ """Save design spec and judge decision.++ Args:+ run_dir: Run directory.+ spec: Strategy design spec.+ decision: Judge decision result.+ """+ self._write_json(run_dir / "design_spec.json", spec)+ self._write_json(run_dir / "judge_decision.json", decision)++ def save_rag_spec(+ self,+ run_dir: Path,+ selection: Dict[str, Any],+ spec: Dict[str, Any],+ *,+ candidates: Optional[List[Dict[str, Any]]] = None,+ ) -> None:+ """Save RAG results.++ Args:+ run_dir: Run directory.+ selection: Selected API metadata.+ spec: Enriched data API spec.+ candidates: Candidate API list.+ """+ enriched_spec = copy.deepcopy(spec) if spec else {}+ enriched_spec["_rag_metadata"] = selection+ spec_yaml = yaml.safe_dump(enriched_spec, allow_unicode=True, sort_keys=False)+ (run_dir / "data_api_spec.yaml").write_text(spec_yaml, encoding="utf-8")+ self._write_json(run_dir / "rag_metadata.json", selection)+ if candidates:+ candidate_yaml = yaml.safe_dump(+ {"generated_at": datetime.now().isoformat(), "candidates": candidates},+ allow_unicode=True,+ sort_keys=False,+ )+ (run_dir / "rag_candidates.yaml").write_text(candidate_yaml, encoding="utf-8")++ def mark_success(self, run_dir: Path) -> None:+ """Mark the run as successful.++ Args:+ run_dir: Run directory.+ """+ self._write_json(run_dir / "state.json", {"status": "success"})++ def mark_failure(self, run_dir: Path, reason: str) -> None:+ """Mark the run as failed.++ Args:+ run_dir: Run directory.+ reason: Failure reason.+ """+ self._write_json(run_dir / "state.json", {"status": "failed", "reason": reason})++ # -----------------------------------------------------------------------+ # Generic persistence: extract and save key artifacts by tool name+ # -----------------------------------------------------------------------++ _PERSIST_MAP: Dict[str, str] = {+ "plan": "_persist_plan",+ "search": "_persist_search",+ "resolve": "_persist_resolve",+ "design": "_persist_design",+ }++ def persist_tool_result(self, tool_name: str, result_data: Dict[str, Any], run_dir: Path) -> None:+ """Persist key artifacts by tool name.++ Args:+ tool_name: Tool name.+ result_data: Parsed tool result dict.+ run_dir: Run directory.+ """+ method_name = self._PERSIST_MAP.get(tool_name)+ if method_name:+ method = getattr(self, method_name, None)+ if method:+ try:+ method(result_data, run_dir)+ except Exception:+ pass++ def _persist_plan(self, data: Dict[str, Any], run_dir: Path) -> None:+ if data and "error" not in data:+ self.save_planner_output(run_dir, data)++ def _persist_search(self, data: Dict[str, Any], run_dir: Path) -> None:+ if data.get("selections"):+ sel = data["selections"][0] if data["selections"] else {}+ spec = data.get("data_api_spec") or {}+ self.save_rag_spec(run_dir, sel, spec, candidates=data.get("candidates"))++ def _persist_resolve(self, data: Dict[str, Any], run_dir: Path) -> None:+ if data and data.get("status") == "ok":+ self._write_json(run_dir / "data_config.json", data)++ def _persist_design(self, data: Dict[str, Any], run_dir: Path) -> None:+ spec = data.get("spec") or {}+ decision = data.get("judge_decision") or {}+ if spec:+ self.save_design(run_dir, spec, decision)++ @staticmethod+ def _write_json(path: Path, data: Any) -> None:+ path.write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")diff --git a/agent/src/providers/__init__.py b/agent/src/providers/__init__.pynew file mode 100644index 000000000..c70aa14ba--- /dev/null+++ b/agent/src/providers/__init__.py@@ -0,0 +1,5 @@+"""LLM provider abstraction layer."""++from src.providers.llm import build_llm++__all__ = ["build_llm"]diff --git a/agent/src/providers/chat.py b/agent/src/providers/chat.pynew file mode 100644index 000000000..e4c45b669--- /dev/null+++ b/agent/src/providers/chat.py@@ -0,0 +1,154 @@+"""ChatLLM: raw LLM message interface with function calling support.++ChatLLM is designed specifically for the AgentLoop ReAct cycle.+"""++from __future__ import annotations++from dataclasses import dataclass, field+from typing import Any, Dict, List, Optional++from src.providers.llm import build_llm+++@dataclass+class ToolCallRequest:+ """Tool call request returned by the LLM.++ Attributes:+ id: Tool call ID (used to match tool_result messages).+ name: Tool name.+ arguments: Tool argument dict.+ """++ id: str+ name: str+ arguments: Dict[str, Any]+++@dataclass+class LLMResponse:+ """LLM response.++ Attributes:+ content: Text content (final answer or thinking text).+ tool_calls: List of tool call requests.+ finish_reason: Finish reason string.+ """++ content: Optional[str] = None+ tool_calls: List[ToolCallRequest] = field(default_factory=list)+ finish_reason: str = "stop"++ @property+ def has_tool_calls(self) -> bool:+ """Return True if the response contains tool calls."""+ return len(self.tool_calls) > 0+++class ChatLLM:+ """LLM chat client with function calling support.++ Uses build_llm() to obtain a ChatOpenAI instance and bind_tools() to attach tool definitions.++ Attributes:+ model_name: Model name.+ """++ def __init__(self, model_name: Optional[str] = None) -> None:+ """Initialize ChatLLM.++ Args:+ model_name: Model name; defaults to the environment variable value.+ """+ self.model_name = model_name+ self._llm = build_llm(model_name=model_name)++ def chat(self, messages: List[Dict[str, Any]], tools: Optional[List[Dict[str, Any]]] = None, timeout: Optional[int] = None) -> LLMResponse:+ """Call the LLM synchronously.++ Args:+ messages: Message list (OpenAI format).+ tools: Tool definition list (OpenAI function calling format).+ timeout: Optional per-call timeout in seconds.++ Returns:+ LLMResponse.+ """+ llm = self._llm.bind_tools(tools) if tools else self._llm+ config = {"timeout": timeout} if timeout else {}+ ai_message = llm.invoke(messages, config=config)+ return self._parse_response(ai_message)++ def stream_chat(+ self,+ messages: List[Dict[str, Any]],+ tools: Optional[List[Dict[str, Any]]] = None,+ on_text_chunk: Optional[Any] = None,+ timeout: Optional[int] = None,+ ) -> LLMResponse:+ """Stream the LLM and optionally forward text deltas (e.g. thinking).++ Iterates AIMessageChunk; each text delta invokes ``on_text_chunk``.+ Aggregates chunks into one response; on failure falls back to ``chat()``.++ Args:+ messages: Messages in OpenAI format.+ tools: Tool definitions for function calling.+ on_text_chunk: Optional callback ``(delta: str) -> None``.+ timeout: Optional per-call timeout in seconds.++ Returns:+ Parsed ``LLMResponse``.+ """+ try:+ llm = self._llm.bind_tools(tools) if tools else self._llm+ config = {"timeout": timeout} if timeout else {}+ accumulated = None+ for chunk in llm.stream(messages, config=config):+ if chunk.content and on_text_chunk:+ on_text_chunk(chunk.content)+ accumulated = chunk if accumulated is None else accumulated + chunk+ if accumulated is None:+ return LLMResponse(content="", tool_calls=[], finish_reason="stop")+ return self._parse_response(accumulated)+ except Exception:+ return self.chat(messages, tools=tools, timeout=timeout)++ async def achat(self, messages: List[Dict[str, Any]], tools: Optional[List[Dict[str, Any]]] = None, timeout: Optional[int] = None) -> LLMResponse:+ """Async LLM invocation.++ Args:+ messages: Messages in OpenAI format.+ tools: Tool definitions (OpenAI function-calling format).+ timeout: Optional per-call timeout in seconds.++ Returns:+ ``LLMResponse``.+ """+ llm = self._llm.bind_tools(tools) if tools else self._llm+ config = {"timeout": timeout} if timeout else {}+ ai_message = await llm.ainvoke(messages, config=config)+ return self._parse_response(ai_message)++ @staticmethod+ def _parse_response(ai_message: Any) -> LLMResponse:+ """Convert a LangChain AIMessage to ``LLMResponse``.++ Args:+ ai_message: LangChain AIMessage instance.++ Returns:+ ``LLMResponse``.+ """+ content = ai_message.content if hasattr(ai_message, "content") else None+ raw_calls = getattr(ai_message, "tool_calls", None) or []+ tool_calls = []+ for tc in raw_calls:+ tool_calls.append(ToolCallRequest(+ id=tc.get("id", ""),+ name=tc.get("name", ""),+ arguments=tc.get("args", {}),+ ))+ finish = getattr(ai_message, "response_metadata", {}).get("finish_reason", "stop")+ return LLMResponse(content=content, tool_calls=tool_calls, finish_reason=finish)diff --git a/agent/src/providers/llm.py b/agent/src/providers/llm.pynew file mode 100644index 000000000..725f71a9a--- /dev/null+++ b/agent/src/providers/llm.py@@ -0,0 +1,148 @@+"""LLM factory and JSON extraction helpers."""++from __future__ import annotations++import json+import os+from pathlib import Path+from typing import Any, Dict, Optional++try:+ from dotenv import load_dotenv+except ImportError:+ load_dotenv = None # type: ignore++try:+ from langchain_openai import ChatOpenAI+except ImportError:+ ChatOpenAI = None # type: ignore++AGENT_DIR = Path(__file__).resolve().parents[2]++# .env search order: ~/.vibe-trading/.env โ agent/.env โ $CWD/.env+_ENV_CANDIDATES = [+ Path.home() / ".vibe-trading" / ".env",+ AGENT_DIR / ".env",+ Path.cwd() / ".env",+]++_dotenv_loaded: bool = False+++def _load_env_file(path: Path) -> None:+ """Load a single .env file into os.environ (setdefault, no override)."""+ if load_dotenv is not None:+ load_dotenv(dotenv_path=path, override=False)+ else:+ for raw in path.read_text(encoding="utf-8").splitlines():+ line = raw.strip()+ if not line or line.startswith("#") or "=" not in line:+ continue+ key, value = line.split("=", 1)+ key = key.strip()+ if key:+ os.environ.setdefault(key, value.strip().strip('"').strip("'"))+++def _ensure_dotenv() -> None:+ """Load `.env` from the first found candidate path."""+ global _dotenv_loaded+ if _dotenv_loaded:+ return+ for candidate in _ENV_CANDIDATES:+ if candidate.exists():+ _load_env_file(candidate)+ break+ _dotenv_loaded = True+++def _sync_provider_env() -> None:+ """Map provider-specific env vars to OPENAI_* for ChatOpenAI."""+ _ensure_dotenv()+ provider = os.getenv("LANGCHAIN_PROVIDER", "openai").lower()+ provider_env = {+ "openai": ("OPENAI_API_KEY", "OPENAI_API_BASE"),+ "openrouter": ("OPENAI_API_KEY", "OPENAI_API_BASE"),+ "deepseek": ("DEEPSEEK_API_KEY", "DEEPSEEK_BASE_URL"),+ "qwen": ("QWEN_API_KEY", "QWEN_BASE_URL"),+ }+ key_env, base_env = provider_env.get(provider, provider_env["openai"])+ api_key = os.getenv(key_env) or os.getenv("OPENAI_API_KEY", "")+ base_url = os.getenv(base_env, "") or os.getenv("OPENAI_API_BASE", "") or os.getenv("OPENAI_BASE_URL", "")+ if api_key:+ os.environ["OPENAI_API_KEY"] = api_key+ if base_url:+ os.environ["OPENAI_API_BASE"] = base_url+ os.environ.setdefault("OPENAI_BASE_URL", base_url)+++def build_llm(*, model_name: Optional[str] = None, callbacks: Any = None) -> Any:+ """Construct a ChatOpenAI instance.++ Args:+ model_name: Model name; defaults to LANGCHAIN_MODEL_NAME.+ callbacks: Optional LangChain callbacks.++ Returns:+ ChatOpenAI instance.++ Raises:+ RuntimeError: If langchain-openai is missing or LANGCHAIN_MODEL_NAME is unset.+ """+ if ChatOpenAI is None:+ raise RuntimeError("langchain-openai is not installed")+ _sync_provider_env()+ name = model_name or os.getenv("LANGCHAIN_MODEL_NAME", "").strip()+ if not name:+ raise RuntimeError("LANGCHAIN_MODEL_NAME is not set")+ temperature = float(os.getenv("LANGCHAIN_TEMPERATURE", "0.0"))+ timeout = int(os.getenv("TIMEOUT_SECONDS", "600"))+ max_retries = int(os.getenv("MAX_RETRIES", "3"))+ return ChatOpenAI(+ model=name,+ temperature=temperature,+ timeout=timeout,+ max_retries=max_retries,+ callbacks=callbacks,+ )+++def _extract_balanced_json(text: str) -> Optional[Dict[str, Any]]:+ """Extract the outermost JSON object from text using bracket balancing.++ Args:+ text: Text that may embed a JSON object.++ Returns:+ Parsed dict, or None on failure.+ """+ start = -1+ depth = 0+ in_string = False+ escape = False++ for i, ch in enumerate(text):+ if escape:+ escape = False+ continue+ if ch == "\\" and in_string:+ escape = True+ continue+ if ch == '"':+ in_string = not in_string+ continue+ if in_string:+ continue+ if ch == "{":+ if depth == 0:+ start = i+ depth += 1+ elif ch == "}":+ depth -= 1+ if depth == 0 and start >= 0:+ candidate = text[start : i + 1]+ try:+ return json.loads(candidate)+ except json.JSONDecodeError:+ start = -1+ return Nonediff --git a/agent/src/session/__init__.py b/agent/src/session/__init__.pynew file mode 100644index 000000000..1d701a012--- /dev/null+++ b/agent/src/session/__init__.py@@ -0,0 +1,18 @@+"""Session management package for conversations, persistence, and SSE streams."""++from src.session.models import Session, Message, Attempt, SessionStatus, AttemptStatus+from src.session.store import SessionStore+from src.session.events import EventBus, SSEEvent+from src.session.service import SessionService++__all__ = [+ "Session",+ "Message",+ "Attempt",+ "SessionStatus",+ "AttemptStatus",+ "SessionStore",+ "EventBus",+ "SSEEvent",+ "SessionService",+]diff --git a/agent/src/session/events.py b/agent/src/session/events.pynew file mode 100644index 000000000..1d6393a26--- /dev/null+++ b/agent/src/session/events.py@@ -0,0 +1,221 @@+"""SSE event bus with support for last_event_id recovery and buffering.++V5: Fixes the thread-safety issue caused by calling queue.put_nowait() on asyncio.Queue from a background thread.+"""++from __future__ import annotations++import asyncio+import json+import logging+import threading+import time+import uuid++logger = logging.getLogger(__name__)+from dataclasses import dataclass, field+from typing import Any, AsyncIterator, Dict, List, Optional+++@dataclass+class SSEEvent:+ """Server-sent event.++ Attributes:+ event_id: Globally unique event ID used for last_event_id recovery.+ event_type: Event type stored in the SSE ``event`` field.+ data: Event payload.+ session_id: Owning session ID.+ timestamp: Event timestamp.+ """++ event_id: str = field(default_factory=lambda: uuid.uuid4().hex[:16])+ event_type: str = "message"+ data: Dict[str, Any] = field(default_factory=dict)+ session_id: str = ""+ timestamp: float = field(default_factory=time.time)++ def to_sse(self) -> str:+ """Format the event as an SSE text frame.++ Returns:+ Text that conforms to the SSE specification.+ """+ payload = json.dumps(self.data, ensure_ascii=False)+ lines = [+ f"id: {self.event_id}",+ f"event: {self.event_type}",+ f"data: {payload}",+ "",+ "",+ ]+ return "\n".join(lines)+++class EventBus:+ """Session-scoped event bus with subscribers and buffered events.++ V5: Inject the asyncio event loop with ``set_loop()``, and use+ ``call_soon_threadsafe`` in ``publish()`` to preserve thread safety.++ Attributes:+ max_buffer_size: Maximum number of buffered events per session.+ """++ def __init__(self, max_buffer_size: int = 500) -> None:+ """Initialize the event bus.++ Args:+ max_buffer_size: Maximum number of buffered events per session.+ """+ self.max_buffer_size = max_buffer_size+ self._buffers: Dict[str, List[SSEEvent]] = {}+ self._subscribers: Dict[str, List[asyncio.Queue]] = {}+ self._lock = threading.Lock()+ self._loop: Optional[asyncio.AbstractEventLoop] = None++ def set_loop(self, loop: asyncio.AbstractEventLoop) -> None:+ """Set the asyncio event loop, usually during api_server startup.++ Args:+ loop: asyncio event loop.+ """+ self._loop = loop++ def publish(self, event: SSEEvent) -> None:+ """Publish an event to a session channel in a thread-safe way.++ Args:+ event: Event to publish.+ """+ session_id = event.session_id+ with self._lock:+ if session_id not in self._buffers:+ self._buffers[session_id] = []+ buffer = self._buffers[session_id]+ buffer.append(event)+ if len(buffer) > self.max_buffer_size:+ self._buffers[session_id] = buffer[-self.max_buffer_size:]++ queues = list(self._subscribers.get(session_id, []))++ # Safely enqueue onto the queue from inside the asyncio loop.+ for queue in queues:+ if self._loop and self._loop.is_running():+ self._loop.call_soon_threadsafe(self._safe_put, queue, event)+ else:+ try:+ queue.put_nowait(event)+ except asyncio.QueueFull:+ pass++ @staticmethod+ def _safe_put(queue: asyncio.Queue, event: SSEEvent) -> None:+ """Safely put an event onto a queue.++ Args:+ queue: asyncio queue.+ event: SSE event.+ """+ try:+ queue.put_nowait(event)+ except asyncio.QueueFull:+ logger.warning("EventBus queue full, dropping %s event for session %s", event.event_type, event.session_id)++ def emit(+ self,+ session_id: str,+ event_type: str,+ data: Optional[Dict[str, Any]] = None,+ ) -> SSEEvent:+ """Build and publish an event in one step.++ Args:+ session_id: Session ID.+ event_type: Event type.+ data: Event payload.++ Returns:+ The published SSEEvent.+ """+ event = SSEEvent(+ event_type=event_type,+ data=data or {},+ session_id=session_id,+ )+ self.publish(event)+ return event++ def replay(self, session_id: str, last_event_id: Optional[str] = None) -> List[SSEEvent]:+ """Replay buffered session events for reconnect recovery.++ Args:+ session_id: Session ID.+ last_event_id: Last event ID received by the client.++ Returns:+ List of events that should be replayed.+ """+ if not last_event_id:+ return [] # First connect: history loaded via REST, no replay needed+ with self._lock:+ buffer = self._buffers.get(session_id, [])+ found = False+ result: List[SSEEvent] = []+ for event in buffer:+ if found:+ result.append(event)+ elif event.event_id == last_event_id:+ found = True+ return result++ async def subscribe(+ self,+ session_id: str,+ last_event_id: Optional[str] = None,+ ) -> AsyncIterator[SSEEvent]:+ """Subscribe to a session event stream asynchronously.++ Args:+ session_id: Session ID.+ last_event_id: Last event ID received by the client for reconnect recovery.++ Yields:+ SSEEvent objects.+ """+ queue: asyncio.Queue[SSEEvent] = asyncio.Queue(maxsize=200)++ with self._lock:+ if session_id not in self._subscribers:+ self._subscribers[session_id] = []+ self._subscribers[session_id].append(queue)++ try:+ replay_events = self.replay(session_id, last_event_id)+ for event in replay_events:+ yield event++ while True:+ try:+ event = await asyncio.wait_for(queue.get(), timeout=30.0)+ yield event+ except asyncio.TimeoutError:+ yield SSEEvent(+ event_type="heartbeat",+ data={"ts": time.time()},+ session_id=session_id,+ )+ finally:+ with self._lock:+ subs = self._subscribers.get(session_id, [])+ if queue in subs:+ subs.remove(queue)++ def clear(self, session_id: str) -> None:+ """Clear the buffered events for a session.++ Args:+ session_id: Session ID.+ """+ with self._lock:+ self._buffers.pop(session_id, None)diff --git a/agent/src/session/models.py b/agent/src/session/models.pynew file mode 100644index 000000000..361be1f6d--- /dev/null+++ b/agent/src/session/models.py@@ -0,0 +1,207 @@+"""Session data models for the core Session, Message, and Attempt entities."""++from __future__ import annotations++import uuid+from dataclasses import dataclass, field, asdict+from datetime import datetime+from enum import Enum+from typing import Any, Dict, List, Optional+++class SessionStatus(str, Enum):+ """Session lifecycle states."""++ ACTIVE = "active"+ COMPLETED = "completed"+ ARCHIVED = "archived"+++class AttemptStatus(str, Enum):+ """Statuses for a single execution attempt."""++ PENDING = "pending"+ RUNNING = "running"+ WAITING_USER = "waiting_user"+ COMPLETED = "completed"+ FAILED = "failed"+ CANCELLED = "cancelled"+++@dataclass+class Session:+ """A multi-turn conversation session.++ Attributes:+ session_id: Unique identifier.+ title: User-visible session title.+ status: Session status.+ created_at: Creation time in ISO format.+ updated_at: Last update time in ISO format.+ last_attempt_id: ID of the most recent Attempt.+ config: Session-level configuration such as model overrides or strategy parameters.+ """++ session_id: str = field(default_factory=lambda: uuid.uuid4().hex[:12])+ title: str = ""+ status: SessionStatus = SessionStatus.ACTIVE+ created_at: str = field(default_factory=lambda: datetime.now().isoformat())+ updated_at: str = field(default_factory=lambda: datetime.now().isoformat())+ last_attempt_id: Optional[str] = None+ config: Dict[str, Any] = field(default_factory=dict)++ def to_dict(self) -> Dict[str, Any]:+ """Serialize the session to a dictionary.++ Returns:+ A JSON-serializable dictionary.+ """+ data = asdict(self)+ data["status"] = self.status.value+ return data++ @classmethod+ def from_dict(cls, data: Dict[str, Any]) -> Session:+ """Deserialize a session from a dictionary.++ Args:+ data: Dictionary produced from parsed JSON.++ Returns:+ A Session instance.+ """+ data = dict(data)+ if "status" in data:+ data["status"] = SessionStatus(data["status"])+ return cls(**data)+++@dataclass+class Message:+ """A session message such as user input or system output.++ Attributes:+ message_id: Unique identifier.+ session_id: Owning session ID.+ role: Message role: user / assistant / system.+ content: Message text content.+ created_at: Creation time in ISO format.+ linked_attempt_id: Related Attempt ID, if any.+ metadata: Additional metadata.+ """++ message_id: str = field(default_factory=lambda: uuid.uuid4().hex[:12])+ session_id: str = ""+ role: str = "user"+ content: str = ""+ created_at: str = field(default_factory=lambda: datetime.now().isoformat())+ linked_attempt_id: Optional[str] = None+ metadata: Dict[str, Any] = field(default_factory=dict)++ def to_dict(self) -> Dict[str, Any]:+ """Serialize the message to a dictionary.++ Returns:+ A JSON-serializable dictionary.+ """+ return asdict(self)++ @classmethod+ def from_dict(cls, data: Dict[str, Any]) -> Message:+ """Deserialize a message from a dictionary.++ Args:+ data: Dictionary produced from parsed JSON.++ Returns:+ A Message instance.+ """+ return cls(**data)+++@dataclass+class Attempt:+ """A strategy execution attempt corresponding to one pipeline run.++ Attributes:+ attempt_id: Unique identifier.+ session_id: Owning session ID.+ parent_attempt_id: Parent Attempt ID for follow-up modification scenarios.+ status: Execution status.+ prompt: User input that triggered this execution.+ run_dir: Run directory path.+ summary: Execution summary.+ react_trace: ReAct agent trace records.+ created_at: Creation time in ISO format.+ completed_at: Completion time in ISO format, if available.+ error: Error message when the attempt fails.+ metrics: Snapshot of backtest metrics.+ """++ attempt_id: str = field(default_factory=lambda: uuid.uuid4().hex[:12])+ session_id: str = ""+ parent_attempt_id: Optional[str] = None+ status: AttemptStatus = AttemptStatus.PENDING+ prompt: str = ""+ run_dir: Optional[str] = None+ summary: Optional[str] = None+ react_trace: List[Dict[str, Any]] = field(default_factory=list)+ created_at: str = field(default_factory=lambda: datetime.now().isoformat())+ completed_at: Optional[str] = None+ error: Optional[str] = None+ metrics: Optional[Dict[str, Any]] = None++ def to_dict(self) -> Dict[str, Any]:+ """Serialize the attempt to a dictionary.++ Returns:+ A JSON-serializable dictionary.+ """+ data = asdict(self)+ data["status"] = self.status.value+ return data++ @classmethod+ def from_dict(cls, data: Dict[str, Any]) -> Attempt:+ """Deserialize an attempt from a dictionary.++ Args:+ data: Dictionary produced from parsed JSON.++ Returns:+ An Attempt instance.+ """+ data = dict(data)+ if "status" in data:+ data["status"] = AttemptStatus(data["status"])+ return cls(**data)++ def mark_running(self) -> None:+ """Mark the attempt as running."""+ self.status = AttemptStatus.RUNNING+ self.completed_at = None++ def mark_completed(self, summary: Optional[str] = None) -> None:+ """Mark the attempt as completed.++ Args:+ summary: Execution summary.+ """+ self.status = AttemptStatus.COMPLETED+ self.completed_at = datetime.now().isoformat()+ if summary:+ self.summary = summary++ def mark_failed(self, error: str) -> None:+ """Mark the attempt as failed.++ Args:+ error: Error message.+ """+ self.status = AttemptStatus.FAILED+ self.completed_at = datetime.now().isoformat()+ self.error = error++ def mark_waiting_user(self) -> None:+ """Mark the attempt as waiting for user input."""+ self.status = AttemptStatus.WAITING_USERdiff --git a/agent/src/session/service.py b/agent/src/session/service.pynew file mode 100644index 000000000..eefdb97ee--- /dev/null+++ b/agent/src/session/service.py@@ -0,0 +1,338 @@+"""Session lifecycle orchestration for message flow, attempt creation, and execution scheduling.++V5: Uses AgentLoop instead of the fixed pipeline behind the generate skill.+"""++from __future__ import annotations++import asyncio+import concurrent.futures+from datetime import datetime+from pathlib import Path+from typing import Any, Dict, Optional++# Dedicated thread pool limited to four concurrent agents to avoid exhausting the default executor.+_AGENT_EXECUTOR = concurrent.futures.ThreadPoolExecutor(max_workers=4, thread_name_prefix="agent")++from src.session.events import EventBus+from src.session.models import (+ Attempt,+ AttemptStatus,+ Message,+ Session,+)+from src.session.store import SessionStore+++class SessionService:+ """Session lifecycle service.++ Attributes:+ store: Session persistence store.+ event_bus: SSE event bus.+ runs_dir: Root runs directory.+ """++ def __init__(+ self,+ store: SessionStore,+ event_bus: EventBus,+ runs_dir: Path,+ ) -> None:+ """Initialize the session service.++ Args:+ store: Session persistence store.+ event_bus: SSE event bus.+ runs_dir: Root runs directory.+ """+ self.store = store+ self.event_bus = event_bus+ self.runs_dir = runs_dir+ self._active_loops: Dict[str, "AgentLoop"] = {}++ def create_session(self, title: str = "", config: Optional[Dict[str, Any]] = None) -> Session:+ """Create a new session.++ Args:+ title: Session title.+ config: Session configuration.++ Returns:+ The newly created Session.+ """+ session = Session(title=title, config=config or {})+ self.store.create_session(session)+ self.event_bus.emit(session.session_id, "session.created", {"session_id": session.session_id, "title": title})+ return session++ def get_session(self, session_id: str) -> Optional[Session]:+ """Return a session by ID."""+ return self.store.get_session(session_id)++ def list_sessions(self, limit: int = 50) -> list[Session]:+ """List all sessions."""+ return self.store.list_sessions(limit)++ def delete_session(self, session_id: str) -> bool:+ """Delete a session."""+ self.event_bus.clear(session_id)+ return self.store.delete_session(session_id)++ async def send_message(self, session_id: str, content: str, role: str = "user") -> Dict[str, Any]:+ """Send a message to a session and trigger execution.++ Args:+ session_id: Session ID.+ content: Message content.+ role: Message role.++ Returns:+ Dictionary containing message_id and attempt_id.+ """+ session = self.store.get_session(session_id)+ if not session:+ raise ValueError(f"Session {session_id} not found")++ message = Message(session_id=session_id, role=role, content=content)+ self.store.append_message(message)+ self.event_bus.emit(session_id, "message.received", {"message_id": message.message_id, "role": role, "content": content})++ if role != "user":+ return {"message_id": message.message_id}++ attempt = Attempt(session_id=session_id, parent_attempt_id=session.last_attempt_id, prompt=content)+ self.store.create_attempt(attempt)+ session.last_attempt_id = attempt.attempt_id+ session.updated_at = datetime.now().isoformat()+ self.store.update_session(session)+ self.event_bus.emit(session_id, "attempt.created", {"attempt_id": attempt.attempt_id, "prompt": content})++ asyncio.create_task(self._run_attempt(session, attempt))+ return {"message_id": message.message_id, "attempt_id": attempt.attempt_id}++ async def resume_attempt(self, session_id: str, attempt_id: str, user_input: str) -> Dict[str, Any]:+ """Resume an attempt that is waiting for user input.++ Args:+ session_id: Session ID.+ attempt_id: Attempt ID.+ user_input: User reply content.++ Returns:+ Dictionary containing status and attempt_id.+ """+ session = self.store.get_session(session_id)+ if not session:+ raise ValueError(f"Session {session_id} not found")+ attempt = self.store.get_attempt(session_id, attempt_id)+ if not attempt:+ raise ValueError(f"Attempt {attempt_id} not found")+ if attempt.status != AttemptStatus.WAITING_USER:+ raise ValueError(f"Attempt {attempt_id} is not waiting for user input")++ message = Message(session_id=session_id, role="user", content=user_input, linked_attempt_id=attempt_id)+ self.store.append_message(message)++ # Append the user's reply to the prompt and rerun the attempt.+ attempt.prompt = f"{attempt.prompt}\n\nUser reply: {user_input}"+ attempt.status = AttemptStatus.RUNNING+ self.store.update_attempt(attempt)+ self.event_bus.emit(session_id, "attempt.resumed", {"attempt_id": attempt_id, "user_input": user_input})++ asyncio.create_task(self._run_attempt(session, attempt))+ return {"status": "resumed", "attempt_id": attempt_id}++ def get_messages(self, session_id: str, limit: int = 100) -> list[Message]:+ """Return the message history."""+ return self.store.get_messages(session_id, limit)++ def get_attempts(self, session_id: str) -> list[Attempt]:+ """Return all execution attempts."""+ return self.store.list_attempts(session_id)++ def get_attempt(self, session_id: str, attempt_id: str) -> Optional[Attempt]:+ """Return a single execution attempt."""+ return self.store.get_attempt(session_id, attempt_id)++ def cancel_current(self, session_id: str) -> bool:+ """Cancel the currently running AgentLoop for a session.++ Args:+ session_id: Session ID.++ Returns:+ Whether cancellation succeeded. True means an active loop existed and received a cancel signal.+ """+ loop = self._active_loops.get(session_id)+ if loop is None:+ return False+ loop.cancel()+ return True++ async def _run_attempt(self, session: Session, attempt: Attempt) -> None:+ """Execute an Attempt in the background."""+ attempt.mark_running()+ self.store.update_attempt(attempt)+ self.event_bus.emit(session.session_id, "attempt.started", {"attempt_id": attempt.attempt_id})++ try:+ messages = self.store.get_messages(session.session_id)+ result = await self._run_with_agent(attempt, messages=messages)+ if result.get("status") == "success":+ attempt.mark_completed(summary=result.get("content", ""))+ else:+ attempt.mark_failed(error=result.get("reason", "unknown"))+ attempt.run_dir = result.get("run_dir")++ self.store.update_attempt(attempt)+ reply_metadata = {}+ if attempt.run_dir:+ reply_metadata["run_id"] = Path(attempt.run_dir).name+ reply_metadata["status"] = attempt.status.value+ if attempt.metrics:+ reply_metadata["metrics"] = attempt.metrics++ reply = Message(+ session_id=session.session_id, role="assistant",+ content=self._format_result_message(attempt),+ linked_attempt_id=attempt.attempt_id,+ metadata=reply_metadata,+ )+ self.store.append_message(reply)+ self.event_bus.emit(+ session.session_id,+ "attempt.completed" if attempt.status == AttemptStatus.COMPLETED else "attempt.failed",+ {"attempt_id": attempt.attempt_id, "status": attempt.status.value,+ "summary": attempt.summary, "error": attempt.error, "run_dir": attempt.run_dir},+ )++ except Exception as exc:+ attempt.mark_failed(error=str(exc))+ self.store.update_attempt(attempt)+ self.event_bus.emit(session.session_id, "attempt.failed", {"attempt_id": attempt.attempt_id, "error": str(exc)})++ async def _run_with_agent(self, attempt: Attempt, messages: list = None) -> Dict[str, Any]:+ """Execute an attempt with the V5 AgentLoop.++ Args:+ attempt: Current execution attempt.+ messages: Session message history.++ Returns:+ Result dictionary containing status, run_dir, run_id, metrics, and related fields.+ """+ from src.tools import build_registry+ from src.providers.chat import ChatLLM+ from src.agent.loop import AgentLoop++ registry = build_registry()+ llm = ChatLLM()++ session_id = attempt.session_id+ attempt_id = attempt.attempt_id++ def event_callback(event_type: str, data: Dict[str, Any]) -> None:+ """Forward AgentLoop events to the SSE event bus."""+ data["attempt_id"] = attempt_id+ self.event_bus.emit(session_id, event_type, data)++ agent = AgentLoop(+ registry=registry,+ llm=llm,+ event_callback=event_callback,+ max_iterations=50,+ )+ self._active_loops[session_id] = agent++ # Build the message history context.+ history = self._convert_messages_to_history(messages) if messages else None++ try:+ loop = asyncio.get_event_loop()+ result = await loop.run_in_executor(+ _AGENT_EXECUTOR,+ lambda: agent.run(+ user_message=attempt.prompt,+ history=history,+ session_id=session_id,+ ),+ )+ finally:+ self._active_loops.pop(session_id, None)++ # Load metrics from the run output when available.+ if result.get("run_dir"):+ metrics = self._load_metrics(Path(result["run_dir"]))+ if metrics:+ result["metrics"] = metrics++ return result++ @staticmethod+ def _convert_messages_to_history(messages: list) -> list[Dict[str, Any]]:+ """Convert Session messages into OpenAI-format history.++ Keeps the readable ``[prev_run: {run_id}]`` marker instead of removing it+ completely, and trims by character budget instead of a hard six-message cap+ so the LLM can still see previous artifact paths and strategy content during+ iterative updates.++ Args:+ messages: Session message list without the current turn.++ Returns:+ OpenAI-format messages trimmed from the newest items within the token budget.+ """+ import re+ from pathlib import Path++ def _shorten_run_dir(match: re.Match) -> str:+ path_str = match.group(0).replace("Run directory:", "").strip()+ run_id = Path(path_str).name if path_str else ""+ return f"[prev_run: {run_id}]" if run_id else ""++ history = []+ for msg in messages[:-1]:+ role = msg.role if hasattr(msg, "role") else msg.get("role", "user")+ content = msg.content if hasattr(msg, "content") else msg.get("content", "")+ if not content.strip() or role not in ("user", "assistant"):+ continue+ content = re.sub(r"Run directory:\s*\S+", _shorten_run_dir, content).strip()+ if content:+ history.append({"role": role, "content": content})++ # Trim from the newest messages within a character budget of roughly 3000 tokens.+ MAX_HISTORY_CHARS = 12000+ total_chars = 0+ trimmed: list = []+ for msg in reversed(history):+ msg_len = len(msg.get("content", ""))+ if total_chars + msg_len > MAX_HISTORY_CHARS:+ break+ trimmed.append(msg)+ total_chars += msg_len+ return list(reversed(trimmed))++ @staticmethod+ def _load_metrics(run_dir: Path) -> Optional[Dict[str, Any]]:+ """Load metrics.csv from a run directory."""+ import csv+ metrics_path = run_dir / "artifacts" / "metrics.csv"+ if not metrics_path.exists():+ return None+ try:+ with open(metrics_path, "r", encoding="utf-8") as f:+ rows = list(csv.DictReader(f))+ if rows:+ return {k: float(v) for k, v in rows[0].items() if v}+ except Exception:+ pass+ return None++ @staticmethod+ def _format_result_message(attempt: Attempt) -> str:+ """Format the final execution result message."""+ if attempt.status == AttemptStatus.COMPLETED:+ return attempt.summary or "Strategy execution completed."+ return f"Execution failed: {attempt.error or 'unknown error'}"diff --git a/agent/src/session/store.py b/agent/src/session/store.pynew file mode 100644index 000000000..b077115fb--- /dev/null+++ b/agent/src/session/store.py@@ -0,0 +1,254 @@+"""Filesystem-backed persistence for Session, Message, and Attempt records."""++from __future__ import annotations++import json+from pathlib import Path+from typing import Any, Dict, List, Optional++from src.session.models import Attempt, Message, Session+++class SessionStore:+ """Filesystem-backed persistent storage.++ Directory structure::++ sessions/+ โโโ {session_id}/+ โ โโโ session.json+ โ โโโ messages.jsonl+ โ โโโ attempts/+ โ โโโ {attempt_id}/+ โ โโโ attempt.json++ Attributes:+ base_dir: Root directory for session storage.+ """++ def __init__(self, base_dir: Path) -> None:+ """Initialize session storage.++ Args:+ base_dir: Root directory for session storage.+ """+ self.base_dir = base_dir+ self.base_dir.mkdir(parents=True, exist_ok=True)++ def _session_dir(self, session_id: str) -> Path:+ return self.base_dir / session_id++ def _session_file(self, session_id: str) -> Path:+ return self._session_dir(session_id) / "session.json"++ def _messages_file(self, session_id: str) -> Path:+ return self._session_dir(session_id) / "messages.jsonl"++ def _attempt_dir(self, session_id: str, attempt_id: str) -> Path:+ return self._session_dir(session_id) / "attempts" / attempt_id++ def _attempt_file(self, session_id: str, attempt_id: str) -> Path:+ return self._attempt_dir(session_id, attempt_id) / "attempt.json"++ # ---- Session CRUD ----++ def create_session(self, session: Session) -> Session:+ """Create and persist a session.++ Args:+ session: Session instance to create.++ Returns:+ The persisted Session.++ Raises:+ ValueError: Raised when the session already exists.+ """+ session_dir = self._session_dir(session.session_id)+ if session_dir.exists():+ raise ValueError(f"Session {session.session_id} already exists")+ session_dir.mkdir(parents=True)+ (session_dir / "attempts").mkdir()+ self._write_json(self._session_file(session.session_id), session.to_dict())+ return session++ def get_session(self, session_id: str) -> Optional[Session]:+ """Read a session.++ Args:+ session_id: Session ID.++ Returns:+ The Session instance, or None when it does not exist.+ """+ path = self._session_file(session_id)+ data = self._read_json(path)+ if data is None:+ return None+ return Session.from_dict(data)++ def update_session(self, session: Session) -> None:+ """Update a session.++ Args:+ session: Modified Session instance.+ """+ self._write_json(self._session_file(session.session_id), session.to_dict())++ def delete_session(self, session_id: str) -> bool:+ """Delete a session and all of its data.++ Args:+ session_id: Session ID.++ Returns:+ Whether the delete succeeded.+ """+ session_dir = self._session_dir(session_id)+ if not session_dir.exists():+ return False+ import shutil+ shutil.rmtree(session_dir, ignore_errors=True)+ return True++ def list_sessions(self, limit: int = 50) -> List[Session]:+ """List all sessions in descending update-time order.++ Args:+ limit: Maximum number of sessions to return.++ Returns:+ List of Session objects.+ """+ sessions: List[Session] = []+ if not self.base_dir.exists():+ return sessions+ for session_dir in self.base_dir.iterdir():+ if not session_dir.is_dir():+ continue+ session_file = session_dir / "session.json"+ data = self._read_json(session_file)+ if data:+ sessions.append(Session.from_dict(data))+ sessions.sort(key=lambda s: s.updated_at, reverse=True)+ return sessions[:limit]++ # ---- Message Append-Only Log ----++ def append_message(self, message: Message) -> None:+ """Append a message to the session JSONL log.++ Args:+ message: Message to append.+ """+ path = self._messages_file(message.session_id)+ path.parent.mkdir(parents=True, exist_ok=True)+ with path.open("a", encoding="utf-8") as f:+ f.write(json.dumps(message.to_dict(), ensure_ascii=False) + "\n")++ def get_messages(self, session_id: str, limit: int = 100) -> List[Message]:+ """Read all messages for a session.++ Args:+ session_id: Session ID.+ limit: Maximum number of messages to return.++ Returns:+ List of Message objects in chronological order.+ """+ path = self._messages_file(session_id)+ if not path.exists():+ return []+ messages: List[Message] = []+ for line in path.read_text(encoding="utf-8").strip().splitlines():+ if line.strip():+ messages.append(Message.from_dict(json.loads(line)))+ return messages[-limit:]++ # ---- Attempt CRUD ----++ def create_attempt(self, attempt: Attempt) -> Attempt:+ """Create an execution attempt.++ Args:+ attempt: Attempt to create.++ Returns:+ The persisted Attempt.+ """+ attempt_dir = self._attempt_dir(attempt.session_id, attempt.attempt_id)+ attempt_dir.mkdir(parents=True, exist_ok=True)+ self._write_json(+ self._attempt_file(attempt.session_id, attempt.attempt_id),+ attempt.to_dict(),+ )+ return attempt++ def get_attempt(self, session_id: str, attempt_id: str) -> Optional[Attempt]:+ """Read an execution attempt.++ Args:+ session_id: Session ID.+ attempt_id: Attempt ID.++ Returns:+ The Attempt instance, or None when it does not exist.+ """+ path = self._attempt_file(session_id, attempt_id)+ data = self._read_json(path)+ if data is None:+ return None+ return Attempt.from_dict(data)++ def update_attempt(self, attempt: Attempt) -> None:+ """Update an execution attempt.++ Args:+ attempt: Modified Attempt.+ """+ self._write_json(+ self._attempt_file(attempt.session_id, attempt.attempt_id),+ attempt.to_dict(),+ )++ def list_attempts(self, session_id: str) -> List[Attempt]:+ """List all execution attempts for a session.++ Args:+ session_id: Session ID.++ Returns:+ List of Attempt objects sorted by creation time.+ """+ attempts_dir = self._session_dir(session_id) / "attempts"+ if not attempts_dir.exists():+ return []+ attempts: List[Attempt] = []+ for attempt_dir in attempts_dir.iterdir():+ if not attempt_dir.is_dir():+ continue+ attempt_file = attempt_dir / "attempt.json"+ data = self._read_json(attempt_file)+ if data:+ attempts.append(Attempt.from_dict(data))+ attempts.sort(key=lambda a: a.created_at)+ return attempts++ # ---- IO Helpers ----++ @staticmethod+ def _write_json(path: Path, data: Dict[str, Any]) -> None:+ path.parent.mkdir(parents=True, exist_ok=True)+ path.write_text(+ json.dumps(data, ensure_ascii=False, indent=2),+ encoding="utf-8",+ )++ @staticmethod+ def _read_json(path: Path) -> Optional[Dict[str, Any]]:+ if not path.exists():+ return None+ try:+ return json.loads(path.read_text(encoding="utf-8"))+ except (json.JSONDecodeError, OSError):+ return Nonediff --git a/agent/src/skills/adr-hshare/SKILL.md b/agent/src/skills/adr-hshare/SKILL.mdnew file mode 100644index 000000000..dd32dfe1d--- /dev/null+++ b/agent/src/skills/adr-hshare/SKILL.md@@ -0,0 +1,224 @@+---+name: adr-hshare+description: ADR/H-share/A-share cross-listing premium analysis โ track pricing gaps between US-listed ADRs, HK-listed H-shares, and A-shares for arbitrage signals, dual-listing valuation, and delisting risk assessment.+---+# ADR / H-Share / A-Share Cross-Listing Analysis++## Overview++Many Chinese companies are listed on multiple exchanges โ A-shares in Shanghai/Shenzhen, H-shares in Hong Kong, and ADRs in the US. Pricing gaps between these listings create arbitrage opportunities and reveal market-specific sentiment differences. This skill provides frameworks for analyzing cross-listing premiums, identifying arbitrage signals, and assessing delisting risk for US-listed Chinese ADRs.++## Core Concepts++### 1. Cross-Listing Structures++| Structure | Description | Examples |+|-----------|-------------|---------|+| A + H dual-listed | Same company listed on both A-share and HK exchange | PetroChina (601857.SH / 0857.HK), ICBC (601398.SH / 1398.HK) |+| H + ADR dual-listed | HK-listed with US ADR | Alibaba (9988.HK / BABA), JD.com (9618.HK / JD) |+| A + H + ADR triple-listed | All three markets | China Life (601628.SH / 2628.HK / LFC) |+| HK primary + US secondary | Primary listing in HK, secondary ADR | Tencent (0700.HK / TCEHY OTC) |+| US primary โ HK secondary | Originally US, added HK listing | Alibaba (BABA โ 9988.HK), Baidu (BIDU โ 9888.HK) |++### 2. AH Premium Analysis++**AH Premium = (A-share price / H-share price in CNY terms - 1) ร 100%**++```python+def calculate_ah_premium(a_price_cny, h_price_hkd, usdcny, usdhkd):+ """Calculate AH premium for a dual-listed stock."""+ h_price_cny = h_price_hkd * (usdcny / usdhkd) # Convert HKD to CNY+ ah_premium = (a_price_cny / h_price_cny - 1) * 100+ return ah_premium++# Example: PetroChina+# A-share: 8.50 CNY, H-share: 6.20 HKD+# USDCNY: 7.25, USDHKD: 7.82+# H in CNY: 6.20 * (7.25/7.82) = 5.75 CNY+# AH Premium: (8.50/5.75 - 1) * 100 = 47.8%+```++**AH Premium signal interpretation:**++| Premium Level | Interpretation | Action |+|--------------|----------------|--------|+| >50% | Extreme A-share premium; A-share speculative bubble or H-share extreme undervaluation | Strong: buy H, sell/avoid A |+| 30-50% | Elevated premium; normal for high-retail-participation names | Moderate: favor H if fundamentals same |+| 10-30% | Normal range for most AH pairs | Neutral; no strong arbitrage signal |+| 0-10% | Compressed premium; A-shares relatively cheap | Unusual; investigate catalyst |+| <0% | H-share premium over A-share | Very rare; usually near-term event-driven |++**Structural drivers of AH premium:**+1. **Liquidity premium**: A-shares have much higher retail participation and turnover โ liquidity premium+2. **Access premium**: A-shares were historically hard for foreigners to access โ scarcity premium+3. **Currency expectations**: CNY depreciation expectations widen the premium+4. **Regulatory arbitrage**: different trading rules (T+1 in A-shares vs T+0 in HK)+5. **Investor composition**: A-share retail speculative premium vs HK institutional valuation discipline++### 3. ADR Premium/Discount Analysis++**ADR premium = (ADR price in USD / HK equivalent in USD - 1) ร 100%**++```python+def calculate_adr_premium(adr_price_usd, hk_price_hkd, adr_ratio, usdhkd):+ """+ Calculate ADR premium over HK listing.+ adr_ratio: number of HK shares per 1 ADR (e.g., BABA: 1 ADR = 8 HK shares)+ """+ hk_equivalent_usd = (hk_price_hkd * adr_ratio) / usdhkd+ premium = (adr_price_usd / hk_equivalent_usd - 1) * 100+ return premium++# Example: Alibaba+# BABA ADR: $85.00, 9988.HK: HKD 82.50+# ADR ratio: 1 ADR = 8 HK shares+# HK equivalent: (82.50 * 8) / 7.82 = $84.40+# ADR premium: (85.00/84.40 - 1) * 100 = 0.71%+```++**Key ADR conversion ratios:**++| Company | ADR Ticker | HK Ticker | ADR Ratio (HK:ADR) | ADR Exchange |+|---------|-----------|-----------|---------------------|--------------|+| Alibaba | BABA | 9988.HK | 8:1 | NYSE |+| JD.com | JD | 9618.HK | 2:1 | NASDAQ |+| Baidu | BIDU | 9888.HK | 8:1 | NASDAQ |+| Bilibili | BILI | 9626.HK | 1:1 | NASDAQ |+| NIO | NIO | 9866.HK | 1:1 | NYSE |+| XPeng | XPEV | 9868.HK | 2:1 | NYSE |+| Li Auto | LI | 2015.HK | 2:1 | NASDAQ |+| NetEase | NTES | 9999.HK | 5:1 | NASDAQ |+| Trip.com | TCOM | 9961.HK | 1:1 | NASDAQ |+| Pinduoduo | PDD | N/A (US-only) | N/A | NASDAQ |++**ADR premium drivers:**+- US trading hours sentiment (earnings releases, macro data during US hours)+- US-specific regulatory events (SEC, PCAOB audits)+- Liquidity premium (ADR often more liquid for global funds)+- Time zone gap: ADR closes at HK's open โ overnight gap creates premium/discount++### 4. Delisting Risk Assessment++**HFCAA (Holding Foreign Companies Accountable Act) framework:**++Since 2022, PCAOB gained access to audit workpapers of Chinese companies. Key risks:++| Risk Level | Criteria | Impact |+|------------|----------|--------|+| Low | PCAOB inspection completed, no issues | ADR status stable |+| Medium | PCAOB inspection completed, deficiencies noted | Monitor for resolution |+| High | PCAOB access revoked or restricted | 3-year delisting countdown activated |+| Critical | On SEC "identified issuer" list for 3 consecutive years | Forced delisting |++**Delisting risk indicators:**+```python+delisting_risk_factors = {+ "pcaob_status": "inspected", # inspected / pending / blocked+ "sec_identified_years": 0, # 0, 1, 2, or 3 (3 = delist)+ "has_hk_listing": True, # Backup listing reduces impact+ "hk_listing_type": "primary", # primary (can be in Connect) vs secondary+ "vie_structure": True, # Variable Interest Entity adds legal risk+ "state_owned": False, # SOE status adds geopolitical risk+}++# Companies with HK primary listing (BABA, JD, BIDU, NTES, etc.) have+# a safety net if US delisting occurs โ fungible conversion ADR โ HK shares+# Companies with US-only listing (PDD until HK listing) face higher risk+```++### 5. Cross-Listing Arbitrage Strategies++**Strategy 1: AH Premium Mean-Reversion**+```python+# When AH premium for a specific stock diverges significantly from its historical average+ah_premium_current = 45 # current premium+ah_premium_mean_12m = 35 # 12-month average+ah_premium_std = 8 # standard deviation++z_score = (ah_premium_current - ah_premium_mean_12m) / ah_premium_std++if z_score > 2.0:+ signal = "fade_premium" # A-share overvalued vs H; buy H, avoid A+elif z_score < -2.0:+ signal = "buy_premium" # A-share undervalued vs H; buy A, avoid H+else:+ signal = "neutral"+```++**Strategy 2: ADR-HK Intraday Arbitrage**+- During overlapping trading hours (HK morning = US pre-market via ADR), price gaps can appear+- Professional arbitrageurs use ADRโHK fungible conversion to capture these gaps+- For research purposes: tracking ADR premium trend indicates which market is leading sentiment++**Strategy 3: Event-Driven Cross-Listing**+- New HK listing announcement (USโHK): ADR typically dips 2-5% on dilution fear, then recovers+- MSCI / FTSE index inclusion of HK listing: triggers passive fund buying in HK+- Stock Connect inclusion (HK primary listing eligible): triggers mainland institutional buying++## Data Access++```python+import yfinance as yf++# Fetch ADR and HK prices simultaneously+baba_adr = yf.download("BABA", start="2025-01-01", end="2026-03-30", progress=False)+baba_hk = yf.download("9988.HK", start="2025-01-01", end="2026-03-30", progress=False)++# For A+H pairs+petrochina_a = yf.download("601857.SS", start="2025-01-01", end="2026-03-30", progress=False)+petrochina_h = yf.download("0857.HK", start="2025-01-01", end="2026-03-30", progress=False)++# FX rates for premium calculation+cny = yf.download("CNY=X", start="2025-01-01", end="2026-03-30", progress=False) # USD/CNY+hkd = yf.download("HKD=X", start="2025-01-01", end="2026-03-30", progress=False) # USD/HKD++# AH Premium Index (HSAHP)+# Not directly on yfinance; use Hang Seng website or Tushare+```++## Output Format++```+## Cross-Listing Analysis โ [Company Name]++### Listing Structure+- **A-share**: [code] @ [price CNY]+- **H-share**: [code] @ [price HKD]+- **ADR**: [ticker] @ [price USD] (ratio: X HK shares = 1 ADR)++### Premium/Discount+- **AH Premium**: [X%] (12m avg: X%, z-score: X.X)+- **ADR-HK Premium**: [X%] (5d avg: X%)+- **Direction**: [AH premium widening / narrowing / stable]++### Valuation Comparison+| Metric | A-share | H-share | ADR |+|--------|---------|---------|-----|+| PE (TTM) | XX.X | XX.X | XX.X |+| PB | X.X | X.X | X.X |+| Dividend yield | X.X% | X.X% | X.X% |++### Delisting Risk (ADR)+- **PCAOB status**: [inspected / pending]+- **SEC identified years**: [0/1/2/3]+- **HK backup**: [yes-primary / yes-secondary / no]+- **Risk level**: [low / medium / high / critical]++### Arbitrage Signal+- **AH premium z-score**: [X.X] โ [fade premium / neutral / buy premium]+- **Best market to buy**: [A / H / ADR] โ rationale+- **Catalyst**: [index inclusion, Connect eligibility, earnings]++### Investment Implication+- **Preferred listing**: [H-share / ADR / A-share] for new position+- **Risk**: [delisting, FX, regulatory, liquidity]+```++## Notes++- AH premium arbitrage is not freely executable: A-shares and H-shares are NOT fungible (no direct conversion), so true arbitrage requires separate capital pools+- ADRโHK conversion IS possible for most dual-listed names (via depositary bank), but takes 2-3 business days and involves fees+- Currency risk (CNY, HKD, USD) is a major driver of cross-listing premiums; always hedge or account for FX when comparing+- VIE (Variable Interest Entity) structure adds a layer of legal risk for many Chinese ADRs; this is a structural risk, not a trading signal+- Stock Connect eligibility requirements mean not all HK-listed Chinese companies are accessible to mainland investors+- This framework is for research purposes only and does not constitute investment advicediff --git a/agent/src/skills/asset-allocation/SKILL.md b/agent/src/skills/asset-allocation/SKILL.mdnew file mode 100644index 000000000..76b53d456--- /dev/null+++ b/agent/src/skills/asset-allocation/SKILL.md@@ -0,0 +1,289 @@+---+name: asset-allocation+description: Asset allocation theory and optimizer usage โ MPT / Black-Litterman / risk budgeting / all-weather strategy, including guides for 4 optimizers and rebalancing rules.+---++# Asset Allocation and Portfolio Optimization++## Overview++From asset allocation theory to practical implementation, this skill covers classical frameworks (MPT, BL, risk budgeting, all-weather) and the usage of the four optimizers built into this system. The output can be written directly into `config.json`.++## Asset Allocation Theory++### 1. Modern Portfolio Theory (MPT, Markowitz)++**Core idea**: maximize expected return for a given level of risk (the efficient frontier).++```+Optimization problem:+min w'ฮฃw (portfolio variance)+s.t. w'ฮผ = target_return+ ฮฃw = 1+ w โฅ 0 (no shorting)+```++| Advantages | Disadvantages |+|------|------|+| Mathematically rigorous | Extremely sensitive to inputs (garbage in, garbage out) |+| Efficient frontier is visualizable | Concentrated-allocation problem (often produces extreme weights) |+| Foundational framework | Assumes normality and ignores fat tails |++**Practical advice**: do not use raw MPT directly. Add constraints (upper/lower bounds, sector limits) or use a regularized version.++### 2. Black-Litterman Model++**Core idea**: start from market equilibrium and incorporate investor views.++```+Steps:+1. Reverse-imply market equilibrium returns: ฯ = ฮดฮฃw_mkt+2. Build the view matrices: P (selection matrix), Q (view returns), ฮฉ (view uncertainty)+3. Blend the posterior: ฮผ_BL = [(ฯฮฃ)^-1 + P'ฮฉ^-1 P]^-1 [(ฯฮฃ)^-1 ฯ + P'ฮฉ^-1 Q]+4. Run Markowitz optimization using posterior ฮผ_BL+```++**Example views**:+- Absolute view: "China A-shares will return 10% over the next year" โ `P=[1,0,0], Q=[0.10]`+- Relative view: "China A-shares will outperform US equities by 5%" โ `P=[1,-1,0], Q=[0.05]`++**Parameter guidance**:+- `ฯ` (uncertainty scaling): `0.025-0.05`+- `ฮฉ`: set according to view confidence, where higher confidence = smaller variance++### 3. Risk Budgeting++**Core idea**: allocate by risk contribution rather than by capital share.++```+Risk contribution: RC_i = w_i ร (ฮฃw)_i / ฯ_p+Target: RC_i / ฯ_p = budget_i (for all i)+```++| Strategy | Risk Budget | Best Use Case |+|------|---------|---------|+| Equal risk contribution | Each asset 1/N | When you do not know which asset is best |+| Equity-tilted risk budget | Stocks 60%, bonds 30%, commodities 10% | When you want equities to contribute more risk |+| Dynamic risk budget | Adjust dynamically by signal strength | When you have market-timing ability |++### 4. All-Weather Strategy++**Bridgewater framework**: allocate risk equally across economic environments.++```+Economic environment Asset allocation+โโโโโโโโโ โโโโโโโโโ+Growth rising Equities + commodities + corporate bonds+Growth falling Government bonds + inflation-protected bonds+Inflation rising Commodities + inflation-protected bonds + EM debt+Inflation falling Equities + government bonds++Simplified allocation example for China-focused portfolios:+- 30% CSI 300 / CSI 500+- 40% government bonds / credit bonds+- 15% gold+- 15% commodities / REITs+```++## Guide to the 4 Optimizers++### Overview of the Built-In Optimizers++Configure them in `config.json` through `optimizer` and `optimizer_params`:++| optimizer | Display Name | Core Idea | Best Use Case |+|-----------|--------|---------|---------|+| `equal_volatility` | Equal Volatility | Allocate weights by inverse volatility | Simple and effective baseline |+| `risk_parity` | Risk Parity | Equalize risk contribution while accounting for correlation | Long-term robust allocation |+| `mean_variance` | Mean-Variance | Maximize Sharpe ratio or minimize variance | When return forecasts are available |+| `max_diversification` | Maximum Diversification | Maximize the diversification ratio | When pursuing a low-correlation portfolio |++### 1. `equal_volatility`++```json+{+ "optimizer": "equal_volatility",+ "optimizer_params": {+ "lookback": 60+ }+}+```++**Principle**: `w_i = (1/ฯ_i) / ฮฃ(1/ฯ_j)`++| Parameter | Default | Description |+|------|--------|------|+| lookback | 60 | Volatility calculation window (trading days) |++**Advantages**: simple and fast, no return forecast required, no correlation matrix required.+**Disadvantages**: ignores cross-asset correlation.++### 2. `risk_parity`++```json+{+ "optimizer": "risk_parity",+ "optimizer_params": {+ "lookback": 60+ }+}+```++**Principle**: solve for weights such that each asset contributes the same amount of risk.++| Parameter | Default | Description |+|------|--------|------|+| lookback | 60 | Covariance-matrix estimation window |++**Advantages**: accounts for correlation, spreads risk more evenly, and is robust over long horizons.+**Disadvantages**: requires iterative solving and is sensitive to covariance estimates.++### 3. `mean_variance`++```json+{+ "optimizer": "mean_variance",+ "optimizer_params": {+ "lookback": 60,+ "risk_free": 0.0+ }+}+```++**Principle**: Markowitz optimization that maximizes the Sharpe ratio.++| Parameter | Default | Description |+|------|--------|------|+| lookback | 60 | Window for estimating means and covariances |+| risk_free | 0.0 | Risk-free rate (annualized) |++**Advantages**: theoretically optimal (if inputs are accurate).+**Disadvantages**: extremely sensitive to inputs, prone to extreme weights, and often performs poorly out of sample.+**Recommendation**: do not make `lookback` too short (`<30` easily overfits), and add upper/lower weight constraints.++### 4. `max_diversification`++```json+{+ "optimizer": "max_diversification",+ "optimizer_params": {+ "lookback": 60+ }+}+```++**Principle**: maximize `DR = (w'ฯ) / ฯ_p` (the diversification ratio).++| Parameter | Default | Description |+|------|--------|------|+| lookback | 60 | Calculation window |++**Advantages**: does not require return forecasts and seeks true diversification.+**Disadvantages**: effectiveness is limited in highly correlated environments.++### Optimizer Selection Decision Tree++```+Do you have return forecasts?+โโโ Yes โ mean_variance (remember to add constraints)+โโโ No โ Do you need to account for correlation?+ โโโ Yes โ risk_parity (recommended default)+ โโโ No โ Are volatility differences across assets large?+ โโโ Yes โ equal_volatility+ โโโ No โ max_diversification+```++## Rebalancing Strategy++### Three Rebalancing Triggers++| Method | Trigger Condition | Advantages | Disadvantages |+|------|---------|------|------|+| Periodic rebalancing | Fixed monthly / quarterly date | Simple, predictable trading cost | May miss or delay adjustments |+| Threshold trigger | Deviation from target weight > X% | Trades only when needed | Frequent trading in high-volatility markets |+| Volatility trigger | VIX / volatility breaks a threshold | Adapts to market regime | Parameter selection is difficult |++### Suggested Rebalancing Frequency++| Asset Class | Suggested Frequency | Threshold |+|---------|---------|------|+| Equity portfolio | Monthly | ยฑ5% |+| Stock-bond mix | Quarterly | ยฑ10% |+| Global macro | Quarterly / semiannual | ยฑ10% |+| Cryptocurrency | Weekly / biweekly | ยฑ15% (high volatility) |++### Rebalancing in Backtests++Implement rebalancing logic in `signal_engine.py`:++```python+# Periodic rebalancing example (every 20 trading days)+if bar_count % rebalance_freq == 0:+ # Recompute weights+ new_weights = calculate_target_weights(data_map)+ for code, weight in new_weights.items():+ signals[code].iloc[i] = weight+```++## Cross-Asset Correlation Analysis++### Typical Correlation Matrix (China-Focused Portfolio Example)++| | CSI 300 | CSI 500 | Government Bonds | Gold | BTC |+|--|--------|--------|------|------|-----|+| CSI 300 | 1.00 | 0.85 | -0.15 | 0.05 | 0.10 |+| CSI 500 | 0.85 | 1.00 | -0.10 | 0.03 | 0.12 |+| Government Bonds | -0.15 | -0.10 | 1.00 | 0.20 | -0.05 |+| Gold | 0.05 | 0.03 | 0.20 | 1.00 | 0.15 |+| BTC | 0.10 | 0.12 | -0.05 | 0.15 | 1.00 |++**Key patterns**:+- Negative stock-bond correlation is the foundation of allocation (but it does not always hold; in 2022 both stocks and bonds sold off)+- Gold has low correlation with equities and serves as a hedge+- BTC's correlation with traditional assets is unstable and tends to become positive in crises+- Large-cap versus small-cap China A-shares have high correlation (`0.85`), so diversification benefits are limited++## Output Format++```markdown+## Asset Allocation Recommendation++### Allocation Plan+| Asset | Weight | Risk Contribution | Expected Return (Annualized) |+|------|------|---------|--------------|+| CSI 300 | 30% | 45% | 8% |+| Government Bond ETF | 40% | 15% | 3% |+| Gold | 15% | 20% | 5% |+| BTC | 15% | 20% | 15% |++### Optimizer Configuration+```json+{+ "optimizer": "risk_parity",+ "optimizer_params": {"lookback": 60}+}+```++### Expected Risk / Return+| Metric | Value |+|------|-----|+| Expected annualized return | 7.2% |+| Expected annualized volatility | 8.5% |+| Expected Sharpe | 0.85 |+| Expected maximum drawdown | -12% |++### Rebalancing Rules+- Frequency: quarterly (first trading day of March / June / September / December)+- Threshold: trigger when any asset deviates from target by ยฑ10%+- Cost: estimated annual trading cost 0.15%+```++## Notes++1. **The optimizer needs enough instruments**: at least 3 instruments are needed for meaningful optimization; with 2 instruments, `equal_volatility` is usually enough+2. **`lookback` window**: too short (`<20`) is noisy, too long (`>120`) reacts slowly, and 60 is a reasonable default+3. **`mean_variance` trap**: it is the easiest to overfit, and out-of-sample Sharpe is often cut by half or more+4. **Rebalancing cost**: frequent rebalancing eats into returns; for China A-share portfolios, stamp duty of 0.05% plus commissions is material+5. **Cross-market allocation**: use `"source": "auto"` in `config.json`, and let `codes` mix instruments from different markets+6. **Leverage constraint**: the sum of weights must be โค 1.0, and leverage is not allowed unless explicitly specified+7. **Survivorship bias**: historical correlations may be distorted by delistings and new listingsdiff --git a/agent/src/skills/backtest-diagnose/SKILL.md b/agent/src/skills/backtest-diagnose/SKILL.mdnew file mode 100644index 000000000..a36f93ecf--- /dev/null+++ b/agent/src/skills/backtest-diagnose/SKILL.md@@ -0,0 +1,88 @@+---+name: backtest-diagnose+description: Diagnose failed or underperforming backtests, locate the root cause, and fix the issue+---++# Backtest Diagnosis++## Overview++Use this skill when a user reports that a backtest failed, raised an error, or produced poor results.++## Diagnostic Workflow++1. **Read existing artifacts**: use `read_file` to inspect `artifacts/metrics.csv`, `equity.csv`, and `trades.csv`+2. **Read the code**: use `read_file` to inspect `code/signal_engine.py` and `config.json`+3. **Classify the issue**: determine the root cause using the error taxonomy below+4. **Apply the fix**: use `edit_file` to modify the code, then rerun the backtest+5. **Verify the fix**: use `read_file` to inspect the new `metrics.csv`++## Error Taxonomy++### Runtime Errors (`exit_code != 0`)++| Error Type | Common Cause | Fix |+|---------|---------|---------|+| ImportError | Missing dependency | `bash("pip install xxx")` |+| KeyError | DataFrame column-name mismatch | Check the actual column names in `data_map` |+| IndexError | Empty data or insufficient length | Add length checks |+| TypeError | Incorrect signal type | Ensure the return value is `pd.Series` |++### Logic Bugs (Backtest Succeeds but Results Are Abnormal)++1. **Zero trades** (`trade_count=0`): signal-logic bug. Conditions are too strict, so the signal stays at 0. Check whether entry and exit logic is reasonable, and inspect the signal series to confirm it is not all zeros.+2. **Late trades** (first trade occurs more than 2 years after the backtest start): data-filtering bug. The lookback window may be too long, or the initial data segment may have been dropped. Shorten the window or check whether `dropna` is too aggressive.+3. **Capital utilization < 50%** (mostly in cash): position-sizing bug. Signal triggers may be too sparse, or the position-sizing logic may be wrong.+4. **Open position at the end** (a position still exists when the backtest ends): exit-timing bug. Forced liquidation may be missing, or exit logic does not cover the final segment.++### Data Errors++| Symptom | Root Cause | Fix |+|------|------|---------|+| No data fetched | Invalid API token or code issue | Check `config.json` |+| Too little data | Date range too narrow | Expand the date range |++### Data-Source Error Ignore List++If you encounter the following keywords, **do not modify the code**. The problem is on the data-provider side:+- a provider-side "no data available" response+- `rate limit`+- `API limit`+- `daily limit`+- `Information` (common in Tushare API responses)++These issues require the user to check the API token, switch data sources, or wait for the quota to reset.++## Hard-Gate Checklist++1. `artifacts/metrics.csv` exists and is non-empty+2. `artifacts/equity.csv` exists and is non-empty+3. `trade_count > 0` (`0` trades means a signal bug)+4. The equity series contains no `NaN`+5. `exit_code == 0`++## Fixing Principles++- Use **edit_file** to make precise code fixes instead of rewriting the entire file with `write_file`, unless the structure is fundamentally broken+- Fix the bug only, do not change strategy logic unless the user explicitly asks+- Fix one issue at a time, and rerun the backtest immediately after each fix+- Limit yourself to at most 3 repair iterations++## Post-Fix Validation Rules++After modifying `signal_engine.py`, you must confirm:+1. **AST syntax passes**: `bash("python -c \"import ast; ast.parse(open('code/signal_engine.py').read()); print('OK')\"")`+2. **Contains `class SignalEngine`**: the file must define `class SignalEngine`+3. **Contains `def generate`**: the class must contain a `def generate` method+4. **Rerun the backtest**: after the fix, rerun the backtest and verify the results++## `action_items` Writing Rules++After diagnosis, output actionable improvement suggestions:+- Format: `"Change X from A to B"` or `"Add X logic in signal_engine.py"`+- Be specific about parameter values, filenames, and function names+- Provide at least 2 items+- Examples:+ - `"Change RSI threshold from 30 to 25 in signal_engine.py line 42"`+ - `"Add signals = signals.fillna(0) after signal calculation to prevent NaN propagation"`+ - `"Add a volume filter: skip buy signals when volume is below the 20-day average"`diff --git a/agent/src/skills/behavioral-finance/SKILL.md b/agent/src/skills/behavioral-finance/SKILL.mdnew file mode 100644index 000000000..af772146a--- /dev/null+++ b/agent/src/skills/behavioral-finance/SKILL.md@@ -0,0 +1,207 @@+---+name: behavioral-finance+description: "Behavioral finance applications: theories of overreaction and underreaction, behavioral explanations for momentum and reversal, investor sentiment cycles, cognitive-bias checklists, and debiasing quantitative strategies."+---++# Behavioral Finance Applications++## Overview++Translate behavioral-finance theory into quantifiable trading signals and risk-control rules. Core assumption: market participants systematically deviate from rational decision-making, and these biases can be predicted and exploited.++Applicable scenarios:+- Behavioral interpretation and parameter optimization for momentum / reversal strategies+- Contrarian signals when market sentiment becomes extreme+- Debiasing mechanisms in portfolio construction+- Capturing behavior patterns specific to retail-driven China A-share markets++## Core Concepts++### Overreaction and Underreaction++**Underreaction** โ momentum effect:+```+Mechanism: anchoring bias + conservatism+ Investors anchor on old information and update insufficiently to new information+ After an earnings beat, the stock price digests it gradually rather than all at once+China A-share evidence:+ - Earnings-guidance beats still produce 3-5% excess return over the following 20 days+ - After analyst rating upgrades, momentum often persists for 1-3 months+Quant signal:+ SUE (standardized unexpected earnings) > 2ฯ -> buy and hold for 60 days+ Top 10% 20-day return -> continue holding for 20 days (China A-share momentum cycles are shorter)+```++**Overreaction** โ reversal effect:+```+Mechanism: representativeness heuristic + availability bias+ Investors extrapolate recent trends too aggressively and ignore mean reversion+ Panic / euphoria drives reactions beyond what fundamentals support+China A-share evidence:+ - Rebounds after consecutive limit-downs (after 3 limit-downs, the average 20-day rebound is 8%)+ - Big annual losers often earn 5-10% excess return the next year+Quant signal:+ Bottom 10% of 250-day return -> buy and hold for 250 days+ RSI(5) < 10 -> short-term rebound signal (5-10 days)+```++**Key distinction**:+| Dimension | Underreaction (Momentum) | Overreaction (Reversal) |+|------|------------------|------------------|+| Time scale | 1-12 months | <1 week or >12 months |+| Information type | Clear events (earnings / announcements) | Ambiguous information (sentiment / trend) |+| Best China A-share window | 20-60 days | 5-10 days (short term) / 1 year (long term) |++### Cognitive Bias Checklist++**Individual decision biases**:+| Bias | Manifestation | Quant Detection | Debiasing Strategy |+|------|------|----------|------------|+| Loss aversion | Hold losing stocks, sell winners too early | Holding period: losing positions > winning positions by 2-3x | Pre-set stop-loss line and execute mechanically |+| Overconfidence | Overtrading, concentrated positions | Monthly turnover > 100%, single-stock weight > 30% | Limit the number of trades per month |+| Anchoring effect | Anchoring to entry price / historical highs | Abnormal volume expansion near the entry price | Use relative valuation instead of absolute price |+| Confirmation bias | Focus only on information that supports the existing view | Single-source information, ignoring bearish news | Force reading the opposing view |+| Recency bias | Overweight recent events | Recent gains/losses have too much influence on position size | Lengthen the evaluation window (โฅ60 days) |+| Framing effect | Same information framed differently leads to different decisions | Decision differences between return format and absolute-PnL format | Evaluate consistently in return space |++**Group behavior biases**:+| Bias | Manifestation | China A-share Characteristics | Quant Indicator |+|------|------|---------|----------|+| Herding | Chasing rallies and panic-selling together | Extremely fast sector rotation (3-5 days) | Intra-sector stock correlation > 0.8 |+| Information cascades | Ignoring private information and following public signals | Sector follow-through after a leader stock hits limit-up | Sector return on the day after leader-stock limit-up |+| Attention effect | Buying stocks that attract attention | Explosive turnover in limit-up / news-driven stocks | Abnormal turnover > 3x average |++### Investor Sentiment Cycle++```+Fear -> Caution -> Optimism -> Excitement -> Euphoria -> Denial -> Panic -> Fear+ | | | | | | |+ Bottom Recovery Mid-uptrend Pre-top Top Early selloff Pre-bottom++Quant sentiment indicators:+ 1. Closed-end fund discount: discount > 15% -> extreme fear -> buy signal+ 2. Margin-financing growth: monthly growth > 20% -> euphoria -> reduce position+ 3. New account openings: weekly openings > 2x average -> overheated market+ 4. Turnover ratio: All-A daily turnover > 3% -> euphoric; < 0.5% -> deeply depressed+ 5. Number of limit-up stocks: > 100 -> euphoric; < 10 -> weak+```++## Analysis Framework++### 1. Disposition-Effect Signal++**Principle**: investors tend to sell winners and hold losers. Once winning positions are largely cleared, selling pressure eases; when trapped holders are deeply underwater, selling pressure can also ease.++```+China A-share application:+ Compute the profit ratio in the chip-distribution structure:+ - Profit ratio > 90% and shrinking volume -> winners are reluctant to sell -> may continue rising+ - Profit ratio > 90% and expanding volume -> winners are exiting -> topping signal+ - Profit ratio < 10% and shrinking volume -> low willingness to cut losses -> bottom stabilization+ - Profit ratio < 10% and expanding volume -> panic selling -> short-term oversold++Quant implementation:+ capital_gain_overhang = (current_price - avg_cost) / avg_cost+ where avg_cost is approximated by 60-day VWAP+ CGO > 0.2 -> strong unrealized gains, watch for disposition-effect selling pressure+ CGO < -0.3 -> deeply trapped holders, selling pressure may actually ease+```++### 2. Composite Sentiment Indicator++```python+# Multi-dimensional sentiment score (0-100, 50 = neutral)+sentiment_components = {+ 'turnover_ratio': normalize(all_a_turnover, historical_percentile), # weight 25%+ 'margin_growth': normalize(monthly_margin_growth, historical_percentile), # weight 25%+ 'new_high_ratio': normalize(new_high_ratio, historical_percentile), # weight 20%+ 'limit_up_count': normalize(limit_up_count, historical_percentile), # weight 15%+ 'fund_discount': normalize(closed_end_fund_discount, historical_percentile), # weight 15% (inverse)+}++sentiment_score = weighted_sum(components)+# > 80: extreme greed -> cut exposure below 60%+# 60-80: optimistic -> maintain normal exposure+# 40-60: neutral -> keep exposure unchanged+# 20-40: pessimistic -> add gradually+# < 20: extreme fear -> increase exposure above 80%+```++### 3. Behavioral Optimization of Momentum Strategies++Traditional momentum (sorting by past 12-month returns) is unstable in China A-shares. A behavioral-finance perspective suggests the following optimizations:++```+Optimization 1: Separate sentiment momentum from fundamental momentum+ Sentiment momentum = part of recent price rise with no fundamental support -> short-term reversal+ Fundamental momentum = price rise consistent with earnings revisions -> can persist+ Trade: buy stocks with "strong fundamental momentum + weak sentiment momentum"++Optimization 2: Attention-weighted momentum+ High-attention retail names reverse faster+ Indicator: if abnormal turnover > 3x average, cut momentum holding period by 50%+ Example: if a normal momentum basket holds for 60 days, high-attention names hold only 30 days++Optimization 3: Combine cross-sectional momentum and time-series momentum+ Cross-sectional: relative strength (top 20% in return ranking)+ Time-series: absolute trend (price > MA60)+ Both satisfied -> strong signal; only one satisfied -> half position+```++### 4. Contrarian Trading Signals++```+Extreme-fear buy conditions (at least 3 items):+ โก Shanghai Composite RSI(5) < 15+ โก All-A daily turnover < 0.5%+ โก Weekly margin-financing decline > 5%+ โก Limit-up count < 10 and limit-down count > 50+ โก Closed-end fund discount > 15%++Extreme-greed sell conditions (at least 3 items):+ โก Shanghai Composite RSI(5) > 90+ โก All-A daily turnover > 3%+ โก Weekly margin-financing growth > 10%+ โก Limit-up count > 150+ โก Weekly increase in new account openings > 100%+```++## Output Format++Behavioral-finance analysis report:+```+=== Market Sentiment Diagnosis ===+Date: 2026-03-28+Sentiment score: 72/100 (optimistic bias)+Current phase: transition from optimism to excitement++=== Behavioral-Bias Signals ===+Overreaction detection: 127 stocks rose > 15% in the past 5 days -> 65% probability of short-term reversal+Disposition effect: winner-clearing ratio is low (35%) -> overhead selling pressure remains+Herding effect: sector correlation 0.85 -> severe follow-the-leader behavior, divergence likely soon++=== Strategy Recommendations ===+Momentum strategy: shorten holding period from 60 days to 30 days (market attention is elevated)+Contrarian signal: not triggered (sentiment is not yet extreme)+Position suggestion: maintain 70% exposure, and prioritize names with "strong fundamental momentum + weak sentiment momentum"++=== Debiasing Checklist ===+โก Are you overconfident because of recent profits? -> check position concentration+โก Are you anchored to your entry price? -> re-evaluate using current PE/PB+โก Are you ignoring bearish information? -> force yourself to read bearish research reports+```++## Notes++1. **High retail participation in China A-shares**: behavioral-bias signals are more pronounced than in US equities, but sector rotation is also faster, so momentum windows should be shorter+2. **Lag in sentiment indicators**: margin-financing balance is released T+1, and new account openings are weekly, so they are not suitable for intraday trading+3. **Structural changes**: after 2019, foreign capital and quant participation rose, so the effectiveness of traditional behavioral-finance signals may have weakened+4. **Behavioral factors correlate with traditional factors**: disposition-effect factors correlate about 0.3-0.5 with momentum, so control collinearity+5. **Overfitting risk**: behavioral stories are easy to explain after the fact, so out-of-sample validation is mandatory+6. **Extreme sentiment is rare**: extreme fear / greed appears only 2-3 times per year, so strategy capacity is limited++## Dependencies++```bash+pip install pandas numpy scipy+```diff --git a/agent/src/skills/candlestick/SKILL.md b/agent/src/skills/candlestick/SKILL.mdnew file mode 100644index 000000000..f09794b89--- /dev/null+++ b/agent/src/skills/candlestick/SKILL.md@@ -0,0 +1,57 @@+---+name: candlestick+description: Candlestick pattern recognition engine, pure pandas vectorized implementation of 15 classic candlestick patterns (5 single-candle + 5 double-candle + 4 triple-candle + 1 trend confirmation), generating a composite signal from bullish/bearish pattern scores.+---+# Candlestick Pattern Recognition++## Purpose++Identifies 15 classic candlestick patterns and generates trading signals:++### Single-Candle Patterns (5)+| Pattern | Signal | Description |+|------|------|------|+| Hammer | Bullish | Long lower shadow with a small body at the top |+| Inverted Hammer | Bullish | Long upper shadow with a small body at the bottom |+| Shooting Star | Bearish | Long upper shadow with a small body at the bottom (appears after an uptrend) |+| Doji | Neutral | Open and close are nearly equal |+| Spinning Top | Neutral | Small body with roughly equal upper and lower shadows |++### Double-Candle Patterns (5)+| Pattern | Signal |+|------|------|+| Bullish Engulfing | Bullish |+| Bearish Engulfing | Bearish |+| Bullish Harami | Bullish |+| Bearish Harami | Bearish |+| Piercing Line | Bullish |+| Dark Cloud Cover | Bearish |++### Triple-Candle Patterns (4)+| Pattern | Signal |+|------|------|+| Morning Star | Bullish |+| Evening Star | Bearish |+| Three White Soldiers | Bullish |+| Three Black Crows | Bearish |++## Signal Logic++Bullish patterns score +1, bearish patterns score -1. Go long when the total score is > 0, go short when it is < 0, and stand aside when it equals 0.++## Parameters++| Parameter | Default | Description |+|------|--------|------|+| body_pct | 0.1 | Threshold for body-to-range ratio in a doji |+| shadow_ratio | 2.0 | Ratio of shadow length to body length |++## Dependencies++```bash+pip install pandas numpy requests+```++## Signal Convention++- `1` = long, `-1` = short, `0` = stand asidediff --git a/agent/src/skills/candlestick/example_signal_engine.py b/agent/src/skills/candlestick/example_signal_engine.pynew file mode 100644index 000000000..d74725ab8--- /dev/null+++ b/agent/src/skills/candlestick/example_signal_engine.py@@ -0,0 +1,590 @@+"""K็บฟๅฝขๆ่ฏๅซไฟกๅทๅผๆใ++็บฏ pandas ๅ้ๅๅฎ็ฐ 15 ็ง็ปๅ ธ่ก็ๅพๅฝขๆ่ฏๅซ๏ผ+- ๅๆ นๅฝขๆ (5): ้คๅญ็บฟใๅ้คๅญใๅฐๅปไนๆใๅๅญๆใ็บบ้ค็บฟ+- ๅๆ นๅฝขๆ (6): ็ๆถจ/็่ทๅๆฒกใ็ๆถจ/็่ทๅญ็บฟใๅบ็ฉฟ็บฟใไนไบ็้กถ+- ไธๆ นๅฝขๆ (4): ๆจๆใๆฎๆใไธ็ฝๅ ตใไธไน้ธฆ++ไฟกๅท็บฆๅฎ: 1=ๅๅค, -1=ๅ็ฉบ, 0=่งๆ+"""++from typing import Dict++import numpy as np+import pandas as pd+++# ---------------------------------------------------------------------------+# ๅ้ๅ่พ ๅฉๅฝๆฐ+# ---------------------------------------------------------------------------+++def _body(o: pd.Series, c: pd.Series) -> pd.Series:+ """ๅฎไฝ้ฟๅบฆ๏ผ็ปๅฏนๅผ๏ผใ++ Args:+ o: ๅผ็ไปทๅบๅใ+ c: ๆถ็ไปทๅบๅใ++ Returns:+ ๆฏๆ นK็บฟ็ๅฎไฝ้ฟๅบฆใ+ """+ return (c - o).abs()+++def _range(h: pd.Series, l: pd.Series) -> pd.Series:+ """K็บฟๆฏๅน ๏ผๆ้ซ - ๆไฝ๏ผใ++ Args:+ h: ๆ้ซไปทๅบๅใ+ l: ๆไฝไปทๅบๅใ++ Returns:+ ๆฏๆ นK็บฟ็ๆฏๅน ใ+ """+ return h - l+++def _upper_shadow(o: pd.Series, c: pd.Series, h: pd.Series) -> pd.Series:+ """ไธๅฝฑ็บฟ้ฟๅบฆใ++ Args:+ o: ๅผ็ไปทๅบๅใ+ c: ๆถ็ไปทๅบๅใ+ h: ๆ้ซไปทๅบๅใ++ Returns:+ ๆฏๆ นK็บฟ็ไธๅฝฑ็บฟ้ฟๅบฆใ+ """+ return h - pd.concat([o, c], axis=1).max(axis=1)+++def _lower_shadow(o: pd.Series, c: pd.Series, l: pd.Series) -> pd.Series:+ """ไธๅฝฑ็บฟ้ฟๅบฆใ++ Args:+ o: ๅผ็ไปทๅบๅใ+ c: ๆถ็ไปทๅบๅใ+ l: ๆไฝไปทๅบๅใ++ Returns:+ ๆฏๆ นK็บฟ็ไธๅฝฑ็บฟ้ฟๅบฆใ+ """+ return pd.concat([o, c], axis=1).min(axis=1) - l+++# ---------------------------------------------------------------------------+# ไฟกๅทๅผๆ+# ---------------------------------------------------------------------------+++class SignalEngine:+ """K็บฟๅฝขๆ่ฏๅซไฟกๅทๅผๆใ++ ็บฏๅ้ๅๅฎ็ฐ๏ผ้่ฟ็ๆถจ/็่ทๅฝขๆ่ฏๅ็ๆ็ปผๅไบคๆไฟกๅทใ++ Attributes:+ body_pct: ๅๅญๆๅคๅฎ้ๅผ๏ผๅฎไฝๅ ๆฏๅน ๆฏไพใ+ shadow_ratio: ๅฝฑ็บฟไธๅฎไฝ็้ฟๅบฆๆฏ้ๅผใ+ """++ def __init__(self, body_pct: float = 0.1, shadow_ratio: float = 2.0):+ """ๅๅงๅK็บฟๅฝขๆไฟกๅทๅผๆใ++ Args:+ body_pct: ๅๅญๆๅฎไฝ/ๆฏๅน ๆฏ้ๅผ๏ผ้ป่ฎค 0.1ใ+ shadow_ratio: ๅฝฑ็บฟไธๅฎไฝ้ฟๅบฆๆฏ๏ผ้ป่ฎค 2.0ใ+ """+ self.body_pct = body_pct+ self.shadow_ratio = shadow_ratio++ # -----------------------------------------------------------------------+ # ๅๆ นๅฝขๆ+ # -----------------------------------------------------------------------++ def _detect_hammer(self, o: pd.Series, h: pd.Series,+ l: pd.Series, c: pd.Series) -> pd.Series:+ """ๆฃๆต้คๅญ็บฟ๏ผHammer๏ผโโ ็ๆถจใ++ ๆกไปถ๏ผไธๅฝฑ็บฟ >= shadow_ratio * ๅฎไฝ๏ผไธๅฝฑ็บฟ < ๅฎไฝ๏ผๅฎไฝ > 0๏ผๆฏๅน > 0ใ++ Args:+ o: ๅผ็ไปทใ+ h: ๆ้ซไปทใ+ l: ๆไฝไปทใ+ c: ๆถ็ไปทใ++ Returns:+ ไฟกๅทๅบๅ๏ผ1=ๆฃๆตๅฐ้คๅญ็บฟ๏ผ0=ๆชๆฃๆตๅฐใ+ """+ bd = _body(o, c)+ rng = _range(h, l)+ ls = _lower_shadow(o, c, l)+ us = _upper_shadow(o, c, h)+ cond = (ls >= self.shadow_ratio * bd) & (us < bd) & (bd > 0) & (rng > 0)+ return cond.astype(int)++ def _detect_inverted_hammer(self, o: pd.Series, h: pd.Series,+ l: pd.Series, c: pd.Series) -> pd.Series:+ """ๆฃๆตๅ้คๅญ๏ผInverted Hammer๏ผโโ ็ๆถจใ++ ๆกไปถ๏ผไธๅฝฑ็บฟ >= shadow_ratio * ๅฎไฝ๏ผไธๅฝฑ็บฟ < ๅฎไฝใ++ Args:+ o: ๅผ็ไปทใ+ h: ๆ้ซไปทใ+ l: ๆไฝไปทใ+ c: ๆถ็ไปทใ++ Returns:+ ไฟกๅทๅบๅ๏ผ1=ๆฃๆตๅฐๅ้คๅญ๏ผ0=ๆชๆฃๆตๅฐใ+ """+ bd = _body(o, c)+ us = _upper_shadow(o, c, h)+ ls = _lower_shadow(o, c, l)+ cond = (us >= self.shadow_ratio * bd) & (ls < bd) & (bd > 0)+ return cond.astype(int)++ def _detect_shooting_star(self, o: pd.Series, h: pd.Series,+ l: pd.Series, c: pd.Series) -> pd.Series:+ """ๆฃๆตๅฐๅปไนๆ๏ผShooting Star๏ผโโ ็่ทใ++ ๅฝขๆไธๅ้คๅญ็ธๅ๏ผไฝ้ๅบ็ฐๅจไธๆถจ่ถๅฟไนๅ๏ผๅไธๆ นๆถ็ > ๅไธคๆ นๆถ็๏ผใ++ Args:+ o: ๅผ็ไปทใ+ h: ๆ้ซไปทใ+ l: ๆไฝไปทใ+ c: ๆถ็ไปทใ++ Returns:+ ไฟกๅทๅบๅ๏ผ-1=ๆฃๆตๅฐๅฐๅปไนๆ๏ผ0=ๆชๆฃๆตๅฐใ+ """+ bd = _body(o, c)+ us = _upper_shadow(o, c, h)+ ls = _lower_shadow(o, c, l)+ uptrend = c.shift(1) > c.shift(2)+ cond = (us >= self.shadow_ratio * bd) & (ls < bd) & (bd > 0) & uptrend+ return -(cond.astype(int))++ def _detect_doji(self, o: pd.Series, h: pd.Series,+ l: pd.Series, c: pd.Series) -> pd.Series:+ """ๆฃๆตๅๅญๆ๏ผDoji๏ผโโ ไธญๆง๏ผไฟกๅทไธบ0๏ผใ++ ๆกไปถ๏ผๅฎไฝ/ๆฏๅน < body_pct ไธๆฏๅน > 0ใ++ Args:+ o: ๅผ็ไปทใ+ h: ๆ้ซไปทใ+ l: ๆไฝไปทใ+ c: ๆถ็ไปทใ++ Returns:+ ไฟกๅทๅบๅ๏ผๅง็ปไธบ0๏ผไธญๆงๅฝขๆ๏ผไธไบง็ๆนๅไฟกๅท๏ผใ+ """+ bd = _body(o, c)+ rng = _range(h, l)+ safe_rng = rng.replace(0, np.nan)+ cond = (bd / safe_rng < self.body_pct) & (rng > 0)+ # ๅๅญๆไธบไธญๆง๏ผไธ่ดก็ฎๆนๅๅๆฐ+ return pd.Series(0, index=o.index)++ def _detect_spinning_top(self, o: pd.Series, h: pd.Series,+ l: pd.Series, c: pd.Series) -> pd.Series:+ """ๆฃๆต็บบ้ค็บฟ๏ผSpinning Top๏ผโโ ไธญๆง๏ผไฟกๅทไธบ0๏ผใ++ ๆกไปถ๏ผๅฎไฝ/ๆฏๅน < 0.3๏ผไธๅฝฑ็บฟ > ๅฎไฝ๏ผไธๅฝฑ็บฟ > ๅฎไฝ๏ผไธไธๆฏๅๅญๆใ++ Args:+ o: ๅผ็ไปทใ+ h: ๆ้ซไปทใ+ l: ๆไฝไปทใ+ c: ๆถ็ไปทใ++ Returns:+ ไฟกๅทๅบๅ๏ผๅง็ปไธบ0๏ผไธญๆงๅฝขๆ๏ผไธไบง็ๆนๅไฟกๅท๏ผใ+ """+ bd = _body(o, c)+ rng = _range(h, l)+ safe_rng = rng.replace(0, np.nan)+ us = _upper_shadow(o, c, h)+ ls = _lower_shadow(o, c, l)+ is_doji = (bd / safe_rng < self.body_pct) & (rng > 0)+ cond = ((bd / safe_rng < 0.3) & (us > bd) & (ls > bd)+ & (rng > 0) & ~is_doji)+ # ็บบ้ค็บฟไธบไธญๆง๏ผไธ่ดก็ฎๆนๅๅๆฐ+ return pd.Series(0, index=o.index)++ # -----------------------------------------------------------------------+ # ๅๆ นๅฝขๆ+ # -----------------------------------------------------------------------++ def _detect_engulfing(self, o: pd.Series, h: pd.Series,+ l: pd.Series, c: pd.Series) -> pd.Series:+ """ๆฃๆตๅๆฒกๅฝขๆ๏ผEngulfing๏ผใ++ ็ๆถจๅๆฒก๏ผๅไธๆ น็่ท๏ผๅฝๅ็ๆถจ๏ผๅฝๅๅฎไฝๅ ๅซๅไธๆ นๅฎไฝใ+1+ ็่ทๅๆฒก๏ผๅไธๆ น็ๆถจ๏ผๅฝๅ็่ท๏ผๅฝๅๅฎไฝๅ ๅซๅไธๆ นๅฎไฝใ-1++ Args:+ o: ๅผ็ไปทใ+ h: ๆ้ซไปทใ+ l: ๆไฝไปทใ+ c: ๆถ็ไปทใ++ Returns:+ ไฟกๅทๅบๅ๏ผ1=็ๆถจๅๆฒก๏ผ-1=็่ทๅๆฒก๏ผ0=ๆ ใ+ """+ o1, c1 = o.shift(1), c.shift(1)+ prev_bear = c1 < o1+ prev_bull = c1 > o1+ curr_bull = c > o+ curr_bear = c < o++ bullish = prev_bear & curr_bull & (c >= o1) & (o <= c1)+ bearish = prev_bull & curr_bear & (c <= o1) & (o >= c1)++ sig = pd.Series(0, index=o.index)+ sig[bullish] = 1+ sig[bearish] = -1+ return sig++ def _detect_harami(self, o: pd.Series, h: pd.Series,+ l: pd.Series, c: pd.Series) -> pd.Series:+ """ๆฃๆตๅญ็บฟๅฝขๆ๏ผHarami๏ผใ++ ็ๆถจๅญ็บฟ๏ผๅไธๆ น็่ทๅคงๅฎไฝ๏ผๅฝๅๅฐๅฎไฝ่ขซๅ ๅซๅจๅไธๆ นๅฎไฝๅ ใ+1+ ็่ทๅญ็บฟ๏ผๅไธๆ น็ๆถจๅคงๅฎไฝ๏ผๅฝๅๅฐๅฎไฝ่ขซๅ ๅซๅจๅไธๆ นๅฎไฝๅ ใ-1++ Args:+ o: ๅผ็ไปทใ+ h: ๆ้ซไปทใ+ l: ๆไฝไปทใ+ c: ๆถ็ไปทใ++ Returns:+ ไฟกๅทๅบๅ๏ผ1=็ๆถจๅญ็บฟ๏ผ-1=็่ทๅญ็บฟ๏ผ0=ๆ ใ+ """+ bd = _body(o, c)+ o1, c1 = o.shift(1), c.shift(1)+ bd1 = _body(o1, c1)++ prev_bear = c1 < o1+ prev_bull = c1 > o1+ large_prev = bd1 > bd++ # ๅฝๅๅฎไฝๅฎๅ จๅจๅไธๆ นๅฎไฝๅ+ prev_top = pd.concat([o1, c1], axis=1).max(axis=1)+ prev_bot = pd.concat([o1, c1], axis=1).min(axis=1)+ curr_top = pd.concat([o, c], axis=1).max(axis=1)+ curr_bot = pd.concat([o, c], axis=1).min(axis=1)+ contained = (curr_top <= prev_top) & (curr_bot >= prev_bot)++ bullish = prev_bear & large_prev & contained+ bearish = prev_bull & large_prev & contained++ sig = pd.Series(0, index=o.index)+ sig[bullish] = 1+ sig[bearish] = -1+ return sig++ def _detect_piercing_line(self, o: pd.Series, h: pd.Series,+ l: pd.Series, c: pd.Series) -> pd.Series:+ """ๆฃๆตๅบ็ฉฟ็บฟ๏ผPiercing Line๏ผโโ ็ๆถจใ++ ๆกไปถ๏ผๅไธๆ น็่ท๏ผๅฝๅๅผ็ไฝไบๅไธๆ นๆไฝไปท๏ผๅฝๅๆถ็้ซไบๅไธๆ นๅฎไฝไธญ็นใ++ Args:+ o: ๅผ็ไปทใ+ h: ๆ้ซไปทใ+ l: ๆไฝไปทใ+ c: ๆถ็ไปทใ++ Returns:+ ไฟกๅทๅบๅ๏ผ1=ๆฃๆตๅฐๅบ็ฉฟ็บฟ๏ผ0=ๆ ใ+ """+ o1, c1, l1 = o.shift(1), c.shift(1), l.shift(1)+ prev_bear = c1 < o1+ curr_bull = c > o+ opens_below = o < l1+ mid1 = (o1 + c1) / 2+ closes_above_mid = c > mid1++ cond = prev_bear & curr_bull & opens_below & closes_above_mid+ return cond.astype(int)++ def _detect_dark_cloud(self, o: pd.Series, h: pd.Series,+ l: pd.Series, c: pd.Series) -> pd.Series:+ """ๆฃๆตไนไบ็้กถ๏ผDark Cloud Cover๏ผโโ ็่ทใ++ ๆกไปถ๏ผๅไธๆ น็ๆถจ๏ผๅฝๅๅผ็้ซไบๅไธๆ นๆ้ซไปท๏ผๅฝๅๆถ็ไฝไบๅไธๆ นๅฎไฝไธญ็นใ++ Args:+ o: ๅผ็ไปทใ+ h: ๆ้ซไปทใ+ l: ๆไฝไปทใ+ c: ๆถ็ไปทใ++ Returns:+ ไฟกๅทๅบๅ๏ผ-1=ๆฃๆตๅฐไนไบ็้กถ๏ผ0=ๆ ใ+ """+ o1, c1, h1 = o.shift(1), c.shift(1), h.shift(1)+ prev_bull = c1 > o1+ curr_bear = c < o+ opens_above = o > h1+ mid1 = (o1 + c1) / 2+ closes_below_mid = c < mid1++ cond = prev_bull & curr_bear & opens_above & closes_below_mid+ return -(cond.astype(int))++ # -----------------------------------------------------------------------+ # ไธๆ นๅฝขๆ+ # -----------------------------------------------------------------------++ def _detect_morning_star(self, o: pd.Series, h: pd.Series,+ l: pd.Series, c: pd.Series) -> pd.Series:+ """ๆฃๆตๆจๆ๏ผMorning Star๏ผโโ ็ๆถจใ++ ๆกไปถ๏ผ+ - Day1 ็่ท+ - Day2 ๅฐๅฎไฝไธๅไธ่ทณ็ฉบ๏ผDay2ๆ้ซ < Day1ๆไฝ๏ผ+ - Day3 ็ๆถจไธๆถ็้ซไบ Day1 ๅฎไฝไธญ็น++ Args:+ o: ๅผ็ไปทใ+ h: ๆ้ซไปทใ+ l: ๆไฝไปทใ+ c: ๆถ็ไปทใ++ Returns:+ ไฟกๅทๅบๅ๏ผ1=ๆฃๆตๅฐๆจๆ๏ผ0=ๆ ใ+ """+ o1, c1 = o.shift(2), c.shift(2) # Day1+ o2, c2, h2 = o.shift(1), c.shift(1), h.shift(1) # Day2+ bd2 = _body(o2, c2)+ rng2 = _range(h.shift(1), l.shift(1))+ safe_rng2 = rng2.replace(0, np.nan)++ day1_bear = c1 < o1+ day2_small = bd2 / safe_rng2 < 0.3+ day2_gap = h2 < l.shift(2) # Day2 high < Day1 low (gap down)+ day3_bull = c > o+ mid1 = (o1 + c1) / 2+ day3_above_mid = c > mid1++ cond = day1_bear & day2_small & day2_gap & day3_bull & day3_above_mid+ return cond.astype(int).fillna(0).astype(int)++ def _detect_evening_star(self, o: pd.Series, h: pd.Series,+ l: pd.Series, c: pd.Series) -> pd.Series:+ """ๆฃๆตๆฎๆ๏ผEvening Star๏ผโโ ็่ทใ++ ๆกไปถ๏ผ+ - Day1 ็ๆถจ+ - Day2 ๅฐๅฎไฝไธๅไธ่ทณ็ฉบ๏ผDay2ๆไฝ > Day1ๆ้ซ๏ผ+ - Day3 ็่ทไธๆถ็ไฝไบ Day1 ๅฎไฝไธญ็น++ Args:+ o: ๅผ็ไปทใ+ h: ๆ้ซไปทใ+ l: ๆไฝไปทใ+ c: ๆถ็ไปทใ++ Returns:+ ไฟกๅทๅบๅ๏ผ-1=ๆฃๆตๅฐๆฎๆ๏ผ0=ๆ ใ+ """+ o1, c1 = o.shift(2), c.shift(2) # Day1+ o2, c2, l2 = o.shift(1), c.shift(1), l.shift(1) # Day2+ bd2 = _body(o2, c2)+ rng2 = _range(h.shift(1), l.shift(1))+ safe_rng2 = rng2.replace(0, np.nan)++ day1_bull = c1 > o1+ day2_small = bd2 / safe_rng2 < 0.3+ day2_gap = l2 > h.shift(2) # Day2 low > Day1 high (gap up)+ day3_bear = c < o+ mid1 = (o1 + c1) / 2+ day3_below_mid = c < mid1++ cond = day1_bull & day2_small & day2_gap & day3_bear & day3_below_mid+ return -(cond.astype(int).fillna(0).astype(int))++ def _detect_three_white_soldiers(self, o: pd.Series, h: pd.Series,+ l: pd.Series, c: pd.Series) -> pd.Series:+ """ๆฃๆตไธ็ฝๅ ต๏ผThree White Soldiers๏ผโโ ็ๆถจใ++ ๆกไปถ๏ผ่ฟ็ปญ3ๆ น้ณ็บฟ๏ผๆฏๆ นๆถ็้ๅข๏ผๆฏๆ นๅผ็ๅจๅไธๆ นๅฎไฝๅ ใ++ Args:+ o: ๅผ็ไปทใ+ h: ๆ้ซไปทใ+ l: ๆไฝไปทใ+ c: ๆถ็ไปทใ++ Returns:+ ไฟกๅทๅบๅ๏ผ1=ๆฃๆตๅฐไธ็ฝๅ ต๏ผ0=ๆ ใ+ """+ o1, c1 = o.shift(2), c.shift(2) # Day1+ o2, c2 = o.shift(1), c.shift(1) # Day2++ bull1 = c1 > o1+ bull2 = c2 > o2+ bull3 = c > o++ close_up = (c2 > c1) & (c > c2)++ # ๆฏๆ นๅผ็ๅจๅไธๆ นๅฎไฝๅ+ open2_in = (o2 >= o1) & (o2 <= c1)+ open3_in = (o >= o2) & (o <= c2)++ cond = bull1 & bull2 & bull3 & close_up & open2_in & open3_in+ return cond.astype(int).fillna(0).astype(int)++ def _detect_three_black_crows(self, o: pd.Series, h: pd.Series,+ l: pd.Series, c: pd.Series) -> pd.Series:+ """ๆฃๆตไธไน้ธฆ๏ผThree Black Crows๏ผโโ ็่ทใ++ ๆกไปถ๏ผ่ฟ็ปญ3ๆ น้ด็บฟ๏ผๆฏๆ นๆถ็้ๅ๏ผๆฏๆ นๅผ็ๅจๅไธๆ นๅฎไฝๅ ใ++ Args:+ o: ๅผ็ไปทใ+ h: ๆ้ซไปทใ+ l: ๆไฝไปทใ+ c: ๆถ็ไปทใ++ Returns:+ ไฟกๅทๅบๅ๏ผ-1=ๆฃๆตๅฐไธไน้ธฆ๏ผ0=ๆ ใ+ """+ o1, c1 = o.shift(2), c.shift(2) # Day1+ o2, c2 = o.shift(1), c.shift(1) # Day2++ bear1 = c1 < o1+ bear2 = c2 < o2+ bear3 = c < o++ close_dn = (c2 < c1) & (c < c2)++ # ๆฏๆ นๅผ็ๅจๅไธๆ นๅฎไฝๅ ๏ผ้ด็บฟๅฎไฝ๏ผopenๅจไธ๏ผcloseๅจไธ๏ผ+ open2_in = (o2 <= o1) & (o2 >= c1)+ open3_in = (o <= o2) & (o >= c2)++ cond = bear1 & bear2 & bear3 & close_dn & open2_in & open3_in+ return -(cond.astype(int).fillna(0).astype(int))++ # -----------------------------------------------------------------------+ # ไธปๅ ฅๅฃ+ # -----------------------------------------------------------------------++ def generate(self, data_map: Dict[str, pd.DataFrame]) -> Dict[str, pd.Series]:+ """ๅฏนๆฏไธชๆ ็่ฟ่กๅ จ้จๅฝขๆๆฃๆต๏ผๆฑๆป่ฏๅ็ๆไฟกๅทใ++ Args:+ data_map: ๆ ็ไปฃ็ ๅฐ OHLCV DataFrame ็ๆ ๅฐใ+ DataFrame ้ๅ ๅซ open/high/low/close ๅ๏ผindex ไธบ datetimeใ++ Returns:+ ๆ ็ไปฃ็ ๅฐไฟกๅท Series ็ๆ ๅฐ๏ผ1=ๅๅค, -1=ๅ็ฉบ, 0=่งๆ๏ผใ++ Example:+ >>> engine = SignalEngine()+ >>> signals = engine.generate({"BTC-USDT": df})+ >>> signals["BTC-USDT"].value_counts()+ """+ result = {}+ for code, df in data_map.items():+ o = df["open"]+ h = df["high"]+ l = df["low"]+ c = df["close"]++ # ๆถ้ๆๆๅฝขๆ็ไฟกๅทๅๆฐ+ scores = pd.DataFrame(index=df.index)++ # ๅๆ นๅฝขๆ+ scores["hammer"] = self._detect_hammer(o, h, l, c)+ scores["inv_hammer"] = self._detect_inverted_hammer(o, h, l, c)+ scores["shooting_star"] = self._detect_shooting_star(o, h, l, c)+ scores["doji"] = self._detect_doji(o, h, l, c)+ scores["spinning_top"] = self._detect_spinning_top(o, h, l, c)++ # ๅๆ นๅฝขๆ+ scores["engulfing"] = self._detect_engulfing(o, h, l, c)+ scores["harami"] = self._detect_harami(o, h, l, c)+ scores["piercing"] = self._detect_piercing_line(o, h, l, c)+ scores["dark_cloud"] = self._detect_dark_cloud(o, h, l, c)++ # ไธๆ นๅฝขๆ+ scores["morning_star"] = self._detect_morning_star(o, h, l, c)+ scores["evening_star"] = self._detect_evening_star(o, h, l, c)+ scores["three_white"] = self._detect_three_white_soldiers(o, h, l, c)+ scores["three_black"] = self._detect_three_black_crows(o, h, l, c)++ total = scores.sum(axis=1)+ result[code] = pd.Series(+ np.sign(total).astype(int), index=df.index, name="signal"+ )+ return result+++# ---------------------------------------------------------------------------+# ๆฐๆฎ่ทๅ+# ---------------------------------------------------------------------------+++def _fetch_okx(inst_id: str, bar: str = "1D", limit: int = 300) -> pd.DataFrame:+ """ไป OKX ่ทๅK็บฟๆฐๆฎใ++ Args:+ inst_id: ไบคๆๅฏน๏ผๅฆ "BTC-USDT"ใ+ bar: K็บฟๅจๆ๏ผ้ป่ฎค "1D"ใ+ limit: ่ทๅๆฐ้๏ผ้ป่ฎค 300ใ++ Returns:+ ๅ ๅซ open/high/low/close/volume ๅ็ DataFrame๏ผindex ไธบ datetimeใ++ Raises:+ KeyError: ๅฝ API ่ฟๅๆ ผๅผๅผๅธธๆถใ+ """+ import requests++ resp = requests.get("https://www.okx.com/api/v5/market/candles", params={+ "instId": inst_id, "bar": bar, "limit": str(limit)+ })+ candles = resp.json()["data"]+ columns = ["ts", "open", "high", "low", "close",+ "vol", "volCcy", "volCcyQuote", "confirm"]+ df = pd.DataFrame(reversed(candles), columns=columns)+ df["ts"] = pd.to_datetime(df["ts"].astype("int64"), unit="ms")+ df = df.set_index("ts")+ for col in ["open", "high", "low", "close"]:+ df[col] = df[col].astype(float)+ df["volume"] = df["vol"].astype(float)+ return df+++if __name__ == "__main__":+ symbols = ["BTC-USDT", "ETH-USDT", "SOL-USDT"]+ data_map = {}+ for sym in symbols:+ print(f"Fetching {sym} ...")+ data_map[sym] = _fetch_okx(sym)++ engine = SignalEngine()+ signals = engine.generate(data_map)++ for sym in symbols:+ sig = signals[sym]+ buys = (sig == 1).sum()+ sells = (sig == -1).sum()+ holds = (sig == 0).sum()+ print(f"\n{sym} ({len(sig)} bars)")+ print(f" Long: {buys}")+ print(f" Short: {sells}")+ print(f" Hold: {holds}")+ # ๆพ็คบๆ่ฟ็้้ถไฟกๅท+ nonzero = sig[sig != 0]+ if len(nonzero) > 0:+ last = nonzero.iloc[-1]+ label = "Long" if last == 1 else "Short"+ print(f" Latest signal: {label} @ {nonzero.index[-1]:%Y-%m-%d}")diff --git a/agent/src/skills/chanlun/SKILL.md b/agent/src/skills/chanlun/SKILL.mdnew file mode 100644index 000000000..dd2779be6--- /dev/null+++ b/agent/src/skills/chanlun/SKILL.md@@ -0,0 +1,109 @@+---+name: chanlun+description: ๅบไบ็ผ ่ฎบ๏ผ็ผ ไธญ่ฏด็ฆ ๏ผ็ๅฝขๆ่ฏๅซๅผๆ๏ผไฝฟ็จczscๅบ่ชๅจๆฃๆตK็บฟๅๅใ็ฌใไธญๆข๏ผๅนถ็ๆไธไนฐ/ไธๅ/ไบไนฐ/ไบๅ/ไธไนฐ/ไธๅ็ญไนฐๅ็นไฟกๅทใๆฏๆๅคๅจๆๅๆๅๅฝขๆๅ็ฑป๏ผ3/5/7/9/11็ฌๅฝขๆ๏ผใ+---+# ็ผ ่ฎบๅฝขๆ่ฏๅซ++## ็จ้++ๅบไบ**็ผ ไธญ่ฏด็ฆ **็่ฎบ็ไปทๆ ผๅฝขๆ่ฏๅซใ็ผ ่ฎบๆฏไธๅฅๅฎๅ จๅบไบไปทๆ ผ็ปๆ็ๆๆฏๅๆๆนๆณ๏ผๆ ธๅฟ้พ่ทฏ๏ผ++```+ๅๅงK็บฟ โ ๅปๅ ๅซๅค็ โ ๅๅ่ฏๅซ โ ็ฌๆฃๆต โ ไธญๆขๆๅปบ โ ไนฐๅ็นๅคๅฎ+```++้็จไบไปปไฝๆ OHLCV ๆฐๆฎ็ๅธๅบ๏ผA่กใๅ ๅฏ่ดงๅธใๆ่ดง็ญ๏ผใ++## ๆ ธๅฟๆฆๅฟต++| ๆฆๅฟต | ่ฏดๆ | ่ฏฆ็ปๆๆกฃ |+| --- | --- | --- |+| ๅๅ๏ผFX๏ผ | ้กถๅๅ๏ผไธญ้ดK็บฟๆ้ซ๏ผๅบๅๅ๏ผไธญ้ดK็บฟๆไฝ | [ๅๅ](references/ๆ ธๅฟๆฆๅฟต/ๅๅ.md) |+| ็ฌ๏ผBI๏ผ | ็ธ้ป้กถๅบๅๅไน้ด็ไธๆฎต่ตฐๅฟ๏ผๆๅฐๅๅ | [็ฌ](references/ๆ ธๅฟๆฆๅฟต/็ฌ.md) |+| ไธญๆข๏ผZS๏ผ | ่ณๅฐ3็ฌๆๆ็ไปทๆ ผ้ๅ ๅบๅ๏ผ่ถๅฟ็ๆ ธๅฟ | [ไธญๆข](references/ๆ ธๅฟๆฆๅฟต/ไธญๆข.md) |++## ไนฐๅ็นไฝ็ณป++| ไนฐๅ็น | ๅซไน | ่ฏฆ็ปๆๆกฃ |+| --- | --- | --- |+| ไธไนฐ/ไธๅ | ่ถๅฟ็ปๆๅ็็ฌฌไธไธชๅ่ฝฌไฟกๅท๏ผ่้ฉฐ็น๏ผ | [ไธไนฐไธๅ](references/ไนฐๅ็น/ไธไนฐไธๅ.md) |+| ไบไนฐ/ไบๅ | ไธไนฐ/ไธๅๅๅ่ฐไธ็ ดๅบ/้กถ็็กฎ่ฎคไฟกๅท | [ไบไนฐไบๅ](references/ไนฐๅ็น/ไบไนฐไบๅ.md) |+| ไธไนฐ/ไธๅ | ไธญๆขไธ็งป/ไธ็งปๅๅ่ฐไธ่ฟๅ ฅๅไธญๆข็ไฟกๅท | [ไธไนฐไธๅ](references/ไนฐๅ็น/ไธไนฐไธๅ.md) |++## ไพ่ตๅฎ่ฃ++```bash+pip install czsc requests pandas+```++## ๅฟซ้ไธๆ++```python+from czsc import CZSC, RawBar, Freq+from datetime import datetime++# ๅๅค RawBar ๅ่กจ๏ผ้ๆๆถ้ดๆญฃๅบๆๅ๏ผ+bars = [+ RawBar(symbol="BTC-USDT", id=0, dt=datetime(2026,1,1),+ freq=Freq.D, open=70000, close=71000,+ high=72000, low=69000, vol=1000, amount=71000000),+ # ... ๆดๅคK็บฟ+]++# ๅๅปบๅๆๅจ๏ผ่ชๅจๆฃๆตๅๅ/็ฌ/ไธญๆข+c = CZSC(bars)++# ่ฎฟ้ฎ็ปๆ+print(c.bi_list) # ๅทฒๅฎๆ็็ฌ+print(c.bars_ubi) # ๆชๅฎๆ็ฌไธญ็K็บฟ+```++## ๅฏ็จไฟกๅทๅฝๆฐ๏ผczsc.signals.cxt๏ผ++czsc ๅ ็ฝฎ 43 ไธช็ผ ่ฎบไฟกๅทๅฝๆฐ๏ผๆ ธๅฟๅฆไธ๏ผ++| ๅฝๆฐ | ่ฏดๆ | ็ฑปๅ |+| --- | --- | --- |+| `cxt_first_buy_V221126` | ไธไนฐไฟกๅท | ไนฐๅ็น |+| `cxt_first_sell_V221126` | ไธๅไฟกๅท | ไนฐๅ็น |+| `cxt_second_bs_V230320` | ๅ็บฟ่พ ๅฉไบไนฐไบๅ | ไนฐๅ็น |+| `cxt_third_bs_V230318` | ๅ็บฟ่พ ๅฉไธไนฐไธๅ | ไนฐๅ็น |+| `cxt_third_buy_V230228` | ็ฌไธไนฐ่พ ๅฉ | ไนฐๅ็น |+| `cxt_double_zs_V230311` | ไธคไธญๆข็ปๅๅคๆญBS1 | ไธญๆข |+| `cxt_three_bi_V230618` | ไธ็ฌๅฝขๆๅ็ฑป | ๅฝขๆ |+| `cxt_five_bi_V230619` | ไบ็ฌๅฝขๆๅ็ฑป | ๅฝขๆ |+| `cxt_seven_bi_V230620` | ไธ็ฌๅฝขๆๅ็ฑป | ๅฝขๆ |+| `cxt_nine_bi_V230621` | ไน็ฌๅฝขๆๅ็ฑป | ๅฝขๆ |+| `cxt_eleven_bi_V230622` | ๅไธ็ฌๅฝขๆๅ็ฑป | ๅฝขๆ |+| `cxt_bi_base_V230228` | BIๅบ็กไฟกๅท๏ผๆนๅ/่ฝฌๆ๏ผ | ๅบ็ก |+| `cxt_bi_end_V230312` | MACD่พ ๅฉ็ฌ็ปๆ | ่พ ๅฉ |+| `cxt_range_oscillation_V230620` | ๅบ้ด้่กๅคๆญ | ่พ ๅฉ |+| `cxt_zhong_shu_gong_zhen_V221221` | ๅคงๅฐ็บงๅซไธญๆขๅ ฑๆฏ | ไธญๆข |++## ไฟกๅท็บฆๅฎ++- ไฟกๅทๅผๆ่พๅบ๏ผ`1`=ๅๅค๏ผ`-1`=ๅ็ฉบ๏ผ`0`=่งๆ+- ๅๅคๆกไปถ๏ผไธไนฐไฟกๅท ๆ ไธ็ฌๅไธ็่ ๆ ไบ็ฌ็ฑปไธไนฐ+- ๅ็ฉบๆกไปถ๏ผไธๅไฟกๅท ๆ ไธ็ฌๅไธ็่ ๆ ไบ็ฌ็ฑปไธๅ+- ไธญๆข่พ ๅฉ๏ผไปทๆ ผๅจไธญๆขไธๆฒฟ้่ฟๅๅคไผๅฟ๏ผไธๆฒฟ้่ฟๅ็ฉบไผๅฟ++## ๆฐๆฎๆ ผๅผ++czsc ๆฅๅ `List[RawBar]`๏ผๆฏไธช RawBar ๅ ๅซ๏ผ++| ๅญๆฎต | ็ฑปๅ | ่ฏดๆ |+| --- | --- | --- |+| symbol | str | ๆ ็ไปฃ็ |+| id | int | ๅบๅท๏ผไป0ๅผๅง๏ผ |+| dt | datetime | ๆถ้ด |+| freq | Freq | ้ข็๏ผ`Freq.F1/F5/F15/F30/F60/D/W/M` |+| open | float | ๅผ็ไปท |+| close | float | ๆถ็ไปท |+| high | float | ๆ้ซไปท |+| low | float | ๆไฝไปท |+| vol | float | ๆไบค้ |+| amount | float | ๆไบค้ข |++## ๅฎ็ฐๆนๅผ++ไฝฟ็จ [czsc](https://github.com/waditu/czsc) ๅบ๏ผv0.9.68+๏ผ๏ผๅบไบ็บฏ Python ๅฎ็ฐ๏ผๅฏ้ Rust ๅ ้ๅ็ซฏ๏ผใๆฏๆๅข้ๆดๆฐ๏ผ้ๅๅฎๆถๅๆใdiff --git a/agent/src/skills/chanlun/example_signal_engine.py b/agent/src/skills/chanlun/example_signal_engine.pynew file mode 100644index 000000000..17d5d753e--- /dev/null+++ b/agent/src/skills/chanlun/example_signal_engine.py@@ -0,0 +1,225 @@+"""็ผ ่ฎบๅฝขๆ่ฏๅซไฟกๅทๅผๆใ++ๅบไบ czsc ๅบๅฎ็ฐ็ผ ไธญ่ฏด็ฆ ็่ฎบ็ไนฐๅ็นไฟกๅท็ๆใ+ๆ ธๅฟ้พ่ทฏ๏ผK็บฟ โ ๅๅ โ ็ฌ โ ไธญๆข โ ไนฐๅ็นใ+"""++from typing import Optional, Dict+from datetime import datetime++import pandas as pd+from czsc import CZSC, RawBar, Freq, ZS+from czsc.signals.cxt import (+ cxt_first_buy_V221126,+ cxt_first_sell_V221126,+ cxt_bi_base_V230228,+ cxt_three_bi_V230618,+ cxt_five_bi_V230619,+)+++def _df_to_bars(df: pd.DataFrame, symbol: str, freq: Freq = Freq.D) -> list:+ """ๅฐ OHLCV DataFrame ่ฝฌๆขไธบ czsc RawBar ๅ่กจใ++ Args:+ df: ๅ ๅซ open/high/low/close/volume ๅ็ DataFrame๏ผindex ไธบ datetimeใ+ symbol: ๆ ็ไปฃ็ ใ+ freq: K็บฟ้ข็๏ผ้ป่ฎคๆฅ็บฟใ++ Returns:+ ๆๆถ้ดๆญฃๅบๆๅ็ RawBar ๅ่กจใ+ """+ bars = []+ for i, (dt, row) in enumerate(df.iterrows()):+ if not isinstance(dt, datetime):+ dt = pd.Timestamp(dt).to_pydatetime()+ bars.append(RawBar(+ symbol=symbol,+ id=i,+ dt=dt,+ freq=freq,+ open=float(row["open"]),+ close=float(row["close"]),+ high=float(row["high"]),+ low=float(row["low"]),+ vol=float(row.get("volume", row.get("vol", 0))),+ amount=float(row.get("amount", 0)),+ ))+ return bars+++def _get_signals(c: CZSC) -> dict:+ """่ฎก็ฎ็ผ ่ฎบไนฐๅ็นไฟกๅทใ++ Args:+ c: CZSC ๅๆๅจๅฎไพใ++ Returns:+ ไฟกๅทๅญๅ ธใ+ """+ s = {}+ s.update(cxt_first_buy_V221126(c, di=1))+ s.update(cxt_first_sell_V221126(c, di=1))+ s.update(cxt_bi_base_V230228(c, di=1))+ s.update(cxt_three_bi_V230618(c, di=1))+ s.update(cxt_five_bi_V230619(c, di=1))+ return s+++def _check_zhongshu(bi_list: list) -> Optional[ZS]:+ """ๆฃๆตๆ่ฟ็ๆๆไธญๆขใ++ Args:+ bi_list: ็ฌๅ่กจใ++ Returns:+ ๆ่ฟ็ๆๆไธญๆข๏ผๆฒกๆๅ่ฟๅ Noneใ+ """+ if len(bi_list) < 3:+ return None+ for i in range(len(bi_list) - 3, max(len(bi_list) - 10, -1), -1):+ zs = ZS(bis=bi_list[i:i + 3])+ if zs.is_valid:+ return zs+ return None+++class SignalEngine:+ """็ผ ่ฎบๅฝขๆ่ฏๅซไฟกๅทๅผๆใ++ ๅบไบๅๅโ็ฌโไธญๆขโไนฐๅ็น้พ่ทฏ๏ผ็ๆๅๅค/ๅ็ฉบ/่งๆไฟกๅทใ++ Attributes:+ freq: K็บฟๅๆ้ข็ใ+ """++ def __init__(self, freq: Freq = Freq.D):+ """ๅๅงๅ็ผ ่ฎบไฟกๅทๅผๆใ++ Args:+ freq: K็บฟๅๆ้ข็๏ผ้ป่ฎคๆฅ็บฟใ+ """+ self.freq = freq++ def generate(self, data_map: Dict[str, pd.DataFrame]) -> Dict[str, pd.Series]:+ """ๆ นๆฎ็ผ ่ฎบๅฝขๆ็ๆไบคๆไฟกๅทใ++ Args:+ data_map: ๆ ็ไปฃ็ ๅฐ OHLCV DataFrame ็ๆ ๅฐใ+ DataFrame ้ๅ ๅซ open/high/low/close/volume ๅ๏ผindex ไธบ datetimeใ++ Returns:+ ๆ ็ไปฃ็ ๅฐไฟกๅท Series ็ๆ ๅฐ๏ผ1=ๅๅค, -1=ๅ็ฉบ, 0=่งๆ๏ผใ+ """+ result = {}+ for code, df in data_map.items():+ signal = pd.Series(0, index=df.index)+ bars = _df_to_bars(df, code, self.freq)++ if len(bars) < 30:+ result[code] = signal+ continue++ # ้ๆ นK็บฟๅๆ๏ผ่ฎฐๅฝๆฏๆ นK็บฟ็ไฟกๅท+ c = CZSC(bars[:30], get_signals=_get_signals)+ for bar in bars[30:]:+ c.update(bar)+ sig = self._evaluate_signals(c)+ if sig != 0:+ signal.iloc[bar.id] = sig++ result[code] = signal+ return result++ def _evaluate_signals(self, c: CZSC) -> int:+ """่ฏไผฐๅฝๅไฟกๅท็ถๆ๏ผ่ฟๅไบคๆๆนๅใ++ Args:+ c: CZSC ๅๆๅจๅฎไพใ++ Returns:+ 1=ๅๅค, -1=ๅ็ฉบ, 0=่งๆใ+ """+ signals = c.signals+ if not signals:+ return 0++ # ไธไนฐไฟกๅท+ buy1_key = [k for k in signals if "BUY1" in k]+ if buy1_key and "ไธไนฐ" in str(signals.get(buy1_key[0], "")):+ return 1++ # ไธๅไฟกๅท+ sell1_key = [k for k in signals if "SELL1" in k]+ if sell1_key and "ไธๅ" in str(signals.get(sell1_key[0], "")):+ return -1++ # ไธ็ฌๅฝขๆ+ three_bi_key = [k for k in signals if "ไธ็ฌ" in k]+ if three_bi_key:+ val = str(signals.get(three_bi_key[0], ""))+ if "ๅไธ็่" in val:+ return 1+ if "ๅไธ็่" in val:+ return -1++ # ไบ็ฌๅฝขๆ+ five_bi_key = [k for k in signals if "ไบ็ฌ" in k]+ if five_bi_key:+ val = str(signals.get(five_bi_key[0], ""))+ if "็ฑปไธไนฐ" in val:+ return 1+ if "็ฑปไธๅ" in val:+ return -1++ # ็ฌๅบ็กไฟกๅท + ไธญๆขไฝ็ฝฎ่พ ๅฉ+ bi_key = [k for k in signals if "V230228" in k]+ if bi_key and len(c.bi_list) >= 3:+ val = str(signals.get(bi_key[0], ""))+ zs = _check_zhongshu(c.bi_list)+ if zs and zs.is_valid:+ last_close = c.bars_raw[-1].close+ if "ๅไธ_่ฝฌๆ" in val and last_close <= zs.zd:+ return 1+ if "ๅไธ_่ฝฌๆ" in val and last_close >= zs.zg:+ return -1++ return 0+++if __name__ == "__main__":+ import requests++ BASE_URL = "https://www.okx.com/api/v5"++ # ่ทๅ BTC ๆฅ็บฟๆฐๆฎ+ resp = requests.get(f"{BASE_URL}/market/candles", params={+ "instId": "BTC-USDT", "bar": "1D", "limit": "300"+ })+ candles = resp.json()["data"]++ # ่ฝฌไธบ DataFrame+ columns = ["ts", "open", "high", "low", "close", "vol", "volCcy", "volCcyQuote", "confirm"]+ df = pd.DataFrame(reversed(candles), columns=columns)+ df["ts"] = pd.to_datetime(df["ts"].astype("int64"), unit="ms")+ df = df.set_index("ts")+ for col in ["open", "high", "low", "close"]:+ df[col] = df[col].astype(float)+ df["volume"] = df["vol"].astype(float)+ df["amount"] = df["volCcy"].astype(float)++ # ่ฟ่กไฟกๅทๅผๆ+ engine = SignalEngine(freq=Freq.D)+ signals = engine.generate({"BTC-USDT": df})++ # ่พๅบ็ปๆ+ sig = signals["BTC-USDT"]+ buys = sig[sig == 1]+ sells = sig[sig == -1]+ print(f"BTC-USDT ็ผ ่ฎบไฟกๅท ({len(df)} ๆ นK็บฟ)")+ print(f" ๅๅคไฟกๅท: {len(buys)} ไธช")+ print(f" ๅ็ฉบไฟกๅท: {len(sells)} ไธช")+ if len(buys) > 0:+ print(f" ๆ่ฟๅๅค: {buys.index[-1]:%Y-%m-%d}")+ if len(sells) > 0:+ print(f" ๆ่ฟๅ็ฉบ: {sells.index[-1]:%Y-%m-%d}")diff --git "a/agent/src/skills/chanlun/references/\344\271\260\345\215\226\347\202\271/\344\270\200\344\271\260\344\270\200\345\215\226.md" "b/agent/src/skills/chanlun/references/\344\271\260\345\215\226\347\202\271/\344\270\200\344\271\260\344\270\200\345\215\226.md"new file mode 100644index 000000000..802107960--- /dev/null+++ "b/agent/src/skills/chanlun/references/\344\271\260\345\215\226\347\202\271/\344\270\200\344\271\260\344\270\200\345\215\226.md"@@ -0,0 +1,63 @@+## ไธไนฐ / ไธๅ๏ผ็ฌฌไธ็ฑปไนฐๅ็น๏ผ+----++็ผ ่ฎบไธญๆ้่ฆ็ไนฐๅ็นไฟกๅท๏ผๅบ็ฐๅจ่ถๅฟๅ่ฝฌ็ๆ็นไฝ็ฝฎใ++### ไธไนฐ๏ผFirst Buy๏ผ++**ๅฎไน**๏ผไธ้่ถๅฟไธญ๏ผ่ณๅฐไธคไธชๅไธไธญๆข๏ผ๏ผๆๅไธๆฎตไธ่ทๅบ็ฐ**่้ฉฐ**๏ผๅฝขๆๅบๅๅๆถ็ไนฐๅ ฅ็นใ++**่้ฉฐๅคๆญ**๏ผๆๅไธๆฎตไธ่ท็ๅๅบฆๅฐไบๅไธๆฎตไธ่ท๏ผMACD้ข็งฏใไปทๆ ผๅน ๅบฆ็ญ่กก้๏ผใ++```+โ+ \+ \ โไธญๆข1+ \/+ /\+ โ \+ \ โไธญๆข2+ \/+ /\+ โ \ โ ่้ฉฐ๏ผๅๅบฆๅๅผฑ๏ผ+ โ โ ไธไนฐ็น+```++**ไฟกๅทๆกไปถ**๏ผ+1. ๅญๅจ่ณๅฐไธคไธชไธญๆข็ไธ้่ถๅฟ+2. ๆๅไธๆฎตไธ่ทๅๅบฆ < ๅไธๆฎตไธ่ทๅๅบฆ๏ผ่้ฉฐ๏ผ+3. ๅบ็ฐๅบๅๅ็กฎ่ฎค++### ไธๅ๏ผFirst Sell๏ผ++**ๅฎไน**๏ผไธๅ่ถๅฟไธญ๏ผ่ณๅฐไธคไธชๅไธไธญๆข๏ผ๏ผๆๅไธๆฎตไธๆถจๅบ็ฐ่้ฉฐ๏ผๅฝขๆ้กถๅๅๆถ็ๅๅบ็นใ++```+ โ โ ไธๅ็น+ โ / โ ่้ฉฐ๏ผๅๅบฆๅๅผฑ๏ผ+ \/+ /\+ โ \ โไธญๆข2+ /+ /\+ โ \ โไธญๆข1+ /+ โ+```++### czsc ไฟกๅทๅฝๆฐ++```python+from czsc.signals.cxt import cxt_first_buy_V221126, cxt_first_sell_V221126++def get_signals(c):+ s = {}+ s.update(cxt_first_buy_V221126(c, di=1)) # di=1 ่กจ็คบๅๆฐ็ฌฌ1็ฌ+ s.update(cxt_first_sell_V221126(c, di=1))+ return s+```++**่พๅบไฟกๅทๆ ผๅผ**๏ผ`{freq}_D{di}B_BUY1` / `{freq}_D{di}B_SELL1`+- ๅผไธบ `ไธไนฐ_xxx` ๆถ่งฆๅๅๅค+- ๅผไธบ `ไธๅ_xxx` ๆถ่งฆๅๅ็ฉบ+- ๅผไธบ `ๅ ถไป_ไปปๆ_ไปปๆ_0` ๆถๆ ไฟกๅทdiff --git "a/agent/src/skills/chanlun/references/\344\271\260\345\215\226\347\202\271/\344\270\211\344\271\260\344\270\211\345\215\226.md" "b/agent/src/skills/chanlun/references/\344\271\260\345\215\226\347\202\271/\344\270\211\344\271\260\344\270\211\345\215\226.md"new file mode 100644index 000000000..5094529a0--- /dev/null+++ "b/agent/src/skills/chanlun/references/\344\271\260\345\215\226\347\202\271/\344\270\211\344\271\260\344\270\211\345\215\226.md"@@ -0,0 +1,70 @@+## ไธไนฐ / ไธๅ๏ผ็ฌฌไธ็ฑปไนฐๅ็น๏ผ+----++ไธญๆขไธ็งป/ไธ็งปๅ็่ถๅฟๅปถ็ปญไฟกๅท๏ผๆฏๆๅฏ้ ็้กบๅฟไบคๆไฟกๅทใ++### ไธไนฐ๏ผThird Buy๏ผ++**ๅฎไน**๏ผไธๅ่ถๅฟไธญ๏ผไปทๆ ผ็ช็ ดไธญๆขไธๆฒฟๅๅ่ฐ๏ผๅ่ฐ**ไธ่ฟๅ ฅๅไธญๆข**๏ผไฝ็น้ซไบไธญๆขZG๏ผๆถ็ไนฐๅ ฅ็นใ++```+ โ+ / \+ โ / โ ไธไนฐ โ ๅ่ฐไธ่ฟๅ ฅๅไธญๆข+ / \ /+ / โ+ ------/---------- ZG (ไธญๆขไธๆฒฟ)+ โ /+ / \ / โ ไธญๆขๅบๅ+ / \/+ / /\+ / โ \+โ ------\----------- ZD (ไธญๆขไธๆฒฟ)+ โ+```++**ไฟกๅทๆกไปถ**๏ผ+1. ๅญๅจๆๆไธญๆข+2. ไปทๆ ผๅไธ็ช็ ดไธญๆขไธๆฒฟ๏ผZG๏ผ+3. ็ช็ ดๅๅ่ฐ็ไฝ็น > ไธญๆขไธๆฒฟ๏ผZG๏ผ+4. ๅบ็ฐๅบๅๅ็กฎ่ฎค++### ไธๅ๏ผThird Sell๏ผ++**ๅฎไน**๏ผไธ้่ถๅฟไธญ๏ผไปทๆ ผ่ท็ ดไธญๆขไธๆฒฟๅๅๅผน๏ผๅๅผน**ไธ่ฟๅ ฅๅไธญๆข**๏ผ้ซ็นไฝไบไธญๆขZD๏ผๆถ็ๅๅบ็นใ++```+ โ+ ------/---------- ZG+ \ โ /+ \ / \/ โ ไธญๆขๅบๅ+ \/ \+ \ โ+ ------\---------- ZD+ \ โ+ \ / \+ โ โ ไธๅ โ ๅๅผนไธ่ฟๅ ฅๅไธญๆข+ \+ โ+```++### czsc ไฟกๅทๅฝๆฐ++```python+from czsc.signals.cxt import cxt_third_bs_V230318, cxt_third_bs_V230319++def get_signals(c):+ s = {}+ # ๅ็บฟ่พ ๅฉไธไนฐไธๅ+ s.update(cxt_third_bs_V230318(c, di=1, ma_type="SMA", timeperiod=20))+ # ๅขๅ ๅ็บฟๅฝขๆๅคๆญ็ไธไนฐไธๅ+ s.update(cxt_third_bs_V230319(c, di=1, ma_type="SMA", timeperiod=20))+ return s+```++### ๅฎๆ่ฆ็น++- ไธไนฐๆฏ**ๆๅฏ้ **็ไนฐ็น๏ผไธญๆขไธ็งปๅทฒ็กฎ่ฎค่ถๅฟ๏ผๅ่ฐไธ่ฟไธญๆข่ฏดๆๅๅบฆๅผบ+- ไธไนฐๅฏ็จไบๅ ไป๏ผ้ ๅไธไนฐ/ไบไนฐ็ๅบไป+- ไธๅๅ็๏ผๆฏๆๅฏ้ ็ๅๅบ/ๅ็ฉบไฟกๅท+- ๆญขๆไฝๆ็กฎ๏ผไธไนฐๆญขๆ่ฎพๅจไธญๆขZGไธๆน๏ผไธๅๆญข็่ฎพๅจไธญๆขZDไธๆนdiff --git "a/agent/src/skills/chanlun/references/\344\271\260\345\215\226\347\202\271/\344\272\214\344\271\260\344\272\214\345\215\226.md" "b/agent/src/skills/chanlun/references/\344\271\260\345\215\226\347\202\271/\344\272\214\344\271\260\344\272\214\345\215\226.md"new file mode 100644index 000000000..498cac619--- /dev/null+++ "b/agent/src/skills/chanlun/references/\344\271\260\345\215\226\347\202\271/\344\272\214\344\271\260\344\272\214\345\215\226.md"@@ -0,0 +1,55 @@+## ไบไนฐ / ไบๅ๏ผ็ฌฌไบ็ฑปไนฐๅ็น๏ผ+----++ไธไนฐ/ไธๅไนๅ็ๅ่ฐ็กฎ่ฎคไฟกๅท๏ผๅฎๅ จๆง้ซไบไธไนฐไธๅใ++### ไบไนฐ๏ผSecond Buy๏ผ++**ๅฎไน**๏ผไธไนฐๅบ็ฐๅ๏ผไปทๆ ผๅๅผนๅๅ่ฐ๏ผๅ่ฐ**ไธ็ ดไธไนฐไฝ็น**ๆถ็ไนฐๅ ฅ็นใ++```+ โ+ / \+ โ / \+ / \ /+ / \ /+ / \ /+โ โ ไธไนฐ โ ไบไนฐ โ ๅ่ฐไธ็ ดไธไนฐไฝ็น+```++**ไฟกๅทๆกไปถ**๏ผ+1. ๅทฒๅบ็ฐไธไนฐไฟกๅท+2. ๅๅผนๅๅ่ฐ+3. ๅ่ฐไฝ็น > ไธไนฐไฝ็น๏ผไธๅๆฐไฝ๏ผ+4. ๅบ็ฐๅบๅๅ็กฎ่ฎค++### ไบๅ๏ผSecond Sell๏ผ++**ๅฎไน**๏ผไธๅๅบ็ฐๅ๏ผไปทๆ ผๅ่ฐๅๅๅผน๏ผๅๅผน**ไธ็ ดไธๅ้ซ็น**ๆถ็ๅๅบ็นใ++```+โ ไธๅ โ ไบๅ โ ๅๅผนไธ็ ดไธๅ้ซ็น+ \ /\+ \ / \+ \ / \+ \ / \+ โ โ+```++### czsc ไฟกๅทๅฝๆฐ++```python+from czsc.signals.cxt import cxt_second_bs_V230320++def get_signals(c):+ s = {}+ # ๅ็บฟ่พ ๅฉ่ฏๅซไบไนฐไบๅ+ s.update(cxt_second_bs_V230320(c, di=1, ma_type="SMA", timeperiod=20))+ return s+```++### ๅฎๆ่ฆ็น++- ไบไนฐๆฏไธไนฐ**ๆดๅฎๅ จ**๏ผไธไนฐๆฏๆๅบ๏ผๅฏ่ฝ็ปง็ปญ่ท๏ผ๏ผไบไนฐๆฏ็กฎ่ฎคๅ่ฝฌ+- ไบไนฐ็ๆญขๆไฝๆ็กฎ๏ผ่ฎพๅจไธไนฐไฝ็นไธๆน+- ไบๅๅ็๏ผๆญข็ไฝ่ฎพๅจไธๅ้ซ็นไธๆนdiff --git "a/agent/src/skills/chanlun/references/\346\240\270\345\277\203\346\246\202\345\277\265/\344\270\255\346\236\242.md" "b/agent/src/skills/chanlun/references/\346\240\270\345\277\203\346\246\202\345\277\265/\344\270\255\346\236\242.md"new file mode 100644index 000000000..b4a18aeeb--- /dev/null+++ "b/agent/src/skills/chanlun/references/\346\240\270\345\277\203\346\246\202\345\277\265/\344\270\255\346\236\242.md"@@ -0,0 +1,74 @@+## ไธญๆข๏ผZS / Zhong Shu๏ผ+----++ไธญๆขๆฏ็ผ ่ฎบ็ๆ ธๅฟๆฆๅฟต๏ผ็ฑ่ณๅฐ3็ฌๆๆ็**ไปทๆ ผ้ๅ ๅบๅ**ใไธญๆขไปฃ่กจๅค็ฉบๅ้็ๅ่กกๅบๅ๏ผไปทๆ ผ็ช็ ดไธญๆขๆๅณ็่ถๅฟๅฝขๆใ++### ๆๆๆกไปถ++่ณๅฐ3็ฌ๏ผ1ไธชๅฎๆด็ไธไธๆไธไธ่ฟๅจ๏ผ๏ผไธๅญๅจๅ ฑๅ็ไปทๆ ผ้ๅ ๅบ้ดใ++```+ โ โ+ / \ โ / \+ / \ / \ / \+ / \ / \ โ / \+ / ZG---\/---------\--/--- \+โ -----/\---------/\-----โ โ+ ZD / \ / \+ โ \ /+ \ /+ \ /+ โ+```++### ๅ ณ้ฎๅฑๆง++| ๅฑๆง | ๅ ฌๅผ | ่ฏดๆ |+| --- | --- | --- |+| `zg`๏ผไธๆฒฟ๏ผ | `min(bis[:3]ๅ็ฌ็high)` | ไธญๆขไธ่พน็ |+| `zd`๏ผไธๆฒฟ๏ผ | `max(bis[:3]ๅ็ฌ็low)` | ไธญๆขไธ่พน็ |+| `zz`๏ผไธญ่ฝด๏ผ | `zd + (zg - zd) / 2` | ไธญๆขไธญๅฟไปทๆ ผ |+| `gg`๏ผๆ้ซ๏ผ | ๆๆ็ฌ็ๆ้ซไปท | ไธญๆขๅบๅๆ้ซ |+| `dd`๏ผๆไฝ๏ผ | ๆๆ็ฌ็ๆไฝไปท | ไธญๆขๅบๅๆไฝ |+| `is_valid` | `zg > zd` | ไธญๆขๆฏๅฆๆๆ |++### ไธญๆขไธ่ถๅฟ++- **ไธญๆข้่ก**๏ผไปทๆ ผๅจไธญๆขๅ ๅๅค่ฟๅจ๏ผๆ ่ถๅฟ+- **ไธญๆขไธ็งป**๏ผๆฐไธญๆข็ zd > ๅไธญๆข็ zg โ ไธๅ่ถๅฟ+- **ไธญๆขไธ็งป**๏ผๆฐไธญๆข็ zg < ๅไธญๆข็ zd โ ไธ้่ถๅฟ+- **ไธญๆขๆฉๅฑ**๏ผๆฐ็ฌ็ช็ ดไธญๆขๅๅๅๅฐไธญๆขๅ โ ้่กๅปถ็ปญ++### czsc ๆฐๆฎ็ปๆ++```python+@dataclass+class ZS:+ bis: List[BI] # ๆๆไธญๆข็็ฌๅ่กจ++ @property+ def zg(self): ... # ไธๆฒฟ+ @property+ def zd(self): ... # ไธๆฒฟ+ @property+ def zz(self): ... # ไธญ่ฝด+ @property+ def gg(self): ... # ๆ้ซ+ @property+ def dd(self): ... # ๆไฝ+ @property+ def is_valid(self): ... # ๆฏๅฆๆๆ+```++### ไฝฟ็จ็คบไพ++```python+from czsc import CZSC, ZS++c = CZSC(bars)+# ็จๆ่ฟ็็ฌๆฃๆตไธญๆข+for i in range(len(c.bi_list) - 3):+ zs = ZS(bis=c.bi_list[i:i+3])+ if zs.is_valid:+ print(f"ไธญๆข: ZG={zs.zg:.0f} ZD={zs.zd:.0f} ZZ={zs.zz:.0f}")+```diff --git "a/agent/src/skills/chanlun/references/\346\240\270\345\277\203\346\246\202\345\277\265/\345\210\206\345\236\213.md" "b/agent/src/skills/chanlun/references/\346\240\270\345\277\203\346\246\202\345\277\265/\345\210\206\345\236\213.md"new file mode 100644index 000000000..e3a13e919--- /dev/null+++ "b/agent/src/skills/chanlun/references/\346\240\270\345\277\203\346\246\202\345\277\265/\345\210\206\345\236\213.md"@@ -0,0 +1,61 @@+## ๅๅ๏ผFX๏ผ+----++ๅๅๆฏ็ผ ่ฎบๆๅบ็ก็่ฏๅซๅๅ ๏ผ็ฑ่ฟ็ปญไธๆ น**ๅปๅ ๅซๅ**็K็บฟๆๆใ++### ๅปๅ ๅซๅค็++็ธ้ปไธคๆ นK็บฟๅญๅจๅ ๅซๅ ณ็ณป๏ผไธๆ นK็บฟ้ซไฝๅฎๅ จ่ขซๅฆไธๆ น่ฆ็๏ผๆถ๏ผ้ๅๅนถไธบไธๆ น๏ผ++- **ไธๅๆนๅ**๏ผๅไธคๆ นK็บฟไธญ่พๅคง็้ซ็นๅ่พๅคง็ไฝ็น+- **ไธ้ๆนๅ**๏ผๅ่พๅฐ็้ซ็นๅ่พๅฐ็ไฝ็น++### ้กถๅๅ๏ผMark.G๏ผ++```+ โโ+ โโ โโ+โโ โโ+```++ๆกไปถ๏ผ`k1.high < k2.high > k3.high` ไธ `k1.low < k2.low > k3.low`++่กจ็คบไธๆถจๅ้่กฐ็ซญ๏ผๅฏ่ฝ่ฝฌ่ทใ++### ๅบๅๅ๏ผMark.D๏ผ++```+โโ โโ+ โโ โโ+ โโ+```++ๆกไปถ๏ผ`k1.high > k2.high < k3.high` ไธ `k1.low > k2.low < k3.low`++่กจ็คบไธ่ทๅ้่กฐ็ซญ๏ผๅฏ่ฝ่ฝฌๆถจใ++### czsc ๆฐๆฎ็ปๆ++```python+@dataclass+class FX:+ symbol: str # ๆ ็ไปฃ็ + dt: datetime # ๅๅๆถ้ด๏ผๅไธญ้ดK็บฟๆถ้ด๏ผ+ mark: Mark # Mark.G๏ผ้กถ๏ผ/ Mark.D๏ผๅบ๏ผ+ high: float # ๅๅๆ้ซไปท+ low: float # ๅๅๆไฝไปท+ fx: float # ๅๅๅผ๏ผ้กถๅhigh๏ผๅบๅlow๏ผ+ elements: List[NewBar] # ๆๆๅๅ็ไธๆ นๅปๅ ๅซK็บฟ+```++### ไฝฟ็จ็คบไพ++```python+from czsc import CZSC++c = CZSC(bars)+# ็ฌ็็ซฏ็นๅฐฑๆฏๅๅ+for bi in c.bi_list:+ print(f"่ตท็นๅๅ: {bi.fx_a.mark.value} {bi.fx_a.dt}")+ print(f"็ป็นๅๅ: {bi.fx_b.mark.value} {bi.fx_b.dt}")+```diff --git "a/agent/src/skills/chanlun/references/\346\240\270\345\277\203\346\246\202\345\277\265/\347\254\224.md" "b/agent/src/skills/chanlun/references/\346\240\270\345\277\203\346\246\202\345\277\265/\347\254\224.md"new file mode 100644index 000000000..400da9f13--- /dev/null+++ "b/agent/src/skills/chanlun/references/\346\240\270\345\277\203\346\246\202\345\277\265/\347\254\224.md"@@ -0,0 +1,74 @@+## ็ฌ๏ผBI๏ผ+----++็ฌๆฏ็ผ ่ฎบ็ๅบๆฌ่ตฐๅฟๅๅ ๏ผ่ฟๆฅ็ธ้ป็้กถๅๅๅๅบๅๅใ++### ๆๆๆกไปถ++1. **ๆนๅ**๏ผไธๅ็ฌ๏ผๅบโ้กถ๏ผ๏ผไธ้็ฌ๏ผ้กถโๅบ๏ผ+2. **้กถๅบไบคๆฟ**๏ผ็ธ้ปไธค็ฌ็็ซฏ็นๅๅๅฟ ้กปไบคๆฟ๏ผ้กถ-ๅบ-้กถ-ๅบ...๏ผ+3. **ๆ ๅ ๅซ**๏ผไธคไธชๅๅไน้ดไธ่ฝๅญๅจไปทๆ ผๅบ้ดๅ ๅซ+4. **ๆๅฐ้ฟๅบฆ**๏ผๅปๅ ๅซๅ็K็บฟๆฐไธๅฐไบ้ๅผ๏ผ้ป่ฎค7ๆ น๏ผ++### ไธๅ็ฌ++```+ โ้กถๅๅ+ /+ /+ /+ /+โๅบๅๅ+```++`fx_a.mark = Mark.D`๏ผ`fx_b.mark = Mark.G`๏ผไธ `fx_b.fx > fx_a.fx`++### ไธ้็ฌ++```+โ้กถๅๅ+ \+ \+ \+ \+ โๅบๅๅ+```++`fx_a.mark = Mark.G`๏ผ`fx_b.mark = Mark.D`๏ผไธ `fx_b.fx < fx_a.fx`++### ๅ ณ้ฎๅฑๆง++| ๅฑๆง | ่ฏดๆ |+| --- | --- |+| `direction` | Direction.Up๏ผไธๅ๏ผ/ Direction.Down๏ผไธ้๏ผ |+| `high` | ็ฌ็ๆ้ซไปท |+| `low` | ็ฌ็ๆไฝไปท |+| `length` | ็ฌๅ ๅซ็ๅปๅ ๅซK็บฟๆฐ |+| `power_price` | ็ฌ็ไปทๆ ผๅๅบฆ๏ผ้ซไฝๅทฎ๏ผ |+| `slope` | ็ฌ็ๆ็ |+| `angle` | ็ฌ็่งๅบฆ |++### czsc ๆฐๆฎ็ปๆ++```python+@dataclass+class BI:+ symbol: str+ fx_a: FX # ่ตท็นๅๅ+ fx_b: FX # ็ป็นๅๅ+ fxs: List[FX] # ็ป่ฟ็ๆๆๅๅ+ direction: Direction # Up / Down+ bars: List[NewBar] # ็ฌๅ ็ๅปๅ ๅซK็บฟ+```++### ไฝฟ็จ็คบไพ++```python+from czsc import CZSC++c = CZSC(bars)+for bi in c.bi_list[-5:]:+ d = "โ" if bi.direction.value == "Up" else "โ"+ print(f"{d} {bi.fx_a.dt:%m-%d} -> {bi.fx_b.dt:%m-%d} "+ f"H={bi.high:.0f} L={bi.low:.0f} len={bi.length}")+```diff --git a/agent/src/skills/commodity-analysis/SKILL.md b/agent/src/skills/commodity-analysis/SKILL.mdnew file mode 100644index 000000000..6d502d261--- /dev/null+++ b/agent/src/skills/commodity-analysis/SKILL.md@@ -0,0 +1,205 @@+---+name: commodity-analysis+description: Commodity analysis (oil supply-demand balance / gold pricing / copper as an economic predictor / inventory cycles / futures premium-discount structure / seasonality), generating directional commodity signals.+---+# Commodity Analysis++## Overview++Analyze commodities from four dimensions โ supply-demand balance, pricing model, inventory cycle, and futures structure โ and output directional signals suitable for backtesting. Focuses on crude oil (global pricing anchor), gold (safe haven + inflation hedge), and copper (economic barometer).++## Core Concepts++### 1. Crude Oil Supply-Demand Balance++**Key supply-side variables:**++| Variable | Data Source | Frequency | Direction of Impact |+|------|--------|------|---------|+| OPEC production | OPEC monthly report | Monthly | Production cuts โ oil price โ |+| US shale output | EIA weekly report | Weekly | Higher output โ oil price โ |+| Rig count (Baker Hughes) | Baker Hughes | Weekly | Leads production by 3-6 months |+| Strategic Petroleum Reserve (SPR) | EIA | Weekly | SPR release โ short-term oil price โ |++**Key demand-side variables:**+- IEA global oil demand forecast (quarterly)+- China crude imports (customs monthly data)+- US gasoline demand (EIA weekly report, implied demand)+- Global PMI (leads demand by 1-2 months)++**Supply-demand balance signals:**++```python+# Simplified supply-demand judgment+if opec_compliance > 90% and us_rig_count_declining:+ supply_signal = "tight" # bullish for oil+elif opec_compliance < 80% and us_production_rising:+ supply_signal = "loose" # bearish for oil++if global_pmi > 50 and china_import_yoy > 5%:+ demand_signal = "strong" # bullish for oil+elif global_pmi < 48 and china_import_yoy < 0:+ demand_signal = "weak" # bearish for oil+```++### 2. Gold Pricing Framework++**Four-factor model:**++| Factor | Weight | Logic | Indicator |+|------|------|------|------|+| Real rates | 40% | Real rates โ โ lower opportunity cost of holding gold โ gold โ | 10Y TIPS yield |+| US dollar index | 25% | USD โ โ gold becomes cheaper in pricing terms โ gold โ | DXY |+| Safe-haven demand | 20% | Risk โ โ safe-haven buying โ gold โ | VIX + geopolitical risk index |+| Central-bank buying | 15% | Central-bank purchases โ structural demand support | WGC quarterly report |++**Practical rules:**+- 10Y TIPS < 0%: strong support for gold (negative real rates mean negative holding cost)+- 10Y TIPS > 2%: pressure on gold (positive real rates reduce attractiveness)+- Correlation between DXY and gold is around -0.6, but not absolute (they both rose in 2022 due to safe-haven demand)+- Central-bank purchases >1000 tons / year (2022-2023 level): long-term structural bullish support++### 3. Dr. Copper as an Economic Predictor++**Copper as a leading indicator:**+- YoY copper-price change leads industrial production by about 2-3 months+- Copper / gold ratio is highly positively correlated with the US 10Y Treasury yield (`r > 0.7`)+- Copper breakout above the prior high confirms economic recovery++**Copper fundamental tracking:**++| Indicator | Data Source | Threshold |+|------|--------|------|+| LME copper inventory | LME daily report | <150k tons = tight |+| SHFE copper inventory | SHFE weekly report | WoW decline >10% = tight |+| Copper concentrate TC/RC | SMM | TC < $30/ton = tight mining supply |+| China copper imports | Customs monthly report | YoY growth >10% = strong demand |++### 4. Inventory Cycle Analysis++**Visible inventory vs hidden inventory:**+- Visible inventory: published by exchanges (LME / SHFE / COMEX), transparent and trackable+- Hidden inventory: bonded areas / trader warehouses, opaque but potentially larger+- The true turning point in prices is the turning point in total inventory++**Four inventory-cycle stages (using copper as example):**++```+Active restocking (priceโ volumeโ) -> Passive restocking (priceโ volumeโ) -> Active destocking (priceโ volumeโ) -> Passive destocking (priceโ volumeโ)+ mid bull market late bull market mid bear market late bear / early bull market+```++**Signal mapping:**++| Stage | Inventory Direction | Price Direction | Trading Signal |+|------|---------|---------|---------|+| Passive destocking | โ | โ | Long (best buying point) |+| Active restocking | โ | โ | Keep long positions |+| Passive restocking | โ | โ | Close longs (warning) |+| Active destocking | โ | โ | Short or stay neutral |++### 5. Futures Premium / Discount Structure++**Contango (futures > spot, normal market):**+- Supply is abundant, and the market prices in carrying costs (storage + funding)+- Roll yield is negative (`roll yield < 0`), unfavorable for long holders+- Deep contango (`far month - near month > 5%`) = severe oversupply++**Backwardation (futures < spot, inverted market):**+- Supply is tight, and spot premium reflects strong immediate demand+- Roll yield is positive (`roll yield > 0`), favorable for long holders+- Deep backwardation (`near month - far month > 3%`) = squeeze or extreme shortage++**Term-structure signal:**++```python+# Spread ratio = (front month - second month) / front month+spread_ratio = (front_month - second_month) / front_month++if spread_ratio > 0.02: # backwardation > 2%+ signal = "strongly bullish" # spot shortage+elif spread_ratio < -0.03: # contango > 3%+ signal = "bearish" # oversupply+else:+ signal = "neutral"+```++### 6. Seasonality++**Oil seasonality:**+- March-May: refinery maintenance ends + summer inventory build โ seasonal rise (ahead of the "driving season")+- September-October: hurricane season (Gulf of Mexico) โ supply disruption โ higher volatility+- November-December: heating-oil demand โ stronger diesel crack spread++**Gold seasonality:**+- January-February: Lunar New Year + Indian wedding-season physical demand โ relatively strong+- July-August: traditional soft season โ relatively weak+- October-November: Diwali + Christmas restocking โ relatively strong++**Copper seasonality:**+- March-April: China construction season starts โ demand recovery+- June-July: off-season inventory buildup โ pressure+- September-October: "Golden September, Silver October" โ demand recovery++## Analysis Framework++### Five-Step Commodity Analysis++1. **Supply-demand sets direction**: is the balance in surplus or shortage? Which way are marginal variables moving?+2. **Inventory sets rhythm**: which inventory-cycle stage are we in? Is a turning point close?+3. **Term structure confirms**: contango or backwardation? Does it confirm the supply-demand judgment?+4. **Seasonality overlay**: is seasonality currently a tailwind or a headwind?+5. **Macro validation**: do the dollar / rates / risk appetite support the directional judgment?++### Composite Scoring Template++```python+commodity_score = {+ "supply_demand": +1, # supply-demand is tight+ "inventory_cycle": +2, # passive destocking (best stage)+ "term_structure": +1, # mild backwardation+ "seasonality": 0, # neutral seasonality+ "macro_env": -1, # stronger dollar is a headwind+}+# Total score = +3/5 = +0.6 -> bullish bias, but not a strong signal+```++## Output Format++```+## Commodity Analysis Report โ [Commodity Name]++### Supply-Demand Structure+- Supply side: [surplus / balanced / shortage] โ [specific data]+- Demand side: [strong / stable / weak] โ [specific data]+- Balance table: [inventory build X tons / drawdown X tons]++### Inventory Cycle+- Current stage: [active restocking / passive restocking / active destocking / passive destocking]+- Visible inventory: [LME X tons, SHFE X tons, WoW change]++### Term Structure+- Front-back spread: [contango X% / backwardation X%]+- Roll yield: [positive / negative]++### Composite Score+| Dimension | Score(-2~+2) | Basis |+|------|------------|------|+| Supply-demand | +1 | OPEC compliance rate 92% |+| Inventory | +2 | LME inventory hit 18-month low |++### Trading Direction+- Direction: [bullish / bearish / neutral]+- Confidence: [high / medium / low]+- Risk points: [specific risks]+```++## Notes++- Commodity data sources are fragmented (EIA / OPEC / LME / SHFE, etc.). This skill provides the analytical framework; data should be retrieved through `web-reader` or entered manually+- Futures prices include roll costs, so direct comparison across different contracts must account for expiry-roll effects+- Seasonal patterns are statistical averages and may be completely overwhelmed by fundamentals in a given year+- Gold has both commodity and financial attributes, and the financial side (rates / dollar) usually dominates short-term pricing+- Copperโs financial characteristics have strengthened since 2020 (copper futures are used as a macro hedge), so pure fundamental analysis may be insufficient+- Inventory data is lagged (hidden inventories cannot be tracked in real time), so cross-check with price and basis behavior+- This framework is for research backtesting only and does not constitute investment advicediff --git a/agent/src/skills/convertible-bond/SKILL.md b/agent/src/skills/convertible-bond/SKILL.mdnew file mode 100644index 000000000..cb566ae7d--- /dev/null+++ b/agent/src/skills/convertible-bond/SKILL.md@@ -0,0 +1,258 @@+---+name: convertible-bond+description: A่กๅฏ่ฝฌๅบๅๆโโ่ฝฌ่ก/็บฏๅบ/ๆๆไธ็ปดไผฐๅผใไธไฟฎ/ๅผบ่ต/ๅๅฎๅๅผใๅไฝ็ญ็ฅไธ่ฝฌๅบ่ฝฎๅจ้ๅบๆกๆถ+---++# A่กๅฏ่ฝฌๅบๅๆ++## ๆฆ่ฟฐ++A่กๅฏ่ฝฌๅบๆฏๅ ทๆ"ๅบๅบไฟๆค+่ก็ฅจๆๆ"็นๅพ็ๆททๅๅ็งใๆฌskill่ฆ็ๅฏ่ฝฌๅบไธ็ปดไผฐๅผใๆกๆฌพๅๅผๅๆใๅไฝ็ญ็ฅๅ่ฝฎๅจ้ๅบๆกๆถใ++## ๅฏ่ฝฌๅบๅบ็กๆฆๅฟต++### ๆ ธๅฟ่ฆ็ด++| ่ฆ็ด | ่ฏดๆ | ็คบไพ |+|------|------|------|+| ้ขๅผ | 100ๅ | - |+| ็ฅจ้ขๅฉ็ | ้ๅข๏ผ้ๅธธ0.3%-2.0% | ็ฌฌ1ๅนด0.4%...็ฌฌ6ๅนด2.0% |+| ่ฝฌ่กไปท | ่ฝฌๆขๆ่ก็ฅจ็ไปทๆ ผ | ่ฝฌ่กไปท15.00ๅ |+| ๅฐๆๆ้ | ้ๅธธ6ๅนด | 2024-2030 |+| ๅฐๆ่ตๅไปท | ้ขๅผ+ๆๅไธๅนดๅฉๆฏ+่กฅๅฟ | 110-115ๅ |+| ๅๅฎๆกๆฌพ | ่กไปทๆ็ปญไฝไบ่ฝฌ่กไปท70%ๅฏๅๅฎ | ่ฟ็ปญ30ไธชไบคๆๆฅไธญ30ๅคฉ<70% |+| ๅผบ่ตๆกๆฌพ | ่กไปทๆ็ปญ้ซไบ่ฝฌ่กไปท130%ๅฏๅผบ่ต | ่ฟ็ปญ30ไธชไบคๆๆฅไธญ15ๅคฉ>130% |+| ไธไฟฎๆกๆฌพ | ๅฏไปฅไธ่ฐ่ฝฌ่กไปท | ่ฟ็ปญ30ไธชไบคๆๆฅไธญ15ๅคฉ<85% |++### ๅ ณ้ฎๆๆ ++```+่ฝฌ่กไปทๅผ = ้ขๅผ / ่ฝฌ่กไปท ร ๆญฃ่กไปทๆ ผ+ = 100 / 15.00 ร 18.00 = 120.00ๅ ++่ฝฌ่กๆบขไปท็ = (่ฝฌๅบไปทๆ ผ - ่ฝฌ่กไปทๅผ) / ่ฝฌ่กไปทๅผ ร 100%+ = (125 - 120) / 120 ร 100% = 4.17%++็บฏๅบไปทๅผ = ฮฃ(็ฅจๆฏ / (1+r)^t) + ๅฐๆ่ตๅไปท / (1+r)^n+ โ 85-95ๅ ๏ผๅๅณไบๅฉไฝๆ้ๅๅฉ็๏ผ++็บฏๅบๆบขไปท็ = (่ฝฌๅบไปทๆ ผ - ็บฏๅบไปทๅผ) / ็บฏๅบไปทๅผ ร 100%+```++## ไธ็ปดไผฐๅผไฝ็ณป++### 1. ็บฏๅบไปทๅผ๏ผๅบๅบ๏ผ++```python+def bond_floor(coupon_rates: list, years_remaining: float,+ redemption_price: float = 110, yield_rate: float = 0.03) -> float:+ """+ Args:+ coupon_rates: ๅฉไฝๅๅนด็ฅจ้ขๅฉ็ๅ่กจ๏ผๅฆ [0.8, 1.0, 1.5, 2.0]+ years_remaining: ๅฉไฝๅนด้+ redemption_price: ๅฐๆ่ตๅไปท+ yield_rate: ๆ็ฐ็๏ผๅๆไฟก็จๅบๆถ็็๏ผ็บฆ2.5-4%๏ผ+ Returns:+ ็บฏๅบไปทๅผ+ """+ pv = sum(c * 100 / (1 + yield_rate)**i for i, c in enumerate(coupon_rates, 1))+ pv += redemption_price / (1 + yield_rate)**len(coupon_rates)+ return pv+```++**็บฏๅบไปทๅผๅซไน**๏ผ+- ็บฏๅบไปทๅผ่ถ้ซ โ ๅบๅบไฟๆค่ถๅผบ โ ไธ่ท็ฉบ้ดๆ้+- ้ๅธธ็บฏๅบไปทๅผๅจ 85-100 ไน้ด+- ่ฝฌๅบไปทๆ ผ่ทๅฐ็บฏๅบไปทๅผ้่ฟ = "ๅบๆง่ฝฌๅบ"๏ผๅฎๅ จไฝๅผนๆงๅฐ++### 2. ่ฝฌ่กไปทๅผ๏ผ่กๆง๏ผ++```+่ฝฌ่กไปทๅผ = 100 / ่ฝฌ่กไปท ร ๆญฃ่กๅฝๅไปท++ๅฝฑๅๅ ๅญ:+- ๆญฃ่กไปทๆ ผ๏ผๆญฃ็ธๅ ณ๏ผ+- ่ฝฌ่กไปท๏ผ่ด็ธๅ ณ๏ผ+- ไธไฟฎ่ฝฌ่กไปท โ ่ฝฌ่กไปทๅผไธๅ+```++### 3. ๆๆไปทๅผ++```+ๆๆไปทๅผ = ่ฝฌๅบไปทๆ ผ - max(็บฏๅบไปทๅผ, ่ฝฌ่กไปทๅผ)++ๆๆไปทๅผ้ซ โ ๅธๅบ็ๅฅฝๆญฃ่กไธๆถจๆฝๅ ๆ ็ๅฅฝไธไฟฎๆฆ็+ๆๆไปทๅผไฝ/่ด โ ไพฟๅฎ๏ผๅฏ่ฝๆๆบไผ๏ผ+```++### ไธ็ปดๅคๆญ็ฉ้ต++| ่ฝฌ่กไปทๅผ | ็บฏๅบไปทๅผ | ่ฝฌๅบ็ฑปๅ | ็ญ็ฅ |+|---------|---------|---------|------|+| >120 | ไธ้่ฆ | ๅ่กๅ | ่ท้ๆญฃ่ก๏ผๅ ณๆณจๅผบ่ต้ฃ้ฉ |+| 100-120 | ไธ้่ฆ | ๅนณ่กกๅ | ่ฟๅฏๆป้ๅฏๅฎ๏ผๆไฝณๅบ้ด |+| <100 | >90 | ๅๅบๅ | ๆๆๅๅฉๆฏ๏ผ็ญไธไฟฎ/ๆญฃ่กๅๅผน |+| <80 | <85 | ๅฐๅขๅ | ้ซ้ฃ้ฉ๏ผๅฏ่ฝๆไฟก็จ้ฃ้ฉ |++## ๆกๆฌพๅๅผๅๆ++### ไธไฟฎๅๅผ++**่งฆๅๆกไปถ**๏ผ่ฟ็ปญ30ไธชไบคๆๆฅไธญ15ๅคฉๆญฃ่กๆถ็ไปทไฝไบๅฝๆ่ฝฌ่กไปท็85%ใ++```+ไธไฟฎๆฆ็่ฏไผฐ:+1. ่งฆๅๆกไปถๅทฒๆปก่ถณ/ๆฅ่ฟๆปก่ถณ โ ้ซๆฆ็+2. ๅคง่กไธๆๆๅคง้่ฝฌๅบๆช่ฝฌ่ก โ ้ซๆฆ็๏ผๆๅจๅไธไฟฎ๏ผ+3. ๅ ฌๅธๅณๅฐ้ขไธดๅๅฎ โ ้ซๆฆ็๏ผไธไฟฎ้ฟๅ ๅๅฎ๏ผ+4. ๅ ฌๅธ็ฐ้ๅ ่ฃใๆ ่ฟๅบๅๅ โ ไฝๆฆ็๏ผๆ ๅจๅไธไฟฎ๏ผ+5. ่ฝฌ่กไผๅคงๅน ็จ้่กๆ โ ไฝๆฆ็๏ผๆงๅถๆ้กพ่๏ผ++ไธไฟฎๅๅฝฑๅ:+- ่ฝฌ่กไปทๅผ = 100 / ๆฐ่ฝฌ่กไปท ร ๆญฃ่กไปท๏ผ้ๅธธ็ฌ้ดไธๅ+- ่ฝฌๅบไปทๆ ผ้ๅธธไธๆถจ 5-15%+- ไฝๆญฃ่กๅฏ่ฝๅ ็จ้้ขๆไธ่ท+```++### ๅผบ่ตๅๅผ++**่งฆๅๆกไปถ**๏ผ่ฟ็ปญ30ไธชไบคๆๆฅไธญ15ๅคฉๆญฃ่กๆถ็ไปท้ซไบ่ฝฌ่กไปท็130%ใ++```+ๅผบ่ตๅบๅฏน:+1. ๅ ฌๅๅผบ่ต โ ๅฟ ้กปๅจ่ตๅๆฅๅ่ฝฌ่กๆๅๅบ+2. ่ตๅไปท้ๅธธ 100.XX ๅ โ ่ฟไฝไบ่ฝฌ่กไปทๅผ+3. ไธ่ฝฌ่ก = ๅทจไบ๏ผๅฆ่ฝฌๅบไปท160ๅ ๏ผ่ตๅไปท100ๅ ๏ผ++ๅผบ่ตไฟกๅท:+- ๆญฃ่กไปทๆ็ปญ>่ฝฌ่กไปท130% โ ๆฐๅคฉๆฐ+- ๅ ฌๅธๅ ฌๅ"ไธๆๅ่ตๅ" โ ๆๆถๅฎๅ จ+- ่ฝฌ่ก่ฟๅบฆๅทฒ>90% โ ๅฏ่ฝไธ่ตๅ+```++### ๅๅฎๅๅผ++**่งฆๅๆกไปถ**๏ผๆญฃ่กไปท่ฟ็ปญ30ๅคฉไฝไบ่ฝฌ่กไปท็70%๏ผๆๅ2ไธช่ฎกๆฏๅนดๅบฆ๏ผใ++```+ๅๅฎ = ๆ่ต่ ๆๆไปฅ้ขๅผ+ๅฉๆฏๅๅ็ปๅ ฌๅธ++ๅ ฌๅธๅบๅฏน:+1. ไธไฟฎ่ฝฌ่กไปท โ ้ฟๅ ๅๅฎ+2. ๆๅ่กไปท โ ้ฟๅ ่งฆๅๆกไปถ+3. ๆฅๅๅๅฎ โ ๆ้ฑ่ฟๅบ++ๆ่ต่ ็ญ็ฅ:+- ๅจๅๅฎๆๆๆ็บฏๅบไปทๅผ้่ฟ็่ฝฌๅบ โ ไธๆๅๅฎไฟๅบ+- ไธไฟฎ้ขๆ โ ่ตไธไฟฎๆถ็+```++## ๅไฝ็ญ็ฅ++### ็ญ็ฅ้ป่พ++```+ๅไฝๅผ = ่ฝฌๅบไปทๆ ผ + ่ฝฌ่กๆบขไปท็ ร 100++ๅไฝๅผ่ถไฝ โ ไปทๆ ผไฝ + ๆบขไปท็ไฝ โ ๆงไปทๆฏ้ซ++็ญ้ๆกไปถ:+1. ๅไฝๅผ < 130๏ผไธฅๆ ผ๏ผๆ < 150๏ผๅฎฝๆพ๏ผ+2. ่ฝฌๅบไปทๆ ผ < 115๏ผๅฎๅ จ๏ผ+3. ่ฝฌ่กๆบขไปท็ < 30%๏ผๅผนๆง๏ผ+4. ๅฉไฝๆ้ > 1ๅนด๏ผ้ฟๅ ๅฐๆๅๅ๏ผ+5. ไฟก็จ่ฏ็บง โฅ AA-๏ผ้ฟๅ ไฟก็จ้ฃ้ฉ๏ผ+```++### ๅไฝ้ๅบ็คบไพ++```markdown+### ๅไฝๆๅ Top 10++| ๆๅ | ่ฝฌๅบๅ | ไปทๆ ผ | ๆบขไปท็ | ๅไฝๅผ | ่ฏ็บง | ๅฉไฝๅนด้ |+|------|--------|------|--------|--------|------|---------|+| 1 | XX่ฝฌๅบ | 105.2 | 12.3% | 117.5 | AA | 3.2ๅนด |+| 2 | YY่ฝฌๅบ | 108.5 | 15.6% | 124.1 | AA | 2.8ๅนด |+| ... | ... | ... | ... | ... | ... | ... |+```++### ๅไฝ็ญ็ฅๅๆตๆกๆถ++```python+class ConvertibleBondEngine:+ """ๅไฝ็ญ็ฅไฟกๅทๅผๆ"""+ def generate(self, data_map):+ # ๆฏๆๆซ่ฎก็ฎๅไฝๅผ+ # ้ Top N ็ญๆ้ ็ฝฎ+ # ไธๆๅ่ฐไป+ pass+```++**ๅๅฒ่กจ็ฐๅ่**๏ผA่กๅฏ่ฝฌๅบ๏ผ๏ผ+- ๅนดๅๆถ็๏ผ10-15%+- ๆๅคงๅๆค๏ผ-8% ~ -15%+- Sharpe๏ผ1.0-1.5+- ๅ ณ้ฎ้ฃ้ฉ๏ผไฟก็จ้ฃ้ฉ๏ผๅฐ็่ฝฌๅบ่ฟ็บฆ๏ผ++## ่ฝฌๅบ่ฝฎๅจ็ญ็ฅ++### ่ฝฎๅจ็ปดๅบฆ++| ็ปดๅบฆ | ๆๆ | ไฟกๅท |+|------|------|------|+| ไปทๆ ผ | ่ฝฌๅบไปทๆ ผ | <110่ถ ไพฟๅฎ, 110-120ๅ็, >130ๅ่ดต |+| ๅผนๆง | ่ฝฌ่กๆบขไปท็ | <10%้ซๅผนๆง, 10-30%ไธญ็ญ, >50%็บฏๅบ |+| ๅฎๅ จ | ็บฏๅบไปทๅผ/ไปทๆ ผ | >0.9ๅฎๅ จ่พน้ ้ซ |+| ไธไฟฎ | ไธไฟฎๆฆ็ | ๅคง่กไธๆไป+ๆฅ่ฟ่งฆๅ=้ซๆฆ็ |+| ๆญฃ่ก | ๆญฃ่กๅจ้ | ๆญฃ่ก่ถๅฟๅๅฅฝ=ๅผนๆงๆฅๆบ |++### ่ฝฎๅจๆต็จ++```+1. ๅ จๅธๅบ็ญ้๏ผๅ้ค: ๅทฒ้ๅธ/ๅทฒๅ ฌๅๅผบ่ต/่ฏ็บง<A+๏ผ+2. ่ฎก็ฎๅ็ปดๅบฆๅพๅ+3. ็ปผๅๆๅๆๅ+4. ้ Top 15-20 ๅช็ญๆ้ ็ฝฎ+5. ๆฏๆ่ฐไปไธๆฌก+```++## ่พๅบๆ ผๅผ++```markdown+## ๅฏ่ฝฌๅบๅๆ: [่ฝฌๅบๅ็งฐ/ไปฃ็ ]++### ๅบๆฌไฟกๆฏ+| ๆๆ | ๅผ |+|------|-----|+| ๅฝๅไปท | 112.50 |+| ่ฝฌ่กไปทๅผ | 98.30 |+| ็บฏๅบไปทๅผ | 92.15 |+| ่ฝฌ่กๆบขไปท็ | 14.4% |+| ็บฏๅบๆบขไปท็ | 22.1% |+| ๅไฝๅผ | 126.9 |+| ๅฉไฝๅนด้ | 3.5ๅนด |+| ่ฏ็บง | AA |++### ไธ็ปดไผฐๅผ+- **ๅบๅบไฟๆค**: ็บฏๅบไปทๅผ92.15, ไธ่ท็ฉบ้ด็บฆ18%ๆไฟๆค+- **่กๆงๅผนๆง**: ๆบขไปท็14.4%ๅไฝ, ๆญฃ่กไธๆถจ10%่ฝฌๅบ้ข่ฎกๆถจ8%+- **ๆๆไปทๅผ**: ่ฝฌๅบไปทๆ ผ-max(็บฏๅบ,่ฝฌ่ก)=14.2, ๅ็++### ๆกๆฌพๅๅผ+- **ไธไฟฎๆฆ็**: ไธญ๏ผๆญฃ่ก่ทไธไฟฎ่งฆๅไปท่ฟๆ12%็ฉบ้ด๏ผ+- **ๅผบ่ต้ฃ้ฉ**: ไฝ๏ผๆญฃ่ก่ทๅผบ่ต็บฟ่ฟๆ35%๏ผ+- **ๅๅฎไฟๆค**: ๅฐๆช่ฟๅ ฅๅๅฎๆ++### ๆ่ตๅปบ่ฎฎ+ๅไฝๅผ126.9๏ผๅฑไบๆงไปทๆฏๅบ้ดใๅปบ่ฎฎ...+```++## ๆณจๆไบ้กน++1. **ไฟก็จ้ฃ้ฉๆฏๆๅคง้ท**๏ผA่กๅทฒๅบ็ฐๅฏ่ฝฌๅบ่ฟ็บฆๆกไพ๏ผๆ็น่ฝฌๅบ็ญ๏ผ๏ผไฝ่ฏ็บง่ฝฌๅบ่ฐจๆ +2. **ๅผบ่ตๅ่ฎกๆถ่ฆ็ฏ็ดง**๏ผๅ ฌๅๅผบ่ตๅไธ่ฝฌ่ก/ไธๅๅบไผๅทจไบ๏ผๆฏๅคฉๆฃๆฅๅผบ่ตๅ ฌๅ+3. **ๆตๅจๆง้ฃ้ฉ**๏ผๅฐ็่ฝฌๅบๆฅๆไบค้ขๅฏ่ฝไธ่ถณ100ไธ๏ผๅคง่ต้่ฟๅบๅฐ้พ+4. **ๆกๆฌพๅทฎๅผ**๏ผๆฏๅช่ฝฌๅบๆกๆฌพ็ป่ไธๅ๏ผไธไฟฎๆฏไพใๅผบ่ตๅคฉๆฐ๏ผ๏ผๅฟ ้กป้ๅชๆ ธๆฅ+5. **ๅฐๆไธ่ฝฌ่ก**๏ผๅฆๆๅฐๆๆฒก่ฝฌ่ก๏ผๅชๆฟๅ้ขๅผ+ๅฉๆฏ๏ผ110ๅทฆๅณ๏ผ๏ผ้ซไปทไนฐๅ ฅไผไบ+6. **ๆฐๆฎ่ทๅ**๏ผๅฏ่ฝฌๅบๆฐๆฎ้้่ฟtushare็ๅฏ่ฝฌๅบๆฅๅฃ่ทๅ๏ผOHLCVๆฐๆฎๅฏ็จๆ ๅๆฅๅฃ+7. **ๅๆตๅฑ้**๏ผๅฏ่ฝฌๅบๅๆต้่ฆ่ฝฌ่กไปทใๅผบ่ต/ๅๅฎไฟกๆฏ็ญ้ขๅคๆฐๆฎ๏ผๆฏ่ก็ฅจๅๆตๅคๆdiff --git a/agent/src/skills/corporate-events/SKILL.md b/agent/src/skills/corporate-events/SKILL.mdnew file mode 100644index 000000000..0df5ee849--- /dev/null+++ b/agent/src/skills/corporate-events/SKILL.md@@ -0,0 +1,267 @@+---+name: corporate-events+description: ๅ ฌๅธไบไปถ้ฉฑๅจๅๆ๏ผๅนถ่ดญๅฅๅฉไปทๅทฎ่ฎก็ฎใๅคง่กไธๅขๅๆไฟกๅทใ่กๆๆฟๅฑ่งฃ่ฏปใๅฎๅข้ ่กๅฝฑๅ่ฏไผฐใA่กST/้ๅธ้ข่ญฆ+---++# ๅ ฌๅธไบไปถ้ฉฑๅจๅๆ++## ๆฆ่ฟฐ++้่ฟๅ ฌๅธๅฑ้ข็้ๅคงไบไปถ๏ผๅนถ่ดญใๅขๅๆใ่กๆๆฟๅฑใๅ่่ต็ญ๏ผๆๅปบไบไปถ้ฉฑๅจไบคๆ็ญ็ฅใๆ ธๅฟ้ป่พ๏ผไบไปถๅ ฌๅๅ ๅซๅข้ไฟกๆฏ๏ผๅธๅบๆถๅ้่ฆๆถ้ด๏ผไบไปถๅๅๅญๅจ็ณป็ปๆง่ถ ้ขๆถ็ใ++้็จๅบๆฏ๏ผ+- ๅนถ่ดญ้็ปๅฅๅฉ๏ผA่กๅๅฃณ/่ตไบงๆณจๅ ฅ/ๅธๆถๅๅนถ๏ผ+- ๅคง่กไธ/้ซ็ฎกๅขๅๆ็ไฟกๅทๆๅ+- ่กๆๆฟๅฑ็่กๆไปทไธ่งฃ้ๆกไปถๅๆ+- ๅฎๅข/้ ่ก/ๅฏไบคๅบ็ๆไปทๅฅๅฉ+- ST/*ST/้ๅธ้ข่ญฆ็่ง้ฟไธๆๆบ++## ๆ ธๅฟๆฆๅฟต++### ๅนถ่ดญๅฅๅฉ๏ผMerger Arbitrage๏ผ++**A่กๅนถ่ดญ็น่ฒ**๏ผ+| ็ฑปๅ | ้ข็ | ่ถ ้ขๆถ็ | ้ฃ้ฉ |+|------|------|----------|------|+| ๅๅฃณไธๅธ | ไฝ(ๆณจๅๅถๅๅๅฐ) | ้ซ(30-100%) | ๆ้ซ(ๅฎกๆนๅคฑ่ดฅ) |+| ่ตไบงๆณจๅ ฅ | ไธญ | ไธญ(10-30%) | ้ซ(ไผฐๅผ/ๅฎกๆน) |+| ๅธๆถๅๅนถ | ไฝ | ไฝ(5-15%) | ไฝ(ๅทฒ่พพๅ่ฎฎ) |+| ่ฆ็บฆๆถ่ดญ | ไฝ | ไฝ(3-8%) | ๆไฝ |++**ไปทๅทฎ่ฎก็ฎ**๏ผ+```+ๅนถ่ดญๅฅๅฉไปทๅทฎ = (่ฆ็บฆไปท - ๅฝๅไปท) / ๅฝๅไปท+ๅนดๅๆถ็ = ไปทๅทฎ / ้ข่ฎกๅฎๆๆถ้ด(ๅนด)++็คบไพ:+ Aๅ ฌๅธ่ฆ็บฆๆถ่ดญBๅ ฌๅธ, ่ฆ็บฆไปท25ๅ , Bๅฝๅ่กไปท23.5ๅ + ไปทๅทฎ = (25 - 23.5) / 23.5 = 6.38%+ ้ข่ฎก3ไธชๆๅฎๆ, ๅนดๅ = 6.38% ร 4 = 25.5%++้ฃ้ฉ่ฏไผฐ:+ ๅฎกๆน็กฎๅฎๆง: ๅทฒ่ทๅๅก้จ/่ฏ็ไผ้ขๅฎก โ ้ซ็กฎๅฎๆง+ ๅฏนไปทๆนๅผ: ็ฐ้ > ่ก็ฅจ+็ฐ้ > ็บฏ่ก็ฅจ (็กฎๅฎๆง้ๅ)+ ไบคๆๆกไปถ: ๆฏๅฆๆMACๆกๆฌพ(้ๅคงไธๅฉๅๅ)+```++**A่กๅนถ่ดญๅฅๅฉ่ฆ็น**๏ผ+- ๅ็ๅถๅบฆๆน้ฉๅ๏ผๅค็้ฆๆฅๆถจ่ทๅน ๅ้๏ผๅไธๆฟ/็งๅๆฟ20%๏ผ+- ๅ ณๆณจ"็ญนๅ้ๅคง่ตไบง้็ป"ๅ ฌๅ โ ๅ็ โ ๅค็็่ๅฅ+- ๅฎกๆน้พ๏ผ่ฃไบไผ โ ่กไธๅคงไผ โ ่ฏ็ไผ๏ผๆฏไธๆญฅ้ฝๆฏ้ฃ้ฉ็น๏ผ++### ๅๆ/Spin-off++```+A่กๅๆไธๅธๆกไปถ:+ - ไธๅธๆปก3ๅนด+ - ๅญๅ ฌๅธๅๅฉๆถฆ โฅ ๆฏๅ ฌๅธๅๅฉๆถฆ10%+ - ๅญๅ ฌๅธๅ่ตไบง โค ๆฏๅ ฌๅธๅ่ตไบง30%++ไบคๆ็ญ็ฅ:+ ้ขๆกๅ ฌๅ โ ไนฐๅ ฅๆฏๅ ฌๅธ๏ผๅๆ้ขๆๆๅไผฐๅผ๏ผ+ ๅญๅ ฌๅธไธๅธ โ ๆฉๆบๅๅบๆฏๅ ฌๅธ๏ผๅฉๅฅฝๅ ็ฐ๏ผ++ๅฎไพ:+ 2023ๅนดๆ็งๆๅ ฌๅธๅๆๅญๅ ฌๅธ่ณ็งๅๆฟ+ ้ขๆกๅ ฌๅๅๆฏๅ ฌๅธ20ๆฅๆถจๅน 18%+ ๅญๅ ฌๅธไธๅธ้ฆๆฅๅๆฏๅ ฌๅธๅ่ฐ8%+```++### ๅคง่กไธๅขๅๆไฟกๅท++**ๅขๆไฟกๅท**๏ผ็ๅค๏ผ๏ผ+| ไฟกๅทๅผบๅบฆ | ๆกไปถ | ่ถ ้ขๆถ็(20ๆฅ) |+|----------|------|----------------|+| ๅผบ | ๆง่ก่กไธๅขๆ > ๆป่กๆฌ1% | +8~12% |+| ไธญ | ้ซ็ฎก้ไฝๅขๆ(โฅ3ไบบ) | +5~8% |+| ๅผฑ | ๅไธ่ฃไบ/็ไบๅขๆ | +2~4% |++**ๅๆไฟกๅท**๏ผ็็ฉบ๏ผ๏ผ+| ไฟกๅทๅผบๅบฆ | ๆกไปถ | ่ถ ้ขๆถ็(20ๆฅ) |+|----------|------|----------------|+| ๅผบ | ๆง่ก่กไธ่ฎกๅๅๆ > ๆป่กๆฌ2% | -5~10% |+| ไธญ | ่งฃ็ฆๅ้ฆๆฌกๅๆ | -3~6% |+| ๅผฑ | ้ซ็ฎก็ฆป่ๅๆ | -2~4% |++```+ๅ ณ้ฎ็ชๅฃๆ:+ - ๅ ฌๅๅ6ไธชๆ: ๅ ๅนไบคๆ้ซๅๅบ๏ผๅผๅธธๆพ้ๅฏ่ฝๆฏๅ ็ฅ่ต้+ - ๅ ฌๅๅ3ๆฅ: ไฟกๆฏๅฒๅปๆๅคง+ - ๅ ฌๅๅ20ๆฅ: ่ถ ้ขๆถ็ๅบๆฌๆถๅ++่ฟๆปค่งๅ:+ ๆ้ค: ่ขซๅจๅๆ(่ดจๆผๅนณไป)ใๅคงๅฎไบคๆๆไปทๅๆ(ๅฏ่ฝๆฏๆขๆไธๆฏ็็ฉบ)+ ไฟ็: ็ซไปทๅๆ(็ๆญฃ็็ฉบ)ใๅขๆๅ็ญๆๅๅๆ(ๅๅไฟกๅท)+```++### ่กๆๆฟๅฑ่งฃ่ฏป++```+ๅ ณ้ฎ่ฆ็ด :+ 1. ่กๆไปท/ๆไบไปท: ็ธๅฏนๅฝๅ่กไปท็ๆไปท็+ ๆไปท > 50% โ ๆฟๅฑๅๅบฆๅคงไฝๅฏ่ฝๆ่ไธฅ้+ ๆไปท < 20% โ ็ฎก็ๅฑๅฏน่กไปทๆไฟกๅฟ++ 2. ่งฃ้ๆกไปถ: ไธ็ปฉ็ฎๆ ๆฏๅฆๆๆๆๆง+ ไพ: "ๆชๆฅ3ๅนดๅๅฉๆถฆๅคๅๅข้ฟ็โฅ20%"+ vs ่กไธๅนณๅๅข้ฟ็10% โ ๆกไปถ่พ้ซ โ ๆญฃ้ขไฟกๅท++ 3. ๆฟๅฑๅฏน่ฑก: ๆ ธๅฟๆๆฏไบบๅๅ ๆฏ+ ๆ ธๅฟๆๆฏไบบๅ > 50% โ ็ปๅฎๆ ธๅฟไบบๆ โ ๆญฃ้ข+ ็บฏ็ฎก็ๅฑ โ ๅฏ่ฝๆฏๅฉ็่พ้++ 4. ่กไปฝๆฅๆบ:+ ๅฎๅๅขๅ โ ๆ่ๆฏ่กๆถ็+ ๅ่ดญ โ ไธๆ่๏ผๆดๆญฃ้ข++ 5. ็ญๅพ ๆ/่งฃ้ๆ:+ ็ญๅพ ๆ1ๅนด+่งฃ้ๆ3ๅนด โ ๆ ๅๆนๆก+ ็ญๅพ ๆ็ญ+่งฃ้ๆกไปถไฝ โ ๅฉ็่พ้ๅซ็++A่กๅฎ่ฏ:+ ๆฟๅฑๆนๆกๅ ฌๅๅ60ๆฅๅนณๅ่ถ ้ขๆถ็: +6.2%+ ่งฃ้ๆกไปถ่ถ ้ขๆ็: +10.5%+ ่กๆไปทๆฅ่ฟๅฝๅไปท็: +8.3%+ ้ฆๆฌกๆจๅบๆฟๅฑ > ๅๆฌกๆจๅบ: ่ถ ้ขๆถ็ๆด้ซ+```++## ๅๆๆกๆถ++### 1. ๅฎๅข/้ ่กไบไปถ++**ๅฎๅข๏ผๅฎๅๅขๅ๏ผ**๏ผ+```+ไบไปถๆถ้ด็บฟ:+ ้ขๆกๅ ฌๅ โ ่กไธๅคงไผ โ ่ฏ็ไผๅฎกๆน โ ๅ่ก โ ่งฃ็ฆ++ไบคๆ่็น:+ 1. ้ขๆกๅ ฌๅๆฅ: ๅ ณๆณจๆไปท็ๅๅ่ต็จ้+ ๆไปท็ = (ๅฝๅไปท - ๅ่กๅบไปท) / ๅฝๅไปท+ ๆไปท็ > 20% โ ๅฉๅฅฝ๏ผๆบๆๆฟๆๆไปทไนฐๅ ฅ = ็ๅฅฝ๏ผ++ 2. ๅ่กๅ: ๅฎๅขๅฏน่ฑกๆๅจๅ็ปดๆค่กไปท๏ผ้ๅฎไปทๆ ผ๏ผ+ ๅ ฌๅๅๅฐๅ่กๅ้ๅธธๆๆญฃ่ถ ้ขๆถ็++ 3. ่งฃ็ฆๆฅ: ๅฎๅข่กไปฝ่งฃ็ฆ โ ๅๅ+ ่งฃ็ฆๅ20ๆฅๅนณๅ่ทๅน 3-5%+ ่งฃ็ฆๅ20ๆฅ็ปง็ปญๆฟๅ++ๅ่ต็จ้่ฏๅ:+ ๅนถ่ดญไผ่ดจ่ตไบง: +3ๅ+ ๆฉไบง/ๆฐ้กน็ฎ: +2ๅ+ ่กฅๅ ๆตๅจ่ต้: 0ๅ (ไธญๆงๅ่ด)+ ๅฟ่ฟๅบๅก: -1ๅ+ ๅคง่กไธ่ฎค่ดญๆฏไพ > 50%: +2ๅ (ๅฉ็็ปๅฎ)+```++**ๅฏไบคๅบ๏ผEB๏ผ**๏ผ+```+ๅฏไบคๆขๅบๅธ = ๅคง่กไธไปฅๆๆ่กไปฝไธบๆ ไฟๅ่ก็ๅบๅธ+ ๆข่กไปท = ๅ่กๆถ็บฆๅฎ็ๆข่กไปทๆ ผ+ ๅฝ่กไปท > ๆข่กไปท ร 130% โ ๆ่ต่ ๅพๅๆข่ก โ ็ธๅฝไบๅคง่กไธๅๆ+ ๅฝ่กไปท < ๆข่กไปท ร 70% โ ๆ่ต่ ๆๆๅบๅธ โ ๅคง่กไธ็จไฝๅฉ็่่ต++ไบคๆไฟกๅท:+ ๅ่กๅฏไบคๅบ = ๅคง่กไธๅฏ่ฝ่ฎกๅๅๆ๏ผไฝๆฏ็ดๆฅๅๆๆดๆธฉๅ+ ไธด่ฟๆข่กๆ+่กไปทๆฅ่ฟๆข่กไปท โ ๅ ณๆณจๅคง่กไธๆฏๅฆๆๆ่ฎฉ่กไปท็ช็ ดๆข่กไปท+```++### 2. ST/้ๅธ้ข่ญฆ++**STๆ ่ฎฐ่งๅ๏ผ2024ๆฐ่ง๏ผ**๏ผ+```+*ST (้ๅธ้ฃ้ฉ่ญฆ็คบ):+ - ๆ่ฟไธๅนดๅๅฉๆถฆไธบ่ด + ่ฅๆถ < 3ไบฟ๏ผไธปๆฟ๏ผ/ 1ไบฟ๏ผๅไธๆฟ๏ผ+ - ๅฎก่ฎกๆ่ง: ๆ ๆณ่กจ็คบ/ๅฆๅฎ+ - ่ดขๅก้ ๅ++ST (ๅ ถไป้ฃ้ฉ่ญฆ็คบ):+ - ่ต้ๅ ็จ+ - ่ฟ่งๆ ไฟ+ - ๅ ๆงๅฎก่ฎกๅฆๅฎๆ่ง++้ๅธๆกไปถ:+ - ่ฟ็ปญ20ไธชไบคๆๆฅๆถ็ๅธๅผ < 3ไบฟ๏ผไธปๆฟ๏ผ/ 5ไบฟ๏ผๅไธๆฟ/็งๅๆฟ๏ผ+ - ่ฟ็ปญ20ไธชไบคๆๆฅ่กไปท < 1ๅ + - ่ดขๅก็ฑป: *STๅไธไธๅนดไปไธ่พพๆ +```++**ไบคๆ็ญ็ฅ**๏ผ+```+่ง้ฟ็ญ็ฅ๏ผๆจ่๏ผ:+ - ๆไปไธญๆ้คๆๆST/*ST+ - ๆ้ค "ๆ่ฟไธๅญฃๅบฆไบๆ + ่ฅๆถไธๆป > 30%" ็ๆฝๅจST่ก+ - ๆ้คๅฎก่ฎกๆบๆๅบๅ ทไฟ็ๆ่ง็++ๆๆบ็ญ็ฅ๏ผ้ซ้ฃ้ฉ๏ผไป ไพ็ ็ฉถ๏ผ:+ ๆๅธฝๆฆๅฟต: *STๅ ฌๅธไธ็ปฉๆญไบ โ ็ณ่ฏทๆๅธฝ โ ๆถจๅๆฝฎ+ ๆกไปถ็ญ้:+ - ๆ่ฟไธๅญฃๅบฆ็ๅฉ๏ผๆญไบๆ็น๏ผ+ - ๆๅฎ่ดจๆง่ตไบง้็ป/ๅบๅก้็ปๆนๆก+ - ๅธๅผ > 10ไบฟ๏ผ่ฟ็ฆป้ขๅผ้ๅธ็บฟ๏ผ+ ้ฃๆง: ไปไฝ < 5%, ๆญขๆ -15%+```++### 3. ไบไปถๆฅๅไธไบคๆๆถ้ด็ช++```+T-30 ่ณ T-1๏ผไบๅ็ชๅฃ๏ผ:+ ๅขๆ/ๅ่ดญ้ขๆก โ ้ๆญฅๅปบไป+ ๅนถ่ดญ้ขๆก โ ่ฏไผฐ็กฎๅฎๆงๅๅปบไป++T๏ผๅ ฌๅๆฅ๏ผ:+ ๅฉๅฅฝไบไปถ โ ้ๅ็ซไปท่ฟฝๅ ฅ๏ผๆณจๆๆถจๅๅฐๅ้๏ผ+ ๅฉ็ฉบไบไปถ โ ๅผ็ๅๆๅๅๅบ++T+1 ่ณ T+20๏ผไบๅ็ชๅฃ๏ผ:+ ไฟกๆฏ้ๆญฅๆถๅ๏ผ่ถ ้ขๆถ็้ๅ+ ๅคงไบไปถ๏ผๅนถ่ดญ/้็ป๏ผ: ๆถๅๆๅฏ่พพ60ๅคฉ+ ๅฐไบไปถ๏ผๅขๆ/ๅ่ดญ๏ผ: 20ๅคฉๅบๆฌๆถๅ++T+N๏ผ้ฟๆๆๅบ๏ผ:+ ่กๆๆฟๅฑ่งฃ้ๆๅๅ: ็ฎก็ๅฑๆๅจๅ็ปดๆค่กไปท+ ๅฎๅข่งฃ็ฆๆฅ: ็กฎๅฎๆงๅๅ+```++## ่พๅบๆ ผๅผ++ไบไปถ้ฉฑๅจๅๆๆฅๅ๏ผ+```+=== ไบไปถๆฆๅต ===+ๆ ็: 000001.SZ ๅนณๅฎ้ถ่ก+ไบไปถ: ๆง่ก่กไธๅขๆ่ฎกๅๅ ฌๅ+ๆฅๆ: 2026-03-25+ๅขๆ่งๆจก: 10-20ไบฟๅ (ๅ ๆป่กๆฌ0.8%-1.6%)++=== ไฟกๅท่ฏไผฐ ===+ไฟกๅทๅผบๅบฆ: ๅผบ (ๆง่ก่กไธ+้้ขๅคง)+ๅๅฒๅ่: ๅ็ฑปไบไปถ20ๆฅๅนณๅ่ถ ้ข+8.2%+็กฎๅฎๆง: ้ซ (ๅทฒๅ ฌๅๅขๆ่ฎกๅ, 6ไธชๆ็ชๅฃๆ)++=== ็ญ็ฅๅปบ่ฎฎ ===+ๆไฝ: ๅ ฌๅๆฌกๆฅๅผ็ๅปบไป+ไปไฝ: 5-8% (ๅไบไปถไธ้)+ๆๆๆ: 20-30ไธชไบคๆๆฅ+ๆญขๆ: -5% (ไฝไบๅ ฌๅๆฅๆถ็ไปท5%)+ๆญข็: +12% ๆ ๆๆๆๆปก++=== ้ฃ้ฉๆ็คบ ===+- ๅธๅบ็ณป็ปๆงไธ่ทๅฏ่ฝๆตๆถไบไปถๆๅบ+- ๅขๆ่ฟๅบฆไธๅ้ขๆ โ ๅ ณๆณจๆๅบฆๅขๆๅ ฌๅ+- ้ถ่กๆฟๅๆดไฝไผฐๅผๅๅถ โ ่ถ ้ขๆถ็ๅฏ่ฝๅไฝ+```++## ๆณจๆไบ้กน++1. **ไฟกๆฏๆถๆๆง**๏ผA่กๅ ฌๅๅจไบคๆๆๅฎ็ฝ/ๅทจๆฝฎ่ต่ฎฏ็ฝ้ฆๅ๏ผ็ฌฌไธๆนๅนณๅฐๆๅปถ่ฟ๏ผๅฅๅฉ็ชๅฃๅฏ่ฝๅทฒๅ ณ้ญ+2. **ๅ ๅนไบคๆ้ฃ้ฉ**๏ผไบไปถๅ ฌๅๅ็ๅผๅธธ้ไปทๅฏ่ฝๆฏๅ ๅนไบคๆ๏ผ่ท้ไปๅ ฅ้่ฐจๆ ๏ผๅฏ่ฝ่ขซ็็ฎก่ฐๆฅ๏ผ+3. **ไบไปถ่้ๆๅบ**๏ผๅไธๆ ็ๅคไธชไบไปถๅ ๅ ๆถไฟกๅทๅขๅผบ๏ผๅขๆ+ๅ่ดญ+ๆฟๅฑ = ๅผบไฟกๅท๏ผ๏ผไฝ้ๆ้ค"็ปๅๆณๆค็"+4. **ๆณจๅๅถๅฝฑๅ**๏ผๅๅฃณไธๅธไปทๅผไธ้๏ผไผ ็ปๅฃณ่ตๆบๅฅๅฉ็ฉบ้ดๅคงๅน ๆถ็ผฉ+5. **้ๅๅฏ่ทๅๆง**๏ผtushare ๆไพๅขๅๆ/่กๆๆฟๅฑ/ๅฎๅขๆฐๆฎๆฅๅฃ๏ผไฝๅฎๆถๆงไธ่ถณ๏ผT+1ๆๆดๆ ข๏ผ+6. **ไปไฝๆงๅถ**๏ผๅไธไบไปถ้ฉฑๅจ็ญ็ฅไปไฝไธ่ถ ่ฟ10%๏ผไบไปถๅคฑ่ดฅ๏ผๅฆๅนถ่ดญ่ขซๅฆ๏ผๅฏ่ฝๅฏผ่ด20%+่ทๅน++## ไพ่ต++```bash+pip install pandas numpy+```diff --git a/agent/src/skills/correlation-analysis/SKILL.md b/agent/src/skills/correlation-analysis/SKILL.mdnew file mode 100644index 000000000..74014b49d--- /dev/null+++ b/agent/src/skills/correlation-analysis/SKILL.md@@ -0,0 +1,1101 @@+---+name: correlation-analysis+description: Correlation and cointegration analysis โ co-movement discovery, deep return-correlation analysis, sector clustering, realized correlation, Engle-Granger / Johansen cointegration, half-life, Kalman dynamic hedge ratio, cross-market linkage analysis, and pair-trading signal generation+---++# Correlation and Cointegration Analysis++## Overview++Correlation analysis is a foundational tool for pairs trading, portfolio construction, and risk management. This skill covers four analysis modes (co-movement discovery / return-correlation deep dive / sector clustering / realized correlation), a full cointegration-testing framework, cross-market linkage analysis, and the complete workflow from analytics to pair-trading signals.++---++## Mode 1: Co-Movement Discovery++**Use case**: Given a target asset, scan a universe for highly correlated assets and build a candidate pool with similar industry or factor exposure, for use in pairs trading or substitute identification.++### Workflow++```+1. Pull daily return series for the target asset and N candidates+2. Compute Pearson / Spearman correlations between the target and each candidate+3. Rank by correlation in descending order and keep Top-K (usually K=10-20)+4. Run cointegration tests on the Top-K set to retain pairs with real long-run equilibrium+5. Output the candidate pool and a correlation summary+```++```python+import pandas as pd+import numpy as np+from scipy.stats import pearsonr, spearmanr++def scan_correlated_assets(+ target_returns: pd.Series,+ universe_returns: pd.DataFrame,+ top_k: int = 20,+ min_corr: float = 0.5,+ method: str = "pearson",+) -> pd.DataFrame:+ """Scan for assets that are highly correlated with the target asset.++ Args:+ target_returns: Daily return series for the target asset+ universe_returns: Candidate-universe return matrix, columns are symbols+ top_k: Number of top candidates to return+ min_corr: Minimum absolute-correlation threshold+ method: "pearson" or "spearman"++ Returns:+ A DataFrame containing symbol / corr / p_value / rank+ """+ aligned = universe_returns.dropna(axis=1, how="any")+ aligned, target_aligned = aligned.align(target_returns, join="inner", axis=0)++ results = []+ for col in aligned.columns:+ if method == "spearman":+ corr, p = spearmanr(target_aligned, aligned[col])+ else:+ corr, p = pearsonr(target_aligned, aligned[col])+ results.append({"symbol": col, "corr": corr, "p_value": p})++ df = pd.DataFrame(results)+ df = df[df["corr"].abs() >= min_corr].sort_values("corr", ascending=False)+ df["rank"] = range(1, len(df) + 1)+ return df.head(top_k).reset_index(drop=True)+```++**Screening guidance**:++| Correlation | Conclusion | Follow-up Action |+|---------|------|---------|+| > 0.8 | Strong same-direction co-movement | Send to the cointegration test queue |+| 0.6 - 0.8 | Moderate co-movement | Check industry / factor alignment before cointegration |+| < 0.6 | Weak correlation | Usually unsuitable for pairs trading |+| Negative and < -0.6 | Strong inverse co-movement | Can be used in hedged portfolios, but be careful with spread direction |++---++## Mode 2: Deep Return-Correlation Analysis++**Use case**: Run a full bivariate correlation study on two assets, including multiple correlation coefficients, Beta / Rยฒ, rolling correlation, and spread Z-Score.++### Core Metrics++```python+import statsmodels.api as sm+from scipy.stats import pearsonr, spearmanr, kendalltau++def bivariate_correlation_analysis(+ y: pd.Series,+ x: pd.Series,+ rolling_window: int = 60,+) -> dict:+ """Run deep correlation analysis for two assets.++ Args:+ y: Daily return series of asset A+ x: Daily return series of asset B+ rolling_window: Rolling-window length in trading days++ Returns:+ Dict of correlation statistics+ """+ # Align the two series.+ df = pd.concat([y.rename("y"), x.rename("x")], axis=1).dropna()+ y_clean, x_clean = df["y"], df["x"]++ # Static correlations.+ pearson_r, pearson_p = pearsonr(y_clean, x_clean)+ spearman_r, spearman_p = spearmanr(y_clean, x_clean)+ kendall_r, kendall_p = kendalltau(y_clean, x_clean)++ # OLS: y = ฮฑ + ฮฒยทx+ x_const = sm.add_constant(x_clean)+ ols = sm.OLS(y_clean, x_const).fit()+ beta = ols.params["x"]+ alpha = ols.params["const"]+ r_squared = ols.rsquared++ # Rolling Pearson correlation.+ rolling_corr = y_clean.rolling(rolling_window).corr(x_clean)++ # Spread and Z-Score using the hedge ratio.+ spread = y_clean - beta * x_clean+ spread_mean = spread.rolling(rolling_window).mean()+ spread_std = spread.rolling(rolling_window).std()+ z_score = (spread - spread_mean) / spread_std++ return {+ "pearson": {"r": round(pearson_r, 4), "p": round(pearson_p, 6)},+ "spearman": {"r": round(spearman_r, 4), "p": round(spearman_p, 6)},+ "kendall": {"r": round(kendall_r, 4), "p": round(kendall_p, 6)},+ "beta": round(beta, 4),+ "alpha": round(alpha, 6),+ "r_squared": round(r_squared, 4),+ "rolling_corr": rolling_corr,+ "spread": spread,+ "z_score": z_score,+ "spread_mean": spread_mean,+ "spread_std": spread_std,+ }+```++### Correlation-Coefficient Selection Guide++| Coefficient | Assumption | Best Use Case | Not Suitable When |+|------|------|---------|--------|+| Pearson | Linear, approximately normal | Return series | Heavy tails / many outliers |+| Spearman | Monotonic relationship | Ranking / quantile analysis, many outliers | When magnitude information matters |+| Kendall | Order consistency | Small samples, unknown distribution | Large samples due to slower computation |++**Practical rule in finance**: Usually report all three coefficients. If Pearson and Spearman differ by more than 0.1, the relationship is likely nonlinear or heavy-tailed, and Spearman should carry more weight.++---++## Mode 3: Sector Clustering++**Use case**: Run hierarchical clustering on the correlation matrix of N assets to discover sector structure, check portfolio diversification, and identify similar assets.++```python+import numpy as np+import pandas as pd+from scipy.cluster.hierarchy import linkage, dendrogram, fcluster+from scipy.spatial.distance import squareform+import matplotlib.pyplot as plt+import seaborn as sns++def sector_clustering(+ returns: pd.DataFrame,+ method: str = "ward",+ n_clusters: int = 5,+ figsize: tuple = (12, 10),+) -> dict:+ """Run sector clustering analysis.++ Args:+ returns: Multi-asset daily return matrix, columns are symbols+ method: Linkage method: "ward" / "complete" / "average"+ n_clusters: Target number of clusters+ figsize: Heatmap size++ Returns:+ Dict containing the correlation matrix, cluster labels, and figure objects+ """+ # 1. Correlation matrix+ corr_matrix = returns.corr(method="pearson")++ # 2. Distance matrix where distance = 1 - |correlation|+ distance_matrix = 1 - corr_matrix.abs()+ condensed = squareform(distance_matrix.values, checks=False)++ # 3. Hierarchical clustering+ linkage_matrix = linkage(condensed, method=method)+ labels = fcluster(linkage_matrix, n_clusters, criterion="maxclust")+ cluster_df = pd.DataFrame({"symbol": corr_matrix.columns, "cluster": labels})++ # 4. Heatmap sorted by cluster+ order = cluster_df.sort_values("cluster").index+ sorted_corr = corr_matrix.iloc[order, order]++ fig_heatmap, ax = plt.subplots(figsize=figsize)+ sns.heatmap(+ sorted_corr,+ cmap="RdYlGn",+ center=0,+ vmin=-1,+ vmax=1,+ annot=len(corr_matrix) <= 20,+ fmt=".2f",+ ax=ax,+ cbar_kws={"label": "Pearson correlation"},+ )+ ax.set_title(f"Correlation Heatmap ({method.upper()} clustering order)")++ # 5. Dendrogram+ fig_dendro, ax2 = plt.subplots(figsize=(figsize[0], 6))+ dendrogram(+ linkage_matrix,+ labels=list(corr_matrix.columns),+ ax=ax2,+ leaf_rotation=90,+ color_threshold=0,+ )+ ax2.set_title(f"Hierarchical Dendrogram ({method.upper()} linkage)")+ ax2.set_ylabel("Distance")++ return {+ "corr_matrix": corr_matrix,+ "cluster_labels": cluster_df,+ "linkage_matrix": linkage_matrix,+ "fig_heatmap": fig_heatmap,+ "fig_dendrogram": fig_dendro,+ "n_clusters": n_clusters,+ }+```++### Comparison of Three Linkage Methods++| Method | Feature | Best Use Case | Weakness |+|------|------|---------|------|+| Ward | Minimizes within-cluster variance, gives compact clusters | **Default recommendation**, stock-sector discovery | Works best for spherical clusters, weaker for irregular shapes |+| Complete | Uses maximum pairwise distance, conservative | When high within-cluster similarity is required | Can produce elongated clusters |+| Average | Uses average distance, compromise approach | General analysis where compactness is not the top priority | Sensitive to noise |++---++## Mode 4: Realized Correlation++**Use case**: Compute rolling correlation time series and analyze conditional correlation by market regime (bull / bear / high-volatility) to discover how correlation evolves dynamically.++```python+def realized_correlation(+ y: pd.Series,+ x: pd.Series,+ benchmark: pd.Series,+ windows: list = [20, 60, 120],+ vol_window: int = 20,+ vol_threshold: float = 1.5,+) -> dict:+ """Rolling realized correlation plus regime-conditional correlation.++ Args:+ y, x: Daily return series of two assets+ benchmark: Daily return series of the benchmark index used for regime labeling+ windows: List of rolling windows in trading days+ vol_window: Volatility window+ vol_threshold: High-vol threshold as a multiple of average vol++ Returns:+ Rolling correlation series and conditional-correlation summary+ """+ df = pd.concat([y.rename("y"), x.rename("x"),+ benchmark.rename("bm")], axis=1).dropna()++ # Rolling correlation time series.+ rolling_corrs = {}+ for w in windows:+ rolling_corrs[f"roll_{w}d"] = df["y"].rolling(w).corr(df["x"])++ # Regime labels.+ bm_ret_252 = df["bm"].rolling(252).mean()+ bm_vol = df["bm"].rolling(vol_window).std()+ bm_vol_mean = bm_vol.rolling(252).mean()++ df["regime"] = "sideways"+ df.loc[df["bm"] > bm_ret_252, "regime"] = "bull"+ df.loc[df["bm"] < -bm_ret_252.abs(), "regime"] = "bear"+ df.loc[bm_vol > bm_vol_mean * vol_threshold, "regime"] = "high_vol"++ # Conditional correlation.+ cond_corr = {}+ for regime in ["bull", "bear", "sideways", "high_vol"]:+ mask = df["regime"] == regime+ if mask.sum() >= 30:+ r, p = pearsonr(df.loc[mask, "y"], df.loc[mask, "x"])+ cond_corr[regime] = {"corr": round(r, 4), "p": round(p, 6), "n": int(mask.sum())}+ else:+ cond_corr[regime] = {"corr": None, "p": None, "n": int(mask.sum())}++ return {+ "rolling_corrs": pd.DataFrame(rolling_corrs),+ "regime_labels": df["regime"],+ "conditional_corr": cond_corr,+ }+```++### Typical Correlation Behavior by Market Regime++| Market Regime | Equity-Equity Correlation | Equity-Bond Correlation | A-Share Characteristic |+|---------|---------|---------|--------|+| Bull | Medium (0.4-0.6) | Low or negative | Small-cap names tend to move together strongly |+| Bear | **High (0.7-0.9)** | Negative (safe-haven effect) | Broad selloff, correlation jumps sharply |+| High volatility | **Very high (0.8+)** | Negative | In crises, correlation often converges toward 1 |+| Sideways | Low (0.2-0.4) | Near zero | Stock dispersion rises, ideal for pairs trading |++---++## Cointegration Analysis++Correlation measures the degree of co-movement. Cointegration measures whether a **long-run equilibrium relationship** exists. High correlation does not guarantee cointegration, and low correlation does not rule it out.++### Engle-Granger Two-Step Method++Suitable for two-variable pairs, quick and intuitive.++```python+from statsmodels.tsa.stattools import coint, adfuller+import statsmodels.api as sm+import numpy as np++def engle_granger_coint(+ y: pd.Series,+ x: pd.Series,+ significance: float = 0.05,+) -> dict:+ """Run the Engle-Granger two-step cointegration test.++ H0: No cointegration relationship exists (residuals contain a unit root).++ Args:+ y, x: Two price series. These must be non-stationary series,+ usually prices rather than returns.+ significance: Significance level++ Returns:+ Test results and spread series+ """+ # Step 1: estimate the cointegrating vector with OLS.+ x_const = sm.add_constant(x)+ ols = sm.OLS(y, x_const).fit()+ hedge_ratio = ols.params[x.name if x.name else "x"]+ intercept = ols.params["const"]+ residuals = ols.resid++ # Step 2: test residual stationarity with ADF.+ adf_res = adfuller(residuals, autolag="AIC")+ adf_stat, adf_p = adf_res[0], adf_res[1]++ # statsmodels coint wrapper.+ coint_stat, coint_p, crit_vals = coint(y, x)++ return {+ "method": "Engle-Granger",+ "is_cointegrated": coint_p < significance,+ "coint_p": round(coint_p, 6),+ "coint_stat": round(coint_stat, 4),+ "critical_values": {"1%": crit_vals[0], "5%": crit_vals[1], "10%": crit_vals[2]},+ "hedge_ratio": round(hedge_ratio, 6),+ "intercept": round(intercept, 6),+ "spread": residuals,+ "adf_on_spread": {"stat": round(adf_stat, 4), "p": round(adf_p, 6)},+ }+```++**Note**: Engle-Granger can detect only one cointegrating vector, and the test result depends on the ordering of `y` and `x`. In practice, test both directions and keep the direction with the smaller p-value.++### Johansen Cointegration Test for Multiple Variables++Suitable for three or more assets and for estimating the number of cointegrating vectors (rank).++```python+from statsmodels.tsa.vector_ar.vecm import coint_johansen++def johansen_coint(+ prices: pd.DataFrame,+ det_order: int = 0,+ k_ar_diff: int = 1,+) -> dict:+ """Run the Johansen cointegration test.++ Args:+ prices: Multi-asset price matrix, columns are symbols.+ The series must be non-stationary.+ det_order: Deterministic term. -1=no intercept, 0=intercept, 1=trend+ k_ar_diff: Number of lagged differences in the VAR, usually 1-5 chosen by AIC++ Returns:+ Trace-test and max-eigenvalue-test results+ """+ result = coint_johansen(prices.dropna(), det_order=det_order, k_ar_diff=k_ar_diff)+ n = prices.shape[1]++ # Trace test.+ trace_results = []+ for i in range(n):+ trace_results.append({+ "H0_rank_leq": i,+ "trace_stat": round(result.lr1[i], 4),+ "crit_10pct": result.cvt[i, 0],+ "crit_5pct": result.cvt[i, 1],+ "crit_1pct": result.cvt[i, 2],+ "reject_5pct": result.lr1[i] > result.cvt[i, 1],+ })++ # Max-eigenvalue test.+ maxeig_results = []+ for i in range(n):+ maxeig_results.append({+ "H0_rank_eq": i,+ "maxeig_stat": round(result.lr2[i], 4),+ "crit_10pct": result.cvm[i, 0],+ "crit_5pct": result.cvm[i, 1],+ "crit_1pct": result.cvm[i, 2],+ "reject_5pct": result.lr2[i] > result.cvm[i, 1],+ })++ # Cointegrating vectors, normalized.+ coint_vectors = pd.DataFrame(+ result.evec[:, :sum(r["reject_5pct"] for r in trace_results)],+ index=prices.columns,+ )++ return {+ "method": "Johansen",+ "n_coint_vectors_trace": sum(r["reject_5pct"] for r in trace_results),+ "trace_test": pd.DataFrame(trace_results),+ "maxeig_test": pd.DataFrame(maxeig_results),+ "coint_vectors": coint_vectors,+ "eigenvalues": result.eig,+ }+```++**Johansen rank interpretation rules**:++```+Start the trace test from H0: rank=0 and move upward.+The first rank that cannot be rejected is the estimated cointegration rank.++rank = 0 โ no cointegration+rank = 1 โ one cointegrating vector (most common, long-run equilibrium for a pair)+rank = k-1 โ k-1 cointegrating vectors (system is tightly linked)+rank = k โ the series themselves are stationary, so cointegration is not needed+```++### Half-Life Calculation++Half-life measures how long a spread takes to mean-revert after deviating from equilibrium. It is a practical reference for expected holding period in pairs trading.++```python+def compute_half_life(spread: pd.Series) -> float:+ """Estimate mean-reversion half-life with OLS, in days.++ Principle:+ Estimate ฮSpread_t = ฮปยทSpread_{t-1} + ฮต+ Half-life = -ln(2) / ฮป, where ฮป must be negative for mean reversion++ Args:+ spread: Spread series, which should be stationary++ Returns:+ Half-life in trading days. Negative or infinite values imply divergence.+ """+ spread_lag = spread.shift(1)+ delta = spread.diff()+ df = pd.concat([delta, spread_lag], axis=1).dropna()+ df.columns = ["delta", "lag"]++ x_const = sm.add_constant(df["lag"])+ ols = sm.OLS(df["delta"], x_const).fit()+ lam = ols.params["lag"]++ if lam >= 0:+ return float("inf") # no mean reversion++ half_life = -np.log(2) / lam+ return round(half_life, 1)+```++**Half-life reference ranges**:++| Half-Life | Meaning | Trading Guidance |+|-------|------|---------|+| < 5 days | Extremely fast reversion | Intraday or overnight trading, friction cost matters |+| 5-20 days | Fast reversion | Ideal range for short-term pairs trading |+| 20-60 days | Medium-speed reversion | Medium-term holding, rolling windows 60-120 days |+| 60-180 days | Slow reversion | Long holding period, monitor cointegration stability |+| > 180 days | Near random walk | High pairs-trading risk, use cautiously |++### Kalman Filter Dynamic Hedge Ratio++Static OLS hedge ratios cannot capture gradual drift in the cointegration relationship. A Kalman filter provides a continuously updated dynamic hedge ratio.++```python+import numpy as np++def kalman_hedge_ratio(+ y: pd.Series,+ x: pd.Series,+ delta: float = 1e-4,+ vt: float = 1.0,+) -> pd.DataFrame:+ """Estimate a dynamic hedge ratio with a Kalman filter.++ State equation:+ ฮฒ_t = ฮฒ_{t-1} + w_t, w ~ N(0, Q)+ Observation equation:+ y_t = ฮฒ_t ยท x_t + v_t, v ~ N(0, R)++ Args:+ y: Price series of asset A+ x: Price series of asset B+ delta: State-noise intensity. Larger means faster hedge-ratio adaptation+ vt: Observation-noise variance++ Returns:+ DataFrame containing the dynamic hedge ratio and spread+ """+ n = len(y)+ # State: [ฮฒ, ฮฑ] = hedge ratio + intercept+ Wt = delta / (1 - delta) * np.eye(2)+ Vt = vt++ # Initialization+ theta = np.zeros((n, 2))+ P = np.zeros((n, 2, 2))+ P[0] = np.eye(2)++ spread = np.zeros(n)+ spread[0] = float("nan")++ for t in range(1, n):+ F = np.array([x.iloc[t], 1.0])++ # Predict+ theta_pred = theta[t - 1]+ P_pred = P[t - 1] + Wt++ # Innovation+ innovation = y.iloc[t] - F @ theta_pred+ S = F @ P_pred @ F.T + Vt++ # Kalman gain+ K = P_pred @ F.T / S++ # Update+ theta[t] = theta_pred + K * innovation+ P[t] = (np.eye(2) - np.outer(K, F)) @ P_pred++ spread[t] = y.iloc[t] - theta[t, 0] * x.iloc[t] - theta[t, 1]++ return pd.DataFrame({+ "hedge_ratio": theta[:, 0],+ "intercept": theta[:, 1],+ "spread": spread,+ }, index=y.index)+```++**Static vs dynamic hedge-ratio comparison**:++| Method | Strength | Weakness | Best Use Case |+|------|------|------|------|+| OLS | Simple, stable | Cannot capture time variation | Short-term stable pairs |+| Rolling OLS | Time-varying, intuitive | Window-sensitive, endpoint effect | Medium-term pairs |+| Kalman Filter | Real-time, continuous update | `delta` is harder to tune | Long-term or structurally shifting pairs |++---++## Cross-Market Correlation++### Correlation Across China A-Share Sectors++```python+# Typical China A-share sector-correlation patterns+ASHARE_SECTOR_PATTERNS = {+ "strong_pairs_gt_0_7": [+ "Banks & insurance",+ "Baijiu & consumer staples",+ "New energy & solar",+ "Defense & aerospace",+ ],+ "medium_pairs_0_4_to_0_7": [+ "Pharma & consumer",+ "Technology & semiconductors",+ "Real estate & building materials",+ ],+ "low_or_negative_lt_0_3": [+ "Gold & technology",+ "Utilities & cyclicals",+ "Consumer & cyclicals",+ ],+}+```++### Cross-Market Linkage Analysis++```python+def cross_market_correlation(+ markets: dict, # {"China A-shares": series, "Hong Kong": series, "crypto": series, "US": series}+ rolling_window: int = 60,+ lag_days: list = [0, 1, 2, 3],+) -> dict:+ """Cross-market correlation plus lead-lag analysis.++ Args:+ markets: Daily return series for each market+ rolling_window: Rolling window+ lag_days: List of lags to test++ Returns:+ Correlation matrix, lead-lag analysis, and rolling correlation+ """+ df = pd.DataFrame(markets).dropna()++ # Static correlation matrix+ static_corr = df.corr()++ # Lead-lag correlation to detect cross-market transmission+ lead_lag = {}+ mkt_names = list(markets.keys())+ for i, m1 in enumerate(mkt_names):+ for m2 in mkt_names[i + 1:]:+ pair_key = f"{m1}_{m2}"+ lead_lag[pair_key] = {}+ for lag in lag_days:+ if lag == 0:+ r, _ = pearsonr(df[m1], df[m2])+ else:+ r, _ = pearsonr(df[m1].iloc[lag:], df[m2].iloc[:-lag])+ lead_lag[pair_key][f"lag_{lag}d"] = round(r, 4)++ # Rolling correlation+ rolling_corrs = {}+ for i, m1 in enumerate(mkt_names):+ for m2 in mkt_names[i + 1:]:+ key = f"{m1}_{m2}"+ rolling_corrs[key] = df[m1].rolling(rolling_window).corr(df[m2])++ return {+ "static_corr": static_corr,+ "lead_lag": pd.DataFrame(lead_lag).T,+ "rolling_corrs": pd.DataFrame(rolling_corrs),+ }+```++### Empirical Cross-Market Linkage Patterns++| Market Pair | Average Correlation | Transmission Direction | Lag |+|-------|---------|---------|------|+| China A-shares โ Hong Kong | 0.5-0.7 | Two-way, Hong Kong slightly leads | 0-1 day |+| China A-shares โ U.S. equities | 0.2-0.4 | U.S. leads overnight | 1 day |+| BTC โ ETH | 0.7-0.9 | Highly synchronous | < 1 hour |+| China A-shares โ BTC | 0.0-0.2 | Mostly independent, except correlation spikes in crises | Unstable |+| U.S. equities โ BTC | 0.1-0.4 | U.S. leads through institutional capital flows | Within 1 day |+| RMB exchange rate โ China A-shares | -0.2 - 0.3 | RMB weakness โ foreign outflows โ China A-share weakness | 0-2 days |++### Impact of FX Factors on Cross-Market Correlation++Cross-market correlation analysis must distinguish between local-currency returns and FX-adjusted returns. Otherwise, exchange-rate moves can create spurious correlation or hide the true one.++```python+def fx_adjusted_correlation(+ foreign_price: pd.Series, # foreign-market price, denominated in foreign currency+ domestic_price: pd.Series, # domestic-market price+ fx_rate: pd.Series, # foreign currency / domestic currency, e.g. USD/CNY+) -> dict:+ """Cross-market correlation adjusted for FX effects.++ Args:+ foreign_price: Foreign-market price series in foreign currency+ domestic_price: Domestic-market price series in domestic currency+ fx_rate: FX series expressed as foreign / domestic++ Returns:+ Raw correlation vs FX-adjusted correlation+ """+ # Domestic-currency foreign return = foreign return + FX return+ foreign_ret = foreign_price.pct_change()+ fx_ret = fx_rate.pct_change()+ foreign_ret_cny = (1 + foreign_ret) * (1 + fx_ret) - 1++ domestic_ret = domestic_price.pct_change()++ df = pd.concat([foreign_ret.rename("foreign_raw"),+ foreign_ret_cny.rename("foreign_domestic"),+ domestic_ret.rename("domestic"),+ fx_ret.rename("fx")], axis=1).dropna()++ raw_corr, _ = pearsonr(df["foreign_raw"], df["domestic"])+ adj_corr, _ = pearsonr(df["foreign_domestic"], df["domestic"])+ fx_corr, _ = pearsonr(df["fx"], df["domestic"])++ return {+ "raw_corr_foreign_domestic": round(raw_corr, 4),+ "fx_adjusted_corr": round(adj_corr, 4),+ "fx_domestic_corr": round(fx_corr, 4),+ "fx_contribution": round(adj_corr - raw_corr, 4),+ "note": "fx_contribution > 0 means FX amplified cross-market correlation",+ }+```++### Correlation Breakdown During Crises++During crises, equity correlation converges toward 1 and diversification breaks down. This is one of the central challenges in portfolio risk management.++```python+def correlation_breakdown_test(+ returns: pd.DataFrame,+ crisis_threshold: float = -0.02, # one-day benchmark drop threshold for crisis days+ benchmark_col: str = None,+ window: int = 20,+) -> dict:+ """Detect jumps in correlation during crisis periods.++ Args:+ returns: Multi-asset daily return matrix+ crisis_threshold: Benchmark return below this level defines a crisis day+ benchmark_col: Benchmark column name. If None, use cross-sectional mean return+ window: Window for rolling average correlation++ Returns:+ Comparison of correlation in normal periods vs crisis periods+ """+ if benchmark_col:+ bm = returns[benchmark_col]+ else:+ bm = returns.mean(axis=1)++ crisis_mask = bm < crisis_threshold+ normal_mask = ~crisis_mask++ # Average pairwise correlation for each period+ def avg_corr(df_subset: pd.DataFrame) -> float:+ if len(df_subset) < 5:+ return float("nan")+ c = df_subset.corr()+ upper = c.where(np.triu(np.ones(c.shape), k=1).astype(bool))+ return float(upper.stack().mean())++ crisis_corr = avg_corr(returns[crisis_mask])+ normal_corr = avg_corr(returns[normal_mask])++ # Rolling average correlation to detect structural change+ rolling_avg_corr = pd.Series(dtype=float, index=returns.index)+ for i in range(window, len(returns)):+ sub = returns.iloc[i - window:i]+ rolling_avg_corr.iloc[i] = avg_corr(sub)++ return {+ "normal_avg_corr": round(normal_corr, 4),+ "crisis_avg_corr": round(crisis_corr, 4),+ "corr_jump": round(crisis_corr - normal_corr, 4),+ "crisis_days": int(crisis_mask.sum()),+ "normal_days": int(normal_mask.sum()),+ "rolling_avg_corr": rolling_avg_corr,+ }+```++---++## Pair-Trading Signal Generation++### Full Workflow From Correlation to Signal++```+Step 1: Asset screening+ - Run scan_correlated_assets and keep candidate pairs with Pearson > 0.6+ - Run engle_granger_coint and keep pairs with p < 0.05++Step 2: Spread quality assessment+ - Run compute_half_life and keep pairs with half-life between 5 and 60 days+ - Test spread stationarity with ADF and require p < 0.05+ - Measure how often the absolute Z-Score exceeds 1.5 over the last 12 months+ to estimate trading frequency++Step 3: Hedge-ratio selection+ - Use static OLS for stable pairs+ - Use Kalman Filter for long-lived or drifting pairs++Step 4: Signal generation+ - Compute rolling Z-Score with a lookback of 2-3ร half-life+ - Generate long / short / exit signals based on thresholds++Step 5: Signal monitoring+ - Recompute Z-Score daily+ - Re-run cointegration monthly to avoid broken relationships+ - Warn if half-life exceeds 2ร the original value+```++### Z-Score Signal Generation++```python+def generate_pair_signals(+ y_price: pd.Series,+ x_price: pd.Series,+ lookback: int = 60,+ entry_z: float = 2.0,+ exit_z: float = 0.5,+ stop_z: float = 3.5,+ use_kalman: bool = False,+) -> pd.DataFrame:+ """Generate pair-trading signals.++ Args:+ y_price, x_price: Two price series+ lookback: Rolling Z-Score lookback, usually 2-3ร half-life+ entry_z: Entry threshold+ exit_z: Exit threshold, usually near mean reversion+ stop_z: Stop threshold. Crossing it suggests cointegration may have broken+ use_kalman: Whether to use a Kalman dynamic hedge ratio++ Returns:+ DataFrame containing signals, Z-Score, and positions+ """+ if use_kalman:+ kf = kalman_hedge_ratio(y_price, x_price)+ spread = kf["spread"]+ else:+ y_ret = y_price.pct_change()+ x_ret = x_price.pct_change()+ res = bivariate_correlation_analysis(y_ret, x_ret, lookback)+ hedge_ratio = abs(res["beta"])+ spread = np.log(y_price) - hedge_ratio * np.log(x_price)++ spread_mean = spread.rolling(lookback).mean()+ spread_std = spread.rolling(lookback).std()+ z_score = (spread - spread_mean) / spread_std++ # Signal state machine to avoid repeated re-entry.+ signal_y = pd.Series(0.0, index=y_price.index)+ signal_x = pd.Series(0.0, index=x_price.index)+ position = 0 # 0=flat, 1=long spread, -1=short spread++ for i in range(lookback, len(z_score)):+ z = z_score.iloc[i]+ if np.isnan(z):+ continue++ if position == 0:+ if z < -entry_z:+ position = 1 # spread is too low: buy y, sell x+ elif z > entry_z:+ position = -1 # spread is too high: sell y, buy x+ elif position == 1:+ if z > -exit_z or z > stop_z:+ position = 0+ elif position == -1:+ if z < exit_z or z < -stop_z:+ position = 0++ signal_y.iloc[i] = 0.5 * position+ signal_x.iloc[i] = -0.5 * position++ return pd.DataFrame({+ "spread": spread,+ "z_score": z_score,+ "spread_mean": spread_mean,+ "spread_std": spread_std,+ "signal_y": signal_y,+ "signal_x": signal_x,+ "position": signal_y * 2, # 1=long spread, -1=short spread, 0=flat+ })+```++### Z-Score Threshold Configuration Guide++| Parameter | Conservative | Standard | Aggressive | Notes |+|------|------|------|------|------|+| entry_z | 2.5 | 2.0 | 1.5 | Higher threshold means fewer trades |+| exit_z | 0.3 | 0.5 | 0.8 | Higher threshold means shorter holding periods |+| stop_z | 3.0 | 3.5 | 4.0 | Beyond this level, cointegration may have broken |+| lookback | 90 | 60 | 30 | Usually 2-3ร half-life |++### Spread-Stability Monitoring++```python+def monitor_spread_health(+ spread: pd.Series,+ original_half_life: float,+ original_corr: float,+ warning_hl_multiple: float = 2.0,+ warning_corr_drop: float = 0.2,+) -> dict:+ """Monitor spread stability and judge whether cointegration still holds.++ Args:+ spread: Live spread series+ original_half_life: Half-life at entry, in days+ original_corr: Correlation at entry+ warning_hl_multiple: Warn if half-life exceeds this multiple of the original+ warning_corr_drop: Warn if correlation drops by more than this amount++ Returns:+ Health-status report+ """+ recent = spread.iloc[-60:] if len(spread) > 60 else spread++ current_hl = compute_half_life(recent)+ current_adf = adfuller(recent.dropna())[1]++ hl_ratio = current_hl / original_half_life if original_half_life > 0 else float("inf")++ # Cointegration health score+ health_score = 100+ warnings = []++ if current_adf > 0.10:+ health_score -= 40+ warnings.append(f"Spread ADF p={current_adf:.3f} > 0.10, stationarity has weakened")++ if hl_ratio > warning_hl_multiple:+ health_score -= 30+ warnings.append(+ f"Half-life {current_hl:.1f}d is {hl_ratio:.1f}x the original {original_half_life:.1f}d"+ )++ if current_adf > 0.20:+ health_score -= 20+ warnings.append("Spread may no longer be stationary. Re-test cointegration immediately")++ status = "healthy" if health_score >= 70 else "warning" if health_score >= 40 else "danger"++ return {+ "health_score": health_score,+ "status": status,+ "current_half_life": round(current_hl, 1),+ "hl_ratio": round(hl_ratio, 2),+ "spread_adf_p": round(current_adf, 4),+ "warnings": warnings,+ "action": "hold" if status == "healthy" else "reduce" if status == "warning" else "exit_now",+ }+```++---++## Visualization Templates++### Rolling-Correlation Time-Series Plot++```python+import matplotlib.pyplot as plt++def plot_rolling_correlation(+ rolling_corrs: pd.DataFrame,+ title: str = "Rolling Correlation",+ figsize: tuple = (14, 5),+) -> plt.Figure:+ """Plot rolling correlation time series across multiple windows."""+ fig, ax = plt.subplots(figsize=figsize)+ colors = ["#2196F3", "#FF9800", "#4CAF50"]+ for i, col in enumerate(rolling_corrs.columns):+ ax.plot(rolling_corrs.index, rolling_corrs[col],+ label=col, color=colors[i % len(colors)], alpha=0.8)+ ax.axhline(0, color="black", linestyle="--", linewidth=0.8)+ ax.axhline(0.6, color="green", linestyle=":", linewidth=0.8, label="high-correlation threshold (0.6)")+ ax.axhline(-0.6, color="red", linestyle=":", linewidth=0.8)+ ax.set_title(title)+ ax.set_ylabel("Correlation")+ ax.legend(loc="best")+ ax.grid(True, alpha=0.3)+ plt.tight_layout()+ return fig+```++### Z-Score Signal Plot++```python+def plot_zscore_signals(+ signal_df: pd.DataFrame,+ entry_z: float = 2.0,+ stop_z: float = 3.5,+ figsize: tuple = (14, 8),+) -> plt.Figure:+ """Plot spread Z-Score and pair-trading signals."""+ fig, axes = plt.subplots(2, 1, figsize=figsize, sharex=True)++ # Top chart: spread+ axes[0].plot(signal_df["spread"], label="Spread", color="#1565C0")+ axes[0].plot(signal_df["spread_mean"], label="Mean", color="orange", linestyle="--")+ axes[0].fill_between(signal_df.index,+ signal_df["spread_mean"] - signal_df["spread_std"],+ signal_df["spread_mean"] + signal_df["spread_std"],+ alpha=0.2, color="orange", label="ยฑ1ฯ")+ axes[0].set_title("Spread and Mean")+ axes[0].legend()+ axes[0].grid(True, alpha=0.3)++ # Bottom chart: Z-Score + signals+ axes[1].plot(signal_df["z_score"], label="Z-Score", color="#1565C0")+ axes[1].axhline(entry_z, color="red", linestyle="--", label=f"entry threshold (ยฑ{entry_z})")+ axes[1].axhline(-entry_z, color="red", linestyle="--")+ axes[1].axhline(stop_z, color="darkred", linestyle=":", label=f"stop threshold (ยฑ{stop_z})")+ axes[1].axhline(-stop_z, color="darkred", linestyle=":")+ axes[1].axhline(0, color="black", linestyle="-", linewidth=0.8)++ # Annotate entry / exit points+ long_entry = signal_df["position"].diff() > 0+ short_entry = signal_df["position"].diff() < 0+ exit_pos = (signal_df["position"] == 0) & (signal_df["position"].shift(1) != 0)++ axes[1].scatter(signal_df.index[long_entry], signal_df["z_score"][long_entry],+ color="green", marker="^", s=80, label="long spread", zorder=5)+ axes[1].scatter(signal_df.index[short_entry], signal_df["z_score"][short_entry],+ color="red", marker="v", s=80, label="short spread", zorder=5)+ axes[1].scatter(signal_df.index[exit_pos], signal_df["z_score"][exit_pos],+ color="gray", marker="o", s=40, label="exit", zorder=5)++ axes[1].set_title("Z-Score and Trading Signals")+ axes[1].legend(loc="best")+ axes[1].grid(True, alpha=0.3)++ plt.tight_layout()+ return fig+```++---++## Dependencies++```bash+pip install pandas numpy scipy statsmodels matplotlib seaborn+```++---++## Output Format++```markdown+## Correlation and Cointegration Analysis Report++### Pair: [Asset A] vs [Asset B] ([Start Date] - [End Date])++#### Correlation Statistics+| Metric | Value | Interpretation |+|------|------|------|+| Pearson r | 0.82 | Strong linear positive correlation |+| Spearman ฯ | 0.80 | Consistent monotonic relationship |+| Beta (A/B) | 1.15 | Sensitivity of A to B |+| Rยฒ | 0.67 | 67% of return variance in A is explained by B |++#### Cointegration Tests+| Method | Statistic | p-value | Conclusion |+|------|--------|------|------|+| Engle-Granger | -4.12 | 0.008 | Cointegrated ** |+| Johansen trace test | 28.3 | โ | 1 cointegrating vector |+| Spread ADF | -3.95 | 0.002 | Spread is stationary ** |++#### Mean-Reversion Characteristics+| Metric | Value |+|------|------|+| OLS hedge ratio | 1.23 |+| Half-life | 18.5 days |+| Suggested holding window | 10-30 days |+| Suggested lookback window | 40-60 days |++#### Conditional Correlation (Regime Analysis)+| Regime | Correlation | Sample Size |+|------|---------|--------|+| Bull | 0.76 | 312 days |+| Bear | 0.88 | 198 days |+| High volatility | 0.91 | 87 days |+| Sideways | 0.71 | 645 days |++#### Recommended Pair-Trading Signal Parameters+| Parameter | Value |+|------|-----|+| entry_z | 2.0 |+| exit_z | 0.5 |+| stop_z | 3.5 |+| lookback | 60 days |++#### Current Spread Status+| Metric | Value | Alert |+|------|-----|------|+| Current Z-Score | -2.3 | Near entry zone |+| Health score | 85/100 | Healthy |+| Half-life (last 60 days) | 21.2 days | Normal |+```++---++## Notes++1. **Prices vs returns**: Use price series, which are non-stationary, for cointegration tests; use return series, which are stationary, for correlation analysis. Mixing them is the most common mistake.+2. **Data alignment**: Cross-market analysis must handle holiday mismatches with an inner join. Do not forward-fill missing trading days, or you will create fake correlation.+3. **Cointegration is not the same as high correlation**: Two series can have Pearson < 0.3 and still be cointegrated, and the reverse can also happen.+4. **Out-of-sample validation**: If a pair is selected using cointegration on the first N years, you must verify whether the relationship survives in later out-of-sample data to avoid overfitting.+5. **Crisis-period risk**: Correlation jumps in crises, and both legs in a pair can crash together. Stop thresholds should be tighter than in normal periods.+6. **China A-share specifics**: China A-shares contain many non-trading days due to holidays and suspensions. Date alignment is especially important in cross-market comparison.+7. **Multiple testing**: When testing N asset pairs simultaneously, use Benjamini-Hochberg FDR adjustment on p-values. Otherwise false positives will be excessive.+8. **Kalman tuning**: Tune `delta` with grid search plus out-of-sample validation. Do not rely blindly on the default value.diff --git a/agent/src/skills/credit-analysis/SKILL.md b/agent/src/skills/credit-analysis/SKILL.mdnew file mode 100644index 000000000..26373b1c5--- /dev/null+++ b/agent/src/skills/credit-analysis/SKILL.md@@ -0,0 +1,1130 @@+---+name: credit-analysis+description: "ๅบๆถไธไฟก็จๅๆ๏ผไฟก็จๅบ่ฏ็บงใๅฉๅทฎๅๆใ่ฟ็บฆ้ฃ้ฉ่ฏไผฐใๅๆๅบ็ ็ฉถใๅฏ่ฝฌๅบๅฎไปทไธ็ญ็ฅใ"+---++# Credit Analysis Skill โ ๅบๆถไธไฟก็จๅๆ++## ้็จๅบๆฏ++ๅฝ็จๆทๆๅบไปฅไธ็ฑปๅ้ฎ้ขๆถ๏ผไผๅ ่ฐ็จๆฌ skill๏ผ+- ๅบๅธๅฎไปทใYTM ่ฎก็ฎใไน ๆ/ๅธๆงๅๆ+- ไผไธไฟก็จ่ฏ็บงใ่ฟ็บฆๆฆ็ไผฐ็ฎ+- ไฟก็จๅฉๅทฎๅๆไธไบคๆ็ญ็ฅ+- ๅๆๅบใABS/MBS ไฟก็จ่ฏไผฐ+- ๅฉ็้ฃ้ฉ็ฎก็๏ผDV01ใๅ ณ้ฎๅฉ็ไน ๆ๏ผ+- ไธญๅฝๅบๆถๅธๅบ็ปๆๅๆ++---++## ไธใไฟก็จๅๆๆกๆถ++### 1.1 ไฟก็จ่ฏ็บงไฝ็ณป++#### ไธปไฝ่ฏ็บง vs ๅบ้กน่ฏ็บง++| ็ฑปๅ | ๅฎไน | ่ฏ็บงๅฏน่ฑก |+|------|------|----------|+| **ไธปไฝ่ฏ็บง๏ผIssuer Rating๏ผ** | ๅ่กไบบๆดไฝๅฟๅบ่ฝๅ | ไผไธใๆฟๅบใ้่ๆบๆ |+| **ๅบ้กน่ฏ็บง๏ผIssue Rating๏ผ** | ็นๅฎๅบๅธ็ไฟก็จ่ดจ้ | ๅ ทไฝๅบๅธ๏ผ่่ๆตๆผๅใไผๅ ็บงใๅฅ็บฆๆกๆฌพ |++ๅบ้กน่ฏ็บงๅฏ้ซไบๆไฝไบไธปไฝ่ฏ็บง๏ผๅๅณไบๆ ไฟ็ปๆ๏ผใ++#### ๆ ๅๆฎๅฐ / ็ฉ่ฟช / ไธญๅฝ่ฏ็บงๅฏน็ ง++| S&P | Moody's | ไธญๅฝ่ฏ็บง | ๅซไน |+|-----|---------|----------|------|+| AAA | Aaa | AAA | ๆ้ซไฟก็จ่ดจ้๏ผๆไฝ่ฟ็บฆ้ฃ้ฉ |+| AA+/AA/AA- | Aa1/Aa2/Aa3 | AA+/AA/AA- | ้ซ่ดจ้๏ผๆไฝ่ฟ็บฆ้ฃ้ฉ |+| A+/A/A- | A1/A2/A3 | A+/A/A- | ่พ้ซไฟก็จ่ดจ้ |+| BBB+/BBB/BBB- | Baa1/Baa2/Baa3 | BBB+/BBB/BBB- | ๆ่ต็บงไธ้๏ผIG/HYๅๆฐดๅฒญ๏ผ |+| BB+ๅไปฅไธ | Ba1ๅไปฅไธ | BB+ๅไปฅไธ | ้ซๆถ็/ๆๆบ็บง |+| D | D | D | ่ฟ็บฆ |++> **ไธญๅฝ็น็น**๏ผๅฝๅ ่ฏ็บง่้ซ๏ผAA็บงๅจๅฝๅ ็บฆ็ญๅไบๅฝ้ BBB-๏ผ้็ปๅ่ฏ็บงๅฑๆ๏ผๆญฃ้ข/็จณๅฎ/่ด้ข๏ผ็ปผๅๅคๆญใ++---++### 1.2 Altman Z-Score ๆจกๅ++็จไบ้ขๆตไผไธ่ดขๅกๅฐๅข๏ผๅๅงๆจกๅ้็จไบไธๅธๅถ้ ไธ๏ผ++```+Z = 1.2รX1 + 1.4รX2 + 3.3รX3 + 0.6รX4 + 1.0รX5+```++| ๅ้ | ่ฎก็ฎๅ ฌๅผ | ๅซไน |+|------|----------|------|+| X1 | ่ฅ่ฟ่ตๆฌ / ๆป่ตไบง | ๆตๅจๆง |+| X2 | ็ๅญๆถ็ / ๆป่ตไบง | ็ๅฉ็งฏ็ดฏ |+| X3 | EBIT / ๆป่ตไบง | ็ๅฉ่ฝๅ |+| X4 | ่กๆๅธๅผ / ๆป่ดๅบ่ดฆ้ขๅผ | ่ดขๅกๆ ๆ |+| X5 | ้ๅฎๆถๅ ฅ / ๆป่ตไบง | ่ตไบงๆ็ |++**ๅคๆญๅบ้ด**๏ผ+- Z > 2.99๏ผๅฎๅ จๅบ๏ผไฝ่ฟ็บฆ้ฃ้ฉ๏ผ+- 1.81 < Z < 2.99๏ผ็ฐ่ฒๅบ๏ผ้ๆทฑๅ ฅๅๆ๏ผ+- Z < 1.81๏ผๅฑ้ฉๅบ๏ผ้ซ่ฟ็บฆ้ฃ้ฉ๏ผ++**ๆน่ฟ็ๆฌ**๏ผ+- Z'๏ผ็งๆไผไธ๏ผ๏ผX4ๆน็จ่กๆ่ดฆ้ขๅผ๏ผไธด็ๅผ2.90/1.23+- Z''๏ผ้ๅถ้ ไธ/ๆฐๅ ดๅธๅบ๏ผ๏ผๅปๆX5๏ผไธด็ๅผ2.60/1.10++**ๅฑ้ๆง**๏ผ+- ๅบไบๅๅฒๆฐๆฎ๏ผๆปๅๆงๅผบ+- ไธ้็จ้่็ฑปไผไธ๏ผๆ ๆๅฎไนไธๅ๏ผ+- ไธญๅฝๅธๅบ้้ๆฐๆ ๅฎๅๆฐ++---++### 1.3 Merton ็ปๆๅๆจกๅ++ๅฐๅ ฌๅธ่กๆ่งไธบๅฏนๅ ฌๅธ่ตไบง็็ๆถจๆๆ๏ผๆง่กไปทๆ ผ=ๅบๅก้ขๅผ๏ผ๏ผ++**ๆ ธๅฟๅ่ฎพ**๏ผ+- ๅ ฌๅธ่ตไบงไปทๅผ V ้ตๅพชๅ ไฝๅธๆ่ฟๅจ๏ผ`dV = ฮผV dt + ฯ_V V dW`+- ๅบๅกไธบ้ถๆฏๅบ๏ผ้ขๅผ D๏ผๅฐๆๆฅ T+- ่ฟ็บฆไป ๅจ T ๆถๅปๅ็๏ผๆฌงๅผ่ฟ็บฆ่ฎพๅฎ๏ผ++**่กๆๅฎไปท๏ผBSๅ ฌๅผ๏ผ**๏ผ+```+E = VยทN(d1) - Dยทe^(-rT)ยทN(d2)++d1 = [ln(V/D) + (r + ฯ_Vยฒ/2)T] / (ฯ_VยทโT)+d2 = d1 - ฯ_VยทโT+```++**่ฟ็บฆๆฆ็๏ผ้ฃ้ฉไธญๆง๏ผ**๏ผ+```+PD = N(-d2)+```++**่ท่ฟ็บฆ่ท็ฆป๏ผDD, Distance to Default๏ผ**๏ผ+```+DD = [ln(V/D) + (ฮผ - ฯ_Vยฒ/2)T] / (ฯ_VยทโT)+```++**ไฟก็จๅฉๅทฎไผฐ็ฎ**๏ผ+```+ไฟก็จๅฉๅทฎ โ -ln[N(d2) + (V/Dยทe^(rT))ยทN(-d1)] / T+```++**ๅๆฐไผฐ็ฎๆนๆณ**๏ผ่็ซๆน็จ็ป๏ผ๏ผ+1. E = VยทN(d1) - Dยทe^(-rT)ยทN(d2)+2. ฯ_EยทE = N(d1)ยทฯ_VยทV++---++### 1.4 KMV ๆจกๅ๏ผ้ขๆ่ฟ็บฆ้ข็ EDF๏ผ++KMV ๆฏ Merton ๆจกๅ็ๅไธๅๅฎ็ฐ๏ผ็ฑ็ฉ่ฟชๆถ่ดญ๏ผ++**ๆญฅ้ชค**๏ผ+1. ็จ่กไปทๅ่กๆๆณขๅจ็ๅๆจ่ตไบงไปทๅผ V ๅ่ตไบงๆณขๅจ็ ฯ_V+2. ่ฎก็ฎ่ฟ็บฆ่งฆๅ็น๏ผDefault Point๏ผ๏ผ`DP = ็ญๆๅบๅก + 0.5ร้ฟๆๅบๅก`+3. ่ฎก็ฎ่ท่ฟ็บฆ่ท็ฆป๏ผ`DD = (V - DP) / (V ร ฯ_V)`+4. ้่ฟๅๅฒ่ฟ็บฆๆฐๆฎๅบๅฐ DD ๆ ๅฐไธบ EDF๏ผ้ๆญฃๆๆ ๅฐ๏ผ++**ไธ Merton ็ๅบๅซ**๏ผ+- ่ฟ็บฆ่งฆๅ็นไธๆฏๅ จ้จๅบๅก๏ผ่ๆฏ็ญๆ+ๅ้ฟๆ+- DDโEDF ๆ ๅฐๅบไบๅฎ่ฏๆฐๆฎๅบ๏ผ้ๆญฃๆๅๅธๅ่ฎพ+- EDF ๆฏ็ๅฎไธ็ๆฆ็๏ผ่้้ฃ้ฉไธญๆงๆฆ็++**EDF ๅ่ๅบ้ด**๏ผ็บฆ๏ผ๏ผ+- EDF < 0.1%๏ผๆ่ต็บง+- 0.1%โ1%๏ผBBB-BB ็บง+- 1%โ5%๏ผB ็บง+- EDF > 5%๏ผCCC ๅไปฅไธ++---++### 1.5 ไฟก็จ่ฏๅๅกๆนๆณ่ฎบ++้็จไบ้ถๅฎไฟก่ดท/ABS ๅบๅฑ่ตไบงๅๆ๏ผ++**ๅปบๆจกๆต็จ**๏ผ+1. **ๆฐๆฎๅๅค**๏ผๆถ้ๅๅฒ่ดทๆฌพๆฐๆฎ๏ผๅฎไน่ฟ็บฆๆ ็ญพ๏ผๅฆ้พๆ90ๅคฉ+๏ผ+2. **็นๅพๅทฅ็จ**๏ผWOE๏ผWeight of Evidence๏ผ็ผ็ +3. **็นๅพ้ๆฉ**๏ผIVๅผ๏ผInformation Value๏ผ็ญ้๏ผIV>0.02ไฟ็+4. **ๆจกๅ่ฎญ็ป**๏ผLogistic Regression๏ผไธปๆต๏ผใXGBoost+5. **่ฏๅ่ฝฌๆข**๏ผ`Score = A - Bรln(odds)`๏ผ้ๅธธๅบๅๅ600๏ผPDO=20++**WOE ๅ IV ่ฎก็ฎ**๏ผ+```python+WOE_i = ln(ๅฅฝๆ ทๆฌๆฏไพ_i / ๅๆ ทๆฌๆฏไพ_i)+IV_i = (ๅฅฝๆ ทๆฌๆฏไพ_i - ๅๆ ทๆฌๆฏไพ_i) ร WOE_i+ๆปIV = ฮฃ IV_i+```++**IV ๅ่ๆ ๅ**๏ผ+- IV < 0.02๏ผๆ ้ขๆตๅ+- 0.02โ0.1๏ผๅผฑ้ขๆตๅ+- 0.1โ0.3๏ผไธญ็ญ้ขๆตๅ+- IV > 0.3๏ผๅผบ้ขๆตๅ++---++## ไบใๅบๆถไบงๅๅๆ++### 2.1 ๅฝๅบไธๆฟๅบๅบ++#### ๆถ็็ๆฒ็บฟๅๆ++**ๅณๆๅฉ็ๆฒ็บฟ๏ผZero Curve๏ผ**๏ผๅๆ้ๆ ้ฃ้ฉ้ถๆฏๅบๆถ็็๏ผ้่ฟ Bootstrap ๆนๆณไป้ๆฏๅบๆๅใ++**่ฟๆๅฉ็ๆฒ็บฟ๏ผForward Curve๏ผ**๏ผ+```+f(T1, T2) = [(1+r2)^T2 / (1+r1)^T1]^(1/(T2-T1)) - 1+```++**ๆ้ๅฉๅทฎ**๏ผ+- 10Y-2Y๏ผ็ปๆตๅจๆ้ขๅคๆๆ ๏ผ่ดๅผ้ๅธธ้ข็คบ่กฐ้+- 10Y-1Y๏ผๆตๅจๆงๅๅฅฝ่กก้ๆๆ +- 30Y-10Y๏ผ่ถ ้ฟ็ซฏไพ้ๅคๆญ++**ๆถ็็ๆฒ็บฟๅฝขๆ**๏ผ+| ๅฝขๆ | ็นๅพ | ็ปๆตๅซไน |+|------|------|----------|+| ๆญฃๆ็๏ผNormal๏ผ | ้ฟ็ซฏ>็ญ็ซฏ | ็ปๆตๆฉๅผ ้ขๆ |+| ๅนณๅฆ๏ผFlat๏ผ | ๅๆ้็ธ่ฟ | ็ปๆต่ฝฌๆ็น |+| ๅๆ๏ผInverted๏ผ | ็ญ็ซฏ>้ฟ็ซฏ | ่กฐ้ไฟกๅท |+| ้ฉผๅณฐ๏ผHumped๏ผ | ไธญ็ซฏๆ้ซ | ๆตๅจๆงๅๅฑ |++#### ไธญๅฝๅฝๅบๆถ็็ๆฒ็บฟ็น็น+- ๅบๅๆฒ็บฟ๏ผไธญๅฝๅฝๅบ๏ผCGBs๏ผ+ ๅฝๅผๅบ๏ผPolicy Bank Bonds๏ผ+- ๅ ณ้ฎ็นไฝ๏ผ1Y/3Y/5Y/7Y/10Y/30Y+- 10Yๅฝๅบไธบๆ ธๅฟๅบๅๅฉ็++---++### 2.2 ไผไธๅบๅๆ++#### ๆ ธๅฟๆๆ ++**็ฅจ้ขๅฉ็๏ผCoupon Rate๏ผ**๏ผๅ่กๆถ็บฆๅฎ๏ผๆ้ขๅผ่ฎกๆฏใ++**ๅฐๆๆถ็็ YTM๏ผYield to Maturity๏ผ**๏ผ+ไฝฟ ๅบๅธ็ฐๅผ = ๅธๅบไปทๆ ผ็ๅ ้จๆถ็็๏ผ+```+P = ฮฃ [C/(1+y)^t] + F/(1+y)^n+```+ๅ ถไธญ C=็ฅจๆฏ๏ผF=้ขๅผ๏ผy=YTM๏ผn=ๆๆฐใ++**ๅฝๆๆถ็็๏ผCurrent Yield๏ผ**๏ผ`CY = ๅนด็ฅจๆฏ / ๅธๅบไปทๆ ผ`๏ผๅฟฝ็ฅๆฌ้ๆ็๏ผ++**ไฟฎๆญฃไน ๆ๏ผModified Duration๏ผ**๏ผ+```+MD = -dP/P รท dy = Macaulay Duration / (1+y/m)+```+ๅซไน๏ผๅฉ็ๆฏๅๅ1%๏ผๅบๅธไปทๆ ผๅๅ็บฆMD%๏ผๅๅ๏ผใ++**ๅธๆง๏ผConvexity๏ผ**๏ผ+```+CX = [ฮฃ t(t+1)ยทCF_t/(1+y)^(t+2)] / P+ไปทๆ ผๅๅไฟฎๆญฃ๏ผฮP/P โ -MDยทฮy + 0.5ยทCXยท(ฮy)ยฒ+```++#### ๅบๅธไปทๆ ผๅ ฌๅผ๏ผๅฎๆด๏ผ+```python+def bond_price(face, coupon_rate, ytm, n_periods, freq=1):+ """้ๆฏๅบๅธๅฎไปท๏ผ่ดด็ฐ็ฐ้ๆตๆณ๏ผใ++ Args:+ face: ้ขๅผ+ coupon_rate: ็ฅจ้ขๅฉ็๏ผๅนดๅ๏ผ+ ytm: ๅฐๆๆถ็็๏ผๅนดๅ๏ผ+ n_periods: ๅฉไฝไปๆฏๆๆฐ+ freq: ๆฏๅนดไปๆฏๆฌกๆฐ๏ผ1=ๅนดไป๏ผ2=ๅๅนดไป๏ผ++ Returns:+ ๅบๅธ็ฐๅผ๏ผ่ไปท๏ผ+ """+ c = face * coupon_rate / freq+ y = ytm / freq+ pv_coupons = c * (1 - (1+y)**(-n_periods)) / y+ pv_face = face / (1+y)**n_periods+ return pv_coupons + pv_face+```++---++### 2.3 ๅฏ่ฝฌๅบ๏ผ็บฏๅบ้จๅ๏ผ++> ๅฏ่ฝฌๅบ็่ฝฌ่กๆๆ้จๅ่ฏฆ่ง `convertible-bond` skill๏ผๆฌ่่็ฆ็บฏๅบไปทๅผใ++**็บฏๅบไปทๅผ๏ผBond Floor๏ผ**๏ผ+```+็บฏๅบไปทๅผ = ฮฃ [็ฅจๆฏ/(1+r_straight)^t] + ้ขๅผ/(1+r_straight)^n+```+ๅ ถไธญ r_straight ไธบๅ่ฏ็บงๅๆ้็ดๅบๆถ็็ใ++**่ฝฌ่กๆบขไปท็ไธ็บฏๅบๆบขไปท็**๏ผ+- ่ฝฌ่กๆบขไปท็ = (ๅฏ่ฝฌๅบไปทๆ ผ - ่ฝฌ่กไปทๅผ) / ่ฝฌ่กไปทๅผ+- ็บฏๅบๆบขไปท็ = (ๅฏ่ฝฌๅบไปทๆ ผ - ็บฏๅบไปทๅผ) / ็บฏๅบไปทๅผ++**ไธไฟฎๆกๆฌพไฟก็จๅซไน**๏ผ+ไธไฟฎ่ฝฌ่กไปทๅฏ่ฝๅฏผ่ดๆ่๏ผ้่ฏไผฐๅ ฌๅธๆๆฟ๏ผๅผบ่ตๅฒๅจ vs ๅๅฎๅๅ๏ผใ++---++### 2.4 ABS/MBS ๅๆ++#### ๅบๅฑ่ตไบงๅๆๆกๆถ++**่ตไบง่ดจ้ๆๆ **๏ผ+- ๅ ๆๅนณๅ็ฅจๆฏ๏ผWAC๏ผ+- ๅ ๆๅนณๅๅฉไฝๆ้๏ผWAM๏ผ+- ๅ ๆๅนณๅ่ดทๆฌพไปทๅผๆฏ๏ผLTV๏ผ+- ๅๅฒ้พๆ็๏ผDPD 30/60/90+๏ผ+- ็ดฏ่ฎก่ฟ็บฆ็๏ผCDR๏ผCumulative Default Rate๏ผ++**ๆฉๅฟ็ๆจกๅ**๏ผ+- CPR๏ผConditional Prepayment Rate๏ผ๏ผๅนดๅๆฉๅฟ็+- SMM๏ผSingle Monthly Mortality๏ผ๏ผๆๆฉๅฟ็+ ```+ CPR = 1 - (1 - SMM)^12+ SMM = 1 - (1 - CPR)^(1/12)+ ```+- PSA ๆจกๅ๏ผๆ ๅๆฉๅฟๅ่ฎพ๏ผPSA100 = ๅ30ไธชๆ็บฟๆงๅข่ณ6%/ๅนด๏ผไนๅ6%/ๅนดๆๅฎ๏ผ++**ๅๅฑ็ปๆ๏ผTranche๏ผๅๆ**๏ผ+- ไผๅ ็บง๏ผSenior๏ผ๏ผๆๅ ๅๅฟ๏ผ่ฏ็บงๆ้ซ+- ๅคนๅฑ๏ผMezzanine๏ผ๏ผๆฌก็บงๅๅฟ+- ๅฃๅ็บง๏ผEquity/Junior๏ผ๏ผ้ฆๅ ๅธๆถๆๅคฑ๏ผ่ถ ้ขๅฉๅทฎๅฝๅฑ++**ๅ ณ้ฎ้ฃ้ฉๆๆ **๏ผ+```+ๅขไฟกๅๆฐ = (ๅบๅฑ่ตไบงๆฑ ่งๆจก - ไผๅ ็บง่งๆจก) / ไผๅ ็บง่งๆจก+่ถ ้ขๅฉๅทฎ = ๅบๅฑ่ตไบงๆฑ ๅฉ็ - ไผๅ ็บง่่ตๆๆฌ - ๆๅก่ดน+```++---++### 2.5 ๅๆๅบไฟก็จๅๆ++ๅๆๅบ๏ผLGFV๏ผๅฐๆนๆฟๅบ่่ตๅนณๅฐๅบ๏ผๆฏไธญๅฝๅบๆถๅธๅบ็นๆๅ็งใ++#### ๅๆๆกๆถ++**ๅ็ปด่ฏไผฐๆจกๅ**๏ผ++| ็ปดๅบฆ | ๆ ธๅฟๆๆ | ๆ้ |+|------|----------|------|+| ๅบๅ่ดขๆฟๅฎๅ | ไธ่ฌๅ ฌๅ ฑ้ข็ฎๆถๅ ฅใGDP่งๆจกใ่ดขๆฟ่ช็ป็ | 40% |+| ๅนณๅฐๅฑ็บง | ็็บง>ๅธ็บง>ๅบๅฟ็บง๏ผ็บงๅซ่ถ้ซ้ๆงๆฏๆ่ถๅผบ | 25% |+| ๅนณๅฐๅฐไฝ | ๆฏๅฆๅฏไธๅๆใ่ตไบงๆณจๅ ฅๅๅบฆใไธๅกๅคๅ ๅ | 20% |+| ๅบๅก็ปๆ | ๆๆฏ่ดๅบ่งๆจกใ็ญๆๅบๅกๅ ๆฏใๅ่่ตๅๅ | 15% |++**้ๆงๅบๅก้ฃ้ฉไฟกๅท**๏ผ+- ๅๆ่ดงๅธ่ต้/็ญๆๅบๅก < 0.5๏ผๆตๅจๆง็ดงๅผ ๏ผ+- EBITDAๅฉๆฏ่ฆ็็ < 1๏ผไพ่ตๅค้จ่่ตไปๆฏ๏ผ+- ้ๆ ่่ตๅ ๆฏ>30%๏ผๅ่่ต้ฃ้ฉ้ซ๏ผ+- ๅบๅฟ็บงๅๆใๅผฑๅบๅ๏ผ่ดๅบ็>100%๏ผ++**ๅๆไผฐๅผๆบขไปท็ปๆ**๏ผๅ่๏ผ๏ผ+```+ๅๆๅฉ็ โ ๅๆๅฝๅบ + ๆตๅจๆงๆบขไปท(30-50bp) + ๅบๅๆบขไปท(0-200bp) + ๅนณๅฐๆบขไปท(0-100bp)+```++**ๆฟ็ญ้ฃ้ฉ**๏ผ2023ๅนดๅๆๅๅบๆฟ็ญๅๅๅๅ ๅง๏ผๅ ณๆณจ๏ผ+- ไธๆฝๅญๅๅบ่ฟๅบฆ+- ๅนณๅฐ่ฝฌๅ๏ผๅๆ่ฝฌไผไธ๏ผ+- ๅบๅๅๅ็ฎก็ๆฟ็ญ++---++## ไธใๅฉ็้ฃ้ฉ็ฎก็++### 3.1 ไน ๆไฝ็ณป++#### Macaulay Duration๏ผ้บฆ่ๅฉไน ๆ๏ผ++ๆถ้ดๅ ๆ็ฐ้ๆต็ฐๅผไนๅ๏ผๅไฝไธบ"ๅนด"๏ผ+```+D_mac = ฮฃ [t ร CF_t/(1+y)^t] / P+```++#### Modified Duration๏ผไฟฎๆญฃไน ๆ๏ผ++ๅฉ็ๆๆๆงๅบฆ้๏ผ+```+D_mod = D_mac / (1 + y/m)+ฮP โ -D_mod ร P ร ฮy+```++#### Effective Duration๏ผๆๆไน ๆ๏ผ++้็จไบๅซๆๅบๅธ๏ผๅฏ่ตๅๅบใMBS็ญ๏ผ๏ผ+```+D_eff = (P_down - P_up) / (2 ร P_0 ร ฮy)+```+ๅ ถไธญ P_down/P_up ไธบๅฉ็ไธ็งป/ไธ็งปฮyๅ็ไปทๆ ผใ++#### Dollar Duration๏ผไน ๆ้้ข๏ผ++```+Dollar Duration = D_mod ร P ร ้ขๅผ+```++---++### 3.2 ๅธๆง๏ผConvexity๏ผ++่กก้ไน ๆๅฏนๅฉ็็ๆๆๆง๏ผไบ้ถๆๅบ๏ผ๏ผ++```+C = ฮฃ [t(t+1) ร CF_t/(1+y)^(t+2)] / P++ไปทๆ ผ็ฒพ็กฎไผฐ็ฎ๏ผ+ฮP/P โ -D_modยทฮy + 0.5ยทCยท(ฮy)ยฒ+```++**ๅธๆง็ไปทๅผ**๏ผๆญฃๅธๆงไฝฟๅบๅธๅจๅฉ็ไธ่กๆถๆถจๅน ๅคงไบ้ขๆ๏ผๅฉ็ไธ่กๆถ่ทๅน ๅฐไบ้ขๆ๏ผ๏ผๅ ๆญคๆญฃๅธๆงๅบๅธๆฏ่ดๅธๆงๅบๅธ๏ผๅฆๅฏ่ตๅๅบใMBS๏ผๆดๅ้็ใ++---++### 3.3 DV01๏ผๅบ็นไปทๅผ๏ผ++ๅฉ็ๅๅจ1ๅบ็น๏ผ0.01%๏ผๅฏผ่ด็ไปทๆ ผๅๅ๏ผ+```+DV01 = D_mod ร P ร 0.0001+```++็ปๅๅฑ้ข๏ผ`Portfolio DV01 = ฮฃ (DV01_i ร ๆไป้_i)`++**็จ้**๏ผๅฉ็ๅฏนๅฒๆฏ็่ฎก็ฎ+```+ๅฏนๅฒๆฏ็ = DV01_่ขซๅฏนๅฒๅคดๅฏธ / DV01_ๅฏนๅฒๅทฅๅ ท+```++---++### 3.4 ๅ ณ้ฎๅฉ็ไน ๆ๏ผKey Rate Duration, KRD๏ผ++่กก้ๆถ็็ๆฒ็บฟๅๅ ณ้ฎๆ้ๅนณ่ก็งปๅจ1bpๅฏนไปทๆ ผ็ๅฝฑๅ๏ผ+- ๅธธ็จๅ ณ้ฎ็น๏ผ1Y, 2Y, 3Y, 5Y, 7Y, 10Y, 20Y, 30Y+- `KRD_i = -ฮP/(P ร ฮy_i)`๏ผไป ็ฌฌiไธชๅ ณ้ฎๅฉ็ๅๅจ1bp๏ผ+- `ฮฃ KRD_i โ D_mod`๏ผๅๅ ณ้ฎๅฉ็ไน ๆไนๅ็บฆ็ญไบไฟฎๆญฃไน ๆ๏ผ++**ๅบ็จ**๏ผ+- ่ฏๅซ็ปๅๅฏน็นๅฎๆ้ๅฉ็็ๆด้ฒ+- ็ฒพ็กฎๅฏนๅฒ้ๅนณ่ก็งปๅจ้ฃ้ฉ๏ผๆญๆฒ/่ถๅผ๏ผ++---++### 3.5 ๅ ็ซ็ญ็ฅ++**ไน ๆๅน้ ๏ผDuration Matching๏ผ**๏ผ+ไฝฟ่ตไบง็ปๅไน ๆ = ่ดๅบไน ๆ๏ผๅฏนๅฉ็ๅนณ่ก็งปๅจๅ ็ซใ+ๆกไปถ๏ผ`ฮฃ (w_i ร D_i) = D_liability`++**็ฐ้ๆตๅน้ ๏ผCash Flow Matching๏ผ**๏ผ+็ดๆฅๅน้ ๆฏๆ็ฐ้ๆต๏ผๅฝปๅบๆถ้คๅๆ่ต้ฃ้ฉ๏ผไฝ็ตๆดปๆงๅทฎใๆๆฌ้ซใ++**ๆกไปถๅ ็ซ๏ผContingent Immunization๏ผ**๏ผ+ๅฝ็ปๅไปทๅผ่ถ ่ฟๅฎๅ จๅบ็บฟๆถไธปๅจ็ฎก็๏ผ่ท่ณๅบ็บฟๆถๅๆขไธบ่ขซๅจๅ ็ซใ++**ๅๅนณ่กก้ข็**๏ผ+- ไน ๆ้ๆถ้ดๆผ็งป๏ผ้ๅฎๆ๏ผๅญฃๅบฆ/ๆๅบฆ๏ผๅๅนณ่กก+- ๅฉ็ๅคงๅน ๅๅจ๏ผ>50bp๏ผๅ็ซๅณๅๅนณ่กก++---++## ๅใไฟก็จๅฉๅทฎๅๆ++### 4.1 ไฟก็จๅฉๅทฎ็ๆๆ++```+ไฟก็จๅฉๅทฎ๏ผCredit Spread๏ผ= ่ฟ็บฆ้ฃ้ฉๆบขไปท + ๆตๅจๆงๆบขไปท + ็จๆถๆบขไปท๏ผ้จๅๅธๅบ๏ผ+```++| ็ปๆ้จๅ | ๅฝฑๅๅ ็ด | ้ๅๆนๅผ |+|----------|----------|----------|+| ่ฟ็บฆ้ฃ้ฉๆบขไปท | ่ฏ็บงใ่กไธใ่ดขๅก็ถๅตใๅฎ่งๅจๆ | CDSๆฅไปทใๆจกๅๆต็ฎ |+| ๆตๅจๆงๆบขไปท | ๅ่ก่งๆจกใๅฉไฝๆ้ใๅธๅบๆทฑๅบฆ | ไนฐๅไปทๅทฎใๆขๆ็ |+| ็จๆถๆบขไปท | ๅฝๅบๅ ็จไผๆ ๏ผ้จๅๅฝๅฎถ/ๆ่ต่ ๏ผ | ๅฉ็ๅทฎๅผๅๆ |++**ๅฉๅทฎ่กก้ๅบๅ**๏ผ+- ๅฝ้ ๅธๅบ๏ผG-Spread๏ผvs ๅฝๅบ๏ผใI-Spread๏ผvs ๆๆ๏ผใZ-Spread๏ผ้ถๆฏๅฉๅทฎ๏ผใOAS๏ผๆๆ่ฐๆดๅฉๅทฎ๏ผ+- ไธญๅฝๅธๅบ๏ผไฟก็จๅฉๅทฎ้ๅธธๅฏนๆฏๅฝๅบๆAAAๅๆ++**OAS๏ผOption-Adjusted Spread๏ผ**๏ผ+ๅฅ็ฆปๅตๅ ฅๆๆไปทๅผๅ็ไฟก็จๅฉๅทฎ๏ผ้็จไบๅซๆๅบๆฏ่พ๏ผ+```+P = ฮฃ CF_t / (1 + r_t + OAS)^t+```++---++### 4.2 ไฟก็จๅฉๅทฎๆฒ็บฟๅฝขๆ++**ๆญฃๆ็**๏ผๅธธ่ง๏ผ๏ผ้ฟๆๅฉๅทฎ > ็ญๆๅฉๅทฎ๏ผๅๆ ๆ้ไธ็กฎๅฎๆงๅ ๅ ใ++**ๅนณๅฆ/ๅๆ**๏ผ+- ๅธๅบๅฏน้ฟๆไฟก็จ้ฃ้ฉไน่ง๏ผๅนณๅฆ๏ผ+- ็ญๆๆตๅจๆงๅฑๆบ/ๅ่่ตๅฐๅข๏ผๅๆ๏ผ๏ผ่ญฆ็คบไฟกๅท++**ไฟก็จๅฉๅทฎไธๅฝๅบๆถ็็็็ธๅ ณๆง**๏ผ+- ็ปๆตๆฉๅผ ๏ผไฟก็จๅฉๅทฎๆถ็ช๏ผ้ฃ้ฉๅๅฅฝไธๅ๏ผ+- ็ปๆต่กฐ้/ไฟก็จไบไปถ๏ผไฟก็จๅฉๅทฎ่ตฐ้+- "้ๅ่ดจ้"ๆๅบ๏ผๅฝๅบๆถ็็ไธ่ก+ไฟก็จๅฉๅทฎๆฉๅคง๏ผๅ้ๆๅป้ซๆถ็ๅบ++---++### 4.3 ไฟก็จๅฉๅทฎๅๅ็้ฉฑๅจๅ ็ด++**ๅฎ่งๅ ็ด **๏ผ+- GDPๅข้ใPMI๏ผ้ขๆๆนๅโๅฉๅทฎๆถ็ช+- ่ดงๅธๆฟ็ญๅฎฝๆพ๏ผๆตๅจๆงๆบขไปทไธ้+- ไฟก็จไบไปถ๏ผ่ฟ็บฆๆฝฎ๏ผ๏ผ็ณป็ปๆงๅฉๅทฎ่ตฐ้++**่กไธๅ ็ด **๏ผ+- ่กไธๆฟ็ญ๏ผๅฆๅฐไบง่ฐๆงใๅๆๅๅบ๏ผ+- ่กไธๆฏๆฐๅจๆ+- ๅ่่ต็ฏๅข++**ไธชๅธๅ ็ด **๏ผ+- ่ฏ็บง่ฐๆด๏ผไธ่ฐโๅฉๅทฎ่ทณๅ๏ผ+- ่ดขๅกๆฐๆฎๅๅ+- ๅฐๆๅๅ๏ผไธด่ฟๅฐๆโๆตๅจๆงๅฉๅทฎๅขๅ ๏ผ++---++### 4.4 ไฟก็จๅฉๅทฎไบคๆ็ญ็ฅ++**ๅฉๅทฎๅ็ผฉไบคๆ๏ผSpread Tightening๏ผ**๏ผ+ๅๅค่ขซไฝไผฐ๏ผ้ซๅฉๅทฎ๏ผไฟก็จๅบ๏ผๅ็ฉบๅฝๅบๅฏนๅฒๅฉ็้ฃ้ฉใ+- ้็จๅบๆฏ๏ผ็ปๆตๅค่ๅๆใๅคฎ่กๅฎฝๆพๅจๆ++**ๅฉๅทฎๆฉๅคงไบคๆ๏ผSpread Widening๏ผ**๏ผ+ๅ็ฉบไฟก็จๅบ๏ผ้่ฟCDS๏ผ๏ผๅๅคๅฝๅบใ+- ้็จๅบๆฏ๏ผ็ปๆตไธ่กใไฟก็จไบไปถ้ขๅ++**่ทจ่ฏ็บงๅฉๅทฎไบคๆ**๏ผ+ๅๅค้ซๆถ็/ๅ็ฉบๆ่ต็บง๏ผๅฉๅทฎๅ็ผฉๆถ๏ผ๏ผๆ็ธๅใ++**่ถๅผๅฉๅทฎไบคๆ๏ผButterfly๏ผ**๏ผ+ๅๅคไธญๆใๅ็ฉบ็ญ็ซฏๅ้ฟ็ซฏ๏ผ่ทๅฉไบไฟก็จๆฒ็บฟไธญๆฎต็็ธๅฏนไปทๅผใ++**ไธญๅฝ็น่ฒๅทฅๅ ท**๏ผ+- ไฟก็จ้ฃ้ฉ็ผ้ๅทฅๅ ท๏ผCRMW/CDS๏ผ๏ผๅฏนๅฒไฟก็จ้ฃ้ฉ+- ๅฝๅบๆ่ดง๏ผๅฏนๅฒๅฉ็ไน ๆ้ฃ้ฉ++---++## ไบใPython ไปฃ็ ๆจกๆฟ++### 5.1 ๅบๅธๅฎไปทไธไน ๆ่ฎก็ฎ++```python+import numpy as np+from scipy.optimize import brentq+++def bond_price(face: float, coupon_rate: float, ytm: float,+ n_periods: int, freq: int = 1) -> float:+ """้ๆฏๅบๅธๅ็ฐๅผๅฎไปทใ++ Args:+ face: ้ขๅผ๏ผ้ๅธธ100+ coupon_rate: ๅนด็ฅจ้ขๅฉ็๏ผๅฐๆฐๅฝขๅผ๏ผๅฆ0.05่กจ็คบ5%๏ผ+ ytm: ๅนดๅฐๆๆถ็็๏ผๅฐๆฐๅฝขๅผ๏ผ+ n_periods: ๅฉไฝไปๆฏๆๆฐ+ freq: ๆฏๅนดไปๆฏๆฌกๆฐ๏ผ1=ๅนดไป๏ผ2=ๅๅนดไป๏ผ++ Returns:+ ๅบๅธๅ จไปท๏ผ่ไปท๏ผ++ Examples:+ >>> bond_price(100, 0.05, 0.04, 5) # 5ๅนดๆใ5%็ฅจๆฏใYTM=4%+ 104.4518...+ """+ c = face * coupon_rate / freq+ y = ytm / freq+ if y == 0:+ return c * n_periods + face+ pv_coupons = c * (1 - (1 + y) ** (-n_periods)) / y+ pv_face = face / (1 + y) ** n_periods+ return pv_coupons + pv_face+++def ytm_solve(price: float, face: float, coupon_rate: float,+ n_periods: int, freq: int = 1) -> float:+ """็ปๅฎๅธๅบไปทๆ ผๅๆฑYTM๏ผๆฐๅผ่งฃๆณ๏ผใ++ Args:+ price: ๅบๅธๅธๅบไปทๆ ผ๏ผ่ไปท๏ผ+ face: ้ขๅผ+ coupon_rate: ๅนด็ฅจ้ขๅฉ็+ n_periods: ๅฉไฝไปๆฏๆๆฐ+ freq: ๆฏๅนดไปๆฏๆฌกๆฐ++ Returns:+ ๅนดๅYTM๏ผๅฐๆฐๅฝขๅผ๏ผ++ Raises:+ ValueError: ๆ ๆณๅจๅ็่ๅดๅ ๆพๅฐ่งฃๆถ+ """+ def pv_diff(y):+ return bond_price(face, coupon_rate, y, n_periods, freq) - price++ try:+ return brentq(pv_diff, -0.5, 10.0)+ except ValueError as e:+ raise ValueError(f"ๆ ๆณๆฑ่งฃYTM๏ผๆฃๆฅ่พๅ ฅๅๆฐ: {e}")+++def macaulay_duration(face: float, coupon_rate: float, ytm: float,+ n_periods: int, freq: int = 1) -> float:+ """Macaulayไน ๆ๏ผๅไฝ๏ผๆๆฐ๏ผ้คไปฅfreqๅพๅนดๆฐ๏ผใ++ Args:+ face: ้ขๅผ+ coupon_rate: ๅนด็ฅจ้ขๅฉ็+ ytm: ๅนดๅฐๆๆถ็็+ n_periods: ๅฉไฝไปๆฏๆๆฐ+ freq: ๆฏๅนดไปๆฏๆฌกๆฐ++ Returns:+ Macaulayไน ๆ๏ผๅนด๏ผ+ """+ c = face * coupon_rate / freq+ y = ytm / freq+ price = bond_price(face, coupon_rate, ytm, n_periods, freq)++ weighted_sum = sum(+ t * (c / (1 + y) ** t)+ for t in range(1, n_periods)+ ) + n_periods * ((c + face) / (1 + y) ** n_periods)++ return (weighted_sum / price) / freq+++def modified_duration(face: float, coupon_rate: float, ytm: float,+ n_periods: int, freq: int = 1) -> float:+ """ไฟฎๆญฃไน ๆใ++ Returns:+ ไฟฎๆญฃไน ๆ๏ผๅฏนytm็ไปทๆ ผๅผนๆง๏ผๅ่ดๅทๅ๏ผ+ """+ d_mac = macaulay_duration(face, coupon_rate, ytm, n_periods, freq)+ return d_mac / (1 + ytm / freq)+++def convexity(face: float, coupon_rate: float, ytm: float,+ n_periods: int, freq: int = 1) -> float:+ """ๅบๅธๅธๆงใ++ Returns:+ ๅธๆง๏ผๅนดยฒ๏ผ+ """+ c = face * coupon_rate / freq+ y = ytm / freq+ price = bond_price(face, coupon_rate, ytm, n_periods, freq)++ conv_sum = sum(+ t * (t + 1) * (c / (1 + y) ** (t + 2))+ for t in range(1, n_periods)+ ) + n_periods * (n_periods + 1) * ((c + face) / (1 + y) ** (n_periods + 2))++ return (conv_sum / price) / (freq ** 2)+++def dv01(face: float, coupon_rate: float, ytm: float,+ n_periods: int, freq: int = 1, par_amount: float = 1_000_000) -> float:+ """DV01๏ผๆฏ็พไธ้ขๅผ็ๅบ็นไปทๅผ๏ผใ++ Args:+ par_amount: ๆไป้ขๅผ๏ผ้ป่ฎค100ไธ++ Returns:+ ๆฏ1bpๅฉ็ๅๅจๅฏนๅบ็ไปทๆ ผๅๅ๏ผๅ ๏ผ+ """+ d_mod = modified_duration(face, coupon_rate, ytm, n_periods, freq)+ price = bond_price(face, coupon_rate, ytm, n_periods, freq)+ return d_mod * (price / 100) * 0.0001 * par_amount+```++---++### 5.2 ๆถ็็ๆฒ็บฟๆๅ๏ผNelson-Siegel / Svensson๏ผ++```python+import numpy as np+from scipy.optimize import minimize+from typing import Tuple+++def nelson_siegel(tau: np.ndarray, beta0: float, beta1: float,+ beta2: float, lambda1: float) -> np.ndarray:+ """Nelson-Siegel ๅณๆๅฉ็ๆจกๅใ++ Args:+ tau: ๆ้ๆฐ็ป๏ผๅนด๏ผ+ beta0: ้ฟๆๅฉ็ๆฐดๅนณ๏ผlevel๏ผ+ beta1: ๆ็ๅ ๅญ๏ผslope๏ผ+ beta2: ๆฒ็ๅ ๅญ๏ผcurvature๏ผ+ lambda1: ๆฒ็บฟ่กฐๅ้ๅบฆ++ Returns:+ ๅๆ้ๅณๆๅฉ็ๆฐ็ป+ """+ factor1 = (1 - np.exp(-tau / lambda1)) / (tau / lambda1)+ factor2 = factor1 - np.exp(-tau / lambda1)+ return beta0 + beta1 * factor1 + beta2 * factor2+++def svensson(tau: np.ndarray, beta0: float, beta1: float,+ beta2: float, beta3: float,+ lambda1: float, lambda2: float) -> np.ndarray:+ """Svensson ๆจกๅ๏ผNSๆฉๅฑ๏ผๅๆฒ็ๅ ๅญ๏ผใ++ Args:+ tau: ๆ้ๆฐ็ป๏ผๅนด๏ผ+ beta0-beta3: ๅๆฐ+ lambda1, lambda2: ไธคไธช่กฐๅ้ๅบฆๅๆฐ++ Returns:+ ๅๆ้ๅณๆๅฉ็ๆฐ็ป+ """+ f1 = (1 - np.exp(-tau / lambda1)) / (tau / lambda1)+ f2 = f1 - np.exp(-tau / lambda1)+ f3 = (1 - np.exp(-tau / lambda2)) / (tau / lambda2) - np.exp(-tau / lambda2)+ return beta0 + beta1 * f1 + beta2 * f2 + beta3 * f3+++def fit_yield_curve(maturities: np.ndarray, yields: np.ndarray,+ model: str = "svensson") -> Tuple[np.ndarray, callable]:+ """ๆๅๆถ็็ๆฒ็บฟๅนถ่ฟๅๆๅผๅฝๆฐใ++ Args:+ maturities: ๅทฒ็ฅๅบๅธๆ้๏ผๅนด๏ผ๏ผๅฆ [0.25, 0.5, 1, 2, 3, 5, 7, 10]+ yields: ๅฏนๅบYTM๏ผๅฐๆฐ๏ผ๏ผๅฆ [0.02, 0.021, ...]+ model: "nelson_siegel" ๆ "svensson"++ Returns:+ (ๆไผๅๆฐ, ๆๅผๅฝๆฐ)++ Raises:+ ValueError: ๆช็ฅๆจกๅๅ็งฐ+ """+ if model == "nelson_siegel":+ def objective(params):+ fitted = nelson_siegel(maturities, *params)+ return np.sum((fitted - yields) ** 2)+ x0 = [0.04, -0.02, 0.01, 1.5]+ bounds = [(0, 0.2), (-0.2, 0.2), (-0.2, 0.2), (0.1, 10)]+ result = minimize(objective, x0, method="L-BFGS-B", bounds=bounds)+ return result.x, lambda t: nelson_siegel(np.array(t), *result.x)++ elif model == "svensson":+ def objective(params):+ fitted = svensson(maturities, *params)+ return np.sum((fitted - yields) ** 2)+ x0 = [0.04, -0.02, 0.01, 0.01, 1.5, 5.0]+ bounds = [(0, 0.2), (-0.2, 0.2), (-0.2, 0.2), (-0.2, 0.2),+ (0.1, 10), (0.1, 20)]+ result = minimize(objective, x0, method="L-BFGS-B", bounds=bounds)+ return result.x, lambda t: svensson(np.array(t), *result.x)++ else:+ raise ValueError(f"ๆช็ฅๆจกๅ: {model}๏ผๆฏๆ nelson_siegel / svensson")+```++---++### 5.3 Altman Z-Score ่ฎก็ฎ++```python+import pandas as pd+++def altman_z_score(working_capital: float, retained_earnings: float,+ ebit: float, market_cap: float, total_debt: float,+ revenue: float, total_assets: float,+ model: str = "original") -> dict:+ """Altman Z-Score ่ฟ็บฆ้ฃ้ฉ่ฏไผฐใ++ Args:+ working_capital: ่ฅ่ฟ่ตๆฌ๏ผๆตๅจ่ตไบง-ๆตๅจ่ดๅบ๏ผ+ retained_earnings: ็ๅญๆถ็+ ebit: ๆฏ็จๅๅฉๆถฆ+ market_cap: ่กๆๅธๅผ๏ผoriginal๏ผๆ่ดฆ้ขๅ่ตไบง๏ผprime/double_prime๏ผ+ total_debt: ๆปๅบๅก+ revenue: ่ฅไธๆถๅ ฅ+ total_assets: ๆป่ตไบง+ model: "original"๏ผไธๅธๅถ้ ไธ๏ผ| "prime"๏ผ็งๆไผไธ๏ผ| "double_prime"๏ผ้ๅถ้ ไธ๏ผ++ Returns:+ ๅซZ-Scoreใๅๅ้กนใ้ฃ้ฉ็ญ็บง็ๅญๅ ธ+ """+ x1 = working_capital / total_assets+ x2 = retained_earnings / total_assets+ x3 = ebit / total_assets+ x4 = market_cap / total_debt+ x5 = revenue / total_assets++ if model == "original":+ z = 1.2*x1 + 1.4*x2 + 3.3*x3 + 0.6*x4 + 1.0*x5+ safe_zone = z > 2.99+ distress_zone = z < 1.81+ elif model == "prime":+ z = 0.717*x1 + 0.847*x2 + 3.107*x3 + 0.420*x4 + 0.998*x5+ safe_zone = z > 2.90+ distress_zone = z < 1.23+ elif model == "double_prime":+ # ๅปๆX5๏ผ้ๅถ้ ไธ่ตไบงๅจ่ฝฌ็ๆไนไธๅ๏ผ+ z = 6.56*x1 + 3.26*x2 + 6.72*x3 + 1.05*x4+ safe_zone = z > 2.60+ distress_zone = z < 1.10+ else:+ raise ValueError(f"ๆช็ฅๆจกๅ: {model}")++ if safe_zone:+ risk_level = "ๅฎๅ จๅบ๏ผไฝ่ฟ็บฆ้ฃ้ฉ๏ผ"+ elif distress_zone:+ risk_level = "ๅฑ้ฉๅบ๏ผ้ซ่ฟ็บฆ้ฃ้ฉ๏ผ"+ else:+ risk_level = "็ฐ่ฒๅบ๏ผ้ๆทฑๅ ฅๅๆ๏ผ"++ return {+ "z_score": round(z, 4),+ "risk_level": risk_level,+ "components": {+ "X1_ๆตๅจๆง": round(x1, 4),+ "X2_็ๅฉ็งฏ็ดฏ": round(x2, 4),+ "X3_็ๅฉ่ฝๅ": round(x3, 4),+ "X4_ๆ ๆ": round(x4, 4),+ "X5_ๆ็": round(x5, 4) if model != "double_prime" else "N/A",+ }+ }+```++---++### 5.4 ไฟก็จๅฉๅทฎๆถๅบๅๆ++```python+import pandas as pd+import numpy as np+from typing import Optional+++def credit_spread_analysis(+ bond_yields: pd.Series,+ risk_free_yields: pd.Series,+ window: int = 252,+ issuer_name: Optional[str] = None+) -> pd.DataFrame:+ """ไฟก็จๅฉๅทฎๆถๅบๅๆ๏ผZ-Scoreๆ ๅๅ + ๅๅฒๅไฝๆฐ๏ผใ++ Args:+ bond_yields: ไฟก็จๅบๆถ็็ๆถ้ดๅบๅ๏ผ%๏ผๆฅ้ข๏ผ+ risk_free_yields: ๅฏนๅบๆ้ๆ ้ฃ้ฉๅฉ็๏ผ%๏ผๆฅ้ข๏ผ+ window: ๆปๅจ็ชๅฃ๏ผไบคๆๆฅๆฐ๏ผ๏ผ้ป่ฎค252๏ผ1ๅนด๏ผ+ issuer_name: ๅ่กไบบๅ็งฐ๏ผ็จไบ่พๅบๆ ๆณจ++ Returns:+ ๅซไฟก็จๅฉๅทฎใZ-Scoreใๅๅฒๅไฝๆฐ็DataFrame++ Raises:+ ValueError: ่พๅ ฅๅบๅ้ฟๅบฆไธไธ่ดๆถ+ """+ if len(bond_yields) != len(risk_free_yields):+ raise ValueError("ๆถ็็ๅบๅ้ฟๅบฆๅฟ ้กปไธ่ด")++ spread = bond_yields - risk_free_yields+ spread.name = f"{issuer_name or 'ๆช็ฅๅ่กไบบ'}_ไฟก็จๅฉๅทฎ(bp)"+ spread_bp = spread * 100 # ่ฝฌๆขไธบๅบ็น++ result = pd.DataFrame({"ไฟก็จๅฉๅทฎ_bp": spread_bp})++ # ๆปๅจ็ป่ฎก+ result["ๆปๅจๅๅผ"] = spread_bp.rolling(window).mean()+ result["ๆปๅจๆ ๅๅทฎ"] = spread_bp.rolling(window).std()+ result["Z-Score"] = (spread_bp - result["ๆปๅจๅๅผ"]) / result["ๆปๅจๆ ๅๅทฎ"]++ # ๅๅฒๅไฝๆฐ๏ผไฝฟ็จๅ จๆ ทๆฌ๏ผ+ result["ๅๅฒๅไฝๆฐ"] = spread_bp.rank(pct=True)++ # ๅฉๅทฎๅๅ+ result["ๆฅๅๅ_bp"] = spread_bp.diff()+ result["ๆๅๅ_bp"] = spread_bp.diff(21)++ # ไฟกๅท็ๆ+ result["ๅฉๅทฎไฟกๅท"] = "ไธญๆง"+ result.loc[result["Z-Score"] < -1.5, "ๅฉๅทฎไฟกๅท"] = "ๅ่ดต๏ผๅฉๅทฎๅไฝ๏ผ"+ result.loc[result["Z-Score"] > 1.5, "ๅฉๅทฎไฟกๅท"] = "ๅไพฟๅฎ๏ผๅฉๅทฎๅ้ซ๏ผ"++ return result+++def spread_term_structure(+ issuers: dict,+ risk_free_curve: pd.Series+) -> pd.DataFrame:+ """ไฟก็จๅฉๅทฎๆ้็ปๆๅๆใ++ Args:+ issuers: {ๅ่กไบบ: {ๆ้: ๆถ็็}} ๅญๅ ธ+ ไพ๏ผ{"AAAๅๆ": {1: 0.025, 3: 0.028, 5: 0.032}}+ risk_free_curve: ๆ ้ฃ้ฉๅฉ็ๆฒ็บฟ {ๆ้: ๆถ็็}++ Returns:+ ไฟก็จๅฉๅทฎๆ้็ปๆ็ฉ้ต๏ผ่ก=ๅ่กไบบ๏ผๅ=ๆ้๏ผ+ """+ records = []+ for issuer, ytm_curve in issuers.items():+ row = {"ๅ่กไบบ": issuer}+ for term, ytm in ytm_curve.items():+ rf = risk_free_curve.get(term, np.nan)+ row[f"{term}Yๅฉๅทฎ(bp)"] = round((ytm - rf) * 10000, 1)+ records.append(row)+ return pd.DataFrame(records).set_index("ๅ่กไบบ")+```++---++### 5.5 Merton ๆจกๅ่ฟ็บฆๆฆ็++```python+import numpy as np+from scipy.stats import norm+from scipy.optimize import fsolve+from typing import Tuple+++def merton_model(+ equity_value: float,+ equity_vol: float,+ debt_face: float,+ risk_free: float,+ T: float+) -> dict:+ """Merton็ปๆๅๆจกๅ๏ผไผฐ็ฎ่ฟ็บฆๆฆ็ๅไฟก็จๅฉๅทฎใ++ Args:+ equity_value: ่กๆๅธๅผ๏ผไบฟๅ ๏ผ+ equity_vol: ่กๆๅนดๅๆณขๅจ็๏ผๅฐๆฐ๏ผ+ debt_face: ๅบๅก้ขๅผ๏ผไบฟๅ ๏ผ็ฎๅไธบ้ถๆฏๅบ๏ผ+ risk_free: ๆ ้ฃ้ฉๅฉ็๏ผๅฐๆฐ๏ผ+ T: ๅบๅกๅฐๆๅนด้++ Returns:+ ๅซ่ตไบงไปทๅผใ่ท่ฟ็บฆ่ท็ฆปใ่ฟ็บฆๆฆ็ใไฟก็จๅฉๅทฎ็ๅญๅ ธ+ """+ def equations(params):+ V, sigma_V = params+ d1 = (np.log(V / debt_face) + (risk_free + 0.5 * sigma_V**2) * T) / (sigma_V * np.sqrt(T))+ d2 = d1 - sigma_V * np.sqrt(T)++ # ๆน็จ1๏ผ่กๆ=่ตไบง็ๆถจๆๆ+ eq1 = V * norm.cdf(d1) - debt_face * np.exp(-risk_free * T) * norm.cdf(d2) - equity_value+ # ๆน็จ2๏ผ่กๆๆณขๅจ็=่ตไบงๆณขๅจ็็ๆ ๆๆพๅคง+ eq2 = norm.cdf(d1) * sigma_V * V - equity_vol * equity_value+ return [eq1, eq2]++ # ๅๅงๅผไผฐ่ฎก+ V0 = equity_value + debt_face+ sigma_V0 = equity_vol * equity_value / V0++ solution = fsolve(equations, [V0, sigma_V0], full_output=True)+ V_star, sigma_V_star = solution[0]++ d1 = (np.log(V_star / debt_face) + (risk_free + 0.5 * sigma_V_star**2) * T) / (sigma_V_star * np.sqrt(T))+ d2 = d1 - sigma_V_star * np.sqrt(T)++ # ้ฃ้ฉไธญๆง่ฟ็บฆๆฆ็+ pd_rn = norm.cdf(-d2)++ # ่ท่ฟ็บฆ่ท็ฆป๏ผ็ๅฎไธ็่ฟไผผ๏ผ็จๆ ้ฃ้ฉๅฉ็ไปฃๆฟ็ๅฎๆผ็งป๏ผ+ dd = d2++ # ไฟก็จๅฉๅทฎ๏ผ็ฎๅไผฐ็ฎ๏ผ+ debt_value = debt_face * np.exp(-risk_free * T) * norm.cdf(d2) + V_star * norm.cdf(-d1)+ if debt_value > 0 and T > 0:+ credit_spread = -np.log(debt_value / (debt_face * np.exp(-risk_free * T))) / T+ else:+ credit_spread = np.nan++ return {+ "่ตไบงไปทๅผ_ไบฟ": round(V_star, 2),+ "่ตไบงๆณขๅจ็": round(sigma_V_star, 4),+ "่ท่ฟ็บฆ่ท็ฆป_DD": round(dd, 3),+ "่ฟ็บฆๆฆ็_RN": f"{pd_rn*100:.2f}%",+ "ไฟก็จๅฉๅทฎ_bp": round(credit_spread * 10000, 1) if not np.isnan(credit_spread) else "N/A",+ }+```++---++## ๅ ญใไธญๅฝๅบๆถๅธๅบ็น่ฒ++### 6.1 ๅธๅบ็ปๆ++#### ้ถ่ก้ดๅธๅบ vs ไบคๆๆๅธๅบ++| ็ปดๅบฆ | ้ถ่ก้ดๅธๅบ๏ผCFETS๏ผ | ไบคๆๆๅธๅบ๏ผไธไบคๆ/ๆทฑไบคๆ๏ผ |+|------|---------------------|--------------------------|+| ็็ฎกๆบๆ | ไบบๆฐ้ถ่ก | ่ฏ็ไผ |+| ไธป่ฆๅไธ่ | ้ถ่กใไฟ้ฉใๅบ้ใๅค่ต | ๅธๅใๅบ้ใไธชไบบๆ่ต่ |+| ไบคๆๆนๅผ | ่ฏขไปท๏ผOTC๏ผ+ ๅฟๅ็นๅป | ้ไธญๆฎๅ + ๅคงๅฎไบคๆ |+| ไธป่ฆๅ็ง | ๅฝๅบใๆฟ้ๅบใไฟก็จๅบใABS | ไผไธๅบใๅ ฌๅธๅบใๅฏ่ฝฌๅบ |+| ่งๆจกๅ ๆฏ | ~90%๏ผไปฅไบคๆ้่ฎก๏ผ | ~10% |+| ็ป็ฎๆนๅผ | T+0/T+1๏ผDVP๏ผ | T+1 |+| ๆตๅจๆง | ้ซ๏ผๅฝๅบ/ๆฟ้ๅบ๏ผ | ้ซ๏ผๅฏ่ฝฌๅบ๏ผ/ไฝ๏ผ็บฏๅบ๏ผ |++#### ไธป่ฆๅบๅธๅ็ง++| ๅ็ง | ๅ่กไธปไฝ | ็็ฎก/ๆณจๅ | ไฟก็จ้ฃ้ฉ |+|------|----------|-----------|----------|+| ๅฝๅบ๏ผCGBs๏ผ | ่ดขๆฟ้จ | ๆ ้ๅถ | ๆ ๏ผไธปๆไฟก็จ๏ผ |+| ๅฐๆนๆฟๅบๅบ | ๅ็ๅธๆฟๅบ | ่ดขๆฟ้จๅฎกๆน | ๆไฝ |+| ๆฟ็ญๆง้ถ่กๅบ๏ผๅฝๅผ/ๅๅ/่ฟๅบๅฃ๏ผ | ๆฟ็ญ่ก | ๆ ้ๅถ | ๆไฝ๏ผๅไธปๆ๏ผ |+| ๅไธๅญๅ๏ผNCD๏ผ | ้ถ่ก | ๅคฎ่ก | ไฝ๏ผ้ถ่กไฟก็จ๏ผ |+| ่ถ ็ญๆ่่ตๅธ๏ผSCP๏ผ/ ็ญ่๏ผCP๏ผ/ ไธญ็ฅจ๏ผMTN๏ผ | ้้่ไผไธ | ไบคๆๅๅไผ๏ผNAFMII๏ผ | ไธญ |+| ไผไธๅบ | ไผไธ | ๅๆนๅง | ไธญ้ซ |+| ๅ ฌๅธๅบ | ไธๅธๅ ฌๅธ | ่ฏ็ไผ | ไธญ้ซ |+| ๅๆๅบ | ๅฐๆน่่ตๅนณๅฐ | ๅคๅ | ไธญ้ซ๏ผ้ๆงๆฟๅบ่ไนฆ๏ผ |+| ABS/ABN | SPV | NAFMII/่ฏ็ไผ | ๅๅณไบๅบๅฑ่ตไบง |++---++### 6.2 ๅๆๅบๆทฑๅบฆๅๆ่ฆ็น++**ไธ็บงๅธๅบๅๆ**๏ผๅ่กๅฎไปท๏ผ๏ผ+1. ๆ ธๆฅๅ่กไบบๅฑ็บงๅๅบๅ๏ผ็/ๅธ/ๅบๅฟ๏ผ+2. ๅฎกๆฅไธปไธๅ ๆฏ๏ผๅบ็ก่ฎพๆฝไธๅกvsๅไธๅไธๅกๆฏไพ๏ผ+3. ่ฏไผฐๅบๅไธ่ฌๅ ฌๅ ฑ้ข็ฎๆถๅ ฅๅๆฟๅบ่ดๅบ็+4. ๅๆ่ฟ3ๅนดๅๆๆต่ฝฌ่ตไบง็็ๅฎๆง๏ผๅพๆฅๆฌพๅผๅธธ๏ผ++**ไบ็บงๅธๅบๅๆ**๏ผๆไปไผฐๅผ๏ผ๏ผ+1. ่ท่ธชๅฉๅทฎๅๅ๏ผvs ๅ่ฏ็บงๅๆ้๏ผ+2. ๅ ณๆณจ่ๆ ไบไปถ๏ผๆๆฏๆง่ฟ็บฆ/ๅ็ฅจ้พๆ/่ฏ็บงไธ่ฐ๏ผ+3. ็ๆตๅ่่ต่ๅฅ๏ผๅฐๆๅๅ vs ๆฐๅ่ๅฅ๏ผ+4. ๅ ณๆณจๅบๅๆฟ็ญ๏ผๅๅบๅๅใๅบๅก็ฝฎๆข่ฟๅบฆ๏ผ++**้ฃ้ฉ้ข่ญฆไฟกๅท๏ผ็บข็บฟ๏ผ**๏ผ+- ่ดงๅธ่ต้/็ญๆๅบๅก < 0.3+- ้ๆ ่่ต/ๆๆฏ่ดๅบ > 40%+- ๅ็ฅจ้พๆ่ขซ็บณๅ ฅ็ณป็ป๏ผ็ฅจๆฎๅคฑไฟกๅๅ๏ผ+- ๆๅจๅบๅๅๆๆดไฝๅ่่ตๅ้ป+- ็ฎก็ๅฑไบบไบๅๅจๅ ๅ ๅบๅ่ฏ็บง่ด้ขๅฑๆ++---++### 6.3 ็่ดข/่ต็ฎกไบงๅไฟก็จๅๆ++**ๅๅผๅ่ฝฌๅๅ็ๅบๅฑ็ฉฟ้ๅๆ**๏ผ+- ๆททๅๅ็่ดข๏ผ้ๅๅซ่ฏไผฐๆ็็ซฏ๏ผๅธๅผๆณขๅจ๏ผๅๅบๆถ็ซฏ๏ผไฟก็จ้ฃ้ฉ๏ผ+- ๅบๆถ+็ญ็ฅ๏ผไธปไฝ80%+ๅบๅธ๏ผ20%-ไปฅๅ ๆ็/ๅฏ่ฝฌๅบ+- FOFๅ็่ดข๏ผไธคๅฑๅตๅฅ็ฉฟ้๏ผ้่ฏไผฐๅบๅฑๅบ้ๆไป++**ๆตๅจๆงๅๆๆกๆถ**๏ผ+```+ไบงๅๅฑ้ขๆตๅจๆง = f(ๅบๅฑ่ตไบงๆตๅจๆง, ่ตๅๆกๆฌพ, ๆไฝๆๆฌๆณ vs ๅธๅผๆณ)+```+- ๆไฝๆๆฌๆณ๏ผไปทๆ ผ็จณๅฎไฝ้่้ฃ้ฉ๏ผไธ้็จๅๅผๅไบงๅ๏ผ+- ๅธๅผๆณ๏ผๅๆ ็ๅฎไปทๅผ๏ผไฝๆณขๅจๆด้ฒๅฏ่ฝๅผๅ่ตๅๆฝฎ++**ๅบๅฑไฟก็จ่ฏไผฐๆญฅ้ชค**๏ผ+1. ่ทๅๅบๅธๆไปๆ็ป๏ผๅญฃๆฅ/ๅๅนดๆฅๆซ้ฒ๏ผ+2. ๆ่ฏ็บง/่กไธ/ๅๆ/้ๅๆๅ็ฑป+3. ่ฎก็ฎๅ ๆไฟก็จๅฉๅทฎ+4. ่ฏๅซ้ไธญๅบฆ้ฃ้ฉ๏ผๅๅธ > 5%ไธบ้ซ้ไธญๅบฆ๏ผ+5. ่ฏไผฐๆตๅจๆงๆขฏๅบฆ๏ผ้ซๆตๅจโไฝๆตๅจ่ฆ็ๅบฆ๏ผ++---++### 6.4 ่ฟ็บฆๆกไพๅๆๆนๆณ่ฎบ++**่ฟ็บฆ็ฑปๅ**๏ผ+| ็ฑปๅ | ็นๅพ | ไธญๅฝๅ ธๅๆกไพ |+|------|------|------------|+| ๆตๅจๆง่ฟ็บฆ | ่ตไบงๅฅๅบทไฝ็ฐ้ๆตๆญ่ฃ | ้จๅไธญๅฐๆฟไผ |+| ๆๆฏๆง่ฟ็บฆ | ่งฆๅๆกๆฌพ๏ผไบคๅ่ฟ็บฆ/ๅ ้ๅฐๆ๏ผ | ๅค่งไบๅผฑ่ต่ดจไธปไฝ |+| ็ป่ฅๆง่ฟ็บฆ | ไธปไธๆถๅๅฏผ่ด่ฟๆฌพ่ฝๅไธ้ | ๆฐธ็ คใๅๆจ๏ผ2020๏ผ |+| ๆฌบ่ฏๆง่ฟ็บฆ | ่ดขๅก้ ๅ/่ตไบง่ พๆช | ๅบท็พ่ฏไธใ่็ๅ |++**่ฟ็บฆๅๆฒฟไฟกๅท๏ผPrecursor Signals๏ผ**๏ผ++```+่ดขๅกๅฑ้ข๏ผ+ - ๅบๆถ่ดฆๆฌพ/ๆป่ตไบง ๅผๅธธๅข้ซ๏ผ่ๅขๆถๅ ฅ๏ผ+ - ่ดงๅธ่ต้ไฝ้ข้ซไฝๅ้ๆฏไพ้ซ+ - ๅ่ช/ๆ ๅฝข่ตไบงๅ ๆฏๆ็ปญๅขๅคง+ - ๅ ณ่ๆนไบคๆๅ ๆฏๅผๅธธ++ๅธๅบๅฑ้ข๏ผ+ - ไบ็บงๅธๅบไปทๆ ผๆ็ปญไธ่ท๏ผ่ท็ ด90๏ผ+ - ไฟก็จๅฉๅทฎๅฟซ้่ตฐ้๏ผๅๅจ>50bp๏ผ+ - ไธปๆฟ้ๅๆดๆขๆไธๅไธๅ็ปญๅ่ก+ - CDSๆฅไปท๏ผๅฆๆ๏ผๅฟซ้ไธๅ++่ฏ็บงๅฑ้ข๏ผ+ - ่ฏ็บงๅๅ ฅ่ด้ข่งๅฏ+ - ๅคๅฎถ่ฏ็บงๆบๆไธ่ฐ+ - ๅฑๆ็ฑ็จณๅฎไธ่ฐ่ณ่ด้ข+```++**ไบๅๅๆๆกๆถ๏ผPost-Default Analysis๏ผ**๏ผ+1. ่ฟ็บฆ่งฆๅๆถ็นไธ่ต้ๆตๅ้ๆ+2. ่ตไบง่ดๅบ่กจ"็ๅฎๆง"่ฏไผฐ๏ผๅบๅ็ๅฎ่ตไบง vs ่ดฆ้ข่ตไบง๏ผ+3. ๅบๆไผๅ ็บงๆขณ็๏ผๆ ไฟ้กบๅบใๆต่ดจๆผๅ๏ผ+4. ๅค็ฝฎ้ขๆๅๆถ็ไผฐ็ฎ๏ผRecovery Rate๏ผ+5. ็ณป็ปๆง้ฃ้ฉไผ ๆ่ทฏๅพ๏ผไบคๅๆๆใๅ็ฑปไธปไฝ๏ผ++**ไธญๅฝๅธๅบๅๆถ็ๅ่**๏ผ+- ๅๆๅบ๏ผๆๆฏๆง่ฟ็บฆๅๅ่งฃ๏ผ๏ผๆฅ่ฟ100%+- ๆฟไผ่ฟ็บฆ๏ผ็บฆ20%-50%๏ผๅๅณไบๅๅจ่ดจ้๏ผ+- ๅทฅไธไผไธ่ฟ็บฆ๏ผ็บฆ30%-60%+- ้่ๆบๆ๏ผ้้ถ๏ผ๏ผ็บฆ40%-70%๏ผ็็ฎกไปๅ ฅ็จๅบฆ๏ผ++---++## ไธใไธๅ ถไป Skill ็ๅ ณ่++| ็ธๅ ณ Skill | ไบ่กฅๅ ณ็ณป |+|------------|----------|+| `convertible-bond` | ๅฏ่ฝฌๅบ่ฝฌ่กๆๆ้จๅ็ฑ convertible-bond skill ๅค็๏ผๆฌ skill ่ด่ดฃ็บฏๅบๅฎไปทๅไฟก็จ้ฃ้ฉ |+| `macro-analysis` | ๅฎ่งๅฉ็็ฏๅขๅไฟก็จๅจๆๅคๆญ็ฑ macro skill ๆไพ่พๅ ฅ |+| `risk-management` | ็ปๅๅฑ้ขไฟก็จ้ฃ้ฉ๏ผVaR/CVaR๏ผๅ่ risk-management skill |+| `equity-fundamental` | ไฟก็จๅๆไธ่กๆไผฐๅผๅ ฑไบซ่ดขๅกๆฅ่กจๅๆๆกๆถ๏ผAltman Z-Scoreไธคไพงๅ้็จ |++---++## ๅ ซใๅฟซ้ๅ่++### ๅธธ็จๅ ฌๅผ้ๆฅ++```+YTM ่ฟไผผๅ ฌๅผ๏ผ+ YTM โ [C + (F-P)/n] / [(F+P)/2]++ไน ๆไธไปทๆ ผๅๅ๏ผ+ ฮP โ -D_mod ร P ร ฮy + 0.5 ร CX ร P ร (ฮy)ยฒ++DV01 = D_mod ร P ร 0.0001 ร ๆไป้ขๅผ++ไฟก็จๅฉๅทฎ = ๅบๅธYTM - ๅๆ้ๅฝๅบYTM++Z-Score ้ฃ้ฉไฟกๅท๏ผ+ Z > 2.99 โ ๅฎๅ จ 1.81 < Z < 2.99 โ ็ฐ่ฒ Z < 1.81 โ ๅฑ้ฉ++่ฟ็บฆ่ท็ฆป DD โ EDF๏ผ+ DD > 4: EDF < 0.1%+ DD 2-4: EDF 0.1%-1%+ DD 1-2: EDF 1%-5%+ DD < 1: EDF > 5%+```++### ไธญๅฝๅบๆถๆฐๆฎๆบ++| ๆฐๆฎ็ฑปๅ | ๆจ่ๆฅๆบ |+|----------|----------|+| ๅฝๅบๆถ็็ๆฒ็บฟ | ไธญๅคฎ็ป็ฎๅ ฌๅธ๏ผCCDC๏ผใ่ดขๆฟ้จๅฎ็ฝ |+| ไฟก็จๅบ่กๆ | WindใDMๆฐๆฎ |+| ๅๆ่ดขๅกๆฐๆฎ | ๅๅบไธปไฝๅนดๆฅใWind |+| ่ฏ็บงๆฅๅ | ไธญ่ฏไฟกใ่ๅ่ตไฟกใไธๆน้่ฏๅฎ็ฝ |+| ่ฟ็บฆๆฐๆฎ | Windใไธญๅฝๅบๅธไฟกๆฏ็ฝ๏ผchinamoney.com.cn๏ผ |+| ABSๆฐๆฎ | CNABS๏ผไธญๅฝ่ตไบง่ฏๅธๅๅๆ็ฝ๏ผ |diff --git a/agent/src/skills/crypto-derivatives/SKILL.md b/agent/src/skills/crypto-derivatives/SKILL.mdnew file mode 100644index 000000000..cf2560c72--- /dev/null+++ b/agent/src/skills/crypto-derivatives/SKILL.md@@ -0,0 +1,280 @@+---+name: crypto-derivatives+description: Crypto-derivatives strategies โ perpetual funding-rate arbitrage, futures term-structure contango/backwardation trading, and option volatility-smile / Greeks analysis.+---++# Crypto-Derivatives Strategies++## Overview++Covers three major crypto-derivatives strategy directions: perpetual funding-rate arbitrage, futures term-structure trading, and options strategies (volatility trading). The main exchanges are OKX and Deribit.++## Perpetual Funding-Rate Arbitrage++### Funding-Rate Mechanism++```+Perpetual contracts have no expiry and rely on the funding rate to anchor prices to spot:++Funding rate > 0: longs pay shorts (strong bullish sentiment)+Funding rate < 0: shorts pay longs (strong bearish sentiment)++Settlement frequency: OKX settles every 8 hours (00:00 / 08:00 / 16:00 UTC)+Annualized return = funding rate ร 3 ร 365+```++### Arbitrage Strategies++```+Positive carry arbitrage (funding rate > 0):+ Long spot + short perpetual = net delta close to zero+ Return source: collect funding every 8 hours++Reverse carry arbitrage (funding rate < 0, less common):+ Short spot (borrow coin and sell) + long perpetual+ Return source: collect funding every 8 hours+```++### Funding-Rate Signals++| Funding Rate (8h) | Annualized | Market Sentiment | Strategy Signal |+|-------------|------|---------|---------|+| > 0.1% | > 109% | Extreme greed | Short signal (rate is unsustainable) |+| 0.03-0.1% | 33-109% | Bullish bias | Positive carry arbitrage is attractive |+| 0.01-0.03% | 11-33% | Normal bullish | Positive carry arbitrage is tradable |+| -0.01~0.01% | -11~11% | Neutral | No arbitrage opportunity |+| < -0.01% | < -11% | Bearish bias | Reverse carry arbitrage or stop-loss |+| < -0.1% | < -109% | Extreme panic | Long signal (rate is unsustainable) |++### Arbitrage Risk Control++```+Risk points:+1. Insufficient margin: the derivatives leg requires margin, and extreme moves can liquidate the account+2. Funding reversal: a positive rate can suddenly turn negative, making the arbitrage unprofitable+3. Basis volatility: changes in the spot-futures basis can cause floating losses+4. Exchange risk: withdrawal limits, downtime, liquidation-mechanism differences++Risk parameters:+- Leverage: no more than 3x (arbitrage does not need high leverage)+- Margin ratio: keep >50% (far from liquidation)+- Single-coin allocation: <30% (diversification)+- Stop-loss: close when floating loss exceeds expected return over 3 months+```++## Term-Structure Trading++### Basic Concepts++```+Term structure = futures price curve across different expiries++Contango: far month > near month > spot+ - Meaning: market expects higher future prices+ - Common in bull markets or normal market conditions++Backwardation: far month < near month < spot+ - Meaning: market expects lower future prices or spot shortage+ - Common in bear markets or after extreme events+```++### Term-Structure Metrics++```python+def term_structure_spread(spot_price, futures_prices: dict) -> dict:+ """+ Args:+ spot_price: Spot price+ futures_prices: {expiry: price}, for example {'2026-06': 105000, '2026-09': 107000}+ Returns:+ Basis, annualized basis, and structure type+ """+ results = {}+ for expiry, price in futures_prices.items():+ days_to_expiry = (pd.Timestamp(expiry) - pd.Timestamp.now()).days+ basis = (price - spot_price) / spot_price+ annualized = basis / days_to_expiry * 365+ results[expiry] = {+ 'basis': basis,+ 'annualized_basis': annualized,+ 'days': days_to_expiry,+ }+ return results+```++### Trading Strategies++| Strategy | Action | Applicable Environment | Risk |+|------|------|---------|------|+| Cash-and-Carry | Long spot + short futures | Significant contango (annualized >15%) | Exchange risk |+| Calendar Spread | Long near month + short far month | Expect contango convergence | Basis widening |+| Reverse Calendar | Short near month + long far month | Expect backwardation convergence | Basis reversal |++### Historical Regularities of BTC Term Structure++```+- Bull market: contango annualized 15-40%, quarterly futures premium 5-10%+- Bear market: backwardation or contango annualized <5%+- Around halving: contango usually widens+- Extreme crashes: brief backwardation (such as March 12 and May 19)+```++## Options Strategies++### Overview of the Crypto Options Market++| Exchange | Underlyings | Characteristics |+|--------|------|------|+| Deribit | BTC / ETH | Largest options exchange, >80% market share |+| OKX | BTC / ETH | Second largest, liquidity still growing |+| Binance | BTC / ETH | Weaker liquidity |++### Basic Greeks++| Greek | Meaning | Crypto-Specific Characteristic |+|-------|------|-----------|+| Delta | Change in option price for a 1% move in the underlying | BTC is highly volatile, so Delta changes quickly |+| Gamma | Rate of change of Delta | ATM options have the highest Gamma |+| Theta | Time decay (per day) | Crypto trades 7x24, so there are no weekends off |+| Vega | Impact of a 1% move in implied volatility | BTC IV is often 50-120%, far above traditional assets |+| Rho | Rate sensitivity | In crypto markets, the rate proxy is DeFi yield |++### Volatility Smile / Skew++```+Characteristics of the BTC option volatility surface:+1. Smile: IV of OTM puts and OTM calls is both higher than ATM IV+2. Skew: usually OTM put IV > OTM call IV (downside-protection demand)+3. Reverse skew: in bull markets, OTM call IV may exceed OTM put IV++25ฮ Risk Reversal = IV(25ฮ Call) - IV(25ฮ Put)+ > 0: bullish skew+ < 0: bearish skew (normal state)+ The larger the absolute value, the steeper the skew+```++### Common Options Strategies++#### 1. Short Straddle++```+Action: sell ATM call + ATM put simultaneously+Return source: time decay (Theta income)+Risk: large move in the underlying+Applicable when: IV is considered too high and the market is expected to stay range-bound++BTC parameter suggestions:+- Consider selling when IV > 80%+- Expiry: 7-14 days (faster decay)+- Margin: at least 30% of underlying notional+```++#### 2. Protective Put++```+Action: hold spot + buy OTM put+Purpose: hedge downside risk+Cost: put premium (about 2-5% of underlying value per month)+Applicable when: protecting profits in a bull market++BTC parameter suggestions:+- Strike: 10-15% below spot+- Expiry: 1-3 months+- Delta: -0.2 to -0.3+```++#### 3. Iron Butterfly++```+Action: sell ATM call + sell ATM put + buy OTM call + buy OTM put+Return source: profit when the underlying moves within a narrow range+Risk: limited (protected by OTM options)+Applicable when: low-volatility expectation++Maximum profit = premium sold - premium bought+Maximum loss = wing width - maximum profit+```++#### 4. Volatility Arbitrage++```+Action: long / short IV versus realized volatility++Long volatility:+- Buy straddle + Delta hedge+- Applicable when: IV < historical volatility (IV is low)++Short volatility:+- Sell straddle + Delta hedge+- Applicable when: IV > historical volatility (IV is high)++BTC IV reference:+- IV < 40%: extremely low (long volatility)+- IV 40-60%: normal-to-low+- IV 60-80%: normal+- IV 80-120%: elevated (short volatility)+- IV > 120%: extremely high (short volatility, but risk is large)+```++## Analysis Framework++### Daily Monitoring Metrics++```+1. Perpetual funding rate (8h / annualized)+2. BTC quarterly-futures basis+3. 25ฮ Risk Reversal+4. ATM implied volatility+5. Option put/call ratio+6. Option open interest+```++### Strategy Selection Decision Tree++```+Market environment judgment:+โโโ High funding rate (>0.05%) + high IV (>80%)+โ โโโ Positive carry arbitrage + short volatility+โโโ Low funding rate + low IV (<50%)+โ โโโ Stay out of carry arbitrage + long volatility+โโโ Significant contango (annualized >20%)+โ โโโ Cash-and-Carry+โโโ Backwardation+ โโโ Reduce exposure / hedge / buy protective puts+```++## Output Format++```markdown+## Crypto-Derivatives Analysis++### Market Snapshot+| Metric | BTC | ETH |+|------|-----|-----|+| Spot price | $95,000 | $3,200 |+| Perpetual funding (8h) | 0.035% | 0.028% |+| Annualized funding | 38.3% | 30.7% |+| Quarterly basis (annualized) | 18.5% | 15.2% |+| ATM IV (30d) | 65% | 72% |+| 25ฮ RR | -3.2% | -4.5% |++### Strategy Suggestions+| Strategy | Direction | Expected Annualized Return | Risk Level |+|------|------|---------|---------|+| BTC funding-rate arbitrage | Short perpetual + long spot | 25-35% | Medium |+| ETH Calendar Spread | Long near month / short far month | 12-18% | Medium-low |+| BTC Short Strangle | Sell OTM call + put | Collect premium | High |++### Risk Warnings+- ...+```++## Notes++1. **This system is for backtest research only**: it does not execute live trades; derivatives analysis is for research and backtesting+2. **Crypto trades 7x24**: Theta decay never stops, unlike traditional options+3. **Liquidity concentration**: BTC / ETH options are concentrated on Deribit; liquidity in other coins is extremely poor+4. **Extreme volatility**: 10-20% single-day BTC moves are not rare, so margin management is critical+5. **Exchange risk**: centralized exchanges can freeze assets or fail; diversify across venues+6. **Data acquisition**: OKX data is available through the OKX data source, while Deribit requires an additional interface+7. **Regulatory risk**: regulation of crypto derivatives is tightening across jurisdictions, so strategy compliance must be assessed separatelydiff --git a/agent/src/skills/defi-yield/SKILL.md b/agent/src/skills/defi-yield/SKILL.mdnew file mode 100644index 000000000..77765505b--- /dev/null+++ b/agent/src/skills/defi-yield/SKILL.md@@ -0,0 +1,263 @@+---+name: defi-yield+description: DeFi yield analysis and optimization โ lending rates, LP yields, staking returns, yield farming strategies, risk-adjusted yield comparison, and protocol-level sustainability assessment.+---+# DeFi Yield Analysis & Optimization++## Overview++Analyze and compare yields across DeFi protocols โ lending, liquidity provision, staking, and yield farming โ to identify the best risk-adjusted opportunities and assess sustainability. DeFi yields are a real-time proxy for crypto market leverage demand, capital allocation, and protocol health.++## Core Concepts++### 1. DeFi Yield Sources++| Yield Source | Mechanism | Typical APY Range | Risk Level |+|-------------|-----------|-------------------|------------|+| Lending (supply) | Earn interest from borrowers | 1-15% (stablecoins 3-8%) | Low-medium |+| Borrowing cost | Interest paid by borrowers | 3-20% | N/A (cost side) |+| LP fees (AMM) | Trading fee share from DEX | 5-50% (varies by pair) | Medium-high |+| Staking | Validator/delegation rewards | 3-15% | Low-medium |+| Liquidity mining | Protocol token incentives | 10-500% (unsustainable) | High |+| Restaking | Re-hypothecated staking yield | 5-20% (ETH + AVS rewards) | Medium-high |+| Points farming | Off-chain points โ future airdrop | Unknown (speculative) | Very high |++### 2. Lending Rate Analysis++**Lending rates as market signal:**++```python+# High borrow rates = high leverage demand = bullish sentiment+# Low borrow rates = low leverage demand = bearish / waiting++def lending_rate_signal(borrow_rate_stable, borrow_rate_eth):+ """Analyze DeFi lending rates for market sentiment."""+ if borrow_rate_stable > 15:+ stable_signal = "extreme_demand" # Leveraged long via stablecoin borrowing+ elif borrow_rate_stable > 8:+ stable_signal = "elevated_demand"+ elif borrow_rate_stable > 3:+ stable_signal = "normal"+ else:+ stable_signal = "low_demand" # Bear market, no one borrowing++ if borrow_rate_eth > 10:+ eth_signal = "extreme_demand" # Shorting or leveraged strategies+ elif borrow_rate_eth > 5:+ eth_signal = "elevated"+ else:+ eth_signal = "low_demand"++ return stable_signal, eth_signal+```++**Key lending protocols:**++| Protocol | Chain | Specialization | TVL Range |+|----------|-------|---------------|-----------|+| Aave V3 | Multi-chain | Blue-chip lending, institutional grade | $10-20B |+| Compound V3 | Ethereum, Base | Conservative, USDC-focused | $3-5B |+| MakerDAO/Sky | Ethereum | CDP-based DAI/USDS minting | $8-15B |+| Morpho | Ethereum | Rate optimization, P2P matching | $3-8B |+| Spark | Ethereum | MakerDAO lending arm | $2-5B |+| Kamino | Solana | Concentrated LP + lending | $1-3B |++### 3. LP Yield Analysis++**Impermanent Loss (IL) โ the core risk of LP positions:**++```python+def impermanent_loss(price_ratio_change):+ """+ Calculate impermanent loss for a 50/50 AMM pool.+ price_ratio_change: new_price / old_price of the volatile asset.+ """+ r = price_ratio_change+ il = 2 * (r ** 0.5) / (1 + r) - 1+ return il * 100 # Return as percentage++# Examples:+# Price +25% โ IL = -0.6%+# Price +50% โ IL = -2.0%+# Price +100% (2x) โ IL = -5.7%+# Price +200% (3x) โ IL = -13.4%+# Price -50% โ IL = -5.7%+# Price -75% โ IL = -20.0%+```++**LP yield = fee income + token incentives - impermanent loss**++```python+def net_lp_yield(fee_apy, incentive_apy, estimated_il_annualized):+ """Calculate risk-adjusted LP yield."""+ gross_yield = fee_apy + incentive_apy+ net_yield = gross_yield - abs(estimated_il_annualized)+ return net_yield++# Example: ETH/USDC pool+# Fee APY: 15%, Incentive APY: 20%, Estimated IL: 8%+# Net yield: 15% + 20% - 8% = 27%+```++**LP pool evaluation criteria:**++| Metric | Good | Mediocre | Avoid |+|--------|------|----------|-------|+| Fee APY / TVL | > 10% | 5-10% | < 5% |+| IL risk (based on pair volatility) | < 5% annualized | 5-15% | > 15% |+| TVL stability (30d change) | Growing or stable | Declining < 10% | Declining > 30% |+| Volume/TVL ratio | > 0.5x daily | 0.1-0.5x | < 0.1x |+| Incentive dependency | < 30% of yield | 30-70% | > 70% (unsustainable) |++### 4. Staking Yield Analysis++**ETH staking ecosystem:**++| Method | APY | Risk | Liquidity |+|--------|-----|------|-----------|+| Solo validator | ~3.5% | Slashing, downtime | Locked (exit queue) |+| Lido (stETH) | ~3.3% | Smart contract, governance | Liquid (stETH tradeable) |+| Rocket Pool (rETH) | ~3.2% | Smart contract, more decentralized | Liquid |+| Coinbase (cbETH) | ~3.0% | Custodial, regulatory | Liquid |+| EigenLayer restaking | ~3.5% + AVS rewards | Smart contract, slashing risk | Semi-liquid |++**Staking yield signal:**+```python+# ETH staking yield trends+# Rising yield = more transactions / MEV = network activity increasing (bullish)+# Falling yield = less activity = network cooling down++# Restaking yield premium+restaking_premium = eigenlayer_yield - native_staking_yield+if restaking_premium > 3:+ signal = "high_restaking_demand" # AVS demand strong+elif restaking_premium > 1:+ signal = "moderate_premium"+else:+ signal = "low_premium" # Restaking risk not compensated+```++### 5. Yield Sustainability Assessment++**The "real yield" test:**++```python+def yield_sustainability(protocol):+ """+ Real yield = yield funded by actual economic activity (fees, revenue)+ Token yield = yield funded by token emissions (inflationary, unsustainable)+ """+ total_yield_usd = protocol.total_yield_distributed_per_year+ fee_revenue_usd = protocol.annual_fee_revenue+ token_emission_usd = protocol.annual_token_emissions_at_market_price++ real_yield_pct = fee_revenue_usd / total_yield_usd * 100+ token_yield_pct = token_emission_usd / total_yield_usd * 100++ if real_yield_pct > 80:+ sustainability = "highly_sustainable" # Revenue-funded+ elif real_yield_pct > 50:+ sustainability = "partially_sustainable"+ elif real_yield_pct > 20:+ sustainability = "emission_dependent" # Mostly token incentives+ else:+ sustainability = "ponzi_risk" # Almost entirely token-funded++ return sustainability, real_yield_pct+```++**Warning signs of unsustainable yield:**+1. APY > 100% with no clear revenue source โ token emissions will dilute to zero+2. Protocol TVL growing but token price declining โ mercenary capital chasing yield+3. Yield declining month-over-month while TVL is stable โ emissions being cut+4. Protocol governance voting to increase emissions โ short-term pump, long-term dilution+5. Multiple yield sources stacking (lending + LP + staking + points) โ complexity hides risk++### 6. Risk-Adjusted Yield Comparison Framework++```python+def risk_adjusted_yield(opportunities):+ """Compare DeFi opportunities on risk-adjusted basis."""+ scored = []+ for opp in opportunities:+ # Base yield+ base = opp.apy++ # Risk deductions+ smart_contract_risk = -2 if opp.audit_status == "unaudited" else -0.5+ il_risk = -opp.estimated_il if opp.type == "LP" else 0+ protocol_risk = -1 if opp.tvl < 50_000_000 else 0 # Small protocol risk+ chain_risk = -0.5 if opp.chain != "ethereum" else 0 # Non-ETH chain risk+ sustainability_risk = -(base * 0.3) if opp.real_yield_pct < 30 else 0++ # Adjusted yield+ adjusted = base + smart_contract_risk + il_risk + protocol_risk + chain_risk + sustainability_risk++ scored.append({+ "protocol": opp.name,+ "base_apy": base,+ "adjusted_apy": adjusted,+ "risk_level": opp.risk_level,+ })++ return sorted(scored, key=lambda x: x["adjusted_apy"], reverse=True)+```++## Data Sources++| Source | Access | Data Available |+|--------|--------|---------------|+| DeFi Llama Yields | Free | APY across 1000+ pools/protocols |+| Aave/Compound dashboards | Free | Real-time lending rates |+| Dune Analytics | Free | Custom yield queries |+| DeBank | Free | Portfolio yield tracking |+| TokenTerminal | Free/Paid | Protocol revenue and earnings |+| EigenLayer dashboard | Free | Restaking rates and AVS yields |++## Output Format++```+## DeFi Yield Analysis โ [Date]++### Market Yield Overview+- **Stablecoin lending (Aave USDC)**: X.X% supply APY+- **ETH staking**: X.X% base + X.X% restaking premium+- **Top LP yields**: [pool1 X%, pool2 X%]+- **Yield trend**: [rising / stable / compressing]++### Top Opportunities (Risk-Adjusted)+| Rank | Protocol | Pool/Strategy | Base APY | Adjusted APY | Risk |+|------|----------|--------------|----------|-------------|------|+| 1 | [protocol] | [pool] | X.X% | X.X% | Low |+| 2 | [protocol] | [pool] | X.X% | X.X% | Medium |+| 3 | [protocol] | [pool] | X.X% | X.X% | Medium |++### Lending Market Signal+- **Stablecoin borrow rates**: X.X% โ [high leverage demand / normal / low]+- **ETH borrow rates**: X.X% โ [shorting demand / normal]+- **Utilization rates**: [high / normal / low]++### Sustainability Assessment+| Protocol | Real Yield % | Token Yield % | Verdict |+|----------|-------------|---------------|---------|+| [protocol] | XX% | XX% | Sustainable |+| [protocol] | XX% | XX% | Emission-dependent |++### Yield Strategy Recommendation+- **Conservative**: [stablecoin lending on Aave/Compound, X-X% APY]+- **Balanced**: [ETH staking + restaking, X-X% APY]+- **Aggressive**: [LP on DEX with hedged IL, X-X% net APY]++### Risk Warnings+1. [Smart contract risk: protocol X is unaudited]+2. [IL risk: volatile pair X/Y estimated IL X%]+3. [Sustainability risk: protocol Y >80% token-funded]+```++## Notes++- DeFi yields are highly variable and can change within hours; quoted APYs are point-in-time snapshots+- "APY" in DeFi often assumes compounding that requires manual action (claiming + restaking); true returns may be lower+- Smart contract risk is the dominant risk in DeFi; even audited protocols have been exploited (multi-sig, oracle manipulation)+- Tax implications of DeFi yield vary by jurisdiction; yield farming income is taxable in most countries+- This framework is for research purposes only and does not constitute investment advicediff --git a/agent/src/skills/doc-reader/SKILL.md b/agent/src/skills/doc-reader/SKILL.mdnew file mode 100644index 000000000..e7ce37d3f--- /dev/null+++ b/agent/src/skills/doc-reader/SKILL.md@@ -0,0 +1,74 @@+---+name: doc-reader+description: Read PDF documents (papers, annual reports, research reports), automatically extracting text pages and applying OCR to image/scanned pages. Use the `read_document` tool.+---+# PDF Document Reading++## Purpose++Read the full text of PDF documents and automatically handle two page types:+- **Text pages** (most papers and digital reports) โ extracted directly in milliseconds+- **Image / scanned pages** (annual report charts, scanned research reports) โ OCR recognition with Chinese and English support++Applicable to PDF documents such as papers, annual reports, research reports, announcements, and contracts.++## Usage++**Call the `read_document` tool directly (do not use bash to write a Python script):**++```+read_document(file_path="uploads/paper.pdf")+read_document(file_path="uploads/annual_report.pdf", pages="1-10")+read_document(file_path="uploads/research.pdf", pages="1,3,15-20")+```++**Forbidden**: do not run a Python script from bash to read PDFs. Call the tool directly.++## Return Format++```json+{+ "status": "ok",+ "file": "paper.pdf",+ "total_pages": 45,+ "pages_read": 45,+ "ocr_pages": 3,+ "char_count": 52000,+ "truncated": true,+ "text": "--- Page 1 ---\n...\n--- Page 5 [OCR] ---\n..."+}+```++- `ocr_pages`: number of pages recognized via OCR (image / scanned pages)+- `truncated`: content is truncated when it exceeds 15000 characters+- `[OCR]` indicates that the page content was obtained via image recognition++## Typical Workflows++### Paper Summary+```+1. read_document(file_path="paper.pdf") โ get the full text+2. Analyze the text and extract the abstract, methodology, and conclusion+3. Output the summary+```++### Annual Report Analysis+```+1. read_document(file_path="annual_report.pdf", pages="1-5") โ read the summary first+2. Determine the key sections from the summary+3. read_document(file_path="...", pages="15-25") โ read the financial-data section+4. Extract key metrics+```++### Research Report Review+```+1. read_document(file_path="research.pdf") โ full text+2. Extract the core thesis, target price, and risk factors+```++## Notes++- Content longer than 15000 characters will be truncated. For long documents, read them in chunks with the `pages` parameter+- OCR pages are slower (about 1-3 seconds per page), while pure text pages are processed in milliseconds+- OCR for charts and tables inside images may be imperfect, so complex tables should be checked manually+- Only PDF format is supporteddiff --git a/agent/src/skills/earnings-forecast/SKILL.md b/agent/src/skills/earnings-forecast/SKILL.mdnew file mode 100644index 000000000..ac534ab8c--- /dev/null+++ b/agent/src/skills/earnings-forecast/SKILL.md@@ -0,0 +1,198 @@+---+name: earnings-forecast+description: ็ๅฉ้ขๆตไธไธ่ด้ขๆๅๆ๏ผ่ชไธ่ไธ/่ชไธ่ไธ้ขๆตๆณ/SUE/PEAD/ๅๆๅธ้ขๆไฟฎๆญฃ๏ผ๏ผๆๆไธ็ปฉ่ถ ้ขๆไบคๆๆบไผใ+---+# ็ๅฉ้ขๆตไธไธ่ด้ขๆ++## ๆฆ่ฟฐ++ๅด็ปไผไธ็ๅฉ้ขๆตๅๅธๅบไธ่ด้ขๆๅๅทฎๆๅปบไบคๆไฟกๅทใๆ ธๅฟ้ป่พ๏ผ่กไปท็ญๆ็ฑ็ๅฉ้ขๆๅทฎ้ฉฑๅจ๏ผๆๆใ้ขๆๅทฎใๆฏ้ขๆต็ปๅฏน็ๅฉๆดๆไปทๅผใไธคๆกไธป็บฟ๏ผโ ่ชไธป้ขๆต vs ไธ่ด้ขๆๅฏนๆฏๅฏปๆพๅๅทฎ๏ผโก ่ท่ธชๅๆๅธ้ขๆไฟฎๆญฃๅจ้ใ++## ๆ ธๅฟๆฆๅฟต++### 1. ่ชไธ่ไธ้ขๆตๆณ๏ผTop-Down๏ผ++**้ขๆต้พๆก๏ผ**++```+GDPๅข้้ขๆต โ ่กไธๅขๅ ๅผๅข้ โ ่กไธๆถๅ ฅๅข้ โ ้พๅคดๅ ฌๅธๆถๅ ฅๅข้ โ ๅฉๆถฆ็ๅ่ฎพ โ EPS้ขๆต+```++**A่กๅฎๆ็คบไพ๏ผไปฅ็ฝ้ ่กไธไธบไพ๏ผ๏ผ**++| ๅฑ็บง | ๆๆ | ้ขๆต้ป่พ |+|------|------|---------|+| ๅฎ่ง | GDP +5.0% | ๆถ่ดนๅ GDPๆฏ้65%๏ผๆถ่ดนๅข้็บฆ+6% |+| ่กไธ | ็ฝ้ ๆถๅ ฅ +8% | ้ซ็ซฏ็ฝ้ ้ไปท้ฝๅ๏ผ็ปๆๅ็บง |+| ๅ ฌๅธ | ่ดตๅท่ ๅฐ(600519.SH) | ๅบๅไปท+10%๏ผ้้+2%๏ผๆถๅ ฅ็บฆ+12% |+| ็ๅฉ | ๅๅฉๆถฆ็55% | ๆไปทไผ ๅฏผ๏ผ่ดน็จ็็จณๅฎ |+| EPS | ็บฆ62ๅ | ๅๅฉๆถฆ/ๆป่กๆฌ |++**้็จๅบๆฏ๏ผ** ่กไธbetaๅคๆญใๅคง็็ๅฉๅจๆๅฎไฝใๅฎ่ง็ญ็ฅ้ ๅ++### 2. ่ชไธ่ไธ้ขๆตๆณ๏ผBottom-Up๏ผ++**ๆถๅ ฅๆ่งฃไธๆฟๆง๏ผ**++```python+# ๆนๆณ1๏ผ้ไปทๆ่งฃ+revenue = volume * price+# ไพ๏ผไธญๅฝ็ฅๅ(601088.SH) = ็ ค็ญ้้(ไบฟๅจ) ร ็ คไปท(ๅ /ๅจ) + ็ตๅๆถๅ ฅ++# ๆนๆณ2๏ผๅฎขๆท/ไบงๅๆ่งฃ+revenue = sum(segment_revenue for segment in business_lines)+# ไพ๏ผ็พ็้ๅข(000333.SZ) = ๆ้็ฉบ่ฐ + ๆถ่ดน็ตๅจ + ๆบๅจไบบๅ่ชๅจๅ++# ๆนๆณ3๏ผ้จๅบ/็จๆทๆ่งฃ+revenue = stores * revenue_per_store # ๆ users * ARPU+# ไพ๏ผๆตทๅบๆ(6862.HK) = ้จๅบๆฐ ร ็ฟปๅฐ็ ร ๅฎขๅไปท ร ่ฅไธๅคฉๆฐ+```++**ๅฉๆถฆ็ๅ่ฎพๅ ณ้ฎ็น๏ผ**+- ๆฏๅฉ็๏ผๅๆๆๆๆฌๅ ๆฏๅๅจใไบงๅ็ปๆๅ็บง+- ่ดน็จ็๏ผ่งๆจกๆๅบ๏ผๆถๅ ฅๅขใ่ดน็จ็้๏ผใ็ ๅๆๅ ฅๅๅจ+- ็จ็๏ผ้ซๆฐๆๆฏไผไธ15% vs ๆฎ้25%๏ผๆฏๅฆๆ็จๆถไผๆ ๅฐๆ++### 3. ๆ ๅๅๆช้ขๆ็ๅฉ๏ผSUE๏ผ++**ๅ ฌๅผ๏ผ**++```python+SUE = (actual_EPS - consensus_EPS) / std(actual_EPS - consensus_EPS)+# consensus_EPS = ๅๆๅธไธ่ด้ขๆEPS๏ผๅไธญไฝๆฐ๏ผ+# std = ่ฟๅป8ไธชๅญฃๅบฆ้ขๆตๅๅทฎ็ๆ ๅๅทฎ+```++**ไฟกๅท้ๅผ๏ผA่กๅฎ่ฏๅ่๏ผ๏ผ**++| SUE่ๅด | ๅซไน | ไบคๆๅจไฝ |+|---------|------|---------|+| SUE > +2.0 | ๅคงๅน ่ถ ้ขๆ | ๅผบไนฐๅ ฅไฟกๅท |+| SUE +1.0~+2.0 | ๆธฉๅ่ถ ้ขๆ | ไนฐๅ ฅไฟกๅท |+| SUE -1.0~+1.0 | ็ฌฆๅ้ขๆ | ๆ ไฟกๅท |+| SUE -2.0~-1.0 | ๆธฉๅไฝไบ้ขๆ | ๅๅบไฟกๅท |+| SUE < -2.0 | ๅคงๅน ไฝไบ้ขๆ | ๅผบๅๅบไฟกๅท |++### 4. ็ไฝๅ ฌๅๅๆผ็งป๏ผPEAD๏ผ++**็ฐ่ฑก๏ผ** ไธ็ปฉๅ ฌๅๅ๏ผ่ถ ้ขๆๆนๅ็่กไปทๆผ็งปๅฏๆ็ปญ30-60ไธชไบคๆๆฅใ++**A่กPEAD็ญ็ฅๅฎ็ฐ๏ผ**++```python+# ็ญ็ฅ้ป่พ+# 1. ไธ็ปฉๅ ฌๅๆฅ๏ผๅนดๆฅ4/30ๅ๏ผไธญๆฅ8/31ๅ๏ผๅญฃๆฅๅๆชๆญขๆฅ๏ผ+# 2. ่ฎก็ฎSUE+# 3. SUE > +1.5 ็่ก็ฅจไนฐๅ ฅๆๆ 40 ไธชไบคๆๆฅ+# 4. SUE < -1.5 ็่ก็ฅจๅๅบ/ๅ็ฉบ๏ผๅฆๆๅฏไปฅ๏ผ++# ๅ ณ้ฎๅๆฐ+holding_period = 40 # ๆๆไบคๆๆฅๆฐ+sue_threshold = 1.5 # SUE้ๅผ+max_positions = 10 # ๆๅคงๆไปๆฐ+rebalance_on = "earnings_date" # ๅจไธ็ปฉๅ ฌๅๆฅ่ฐไป+```++**A่กPEADๆณจๆไบ้กน๏ผ**+- A่กๅ็ฉบๅ้๏ผ่ๅธ๏ผ๏ผPEAD็ญ็ฅ้ๅธธๅชๅๅคๅคด+- ไธ็ปฉ้ขๅ๏ผ1ๆๅบ/7ๆไธญๆฌ๏ผๆฏๆญฃๅผๆฅๅๆดๆฉ๏ผๆขๅ ๅๅบ+- ๅนดๆฅ4/30ๆชๆญข๏ผ้ไธญๅจ4ๆๅๅธ๏ผไฟกๆฏๆฅๆคๆ้ๅๆฃ++### 5. ๅๆๅธ้ขๆไฟฎๆญฃๅจ้++**ไธไธชๅ ณ้ฎๆๆ ๏ผ**++```python+# 1. ้ขๆไฟฎๆญฃๆฏ็๏ผERM๏ผ+ERM = (ไธ่ฐๅฎถๆฐ - ไธ่ฐๅฎถๆฐ) / ๆป่ฆ็ๅฎถๆฐ+# ERM > 0.3 = ๆญฃ้ขๅจ้, ERM < -0.3 = ่ด้ขๅจ้++# 2. ้ขๆๅๅๅน ๅบฆ+eps_change_pct = (new_consensus - old_consensus_30d_ago) / abs(old_consensus_30d_ago)+# ๅๅ > +5% = ๆพ่ไธ่ฐ++# 3. ้ขๆ็ฆปๆฃๅบฆ+dispersion = std(all_analyst_EPS) / mean(all_analyst_EPS)+# ็ฆปๆฃๅบฆ > 0.3 = ๅๆญงๅคง, ไธ็กฎๅฎๆง้ซ+# ็ฆปๆฃๅบฆ < 0.1 = ๅ ฑ่ฏๅผบ, ็กฎๅฎๆง้ซ+```++**้ขๆไฟฎๆญฃๅจ้็ญ็ฅ๏ผ**+- ไนฐๅ ฅ๏ผERM > +0.3 ไธ eps_change_pct > +5% ไธ dispersion < 0.25+- ๅๅบ๏ผERM < -0.3 ไธ eps_change_pct < -5%+- ไฟกๅทๆๆๆ๏ผ็บฆ 60-90 ไธชไบคๆๆฅ๏ผ้ขๆไฟฎๆญฃๅจ้่กฐๅ๏ผ++## ๅๆๆกๆถ++### ็ๅฉๅๆๅๆญฅๆณ++1. **ๆๅปบ้ขๆต**๏ผ้ๆฉTop-DownๆBottom-Upๆนๆณ๏ผ่พๅบEPS้ขๆตๅผ+2. **่ทๅไธ่ด้ขๆ**๏ผไปWind/ไธๆน่ดขๅฏ/ๅ่ฑ้กบ่ทๅๅๆๅธไธ่ด้ขๆEPS+3. **่ฎก็ฎๅๅทฎ**๏ผSUEๆ็ฎๅ็พๅๆฏๅๅทฎ๏ผๅคๆญ่ถ ้ขๆ/ไฝไบ้ขๆๆนๅ+4. **ไฟกๅท็ๆ**๏ผๆ นๆฎSUE้ๅผ็ๆไบคๆไฟกๅท๏ผ็ปๅPEADๆๆๆ็ฎก็ไปไฝ++### ่ดขๆฅๆฅๅ๏ผA่กๅ ณ้ฎๆถ้ด่็น๏ผ++| ๆถ้ด | ไบไปถ | ็ญ็ฅๅจไฝ |+|------|------|---------|+| 1ๆไธญๆฌ | ๅนดๆฅไธ็ปฉ้ขๅๆซ้ฒ้ซๅณฐ | ๆขๅ ๆๆ้ขๆๅทฎ |+| 3-4ๆ | ๅนดๆฅๆญฃๅผๅๅธ | ็กฎ่ฎคSUE๏ผPEADๅปบไป |+| 4ๆ30ๆฅ | ๅนดๆฅๆชๆญขๆฅ | ๆชๆซ้ฒ = ๅฉ็ฉบไฟกๅท |+| 7ๆไธญๆฌ | ไธญๆฅไธ็ปฉ้ขๅ | ๅๅนดๅบฆ้ขๆไฟฎๆญฃ |+| 8ๆ31ๆฅ | ไธญๆฅๆชๆญขๆฅ | ๅไธ |+| 10ๆ31ๆฅ | ไธๅญฃๆฅๆชๆญขๆฅ | Q3ๆฐๆฎ้ช่ฏๅ จๅนด้ขๆ |++### ้ขๆๅทฎไบคๆ็ปๅๆๅปบ++```python+# ็ปๅๆๅปบๅๆฐ+config = {+ "universe": "ๆฒชๆทฑ300ๆๅ่ก", # ๆตๅจๆงไฟ้+ "signal": "SUE > +1.5 ๆ ERM > +0.3", # ่ถ ้ขๆไฟกๅท+ "max_positions": 20, # ๆๅคงๆไป+ "position_weight": "equal", # ็ญๆ+ "holding_period": 40, # ไบคๆๆฅ+ "rebalance": "earnings_calendar", # ๆ่ดขๆฅๆฅๅ่ฐไป+ "stop_loss": -0.08, # 8%ๆญขๆ+}+```++## ่พๅบๆ ผๅผ++```+## ็ๅฉ้ขๆตๅๆ โ [ๆ ็ไปฃ็ ] [ๅ ฌๅธๅ็งฐ]++### ็ๅฉ้ขๆต+- ้ขๆตๆนๆณ๏ผ[Top-Down / Bottom-Up]+- ้ขๆตEPS๏ผ[Xๅ ]+- ้ขๆตไพๆฎ๏ผ[ๆถๅ ฅๅข้X%๏ผๅฉๆถฆ็X%๏ผๅ ณ้ฎๅ่ฎพ]++### ไธ่ด้ขๆๅฏนๆฏ+- ไธ่ด้ขๆEPS๏ผ[Xๅ ]๏ผๆฅๆบ๏ผ[Wind/ไธ่ดข]๏ผ่ฆ็[N]ๅฎถ๏ผ+- ้ขๆๅๅทฎ๏ผ[+X% / -X%]+- SUE๏ผ[+X.X]+- ้ขๆ็ฆปๆฃๅบฆ๏ผ[X.X]๏ผ[้ซๅๆญง/ไฝๅๆญง]๏ผ++### ๅๆๅธๅจ้+- ERM๏ผ้ขๆไฟฎๆญฃๆฏ็๏ผ๏ผ[+X.X]๏ผ่ฟๅป30ๆฅ[N]ๅฎถไธ่ฐ/[M]ๅฎถไธ่ฐ๏ผ+- ้ขๆๅๅๅน ๅบฆ๏ผ[+X%]++### ไฟกๅทๅคๆญ+- SUEไฟกๅท๏ผ[ๅผบไนฐๅ ฅ/ไนฐๅ ฅ/ๆ /ๅๅบ/ๅผบๅๅบ]+- ๅจ้ไฟกๅท๏ผ[ๆญฃ้ข/ไธญๆง/่ด้ข]+- PEADๅปบไป็ชๅฃ๏ผ[ๆฏ/ๅฆ]๏ผ่ท่ดขๆฅๅๅธ[X]ๆฅ๏ผ++### ้ฃ้ฉๆ็คบ+- [ๅ ทไฝ้ฃ้ฉ๏ผๅฆไธๆฌกๆงๆถ็ใไผ่ฎกๆฟ็ญๅๆดใๅ่ชๅๅผ็ญ]+```++## ๆณจๆไบ้กน++- ไธ่ด้ขๆๆฐๆฎ้่ฆWind/Choice็ญไป่ดน็ป็ซฏ๏ผๅ ่ดนๆฐๆฎๆบ๏ผไธๆน่ดขๅฏ็ฝ้กต็๏ผๅฏ่ฝไธๅคๅๆถ+- SUE่ฎก็ฎ้่ฆ่ณๅฐ8ไธชๅญฃๅบฆ็ๅๅฒ้ขๆตๅๅทฎๆฐๆฎๆฅไผฐ่ฎกๆ ๅๅทฎ+- ไธ็ปฉ้ขๅๅไธ็ปฉๅฟซๆฅๆฏๆฏๆญฃๅผ่ดขๆฅๆดๆฉ็ไฟกๅทๆบ๏ผไฝ็ฒพๅบฆ่พไฝ+- A่ก่ดขๆฅๅญฃไฟกๆฏๆฅๆค๏ผ4ๆ/8ๆ๏ผ๏ผPEADไฟกๅทๅฏ่ฝไบ็ธๅนฒๆฐ+- ไธๆฌกๆงๆ็๏ผ่ตไบงๅค็ฝฎ/ๆฟๅบ่กฅ่ดด/ๆ่ตๆถ็๏ผไผๆญๆฒEPS๏ผ้ๅ้ค้็ปๅธธๆงๆ็็จๆฃ้EPS+- ้ขๆไฟฎๆญฃๅจ้ๆ่ชๆๅฎ็ฐๅพๅ๏ผๅๆๅธ็พ็พคๆๅบ๏ผ๏ผๆ็น่ฏๅซๆฏ่ถๅฟ่ท่ธชๆดๆไปทๅผ+- ๅฐๅธๅผ่ก็ฅจๅๆๅธ่ฆ็ๅฐ๏ผ< 3ๅฎถ๏ผ๏ผไธ่ด้ขๆ็ป่ฎกๆไนๅผฑ๏ผไผๅ ้ๆฉๆฒชๆทฑ300/ไธญ่ฏ500ๆๅ่ก+- ๆฌๆกๆถไป ็จไบ็ ็ฉถๅๆต๏ผไธๆๆๆ่ตๅปบ่ฎฎdiff --git a/agent/src/skills/earnings-revision/SKILL.md b/agent/src/skills/earnings-revision/SKILL.mdnew file mode 100644index 000000000..0a4d3850f--- /dev/null+++ b/agent/src/skills/earnings-revision/SKILL.md@@ -0,0 +1,232 @@+---+name: earnings-revision+description: Earnings estimate revisions, guidance analysis, and post-earnings drift (PEAD) โ track analyst consensus changes, earnings surprise patterns, and management guidance shifts for US/HK equities.+---+# Earnings Revision & Guidance Analysis++## Overview++Track sell-side analyst estimate revisions, management guidance changes, and post-earnings price drift to generate investment signals. Earnings revisions are among the most persistent and well-documented alpha factors in equity markets โ stocks with upward revisions tend to continue outperforming, and vice versa.++## Core Concepts++### 1. Earnings Revision Momentum++**The revision signal hierarchy (strongest to weakest):**++| Signal Type | Description | Typical Alpha (annualized) | Persistence |+|-------------|-------------|---------------------------|-------------|+| Earnings surprise (beat/miss) | Actual EPS vs consensus | 3-8% post-event drift | 60-90 days (PEAD) |+| Consensus revision breadth | % of analysts revising up vs down | 4-6% long-short spread | 3-6 months |+| Estimate magnitude change | Size of revision relative to prior estimate | 3-5% | 1-3 months |+| Guidance revision | Management guidance change vs prior | 5-10% on event | Immediate + 30-60 day drift |+| Whisper number miss/beat | Actual vs buy-side whisper (not official consensus) | 2-4% | 1-2 weeks |++### 2. Key Metrics++**Earnings Surprise:**+```python+# Standardized Unexpected Earnings (SUE)+sue = (actual_eps - consensus_eps) / std_of_forecast_errors++# Interpretation+# SUE > +2: large positive surprise โ strong PEAD signal+# SUE < -2: large negative surprise โ strong negative PEAD+# |SUE| < 0.5: in-line with expectations โ weak signal+```++**Revision Breadth:**+```python+# Revision breadth ratio+breadth = (num_upgrades - num_downgrades) / total_analysts++# Interpretation+# breadth > +0.5: strong consensus upgrade momentum+# breadth < -0.5: strong consensus downgrade momentum+# |breadth| < 0.2: mixed / no clear direction+```++**Estimate Dispersion:**+```python+# Analyst disagreement+dispersion = std_of_estimates / abs(mean_estimate)++# High dispersion (>15%): high uncertainty โ larger potential surprise+# Low dispersion (<5%): tight consensus โ smaller surprise but higher confidence+```++### 3. Post-Earnings Announcement Drift (PEAD)++The most robust anomaly in equity markets: prices continue to drift in the direction of the earnings surprise for 60-90 days after the announcement.++**PEAD trading rules:**++| Surprise Quintile | Average 60-day Drift | Strategy |+|-------------------|---------------------|----------|+| Q5 (top surprise) | +4 to +8% | Go long, hold 60-90 days |+| Q4 | +1 to +3% | Mild long |+| Q3 (in-line) | ~0% | No action |+| Q2 | -1 to -3% | Mild short / underweight |+| Q1 (worst surprise) | -4 to -8% | Go short / avoid, hold 60-90 days |++**PEAD enhancement filters:**+- Small/mid cap > large cap (less analyst coverage = slower price discovery)+- Low institutional ownership > high ownership (slower information diffusion)+- First surprise in a direction > consecutive same-direction surprises+- Revenue surprise + EPS surprise together > EPS surprise alone++### 4. Management Guidance Analysis++**Guidance types:**++| Type | What It Covers | Signal Weight |+|------|----------------|---------------|+| Revenue guidance | Top-line outlook | High (harder to manipulate) |+| EPS guidance | Bottom-line outlook | Medium (can be managed via buybacks, tax rate) |+| Margin guidance | Profitability trajectory | High (reflects pricing power and cost control) |+| CapEx guidance | Investment intentions | Medium (forward-looking growth signal) |+| Segment guidance | Division-level detail | High (reveals where growth is coming from) |++**Guidance change signals:**++```python+# Guidance revision scoring+def score_guidance_change(current_guide, prior_guide, consensus):+ # Guide above consensus = positive signal+ if current_guide.midpoint > consensus * 1.02:+ guide_vs_consensus = "above"+ elif current_guide.midpoint < consensus * 0.98:+ guide_vs_consensus = "below"+ else:+ guide_vs_consensus = "inline"++ # Guide raised vs lowered vs maintained+ if prior_guide:+ if current_guide.midpoint > prior_guide.midpoint * 1.01:+ guide_revision = "raised"+ elif current_guide.midpoint < prior_guide.midpoint * 0.99:+ guide_revision = "lowered"+ else:+ guide_revision = "maintained"++ # Strongest signal: raised guidance above consensus+ # Weakest signal: lowered guidance below consensus+```++**Guidance language analysis:**++| Language Pattern | Interpretation | Signal |+|-----------------|----------------|--------|+| "Raising full-year outlook" | Confidence in acceleration | Strong positive |+| "Reaffirming guidance" | No change, on-track | Mild positive (met expectations) |+| "Narrowing guidance range to upper half" | Soft raise without formal revision | Positive |+| "Updating guidance to reflect..." | Euphemism for guidance cut | Negative |+| "Withdrawing guidance" | High uncertainty, loss of visibility | Strong negative |+| "Providing preliminary results" | Pre-announcement, usually bad news | Negative (if below consensus) |++### 5. Earnings Quality Indicators++**Red flags in earnings reports:**+1. Revenue growing but cash flow declining โ accrual manipulation+2. Changing revenue recognition policy โ inflating top line+3. Declining DSO (Days Sales Outstanding) story contradicted by rising AR โ channel stuffing+4. Beating EPS via lower tax rate or share buyback, not operating improvement+5. Frequent "non-GAAP adjustments" that always add back expenses โ questionable earnings quality+6. Inventory build outpacing revenue growth โ future write-down risk++**Quality scoring:**+```python+earnings_quality = {+ "fcf_conversion": fcf / net_income, # >0.8 = good, <0.5 = poor+ "accrual_ratio": (net_income - ocf) / avg_assets, # <5% = good, >10% = concern+ "revenue_cash_alignment": revenue_growth - ocf_growth, # small gap = good+ "non_gaap_gap": non_gaap_eps - gaap_eps, # large gap = red flag+ "buyback_eps_boost": eps_growth - net_income_growth, # large = artificial+}+```++## Earnings Calendar and Workflow++### Pre-Earnings Analysis Checklist++1. **Consensus snapshot**: current EPS/revenue consensus, revision trend (30d/60d/90d)+2. **Historical surprise pattern**: has the company consistently beat/missed? By how much?+3. **Guidance comparison**: last quarter's guidance vs current consensus+4. **Whisper number**: buy-side expectations (often 1-3% above street consensus for serial beaters)+5. **Options market pricing**: implied move from at-the-money straddle+6. **Sector peers already reported**: read-through signals from competitors++### Post-Earnings Analysis Checklist++1. **Headline numbers**: EPS surprise %, revenue surprise %+2. **Quality of beat/miss**: operating income-driven or one-time items?+3. **Guidance change**: raised / maintained / lowered / withdrawn+4. **Call tone**: management confidence level, Q&A defensiveness+5. **Analyst reaction**: immediate revision direction (first 24-48 hours)+6. **Price/volume reaction**: gap up/down, reversal, volume multiple vs average++## Multi-Market Considerations++### US Equities+- Earnings season: Jan/Apr/Jul/Oct (roughly 2-6 weeks after quarter-end)+- Data: SEC filings (10-Q within 40 days, 10-K within 60 days for large accelerated filers)+- Consensus: Bloomberg, Refinitiv, FactSet, Visible Alpha+- Via yfinance: `ticker.earnings_dates`, `ticker.earnings_history`++### Hong Kong Equities+- Earnings season: Mar-Apr (annual), Aug-Sep (interim)+- Many HK-listed companies report semi-annually, not quarterly+- Dual-listed (A+H): compare A-share analyst estimates vs HK analyst estimates for arbitrage+- Via yfinance: `yf.Ticker("0700.HK").financials`++### Key Differences++| Dimension | US | HK |+|-----------|----|----|+| Reporting frequency | Quarterly | Semi-annual (most) |+| Guidance practice | Common | Rare |+| Analyst coverage | Deep (>20 for large caps) | Thinner (5-15 for large caps) |+| Pre-announcement | Regulated (Reg FD) | Less regulated |+| Earnings call | Standard | Less common for mid/small caps |++## Output Format++```+## Earnings Revision Analysis โ [Ticker]++### Consensus Snapshot+- **Current FY EPS consensus**: $X.XX (N analysts)+- **30-day revision**: [up/down X%] โ [N upgrades / N downgrades]+- **60-day revision**: [up/down X%]+- **Estimate dispersion**: [low/medium/high] (CV = X%)++### Last Earnings Event+- **Date**: YYYY-MM-DD | **Quarter**: FY25Q3+- **EPS**: $X.XX actual vs $X.XX consensus (surprise: +X%)+- **Revenue**: $X.XB actual vs $X.XB consensus (surprise: +X%)+- **Guidance**: [raised / maintained / lowered] โ FY25 EPS guide: $X.XX-$X.XX+- **Price reaction**: [+X% on day, +X% over 5 days]++### Revision Momentum+- **Breadth**: [+0.6 โ strong upgrade momentum]+- **Magnitude**: [average revision +X% over 30 days]+- **PEAD status**: [still within 60-day drift window / drift exhausted]++### Earnings Quality+- **FCF conversion**: X% [strong/adequate/weak]+- **Accrual ratio**: X% [clean/moderate/concern]+- **Non-GAAP gap**: $X.XX [small/large]++### Signal+- **Direction**: [bullish / neutral / bearish]+- **Catalyst**: [next earnings date: YYYY-MM-DD]+- **Confidence**: [high / medium / low]+```++## Notes++- Earnings revision data requires real-time consensus feeds (Bloomberg, Refinitiv) for professional-grade signals; yfinance provides historical actuals but not real-time consensus+- PEAD is strongest in the first 30 days post-announcement; signal decays significantly after 60 days+- Guidance withdrawals are almost always negative โ companies rarely withdraw guidance when business is going well+- Beware of "beat and lower" โ beating current quarter but lowering forward guidance is often net negative+- This framework is for research purposes only and does not constitute investment advicediff --git a/agent/src/skills/edgar-sec-filings/SKILL.md b/agent/src/skills/edgar-sec-filings/SKILL.mdnew file mode 100644index 000000000..c7b0e45bb--- /dev/null+++ b/agent/src/skills/edgar-sec-filings/SKILL.md@@ -0,0 +1,296 @@+---+name: edgar-sec-filings+description: SEC EDGAR filing analysis โ 10-K, 10-Q, 8-K, proxy statements, insider Form 4. Extract key financials, risk factors, management discussion, and generate investment signals from US public company filings.+---+# SEC EDGAR Filing Analysis++## Overview++Analyze US public company filings from SEC EDGAR to extract fundamental insights, risk signals, and investment-relevant information. Covers annual reports (10-K), quarterly reports (10-Q), current events (8-K), proxy statements (DEF 14A), and insider transactions (Form 4).++This skill provides the analytical framework for interpreting SEC filings. Data retrieval uses `read_url` tool with EDGAR URLs or `yfinance` Ticker objects for structured financial data.++## Filing Types and Investment Relevance++| Filing | Frequency | Key Content | Signal Value |+|--------|-----------|-------------|--------------|+| 10-K | Annual | Full-year financials, risk factors, MD&A, segment data | Comprehensive fundamental view |+| 10-Q | Quarterly | Quarterly financials, interim MD&A, legal updates | Trend confirmation / inflection detection |+| 8-K | Event-driven | Material events: M&A, CEO change, restatement, guidance | Catalyst / risk trigger |+| DEF 14A | Annual (proxy) | Executive comp, board composition, shareholder proposals | Governance quality signal |+| Form 4 | Within 2 days | Insider buys / sells | Insider conviction signal |+| 13F | Quarterly | Institutional holdings >$100M AUM | Smart money positioning |+| SC 13D/G | Event-driven | >5% ownership stake disclosure | Activist / strategic investor signal |++## EDGAR Data Access++### Direct EDGAR URLs++```python+# Company filings search+# https://www.sec.gov/cgi-bin/browse-edgar?action=getcompany&CIK={ticker}&type={filing_type}++# Example: Apple 10-K filings+url = "https://www.sec.gov/cgi-bin/browse-edgar?action=getcompany&CIK=AAPL&type=10-K&dateb=&owner=include&count=10"++# EDGAR full-text search (EFTS)+# https://efts.sec.gov/LATEST/search-index?q={query}&dateRange=custom&startdt={start}&enddt={end}+```++### Via yfinance (structured data)++```python+import yfinance as yf+ticker = yf.Ticker("AAPL")++# Financial statements (derived from 10-K/10-Q)+income = ticker.financials # Annual income statement+income_q = ticker.quarterly_financials # Quarterly+balance = ticker.balance_sheet # Balance sheet+cashflow = ticker.cashflow # Cash flow statement++# Insider transactions (derived from Form 4)+insider = ticker.insider_transactions++# Institutional holders (derived from 13F)+institutions = ticker.institutional_holders+major = ticker.major_holders+```++## 10-K / 10-Q Analysis Framework++### I. Financial Statement Deep Dive++**Income Statement Focus:**+- Revenue growth rate: YoY and QoQ acceleration / deceleration+- Gross margin trend: expanding (pricing power) vs compressing (cost pressure)+- Operating leverage: SG&A as % of revenue declining = positive operating leverage+- R&D intensity: R&D / revenue ratio vs peers+- Non-recurring items: restructuring charges, impairments, one-time gains++**Balance Sheet Focus:**+- Cash & equivalents vs total debt: net cash / net debt position+- Current ratio and quick ratio: liquidity health+- Goodwill / intangibles as % of total assets: acquisition-driven growth risk+- Inventory days (for manufacturers / retailers): rising = demand weakness signal+- Accounts receivable days: rising = collection risk or channel stuffing++**Cash Flow Focus:**+- FCF = Operating CF - CapEx: true cash generation power+- FCF conversion = FCF / Net Income: >80% = high earnings quality+- CapEx intensity = CapEx / Revenue: rising = growth investment or maintenance burden+- Stock-based compensation: add back to get true cash earnings+- Buyback vs dividend: capital return strategy signal++### II. MD&A (Management Discussion & Analysis)++The MD&A section is the most qualitative and forward-looking part of the filing.++**Key extraction targets:**+1. **Revenue drivers**: which segments / geographies are growing, which are declining+2. **Margin commentary**: management explanation for margin changes+3. **Forward guidance language**: "expect", "anticipate", "believe" โ tone shift detection+4. **Risk factor changes**: compare risk factors vs prior filing; NEW risks added = material change+5. **Liquidity and capital resources**: debt maturity schedule, credit facility availability++**Tone analysis signals:**+```python+# Simplified tone scoring+positive_words = ["growth", "improvement", "strong", "exceeded", "momentum", "opportunity"]+negative_words = ["challenging", "decline", "uncertainty", "headwind", "pressure", "risk"]+cautious_words = ["moderate", "cautious", "prudent", "measured", "selective"]++# Count frequency change vs prior filing+# Rising negative word count = deteriorating outlook+# Rising cautious words = management hedging+```++### III. Risk Factor Analysis++**Risk factor change detection (10-K vs prior 10-K):**++| Change Type | Signal | Action |+|-------------|--------|--------|+| New risk factor added | Material new risk identified | Deep dive on the specific risk |+| Risk factor removed | Risk resolved or deemed immaterial | Positive signal if genuine resolution |+| Language intensified | Risk escalating | Review exposure and hedging |+| Order changed (moved higher) | Risk priority elevated | Assess potential impact magnitude |++**Common risk categories for US equities:**+- Regulatory / legal risk (antitrust, FDA, patent expiry)+- Customer concentration (>10% revenue from single customer must be disclosed)+- Geographic concentration (China exposure, emerging market risk)+- Technology disruption risk+- Cybersecurity risk (new SEC mandate: material cybersecurity incidents must be disclosed in 8-K)+- Climate / ESG risk (increasingly required)++## 8-K Event Analysis++### Material Event Classification++| Event Type | 8-K Item | Typical Price Impact | Time Sensitivity |+|------------|----------|---------------------|------------------|+| Earnings pre-release | 2.02 | High | Immediate |+| M&A announcement | 1.01 | Very high | Immediate |+| CEO / CFO departure | 5.02 | Medium-high | Same day |+| Restatement | 4.02 | Very high (negative) | Immediate |+| Guidance revision | 7.01/8.01 | High | Same day |+| Credit agreement change | 1.01 | Low-medium | Monitor |+| Share repurchase program | 8.01 | Low positive | Background signal |+| Dividend change | 8.01 | Medium | Same day |++### 8-K Signal Rules++```python+# High-priority 8-K events+if item == "4.02": # Restatement+ signal = "strong_negative" # Restatements destroy trust+ action = "review_all_prior_financials"+elif item == "2.02" and surprise_direction == "negative":+ signal = "negative" # Earnings pre-announcement miss+elif item == "5.02" and role in ["CEO", "CFO"]:+ signal = "uncertainty" # C-suite departure = governance risk+elif item == "1.01" and event_type == "acquisition":+ signal = "evaluate" # M&A: acquirer usually -2 to -5%, target +20-40%+```++## Insider Transaction Analysis (Form 4)++### Signal Framework++| Pattern | Signal | Confidence |+|---------|--------|------------|+| Cluster buying: 3+ insiders buying within 30 days | Strong bullish | High |+| CEO/CFO large open-market purchase (>$500K) | Bullish | High |+| Insider buying after price decline >20% | Contrarian bullish | Medium-high |+| Cluster selling at all-time highs | Neutral to mildly bearish | Low (may be pre-planned) |+| CFO selling >50% of holdings | Bearish | Medium |+| 10b5-1 plan sales | Neutral | Low (pre-programmed) |++**Key distinctions:**+- **Open-market purchases** (most informative): insider spending own money+- **10b5-1 plan sales** (least informative): pre-programmed, regulatory safe harbor+- **Option exercises + immediate sale**: often tax-driven, low signal value+- **Gift transactions**: ignore for signal purposes++```python+# Insider signal scoring+def score_insider_activity(transactions, lookback_days=90):+ buys = [t for t in transactions if t.type == "Purchase" and t.days_ago <= lookback_days]+ sells = [t for t in transactions if t.type == "Sale" and t.days_ago <= lookback_days]++ buy_value = sum(t.value for t in buys)+ sell_value = sum(t.value for t in sells)++ # Filter out 10b5-1 plan sales+ organic_sells = [s for s in sells if not s.is_10b5_1]++ if len(buys) >= 3 and buy_value > 1_000_000:+ return "strong_bullish"+ elif buy_value > sell_value * 2:+ return "bullish"+ elif len(organic_sells) >= 3 and sell_value > 5_000_000:+ return "bearish_watch"+ else:+ return "neutral"+```++## 13F Institutional Holdings Analysis++### Smart Money Tracking++**Key metrics:**+- Number of institutional holders: rising = broadening ownership base+- Top 10 holder concentration: >50% = concentrated, vulnerable to single-fund redemption+- New positions initiated this quarter: smart money entering+- Positions closed this quarter: smart money exiting+- Activist stakes (SC 13D): potential for corporate action catalyst++**Institutional quality tiers:**+1. **Tier 1 โ Conviction signals**: Berkshire, Baupost, Greenlight, Pershing Square, Tiger Global+2. **Tier 2 โ Trend signals**: BlackRock, Vanguard, Fidelity (flow-driven, less stock-picking signal)+3. **Tier 3 โ Quantitative**: Renaissance, Two Sigma, Citadel (high turnover, less directional signal)++```python+# 13F change detection+def analyze_13f_changes(current_holders, prior_holders):+ new_positions = current_holders - prior_holders # New entries+ closed_positions = prior_holders - current_holders # Exits++ # Flag: multiple Tier 1 funds initiating+ tier1_new = [h for h in new_positions if h.tier == 1]+ if len(tier1_new) >= 2:+ signal = "strong_smart_money_accumulation"++ return signal+```++## Composite Filing Signal++### Scoring Template++```python+filing_score = {+ "financial_health": 0, # -2 to +2: based on 10-K/10-Q financials+ "management_tone": 0, # -2 to +2: MD&A sentiment shift+ "risk_factor_change": 0, # -2 to +2: new risks vs resolved risks+ "insider_activity": 0, # -2 to +2: net insider buying/selling+ "institutional_flow": 0, # -2 to +2: 13F position changes+ "event_catalyst": 0, # -2 to +2: recent 8-K impact+}+# Total range: -12 to +12+# > +6: strong fundamental bullish+# +2 to +6: mild bullish+# -2 to +2: neutral+# < -2: fundamental caution+```++## Output Format++```+## SEC Filing Analysis โ [Ticker]++### Filing Summary+- **Latest 10-K/10-Q**: [date], [period]+- **Recent 8-K events**: [list material events]+- **Insider activity (90d)**: [net buy/sell summary]++### Financial Health+- Revenue trend: [accelerating / stable / decelerating]+- Margin trajectory: [expanding / stable / compressing]+- FCF conversion: [strong / adequate / weak]+- Balance sheet: [net cash / moderate leverage / high leverage]++### MD&A Tone Shift+- vs prior filing: [more optimistic / unchanged / more cautious]+- Key language changes: [specific quotes or paraphrases]++### Risk Factor Changes+- New risks: [list any new risk factors added]+- Intensified risks: [list risks with stronger language]+- Resolved risks: [list removed risk factors]++### Insider & Institutional Signals+- Insider net activity: [cluster buy / neutral / cluster sell]+- Institutional positioning: [accumulation / stable / distribution]++### Composite Signal+| Dimension | Score (-2~+2) | Basis |+|-----------|---------------|-------|+| Financial health | +1 | Revenue accelerating, margins stable |+| Management tone | -1 | More cautious language in MD&A |+| ... | ... | ... |++### Investment Implication+- Direction: [bullish / bearish / neutral]+- Confidence: [high / medium / low]+- Key monitoring: [next earnings date, upcoming 8-K triggers]+```++## Notes++- EDGAR filings are public and free; no API key required (rate limit: 10 requests/second with User-Agent header)+- 10-K/10-Q data is backward-looking; combine with forward guidance and analyst estimates for complete view+- Insider transaction data has a 2-business-day reporting lag; real-time insider data requires paid services+- 13F data is reported with a 45-day lag after quarter-end; positions may have already changed+- This framework is for research purposes only and does not constitute investment advicediff --git a/agent/src/skills/elliott-wave/SKILL.md b/agent/src/skills/elliott-wave/SKILL.mdnew file mode 100644index 000000000..4d744bfad--- /dev/null+++ b/agent/src/skills/elliott-wave/SKILL.md@@ -0,0 +1,55 @@+---+name: elliott-wave+description: Elliott Wave Theory signal engine. Detects swing points through Zigzag, matches 5-wave impulse and 3-wave corrective structures, validates them with Fibonacci wave relationships, and generates trend-top / correction-complete signals. Pure in-house pandas implementation.+---+# Elliott Wave Theory++## Purpose++Classic wave theory based on the core assumption that markets move in fractal wave structures:++| Structure | Wave Count | Direction | Meaning |+|------|------|------|------|+| Impulse wave | 5 waves (1-2-3-4-5) | Trend-following | Main trend direction |+| Corrective wave | 3 waves (A-B-C) | Counter-trend | Pullback correction |++## Core Rules++### Three Iron Rules for Impulse Waves+1. Wave 2 cannot retrace beyond the start of wave 1+2. Wave 3 cannot be the shortest impulse wave+3. Wave 4 cannot enter the price territory of wave 1++### Fibonacci Relationships Between Waves+- Wave 2 retraces 0.5-0.618 of wave 1+- Wave 3 = wave 1 ร 1.618 (most common)+- Wave 4 retraces 0.382 of wave 3+- Wave 5 โ the length of wave 1++## Signal Logic++- **5-wave advance completed** โ sell (trend top)+- **ABC pullback completed** โ buy (correction finished)+- **Wave 3 in progress** โ stay with the trend (no reversal signal is generated)++## Parameters++| Parameter | Default | Description |+|------|--------|------|+| swing_window | 10 | Rolling window for swing-point detection |+| fib_tolerance | 0.15 | Tolerance for Fibonacci ratios |+| min_wave_bars | 5 | Minimum number of candles per wave |++## Notes++Wave theory is highly subjective, and automatic counting can yield multiple interpretations. This implementation uses a "simplest effective single interpretation" strategy and would rather miss signals than misclassify them.++## Dependencies++```bash+pip install pandas numpy requests+```++## Signal Convention++- `1` = long, `-1` = short, `0` = stand asidediff --git a/agent/src/skills/elliott-wave/example_signal_engine.py b/agent/src/skills/elliott-wave/example_signal_engine.pynew file mode 100644index 000000000..e3588f37e--- /dev/null+++ b/agent/src/skills/elliott-wave/example_signal_engine.py@@ -0,0 +1,458 @@+"""่พ็ฅ็นๆณขๆตช็่ฎบไฟกๅทๅผๆใ++้่ฟ Zigzag ๆฃๆต Swing ็น๏ผๅน้ 5 ๆตชๆจๅจๅ 3 ๆตช่ฐๆด็ปๆ๏ผ+็ปๅ Fibonacci ๆตช้ดๅ ณ็ณป้ช่ฏ๏ผ็ๆ่ถๅฟ่ง้กถ/่ฐๆด็ปๆไฟกๅทใ+็บฏ pandas/numpy ๅฎ็ฐ๏ผๆ ๅค้จๆณขๆตชๅบไพ่ตใ+"""++from typing import Dict, List, Optional, Tuple++import numpy as np+import pandas as pd+++class SignalEngine:+ """่พ็ฅ็นๆณขๆตช็่ฎบไฟกๅทๅผๆใ++ ๆฃๆตๆต็จ๏ผ+ 1. Zigzag Swing ็นๆฃๆต๏ผๆปๅจ็ชๅฃๅฑ้จๆๅผ๏ผ+ 2. 5 ๆตชๆจๅจ็ปๆๅน้ + ไธๅคง้ๅพ้ช่ฏ+ 3. ABC ่ฐๆด็ปๆๅน้ + 4. Fibonacci ๆตช้ดๅ ณ็ณป่ฟๆปค++ ็ญ็ฅ๏ผๅฎๅฏๆผไฟกๅทไนไธ่ฏฏๅคใ++ Attributes:+ swing_window: Swing ็นๆฃๆตๆปๅจ็ชๅฃๅๅพใ+ fib_tolerance: Fibonacci ๆฏ็ๅฎนๅทฎใ+ min_wave_bars: ๆฏๆตชๆๅฐ K ็บฟๆฐใ++ Example:+ >>> engine = SignalEngine()+ >>> signals = engine.generate({"BTC-USDT": df})+ >>> signals["BTC-USDT"].value_counts()+ """++ def __init__(+ self,+ swing_window: int = 10,+ fib_tolerance: float = 0.15,+ min_wave_bars: int = 5,+ ):+ """ๅๅงๅ่พ็ฅ็นๆณขๆตชไฟกๅทๅผๆใ++ Args:+ swing_window: Swing ็นๆฃๆตๆปๅจ็ชๅฃๅๅพ๏ผ้ป่ฎค 10ใ+ fib_tolerance: Fibonacci ๆฏ็ๅฎนๅทฎ๏ผ้ป่ฎค 0.15ใ+ min_wave_bars: ๆฏๆตชๆๅฐ K ็บฟๆฐ๏ผ้ป่ฎค 5ใ+ """+ self.swing_window = swing_window+ self.fib_tolerance = fib_tolerance+ self.min_wave_bars = min_wave_bars++ def _find_swings(+ self, high: pd.Series, low: pd.Series+ ) -> List[Dict]:+ """็จๆปๅจ็ชๅฃๆพๅฑ้จ้ซไฝ็น๏ผ็ๆไบคๆฟ็ Zigzag ๅบๅใ++ Args:+ high: ๆ้ซไปทๅบๅใ+ low: ๆไฝไปทๅบๅใ++ Returns:+ ไบคๆฟๆๅ็ Swing ็นๅ่กจ๏ผๆฏไธชๅ ็ด ไธบ+ {"index": datetime, "price": float, "type": "H"|"L"}ใ+ """+ w = self.swing_window+ full_w = w * 2 + 1++ if len(high) < full_w:+ return []++ # ๆฃๆตๅฑ้จๆๅผ+ roll_max = high.rolling(full_w, center=True).max()+ roll_min = low.rolling(full_w, center=True).min()+ swing_high_mask = high == roll_max+ swing_low_mask = low == roll_min++ # ๆถ้ๆๆๅ้ Swing ็น+ raw_points = []+ for idx in high.index:+ is_h = bool(swing_high_mask.get(idx, False))+ is_l = bool(swing_low_mask.get(idx, False))+ if is_h and is_l:+ # ๅไธๆ นK็บฟๅๆถๆฏ้ซไฝ็น๏ผๅๅน ๅบฆๆดๅคง็+ pass+ elif is_h:+ raw_points.append({"index": idx, "price": float(high[idx]), "type": "H"})+ elif is_l:+ raw_points.append({"index": idx, "price": float(low[idx]), "type": "L"})++ if len(raw_points) < 2:+ return raw_points++ # ่ฟๆปคไธบไธฅๆ ผไบคๆฟ็ H/L ๅบๅ+ zigzag = [raw_points[0]]+ for pt in raw_points[1:]:+ if pt["type"] == zigzag[-1]["type"]:+ # ่ฟ็ปญๅ็ฑปๅ๏ผไฟ็ๆดๆ็ซฏ็+ if pt["type"] == "H" and pt["price"] > zigzag[-1]["price"]:+ zigzag[-1] = pt+ elif pt["type"] == "L" and pt["price"] < zigzag[-1]["price"]:+ zigzag[-1] = pt+ else:+ zigzag.append(pt)++ return zigzag++ def _check_fib_ratios(+ self, w1: float, w2: float, w3: float, w4: float, w5: float+ ) -> bool:+ """้ช่ฏ 5 ๆตชๆจๅจ็ปๆ็ Fibonacci ๆตช้ดๅ ณ็ณปใ++ ๆฃๆฅ้กน๏ผ+ - ๆตช2 ๅๆคๆตช1 ็ 0.5-0.618+ - ๆตช3/ๆตช1 ๅจ 1.0-2.618 ่ๅด+ - ๆตช4 ๅๆคๆตช3 ็ 0.236-0.5++ Args:+ w1: ๆตช1 ๅน ๅบฆ๏ผ็ปๅฏนๅผ๏ผใ+ w2: ๆตช2 ๅๆคๅน ๅบฆ๏ผ็ปๅฏนๅผ๏ผใ+ w3: ๆตช3 ๅน ๅบฆ๏ผ็ปๅฏนๅผ๏ผใ+ w4: ๆตช4 ๅๆคๅน ๅบฆ๏ผ็ปๅฏนๅผ๏ผใ+ w5: ๆตช5 ๅน ๅบฆ๏ผ็ปๅฏนๅผ๏ผใ++ Returns:+ ๆฏๅฆๆปก่ถณ Fibonacci ๆฏ็่ฆๆฑใ+ """+ tol = self.fib_tolerance++ if w1 == 0 or w3 == 0:+ return False++ # ๆตช2 ๅๆคๆตช1๏ผ็ฎๆ 0.5-0.618+ r2 = w2 / w1+ if not (0.5 - tol <= r2 <= 0.618 + tol):+ return False++ # ๆตช3 / ๆตช1๏ผ็ฎๆ ~1.618๏ผๆพๅฎฝๅฐ 1.0-2.618+ r3 = w3 / w1+ if not (1.0 - tol <= r3 <= 2.618 + tol):+ return False++ # ๆตช4 ๅๆคๆตช3๏ผ็ฎๆ ~0.382๏ผๆพๅฎฝๅฐ 0.236-0.5+ r4 = w4 / w3+ if not (0.236 - tol <= r4 <= 0.5 + tol):+ return False++ return True++ def _check_min_bars(self, swings: List[Dict], start: int, count: int) -> bool:+ """ๆฃๆฅ่ฟ็ปญ Swing ็นไน้ดๆฏๅฆๆปก่ถณๆๅฐ K ็บฟๆฐใ++ Args:+ swings: Swing ็นๅ่กจใ+ start: ่ตทๅง็ดขๅผใ+ count: ๆฃๆฅ็็นๆฐใ++ Returns:+ ๆฏๅฆๆฏๆฎต้ฝๆปก่ถณๆๅฐ K ็บฟๆฐใ+ """+ for i in range(start, start + count - 1):+ idx_a = swings[i]["index"]+ idx_b = swings[i + 1]["index"]+ if hasattr(idx_a, "value") and hasattr(idx_b, "value"):+ # ๆถ้ดๆณ็ฑปๅ๏ผ็จๅคฉๆฐๅทฎไผฐ็ฎ+ diff = abs((idx_b - idx_a).days)+ else:+ diff = abs(int(idx_b) - int(idx_a))+ if diff < self.min_wave_bars:+ return False+ return True++ def _find_impulse(self, swings: List[Dict]) -> List[Tuple]:+ """ๅจ Swing ๅบๅไธญๅฏปๆพ 5 ๆตชๆจๅจ็ปๆใ++ ็ๆถจๆจๅจๆตช๏ผL-H-L-H-L-H๏ผ6ไธช็น๏ผ5ๆฎตๆตช๏ผ+ ็่ทๆจๅจๆตช๏ผH-L-H-L-H-L๏ผ6ไธช็น๏ผ5ๆฎตๆตช๏ผ++ ไธๅคง้ๅพ้ช่ฏ๏ผ+ 1. ๆตช2 ไธ็ ดๆตช1 ่ตท็น+ 2. ๆตช3 ไธๆฏๆ็ญๆจๅจๆตช+ 3. ๆตช4 ไธ่ฟๅ ฅๆตช1 ๅบๅ++ Args:+ swings: ไบคๆฟๆๅ็ Swing ็นๅ่กจใ++ Returns:+ (็ปๆๆถ้ดๆณ, ไฟกๅทๆนๅ) ๅ ็ปๅ่กจใ+ 5 ๆตชไธๅๅฎๆ่ฟๅ -1๏ผๅ๏ผ๏ผ5 ๆตชไธ่ทๅฎๆ่ฟๅ 1๏ผไนฐ๏ผใ+ """+ results = []++ for i in range(len(swings) - 5):+ types = [s["type"] for s in swings[i : i + 6]]++ # --- ็ๆถจๆจๅจๆตช: L, H, L, H, L, H ---+ if types == ["L", "H", "L", "H", "L", "H"]:+ x, p1, p2, p3, p4, p5 = swings[i : i + 6]++ wave1 = p1["price"] - x["price"] # ไธๅ+ wave2 = p1["price"] - p2["price"] # ๅๆค๏ผๆญฃๅผ๏ผ+ wave3 = p3["price"] - p2["price"] # ไธๅ+ wave4 = p3["price"] - p4["price"] # ๅๆค๏ผๆญฃๅผ๏ผ+ wave5 = p5["price"] - p4["price"] # ไธๅ++ if wave1 <= 0 or wave3 <= 0 or wave5 <= 0:+ continue++ # ้ๅพ1๏ผๆตช2ไธ็ ดๆตช1่ตท็น+ if p2["price"] <= x["price"]:+ continue++ # ้ๅพ2๏ผๆตช3ไธๆฏๆ็ญๆจๅจๆตช+ if wave3 < wave1 and wave3 < wave5:+ continue++ # ้ๅพ3๏ผๆตช4ไธ่ฟๅ ฅๆตช1ๅบๅ+ if p4["price"] <= p1["price"]:+ continue++ # ๆๅฐK็บฟๆฐๆฃๆฅ+ if not self._check_min_bars(swings, i, 6):+ continue++ # Fibonacci ้ช่ฏ+ if not self._check_fib_ratios(wave1, wave2, wave3, wave4, wave5):+ continue++ # 5ๆตชไธๅๅฎๆ โ ๅๅบไฟกๅท+ results.append((p5["index"], -1))++ # --- ็่ทๆจๅจๆตช: H, L, H, L, H, L ---+ elif types == ["H", "L", "H", "L", "H", "L"]:+ x, p1, p2, p3, p4, p5 = swings[i : i + 6]++ wave1 = x["price"] - p1["price"] # ไธ่ท+ wave2 = p2["price"] - p1["price"] # ๅๅผน๏ผๆญฃๅผ๏ผ+ wave3 = p2["price"] - p3["price"] # ไธ่ท+ wave4 = p4["price"] - p3["price"] # ๅๅผน๏ผๆญฃๅผ๏ผ+ wave5 = p4["price"] - p5["price"] # ไธ่ท++ if wave1 <= 0 or wave3 <= 0 or wave5 <= 0:+ continue++ # ้ๅพ1๏ผๆตช2ไธ่ถ ่ฟๆตช1่ตท็น+ if p2["price"] >= x["price"]:+ continue++ # ้ๅพ2๏ผๆตช3ไธๆฏๆ็ญๆจๅจๆตช+ if wave3 < wave1 and wave3 < wave5:+ continue++ # ้ๅพ3๏ผๆตช4ไธ่ฟๅ ฅๆตช1ๅบๅ+ if p4["price"] >= p1["price"]:+ continue++ # ๆๅฐK็บฟๆฐๆฃๆฅ+ if not self._check_min_bars(swings, i, 6):+ continue++ # Fibonacci ้ช่ฏ+ if not self._check_fib_ratios(wave1, wave2, wave3, wave4, wave5):+ continue++ # 5ๆตชไธ่ทๅฎๆ โ ไนฐๅ ฅไฟกๅท+ results.append((p5["index"], 1))++ return results++ def _find_abc(self, swings: List[Dict]) -> List[Tuple]:+ """ๅจ Swing ๅบๅไธญๅฏปๆพ ABC ่ฐๆด็ปๆใ++ ็่ท่ฐๆด๏ผไธๅ่ถๅฟๅ๏ผ๏ผH-L-H-L๏ผA ไธ B ๅๅผน C ไธ๏ผ+ ็ๆถจ่ฐๆด๏ผไธ้่ถๅฟๅ๏ผ๏ผL-H-L-H๏ผA ไธ B ๅ่ฝ C ไธ๏ผ++ Args:+ swings: ไบคๆฟๆๅ็ Swing ็นๅ่กจใ++ Returns:+ (็ปๆๆถ้ดๆณ, ไฟกๅทๆนๅ) ๅ ็ปๅ่กจใ+ ABC ไธ่ฐๅฎๆ่ฟๅ 1๏ผไนฐ๏ผ๏ผABC ไธ่ฐๅฎๆ่ฟๅ -1๏ผๅ๏ผใ+ """+ tol = self.fib_tolerance+ results = []++ for i in range(len(swings) - 3):+ types = [s["type"] for s in swings[i : i + 4]]++ # --- ็่ท ABC: H, L, H, L๏ผไธ-ไธ-ไธ๏ผโ ่ฐๆด็ปๆๅไนฐๅ ฅ ---+ if types == ["H", "L", "H", "L"]:+ start, pa, pb, pc = swings[i : i + 4]++ wave_a = start["price"] - pa["price"] # A ไธ่ทๅน ๅบฆ+ wave_b = pb["price"] - pa["price"] # B ๅๅผนๅน ๅบฆ+ wave_c = pb["price"] - pc["price"] # C ไธ่ทๅน ๅบฆ++ if wave_a <= 0 or wave_b <= 0 or wave_c <= 0:+ continue++ # B ไธ่ถ ่ฟ่ตท็น+ if pb["price"] >= start["price"]:+ continue++ # B ๅๆค A ็ 0.382-0.618+ r_b = wave_b / wave_a+ if not (0.382 - tol <= r_b <= 0.618 + tol):+ continue++ # C โ A๏ผ0.618-1.618 ๅ A ๆตช๏ผ+ r_c = wave_c / wave_a+ if not (0.618 - tol <= r_c <= 1.618 + tol):+ continue++ # ๆๅฐK็บฟๆฐๆฃๆฅ+ if not self._check_min_bars(swings, i, 4):+ continue++ # ABC ไธ่ฐๅฎๆ โ ไนฐๅ ฅไฟกๅท+ results.append((pc["index"], 1))++ # --- ็ๆถจ ABC: L, H, L, H๏ผไธ-ไธ-ไธ๏ผโ ่ฐๆด็ปๆๅๅๅบ ---+ elif types == ["L", "H", "L", "H"]:+ start, pa, pb, pc = swings[i : i + 4]++ wave_a = pa["price"] - start["price"] # A ไธๆถจๅน ๅบฆ+ wave_b = pa["price"] - pb["price"] # B ๅ่ฝๅน ๅบฆ+ wave_c = pc["price"] - pb["price"] # C ไธๆถจๅน ๅบฆ++ if wave_a <= 0 or wave_b <= 0 or wave_c <= 0:+ continue++ # B ไธไฝไบ่ตท็น+ if pb["price"] <= start["price"]:+ continue++ # B ๅๆค A ็ 0.382-0.618+ r_b = wave_b / wave_a+ if not (0.382 - tol <= r_b <= 0.618 + tol):+ continue++ # C โ A+ r_c = wave_c / wave_a+ if not (0.618 - tol <= r_c <= 1.618 + tol):+ continue++ # ๆๅฐK็บฟๆฐๆฃๆฅ+ if not self._check_min_bars(swings, i, 4):+ continue++ # ABC ไธ่ฐๅฎๆ โ ๅๅบไฟกๅท+ results.append((pc["index"], -1))++ return results++ def generate(+ self, data_map: Dict[str, pd.DataFrame]+ ) -> Dict[str, pd.Series]:+ """ๆ นๆฎ่พ็ฅ็นๆณขๆตช็่ฎบ็ๆไบคๆไฟกๅทใ++ Args:+ data_map: ๆ ็ไปฃ็ ๅฐ OHLCV DataFrame ็ๆ ๅฐใ+ DataFrame ้ๅ ๅซ high/low/close ๅ๏ผindex ไธบ datetimeใ++ Returns:+ ๆ ็ไปฃ็ ๅฐไฟกๅท Series ็ๆ ๅฐ๏ผ1=ๅๅค, -1=ๅ็ฉบ, 0=่งๆ๏ผใ+ """+ result = {}++ for code, df in data_map.items():+ signal = pd.Series(0, index=df.index, dtype=int)++ swings = self._find_swings(df["high"], df["low"])+ if len(swings) < 4:+ result[code] = signal+ continue++ # 5 ๆตชๆจๅจ็ปๆ+ if len(swings) >= 6:+ for idx, direction in self._find_impulse(swings):+ if idx in signal.index:+ signal[idx] = direction++ # ABC ่ฐๆด็ปๆ+ for idx, direction in self._find_abc(swings):+ if idx in signal.index:+ signal[idx] = direction++ result[code] = signal++ return result+++def _fetch_okx(+ inst_id: str, bar: str = "1D", limit: int = 300+) -> pd.DataFrame:+ """ไป OKX API ่ทๅ K ็บฟๆฐๆฎใ++ Args:+ inst_id: ไบคๆๅฏนๆ ่ฏ๏ผๅฆ "BTC-USDT"ใ+ bar: K ็บฟๅจๆ๏ผ้ป่ฎค "1D"ใ+ limit: ่ทๅๆฐ้๏ผ้ป่ฎค 300ใ++ Returns:+ OHLCV DataFrame๏ผindex ไธบ datetimeใ++ Raises:+ KeyError: API ่ฟๅๆ ผๅผๅผๅธธๆถใ+ """+ import requests++ resp = requests.get(+ "https://www.okx.com/api/v5/market/candles",+ params={"instId": inst_id, "bar": bar, "limit": str(limit)},+ )+ candles = resp.json()["data"]+ columns = [+ "ts", "open", "high", "low", "close",+ "vol", "volCcy", "volCcyQuote", "confirm",+ ]+ df = pd.DataFrame(reversed(candles), columns=columns)+ df["ts"] = pd.to_datetime(df["ts"].astype("int64"), unit="ms")+ df = df.set_index("ts")+ for col in ["open", "high", "low", "close"]:+ df[col] = df[col].astype(float)+ df["volume"] = df["vol"].astype(float)+ return df+++if __name__ == "__main__":+ symbols = ["BTC-USDT", "ETH-USDT", "SOL-USDT"]+ data_map = {}++ print("=== ่พ็ฅ็นๆณขๆตช็่ฎบไฟกๅทๅผๆ ===\n")++ for sym in symbols:+ print(f"่ทๅ {sym} ๆฐๆฎ...")+ data_map[sym] = _fetch_okx(sym, bar="1D", limit=300)+ print(+ f" {len(data_map[sym])} ๆ นK็บฟ, "+ f"{data_map[sym].index[0]:%Y-%m-%d} ~ "+ f"{data_map[sym].index[-1]:%Y-%m-%d}"+ )++ engine = SignalEngine()+ signals = engine.generate(data_map)++ print("\n--- ไฟกๅท็ป่ฎก ---")+ for sym in symbols:+ sig = signals[sym]+ buys = sig[sig == 1]+ sells = sig[sig == -1]+ print(f"\n{sym} ({len(data_map[sym])} ๆ นK็บฟ):")+ print(f" ๅๅคไฟกๅท: {len(buys)} ไธช")+ print(f" ๅ็ฉบไฟกๅท: {len(sells)} ไธช")+ if len(buys) > 0:+ print(f" ๆ่ฟๅๅค: {buys.index[-1]:%Y-%m-%d}")+ if len(sells) > 0:+ print(f" ๆ่ฟๅ็ฉบ: {sells.index[-1]:%Y-%m-%d}")diff --git "a/agent/src/skills/elliott-wave/references/Fibonacci\346\265\252\351\227\264\345\205\263\347\263\273.md" "b/agent/src/skills/elliott-wave/references/Fibonacci\346\265\252\351\227\264\345\205\263\347\263\273.md"new file mode 100644index 000000000..63f52daec--- /dev/null+++ "b/agent/src/skills/elliott-wave/references/Fibonacci\346\265\252\351\227\264\345\205\263\347\263\273.md"@@ -0,0 +1,41 @@+# Fibonacci ๆตช้ดๅ ณ็ณป++## ๆจๅจๆตชๅ ณ็ณป++### ๆตช2 vs ๆตช1+- ๅธธ่งๅๆค๏ผ0.5, 0.618+- ๆๅคงๅๆค๏ผ0.786๏ผ่ถ ่ฟๅๅฏ่ฝไธๆฏๆตช2๏ผ++### ๆตช3 vs ๆตช1+- ๆๅธธ่ง๏ผ1.618 ร ๆตช1+- ๅ ถไป๏ผ1.0, 2.618 ร ๆตช1+- ๆตช3ๆฏๆๅ ทๆดปๅ็ไธๆตช++### ๆตช4 vs ๆตช3+- ๅธธ่งๅๆค๏ผ0.382+- ๅ ถไป๏ผ0.236, 0.5+- ๆตช4้ๅธธๆฏๆๆต ็ๅ่ฐ++### ๆตช5 vs ๆตช1+- ๆๅธธ่ง๏ผ็ญไบๆตช1้ฟๅบฆ+- ๅ ถไป๏ผ0.618, 1.618 ร ๆตช1+- ๆตช5ๅฏ่ฝ"ๅคฑ่ดฅ"๏ผไธ่ถ ่ฟๆตช3้ซ็น๏ผ++## ่ฐๆดๆตชๅ ณ็ณป++### Cๆตช vs Aๆตช+- ๆๅธธ่ง๏ผ็ญไบAๆตช้ฟๅบฆ+- ๅ ถไป๏ผ1.618 ร Aๆตช++### Bๆตชๅๆค+- ้ฏ้ฝฟๅฝข๏ผๅๆคAๆตช็0.382-0.618+- ๅนณๅฐๅฝข๏ผๅๆคAๆตช็0.786-1.0++## ๆฌๅผๆไฝฟ็จ็ๆฏ็++| ๅ ณ็ณป | ็ฎๆ ๅผ | ๅฎนๅทฎ |+|------|--------|------|+| ๆตช2/ๆตช1 | 0.5-0.618 | ยฑ15% |+| ๆตช3/ๆตช1 | 1.618 | ยฑ15% |+| ๆตช4/ๆตช3 | 0.382 | ยฑ15% |+| ๆตช5/ๆตช1 | 1.0 | ยฑ15% |diff --git "a/agent/src/skills/elliott-wave/references/\346\263\242\346\265\252\347\273\223\346\236\204.md" "b/agent/src/skills/elliott-wave/references/\346\263\242\346\265\252\347\273\223\346\236\204.md"new file mode 100644index 000000000..469ca8eb3--- /dev/null+++ "b/agent/src/skills/elliott-wave/references/\346\263\242\346\265\252\347\273\223\346\236\204.md"@@ -0,0 +1,53 @@+# ๆณขๆตช็ปๆ++## ๆจๅจๆตช (Impulse Wave)++5ๆตช็ปๆ๏ผ้กบ่ถๅฟๆนๅ๏ผ++```+ 5+ / \+ / \+ 3 / \+ / \/ \+/ 4 \+1+ \+ 2+```++### ไธๅคง้ๅพ๏ผไธๅฏ่ฟๅ๏ผ+1. **ๆตช2ไธ็ ดๆตช1่ตท็น**๏ผๆตช2็ๅๆคไธ่ฝ่ถ ่ฟๆตช1็่ตทๅงไฝ็ฝฎ+2. **ๆตช3ไธๆฏๆ็ญ**๏ผๆตช3ๅฟ ้กปๅคงไบๆตช1ๆๆตช5ไธญ่ณๅฐไธไธช+3. **ๆตช4ไธ่ฟๅ ฅๆตช1ๅบๅ**๏ผๆตช4็ไฝ็นไธ่ฝไฝไบๆตช1็้ซ็น++### ๅธธ่ง็นๅพ+- ๆตช1๏ผ่ถๅฟๅฏๅจ๏ผ้ๅธธ่พๅผฑ+- ๆตช2๏ผๆทฑๅบฆๅ่ฐ๏ผไฝไธ็ ดๆตช1่ตท็น+- ๆตช3๏ผๆๅผบๆ้ฟ็ๆตช๏ผ้ๅธธๆๆพ้+- ๆตช4๏ผๆต ๅบฆๅ่ฐ๏ผไธๆตช2ไบคๆฟ๏ผๅฆๆตช2ๆฅ่ท๏ผๆตช4ๆจช็๏ผ+- ๆตช5๏ผๆๅไธๆตช๏ผๅฏ่ฝๅบ็ฐ่็ฆป++## ่ฐๆดๆตช (Corrective Wave)++3ๆตช็ปๆ๏ผ้่ถๅฟๆนๅ๏ผ++```+A+ \+ \+ B+ /+ /+C+```++### ABC็ปๆ+- **Aๆตช**๏ผๅๅงๅ่ฐ๏ผๅธๅบไป็ๅฅฝ+- **Bๆตช**๏ผๅๅผน๏ผไฝๆ ๆณ็ช็ ดๅ้ซ+- **Cๆตช**๏ผๆ็ปไธ่ท๏ผ้ๅธธ็ญไบAๆตช้ฟๅบฆ++### ่ฐๆดๆตชๅไฝ+- ้ฏ้ฝฟๅฝข(Zigzag)๏ผ5-3-5๏ผๆๅธธ่ง+- ๅนณๅฐๅฝข(Flat)๏ผ3-3-5+- ไธ่งๅฝข(Triangle)๏ผ3-3-3-3-3diff --git a/agent/src/skills/etf-analysis/SKILL.md b/agent/src/skills/etf-analysis/SKILL.mdnew file mode 100644index 000000000..fcea74ec7--- /dev/null+++ b/agent/src/skills/etf-analysis/SKILL.md@@ -0,0 +1,869 @@+---+name: etf-analysis+description: "ETFๅๆ๏ผไบงๅ็ญ้ใ่ดน็ๅฏนๆฏใ่ท่ธช่ฏฏๅทฎใๆตๅจๆง่ฏไผฐใ็ญ็ฅๅบ็จไธไธญๅฝๅธๅบETF้ๅ้ ็ฝฎๆกๆถใ"+---++# ETF ๅๆ Skill++## ๅฎไฝ++ETF๏ผไบคๆๆไบคๆๅบ้๏ผๆฏ่ขซๅจๆ่ตไธ่ตไบง้ ็ฝฎ็ๆ ธๅฟๅทฅๅ ทใๆฌ skill ่ฆ็ ETF ไบงๅๅๆใ้ๆฉๆนๆณ่ฎบใ็ญ็ฅๅบ็จใไธญๅฝๅธๅบ็น่ฒไปฅๅๆฐๆฎ้ฉฑๅจ็้ๅๅๆๆนๆณ๏ผไธบๆๅปบๅบไบ ETF ็้ๅ็ญ็ฅไธ็ปๅๆไพๅฎๆดๆกๆถใ++---++## 1. ETF ไบงๅๅ็ฑป++### 1.1 ๆๆ ็่ตไบงๅ็ฑป++| ็ฑปๅ | ไปฃ่กจไบงๅ | ็น็น |+|------|---------|------|+| **ๅฎฝๅบ ETF** | ๆฒชๆทฑ300ETF (510300)ใไธญ่ฏ500ETF (510500)ใๅไธๆฟETF (159915)ใ็งๅ50ETF (588000) | ๆตๅจๆงๆๅฅฝ๏ผไบคๆๆๆฌๆไฝ๏ผ้ๅๆ ธๅฟไปไฝ |+| **่กไธ ETF** | ๆถ่ดนETF (159928)ใๅป็ETF (512170)ใๅๅฏผไฝETF (512480)ใ้ถ่กETF (512800) | ่กไธ่ฝฎๅจๅทฅๅ ท๏ผๆไป้ไธญๅบฆ้ซ |+| **ไธป้ข ETF** | ๆฐ่ฝๆบETF (516160)ใ็ขณไธญๅETFใๅ ๅฎๅฎETF | ไธป้ข็ไฝๅฑๆงๅผบ๏ผ็ๅฝๅจๆ็ญ |+| **็ญ็ฅETF / Smart Beta** | ็บขๅฉETF (510880)ใไฝๆณขETFใ่ดจ้ETFใๅจ้ETF | ๅ ๅญๆด้ฒๆ็กฎ๏ผ่ดน็้ๅธธ็ฅ้ซไบๅฎฝๅบ |+| **ๅๅ ETF** | ้ป้ETF (518880)ใ่ฑ็ฒETF (159985)ใๅๆฒนETF (162411) | ๅฎ็ฉ/ๆ่ดงๆฏๆ๏ผๆณจๆๅฑๆๆ่ |+| **ๅบๅธ ETF** | ๅฝๅบETF (511010)ใไฟก็จๅบETFใๅฏ่ฝฌๅบETF (511380) | ๅฉ็ๆๆ๏ผไน ๆ็ฎก็ๅ ณ้ฎ |+| **่ทจๅข ETF (QDII)** | ็บณๆETF (159632)ใๆ ๆฎ500ETF (513500)ใๆฅ็ป225ETF (513880) | ๆฑ็้ฃ้ฉ+ๆบขไปท้ฃ้ฉๅ้ๅ ๅ |+| **่ดงๅธ ETF** | ๅๅฎๆทป็ (511990)ใ้ถๅๆฅๅฉ (511880) | T+0 ็ณ่ต๏ผๆตๅจๆง็ฎก็ๅทฅๅ ท |++### 1.2 ็ปๆ็ฑปๅ++- **ๆฎ้ ETF**๏ผๅบๅ ไบคๆ๏ผๅฎ็ฉ็ณ่ต๏ผไธ็ฏฎๅญ่ก็ฅจๆข่ดญ๏ผ๏ผๆๆบขไปทๆๅฅๅฉๆบๅถ่ชๅจๆถๆ+- **LOF๏ผไธๅธๅผๆพๅผๅบ้๏ผ**๏ผๅบๅ ๅคๅๅฏไบคๆ๏ผๆๆบขไปทๅฅๅฉ่ทฏๅพ็ธๅไฝๆ็็ฅไฝ+- **ETF ่ๆฅๅบ้**๏ผๅบๅคๆธ ้่ดญไนฐ็ ETF ๆฟไปฃๅ๏ผT+1 ็ณ่ต๏ผๆ ๆๆบขไปท๏ผ้ๅๅฎๆ+- **ๆ ๆ/ๅๅ ETF**๏ผๆฅๅ ๆๅฎๆ ๆ๏ผ้ฟๆๆๆๆ่กฐๅๆๅบ๏ผ่ง็ฌฌ 3.4 ่๏ผ++---++## 2. ETF ๆ ธๅฟๆๆ ++### 2.1 ่ท่ธช่ฏฏๅทฎ๏ผTracking Error๏ผ++่กก้ ETF ๅคๅถๆๆฐ่ฝๅ็ๆๆ ธๅฟๆๆ ใ++```+ๆฅ่ท่ธช่ฏฏๅทฎ = std(ETFๆฅๆถ็็ - ๆๆฐๆฅๆถ็็)+ๅนดๅ่ท่ธช่ฏฏๅทฎ = ๆฅ่ท่ธช่ฏฏๅทฎ ร โ252+```++**่ฏ็บงๆ ๅ๏ผA่กๅฎฝๅบETF๏ผ**๏ผ+- ไผ็ง๏ผๅนดๅ่ท่ธช่ฏฏๅทฎ < 0.2%+- ๅๆ ผ๏ผ0.2% ~ 0.5%+- ่พๅทฎ๏ผ> 0.5%++**่ท่ธช่ฏฏๅทฎๆฅๆบ**๏ผ+1. ็ฎก็่ดนๅๆ็ฎก่ดน๏ผๆ็ปญๆ็ดฏ๏ผๆฏๆฅ่ฎกๆ๏ผ+2. ๅ็บขๅค็ๆถๆบ๏ผๅ็บขๅๆ่ตๅปถ่ฟ๏ผ+3. ๆๅ่ก็บณๅ ฅ/ๅ้คๆถ็ไนฐๅๅฒๅป+4. ็ฐ้ไปไฝ๏ผ็ณ่ตๅธฆๆฅ็ๆๆถๆง็ฐ้ๆ็ดฏ๏ผ+5. ๅ็่กๅค็๏ผ็จๆฟไปฃๅๆ็ฐ้ๆฟไปฃ๏ผ+6. ๆๆฐ็ผๅถๆนๆณ๏ผๅ จๅคๅถ vs ๆฝๆ ทๅคๅถ๏ผ++### 2.2 ไฟกๆฏๆฏ็๏ผInformation Ratio๏ผ++```+IR = (ETFๅนดๅๆถ็็ - ๆๆฐๅนดๅๆถ็็) / ๅนดๅ่ท่ธช่ฏฏๅทฎ+```++ๅฏน ETF ๆฅ่ฏด IR ้ๅธธไธบ่ด๏ผๅ ่ดน็ๆ็ดฏ๏ผ๏ผIR ่ถๆฅ่ฟ 0 ่ถๅฅฝใ++### 2.3 ๆๆบขไปท็++```+ๆๆบขไปท็ = (ETFๅธไปท - ETFๅๅผIOPV) / ETFๅๅผIOPV ร 100%+```++- **ๆญฃๆบขไปท**๏ผๅธไปท > ๅๅผ๏ผๅฅๅฉ่ ๅๅบ ETF / ็ณ่ดญไธ็ฏฎๅญ่ก็ฅจๆข่ดญ๏ผๆบขไปทๆถๆ+- **่ดๆไปท**๏ผๅธไปท < ๅๅผ๏ผๅฅๅฉ่ ไนฐๅ ฅ ETF / ่ตๅไธ็ฏฎๅญ่ก็ฅจ๏ผๆไปทๆถๆ+- **ๅผๅธธๆบขไปทๅบๆฏ**๏ผ่ทจๅข QDII ETF๏ผ้ขๅบฆ้ๅถๅฏผ่ดๆ็ปญๆบขไปท๏ผใๅ็่กๆฏไพ้ซ็่กไธ ETF++### 2.4 ๆตๅจๆงๆๆ ++| ๆๆ | ๅซไน | ๅ่้ๅผ |+|------|------|--------|+| ๆฅๅๆไบค้ข | ไนฐๅๆนไพฟ็จๅบฆ | ๅฎฝๅบ > 1ไบฟ๏ผ่กไธ > 2000ไธ |+| ไนฐๅไปทๅทฎ๏ผSpread๏ผ | ๅณๆถไบคๆๆๆฌ | < 0.05% ไธบไผ่ดจ |+| ็ๅฃๆทฑๅบฆ | ๅ็ฌๅคง้ขไบคๆๅฒๅป | ไนฐๅๅ5ๆกฃ็ดฏ่ฎก > 500ไธไธบไฝณ |+| ๆขๆ็ | ๆดป่ท็จๅบฆ | ่ฟไฝๅๆตๅจๆง้ฃ้ฉ้ซ |++### 2.5 ่ดน็ไฝ็ณป++```+็ปผๅ่ดน็ = ็ฎก็่ดน + ๆ็ฎก่ดน + ๆๆฐไฝฟ็จ่ดน+๏ผไธๅซไบคๆไฝฃ้ใๅฐ่ฑ็จใ็ณ่ต่ดน๏ผ+```++**้ฟๆ่ดน็ๅฝฑๅๅ ฌๅผ**๏ผ+```+Nๅนด่ดน็ๅคๅฉๆ่ = (1 - ๅนด่ดน็)^N+ไพ๏ผๅนด่ดน็0.5% vs 0.15%๏ผ10ๅนดๅทฎ่ท โ 3.5%๏ผ20ๅนดๅทฎ่ท โ 6.8%+```++ไธปๆตๅฎฝๅบ ETF ่ดน็ๅฏนๆฏ๏ผ2025ๅนด๏ผ๏ผ+- ๅๅค/ๆๆน่พพ/ๅๆน ๆฒชๆทฑ300ETF๏ผ0.15%๏ผ็ฎก็๏ผ+ 0.05%๏ผๆ็ฎก๏ผ= 0.20%+- ้จๅๅฐ่งๆจกๅฎฝๅบ๏ผ0.5%+๏ผ้ฟๆๆๆๅฃๅฟๆๆพ++### 2.6 ่งๆจกไธๆตๅจๆง่ฏไผฐ++- **่งๆจก้จๆง**๏ผ+ - < 2ไบฟ๏ผๆธ ็้ฃ้ฉ่พ้ซ๏ผๆตๅจๆงๅทฎ+ - 2~10ไบฟ๏ผๅฏๆญฃๅธธไบคๆ๏ผๅคง้ข่ต้ๅ้+ - > 10ไบฟ๏ผๆตๅจๆงๅ ่ถณ๏ผๅๅธๅๆดป่ท+ - > 100ไบฟ๏ผๆ่ฐ ETF๏ผๆบๆ้ฆ้++- **ๆธ ็้ฃ้ฉไฟกๅท**๏ผ่งๆจกๆ็ปญไธๆปใ่ฟ็ปญ90ๅคฉๆฅๅ่งๆจก < 5000ไธ++---++## 3. ETF ้ๆฉๆนๆณ่ฎบ++### 3.1 ๅ็ฑป ETF ๆฏ่พๆกๆถ++ๅไธๆๆฐๅพๅพๆๅคๅช ETF๏ผ้ๆฉๆญฅ้ชค๏ผ++```+Step 1: ่งๆจก็ญ้ โ ๅ้ค < 5ไบฟ็ๅฐ่งๆจกไบงๅ+Step 2: ่ดน็ๆฏ่พ โ ๅ็ญๆกไปถไธ้่ดน็ๆไฝ+Step 3: ่ท่ธช่ฏฏๅทฎ โ ่ฟ1ๅนด/่ฟ3ๅนดๅ็ปดๅบฆๆฏ่พ+Step 4: ๆตๅจๆง โ ๆฅๅๆไบค้ขใไนฐๅไปทๅทฎ+Step 5: ๅบ้ๅ ฌๅธ โ ๆๆฐๅๆ่ต่ฝๅใๅๅฒๅฃ็ข+```++**้ๅ่ฏๅๆจกๅ**๏ผ++```python+def etf_score(etf_data: dict) -> float:+ """+ ETF ็ปผๅ่ฏๅ๏ผ่ถ้ซ่ถๅฅฝ๏ผๆปกๅ100๏ผใ++ Args:+ etf_data: ๅ ๅซ scale, fee, tracking_error, avg_volume, spread ็ๅญๅ ธ++ Returns:+ ็ปผๅ่ฏๅ 0~100+ """+ score = 0.0+ # ่งๆจกๅพๅ๏ผ30ๅ๏ผ+ scale = etf_data['scale_billion']+ score += min(30, scale / 10 * 30)++ # ่ดน็ๅพๅ๏ผ25ๅ๏ผ๏ผ่ดน็่ถไฝ่ถ้ซๅ+ fee = etf_data['total_fee_pct'] # ๅนด่ดน็็พๅๆฏ+ score += max(0, 25 - fee * 50)++ # ่ท่ธช่ฏฏๅทฎๅพๅ๏ผ30ๅ๏ผ๏ผ่ฏฏๅทฎ่ถๅฐ่ถ้ซๅ+ te = etf_data['tracking_error_annual_pct']+ score += max(0, 30 - te * 60)++ # ๆตๅจๆงๅพๅ๏ผ15ๅ๏ผ+ vol = etf_data['avg_daily_volume_million']+ score += min(15, vol / 10 * 15)++ return round(score, 2)+```++### 3.2 ่ดน็ๅฝฑๅ้ฟๆๆถ็็้ๅๅๆ++```python+import numpy as np++def fee_drag_analysis(annual_return: float, years: int, fee_rates: list[float]) -> dict:+ """+ ๅๆไธๅ่ดน็ๅฏน้ฟๆๆถ็็ๆ็ดฏๆๆใ++ Args:+ annual_return: ๆๆฐๅนดๅๆถ็็๏ผๅฐๆฐ๏ผๅฆ0.08๏ผ+ years: ๆ่ตๅนด้+ fee_rates: ๅพ ๆฏ่พ็่ดน็ๅ่กจ๏ผๅฐๆฐ๏ผๅฆ[0.002, 0.005, 0.015]๏ผ++ Returns:+ ๅ่ดน็ไธ็็ปๅผๅๆฐๅ็ธๅฏนๆ็ดฏๅญๅ ธ+ """+ results = {}+ base_value = (1 + annual_return) ** years+ for fee in fee_rates:+ net_return = annual_return - fee+ end_value = (1 + net_return) ** years+ drag = (base_value - end_value) / base_value * 100+ results[f'{fee*100:.2f}%'] = {+ 'end_value_multiple': round(end_value, 4),+ 'drag_pct': round(drag, 2)+ }+ return results++# ็คบไพ๏ผ8% ๆๆฐๆถ็๏ผ20ๅนดๆ+# fee_drag_analysis(0.08, 20, [0.002, 0.005, 0.015])+```++### 3.3 ๅๅธๅ่ดจ้่ฏไผฐ++ไผ่ดจๅๅธๅไฝ็ฐๅจ๏ผ+- **ไปทๅทฎ็จณๅฎ**๏ผๆณขๅจๆไปทๅทฎๆฉๅคงๅน ๅบฆๅฐ๏ผ< 3ๅๆญฃๅธธๆฐดๅนณ๏ผ+- **ๆทฑๅบฆๅ ่ถณ**๏ผ็ๅฃๅๆกฃไฝ้้ขๅๅ+- **ๆฅไปท่ฟ็ปญๆง**๏ผไธ้ข็นๆคๅ้ๆฅ+- **ๅคงๅๅบๅฏน**๏ผๅคง้ขไบคๆๅไปทๅทฎๅฟซ้ๆขๅค++่ฏไผฐๆนๆณ๏ผ+```python+# ้่ฟLevel2ๆฐๆฎ่ฎก็ฎๆๆไปทๅทฎ+effective_spread = (ask_price - bid_price) / mid_price * 100 # ๅไฝ %++# ไปทๆ ผๅฒๅปๆๆฌ๏ผImpact Cost๏ผ+# ไนฐๅ ฅNไธๅ ๆ้ๅไปท็ธๅฏนไบไธญ้ดไปท็ๅ็ฆป+impact_cost = (avg_buy_price - mid_price) / mid_price * 100+```++### 3.4 ๅบ้ๅ ฌๅธๅฎๅ่ฏไผฐ++| ็ปดๅบฆ | ่ฏไผฐ่ฆ็น |+|------|---------|+| ETF ็ฎก็่งๆจก | ๅ จๅธๅบๆๅ๏ผๆๆฐๅๆ่ตไธไธๅบฆ |+| ่ท่ธช่ฏฏๅทฎๅๅฒ | ้ฟๆ็ปดๅบฆ๏ผ3ๅนด+๏ผ็จณๅฎๆง |+| ไบงๅ็บฟๅฎๆดๆง | ๅฎฝๅบใ่กไธใ่ทจๅข่ฆ็ๅนฟๅบฆ |+| ็ณ่ตๆ็ | T+0 ๅฎ็ฉ็ณ่ตๅค็่ฝๅ |+| ๅๅธๅๅไฝ่ดจ้ | ไธๅคด้จๅธๅๅๅธๅ็ๅไฝ็จณๅฎๆง |++ๅฝๅ ETF ็ฎก็ๅคด้จๅ ฌๅธ๏ผ่งๆจกๅฃๅพ๏ผ๏ผๅๅคใๆๆน่พพใๅๆณฐๆ็ใๅๆนใๅๅฎใๅๆถ++---++## 4. ETF ็ญ็ฅๅบ็จ++### 4.1 ๆ ธๅฟ-ๅซๆ็ญ็ฅ๏ผCore-Satellite๏ผ++```+ๆป็ปๅ = ๆ ธๅฟไปไฝ๏ผ70~80%๏ผ+ ๅซๆไปไฝ๏ผ20~30%๏ผ++ๆ ธๅฟไปไฝ๏ผๅฎฝๅบETF๏ผๆฒชๆทฑ300/ไธญ่ฏ500/ๅ จA๏ผ+ โ ่ทๅๅธๅบbeta๏ผไฝ่ดน็๏ผ้ฟๆๆๆ๏ผๅๅฐไบคๆๆฉๆฆ++ๅซๆไปไฝ๏ผ่กไธETF/ไธป้ขETF/Smart Beta ETF+ โ ๅขๅผบๆถ็๏ผไธปๅจๆด้ฒ็นๅฎๅ ๅญ๏ผๅ ่ฎธๆด้ซๆขๆ+```++**ๅๅนณ่กก่งฆๅๆกไปถ**๏ผ+- ๆถ้ด่งฆๅ๏ผๆฏๅญฃๅบฆ/ๆฏๅๅนด+- ๅ็ฆป่งฆๅ๏ผๅไธ่ตไบงๅ็ฆป็ฎๆ ๆ้ > 5%++### 4.2 ่กไธ่ฝฎๅจ ETF ็ญ็ฅ++**ๅจ้่ฝฎๅจ**๏ผ+```python+def sector_momentum_rotation(etf_returns: pd.DataFrame, lookback: int = 20, top_n: int = 3) -> list[str]:+ """+ ๅบไบๅจ้็่กไธETF่ฝฎๅจ้ๆฉใ++ Args:+ etf_returns: ๅ่กไธETFๆฅๆถ็็ DataFrame๏ผๅไธบETFไปฃ็ + lookback: ๅ็็ชๅฃ๏ผไบคๆๆฅๆฐ๏ผ+ top_n: ๆๆETFๆฐ้++ Returns:+ ๆฌๆๆๆ็ETFไปฃ็ ๅ่กจ+ """+ momentum = etf_returns.tail(lookback).sum()+ selected = momentum.nlargest(top_n).index.tolist()+ return selected+```++**ๅฎ่งๅจๆ่ฝฎๅจ**๏ผ+| ็ปๆตๅจๆ | ๆจ่่กไธ ETF |+|---------|------------|+| ๅค่ๆ๏ผไฝๅข้ฟโ้ซๅข้ฟ๏ผไฝ้่๏ผ | ๆถ่ดนใ็งๆใไธญๅฐ็ |+| ่ฟ็ญๆ๏ผ้ซๅข้ฟ๏ผ้ซ้่๏ผ | ่ฝๆบใๆๆใๅทฅไธ |+| ๆป่ๆ๏ผไฝๅข้ฟ๏ผ้ซ้่๏ผ | ่ฝๆบใๅ ฌ็จไบไธใๆถ่ดน |+| ่กฐ้ๆ๏ผ้ซๅข้ฟโไฝๅข้ฟ๏ผ | ๅป็ใๅ ฌ็จไบไธใๅบๅธETF |++### 4.3 Smart Beta ETF ๅ ๅญๆด้ฒๅๆ++ไธป่ฆๅ ๅญๅๅฏนๅบETF๏ผ++| ๅ ๅญ | ไปฃ่กจETF | ๅๅฒๆๆๆง๏ผA่ก๏ผ |+|------|--------|--------------|+| ไปทๅผ๏ผไฝไผฐๅผ๏ผ | ๆฒชๆทฑ300ไปทๅผETF | ไธญ็ญ๏ผๅ้ฃๆ ผๅๆขๅฝฑๅ |+| ็บขๅฉ๏ผ้ซ่กๆฏ๏ผ | ็บขๅฉETF (510880) | ่พๅผบ๏ผๅฐคๅ ถ็ๅธ้ฒๅพก |+| ไฝๆณขๅจ | ไธญ่ฏไฝๆณขETF | ่พๅผบ๏ผๅคๆฎๆฏไผไบๅฎฝๅบ |+| ่ดจ้๏ผ้ซROE๏ผ | ไธญ่ฏ่ดจ้ETF | ่พๅผบ๏ผ้ฟๆๅคๅๆๆๅฅฝ |+| ๅจ้ | ็ฎๅA่กไบงๅๅฐ | ไธญ็ญๆๆๆ๏ผ้ฟๆๅๅผๅๅฝ |+| ๅฐ็ | ไธญ่ฏ1000ETF (512100) | ๅผบ๏ผไฝๆตๅจๆง้ฃ้ฉ้ซ |++**ๅ ๅญๆด้ฒๅๆไปฃ็ **๏ผ+```python+import pandas as pd+import numpy as np+from scipy import stats++def factor_exposure_analysis(etf_returns: pd.Series, factor_returns: dict[str, pd.Series]) -> pd.DataFrame:+ """+ ๅๆETFๅฏนๅๅ ๅญ็ๆด้ฒ็จๅบฆ๏ผๅๅ ๅญๅๅฝ๏ผใ++ Args:+ etf_returns: ETFๆฅๆถ็็ๅบๅ+ factor_returns: ๅๅ ๅญๆถ็็ๅญๅ ธ {ๅ ๅญๅ: ๆถ็็ๅบๅ}++ Returns:+ ๅ ๅซ beta, t_stat, r_squared ็ DataFrame+ """+ results = []+ for factor_name, factor_ret in factor_returns.items():+ aligned = pd.concat([etf_returns, factor_ret], axis=1).dropna()+ x = aligned.iloc[:, 1].values+ y = aligned.iloc[:, 0].values+ slope, intercept, r_value, p_value, std_err = stats.linregress(x, y)+ results.append({+ 'factor': factor_name,+ 'beta': round(slope, 4),+ 't_stat': round(slope / std_err, 2),+ 'r_squared': round(r_value ** 2, 4),+ 'p_value': round(p_value, 4)+ })+ return pd.DataFrame(results).set_index('factor')+```++### 4.4 ๆ ๆ/ๅๅ ETF ็่กฐๅๆๅบ++**Beta ่กฐๅ๏ผVolatility Decay๏ผๅ็**๏ผ++```+ๆฏๆฅๆๅฎๆ ๆ N ๅ โ ๅคๅๆๅบๅฏผ่ด้ฟๆๆถ็ โ N ร ๆๆฐๆถ็++่กฐๅ้๏ผ่ฟไผผ๏ผ= Nยฒ(N-1)/2 ร ฯยฒ ร T+ๅ ถไธญ ฯ ไธบๆๆฐๆฅๆณขๅจ็๏ผT ไธบๆๆๅคฉๆฐ+```++**ๆฐๅผ็คบไพ**๏ผ+- ๆๆฐๅนดๅๆณขๅจ็ 20%๏ผๆฅๆณขๅจ็ โ 1.26%+- 2ๅๆ ๆETF๏ผๆๆ1ๅนด๏ผ่กฐๅๆ่ โ 2ยฒ ร (2-1)/2 ร (0.2)ยฒ ร 1 โ 4%++**้็จๅบๆฏ**๏ผ+- ๆ ๆETF๏ผๅผบ่ถๅฟ่กๆ ไธญ็็ญๆๅทฅๅ ท๏ผๆๆ < 1ไธชๆ๏ผ+- ๅๅETF๏ผๅธๅบๅฏนๅฒใ็ญๆไธ่ทๆผๆณจ๏ผไธ้ๅ้ฟๆๆๆ๏ผ+- **ไธฅ็ฆ**๏ผ็จๆ ๆ/ๅๅETFๅ้ฟๆ้ ็ฝฎไปไฝ++### 4.5 ETF ๅฅๅฉ็ญ็ฅ++**ๆๆบขไปทๅฅๅฉ**๏ผ้่ฆๆๅฎ็ฉ็ณ่ต่ตๆ ผ๏ผ้ๅธธ้จๆง100ไธไปฝ๏ผ๏ผ++```+ๆบขไปทๅฅๅฉ๏ผ+ ETFๅธไปท > IOPV + ไบคๆๆๆฌ+ โ ไนฐๅ ฅไธ็ฏฎๅญๆๅ่ก โ ็ณ่ดญETFไปฝ้ข โ ๅๅบETF+ โ ๅฅๅฉๅฉๆถฆ โ ๆบขไปท็ - ๅฒๅปๆๆฌ - ไฝฃ้++ๆไปทๅฅๅฉ๏ผ+ ETFๅธไปท < IOPV - ไบคๆๆๆฌ+ โ ไนฐๅ ฅETFไปฝ้ข โ ่ตๅไธ็ฏฎๅญๆๅ่ก โ ๅๅบๆๅ่ก+ โ ๅฅๅฉๅฉๆถฆ โ ๆไปท็ - ๅฒๅปๆๆฌ - ไฝฃ้+```++**่ทจๅธๅบๅฅๅฉ๏ผETF vs ๆ่ดง๏ผ**๏ผ+```+IF๏ผๆฒชๆทฑ300่กๆๆ่ดง๏ผๅบๅทฎ = ๆ่ดงไปทๆ ผ - ๆฒชๆทฑ300ๆๆฐ+ๅฝๅบๅทฎ > ๅ็ๅบๅทฎ๏ผๆ ้ฃ้ฉๅฉ็รๅฉไฝๆ้๏ผๆถ๏ผ+ โ ๅๆ่ดง + ไนฐETF๏ผๆญฃๅๅฅๅฉ๏ผ+ๅฝๅบๅทฎ < ๅ็ๅบๅทฎๆถ๏ผ+ โ ไนฐๆ่ดง + ๅETF๏ผๅๅๅฅๅฉ๏ผ้่ๅธ๏ผ+```++**็ป่ฎกๅฅๅฉ๏ผ้ ๅฏนไบคๆ๏ผ**๏ผ+```python+# ๅ็ฑปETF๏ผๅฆไธๅๅ ฌๅธๅ่ก็ๆฒชๆทฑ300ETF๏ผไน้ด็ไปทๅทฎๅๅผๅๅฝ+# ไปทๅทฎ = ไปทๆ ผๅทฎ ๆ ไปทๆ ผๆฏ+# ๅฝไปทๅทฎๅ็ฆปๅๅฒๅๅผ2ไธชๆ ๅๅทฎๆถๅปบไป๏ผๅๅฝๆถๅนณไป+spread = etf_a_price / etf_b_price+z_score = (spread - spread.rolling(60).mean()) / spread.rolling(60).std()+signal = pd.Series(0, index=z_score.index)+signal[z_score > 2] = -1 # ETF_A ็ธๅฏน่ดต๏ผๅAไนฐB+signal[z_score < -2] = 1 # ETF_A ็ธๅฏนไพฟๅฎ๏ผไนฐAๅB+```++---++## 5. ไธญๅฝ ETF ๅธๅบ็น่ฒ++### 5.1 ๅบๅ ETF vs ๅบๅค่ๆฅๅบ้++| ็ปดๅบฆ | ๅบๅ ETF | ๅบๅค่ๆฅๅบ้ |+|------|---------|-----------|+| ่ดญไนฐๆธ ้ | ่ฏๅธ่ดฆๆท๏ผๅฎๆถไบคๆ | ้ถ่ก/ๅบ้็ด้๏ผT+1็ณ่ต |+| ็ณ่ตๆนๅผ | ๅฎ็ฉ็ณ่ต๏ผๆบๆ๏ผๆไบ็บงๅธๅบ๏ผไธชไบบ๏ผ | ็ฐ้็ณ่ต |+| ๆๆบขไปท | ๅญๅจ๏ผๆๅฅๅฉๆบๅถ๏ผ | ไธๅญๅจ |+| ๆๅฐไบคๆๅไฝ | 100ไปฝ๏ผ็บฆ10~100ๅ ๏ผ | 1ๅ ่ตทๆ |+| ่ดน็ | ่พไฝ๏ผ็ฎก็่ดน+ไบคๆไฝฃ้๏ผ | ็ฅ้ซ๏ผ็ณ่ดญ่ดน+็ฎก็่ดน๏ผ |+| ้ๅๅบๆฏ | ๆณขๆฎตๆไฝใๅคง้ข้ ็ฝฎ | ๅฎๆใๅฐ้ข้ฟๆๆๆ |++### 5.2 ่ทจๅข ETF๏ผQDII๏ผ็นๆฎ่้++**ๆบขไปทๅฝขๆๅๅ **๏ผ+- QDII ้ขๅบฆ้ๅถ๏ผๅบ้ๅ ฌๅธ QDII ้ขๅบฆ็จๅฎๅๆๅ็ณ่ดญ๏ผๅฅๅฉๆบๅถๅคฑๆ+- ๆฑ็ๅฝฑๅ๏ผไบบๆฐๅธ่ดฌๅผๆถ๏ผๆๆๅขๅค่ตไบง็ ETF ๅๅผไธๅ๏ผๅผๅ่ฟฝๆถจ+- ๆถๅทฎๅฝฑๅ๏ผA ่กๆถ็ๆถๆตทๅคๅธๅบๅฐๆชๅผ็๏ผIOPV ๅ่ไปทๆปๅ++**ๆบขไปท็่ญฆๆ็บฟ**๏ผ+- < 2%๏ผๆญฃๅธธ่ๅด๏ผๅฏๆญฃๅธธ้ ็ฝฎ+- 2%~5%๏ผๆบขไปทๆๆพ๏ผๅ ฅๅบ้่ฐจๆ ๏ผ็ญๅพ ๅ่ฝ+- > 5%๏ผ้ซๆบขไปท๏ผๅญๅจๆพ่ไนฐๅ ฅ้ฃ้ฉ๏ผๅๅผๅ่ฝไฝๆบขไปทๆถ็ชๅๆ๏ผ++**ๆฑ็ๅฏนๅฒ**๏ผ+- ้จๅ QDII ETF ๆไพๅฏนๅฒ็ๆฌ๏ผๅฆๆ ๆฎ500ๅฏนๅฒETF๏ผ+- ๅฏนๅฒๆๆฌ โ ไธญ็พๅฉๅทฎ๏ผ2025ๅนด็บฆ1.5~2.5%/ๅนด๏ผ๏ผๆพ่้ไฝๆถ็++### 5.3 LOF ไธๅ็บงๅบ้ๅๅฒ็ป้ช++**LOF๏ผไธๅธๅผๆพๅผๅบ้๏ผ**๏ผ+- ๅบๅ ๅคๅๅฏไบคๆ๏ผๆไปทๅฅๅฉ่ทฏๅพ๏ผๅบๅ ๆไปทไนฐๅ ฅ โ ่ฝฌๆ็ฎก โ ๅบๅค่ตๅ+- ่ฝฌๆ็ฎกๆถ้ด T+2~T+3๏ผๅญๅจๅๅผๅๅจ้ฃ้ฉ++**ๅ็บงๅบ้๏ผๅทฒๅ จ้ข่ฝฌๅ๏ผ2020ๅนดๅๅๅฒๅ่๏ผ**๏ผ+- A ไปฝ้ข๏ผ็บฆๅฎๆถ็ๅ๏ผ็ฑปไผผๅบๅธ+- B ไปฝ้ข๏ผๆ ๆๅ๏ผไธA็บฆๅฎๆถ็ๆ้ฉ+- ้่ฆๆ่ฎญ๏ผไธๆๆบๅถๅฏผ่ดBไปฝ้ขๅคงๅน ไบๆ๏ผ้ซๆบขไปทๅฅๅฉ่ขซ่ฝง็ฉบ+- ็ฐ็ถ๏ผ็็ฎก่ฆๆฑๅ จ้จ่ฝฌๅไธบๆฎ้ETF๏ผไธๅๆๆฐๅ++### 5.4 ไธญๅฝไธป่ฆ ETF ๆๆฐไฝ็ณป++**ๅฎฝๅบๆๆฐ**๏ผ++| ๆๆฐ | ๆๅ่ก | ็น็น |+|------|-------|------|+| ๆฒชๆทฑ300 | ๆฒชๆทฑไธคๅธๅธๅผๆๅคง300ๅช | ๅคง็่็ญน๏ผ่ก็ๅไธฐๅฏ๏ผIFๆ่ดง/300ๆๆ๏ผ |+| ไธญ่ฏ500 | 300~800ๅไธญ็่ก | ไธญ็ๆ้ฟ๏ผไธ300ไบ่กฅ |+| ไธญ่ฏ1000 | 800~1800ๅๅฐ็่ก | ๅฐ็ๅ ๅญ๏ผๆณขๅจ่พๅคง |+| ไธ่ฏ50 | ๆฒชๅธๆๅคง50ๅช | ่ถ ๅคง็๏ผ้่ๅฐไบงๆ้้ซ |+| ๅไธๆฟๆ | ๅไธๆฟๅ100ๅ | ็งๆๆ้ฟ๏ผๆณขๅจๅคง |+| ็งๅ50 | ็งๅๆฟๅ50ๅ | ็กฌ็งๆ๏ผไธๅธๆถ้ด็ญ |+| ๅ่ฏ50 | ๅไบคๆๅ50ๅ | ๆฐๅ ดๅธๅบ๏ผๆตๅจๆงๅผฑ |+| ไธญ่ฏๅ จๆ / ไธๅพๅ จA | ๅ จๅธๅบ | ๆๅฎฝๆณ็ๅบๅ |++**ๆๆฐ่ฐๆด่งๅพ**๏ผ+- ๆฒชๆทฑ300/ไธญ่ฏ500๏ผๆฏๅนด6ๆๅ12ๆ่ฐๆดไธๆฌก+- ่ฐๆดๅๅ๏ผ็บณๅ ฅ่ก็ฅจๆถจใๅ้ค่ก็ฅจ่ท๏ผ็ญๆ๏ผ๏ผๆไพไบไปถ้ฉฑๅจๆบไผ++---++## 6. ETF ็ปๅๆๅปบ++### 6.1 ๅบไบ ETF ็่ตไบง้ ็ฝฎๅฎ็ฐ++**็ปๅ ธ้ ็ฝฎๆกๆถ๏ผๅฏ็จETFๅฎ็ฐ๏ผ**๏ผ++```+่กๅบ 60/40 ไธญๅฝ็๏ผ+ ๆฒชๆทฑ300ETF 30% + ไธญ่ฏ500ETF 20% + ไธญๅบETF 40% + ้ป้ETF 10%++ๅ จๅคฉๅ็ปๅ๏ผไธญๅฝ็๏ผ๏ผ+ ่ก็ฅจETF๏ผๆฒชๆทฑ300๏ผ25%+ ้ฟๆๅฝๅบETF 40%+ ไธญๆๅฝๅบETF 15%+ ้ป้ETF 7.5%+ ๅๅETF 12.5%++ๅ้็ญ็ฅ๏ผ+ ๅฎฝๅบETF๏ผไฝ้ฃ้ฉๆ ธๅฟ๏ผ50%+ ่กไธ/ไธป้ขETF๏ผ้ซๅผนๆง่ฟๆป๏ผ50%+```++### 6.2 ๅ จ็ๅ้ ็ฝฎ็ ETF ๅทฅๅ ท้ๆฉ++```+A่ก๏ผๆฒชๆทฑ300ETF 510300 / ไธญ่ฏ500ETF 510500+็พ่ก๏ผ็บณๆETF 159632 / ๆ ๆฎ500ETF 513500+ๆธฏ่ก๏ผๆ็ETF 159920 / ๆ็็งๆETF 513130+ๆฌงๆดฒ๏ผๅพทๅฝDAX ETF / ๆฌงๆดฒ50ETF๏ผ่งๆจก่พๅฐ๏ผ+ๆฅๆฌ๏ผๆฅ็ป225ETF 513880 / ไธ่ฏETF+ๆฐๅ ด๏ผ่ถๅETF / ๅฐๅบฆETF๏ผ้จๅๆQDIIๆบขไปท๏ผ++ๅบๅฎๆถ็๏ผ+ ๅฝๅ ๏ผๅฝๅบETF 511010 / ๆฟ้ๅบETF+ ็พๅฝ๏ผ็พๅบETF๏ผQDII๏ผ++ๅๅ๏ผ+ ้ป้ETF 518880+ ๅๆฒนETF 162411+ CRBๅๅๆๆฐETF๏ผๅฝๅ ่พๅฐ๏ผ+```++### 6.3 ๅๅนณ่กก้ข็ไธไบคๆๆๆฌๆ่กก++**ๅๅนณ่กกๆๆฌ**๏ผ+```+ๅๆฌกๅๅนณ่กกๆๆฌ โ ไบคๆ้้ข ร (ไฝฃ้็ + ไปทๅทฎ/2 + ๅฒๅปๆๆฌ)+โ ไบคๆ้้ข ร 0.05%~0.15%๏ผๅฎฝๅบETF๏ผ++ๅนดๅๅๅนณ่กกๆๆฌ = ๅๆฌกๆๆฌ ร ๅนดๅ่ฐไปๆฌกๆฐ+```++**ๆไผๅๅนณ่กก้ข็ๅปบ่ฎฎ**๏ผ+- ็บฏ่ขซๅจ้ ็ฝฎ๏ผๆณขๅจไฝ๏ผ๏ผๆฏๅนด2ๆฌก๏ผ6ๆ/12ๆ๏ผ+- ่กไธ่ฝฎๅจ๏ผๆณขๅจ้ซ๏ผ๏ผๆฏๆๆๆฏๅญฃๅบฆ+- ้ๅผ่งฆๅๆณ๏ผๅ็ฆป็ฎๆ ๆ้ > 5% ๆถ่งฆๅ๏ผ้ๅธธไผไบๅบๅฎ้ข็++**ๅ ไฝฃ้ๅๅนณ่กกๆๅทง**๏ผ+- ๅฉ็จๆฐๅข่ต้ๅฎๅ่กฅไปๅไฝไปไฝ๏ผๅๅฐๅๅบๆไฝ+- ๅ็บขๆถ็ไผๅ ้ ็ฝฎๅฐไฝ้ ่ตไบง++### 6.4 ็จๅกๆ็่้++ไธญๅฝ ETF ็จๅก่งๅ๏ผ+- **ไธชไบบๆ่ต่ **๏ผ+ - ่ก็ฅจๅETF่ตๆฌๅฉๅพๅ ็จ๏ผๆๆๆ้ด๏ผ+ - ETFๅ็บข๏ผ็ฐ้ๅ็บขๅ ็จ๏ผ็บขๅฉๅๆ่ตไธ่ฎก็จ+ - ่ดงๅธETFๅฉๆฏๆถๅ ฅ๏ผๆๅ ไธชไบบๆๅพ็จ+- **ๆบๆๆ่ต่ **๏ผ+ - ่ตๆฌๅฉๅพ้่ฎกๅ ฅไผไธๆๅพ็จ๏ผ25%๏ผ+ - ๆ่กๆ้ดๅ็บข๏ผๆ่ก > 12ไธชๆๅ ็จ++**็จๅกๆ็็ญ็ฅ**๏ผ+- ้ซๆขๆ็่กไธ่ฝฎๅจ็ญ็ฅๅฐฝ้ๆพๅจไธชไบบ่ดฆๆท๏ผๅฉ็จ่ตๆฌๅฉๅพๅ ็จ๏ผ+- ๅฎๆๅฎ้ข้ฟๆๆๆ๏ผๅๅฐ็ญๆ่ตๆฌๅฉๅพๅฎ็ฐ้ข็++---++## 7. ๆฐๆฎๅๆๆนๆณ++### 7.1 ็จ Tushare ่ทๅ ETF ๆฐๆฎ++```python+import tushare as ts+import pandas as pd++def get_etf_list(pro: ts.pro_api) -> pd.DataFrame:+ """+ ่ทๅๅ จๅธๅบETFๅ่กจใ++ Args:+ pro: tushare pro_api ๅฎไพ++ Returns:+ ETFๅบๆฌไฟกๆฏ DataFrame+ """+ df = pro.fund_basic(market='E', status='L') # E=ETF, L=ไธๅธไธญ+ return df[['ts_code', 'name', 'management', 'found_date', 'issue_date']]+++def get_etf_nav(pro: ts.pro_api, ts_code: str, start_date: str, end_date: str) -> pd.DataFrame:+ """+ ่ทๅETFๅๅผๆฐๆฎ๏ผIOPV๏ผใ++ Args:+ pro: tushare pro_api ๅฎไพ+ ts_code: ETFไปฃ็ ๏ผๅฆ '510300.SH'+ start_date: ๅผๅงๆฅๆ 'YYYYMMDD'+ end_date: ็ปๆๆฅๆ 'YYYYMMDD'++ Returns:+ ๅ ๅซ trade_date, nav, accum_nav ็ DataFrame+ """+ df = pro.fund_nav(ts_code=ts_code, start_date=start_date, end_date=end_date)+ return df.sort_values('end_date').reset_index(drop=True)+++def get_etf_daily(pro: ts.pro_api, ts_code: str, start_date: str, end_date: str) -> pd.DataFrame:+ """+ ่ทๅETFๅบๅ ๆฅ่กๆ ๏ผๅธไปท๏ผใ++ Args:+ pro: tushare pro_api ๅฎไพ+ ts_code: ETFไปฃ็ + start_date: ๅผๅงๆฅๆ+ end_date: ็ปๆๆฅๆ++ Returns:+ ๅ ๅซ trade_date, open, high, low, close, vol, amount ็ DataFrame+ """+ df = pro.fund_daily(ts_code=ts_code, start_date=start_date, end_date=end_date)+ return df.sort_values('trade_date').reset_index(drop=True)+++def get_index_daily(pro: ts.pro_api, index_code: str, start_date: str, end_date: str) -> pd.DataFrame:+ """+ ่ทๅๅบๅๆๆฐๆฅ่กๆ ๏ผ็จไบ่ฎก็ฎ่ท่ธช่ฏฏๅทฎ๏ผใ++ Args:+ pro: tushare pro_api ๅฎไพ+ index_code: ๆๆฐไปฃ็ ๏ผๅฆ '000300.SH'๏ผๆฒชๆทฑ300๏ผ+ start_date: ๅผๅงๆฅๆ+ end_date: ็ปๆๆฅๆ++ Returns:+ ๅ ๅซ trade_date, close ็ DataFrame+ """+ df = pro.index_daily(ts_code=index_code, start_date=start_date, end_date=end_date)+ return df[['trade_date', 'close', 'pct_chg']].sort_values('trade_date').reset_index(drop=True)+```++### 7.2 ่ท่ธช่ฏฏๅทฎ่ฎก็ฎไปฃ็ ๆจกๆฟ++```python+import numpy as np+import pandas as pd+++def calc_tracking_error(+ etf_prices: pd.Series,+ index_prices: pd.Series,+ annualize: bool = True+) -> dict:+ """+ ่ฎก็ฎETFๅฏนๆ ็ๆๆฐ็่ท่ธช่ฏฏๅทฎใ++ Args:+ etf_prices: ETFๅๅผๅบๅ๏ผไปฅdateไธบ็ดขๅผ๏ผ+ index_prices: ๆๆฐไปทๆ ผๅบๅ๏ผไปฅdateไธบ็ดขๅผ๏ผ+ annualize: ๆฏๅฆๅนดๅ๏ผ้ป่ฎคTrue++ Returns:+ ๅ ๅซ tracking_error, avg_daily_diff, max_daily_diff ็ๅญๅ ธ+ """+ # ๅฏน้ฝๆฐๆฎ+ aligned = pd.concat([etf_prices, index_prices], axis=1).dropna()+ aligned.columns = ['etf', 'index']++ # ่ฎก็ฎๆฅๆถ็็ๅทฎๅผ+ etf_ret = aligned['etf'].pct_change().dropna()+ idx_ret = aligned['index'].pct_change().dropna()+ daily_diff = etf_ret - idx_ret++ # ่ท่ธช่ฏฏๅทฎ = ๅทฎๅผ็ๆ ๅๅทฎ+ te_daily = daily_diff.std()+ te = te_daily * np.sqrt(252) if annualize else te_daily++ return {+ 'tracking_error': round(te * 100, 4), # ็พๅๆฏ+ 'avg_daily_diff': round(daily_diff.mean() * 100, 4), # ๅนณๅๆฅๅๅทฎ %+ 'max_daily_diff': round(daily_diff.abs().max() * 100, 4), # ๆๅคงๅๆฅๅๅทฎ %+ 'annualized': annualize+ }+++def compare_etfs_same_index(+ etf_codes: list[str],+ index_code: str,+ pro,+ start_date: str,+ end_date: str+) -> pd.DataFrame:+ """+ ๆฏ่พ่ฟฝ่ธชๅไธๆๆฐ็ๅคๅชETF็่ท่ธช่กจ็ฐใ++ Args:+ etf_codes: ETFไปฃ็ ๅ่กจ+ index_code: ๅบๅๆๆฐไปฃ็ + pro: tushare pro_api ๅฎไพ+ start_date: ๅผๅงๆฅๆ+ end_date: ็ปๆๆฅๆ++ Returns:+ ๅETF็่ท่ธช่ฏฏๅทฎๆฏ่พ DataFrame+ """+ index_df = get_index_daily(pro, index_code, start_date, end_date)+ index_prices = index_df.set_index('trade_date')['close']++ results = []+ for code in etf_codes:+ nav_df = get_etf_nav(pro, code, start_date, end_date)+ etf_prices = nav_df.set_index('end_date')['nav']+ te_result = calc_tracking_error(etf_prices, index_prices)+ te_result['ts_code'] = code+ results.append(te_result)++ return pd.DataFrame(results).set_index('ts_code').sort_values('tracking_error')+```++### 7.3 ๆๆบขไปท็็ๆง++```python+def calc_premium_discount(+ market_price: float,+ iopv: float+) -> dict:+ """+ ่ฎก็ฎETFๆๆบขไปท็ๅๅฅๅฉไฟกๅทใ++ Args:+ market_price: ETFๅบๅ ๅธไปท+ iopv: ๅฎๆถๅๅผ๏ผIOPV๏ผ++ Returns:+ ๅ ๅซ premium_pct, signal, arbitrage_feasible ็ๅญๅ ธ+ """+ premium_pct = (market_price - iopv) / iopv * 100++ if premium_pct > 0.3:+ signal = 'PREMIUM_HIGH' # ๆบขไปท๏ผๅๅบETFๆ็ณ่ดญๅฅๅฉ+ feasible = premium_pct > 0.5 # ๆฃ้คๆๆฌๅๆฏๅฆๅฏๅฅๅฉ+ elif premium_pct < -0.3:+ signal = 'DISCOUNT_HIGH' # ๆไปท๏ผไนฐๅ ฅETFๆ่ตๅๅฅๅฉ+ feasible = premium_pct < -0.5+ else:+ signal = 'NORMAL'+ feasible = False++ return {+ 'premium_pct': round(premium_pct, 4),+ 'signal': signal,+ 'arbitrage_feasible': feasible+ }+++def monitor_qdii_premium(pro, qdii_codes: list[str], date: str) -> pd.DataFrame:+ """+ ็ๆงQDII ETFๆบขไปท็๏ผๆบขไปท่ฟ้ซๆถๅๅบ้ข่ญฆ๏ผใ++ Args:+ pro: tushare pro_api ๅฎไพ+ qdii_codes: QDII ETFไปฃ็ ๅ่กจ+ date: ๆฅ่ฏขๆฅๆ 'YYYYMMDD'++ Returns:+ ๅQDII ETF็ๆบขไปท็ๅ้ฃ้ฉ็ญ็บง DataFrame+ """+ results = []+ for code in qdii_codes:+ # ่ทๅๅธไปท+ price_df = pro.fund_daily(ts_code=code, trade_date=date)+ # ่ทๅๅๅผ+ nav_df = pro.fund_nav(ts_code=code, end_date=date)++ if not price_df.empty and not nav_df.empty:+ market_price = price_df.iloc[0]['close']+ nav = nav_df.iloc[0]['nav']+ premium_pct = (market_price - nav) / nav * 100+ risk_level = (+ 'HIGH' if premium_pct > 5+ else 'MEDIUM' if premium_pct > 2+ else 'LOW'+ )+ results.append({+ 'ts_code': code,+ 'market_price': market_price,+ 'nav': nav,+ 'premium_pct': round(premium_pct, 2),+ 'risk_level': risk_level+ })++ return pd.DataFrame(results).sort_values('premium_pct', ascending=False)+```++### 7.4 ่ต้ๆตๅ ฅๆตๅบๅๆ++```python+def etf_fund_flow_analysis(+ pro,+ ts_code: str,+ start_date: str,+ end_date: str+) -> pd.DataFrame:+ """+ ๅๆETF่งๆจกๅๅไธ่ต้ๅๆตๅ ฅ/ๆตๅบใ++ Args:+ pro: tushare pro_api ๅฎไพ+ ts_code: ETFไปฃ็ + start_date: ๅผๅงๆฅๆ+ end_date: ็ปๆๆฅๆ++ Returns:+ ๅ ๅซ่งๆจกๅๅๅ่ต้ๆตๅไผฐ็ฎ็ DataFrame+ """+ nav_df = get_etf_nav(pro, ts_code, start_date, end_date)+ nav_df['end_date'] = pd.to_datetime(nav_df['end_date'])+ nav_df = nav_df.sort_values('end_date')++ # ่งๆจก๏ผๅไฝไบฟๅ ๏ผ+ nav_df['scale'] = nav_df['unit_nav'] * nav_df['fund_share'] / 1e8++ # ๅๅผๅๅจๅผ่ตท็่งๆจกๅๅ๏ผ่ขซๅจ๏ผ+ nav_df['nav_return'] = nav_df['unit_nav'].pct_change()+ nav_df['passive_change'] = nav_df['scale'].shift(1) * nav_df['nav_return']++ # ่ต้ๅๆตๅ ฅ โ ่งๆจกๅๅ - ๅๅผๅธฆๆฅ็่ขซๅจๅๅ+ nav_df['net_flow'] = nav_df['scale'].diff() - nav_df['passive_change']++ # ็ป่ฎกๅบ้ด+ summary = {+ 'total_net_flow': nav_df['net_flow'].sum(), # ๅบ้ดๆปๅๆตๅ ฅ๏ผไบฟๅ ๏ผ+ 'avg_daily_flow': nav_df['net_flow'].mean(), # ๆฅๅๅๆตๅ ฅ+ 'inflow_days': (nav_df['net_flow'] > 0).sum(), # ๅๆตๅ ฅๅคฉๆฐ+ 'outflow_days': (nav_df['net_flow'] < 0).sum(), # ๅๆตๅบๅคฉๆฐ+ 'current_scale': nav_df['scale'].iloc[-1] # ๆๆฐ่งๆจก+ }++ return nav_df[['end_date', 'unit_nav', 'scale', 'net_flow']], summary+++def cross_etf_flow_comparison(+ pro,+ etf_codes: list[str],+ start_date: str,+ end_date: str+) -> pd.DataFrame:+ """+ ๆฏ่พๅ็ฑปETF็่ต้ๆตๅ๏ผๅคๆญ่ต้ๅๅฅฝใ++ Args:+ pro: tushare pro_api ๅฎไพ+ etf_codes: ๅ็ฑปETFไปฃ็ ๅ่กจ+ start_date: ๅผๅงๆฅๆ+ end_date: ็ปๆๆฅๆ++ Returns:+ ๅETF่ต้ๆตๅๆฑๆปๅฏนๆฏ DataFrame+ """+ rows = []+ for code in etf_codes:+ _, summary = etf_fund_flow_analysis(pro, code, start_date, end_date)+ summary['ts_code'] = code+ rows.append(summary)+ return pd.DataFrame(rows).set_index('ts_code').sort_values('total_net_flow', ascending=False)+```++---++## 8. ๅธธ่งๅๆๅบๆฏไธๆ็คบ่ฏๆจกๆฟ++### ๅบๆฏ 1๏ผ็ญ้ๅ็ฑปๆไผ ETF++```+ๅๆ่ฟฝ่ธช [ๆฒชๆทฑ300/ไธญ่ฏ500/xxx] ๆๆฐ็ๆๆETF๏ผ+็ปดๅบฆ๏ผ่งๆจกใ่ดน็ใ่ฟ1ๅนด่ท่ธช่ฏฏๅทฎใๆฅๅๆไบค้ขใไนฐๅไปทๅทฎใ+็ปๅบ็ปผๅ่ฏๅๆๅ๏ผๅนถๆจ่ๆ้ๅ[้ฟๆๆๆ/ๆณขๆฎตๆไฝ/ๅคง้ข้ ็ฝฎ]็ไบงๅใ+```++### ๅบๆฏ 2๏ผ่กไธ ETF ่ฝฎๅจไฟกๅท++```+ๅบไบ่ฟๅป [20/60] ๆฅๅจ้๏ผๅจไปฅไธ่กไธETFไธญ้ๅบๅ3ๅ๏ผ+[ๆถ่ดนใๅป็ใ็งๆใ่ฝๆบใ้่ใๅทฅไธใๆๆใๅ ฌ็จไบไธ]+ๅๆถๆ้ค่ฟ30ๆฅ่ทๅน ่ถ ่ฟ15%็ETFใ+```++### ๅบๆฏ 3๏ผETF ็ปๅๅๆต++```+ๆๅปบไปฅไธETF็ปๅๅนถๅๆต [2020-01-01 ่ณ 2025-12-31]๏ผ+- ๆฒชๆทฑ300ETF 40%+- ไธญ่ฏ500ETF 20%+- ๅฝๅบETF 30%+- ้ป้ETF 10%+ๆฏๅญฃๅบฆๅๅนณ่กก๏ผ่ฎก็ฎๅนดๅๆถ็ใๅคๆฎๆฏ็ใๆๅคงๅๆคใไธๆฒชๆทฑ300็็ธๅ ณๆงใ+```++### ๅบๆฏ 4๏ผQDII ๆบขไปท้ฃ้ฉ็ๆง++```+็ๆงไปฅไธQDII ETF็ๅฎๆถๆๆบขไปท็๏ผ[็บณๆETF 159632ใๆ ๆฎ500 513500ใๆฅ็ป225 513880]+ๆบขไปท > 3% ๆถๅๅบ้ข่ญฆ๏ผๅปบ่ฎฎ็ญๅพ ๅ่ฝๅๅๅ ฅๅบใ+```++---++## 9. ๅ ณ้ฎๆณจๆไบ้กน++1. **ๅ็ๆฟไปฃ**๏ผ่กไธETFไธญ่ฅๆๅคง้ๅ็่ก๏ผIOPV ๅคฑ็๏ผๆๆบขไปทๅ่ๆไนไธ้+2. **QDII ้ขๅบฆ**๏ผ้ขๅบฆ่ๅฐฝๆถ็ณ่ดญๆๅ๏ผๆบขไปทๅฏ่ฝๆ็ปญๆฐๆ๏ผไธ้ๅๅฅๅฉ+3. **ๆๅ่ก่ฐๆด**๏ผๆฏๅนด6ๆ/12ๆๆๆฐ่ฐๆดๅๅ1~2ๅจไผๆไธๅฎ่งๅพๆงๆบไผ+4. **ๆ ๆETF็ฆๆญข้ฟๆ**๏ผ่กฐๅๆๅบๅจ้่กๅธไธญๆๅ ถๆๆพ๏ผไธฅๆ ผ้ๅถๆๆๅจๆ+5. **่ดงๅธETF**๏ผๆฌ่ดจๆฏ่ดงๅธๅธๅบๅบ้๏ผไธๆฎ้ETF้ป่พไธๅ๏ผๆตๅจๆง็ฎก็ๅทฅๅ ท่้ๆ่ตๅทฅๅ ท+6. **ๆตๅจๆงๅทฎ็ETF**๏ผๅคง้ขไบคๆๅบๆๅๅคๆฅ๏ผ้ฟๅ ่ชๆๅฒๅป+7. **็จๅกๅค็**๏ผETF ๅบ้ๅ็บขไธญ่ฅๅซ่กๆฏๆถ็๏ผๅพ็จ่งๅไธ่ตๆฌๅฉๅพไธๅ๏ผๆณจๆๅบๅdiff --git a/agent/src/skills/event-driven/SKILL.md b/agent/src/skills/event-driven/SKILL.mdnew file mode 100644index 000000000..302a804b5--- /dev/null+++ b/agent/src/skills/event-driven/SKILL.md@@ -0,0 +1,179 @@+---+name: event-driven+description: Event-driven strategy based on sentiment-scored signals from news, announcements, and macro events. The LLM acts as the NLP engine, and event data follows a CSV schema.+---+# Event-Driven Strategy++## Purpose++Uses event information such as news, announcements, and macro policy updates. The LLM analyzes sentiment and impact magnitude to generate event-driven trading signals. Event data is managed in CSV format, and technical signals are combined with event signals through weighted aggregation to form the final trading decision.++## Workflow++1. **Data collection**: use the `read_url` tool to fetch the full text of news and announcements+2. **LLM analysis**: the LLM reads the news and scores it from `-1.0` to `1.0` with a standardized prompt (extremely bearish to extremely bullish)+3. **Generate the event CSV**: write data in the `date,event_type,score,source,summary` schema+4. **Signal aggregation**: `signal_engine.py` reads the event CSV, applies time decay, and combines it with the technical signal++**Key principle: the event CSV is the data layer, and `signal_engine.py` is the logic layer. Keep them decoupled.**++## Event CSV Schema++```csv+date,event_type,score,source,summary+2024-01-15,earnings,0.8,read_url,Q4 revenue beat expectations by 30%+2024-01-20,macro,-0.5,read_url,Central bank raised rates by 25bp+2024-02-01,policy,0.3,read_url,New-energy subsidies extended+2024-02-10,sentiment,-0.7,read_url,Bearish sentiment surged on social media+2024-03-05,insider,0.4,read_url,CEO bought 5 million shares+```++Field descriptions:++| Field | Type | Description |+|------|------|------|+| date | str (`YYYY-MM-DD`) | Date when the event became knowable (publication date, not occurrence date. If released after market close โ use the next trading day) |+| event_type | str | `earnings / macro / policy / sentiment / insider / technical_break` |+| score | float | `-1.0 ~ 1.0` (standardized LLM score) |+| source | str | Data-source tag (such as `read_url`) |+| summary | str | Event summary (one sentence, no commas) |++## Event Type Details++| Type | Meaning | Typical Impact | Duration |+|------|------|---------|---------|+| earnings | Earnings release | Short-term shock | 1-5 days |+| macro | Macro data / central-bank policy | Medium-term impact | 5-20 days |+| policy | Industry policy / regulatory change | Long-term impact | 20-60 days |+| sentiment | Market sentiment / public opinion | Short-term shock | 1-3 days |+| insider | Insider trading / block trade | Medium-term signal | 5-10 days |+| technical_break | Break of a key technical level | Short-term catalyst | 1-5 days |++## Signal Aggregation++### Time Decay of Event Signals++Event impact decays exponentially over time:++```python+import numpy as np+import pandas as pd+++def compute_event_signal(event_df: pd.DataFrame, dates: pd.DatetimeIndex,+ decay_lambda: float = 0.1,+ min_score_threshold: float = 0.2,+ event_lookback: int = 30) -> pd.Series:+ """Compute an event-driven signal with time decay.++ Args:+ event_df: DataFrame loaded from the event CSV, with date/event_type/score/source/summary columns.+ dates: Backtest date sequence (DatetimeIndex).+ decay_lambda: Decay coefficient. Higher values decay faster. Default 0.1 (decays to ~37% in about 10 days).+ min_score_threshold: Minimum score threshold. Events with |score| below this value are ignored.+ event_lookback: Event lookback window in days. Events older than this are excluded.++ Returns:+ Event signal Series aligned with dates, with value range [-1.0, 1.0].+ """+ event_df = event_df[event_df["score"].abs() >= min_score_threshold].copy()+ event_df["date"] = pd.to_datetime(event_df["date"])++ signal = pd.Series(0.0, index=dates)++ for trade_date in dates:+ # Only consider events published on or before trade_date (avoid look-ahead)+ mask = (event_df["date"] <= trade_date) & \+ (event_df["date"] >= trade_date - pd.Timedelta(days=event_lookback))+ relevant = event_df[mask]++ if relevant.empty:+ continue++ days_since = (trade_date - relevant["date"]).dt.days.values+ scores = relevant["score"].values+ # Exponential decay: score * exp(-lambda * days)+ decayed = scores * np.exp(-decay_lambda * days_since)+ # Sum multiple events and clip to [-1, 1]+ signal[trade_date] = np.clip(decayed.sum(), -1.0, 1.0)++ return signal+```++### Weighted Combination of Technical and Event Signals++```python+def combine_signals(tech_signal: pd.Series, event_signal: pd.Series,+ alpha: float = 0.6) -> pd.Series:+ """Combine technical and event signals with weights.++ Args:+ tech_signal: Technical signal, range [-1.0, 1.0].+ event_signal: Event-driven signal, range [-1.0, 1.0].+ alpha: Weight of the technical signal, default 0.6 (technical primary, event secondary).++ Returns:+ Combined signal, range [-1.0, 1.0].+ """+ combined = alpha * tech_signal + (1 - alpha) * event_signal+ return combined.clip(-1.0, 1.0)+```++Default `alpha = 0.6`: technical signal 60%, event signal 40%.++## Parameters++| Parameter | Default | Description |+|------|--------|------|+| alpha | 0.6 | Weight of the technical signal (`1-alpha` is the event weight) |+| decay_lambda | 0.1 | Decay coefficient (higher values decay faster; `0.1` โ decays to 37% in 10 days) |+| event_lookback | 30 | Event lookback window in days (older events are excluded) |+| min_score_threshold | 0.2 | Minimum score threshold (events with |score| below this are ignored) |++## LLM Scoring Prompt Template++After fetching news with `read_url`, use the following standardized prompt to keep scoring consistent:++```+You are a financial event analyst. Read the following news / announcement and score its impact on the stock price.++Scoring scale:+- 1.0: extremely bullish (for example, earnings far above expectations, major favorable policy)+- 0.5: moderately bullish (for example, earnings slightly above expectations, favorable industry news)+- 0.2: mildly bullish+- 0.0: neutral (no obvious impact)+- -0.2: mildly bearish+- -0.5: moderately bearish (for example, earnings below expectations, tighter industry regulation)+- -1.0: extremely bearish (for example, accounting fraud, major violations, black-swan event)++Score strictly on the scale above. Output one number only. Do not explain.++News content:+{news_content}++Score:+```++## Common Pitfalls++1. **Look-ahead bias**: the `date` in the event CSV must be the "knowable date" โ announcements released after market close should use the next trading day, not the same day. In backtests, strictly enforce `event_date <= trade_date`+2. **Duplicate event scoring**: the same event may appear from multiple news sources and generate multiple rows. Deduplicate by `(date, event_type)` or average the scores+3. **Sentiment drift**: the LLM scoring standard can drift as the prompt or model version changes. Fix the prompt template and recalibrate regularly+4. **Event sparsity**: most trading days have no events, so the event signal is 0 and the final signal is mainly driven by technicals. This is normal; do not fabricate data just to "fill gaps"+5. **Event data in backtests**: historical backtests require a fully prepared historical event CSV in advance; you cannot fetch it in real time. It is recommended to maintain separate event files per instrument+6. **Commas in the `summary` field**: a common reason for CSV parsing errors โ avoid commas in `summary`, or read with `pd.read_csv(quoting=csv.QUOTE_ALL)`+7. **Decay parameter sensitivity**: overly large `decay_lambda` makes event impact disappear too quickly, while overly small values keep stale events active for too long. In theory, different event types should use different decay profiles, but the default simplifies all of them to `0.1`++## Dependencies++```bash+pip install pandas numpy+```++No additional dependencies. LLM analysis is handled by the Agent itself, and the `read_url` tool is built in.++## Signal Convention++- Pure event signal: `[-1.0, 1.0]` (computed from event score + time decay)+- Combined signal: `alpha * tech_signal + (1 - alpha) * event_signal`, clipped to `[-1.0, 1.0]`+- When no event exists, `event_signal = 0`, so the combined signal collapses to the pure technical signaldiff --git a/agent/src/skills/execution-model/SKILL.md b/agent/src/skills/execution-model/SKILL.mdnew file mode 100644index 000000000..abaec0e75--- /dev/null+++ b/agent/src/skills/execution-model/SKILL.md@@ -0,0 +1,348 @@+---+name: execution-model+description: Trade execution modeling (backtest only) โ slippage formulas (linear / square-root impact), VWAP/TWAP execution logic, market-impact cost estimation, and execution-assumption configuration.+---++# Trade Execution Modeling++## Overview++Provide more realistic execution assumptions for backtests, including slippage models, market-impact estimation, and execution-algorithm principles. This skill is for backtest simulation only and does not involve live order execution.++## Slippage Models++### Why Slippage Models Are Needed++```+Idealized backtest: filled at the close, zero slippage+Real world:+1. The order book has a bid-ask spread+2. Large orders push prices (market impact)+3. Execution is delayed (there is latency from signal to fill)++No slippage model -> overly optimistic backtest -> losses in live trading+```++### 1. Fixed Slippage Model++```python+def fixed_slippage(price: float, direction: int, bps: float = 5.0) -> float:+ """+ Args:+ price: Original price+ direction: 1=buy, -1=sell+ bps: Slippage in basis points (1bp = 0.01%), default 5bp+ Returns:+ Execution price after slippage+ """+ slippage = price * bps / 10000+ return price + direction * slippage+```++**Reference fixed-slippage assumptions by market:**++| Market | Instrument | Suggested Slippage (bps) | Notes |+|------|------|-------------|------|+| China A-share large cap | CSI 300 constituents | 3-5 | Good liquidity |+| China A-share small cap | CSI 1000 constituents | 5-10 | Average liquidity |+| China micro-cap | market cap < 5 billion RMB | 10-30 | Poor liquidity |+| US large cap | AAPL / MSFT | 1-3 | Excellent liquidity |+| Hong Kong stocks | Hang Seng constituents | 5-10 | Less liquid than A / US |+| BTC spot | BTC-USDT | 2-5 | Good OKX liquidity |+| ETH spot | ETH-USDT | 3-8 | Slightly worse than BTC |+| Small altcoins | other `-USDT` pairs | 10-50 | Liquidity varies widely |++### 2. Linear Impact Model++```python+def linear_impact(price: float, direction: int,+ volume_traded: float, adv: float,+ impact_coeff: float = 0.1) -> float:+ """+ Linear market impact: impact โ traded volume / ADV++ Args:+ price: Original price+ direction: 1=buy, -1=sell+ volume_traded: Trade size (shares or notional)+ adv: Average Daily Volume+ impact_coeff: Impact coefficient, usually 0.05-0.2+ Returns:+ Execution price after impact+ """+ participation_rate = volume_traded / adv+ impact = impact_coeff * participation_rate+ return price * (1 + direction * impact)+```++**Reference impact coefficients:**++| Market | impact_coeff | Notes |+|------|-------------|------|+| China A-share large cap | 0.05-0.10 | 10% daily price-limit system |+| China A-share small cap | 0.10-0.20 | Liquidity premium |+| US equities | 0.03-0.08 | Market-maker buffering |+| Crypto | 0.05-0.15 | 24h trading is dispersed |++### 3. Square-Root Impact Model (Almgren-Chriss)++```python+import numpy as np++def sqrt_impact(price: float, direction: int,+ volume_traded: float, adv: float,+ volatility: float, eta: float = 0.5) -> float:+ """+ Square-root market impact (more accepted in academia):+ impact = ฮท ร ฯ ร sqrt(V/ADV)++ Args:+ price: Original price+ direction: 1=buy, -1=sell+ volume_traded: Trade size+ adv: Average daily volume+ volatility: Daily volatility (standard deviation)+ eta: Impact elasticity coefficient, usually 0.3-0.8+ Returns:+ Execution price after impact+ """+ participation = volume_traded / adv+ impact = eta * volatility * np.sqrt(participation)+ return price * (1 + direction * impact)+```++**Advantages of the square-root model**:+- Strongest empirical support (standard in financial literature)+- Marginal impact declines for larger orders (intuitive)+- Parameters can be estimated from historical data++### Slippage Model Selection Decision Tree++```+Backtest capital vs instrument ADV:+โโโ Capital < 0.5% of ADV -> fixed slippage (5bps) is enough+โโโ Capital 0.5-5% -> linear impact model+โโโ Capital > 5% -> square-root impact model (required)+```++## Execution Algorithm Principles++### VWAP (Volume Weighted Average Price)++```+Goal: execute at the day's volume-weighted average price++VWAP = ฮฃ(Price_i ร Volume_i) / ฮฃ(Volume_i)++Execution logic:+1. Forecast the intraday volume profile (typically U-shaped)+2. Split the order according to the predicted profile+3. Execute proportionally in each time slice++Typical China A-share VWAP volume profile (U-shaped):+09:30-10:00 15% (active open)+10:00-11:30 25% (normal morning session)+13:00-14:00 15% (weak afternoon session)+14:00-14:30 15% (afternoon recovery)+14:30-15:00 30% (active close)++VWAP in backtests:+- Daily backtest: use the VWAP field directly as the fill price+- Minute backtest: simulate VWAP order slicing+```++### TWAP (Time Weighted Average Price)++```+Goal: execute evenly over a specified time window++TWAP = simple time-sliced execution++Execution logic:+1. Define an execution window (for example 09:30-11:30)+2. Divide it into N time buckets+3. Execute total_size / N in each bucket++Pros and cons:++ Simple, no need to forecast volume+- Easier to cause impact during low-volume periods+- Less adaptive than VWAP+```++### Simulating Execution Delay in Backtests++```python+def delayed_execution(signal_series: pd.Series, delay_bars: int = 1) -> pd.Series:+ """+ Simulate the delay from signal generation to execution++ Args:+ signal_series: Original signal+ delay_bars: Number of bars to delay, default 1 (T+1 execution)+ Returns:+ Delayed signal++ China A-shares: delay_bars=1 (T+1 rule)+ Crypto: delay_bars=0 or 1+ """+ return signal_series.shift(delay_bars)+```++## Integrated Transaction-Cost Model++### Total Cost Breakdown++```+Total trading cost = explicit cost + implicit cost++Explicit cost:+- Commission: China A-shares 2-3 bps, crypto 0.02-0.1%+- Stamp duty (China A-share sell side): 0.05% (sell orders only)+- Transfer fee: negligible++Implicit cost:+- Bid-ask spread: 0.5-5bps+- Market impact: depends on trade size and liquidity+- Opportunity cost: loss from not filling at the best price+```++### Reference Trading Costs by Market++| Cost Item | China A-shares | Hong Kong | US | Crypto (OKX) |+|--------|-----|------|------|-----------|+| Commission (one way) | 0.025% | 0.05% | 0 (zero commission) | 0.08% (maker) |+| Stamp duty | 0.05% (sell) | 0.1% (both sides) | 0 | 0 |+| Bid-ask spread | 0.03-0.1% | 0.05-0.2% | 0.01-0.05% | 0.01-0.05% |+| Total one-way | ~0.1% | ~0.2% | ~0.03% | ~0.1% |+| Total round-trip | ~0.2% | ~0.4% | ~0.06% | ~0.2% |++### Cost Settings in Backtests++```json+{+ "commission": 0.001,+ "comment": "0.1% one-way commission, already includes stamp duty and spread"+}+```++**Recommendations**:+- China A-shares: `commission = 0.001` (conservative, includes all costs)+- Crypto: `commission = 0.001` (including slippage)+- Hong Kong / US equities: `commission = 0.001-0.002`++## Backtest Execution Assumptions++### Relevant `config.json` Settings++```json+{+ "commission": 0.001,+ "engine": "daily",+ "interval": "1D"+}+```++### Advanced Execution Assumptions (implemented in `signal_engine.py`)++```python+class SignalEngine:+ def __init__(self):+ # Execution assumption parameters+ self.execution_delay = 1 # T+1 delay+ self.slippage_bps = 5 # Fixed 5bps slippage+ self.max_participation = 0.05 # Maximum participation rate 5%++ def generate(self, data_map):+ for code, df in data_map.items():+ # 1. Generate raw signal+ raw_signal = self._compute_signal(df)++ # 2. Apply execution delay+ delayed_signal = raw_signal.shift(self.execution_delay)++ # 3. Apply volume filter (do not trade when liquidity is too low)+ volume_ok = df['volume'] > df['volume'].rolling(20).mean() * 0.3+ delayed_signal[~volume_ok] = 0++ signals[code] = delayed_signal+```++## Analysis Framework++### Evaluate the Impact of Transaction Costs++```+Step 1: Estimate annual turnover+ Annual turnover = annual trade count ร 2 (buy + sell) / number of positions++Step 2: Compute annual cost drag+ Annual cost = annual turnover ร total one-way cost++Step 3: Evaluate the impact on returns+ Net return = gross return - annual cost++Example:+ Annual turnover = 12 (monthly rebalance)+ One-way cost = 0.1%+ Annual cost = 12 ร 0.1% = 1.2%+ If annualized return is only 5% -> costs eat 24% of returns!+```++### Sensitivity Analysis for Execution Assumptions++```markdown+### Backtest Results Under Different Slippage Assumptions++| Slippage (bps) | Annual Return | Sharpe | Max Drawdown |+|-----------|---------|--------|---------|+| 0 (ideal) | 15.2% | 1.35 | -18.5% |+| 3 | 13.8% | 1.22 | -19.0% |+| 5 | 12.9% | 1.15 | -19.2% |+| 10 | 11.1% | 0.98 | -19.8% |+| 20 | 7.5% | 0.65 | -20.5% |++Conclusion: the strategy still has meaningful profitability under 10bps slippage+```++## Output Format++```markdown+## Execution Cost Analysis++### Strategy Trading Characteristics+| Metric | Value |+|------|-----|+| Average annual trade count | 48 |+| Annual turnover | 4.8x |+| Average holding days | 25 |+| Average order size | ยฅ50,000 |++### Cost Estimate+| Cost Item | Per Trade | Annualized |+|--------|------|------|+| Commission | 0.025% | 0.24% |+| Stamp duty | 0.025% | 0.12% |+| Estimated slippage | 0.03% | 0.29% |+| **Total** | **0.08%** | **0.65%** |++### Cost Impact+- Gross return: 12.5%+- Net return: 11.85%+- Cost drag: -0.65% (5.2% of gross return)+- Conclusion: cost impact is manageable++### Optimization Suggestions+1. Lower turnover (lengthen holding period)+2. Avoid trading during low-liquidity windows+3. Use limit orders instead of market orders+```++## Notes++1. **Backtest only**: this system does not execute live trades; the execution model is used only to improve backtest realism+2. **Conservative assumptions**: in backtests, it is better to overestimate transaction costs than to underestimate them+3. **China A-share T+1 rule**: trades cannot be executed on the same day the signal is generated, so execution must be delayed by 1 day+4. **Price-limit constraints**: when China A-shares are locked at limit-up / limit-down, no fill is possible; those dates should be skipped in backtests+5. **Volume constraints**: order size should not exceed 5-10% of the dayโs traded volume, otherwise the impact model becomes invalid+6. **Backtest overfitting**: even with slippage included, the strategy may still overfit; out-of-sample validation matters more+7. **`commission` in config**: the default `0.001` (0.1%) is a reasonable all-in cost estimatediff --git a/agent/src/skills/factor-research/SKILL.md b/agent/src/skills/factor-research/SKILL.mdnew file mode 100644index 000000000..409c76d0f--- /dev/null+++ b/agent/src/skills/factor-research/SKILL.md@@ -0,0 +1,139 @@+---+name: factor-research+description: Factor research framework with IC/IR analysis, quantile backtesting, and factor combination. Suitable for cross-sectional factor evaluation across multiple instruments.+---++# Factor Research Framework++## Purpose++Systematically evaluates the predictive power of single or multiple factors. Uses IC/IR statistical tests and quantile backtests to determine whether a factor has stock-selection power, and to guide factor screening and combination.++Applicable scenarios:+- Single-factor validity testing (momentum, value, quality, volatility, and more)+- Determining weights for multi-factor combination+- Factor decay analysis (IC changes across different holding periods)+- Comparing factor differences across industries and markets++## Workflow++1. **Calculate factor values**: compute factor exposures for each instrument on the cross-section, and output a factor CSV (`index=date`, `columns=codes`)+2. **Calculate returns**: compute each instrument's forward N-day return, and output a return CSV (same structure)+3. **Call the `factor_analysis` tool**: pass in the factor CSV, return CSV, and output directory+4. **Interpret the results**: judge factor validity based on IC/IR criteria and quantile backtest results+5. **Factor screening / combination**: keep effective factors and combine them with equal weights or IC-based weights++**Key point**: the rows (dates) and columns (instrument codes) of the factor CSV and return CSV must align exactly. Returns must be forward returns after the factor-observation date (to avoid look-ahead bias).++## `factor_analysis` Tool Parameters++| Parameter | Type | Required | Default | Description |+|------|------|------|------|------|+| factor_csv | string | Yes | - | Path to the factor-value CSV |+| return_csv | string | Yes | - | Path to the return CSV |+| output_dir | string | Yes | - | Output directory for results |+| n_groups | integer | No | 5 | Number of quantile groups |++## Output Files++| File | Contents |+|------|------|+| ic_series.csv | Daily IC series |+| ic_summary.json | IC mean, IC standard deviation, IR, proportion of IC > 0 |+| group_equity.csv | Cumulative equity curves for each quantile group |++## IC/IR Interpretation Standards++| Metric | Threshold | Interpretation |+|------|------|------|+| IC mean | > 0.03 | Factor has basic predictive power |+| IC mean | > 0.05 | Factor has strong predictive power |+| IC mean | > 0.10 | Unusually high; check for look-ahead bias |+| IR (IC mean / IC std) | > 0.5 | Factor is stably effective |+| IR | > 1.0 | Extremely strong, very rare |+| Proportion of IC > 0 | > 55% | Factor direction is stable |+| Proportion of IC > 0 | < 50% | Factor direction is unstable and unusable |++Note: negative IC can also be useful (reverse factors). Judge by absolute value, and reverse the signal direction in actual use.++## Quantile Backtest Interpretation++Quantile backtesting sorts instruments into N groups by factor value from low to high (default 5 groups), with equal-weight holding inside each group.++**Criteria**:+- **Monotonicity**: the final net values from `Group_1` to `Group_N` should show a monotonic rising (or falling) pattern. Better monotonicity means stronger factor discrimination+- **Long-short spread**: the net-value difference between the highest and lowest group (`long_short_spread`). A larger spread means stronger selection power+- **Nonlinearity**: if only the top and bottom groups differ materially while the middle groups are similar, the factor may only be effective in the tails+- **Stability**: group equity curves should be smooth; sharp swings indicate an unstable factor++**Warning signs**:+- No meaningful difference across group equity curves โ the factor is ineffective+- Non-monotonic pattern (such as V-shape or inverted V-shape) โ the factor may have a nonlinear relationship and requires further analysis+- One group's net value falls persistently โ the factor may be usable in reverse++## Factor Combination Methods++When multiple single factors pass validity tests, they should be combined into a composite factor:++### Equal-Weight Combination+The simplest method: standardize each factor and sum them with equal weights. Suitable when the factor count is small and IC differences are minor.++```+Composite factor = Z(factor1) + Z(factor2) + ... + Z(factorN)+where Z() is cross-sectional Z-score standardization+```++### IC-Weighted Combination+Assign weights according to historical IC mean. Factors with higher IC receive larger weights.++```+weight_i = |IC_mean_i| / sum(|IC_mean_j|)+Composite factor = sum(weight_i * Z(factor_i))+```++### Orthogonalized Combination+First orthogonalize the factors with the Schmidt process to remove collinearity, then combine them with equal weights. Suitable when factors are highly correlated with one another.++```+1. Sort factors by IC from high to low+2. Keep the first factor unchanged+3. Regress each later factor on all previous factors and use the residual as the orthogonalized factor+4. Combine the orthogonalized factors with equal weights+```++## Common Pitfalls++### Look-Ahead Bias+- Factor values must be computed using data from day T and earlier, while returns must use data from T+1 to T+N+- Wrong example: calculate the factor with day T closing price and correlate it with day T return โ artificially inflated IC+- Correct approach: factor value at day T, return defined as the move from the T close to the T+1 close and beyond++### Skewed Factor Distributions+- Some factors (such as market cap and turnover) have heavily right-skewed distributions+- Computing IC directly from raw values makes the result dominated by outliers+- Solution: apply cross-sectional rank or Z-score standardization before computing IC++### Industry Neutralization+- Factor values can be highly similar within the same industry, causing stock selection to cluster in a few sectors+- Solution: perform Z-score standardization within each industry (industry neutralization) to remove industry effects+- For China A-shares, Shenwan Level-1 industries can be used++### Insufficient Sample Size+- Each cross-section should contain at least 5 valid instruments to compute meaningful IC+- Quantile backtests require at least `n_groups` instruments+- When the universe is too small, IC is noisy and IR becomes unreliable++### Factor Crowding+- Classic factors (momentum, value) may see diminished excess returns after becoming widely used+- Regularly inspect the time-series evolution of factor IC to see whether decay is occurring+- Consider factor innovation or factor timing++### Survivorship Bias+- Backtesting only on stocks that still survive today will overestimate factor performance+- Use full-sample data including delisted stocks++## Dependencies++```bash+pip install pandas numpy scipy+```diff --git a/agent/src/skills/financial-statement/SKILL.md b/agent/src/skills/financial-statement/SKILL.mdnew file mode 100644index 000000000..f6e6be35a--- /dev/null+++ b/agent/src/skills/financial-statement/SKILL.md@@ -0,0 +1,261 @@+---+name: financial-statement+description: ่ดขๆฅไธ่กจๆทฑๅบฆ่งฃ่ฏปโโไธ่กจๅพ็จฝๅ ณ็ณปใ็ๅฉ่ดจ้(ๅบ่ฎกvs็ฐ้ๆต)ๅๆใๆ้ฆๅ่งฃใ10+่ดขๅก้ ๅ็บขๆๆๆ +---++# ่ดขๆฅไธ่กจ่งฃ่ฏป++## ๆฆ่ฟฐ++ไปไธๅผ ๆฅ่กจ๏ผๅฉๆถฆ่กจใ่ตไบง่ดๅบ่กจใ็ฐ้ๆต้่กจ๏ผ็ๅพ็จฝๅ ณ็ณปๅบๅ๏ผๆทฑๅบฆๅๆไผไธ็ๅฉ่ดจ้๏ผ่ฏๅซ่ดขๅก้ ๅไฟกๅท๏ผ็จๆ้ฆๅๆๅ่งฃ็ๅฉ้ฉฑๅจๅ ๅญใ++## ไธ่กจๆ ธๅฟๆกๆถ++### ๅฉๆถฆ่กจ๏ผ่ตไบๅคๅฐ๏ผ++```+่ฅไธๆถๅ ฅ+ - ่ฅไธๆๆฌ โ ๆฏๅฉๆถฆ๏ผๆฏๅฉ็ = ๆฏๅฉ/่ฅๆถ๏ผ+ - ้ๅฎ่ดน็จ + ็ฎก็่ดน็จ + ็ ๅ่ดน็จ โ ๆ ธๅฟๅฉๆถฆ+ + ๆ่ตๆถ็ + ๅ ฌๅ ไปทๅผๅๅจ โ ่ฅไธๅฉๆถฆ+ + ่ฅไธๅคๆถๆฏ โ ๅฉๆถฆๆป้ข+ - ๆๅพ็จ โ ๅๅฉๆถฆ+ - ๅฐๆฐ่กไธๆ็ โ ๅฝๆฏๅๅฉๆถฆ+```++**ๅ ณ้ฎๆฏ็**๏ผ++| ๆฏ็ | ๅ ฌๅผ | ๅฅๅบท่ๅด | ่ญฆ็คบ |+|------|------|---------|------|+| ๆฏๅฉ็ | ๆฏๅฉ/่ฅๆถ | ่กไธๅทฎๅผๅคง | ่ฟ็ปญ3ๅญฃไธๆป |+| ๅๅฉ็ | ๅๅฉ/่ฅๆถ | >10%ไผ็ง | <0%ไธๆ ๆนๅ่ถๅฟ |+| ๆ้ด่ดน็จ็ | (้็ฎก็ )/่ฅๆถ | <30% | ้ๅนดไธๅ |+| ๆฃ้/ๅฝๆฏ | ๆฃ้ๅๅฉ/ๅฝๆฏๅๅฉ | >80% | <50%ไพ่ต้็ปๅธธ |++### ่ตไบง่ดๅบ่กจ๏ผๆไปไนๅฎถๅบ๏ผ++```+่ตไบง = ่ดๅบ + ๆๆ่ ๆ็++่ตไบง็ซฏ้็น:+- ่ดงๅธ่ต้: ๆฏๅฆๅ้๏ผๅญ่ดทๅ้ซ๏ผ+- ๅบๆถ่ดฆๆฌพ: ๅข้ๆฏๅฆ่ถ ่ฟ่ฅๆถ๏ผ+- ๅญ่ดง: ๆฏๅฆ็งฏๅ๏ผ่ทไปทๅๅคๅคไธๅค๏ผ+- ๅ่ช: ๅนถ่ดญๆบขไปท๏ผๅๅผ้ฃ้ฉ+- ๅจๅปบๅทฅ็จ: ๆฏๅฆ้ฟๆไธ่ฝฌๅบ๏ผ++่ดๅบ็ซฏ้็น:+- ๆๆฏ่ดๅบ: ็ญๆๅๆฌพ+้ฟๆๅๆฌพ+ๅบไปๅบๅธ+- ๅบไป่ดฆๆฌพ: ๅฏนไธๆธธ่ฎฎไปทๆ+- ้ขๆถ/ๅๅ่ดๅบ: ๅฏนไธๆธธ่ฎฎไปทๆ+```++**ๅ ณ้ฎๆฏ็**๏ผ++| ๆฏ็ | ๅ ฌๅผ | ๅฅๅบท่ๅด |+|------|------|---------|+| ่ตไบง่ดๅบ็ | ่ดๅบ/่ตไบง | 40-60%๏ผ้้่๏ผ |+| ๆตๅจๆฏ็ | ๆตๅจ่ตไบง/ๆตๅจ่ดๅบ | 1.5-2.5 |+| ้ๅจๆฏ็ | (ๆตๅจ่ตไบง-ๅญ่ดง)/ๆตๅจ่ดๅบ | >1.0 |+| ๆๆฏ่ดๅบ็ | ๆๆฏ่ดๅบ/ๆป่ตไบง | <30% |++### ็ฐ้ๆต้่กจ๏ผ็ๆญฃๆฟๅฐๅคๅฐ็ฐ้๏ผ++```+็ป่ฅๆดปๅจ็ฐ้ๆต(CFO): ๅ็ๆ่ต็็ฐ้+ๆ่ตๆดปๅจ็ฐ้ๆต(CFI): ไนฐๅ่ตไบง่ฑ็็ฐ้+็ญน่ตๆดปๅจ็ฐ้ๆต(CFF): ๅ้ฑ/่ฟ้ฑ/ๅ็บข++้ป้ๅ ฌๅผ: ๅๅฉๆถฆ โ CFO๏ผ้ฟๆๆฅ็๏ผ+```++**็ฐ้ๆต่ดจ้็ฉ้ต**๏ผ++| CFO | CFI | CFF | ไผไธ็ถๆ |+|-----|-----|-----|---------|+| + | - | - | ไผ็ง๏ผ่ต้ฑใๆ่ตใ่ฟๅบ๏ผ |+| + | - | + | ๆฉๅผ ๏ผ่ต้ฑใๆ่ตใๅ้ฑๅ ้๏ผ |+| + | + | - | ็จณๅฅ๏ผ่ต้ฑใๅๆถๆ่ตใ่ฟๅบ๏ผ |+| - | - | + | ๅฑ้ฉ๏ผไบ้ฑใ่ฟๅจๆใ้ ๅ้ฑๆดป๏ผ |+| - | + | + | ๅฐๅข๏ผๅ่ตไบง+ๅ้ฑ็ปดๆ๏ผ |+| - | + | - | ่กฐ้๏ผๅ่ตไบง่ฟๅบ๏ผ |++## ไธ่กจๅพ็จฝๅ ณ็ณป++### ๆ ธๅฟๅพ็จฝ++```+1. ๅฉๆถฆ่กจ โ ่ตไบง่ดๅบ่กจ+ ๅๅฉๆถฆ โ ็ๅญๆถ็๏ผๆชๅ้ ๅฉๆถฆๅขๅ ๏ผ+ ๅบๆถๅขๅ = ๆถๅ ฅ - ๅฎ้ ๆถๆฌพ+ ๅญ่ดงๅขๅ = ้่ดญ - ๅทฒๅฎๆๆฌ++2. ๅฉๆถฆ่กจ โ ็ฐ้ๆต้่กจ+ ๅๅฉๆถฆ + ๆๆง - ่ฅ่ฟ่ตๆฌๅขๅ โ ็ป่ฅ็ฐ้ๆต+ ๅฆๆๅทฎๅผๅคง โ ็ๅฉ่ดจ้ๅญ็++3. ่ตไบง่ดๅบ่กจ โ ็ฐ้ๆต้่กจ+ ๆๆซ็ฐ้ = ๆๅ็ฐ้ + CFO + CFI + CFF+ ่ดงๅธ่ต้ๅๅจ = ไธไธช็ฐ้ๆตไนๅ+```++### ๅพ็จฝ้ช่ฏๅ ฌๅผ++```python+# ้ช่ฏ็ๅฉ่ดจ้+accrual_ratio = (net_income - cfo) / total_assets+# accrual_ratio > 10% โ ๅบ่ฎกๅฉๆถฆๅ ๆฏ้ซ๏ผ็ๅฉ่ดจ้ๅทฎ++# ้ช่ฏๆถๅ ฅ่ดจ้+receivable_growth = accounts_receivable.pct_change()+revenue_growth = revenue.pct_change()+# receivable_growth > revenue_growth โ ๆถๅ ฅ่ดจ้ๆถๅ++# ้ช่ฏ่ตไบง่ดๅบ่กจไธ็ฐ้ๆตไธ่ดๆง+cash_change = cash_end - cash_begin+cf_total = cfo + cfi + cff+# abs(cash_change - cf_total) > 1 โ ๆฐๆฎๆ้ฎ้ข+```++## ็ๅฉ่ดจ้ๅๆ++### ๅบ่ฎก vs ็ฐ้ๆต++```+้ซ่ดจ้็ๅฉ:+- CFO / ๅๅฉๆถฆ > 1.0๏ผ็ฐ้ๅฉๆถฆๅคงไบ็บธ้ขๅฉๆถฆ๏ผ+- ๅบๆถ่ดฆๆฌพๅข้ < ่ฅๆถๅข้+- ็ป่ฅ็ฐ้ๆตๆ็ปญไธบๆญฃ++ไฝ่ดจ้็ๅฉ:+- CFO / ๅๅฉๆถฆ < 0.5๏ผๅคง้ๅฉๆถฆๆฒกๅๆ็ฐ้๏ผ+- ๅบๆถ/่ฅๆถๆฏไพๆ็ปญไธๅ+- ไพ่ตไธๆฌกๆงๆถ็๏ผๆ่ตๆถ็ใ่ตไบงๅค็ฝฎ๏ผ+```++### ็ๅฉ่ดจ้่ฏๅๅก++| ๆๆ | ไผ็ง(3ๅ) | ไธ่ฌ(2ๅ) | ๅทฎ(1ๅ) | ๆ้ |+|------|----------|----------|---------|------|+| CFO/ๅๅฉๆถฆ | >1.2 | 0.8-1.2 | <0.8 | 25% |+| ๅบๆถๅข้vs่ฅๆถ | ๅบๆถๅข้ๆดๆ ข | ๅๆญฅ | ๅบๆถๆดๅฟซ | 20% |+| ๆฃ้/ๅฝๆฏ | >90% | 70-90% | <70% | 20% |+| ็ป่ฅ็ฐ้ๆต่ถๅฟ | ่ฟ็ปญๅข้ฟ | ๆณขๅจ | ไธ้ | 20% |+| ๅญ่ดงๅจ่ฝฌ | ๅ ๅฟซ | ็จณๅฎ | ๆพๆ ข | 15% |++่ฏๅ โฅ 2.5 = ็ๅฉ่ดจ้ไผ็ง+่ฏๅ 1.5-2.5 = ้่ฆๅ ณๆณจ+่ฏๅ < 1.5 = ็ๅฉ่ดจ้ๅทฎ๏ผๅปบ่ฎฎๅ้ฟ++## ่ดขๅก้ ๅ็บขๆๆๆ ++### 12ไธช็บขๆไฟกๅท++| # | ็บขๆ | ๆฃๆตๆนๆณ | ไธฅ้ๅบฆ |+|---|------|---------|--------|+| 1 | ๅญ่ดทๅ้ซ | ่ดงๅธ่ต้้ซ + ๆๆฏ่ดๅบ้ซ๏ผๅๆถ>่ฅๆถ30%๏ผ | ้ซ |+| 2 | ๅบๆถๆดๅข | ๅบๆถๅข้ > ่ฅๆถๅข้ ร 1.5๏ผๆ็ปญ2ๅญฃ+ | ้ซ |+| 3 | ๅญ่ดงๅผๅธธ | ๅญ่ดง/่ฅๆถๆฏไพ็ช็ถไธๅ>50% | ้ซ |+| 4 | ็ป่ฅ็ฐ้ๆตไธบ่ด | CFO่ฟ็ปญ2ๅนดไธบ่ดไฝๅๅฉๆถฆไธบๆญฃ | ้ซ |+| 5 | ๅ ณ่ไบคๆๅ ๆฏ้ซ | ๅ ณ่ไบคๆ/่ฅๆถ > 30% | ้ซ |+| 6 | ้ข็นๆดๆขๅฎก่ฎกๅธ | 3ๅนดๅ ๆข2ๆฌกๅฎก่ฎกๅธ | ไธญ |+| 7 | ๅจๅปบๅทฅ็จไธ่ฝฌๅบ | ๅจๅปบๅทฅ็จ/ๅบๅฎ่ตไบง > 50%๏ผๆ็ปญ3ๅนด+ | ไธญ |+| 8 | ้ขไป่ดฆๆฌพๅผๅธธ | ้ขไป/่ฅๆถๆฏไพ็ช็ถไธๅ | ไธญ |+| 9 | ๅฐๆฐ่กไธๆ็ๅผๅธธ | ๅฐๆฐ่กไธๆ็/ๅๅฉๆถฆๆฏไพๆณขๅจๅคง | ไธญ |+| 10 | ๅฎก่ฎกๆ่ง | ้ๆ ๅๆ ไฟ็ๆ่ง๏ผไฟ็/ๅฆๅฎ/ๆ ๆณ่กจ็คบ๏ผ | ้ซ |+| 11 | ่ตๆฌๅ็่ฟ้ซ | ็ ๅ่ตๆฌๅ/็ ๅๆป้ข > 50% | ไธญ |+| 12 | ๅ่ชๅ ๆฏ้ซ | ๅ่ช/ๅ่ตไบง > 30%๏ผไธๆ ็ไธ็ปฉไธ่พพๆ | ไธญ |++### ็ปผๅ้ ๅๆฆ็่ฏไผฐ++```+็บขๆๆฐ้ ้ ๅๆฆ็ ๅปบ่ฎฎ+0-1ไธช ไฝ ๆญฃๅธธๆ่ต+2-3ไธช ไธญ ๆทฑๅ ฅ่ฐๆฅ๏ผ่ฐจๆ ๆ่ต+4-5ไธช ้ซ ๅปบ่ฎฎๅ้ฟ+6+ไธช ๆ้ซ ๅผบ็ๅ้ฟ+```++## ๆ้ฆๅๆ++### ไธ็บงๅ่งฃ++```+ROE = ๅๅฉ็ ร ๆป่ตไบงๅจ่ฝฌ็ ร ๆ็ไนๆฐ++ROE = (ๅๅฉๆถฆ/่ฅๆถ) ร (่ฅๆถ/ๆป่ตไบง) ร (ๆป่ตไบง/ๅ่ตไบง)+ ็ๅฉ่ฝๅ ่ฟ่ฅๆ็ ๆ ๆๆฐดๅนณ+```++### ไบ็บงๅ่งฃ++```+ROE = ็จๅก่ดๆ ร ๅฉๆฏ่ดๆ ร ่ฅไธๅฉๆถฆ็ ร ่ตไบงๅจ่ฝฌ็ ร ๆ็ไนๆฐ+ = (ๅๅฉ/็จๅๅฉๆถฆ) ร (็จๅๅฉๆถฆ/EBIT) ร (EBIT/่ฅๆถ) ร (่ฅๆถ/ๆป่ตไบง) ร (ๆป่ตไบง/ๅ่ตไบง)+```++### ๆ้ฆๅๆๆจกๆฟ++```markdown+### ๆ้ฆๅๆ: [ๅ ฌๅธๅ]++| ๆๆ | 2024 | 2025 | ๅๅ | ้ฉฑๅจๅคๆญ |+|------|------|------|------|---------|+| ROE | 15.2% | 17.8% | +2.6% | โ |+| ๅๅฉ็ | 8.5% | 9.2% | +0.7% | ็ๅฉๆนๅ โ |+| ่ตไบงๅจ่ฝฌ็ | 0.85 | 0.88 | +0.03 | ๆ็ๆๅ โ |+| ๆ็ไนๆฐ | 2.10 | 2.20 | +0.10 | ๆ ๆไธๅ โ ๏ธ |++็ป่ฎบ: ROEๆๅไธป่ฆ็ฑ็ๅฉ่ฝๅๆนๅ้ฉฑๅจ๏ผๆ ๆๅฐๅน ไธๅ้ๅ ณๆณจ+```++### ่กไธROEๅฏนๆฏ++| ่กไธ | ๅ ธๅROE | ้ฉฑๅจ็ฑปๅ |+|------|---------|---------|+| ็ฝ้ | 25-30% | ้ซๅๅฉ็้ฉฑๅจ๏ผๆฏๅฉ็>90%๏ผ |+| ้ถๅฎ | 8-15% | ้ซๅจ่ฝฌ้ฉฑๅจ๏ผ่ๅฉๅค้๏ผ |+| ้ถ่ก | 10-14% | ้ซๆ ๆ้ฉฑๅจ๏ผๆ็ไนๆฐ>10x๏ผ |+| ็งๆ | 12-20% | ้ซๅๅฉ็+ไธญ็ญๅจ่ฝฌ |+| ๅฐไบง | 5-10% | ้ซๆ ๆไฝๅจๅปๆ ๆ |++## ่พๅบๆ ผๅผ++```markdown+## ่ดขๅกๅๆ: [ๅ ฌๅธๅ/ไปฃ็ ]++### ไธ่กจๆฆ่ฆ+| ๆๆ | 2023A | 2024A | 2025E | ่ถๅฟ |+|------|-------|-------|-------|------|+| ่ฅๆถ(ไบฟ) | ... | ... | ... | ... |+| ๅๅฉๆถฆ(ไบฟ) | ... | ... | ... | ... |+| CFO(ไบฟ) | ... | ... | ... | ... |+| ่ตไบง่ดๅบ็ | ... | ... | ... | ... |++### ็ๅฉ่ดจ้่ฏๅ+| ๆๆ | ๅพๅ | ่ฏดๆ |+|------|------|------|+| CFO/ๅๅฉๆถฆ | 3/3 | 1.25, ็ฐ้ๅๆถไผ็ง |+| ... | ... | ... |+| **็ปผๅ** | **2.7/3** | **็ๅฉ่ดจ้ไผ็ง** |++### ๆ้ฆๅ่งฃ+[ๆ้ฆๅๆ่กจๆ ผ]++### ็บขๆๆฃๆฅ+- [x] ๅญ่ดทๅ้ซ โ ๅฆ๏ผ่ดงๅธ่ต้ๅ็+- [x] ๅบๆถๅผๅธธ โ ๅฆ๏ผๅข้ไฝไบ่ฅๆถ+- [!] ๅ่ชๅ ๆฏ โ 22%๏ผๆฅ่ฟ่ญฆๆ็บฟ๏ผ้ๅ ณๆณจ++### ็ป่ฎบ+...+```++## ๆณจๆไบ้กน++1. **่ดขๆฅไผ่ฎกๅๅๅทฎๅผ**๏ผA่ก็จไธญๅฝไผ่ฎกๅๅ๏ผๆธฏ่ก/็พ่ก็จIFRS/US GAAP๏ผๆฏ่พๆถๆณจๆ่ฐๆด+2. **ๅญฃๅบฆๆฐๆฎ็ๅๆฏ้็ฏๆฏ**๏ผๅญฃ่ๆงๅ ็ด ๅคง๏ผๅฆๆถ่ดนQ4ๆบๅญฃ๏ผ๏ผ็ฏๆฏๆณขๅจไธไปฃ่กจ่ถๅฟ+3. **้ถ่ก/ไฟ้ฉ็นๆฎ**๏ผไธ่กจ็ปๆไธไธ่ฌไผไธๅฎๅ จไธๅ๏ผไธ้็จไผ ็ปๅพ็จฝๅๆ+4. **้่ตไบง vs ่ฝป่ตไบง**๏ผ่ตไบงๅจ่ฝฌ็่ทจ่กไธไธๅฏๆฏ๏ผๅ่กไธๅ ๆฏ่พๆๆๆไน+5. **ๅนถ่กจ่ๅดๅๅ**๏ผๆฐๆถ่ดญ/ๅค็ฝฎๅญๅ ฌๅธๅฏผ่ดๅๆฏไธๅฏๆฏ๏ผ้็ๅฏๆฏๅฃๅพ+6. **ๆฐๆฎๆฅๆบ**๏ผtushareๆไพA่ก่ดขๆฅๆฐๆฎ๏ผextra_fieldsไธญๅฏ่ทๅpe/pb/roe็ญๆๆ diff --git a/agent/src/skills/fund-analysis/SKILL.md b/agent/src/skills/fund-analysis/SKILL.mdnew file mode 100644index 000000000..37d023637--- /dev/null+++ b/agent/src/skills/fund-analysis/SKILL.md@@ -0,0 +1,272 @@+---+name: fund-analysis+description: ๅบ้ๅๆไธ็ญ้๏ผๆจๆ่ฏ็บง/ๅคๆฎๆฏ็/ไฟกๆฏๆฏ็ใSharpe้ฃๆ ผ็ฎฑๅๆใ้ฃๆ ผๆผ็งปๆฃๆตใๅบ้็ป็่ฏไปทใFOF็ปๅๆๅปบใETF้ๆฉ+---++# ๅบ้ๅๆไธ็ญ้++## ๆฆ่ฟฐ++็ณป็ปๅ่ฏไผฐๅ ฌๅๅบ้/็งๅๅบ้/ETF็ไธ็ปฉ่กจ็ฐใๆ่ต้ฃๆ ผๅ็ฎก็่ฝๅ๏ผๅนถๆๅปบFOF๏ผๅบ้ไธญ็ๅบ้๏ผ็ปๅใๆ ธๅฟ็ฎๆ ๏ผๆพๅฐ"ๅฏๆ็ปญ็่ถ ้ขๆถ็ๆฅๆบ"่้"่ฟๅปไธ็ปฉๆๅฅฝ็ๅบ้"ใ++้็จๅบๆฏ๏ผ+- ่ก็ฅจๅ/ๆททๅๅๅบ้็ๅค็ปดๅบฆ็ญ้+- ๅบ้็ป็ๆ่ต้ฃๆ ผ็ๅฝๅ ไธๆผ็งปๆฃๆต+- ETFไบงๅ็่ท่ธชๆ็่ฏไผฐ+- FOF็ปๅ็่ตไบง้ ็ฝฎไธๅๅนณ่กก+- A่กๅ ฌๅๅบ้็็นๆๅๆ็ปดๅบฆ++## ๆ ธๅฟๆฆๅฟต++### ๅบ้็ปฉๆๆๆ ไฝ็ณป++**ๆถ็็ฑปๆๆ **๏ผ+| ๆๆ | ๅ ฌๅผ | ไผ็ง้ๅผ | ่ฏดๆ |+|------|------|----------|------|+| ๅนดๅๆถ็็ | (1+ๆปๆถ็)^(1/ๅนดๆฐ)-1 | > 15% (่กๅบ) | ็ปๅฏนๆถ็ |+| ่ถ ้ขๆถ็(Alpha) | ๅบ้ๆถ็-ๅบๅๆถ็ | > 5%/ๅนด | ็ธๅฏนๅบๅ |+| ไฟกๆฏๆฏ็(IR) | Alpha / ่ท่ธช่ฏฏๅทฎ | > 0.5 | Alpha็จณๅฎๆง |+| ่็ | ่ท่ตขๅบๅ็ๆไปฝๅ ๆฏ | > 55% | ไธ่ดๆง |++**้ฃ้ฉ็ฑปๆๆ **๏ผ+| ๆๆ | ๅ ฌๅผ | ไผ็ง้ๅผ | ่ฏดๆ |+|------|------|----------|------|+| ๆๅคงๅๆค | max(peak-trough)/peak | < 20% (่กๅบ) | ๆ็ซฏ้ฃ้ฉ |+| ๅนดๅๆณขๅจ็ | std(ๆฅๆถ็)*โ252 | < 20% (่กๅบ) | ๆป้ฃ้ฉ |+| ไธ่กๆ ๅๅทฎ | std(่ดๆถ็)*โ252 | < 13% | ไธ่ก้ฃ้ฉ |+| Calmarๆฏ็ | ๅนดๅๆถ็/ๆๅคงๅๆค | > 1.0 | ๆถ็/ๆ็ซฏ้ฃ้ฉ |++**้ฃ้ฉ่ฐๆดๆๆ **๏ผ+| ๆๆ | ๅ ฌๅผ | ไผ็ง้ๅผ | ่ฏดๆ |+|------|------|----------|------|+| ๅคๆฎๆฏ็ | (Rp-Rf)/ฯp | > 1.0 | ๆฏๅไฝ้ฃ้ฉๆถ็ |+| Sortinoๆฏ็ | (Rp-Rf)/ไธ่กฯ | > 1.5 | ๆดๅ ณๆณจไธ่ก้ฃ้ฉ |+| Treynorๆฏ็ | (Rp-Rf)/ฮฒ | > 10% | ๆฏๅไฝ็ณป็ป้ฃ้ฉๆถ็ |++```+ๆ ้ฃ้ฉๅฉ็(Rf): A่ก้ๅธธ็จ1ๅนดๆๅฝๅบๆถ็็, ็บฆ2.0-2.5%+ๅบๅ: ่ก็ฅจๅโๆฒชๆทฑ300; ๆททๅๅโๆฒชๆทฑ300ร60%+ไธญ่ฏๅ จๅบร40%+่ฏไผฐๅจๆ: ่ณๅฐ3ๅนด๏ผๆจ่5ๅนด๏ผ่ฆ็ๅฎๆด็็ๅจๆ๏ผ+```++### Sharpe้ฃๆ ผ็ฎฑๅๆ++**ไนๅฎซๆ ผ้ฃๆ ผๅ็ฑป**๏ผ+```+ ไปทๅผ ๅนณ่กก ๆ้ฟ+ๅคง็ ๅคง็ไปทๅผ ๅคง็ๅนณ่กก ๅคง็ๆ้ฟ+ไธญ็ ไธญ็ไปทๅผ ไธญ็ๅนณ่กก ไธญ็ๆ้ฟ+ๅฐ็ ๅฐ็ไปทๅผ ๅฐ็ๅนณ่กก ๅฐ็ๆ้ฟ++ๅคๅฎๆนๆณ๏ผๅๅฝๆณ๏ผ:+ Ri = ฮฑ + ฮฒ1รๅคง็ไปทๅผ + ฮฒ2รๅคง็ๆ้ฟ + ฮฒ3รๅฐ็ไปทๅผ + ฮฒ4รๅฐ็ๆ้ฟ + ฮต++ ้ฃๆ ผๆๆฐ้ๆฉ(A่ก):+ ๅคง็ไปทๅผ: ๆฒชๆทฑ300ไปทๅผ (399346)+ ๅคง็ๆ้ฟ: ๆฒชๆทฑ300ๆ้ฟ (399370)+ ๅฐ็ไปทๅผ: ไธญ่ฏ500ไปทๅผ (930782)+ ๅฐ็ๆ้ฟ: ไธญ่ฏ500ๆ้ฟ (930783)++ ฮฒๆ้ๆๅคง็ๆนๅ = ๅบ้ไธป้ฃๆ ผ+ Rยฒ > 0.85 โ ้ฃๆ ผๆ็กฎ; Rยฒ < 0.70 โ ้ฃๆ ผๆจก็ณ/ๆฉๆถๅ+```++### ้ฃๆ ผๆผ็งปๆฃๆต++```+ๆนๆณ: ๆปๅจ็ชๅฃๅๅฝ (็ชๅฃ=60ไธชไบคๆๆฅ, ๆญฅ้ฟ=20ๆฅ)++ๆผ็งปๅคๅฎ:+ 1. ่ฎก็ฎๆฏไธช็ชๅฃ็้ฃๆ ผๆ้ฮฒ+ 2. ็ธ้ป็ชๅฃฮฒๅๅ:+ |ฮฮฒ| > 0.2 โ ๆพ่ๆผ็งป+ ๆๅคงฮฒๅฏนๅบ็้ฃๆ ผๅไบ โ ้ฃๆ ผๅๆข++ 3. Rยฒๆถๅบ:+ Rยฒๆ็ปญไธ้ โ ๅบ้็ป็ๅจๅๆฉๆถ/ๅ็ฆปๅบๅ+ Rยฒๅฟฝ้ซๅฟฝไฝ โ ้ฃๆ ผไธ็จณๅฎ++ๆผ็งป็ฑปๅ:+ - ๆธ่ฟๆผ็งป: ๅคง็โไธญ็โๅฐ็ (้ๅธธๆฏ่งๆจกๅข้ฟๅ่ขซ่ฟซไธๆฒ)+ - ็ชๅๆผ็งป: ไปทๅผ็ช็ถๅๆขๆ้ฟ (ๅฏ่ฝๆขไบๅบ้็ป็)+ - ๅจๆๆผ็งป: ็ๅธ่ฟฝๆ้ฟใ็ๅธ่ฝฌไปทๅผ (ๆฉๆถๅ)++A่กๅธธ่งๆผ็งป:+ 2020-2021: ๅคง้"ไปทๅผๅ"ๅบ้ๅฎ้ ๆไป่ฝฌๅๆฐ่ฝๆบ/ๅๅฏผไฝ(ๆ้ฟ)+ ๆฃๆต: ็ณๆฅ้ฃๆ ผ=ๅคง็ไปทๅผ, ๅฎ้ ๅๅฝ้ฃๆ ผ=ๅคง็ๆ้ฟ โ ๅไธๅฏๅฎ+```++## ๅๆๆกๆถ++### 1. ๅบ้็ญ้ๆกๆถ๏ผไบๆญฅๆณ๏ผ++```+Step 1: ็กฌๆๆ ่ฟๆปค+ โก ๆ็ซ โฅ 3ๅนด+ โก ่งๆจก 2-100ไบฟ๏ผๅคชๅฐๆธ ็้ฃ้ฉ, ๅคชๅคง่นๅคง้พๆๅคด๏ผ+ โก ๅไธๅบ้็ป็็ฎก็ โฅ 2ๅนด+ โก ๆบๆๆๆๆฏไพ > 20%๏ผๆบๆ่ฎคๅฏ๏ผ++Step 2: ็ปฉๆๆๅบ+ โก ่ฟ3ๅนดๅนดๅๆถ็ > ๅ็ฑปไธญไฝๆฐ+ โก ่ฟ3ๅนดๅคๆฎๆฏ็ > ๅ็ฑปๅ30%+ โก ๆๅคงๅๆค < ๅ็ฑปไธญไฝๆฐ+ โก ไฟกๆฏๆฏ็ > 0.3++Step 3: ้ฃๆ ผ้ช่ฏ+ โก ๅฎ้ ้ฃๆ ผไธ็ณๆฅ้ฃๆ ผไธ่ด๏ผRยฒ > 0.8๏ผ+ โก ้ฃๆ ผๆผ็งปๅพๅ < 0.3๏ผ็จณๅฎ๏ผ+ โก ่ฟ1ๅนด้ฃๆ ผไธ่ฟ3ๅนดไธ่ด++Step 4: ๅบ้็ป็่ฏไปท+ โก ็ฎก็ๅ็ฑปๅบ้ โฅ 3ๅนด+ โก ๅๅฒไปป่ๅบ้ๆถ็ๅไธบๆญฃ่ถ ้ข+ โก ๆขๆ็ๅ็๏ผๅนดๅ200-400%ไธบๆญฃๅธธ, >600%่ฟ้ซ๏ผ+ โก ๆ่ก้ไธญๅบฆ้ไธญ๏ผๅ10ๅคงๆไป40-70%๏ผ++Step 5: ่ดน็จๆฃๆฅ+ โก ็ฎก็่ดน โค 1.5%๏ผไธปๅจ่กๅบ๏ผ+ โก ๆ ๆฉ็ฝๆง่ตๅ่ดน๏ผๆๆ>1ๅนดๅ ่ตๅ่ดน๏ผ+ โก ๆ็ฎก่ดน โค 0.25%+```++### 2. ๅบ้็ป็่ฏไปท++```+ๆ ธๅฟ็ปดๅบฆ:+ 1. ่ถ ้ขๆถ็่ฝๅ:+ ไปป่ๅนดๅAlpha (็ธๅฏนๅบๅ)+ ็ๅธAlpha vs ็ๅธAlpha (ไผ็ง็ป็็ๅธไนๆ่ถ ้ข)++ 2. ้ฃ้ฉๆงๅถ:+ ๆๅคงๅๆค vs ๅบๅๆๅคงๅๆค+ ไธ่กๆ่ทๆฏ็ < 0.8 โ ๅไบๆงๅถไธ่ก้ฃ้ฉ+ ไธ่กๆ่ทๆฏ็ > 1.0 โ ไธๆถจ่กๆ ไธๆ้++ 3. ้่ก่ฝๅ vs ๆฉๆถ่ฝๅ (T-Mๆจกๅ):+ Ri-Rf = ฮฑ + ฮฒ(Rm-Rf) + ฮณ(Rm-Rf)ยฒ + ฮต+ ฮฑ > 0 โ ๆ้่ก่ฝๅ+ ฮณ > 0 โ ๆๆฉๆถ่ฝๅ+ A่กๅฎ่ฏ: ๅคง้จๅๅบ้็ป็ๆ้่ก่ฝๅ, ๅฐๆๆฉๆถ่ฝๅ++ 4. ๆไป็นๅพ:+ ๆขๆ็: <200%=้ฟๆๆๆ; 200-400%=้ไธญ; >600%=้ข็นไบคๆ+ ๆ่ก้ไธญๅบฆ: ๅ10ๅคงๅ ๆฏ, >70%=้ไธญ, <40%=ๅๆฃ+ ่กไธๅ็ฆปๅบฆ: ็ธๅฏนๅบๅ็่กไธ่ถ /ไฝ้ ๅน ๅบฆ++็ป็ๆดๆขไฟกๅท:+ ๅบ้็ป็ๅๆดๅ ฌๅๆฅ่ตท:+ - ๆฐ็ป็ๆฅ่ชๅไธๅ ฌๅธใ้ฃๆ ผ็ธ่ฟ โ ๅฝฑๅๅฐ+ - ๆฐ็ป็้ฃๆ ผๆช็ถไธๅ โ ้ๆฐ่ฏไผฐ, ่งๅฏ1-2ไธชๅญฃๅบฆๅๅณๅฎ+ - ๆๆ็ป็็ฆป่ โ ่่่ตๅ, ่ท่ธชๆฐ็ป็็ๅ ถไปไบงๅ+```++### 3. ETF้ๆฉๆกๆถ++```+ๆ ธๅฟๆ ๅ:+ 1. ่ท่ธช่ฏฏๅทฎ: ๅนดๅ < 2% (่ขซๅจ) / < 4% (ๅขๅผบ)+ ่ฎก็ฎ: std(ETFๆฅๆถ็ - ๆๆฐๆฅๆถ็) ร โ252++ 2. ่ดน็ๆฏ่พ:+ ็ฎก็่ดน: 0.15%(ๆไฝ) ~ 0.50%(ๆฎ้)+ ๆ็ฎก่ดน: 0.05% ~ 0.10%+ ็ปผๅ่ดน็ๅทฎ 0.2%/ๅนด๏ผ10ๅนด็ดฏ็งฏๅทฎๅผๆพ่++ 3. ๆตๅจๆง:+ ๆฅๅๆไบค้ข > 1ไบฟ โ ๆตๅจๆงๅ ่ถณ+ ไนฐๅไปทๅทฎ < 0.1% โ ไบคๆๆๆฌไฝ+ ๆๆบขไปท็ < 0.3% โ ๅฎไปทๅ็กฎ++ 4. ่งๆจก:+ > 10ไบฟ โ ๆธ ็้ฃ้ฉๆไฝ+ 2-10ไบฟ โ ๅฏๆฅๅ+ < 2ไบฟ โ ้ๅ ณๆณจๆฏๅฆๆๆธ ็้ฃ้ฉ++A่กไธปๆตๅฎฝๅบETFๅฏนๆฏ(็คบไพ):+ | ETF | ไปฃ็ | ่ดน็ | ่งๆจก | ่ท่ธช่ฏฏๅทฎ |+ |-----|------|------|------|----------|+ | ๅๆณฐๆ็ๆฒชๆทฑ300ETF | 510300 | 0.20% | 800ไบฟ+ | 0.5% |+ | ๆๆน่พพๆฒชๆทฑ300ETF | 510310 | 0.20% | 200ไบฟ+ | 0.6% |+ | ๅๅคไธ่ฏ50ETF | 510050 | 0.50% | 500ไบฟ+ | 0.4% |+ | ๅๆนไธญ่ฏ500ETF | 510500 | 0.20% | 400ไบฟ+ | 0.8% |+```++### 4. FOF็ปๅๆๅปบ++```+Step 1: ๅคง็ฑป่ตไบง้ ็ฝฎ+ ไฟๅฎๅ: ่กๅบ30% + ๅบๅบ50% + ่ดงๅบ20%+ ๅ่กกๅ: ่กๅบ50% + ๅบๅบ30% + ๅๅ10% + ่ดงๅบ10%+ ๆฟ่ฟๅ: ่กๅบ70% + ๅบๅบ20% + ๅๅ10%++Step 2: ็ปๅ่ตไบง้ๅบ+ ๆฏไธช่ตไบง็ฑปๅซ้ 2-3 ๅชๅบ้๏ผๅๆฃ็ฎก็ไบบ้ฃ้ฉ๏ผ++ ่ก็ฅจ้จๅ:+ ๅคง็ไปทๅผ 1ๅช + ๅคง็ๆ้ฟ 1ๅช + ไธญๅฐ็ 1ๅช+ ้ฃๆ ผไบ่กฅ, ้ไฝๅไธ้ฃๆ ผๆด้ฒ++ ๅบๅธ้จๅ:+ ็บฏๅบ 1ๅช + ่ฝฌๅบๅขๅผบ 1ๅช+ ๆงๅถไฟก็จ้ฃ้ฉ, ไธ่ฟฝ้ซๆถ็ๅบ++Step 3: ๅๅนณ่กก่งๅ+ ๅฎๆ: ๆฏๅญฃๅบฆๆฃๆฅไธๆฌกๅ็ฆปๅบฆ+ ่งฆๅ: ไปปไธ่ตไบงๅ็ฆป็ฎๆ ๆ้ > 5% โ ๅๅนณ่กก++ ๅๅนณ่กกๆนๆณ:+ a. ๅๅบ่ถ ้ ใไนฐๅ ฅไฝ้ โ ไบคๆๆๆฌ้ซ+ b. ๅข้่ต้ไนฐๅ ฅไฝ้ โ ๅๅฐไบคๆ้ข็+ c. ๅ็บขๅๆ่ตๅฐไฝ้ โ ๆไผๆนๆก++Step 4: ็ๆง้ข่ญฆ+ โก ๅญฃๅบฆ็ปฉๆๅ้กพ: ไปปไธๅบ้่ฟ็ปญ2ไธชๅญฃๅบฆๆๅๅ30% โ ่งๅฏ+ โก ๅบ้็ป็ๅๆด โ ้ๆฐ่ฏไผฐ+ โก ้ฃๆ ผๆผ็งป โ ๆฟๆขไธบ้ฃๆ ผ็จณๅฎ็ๅ็ฑปๅบ้+ โก ่งๆจกๅผๅธธ(ๆดๅข/ๆด้) โ ๅ ณๆณจๆตๅจๆงๅฒๅป+```++## ่พๅบๆ ผๅผ++ๅบ้ๅๆๆฅๅ๏ผ+```+=== ๅบ้ๆฆๅต ===+ๅ็งฐ: ๆๆน่พพ่็ญน็ฒพ้ๆททๅ (005827)+็ป็: ๅผ ๅค ไปป่: 2018-01-05 (8ๅนด)+่งๆจก: 450ไบฟ ้ฃๆ ผ: ๅคง็ๆ้ฟ++=== ็ปฉๆ่ฏไผฐ (่ฟ3ๅนด) ===+ๅนดๅๆถ็: 12.5% (ๅ็ฑปๅ25%)+ๅคๆฎๆฏ็: 0.85 (ๅ็ฑปๅ20%)+ๆๅคงๅๆค: -28.3% (ๅ็ฑปไธญไฝ-25.6%)+ไฟกๆฏๆฏ็: 0.62+Calmarๆฏ็: 0.44+่็: 58% (ๆๅบฆ่ท่ตขๅบๅ)++=== ้ฃๆ ผๅๆ ===+ๅๅฝ้ฃๆ ผ: ๅคง็ๆ้ฟ (Rยฒ=0.91)+้ฃๆ ผๆผ็งป: ไฝ (่ฟ1ๅนดไธ่ฟ3ๅนดไธ่ด)+ๆ่ก้ไธญๅบฆ: ๅ10ๅคงๆไป68%+ๆขๆ็: ๅนดๅ150% (ไฝๆขๆ, ้ฟๆๆๆ)++=== ่ฏไปท ===+ไผๅฟ: ้่ก่ฝๅๅผบ(Alphaๆพ่), ้ฃๆ ผ็จณๅฎ+ๅฃๅฟ: ่งๆจก่ฟๅคงๅฏ่ฝๅฝฑๅๆไฝ็ตๆดปๆง, ๅๆคๆงๅถไธ่ฌ+ๅปบ่ฎฎ: ้ๅไฝไธบFOF็ปๅไธญ็ๅคง็ๆ้ฟ้ ็ฝฎ, ไปไฝ15-20%+```++## ๆณจๆไบ้กน++1. **ๅนธๅญ่ ๅๅทฎ**๏ผๅบ้ๆฐๆฎๅบไธญๅทฒๆธ ็ๅบ้ๅฏ่ฝ่ขซๆ้ค๏ผๅฏผ่ดๅๅฒๅนณๅไธ็ปฉๅ้ซ+2. **่งๆจกๆๅบ**๏ผๅบ้่งๆจก่ถ ่ฟ200ไบฟๅ๏ผๅฐ็่ก็ญ็ฅ้พไปฅๆง่ก๏ผAlphaๅฏ่ฝไธ้+3. **ๅญฃๆซๆๅบ**๏ผ้จๅๅบ้ๅจๅญฃๆซๅญๅจ"็ฒ้ฅฐๆฉฑ็ช"่กไธบ๏ผๅญฃๆซไนฐๅ ฅ้ไป่กๆๅๅผ๏ผ๏ผ้็จๆไธญๆฐๆฎไบคๅ้ช่ฏ+4. **็ณ่ตๅฒๅป**๏ผๅคง่งๆจก็ณ่ดญ/่ตๅๅฝฑๅๅบ้ๆถ็๏ผๆ่/่ขซ่ฟซๅๅบ๏ผ๏ผๅ ณๆณจไปฝ้ขๅๅจ+5. **่ดน็ๆ็ดฏ**๏ผ้ฟๆๆฅ็๏ผ่ดน็ๅทฎๅผๅฏน็ดฏ่ฎกๆถ็ๅฝฑๅๆพ่ใ10ๅนดๆ 1.5% vs 0.5% ่ดน็ๅทฎ โ ็บฆ10%็ดฏ่ฎกๆถ็ๅทฎ+6. **ๆๆฐๅขๅผบ็ๅ**๏ผ้จๅ"ๆๆฐๅขๅผบ"ๅฎ้ ๅ็ฆปๅบๅๆๅคง๏ผ่ท่ธช่ฏฏๅทฎ>8%๏ผ๏ผๅฎ่ดจๆฏไธปๅจ็ฎก็ๆซ็ๅขๅผบๅค่กฃ++## ไพ่ต++```bash+pip install pandas numpy scipy+```diff --git a/agent/src/skills/fundamental-filter/SKILL.md b/agent/src/skills/fundamental-filter/SKILL.mdnew file mode 100644index 000000000..7eb5ad36f--- /dev/null+++ b/agent/src/skills/fundamental-filter/SKILL.md@@ -0,0 +1,126 @@+---+name: fundamental-filter+description: Fundamental factor screening โ filter stocks by PE/PB/ROE and other financial metrics for value or growth selection. Supports A-shares (via tushare extra_fields) and HK/US stocks (via yfinance Ticker info).+---+# Fundamental Factor Screening++## Purpose++Filter stocks using fundamental financial data (PE/PB/ROE, etc.) to build value or growth screen signals for backtesting. Supports multiple markets with different data sources.++## Market Support++| Market | Data Source | Method | Supported Metrics |+|--------|-----------|--------|------------------|+| A-shares | tushare `daily_basic` | `extra_fields` in config.json | pe, pb, pe_ttm, ps_ttm, dv_ttm, total_mv, circ_mv, roe |+| US stocks | yfinance `Ticker.info` | Direct API call | trailingPE, forwardPE, priceToBook, returnOnEquity, marketCap, dividendYield |+| HK stocks | yfinance `Ticker.info` | Direct API call | trailingPE, priceToBook, returnOnEquity, marketCap |++## Signal Logic++### Value Filter (Default)++1. PE < pe_max AND PE > 0 (exclude loss-making stocks)+2. PB < pb_max+3. ROE > roe_min+4. All conditions met โ long (1), otherwise โ flat (0)++### Growth Filter (Optional)++1. PE_TTM within reasonable range (0 < PE_TTM < pe_ttm_max)+2. ROE > roe_min (profitability floor)+3. Market cap > mv_min (exclude micro-caps)++## A-Share Usage (tushare)++### config.json++```json+{+ "source": "tushare",+ "codes": ["000001.SZ", "600036.SH", "000858.SZ"],+ "start_date": "2023-01-01",+ "end_date": "2024-12-31",+ "extra_fields": ["pe", "pb", "pe_ttm", "roe", "total_mv"],+ "initial_cash": 1000000,+ "commission": 0.001+}+```++The `extra_fields` columns are automatically merged into the daily DataFrame by the DataLoader.++## HK/US Stock Usage (yfinance)++For HK/US stocks, fundamental data is not available as daily time-series via the backtest loader. Instead, use `yfinance` Ticker info for point-in-time screening:++```python+import yfinance as yf++def screen_us_stocks(tickers, criteria):+ """Screen US/HK stocks by fundamental criteria."""+ passed = []+ for symbol in tickers:+ info = yf.Ticker(symbol).info+ pe = info.get("trailingPE")+ pb = info.get("priceToBook")+ roe = info.get("returnOnEquity") # Decimal (e.g., 0.25 = 25%)+ mcap = info.get("marketCap")++ if pe is None or pb is None or roe is None:+ continue # Skip stocks with missing data++ if (0 < pe < criteria["pe_max"]+ and pb < criteria["pb_max"]+ and roe > criteria["roe_min"]+ and (mcap or 0) > criteria.get("mcap_min", 0)):+ passed.append({+ "symbol": symbol,+ "pe": pe,+ "pb": pb,+ "roe": round(roe * 100, 1), # Convert to percentage+ "mcap": mcap,+ })++ return passed++# Example: screen S&P 500 components+criteria = {"pe_max": 20, "pb_max": 3.0, "roe_min": 0.08, "mcap_min": 10_000_000_000}+results = screen_us_stocks(["AAPL", "MSFT", "JNJ", "JPM", "XOM"], criteria)+```++### HK Stock Screening++```python+# HK stocks use the same yfinance interface+hk_tickers = ["0700.HK", "9988.HK", "1810.HK", "2318.HK", "0005.HK"]+results = screen_us_stocks(hk_tickers, criteria) # Same function works+```++## Parameters++| Parameter | Default | Description |+|-----------|---------|-------------|+| pe_max | 20.0 | PE ceiling (exclude overvalued) |+| pb_max | 3.0 | PB ceiling |+| roe_min | 8.0 | ROE floor (%), exclude low-profitability |+| pe_min | 0.0 | PE floor (exclude loss-making stocks) |+| mcap_min | 0 | Market cap floor (for US/HK, in USD) |++## Common Pitfalls++- `extra_fields` columns may contain NaN (new listings, ST stocks) โ must `fillna` or `dropna`+- Negative PE means loss-making โ always filter with `pe > 0`+- ROE units differ: tushare uses percentage (e.g., 15 = 15%), yfinance uses decimal (e.g., 0.15 = 15%)+- For portfolio strategies: N stocks passing the screen each get weight 1/N+- yfinance `Ticker.info` is a point-in-time snapshot, not historical time-series โ cannot directly use for daily rebalancing backtests on US/HK stocks+- For US/HK daily fundamental backtests, consider using the screening results as a stock universe, then applying technical signals within that universe++## Dependencies++```bash+pip install pandas numpy yfinance+```++## Signal Convention++- `1/N` = selected for long (N = number of stocks passing the screen), `0` = not selecteddiff --git a/agent/src/skills/fundamental-filter/example_signal_engine.py b/agent/src/skills/fundamental-filter/example_signal_engine.pynew file mode 100644index 000000000..b7a48a5cd--- /dev/null+++ b/agent/src/skills/fundamental-filter/example_signal_engine.py@@ -0,0 +1,127 @@+"""ๅบๆฌ้ขๅ ๅญ่ฟๆปค้่กไฟกๅทๅผๆใ++ๅบไบ PE/PB/ROE ็ญ่ดขๅกๆๆ ๅฏน A ่ก่ฟ่กไปทๅผ็ญ้๏ผ+ๆปก่ถณๅ จ้จๆกไปถ็่ก็ฅจ็ญๆๅๅคใไป ้ tushare ๆฐๆฎๆบ๏ผ้ extra_fields๏ผใ+"""++from typing import Dict, List++import numpy as np+import pandas as pd+++class SignalEngine:+ """ๅบๆฌ้ขๅ ๅญ่ฟๆปคไฟกๅทๅผๆใ++ ้่ฟ PE/PB/ROE ไธ้่ฟๆปค็ญ้ไปทๅผ่ก๏ผๆปก่ถณๆกไปถ็่ก็ฅจ็ญๆๅ้ ใ++ Attributes:+ pe_min: PE ไธ้๏ผๆ้คไบๆ่ก๏ผใ+ pe_max: PE ไธ้๏ผๆ้ค้ซไผฐๅผ๏ผใ+ pb_max: PB ไธ้ใ+ roe_min: ROE ไธ้๏ผ%๏ผใ++ Example:+ >>> engine = SignalEngine(pe_max=15, pb_max=2, roe_min=10)+ >>> signals = engine.generate({"000001.SZ": df1, "600036.SH": df2})+ """++ def __init__(+ self,+ pe_min: float = 0.0,+ pe_max: float = 20.0,+ pb_max: float = 3.0,+ roe_min: float = 8.0,+ ):+ """ๅๅงๅๅบๆฌ้ข่ฟๆปคๅผๆใ++ Args:+ pe_min: PE ไธ้๏ผๆ้คไบๆ่ก๏ผ้ป่ฎค 0๏ผใ+ pe_max: PE ไธ้๏ผๆ้ค้ซไผฐๅผ๏ผใ+ pb_max: PB ไธ้ใ+ roe_min: ROE ไธ้๏ผ%๏ผใ+ """+ self.pe_min = pe_min+ self.pe_max = pe_max+ self.pb_max = pb_max+ self.roe_min = roe_min++ def generate(self, data_map: Dict[str, pd.DataFrame]) -> Dict[str, pd.Series]:+ """ๅบไบๅบๆฌ้ขๆกไปถ่ฟๆปค๏ผๅฏนๆปก่ถณๆกไปถ็่ก็ฅจ็ญๆๅๅคใ++ Args:+ data_map: ๆ ็ไปฃ็ ๅฐ DataFrame ็ๆ ๅฐใ+ DataFrame ้ๅ ๅซ open/high/low/close/volume ๅๅ pe/pb/roe ็ญ extra_fieldsใ++ Returns:+ ๆ ็ไปฃ็ ๅฐไฟกๅท Series ็ๆ ๅฐใ+ """+ codes = list(data_map.keys())+ if not codes:+ return {}++ # ่ทๅๆๆๆฅๆ็ๅนถ้+ all_dates = sorted(set().union(*(df.index for df in data_map.values())))+ date_index = pd.DatetimeIndex(all_dates)++ # ้ๆฅๅคๆญๆฏๅช่ก็ฅจๆฏๅฆๆปก่ถณๆกไปถ+ signals: Dict[str, pd.Series] = {code: pd.Series(0.0, index=date_index) for code in codes}++ for dt in date_index:+ qualified: List[str] = []+ for code, df in data_map.items():+ if dt not in df.index:+ continue+ row = df.loc[dt]+ pe = row.get("pe", np.nan)+ pb = row.get("pb", np.nan)+ roe = row.get("roe", np.nan)++ if pd.isna(pe) or pd.isna(pb) or pd.isna(roe):+ continue+ if self.pe_min < pe <= self.pe_max and pb <= self.pb_max and roe >= self.roe_min:+ qualified.append(code)++ if qualified:+ weight = 1.0 / len(qualified)+ for code in qualified:+ signals[code].at[dt] = weight++ # ๅฏน้ฝๅฐๅ่ชๅๅง็ดขๅผ+ result = {}+ for code, df in data_map.items():+ result[code] = signals[code].reindex(df.index).fillna(0.0)+ return result+++if __name__ == "__main__":+ # ๆผ็คบ๏ผ็จ้ๆบๆฐๆฎๆจกๆๅบๆฌ้ข่ฟๆปค+ np.random.seed(42)+ dates = pd.bdate_range("2024-01-01", "2024-12-31")++ def _mock_stock(pe_range, pb_range, roe_range):+ n = len(dates)+ return pd.DataFrame({+ "open": np.random.uniform(10, 50, n),+ "high": np.random.uniform(10, 50, n),+ "low": np.random.uniform(10, 50, n),+ "close": np.random.uniform(10, 50, n),+ "volume": np.random.uniform(1e6, 1e7, n),+ "pe": np.random.uniform(*pe_range, n),+ "pb": np.random.uniform(*pb_range, n),+ "roe": np.random.uniform(*roe_range, n),+ }, index=dates)++ data_map = {+ "000001.SZ": _mock_stock((5, 15), (0.5, 2.0), (8, 20)), # ๅคงๆฆ็ๅ ฅ้+ "600036.SH": _mock_stock((3, 10), (0.3, 1.5), (12, 25)), # ้ซๆฆ็ๅ ฅ้+ "000858.SZ": _mock_stock((30, 80), (5, 15), (5, 10)), # ๅคงๆฆ็ไธๅ ฅ้+ }++ engine = SignalEngine(pe_max=20, pb_max=3, roe_min=8)+ signals = engine.generate(data_map)++ for code in data_map:+ sig = signals[code]+ active_days = (sig > 0).sum()+ print(f"{code}: {active_days}/{len(sig)} days in portfolio")diff --git a/agent/src/skills/geopolitical-risk/SKILL.md b/agent/src/skills/geopolitical-risk/SKILL.mdnew file mode 100644index 000000000..8960d8f04--- /dev/null+++ b/agent/src/skills/geopolitical-risk/SKILL.md@@ -0,0 +1,915 @@+---+name: geopolitical-risk+description: "Geopolitical risk analysis: quantify crisis signals, identify precursors, and build event-driven strategies for war, sanctions, and supply disruption scenarios."+---++# Geopolitical Risk Analysis++## Overview++Quantify geopolitical risk signals, identify crisis precursors, and build event-driven strategies that convert narratives such as "war / conflict / sanctions / supply disruption" into actionable multi-asset allocation decisions.++---++## Core Analytical Framework++### 1. Risk Layering Model++```+Layer 1: Structural risk (long-lasting, slow-moving)+ โโโ Great-power rivalry, alliance structures, nuclear deterrence balance++Layer 2: Situational risk (cyclical escalation, monthly / quarterly scale)+ โโโ Military exercises, election cycles, sanctions escalation, diplomatic friction++Layer 3: Event risk (sudden shocks, daily / hourly scale)+ โโโ Military action, assassination, sanctions announcements, nuclear tests+```++### 2. Five Dimensions of Risk Assessment++| Dimension | Description | Quantitative Proxy |+|------|------|-------------|+| **Intensity** | Severity of conflict / sanctions | GPR Index percentile |+| **Persistence** | Expected duration of the crisis | Futures curve contango / backwardation |+| **Transmission** | Spillover into supply chains / finance | CDS spread widening, VIX jump magnitude |+| **Predictability** | Whether the event is already priced in | Option implied volatility skew |+| **Reversibility** | Whether the situation can be resolved through negotiation | Speed of reversal in news sentiment |++---++## Monitoring the Six Major Global Geopolitical Hotspots++### 1. Strait of Hormuz โ Oil Transport Chokepoint++**Strategic significance**+- Roughly 20% of global oil supply (about 17 million barrels/day) and 20% of LNG passes through it+- Iran has the ability to disrupt the strait through mines, naval assets, and shore-based missiles+- It is the only export route for Gulf states such as Saudi Arabia, the UAE, Kuwait, and Iraq++**Risk triggers**+- Escalation in U.S.-Iran tensions, such as failed nuclear talks or tighter sanctions+- Tankers being seized or attacked+- Iranian blockade drills during military exercises++**Key monitoring indicators**+```python+# Proxy indicators+- Brent-WTI spread widening (signal of regional supply stress)+- Persian Gulf tanker insurance rates (Lloyd's H&M quotes)+- UAE dirham NDF (depreciates under stress)+- Israeli shekel volatility+- Relative strength of VanEck Oil Services ETF (OIH) vs XLE+```++**Asset impact direction**+- Bullish: crude oil, LNG, shipping stocks (BDRY/FRO), defense stocks (LMT/RTX)+- Bearish: airlines (DAL/UAL), petrochemical refiners, emerging-market importers such as INR and KRW++---++### 2. Taiwan Strait โ Core of the Semiconductor Supply Chain++**Strategic significance**+- TSMC accounts for roughly 90% of global advanced-node capacity below 5nm+- Taiwan produces about 65% of the world's semiconductors+- It sits on the main southbound route linking Northeast Asia and Southeast Asia++**Risk triggers**+- Larger-scale Chinese military exercises, especially blockade drills+- U.S. arms sales to Taiwan or high-level official visits+- Major policy changes in cross-strait relations++**Key monitoring indicators**+```python+# Proxy indicators+- Abnormal weakness in the Philadelphia Semiconductor Index (SOX)+- TSM ADR (TSM) premium / discount in the U.S. market+- Taiwan CDS spreads+- TWD NDF depreciation under stress+- KOSPI, given Korea's semiconductor linkage+- U.S.-listed Chinese ADRs / Hong Kong Hang Seng Tech Index+```++**Asset impact direction**+- Bullish: Intel / GlobalFoundries as substitute capacity providers, defense stocks, JPY as a haven+- Bearish: Apple / NVIDIA / AMD / Qualcomm as TSMC clients, TSM ADR, Samsung Electronics+- Extreme scenario: global semiconductor shortage leading to collapse across auto and consumer-electronics supply chains++**Supply chain substitution timeline**+```+3-6 months: inventory drawdown, sharp price spikes+6-18 months: partial substitution by Samsung / Intel IDM advanced capacity+2-4 years: ramp-up from TSMC Arizona and Kumamoto Japan+5+ years: Mainland China's independent advanced process catch-up, with major uncertainty+```++---++### 3. Red Sea / Suez Canal โ Europe-Asia Trade Artery++**Strategic significance**+- The Suez Canal carries about 12% of global trade volume and 30% of container shipping+- The alternative route around the Cape of Good Hope adds 10-14 days and raises cost by 15-25%+- Houthi forces in Yemen threaten the Bab el-Mandeb chokepoint++**Risk triggers** (already validated by the 2024 Houthi attacks)+- Intensified attacks on merchant vessels by Houthi forces+- Israel-Gaza escalation spilling across the region+- Political instability in Eritrea or Somalia++**Key monitoring indicators**+```python+# Proxy indicators+- Daily changes in the Baltic Dry Index (BDI)+- SCFI Shanghai Containerized Freight Index+- Share prices of Maersk and other container shipping companies+- Share of AIS-tracked vessels rerouting via the Cape of Good Hope (>30% is high alert)+- European TTF natural gas prices, given Red Sea LNG exposure+```++**Asset impact direction**+- Bullish: shipping stocks (ZIM/MAERSK/COSCO), tankers rerouting around the Cape (FRO/STNG)+- Bearish: European manufacturers facing supply-chain delays, inflation-sensitive sectors+- Lag effect: higher freight rates โ higher global CPI โ tighter rate expectations++---++### 4. Russia-Ukraine Conflict โ Energy and Food Security++**Strategic significance**+- Russia is the world's largest natural gas exporter and second-largest crude exporter+- Ukraine is a major global grain exporter (wheat / corn / sunflower oil)+- The war has already driven a permanent restructuring of Europe's energy mix++**Ongoing risk points**+- Escalation in nuclear rhetoric, a major tail-risk driver+- Sanctions expanding to third parties, forcing countries like China and India to choose sides+- Continued attacks on Ukrainian infrastructure such as the power grid and ports++**Key monitoring indicators**+```python+# Proxy indicators+- European TTF natural gas futures+- Ukrainian sovereign CDS spreads+- RUB/USD exchange rate under sanctions pressure+- Chicago wheat futures (ZW)+- European power prices, e.g. Germany EEX Baseload+- Russian ETF trading status (RSX liquidated; use substitutes)+```++**Sanctions transmission-chain analysis**+```+Sanctions announcement+ โโโ Financial sanctions โ SWIFT cutoff โ cross-border settlement disruption โ emerging-market debt crisis+ โโโ Energy sanctions โ European gas spike โ industrial energy costs โ eurozone recession+ โโโ Export controls โ Russia semiconductor / military shortages โ weaker war sustainability+ โโโ Grain blockade โ Middle East / Africa food stress โ political instability โ migration pressure+```++---++### 5. South China Sea โ Shipping Lanes and Rare-Earth Competition++**Strategic significance**+- Around one-third of global trade value, roughly USD 3.4 trillion annually, passes through the South China Sea+- China controls about 60% of global rare-earth supply, even more in refining+- Territorial frictions between China and the Philippines / Vietnam persist++**Risk triggers**+- China declaring an Air Defense Identification Zone (ADIZ)+- Clashes around flashpoints such as Sabina Shoal or Scarborough Shoal+- Rare-earth export bans or quota cuts as a technology retaliation tool against the U.S.++**Key monitoring indicators**+```python+# Proxy indicators+- Chinese rare-earth futures prices (permanent magnets / praseodymium-neodymium oxide)+- Philippine peso volatility+- Vietnam industrial park REITs / ETFs+- MP Materials (MP) share price as a substitute rare-earth beneficiary+- Share prices of Chinese shipping companies+```++**Asset impact direction**+- Bullish: rare-earth miners such as MP Materials and Australia's Lynas, Japanese trading houses with inventories+- Bearish: EV / permanent-magnet motor supply chains, Chinese ADRs++---++### 6. Korean Peninsula โ Regional Security Shock Source++**Strategic significance**+- North Korea possesses nuclear weapons and ICBMs, making it a non-trivial tail risk+- Strategic cooperation among China, Russia, and North Korea has deepened, including artillery supply during the Russia-Ukraine war+- South Korea is a major global exporter of semiconductors, shipbuilding, and autos++**Risk triggers**+- Nuclear or missile tests, especially ICBM launches+- North Korea announcing strategic changes such as "nuclear sharing"+- Political crises in South Korea affecting U.S. force deployment++**Key monitoring indicators**+```python+# Proxy indicators+- KRW/USD volatility spike+- KOSPI decline+- South Korean CDS spreads+- JPY safe-haven inflows (JPY/USD strength)+- ADR prices of Samsung / SK Hynix+```++---++## Quantitative Framework for Geopolitical Risk++### GPR Index (Caldara & Iacoviello)++**Definition and source**+- Built by Fed economists Dario Caldara and Matteo Iacoviello+- Computed from war / terror / military-related word frequency in major newspapers globally+- Monthly data back to 1900, covering global and country-specific series+- Official data: https://www.matteoiacoviello.com/gpr.htm++**Index taxonomy**+```+GPR: overall geopolitical risk+GPRT: geopolitical threats (forward-looking)+GPRA: geopolitical acts (events already realized)+GPR_country: country-level sub-index+```++**Python example**+```python+import pandas as pd+import requests++def load_gpr_index():+ """Load the official GPR Index data.++ Returns:+ pd.DataFrame: Monthly GPR data with columns such as GPR, GPRT, and GPRA.+ """+ url = "https://www.matteoiacoviello.com/gpr_files/data_gpr_export.xls"+ df = pd.read_excel(url, index_col=0, parse_dates=True)+ return df++def gpr_signal(df, window=12, threshold=1.5):+ """Generate abnormal GPR signals.++ Args:+ df: DataFrame containing GPR data+ window: Rolling mean window in months+ threshold: Z-score trigger threshold in standard deviations++ Returns:+ pd.Series: Boolean signal where True means high-risk state+ """+ gpr = df["GPR"]+ rolling_mean = gpr.rolling(window).mean()+ rolling_std = gpr.rolling(window).std()+ z_score = (gpr - rolling_mean) / rolling_std+ return z_score > threshold+```++---++### Calculating War Risk Premiums++**Oil war premium**+```python+def oil_war_premium(spot_price, mean_5y_price, supply_disruption_prob,+ disruption_magnitude_pct):+ """Estimate the war-risk premium embedded in crude oil.++ Method:+ A simplified model based on expected supply-disruption value.++ Args:+ spot_price: Current spot price in USD/bbl+ mean_5y_price: Five-year average price as the "no-risk" baseline+ supply_disruption_prob: Probability of supply disruption in [0, 1]+ disruption_magnitude_pct: Price impact of disruption in [0, 1]++ Returns:+ float: Estimated war premium in USD/bbl+ """+ expected_disruption_premium = (+ mean_5y_price * disruption_magnitude_pct * supply_disruption_prob+ )+ observed_premium = spot_price - mean_5y_price+ return max(0, min(observed_premium, expected_disruption_premium))+```++**Gold safe-haven premium**+```python+def gold_geopolitical_premium(gold_price, real_yield_10y, usd_index):+ """Decompose the geopolitical premium component in gold prices.++ Args:+ gold_price: Spot gold price in USD/oz+ real_yield_10y: 10-year real yield in percent+ usd_index: DXY index++ Returns:+ float: Geopolitical premium as the residual component+ """+ import numpy as np+ # Gold fundamentals: real rates (negative) + USD (negative)+ # Linear approximation:+ # Gold โ ฮฑ - ฮฒ1*RealYield - ฮฒ2*DXY + ฮต (geopolitical premium)+ # ฮฒ1 โ 800, ฮฒ2 โ 15 are rough historical estimates that should be updated+ fundamental_value = 2000 - 800 * real_yield_10y - 15 * (usd_index - 100)+ return gold_price - fundamental_value+```++---++### Supply-Chain Disruption Probability Assessment++**Bayesian update framework**+```python+def update_disruption_probability(prior_prob, new_event_severity, base_rate=0.05):+ """Update supply-chain disruption probability using a new event.++ This is a simplified Bayesian update that adjusts the prior+ using the severity of the new event.++ Args:+ prior_prob: Prior disruption probability+ new_event_severity: Event severity in [0, 1]+ 0.0 = diplomatic friction+ 0.3 = military standoff+ 0.6 = local conflict+ 1.0 = full-scale war+ base_rate: Historical annualized baseline disruption rate++ Returns:+ float: Updated disruption probability+ """+ # Likelihood ratio: how much more likely the event is before a real disruption+ # than in a non-disruption state+ likelihood_ratio = 1 + 9 * new_event_severity # 1x ~ 10x+ posterior = (prior_prob * likelihood_ratio) / (+ prior_prob * likelihood_ratio + (1 - prior_prob)+ )+ return posterior+```++---++### Quantifying Sanctions Transmission Chains++**Sanctions intensity scorecard**++| Sanction Type | Intensity Score | Typical Asset Shock | Expected Duration |+|----------|--------|-------------|-------------|+| Targeted sanctions on people / entities | 1-2 | <0.5% | Short-lived |+| Sector-level export controls | 3-4 | 1-3% | Several months |+| SWIFT cutoff | 7-8 | 5-15% | Long-lasting |+| Full-scale economic sanctions | 9-10 | 10-30% | Structural |+| Oil embargo | 8-9 | Crude +10-30% | Medium-term |++---++## Asset-Class Impact Mapping++### Energy++| Asset | Hormuz | Russia-Ukraine | Red Sea | Notes |+|------|---------|------|------|------|+| Brent crude | +++ shock | ++ persistent | + mild | Primary geopolitical-risk asset |+| WTI crude | ++ shock | ++ persistent | + mild | Widens against Brent |+| Europe TTF gas | ++ | +++ | + | Cost of replacing Russian gas |+| LNG futures | +++ | ++ | ++ | Red Sea disruption matters for Asian LNG |+| Relevant ETFs | XLE, OIH, UNG | | | |++### Precious Metals (Safe Haven Function)++```+Gold (GLD/GC): geopolitical shock โ immediate rally, but persistence depends on real-rate direction+Silver (SLV/SI): industrial exposure dilutes safe-haven behavior and raises volatility+Palladium / platinum: Russia is a major producer, so sanctions hit supply directly+```++**Empirical patterns (2001-2024)**+- A 1-standard-deviation rise in GPR implies about +1.2% expected gold return over a 1-month window+- On day one of major shocks such as Pearl Harbor, 9/11, or Russia-Ukraine, gold rose roughly 3-8%+- Within 60 days, around 50-70% of the geopolitical premium mean-reverts++### Agriculture++| Asset | Russia-Ukraine Conflict | South China Sea Blockade | Driver |+|------|---------|---------|---------|+| Wheat (ZW) | +++ | + | Russia + Ukraine account for about 30% of exports |+| Corn (ZC) | ++ | + | Ukraine is a major exporter |+| Sunflower oil | +++ | - | Ukraine accounts for roughly 50% globally |+| Soybeans (ZS) | + | + | China import demand |++### Semiconductors / Technology++```+Estimated impact under a Taiwan Strait crisis:+- Mild military tension (drills): SOX -5% to -10%+- Blockade drill (1 month): SOX -15% to -25%+- Actual military conflict: SOX -40% to -60% (no true historical analogue)++Beneficiaries through substitution:+- Intel (INTC): IDM model with U.S.-based capacity+- GlobalFoundries (GFS): U.S. / Europe / Singapore capacity+- Samsung, though Korea itself is also a geopolitical risk zone+```++### Shipping / Logistics++```+Key ETFs and stocks:+- BDRY: bulk-shipping freight ETF tracking BDI, highly sensitive to Red Sea / Hormuz shocks+- ZIM: Israeli container shipper, directly exposed to Red Sea risk+- FRO (Frontline): tanker beneficiary of Hormuz risk+- STNG (Scorpio Tankers): benefits from rerouting around the Red Sea+- MAERSK.B: container-shipping leader that benefits from freight spikes during crises+```++### Defense++```+U.S. defense ETFs: ITA (iShares), XAR (SPDR)++Single-stock beneficiaries of geopolitical risk:+- LMT (Lockheed Martin): F-35, missile systems+- RTX (Raytheon): air-defense systems such as Patriot+- NOC (Northrop Grumman): B-21 bomber, nuclear systems+- BA (Boeing): military exposure, though commercial aviation can be hurt by geopolitics++Historical pattern:+Higher geopolitical risk โ faster defense budget approvals โ effect shows up with a 6-12 month lag+```++### FX (Safe-Haven Currencies)++```+Capital flows during crises:+Risk currencies (AUD/NZD/MXN/KRW/BRL) โ outflows+Safe-haven currencies (JPY/CHF/USD) โ inflows++JPY:+- Net-creditor-nation status + repatriation effect+- Historical crisis moves: +1% to +3% vs USD++CHF:+- Neutral country + European financial center+- Major crises: +2% to +5% vs EUR++USD:+- Global reserve currency and final safe haven during crises+- But if the U.S. homeland is directly attacked, USD can weaken instead++Note: High-carry funding currencies such as TRY and ARS tend to suffer the most when global risk aversion rises+```++---++## Event-Driven Strategy Framework++### Phase 1: Positioning Before the Crisis (Early-Warning Signal Detection)++**Signal classification system**++```python+SIGNAL_LEVELS = {+ "GREEN": {+ "desc": "Normal geopolitical risk level",+ "gpr_percentile": (0, 50),+ "action": "Standard allocation, no special hedge required"+ },+ "YELLOW": {+ "desc": "Risk rising, watch for escalation",+ "gpr_percentile": (50, 75),+ "action": "Small long-gold position, reduce high-risk asset exposure by 10%"+ },+ "ORANGE": {+ "desc": "High-risk state, potential shock approaching",+ "gpr_percentile": (75, 90),+ "action": "Add safe-haven assets, buy OTM protective options, bullish on oil"+ },+ "RED": {+ "desc": "Extreme risk, crisis may break out",+ "gpr_percentile": (90, 100),+ "action": "Maximize defensive positioning, hold cash / gold / Treasuries, short high-risk assets"+ }+}+```++**Early-warning checklist**+```+Diplomatic:+ [ ] Embassy closures / downgrades+ [ ] Diplomat expulsions+ [ ] UN emergency meeting called+ [ ] Escalation in joint statements by multiple countries++Military:+ [ ] Large-scale exercises (>50,000 personnel)+ [ ] Carrier strike group forward deployment+ [ ] Higher readiness announcements+ [ ] Missile / nuclear system release orders++Financial:+ [ ] Target-country CDS spread breaks historical highs+ [ ] Exchange rate devaluation >3% in one week+ [ ] Sharp decline in FX reserves+ [ ] Accelerating capital flight+```++---++### Phase 2: Trading During the Crisis++**Volatility trading framework**+```python+def crisis_vol_strategy(underlying, option_chain):+ """Volatility trading framework during crises.++ Crisis outbreaks usually cause:+ 1. A short-term VIX spike (long VIX futures / options)+ 2. Inversion in the IV term structure (front month > back month)+ 3. Steeper put skew++ Args:+ underlying: Underlying asset ticker+ option_chain: Option chain data++ Returns:+ dict: Recommended strategies and sizing guidance+ """+ strategies = {+ "long_vix_futures": {+ "instrument": "Front-month VX futures",+ "trigger": "VIX < 20 and GPR > 75th percentile",+ "target": "VIX spikes to 35-50",+ "stop": "VIX falls 15% below entry"+ },+ "backspread": {+ "instrument": f"Buy OTM Put + sell ATM Put on {underlying}",+ "trigger": "Implied volatility is at a historical low",+ "profit_zone": "Large drop > 10%"+ },+ "calendar_spread": {+ "instrument": "Sell near-month ATM + buy far-month ATM",+ "trigger": "Exit when term-structure inversion becomes excessive",+ "profit_zone": "Volatility mean reversion"+ }+ }+ return strategies+```++**Crisis allocation matrix**+```+Crisis type | Gold | Oil | Defense | JPY | Treasuries | EM+Energy conflict | ++ | +++ | ++ | + | + | ---+Nuclear escalation | +++ | + | + | +++ | +++ | ---+Sanctions / trade | + | + | + | + | + | --+Food crisis | + | 0 | 0 | 0 | + | -- (importers)+Sea blockade | + | ++ | + | + | + | -+```++---++### Phase 3: Mean Reversion After the Crisis++**Recovery time of historical events**++| Event | S&P 500 Max Drawdown | Days to Recover Prior High | Max Oil Rally | Max Gold Rally |+|------|----------------|--------------|-------------|-------------|+| 9/11 attacks (2001) | -11.6% | 31 days | -35% (demand collapse) | +5% |+| Iraq War (2003) | -3% | <30 days | +40% (within 1 year) | +15% |+| Russia-Georgia War (2008) | <-5% | <30 days | Overlapped with financial crisis | +10% |+| Crimea (2014) | -1% | 7 days | -5% | +3% |+| Full invasion of Ukraine (2022) | -3% briefly | <20 days | +40% (within 3 months) | +5% |++**Core patterns**+```+1. The initial equity shock from geopolitical events usually recovers within 30 days unless recession hits simultaneously+2. Energy / commodities effects last longer because supply-side changes are structural+3. Go long the most damaged assets once the crisis de-escalates and mean reversion starts+4. Sell safe-haven assets that exploded during the crisis, especially gold after tension fades+```++**Mean-reversion signals**+```python+REVERSION_SIGNALS = [+ "Ceasefire agreement signed / negotiations announced",+ "Energy / grain exports resume, confirmed by shipping data",+ "Target-country CDS spreads retrace >20% from the peak",+ "GPR Index falls >30% from the peak",+ "VIX drops below 20 after peaking",+ "Safe-haven currencies such as JPY / CHF begin weakening"+]+```++---++## Data Sources and APIs++### 1. GPR Index (Most Important Quantitative Dataset)++```python+# Official download, free, monthly updates+GPR_DATA_URL = "https://www.matteoiacoviello.com/gpr_files/data_gpr_export.xls"++# High-frequency daily GPR based on Twitter / news+# Access request required: https://www.policyuncertainty.com/gpr_daily.html++# Related paper:+# Caldara & Iacoviello (2022), "Measuring Geopolitical Risk"+# American Economic Review, 112(4): 1194-1225+```++### 2. GDELT Global Event Database (Free)++```python+# GDELT 2.0 provides global news-event data updated every 15 minutes+# Includes the CAMEO event code system for military / diplomatic / conflict classification++def query_gdelt_events(country_code, event_type, start_date, end_date):+ """Query GDELT geopolitical event data.++ GDELT BigQuery table: gdelt-bq.gdeltv2.events+ CAMEO root codes: 14=protest, 18=assault, 19=fight, 20=mass violence++ Args:+ country_code: FIPS country code, e.g. 'CH' for China, 'RS' for Russia+ event_type: CAMEO root code+ start_date: Start date in YYYY-MM-DD+ end_date: End date in YYYY-MM-DD++ Returns:+ pd.DataFrame: Event records+ """+ from google.cloud import bigquery+ client = bigquery.Client()++ query = f"""+ SELECT SQLDATE, Actor1CountryCode, Actor2CountryCode,+ EventCode, GoldsteinScale, NumMentions, AvgTone+ FROM `gdelt-bq.gdeltv2.events`+ WHERE (Actor1CountryCode = '{country_code}'+ OR Actor2CountryCode = '{country_code}')+ AND EventRootCode = '{event_type}'+ AND SQLDATE BETWEEN '{start_date.replace('-','')}'+ AND '{end_date.replace('-','')}'+ ORDER BY SQLDATE DESC+ """+ return client.query(query).to_dataframe()+```++### 3. ACLED Armed Conflict Location & Event Data++```python+# Armed Conflict Location & Event Data Project+# https://acleddata.com/+# Covers 100+ countries and is free for approved academic access++ACLED_API_BASE = "https://api.acleddata.com/acled/read"++def fetch_acled_events(country, start_date, end_date, api_key):+ """Fetch ACLED armed-conflict event data.++ Args:+ country: Country name in English+ start_date: Start date in YYYY-MM-DD+ end_date: End date in YYYY-MM-DD+ api_key: ACLED API key++ Returns:+ pd.DataFrame: Conflict event data+ """+ import requests+ import pandas as pd++ params = {+ "key": api_key,+ "email": "[email protected]",+ "country": country,+ "event_date": f"{start_date}|{end_date}",+ "event_date_where": "BETWEEN",+ "export_type": "json"+ }+ resp = requests.get(ACLED_API_BASE, params=params)+ return pd.DataFrame(resp.json()["data"])+```++### 4. Real-Time News Sentiment Analysis++```python+# Option A: Use the Jina Reader API integrated in the project through read_url+def analyze_geopolitical_news(query: str) -> dict:+ """Read news through Jina and analyze geopolitical-risk sentiment.++ Use together with the agent's read_url tool.++ Args:+ query: Search keywords++ Returns:+ dict: Sentiment-analysis result+ """+ # Recommended news sources:+ news_sources = [+ "https://www.reuters.com/world/",+ "https://www.bloomberg.com/politics",+ "https://www.ft.com/world",+ "https://www.foreignpolicy.com/"+ ]+ # Use read_url to fetch content, then pass it to the LLM to extract risk events++# Option B: Event Registry API (paid, structured news)+# https://eventregistry.org/+# Supports filtering by country / topic / time and returns standardized events++# Option C: VADER / FinBERT sentiment analysis+# Score geopolitical news sentiment and build high-frequency signals+```++### 5. Other Practical Data Sources++```python+DATA_SOURCES = {+ "oil_tanker_tracking": {+ "desc": "Crude oil / LNG vessel AIS tracking",+ "source": "MarineTraffic API (paid) / VesselFinder (limited free)",+ "use_case": "Real-time monitoring of traffic through Hormuz / the Red Sea"+ },+ "un_vote_data": {+ "desc": "UN General Assembly / Security Council voting records",+ "source": "UN Data API (free)",+ "use_case": "Track changes in great-power alignment"+ },+ "arms_transfer": {+ "desc": "Arms transfers and military aid data",+ "source": "SIPRI Arms Transfers Database (free)",+ "use_case": "Estimate conflict-escalation probability"+ },+ "nuclear_risk": {+ "desc": "Real-time nuclear-risk assessment",+ "source": "Bulletin of the Atomic Scientists Doomsday Clock",+ "use_case": "Tail-risk monitoring"+ },+ "commodity_futures": {+ "desc": "Commodity futures prices, including geopolitical premium",+ "source": "Integrated in this project: Tushare commodity futures / OKX crypto",+ "use_case": "Estimate war premium"+ }+}+```++---++## Application Scenarios++### Scenario 1: Geopolitical Risk Dashboard (Monthly Refresh)++```+Run at the start of each month:+1. Download the latest GPR Index data+2. Calculate CDS spread changes for each hotspot country+3. Analyze tanker insurance rates+4. Summarize counts of high-intensity GDELT conflict events+5. Output a composite risk score (0-100) plus allocation guidance+```++### Scenario 2: Rapid Event Shock Assessment++```+Trigger:+Major geopolitical event breaks out, such as a missile strike or sanctions announcement++Execution flow:+1. Identify the event type and intensity (0-10)+2. Map the affected asset classes+3. Estimate the short-term price shock range+4. Identify hedging instruments (options / futures / ETFs)+5. Set stop-loss rules and position size+```++### Scenario 3: Quarterly Risk Stress Testing++```python+# Geopolitical scenario stress tests for a portfolio+SCENARIOS = {+ "hormuz_blockade_30d": {+ "oil_price_shock": +40,+ "gold_shock": +8,+ "equity_shock": -12,+ "usd_shock": +3,+ "description": "30-day Strait of Hormuz blockade scenario"+ },+ "taiwan_conflict_mild": {+ "semioconductor_shock": -25,+ "gold_shock": +5,+ "equity_shock": -15,+ "jpy_shock": +8,+ "description": "Mild Taiwan Strait military conflict scenario"+ },+ "russia_gas_cutoff": {+ "eu_natgas_shock": +80,+ "eu_equity_shock": -20,+ "eur_shock": -8,+ "gold_shock": +6,+ "description": "Russia fully cuts off gas to Europe"+ }+}++def portfolio_stress_test(portfolio_weights, scenarios=SCENARIOS):+ """Run geopolitical scenario stress tests on a portfolio.++ Args:+ portfolio_weights: dict mapping asset ticker to weight+ scenarios: Scenario-definition dictionary++ Returns:+ pd.DataFrame: Expected portfolio PnL under each scenario+ """+ results = {}+ for scenario_name, shocks in scenarios.items():+ portfolio_pnl = sum(+ portfolio_weights.get(asset, 0) * shock / 100+ for asset, shock in shocks.items()+ if asset != "description"+ )+ results[scenario_name] = {+ "portfolio_return": portfolio_pnl,+ "description": shocks["description"]+ }+ return results+```++### Scenario 4: Backtest of a GPR-Driven Dynamic Hedge++```python+# Strategy logic:+# When GPR > 75th percentile, hold 5% gold + 5% oil calls+# When GPR < 25th percentile, revert to standard allocation+# Historical backtests suggest a roughly 30-40% reduction in tail losses+# across major crises from 2001-2023++def gpr_dynamic_hedge_backtest(returns_data, gpr_data,+ hedge_assets=["GLD", "USO"],+ hedge_weight=0.05):+ """Backtest a GPR-driven dynamic hedge strategy.++ Args:+ returns_data: pd.DataFrame of daily asset returns+ gpr_data: pd.Series of monthly GPR Index values+ hedge_assets: List of hedge assets+ hedge_weight: Allocation weight per hedge asset++ Returns:+ pd.DataFrame: Return comparison before and after hedging+ """+ import pandas as pd++ # Map monthly GPR to daily frequency.+ gpr_daily = gpr_data.resample("D").ffill()+ gpr_threshold = gpr_daily.quantile(0.75)++ hedge_signal = gpr_daily > gpr_threshold++ base_return = returns_data.drop(columns=hedge_assets, errors="ignore").mean(axis=1)+ hedge_return = returns_data[hedge_assets].mean(axis=1) if hedge_assets else 0++ hedged_return = base_return.copy()+ hedged_return[hedge_signal] = (+ base_return[hedge_signal] * (1 - len(hedge_assets) * hedge_weight) ++ hedge_return[hedge_signal] * len(hedge_assets) * hedge_weight+ )++ return pd.DataFrame({+ "base": base_return,+ "hedged": hedged_return,+ "hedge_active": hedge_signal.astype(int)+ })+```++---++## References and Further Reading++```+Academic papers:+- Caldara & Iacoviello (2022), "Measuring Geopolitical Risk", AER+- Apergis et al. (2021), "Geopolitical Risks and Asset Prices"+- Mueller & Rauh (2018), "The Hard Problem of Prediction for Conflict Prevention"++Data resources:+- GPR Index: https://www.matteoiacoviello.com/gpr.htm+- GDELT: https://www.gdeltproject.org/+- ACLED: https://acleddata.com/+- SIPRI: https://www.sipri.org/databases++Market-analysis tools:+- BDI (Baltic Dry Index): https://www.balticexchange.com/+- CDS spread data: Bloomberg / Refinitiv (paid) / FRED (partially free)+- Vessel AIS tracking: MarineTraffic.com+```diff --git a/agent/src/skills/global-macro/SKILL.md b/agent/src/skills/global-macro/SKILL.mdnew file mode 100644index 000000000..40aba529b--- /dev/null+++ b/agent/src/skills/global-macro/SKILL.md@@ -0,0 +1,155 @@+---+name: global-macro+description: Global macro analysis framework (central bank policy transmission / FX forecasting / geopolitical risk / capital flows), used to build macro factor signals that drive cross-asset allocation.+---+# Global Macro Analysis++## Overview++Builds a macro analysis framework from three dimensions: central-bank policy, exchange-rate regimes, and geopolitics. Outputs quantifiable macro factor signals to drive cross-asset allocation decisions. Core logic: macro cycles determine major asset direction, while micro-level timing is delegated to other skills.++## Core Concepts++### 1. Central Bank Policy Transmission Chain++```+Policy-rate changes โ government bond yield curve โ credit spreads โ financing costs for the real economy โ corporate earnings โ equity valuation+```++**Monitoring framework for the three major central banks:**++| Central Bank | Core Indicators | Forward Signals | Lagging Confirmation |+|------|---------|---------|---------|+| Federal Reserve (Fed) | FFR, dot plot, SEP | CME FedWatch probabilities | nonfarm payrolls / CPI / PCE |+| European Central Bank (ECB) | Main refinancing rate | Eurozone PMI, HICP | credit growth |+| Bank of Japan (BOJ) | YCC band, policy rate | JPY exchange rate, JGB yields | core CPI |++**Historical transmission of Fed hiking / cutting cycles to China A-shares (empirical):**+- Late in a Fed hiking cycle (the last 1-2 hikes), China A-shares often have already priced it in, and the average drawdown of the CSI 300 narrows to -3%+- In the 3 months after the first Fed cut, the CSI 300 has averaged +8.2% (mean of the 2001 / 2007 / 2019 cycles)+- But rate cuts do not automatically mean gains. In 2008, cuts came with recession and China A-shares still fell++### 2. Exchange Rate Forecasting Framework++**Three-layer model:**++| Model | Applicable Horizon | Core Variables | Accuracy |+|------|---------|---------|------|+| Purchasing Power Parity (PPP) | 3-5 years | CPI gap between two countries | Long-term anchor |+| Interest Parity (UIP/CIP) | 3-12 months | rate differential + forward premium/discount | Medium-term direction |+| BEER model | 1-3 years | terms of trade + net foreign inflows + productivity | Equilibrium estimate |++**USD/CNY practical checklist:**+- China-US 10Y spread > 0: appreciation pressure on the RMB (capital inflows)+- China-US 10Y spread < -150bp: rising depreciation pressure on the RMB+- Net FX settlement surplus / deficit: directly reflects conversion direction of corporates and households+- PBOC fixing vs market expectation: signal that the countercyclical factor has been activated++### 3. Geopolitical Risk Assessment++**Quantitative approach (proxy for the GPR index):**++```python+# Geopolitical risk proxy indicators+risk_indicators = {+ "vix": "Fear index > 25 = high risk",+ "gold_oil_ratio": "Gold / oil > 25 = rising risk aversion",+ "usd_index": "DXY jump > 2% / week = capital flowing back to USD",+ "credit_spread": "IG spread > 150bp = credit tightening",+ "em_spread": "EMBI spread widening > 50bp / month = emerging-market stress"+}+```++**Typical asset impacts of geopolitical events (historical averages):**+- Local conflicts: gold +3-5%, oil +5-15%, equities -2-5%, with impact lasting 1-4 weeks+- Trade friction: affected sectors -10-20%, beneficiary substitute sectors +5-10%, lasting 3-6 months+- Financial sanctions: sanctioned-country currency -10-30%, commodity supply side hit++### 4. Global Capital Flow Tracking++**Key data sources:**+- EPFR fund flows: weekly net inflows into global equity / bond funds+- Northbound flows (Shanghai-Shenzhen-Hong Kong Stock Connect): daily, with net buying > 10 billion RMB in a day as a strong signal+- US Treasury TIC data: monthly, showing changes in foreign holdings of Treasuries+- FX reserve changes: quarterly, indicating central-bank asset allocation direction++**Northbound flow signal rules (China A-share practice):**++| Signal | Condition | Meaning |+|------|------|------|+| Strong buy | Net buying for 5 consecutive days and cumulative amount > 20 billion RMB | Foreign investors are building positions trendwise |+| Weak buy | Single-day net buying > 8 billion RMB | Short-term sentiment is bullish |+| Warning | Net selling for 5 consecutive days and cumulative amount > 15 billion RMB | Foreign investors are reducing positions trendwise |+| Neutral | Daily net flow within ยฑ3 billion RMB | No directional signal |++### 5. Dollar Cycle and Emerging Markets++**Four-stage dollar cycle model:**++```+Strong-dollar phase (DXY rising) โ capital outflows from emerging markets โ EM currency depreciation โ EM equities and bonds both sell off+Weak-dollar phase (DXY falling) โ capital flows back into EM โ EM currency appreciation โ EM assets outperform developed markets+```++**Practical mapping:**+- DXY > 105 and trending up: underweight emerging markets (China A-shares / Hong Kong stocks), overweight USD assets+- DXY < 100 and trending down: overweight emerging markets, underweight USD assets+- DXY in the 100-105 range: allocate selectively based on fundamentals++## Analysis Framework++### Steps for Building a Macro Dashboard++1. **Data collection**: rates (US 10Y / China 10Y government bonds), FX (DXY / USD-CNY), commodities (gold / oil / copper), capital flows (northbound / EPFR)+2. **Cycle positioning**: which stage are we in now: hiking / cutting / pause? Strong-dollar or weak-dollar cycle?+3. **Factor scoring**: score each macro factor from -2 to +2 (-2 = extremely bearish, +2 = extremely bullish)+4. **Asset mapping**: macro factor scores โ recommended weights for major asset classes++### Example Macro Factor Scoring++```python+macro_factors = {+ "fed_policy": +1, # Hiking pause, dovish tilt+ "cny_pressure": -1, # RMB depreciation pressure+ "geopolitical": 0, # Neutral geopolitical risk+ "northbound_flow": +2, # Persistent net northbound buying+ "usd_cycle": -1, # Stronger USD+}+# Composite score = sum(values) / len(values) = +0.2 โ neutral to mildly bullish+```++## Output Format++```+## Macro Analysis Report++### Cycle Positioning+- Federal Reserve: [late hiking / pause / early cutting]+- Dollar cycle: [strong / range-bound / weak]+- China monetary policy: [easing / neutral / tightening]++### Factor Scores (-2 ~ +2)+| Factor | Score | Basis |+|------|------|------|+| Central bank policy | +1 | Fed paused hiking and the market expects cuts this year |+| FX pressure | -1 | USD/CNY broke above 7.2 and FX settlement turned into deficit |+| Capital flows | +2 | Northbound net buying exceeded 20 billion RMB continuously |++### Asset Allocation Recommendations+- China A-shares: [overweight / neutral / underweight] โ rationale+- Hong Kong stocks: [overweight / neutral / underweight] โ rationale+- Gold: [overweight / neutral / underweight] โ rationale+- US Treasuries: [overweight / neutral / underweight] โ rationale++### Risk Warnings+- [specific risk events and potential impacts]+```++## Notes++- Macro analysis provides directional guidance, not precise timing. Leave timing to skills such as `technical-basic` or `volatility`+- Central-bank policy judgment should be based on official statements and meeting minutes. Do not over-interpret unofficial messages+- Exchange-rate forecasting has large errors. PPP deviations can persist for years, so use it for direction only, not exact levels+- Northbound flows contain noise (arbitrage / hedging), so persistence matters (at least 3 consecutive days in the same direction)+- Geopolitical shocks are usually short-lived (1-4 weeks) unless they change fundamentals (such as long-term sanctions or trade wars)+- This framework is not investment advice and is for research backtesting onlydiff --git a/agent/src/skills/harmonic/SKILL.md b/agent/src/skills/harmonic/SKILL.mdnew file mode 100644index 000000000..2db9ed2bd--- /dev/null+++ b/agent/src/skills/harmonic/SKILL.md@@ -0,0 +1,39 @@+---+name: harmonic+description: Harmonic Patterns signal engine. Identifies XABCD five-point structures such as Gartley/Bat/Butterfly/Crab based on Fibonacci geometry, and generates trading signals in the PRZ (Potential Reversal Zone).+---+# Harmonic Patterns++## Purpose++The Fibonacci geometry school uses precise ratio relationships to identify price patterns:++| Pattern | B-Point Retracement | D-Point Retracement | Direction |+|------|---------|---------|------|+| Gartley | 0.618 XA | 0.786 XA | Reversal |+| Bat | 0.382-0.5 XA | 0.886 XA | Reversal |+| Butterfly | 0.786 XA | 1.27 XA | Reversal |+| Crab | 0.382-0.618 XA | 1.618 XA | Reversal |++## Core Concepts++- **XABCD five-point pattern**: a price structure defined by precise Fibonacci ratios+- **PRZ (Potential Reversal Zone)**: the convergence area around point D, where reversal probability is high+- Bullish pattern (point D at the bottom) โ buy signal+- Bearish pattern (point D at the top) โ sell signal++## Dependencies++```bash+pip install pyharmonics pandas numpy requests+```++## Parameters++| Parameter | Default | Description |+|------|--------|------|+| is_stock | False | Whether the instrument is a stock (affects analysis parameters) |++## Signal Convention++- `1` = long, `-1` = short, `0` = stand asidediff --git a/agent/src/skills/harmonic/example_signal_engine.py b/agent/src/skills/harmonic/example_signal_engine.pynew file mode 100644index 000000000..5033529d4--- /dev/null+++ b/agent/src/skills/harmonic/example_signal_engine.py@@ -0,0 +1,510 @@+"""่ฐๆณขๅฝขๆ๏ผHarmonic Patterns๏ผไฟกๅทๅผๆใ++ๅบไบ Fibonacci ๅ ไฝๅญฆๆดพ๏ผ่ฏๅซ Gartley/Bat/Butterfly/Crab ็ญ XABCD ไบ็นๅฝขๆ๏ผ+ๅจ PRZ๏ผๆฝๅจๅ่ฝฌๅบ๏ผ็ๆไบคๆไฟกๅทใ++ไผๅ ไฝฟ็จ pyharmonics ๅบ๏ผ่ฅไธๅฏ็จๅๅ้ๅฐๅ ็ฝฎๆฃๆตๅจใ+"""++from typing import Dict, List, Optional, Tuple++import numpy as np+import pandas as pd+++# ---------------------------------------------------------------------------+# Harmonic pattern definitions: (b_ratio_range, d_ratio_range, name)+# b_ratio = AB / XA+# d_ratio = AD / XA (ๅฏนไบ็ๆถจๅฝขๆ๏ผAD = X price - D price ็็ปๅฏน่ท็ฆป)+# ---------------------------------------------------------------------------+PATTERNS = {+ "Gartley": {+ "b_retrace": (0.55, 0.68), # AB / XA โ 0.618+ "d_retrace": (0.72, 0.84), # AD / XA โ 0.786+ "bc_ratio": (0.382, 0.886), # BC / AB+ "cd_ratio": (1.27, 1.618), # CD / BC+ },+ "Bat": {+ "b_retrace": (0.33, 0.55), # AB / XA โ 0.382-0.5+ "d_retrace": (0.82, 0.94), # AD / XA โ 0.886+ "bc_ratio": (0.382, 0.886),+ "cd_ratio": (1.618, 2.618),+ },+ "Butterfly": {+ "b_retrace": (0.72, 0.84), # AB / XA โ 0.786+ "d_retrace": (1.20, 1.38), # AD / XA โ 1.27 (่ถ ๅบX)+ "bc_ratio": (0.382, 0.886),+ "cd_ratio": (1.618, 2.618),+ },+ "Crab": {+ "b_retrace": (0.33, 0.68), # AB / XA โ 0.382-0.618+ "d_retrace": (1.52, 1.72), # AD / XA โ 1.618 (ๆ่ฟๅปถไผธ)+ "bc_ratio": (0.382, 0.886),+ "cd_ratio": (2.24, 3.618),+ },+}+++def _in_range(value: float, lo: float, hi: float, tol: float = 0.0) -> bool:+ """ๆฃๆฅ value ๆฏๅฆๅจ [lo - tol, hi + tol] ่ๅดๅ ใ++ Args:+ value: ๅพ ๆฃๆฅๆฐๅผใ+ lo: ๅบ้ดไธ็ใ+ hi: ๅบ้ดไธ็ใ+ tol: ๅฎนๅทฎใ++ Returns:+ ๆฏๅฆๅจ่ๅดๅ ใ+ """+ return (lo - tol) <= value <= (hi + tol)+++# ========================== ๅ ็ฝฎ่ฐๆณขๆฃๆตๅจ ==================================+++def _find_swings(+ high: pd.Series,+ low: pd.Series,+ window: int = 10,+) -> Tuple[pd.Series, pd.Series]:+ """ๆฃๆตๆๅจ้ซไฝ็นใ++ ไฝฟ็จๆปๅจ็ชๅฃๆนๆณ๏ผๅฝๆๆ นK็บฟ็้ซ็น็ญไบๅๅ window ๆ นK็บฟ็ๆๅคงๅผๆถ๏ผ+ ๅคๅฎไธบๆๅจ้ซ็น๏ผไฝ็นๅ็ใ++ Args:+ high: ๆ้ซไปทๅบๅใ+ low: ๆไฝไปทๅบๅใ+ window: ๅ็ชๅฃๅคงๅฐ๏ผๅฎ้ ็ชๅฃไธบ 2*window+1ใ++ Returns:+ (swing_highs, swing_lows) ไธคไธช Series๏ผNaN ไฝ็ฝฎ่กจ็คบ้ๆๅจ็นใ+ """+ full_window = window * 2 + 1+ rolling_max = high.rolling(full_window, center=True).max()+ rolling_min = low.rolling(full_window, center=True).min()++ swing_high = high.where(high == rolling_max)+ swing_low = low.where(low == rolling_min)++ return swing_high.dropna(), swing_low.dropna()+++def _merge_swings(+ swing_highs: pd.Series,+ swing_lows: pd.Series,+) -> List[Tuple]:+ """ๅๅนถๆๅจ้ซไฝ็นไธบๆถ้ดๆๅบ็ๅบๅใ++ Args:+ swing_highs: ๆๅจ้ซ็นๅบๅใ+ swing_lows: ๆๅจไฝ็นๅบๅใ++ Returns:+ ๆๅบๅ่กจ๏ผๆฏไธชๅ ็ด ไธบ (timestamp, price, type)๏ผtype ไธบ "H" ๆ "L"ใ+ """+ points = []+ for ts, price in swing_highs.items():+ points.append((ts, price, "H"))+ for ts, price in swing_lows.items():+ points.append((ts, price, "L"))+ points.sort(key=lambda x: x[0])++ # ๅป้ค่ฟ็ปญๅ็ฑปๅ็น๏ผไฟ็ๆๅผ๏ผ+ merged = []+ for pt in points:+ if not merged or merged[-1][2] != pt[2]:+ merged.append(pt)+ else:+ # ๅ็ฑปๅๅๆๅผ+ if pt[2] == "H" and pt[1] > merged[-1][1]:+ merged[-1] = pt+ elif pt[2] == "L" and pt[1] < merged[-1][1]:+ merged[-1] = pt+ return merged+++def _classify_pattern(+ x_price: float,+ a_price: float,+ b_price: float,+ c_price: float,+ d_price: float,+ tol: float = 0.08,+) -> Optional[str]:+ """ๆ นๆฎ Fibonacci ๆฏ็ๅคๆญ XABCD ๅฑไบๅช็ง่ฐๆณขๅฝขๆใ++ Args:+ x_price: X ็นไปทๆ ผใ+ a_price: A ็นไปทๆ ผใ+ b_price: B ็นไปทๆ ผใ+ c_price: C ็นไปทๆ ผใ+ d_price: D ็นไปทๆ ผใ+ tol: ๆฏ็ๅฎนๅทฎใ++ Returns:+ ๅฝขๆๅ็งฐ๏ผๅฆ "Gartley"๏ผ๏ผ่ฅไธๅน้ ไปปไฝๅฝขๆๅ่ฟๅ Noneใ+ """+ xa = abs(a_price - x_price)+ ab = abs(b_price - a_price)+ bc = abs(c_price - b_price)+ cd = abs(d_price - c_price)++ if xa == 0 or ab == 0 or bc == 0:+ return None++ b_retrace = ab / xa+ d_retrace = (ab - cd + bc) / xa # ่ฟไผผ AD/XA๏ผ้ๆ นๆฎๆนๅ่ฐๆด++ # ๆด็ฒพ็กฎ็ D ็นๅๆค่ฎก็ฎ+ ad = abs(d_price - a_price)+ d_retrace = ad / xa++ bc_ratio = bc / ab+ cd_ratio = cd / bc if bc != 0 else 0.0++ for name, rules in PATTERNS.items():+ # Primary validation: B retrace and D retrace (most important)+ if (+ _in_range(b_retrace, *rules["b_retrace"], tol=tol)+ and _in_range(d_retrace, *rules["d_retrace"], tol=tol)+ ):+ return name+ return None+++def _detect_patterns_fallback(+ df: pd.DataFrame,+ swing_window: int = 10,+ tol: float = 0.08,+) -> List[Dict]:+ """ๅ ็ฝฎ่ฐๆณขๅฝขๆๆฃๆต๏ผๅ้ๆนๆก๏ผใ++ ๆต็จ๏ผๆพๆๅจ็น โ ๆไธพ5็น็ปๅ โ ้ช่ฏ Fibonacci ๆฏ็ โ ่พๅบๅฝขๆใ++ Args:+ df: OHLCV DataFrame๏ผ้ๅซ high/low/close ๅใ+ swing_window: ๆๅจ็นๆฃๆต็ชๅฃใ+ tol: Fibonacci ๆฏ็ๅฎนๅทฎใ++ Returns:+ ๆฃๆตๅฐ็ๅฝขๆๅ่กจ๏ผๆฏ้กนๅซ pattern/direction/d_index/d_price ็ญๅญๆฎตใ+ """+ swing_highs, swing_lows = _find_swings(df["high"], df["low"], swing_window)+ merged = _merge_swings(swing_highs, swing_lows)++ if len(merged) < 5:+ return []++ found = []+ # ๆปๅจ็ชๅฃ๏ผๆฏๆฌกๅ5ไธช่ฟ็ปญๆๅจ็นไฝไธบ X-A-B-C-D ๅ้+ for i in range(len(merged) - 4):+ pts = merged[i : i + 5]+ x_ts, x_price, x_type = pts[0]+ a_ts, a_price, a_type = pts[1]+ b_ts, b_price, b_type = pts[2]+ c_ts, c_price, c_type = pts[3]+ d_ts, d_price, d_type = pts[4]++ # XABCD ๅฟ ้กปไบคๆฟ้ซไฝ+ types = [p[2] for p in pts]+ alternating = all(types[j] != types[j + 1] for j in range(4))+ if not alternating:+ continue++ pattern_name = _classify_pattern(+ x_price, a_price, b_price, c_price, d_price, tol=tol+ )+ if pattern_name is None:+ continue++ # ๅคๆญ็ๆถจ/็่ท๏ผ็ๆถจๅฝขๆ X ไธบไฝ็น๏ผD ๅจๅบ้จๅ่ฝฌๅบ๏ผ+ if x_type == "L":+ direction = "bullish"+ else:+ direction = "bearish"++ found.append(+ {+ "pattern": pattern_name,+ "direction": direction,+ "x": (x_ts, x_price),+ "a": (a_ts, a_price),+ "b": (b_ts, b_price),+ "c": (c_ts, c_price),+ "d": (d_ts, d_price),+ "d_index": d_ts,+ "d_price": d_price,+ }+ )+ return found+++# ========================== pyharmonics ้้ ๅฑ ==============================+++def _detect_patterns_pyharmonics(+ df: pd.DataFrame,+ is_stock: bool = False,+) -> List[Dict]:+ """ไฝฟ็จ pyharmonics ๅบๆฃๆต่ฐๆณขๅฝขๆใ++ Args:+ df: OHLCV DataFrame๏ผ้ๅซ open/high/low/close/volume ๅใ+ is_stock: ๆฏๅฆไธบ่ก็ฅจๆ ็ใ++ Returns:+ ๆฃๆตๅฐ็ๅฝขๆๅ่กจ๏ผๆ ผๅผไธ _detect_patterns_fallback ไธ่ดใ++ Raises:+ ImportError: pyharmonics ๆชๅฎ่ฃ ๆถใ+ Exception: pyharmonics ๅ ้จ้่ฏฏๆถใ+ """+ from pyharmonics.technicals import OHLCTechnicals++ tech = OHLCTechnicals(df, is_stock=is_stock)+ tech.fit()++ found = []++ # pyharmonics ๅฐๅฝขๆๅญๅจๅจ tech.matrix ไธญ๏ผbearish/bullish ๅ็ฑป๏ผ+ for direction_attr, direction_label in [+ ("bullish", "bullish"),+ ("bearish", "bearish"),+ ]:+ matrix = getattr(tech, direction_attr, None)+ if matrix is None:+ continue+ for pattern_type, patterns in matrix.items():+ if not isinstance(patterns, list):+ continue+ for p in patterns:+ try:+ # pyharmonics Pattern ๅฏน่ฑกๆ name/x/a/b/c/d ๅฑๆง+ d_idx = p.d.idx if hasattr(p.d, "idx") else None+ d_price = p.d.price if hasattr(p.d, "price") else None++ if d_idx is not None and d_price is not None:+ # ๅฐๆดๆฐ็ดขๅผๆ ๅฐๅ DataFrame ๆถ้ดๆณ+ if isinstance(d_idx, int) and d_idx < len(df):+ d_ts = df.index[d_idx]+ else:+ d_ts = d_idx++ found.append(+ {+ "pattern": str(+ getattr(p, "name", pattern_type)+ ),+ "direction": direction_label,+ "d_index": d_ts,+ "d_price": float(d_price),+ }+ )+ except (AttributeError, TypeError, IndexError):+ continue+ return found+++# ========================== ไฟกๅทๅผๆ ========================================+++class SignalEngine:+ """่ฐๆณขๅฝขๆไฟกๅทๅผๆใ++ ่ฏๅซ Gartley/Bat/Butterfly/Crab ็ญ XABCD ไบ็นๅฝขๆ๏ผ+ ๅจ D ็น๏ผPRZ ๆฝๅจๅ่ฝฌๅบ๏ผ็ๆไบคๆไฟกๅทใ++ ไผๅ ไฝฟ็จ pyharmonics ๅบ๏ผ่ฅไธๅฏ็จๅๅ้ๅฐๅ ็ฝฎๆฃๆตๅจใ++ Attributes:+ is_stock: ๆฏๅฆไธบ่ก็ฅจๆ ็ใ+ swing_window: ๆๅจ็นๆฃๆต็ชๅฃ๏ผไป ๅ ็ฝฎๆฃๆตๅจไฝฟ็จ๏ผใ+ tol: Fibonacci ๆฏ็ๅฎนๅทฎ๏ผไป ๅ ็ฝฎๆฃๆตๅจไฝฟ็จ๏ผใ+ use_pyharmonics: ่ฟ่กๆถ็กฎๅฎๆฏๅฆไฝฟ็จ pyharmonicsใ++ Example:+ >>> engine = SignalEngine()+ >>> signals = engine.generate({"BTC-USDT": df})+ >>> signals["BTC-USDT"].value_counts()+ """++ def __init__(+ self,+ is_stock: bool = False,+ swing_window: int = 10,+ tol: float = 0.12,+ ):+ """ๅๅงๅ่ฐๆณขๅฝขๆไฟกๅทๅผๆใ++ Args:+ is_stock: ๆฏๅฆไธบ่ก็ฅจ๏ผๅฝฑๅ pyharmonics ๅๆฐ๏ผใ+ swing_window: ๆๅจ็นๆฃๆตๅ็ชๅฃๅคงๅฐใ+ tol: Fibonacci ๆฏ็ๅน้ ๅฎนๅทฎใ+ """+ self.is_stock = is_stock+ self.swing_window = swing_window+ self.tol = tol+ self.use_pyharmonics = self._check_pyharmonics()++ @staticmethod+ def _check_pyharmonics() -> bool:+ """ๆฃๆต pyharmonics ๆฏๅฆๅฏ็จใ++ Returns:+ True ๅฆๆ pyharmonics ๅฏๆญฃๅธธๅฏผๅ ฅใ+ """+ try:+ from pyharmonics.technicals import OHLCTechnicals # noqa: F401+ return True+ except ImportError:+ return False++ def _detect(self, df: pd.DataFrame) -> List[Dict]:+ """ๆฃๆตๅไธชๆ ็็่ฐๆณขๅฝขๆใ++ ไผๅ pyharmonics๏ผๅคฑ่ดฅๅๅ้ๅ ็ฝฎๆฃๆตๅจใ++ Args:+ df: OHLCV DataFrameใ++ Returns:+ ๆฃๆตๅฐ็ๅฝขๆๅ่กจใ+ """+ if self.use_pyharmonics:+ try:+ return _detect_patterns_pyharmonics(+ df, is_stock=self.is_stock+ )+ except Exception:+ pass+ return _detect_patterns_fallback(+ df, swing_window=self.swing_window, tol=self.tol+ )++ def generate(+ self, data_map: Dict[str, pd.DataFrame]+ ) -> Dict[str, pd.Series]:+ """ๆ นๆฎ่ฐๆณขๅฝขๆๅจ D ็น็ๆไบคๆไฟกๅทใ++ Args:+ data_map: ๆ ็ไปฃ็ ๅฐ OHLCV DataFrame ็ๆ ๅฐใ+ DataFrame ้ๅ ๅซ open/high/low/close ๅ๏ผindex ไธบ datetimeใ++ Returns:+ ๆ ็ไปฃ็ ๅฐไฟกๅท Series ็ๆ ๅฐ๏ผ1=ๅๅค, -1=ๅ็ฉบ, 0=่งๆ๏ผใ+ """+ result = {}+ for symbol, df in data_map.items():+ signal = pd.Series(0, index=df.index, dtype=int)++ if len(df) < self.swing_window * 4:+ result[symbol] = signal+ continue++ patterns = self._detect(df)+ for p in patterns:+ d_idx = p.get("d_index")+ direction = p.get("direction", "")+ if d_idx is None:+ continue+ # ็กฎไฟ d_idx ๅจ signal index ไธญ+ if d_idx in signal.index:+ if direction == "bullish":+ signal.at[d_idx] = 1+ elif direction == "bearish":+ signal.at[d_idx] = -1++ result[symbol] = signal+ return result+++# ========================== OKX ๆฐๆฎ่ทๅ ====================================+++def _fetch_okx(+ inst_id: str, bar: str = "1D", limit: int = 300+) -> pd.DataFrame:+ """ไป OKX API ่ทๅK็บฟๆฐๆฎใ++ Args:+ inst_id: ไบคๆๅฏนๆ ่ฏ๏ผๅฆ "BTC-USDT"ใ+ bar: K็บฟๅจๆ๏ผ้ป่ฎค "1D"ใ+ limit: ่ทๅๆฐ้๏ผ้ป่ฎค 300ใ++ Returns:+ OHLCV DataFrame๏ผindex ไธบ datetimeใ++ Raises:+ KeyError: API ่ฟๅๆ ผๅผๅผๅธธๆถใ+ """+ import requests++ resp = requests.get(+ "https://www.okx.com/api/v5/market/candles",+ params={"instId": inst_id, "bar": bar, "limit": str(limit)},+ )+ candles = resp.json()["data"]+ columns = [+ "ts", "open", "high", "low", "close",+ "vol", "volCcy", "volCcyQuote", "confirm",+ ]+ df = pd.DataFrame(reversed(candles), columns=columns)+ df["ts"] = pd.to_datetime(df["ts"].astype("int64"), unit="ms")+ df = df.set_index("ts")+ for col in ["open", "high", "low", "close"]:+ df[col] = df[col].astype(float)+ df["volume"] = df["vol"].astype(float)+ return df+++# ========================== ไธปๅ ฅๅฃ ==========================================++if __name__ == "__main__":+ symbols = ["BTC-USDT", "ETH-USDT", "SOL-USDT"]+ data_map = {}++ print("=== ่ฐๆณขๅฝขๆไฟกๅทๅผๆ ===\n")++ for sym in symbols:+ print(f"่ทๅ {sym} ๆฐๆฎ...")+ data_map[sym] = _fetch_okx(sym, bar="1D", limit=300)+ print(+ f" {len(data_map[sym])} ๆ นK็บฟ, "+ f"{data_map[sym].index[0]:%Y-%m-%d} ~ "+ f"{data_map[sym].index[-1]:%Y-%m-%d}"+ )++ engine = SignalEngine(is_stock=False)+ backend = "pyharmonics" if engine.use_pyharmonics else "ๅ ็ฝฎๆฃๆตๅจ"+ print(f"\nๆฃๆตๅ็ซฏ: {backend}")++ signals = engine.generate(data_map)++ print("\n--- ไฟกๅท็ป่ฎก ---")+ for sym in symbols:+ sig = signals[sym]+ buys = sig[sig == 1]+ sells = sig[sig == -1]+ print(f"\n{sym} ({len(data_map[sym])} ๆ นK็บฟ):")+ print(f" ๅๅคไฟกๅท: {len(buys)} ไธช")+ print(f" ๅ็ฉบไฟกๅท: {len(sells)} ไธช")+ if len(buys) > 0:+ print(f" ๆ่ฟๅๅค: {buys.index[-1]:%Y-%m-%d}")+ if len(sells) > 0:+ print(f" ๆ่ฟๅ็ฉบ: {sells.index[-1]:%Y-%m-%d}")++ # ๆๅฐๆฃๆตๅฐ็ๅฝขๆ่ฏฆๆ+ print("\n--- ๅฝขๆ่ฏฆๆ ---")+ for sym in symbols:+ patterns = engine._detect(data_map[sym])+ if patterns:+ print(f"\n{sym}: ๅ ฑ {len(patterns)} ไธชๅฝขๆ")+ for p in patterns[-5:]: # ๆ่ฟ5ไธช+ print(+ f" {p['pattern']} ({p['direction']}) "+ f"D็น: {p['d_index']}"+ )+ else:+ print(f"\n{sym}: ๆ ๆฃๆตๅฐๅฝขๆ")diff --git "a/agent/src/skills/harmonic/references/PRZ\344\272\244\346\230\223.md" "b/agent/src/skills/harmonic/references/PRZ\344\272\244\346\230\223.md"new file mode 100644index 000000000..10c5064d0--- /dev/null+++ "b/agent/src/skills/harmonic/references/PRZ\344\272\244\346\230\223.md"@@ -0,0 +1,29 @@+# PRZ๏ผๆฝๅจๅ่ฝฌๅบ๏ผไบคๆ++## ไปไนๆฏPRZ++PRZ (Potential Reversal Zone) ๆฏๅคไธช Fibonacci ๆฐดๅนณๆฑ่็ไปทๆ ผๅบๅ๏ผ+- D็นๅฎๆๆถ็ไปทๆ ผๅบๅ+- ๅคไธชFibonacciๆๅฝฑ็ไบคๆฑ็น+- ้ซๆฆ็ๅ่ฝฌๅบๅ++## ไบคๆ่งๅ++### ๅ ฅๅบ+- ๅจPRZๅบๅ็ญๅพ ไปทๆ ผๅๅบ๏ผๅ่ฝฌK็บฟๅฝขๆ๏ผ+- ไธ่ฆๅจD็นๆช็กฎ่ฎคๅๆๅๅ ฅๅบ++### ๆญขๆ+- ็ๆถจๅฝขๆ๏ผๆญขๆ่ฎพๅจD็นไธๆน+- ็่ทๅฝขๆ๏ผๆญขๆ่ฎพๅจD็นไธๆน+- ้ๅธธไธบPRZๅบๅๅฎฝๅบฆ็1-1.5ๅ++### ๆญข็+- ็ฌฌไธ็ฎๆ ๏ผAD่ ฟ็0.382ๅๆค+- ็ฌฌไบ็ฎๆ ๏ผAD่ ฟ็0.618ๅๆค+- ็ฌฌไธ็ฎๆ ๏ผA็น++## ๆณจๆไบ้กน+- ่ฐๆณขๅฝขๆๅฎๆไธไปฃ่กจๅฟ ็ถๅ่ฝฌ+- ้่ฆ้ ๅ้่ฝๅK็บฟๅฝขๆ็กฎ่ฎค+- ้ซ็บงๆถ้ดๆกๆถ็ๅฝขๆๆดๅฏ้diff --git "a/agent/src/skills/harmonic/references/XABCD\345\275\242\346\200\201.md" "b/agent/src/skills/harmonic/references/XABCD\345\275\242\346\200\201.md"new file mode 100644index 000000000..ff55071b2--- /dev/null+++ "b/agent/src/skills/harmonic/references/XABCD\345\275\242\346\200\201.md"@@ -0,0 +1,34 @@+# XABCD ่ฐๆณขๅฝขๆ++## ๅฝขๆ่ฏๅซๅ็++่ฐๆณขๅฝขๆ็ฑ5ไธช็นๆๆ๏ผX โ A โ B โ C โ D๏ผๆฏๆฎต่ตฐๅฟไน้ดๅญๅจ็ฒพ็กฎ็ Fibonacci ๆฏ็ๅ ณ็ณปใ++## Gartley ๅฝขๆ๏ผ222ๅฝขๆ๏ผ+- AB = 0.618 ร XA+- BC = 0.382-0.886 ร AB+- CD = 1.27-1.618 ร BC+- D = 0.786 ร XA๏ผๅ ณ้ฎ๏ผ+- ็ๆถจGartley๏ผXไฝA้ซ๏ผDๅจๅบ้จๅ่ฝฌ+- ็่ทGartley๏ผX้ซAไฝ๏ผDๅจ้กถ้จๅ่ฝฌ++## Bat ่่ ๅฝขๆ+- AB = 0.382-0.5 ร XA+- BC = 0.382-0.886 ร AB+- CD = 1.618-2.618 ร BC+- D = 0.886 ร XA๏ผๅ ณ้ฎ๏ผ+- B็นๅๆค่พๆต ๏ผD็นๆดๆทฑ++## Butterfly ่ด่ถๅฝขๆ+- AB = 0.786 ร XA+- BC = 0.382-0.886 ร AB+- CD = 1.618-2.618 ร BC+- D = 1.27 ร XA๏ผ่ถ ๅบX็น๏ผ+- ๅฏไธD็น่ถ ๅบX็น็ๅฝขๆ++## Crab ่่นๅฝขๆ+- AB = 0.382-0.618 ร XA+- BC = 0.382-0.886 ร AB+- CD = 2.24-3.618 ร BC+- D = 1.618 ร XA๏ผๅ ณ้ฎ๏ผๆ่ฟๅปถไผธ๏ผ+- ๆๆ็ซฏ็่ฐๆณขๅฝขๆdiff --git a/agent/src/skills/hedging-strategy/SKILL.md b/agent/src/skills/hedging-strategy/SKILL.mdnew file mode 100644index 000000000..8eef0c39d--- /dev/null+++ b/agent/src/skills/hedging-strategy/SKILL.md@@ -0,0 +1,264 @@+---+name: hedging-strategy+description: Hedging strategy design (beta hedge / option protection / tail risk / cross-asset hedging), including hedge-ratio calculation and cost evaluation.+---+# Hedging Strategy Design++## Overview++Design systematic hedging plans for existing positions, covering linear hedges (futures / ETFs) and nonlinear hedges (options). Output hedge ratios, cost estimates, and execution plans. Core principle: hedging does not eliminate risk; it exchanges unknown losses for known costs.++## Core Concepts++### 1. Beta Hedging (Futures / ETFs)++**Principle:** hedge portfolio systematic risk (beta) with index futures or ETFs while preserving single-stock alpha.++**Hedge ratio calculation:**++```python+# Minimum-variance hedge ratio+hedge_ratio = beta_portfolio * (portfolio_value / futures_value)++# Example: hold a 10 million RMB China A-share portfolio, beta = 1.2+# CSI 300 futures (IF) contract value = index level ร 300+# IF level = 4000, contract value = 4000 ร 300 = 1.2 million+# Required number of short contracts = 1.2 ร (1000 / 120) = 10++# Beta estimation method+import numpy as np+# OLS regression: portfolio_returns = alpha + beta * index_returns + epsilon+beta = np.cov(portfolio_returns, index_returns)[0][1] / np.var(index_returns)+```++**China A-share beta hedging instruments:**++| Instrument | Code | Contract Multiplier | Margin | Suitable Scale |+|------|------|---------|--------|---------|+| IF (CSI 300 futures) | IF2403 | 300 RMB / point | ~12% | > 5 million RMB |+| IC (CSI 500 futures) | IC2403 | 200 RMB / point | ~14% | > 3 million RMB |+| IM (CSI 1000 futures) | IM2403 | 200 RMB / point | ~15% | > 3 million RMB |+| CSI 300 ETF (510300) | 510300.SH | โ | Unlevered | Any size |++**Note:** stock-index futures have basis (spot-futures spread). Shorting futures when they trade at a discount brings extra return (basis convergence), while premium pricing adds extra cost.++### 2. Option Hedging Strategies++#### Protective Put++```+Hold the underlying + buy a put option+```++- **Cost:** option premium (typically 1-3% of underlying value per month)+- **Protection range:** fully protected below the strike price+- **Applicable scenario:** worried about a large drawdown but do not want to sell the position++**China A-share example (50ETF options):**+```python+# Hold 1 million shares of 50ETF (about 2.7 million RMB)+# Buy 100 contracts of 50ETF put 2700 (strike 2.700)+# Premium โ 0.05 RMB/share ร 10000 shares/contract ร 100 contracts = 50,000 RMB+# Cost ratio = 50,000 / 2,700,000 โ 1.85%+# Protection effect: losses are capped once ETF falls below 2.700+```++#### Collar++```+Hold the underlying + buy an OTM put + sell an OTM call+```++- **Cost:** close to zero-cost (the call premium offsets the put premium)+- **Trade-off:** gives up upside above the call strike+- **Applicable scenario:** willing to cap upside in exchange for free downside protection++**Parameter selection guide:**++| Parameter | Aggressive | Balanced | Conservative |+|------|--------|--------|--------|+| Put strike | ATM-5% | ATM-8% | ATM-10% |+| Call strike | ATM+8% | ATM+5% | ATM+3% |+| Net cost | Slightly positive | Near zero | Slightly negative (income) |+| Maximum downside loss | -5% | -8% | -10% |+| Maximum upside gain | +8% | +5% | +3% |++#### Put Spread (Bear Put Spread Hedge)++```+Buy a higher-strike put + sell a lower-strike put+```++- **Cost:** 30-50% cheaper than buying a naked put+- **Protection range:** only between the two strikes; no protection below the lower strike+- **Applicable scenario:** hedging against moderate drawdowns while being cost-sensitive++### 3. Tail-Risk Hedging++**Far OTM put strategy:**++```python+# Buy deep OTM puts (delta โ -0.05 ~ -0.10)+# Characteristics: expires worthless most of the time, but pays off massively during black swans++# Parameters+otm_put_strike = current_price * 0.85 # 15% OTM+cost_per_month = portfolio_value * 0.003 # about 0.3% / month+expected_payoff_in_crash = portfolio_value * 0.10 # ~10% payoff in a severe selloff++# Cost management: ongoing spend of about 3.6% / year, profitable only in tail events+# Taleb-style hedge: lose small amounts often, make large gains occasionally+```++**VIX call strategy (US equities / options market):**++```python+# Buy OTM VIX calls (strike = current VIX + 10)+# If VIX jumps from 15 to 40, call value explodes+# Naturally negatively correlated with an equity portfolio++# China A-share substitutes:+# China has no VIX futures, so alternatives are:+# 1. Buy OTM 50ETF puts (similar tail protection)+# 2. Go long volatility: buy a straddle+# 3. Allocate to gold ETF (518880.SH) as a safe-haven asset+```++### 4. Cross-Asset Hedging++**Stock-bond hedge:**++| Stock/Bond Mix | Expected Volatility | Applicable Scenario |+|---------|-----------|---------|+| 80/20 | ~15% | Bull market environment, small bond buffer |+| 60/40 | ~10% | Classic allocation, suitable for most environments |+| 40/60 | ~7% | Bear market environment, bond-led |+| Risk Parity | ~8% | Volatility-balanced allocation |++**Note:** stock-bond correlation is not stable. In 2022, US stocks and bonds both fell (rising rates), and the traditional 60/40 mix failed. In China, negative stock-bond correlation has been relatively more stable.++**Stock-commodity hedge (equities + commodities):**+- During rising inflation: commodities rise while equities come under pressure โ commodities hedge inflation risk+- During falling inflation: equities rise while commodities come under pressure โ equities drive returns+- Gold ETF (`518880.SH`): low correlation with China A-shares and effective for tail-risk hedging++### 5. Hedge-Ratio Calculation Methods++**Comparison of three methods:**++```python+import numpy as np+from scipy import stats++# Method 1: OLS regression (simplest)+slope, intercept, r, p, se = stats.linregress(hedge_returns, portfolio_returns)+hedge_ratio_ols = slope++# Method 2: Minimum variance+covariance = np.cov(portfolio_returns, hedge_returns)[0][1]+variance_hedge = np.var(hedge_returns)+hedge_ratio_mv = covariance / variance_hedge++# Method 3: EWMA (exponentially weighted, more sensitive)+lambda_param = 0.94 # RiskMetrics default+ewma_cov = pd.Series(portfolio_returns * hedge_returns).ewm(alpha=1-lambda_param).mean()+ewma_var = pd.Series(hedge_returns**2).ewm(alpha=1-lambda_param).mean()+hedge_ratio_ewma = ewma_cov / ewma_var++# Selection guidance:+# Static hedge (monthly rebalance) -> OLS+# Dynamic hedge (weekly rebalance) -> EWMA+# Theoretical analysis -> minimum variance+```++### 6. Hedging Cost Evaluation++**Cost components:**++| Cost Item | Futures Hedge | Options Hedge | Cross-Asset Hedge |+|--------|---------|---------|-----------|+| Direct cost | Margin usage + fees | Premium | Allocation to lower-yield assets |+| Opportunity cost | Basis cost (discount / premium) | Time decay (Theta) | Earn less in a bull market |+| Hidden cost | Roll cost | Volatility premium | Rebalancing transaction costs |+| Annualized estimate | 2-5% (including basis) | 3-8% (depends on IV) | 1-3% (opportunity cost) |++**Cost-benefit decision framework:**++```python+# Is the hedge worth it?+hedge_cost_annual = 0.04 # 4% annualized+expected_loss_without_hedge = 0.15 # 15% expected max loss without hedge+prob_of_loss = 0.25 # 25% probability++expected_loss = expected_loss_without_hedge * prob_of_loss # = 3.75%++# If hedge_cost > expected_loss -> hedge is relatively expensive+# If hedge_cost < expected_loss -> hedge is cost-effective+# Here 4% > 3.75%, so the hedge is marginally expensive, but it may still be worth it because of tail risk+```++## Analysis Framework++### Five-Step Hedging Design Process++1. **Identify the risk**: what kind of risk does the portfolio face? Systematic (beta) or idiosyncratic (single-name events)?+2. **Choose the instrument**: linear (futures / ETF) or nonlinear (options)? This depends on the risk shape and budget+3. **Calculate the ratio**: determine the number of hedge contracts or option lots+4. **Evaluate the cost**: what is the annualized cost, and is it acceptable?+5. **Monitor and adjust**: hedge ratios require dynamic adjustment (beta changes, options expire)++### Risk Scenario โ Hedge Instrument Mapping++| Risk Scenario | Recommended Instrument | Cost Level |+|---------|---------|---------|+| Systematic broad-market selloff | Short IF / IC futures | Low (margin) |+| Moderate drawdown (5-10%) | Collar / Put Spread | Low (zero-cost collar) |+| Black swan (>20% crash) | Far OTM put | Medium (continuous spending) |+| Rising rates | Short government bond futures (TF / T) | Low |+| Currency depreciation | FX forwards / options | Medium |+| Inflation upside surprise | Allocate to commodities / gold | Low (opportunity cost) |++## Output Format++```+## Hedging Plan โ [Portfolio Name]++### Portfolio Overview+- Portfolio size: [X ten-thousand RMB]+- Portfolio beta: [X.XX] (vs [benchmark index])+- Main risk: [systematic / sector concentration / tail]++### Hedging Plan+- Instrument: [short IF futures / Collar / Put Spread / ...]+- Hedge ratio: [X.XX]+- Number of contracts / option lots: [N]+- Hedge coverage: [X%] (full / partial hedge)++### Cost Evaluation+- Direct cost: [X ten-thousand RMB / year]+- Annualized cost ratio: [X%]+- Margin / premium usage: [X ten-thousand RMB]++### Scenario Analysis+| Market Move | PnL Without Hedge | PnL With Hedge | Hedge Effect |+|---------|-----------|-----------|---------|+| Down 10% | -X | -X | Reduce loss by X |+| Down 20% | -X | -X | Reduce loss by X |+| Up 10% | +X | +X | Give up X of upside |++### Execution Notes+- Entry timing: [specific time / condition]+- Rebalance frequency: [monthly / quarterly / event-driven]+- Exit condition: [risk resolution criterion]+```++## Notes++- China A-share index futures have trading restrictions (intraday opening limits, margin requirements), so actual usable size may be limited+- Option liquidity is concentrated in near-month and near-the-money contracts; deep OTM options have wide bid-ask spreads+- Beta is unstable: beta tends to be lower in bull markets and higher in bear markets (meaning the hedge is least sufficient when it is needed most)+- Collar strategies cap upside, so large rallies in the underlying can materially drag portfolio performance+- Tail hedging (far OTM puts) loses money most of the time and requires discipline to execute continuously; do not abandon it halfway because it "feels wasteful"+- Correlations in cross-asset hedges can change violently during crises (trending toward 1), failing exactly when they are needed most+- Hedge plans should be re-evaluated regularly (at least monthly) for beta and cost+- This framework is for research backtesting only, does not constitute investment advice, and does not involve live trading executiondiff --git a/agent/src/skills/hk-connect-flow/SKILL.md b/agent/src/skills/hk-connect-flow/SKILL.mdnew file mode 100644index 000000000..7cd155ab0--- /dev/null+++ b/agent/src/skills/hk-connect-flow/SKILL.md@@ -0,0 +1,246 @@+---+name: hk-connect-flow+description: Stock Connect (Shanghai/Shenzhen-Hong Kong) fund flow analysis โ Northbound (foreign into A-shares), Southbound (mainland into HK), sector allocation tracking, and cross-border arbitrage signals.+---+# Stock Connect Fund Flow Analysis++## Overview++Analyze capital flows through the Shanghai-Hong Kong and Shenzhen-Hong Kong Stock Connect programs. Northbound flows (foreign capital into A-shares) are a key institutional sentiment indicator for the China market; Southbound flows (mainland capital into Hong Kong) reveal mainland investor preference for HK-listed assets. Together they provide a real-time cross-border capital positioning signal.++## Core Concepts++### 1. Stock Connect Architecture++| Channel | Direction | What It Measures |+|---------|-----------|------------------|+| Shanghai Connect Northbound | Foreign โ A-shares (SSE) | Foreign institutional A-share appetite |+| Shenzhen Connect Northbound | Foreign โ A-shares (SZSE) | Foreign institutional A-share appetite (growth bias) |+| Shanghai Connect Southbound | Mainland โ HK (HKEX) | Mainland capital HK allocation |+| Shenzhen Connect Southbound | Mainland โ HK (HKEX) | Mainland capital HK allocation |++**Daily quota**: Each channel has a daily net buy quota (~RMB 52B / HKD 42B). Quota utilization >50% = strong directional signal.++### 2. Northbound Flow Analysis (Foreign into A-shares)++**Why Northbound matters:**+- Foreign institutions (global funds, sovereign wealth funds, hedge funds) are considered "smart money" in A-shares+- Northbound holdings represent ~4-5% of A-share free-float market cap โ small but marginal price-setters+- Northbound flow correlates with MSCI China index rebalancing and global EM allocation decisions++**Northbound signal framework:**++```python+# Daily Northbound net buy signals+def northbound_signal(daily_net_buy_rmb_billion):+ if daily_net_buy_rmb_billion > 10:+ return "strong_foreign_buying" # Very large single-day inflow+ elif daily_net_buy_rmb_billion > 5:+ return "moderate_foreign_buying"+ elif daily_net_buy_rmb_billion > 0:+ return "mild_foreign_buying"+ elif daily_net_buy_rmb_billion > -5:+ return "mild_foreign_selling"+ elif daily_net_buy_rmb_billion > -10:+ return "moderate_foreign_selling"+ else:+ return "strong_foreign_selling" # Panic outflow++# Cumulative flow trend (more important than single-day)+def northbound_trend(flows_20d, flows_5d):+ cum_20d = sum(flows_20d)+ cum_5d = sum(flows_5d)++ if cum_20d > 30 and cum_5d > 10:+ return "sustained_accumulation" # Strong bullish for A-shares+ elif cum_20d < -30 and cum_5d < -10:+ return "sustained_distribution" # Bearish for A-shares+ elif cum_20d > 0 and cum_5d < 0:+ return "accumulation_pausing" # Watch for reversal+ elif cum_20d < 0 and cum_5d > 0:+ return "distribution_pausing" # Possible bottom formation+```++**Northbound sector allocation patterns:**++| Sector Preference | Typical Holdings | Signal |+|-------------------|-----------------|--------|+| Consumer staples (Moutai, dairy) | 30-35% of holdings | Core allocation, low turnover |+| Financials (banks, insurance) | 15-20% | Cyclical allocation, rate-sensitive |+| Technology (semiconductors, software) | 10-15% | Growth allocation, high turnover |+| Healthcare (CXO, innovative pharma) | 8-12% | Structural growth bet |+| New energy (EV, solar) | 5-10% | Thematic, high volatility |++**Sector rotation signal:**+- When Northbound increases consumer staples weight โ defensive positioning+- When Northbound increases tech/new energy weight โ risk-on, growth chasing+- When Northbound reduces across all sectors โ broad risk-off, usually FX-driven (CNY weakening)++### 3. Southbound Flow Analysis (Mainland into HK)++**Why Southbound matters:**+- Mainland investors are the marginal buyer for many HK mid/small caps+- Southbound flows are driven by: AH premium (A vs H discount arbitrage), dividend yield hunting, and tech platform allocation (Tencent, Alibaba, Meituan)+- Insurance and pension funds increasingly use Southbound for international diversification++**Southbound signal framework:**++```python+# Southbound focus areas+southbound_targets = {+ "tech_platforms": ["0700.HK", "9988.HK", "3690.HK", "9618.HK"],+ "high_dividend": ["0939.HK", "1398.HK", "0883.HK", "2628.HK"],+ "ah_discount": [], # Dynamically calculated based on AH premium index+}++def southbound_signal(daily_net_buy_hkd_billion):+ if daily_net_buy_hkd_billion > 5:+ return "strong_mainland_buying"+ elif daily_net_buy_hkd_billion > 2:+ return "moderate_mainland_buying"+ elif daily_net_buy_hkd_billion < -2:+ return "mainland_selling"+ else:+ return "neutral"+```++**Southbound investment patterns:**+1. **Dividend yield arbitrage**: mainland funds buy HK-listed banks/telecoms for higher dividend yield (H-share dividends are often 2-3% higher than A-share equivalents due to lower prices)+2. **Tech platform allocation**: Tencent, Alibaba, Meituan are HK-only or HK-primary listings; mainland tech allocation must go Southbound+3. **AH premium arbitrage**: when AH premium index >130, arbitrage capital flows Southbound to buy cheaper H-shares++### 4. AH Premium Index++The Hang Seng AH Premium Index (HSAHP) tracks the average premium of A-shares over their H-share counterparts for dual-listed companies.++```python+# AH Premium interpretation+ah_premium_index = 130 # A-shares trade 30% above H-shares on average++if ah_premium_index > 140:+ signal = "extreme_ah_premium"+ action = "favor H-shares over A-shares for dual-listed names"+elif ah_premium_index > 125:+ signal = "elevated_ah_premium"+ action = "mild H-share preference"+elif ah_premium_index < 110:+ signal = "compressed_ah_premium"+ action = "A-shares relatively cheap vs H; unusual, investigate"+else:+ signal = "normal_range"+```++### 5. Cross-Border Flow Composite Signal++**Multi-dimensional scoring:**++```python+connect_score = {+ "northbound_flow": 0, # -2 to +2: 20-day cumulative NB flow direction+ "northbound_breadth": 0, # -2 to +2: number of NB top-10 holdings being added to+ "southbound_flow": 0, # -2 to +2: 20-day cumulative SB flow direction+ "ah_premium": 0, # -2 to +2: AH premium level (high = favor HK)+ "fx_direction": 0, # -2 to +2: CNY strength (strong CNY = NB inflow support)+}++# Total range: -10 to +10+# > +5: strong cross-border risk-on, favor A-shares+# +2 to +5: mild bullish+# -2 to +2: neutral / mixed+# < -2: cross-border risk-off, foreign selling A-shares+# < -5: strong risk-off, likely FX-driven+```++## Data Access++### Via Tushare (A-share perspective)++```python+import tushare as ts+pro = ts.pro_api()++# Daily Northbound/Southbound aggregate flows+df = pro.moneyflow_hsgt(start_date="20260101", end_date="20260330")+# Columns: trade_date, ggt_ss (Shanghai SB), ggt_sz (Shenzhen SB),+# hgt (Shanghai NB), sgt (Shenzhen NB), north_money, south_money++# Top 10 Northbound active stocks+df = pro.hsgt_top10(trade_date="20260328", market_type="1") # 1=Shanghai, 3=Shenzhen+# Columns: trade_date, ts_code, name, close, change, rank, market_type,+# amount (trade amount), net_amount (net buy), buy, sell+```++### Via yfinance (HK perspective)++```python+import yfinance as yf++# HK-listed stocks price data+tencent = yf.download("0700.HK", start="2025-01-01", end="2026-03-30", progress=False)+alibaba = yf.download("9988.HK", start="2025-01-01", end="2026-03-30", progress=False)++# AH Premium Index (proxy via Hang Seng indices)+hsi = yf.download("^HSI", start="2025-01-01", end="2026-03-30", progress=False)+```++### Key Data Points to Track++| Metric | Source | Frequency | Threshold |+|--------|--------|-----------|-----------|+| Northbound daily net buy | Tushare / HKEX | Daily | >RMB 5B = significant |+| Northbound 20-day cumulative | Calculated | Daily | >RMB 30B = trend |+| Southbound daily net buy | Tushare / HKEX | Daily | >HKD 3B = significant |+| AH Premium Index | Hang Seng | Daily | >130 = H-share value |+| Quota utilization | HKEX | Intraday | >50% = strong conviction |+| NB Top 10 concentration | Tushare | Daily | Top 3 names >50% = concentrated bet |++## Output Format++```+## Stock Connect Flow Analysis โ [Date Range]++### Northbound (Foreign โ A-shares)+- **20-day cumulative**: [+/- RMB X.XB]+- **5-day trend**: [accelerating / decelerating / reversing]+- **Daily average**: [RMB X.XB]+- **Quota utilization**: [X%]+- **Signal**: [sustained accumulation / distribution / neutral]++### Northbound Sector Allocation+- **Adding to**: [sector1 (top names), sector2]+- **Reducing**: [sector1, sector2]+- **Rotation direction**: [defensive / cyclical / growth]++### Southbound (Mainland โ HK)+- **20-day cumulative**: [+/- HKD X.XB]+- **Focus names**: [Tencent, Alibaba, bank names]+- **Driver**: [dividend yield / tech allocation / AH arbitrage]++### AH Premium+- **Current index**: [XXX]+- **Historical percentile**: [X%]+- **Implication**: [favor H-shares / neutral / favor A-shares]++### Composite Signal+| Dimension | Score (-2~+2) | Basis |+|-----------|---------------|-------|+| NB flow | +1 | Cumulative +RMB 15B over 20 days |+| NB breadth | +2 | Adding across 8 of top 10 |+| SB flow | 0 | Flat |+| AH premium | -1 | AH premium at 135 (H relatively cheap) |+| FX | +1 | CNY stable/strengthening |++### Cross-Market Implication+- **A-share outlook**: [bullish / neutral / bearish] (NB perspective)+- **HK outlook**: [bullish / neutral / bearish] (SB + AH perspective)+- **Arbitrage**: [AH premium trade: buy H / sell A for dual-listed names]+```++## Notes++- Northbound flow is the single most-watched institutional indicator for A-shares; it often leads index turns by 1-3 days+- Quarter-end and MSCI rebalancing dates (Feb/May/Aug/Nov) cause mechanical flow distortions โ filter these out for signal purity+- CNY/USD exchange rate is a key driver of Northbound flow; USD strength typically triggers NB outflows regardless of A-share fundamentals+- Southbound flow can be distorted by dividend arbitrage (mainland funds buy before ex-div, creating artificial inflow spikes)+- Stock Connect data is freely available from HKEX website and Tushare API+- This framework is for research purposes only and does not constitute investment advicediff --git a/agent/src/skills/ichimoku/SKILL.md b/agent/src/skills/ichimoku/SKILL.mdnew file mode 100644index 000000000..06c62def7--- /dev/null+++ b/agent/src/skills/ichimoku/SKILL.md@@ -0,0 +1,45 @@+---+name: ichimoku+description: Ichimoku Kinko Hyo five-line system signal engine. A standalone Japanese technical-analysis school that generates trading signals from Tenkan/Kijun crossovers, cloud position, and Chikou confirmation. Pure pandas implementation.+---+# Ichimoku Kinko Hyo++## Purpose++A standalone Japanese technical analysis framework that uses a five-line system and the cloud to provide a complete trend-evaluation structure:++| Line | Japanese | Calculation | Meaning |+|----|------|------|------|+| Conversion line | Tenkan-sen | (9H+9L)/2 | Short-term trend |+| Base line | Kijun-sen | (26H+26L)/2 | Medium-term trend |+| Leading Span A | Senkou Span A | (Tenkan+Kijun)/2 shifted forward by 26 | Upper cloud boundary |+| Leading Span B | Senkou Span B | (52H+52L)/2 shifted forward by 26 | Lower cloud boundary |+| Lagging Span | Chikou Span | Closing price shifted backward by 26 | Trend confirmation |++## Signal Logic++Signals are triggered only on TK crossover events, with three filters:+- **Strong buy**: bullish TK cross + price above the cloud + bullish cloud (A > B)+- **Strong sell**: bearish TK cross + price below the cloud + bearish cloud (A < B)+- All other cases โ stand aside++Warm-up requires 78 candles (52+26).++## Parameters++| Parameter | Default | Description |+|------|--------|------|+| tenkan_period | 9 | Tenkan-sen period |+| kijun_period | 26 | Kijun-sen period |+| senkou_b_period | 52 | Senkou Span B period |+| displacement | 26 | Forward/backward shift period |++## Dependencies++```bash+pip install pandas numpy requests+```++## Signal Convention++- `1` = long, `-1` = short, `0` = stand asidediff --git a/agent/src/skills/ichimoku/example_signal_engine.py b/agent/src/skills/ichimoku/example_signal_engine.pynew file mode 100644index 000000000..41c331cf9--- /dev/null+++ b/agent/src/skills/ichimoku/example_signal_engine.py@@ -0,0 +1,195 @@+"""ไธ็ฎๅ่กก่กจ๏ผIchimoku Kinko Hyo๏ผไฟกๅทๅผๆใ++ไบ็บฟ็ณป็ป๏ผ่ฝฌๆข็บฟ/ๅบๅ็บฟไบคๅ่งฆๅ๏ผไบๅธฆไฝ็ฝฎ+ๆนๅไธ้่ฟๆปคใ+็บฏ pandas ๅฎ็ฐ๏ผๆ ๅค้จๆๆฏๅๆๅบไพ่ตใ+"""++from typing import Dict, Optional++import pandas as pd+++class SignalEngine:+ """ไธ็ฎๅ่กก่กจไฟกๅทๅผๆใ++ ้่ฟ TK ไบคๅไบไปถ่งฆๅ๏ผไธ้่ฟๆปค็ๆ้ซ่ดจ้ไบคๆไฟกๅท๏ผ+ 1. ่ฝฌๆข็บฟ/ๅบๅ็บฟ้ๅๆๆญปๅ๏ผ่งฆๅๆกไปถ๏ผ+ 2. ไปทๆ ผ็ธๅฏนไบๅธฆ็ไฝ็ฝฎ๏ผๆนๅ็กฎ่ฎค๏ผ+ 3. ไบๅธฆ่ช่บซๆนๅ๏ผ่ถๅฟ็กฎ่ฎค๏ผ++ Attributes:+ tenkan_period: ่ฝฌๆข็บฟๅจๆใ+ kijun_period: ๅบๅ็บฟๅจๆใ+ senkou_b_period: ๅ ่กๅธฆBๅจๆใ+ displacement: ๅ็งป/ๅ็งปๅจๆใ++ Example:+ >>> engine = SignalEngine()+ >>> signals = engine.generate({"BTC-USDT": df})+ >>> signals["BTC-USDT"].value_counts()+ """++ def __init__(+ self,+ tenkan_period: int = 9,+ kijun_period: int = 26,+ senkou_b_period: int = 52,+ displacement: int = 26,+ ):+ """ๅๅงๅไธ็ฎๅ่กก่กจไฟกๅทๅผๆใ++ Args:+ tenkan_period: ่ฝฌๆข็บฟๅจๆ๏ผ้ป่ฎค9ใ+ kijun_period: ๅบๅ็บฟๅจๆ๏ผ้ป่ฎค26ใ+ senkou_b_period: ๅ ่กๅธฆBๅจๆ๏ผ้ป่ฎค52ใ+ displacement: ๅ็งป/ๅ็งปๅจๆ๏ผ้ป่ฎค26ใ+ """+ self.tenkan_period = tenkan_period+ self.kijun_period = kijun_period+ self.senkou_b_period = senkou_b_period+ self.displacement = displacement++ def _donchian_mid(+ self, high: pd.Series, low: pd.Series, period: int+ ) -> pd.Series:+ """่ฎก็ฎ Donchian ้้ไธญ็บฟใ++ ๅ ฌๅผ: (highest_high(period) + lowest_low(period)) / 2++ Args:+ high: ๆ้ซไปทๅบๅใ+ low: ๆไฝไปทๅบๅใ+ period: ๅ็ๅจๆใ++ Returns:+ Donchian ้้ไธญ็บฟๅบๅใ+ """+ return (high.rolling(period).max() + low.rolling(period).min()) / 2++ def generate(+ self, data_map: Dict[str, pd.DataFrame]+ ) -> Dict[str, pd.Series]:+ """ๆ นๆฎไธ็ฎๅ่กก่กจไบ็บฟ็ณป็ป็ๆไบคๆไฟกๅทใ++ Args:+ data_map: ๆ ็ไปฃ็ ๅฐ OHLCV DataFrame ็ๆ ๅฐใ+ DataFrame ้ๅ ๅซ open/high/low/close ๅ๏ผindex ไธบ datetimeใ++ Returns:+ ๆ ็ไปฃ็ ๅฐไฟกๅท Series ็ๆ ๅฐ๏ผ1=ๅๅค, -1=ๅ็ฉบ, 0=่งๆ๏ผใ+ """+ result = {}+ warmup = self.senkou_b_period + self.displacement++ for symbol, df in data_map.items():+ signal = pd.Series(0, index=df.index, dtype=int)++ if len(df) < warmup:+ result[symbol] = signal+ continue++ high = df["high"]+ low = df["low"]+ close = df["close"]++ # --- ไบ็บฟ่ฎก็ฎ ---+ tenkan = self._donchian_mid(high, low, self.tenkan_period)+ kijun = self._donchian_mid(high, low, self.kijun_period)+ span_a = ((tenkan + kijun) / 2).shift(self.displacement)+ span_b = self._donchian_mid(+ high, low, self.senkou_b_period+ ).shift(self.displacement)+ # chikou = close.shift(-self.displacement) # ไธๅไธไฟกๅท่ฎก็ฎ++ # --- TK ไบคๅๆฃๆต ---+ tk_cross_up = (tenkan > kijun) & (+ tenkan.shift(1) <= kijun.shift(1)+ )+ tk_cross_down = (tenkan < kijun) & (+ tenkan.shift(1) >= kijun.shift(1)+ )++ # --- ไบๅธฆไฝ็ฝฎ ---+ cloud_top = pd.concat([span_a, span_b], axis=1).max(axis=1)+ cloud_bottom = pd.concat([span_a, span_b], axis=1).min(axis=1)+ above_cloud = close > cloud_top+ below_cloud = close < cloud_bottom++ # --- ไบๅธฆๆนๅ ---+ bullish_cloud = span_a > span_b+ bearish_cloud = span_a < span_b++ # --- ไธ้่ฟๆปคไฟกๅท ---+ buy = tk_cross_up & above_cloud & bullish_cloud+ sell = tk_cross_down & below_cloud & bearish_cloud+ signal = buy.astype(int) - sell.astype(int)++ result[symbol] = signal++ return result+++def _fetch_okx(+ inst_id: str, bar: str = "1D", limit: int = 300+) -> pd.DataFrame:+ """ไป OKX API ่ทๅK็บฟๆฐๆฎใ++ Args:+ inst_id: ไบคๆๅฏนๆ ่ฏ๏ผๅฆ "BTC-USDT"ใ+ bar: K็บฟๅจๆ๏ผ้ป่ฎค "1D"ใ+ limit: ่ทๅๆฐ้๏ผ้ป่ฎค 300ใ++ Returns:+ OHLCV DataFrame๏ผindex ไธบ datetimeใ++ Raises:+ KeyError: API ่ฟๅๆ ผๅผๅผๅธธๆถใ+ """+ import requests++ resp = requests.get(+ "https://www.okx.com/api/v5/market/candles",+ params={"instId": inst_id, "bar": bar, "limit": str(limit)},+ )+ candles = resp.json()["data"]+ columns = [+ "ts", "open", "high", "low", "close",+ "vol", "volCcy", "volCcyQuote", "confirm",+ ]+ df = pd.DataFrame(reversed(candles), columns=columns)+ df["ts"] = pd.to_datetime(df["ts"].astype("int64"), unit="ms")+ df = df.set_index("ts")+ for col in ["open", "high", "low", "close"]:+ df[col] = df[col].astype(float)+ df["volume"] = df["vol"].astype(float)+ return df+++if __name__ == "__main__":+ symbols = ["BTC-USDT", "ETH-USDT", "SOL-USDT"]+ data_map = {}++ print("=== ไธ็ฎๅ่กก่กจไฟกๅทๅผๆ ===\n")++ for sym in symbols:+ print(f"่ทๅ {sym} ๆฐๆฎ...")+ data_map[sym] = _fetch_okx(sym, bar="1D", limit=300)+ print(f" {len(data_map[sym])} ๆ นK็บฟ, "+ f"{data_map[sym].index[0]:%Y-%m-%d} ~ "+ f"{data_map[sym].index[-1]:%Y-%m-%d}")++ engine = SignalEngine()+ signals = engine.generate(data_map)++ print("\n--- ไฟกๅท็ป่ฎก ---")+ for sym in symbols:+ sig = signals[sym]+ buys = sig[sig == 1]+ sells = sig[sig == -1]+ print(f"\n{sym} ({len(data_map[sym])} ๆ นK็บฟ):")+ print(f" ๅๅคไฟกๅท: {len(buys)} ไธช")+ print(f" ๅ็ฉบไฟกๅท: {len(sells)} ไธช")+ if len(buys) > 0:+ print(f" ๆ่ฟๅๅค: {buys.index[-1]:%Y-%m-%d}")+ if len(sells) > 0:+ print(f" ๆ่ฟๅ็ฉบ: {sells.index[-1]:%Y-%m-%d}")diff --git "a/agent/src/skills/ichimoku/references/\344\272\224\347\272\277\350\256\241\347\256\227.md" "b/agent/src/skills/ichimoku/references/\344\272\224\347\272\277\350\256\241\347\256\227.md"new file mode 100644index 000000000..be44cc22d--- /dev/null+++ "b/agent/src/skills/ichimoku/references/\344\272\224\347\272\277\350\256\241\347\256\227.md"@@ -0,0 +1,38 @@+# ไธ็ฎๅ่กก่กจไบ็บฟ่ฎก็ฎ++## ่ฝฌๆข็บฟ๏ผTenkan-sen๏ผ+```+tenkan = (highest_high(9) + lowest_low(9)) / 2+```+ๅๆ ็ญๆ๏ผ็บฆ2ๅจ๏ผ็ไปทๆ ผไธญ็นใ++## ๅบๅ็บฟ๏ผKijun-sen๏ผ+```+kijun = (highest_high(26) + lowest_low(26)) / 2+```+ๅๆ ไธญๆ๏ผ็บฆ1ไธชๆ๏ผ็ไปทๆ ผไธญ็นใๅบๅ็บฟไนๆฏไปทๆ ผ็"ๅ่กก็น"ใ++## ๅ ่กๅธฆA๏ผSenkou Span A๏ผ+```+span_a = (tenkan + kijun) / 2 # ๅ็งป26ๅจๆ+```+ๅ ่กๅธฆAๆฏ่ฝฌๆข็บฟๅๅบๅ็บฟ็ๅนณๅๅผ๏ผๅ็งป26ๅจๆ็ปๅถใ++## ๅ ่กๅธฆB๏ผSenkou Span B๏ผ+```+span_b = (highest_high(52) + lowest_low(52)) / 2 # ๅ็งป26ๅจๆ+```+ๅ ่กๅธฆBๆฏ52ๅจๆ็ไธญ็น๏ผๅ็งป26ๅจๆ็ปๅถใ++## ่ฟ่ก็บฟ๏ผChikou Span๏ผ+```+chikou = close # ๅ็งป26ๅจๆ็ปๅถ+```+ๅฝๅๆถ็ไปทๅ็งป26ๅจๆใ็จไบ็กฎ่ฎค่ถๅฟ๏ผ่ฟ่ก็บฟๅจไปทๆ ผไธๆนไธบๅคๅคด๏ผไธๆนไธบ็ฉบๅคดใ++## ไบๅธฆ๏ผKumo๏ผ++ๅ ่กๅธฆAๅๅ ่กๅธฆBไน้ด็ๅบๅ็งฐไธบ"ไบๅธฆ"ใ+- A > B๏ผ็ๆถจไบ๏ผ้ๅธธ็ปๅถไธบ็ปฟ่ฒ๏ผ+- A < B๏ผ็่ทไบ๏ผ้ๅธธ็ปๅถไธบ็บข่ฒ๏ผ+- ไบๅธฆๅๅบฆๅๆ ๆฏๆ/้ปๅๅผบๅบฆdiff --git "a/agent/src/skills/ichimoku/references/\344\277\241\345\217\267\347\263\273\347\273\237.md" "b/agent/src/skills/ichimoku/references/\344\277\241\345\217\267\347\263\273\347\273\237.md"new file mode 100644index 000000000..06c42a4d7--- /dev/null+++ "b/agent/src/skills/ichimoku/references/\344\277\241\345\217\267\347\263\273\347\273\237.md"@@ -0,0 +1,28 @@+# ไธ็ฎๅ่กก่กจไฟกๅท็ณป็ป++## TKไบคๅ๏ผๆ ธๅฟไฟกๅท๏ผ++### ้ๅ๏ผ็ๆถจ๏ผ+่ฝฌๆข็บฟไปไธๆน็ฉฟ่ถๅบๅ็บฟ๏ผ+- **ๅผบ้ๅ**๏ผไบคๅๅ็ๅจไบๅธฆไธๆน+- **ไธญ้ๅ**๏ผไบคๅๅ็ๅจไบๅธฆๅ ้จ+- **ๅผฑ้ๅ**๏ผไบคๅๅ็ๅจไบๅธฆไธๆน++### ๆญปๅ๏ผ็่ท๏ผ+่ฝฌๆข็บฟไปไธๆน็ฉฟ่ถๅบๅ็บฟ๏ผ+- **ๅผบๆญปๅ**๏ผไบคๅๅ็ๅจไบๅธฆไธๆน+- **ไธญๆญปๅ**๏ผไบคๅๅ็ๅจไบๅธฆๅ ้จ+- **ๅผฑๆญปๅ**๏ผไบคๅๅ็ๅจไบๅธฆไธๆน++## ไธ้่ฟๆปค++ๆฌๅผๆไฝฟ็จไธ้่ฟๆปค็กฎไฟไฟกๅท่ดจ้๏ผ+1. **TKไบคๅ**๏ผ่งฆๅๆกไปถ+2. **ไปทๆ ผไธไบ็ๅ ณ็ณป**๏ผไปทๆ ผๅจไบไธๆน็ๅค๏ผไบไธๆน็็ฉบ+3. **ไบ็ๆนๅ**๏ผๅ ่กๅธฆA > Bไธบ็ๆถจไบ๏ผๅไน็่ท++ไธไธชๆกไปถๅฟ ้กปไธ่ดๆไผ็ๆไฟกๅทใ++## ้ข็ญ่ฆๆฑ++้่ฆ่ณๅฐ 78 ๆ นK็บฟ๏ผ52ๅจๆ่ฎก็ฎ + 26ๅจๆไฝ็งป๏ผๆ่ฝ็ๆๆๆไฟกๅทใdiff --git a/agent/src/skills/liquidation-heatmap/SKILL.md b/agent/src/skills/liquidation-heatmap/SKILL.mdnew file mode 100644index 000000000..33d82d6c8--- /dev/null+++ b/agent/src/skills/liquidation-heatmap/SKILL.md@@ -0,0 +1,285 @@+---+name: liquidation-heatmap+description: Liquidation level analysis and heatmap interpretation โ identify leveraged position concentration, liquidation cascades, stop-hunt zones, and use liquidation data as support/resistance signals.+---+# Liquidation Heatmap & Level Analysis++## Overview++Analyze the distribution of leveraged positions and their liquidation price levels to identify zones where forced selling/buying will accelerate price moves. Liquidation clusters act as "magnets" โ price tends to be attracted toward large liquidation concentrations because market makers and whales profit from triggering cascading liquidations.++## Core Concepts++### 1. Liquidation Mechanics++**How liquidation works:**++```python+# Long position liquidation+long_liquidation_price = entry_price * (1 - 1/leverage + maintenance_margin)++# Short position liquidation+short_liquidation_price = entry_price * (1 + 1/leverage - maintenance_margin)++# Example: BTC long at $65,000, 10x leverage, 0.5% maintenance margin+# Liquidation: $65,000 * (1 - 1/10 + 0.005) = $58,825+# A 9.5% move against the position triggers liquidation+```++**Leverage and liquidation distance:**++| Leverage | Liquidation Distance (Long) | Liquidation Distance (Short) |+|----------|----------------------------|------------------------------|+| 2x | ~50% drop | ~50% rise |+| 5x | ~20% drop | ~20% rise |+| 10x | ~10% drop | ~10% rise |+| 20x | ~5% drop | ~5% rise |+| 50x | ~2% drop | ~2% rise |+| 100x | ~1% drop | ~1% rise |++### 2. Liquidation Heatmap Interpretation++A liquidation heatmap shows where liquidation orders are concentrated across different price levels, typically color-coded by density.++**Reading the heatmap:**++```+Price Level Long Liquidations Short Liquidations Interpretation+$70,000 โโโโโโโโโโ โโโโโโโโโโโโโโโโ Heavy short liquidation zone+$68,000 โโโโ โโโโโโโโโโ Moderate short liquidation+$66,000 โโโโโโโ โโโโโโโ Balanced (current price area)+$64,000 โโโโโโโโโโ โโโโ Moderate long liquidation+$62,000 โโโโโโโโโโโโโโโโ โโโโโโโโโโ Heavy long liquidation zone+```++**Key principles:**+1. **Liquidation clusters are magnets**: price tends to gravitate toward large liquidation pools because the forced orders provide liquidity for whales to fill their positions+2. **Liquidation cascades**: when a cluster gets hit, the forced selling/buying pushes price further, potentially triggering the next cluster โ cascade effect+3. **After liquidation wipe**: once a large cluster is liquidated, that price level often becomes support/resistance (overleveraged positions are gone)++### 3. Liquidation Level Identification++```python+def identify_liquidation_clusters(open_interest_by_price, leverage_distribution):+ """+ Estimate where liquidation clusters exist based on+ open interest and leverage distribution.+ """+ clusters = []++ for price_level in price_range:+ # Long liquidations: positions opened above this level with high leverage+ long_liq_volume = estimate_long_liq_at_price(+ open_interest_by_price, leverage_distribution, price_level+ )++ # Short liquidations: positions opened below this level with high leverage+ short_liq_volume = estimate_short_liq_at_price(+ open_interest_by_price, leverage_distribution, price_level+ )++ total = long_liq_volume + short_liq_volume++ if total > significance_threshold:+ clusters.append({+ "price": price_level,+ "long_liq": long_liq_volume,+ "short_liq": short_liq_volume,+ "type": "long" if long_liq_volume > short_liq_volume else "short",+ "magnitude": total,+ })++ return sorted(clusters, key=lambda x: x["magnitude"], reverse=True)+```++### 4. Liquidation-Based Trading Signals++**Signal 1: Liquidation Magnet**+```python+def liquidation_magnet_signal(current_price, clusters):+ """+ Price is likely to move toward the nearest large liquidation cluster.+ """+ # Find nearest cluster above and below+ above = [c for c in clusters if c["price"] > current_price]+ below = [c for c in clusters if c["price"] < current_price]++ nearest_above = min(above, key=lambda c: c["price"] - current_price) if above else None+ nearest_below = min(below, key=lambda c: current_price - c["price"]) if below else None++ if nearest_above and nearest_below:+ above_magnitude = nearest_above["magnitude"]+ below_magnitude = nearest_below["magnitude"]++ if above_magnitude > below_magnitude * 2:+ return "upward_magnet" # Larger cluster above โ price likely moves up+ elif below_magnitude > above_magnitude * 2:+ return "downward_magnet" # Larger cluster below โ price likely moves down+ else:+ return "balanced" # Both sides have similar clusters+```++**Signal 2: Cascade Risk**+```python+def cascade_risk(current_price, clusters, direction="down"):+ """+ Assess risk of liquidation cascade โ multiple clusters stacked close together.+ """+ if direction == "down":+ relevant = sorted([c for c in clusters if c["price"] < current_price and c["type"] == "long"],+ key=lambda c: c["price"], reverse=True)+ else:+ relevant = sorted([c for c in clusters if c["price"] > current_price and c["type"] == "short"],+ key=lambda c: c["price"])++ if len(relevant) < 2:+ return "low_cascade_risk"++ # Check if clusters are stacked within 5% of each other+ gaps = []+ for i in range(len(relevant) - 1):+ gap = abs(relevant[i]["price"] - relevant[i+1]["price"]) / current_price * 100+ gaps.append(gap)++ if min(gaps) < 2:+ return "high_cascade_risk" # Clusters stacked tightly โ cascade likely+ elif min(gaps) < 5:+ return "moderate_cascade_risk"+ else:+ return "low_cascade_risk"+```++**Signal 3: Post-Liquidation Support/Resistance**+```python+def post_liquidation_sr(price_history, liquidation_events):+ """+ After a large liquidation event, that price level often becomes S/R.+ """+ sr_levels = []+ for event in liquidation_events:+ if event.total_liquidated > 100_000_000: # >$100M liquidated+ sr_levels.append({+ "price": event.price_level,+ "type": "support" if event.liquidation_type == "long" else "resistance",+ "strength": event.total_liquidated,+ "date": event.date,+ })+ return sr_levels+```++### 5. Liquidation Data Metrics++**Key metrics to track:**++| Metric | Description | Signal |+|--------|-------------|--------|+| 24h total liquidations | Total USD liquidated across all exchanges | > $500M = extreme, volatility spike |+| Long/Short liquidation ratio | Longs liquidated / Shorts liquidated | > 2 = longs squeezed, < 0.5 = shorts squeezed |+| Largest single liquidation | Biggest individual position liquidated | > $10M = whale liquidation |+| OI change post-liquidation | Open interest change after event | Large OI drop = leverage washed out (healthy) |+| Exchange-specific liquidation | Which exchange had most liquidations | Indicates where leverage is concentrated |++**Liquidation volume interpretation:**++| 24h Liquidations | Market State | Implication |+|-----------------|-------------|-------------|+| > $1B | Extreme event | Major leverage wipeout, potential V-reversal |+| $500M - $1B | High volatility | Significant positioning reset |+| $200M - $500M | Elevated | Moderate leverage reduction |+| $50M - $200M | Normal | Background noise |+| < $50M | Calm | Low volatility, leverage building |++### 6. Liquidation Cascade Anatomy++**Typical cascade sequence:**++```+1. Initial trigger (macro event, whale selling, technical breakdown)+ โ+2. Price hits first liquidation cluster ($65,000)+ โ $200M in long liquidations forced to sell+ โ+3. Forced selling pushes price to next cluster ($63,000)+ โ $300M more in long liquidations+ โ+4. Cascade accelerates โ high-leverage positions ($62,000-$60,000)+ โ $500M in rapid succession+ โ+5. Eventually: open interest drops 20-30%, funding rate flips negative+ โ Leverage is "washed out" โ bottom forms+ โ+6. Recovery begins (short-term) as no more forced sellers remain+```++**Trading around cascades:**+- **Before cascade**: reduce leverage, set wider stops, avoid high-leverage longs near heavy liquidation zones+- **During cascade**: do NOT try to catch the knife; wait for OI to stabilize+- **After cascade**: when funding rate flips deeply negative + OI has dropped 20%+, contrarian long entry with tight risk++### 7. Exchange-Level Liquidation Differences++| Exchange | Liquidation Engine | Key Feature |+|----------|-------------------|-------------|+| OKX | Tiered auto-deleveraging | Partial liquidation (reduce position size, not full close) |+| Binance | Insurance fund + ADL | Largest insurance fund (~$1B+) reduces cascade severity |+| Bybit | ADL (Auto-Deleveraging) | ADL triggers when insurance fund depleted |+| dYdX | On-chain liquidation | Transparent, anyone can liquidate (MEV opportunity) |++## Data Sources++| Source | Access | Data Available |+|--------|--------|---------------|+| CoinGlass | Free (limited) | Liquidation heatmap, 24h liquidations, OI |+| Laevitas | Free/Paid | Options + futures liquidation levels |+| Kingfisher (Coinalyze) | Paid | Real-time liquidation level estimates |+| Hyblock Capital | Paid | Professional liquidation heatmaps |+| OKX API | Free | Historical liquidation data |+| DeFi Llama | Free | DeFi protocol liquidation data |++## Output Format++```+## Liquidation Analysis โ [Asset] โ [Date]++### Liquidation Overview (24h)+- **Total liquidated**: $XXX M+- **Long liquidated**: $XXX M (XX%)+- **Short liquidated**: $XXX M (XX%)+- **Largest single**: $XX M [exchange]+- **Market state**: [extreme / elevated / normal / calm]++### Key Liquidation Levels+| Price Level | Type | Est. Volume | Distance from Current | Priority |+|------------|------|-------------|----------------------|----------|+| $XX,XXX | Short liq cluster | $XXX M | +X.X% | High |+| $XX,XXX | Long liq cluster | $XXX M | -X.X% | High |+| $XX,XXX | Long liq cluster | $XXX M | -X.X% | Medium |++### Heatmap Summary+- **Strongest upside magnet**: $XX,XXX (short liquidation cluster, $XXX M)+- **Strongest downside magnet**: $XX,XXX (long liquidation cluster, $XXX M)+- **Asymmetry**: [upside magnet stronger / downside stronger / balanced]++### Cascade Risk+- **Downside cascade risk**: [high / moderate / low]+ - [X clusters stacked within X% below current price]+- **Upside cascade risk**: [high / moderate / low]++### Post-Liquidation S/R Levels+- **Recent support formed**: $XX,XXX (long liquidation wipeout on DATE)+- **Recent resistance formed**: $XX,XXX (short liquidation wipeout on DATE)++### Trading Implications+- **Bias**: [upward magnet stronger โ mild bullish / downward โ bearish]+- **Risk**: [high leverage zone within X% โ reduce position size]+- **Key level**: [$XX,XXX โ if broken, cascade risk activates]+```++## Notes++- Liquidation data is estimated, not exact โ exchanges do not publish real-time liquidation level details for all users+- Heatmap providers use statistical models based on OI and leverage distribution to estimate liquidation prices+- Liquidation levels shift constantly as traders open/close positions โ treat as dynamic zones, not fixed prices+- "Stop hunts" (price briefly touching a liquidation cluster then reversing) are common โ market makers deliberately trigger clusters+- DeFi liquidations are fully transparent (on-chain) but CEX liquidations are opaque+- This framework is for research purposes only and does not constitute investment advicediff --git a/agent/src/skills/macro-analysis/SKILL.md b/agent/src/skills/macro-analysis/SKILL.mdnew file mode 100644index 000000000..aab5c65a0--- /dev/null+++ b/agent/src/skills/macro-analysis/SKILL.md@@ -0,0 +1,191 @@+---+name: macro-analysis+description: Macroeconomic cycle positioning and central-bank policy interpretation, including GDP/CPI/PMI/rates/FX analysis, with output in the form of major-asset allocation tilts.+---++# Macroeconomic Analysis++## Overview++Interprets macroeconomic data and central-bank policy, identifies the current economic-cycle stage, and derives major-asset allocation direction. Covers the three major economies of China (PBOC), the United States (Fed), and Europe (ECB).++## Core Indicator System++### Growth Indicators++| Indicator | Frequency | Key Threshold | Data Source |+|------|------|----------|--------|+| GDP YoY | Quarterly | China >5% = normal, <4% = weak | National Bureau of Statistics |+| Manufacturing PMI | Monthly | >50 = expansion, <50 = contraction, 49-51 = borderline | NBS / Caixin |+| Industrial production | Monthly | >5% = normal | National Bureau of Statistics |+| Retail sales | Monthly | >8% = strong consumption | National Bureau of Statistics |+| Fixed asset investment | Monthly | Focus on infrastructure vs real-estate components | National Bureau of Statistics |++### Inflation Indicators++| Indicator | Frequency | Key Threshold | Interpretation |+|------|------|----------|------|+| CPI YoY | Monthly | >3% = inflation pressure, <0% = deflation risk | Strongly affected by the pork cycle, so core CPI is more reliable |+| PPI YoY | Monthly | >0% = improving corporate profits, <0% = deflation transmission | Leads CPI by 3-6 months |+| Core CPI | Monthly | >2% = demand-driven inflation | Excludes food and energy |+| M2 YoY | Monthly | >10% = monetary easing | The M2-M1 spread reflects how active liquidity is |++### Rates and FX++| Indicator | Meaning | Focus |+|------|------|--------|+| 1Y / 5Y LPR | Loan prime rate | Rate-cut signal |+| DR007 | Interbank 7-day repo rate | Funding tightness / looseness |+| 10Y government bond yield | Risk-free rate anchor | <2.5% = loose, >3.5% = tight |+| USD/CNY | Exchange rate | >7.3 = high depreciation pressure |+| US 10Y-2Y spread | Term spread | Inversion signals recession (leads by 12-18 months) |++## Four-Stage Economic Cycle Model++### Merrill Lynch Clock Framework++```+ GDPโ + CPIโ GDPโ + CPIโ+ โโโโโโโโโโโ โโโโโโโโโโโ+ โ Recovery โ โโโโโ โ Overheatโ+ โ โ โ โ+ โโโโโโฌโโโโโ โโโโโโฌโโโโโ+ โ โ+ โ โ+ โโโโโโดโโโโโ โโโโโโดโโโโโ+ โRecessionโ โโโโโ โStagflat โ+ โ โ โ โ+ โโโโโโโโโโโ โโโโโโโโโโโ+ GDPโ + CPIโ GDPโ + CPIโ+```++### Asset Performance by Stage++| Stage | Best Asset | Second-Best Asset | Worst Asset | Typical Policy |+|------|----------|----------|----------|----------|+| Recovery | Equities (growth / small cap) | Commodities | Bonds | Monetary easing + fiscal stimulus |+| Overheat | Commodities (oil / copper) | Equities (cyclical / value) | Bonds | Hiking cycle begins |+| Stagflation | Cash / short-duration bonds | Gold | Equities | Policy dilemma |+| Recession | Bonds (long duration) | Gold | Equities / commodities | Rate cuts + quantitative easing |++### China-Specific Adjustments++- **Real-estate cycle**: property sales / investment is a core variable in China's economy, and the policy response during downturns determines the turning point+- **Infrastructure offset**: when property is weak, infrastructure often strengthens (countercyclical adjustment), so track the pace of special-bond issuance+- **Export orientation**: external demand (US PMI / Eurozone PMI) affects manufacturing conditions+- **Policy-driven market**: tone-setting from Politburo meetings / the Central Economic Work Conference matters more than the data itself++## Central Bank Policy Analysis Framework++### Federal Reserve (Fed)++**Sequence to watch**: FOMC statement โ dot plot โ Powell speech โ meeting minutes++| Signal | Hawkish (tightening) | Dovish (easing) |+|------|-------------|-------------|+| Employment | "labor market remains tight" | "softening in labor market" |+| Inflation | "inflation remains elevated" | "inflation moving toward target" |+| Forward guidance | "further tightening may be appropriate" | "rate cuts could be appropriate" |+| Balance sheet | Faster / continued QT | Slower QT / hints of QE |++**Fed decision function**: core PCE > 2.5% โ tightening bias; unemployment > 4.5% โ easing bias; when the two conflict, focus on which deviation is larger++### People's Bank of China (PBOC)++**Toolbox:**++| Tool | Signal Strength | Impact |+|------|---------|------|+| RRR cut | Strong | Releases long-term liquidity, bullish for equities and bonds |+| Rate cuts (MLF/LPR) | Strong | Reduces financing costs, bullish for growth stocks |+| OMO (reverse repo) | Medium | Short-term liquidity adjustment |+| PSL / relending | Medium | Targeted support (infrastructure / real estate) |+| Window guidance | Weak but effective | Directs credit allocation |++### European Central Bank (ECB)++**Core variables**: HICP (harmonized CPI), Eurozone PMI, Germany-France yield spread+**Special feature**: large divergence among member economies, creating a "one size fits all" problem++## Analysis Framework++### Step 1: Data Collection and Current-State Description++```+Collect core indicators from the latest 3 months:+- China: PMI, CPI, PPI, M2, aggregate financing, LPR+- United States: nonfarm payrolls, CPI, core PCE, ISM PMI, Fed rate+- Global: oil, copper, US dollar index (DXY), VIX+```++### Step 2: Cycle Positioning++```+Decision criteria:+1. GDP trend: accelerating / decelerating / topping / bottoming+2. Inflation trend: rising / falling / topping / bottoming+3. Policy direction: easing / neutral / tightening / turning+4. Composite stage: recovery / overheat / stagflation / recession+5. Cycle position: early / mid / late+```++### Step 3: Policy Impact Assessment++```+1. Recent policy events (last 30 days)+2. Interpretation of policy intent (support growth / control inflation / contain risk)+3. Transmission paths to each asset class+4. Lag estimation (6-12 months for monetary policy, 3-6 months for fiscal policy)+```++### Step 4: Asset Allocation Tilt++```+Based on cycle position and policy direction:+- Overweight / neutral / underweight: China A-shares / Hong Kong stocks / US equities / bonds / commodities / cash+- Style tilt: growth vs value, large cap vs small cap+- Sector preference: cyclical / defensive / growth+```++## Output Format++```markdown+## Macro Environment Assessment++### Snapshot of Core Data+| Indicator | Latest | Previous | Trend |+|------|--------|------|------|+| China PMI | 50.2 | 49.8 | โ |+| ... | ... | ... | ... |++### Economic Cycle Positioning+- **Current stage**: early recovery / mid-overheat / late stagflation / mid-recession+- **Core logic**: explain the basis in 2-3 sentences+- **Estimated remaining duration**: expected to last another X months++### Central Bank Policy Analysis+- **PBOC**: easing bias, likely another 25bp RRR cut in Q2+- **Fed**: hiking pause, watch the June dot plot+- **Policy conflicts**: whether there are conflicting policy signals worth attention++### Major Asset Allocation Tilt+| Asset | Recommendation | Logic |+|------|------|------|+| China A-shares | Overweight | Policy bottom confirmed + loose liquidity |+| Bonds | Neutral | Limited room for rates to fall further |+| Commodities | Underweight | Weak demand |+| Cash | Underweight | High opportunity cost |++### Risk Warnings+- Risk 1: ...+- Risk 2: ...+```++## Notes++1. **Data timeliness**: macro data is released with lags; PMI is the timeliest (start of month), GDP is the most delayed (quarter-end + 15 days)+2. **Do not predict precisely**: macro analysis provides directional judgment, not exact levels or timing+3. **Focus on marginal change**: direction and speed of change matter more than absolute levels+4. **China-specific feature**: policy intent > economic data, and major meeting tone-setting has the highest priority+5. **Global linkage**: the US dollar / US Treasury yields are global pricing anchors, and Fed policy affects global liquidity+6. **Avoid hindsight bias**: analyze based on the information available at the time, not by reverse-engineering from future datadiff --git a/agent/src/skills/market-microstructure/SKILL.md b/agent/src/skills/market-microstructure/SKILL.mdnew file mode 100644index 000000000..f517dbde2--- /dev/null+++ b/agent/src/skills/market-microstructure/SKILL.md@@ -0,0 +1,298 @@+---+name: market-microstructure+description: "Market microstructure: bid-ask spread analysis, order-flow toxicity metrics (VPIN / Kyle lambda), liquidity measures (Amihud / Roll), price-impact models, limit-order-book analysis, and China A-share call auction / block trade mechanics."+---++# Market Microstructure++## Overview++Study the micro-level mechanisms of price formation: who is trading, how they are trading, and how trades affect prices. For quantitative strategies, this matters because it improves transaction-cost estimation, identifies informed trading, and optimizes execution.++Applicable scenarios:+- Precise estimation of strategy trading costs (instead of simply assuming a flat 0.1% fee)+- Designing large-order execution strategies (`TWAP / VWAP / IS`)+- Detecting order-flow toxicity (avoid time windows dominated by informed traders)+- Quantifying liquidity risk (flash-crash warning)+- Capturing China A-share-specific microstructure features (call auction / closing auction / block trades)++## Core Concepts++### Bid-Ask Spread++**Three measurements:**+| Metric | Formula | Meaning |+|------|------|------|+| Quoted spread | `Ask - Bid` | Best spread shown in the limit order book |+| Effective spread | `2 ร |trade price - mid price|` | Actual spread paid by the trader |+| Realized spread | `2 ร direction ร (trade price - mid price 5min later)` | True market-maker profit |++```+China A-share example:+ Instrument: 600519.SH Kweichow Moutai+ Best bid: 1680.00 Best ask: 1680.50+ Quoted spread: 0.50 RMB = 0.03%++ Instrument: 000001.SZ Ping An Bank+ Best bid: 11.05 Best ask: 11.06+ Quoted spread: 0.01 RMB = 0.09%++Spread decomposition (Roll):+ Spread = adverse-selection cost + inventory cost + order-processing cost+ In China A-shares: adverse selection accounts for 60-70% (mixture of retail and informed traders)++Spread drivers:+ - Larger market cap -> smaller spread (Moutai 0.03% vs small-cap 0.5%)+ - Higher volatility -> wider spread (market-maker risk premium)+ - Higher volume -> narrower spread (greater competition)+ - Higher information asymmetry -> wider spread (adverse selection)+```++### Order-Flow Toxicity Metrics++**VPIN (Volume-Synchronized Probability of Informed Trading):**+```+Principle: replace clock time with volume time to measure the probability of informed trading++Calculation steps:+ 1. Bucket trades by fixed volume (Volume Bucket)+ Bucket size V = average daily volume / 50 (about 5-10 minutes per bucket)++ 2. Classify buy and sell volume in each bucket (Bulk Volume Classification):+ buy_volume = V ร ฮฆ(ฮP / ฯ) (standard normal CDF)+ sell_volume = V - buy_volume++ 3. Compute order-flow imbalance:+ OI_i = |buy_volume_i - sell_volume_i|++ 4. VPIN = ฮฃ(OI_i) / (n ร V) (n=50-bucket rolling window)++Interpretation:+ VPIN < 0.3 -> normal, low informed-trading share+ VPIN 0.3-0.5 -> caution, informed trading rising+ VPIN > 0.5 -> dangerous, high probability that major information is about to be released++China A-share usage:+ A sudden VPIN spike in a stock may foreshadow:+ - insider trading ahead of a major announcement+ - institutional position building / distribution+ Before the 2015 China A-share flash crashes, VPIN stayed above 0.6 for a prolonged period+```++**Kyle's Lambda (price impact coefficient)**:+```+Model: ฮP = ฮป ร OrderFlow + ฮต+ where OrderFlow = buy volume - sell volume++Estimation method:+ 1. Compute ฮP and OrderFlow in 5-minute windows+ 2. Regress ฮP = ฮฑ + ฮป ร OrderFlow+ 3. ฮป = price change caused by one unit of order flow++Interpretation:+ Large ฮป -> poor liquidity, high impact+ Small ฮป -> good liquidity, large orders can be executed cheaply++Typical China A-share values:+ Large cap (CSI 300): ฮป โ 0.001-0.005+ Mid cap (CSI 500): ฮป โ 0.005-0.02+ Small cap (CSI 1000): ฮป โ 0.02-0.1+```++### Liquidity Measures++| Metric | Formula | Advantages | Disadvantages |+|------|------|------|------|+| Amihud illiquidity | `|R_t| / Volume_t` | Requires only daily data | Sensitive to extreme returns |+| Roll implied spread | `2โ(-Cov(R_t, R_{t-1}))` | Requires only daily data | Fails when covariance is positive |+| LOT zero-return ratio | zero-return days / total days | Intuitive | Too coarse |+| Turnover ratio | volume / free float | Simple and intuitive | Does not reflect price impact |+| Traded value | average daily notional | Absolute liquidity | Does not reflect relative impact |++```+Amihud calculation (China A-shares):+ ILLIQ = (1/D) ร ฮฃ(|R_d| / VOL_d) (D=trading days, monthly)++ Normalization: ILLIQ ร 10^6 (for readability)++ Screening rules:+ ILLIQ < 0.5 -> high liquidity (large-cap blue chips)+ ILLIQ 0.5-5 -> medium liquidity+ ILLIQ > 5 -> low liquidity (trade cautiously)++ Strategy application:+ - Liquidity factor: low-liquidity stocks tend to earn long-run excess return (liquidity premium)+ - Liquidity monitor: sudden rise in ILLIQ -> warning of liquidity drying up+```++## Analysis Framework++### 1. Price-Impact Models++**Linear impact (Almgren-Chriss)**:+```+Model: impact = ฮท ร ฯ ร (Q / V)^0.6+ ฮท: impact coefficient, about 0.5-1.5 for China A-shares+ ฯ: daily volatility+ Q: traded quantity (shares)+ V: average daily volume (shares)++Example:+ Sell 100,000 shares of Kweichow Moutai+ Average daily volume 5,000,000 shares, daily volatility 1.8%+ impact = 1.0 ร 0.018 ร (100000/5000000)^0.6+ = 0.018 ร 0.0085+ = 0.015% (1.5bp, acceptable)++ Sell 100,000 shares of a small-cap stock+ Average daily volume 500,000 shares, daily volatility 3.0%+ impact = 1.0 ร 0.03 ร (100000/500000)^0.6+ = 0.03 ร 0.076+ = 0.23% (23bp, should be executed in slices)++Execution-splitting methods:+ TWAP: uniform in clock time -> simple but ignores market state+ VWAP: volume-profile execution -> better matches market rhythm+ IS: minimize Implementation Shortfall -> optimal but requires real-time optimization+```++**Nonlinear impact (square-root model)**:+```+impact = ฯ ร โ(Q / (ADV ร T))+ ฯ: daily volatility+ Q: total trade size+ ADV: average daily traded value+ T: execution days++Applicable to: large trades (Q/ADV > 5%)+```++### 2. Limit Order Book Analysis++```+Depth metrics:+ Level 1 depth: queue size at the best bid and best ask+ Level 5 depth: total queue size across the first 5 levels+ Depth asymmetry: (Bid depth - Ask depth) / (Bid depth + Ask depth)+ > 0 -> stronger bid side, price tends to rise+ < 0 -> stronger ask side, price tends to fall++Resilience:+ The speed at which the book recovers after a large-order impact+ Fast recovery -> good liquidity, temporary impact+ Slow recovery -> poor liquidity, persistent impact++China A-share LOB characteristics:+ - The shallowest depth is in the 15 minutes before the open (highest information asymmetry)+ - Depth improves from 10:00-10:30 (institutions begin participating)+ - Best depth is from 14:00-14:57 (most intraday information has been digested)+ - During the 14:57-15:00 closing auction, depth changes sharply (late-day grabbing / dumping)++Order-book imbalance signal:+ OIR = (Bid_vol - Ask_vol) / (Bid_vol + Ask_vol)+ Rolling 5-minute OIR > 0.3 -> short-term bullish signal (accuracy about 55-60%)+ Note: in China A-shares, large orders are often rapidly added and canceled (icebergs / spoofing), so OIR signals need filtering+```++### 3. Flash-Crash Mechanism and Prevention++```+Flash-crash characteristics:+ 1. Price drops more than 5% within minutes+ 2. Volume first expands, then collapses (liquidity evaporates)+ 3. Bid-ask spread widens sharply (market makers pull quotes)+ 4. Followed by a V-shaped rebound (not always fully recovered)++Triggers:+ - Large market order + thin liquidity -> punches through multiple levels instantly+ - Stop-loss chain -> initial selloff triggers more stop orders+ - Algo resonance -> multiple trend-following algos sell simultaneously+ - ETF discount arbitrage -> ETF redemption and constituent selling intensify the drop++Preventive measures:+ 1. Use limit orders instead of market orders: specify the maximum acceptable price+ 2. Monitor VPIN: if VPIN breaks above 0.5 -> stop trading+ 3. Liquidity threshold: exclude instruments with Amihud > 10+ 4. Spread monitor: if spread widens suddenly to >5x normal -> pause orders+ 5. Time avoidance: do not execute large orders in the first 15 minutes after open or the last 5 minutes before close++China A-share flash-crash cases:+ 2015 Jun-Jul: thousands of stocks hit limit-down, with VPIN staying elevated+ 2020-07-13: Shanghai Composite plunged and then rebounded in a V-shape+ Pattern: liquidity dries up -> limit-down locking (China-specific) -> next-day panic selling+```++### 4. China A-Share-Specific Microstructure++```+Call-auction strategy:+ 9:15-9:20: orders can be entered and canceled, mostly probing quotes (low reference value)+ 9:20-9:25: orders can be entered but not canceled, so real intent is revealed+ Signal: after 9:20, buy orders far exceed sell orders -> likely gap-up open++ Execution: place orders at 9:24:50 (last 10 seconds of the call auction)+ Risk: cannot cancel, and the final execution price may deviate from expectation++Closing call auction (14:57-15:00):+ Feature: closing price is decided within 3 minutes, with concentrated institutional rebalancing and index-fund flows+ Signal: closing-auction volume > 10% of the whole day -> institutions are rebalancing++ Strategy application:+ - VWAP algos should finish most of execution before 14:50, leaving a small residual for the close+ - Avoid placing large orders after 14:57 (high price uncertainty)++Block-trade discount signal:+ Discount = (block-trade price - closing price) / closing price+ Discount < -5%: seller is eager to exit -> short-term bearish+ Discount > -2%: traded near market price -> may be turnover rather than reduction++ Buyer identity:+ Well-known institutional seat buys -> positive signal+ Same broker on both sides -> may be wash trading (neutral)+```++## Output Format++Microstructure analysis report:+```+=== Liquidity Diagnosis ===+Instrument: 000858.SZ Wuliangye+Date: 2026-03-28+Average daily traded value: 2.8 billion RMB Turnover ratio: 0.85%+Amihud: 0.32 (high liquidity)+Effective spread: 0.05% (2.5bp)+Kyle Lambda: 0.003++=== Order-Flow Analysis ===+VPIN: 0.28 (normal)+Order-book imbalance (OIR): +0.12 (mild bid-side bias)+Net large-order buying: +230 million RMB (institutional buying bias)++=== Trading-Cost Estimate ===+Planned trade size: 500,000 shares (about 40 million RMB)+Estimated impact cost: 0.08% (32k RMB)+Commission: 0.025% (10k RMB)+Stamp duty: 0.05% (20k RMB, sell side)+Total one-way transaction cost: about 0.16%++=== Execution Suggestion ===+Recommended strategy: VWAP+Execution window: 10:00-14:50 (avoid the open and the close)+Number of slices: 5-8 (about 60k-100k shares per slice)+Time sensitivity: low (VPIN is normal, no urgency to execute)+```++## Notes++1. **Data requirement is high**: microstructure analysis requires tick-level / Level-2 data, while ordinary daily data only supports rough measures such as Amihud / Roll+2. **China A-share Level-2 data**: ten-level depth data from SSE / SZSE requires a paid subscription, costing roughly 50k-200k RMB per year+3. **High-frequency trading restrictions**: China A-shares strictly prohibit programmatic quote-cancel manipulation (`spoofing`), so microstructure signals are for analysis only, not for HFT strategies+4. **VPIN calibration**: bucket size has a large impact on results and must be adjusted for instrument liquidity; one parameter does not fit all+5. **Cross-market differences**: China A-share `T+1` settlement and daily price limits make its microstructure significantly different from textbook US-equity models+6. **Illusion of liquidity**: high turnover in some China A-shares comes from speculative matched trading and does not represent true liquidity++## Dependencies++```bash+pip install pandas numpy scipy+```diff --git a/agent/src/skills/minute-analysis/SKILL.md b/agent/src/skills/minute-analysis/SKILL.mdnew file mode 100644index 000000000..243004f04--- /dev/null+++ b/agent/src/skills/minute-analysis/SKILL.md@@ -0,0 +1,100 @@+---+name: minute-analysis+description: Minute-level data analysis and backtesting. Retrieves minute candlesticks through OKX/Tushare/yfinance and can be used both for analysis and as input to the backtest engine.+---+# Minute-Level Data Analysis and Backtesting++## Purpose++Retrieve minute-level candlestick data through data-source APIs and calculate intraday indicators (VWAP, TWAP, volume distribution, and more).+Supports minute-level backtesting: set `"interval": "5m"` in `config.json` and use the `backtest` tool to run intraday strategies.++## Backtest Configuration++For minute-level backtests, simply add the `interval` field in `config.json`:++```json+{+ "source": "okx",+ "codes": ["BTC-USDT"],+ "start_date": "2026-03-01",+ "end_date": "2026-03-15",+ "interval": "5m",+ "initial_cash": 1000000,+ "commission": 0.0005+}+```++- The annualization factor is inferred automatically from `source + interval` (`OKX 5m = 365 x 288 = 105120`)+- Minute-level datasets are large. Recommended time limits: no more than 7 days for `1m`, no more than 30 days for `5m`, and no more than 1 year for `1H`++## Supported Data Sources and Intervals++| Data Source | Supported Intervals | Notes |+|--------|---------|------|+| OKX | 1m/5m/15m/30m/1H/4H | Cryptocurrency, trades 7x24 |+| Tushare | 1m/5m/15m/30m/1H | China A-shares, requires score >= 2000 |+| yfinance | 1m/5m/15m/30m/1H | Hong Kong / US equities (free, no key required) |++## OKX Minute Candlestick API++```python+import requests+import pandas as pd++resp = requests.get("https://www.okx.com/api/v5/market/candles", params={+ "instId": "BTC-USDT",+ "bar": "1m", # 1m/5m/15m/30m/1H/4H+ "limit": "300", # At most 300 rows per request+})+data = resp.json()["data"]+columns = ["ts", "open", "high", "low", "close", "vol", "volCcy", "volCcyQuote", "confirm"]+df = pd.DataFrame(reversed(data), columns=columns)+df["ts"] = pd.to_datetime(df["ts"].astype("int64"), unit="ms")+for col in ["open", "high", "low", "close", "vol"]:+ df[col] = df[col].astype(float)+```++## Indicator Calculation Templates++### VWAP (Volume-Weighted Average Price)++```python+typical_price = (df["high"] + df["low"] + df["close"]) / 3+df["vwap"] = (typical_price * df["vol"]).cumsum() / df["vol"].cumsum()+```++### TWAP (Time-Weighted Average Price)++```python+df["twap"] = df["close"].expanding().mean()+```++### Volume Distribution++```python+df["vol_pct"] = df["vol"] / df["vol"].sum() * 100+hourly_vol = df.set_index("ts").resample("1h")["vol"].sum()+```++## Parameters++| Parameter | Description |+|------|------|+| inst_id | Trading pair, such as `"BTC-USDT"` |+| bar / interval | Candlestick interval: `1m/5m/15m/30m/1H/4H` |+| limit | Number of records to retrieve (OKX returns at most 300 per request) |++## Common Pitfalls++- OKX returns at most 300 rows per request. The loader paginates automatically, but `1m` datasets are still very large+- The time range for minute-level backtests should not be too long, otherwise both data retrieval and backtesting will become slow or time out+- Tushare minute endpoints require a score >= 2000. If the score is insufficient, the API returns empty data+- Timestamps are Unix timestamps in milliseconds and should be converted with `unit="ms"`+- Transaction costs for minute strategies should be set lower (for example 0.05% instead of 0.1%) because intraday trading is frequent++## Dependencies++```bash+pip install pandas numpy requests+```diff --git a/agent/src/skills/minute-analysis/example_signal_engine.py b/agent/src/skills/minute-analysis/example_signal_engine.pynew file mode 100644index 000000000..73bff685a--- /dev/null+++ b/agent/src/skills/minute-analysis/example_signal_engine.py@@ -0,0 +1,146 @@+"""ๅ้็บงๆฐๆฎๅๆๅทฅๅ ทใ++้่ฟ OKX API ่ทๅๅ้ K ็บฟ๏ผ่ฎก็ฎ VWAP/TWAP/ๆไบค้ๅๅธ็ญๆฅๅ ๆๆ ใ+ไป ไพๅๆ่พๅบ๏ผไธๅฏ็จไบๅๆตๅผๆ๏ผไป ๆฏๆๆฅ็บฟ๏ผใ+"""++from typing import Optional++import numpy as np+import pandas as pd+import requests+++BASE_URL = "https://www.okx.com/api/v5"+++def fetch_minute_candles(+ inst_id: str, bar: str = "5m", limit: int = 300+) -> Optional[pd.DataFrame]:+ """ไป OKX ่ทๅๅ้็บง K ็บฟๆฐๆฎใ++ Args:+ inst_id: ไบคๆๅฏน๏ผๅฆ "BTC-USDT"ใ+ bar: K ็บฟๅจๆ๏ผ1m/5m/15m/30m/1H/4H๏ผใ+ limit: ่ทๅๆ นๆฐ๏ผๆๅค 300๏ผใ++ Returns:+ OHLCV DataFrame๏ผindex ไธบ datetimeใNone ่กจ็คบ่ทๅๅคฑ่ดฅใ+ """+ resp = requests.get(+ f"{BASE_URL}/market/candles",+ params={"instId": inst_id, "bar": bar, "limit": str(min(limit, 300))},+ timeout=15,+ )+ data = resp.json()+ if data.get("code") != "0" or not data.get("data"):+ print(f"[WARN] ่ทๅๅคฑ่ดฅ: {data.get('msg', 'unknown')}")+ return None++ columns = ["ts", "open", "high", "low", "close", "vol", "volCcy", "volCcyQuote", "confirm"]+ df = pd.DataFrame(reversed(data["data"]), columns=columns)+ df["ts"] = pd.to_datetime(df["ts"].astype("int64"), unit="ms")+ df = df.set_index("ts")+ for col in ["open", "high", "low", "close", "vol"]:+ df[col] = df[col].astype(float)+ df["volume"] = df["vol"]+ return df+++def compute_vwap(df: pd.DataFrame) -> pd.Series:+ """่ฎก็ฎ็ดฏ็งฏ VWAP๏ผๆไบค้ๅ ๆๅนณๅไปท๏ผใ++ Args:+ df: ๅ ๅซ high/low/close/volume ๅ็ DataFrameใ++ Returns:+ VWAP ๅบๅใ+ """+ typical_price = (df["high"] + df["low"] + df["close"]) / 3+ cum_tp_vol = (typical_price * df["volume"]).cumsum()+ cum_vol = df["volume"].cumsum()+ return cum_tp_vol / cum_vol+++def compute_twap(df: pd.DataFrame) -> pd.Series:+ """่ฎก็ฎ็ดฏ็งฏ TWAP๏ผๆถ้ดๅ ๆๅนณๅไปท๏ผใ++ Args:+ df: ๅ ๅซ close ๅ็ DataFrameใ++ Returns:+ TWAP ๅบๅใ+ """+ return df["close"].expanding().mean()+++def volume_profile(df: pd.DataFrame, bins: int = 20) -> pd.DataFrame:+ """่ฎก็ฎๆไบค้ๅๅธ๏ผๆไปทๆ ผๅบ้ด๏ผใ++ Args:+ df: ๅ ๅซ close/volume ๅ็ DataFrameใ+ bins: ไปทๆ ผๅบ้ดๆฐ้ใ++ Returns:+ DataFrame ๅซ price_range ๅ volume ๅใ+ """+ price_bins = pd.cut(df["close"], bins=bins)+ vol_by_price = df.groupby(price_bins, observed=True)["volume"].sum()+ result = vol_by_price.reset_index()+ result.columns = ["price_range", "volume"]+ result["volume_pct"] = result["volume"] / result["volume"].sum() * 100+ return result.sort_values("volume", ascending=False)+++def hourly_volume(df: pd.DataFrame) -> pd.DataFrame:+ """ๆๅฐๆถ่ๅๆไบค้ใ++ Args:+ df: ๅ้็บง DataFrameใ++ Returns:+ ๅฐๆถ็บงๆไบค้ๆฑๆปใ+ """+ hourly = df.resample("1h")["volume"].sum()+ result = hourly.reset_index()+ result.columns = ["hour", "volume"]+ result["volume_pct"] = result["volume"] / result["volume"].sum() * 100+ return result+++if __name__ == "__main__":+ inst = "BTC-USDT"+ bar = "5m"+ print(f"=== {inst} {bar} ๅ้็บงๅๆ ===\n")++ df = fetch_minute_candles(inst, bar=bar, limit=300)+ if df is None or df.empty:+ print("ๆ ๆฐๆฎ")+ exit(1)++ print(f"ๆฐๆฎ่ๅด: {df.index[0]} ~ {df.index[-1]} ({len(df)} ๆ น)")+ print(f"ไปทๆ ผ่ๅด: {df['close'].min():.2f} ~ {df['close'].max():.2f}")+ print()++ # VWAP / TWAP+ vwap = compute_vwap(df)+ twap = compute_twap(df)+ last_close = df["close"].iloc[-1]+ print(f"ๆๆฐไปท: {last_close:.2f}")+ print(f"VWAP: {vwap.iloc[-1]:.2f} ({'้ซไบ' if last_close > vwap.iloc[-1] else 'ไฝไบ'}VWAP)")+ print(f"TWAP: {twap.iloc[-1]:.2f}")+ print()++ # ๆไบค้ๅๅธ+ print("--- ๆไบค้ๅๅธ (Top 5 ไปทๆ ผๅบ้ด) ---")+ vp = volume_profile(df, bins=15)+ for _, row in vp.head(5).iterrows():+ print(f" {row['price_range']}: {row['volume_pct']:.1f}%")+ print()++ # ๅฐๆถๆไบค้+ print("--- ๅฐๆถๆไบค้ ---")+ hv = hourly_volume(df)+ for _, row in hv.iterrows():+ bar_len = int(row["volume_pct"] / 2)+ print(f" {row['hour'].strftime('%H:%M')}: {'โ' * bar_len} {row['volume_pct']:.1f}%")diff --git a/agent/src/skills/ml-strategy/SKILL.md b/agent/src/skills/ml-strategy/SKILL.mdnew file mode 100644index 000000000..840faac81--- /dev/null+++ b/agent/src/skills/ml-strategy/SKILL.md@@ -0,0 +1,214 @@+---+name: ml-strategy+description: Machine-learning predictive strategy based on sklearn walk-forward training, feature engineering, and signal generation. Suitable for any OHLCV data.+---+# Machine-Learning Predictive Strategy++## Purpose++Use sklearn machine-learning models (`RandomForest` / `GradientBoosting` / `Ridge`) to predict the direction of future returns and generate trading signals. Walk-forward training is used to avoid future data leakage, and feature engineering extracts useful factors from OHLCV data.++## Signal Logic++1. **Feature engineering**: build multi-dimensional factors from raw OHLCV data (momentum, volatility, RSI, moving-average ratios, volume ratio, and more)+2. **Label construction**: future N-day return > 0 is the positive class (`1`), < 0 is the negative class (`0`)+3. **Walk-forward training**: use an expanding window (not a fixed window), train on historical data only, and roll forward day by day for prediction+4. **Signal generation**: map `predict_proba[:, 1]` to `[-1.0, 1.0]`, or use discrete signals from `predict` in `{-1, 0, 1}`++## Feature Engineering Template++The following are commonly used features, all computed with pandas:++| Feature Name | Formula | Meaning |+|--------|---------|------|+| ret_5d | `close.pct_change(5)` | Past 5-day return (short-term momentum) |+| ret_20d | `close.pct_change(20)` | Past 20-day return (medium-term momentum) |+| vol_20d | `returns.rolling(20).std()` | 20-day volatility |+| rsi_14 | See the RSI formula below | Relative Strength Index |+| ma_ratio | `close / close.rolling(20).mean()` | Degree of deviation from the 20-day moving average |+| volume_ratio | `volume / volume.rolling(20).mean()` | Volume ratio (current volume vs 20-day average) |+| bb_position | `(close - bb_lower) / (bb_upper - bb_lower)` | Bollinger Band position (`0`=lower band, `1`=upper band) |+| high_low_ratio | `(high - low) / close` | Intraday range ratio |+| close_open_ratio | `(close - open) / open` | Intraday return |+| skew_20d | `returns.rolling(20).skew()` | Return skewness |++```python+import pandas as pd+import numpy as np++def build_features(df: pd.DataFrame) -> pd.DataFrame:+ """Build a machine-learning feature matrix from OHLCV data.++ Args:+ df: DataFrame containing open, high, low, close, and volume columns.++ Returns:+ DataFrame with added feature columns prefixed by 'f_'.+ """+ c = df["close"]+ v = df["volume"]+ ret = c.pct_change()++ features = pd.DataFrame(index=df.index)+ features["f_ret_5d"] = c.pct_change(5)+ features["f_ret_20d"] = c.pct_change(20)+ features["f_vol_20d"] = ret.rolling(20).std()+ features["f_ma_ratio"] = c / c.rolling(20).mean()+ features["f_volume_ratio"] = v / v.rolling(20).mean()++ # RSI(14)+ delta = c.diff()+ gain = delta.clip(lower=0).rolling(14).mean()+ loss = (-delta.clip(upper=0)).rolling(14).mean()+ rs = gain / loss+ features["f_rsi_14"] = 100 - (100 / (1 + rs))++ # Bollinger Band position+ ma20 = c.rolling(20).mean()+ std20 = c.rolling(20).std()+ bb_upper = ma20 + 2 * std20+ bb_lower = ma20 - 2 * std20+ features["f_bb_position"] = (c - bb_lower) / (bb_upper - bb_lower)++ # Intraday features+ features["f_high_low_ratio"] = (df["high"] - df["low"]) / c+ features["f_close_open_ratio"] = (c - df["open"]) / df["open"]+ features["f_skew_20d"] = ret.rolling(20).skew()++ return features+```++## Model Selection Guide++| Model | Advantages | Disadvantages | Applicable Scenario |+|------|------|------|---------|+| RandomForestClassifier | Hard to overfit, robust to hyperparameters, can output feature importance | Weaker at capturing trend-style features | Default first-choice model, medium data size |+| GradientBoostingClassifier | High accuracy, captures complex nonlinear relationships | Easy to overfit, slow to train, requires careful tuning | Sufficient data and tuning experience |+| Ridge / LogisticRegression | Fast training, interpretable, difficult to overfit | Captures only linear relationships | Fast baseline, few features, small dataset |++## Walk-Forward Training Template (Critical)++**Core principle: it is strictly forbidden to train on the full dataset and then predict the full dataset. That is future data leakage.**++- You must use an expanding window or rolling window+- `StandardScaler` must be `fit` on the training set only, then `transform` the test set+- Predict only the current day (or a small forward slice) each time, then roll the window forward++```python+from sklearn.ensemble import RandomForestClassifier+from sklearn.preprocessing import StandardScaler+import numpy as np+import pandas as pd++def walk_forward_predict(+ features: pd.DataFrame,+ labels: pd.Series,+ min_train_size: int = 252,+ retrain_freq: int = 20,+ model_type: str = "random_forest",+) -> pd.Series:+ """Walk-forward training and prediction to avoid future data leakage.++ Args:+ features: Feature matrix aligned with labels by row index.+ labels: Binary labels (0/1), representing the direction of future N-day returns.+ min_train_size: Minimum training-set size in trading days.+ retrain_freq: Retrain the model every N days.+ model_type: Model type, one of "random_forest" / "gradient_boosting" / "ridge".++ Returns:+ Predicted signal series with range [-1.0, 1.0].+ """+ predictions = pd.Series(0.0, index=features.index)+ model = None+ scaler = None++ for i in range(min_train_size, len(features)):+ # Retrain every retrain_freq days+ if model is None or (i - min_train_size) % retrain_freq == 0:+ # Expanding window: train on [0, i)+ X_train = features.iloc[:i].values+ y_train = labels.iloc[:i].values++ # Drop rows with NaN+ valid = ~(np.isnan(X_train).any(axis=1) | np.isnan(y_train))+ X_train = X_train[valid]+ y_train = y_train[valid]++ if len(X_train) < 50:+ continue++ # Standardization: fit only on training set+ scaler = StandardScaler()+ X_train = scaler.fit_transform(X_train)++ # Build the model+ if model_type == "random_forest":+ model = RandomForestClassifier(+ n_estimators=100, max_depth=5, random_state=42+ )+ elif model_type == "gradient_boosting":+ from sklearn.ensemble import GradientBoostingClassifier+ model = GradientBoostingClassifier(+ n_estimators=100, max_depth=3, learning_rate=0.05,+ random_state=42+ )+ elif model_type == "ridge":+ from sklearn.linear_model import LogisticRegression+ model = LogisticRegression(penalty="l2", C=1.0, random_state=42)+ else:+ raise ValueError(f"Unsupported model_type: {model_type}")++ model.fit(X_train, y_train)++ # Predict today+ X_today = features.iloc[i : i + 1].values+ if np.isnan(X_today).any():+ predictions.iloc[i] = 0.0+ continue++ X_today = scaler.transform(X_today)++ if hasattr(model, "predict_proba"):+ # predict_proba[:, 1] is in [0, 1], map it to [-1, 1]+ prob = model.predict_proba(X_today)[0, 1]+ predictions.iloc[i] = prob * 2 - 1 # [0,1] -> [-1,1]+ else:+ predictions.iloc[i] = float(model.predict(X_today)[0])++ return predictions+```++## Parameters++| Parameter | Default | Description |+|------|--------|------|+| model_type | `"random_forest"` | Model type: `random_forest` / `gradient_boosting` / `ridge` |+| min_train_size | 252 | Minimum training-set size (starting length of the expanding window) |+| retrain_freq | 20 | Retraining frequency (every N trading days) |+| prediction_horizon | 5 | Prediction horizon (future N-day return) |+| n_estimators | 100 | Number of trees for tree-based models |+| max_depth | 5 | Maximum tree depth (prevents overfitting) |+| threshold | 0.0 | Signal filtering threshold (`abs(signal) < threshold` is set to 0) |++## Common Pitfalls++1. **Data leakage (most fatal)**: running `fit_transform` on the full dataset before backtesting means future information was used. Walk-forward is mandatory, and the training set must contain history only+2. **Standardization leakage**: using `StandardScaler` on the full dataset to compute means and standard deviations, then transforming everything. The correct approach is `fit_transform` on the training set, then `transform` only on the test set+3. **Overfitting**: trees that are too deep (`max_depth > 10`), too many features, or too small a training set. Keep `max_depth=3~5` and feature count `< 15`+4. **Class imbalance**: in bull markets the up/down ratio may be 7:3, so the model may prefer predicting the majority class. Use `class_weight="balanced"` or SMOTE if needed+5. **Feature noise**: irrelevant features add noise and reduce performance. Check `feature_importances_` after training and remove features with importance below 1%+6. **Look-ahead bias (non-leakage form)**: computing features from today's close and predicting today's signal. Make sure features use only data from T-1 and earlier+7. **Retraining frequency**: too frequent (daily) makes training slow and overfits recent data; too sparse (yearly) makes the model stale. Recommended `retrain_freq=20` (about one month)++## Dependencies++```bash+pip install scikit-learn joblib pandas numpy+```++## Signal Convention++- `predict_proba[:, 1]` mapped through `prob * 2 - 1` to `[-1.0, 1.0]` (continuous-strength signal)+- Or discrete signals from `predict()` in `{-1, 0, 1}` (short, neutral, long)+- Positive values = bullish direction, negative values = bearish direction, absolute value = confidence strengthdiff --git a/agent/src/skills/multi-factor/SKILL.md b/agent/src/skills/multi-factor/SKILL.mdnew file mode 100644index 000000000..e6093d2aa--- /dev/null+++ b/agent/src/skills/multi-factor/SKILL.md@@ -0,0 +1,56 @@+---+name: multi-factor+description: Multi-factor cross-sectional stock ranking. Combines factor standardization, equal-weight or IC-weighted scoring, and TopN portfolio construction. Suitable for multi-instrument portfolio strategies.+---+# Multi-Factor Cross-Sectional Stock Ranking++## Purpose++On the same time cross-section, compute multiple factor values for many stocks, standardize them, combine them into a composite score, and select the top-ranked stocks to build a portfolio.++## Signal Logic++1. **Factor calculation**: calculate N factors for each stock (such as momentum, value, and quality)+2. **Cross-sectional standardization**: standardize each factor on the cross-section with Z-score normalization (subtract mean, divide by standard deviation)+3. **Composite scoring**: sum the factors with equal weights (or custom weights) to obtain a composite score+4. **Rank and select**: go long the TopN names, with weight = 1/N for each++## Built-In Factors++| Factor Name | Calculation Method | Direction |+|--------|---------|------|+| momentum | Return over the past N days | Positive (higher is better) |+| reversal | Return over the past 5 days | Negative (lower is better) |+| volatility | Standard deviation of returns over the past N days | Negative (lower is better) |+| volume_ratio | Today's volume / N-day average volume | Positive |++If `extra_fields` are available (China A-shares), you can also add:+- `pe_factor`: 1/PE (the larger, the cheaper)+- `pb_factor`: 1/PB+- `roe_factor`: ROE (the larger, the better)++## Parameters++| Parameter | Default | Description |+|------|--------|------|+| momentum_window | 20 | Momentum lookback window |+| vol_window | 20 | Volatility lookback window |+| top_n | 3 | Number of selected stocks |+| rebalance_freq | 20 | Rebalancing frequency (trading days) |++## Common Pitfalls++- Cross-sectional standardization requires at least 3 stocks, otherwise Z-scores are meaningless+- Keep the previous signal unchanged between rebalance dates (do not rerank every day)+- Factors have different directions: momentum is positively sorted, volatility is negatively sorted, so directions must be aligned before standardization+- Portfolio weights must be normalized: each TopN stock gets 1/N, all others get 0++## Dependencies++```bash+pip install pandas numpy+```++## Signal Convention++- `1/N` = selected into TopN (equal-weight long), `0` = not selecteddiff --git a/agent/src/skills/multi-factor/example_signal_engine.py b/agent/src/skills/multi-factor/example_signal_engine.pynew file mode 100644index 000000000..4ac93fb5e--- /dev/null+++ b/agent/src/skills/multi-factor/example_signal_engine.py@@ -0,0 +1,202 @@+"""ๅคๅ ๅญๆช้ขๆๅ้่กไฟกๅทๅผๆใ++ๅฏนๅคๅช่ก็ฅจ่ฎก็ฎๅจ้/ๆณขๅจ็/้ๆฏ็ญๅ ๅญ๏ผๆช้ขๆ ๅๅๅ็ปผๅๆๅ๏ผ+้ๅ TopN ็ญๆๅๅคใ็บฏ pandas ๅฎ็ฐใ+"""++from typing import Dict, List++import numpy as np+import pandas as pd+++def zscore_cross_section(series_map: Dict[str, float]) -> Dict[str, float]:+ """ๅฏนๆช้ขๆฐๆฎๅ Z-score ๆ ๅๅใ++ Args:+ series_map: ๆ ็ไปฃ็ ๅฐๅ ๅญๅผ็ๆ ๅฐใ++ Returns:+ ๆ ๅๅๅ็ๆ ๅฐ๏ผๅๅผ 0๏ผๆ ๅๅทฎ 1๏ผใ+ """+ vals = [v for v in series_map.values() if not np.isnan(v)]+ if len(vals) < 2:+ return {k: 0.0 for k in series_map}+ mean = np.mean(vals)+ std = np.std(vals, ddof=1)+ if std < 1e-12:+ return {k: 0.0 for k in series_map}+ return {k: (v - mean) / std if not np.isnan(v) else 0.0 for k, v in series_map.items()}+++class SignalEngine:+ """ๅคๅ ๅญๆช้ขๆๅไฟกๅทๅผๆใ++ ่ฎก็ฎๅจ้ใๅ่ฝฌใๆณขๅจ็ใ้ๆฏๅไธชๅ ๅญ๏ผๆช้ขๆ ๅๅๅ็ญๆๆๅ๏ผ+ ้ TopN ่ก็ฅจ็ญๆๅๅคใ++ Attributes:+ momentum_window: ๅจ้ๅ็็ชๅฃใ+ vol_window: ๆณขๅจ็ๅ็็ชๅฃใ+ top_n: ้่กๆฐ้ใ+ rebalance_freq: ่ฐไป้ข็๏ผไบคๆๆฅ๏ผใ++ Example:+ >>> engine = SignalEngine(top_n=2, rebalance_freq=20)+ >>> signals = engine.generate(data_map)+ """++ def __init__(+ self,+ momentum_window: int = 20,+ vol_window: int = 20,+ top_n: int = 3,+ rebalance_freq: int = 20,+ ):+ """ๅๅงๅๅคๅ ๅญๅผๆใ++ Args:+ momentum_window: ๅจ้ๅ็็ชๅฃใ+ vol_window: ๆณขๅจ็ๅ็็ชๅฃใ+ top_n: ้่กๆฐ้ใ+ rebalance_freq: ่ฐไป้ข็๏ผไบคๆๆฅ๏ผใ+ """+ self.momentum_window = momentum_window+ self.vol_window = vol_window+ self.top_n = top_n+ self.rebalance_freq = rebalance_freq++ def _compute_factors(self, df: pd.DataFrame) -> pd.DataFrame:+ """่ฎก็ฎๅๅช่ก็ฅจ็ๅ ๅญๅผใ++ Args:+ df: OHLCV DataFrameใ++ Returns:+ ๅ ๅซๅๅ ๅญๅ็ DataFrameใ+ """+ close = df["close"]+ volume = df["volume"]+ returns = close.pct_change()++ factors = pd.DataFrame(index=df.index)+ # ๅจ้๏ผ่ฟๅป N ๆฅ็ดฏ่ฎกๆถ็๏ผๆญฃๅ๏ผ+ factors["momentum"] = close / close.shift(self.momentum_window) - 1+ # ๅ่ฝฌ๏ผ่ฟๅป 5 ๆฅๆถ็๏ผๅๅ๏ผๅ่ดๆฐไฝฟ"่ถไฝ่ถๅฅฝ"ๅๆ"่ถ้ซ่ถๅฅฝ"๏ผ+ factors["reversal"] = -(close / close.shift(5) - 1)+ # ๆณขๅจ็๏ผ่ฟๅป N ๆฅๆถ็ๆ ๅๅทฎ๏ผๅๅ๏ผๅ่ดๆฐ๏ผ+ factors["volatility"] = -returns.rolling(self.vol_window).std()+ # ้ๆฏ๏ผๅฝๆฅ้ / N ๆฅๅ้๏ผๆญฃๅ๏ผ+ factors["volume_ratio"] = volume / volume.rolling(self.vol_window).mean()++ return factors++ def generate(self, data_map: Dict[str, pd.DataFrame]) -> Dict[str, pd.Series]:+ """ๆช้ขๆๅ้่ก๏ผTopN ็ญๆๅๅคใ++ Args:+ data_map: ๆ ็ไปฃ็ ๅฐ OHLCV DataFrame ็ๆ ๅฐใ++ Returns:+ ๆ ็ไปฃ็ ๅฐไฟกๅท Series ็ๆ ๅฐ๏ผ1/N = ๅ ฅ้๏ผ0 = ๆชๅ ฅ้๏ผใ+ """+ codes = list(data_map.keys())+ if len(codes) < 2:+ # ๅๅช่ก็ฅจๆ ๆณๅๆช้ขๆๅ+ return {code: pd.Series(0.0, index=df.index) for code, df in data_map.items()}++ # ่ฎก็ฎๆๆ่ก็ฅจ็ๅ ๅญ+ factor_map: Dict[str, pd.DataFrame] = {}+ for code, df in data_map.items():+ factor_map[code] = self._compute_factors(df)++ # ่ทๅๅ ฌๅ ฑๆฅๆ+ all_dates = sorted(set().union(*(f.index for f in factor_map.values())))+ date_index = pd.DatetimeIndex(all_dates)++ signals = {code: pd.Series(0.0, index=date_index) for code in codes}+ factor_names = ["momentum", "reversal", "volatility", "volume_ratio"]++ last_selected: List[str] = []+ for i, dt in enumerate(date_index):+ # ้่ฐไปๆฅ๏ผๆฒฟ็จไธๆฌกไฟกๅท+ if i % self.rebalance_freq != 0 and last_selected:+ weight = 1.0 / len(last_selected) if last_selected else 0.0+ for code in last_selected:+ signals[code].at[dt] = weight+ continue++ # ่ฐไปๆฅ๏ผๆช้ขๆๅ+ composite_scores: Dict[str, float] = {}+ for factor_name in factor_names:+ raw_vals = {}+ for code in codes:+ if dt in factor_map[code].index:+ raw_vals[code] = factor_map[code].at[dt, factor_name]+ else:+ raw_vals[code] = np.nan+ z_vals = zscore_cross_section(raw_vals)+ for code in codes:+ composite_scores[code] = composite_scores.get(code, 0.0) + z_vals.get(code, 0.0)++ # ๆๅๅ TopN+ ranked = sorted(composite_scores.items(), key=lambda x: x[1], reverse=True)+ effective_n = min(self.top_n, len([s for _, s in ranked if not np.isnan(s)]))+ selected = [code for code, _ in ranked[:effective_n]]+ last_selected = selected++ if selected:+ weight = 1.0 / len(selected)+ for code in selected:+ signals[code].at[dt] = weight++ # ๅฏน้ฝๅฐๅๅง็ดขๅผ+ result = {}+ for code, df in data_map.items():+ result[code] = signals[code].reindex(df.index).fillna(0.0)+ return result+++if __name__ == "__main__":+ import requests++ def _fetch_okx(inst_id: str, bar: str = "1D", limit: int = 300) -> pd.DataFrame:+ """ไป OKX API ่ทๅ K ็บฟๆฐๆฎใ++ Args:+ inst_id: ไบคๆๅฏนๆ ่ฏ๏ผๅฆ "BTC-USDT"ใ+ bar: K ็บฟๅจๆใ+ limit: ่ทๅๆ นๆฐใ++ Returns:+ OHLCV DataFrameใ+ """+ resp = requests.get(+ "https://www.okx.com/api/v5/market/candles",+ params={"instId": inst_id, "bar": bar, "limit": str(limit)},+ )+ candles = resp.json()["data"]+ columns = ["ts", "open", "high", "low", "close", "vol", "volCcy", "volCcyQuote", "confirm"]+ df = pd.DataFrame(reversed(candles), columns=columns)+ df["ts"] = pd.to_datetime(df["ts"].astype("int64"), unit="ms")+ df = df.set_index("ts")+ for col in ["open", "high", "low", "close"]:+ df[col] = df[col].astype(float)+ df["volume"] = df["vol"].astype(float)+ return df++ symbols = ["BTC-USDT", "ETH-USDT", "SOL-USDT", "DOGE-USDT"]+ data_map = {}+ for sym in symbols:+ print(f"Fetching {sym} ...")+ data_map[sym] = _fetch_okx(sym, bar="1D", limit=300)++ engine = SignalEngine(top_n=2, rebalance_freq=20)+ signals = engine.generate(data_map)++ for sym in symbols:+ sig = signals[sym]+ active = (sig > 0).sum()+ print(f"\n{sym}: selected {active}/{len(sig)} days")+ if active > 0:+ print(f" Avg weight when selected: {sig[sig > 0].mean():.2%}")diff --git a/agent/src/skills/okx-market/SKILL.md b/agent/src/skills/okx-market/SKILL.mdnew file mode 100644index 000000000..0fca19872--- /dev/null+++ b/agent/src/skills/okx-market/SKILL.md@@ -0,0 +1,69 @@+---+name: okx-market+description: OKX cryptocurrency market data interface. Uses the OKX V5 REST API to retrieve spot, derivatives, index, and other crypto market data, including real-time prices, candlesticks, funding rates, open interest, and more. No authentication required, free to use.+---+# OKX Market++## Overview++The OKX V5 REST API provides comprehensive cryptocurrency market data covering spot, perpetual swaps, delivery futures, options, and more. All market-data endpoints are public and can be called directly without authentication. The data comes from OKX, the world's second-largest cryptocurrency exchange.++## Quick Start++- Install a Python runtime (Python 3.9+ recommended) and the required `requests` dependency.++```bash+pip install requests pandas+```++- No account registration or token configuration is required. Market-data endpoints are fully open.+- Review the endpoint documentation below and locate the interface you need.+- Use Python code to retrieve data according to the documentation. Example for the **spot ticker** endpoint:++```python+import requests+import pandas as pd++BASE_URL = "https://www.okx.com/api/v5"++# Get the latest BTC-USDT market quote+resp = requests.get(f"{BASE_URL}/market/ticker", params={"instId": "BTC-USDT"})+data = resp.json()["data"][0]+print(f"BTC last price: {data['last']} 24h change: {float(data['last'])/float(data['open24h'])*100-100:.2f}%")+```++## Parameter Format Reference++- **Instrument format (`instId`)**:+ - Spot: `BTC-USDT`, `ETH-USDT`+ - Perpetual swap: `BTC-USDT-SWAP`, `ETH-USDT-SWAP`+ - Delivery futures: `BTC-USDT-250328` (expiry date in `YYMMDD`)+ - Options: `BTC-USD-250328-95000-C` (expiry-strike-C/P)+ - Index: `BTC-USD`, `ETH-USD`+- **Candlestick interval (`bar`)**: `1m`, `3m`, `5m`, `15m`, `30m`, `1H`, `2H`, `4H`, `6H`, `12H`, `1D`, `1W`, `1M`+- **Instrument type (`instType`)**: `SPOT` (spot), `SWAP` (perpetual), `FUTURES` (delivery), `OPTION` (option)+- **Timestamp**: millisecond Unix timestamp (for example `1773763200000`)+- **Response format**: JSON. `code=0` indicates success, and data is returned in the `data` field++## Python Script Examples++- [Market data retrieval example](scripts/market_data_example.py)+- [Candlestick data retrieval example](scripts/candle_data_example.py)++## Market Data Endpoint List++| ID | Endpoint Path | Title (Detailed Documentation) | Category | Description |+| ---: | :--- | :--- | :--- | :--- |+| 1 | /market/ticker | [Single Ticker](references/็ฐ่ดง่กๆ /ๅไธช่กๆ .md) | Spot Market | Retrieve the latest market data for a single trading instrument, including last price, bid/ask, 24h volume, and more |+| 2 | /market/tickers | [Batch Tickers](references/็ฐ่ดง่กๆ /ๆน้่กๆ .md) | Spot Market | Retrieve all market data for a given instrument class (`SPOT`/`SWAP`/`FUTURES`/`OPTION`) in batch |+| 3 | /market/candles | [Candlestick Data](references/็ฐ่ดง่กๆ /K็บฟๆฐๆฎ.md) | Spot Market | Retrieve candlestick (OHLCV) data with multiple supported intervals |+| 4 | /market/trades | [Recent Trades](references/็ฐ่ดง่กๆ /ๆ่ฟๆไบค.md) | Spot Market | Retrieve recent trade-level details |+| 5 | /public/instruments | [Instrument List](references/็ฐ่ดง่กๆ /ไบคๆไบงๅๅ่กจ.md) | Spot Market | Retrieve metadata for all tradable instruments, including minimum order size and price precision |+| 6 | /market/books | [Order Book Depth](references/็ฐ่ดง่กๆ /ๆทฑๅบฆๆฐๆฎ.md) | Spot Market | Retrieve bid/ask order book depth data |+| 7 | /public/funding-rate | [Funding Rate](references/ๅ็บฆ่กๆ /่ต้่ดน็.md) | Derivatives Market | Retrieve current and historical funding rates for perpetual contracts |+| 8 | /public/funding-rate-history | [Historical Funding Rate](references/ๅ็บฆ่กๆ /ๅๅฒ่ต้่ดน็.md) | Derivatives Market | Retrieve historical funding-rate data for perpetual contracts |+| 9 | /public/mark-price | [Mark Price](references/ๅ็บฆ่กๆ /ๆ ่ฎฐไปทๆ ผ.md) | Derivatives Market | Retrieve mark prices for derivatives, used for PnL and liquidation calculations |+| 10 | /public/open-interest | [Open Interest](references/ๅ็บฆ่กๆ /ๆไป้.md) | Derivatives Market | Retrieve open-interest data for derivatives |+| 11 | /public/price-limit | [Price Limit](references/ๅ็บฆ่กๆ /้ไปท.md) | Derivatives Market | Retrieve the current maximum and minimum price limits for derivatives |+| 12 | /market/index-tickers | [Index Tickers](references/ๆๆฐ่กๆ /ๆๆฐ่กๆ .md) | Index Market | Retrieve index price market data |+| 13 | /market/index-candles | [Index Candles](references/ๆๆฐ่กๆ /ๆๆฐK็บฟ.md) | Index Market | Retrieve index candlestick data |diff --git "a/agent/src/skills/okx-market/references/\345\220\210\347\272\246\350\241\214\346\203\205/\345\216\206\345\217\262\350\265\204\351\207\221\350\264\271\347\216\207.md" "b/agent/src/skills/okx-market/references/\345\220\210\347\272\246\350\241\214\346\203\205/\345\216\206\345\217\262\350\265\204\351\207\221\350\264\271\347\216\207.md"new file mode 100644index 000000000..5ca5ee0bb--- /dev/null+++ "b/agent/src/skills/okx-market/references/\345\220\210\347\272\246\350\241\214\346\203\205/\345\216\206\345\217\262\350\265\204\351\207\221\350\264\271\347\216\207.md"@@ -0,0 +1,50 @@+## ๅๅฒ่ต้่ดน็+----++ๆฅๅฃ๏ผGET /api/v5/public/funding-rate-history+ๆ่ฟฐ๏ผ่ทๅๆฐธ็ปญๅ็บฆ็ๅๅฒ่ต้่ดน็ๆฐๆฎ๏ผ็จไบๅๆ่ดน็่ถๅฟๅๅฅๅฉๆบไผใ+้้ข๏ผ10ๆฌก/2s++**่พๅ ฅๅๆฐ**++| ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ |+| ---- | ---- | ---- | ---- |+| instId | str | Y | ๆฐธ็ปญๅ็บฆID๏ผๅฆ `BTC-USDT-SWAP` |+| after | str | N | ่ฏทๆฑๆญคๆถ้ดๆณไนๅ็ๆฐๆฎ๏ผๆฏซ็ง๏ผ |+| before | str | N | ่ฏทๆฑๆญคๆถ้ดๆณไนๅ็ๆฐๆฎ๏ผๆฏซ็ง๏ผ |+| limit | str | N | ่ฟๅๆกๆฐ๏ผ้ป่ฎค 100 |++**่พๅบๅๆฐ**++| ๅ็งฐ | ็ฑปๅ | ๆ่ฟฐ |+| ---- | ---- | ---- |+| instId | str | ๅ็บฆID |+| instType | str | ไบงๅ็ฑปๅ |+| fundingRate | str | ่ต้่ดน็ |+| realizedRate | str | ๅฎ้ ๆถๅ่ดน็ |+| fundingTime | str | ็ป็ฎๆถ้ด๏ผๆฏซ็ง๏ผ |++**ๆฅๅฃ็คบไพ**++```python+import requests+import pandas as pd++BASE_URL = "https://www.okx.com/api/v5"++# ่ทๅ BTC ๆฐธ็ปญๅๅฒ่ต้่ดน็+resp = requests.get(f"{BASE_URL}/public/funding-rate-history", params={+ "instId": "BTC-USDT-SWAP",+ "limit": "100"+})+rates = resp.json()["data"]++df = pd.DataFrame(rates)+df["fundingRate"] = df["fundingRate"].astype(float)+df["fundingTime"] = pd.to_datetime(df["fundingTime"].astype(int), unit="ms")++print(f"ๅนณๅ่ดน็: {df['fundingRate'].mean():.6f}")+print(f"ๆๅคง่ดน็: {df['fundingRate'].max():.6f}")+print(f"ๆๅฐ่ดน็: {df['fundingRate'].min():.6f}")+print(df[["fundingTime", "fundingRate"]].head(10))+```diff --git "a/agent/src/skills/okx-market/references/\345\220\210\347\272\246\350\241\214\346\203\205/\346\214\201\344\273\223\351\207\217.md" "b/agent/src/skills/okx-market/references/\345\220\210\347\272\246\350\241\214\346\203\205/\346\214\201\344\273\223\351\207\217.md"new file mode 100644index 000000000..2bdd03843--- /dev/null+++ "b/agent/src/skills/okx-market/references/\345\220\210\347\272\246\350\241\214\346\203\205/\346\214\201\344\273\223\351\207\217.md"@@ -0,0 +1,41 @@+## ๆไป้๏ผOpen Interest๏ผ+----++ๆฅๅฃ๏ผGET /api/v5/public/open-interest+ๆ่ฟฐ๏ผ่ทๅๅ็บฆๆไป้ๆฐๆฎ๏ผๅๆ ๅธๅบไธญๆชๅนณไปๅ็บฆ็ๆป้ใๆไป้ๅๅๆฏๅคๆญๅธๅบ่ถๅฟ็้่ฆๆๆ ใ+้้ข๏ผ20ๆฌก/2s++**่พๅ ฅๅๆฐ**++| ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ |+| ---- | ---- | ---- | ---- |+| instType | str | Y | ไบงๅ็ฑปๅ๏ผ`SWAP`ใ`FUTURES`ใ`OPTION` |+| instId | str | N | ไบงๅID๏ผๅฏ้่ฟๆปค๏ผ |++**่พๅบๅๆฐ**++| ๅ็งฐ | ็ฑปๅ | ๆ่ฟฐ |+| ---- | ---- | ---- |+| instType | str | ไบงๅ็ฑปๅ |+| instId | str | ไบงๅID |+| oi | str | ๆไป้๏ผๅ็บฆๅผ ๆฐ๏ผ |+| oiCcy | str | ๆไป้๏ผๅธ๏ผ |+| ts | str | ๆถ้ดๆณ๏ผๆฏซ็ง๏ผ |++**ๆฅๅฃ็คบไพ**++```python+import requests+import pandas as pd++BASE_URL = "https://www.okx.com/api/v5"++# ่ทๅๆๆๆฐธ็ปญๅ็บฆๆไป้+resp = requests.get(f"{BASE_URL}/public/open-interest", params={"instType": "SWAP"})+oi_data = resp.json()["data"]++df = pd.DataFrame(oi_data)+df["oiCcy"] = df["oiCcy"].astype(float)+df = df.sort_values("oiCcy", ascending=False)+print(df[["instId", "oi", "oiCcy"]].head(10))+```diff --git "a/agent/src/skills/okx-market/references/\345\220\210\347\272\246\350\241\214\346\203\205/\346\240\207\350\256\260\344\273\267\346\240\274.md" "b/agent/src/skills/okx-market/references/\345\220\210\347\272\246\350\241\214\346\203\205/\346\240\207\350\256\260\344\273\267\346\240\274.md"new file mode 100644index 000000000..35622c533--- /dev/null+++ "b/agent/src/skills/okx-market/references/\345\220\210\347\272\246\350\241\214\346\203\205/\346\240\207\350\256\260\344\273\267\346\240\274.md"@@ -0,0 +1,43 @@+## ๆ ่ฎฐไปทๆ ผ+----++ๆฅๅฃ๏ผGET /api/v5/public/mark-price+ๆ่ฟฐ๏ผ่ทๅๅ็บฆ็ๆ ่ฎฐไปทๆ ผใๆ ่ฎฐไปทๆ ผ็จไบ่ฎก็ฎๆชๅฎ็ฐ็ไบๅๅผบๅถๅนณไป๏ผๆฏๆๆฐๆไบคไปทๆด็จณๅฎใ+้้ข๏ผ20ๆฌก/2s++**่พๅ ฅๅๆฐ**++| ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ |+| ---- | ---- | ---- | ---- |+| instType | str | Y | ไบงๅ็ฑปๅ๏ผ`SWAP`ใ`FUTURES`ใ`OPTION` |+| instId | str | N | ไบงๅID๏ผๅฏ้่ฟๆปค๏ผ |++**่พๅบๅๆฐ**++| ๅ็งฐ | ็ฑปๅ | ๆ่ฟฐ |+| ---- | ---- | ---- |+| instType | str | ไบงๅ็ฑปๅ |+| instId | str | ไบงๅID |+| markPx | str | ๆ ่ฎฐไปทๆ ผ |+| ts | str | ๆถ้ดๆณ๏ผๆฏซ็ง๏ผ |++**ๆฅๅฃ็คบไพ**++```python+import requests++BASE_URL = "https://www.okx.com/api/v5"++# ่ทๅ BTC ๆฐธ็ปญๆ ่ฎฐไปทๆ ผ+resp = requests.get(f"{BASE_URL}/public/mark-price", params={+ "instType": "SWAP",+ "instId": "BTC-USDT-SWAP"+})+data = resp.json()["data"][0]+print(f"BTC ๆฐธ็ปญๆ ่ฎฐไปทๆ ผ: {data['markPx']}")++# ่ทๅๆๆๆฐธ็ปญๅ็บฆๆ ่ฎฐไปทๆ ผ+resp = requests.get(f"{BASE_URL}/public/mark-price", params={"instType": "SWAP"})+all_marks = resp.json()["data"]+print(f"ๅ็บฆๆฐ้: {len(all_marks)}")+```diff --git "a/agent/src/skills/okx-market/references/\345\220\210\347\272\246\350\241\214\346\203\205/\350\265\204\351\207\221\350\264\271\347\216\207.md" "b/agent/src/skills/okx-market/references/\345\220\210\347\272\246\350\241\214\346\203\205/\350\265\204\351\207\221\350\264\271\347\216\207.md"new file mode 100644index 000000000..1a337a73f--- /dev/null+++ "b/agent/src/skills/okx-market/references/\345\220\210\347\272\246\350\241\214\346\203\205/\350\265\204\351\207\221\350\264\271\347\216\207.md"@@ -0,0 +1,48 @@+## ่ต้่ดน็+----++ๆฅๅฃ๏ผGET /api/v5/public/funding-rate+ๆ่ฟฐ๏ผ่ทๅๆฐธ็ปญๅ็บฆ็ๅฝๅ่ต้่ดน็ๅไธๆฌก็ป็ฎๆถ้ดใ่ต้่ดน็ๆฏๆฐธ็ปญๅ็บฆ็ๆ ธๅฟๆบๅถ๏ผๅๆ ๅค็ฉบๅ้ๅฏนๆฏใ+้้ข๏ผ20ๆฌก/2s++**่พๅ ฅๅๆฐ**++| ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ |+| ---- | ---- | ---- | ---- |+| instId | str | Y | ๆฐธ็ปญๅ็บฆID๏ผๅฆ `BTC-USDT-SWAP` |++**่พๅบๅๆฐ**++| ๅ็งฐ | ็ฑปๅ | ๆ่ฟฐ |+| ---- | ---- | ---- |+| instId | str | ๅ็บฆID |+| instType | str | ไบงๅ็ฑปๅ๏ผSWAP๏ผ |+| fundingRate | str | ๅฝๅ่ต้่ดน็ |+| fundingTime | str | ไธๆฌก็ป็ฎๆถ้ด๏ผๆฏซ็ง๏ผ |+| nextFundingRate | str | ้ขๆตไธๆ่ต้่ดน็๏ผๅฏ่ฝไธบ็ฉบ๏ผ |+| nextFundingTime | str | ไธไธๆฌก็ป็ฎๆถ้ด๏ผๆฏซ็ง๏ผ |+| settFundingRate | str | ไธๆฌกๅทฒ็ป็ฎ่ต้่ดน็ |+| settState | str | ็ป็ฎ็ถๆ๏ผ`settled`๏ผๅทฒ็ป็ฎ๏ผ/ `processing`๏ผ็ป็ฎไธญ๏ผ |+| prevFundingTime | str | ไธๆฌก็ป็ฎๆถ้ด๏ผๆฏซ็ง๏ผ |+| maxFundingRate | str | ๆๅคง่ต้่ดน็ |+| minFundingRate | str | ๆๅฐ่ต้่ดน็ |+| ts | str | ๆฐๆฎๆถ้ดๆณ๏ผๆฏซ็ง๏ผ |++**ๆฅๅฃ็คบไพ**++```python+import requests+from datetime import datetime++BASE_URL = "https://www.okx.com/api/v5"++# ่ทๅ BTC ๆฐธ็ปญ่ต้่ดน็+resp = requests.get(f"{BASE_URL}/public/funding-rate", params={"instId": "BTC-USDT-SWAP"})+data = resp.json()["data"][0]++rate = float(data["fundingRate"])+next_time = datetime.fromtimestamp(int(data["fundingTime"]) / 1000)+print(f"ๅฝๅ่ต้่ดน็: {rate:.6f} ({rate*100:.4f}%)")+print(f"ไธๆฌก็ป็ฎๆถ้ด: {next_time}")+print(f"ๅนดๅ่ดน็: {rate * 3 * 365 * 100:.2f}%") # ๆฏ8ๅฐๆถ็ป็ฎไธๆฌก+```diff --git "a/agent/src/skills/okx-market/references/\345\220\210\347\272\246\350\241\214\346\203\205/\351\231\220\344\273\267.md" "b/agent/src/skills/okx-market/references/\345\220\210\347\272\246\350\241\214\346\203\205/\351\231\220\344\273\267.md"new file mode 100644index 000000000..c918ad17f--- /dev/null+++ "b/agent/src/skills/okx-market/references/\345\220\210\347\272\246\350\241\214\346\203\205/\351\231\220\344\273\267.md"@@ -0,0 +1,35 @@+## ๅ็บฆ้ไปท+----++ๆฅๅฃ๏ผGET /api/v5/public/price-limit+ๆ่ฟฐ๏ผ่ทๅๅ็บฆ็ๅฝๅๆ้ซๅๆไฝ้ไปทใ่ถ ๅบ้ไปท่ๅด็่ฎขๅไผ่ขซๆ็ปใ+้้ข๏ผ20ๆฌก/2s++**่พๅ ฅๅๆฐ**++| ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ |+| ---- | ---- | ---- | ---- |+| instId | str | Y | ๅ็บฆID๏ผๅฆ `BTC-USDT-SWAP` |++**่พๅบๅๆฐ**++| ๅ็งฐ | ็ฑปๅ | ๆ่ฟฐ |+| ---- | ---- | ---- |+| instType | str | ไบงๅ็ฑปๅ |+| instId | str | ไบงๅID |+| buyLmt | str | ไนฐๅ ฅ้ไปท๏ผๆ้ซๅฏไนฐไปท๏ผ |+| sellLmt | str | ๅๅบ้ไปท๏ผๆไฝๅฏๅไปท๏ผ |+| ts | str | ๆถ้ดๆณ๏ผๆฏซ็ง๏ผ |++**ๆฅๅฃ็คบไพ**++```python+import requests++BASE_URL = "https://www.okx.com/api/v5"++resp = requests.get(f"{BASE_URL}/public/price-limit", params={"instId": "BTC-USDT-SWAP"})+data = resp.json()["data"][0]+print(f"ไนฐๅ ฅไธ้: {data['buyLmt']}")+print(f"ๅๅบไธ้: {data['sellLmt']}")+```diff --git "a/agent/src/skills/okx-market/references/\346\214\207\346\225\260\350\241\214\346\203\205/\346\214\207\346\225\260K\347\272\277.md" "b/agent/src/skills/okx-market/references/\346\214\207\346\225\260\350\241\214\346\203\205/\346\214\207\346\225\260K\347\272\277.md"new file mode 100644index 000000000..29d780ba2--- /dev/null+++ "b/agent/src/skills/okx-market/references/\346\214\207\346\225\260\350\241\214\346\203\205/\346\214\207\346\225\260K\347\272\277.md"@@ -0,0 +1,53 @@+## ๆๆฐK็บฟ+----++ๆฅๅฃ๏ผGET /api/v5/market/index-candles+ๆ่ฟฐ๏ผ่ทๅๆๆฐ็K็บฟๆฐๆฎ๏ผ็จไบๅๆๅบๅไปทๆ ผ่ตฐๅฟใ+้้ข๏ผ20ๆฌก/2s++**่พๅ ฅๅๆฐ**++| ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ |+| ---- | ---- | ---- | ---- |+| instId | str | Y | ๆๆฐID๏ผๅฆ `BTC-USD` |+| bar | str | N | K็บฟๅจๆ๏ผ้ป่ฎค `1m`ใๅฏ้๏ผ`1m/3m/5m/15m/30m/1H/2H/4H/6H/12H/1D/1W/1M` |+| after | str | N | ่ฏทๆฑๆญคๆถ้ดๆณไนๅ็ๆฐๆฎ๏ผๆฏซ็ง๏ผ |+| before | str | N | ่ฏทๆฑๆญคๆถ้ดๆณไนๅ็ๆฐๆฎ๏ผๆฏซ็ง๏ผ |+| limit | str | N | ่ฟๅๆกๆฐ๏ผ้ป่ฎค 100๏ผๆๅคง 100 |++**่พๅบๅๆฐ**++่ฟๅไบ็ปดๆฐ็ป๏ผๆฏๆกๆฐๆฎ๏ผ++| ็ดขๅผ | ๆ่ฟฐ |+| ---- | ---- |+| 0 | ๅผ็ๆถ้ด๏ผๆฏซ็งๆถ้ดๆณ๏ผ |+| 1 | ๅผ็ไปท |+| 2 | ๆ้ซไปท |+| 3 | ๆไฝไปท |+| 4 | ๆถ็ไปท |+| 5 | K็บฟ็ถๆ๏ผ`0`=ๆชๅฎ็ป๏ผ`1`=ๅทฒๅฎ็ป |++**ๆฅๅฃ็คบไพ**++```python+import requests+import pandas as pd++BASE_URL = "https://www.okx.com/api/v5"++# ่ทๅ BTC ๆๆฐๆฅK+resp = requests.get(f"{BASE_URL}/market/index-candles", params={+ "instId": "BTC-USD",+ "bar": "1D",+ "limit": "30"+})+candles = resp.json()["data"]++columns = ["ts", "open", "high", "low", "close", "confirm"]+df = pd.DataFrame(candles, columns=columns)+df["ts"] = pd.to_datetime(df["ts"].astype(int), unit="ms")+for col in ["open", "high", "low", "close"]:+ df[col] = df[col].astype(float)+print(df[["ts", "open", "high", "low", "close"]].head())+```diff --git "a/agent/src/skills/okx-market/references/\346\214\207\346\225\260\350\241\214\346\203\205/\346\214\207\346\225\260\350\241\214\346\203\205.md" "b/agent/src/skills/okx-market/references/\346\214\207\346\225\260\350\241\214\346\203\205/\346\214\207\346\225\260\350\241\214\346\203\205.md"new file mode 100644index 000000000..1b2431bd7--- /dev/null+++ "b/agent/src/skills/okx-market/references/\346\214\207\346\225\260\350\241\214\346\203\205/\346\214\207\346\225\260\350\241\214\346\203\205.md"@@ -0,0 +1,45 @@+## ๆๆฐ่กๆ+----++ๆฅๅฃ๏ผGET /api/v5/market/index-tickers+ๆ่ฟฐ๏ผ่ทๅๆๆฐไปทๆ ผ่กๆ ใๆๆฐไปทๆ ผ็ฑๅคๅฎถไบคๆๆ็ฐ่ดงไปทๆ ผๅ ๆ่ฎก็ฎ๏ผ็จไบ่ก็ๅๅฎไปทๅบๅใ+้้ข๏ผ20ๆฌก/2s++**่พๅ ฅๅๆฐ**++| ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ |+| ---- | ---- | ---- | ---- |+| instId | str | N | ๆๆฐID๏ผๅฆ `BTC-USD`ใ`ETH-USD`๏ผไธ quoteCcy ไบ้ไธ๏ผ |+| quoteCcy | str | N | ่ฎกไปท่ดงๅธ๏ผๅฆ `USD`๏ผ่ทๅๆๆ USD ๆๆฐ๏ผ |++**่พๅบๅๆฐ**++| ๅ็งฐ | ็ฑปๅ | ๆ่ฟฐ |+| ---- | ---- | ---- |+| instId | str | ๆๆฐID |+| idxPx | str | ๆๆฐๆๆฐไปทๆ ผ |+| high24h | str | 24ๅฐๆถๆ้ซ |+| low24h | str | 24ๅฐๆถๆไฝ |+| open24h | str | 24ๅฐๆถๅผ็ไปท |+| sodUtc0 | str | UTC 0็นๅผ็ไปท |+| sodUtc8 | str | UTC+8 0็นๅผ็ไปท |+| ts | str | ๆถ้ดๆณ๏ผๆฏซ็ง๏ผ |++**ๆฅๅฃ็คบไพ**++```python+import requests++BASE_URL = "https://www.okx.com/api/v5"++# ่ทๅ BTC ๆๆฐไปทๆ ผ+resp = requests.get(f"{BASE_URL}/market/index-tickers", params={"instId": "BTC-USD"})+data = resp.json()["data"][0]+print(f"BTC ๆๆฐไปทๆ ผ: {data['idxPx']}")++# ่ทๅๆๆ USD ๆๆฐ+resp = requests.get(f"{BASE_URL}/market/index-tickers", params={"quoteCcy": "USD"})+indexes = resp.json()["data"]+for idx in indexes[:10]:+ print(f" {idx['instId']:15s} {idx['idxPx']:>10s}")+```diff --git "a/agent/src/skills/okx-market/references/\347\216\260\350\264\247\350\241\214\346\203\205/K\347\272\277\346\225\260\346\215\256.md" "b/agent/src/skills/okx-market/references/\347\216\260\350\264\247\350\241\214\346\203\205/K\347\272\277\346\225\260\346\215\256.md"new file mode 100644index 000000000..833c2e521--- /dev/null+++ "b/agent/src/skills/okx-market/references/\347\216\260\350\264\247\350\241\214\346\203\205/K\347\272\277\346\225\260\346\215\256.md"@@ -0,0 +1,77 @@+## K็บฟๆฐๆฎ๏ผOHLCV๏ผ+----++ๆฅๅฃ๏ผGET /api/v5/market/candles+ๆ่ฟฐ๏ผ่ทๅK็บฟๆฐๆฎ๏ผๆฏๆไป1ๅ้ๅฐ1ๆๅค็งๅจๆใๆๅค่ฟๅ1440ๆกๅๅฒๆฐๆฎใๅฏ้่ฟ after/before ๅๆฐ็ฟป้กต่ทๅๆดๆฉๆฐๆฎใ+้้ข๏ผ40ๆฌก/2s++**่พๅ ฅๅๆฐ**++| ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ |+| ---- | ---- | ---- | ---- |+| instId | str | Y | ไบคๆไบงๅID๏ผๅฆ `BTC-USDT` |+| bar | str | N | K็บฟๅจๆ๏ผ้ป่ฎค `1m`ใๅฏ้๏ผ`1m/3m/5m/15m/30m/1H/2H/4H/6H/12H/1D/1W/1M` |+| after | str | N | ่ฏทๆฑๆญคๆถ้ดๆณไนๅ็ๆฐๆฎ๏ผๆฏซ็ง๏ผ๏ผ็จไบ็ฟป้กต |+| before | str | N | ่ฏทๆฑๆญคๆถ้ดๆณไนๅ็ๆฐๆฎ๏ผๆฏซ็ง๏ผ |+| limit | str | N | ่ฟๅๆกๆฐ๏ผ้ป่ฎค 100๏ผๆๅคง 300 |++**่พๅบๅๆฐ**++่ฟๅไบ็ปดๆฐ็ป๏ผๆฏๆกๆฐๆฎๆไปฅไธ้กบๅบๆๅ๏ผ++| ็ดขๅผ | ๆ่ฟฐ |+| ---- | ---- |+| 0 | ๅผ็ๆถ้ด๏ผๆฏซ็งๆถ้ดๆณ๏ผ |+| 1 | ๅผ็ไปท๏ผOpen๏ผ |+| 2 | ๆ้ซไปท๏ผHigh๏ผ |+| 3 | ๆไฝไปท๏ผLow๏ผ |+| 4 | ๆถ็ไปท๏ผClose๏ผ |+| 5 | ๆไบค้๏ผๅธ๏ผ |+| 6 | ๆไบค้ข๏ผ่ฎกไปท่ดงๅธ๏ผ |+| 7 | ๆไบค้ข๏ผๆฅไปท่ดงๅธ๏ผ |+| 8 | K็บฟ็ถๆ๏ผ`0`=ๆชๅฎ็ป๏ผ`1`=ๅทฒๅฎ็ป |++**ๆฅๅฃ็คบไพ**++```python+import requests+import pandas as pd++BASE_URL = "https://www.okx.com/api/v5"++# ่ทๅ BTC-USDT ๆฅ็บฟ๏ผๆ่ฟ30ๆ น+resp = requests.get(f"{BASE_URL}/market/candles", params={+ "instId": "BTC-USDT",+ "bar": "1D",+ "limit": "30"+})+candles = resp.json()["data"]++# ่ฝฌไธบ DataFrame+columns = ["ts", "open", "high", "low", "close", "vol", "volCcy", "volCcyQuote", "confirm"]+df = pd.DataFrame(candles, columns=columns)+df["ts"] = pd.to_datetime(df["ts"].astype(int), unit="ms")+for col in ["open", "high", "low", "close", "vol"]:+ df[col] = df[col].astype(float)+print(df[["ts", "open", "high", "low", "close", "vol"]].head())++# ่ทๅ ETH-USDT 4ๅฐๆถK็บฟ+resp = requests.get(f"{BASE_URL}/market/candles", params={+ "instId": "ETH-USDT",+ "bar": "4H",+ "limit": "50"+})+```++**ๆฐๆฎๆ ทไพ**++```json+{+ "code": "0",+ "data": [+ ["1773763200000", "73915.5", "74800", "71966", "72144.3", "5129.27", "377618988.24", "377618988.24", "0"],+ ["1773676800000", "73269.1", "76011.8", "73158", "73917.4", "8631.72", "642101158.54", "642101158.54", "1"],+ ["1773590400000", "71478.1", "74500", "71300", "73269.1", "8461.09", "620450708.74", "620450708.74", "1"]+ ]+}+```diff --git "a/agent/src/skills/okx-market/references/\347\216\260\350\264\247\350\241\214\346\203\205/\344\272\244\346\230\223\344\272\247\345\223\201\345\210\227\350\241\250.md" "b/agent/src/skills/okx-market/references/\347\216\260\350\264\247\350\241\214\346\203\205/\344\272\244\346\230\223\344\272\247\345\223\201\345\210\227\350\241\250.md"new file mode 100644index 000000000..a573b2019--- /dev/null+++ "b/agent/src/skills/okx-market/references/\347\216\260\350\264\247\350\241\214\346\203\205/\344\272\244\346\230\223\344\272\247\345\223\201\345\210\227\350\241\250.md"@@ -0,0 +1,53 @@+## ไบคๆไบงๅๅ่กจ+----++ๆฅๅฃ๏ผGET /api/v5/public/instruments+ๆ่ฟฐ๏ผ่ทๅๆๆๅฏไบคๆไบงๅ็ๅบ็กไฟกๆฏ๏ผๅ ๆฌไบคๆๅฏนๅ็งฐใๆๅฐไธๅ้ใไปทๆ ผ็ฒพๅบฆใๅ็บฆ้ขๅผ็ญใ+้้ข๏ผ20ๆฌก/2s++**่พๅ ฅๅๆฐ**++| ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ |+| ---- | ---- | ---- | ---- |+| instType | str | Y | ไบงๅ็ฑปๅ๏ผ`SPOT`ใ`SWAP`ใ`FUTURES`ใ`OPTION` |+| instId | str | N | ไบงๅID๏ผๅฆ `BTC-USDT`๏ผๅฏ้่ฟๆปค๏ผ |++**่พๅบๅๆฐ**++| ๅ็งฐ | ็ฑปๅ | ๆ่ฟฐ |+| ---- | ---- | ---- |+| instType | str | ไบงๅ็ฑปๅ |+| instId | str | ไบงๅID |+| baseCcy | str | ๅบ็ก่ดงๅธ๏ผๅฆ BTC๏ผ |+| quoteCcy | str | ่ฎกไปท่ดงๅธ๏ผๅฆ USDT๏ผ |+| tickSz | str | ๆๅฐไปทๆ ผๅๅจ๏ผไปทๆ ผ็ฒพๅบฆ๏ผ |+| lotSz | str | ๆๅฐไบคๆๆฐ้๏ผไธๅ็ฒพๅบฆ๏ผ |+| minSz | str | ๆๅฐไธๅ้ |+| ctVal | str | ๅ็บฆ้ขๅผ๏ผไป ๅ็บฆ๏ผ |+| lever | str | ๆๅคงๆ ๆ๏ผไป ๅ็บฆ๏ผ |+| listTime | str | ไธๅธๆถ้ด |+| state | str | ็ถๆ๏ผ`live`๏ผไบคๆไธญ๏ผ/ `suspend`๏ผๆๅ๏ผ |++**ๆฅๅฃ็คบไพ**++```python+import requests+import pandas as pd++BASE_URL = "https://www.okx.com/api/v5"++# ่ทๅๆๆ็ฐ่ดงไบคๆๅฏน+resp = requests.get(f"{BASE_URL}/public/instruments", params={"instType": "SPOT"})+instruments = resp.json()["data"]+print(f"็ฐ่ดงไบคๆๅฏนๆฐ้: {len(instruments)}")++# ็ญ้ USDT ไบคๆๅฏน+usdt_pairs = [i for i in instruments if i["quoteCcy"] == "USDT"]+df = pd.DataFrame(usdt_pairs)[["instId", "baseCcy", "minSz", "tickSz", "lotSz"]]+print(df.head(10))++# ่ทๅๆๆๆฐธ็ปญๅ็บฆ+resp = requests.get(f"{BASE_URL}/public/instruments", params={"instType": "SWAP"})+swaps = resp.json()["data"]+print(f"ๆฐธ็ปญๅ็บฆๆฐ้: {len(swaps)}")+```diff --git "a/agent/src/skills/okx-market/references/\347\216\260\350\264\247\350\241\214\346\203\205/\345\215\225\344\270\252\350\241\214\346\203\205.md" "b/agent/src/skills/okx-market/references/\347\216\260\350\264\247\350\241\214\346\203\205/\345\215\225\344\270\252\350\241\214\346\203\205.md"new file mode 100644index 000000000..1edc9bef7--- /dev/null+++ "b/agent/src/skills/okx-market/references/\347\216\260\350\264\247\350\241\214\346\203\205/\345\215\225\344\270\252\350\241\214\346\203\205.md"@@ -0,0 +1,77 @@+## ๅไธชไบงๅ่กๆ+----++ๆฅๅฃ๏ผGET /api/v5/market/ticker+ๆ่ฟฐ๏ผ่ทๅๅไธชไบคๆไบงๅ็ๆๆฐ่กๆ ๅฟซ็ ง๏ผๅ ๆฌๆๆฐๆไบคไปทใไนฐไธๅไธไปทใ24ๅฐๆถๆไบค้็ญๆ ธๅฟๆฐๆฎใ+้้ข๏ผ20ๆฌก/2s++**่พๅ ฅๅๆฐ**++| ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ |+| ---- | ---- | ---- | ---- |+| instId | str | Y | ไบคๆไบงๅID๏ผๅฆ `BTC-USDT`ใ`BTC-USDT-SWAP` |++**่พๅบๅๆฐ**++| ๅ็งฐ | ็ฑปๅ | ๆ่ฟฐ |+| ---- | ---- | ---- |+| instType | str | ไบงๅ็ฑปๅ๏ผSPOT/SWAP/FUTURES/OPTION๏ผ |+| instId | str | ไบคๆไบงๅID |+| last | str | ๆๆฐๆไบคไปท |+| lastSz | str | ๆๆฐๆไบค้ |+| askPx | str | ๅไธไปท |+| askSz | str | ๅไธ้ |+| bidPx | str | ไนฐไธไปท |+| bidSz | str | ไนฐไธ้ |+| open24h | str | 24ๅฐๆถๅผ็ไปท |+| high24h | str | 24ๅฐๆถๆ้ซไปท |+| low24h | str | 24ๅฐๆถๆไฝไปท |+| vol24h | str | 24ๅฐๆถๆไบค้๏ผๅธ๏ผ |+| volCcy24h | str | 24ๅฐๆถๆไบค้ข๏ผ่ฎกไปท่ดงๅธ๏ผ |+| sodUtc0 | str | UTC 0็นๅผ็ไปท |+| sodUtc8 | str | UTC+8 0็นๅผ็ไปท |+| ts | str | ๆฐๆฎๆถ้ดๆณ๏ผๆฏซ็ง๏ผ |++**ๆฅๅฃ็คบไพ**++```python+import requests++BASE_URL = "https://www.okx.com/api/v5"++# ่ทๅ BTC-USDT ็ฐ่ดง่กๆ+resp = requests.get(f"{BASE_URL}/market/ticker", params={"instId": "BTC-USDT"})+data = resp.json()["data"][0]+print(f"ๆๆฐไปท: {data['last']}, 24h้: {data['vol24h']}")++# ่ทๅ ETH-USDT ๆฐธ็ปญๅ็บฆ่กๆ+resp = requests.get(f"{BASE_URL}/market/ticker", params={"instId": "ETH-USDT-SWAP"})+data = resp.json()["data"][0]+print(f"ETHๆฐธ็ปญๆๆฐไปท: {data['last']}")+```++**ๆฐๆฎๆ ทไพ**++```json+{+ "code": "0",+ "data": [{+ "instType": "SPOT",+ "instId": "BTC-USDT",+ "last": "72159",+ "lastSz": "0.00005196",+ "askPx": "72157.1",+ "askSz": "1.44548635",+ "bidPx": "72157",+ "bidSz": "0.1012",+ "open24h": "73554.5",+ "high24h": "74883",+ "low24h": "71966",+ "volCcy24h": "443213018.596221053",+ "vol24h": "6013.17760207",+ "ts": "1773842459809",+ "sodUtc0": "73904.3",+ "sodUtc8": "73915.5"+ }]+}+```diff --git "a/agent/src/skills/okx-market/references/\347\216\260\350\264\247\350\241\214\346\203\205/\346\211\271\351\207\217\350\241\214\346\203\205.md" "b/agent/src/skills/okx-market/references/\347\216\260\350\264\247\350\241\214\346\203\205/\346\211\271\351\207\217\350\241\214\346\203\205.md"new file mode 100644index 000000000..6c0bf93fd--- /dev/null+++ "b/agent/src/skills/okx-market/references/\347\216\260\350\264\247\350\241\214\346\203\205/\346\211\271\351\207\217\350\241\214\346\203\205.md"@@ -0,0 +1,44 @@+## ๆน้ไบงๅ่กๆ+----++ๆฅๅฃ๏ผGET /api/v5/market/tickers+ๆ่ฟฐ๏ผๆน้่ทๅๆไธชไบงๅ็ฑปๅไธๆๆไบงๅ็่กๆ ๆฐๆฎใไพๅฆ่ทๅๆๆ็ฐ่ดงไบคๆๅฏน็่กๆ ใ+้้ข๏ผ20ๆฌก/2s++**่พๅ ฅๅๆฐ**++| ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ |+| ---- | ---- | ---- | ---- |+| instType | str | Y | ไบงๅ็ฑปๅ๏ผ`SPOT`๏ผ็ฐ่ดง๏ผใ`SWAP`๏ผๆฐธ็ปญ๏ผใ`FUTURES`๏ผไบคๅฒ๏ผใ`OPTION`๏ผๆๆ๏ผ |++**่พๅบๅๆฐ**++ไธๅไธช่กๆ ๆฅๅฃ็ธๅ๏ผ่ฟๅๆฐ็ปๅ ๅซ่ฏฅ็ฑปๅไธๆๆไบงๅ่กๆ ใ++**ๆฅๅฃ็คบไพ**++```python+import requests+import pandas as pd++BASE_URL = "https://www.okx.com/api/v5"++# ่ทๅๆๆ็ฐ่ดง่กๆ+resp = requests.get(f"{BASE_URL}/market/tickers", params={"instType": "SPOT"})+tickers = resp.json()["data"]++# ่ฝฌไธบ DataFrame๏ผๆ24hๆไบค้ขๆๅบ+df = pd.DataFrame(tickers)+df["volCcy24h"] = df["volCcy24h"].astype(float)+df = df.sort_values("volCcy24h", ascending=False)+print(df[["instId", "last", "volCcy24h"]].head(10))++# ่ทๅๆๆๆฐธ็ปญๅ็บฆ่กๆ+resp = requests.get(f"{BASE_URL}/market/tickers", params={"instType": "SWAP"})+swaps = resp.json()["data"]+print(f"ๆฐธ็ปญๅ็บฆๆฐ้: {len(swaps)}")+```++**ๆฐๆฎๆ ทไพ**++่ฟๅ็ปๆไธๅไธช่กๆ ็ธๅ๏ผ`data` ไธบๆฐ็ปๅฝขๅผ๏ผๅ ๅซ่ฏฅ็ฑปๅไธๅ จ้จไบงๅใdiff --git "a/agent/src/skills/okx-market/references/\347\216\260\350\264\247\350\241\214\346\203\205/\346\234\200\350\277\221\346\210\220\344\272\244.md" "b/agent/src/skills/okx-market/references/\347\216\260\350\264\247\350\241\214\346\203\205/\346\234\200\350\277\221\346\210\220\344\272\244.md"new file mode 100644index 000000000..59341c3a7--- /dev/null+++ "b/agent/src/skills/okx-market/references/\347\216\260\350\264\247\350\241\214\346\203\205/\346\234\200\350\277\221\346\210\220\344\272\244.md"@@ -0,0 +1,38 @@+## ๆ่ฟๆไบค+----++ๆฅๅฃ๏ผGET /api/v5/market/trades+ๆ่ฟฐ๏ผ่ทๅไบงๅๆ่ฟ็ๆไบคๆ็ปๆฐๆฎใ+้้ข๏ผ20ๆฌก/2s++**่พๅ ฅๅๆฐ**++| ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ |+| ---- | ---- | ---- | ---- |+| instId | str | Y | ไบคๆไบงๅID๏ผๅฆ `BTC-USDT` |+| limit | str | N | ่ฟๅๆกๆฐ๏ผ้ป่ฎค 100๏ผๆๅคง 500 |++**่พๅบๅๆฐ**++| ๅ็งฐ | ็ฑปๅ | ๆ่ฟฐ |+| ---- | ---- | ---- |+| instId | str | ไบคๆไบงๅID |+| tradeId | str | ๆไบคID |+| px | str | ๆไบคไปทๆ ผ |+| sz | str | ๆไบคๆฐ้ |+| side | str | ๆไบคๆนๅ๏ผ`buy`๏ผไนฐๅ ฅ๏ผ/ `sell`๏ผๅๅบ๏ผ |+| ts | str | ๆไบคๆถ้ด๏ผๆฏซ็ง๏ผ |++**ๆฅๅฃ็คบไพ**++```python+import requests++BASE_URL = "https://www.okx.com/api/v5"++# ่ทๅ BTC-USDT ๆ่ฟๆไบค+resp = requests.get(f"{BASE_URL}/market/trades", params={"instId": "BTC-USDT", "limit": "10"})+trades = resp.json()["data"]+for t in trades:+ print(f"{t['side']:4s} {t['px']:>10s} {t['sz']:>12s}")+```diff --git "a/agent/src/skills/okx-market/references/\347\216\260\350\264\247\350\241\214\346\203\205/\346\267\261\345\272\246\346\225\260\346\215\256.md" "b/agent/src/skills/okx-market/references/\347\216\260\350\264\247\350\241\214\346\203\205/\346\267\261\345\272\246\346\225\260\346\215\256.md"new file mode 100644index 000000000..230fc4fa7--- /dev/null+++ "b/agent/src/skills/okx-market/references/\347\216\260\350\264\247\350\241\214\346\203\205/\346\267\261\345\272\246\346\225\260\346\215\256.md"@@ -0,0 +1,41 @@+## ๆทฑๅบฆๆฐๆฎ๏ผOrderbook๏ผ+----++ๆฅๅฃ๏ผGET /api/v5/market/books+ๆ่ฟฐ๏ผ่ทๅไบคๆไบงๅ็ไนฐๅ็ๅฃๆทฑๅบฆๆฐๆฎ๏ผๅฏๆๅฎ่ฟๅๆทฑๅบฆๆกฃไฝๆฐใ+้้ข๏ผ40ๆฌก/2s++**่พๅ ฅๅๆฐ**++| ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ |+| ---- | ---- | ---- | ---- |+| instId | str | Y | ไบคๆไบงๅID๏ผๅฆ `BTC-USDT` |+| sz | str | N | ๆทฑๅบฆๆกฃไฝๆฐ๏ผ้ป่ฎค 1๏ผๆๅคง 400 |++**่พๅบๅๆฐ**++| ๅ็งฐ | ็ฑปๅ | ๆ่ฟฐ |+| ---- | ---- | ---- |+| asks | list | ๅ็ๆฐ็ป๏ผๆฏๆกฃ `[ไปทๆ ผ, ๆฐ้, ๅทฒๅบๅผ, ่ฎขๅๆฐ]` |+| bids | list | ไนฐ็ๆฐ็ป๏ผๆฏๆกฃ `[ไปทๆ ผ, ๆฐ้, ๅทฒๅบๅผ, ่ฎขๅๆฐ]` |+| ts | str | ๆถ้ดๆณ๏ผๆฏซ็ง๏ผ |++**ๆฅๅฃ็คบไพ**++```python+import requests++BASE_URL = "https://www.okx.com/api/v5"++# ่ทๅ BTC-USDT ๅ5ๆกฃๆทฑๅบฆ+resp = requests.get(f"{BASE_URL}/market/books", params={"instId": "BTC-USDT", "sz": "5"})+book = resp.json()["data"][0]++print("== ๅ็๏ผAsks๏ผ==")+for ask in book["asks"]:+ print(f" ไปทๆ ผ: {ask[0]:>10s} ๆฐ้: {ask[1]:>12s}")++print("== ไนฐ็๏ผBids๏ผ==")+for bid in book["bids"]:+ print(f" ไปทๆ ผ: {bid[0]:>10s} ๆฐ้: {bid[1]:>12s}")+```diff --git a/agent/src/skills/okx-market/scripts/candle_data_example.py b/agent/src/skills/okx-market/scripts/candle_data_example.pynew file mode 100644index 000000000..316605871--- /dev/null+++ b/agent/src/skills/okx-market/scripts/candle_data_example.py@@ -0,0 +1,103 @@+#!/usr/bin/env python3+# -*- coding: utf-8 -*-+"""ๅ ๅฏ่ดงๅธK็บฟๆฐๆฎ่ทๅ็คบไพ่ๆฌใ"""++from typing import Optional++import requests+import pandas as pd+from datetime import datetime++BASE_URL = "https://www.okx.com/api/v5"++CANDLE_COLUMNS = ["ts", "open", "high", "low", "close", "vol", "volCcy", "volCcyQuote", "confirm"]+INDEX_CANDLE_COLUMNS = ["ts", "open", "high", "low", "close", "confirm"]+++def get_candles(inst_id: str, bar: str = "1D", limit: int = 100) -> Optional[pd.DataFrame]:+ """่ทๅK็บฟๆฐๆฎๅนถ่ฝฌไธบ DataFrameใ++ Args:+ inst_id: ไบคๆไบงๅID๏ผๅฆ BTC-USDTใ+ bar: K็บฟๅจๆ๏ผๅฆ 1m/5m/1H/4H/1D/1Wใ+ limit: ่ฟๅๆกๆฐ๏ผๆๅคง300ใ++ Returns:+ DataFrame (ts, open, high, low, close, vol)๏ผๅคฑ่ดฅ่ฟๅ Noneใ+ """+ try:+ resp = requests.get(f"{BASE_URL}/market/candles", params={+ "instId": inst_id, "bar": bar, "limit": str(limit)+ })+ data = resp.json()+ if data["code"] != "0":+ print(f"API้่ฏฏ: {data['msg']}")+ return None++ df = pd.DataFrame(data["data"], columns=CANDLE_COLUMNS)+ df["ts"] = pd.to_datetime(df["ts"].astype("int64"), unit="ms")+ for col in ["open", "high", "low", "close", "vol"]:+ df[col] = df[col].astype(float)+ df = df.sort_values("ts").reset_index(drop=True)+ return df+ except Exception as e:+ print(f"่ทๅK็บฟๅคฑ่ดฅ: {e}")+ return None+++def get_index_candles(inst_id: str, bar: str = "1D", limit: int = 100) -> Optional[pd.DataFrame]:+ """่ทๅๆๆฐK็บฟๆฐๆฎใ++ Args:+ inst_id: ๆๆฐID๏ผๅฆ BTC-USDใ+ bar: K็บฟๅจๆใ+ limit: ่ฟๅๆกๆฐ๏ผๆๅคง100ใ++ Returns:+ DataFrame (ts, open, high, low, close)๏ผๅคฑ่ดฅ่ฟๅ Noneใ+ """+ try:+ resp = requests.get(f"{BASE_URL}/market/index-candles", params={+ "instId": inst_id, "bar": bar, "limit": str(limit)+ })+ data = resp.json()+ if data["code"] != "0":+ print(f"API้่ฏฏ: {data['msg']}")+ return None++ df = pd.DataFrame(data["data"], columns=INDEX_CANDLE_COLUMNS)+ df["ts"] = pd.to_datetime(df["ts"].astype("int64"), unit="ms")+ for col in ["open", "high", "low", "close"]:+ df[col] = df[col].astype(float)+ df = df.sort_values("ts").reset_index(drop=True)+ return df+ except Exception as e:+ print(f"่ทๅๆๆฐK็บฟๅคฑ่ดฅ: {e}")+ return None+++def main():+ """ไธปๅฝๆฐใ"""+ print("===== OKX K็บฟๆฐๆฎ่ทๅ็คบไพ =====\n")++ # BTC ๆฅ็บฟ+ print("--- BTC-USDT ๆฅ็บฟ (ๆ่ฟ10ๅคฉ) ---")+ df = get_candles("BTC-USDT", "1D", 10)+ if df is not None:+ print(df[["ts", "open", "high", "low", "close", "vol"]].to_string(index=False))++ # ETH 4ๅฐๆถ็บฟ+ print("\n--- ETH-USDT 4H็บฟ (ๆ่ฟ10ๆ น) ---")+ df = get_candles("ETH-USDT", "4H", 10)+ if df is not None:+ print(df[["ts", "open", "high", "low", "close", "vol"]].to_string(index=False))++ # BTC ๆๆฐๆฅK+ print("\n--- BTC-USD ๆๆฐๆฅ็บฟ (ๆ่ฟ10ๅคฉ) ---")+ df = get_index_candles("BTC-USD", "1D", 10)+ if df is not None:+ print(df[["ts", "open", "high", "low", "close"]].to_string(index=False))+++if __name__ == "__main__":+ main()diff --git a/agent/src/skills/okx-market/scripts/market_data_example.py b/agent/src/skills/okx-market/scripts/market_data_example.pynew file mode 100644index 000000000..38380e30f--- /dev/null+++ b/agent/src/skills/okx-market/scripts/market_data_example.py@@ -0,0 +1,112 @@+#!/usr/bin/env python3+# -*- coding: utf-8 -*-+"""ๅ ๅฏ่ดงๅธ่กๆ ๆฐๆฎ่ทๅ็คบไพ่ๆฌใ"""++from typing import Optional++import requests+import pandas as pd+from datetime import datetime++BASE_URL = "https://www.okx.com/api/v5"+++def get_ticker(inst_id: str) -> Optional[dict]:+ """่ทๅๅไธชไบงๅ็ๅฎๆถ่กๆ ใ++ Args:+ inst_id: ไบคๆไบงๅID๏ผๅฆ BTC-USDTใ++ Returns:+ ่กๆ ๆฐๆฎๅญๅ ธ๏ผๅคฑ่ดฅ่ฟๅ Noneใ+ """+ try:+ resp = requests.get(f"{BASE_URL}/market/ticker", params={"instId": inst_id})+ data = resp.json()+ if data["code"] != "0":+ print(f"API้่ฏฏ: {data['msg']}")+ return None+ ticker = data["data"][0]+ last = float(ticker["last"])+ open24h = float(ticker["open24h"])+ chg = (last / open24h - 1) * 100+ print(f"{inst_id} ๆๆฐไปท: {last} 24hๆถจ่ท: {chg:+.2f}% 24h้: {ticker['vol24h']}")+ return ticker+ except Exception as e:+ print(f"่ทๅ่กๆ ๅคฑ่ดฅ: {e}")+ return None+++def get_top_tickers(inst_type: str = "SPOT", top_n: int = 10) -> Optional[pd.DataFrame]:+ """่ทๅๆไบค้ขๆๅๅN็ไบคๆๅฏนใ++ Args:+ inst_type: ไบงๅ็ฑปๅ๏ผSPOT/SWAP/FUTURES/OPTIONใ+ top_n: ่ฟๅๅNๅใ++ Returns:+ DataFrame๏ผๅคฑ่ดฅ่ฟๅ Noneใ+ """+ try:+ resp = requests.get(f"{BASE_URL}/market/tickers", params={"instType": inst_type})+ tickers = resp.json()["data"]+ df = pd.DataFrame(tickers)+ df["volCcy24h"] = df["volCcy24h"].astype(float)+ df["last"] = df["last"].astype(float)+ df = df.sort_values("volCcy24h", ascending=False).head(top_n)+ print(f"\n{inst_type} ๆไบค้ข TOP {top_n}:")+ print(df[["instId", "last", "volCcy24h"]].to_string(index=False))+ return df+ except Exception as e:+ print(f"่ทๅๆน้่กๆ ๅคฑ่ดฅ: {e}")+ return None+++def get_funding_rates(symbols: Optional[list] = None) -> Optional[pd.DataFrame]:+ """่ทๅๆฐธ็ปญๅ็บฆ่ต้่ดน็ใ++ Args:+ symbols: ๅ็บฆIDๅ่กจ๏ผๅฆ ['BTC-USDT-SWAP']ใ้ป่ฎค่ทๅไธปๆตๅธ็งใ++ Returns:+ DataFrame๏ผๅคฑ่ดฅ่ฟๅ Noneใ+ """+ if symbols is None:+ symbols = ["BTC-USDT-SWAP", "ETH-USDT-SWAP", "SOL-USDT-SWAP", "DOGE-USDT-SWAP"]++ rows = []+ for sym in symbols:+ try:+ resp = requests.get(f"{BASE_URL}/public/funding-rate", params={"instId": sym})+ data = resp.json()["data"][0]+ rate = float(data["fundingRate"])+ annual = rate * 3 * 365 * 100+ rows.append({"instId": sym, "fundingRate": rate, "annualized": f"{annual:.2f}%"})+ except Exception as e:+ print(f"่ทๅ {sym} ่ต้่ดน็ๅคฑ่ดฅ: {e}")++ if rows:+ df = pd.DataFrame(rows)+ print("\nๆฐธ็ปญๅ็บฆ่ต้่ดน็:")+ print(df.to_string(index=False))+ return df+ return None+++def main():+ """ไธปๅฝๆฐใ"""+ print("===== OKX ๅ ๅฏ่ดงๅธ่กๆ ่ทๅ็คบไพ =====\n")++ # ่ทๅไธปๆตๅธ็ง่กๆ+ for symbol in ["BTC-USDT", "ETH-USDT", "SOL-USDT"]:+ get_ticker(symbol)++ # ่ทๅ็ฐ่ดงๆไบค้ข TOP 10+ get_top_tickers("SPOT", 10)++ # ่ทๅ่ต้่ดน็+ get_funding_rates()+++if __name__ == "__main__":+ main()diff --git a/agent/src/skills/onchain-analysis/SKILL.md b/agent/src/skills/onchain-analysis/SKILL.mdnew file mode 100644index 000000000..c26c77859--- /dev/null+++ b/agent/src/skills/onchain-analysis/SKILL.md@@ -0,0 +1,252 @@+---+name: onchain-analysis+description: On-chain data analysis โ active addresses / whale tracking / TVL / DEX liquidity, interpretation and signal generation using on-chain valuation metrics such as MVRV / NVT / SOPR.+---++# On-Chain Data Analysis++## Overview++Use transparent public blockchain data for analysis, covering network activity, whale-behavior tracking, DeFi liquidity analysis, and on-chain valuation metrics. This provides crypto investing with data dimensions unavailable in traditional finance.++## Network Activity Metrics++### Core Activity Indicators++| Metric | Meaning | Bullish Signal | Bearish Signal |+|------|------|---------|---------|+| Active addresses | Unique addresses interacting with the network each day | Sustained increase (network adoption rising) | Sustained decline |+| New addresses | Addresses appearing for the first time each day | Accelerating growth (new users entering) | Shrinkage |+| Transaction count | Number of on-chain transactions per day | Steady growth | Sharp decline |+| Transfer value | Total value transferred on-chain per day | Large-value transfer activity | Inactive |+| Activity / price ratio | Growth in active addresses vs growth in price | Activity growth outpaces price growth | Price rises but activity does not |++### Activity Analysis Framework++```+Healthy bull market:+ Priceโ + active addressesโ + new addressesโ = driven by real demand++Bubble signal:+ Priceโ + active addressesโ or flat = capital-driven, not user-driven++Bottoming signal:+ Priceโ + active addresses bottom out and stabilize = speculators exit, real users remain+```++### Historical Reference for BTC Active Addresses++| Phase | Active Addresses (daily avg) | BTC Price | Meaning |+|------|--------------|---------|------|+| 2020 bear-to-bull transition | 0.8-1.0 million | $10k-$20k | Bottom stabilization |+| 2021 bull market | 1.0-1.3 million | $30k-$69k | Healthy growth |+| 2022 bear market | 0.8-0.9 million | $16k-$30k | Pulled back but did not collapse |+| 2024 bull market | 0.9-1.2 million | $40k-$100k | Institution-driven |++## Whale Tracking++### Whale Definition++| Tier | BTC Holdings | ETH Holdings | Estimated Count |+|------|---------|---------|---------|+| Super whales | >10,000 BTC | >100,000 ETH | ~100 |+| Large whales | 1,000-10,000 BTC | 10,000-100,000 ETH | ~2,000 |+| Mid whales | 100-1,000 BTC | 1,000-10,000 ETH | ~15,000 |+| Small whales | 10-100 BTC | 100-1,000 ETH | ~150,000 |++### Whale Behavior Signals++```+Bullish signals:+1. Whales withdraw from exchanges -> intent to hold long term+2. Whale-wallet count rises -> institutions / large holders accumulating+3. Exchange BTC balance keeps falling -> lower available supply+4. Long-term holder (LTH) balances rise -> smart money buying++Bearish signals:+1. Large whale transfers into exchanges -> preparing to sell+2. Dormant addresses wake up and transfer -> early holders taking profits+3. Exchange balances surge -> sell pressure is about to be released+4. Miner balances fall and move to exchanges -> miner capitulation / profit taking+```++### Large Transfer Monitoring++```+Thresholds to watch:+- BTC: single transfer > 500 BTC (about $50M)+- ETH: single transfer > 10,000 ETH (about $30M)+- USDT: single transfer > $50M++Transfer-direction analysis:+- Wallet -> exchange: potential selling (bearish)+- Exchange -> wallet: withdrawal to hold (bullish)+- Exchange -> exchange: arbitrage transfer (neutral)+- Wallet -> wallet: OTC trade (watch follow-up behavior)+```++## DeFi Liquidity Analysis++### TVL (Total Value Locked)++```+TVL = total value of assets locked in DeFi protocols++TVL analysis dimensions:+1. Total TVL trend: rising = capital flowing into the DeFi ecosystem+2. Cross-chain TVL: market-share changes among ETH vs Solana vs Arbitrum+3. Protocol TVL ranking: leading protocols such as Aave / Lido / Maker+4. TVL / market cap ratio: similar to asset-utilization rate in traditional finance+```++### DEX Liquidity Metrics++| Metric | Meaning | Focus |+|------|------|--------|+| DEX volume | Daily decentralized-exchange volume | Trend in DEX / CEX ratio |+| Liquidity depth | Size of AMM liquidity pools | Bigger pools = lower slippage = better |+| LP yield | Annualized return for liquidity providers | Abnormally high = unsustainable |+| Impermanent loss | Opportunity cost for LPs | More severe when volatility is higher |++### Stablecoin Liquidity++```+Stablecoin inflows = "dry powder" for the crypto market++Metrics to watch:+1. Changes in total USDT / USDC supply+2. Stablecoin balances on exchanges+3. Stablecoin mint / burn activity (Tether / Circle)+4. Stablecoin market-cap share (lower = higher risk appetite)++Signals:+- Heavy stablecoin minting -> capital preparing to enter+- Exchange stablecoin balances up -> buying power is accumulating+- Stablecoin share rising quickly -> risk-off market (capital rotating from coins into stablecoins)+```++## On-Chain Valuation Metrics++### MVRV (Market Value to Realized Value)++```+MVRV = market cap / realized cap++Realized cap = ฮฃ(each UTXO ร price at last movement)+ = sum of all holders' cost basis++| MVRV | Meaning | Historical Signal |+|------|------|---------|+| > 3.5 | Severely overvalued, large unrealized profits across holders | Historical top zone |+| 2.0-3.5 | Richly valued, most holders in profit | Mid-to-late bull market |+| 1.0-2.0 | Reasonable range | Normal market or early bull market |+| < 1.0 | Undervalued, most holders underwater | Bear-market bottom zone |++Signal logic: MVRV > 3.5 -> most holders have large unrealized gains -> strong incentive to sell -> potential top+ MVRV < 1.0 -> most holders are losing money -> unwilling to sell -> potential bottom+```++### NVT (Network Value to Transactions)++```+NVT = market cap / daily on-chain transfer value++Similar to a PE ratio in traditional finance:+- High NVT: market cap is high relative to on-chain activity (overvalued or optimistic on future growth)+- Low NVT: market cap is low relative to on-chain activity (undervalued or value-like)++NVT Signal (improved):+NVT_Signal = market cap / MA(90, daily on-chain transfer value)+Use a 90-day moving average to smooth noise++| NVT Signal | Meaning |+|-----------|------|+| > 150 | Severely overvalued |+| 65-150 | Normal range |+| < 65 | Undervalued |+```++### SOPR (Spent Output Profit Ratio)++```+SOPR = realized value of spent outputs / creation value of spent outputs++Simply put: on average, are the coins sold today being sold at a profit or a loss?++| SOPR | Meaning | Signal |+|------|------|------|+| > 1.05 | Sellers are realizing 5%+ profit on average | Profit-taking pressure |+| 1.0-1.05 | Small-profit selling | Normal |+| = 1.0 | Break-even | Key support / resistance |+| < 1.0 | Selling at a loss | Panic selling (bottom signal) |++In bull markets: a pullback to SOPR = 1.0 is a buy opportunity (cost-basis support)+In bear markets: a rebound to SOPR = 1.0 is a sell opportunity (cost-basis resistance)+```++### Other On-Chain Valuation Metrics++| Metric | Formula | Purpose |+|------|------|------|+| Puell Multiple | Daily miner revenue / MA(365, daily miner revenue) | Miner-income cycle |+| Stock-to-Flow | stock / annual production | BTC scarcity model |+| Reserve Risk | HODL Bank / price | Holder confidence |+| Exchange balance | total BTC held on exchanges | Supply-side pressure |++## Analysis Framework++### Composite On-Chain Score++```+Score each indicator from 1 to 5 and combine with weights:++| Dimension | Weight | Indicators |+|------|------|------|+| Valuation | 30% | MVRV, NVT |+| Activity | 25% | active addresses, new addresses |+| Capital flow | 25% | exchange balances, stablecoins |+| Whale behavior | 20% | whale holdings, large transfers |++Total score > 4.0: strongly bullish+Total score 3.0-4.0: bullish bias+Total score 2.0-3.0: neutral+Total score < 2.0: bearish / leaning bearish+```++## Output Format++```markdown+## On-Chain Analysis Report: BTC++### On-Chain Snapshot+| Metric | Current Value | Historical Percentile | Signal |+|------|--------|---------|------|+| MVRV | 2.1 | 65% | Elevated but not at a top |+| NVT Signal | 85 | 50% | Fair |+| SOPR(7d avg) | 1.02 | 55% | Slight profit-taking state |+| Active addresses | 950k/day | 45% | Relatively low |+| Exchange balance | 2.30M BTC | 30% | Low level (bullish) |++### Whale Activity+- Last 7 days: net withdrawal of +15,000 BTC (bullish)+- Large transfers: 3 transfers >1000 BTC into cold wallets+- Miners: holdings stable, no major outflows observed++### Composite Score: 3.5/5 (bullish bias)++### Conclusion+On-chain data is broadly bullish. MVRV is not yet in an extreme zone, exchange balances are low,+and whales continue to accumulate. But active addresses remain soft, so monitor whether this is an+"institution-driven bull market without retail participation". Maintain long exposure, but keep+position sizing controlled and avoid leverage.+```++## Notes++1. **Data-source limitations**: on-chain data is most reliable for BTC and ETH; data quality for other chains is uneven+2. **Entity identification is difficult**: one entity can control multiple addresses, so whale analysis contains error+3. **UTXO vs account model**: BTC (UTXO) analysis methods cannot be directly applied to ETH (account model)+4. **Missing Layer-2 data**: many transactions occur on L2s (Arbitrum / Optimism), so L1 data is incomplete+5. **On-chain data lag**: block confirmation takes time, so this is not suitable for short-term trading decisions+6. **Data acquisition**: the built-in OKX data source provides candles / trade data, but on-chain data requires extra APIs (Glassnode / Nansen)+7. **Metric desensitization**: as market structure changes (ETFization / institutionalization), historical thresholds may need adjustmentdiff --git a/agent/src/skills/options-advanced/SKILL.md b/agent/src/skills/options-advanced/SKILL.mdnew file mode 100644index 000000000..7f1c2920a--- /dev/null+++ b/agent/src/skills/options-advanced/SKILL.md@@ -0,0 +1,186 @@+---+name: options-advanced+description: "Advanced options strategies: volatility-surface modeling (SABR / Local Vol), dynamic Greeks rebalancing, calendar spreads, volatility arbitrage and skew trading, and option market-making basics."+---++# Advanced Options Strategies++## Overview++Go beyond basic option strategies (`covered call` / `protective put`) and focus on trading opportunities along the volatility dimension. Core idea: option price = intrinsic value + time value, and advanced trading essentially trades the volatility expectations embedded behind that time value.++Applicable scenarios:+- Identifying arbitrage opportunities when the volatility surface is abnormal (`skew` / `term structure`)+- Fine-grained management of portfolio Greeks exposures (not just Delta hedging)+- Building structured strategies across maturities and strikes+- Practical application in 50ETF / 300ETF / commodity options++## Core Concepts++### Volatility Surface++Three-dimensional structure: strike ร expiry ร implied volatility.++**Key dimensions**:+| Dimension | Meaning | Typical Shape |+|------|------|----------|+| Smile / Skew | IV across strikes for the same expiry | China A-shares: left-skewed (`put IV > call IV`) |+| Term Structure | IV across expiries for the same strike | Normal case: near-month IV < far-month IV |+| Surface dynamics | Parallel or nonlinear movement of the entire surface | In panic, the whole surface lifts, and near-month IV lifts faster |++**SABR model parameters**:+```+ฮฑ (alpha): initial volatility level, around 0.2-0.5+ฮฒ (beta): CEV exponent, equities usually use 0.5-1.0+ฯ (rho): correlation between volatility and the underlying, usually -0.3 to -0.7 in China A-shares (negative = left skew)+ฮฝ (nu): volatility of volatility (vol of vol), around 0.3-0.8+```++**Local Vol vs SABR**:+- Local Vol (Dupire): backed out from market prices, exact fit but unstable extrapolation+- SABR: parameterized model, 4 parameters capture surface dynamics and extrapolate more reasonably++### Dynamic Greeks Management++**First-order Greeks**:+| Greek | Meaning | Management Approach |+|-------|------|----------|+| Delta (ฮ) | Sensitivity to underlying price | Hedge frequency: daily for ATM, every 2-3 days for OTM |+| Vega (ฮฝ) | Sensitivity to IV | Calendar spreads can isolate Vega exposure |+| Theta (ฮ) | Time decay | Short-option strategies are naturally positive Theta, but watch Gamma risk |+| Rho (ฯ) | Sensitivity to rates | Relevant for long-dated options, usually ignorable for short-dated options |++**Second-order Greeks**:+| Greek | Meaning | Key Scenario |+|-------|------|----------|+| Gamma (ฮ) | Rate of change of Delta | Highest near ATM and spikes before expiry |+| Vanna | Sensitivity of Delta to IV | Core Greek for skew trading |+| Volga / Vomma | Sensitivity of Vega to IV | Important when volatility moves sharply |++**Delta hedge frequency decision**:+```+Hedging cost = trading frequency ร slippage per rebalance+Unhedged risk = Gamma exposure ร underlying volatilityยฒ+Optimal frequency (Zakamouline criterion):+ Trigger hedge when Gamma ร Sยฒ ร ฯยฒ ร ฮt > 2 ร transaction_cost+Practical rule: ATM Gamma is large -> hedge daily; OTM -> hedge weekly or on threshold triggers+```++## Analysis Framework++### 1. Calendar Spread++**Principle**: sell the near-month option and buy the far-month option at the same strike, profiting from faster near-month Theta decay.++**Entry conditions**:+- Normal term structure (`near-month IV โค far-month IV`)+- Expect the underlying to stay in a narrow range+- Open the position 20-30 days before near-month expiry++**50ETF example**:+```+Underlying: 50ETF current price 2.80+Sell: 50ETF near-month C2800 IV=18%, collect premium 0.045+Buy: 50ETF far-month C2800 IV=20%, pay premium 0.082+Net debit: 0.037 (max loss)+Breakeven: profit if the underlying stays in the 2.76-2.84 range at near-month expiry+Max profit: when near-month expires with the underlying right at 2.80, roughly 0.045 minus the time-decay differential+```++**Risk-control points**:+- Large breakout in the underlying โ stop loss (if loss exceeds 50% of net debit)+- Near-month IV suddenly rises above far-month IV (term-structure inversion) โ close position++### 2. Volatility Arbitrage++**Long Gamma strategy** (buy volatility):+```+Scenario: realized volatility is expected to exceed implied volatility+Trade: buy ATM straddle + Delta hedge+Profit source: Gamma-scalping gains > Theta decay+Key metric:+ Breakeven volatility = IV + Theta/Gamma cost+ Example in 300ETF: buy straddle at IV=16%; if realized volatility >18%, the trade is profitable+```++**Short Gamma strategy** (sell volatility):+```+Scenario: realized volatility is expected to stay below implied volatility+Trade: sell ATM straddle + Delta hedge+Profit source: Theta income > hedging loss+Risk control: set max loss = 2x premium received, close when hit+```++### 3. Skew Trade++**Risk Reversal**:+```+Scenario: skew is too steep (put IV excessively high relative to call IV)+Trade: sell OTM put + buy OTM call (zero-cost or slight net credit)+Exposure: long skew (profit if skew mean-reverts)+50ETF example:+ Sell P2700 IV=22% collect 0.025+ Buy C2900 IV=16% pay 0.018+ Net credit 0.007, profiting from skew mean reversion+```++**Butterfly skew trade**:+```+Scenario: localized skew abnormality (IV deviation at a particular strike)+Trade: build a butterfly centered on the abnormal strike+ If IV is too high -> sell that strike (middle leg of the butterfly)+ If IV is too low -> buy that strike+```++### 4. Option Market-Making Basics++**Quoting strategy**:+- Bid-ask spread = `f(Gamma risk, inventory skew, market volatility)`+- Narrow spreads attract flow; wider spreads protect risk+- Inventory-skew management: if Delta exceeds the limit, tilt quotes to induce the other side to offset inventory++**Inventory management**:+```+Delta limit: ยฑ500 underlying-equivalent lots+Gamma limit: daily Gamma PnL should not exceed 2% of account equity+Vega limit: PnL from a 1% IV move should not exceed 1% of account equity+When over the limit: hedge in the market first, adjust quotes second+```++## Output Format++Volatility analysis report:+```+=== Volatility Surface Analysis ===+Underlying: 50ETF Current price: 2.80+ATM IV: 18.5% Historical percentile: 35% (relatively low)+Skew (25D): -3.2% (put IV is 3.2% higher than call IV) Historical percentile: 70% (relatively steep)+Term Structure: normal (near-month 17.8% < far-month 19.2%)++=== Strategy Recommendation ===+Opportunity: steep skew + low IV+Strategy: Risk Reversal (sell put / buy call) + Calendar Spread+Expectation: skew mean reversion + mild IV rise+Risk control: keep Delta neutral, keep Gamma within ยฑ200 lots++=== Greeks Monitoring ===+Portfolio Delta: +15 (neutral)+Portfolio Gamma: -180 (short Gamma, watch gap risk)+Portfolio Vega: +3200 (long Vega, benefits from higher IV)+Portfolio Theta: -450 / day+```++## Notes++1. **China A-share option characteristics**: liquidity in 50ETF / 300ETF options is concentrated in near-month ATM ยฑ 3 strikes; deep OTM and far-month options are illiquid and have large slippage+2. **Margin management**: short-option margin changes dynamically with the underlying; keep >30% buffer to avoid margin calls+3. **Expiry-week effect**: Gamma rises sharply during the week before expiry, Pin Risk increases, and short-option traders should reduce size early+4. **Market-making barrier**: real market making requires high-frequency infrastructure, low latency, and professional risk controls; retail traders should not attempt pure market making+5. **SABR calibration**: calibrate parameters daily after the close with market data, then use prior-day parameters plus real-time adjustment at the open+6. **Gamma scalping PnL**: actual profit = `0.5 ร Gamma ร (RVยฒ - IVยฒ) ร Sยฒ ร T`; realized volatility must exceed IV by a meaningful margin to cover transaction costs++## Dependencies++```bash+pip install pandas numpy scipy+```diff --git a/agent/src/skills/options-payoff/SKILL.md b/agent/src/skills/options-payoff/SKILL.mdnew file mode 100644index 000000000..cfe46729c--- /dev/null+++ b/agent/src/skills/options-payoff/SKILL.md@@ -0,0 +1,859 @@+---+name: options-payoff+description: "Option P&L analysis methodology: payoff diagrams, breakeven calculation, multi-leg strategy visualization, and Greeks-based scenario analysis."+---++# Options Payoff โ Option P&L Analysis Methodology++## Overview++This skill is designed for option strategy analysis scenarios within the Vibe-Trading quantitative framework, covering:+- P&L curve generation for single-leg and multi-leg option portfolios+- Black-Scholes pricing and Greeks calculation+- Implied volatility inversion+- Strategy selection decision support++**Constraint**: For research and backtesting only. Do not output live trading instructions, in line with the project's guardrails.++---++## 1. Supported Strategy Types++### 1.1 Single-Leg Strategies++| Strategy | Bias | Premium | Max Profit | Max Loss |+|------|------|--------|----------|----------|+| Long Call | Bullish | Paid | Unlimited | Premium |+| Long Put | Bearish | Paid | Strike - premium | Premium |+| Short Call | Neutral / mildly bearish | Received | Premium | Unlimited |+| Short Put | Neutral / mildly bullish | Received | Premium | Strike - premium |++### 1.2 Vertical Spreads++| Strategy | Structure | Market View | Net Premium |+|------|------|----------|----------|+| Bull Call Spread | Long Call (lower K) + Short Call (higher K) | Moderately bullish | Net debit |+| Bear Put Spread | Long Put (higher K) + Short Put (lower K) | Moderately bearish | Net debit |+| Bull Put Spread | Short Put (higher K) + Long Put (lower K) | Moderately bullish | Net credit |+| Bear Call Spread | Short Call (lower K) + Long Call (higher K) | Moderately bearish | Net credit |++### 1.3 Straddles / Strangles (Volatility Strategies)++| Strategy | Structure | Market View |+|------|------|----------|+| Long Straddle | Long Call (ATM) + Long Put (ATM) | Large move up or down, low volatility |+| Short Straddle | Short Call (ATM) + Short Put (ATM) | Range-bound market, high volatility |+| Long Strangle | Long Call (OTM) + Long Put (OTM) | Large move, lower cost than a straddle |+| Short Strangle | Short Call (OTM) + Short Put (OTM) | Tight range, collect two-sided premium |++### 1.4 Butterflies / Iron Butterflies++| Strategy | Structure | Feature |+|------|------|------|+| Long Butterfly (Call) | Long Call (K1) + 2ร Short Call (K2) + Long Call (K3) | Low-cost bet that the underlying expires near K2 |+| Long Butterfly (Put) | Long Put (K3) + 2ร Short Put (K2) + Long Put (K1) | Same logic, built with puts |+| Iron Butterfly | Short Call (K2) + Short Put (K2) + Long Call (K3) + Long Put (K1) | Net credit, max profit at K2 |++### 1.5 Condors / Iron Condors++| Strategy | Structure | Feature |+|------|------|------|+| Long Condor (Call) | Long Call (K1) + Short Call (K2) + Short Call (K3) + Long Call (K4) | Bet that the underlying stays between K2 and K3 |+| Iron Condor | Short Put (K2) + Long Put (K1) + Short Call (K3) + Long Call (K4) | Most common neutral strategy with capped risk on both sides |++Here K1 < K2 < K3 < K4, and K2 / K3 are usually OTM.++### 1.6 Calendar Spreads (Time Spreads)++| Strategy | Structure | Market View |+|------|------|----------|+| Calendar Spread | Short near-month Call/Put (K) + Long far-month Call/Put (K) | Short-term range-bound market + rising forward volatility |+| Diagonal Spread | Short near-month Call/Put (K1) + Long far-month Call/Put (K2) | Calendar spread with mild directional bias |++Calendar spreads profit because near-month Theta decay is faster than far-month Theta decay.++### 1.7 Ratio Spreads++| Strategy | Structure | Feature |+|------|------|------|+| Ratio Call Spread | Long 1ร Call (K1) + Short Nร Call (K2), N>1 | Limited upside profit, losses if the upside move becomes extreme |+| Ratio Put Spread | Long 1ร Put (K2) + Short Nร Put (K1) | Limited downside profit, losses if the downside move becomes extreme |+| Call Back Spread | Short 1ร Call (K1) + Long Nร Call (K2), N>1 | Profits from extreme upside, loses on a modest rally |+| Put Back Spread | Short 1ร Put (K2) + Long Nร Put (K1), N>1 | Profits from extreme downside, loses on a mild decline |++### 1.8 Protective / Hedging Strategies++| Strategy | Structure | Use Case |+|------|------|------|+| Covered Call | Long underlying + Short Call (K) | Generate income on an existing position, give up gains above K |+| Protective Put | Long underlying + Long Put (K) | Downside protection on an existing position, pay an insurance premium |+| Collar | Long underlying + Long Put (K1) + Short Call (K2) | Lock the position into a zero-cost / low-cost range |++---++## 2. Black-Scholes Pricing Model++### 2.1 Core Assumptions++- The underlying price follows geometric Brownian motion (lognormal distribution)+- Risk-free rate `r` is constant+- Volatility `ฯ` is constant (historical or implied)+- No dividends, or adjust with a continuous dividend yield `q`+- European options only (exercise at expiration)++### 2.2 Full Formula++```+S = current underlying price+K = strike price+T = time to expiration (years)+r = risk-free rate (annualized continuous compounding)+q = continuous dividend yield (commonly used for China A-share / index options)+ฯ = annualized volatility+N = standard normal CDF++d1 = [ln(S/K) + (r - q + ฯยฒ/2) ร T] / (ฯ ร โT)+d2 = d1 - ฯ ร โT++Call = S ร e^(-qT) ร N(d1) - K ร e^(-rT) ร N(d2)+Put = K ร e^(-rT) ร N(-d2) - S ร e^(-qT) ร N(-d1)+```++### 2.3 Put-Call Parity++```+Call - Put = S ร e^(-qT) - K ร e^(-rT)+```++Use this to verify pricing consistency and detect arbitrage. When dividends exist, replace `S` with `S ร e^(-qT)`.++### 2.4 Greeks Calculation++#### Delta (Price Sensitivity)+```+Delta(Call) = e^(-qT) ร N(d1)+Delta(Put) = e^(-qT) ร (N(d1) - 1)+```+- Range: Call [0, 1], Put [-1, 0]+- ATM โ ยฑ0.5, deep ITM โ ยฑ1, deep OTM โ 0++#### Gamma (Rate of Change of Delta)+```+Gamma = e^(-qT) ร N'(d1) / (S ร ฯ ร โT)++N'(x) = (1/โ(2ฯ)) ร e^(-xยฒ/2) [standard normal PDF]+```+- Calls and puts have the same Gamma+- Gamma is highest near ATM and explodes as expiration approaches++#### Theta (Time Decay, per day)+```+Theta(Call) = [-S ร e^(-qT) ร N'(d1) ร ฯ / (2โT)+ - r ร K ร e^(-rT) ร N(d2)+ + q ร S ร e^(-qT) ร N(d1)] / 365++Theta(Put) = [-S ร e^(-qT) ร N'(d1) ร ฯ / (2โT)+ + r ร K ร e^(-rT) ร N(-d2)+ - q ร S ร e^(-qT) ร N(-d1)] / 365+```+- Usually negative for option holders+- ATM options near expiration have the largest Theta magnitude, which benefits option sellers the most++#### Vega (Volatility Sensitivity, per 1% vol change)+```+Vega = S ร e^(-qT) ร N'(d1) ร โT / 100+```+- Calls and puts have the same Vega+- ATM Vega is the largest, and Vega approaches 0 at expiration++#### Rho (Interest Rate Sensitivity, per 1% rate change)+```+Rho(Call) = K ร T ร e^(-rT) ร N(d2) / 100+Rho(Put) = -K ร T ร e^(-rT) ร N(-d2) / 100+```+- The rate effect is usually small and often negligible for short-dated options++### 2.5 Implied Volatility Inversion (Newton-Raphson)++Given a market price `P_market`, solve for `ฯ` such that `BS(ฯ) = P_market`:++```+Iteration:+ฯ_{n+1} = ฯ_n - [BS(ฯ_n) - P_market] / Vega(ฯ_n)++Stopping condition: |BS(ฯ_n) - P_market| < 1e-6++Initial guess:+ฯ_0 = โ(2ฯ/T) ร P_market/S (Brenner-Subrahmanyam approximation)++Notes:+- If Vega is close to 0 (deep OTM / ITM), switch to bisection+- If the iteration does not converge (>100 rounds), return NaN and raise a warning+- IV > 500% is usually an outlier and should be filtered+```++---++## 3. Payoff Diagram Analysis++### 3.1 Expiry Payoff Curve++**Calculation logic**:+```+For each leg i (Call/Put, Long/Short, strike K_i, quantity n_i):+ Payoff_i(S_T) = n_i ร direction_i ร max(0, S_T - K_i) # Call+ Payoff_i(S_T) = n_i ร direction_i ร max(0, K_i - S_T) # Put++Where direction = +1 (Long) / -1 (Short)++Portfolio payoff = ฮฃ Payoff_i - net premium cost+ (paid premium is positive, received premium is negative)+```++**X-axis range**: `[min(K) ร 0.7, max(K) ร 1.3]`, step size 0.5 or 1++### 3.2 Theoretical Value Curve (Current Black-Scholes Pricing)++For each underlying price `S`, hold `T`, `r`, and `ฯ` constant and compute current theoretical PnL using the Black-Scholes formula:+```+TheoValue(S) = ฮฃ n_i ร direction_i ร BS_price(S, K_i, T, r, ฯ, type_i) - net premium cost+```++The gap between the theoretical value curve and the expiry curve equals the remaining time value.++### 3.3 Break-Even Points++Numerically solve for the roots of `Payoff(S_T) = 0`:+- Use `scipy.optimize.brentq` to solve within adjacent intervals where the sign changes+- Single-leg strategies:+ - Long Call BEP = K + premium+ - Long Put BEP = K - premium+ - Short Call BEP = K + premium received+ - Short Put BEP = K - premium received+- Multi-leg strategies: solve numerically, possibly resulting in 0 to 2 BEPs++### 3.4 Max Profit / Max Loss++```python+max_profit = max(payoff_curve) # If inf, label as "Unlimited"+max_loss = min(payoff_curve) # If -inf, label as "Unlimited"++# Corresponding underlying price region+profit_range = S_range[payoff_curve > 0]+```++### 3.5 P&L Under Different Volatility Scenarios++Generate a `ฯ` scenario matrix using `current IV ร [0.5, 0.75, 1.0, 1.25, 1.5]`.+Plot one theoretical value curve for each `ฯ` and distinguish them by color to observe Vega sensitivity.++---++## 4. Python Code Templates++### 4.1 Black-Scholes Pricing Functions++```python+import numpy as np+from scipy.stats import norm+from scipy.optimize import brentq+from typing import Literal++def bs_price(+ S: float,+ K: float,+ T: float,+ r: float,+ sigma: float,+ option_type: Literal["call", "put"],+ q: float = 0.0,+) -> float:+ """Black-Scholes option pricing.++ Args:+ S: Current underlying price+ K: Strike price+ T: Time to expiration in years+ r: Risk-free rate in annualized continuous compounding, e.g. 0.03+ sigma: Annualized volatility, e.g. 0.20+ option_type: "call" or "put"+ q: Continuous dividend yield, defaults to 0++ Returns:+ Theoretical option price++ Raises:+ ValueError: If sigma <= 0+ """+ if T <= 0:+ # After expiration, return intrinsic value directly.+ if option_type == "call":+ return max(0.0, S - K)+ return max(0.0, K - S)+ if sigma <= 0:+ raise ValueError(f"sigma must be > 0, got {sigma}")++ d1 = (np.log(S / K) + (r - q + 0.5 * sigma**2) * T) / (sigma * np.sqrt(T))+ d2 = d1 - sigma * np.sqrt(T)++ if option_type == "call":+ price = S * np.exp(-q * T) * norm.cdf(d1) - K * np.exp(-r * T) * norm.cdf(d2)+ else:+ price = K * np.exp(-r * T) * norm.cdf(-d2) - S * np.exp(-q * T) * norm.cdf(-d1)++ return float(price)+++def bs_greeks(+ S: float,+ K: float,+ T: float,+ r: float,+ sigma: float,+ option_type: Literal["call", "put"],+ q: float = 0.0,+) -> dict:+ """Calculate the five major Greeks under the Black-Scholes model.++ Returns:+ A dict with keys: delta, gamma, theta, vega, rho.+ Theta and Vega are already converted to per-day and per-1% units.+ """+ if T <= 1e-6:+ return {"delta": 0.0, "gamma": 0.0, "theta": 0.0, "vega": 0.0, "rho": 0.0}++ d1 = (np.log(S / K) + (r - q + 0.5 * sigma**2) * T) / (sigma * np.sqrt(T))+ d2 = d1 - sigma * np.sqrt(T)+ n_prime_d1 = norm.pdf(d1)+ exp_qt = np.exp(-q * T)+ exp_rt = np.exp(-r * T)++ if option_type == "call":+ delta = exp_qt * norm.cdf(d1)+ rho = K * T * exp_rt * norm.cdf(d2) / 100+ theta = (+ -S * exp_qt * n_prime_d1 * sigma / (2 * np.sqrt(T))+ - r * K * exp_rt * norm.cdf(d2)+ + q * S * exp_qt * norm.cdf(d1)+ ) / 365+ else:+ delta = exp_qt * (norm.cdf(d1) - 1)+ rho = -K * T * exp_rt * norm.cdf(-d2) / 100+ theta = (+ -S * exp_qt * n_prime_d1 * sigma / (2 * np.sqrt(T))+ + r * K * exp_rt * norm.cdf(-d2)+ - q * S * exp_qt * norm.cdf(-d1)+ ) / 365++ gamma = exp_qt * n_prime_d1 / (S * sigma * np.sqrt(T))+ vega = S * exp_qt * n_prime_d1 * np.sqrt(T) / 100++ return {+ "delta": round(delta, 6),+ "gamma": round(gamma, 6),+ "theta": round(theta, 6),+ "vega": round(vega, 6),+ "rho": round(rho, 6),+ }+++def implied_volatility(+ market_price: float,+ S: float,+ K: float,+ T: float,+ r: float,+ option_type: Literal["call", "put"],+ q: float = 0.0,+ tol: float = 1e-6,+ max_iter: int = 200,+) -> float:+ """Solve implied volatility with Newton-Raphson.++ Args:+ market_price: Observed market price+ tol: Convergence tolerance+ max_iter: Maximum number of iterations++ Returns:+ Annualized implied volatility. Returns np.nan on failure.++ Raises:+ ValueError: If the market price is below intrinsic value+ """+ # Check intrinsic value first.+ intrinsic = max(0.0, S - K if option_type == "call" else K - S)+ if market_price < intrinsic - 1e-6:+ raise ValueError(f"Market price {market_price} is below intrinsic value {intrinsic}")++ # Brenner-Subrahmanyam initial approximation.+ sigma = np.sqrt(2 * np.pi / T) * market_price / S+ sigma = max(0.001, min(sigma, 5.0))++ for _ in range(max_iter):+ price = bs_price(S, K, T, r, sigma, option_type, q)+ vega = bs_greeks(S, K, T, r, sigma, option_type, q)["vega"] * 100 # restore per-1.0 unit++ diff = price - market_price+ if abs(diff) < tol:+ return round(sigma, 6)++ if abs(vega) < 1e-10:+ # Vega is near zero, fall back to bisection.+ try:+ return float(brentq(+ lambda v: bs_price(S, K, T, r, v, option_type, q) - market_price,+ 1e-4, 10.0, xtol=tol, maxiter=200+ ))+ except ValueError:+ return np.nan++ sigma -= diff / vega+ sigma = max(1e-4, min(sigma, 10.0)) # clamp to a reasonable range++ return np.nan # did not converge+```++### 4.2 Multi-Leg Portfolio Payoff Calculation++```python+from dataclasses import dataclass+import numpy as np++@dataclass+class OptionLeg:+ """Single option leg definition.++ Attributes:+ option_type: "call" or "put"+ K: Strike price+ direction: +1 for Long / -1 for Short+ quantity: Number of contracts, defaults to 1+ premium: Actual traded premium, positive when paid and negative when received+ T: Time to expiration in years, used for theoretical Black-Scholes pricing+ sigma: Volatility used in pricing+ """+ option_type: Literal["call", "put"]+ K: float+ direction: int # +1 or -1+ quantity: float = 1.0+ premium: float = 0.0+ T: float = 0.25+ sigma: float = 0.20+++def compute_expiry_payoff(+ legs: list[OptionLeg],+ S_range: np.ndarray,+) -> np.ndarray:+ """Calculate the expiry payoff curve.++ Args:+ legs: Option legs+ S_range: Array of underlying prices++ Returns:+ Payoff array aligned with S_range, including premium cost+ """+ total_payoff = np.zeros(len(S_range))+ net_premium = sum(leg.direction * leg.quantity * leg.premium for leg in legs)++ for leg in legs:+ if leg.option_type == "call":+ intrinsic = np.maximum(S_range - leg.K, 0)+ else:+ intrinsic = np.maximum(leg.K - S_range, 0)+ total_payoff += leg.direction * leg.quantity * intrinsic++ return total_payoff - net_premium+++def compute_theo_value(+ legs: list[OptionLeg],+ S_range: np.ndarray,+ r: float = 0.03,+ q: float = 0.0,+) -> np.ndarray:+ """Calculate the theoretical value curve under current Black-Scholes pricing.++ Args:+ legs: Option legs, each carrying T and sigma+ S_range: Array of underlying prices+ r: Risk-free rate+ q: Continuous dividend yield++ Returns:+ Theoretical PnL array+ """+ total_value = np.zeros(len(S_range))+ net_premium = sum(leg.direction * leg.quantity * leg.premium for leg in legs)++ for leg in legs:+ prices = np.array([+ bs_price(S, leg.K, leg.T, r, leg.sigma, leg.option_type, q)+ for S in S_range+ ])+ total_value += leg.direction * leg.quantity * prices++ return total_value - net_premium+++def find_breakeven_points(+ S_range: np.ndarray,+ payoff: np.ndarray,+) -> list[float]:+ """Solve for break-even points numerically.++ Returns:+ A list of break-even points, from 0 to many depending on the structure+ """+ beps = []+ for i in range(len(S_range) - 1):+ if payoff[i] * payoff[i + 1] < 0:+ bep = brentq(+ lambda s: np.interp(s, S_range, payoff),+ S_range[i], S_range[i + 1],+ xtol=0.01+ )+ beps.append(round(bep, 2))+ return beps+```++### 4.3 Matplotlib Payoff Diagram++```python+import matplotlib.pyplot as plt+import matplotlib.ticker as mticker++def plot_payoff_diagram(+ legs: list[OptionLeg],+ S_current: float,+ r: float = 0.03,+ q: float = 0.0,+ title: str = "Option Payoff Diagram",+ figsize: tuple = (10, 6),+) -> plt.Figure:+ """Plot the payoff diagram for an option portfolio.++ Args:+ legs: Option legs+ S_current: Current underlying price+ r: Risk-free rate+ q: Continuous dividend yield+ title: Chart title+ figsize: Figure size++ Returns:+ A matplotlib Figure object+ """+ K_values = [leg.K for leg in legs]+ S_lo = min(K_values) * 0.70+ S_hi = max(K_values) * 1.30+ S_range = np.linspace(S_lo, S_hi, 500)++ expiry_pnl = compute_expiry_payoff(legs, S_range)+ theo_pnl = compute_theo_value(legs, S_range, r, q)+ beps = find_breakeven_points(S_range, expiry_pnl)++ fig, ax = plt.subplots(figsize=figsize)++ # Shade profit and loss regions.+ ax.fill_between(S_range, expiry_pnl, 0,+ where=(expiry_pnl >= 0), alpha=0.15, color="green", label="_nolegend_")+ ax.fill_between(S_range, expiry_pnl, 0,+ where=(expiry_pnl < 0), alpha=0.15, color="red", label="_nolegend_")++ # Expiry payoff curve.+ ax.plot(S_range, expiry_pnl, color="steelblue", linewidth=2.0, label="Expiry P&L")++ # Theoretical value curve.+ ax.plot(S_range, theo_pnl, color="darkorange", linewidth=1.5,+ linestyle="--", label="Current theoretical value")++ # Zero axis.+ ax.axhline(0, color="black", linewidth=0.8, linestyle="-")++ # Current price line.+ ax.axvline(S_current, color="gray", linewidth=1.0, linestyle=":",+ label=f"Spot {S_current:.2f}")++ # Strike annotations.+ for K in K_values:+ ax.axvline(K, color="purple", linewidth=0.6, linestyle="--", alpha=0.5)+ ax.text(K, ax.get_ylim()[0], f"K={K}", fontsize=8,+ rotation=90, va="bottom", color="purple")++ # Break-even points.+ for bep in beps:+ ax.scatter([bep], [0], color="red", zorder=5, s=50)+ ax.annotate(f"BEP\n{bep:.2f}", xy=(bep, 0),+ xytext=(bep, max(expiry_pnl) * 0.15),+ fontsize=8, ha="center", color="red",+ arrowprops=dict(arrowstyle="->", color="red", lw=0.8))++ # Max profit / max loss summary.+ max_p = max(expiry_pnl)+ max_l = min(expiry_pnl)+ stats_text = (+ f"Max profit: {'Unlimited' if max_p > 1e6 else f'{max_p:.2f}'}\n"+ f"Max loss: {'Unlimited' if max_l < -1e6 else f'{max_l:.2f}'}\n"+ f"Break-even: {', '.join([str(b) for b in beps]) if beps else 'None'}"+ )+ ax.text(0.02, 0.97, stats_text, transform=ax.transAxes,+ fontsize=9, va="top", bbox=dict(boxstyle="round", fc="white", alpha=0.8))++ ax.set_xlabel("Underlying price")+ ax.set_ylabel("P&L")+ ax.set_title(title)+ ax.legend(loc="upper right")+ ax.yaxis.set_major_formatter(mticker.FuncFormatter(lambda x, _: f"{x:,.0f}"))+ ax.grid(True, alpha=0.3)+ plt.tight_layout()++ return fig+```++### 4.4 Plotly Interactive Payoff Diagram (Recommended for Frontend Display)++```python+import plotly.graph_objects as go++def plot_payoff_plotly(+ legs: list[OptionLeg],+ S_current: float,+ r: float = 0.03,+ q: float = 0.0,+ title: str = "Option Payoff Diagram",+ sigma_scenarios: list[float] | None = None,+) -> go.Figure:+ """Generate a Plotly interactive payoff diagram with optional multi-sigma scenarios.++ Args:+ sigma_scenarios: For example [0.10, 0.15, 0.20, 0.25, 0.30].+ If None, use each leg's own sigma.+ """+ K_values = [leg.K for leg in legs]+ S_range = np.linspace(min(K_values) * 0.70, max(K_values) * 1.30, 500)+ expiry_pnl = compute_expiry_payoff(legs, S_range)++ fig = go.Figure()++ # Expiry payoff.+ fig.add_trace(go.Scatter(+ x=S_range, y=expiry_pnl,+ name="Expiry P&L", line=dict(color="steelblue", width=2),+ fill="tozeroy",+ fillcolor="rgba(70,130,180,0.1)",+ ))++ # Theoretical value under multiple volatility scenarios.+ if sigma_scenarios:+ colors = ["#FF6B6B", "#FFA500", "#4CAF50", "#2196F3", "#9C27B0"]+ for i, sigma in enumerate(sigma_scenarios):+ scenario_legs = [+ OptionLeg(+ option_type=leg.option_type, K=leg.K,+ direction=leg.direction, quantity=leg.quantity,+ premium=leg.premium, T=leg.T, sigma=sigma+ )+ for leg in legs+ ]+ theo = compute_theo_value(scenario_legs, S_range, r, q)+ fig.add_trace(go.Scatter(+ x=S_range, y=theo,+ name=f"IV={sigma*100:.0f}%",+ line=dict(color=colors[i % len(colors)], width=1.5, dash="dash"),+ ))+ else:+ theo_pnl = compute_theo_value(legs, S_range, r, q)+ fig.add_trace(go.Scatter(+ x=S_range, y=theo_pnl,+ name="Current theoretical value",+ line=dict(color="darkorange", width=1.5, dash="dash"),+ ))++ # Zero line and current price line.+ fig.add_hline(y=0, line_dash="solid", line_color="black", line_width=0.8)+ fig.add_vline(x=S_current, line_dash="dot", line_color="gray",+ annotation_text=f"Spot {S_current:.2f}", annotation_position="top right")++ # Strikes.+ for K in set(K_values):+ fig.add_vline(x=K, line_dash="dash", line_color="purple",+ line_width=0.8, opacity=0.5)++ fig.update_layout(+ title=title,+ xaxis_title="Underlying price",+ yaxis_title="P&L",+ hovermode="x unified",+ template="plotly_white",+ legend=dict(orientation="h", yanchor="bottom", y=1.02, xanchor="right", x=1),+ )++ return fig+```++### 4.5 Greeks Profile vs Underlying Price++```python+def plot_greeks_profile(+ legs: list[OptionLeg],+ S_current: float,+ r: float = 0.03,+ q: float = 0.0,+ greeks_to_plot: list[str] | None = None,+) -> go.Figure:+ """Plot portfolio Greeks as functions of the underlying price.++ Args:+ greeks_to_plot: Defaults to ["delta", "gamma", "vega", "theta"]+ """+ if greeks_to_plot is None:+ greeks_to_plot = ["delta", "gamma", "vega", "theta"]++ K_values = [leg.K for leg in legs]+ S_range = np.linspace(min(K_values) * 0.70, max(K_values) * 1.30, 300)++ # Compute portfolio Greeks.+ greek_values = {g: np.zeros(len(S_range)) for g in greeks_to_plot}+ for leg in legs:+ for j, S in enumerate(S_range):+ g = bs_greeks(S, leg.K, leg.T, r, leg.sigma, leg.option_type, q)+ for name in greeks_to_plot:+ greek_values[name][j] += leg.direction * leg.quantity * g[name]++ # Plot subplots.+ from plotly.subplots import make_subplots+ n = len(greeks_to_plot)+ fig = make_subplots(rows=n, cols=1, shared_xaxes=True,+ subplot_titles=[g.capitalize() for g in greeks_to_plot])++ greek_colors = {"delta": "steelblue", "gamma": "green",+ "theta": "red", "vega": "darkorange", "rho": "purple"}++ for i, name in enumerate(greeks_to_plot, start=1):+ fig.add_trace(+ go.Scatter(x=S_range, y=greek_values[name],+ name=name.capitalize(),+ line=dict(color=greek_colors.get(name, "gray"), width=2)),+ row=i, col=1+ )+ fig.add_hline(y=0, line_dash="dot", line_color="black",+ line_width=0.5, row=i, col=1)+ fig.add_vline(x=S_current, line_dash="dash", line_color="gray",+ line_width=0.8, row=i, col=1)++ fig.update_layout(+ title="Greeks Profile",+ height=200 * n,+ showlegend=False,+ template="plotly_white",+ )++ return fig+```++---++## 5. Practical Usage++### 5.1 Strategy Selection Decision Tree by Market View++```+Market view+โโโ Strongly bullish+โ โโโ Willing to pay premium โ Long Call+โ โโโ Want lower cost โ Bull Call Spread+โโโ Moderately bullish+โ โโโ Already hold the underlying โ Covered Call (income enhancement)+โ โโโ No existing position โ Bull Put Spread (net credit)+โโโ Moderately bearish+โ โโโ Already hold the underlying โ Protective Put or Collar+โ โโโ No existing position โ Bear Call Spread (net credit)+โโโ Strongly bearish+โ โโโ Willing to pay premium โ Long Put+โ โโโ Want lower cost โ Bear Put Spread+โโโ Range-bound market (low-IV environment)+โ โโโ Wide range โ Short Strangle+โ โโโ Narrow range โ Short Straddle+โ โโโ Want limited risk โ Iron Condor / Iron Butterfly+โโโ Large move expected (low-IV environment)+ โโโ Direction unclear โ Long Straddle / Long Strangle+ โโโ Slight directional bias โ Call / Put Back Spread+```++### 5.2 Volatility Environment โ Strategy Mapping++| IV Regime | Rule of Thumb | Suitable Strategies | Strategies to Avoid |+|---------|----------|----------|----------|+| Low IV (< 20th percentile) | IV Rank < 20 | Long Straddle, Long Strangle, Back Spread | Short strategies, because premium is too thin |+| Normal IV (20th to 80th percentile) | IV Rank 20 to 80 | Vertical spreads, Calendar Spread, Diagonal | Single-leg positions with asymmetric risk |+| High IV (> 80th percentile) | IV Rank > 80 | Short Straddle, Iron Condor, Covered Call | Long single-leg options due to rich premium |++**IV Rank formula**:+```python+iv_rank = (current_iv - iv_52w_low) / (iv_52w_high - iv_52w_low) * 100+```++**IV Percentile**: The historical percentile rank of current IV over the last 252 trading days.++### 5.3 When to Roll or Adjust++#### Rolling+- **Trigger**: Option Delta moves outside the target range, or time to expiration < 21 days+- **Rolling Up / Down**: Close the current leg and reopen at a higher / lower strike while keeping the same directional bias+- **Rolling Out**: Close the near-month leg and reopen further out on the curve to harvest additional time value+- **Cost assessment**: Compare the net debit / credit of the roll with the payoff from simply holding to expiration++#### Adjusting+- **Delta-neutral rebalancing**: Hedge with underlying or options when portfolio Delta deviates from target by more than ยฑ0.10+- **Gamma scalping**: Under a Long Gamma portfolio, hedge Delta after large underlying moves to lock in gains+- **Stop-loss rule**: Force liquidation when losses reach 2ร the initial premium received, a common rule for Iron Condors++#### Common Adjustment Examples++**Iron Condor gets breached**:+```+Underlying rallies above the short call:+1. Close the call spread and realize the loss+2. Reassess directional view:+ - Still bullish โ reopen a higher put spread to preserve neutrality+ - Not bullish โ close the entire portfolio+```++**Covered Call faces assignment risk**:+```+Underlying approaches the call strike:+1. Assess whether you are willing to sell the underlying at that price+ - Yes โ allow assignment and keep premium + capital gain+ - No โ Roll Up & Out to a higher strike and/or later expiration+```++---++## Quick Usage Example++```python+# Example: Iron Condor payoff diagram+legs = [+ OptionLeg("put", K=90, direction=-1, premium=1.5, T=0.083, sigma=0.20),+ OptionLeg("put", K=85, direction=+1, premium=0.5, T=0.083, sigma=0.20),+ OptionLeg("call", K=110, direction=-1, premium=1.5, T=0.083, sigma=0.20),+ OptionLeg("call", K=115, direction=+1, premium=0.5, T=0.083, sigma=0.20),+]++fig = plot_payoff_plotly(+ legs, S_current=100.0,+ title="Iron Condor (85/90/110/115, 1 month)",+ sigma_scenarios=[0.15, 0.20, 0.25, 0.30],+)+fig.show()++# Implied volatility example+iv = implied_volatility(+ market_price=5.0, S=100, K=100,+ T=0.25, r=0.03, option_type="call"+)+print(f"Implied volatility: {iv:.2%}") # about 0.20+```diff --git a/agent/src/skills/options-strategy/SKILL.md b/agent/src/skills/options-strategy/SKILL.mdnew file mode 100644index 000000000..d5044888e--- /dev/null+++ b/agent/src/skills/options-strategy/SKILL.md@@ -0,0 +1,177 @@+---+name: options-strategy+description: Options strategy framework supporting Black-Scholes pricing, Greeks analysis, and multi-leg backtesting. Suitable for cryptocurrency and equity options.+---++## Purpose++Backtesting of option portfolio strategies. Starting from the underlying price, the engine synthesizes theoretical option prices with the Black-Scholes model, then simulates PnL, Greeks exposure, and expiration exercise for multi-leg option portfolios.++Applicable scenarios:+- Hedging strategies (`covered call`, `protective put`)+- Volatility trading (`straddle`, `strangle`)+- Spread strategies (`iron condor`, `butterfly`, `calendar spread`)+- Option pricing analysis and Greeks sensitivity research++## Supported Strategy Types++| Strategy | Structure | Applicable Market View |+|------|------|----------|+| Covered Call | Hold underlying + short call | Mildly bullish, collect premium |+| Protective Put | Hold underlying + long put | Bullish but wants downside protection |+| Straddle | Buy same-strike call + put | Expect large movement, direction uncertain |+| Strangle | Buy different-strike call + put | Expect large movement, lower cost |+| Iron Condor | Sell put spread + sell call spread | Range-bound market, collect premium |+| Butterfly | Buy low call + sell 2 middle calls + buy high call | Expect narrow-range movement |+| Calendar Spread | Sell near-month + buy far-month at same strike | Exploit differences in time decay |++## `OptionsSignalEngine` Interface++Write the strategy in `code/signal_engine.py`, with class name `SignalEngine`, implementing the `generate` method:++```python+class SignalEngine:+ """Option strategy signal engine."""++ def generate(self, data_map: dict) -> list:+ """Generate option trading instructions.++ Args:+ data_map: code -> DataFrame (columns: open, high, low, close, volume)++ Returns:+ List of trading instructions. Each instruction has the format:+ {+ "date": "2024-01-15", # Trading date+ "action": "open" / "close", # Open or close position+ "underlying": "BTC-USDT", # Underlying code+ "legs": [ # List of option legs+ {+ "type": "call" / "put", # Option type+ "strike": 50000, # Strike price+ "expiry": "2024-02-15", # Expiration date+ "qty": 1 # Quantity (positive = long, negative = short)+ }+ ]+ }+ """+```++### Multi-Leg Combination Example++Iron Condor opening signal:++```python+{+ "date": "2024-01-15",+ "action": "open",+ "underlying": "000300.SH",+ "legs": [+ {"type": "put", "strike": 3800, "expiry": "2024-02-15", "qty": -1}, # Sell put+ {"type": "put", "strike": 3700, "expiry": "2024-02-15", "qty": 1}, # Buy protective put+ {"type": "call", "strike": 4200, "expiry": "2024-02-15", "qty": -1}, # Sell call+ {"type": "call", "strike": 4300, "expiry": "2024-02-15", "qty": 1}, # Buy protective call+ ]+}+```++## `config.json` Format++```json+{+ "codes": ["000300.SH"],+ "start_date": "2020-01-01",+ "end_date": "2024-12-31",+ "source": "tushare",+ "engine": "options",+ "initial_cash": 1000000,+ "commission": 0.001,+ "options_config": {+ "risk_free_rate": 0.05,+ "iv_source": "historical",+ "contract_multiplier": 1.0+ }+}+```++Key fields:+- `engine` must be set to `"options"` so the runner selects the option backtest engine+- `options_config.risk_free_rate`: risk-free rate, default `0.05`+- `options_config.iv_source`: volatility source, currently supports `"historical"` (30-day rolling historical volatility computed from underlying closes)+- `options_config.contract_multiplier`: contract multiplier, default `1.0`++## BS Model Principles++Black-Scholes formula (European options):++```+Call = S * N(d1) - K * e^(-rT) * N(d2)+Put = K * e^(-rT) * N(-d2) - S * N(-d1)++d1 = [ln(S/K) + (r + sigma^2/2) * T] / (sigma * sqrt(T))+d2 = d1 - sigma * sqrt(T)+```++Where `S` = underlying price, `K` = strike, `T` = time to expiry in years, `r` = risk-free rate, `sigma` = volatility, and `N()` = cumulative distribution function of the standard normal.++This engine starts from the underlying daily price series, substitutes historical volatility for implied volatility, and computes theoretical option prices through the BS formula. This is a synthetic-data mode, meaning no real option market data is required.++## Greeks Meaning and Usage++| Greek | Meaning | Usage |+|-------|------|------|+| Delta | Change in option price for a 1-unit move in the underlying | Directional exposure management, hedge-ratio calculation |+| Gamma | Change in Delta for a 1-unit move in the underlying | Measures hedge stability; high Gamma = frequent rebalancing required |+| Theta | Time decay of option value per day (usually negative) | Time-value management, source of return for short-option strategies |+| Vega | Change in option price for a 1% volatility move | Core metric for volatility trading, measures volatility exposure |++The backtest engine computes portfolio-level Greeks aggregates on each trading day and outputs them to `greeks.csv`.++## Common Pitfalls++### Volatility Smile++The BS model assumes constant volatility, but in real markets implied volatility differs across strikes and expiries (volatility smile / skew). This engine approximates with historical volatility, so pricing may be biased for deep OTM / deep ITM options. Strategy design should avoid over-reliance on pricing precision at extreme strikes.++### Time Decay (Theta Decay)++Theta decay is not linear โ the closer the option is to expiry, the faster the decay. The last 30 days decay much faster than the prior 30 days. Short-vol strategies benefit from this, but Gamma risk also rises sharply near expiry.++### Early Exercise++This engine supports European options only (exercise only at expiry), not American options. In scenarios with meaningful early-exercise value (for example, deep ITM puts or calls on high-dividend underlyings), pricing will be biased.++### Liquidity and Slippage++In synthetic-data mode there are no bid-ask spreads or liquidity constraints. In real trading, deep OTM options have poor liquidity and wide spreads, so backtest results will be overly optimistic.++### Contract Multiplier++Option contract multipliers differ across markets (for example, China A-share ETF options often use a 10,000 multiplier, while crypto is typically 1). Make sure `options_config.contract_multiplier` is set correctly.++## Artifact Description++After backtesting, the following files are generated in the `artifacts/` directory:++| File | Contents |+|------|------|+| `equity.csv` | Daily equity, cash, market value of holdings |+| `metrics.csv` | Return, Sharpe ratio, maximum drawdown, and similar metrics |+| `trades.csv` | Trade-by-trade records (open / close / exercise / expire) |+| `greeks.csv` | Daily portfolio Greeks aggregates (`delta/gamma/theta/vega`) |+| `ohlcv_{code}.csv` | Raw underlying candlestick data |++## Pricing Tool++The Agent can call the `options_pricing` tool for one-off pricing:++```+Call the options_pricing tool with:+ spot: 50000+ strike: 52000+ expiry_days: 30+ volatility: 0.6+ option_type: "call"+```++It returns the theoretical price and Greeks, which is suitable for interactive analysis.diff --git a/agent/src/skills/pair-trading/SKILL.md b/agent/src/skills/pair-trading/SKILL.mdnew file mode 100644index 000000000..76af19266--- /dev/null+++ b/agent/src/skills/pair-trading/SKILL.md@@ -0,0 +1,79 @@+---+name: pair-trading+description: Pair trading strategy. Trades mean reversion using the spread/ratio Z-score of two correlated instruments. Requires at least two instruments.+---+# Pair Trading Strategy++## Purpose++Select two highly correlated instruments (such as stocks from the same industry or BTC/ETH), monitor how far their price ratio (or spread) deviates from the mean, and trade against extreme deviations while waiting for mean reversion.++## Signal Logic++1. **Compute the price ratio**: `ratio = close_A / close_B`+2. **Rolling mean and standard deviation**: `mean = ratio.rolling(lookback).mean()`, `std = ratio.rolling(lookback).std()`+3. **Z-score**: `z = (ratio - mean) / std`+4. **Signal generation**:+ - Z < -entry_z โ long A, short B (ratio is too low, expected to revert)+ - Z > +entry_z โ short A, long B (ratio is too high, expected to revert)+ - |Z| < exit_z โ close the position (reverted back near the mean)++## Implementation Notes++- Pair trading requires **exactly two instruments** (`codes` array length = 2)+- The first instrument is A (`leg1`), and the second is B (`leg2`)+- Signals for A and B are opposite: when A is long, B is short, and vice versa+- **Equal-weight allocation only**: A and B each take 50% of capital, with no precise hedge-ratio calculation++## Parameters++| Parameter | Default | Description |+|------|--------|------|+| lookback | 60 | Lookback window for mean and standard deviation |+| entry_z | 2.0 | Entry Z-score threshold |+| exit_z | 0.5 | Exit Z-score threshold |++## Example `config.json`++```json+{+ "source": "tushare",+ "codes": ["601318.SH", "601628.SH"],+ "start_date": "2023-01-01",+ "end_date": "2024-12-31",+ "initial_cash": 1000000,+ "commission": 0.001,+ "extra_fields": null+}+```++Cryptocurrency version:+```json+{+ "source": "okx",+ "codes": ["BTC-USDT", "ETH-USDT"],+ "start_date": "2024-01-01",+ "end_date": "2024-12-31",+ "initial_cash": 1000000,+ "commission": 0.001,+ "extra_fields": null+}+```++## Common Pitfalls++- `codes` must contain exactly 2 instruments, no more and no less+- The date indexes of the two instruments must be aligned (use an inner join), otherwise the ratio calculation will be wrong+- Before the lookback window is filled, Z-scores are `NaN`, so fill signals with 0+- Do not generate same-direction signals for both A and B; pair trading is fundamentally a long-short hedge++## Dependencies++```bash+pip install pandas numpy+```++## Signal Convention++- Instrument A: `0.5` = long, `-0.5` = short, `0` = flat+- Instrument B: direction is opposite to Adiff --git a/agent/src/skills/pair-trading/example_signal_engine.py b/agent/src/skills/pair-trading/example_signal_engine.pynew file mode 100644index 000000000..1388f72c9--- /dev/null+++ b/agent/src/skills/pair-trading/example_signal_engine.py@@ -0,0 +1,152 @@+"""้ ๅฏนไบคๆ็ญ็ฅไฟกๅทๅผๆใ++ๅบไบไธคไธช็ธๅ ณๆ ็็ไปทๆ ผๆฏๅผ Z-score ่ฟ่กๅๅผๅๅฝไบคๆใ+้่ฆๆฐๅฅฝไธคไธชๆ ็๏ผ็ญๆๅ้ ใ็บฏ pandas ๅฎ็ฐใ+"""++from typing import Dict++import numpy as np+import pandas as pd+++class SignalEngine:+ """้ ๅฏนไบคๆไฟกๅทๅผๆใ++ ่ฎก็ฎไธคไธชๆ ็็ไปทๆ ผๆฏๅผ๏ผ้่ฟ Z-score ๅคๆญๅ็ฆป็จๅบฆ๏ผ+ ๅ็ฆป่ฟๅคงๆถๅๅไบคๆ็ญๅพ ๅๅฝใ++ Attributes:+ lookback: ๅๅผๅๆ ๅๅทฎๅ็็ชๅฃใ+ entry_z: ๅผไป Z-score ้ๅผใ+ exit_z: ๅนณไป Z-score ้ๅผใ++ Example:+ >>> engine = SignalEngine(lookback=60, entry_z=2.0)+ >>> signals = engine.generate({"601318.SH": df1, "601628.SH": df2})+ """++ def __init__(+ self,+ lookback: int = 60,+ entry_z: float = 2.0,+ exit_z: float = 0.5,+ ):+ """ๅๅงๅ้ ๅฏนไบคๆๅผๆใ++ Args:+ lookback: ๅๅผๅๆ ๅๅทฎๅ็็ชๅฃใ+ entry_z: ๅผไป Z-score ้ๅผใ+ exit_z: ๅนณไป Z-score ้ๅผใ+ """+ self.lookback = lookback+ self.entry_z = entry_z+ self.exit_z = exit_z++ def generate(self, data_map: Dict[str, pd.DataFrame]) -> Dict[str, pd.Series]:+ """ๆ นๆฎไปทๆ ผๆฏๅผ Z-score ็ๆ้ ๅฏนไบคๆไฟกๅทใ++ Args:+ data_map: ๆฐๅฅฝไธคไธชๆ ็ไปฃ็ ๅฐ OHLCV DataFrame ็ๆ ๅฐใ++ Returns:+ ๆ ็ไปฃ็ ๅฐไฟกๅท Series ็ๆ ๅฐใ+ ็ฌฌไธไธชๆ ็๏ผ0.5=ๅๅค, -0.5=ๅ็ฉบ, 0=็ฉบไปใ+ ็ฌฌไบไธชๆ ็๏ผๆนๅไธ็ฌฌไธไธช็ธๅใ++ Raises:+ ValueError: ๅฝๆ ็ๆฐ้ไธไธบ 2 ๆถใ+ """+ codes = list(data_map.keys())+ if len(codes) != 2:+ raise ValueError(f"้ ๅฏนไบคๆ้่ฆๆฐๅฅฝ 2 ไธชๆ ็๏ผๅฝๅ {len(codes)} ไธช: {codes}")++ code_a, code_b = codes[0], codes[1]+ df_a, df_b = data_map[code_a], data_map[code_b]++ # ๆฅๆๅฏน้ฝ๏ผinner join๏ผ+ common_idx = df_a.index.intersection(df_b.index)+ close_a = df_a.loc[common_idx, "close"]+ close_b = df_b.loc[common_idx, "close"]++ # ไปทๆ ผๆฏๅผ+ ratio = close_a / close_b++ # Z-score+ mean = ratio.rolling(self.lookback).mean()+ std = ratio.rolling(self.lookback).std()+ z = (ratio - mean) / std++ # ไฟกๅท็ๆ+ sig_a = pd.Series(0.0, index=common_idx)+ sig_b = pd.Series(0.0, index=common_idx)++ # Z < -entry_z โ ๅๅค Aใๅ็ฉบ B๏ผๆฏๅผๅไฝ๏ผ้ขๆๅๅฝๅไธ๏ผ+ long_pair = z < -self.entry_z+ sig_a[long_pair] = 0.5+ sig_b[long_pair] = -0.5++ # Z > +entry_z โ ๅ็ฉบ Aใๅๅค B๏ผๆฏๅผๅ้ซ๏ผ้ขๆๅๅฝๅไธ๏ผ+ short_pair = z > self.entry_z+ sig_a[short_pair] = -0.5+ sig_b[short_pair] = 0.5++ # |Z| < exit_z โ ๅนณไป+ flat = z.abs() < self.exit_z+ sig_a[flat] = 0.0+ sig_b[flat] = 0.0++ # ๅกซๅ NaN๏ผlookback ็ชๅฃๅๆ ๆฐๆฎ๏ผ+ sig_a = sig_a.fillna(0.0)+ sig_b = sig_b.fillna(0.0)++ # ๅฏน้ฝๅๅๅง็ดขๅผ+ return {+ code_a: sig_a.reindex(df_a.index).fillna(0.0),+ code_b: sig_b.reindex(df_b.index).fillna(0.0),+ }+++if __name__ == "__main__":+ import requests++ def _fetch_okx(inst_id: str, bar: str = "1D", limit: int = 300) -> pd.DataFrame:+ """ไป OKX API ่ทๅ K ็บฟๆฐๆฎใ++ Args:+ inst_id: ไบคๆๅฏนๆ ่ฏ๏ผๅฆ "BTC-USDT"ใ+ bar: K ็บฟๅจๆใ+ limit: ่ทๅๆ นๆฐใ++ Returns:+ OHLCV DataFrameใ+ """+ resp = requests.get(+ "https://www.okx.com/api/v5/market/candles",+ params={"instId": inst_id, "bar": bar, "limit": str(limit)},+ )+ candles = resp.json()["data"]+ columns = ["ts", "open", "high", "low", "close", "vol", "volCcy", "volCcyQuote", "confirm"]+ df = pd.DataFrame(reversed(candles), columns=columns)+ df["ts"] = pd.to_datetime(df["ts"].astype("int64"), unit="ms")+ df = df.set_index("ts")+ for col in ["open", "high", "low", "close"]:+ df[col] = df[col].astype(float)+ df["volume"] = df["vol"].astype(float)+ return df++ pair = ["BTC-USDT", "ETH-USDT"]+ data_map = {}+ for sym in pair:+ print(f"Fetching {sym} ...")+ data_map[sym] = _fetch_okx(sym, bar="1D", limit=300)++ engine = SignalEngine(lookback=60, entry_z=2.0, exit_z=0.5)+ signals = engine.generate(data_map)++ for sym in pair:+ sig = signals[sym]+ print(f"\n{sym} ({len(sig)} bars)")+ print(f" Long (0.5): {(sig == 0.5).sum()}")+ print(f" Short (-0.5): {(sig == -0.5).sum()}")+ print(f" Flat (0.0): {(sig == 0.0).sum()}")diff --git a/agent/src/skills/performance-attribution/SKILL.md b/agent/src/skills/performance-attribution/SKILL.mdnew file mode 100644index 000000000..c1fa063c8--- /dev/null+++ b/agent/src/skills/performance-attribution/SKILL.md@@ -0,0 +1,253 @@+---+name: performance-attribution+description: Performance attribution analysis โ Brinson sector/stock-selection attribution, factor alpha/beta decomposition, market-timing evaluation, and benchmark comparison framework.+---++# Performance Attribution Analysis++## Overview++Decompose portfolio excess returns into explainable sources: sector allocation, stock selection, factor exposure, timing contribution, and more. This helps explain **why** a strategy made or lost money, rather than only **how much** it made or lost.++## Brinson Attribution Model++### Single-Period Brinson-Fachler Model++```+Total excess return = portfolio return - benchmark return++Decomposed into three parts:+1. Allocation effect: sector-weight deviation ร sector benchmark return deviation+2. Selection effect: stock selection within a sector ร sector benchmark weight+3. Interaction effect: weight deviation ร stock-selection deviation+```++**Mathematical formulas**:++```+Let w_p,i = portfolio weight of sector i+ w_b,i = benchmark weight of sector i+ r_p,i = portfolio return of sector i+ r_b,i = benchmark return of sector i+ R_b = total benchmark return++Allocation_i = (w_p,i - w_b,i) ร (r_b,i - R_b)+Selection_i = w_b,i ร (r_p,i - r_b,i)+Interaction_i = (w_p,i - w_b,i) ร (r_p,i - r_b,i)++Total excess = ฮฃ(Allocation_i) + ฮฃ(Selection_i) + ฮฃ(Interaction_i)+```++### Example Brinson Attribution++```markdown+### Brinson Sector Attribution++| Sector | Portfolio Weight | Benchmark Weight | Portfolio Return | Benchmark Return | Allocation | Selection | Interaction |+|------|---------|---------|---------|---------|---------|---------|---------|+| Food & Beverage | 20% | 10% | 15% | 8% | +0.3% | +0.7% | +0.7% |+| Electronics | 15% | 12% | 5% | 10% | -0.1% | -0.6% | +0.2% |+| Banks | 5% | 20% | 3% | 2% | +0.3% | +0.2% | -0.2% |+| Others | 60% | 58% | 8% | 7% | +0.0% | +0.6% | +0.0% |+| **Total** | 100% | 100% | 9.5% | 6.2% | **+0.5%** | **+0.9%** | **+0.7%** |++Excess return 3.3% = allocation effect 0.5% + selection effect 0.9% + interaction effect 0.7% + residual 0.2%+```++### Multi-Period Attribution (Linked Brinson)++```+Directly summing single-period attribution creates residuals (compounding effect). Common approaches:++Method 1: arithmetic linking (simple sum of each period's attribution)+ - Advantage: simple+ - Disadvantage: residual remains++Method 2: Carino logarithmic linking+ - Advantage: no residual+ - Disadvantage: more complex++Practical recommendation: arithmetic linking is enough for monthly attribution; residuals are usually <0.1%+```++## Factor Attribution++### Alpha-Beta Decomposition++```+R_p = ฮฑ + ฮฒ ร R_m + ฮต++ฮฑ (alpha): excess return, manager skill+ฮฒ (beta): market exposure, systematic risk+ฮต (epsilon): residual, idiosyncratic risk++Regression method: OLS regression, with at least 60 data points+```++#### Multi-Factor Attribution (Fama-French Extension)++```+R_p - R_f = ฮฑ + ฮฒ_mkt ร (R_m - R_f) + ฮฒ_smb ร SMB + ฮฒ_hml ร HML + ฮฒ_mom ร MOM + ฮต++| Factor | Meaning | China A-share Proxy |+|------|------|--------|+| MKT | Market | CSI 300 return |+| SMB | Small-cap premium | CSI 500 - CSI 300 |+| HML | Value premium | high-PB group - low-PB group |+| MOM | Momentum | top past-12M winners - bottom group |+```++#### Factor Exposure Analysis Template++```markdown+### Factor Exposure Analysis++| Factor | Beta | t-stat | Significance | Interpretation |+|------|------|---------|--------|------|+| Market (MKT) | 0.85 | 12.3 | *** | Below 1, defensive profile |+| Small-cap (SMB) | 0.25 | 3.2 | ** | Small-cap tilt |+| Value (HML) | -0.15 | -1.8 | * | Growth tilt |+| Momentum (MOM) | 0.30 | 4.1 | *** | Significant momentum exposure |+| **Alpha** | **0.8% / month** | **2.5** | ** | **Significant alpha** |++Rยฒ = 0.72 โ factors explain 72% of return variation+Alpha = 0.8% / month = 10% / year, significant+```++## Market-Timing Evaluation++### Treynor-Mazuy Model++```+R_p - R_f = ฮฑ + ฮฒ ร (R_m - R_f) + ฮณ ร (R_m - R_f)ยฒ + ฮต++ฮณ > 0 and significant โ timing ability exists (adds risk in bull markets, cuts risk in bear markets)+ฮณ โค 0 โ no timing ability+```++### Henriksson-Merton Model++```+R_p - R_f = ฮฑ + ฮฒ ร (R_m - R_f) + ฮณ ร max(R_m - R_f, 0) + ฮต++ฮณ > 0 โ portfolio beta is higher in bull markets (successful timing)+```++### Practical Timing Metrics++| Metric | Calculation | Meaning |+|------|------|------|+| Bull capture ratio | portfolio return in bull markets / benchmark return | >100% = outperforming |+| Bear capture ratio | portfolio return in bear markets / benchmark return | <100% = better downside defense |+| Timing hit rate | proportion of months where market direction was called correctly | >55% = shows skill |+| Correlation between position changes and market | `corr(position_change, future_return)` | >0 = timing is correct |++## Benchmark Comparison Framework++### Benchmark Selection++| Strategy Type | Recommended Benchmark | China A-share Code |+|---------|---------|---------|+| China A-share large cap | CSI 300 | 000300.SH |+| China A-share small cap | CSI 500 / CSI 1000 | 000905.SH |+| China A-share broad market | CSI All Share | 000985.SH |+| Hong Kong equities | Hang Seng Index | HSI |+| US equities | S&P 500 | SPX |+| Crypto | BTC | BTC-USDT |+| Multi-asset | 60/40 portfolio | self-constructed |++### Risk-Adjusted Performance Metrics++| Metric | Formula | Excellent | Good | Average |+|------|------|------|------|------|+| Sharpe | `(R_p - R_f) / ฯ_p` | >1.5 | 1.0-1.5 | 0.5-1.0 |+| Sortino | `(R_p - R_f) / ฯ_down` | >2.0 | 1.5-2.0 | 1.0-1.5 |+| Calmar | `R_p / MaxDD` | >1.0 | 0.5-1.0 | 0.2-0.5 |+| Information Ratio | `(R_p - R_b) / TE` | >1.0 | 0.5-1.0 | 0.2-0.5 |+| Treynor | `(R_p - R_f) / ฮฒ` | used comparatively | | |++### Rolling Analysis++```+Use rolling windows (such as 12 months) to analyze:+- Rolling Sharpe: strategy stability+- Rolling alpha: whether alpha persists+- Rolling beta: whether market exposure is stable+- Rolling information ratio: persistence of benchmark outperformance++Suggested windows: 252 days for daily data, 12-36 months for monthly data+```++## Analysis Framework++### Step 1: Aggregate Analysis++```+1. Cumulative return vs benchmark+2. Excess-return decomposition (annual / monthly)+3. Summary risk metrics (volatility / max drawdown / Sharpe)+```++### Step 2: Attribution Decomposition++```+1. Brinson attribution (if sector information is available)+2. Factor attribution (alpha / beta / factor exposure)+3. Timing attribution (TM / HM models)+```++### Step 3: Style Analysis++```+1. Large cap vs small cap exposure+2. Growth vs value exposure+3. Style drift detection (rolling style analysis)+```++### Step 4: Conclusions and Recommendations++```+1. Main sources of excess return+2. Whether risk exposure is reasonable+3. Suggested improvement directions+```++## Output Format++```markdown+## Performance Attribution Report++### Performance Overview+| Metric | Strategy | Benchmark | Excess |+|------|------|------|------|+| Cumulative return | +85.2% | +32.1% | +53.1% |+| Annualized return | 12.5% | 5.8% | +6.7% |+| Annualized volatility | 18.2% | 20.5% | - |+| Sharpe | 0.69 | 0.28 | - |+| Information Ratio | 0.82 | - | - |++### Attribution Breakdown+| Source | Contribution (annualized) | Share |+|------|-----------|------|+| Sector allocation | +2.1% | 31% |+| Stock selection | +3.8% | 57% |+| Timing | +0.8% | 12% |++### Factor Exposure+[factor exposure table]++### Conclusion+Excess return mainly comes from stock selection (57% contribution), followed by sector allocation.+Alpha is significant (`t=2.5`), indicating real stock-picking ability.+Watch the risk of excessive small-cap exposure (`SMB beta=0.25`).+```++## Notes++1. **Attribution โ prediction**: attribution explains the past; it does not guarantee persistence in the future+2. **Benchmark selection affects attribution**: switch the benchmark and alpha may disappear, so benchmark choice must be appropriate+3. **Data frequency**: daily attribution is noisy, monthly attribution is more stable but has fewer samples; recommended workflow is daily computation with monthly reporting+4. **Survivorship bias**: delisted stocks may be excluded in backtests, creating false alpha+5. **Multiple-testing problem**: if you test 100 strategies, about 5 may appear significant by chance (`p=0.05`); use multiple-comparison correction+6. **Factor data requirement**: factor attribution requires factor return data, which can be obtained from `tushare` or self-constructed+7. **Attribution in backtest reports**: `metrics.csv` already provides basic metrics after a backtest; this skill adds deeper attribution analysisdiff --git a/agent/src/skills/perp-funding-basis/SKILL.md b/agent/src/skills/perp-funding-basis/SKILL.mdnew file mode 100644index 000000000..74da0d279--- /dev/null+++ b/agent/src/skills/perp-funding-basis/SKILL.md@@ -0,0 +1,251 @@+---+name: perp-funding-basis+description: Perpetual futures funding rate analysis and cash-carry basis trading โ funding rate regimes, annualized basis signals, carry trade construction, and funding rate arbitrage between exchanges.+---+# Perpetual Funding Rate & Basis Trading++## Overview++Analyze perpetual futures funding rates and spot-futures basis to identify carry trade opportunities, market positioning extremes, and directional sentiment signals. Funding rates are the single most important microstructure indicator in crypto derivatives โ they reveal real-time leverage positioning and crowd sentiment.++## Core Concepts++### 1. Funding Rate Mechanics++Perpetual futures have no expiry date. Instead, a **funding rate** is exchanged between longs and shorts every 8 hours (on most exchanges) to keep the perpetual price anchored to the spot price.++```+If perp price > spot price โ funding rate positive โ longs pay shorts+If perp price < spot price โ funding rate negative โ shorts pay longs+```++**OKX funding rate schedule**: payments at 00:00, 08:00, 16:00 UTC++**Annualized funding rate:**+```python+# OKX funding rate is per 8-hour period+# Annualized = rate ร 3 (per day) ร 365+funding_rate_8h = 0.01 # 0.01% per 8h+annualized = funding_rate_8h * 3 * 365 # = 10.95% annualized+```++### 2. Funding Rate Signal Framework++| Funding Rate (8h) | Annualized | Market State | Signal |+|--------------------|------------|-------------|--------|+| > +0.05% | > +54.75% | Extreme long crowding | Contrarian short / reduce longs |+| +0.02% to +0.05% | +21.9% to +54.75% | Elevated long bias | Cautious, carry trade viable |+| +0.005% to +0.02% | +5.5% to +21.9% | Mild long bias | Neutral to mild bullish |+| -0.005% to +0.005% | -5.5% to +5.5% | Balanced | Neutral |+| -0.02% to -0.005% | -21.9% to -5.5% | Mild short bias | Neutral to mild bearish |+| < -0.02% | < -21.9% | Short squeeze territory | Contrarian long / reduce shorts |++**Funding rate regime detection:**+```python+def funding_regime(rates_7d):+ """Classify funding rate regime from 7-day history."""+ avg = sum(rates_7d) / len(rates_7d)+ consecutive_positive = all(r > 0 for r in rates_7d[-3:])+ consecutive_negative = all(r < 0 for r in rates_7d[-3:])++ if avg > 0.03 and consecutive_positive:+ return "overheated_long" # High risk of long squeeze+ elif avg > 0.01 and consecutive_positive:+ return "bullish_carry" # Good carry trade environment+ elif avg < -0.02 and consecutive_negative:+ return "overheated_short" # High risk of short squeeze+ elif avg < -0.005 and consecutive_negative:+ return "bearish_carry" # Inverse carry trade+ else:+ return "neutral"+```++### 3. Spot-Futures Basis Analysis++**Basis = Futures price - Spot price**++For dated futures (quarterly), basis reflects cost-of-carry expectations:++```python+# Annualized basis+def annualized_basis(futures_price, spot_price, days_to_expiry):+ basis_pct = (futures_price - spot_price) / spot_price+ annualized = basis_pct * (365 / days_to_expiry)+ return annualized++# Example: BTC spot $65,000, quarterly future $66,500, 45 days to expiry+# Basis: 2.31%, Annualized: 18.7%+```++**Basis signal interpretation:**++| Annualized Basis | Market State | Signal |+|-----------------|-------------|--------|+| > 30% | Extreme contango, euphoric leverage | Sell basis (cash-carry), top warning |+| 15-30% | Elevated contango, bullish leverage | Carry trade attractive |+| 5-15% | Normal contango | Neutral, mild bullish |+| 0-5% | Flat basis | Low conviction, wait for direction |+| < 0% (backwardation) | Bearish, forced selling | Contrarian long, extreme pessimism |++### 4. Cash-Carry Arbitrage (Delta-Neutral)++**Strategy: buy spot + sell perpetual futures โ collect funding rate**++```python+# Cash-carry trade P&L+def carry_trade_pnl(spot_entry, funding_rates, position_size):+ """+ Delta-neutral carry: long spot + short perp+ P&L comes purely from funding rate collection.+ """+ total_funding_collected = 0+ for rate in funding_rates:+ if rate > 0: # Longs pay shorts โ we collect as short+ total_funding_collected += rate * position_size+ else: # Shorts pay longs โ we pay as short+ total_funding_collected += rate * position_size # This is negative++ return total_funding_collected++# Example: $100,000 position, avg funding +0.015% per 8h, 30 days+# Revenue: 0.015% ร 3 ร 30 ร $100,000 = $1,350 (16.2% annualized)+```++**Carry trade execution on OKX:**+1. Buy spot BTC-USDT on OKX spot market+2. Open equal-sized short BTC-USDT-SWAP on OKX perpetual+3. Net delta = 0 (spot long cancels perp short)+4. Collect positive funding rate every 8 hours+5. Close both legs when funding rate turns negative or basis compresses++**Risk factors:**+- Funding rate can flip negative โ carry becomes a cost+- Liquidation risk on short perp if insufficient margin (use 3-5x max leverage)+- Exchange counterparty risk (keep position across 2-3 exchanges)+- Basis can widen further before mean-reverting โ mark-to-market loss on short leg++### 5. Cross-Exchange Funding Arbitrage++Different exchanges have different funding rates for the same asset. Arbitrage the spread:++```python+# Example: BTC-USDT perpetual funding rates+exchange_rates = {+ "OKX": 0.015, # +0.015% per 8h+ "Binance": 0.020, # +0.020% per 8h+ "Bybit": 0.025, # +0.025% per 8h+}++# Strategy: short on highest funding (Bybit) + long on lowest funding (OKX)+# Net carry = 0.025% - 0.015% = 0.010% per 8h+# Annualized: 0.010% ร 3 ร 365 = 10.95%+# Risk: execution cost + potential for rates to converge/flip+```++### 6. Funding Rate as Directional Indicator++**Divergence signals (most powerful):**++| Price Action | Funding Rate | Interpretation | Signal |+|-------------|-------------|----------------|--------|+| Price making new highs | Funding declining | Longs not chasing โ distribution | Bearish divergence |+| Price making new lows | Funding rising (less negative) | Shorts not pressing โ accumulation | Bullish divergence |+| Price consolidating | Funding spiking positive | Leverage building without breakout | Squeeze risk |+| Price consolidating | Funding deeply negative | Shorts paying heavy cost to maintain | Short squeeze imminent |++**Historical pattern statistics (BTC):**+- Funding > +0.05% for 3+ consecutive periods โ 70% probability of a 5-10% correction within 7 days+- Funding < -0.03% for 3+ consecutive periods โ 65% probability of a 5-15% bounce within 7 days+- These are contrarian signals; funding rate extremes indicate crowded positioning++### 7. Open Interest ร Funding Rate Matrix++```python+# Combined OI + Funding signal+def oi_funding_matrix(oi_change_24h_pct, funding_rate):+ if oi_change_24h_pct > 5 and funding_rate > 0.03:+ return "leveraged_long_buildup" # High risk, squeeze potential+ elif oi_change_24h_pct > 5 and funding_rate < -0.01:+ return "leveraged_short_buildup" # Short squeeze potential+ elif oi_change_24h_pct < -5 and funding_rate > 0:+ return "long_liquidation" # Forced long closing+ elif oi_change_24h_pct < -5 and funding_rate < 0:+ return "short_liquidation" # Forced short closing+ elif abs(oi_change_24h_pct) < 2 and abs(funding_rate) < 0.005:+ return "quiet_market" # Low conviction, wait+ else:+ return "mixed"+```++## Data Access++### Via OKX API++```python+# Funding rate history+# GET /api/v5/public/funding-rate-history?instId=BTC-USDT-SWAP++# Current funding rate+# GET /api/v5/public/funding-rate?instId=BTC-USDT-SWAP++# Open interest+# GET /api/v5/public/open-interest?instType=SWAP&instId=BTC-USDT-SWAP+```++Use `load_skill("okx-market")` for OKX data retrieval patterns.++### Key Metrics to Track++| Metric | Source | Frequency | Alert Threshold |+|--------|--------|-----------|-----------------|+| BTC funding rate (8h) | OKX / Binance | Every 8h | > +0.05% or < -0.03% |+| ETH funding rate (8h) | OKX / Binance | Every 8h | > +0.05% or < -0.03% |+| Annualized basis (quarterly) | OKX | Continuous | > 30% or < 0% |+| BTC open interest change | OKX | Hourly | > ยฑ5% in 24h |+| Cross-exchange funding spread | Multi-exchange | Every 8h | Spread > 0.02% |++## Output Format++```+## Funding Rate & Basis Analysis โ [Asset]++### Current Funding Rates+| Exchange | 8h Rate | Annualized | Regime |+|----------|---------|------------|--------|+| OKX | +0.015% | +16.4% | bullish_carry |+| Binance | +0.020% | +21.9% | bullish_carry |++### Basis Structure+- **Spot price**: $XX,XXX+- **Perp price**: $XX,XXX (premium: X.XX%)+- **Quarterly futures**: $XX,XXX (annualized basis: X.X%)+- **Basis regime**: [contango / flat / backwardation]++### Funding History (7-day)+- **Average**: +X.XXX%+- **Trend**: [rising / stable / declining]+- **Consecutive direction**: [X periods positive/negative]++### Open Interest+- **Current OI**: $X.XB+- **24h change**: [+/-X%]+- **OI ร Funding signal**: [leveraged_long_buildup / quiet / etc.]++### Carry Trade Opportunity+- **Best carry**: [short on Exchange X, long spot]+- **Expected annualized yield**: X.X%+- **Risk**: [funding flip probability, liquidation distance]++### Directional Signal+- **Funding regime**: [overheated / bullish / neutral / bearish / oversold]+- **Divergence**: [none / bullish / bearish]+- **Confidence**: [high / medium / low]+```++## Notes++- Funding rates are exchange-specific; always compare across OKX, Binance, and Bybit for the full picture+- Extremely high funding rates are a **cost** for longs, not a bullish signal โ they indicate overcrowded positioning+- Cash-carry trades have execution risk: slippage on entry/exit, funding rate flipping, and exchange downtime during volatility+- Basis and funding rate signals work best when combined with on-chain data (MVRV, exchange flows)+- This framework is for research purposes only and does not constitute investment advicediff --git a/agent/src/skills/quant-statistics/SKILL.md b/agent/src/skills/quant-statistics/SKILL.mdnew file mode 100644index 000000000..57d237eb4--- /dev/null+++ b/agent/src/skills/quant-statistics/SKILL.md@@ -0,0 +1,449 @@+---+name: quant-statistics+description: "Quantitative statistical methods: ADF unit-root / cointegration tests, GARCH volatility modeling, regression diagnostics (heteroskedasticity / autocorrelation), Bootstrap, and hypothesis testing."+---++# Quantitative Statistical Methods++## Overview++Common statistical methodology used in quantitative investing, covering time-series testing, volatility modeling, regression diagnostics, and statistical inference. Provides the statistical foundation for strategy development and factor research.++## Time-Series Tests++### 1. ADF Unit-Root Test (Stationarity Test)++**Why it matters**: regressing non-stationary series directly can produce spurious regression, making conclusions unreliable.++```python+from statsmodels.tsa.stattools import adfuller++def adf_test(series: pd.Series, significance: float = 0.05) -> dict:+ """+ ADF test: H0 = unit root exists (non-stationary), H1 = stationary++ Args:+ series: Time series+ significance: Significance level+ Returns:+ Test result+ """+ result = adfuller(series.dropna(), autolag='AIC')+ return {+ 'adf_statistic': result[0],+ 'p_value': result[1],+ 'lags_used': result[2],+ 'is_stationary': result[1] < significance,+ 'critical_values': result[4], # 1%, 5%, 10%+ }+```++**Decision rules**:++| p-value | Conclusion | Action |+|-----|------|------|+| < 0.01 | Strongly stationary | Can be used directly for regression / modeling |+| 0.01-0.05 | Stationary | Usable |+| 0.05-0.10 | Weak evidence | Difference the series and retest |+| > 0.10 | Non-stationary | Must difference or handle with cointegration |++**Stationarity of common financial series**:++| Series | Typical Result | Treatment |+|------|---------|---------|+| Price series | Non-stationary (unit root) | Use log returns |+| Log returns | Stationary | Can be used directly |+| PE / PB series | Usually non-stationary | Use changes or logs |+| Volatility series | Usually stationary | Can be used directly |+| Volume | May be non-stationary | Use logs or standardization |++### 2. Cointegration Test++**Purpose**: determine whether two non-stationary series share a long-run equilibrium relationship (the foundation of pair trading / statistical arbitrage).++```python+from statsmodels.tsa.stattools import coint++def cointegration_test(y: pd.Series, x: pd.Series) -> dict:+ """+ Engle-Granger two-step cointegration test+ H0: no cointegration relationship++ Args:+ y, x: Two price series+ Returns:+ Test result+ """+ score, p_value, critical = coint(y, x)+ return {+ 'test_statistic': score,+ 'p_value': p_value,+ 'is_cointegrated': p_value < 0.05,+ 'critical_values': {'1%': critical[0], '5%': critical[1], '10%': critical[2]},+ }+```++**Application in pair trading**:++```python+import statsmodels.api as sm++def find_hedge_ratio(y: pd.Series, x: pd.Series) -> dict:+ """+ Compute hedge ratio: y = ฮฑ + ฮฒรx + ฮต+ Spread = y - ฮฒรx+ """+ x_const = sm.add_constant(x)+ model = sm.OLS(y, x_const).fit()++ spread = y - model.params[1] * x++ return {+ 'hedge_ratio': model.params[1],+ 'intercept': model.params[0],+ 'spread_mean': spread.mean(),+ 'spread_std': spread.std(),+ 'half_life': compute_half_life(spread), # mean-reversion speed+ }++def compute_half_life(spread: pd.Series) -> float:+ """Estimate half-life with OLS regression."""+ spread_lag = spread.shift(1)+ delta = spread - spread_lag+ model = sm.OLS(delta.dropna(), sm.add_constant(spread_lag.dropna())).fit()+ half_life = -np.log(2) / model.params[1]+ return half_life+```++**Pair-trading signal**:++```+z_score = (spread - mean) / std++| z_score | Signal |+|---------|------|+| > 2.0 | Short spread (sell y, buy x) |+| > 1.5 | Small short spread |+| < -1.5 | Small long spread |+| < -2.0 | Long spread (buy y, sell x) |+| Back near 0 | Close position |+```++### 3. Granger Causality Test++```python+from statsmodels.tsa.stattools import grangercausalitytests++def granger_test(data: pd.DataFrame, x_col: str, y_col: str, max_lag: int = 5):+ """+ Test whether x Granger-causes y (whether historical x helps predict y).+ Note: Granger causality is not true causality, only predictive causality.+ """+ results = grangercausalitytests(data[[y_col, x_col]].dropna(), maxlag=max_lag)+ return {lag: results[lag][0]['ssr_ftest'][1] for lag in range(1, max_lag+1)}+```++## GARCH Volatility Modeling++### GARCH(1,1) Model++```+Returns: r_t = ฮผ + ฮต_t+Volatility: ฯยฒ_t = ฯ + ฮฑรฮตยฒ_{t-1} + ฮฒรฯยฒ_{t-1}++Parameter meanings:+- ฯ (omega): long-run variance baseline+- ฮฑ (alpha): impact of yesterday's shock on today's volatility+- ฮฒ (beta): persistence of yesterday's volatility into today+- ฮฑ + ฮฒ: volatility persistence (usually 0.95-0.99)+- Long-run volatility = sqrt(ฯ / (1 - ฮฑ - ฮฒ))+```++```python+from arch import arch_model++def fit_garch(returns: pd.Series) -> dict:+ """+ Fit a GARCH(1,1) model.++ Args:+ returns: Daily return series (in percentage form)+ Returns:+ Model parameters and forecasts+ """+ model = arch_model(returns * 100, vol='Garch', p=1, q=1,+ mean='Constant', dist='normal')+ result = model.fit(disp='off')++ # Forecast volatility for the next 5 days+ forecast = result.forecast(horizon=5)++ return {+ 'omega': result.params['omega'],+ 'alpha': result.params['alpha[1]'],+ 'beta': result.params['beta[1]'],+ 'persistence': result.params['alpha[1]'] + result.params['beta[1]'],+ 'long_run_vol': np.sqrt(result.params['omega'] /+ (1 - result.params['alpha[1]'] - result.params['beta[1]'])) / 100,+ 'current_vol': np.sqrt(result.conditional_volatility[-1]) / 100,+ 'forecast_vol_5d': np.sqrt(forecast.variance.values[-1, :]) / 100,+ 'aic': result.aic,+ 'bic': result.bic,+ }+```++### GARCH Variants++| Model | Characteristics | Applicable Scenario |+|------|------|---------|+| GARCH(1,1) | Baseline, symmetric shock response | Default choice |+| EGARCH | Asymmetric (leverage effect) | Down-move volatility > up-move volatility |+| GJR-GARCH | Another asymmetric form | Same use case as EGARCH, easier to interpret |+| FIGARCH | Long memory | Volatility clustering persists for very long periods |++**GARCH characteristics in China A-shares / crypto**:++```+China A-shares:+- ฮฑ usually 0.05-0.15+- ฮฒ usually 0.80-0.90+- Clear leverage effect (EGARCH fits better)+- Strong volatility clustering persistence++BTC:+- ฮฑ usually 0.05-0.20 (shocks matter more)+- ฮฒ usually 0.75-0.90+- More symmetric shocks (little difference between up/down volatility)+- Long-run volatility around 60-80% annualized+```++## Regression Diagnostics++### 1. Heteroskedasticity Test++```python+from statsmodels.stats.diagnostic import het_white, het_breuschpagan++def heteroscedasticity_test(model_result) -> dict:+ """+ Test whether residuals are heteroskedastic.+ H0: homoskedasticity+ """+ # White test+ white_stat, white_p, _, _ = het_white(model_result.resid, model_result.model.exog)++ # BP test+ bp_stat, bp_p, _, _ = het_breuschpagan(model_result.resid, model_result.model.exog)++ return {+ 'white_p': white_p,+ 'bp_p': bp_p,+ 'has_heteroscedasticity': white_p < 0.05 or bp_p < 0.05,+ 'fix': 'Use HAC standard errors (Newey-West) or WLS' if white_p < 0.05 else 'No adjustment needed',+ }+```++**Heteroskedasticity fixes**:+- Use `model.fit(cov_type='HAC', cov_kwds={'maxlags': 5})`+- Or use weighted least squares (WLS)+- Financial data is almost always heteroskedastic -> use HAC standard errors by default++### 2. Autocorrelation Test++```python+from statsmodels.stats.diagnostic import acorr_ljungbox+from statsmodels.stats.stattools import durbin_watson++def autocorrelation_test(residuals: pd.Series, lags: int = 10) -> dict:+ """+ Test whether residuals are autocorrelated.+ H0: no autocorrelation+ """+ # DW test (first-order only)+ dw = durbin_watson(residuals)++ # Ljung-Box test (multiple lags)+ lb_result = acorr_ljungbox(residuals, lags=lags)++ return {+ 'durbin_watson': dw,+ 'dw_interpretation': 'positive autocorrelation' if dw < 1.5 else 'no autocorrelation' if dw < 2.5 else 'negative autocorrelation',+ 'ljung_box_p': lb_result['lb_pvalue'].values,+ 'has_autocorrelation': any(lb_result['lb_pvalue'] < 0.05),+ 'fix': 'Use Newey-West standard errors or include lag terms',+ }+```++### 3. Multicollinearity Test++```python+from statsmodels.stats.outliers_influence import variance_inflation_factor++def vif_test(X: pd.DataFrame) -> pd.DataFrame:+ """+ VIF test for multicollinearity+ VIF > 10 -> severe collinearity+ VIF > 5 -> needs attention+ """+ vif_data = pd.DataFrame()+ vif_data['feature'] = X.columns+ vif_data['VIF'] = [variance_inflation_factor(X.values, i) for i in range(X.shape[1])]+ vif_data['concern'] = vif_data['VIF'].apply(+ lambda x: 'severe' if x > 10 else 'watch' if x > 5 else 'normal'+ )+ return vif_data+```++### Regression Diagnostics Checklist++```+โก 1. Linearity: residuals vs fitted values show no obvious pattern+โก 2. Normality: residual QQ plot is close to a straight line, Jarque-Bera p>0.05+โก 3. Heteroskedasticity: White / BP test p>0.05, or use HAC standard errors+โก 4. Autocorrelation: DWโ2, Ljung-Box p>0.05+โก 5. Multicollinearity: VIF<5+โก 6. Outliers: Cook's D < 4/n+```++## Bootstrap Methods++### Nonparametric Bootstrap++```python+def bootstrap_statistic(data: np.ndarray, statistic_func,+ n_bootstrap: int = 10000,+ confidence: float = 0.95) -> dict:+ """+ Estimate a confidence interval for a statistic with Bootstrap.++ Args:+ data: Raw data+ statistic_func: Statistic function (for example np.mean, np.median)+ n_bootstrap: Number of Bootstrap resamples+ confidence: Confidence level+ Returns:+ Point estimate and confidence interval+ """+ n = len(data)+ bootstrap_stats = np.array([+ statistic_func(np.random.choice(data, size=n, replace=True))+ for _ in range(n_bootstrap)+ ])++ alpha = 1 - confidence+ lower = np.percentile(bootstrap_stats, alpha/2 * 100)+ upper = np.percentile(bootstrap_stats, (1 - alpha/2) * 100)++ return {+ 'point_estimate': statistic_func(data),+ 'bootstrap_mean': np.mean(bootstrap_stats),+ 'bootstrap_std': np.std(bootstrap_stats),+ 'ci_lower': lower,+ 'ci_upper': upper,+ 'confidence': confidence,+ }+```++### Bootstrap Applications in Quant++| Scenario | Method | Purpose |+|------|------|------|+| Sharpe-ratio confidence interval | Bootstrap return series | Determine whether Sharpe is significantly >0 |+| Factor return test | Bootstrap factor values | Whether factor premium is robust |+| Maximum drawdown distribution | Bootstrap equity paths | Probability distribution of max drawdown |+| Strategy comparison | Paired Bootstrap | Whether strategy A is significantly better than B |++```python+def bootstrap_sharpe(returns: pd.Series, n_bootstrap: int = 10000) -> dict:+ """Bootstrap confidence interval for the Sharpe ratio."""+ def sharpe(r):+ return r.mean() / r.std() * np.sqrt(252) if r.std() > 0 else 0++ result = bootstrap_statistic(returns.values, sharpe, n_bootstrap)+ result['is_significant'] = result['ci_lower'] > 0 # 95% CI excludes 0+ return result+```++## Hypothesis-Testing Framework++### Quick Reference for Common Tests++| Testing Goal | Test Method | Null Hypothesis |+|---------|---------|--------|+| Mean = 0 | t-test | `ฮผ = 0` |+| Two means are equal | Independent t-test | `ฮผ1 = ฮผ2` |+| Normality | Jarque-Bera | Normal distribution |+| Stationarity | ADF | Has unit root (non-stationary) |+| Autocorrelation | Ljung-Box | No autocorrelation |+| Heteroskedasticity | White / BP | Homoskedasticity |+| Cointegration | Engle-Granger | Not cointegrated |++### Multiple-Testing Problem++```+Problem: test 100 factors and filter with p<0.05 -> expect 5 false positives++Correction methods:+1. Bonferroni: p_adj = p ร n_tests (most conservative)+2. Holm-Bonferroni: stepwise correction (fairly conservative)+3. Benjamini-Hochberg (FDR): control false discovery rate (recommended)++from statsmodels.stats.multitest import multipletests+reject, p_adj, _, _ = multipletests(p_values, method='fdr_bh')+```++### Statistical Significance in Financial Backtests++```+Sharpe significance test:+H0: Sharpe = 0 (strategy is ineffective)+H1: Sharpe > 0++Test statistic: t = Sharpe ร sqrt(n) / sqrt(1 + 0.5รSharpeยฒ)+where n = number of observation periods (years)++Rules of thumb:+- Sharpe > 0.5 and backtest >5 years -> may be significant+- Sharpe > 1.0 and backtest >3 years -> likely significant+- Sharpe > 2.0 -> overfitting warning (hard to sustain in reality)+```++## Output Format++```markdown+## Statistical Testing Report++### Stationarity Test+| Series | ADF Statistic | p-value | Conclusion |+|------|----------|-----|------|+| Price | -1.23 | 0.65 | Non-stationary |+| Return | -15.8 | 0.000 | Stationary *** |++### Cointegration Test+| Pair | Statistic | p-value | Cointegrated |+|------|--------|-----|------|+| 600519/000858 | -4.52 | 0.002 | Yes ** |++### GARCH Model+| Parameter | Value | Meaning |+|------|-----|------|+| ฮฑ | 0.08 | Shock effect |+| ฮฒ | 0.88 | Volatility persistence |+| Long-run volatility | 22.5% | Annualized |++### Bootstrap Result+| Metric | Point Estimate | 95% CI | Significant |+|------|--------|--------|------|+| Sharpe | 1.25 | [0.62, 1.88] | Yes |+| Alpha (monthly) | 0.8% | [0.1%, 1.5%] | Yes |+```++## Notes++1. **Financial data is non-normal**: almost all financial return series are fat-tailed, so be careful with tests assuming normality+2. **Multiple testing**: when backtesting many strategies / factors, multiple-testing correction (FDR control) is mandatory+3. **Out-of-sample validation**: statistical significance does not guarantee profitability; out-of-sample testing is still required+4. **Cointegration can break down**: historical cointegration does not guarantee persistence, so pair trading needs ongoing monitoring+5. **GARCH forecast horizon is limited**: volatility-forecast accuracy declines rapidly beyond 5-10 days+6. **Be careful with small samples**: financial datasets may look large, but the number of independent observations can still be small (for example, annual data)+7. **p-hacking risk**: do not keep adjusting until p<0.05; predefine the testing plandiff --git a/agent/src/skills/regulatory-knowledge/SKILL.md b/agent/src/skills/regulatory-knowledge/SKILL.mdnew file mode 100644index 000000000..d866492df--- /dev/null+++ b/agent/src/skills/regulatory-knowledge/SKILL.md@@ -0,0 +1,299 @@+---+name: regulatory-knowledge+description: ้่็็ฎก็ฅ่ฏๅบ๏ผA่กๆถจ่ทๅ/ST้ๅธๆฐ่ง/่ๅธใๆธฏ่กT+0/ๅ็ฉบๆบๅถใ็พ่กPDT/็ๆญใๅ ๅฏ็็ฎกๆฟ็ญใ่ทจๅข็จๅกๅบ็ก+---++# ้่็็ฎก็ฅ่ฏๅบ++## ๆฆ่ฟฐ++้ๅไบคๆๅฟ ้กป็่งฃ็ๅๅธๅบ็็ฎก่งๅใ้่ฏฏ็ไบคๆ่งๅๅ่ฎพไผๅฏผ่ดๅๆตๅคฑ็๏ผๅฆA่กๅๆตไธ่่ๆถจ่ทๅ้ๅถ๏ผใๅฎ็่ฟ่ง๏ผๅฆ็พ่กPDT้ๅถ๏ผๆ็จๅกๆๅคฑใ++้็จๅบๆฏ๏ผ+- ๅๆตๅผๆไธญๆญฃ็กฎๅฎ็ฐไบคๆ่งๅ็บฆๆ+- ่ทจๅธๅบ็ญ็ฅ็่งๅๅทฎๅผๅค็+- ๅ่ง้ฃๆงๅๆฐ่ฎพ็ฝฎ+- ็จๅกๅฝฑๅ็บณๅ ฅ็ญ็ฅๆถ็่ฎก็ฎ++## ๆ ธๅฟๆฆๅฟต++### A่กไบคๆ่งๅ++**ๆถจ่ทๅๅถๅบฆ**๏ผ+| ๆฟๅ | ๆถจ่ทๅ | ๆฐ่ก้ฆๆฅ | STๆถจ่ทๅ |+|------|--------|----------|----------|+| ไธปๆฟ(ๆฒชๆทฑ) | ยฑ10% | +44%/-36% | ยฑ5% |+| ๅไธๆฟ | ยฑ20% | ๅ5ๆฅๆ ้ๅถ | ยฑ20% |+| ็งๅๆฟ | ยฑ20% | ๅ5ๆฅๆ ้ๅถ | ยฑ20% |+| ๅไบคๆ | ยฑ30% | ๅ5ๆฅๆ ้ๅถ | ยฑ30% |++```+ๅๆตๅฝฑๅ:+ ๆถจๅๆถไนฐๅ ฅๅฏ่ฝๆ ๆณๆไบค๏ผๅฐๆฟ๏ผโ ไฟกๅทๅปถ่ฟ+ ่ทๅๆถๅๅบๅฏ่ฝๆ ๆณๆไบค๏ผๅฐๆฟ๏ผโ ๆญขๆๅคฑๆ++ๅๆตๅฎ็ฐ:+ if daily_return >= limit_up:+ buy_signalๆ ๆณๆง่ก, ๆจ่ฟๅฐๆฌกๆฅ+ if daily_return <= limit_down:+ sell_signalๅฏ่ฝๆ ๆณๆง่ก, ็จ่ทๅไปทๆจกๆๆไบค+```++**T+1ๅถๅบฆ**๏ผ+```+A่ก: Tๆฅไนฐๅ ฅ โ T+1ๆฅๆ่ฝๅๅบ+ๅๆตๅฝฑๅ: ไฟกๅทๅจTๆฅไบง็ โ T+1ๆฅๅผ็ๆง่กไนฐๅ ฅ โ T+2ๆฅๆๆฉๅฏๅๅบ+ๅธธ่ง้่ฏฏ: ๅๆตไธญTๆฅไฟกๅทTๆฅๅฐฑๅนณไป โ ่ๅขๆถ็++ไพๅค:+ - ่ๅธๅ็ฉบ: ๅฏT+0(่ๅธๅๅบๅฝๆฅไนฐๅธ่ฟๅธ)+ - ETFๅฅๅฉ: ไธ็บงๅธๅบ็ณ่ตๅฏๅฎ็ฐT+0ๅ็ธไบคๆ+ - ๅฏ่ฝฌๅบ: ๅฎ่กT+0ไบคๆ+```++**่่ต่ๅธ/่ฝฌ่้**๏ผ+```+่่ต(ๆ ๆๅๅค):+ ไฟ่ฏ้ๆฏไพ: โฅ100% (ๅณๆๅคงๆ ๆ2ๅ)+ ็ปดๆๆ ไฟๆฏไพ: โฅ130% (ไฝไบๅ่ฟฝไฟ; <110%ๅผบๅนณ)+ ๆ ็่ๅด: ็บฆ1600ๅช(ๆตๅจๆงๅฅฝ็ไธปๆฟ/ๅไธๆฟ่ก็ฅจ)++่ๅธ(ๅ็ฉบ):+ ๅธๆบ: ่ฏๅธๅ ฌๅธ่ชๆ+่ฝฌ่้ๅๅ ฅ+ ่ดน็: ๅนดๅ8-10%(่ฟ้ซไบ็พ่ก็1-2%)+ ้ๅถ: 2023ๅนดๅ้ๅถ่ๅธT+0, ๅธๆบๅคงๅน ๆถ็ดง++ๅๆตๅฝฑๅ:+ ๅ็ฉบ็ญ็ฅๅจA่กๆๆฌๆ้ซ, ้ๆฃ้ค8-10%/ๅนด็่ๅธ่ดน็จ+ ๅฎ้ ๅฏ่ๅธๆ ็ < ็่ฎบๆ ็ (ๅธๆบๆ้)+```++**้ๅ็ซไปทไธ่ฟ็ปญ็ซไปท**๏ผ+```+ๆฉ็้ๅ็ซไปท: 9:15-9:25 (9:15-9:20ๅฏๆคๅ, 9:20-9:25ไธๅฏๆคๅ)+ 9:25 ไบง็ๅผ็ไปท+่ฟ็ปญ็ซไปท: 9:30-11:30, 13:00-14:57+ๅฐพ็้ๅ็ซไปท: 14:57-15:00 (ไธๅฏๆคๅ)++ๅๆตๅฝฑๅ:+ - ๆฅ็บฟๅๆต้ป่ฎค็จT+1ๅผ็ไปทๆไบค+ - ๅฐพ็3ๅ้้ๅ็ซไปท: ๅคงๅ้ไธญ, VWAP็ญ็ฅ้ๆณจๆ+ - ้ๅ็ซไปทๆ้ด็้ไปทๅๅฏ่ฝๅฝฑๅๅผ็ไปท+```++**ๅคงๅฎไบคๆ**๏ผ+```+ๆถ้ด: 15:00-15:30 (ๆถ็ๅ)+ๆไปท: ้ๅธธๆไปท3-8% (็ธๅฏนๆถ็ไปท)+้ๅถ: ไนฐๅ ฅๅ6ไธชๆๅ ไธ่ฝๅจไบ็บงๅธๅบๅๅบ(ๅคง่กไธๅๆ็จ)++ไฟกๅทๆไน:+ ๅคงๅฎไบคๆ้ข็น + ๆไปทๅคง โ ๅฏ่ฝๆๅๆ้ๆฑ(ๅฉ็ฉบ)+ ๅคงๅฎไบคๆๅ6ไธชๆ่งฃ็ฆ โ ๅ ณๆณจ่งฃ็ฆๆฅๅๅ+```++### ๆธฏ่กไบคๆ่งๅ++```+ไบคๆๆถ้ด:+ ๆฉ็็ซไปท: 9:00-9:30+ ่ฟ็ปญไบคๆ: 9:30-12:00, 13:00-16:00+ ๆถๅธ็ซไปท: 16:00-16:10++ๆ ธๅฟๅทฎๅผ(vs A่ก):+ โ T+0ไบคๆ (ๅฝๆฅไนฐๅฝๆฅๅฏๅ)+ โ ๆ ๆถจ่ทๅ้ๅถ (ไธช่กๅๆฅๅฏๆถจ่ท50%+)+ โ ๅ็ฉบๆบๅถๅฎๅ (่ๅธๆๆฌไฝ, ็บฆ1-3%/ๅนด)+ โ ๆ็ไบคๆ (IPOไธๅธๅไธๆ็็ฐๅธไบคๆ)+ โ ๆตๅจๆงๅทฎ (ๆฅๆไบค้ขไป A่ก็1/10-1/5)+ โ ไป่กๅค (ๅคง้่กไปท<0.1ๆธฏๅ ็ๅฐ็ฅจ)++ๅ็ฉบ่งๅ:+ - ๅช่ฝไปฅไธไฝไบๆไฝณๅ็ไปทๅ็ฉบ (uptick ruleๅไฝ)+ - ้ๅ ๅๅ ฅ่กไปฝๆ่ฝๅ็ฉบ (naked short prohibited)+ - ๅ็ฉบๅคดๅฏธ้ๆฏๆฅๆฅๅ (่พพๅฐ0.02%้ๅผๆถ)++ไบคๆถๅถๅบฆ:+ T+2ไบคๆถ (ไนฐๅ ฅT+2ๆฅๆ่ฝๆๅ่กไปฝ)+ ไฝไบคๆๅฏT+0 (้ขไปๅถๅบฆไธ)++ๅๆตๅฝฑๅ:+ - ๆ ๆถจ่ทๅ โ ๆ็ซฏๆณขๅจๅคง, ๆญขๆๆด้่ฆ+ - T+0 โ ๆฅๅ ็ญ็ฅๅฏ่ก+ - ๆตๅจๆงไฝ โ ๅฐ็่กๆป็นๅคง, ๅฒๅปๆๆฌ้็บณๅ ฅ+```++### ็พ่กไบคๆ่งๅ++```+ไบคๆๆถ้ด(ๅไบฌๆถ้ด):+ ๅคไปคๆถ: 21:30-04:00+ ๅฌไปคๆถ: 22:30-05:00+ ็ๅ: 16:00-21:30 / 17:00-22:30+ ็ๅ: 04:00-08:00 / 05:00-09:00++PDT่งๅ(Pattern Day Trader):+ ๆกไปถ: 5ไธชไบคๆๆฅๅ ๆฅๅ ไบคๆ(ๅฝๆฅๅผๅนณ) โฅ 4ๆฌก+ ่งฆๅๅ: ่ดฆๆท้็ปดๆ โฅ $25,000 ไฝ้ข+ ไฝไบ$25,000: ่ดฆๆท่ขซ้ๅถ90ๅคฉๅช่ฝๅนณไป++ ่ง้ฟๆนๆณ:+ - ไฝฟ็จ็ฐ้่ดฆๆท(Cash Account, T+2ไบคๆถ, ๆ PDT้ๅถไฝ่ต้ๆ็ไฝ)+ - ่ดฆๆท็ปดๆ > $25,000+ - ๆงๅถๆฅๅ ไบคๆ้ข็ < 4ๆฌก/5ๆฅ++็ๆญๆบๅถ:+ Level 1: S&P 500ไธ่ท 7% โ ๆๅ15ๅ้ (15:25ๅไธ่งฆๅ)+ Level 2: S&P 500ไธ่ท13% โ ๆๅ15ๅ้ (15:25ๅไธ่งฆๅ)+ Level 3: S&P 500ไธ่ท20% โ ๅฝๆฅๅๆญขไบคๆ++ ไธช่กLULD(Limit Up-Limit Down):+ ๆถจ่ทๅน ่ถ ่ฟๅ่ไปทยฑ5%(ๅคง็่ก)/ยฑ10%(ๅฐ็่ก) โ ๆๅ5ๅ้++RegSHO(ๅ็ฉบ่งๅ):+ - Locate requirement: ๅ็ฉบๅๅฟ ้กป็กฎ่ฎคๅฏๅๅฐ่กไปฝ+ - Close-out: ่ฟ็ปญ13ๅคฉๆ ๆณไบคๅฒ โ ๅผบๅถๅนณไป+ - Short Sale Circuit Breaker: ไธช่ก่ท>10% โ ๅฝๆฅ+ๆฌกๆฅๅช่ฝuptickๅ็ฉบ++ๅๆตๅฝฑๅ:+ - ็พ่กๆ ๆฅๅธธๆถจ่ทๅ โ ไฝๆLULDๆๅ+ - T+0ไบคๆ(ไฟ่ฏ้่ดฆๆท) โ ๆฅๅ ็ญ็ฅๅฏ่ก+ - ็ๅ็ๅไบคๆ้ไฝ, ๆป็นๅคง+```++### ๅ ๅฏ่ดงๅธ็็ฎก++```+ไธป่ฆๅธๅบๆฟ็ญ(ๆช่ณ2026):+ ไธญๅฝๅคง้: ็ฆๆญขไบคๆๆ่ฟ่ฅๅICO, ไฝๆๆไธ่ฟๆณ+ ้ฆๆธฏ: VASP็็ งๅถๅบฆ, ๅ่งไบคๆๆ(HashKey็ญ)+ ็พๅฝ: SEC/CFTCๅ้็็ฎก, BTC/ETH็ฐ่ดงETFๅทฒ่ทๆน+ ๆฌง็: MiCAๆณ่ง2024ๅนดๅ จ้ข็ๆ+ ๆฅๆฌ: FSA็็ฎก, ไบคๆๆ้ๆณจๅ+ ๆฐๅ ๅก: MAS็็ฎก, Payment Services Act++็จณๅฎๅธ็็ฎก่ถๅฟ:+ - USDT: ๅจๅค้้ๆๅบฆไบ่ฎฎ, ้จๅๅฐๅบ้ๅถ+ - USDC: ๅ่งๆงๆดๅฅฝ, Circleๅ็พๅฝ็็ฎก+ - ๅๅฝๆจ่ฟๅคฎ่กๆฐๅญ่ดงๅธ(CBDC)ๅฏ่ฝๆฟไปฃ++DeFiๅ่ง:+ - ๅคง้จๅDeFiๅ่ฎฎ็ฎๅๅคไบ็็ฎก็ฐ่ฒๅฐๅธฆ+ - ่ถๅฟ: ่ฆๆฑๅ็ซฏKYC, ้พไธไบคๆไป่ช็ฑ+ - ้ฃ้ฉ: ๆบ่ฝๅ็บฆ้ฃ้ฉไธๅๆ่ต่ ไฟๆคๆณ่ฆ็++ๅๆตๅฝฑๅ:+ - ๅ ๅฏๅธๅบ7ร24ไบคๆ, ๆ ไผๅธ+ - ๆ ๆถจ่ทๅ้ๅถ, ๆ็ซฏๆณขๅจๅฏ่พพ50%+/ๆฅ+ - ไบคๆๆ้ดไปทๅทฎๅฏ่พพ1-3%(ๅฅๅฉๆบไผไฝไนๆ้ฃ้ฉ)+ - OKX็ญไธปๆตๆๆ ๆๆ้ซ125x(ๅ็บฆ), ๅๆต้ๆญฃ็กฎ่ฎก็ฎ็ไปไปท+```++## ๅๆๆกๆถ++### 1. ๅๆต่งๅ็บฆๆ็ฉ้ต++```+| ่งๅ | A่ก | ๆธฏ่ก | ็พ่ก | ๅ ๅฏ(OKX) |+|------|-----|------|------|-----------|+| ๆถจ่ทๅ | ยฑ10/20/30% | ๆ | LULDๆๅ | ๆ |+| T+N | T+1 | T+0 | T+0(ไฟ่ฏ้) | T+0 |+| ๅ็ฉบ | ่ๅธ(่ดต) | ๅฎนๆ | ๅฎนๆ | ๆฐธ็ปญๅ็บฆ |+| ไบคๆๆถ้ด | 4h/ๆฅ | 5.5h/ๆฅ | 6.5h/ๆฅ | 24/7 |+| ๆ็ปญ่ดน | 0.025%+ๅฐ่ฑ็จ0.05% | 0.03%+ๅฐ่ฑ็จ0.1% | $0(้จๅ) | 0.02-0.05% |+| ๆๅฐไบคๆๅไฝ | 100่ก | 1ๆ(ไธ็ญ) | 1่ก | 0.001BTC |+```++### 2. ่ทจๅธๅบ็ญ็ฅ็ๅ่งๆฃๆฅ++```+ๆฃๆฅๆธ ๅ:+ โก ไบคๆๆถ้ดๆฏๅฆ้ๅ (ๆถๅบ่ฝฌๆข)+ โก ๅๅธๅบๅๆๅทฎๅผ(A่กๆฅ่/ๅฝๅบ vs ็พ่กๅฃ่ฏ/ๆๆฉ่)+ โก ๆฑ็้ฃ้ฉๆฏๅฆ็บณๅ ฅ(ไบบๆฐๅธ/ๆธฏๅธ/็พๅ /USDT)+ โก ๅ็ฉบๅฏ่กๆง(A่ก็ญ็ฅไธญๅ็ฉบไฟกๅท่ฝๅฆๆง่ก)+ โก ๆๅฐไบคๆๅไฝ็บฆๆ(A่ก100่กๆดๆ โ ๅฐ่ต้ๅฏ่ฝๆ ๆณ็ฒพ็กฎ้ ๆฏ)+ โก ๅฐ่ฑ็จ/่ฏ็ฎก่ดน็ญ้ๅซๆๆฌๆฏๅฆ็บณๅ ฅ++A่ก็ๅฎไบคๆๆๆฌ:+ ไฝฃ้: 0.025% (ไธ2.5, ๆไฝ5ๅ /็ฌ)+ ๅฐ่ฑ็จ: 0.05% (ๅๅบๆถ, 2023ๅนดๅๅ)+ ่ฟๆท่ดน: 0.001%+ ่ง่ดน: 0.00687%+ ๅ่ฎก(ๅ่พน): ็บฆ0.08%+ ๅ่ฎก(ๅ่พน): ็บฆ0.16%++ ๅฝฑๅ: ๆๆขๆ1ๆฌก โ ๅนดๅๆๆฌ็บฆ1.9%+ ๆๆขๆ4ๆฌก โ ๅนดๅๆๆฌ็บฆ7.7%+```++### 3. ็จๅกๅฝฑๅ++```+A่ก:+ ่ก็ฅจไนฐๅ: ๅ ไธชไบบๆๅพ็จ๏ผ2024ๅนด็ปง็ปญๅ ๅพ๏ผ+ ่กๆฏ็จ: ๆๆ>1ๅนดๅ ็จ; 1ไธชๆ-1ๅนด=10%; <1ไธชๆ=20%+ ๅบ้ๅ็บข: ๅ ไธชไบบๆๅพ็จ++ ๅๆตๅฝฑๅ: ้ซ่กๆฏ็ญ็ฅ้่่ๆๆๆ็็จๅกๅทฎๅผ+ ๅนดๅ่กๆฏ5% ร 20%็จ็ = 1%็็จๅกๆ็ดฏ๏ผ็ญๆๆๆๆถ๏ผ++ๆธฏ่ก(้่ฟๆธฏ่ก้):+ ่กๆฏ็จ: 20%๏ผH่ก๏ผๆ 10%๏ผ็บข็ญน/ๆฐไผ๏ผ+ ่ตๆฌๅฉๅพ: ๅ ็จ+ ๆณจๆ: ๆธฏ่ก้่กๆฏ็จ็ฑไธญๅฝ็ป็ฎไปฃๆฃ++็พ่ก:+ ่กๆฏ็จ: 10%(ไธญ็พ็จๆถๅๅฎ)+ ่ตๆฌๅฉๅพ: ็ฎๅไธญๅฝๅฑ ๆฐๆๅ , ไฝ้ๅ ณๆณจๆฟ็ญๅๅ+ W-8BEN่กจๆ ผ: ๅธๅ่ฆๆฑๅกซๅไปฅไบซๅๅๅฎ็จ็++ๅ ๅฏ่ดงๅธ:+ ไธญๅฝ: ๆๆ ๆ็กฎ็จๆถ่งๅฎ๏ผไฝๅคง้ขไบคๆๅฏ่ฝ่ขซ่ฟฝๆบฏ๏ผ+ ็พๅฝ: ่ตๆฌๅฉๅพ็จ(็ญๆ=ๆฎ้ๆถๅ ฅ็จ็, ้ฟๆ=0/15/20%)++ ๅๆตๅฝฑๅ: ๅฆ่ฎกๅ ฅ็จๅก, ้ข็นไบคๆ็ญ็ฅ็ๅๆถ็ไธ้ๆพ่+```++## ่พๅบๆ ผๅผ++ๅ่งๆฃๆฅๆฅๅ๏ผ+```+=== ็ญ็ฅๅ่งๆฃๆฅ ===+็ญ็ฅ: A่ก+ๆธฏ่ก ๅค็ฉบ้ ๅฏนไบคๆ+ๆ ็: 600519.SH (่ดตๅท่ ๅฐ) + 0700.HK (่ พ่ฎฏ)++=== ่งๅ็บฆๆ ===+A่กๅ็ฉบ: ้่ๅธ โ 600519่ๅธ่ดน็็บฆ8%/ๅนด, ๅธๆบๆ้+ๆธฏ่กๅ็ฉบ: 0700.HKๅ็ฉบๆๆฌ็บฆ1.5%/ๅนด, ๅธๆบๅ ่ถณ+T+Nๅทฎๅผ: A่กT+1 vs ๆธฏ่กT+0 โ ้ ๅฏนไฟกๅทๆง่กๆๆถๅทฎ+ๆถจ่ทๅ: A่กยฑ10% ๅฏ่ฝ้ปๆญขๆญขๆๆง่ก+ไบคๆๆถ้ด: A่ก9:30-15:00 vs ๆธฏ่ก9:30-16:00 โ 14:57-16:00ๆธฏ่กๅ่พนๆด้ฒ++=== ๆๆฌไผฐ็ฎ ===+A่กไบคๆๆๆฌ: 0.16%/ๅ่พน+ๆธฏ่กไบคๆๆๆฌ: 0.26%/ๅ่พน (ๅซๅฐ่ฑ็จ0.1%)+่ๅธๆๆฌ(A่ก): 8%/ๅนด+่ๅธๆๆฌ(ๆธฏ่ก): 1.5%/ๅนด+ๆฑ็ๅฏนๅฒๆๆฌ: ็บฆ1%/ๅนด++=== ๅปบ่ฎฎ ===+1. A่ก็ซฏ็จ่กๆๆ่ดงๆฟไปฃ่ๅธๅ็ฉบ โ ๆๆฌ้่ณ2-3%/ๅนด+2. ้ ๅฏนไบคๆไฟกๅทๅจ14:57ๅๆง่กA่ก็ซฏ, ๆธฏ่ก็ซฏๅฏๅปถ่ฟ+3. ๆฑ็้ฃ้ฉ: ไบบๆฐๅธ/ๆธฏๅธๆณขๅจ็บฆยฑ3%/ๅนด, ๅฐไบ็ญ็ฅ้ขๆๆถ็ๅๅฏไธๅฏนๅฒ+```++## ๆณจๆไบ้กน++1. **่งๅๅจๆๅๅ**๏ผ็็ฎก่งๅ้ข็น่ฐๆด๏ผๅฆ2023ๅนดๅฐ่ฑ็จๅๅใ่ๅธT+0้ๅถ๏ผ๏ผๅๆต้ๆๅๅฒๆถ็นไฝฟ็จๅฏนๅบ่งๅ+2. **ๅๆต vs ๅฎ็ๅทฎ่ท**๏ผๆถจ่ทๅๅฐๆฟๆ ๆณๆไบคๆฏๅๆตๆๅคงๅคฑ็ๆฅๆบ๏ผ้ซๆขๆ็ญ็ฅ้ไธฅๆ ผๅปบๆจก+3. **A่ก็นๆฎๆถๆฎต**๏ผ้ๅ็ซไปท9:15-9:25ๅๅฐพ็14:57-15:00่งๅไธ่ฟ็ปญ็ซไปทไธๅ๏ผไฟกๅทๆง่ก้ๅบๅ+4. **่ทจๅธๅบๅๆ**๏ผA่กๆฅ่ไผๅธ็บฆ10ๅคฉ๏ผๆ้ดๆธฏ็พ่กๅๅ ๅฏๅธๅบๆญฃๅธธไบคๆ๏ผ้ๅค็ไฟกๅทไธญๆญ+5. **็็ฎก้ฃ้ฉๆบขไปท**๏ผๅ ๅฏๅธๅบๆฟ็ญไธ็กฎๅฎๆงๆฌ่บซๆฏ้ฃ้ฉๅ ๅญ๏ผๅบๅจ็ญ็ฅไธญ็บณๅ ฅ+6. **ๅธๅๅทฎๅผ**๏ผไธๅๅธๅ็ไฝฃ้็ใ่ๅธ่ดน็ใ็ณป็ปๅปถ่ฟๅทฎๅผๆพ่๏ผๅๆตๅๆฐๅบๅไฟๅฎๅผ++## ไพ่ต++```bash+pip install pandas numpy+```diff --git a/agent/src/skills/report-generate/SKILL.md b/agent/src/skills/report-generate/SKILL.mdnew file mode 100644index 000000000..659195aee--- /dev/null+++ b/agent/src/skills/report-generate/SKILL.md@@ -0,0 +1,260 @@+---+name: report-generate+description: Professional financial research report generation โ standard structure (summary / views / main body / risks / recommendation), Markdown formatting standards, rating system, and terminology guide.+---++# Professional Research Report Generation++## Overview++Generate structured, professional-grade financial research reports. Follow the conventions used by securities firms and asset managers, and output complete Markdown reports that can be used directly for investment research reference.++## Report Types and Structure++### Type Classification++| Type | Length | Core Content | Trigger Scenario |+|------|------|---------|---------|+| Deep-dive stock report | 3000-5000 words | Company analysis + valuation + rating | "Analyze stock XX" |+| Industry research | 2000-4000 words | Industry structure + trend + recommended names | "How is sector XX?" |+| Strategy report | 1500-3000 words | Macro + strategy + allocation recommendation | "What is the market outlook?" |+| Backtest report | 1000-2000 words | Strategy performance + risk + improvement suggestions | After a backtest is completed |+| Flash comment / note | 500-1000 words | Event commentary + impact + action suggestion | "How should we view event XX?" |++### Standard Structure Template++```markdown+# [Report Title]++> **Rating**: Buy | **Target Price**: ยฅXX | **Current Price**: ยฅXX+> **Analyst**: Vibe-Trading | **Date**: 2026-03-28++## Summary++3-5 key points, each 1-2 sentences, covering the core conclusion.+Use explicit language such as bullish / bearish / neutral. Do not be vague.++## Core Views++### View 1: [One-line heading]+2-3 paragraphs of discussion, supported by data.++### View 2: [One-line heading]+2-3 paragraphs of discussion, supported by data.++### View 3: [One-line heading]+2-3 paragraphs of discussion, supported by data.++## Main Analysis++### [Section 1: for example Industry analysis / Company fundamentals / Strategy logic]+Detailed analysis...++### [Section 2: for example Financial analysis / Competitive landscape / Backtest results]+Detailed analysis...++### [Section 3: for example Valuation analysis / Catalysts / Risk-reward]+Detailed analysis...++## Data Appendix++Key data tables...++## Risk Warnings++1. [Risk 1]: specific description + trigger condition + impact level+2. [Risk 2]: ...+3. [Risk 3]: ...++## Investment Recommendation++Clear action recommendation, including direction, position size, and time horizon.++---+*Disclaimer: This report is generated by an AI quantitative system for research reference only and does not constitute investment advice.*+```++## Rating System++### Equity Ratings++| Rating | Definition | Expected Return (12 months) | Use Case |+|------|------|-----------------|---------|+| Strong Buy | Clearly bullish, high conviction | >30% | Undervalued + catalyst + favorable trend |+| Buy | Bullish, reasonably high conviction | 15%-30% | Improving fundamentals + fair valuation |+| Neutral | No clear directional edge | -5%~15% | Fair valuation but lacks catalysts |+| Avoid | Bearish | <-5% | Overvaluation / deteriorating fundamentals |++### Strategy Ratings++| Rating | Definition | Applicable Standard |+|------|------|------|+| High allocation priority | Excellent risk-reward profile | Sharpe > 1.5, max drawdown < 20% |+| Allocatable | Good risk-reward profile | Sharpe > 1.0, max drawdown < 30% |+| Watch | Needs more validation | Sharpe 0.5-1.0 |+| Not recommended | Poor risk-reward profile | Sharpe < 0.5 or drawdown > 40% |++## Markdown Formatting Standards++### Heading Hierarchy++```+# H1: Report title (only one)+## H2: Main sections (summary / views / body / risks / recommendation)+### H3: Subsections+#### H4: Maximum depth; use bold text instead of deeper nesting+```++### Table Standards++```markdown+| Metric | 2024A | 2025E | 2026E | Notes |+|------|-------|-------|-------|------|+| Revenue (100m RMB) | 500.2 | 580.0 | 660.0 | +15% YoY |+| Net profit (100m RMB) | 45.3 | 55.0 | 65.0 | +22% YoY |+| PE(TTM) | 25.0x | 20.5x | 17.3x | Valuation compressing |+```++**Table rules**:+- Right-align numbers where possible (when Markdown cannot do so, at least keep visual alignment clean)+- Put units in the header (`100m / 10k / RMB`)+- Forecast values use `E` (`2025E`), actual values use `A` (`2024A`)+- Keep 1 decimal place for percentages and 1-2 decimal places for monetary values++### Number Formatting Standards++| Type | Format | Example |+|------|------|------|+| Percentage | `X.X%` | Return `12.5%` |+| Large amount | `X,XXX.Xไบฟ` | Market cap `1,234.5ไบฟ` |+| Small amount | `X.XXๅ ` | Stock price `25.80ๅ ` |+| Multiple | `X.Xx` | PE `20.5x` |+| Date | `YYYY-MM-DD` | `2026-03-28` |+| Time range | `YYYY.MM-YYYY.MM` | `2024.01-2025.03` |++### Chart Substitute (Text Description + Data Table)++Since Markdown output cannot embed images, use the following substitute:++```markdown+### Equity Curve++The strategy equity started at 1.00 in 2020-01, peaked at 1.85 in 2021-02,+then suffered its largest drawdown from 2022.04 to 2022.10 (-25.3%), and+recovered by 2023.06 to a new high of 2.10.++| Time Point | Equity | Cumulative Return | Phase Event |+|---------|------|---------|---------|+| 2020-01 | 1.00 | 0% | Start |+| 2021-02 | 1.85 | +85% | Bull-market peak |+| 2022-10 | 1.38 | +38% | Drawdown low |+| 2023-06 | 2.10 | +110% | Recovery to new high |+| 2024-12 | 2.45 | +145% | Latest |+```++## Professional Terminology Guide++### Terms You Should Use (to improve professionalism)++| Scenario | Professional Expression | Avoid |+|------|---------|---------|+| Price down | pullback / correction / drawdown | dropped / fell |+| Price up | strengthened / rebounded / recovered / climbed | rose / went up |+| Uncertainty | uncertainty remains / needs monitoring | hard to say / cannot tell |+| Recommend buying | recommend overweight / add | buy now |+| Recommend selling | recommend underweight / avoid | sell now |+| Undervalued | valuation offers a margin of safety | cheap |+| Expensive | valuation premium is elevated | expensive |+| Trend favorable | conditions are improving / trend is constructive | market looks okay |++### Common Abbreviations++| Abbreviation | Full Name | Chinese Meaning |+|------|------|------|+| YoY | Year over Year | ๅๆฏ |+| QoQ | Quarter over Quarter | ็ฏๆฏ |+| MoM | Month over Month | ๆ็ฏๆฏ |+| TTM | Trailing Twelve Months | ๆปๅจ12ไธชๆ |+| CAGR | Compound Annual Growth Rate | ๅคๅๅข้ฟ็ |+| ROE | Return on Equity | ๅ่ตไบงๆถ็็ |+| EPS | Earnings Per Share | ๆฏ่กๆถ็ |+| FCF | Free Cash Flow | ่ช็ฑ็ฐ้ๆต |++## Backtest Report Template++After a backtest is completed, read `metrics.csv` and `equity.csv` to generate:++```markdown+# Backtest Report: [Strategy Name]++## Strategy Overview+- **Strategy type**: momentum / mean reversion / multi-factor / ...+- **Instruments**: 000001.SZ, 600519.SH, ...+- **Backtest period**: 2016-01-01 to 2026-01-01+- **Initial capital**: ยฅ1,000,000++## Performance Summary++| Metric | Strategy | Benchmark (CSI 300) | Excess |+|------|------|-------------|------|+| Cumulative return | +145.2% | +35.6% | +109.6% |+| Annualized return | 9.8% | 3.2% | +6.6% |+| Sharpe | 1.25 | 0.45 | - |+| Max drawdown | -18.5% | -32.4% | - |+| Calmar | 0.53 | 0.10 | - |+| Win rate | 58.3% | - | - |+| Trade count | 245 | - | - |++## Annual Performance++| Year | Return | Benchmark | Excess | Max Drawdown |+|------|------|------|------|---------|+| 2016 | +12.3% | -8.5% | +20.8% | -8.2% |+| ... | ... | ... | ... | ... |++## Risk Analysis+[Insert output from the `risk-analysis` skill]++## Improvement Suggestions+1. Specific suggestion 1...+2. Specific suggestion 2...++## Rating: Allocatable+Sharpe > 1.0 and max drawdown < 20%, indicating a good risk-reward profile.+```++## Analysis Framework++### Preparation Before Writing++1. **Clarify the report type**: stock / industry / strategy / backtest / flash note+2. **Collect data**: backtest results, fundamentals, industry data+3. **Determine the core view**: decide the conclusion first, then organize the supporting arguments+4. **Choose the rating**: based on quantitative metrics + qualitative judgment++### Writing Principles++1. **Put the conclusion first**: the summary should contain the most important views, without too much buildup+2. **Let data speak**: every view should have at least one supporting data point+3. **Keep logic clear**: because A (data) โ therefore B (judgment) โ recommendation C (action)+4. **Argue both sides**: even in bullish reports, discuss risks; even in bearish reports, mention possible catalysts+5. **Be actionable**: recommendations should specify instruments / position sizing / time frame++## Output Format++Output the complete Markdown research report directly, following the template structure above. Ensure that:+- it has a clear rating+- it is supported by quantitative data+- it includes at least 3 risk warnings+- it contains concrete action recommendations+- it ends with a disclaimer++## Notes++1. **Do not make overly precise forecasts**: use ranges rather than single points (`target price 25-30 RMB` instead of `target price 27.5 RMB`)+2. **Data consistency**: all quoted numbers must be consistent throughout the report and never contradict each other+3. **Mark timeliness**: state both the data cut-off date and the report generation date+4. **Disclaimer is mandatory**: AI-generated reports must explicitly state that they are not investment advice+5. **Avoid absolutes**: "likely" is better than "certain", and "may" is better than "will"+6. **China A-share specific risks**: policy risk / delisting risk / goodwill impairment / major-shareholder selling / lock-up expiry+7. **Crypto-specific risks**: regulation / smart-contract exploits / liquidity risk / rug pullsdiff --git a/agent/src/skills/risk-analysis/SKILL.md b/agent/src/skills/risk-analysis/SKILL.mdnew file mode 100644index 000000000..44cfad65d--- /dev/null+++ b/agent/src/skills/risk-analysis/SKILL.md@@ -0,0 +1,313 @@+---+name: risk-analysis+description: Risk measurement and stress testing โ VaR/CVaR/max drawdown calculation, Monte Carlo simulation, extreme-value tail-risk analysis, and historical scenario stress testing.+---++# Risk Measurement and Stress Testing++## Overview++Systematic risk-measurement methodology covering VaR/CVaR calculation, Monte Carlo simulation, stress-test design, and tail-risk analysis. It provides risk evaluation for backtest results and risk-control constraints for asset allocation.++## Risk Measurement Methods++### 1. VaR (Value at Risk)++**Definition**: the maximum expected loss over a given horizon at a specified confidence level.++#### Three Calculation Methods++| Method | Formula / Steps | Advantages | Disadvantages |+|------|----------|------|------|+| Historical simulation | Sort historical returns and take the quantile | No distribution assumption | Depends on historical samples |+| Parametric (normal) | `VaR = ฮผ - z_ฮฑ ร ฯ` | Easy to compute | Assumes a normal distribution |+| Monte Carlo | Simulate N paths and take the quantile | Flexible | Computationally intensive |++#### Historical Simulation Implementation++```python+import numpy as np+import pandas as pd++def historical_var(returns: pd.Series, confidence: float = 0.95, horizon: int = 1) -> float:+ """+ Args:+ returns: Daily return series+ confidence: Confidence level, commonly 0.95 or 0.99+ horizon: Holding period in days, default 1+ Returns:+ VaR value (positive means loss)+ """+ sorted_returns = returns.sort_values()+ index = int((1 - confidence) * len(sorted_returns))+ var_1d = -sorted_returns.iloc[index]+ return var_1d * np.sqrt(horizon) # square-root-of-time rule+```++#### Parametric Implementation++```python+from scipy.stats import norm++def parametric_var(returns: pd.Series, confidence: float = 0.95, horizon: int = 1) -> float:+ mu = returns.mean()+ sigma = returns.std()+ z = norm.ppf(1 - confidence)+ var_1d = -(mu + z * sigma)+ return var_1d * np.sqrt(horizon)+```++### 2. CVaR / ES (Conditional VaR / Expected Shortfall)++**Definition**: the average loss beyond the VaR threshold, more conservative than VaR.++```python+def historical_cvar(returns: pd.Series, confidence: float = 0.95) -> float:+ """CVaR = the mean of all losses beyond VaR."""+ var = historical_var(returns, confidence)+ tail_losses = returns[returns < -var]+ return -tail_losses.mean() if len(tail_losses) > 0 else var+```++**VaR vs CVaR comparison**:++| Metric | VaR(95%) | CVaR(95%) | Meaning |+|------|----------|-----------|------|+| Typical value | -2.1% | -3.4% | CVaR is usually 1.3-1.8x VaR |+| Subadditivity | Not satisfied | Satisfied | CVaR can be used for portfolio risk decomposition |+| Regulation | Basel II | Basel III | Regulatory trend is shifting toward CVaR |++### 3. Maximum Drawdown Analysis++```python+def max_drawdown_analysis(equity: pd.Series) -> dict:+ """+ Args:+ equity: Net-value series+ Returns:+ dict: max_drawdown, peak_date, trough_date, recovery_date, duration+ """+ peak = equity.cummax()+ drawdown = (equity - peak) / peak+ max_dd = drawdown.min()+ trough_idx = drawdown.idxmin()+ peak_idx = equity[:trough_idx].idxmax()++ # Recovery date+ recovery = equity[trough_idx:][equity[trough_idx:] >= equity[peak_idx]]+ recovery_date = recovery.index[0] if len(recovery) > 0 else None++ return {+ 'max_drawdown': max_dd,+ 'peak_date': peak_idx,+ 'trough_date': trough_idx,+ 'recovery_date': recovery_date,+ 'underwater_days': (trough_idx - peak_idx).days,+ 'recovery_days': (recovery_date - trough_idx).days if recovery_date else None+ }+```++### 4. Monte Carlo Simulation++#### Geometric Brownian Motion (GBM)++```python+def monte_carlo_gbm(S0: float, mu: float, sigma: float,+ T: int = 252, n_paths: int = 10000) -> np.ndarray:+ """+ Args:+ S0: Initial price+ mu: Annualized return+ sigma: Annualized volatility+ T: Number of simulation days+ n_paths: Number of paths+ Returns:+ Price matrix of shape (n_paths, T)+ """+ dt = 1 / 252+ Z = np.random.standard_normal((n_paths, T))+ log_returns = (mu - 0.5 * sigma**2) * dt + sigma * np.sqrt(dt) * Z+ prices = S0 * np.exp(np.cumsum(log_returns, axis=1))+ return prices+```++#### Simulation Result Analysis++```python+def analyze_mc_results(paths: np.ndarray, confidence: float = 0.95) -> dict:+ final_prices = paths[:, -1]+ returns = final_prices / paths[:, 0] - 1++ return {+ 'mean_return': np.mean(returns),+ 'median_return': np.median(returns),+ 'std_return': np.std(returns),+ 'var': -np.percentile(returns, (1 - confidence) * 100),+ 'cvar': -np.mean(returns[returns < -np.percentile(returns, (1-confidence)*100)]),+ 'prob_loss': np.mean(returns < 0),+ 'worst_5pct': np.percentile(returns, 5),+ 'best_5pct': np.percentile(returns, 95),+ }+```++## Stress-Testing Framework++### Historical Scenario Stress Tests++| Scenario | Period | China A-share Drawdown | US Equity Drawdown | BTC Drawdown | 10Y Government Bonds |+|------|--------|---------|---------|---------|---------|+| 2008 financial crisis | 2008.01-2008.10 | -65% | -50% | N/A | yield โ 100bp |+| 2015 China equity crash | 2015.06-2015.08 | -45% | -10% | -20% | yield โ 50bp |+| 2018 trade war | 2018.01-2018.12 | -25% | -20% | -80% | yield โ 30bp |+| 2020 COVID shock | 2020.01-2020.03 | -15% | -35% | -50% | yield โ 80bp |+| 2022 hiking cycle | 2022.01-2022.10 | -20% | -25% | -65% | yield โ 200bp |++### Hypothetical Scenario Design++```python+STRESS_SCENARIOS = {+ 'rate_shock_up_100bp': {+ 'equity': -0.10, # equities down 10%+ 'bond_10y': -0.08, # 10-year bonds down 8%+ 'bond_2y': -0.02, # short bonds down 2%+ 'gold': +0.05, # gold up 5%+ 'btc': -0.15, # BTC down 15%+ },+ 'credit_crisis': {+ 'equity': -0.25,+ 'bond_10y': +0.05, # government bonds act as a safe haven+ 'credit_bond': -0.15,+ 'gold': +0.10,+ 'btc': -0.30,+ },+ 'liquidity_dry_up': {+ 'equity': -0.20,+ 'bond_10y': -0.05, # when liquidity is poor, everything falls+ 'gold': -0.05,+ 'btc': -0.40,+ 'cash': 0.0,+ },+ 'geopolitical_conflict': {+ 'equity': -0.15,+ 'bond_10y': +0.03,+ 'gold': +0.15,+ 'oil': +0.30,+ 'btc': -0.20,+ },+}+```++### Stress-Test Implementation Steps++1. **Select a scenario**: either historical or hypothetical+2. **Apply shocks**: multiply scenario shocks by the current positions+3. **Compute portfolio loss**: `portfolio_loss = ฮฃ(weight_i ร shock_i ร position_i)`+4. **Assess adequacy**: compare loss vs risk budget and whether stop-loss thresholds are triggered++## Tail-Risk Analysis (Extreme Value Theory, EVT)++### POT Method (Peaks Over Threshold)++```python+from scipy.stats import genpareto++def fit_gpd_tail(returns: pd.Series, threshold_pct: float = 5.0) -> dict:+ """+ Fit the tail with a generalized Pareto distribution.+ Args:+ returns: Daily returns+ threshold_pct: Threshold percentile (take the worst X%)+ """+ threshold = np.percentile(returns, threshold_pct)+ exceedances = threshold - returns[returns < threshold] # make positive++ # Fit GPD+ shape, loc, scale = genpareto.fit(exceedances)++ return {+ 'threshold': threshold,+ 'n_exceedances': len(exceedances),+ 'shape_xi': shape, # ฮพ>0 fat tail, ฮพ=0 exponential tail, ฮพ<0 bounded tail+ 'scale_sigma': scale,+ 'tail_type': 'fat tail (dangerous)' if shape > 0 else 'thin tail (safer)',+ }+```++### Tail-Risk Metrics++| Metric | Calculation | Meaning |+|------|------|------|+| Kurtosis | `returns.kurtosis()` | >3 indicates fat tails; China A-shares are often in the 4-8 range |+| Skewness | `returns.skew()` | <0 means left-skewed (large drops are more common than large rallies) |+| Tail ratio | worst 5% / best 5% | >1 means larger downside risk |+| Hill estimator | Tail index | `ฮฑ<2` implies extremely fat tails |++## Analysis Framework++### Input Requirements++```+Required:+- Return series (daily or higher frequency) or net-value series+- Portfolio weights (if it is a portfolio)++Optional:+- Benchmark returns (for relative risk analysis)+- Risk budget / constraint settings+```++### Analysis Steps++1. **Data preprocessing**: compute returns, check missing values, and handle outliers+2. **Descriptive statistics**: mean / volatility / skewness / kurtosis / maximum drawdown+3. **VaR/CVaR calculation**: compare three methods at both 95% and 99% confidence levels+4. **Monte Carlo simulation**: 10,000 paths, output distribution statistics and VaR+5. **Stress testing**: at least 3 historical scenarios + 2 hypothetical scenarios+6. **Tail analysis**: fit GPD and determine tail type+7. **Risk-control recommendations**: provide concrete recommendations based on the results++## Output Format++```markdown+## Risk Analysis Report++### Core Risk Metrics+| Metric | Value |+|------|-----|+| Daily volatility | 1.85% |+| Annualized volatility | 29.3% |+| Maximum drawdown | -32.5% (2024.09.15 โ 2024.11.20) |+| VaR(95%, 1D) | -2.8% |+| CVaR(95%, 1D) | -4.2% |+| Skewness | -0.45 |+| Kurtosis | 5.2 (fat tail) |++### Stress-Test Results+| Scenario | Portfolio Loss | Stop Triggered |+|------|---------|----------|+| 2020 COVID replay | -18.5% | No |+| Rates +100bp | -12.3% | No |+| Liquidity dry-up | -28.7% | Yes |++### Monte Carlo Simulation (252 days, 10000 paths)+| Statistic | Value |+|------|-----|+| Expected return | +8.2% |+| Loss probability | 35% |+| Worst 5% scenario | -22.4% |++### Risk-Control Recommendations+1. Recommend setting a portfolio stop-loss at -15%+2. Tail risk is elevated; consider allocating 5% to gold as a hedge+3. Correlations rise in stressed markets, so diversification benefits will be discounted+```++## Notes++1. **VaR is not the maximum loss**: VaR only says "with 95% probability, losses will not exceed X"; the remaining 5% can be far worse+2. **Normality assumption is dangerous**: financial returns are almost always fat-tailed, so parametric VaR underestimates risk+3. **History does not equal the future**: historical simulation fails when structural breaks occur (for example, the first negative oil price)+4. **Correlation is unstable**: correlation matrices observed in normal markets can collapse in crises (correlations trend toward 1)+5. **Monte Carlo seed**: set a random seed for reproducibility, and use at least 10,000 paths for stability+6. **Holding-period scaling**: the square-root-of-time rule only applies under i.i.d. returns; it becomes inaccurate under autocorrelation+7. **Risk in backtests**: `metrics.csv` already includes `max_drawdown` and `sharpe`; this skill provides deeper analysisdiff --git a/agent/src/skills/seasonal/SKILL.md b/agent/src/skills/seasonal/SKILL.mdnew file mode 100644index 000000000..e5815fcc9--- /dev/null+++ b/agent/src/skills/seasonal/SKILL.md@@ -0,0 +1,63 @@+---+name: seasonal+description: Seasonal/calendar-effect strategy. Generates trading signals from time-based patterns such as month-of-year effects and day-of-week effects. Suitable for any OHLCV data.+---+# Seasonal / Calendar Effect Strategy++## Purpose++Uses time-based regularities in financial markets (month effects, day-of-week effects, and similar patterns) to generate trading signals. Examples include the China A-share "spring rally" (January-March) and the "sell in May" effect.++## Signal Logic++### Month Effect (Default)++- Specified bullish months โ go long+- Specified bearish months โ go short / stay out+- All other months โ stay flat++### Day-of-Week Effect (Optional Overlay)++- Monday / Friday effects+- Start-of-month / end-of-month effects++### Combined Mode++Month signal ร weekday signal; open a position only when both confirm.++## Common Calendar Effects Reference++| Effect | Description | Reference Configuration |+|------|------|---------|+| Spring rally | Higher probability of gains in China A-shares from January to March | bullish_months=[1,2,3] |+| Sell in May | Weaker performance from May to October | bearish_months=[5,6,7,8,9,10] |+| Year-end effect | Institutional rebalancing in December | bullish_months=[11,12] |+| Monday effect | Lower returns on Mondays | bearish_weekdays=[0] |+| Friday effect | Higher returns on Fridays | bullish_weekdays=[4] |++## Parameters++| Parameter | Default | Description |+|------|--------|------|+| bullish_months | [1, 2, 3, 11, 12] | Bullish months |+| bearish_months | [5, 6, 7, 8, 9] | Bearish months |+| use_weekday | False | Whether to enable weekday effects |+| bullish_weekdays | [4] | Bullish weekdays (0=Monday, 4=Friday) |+| bearish_weekdays | [0] | Bearish weekdays |++## Common Pitfalls++- `pd.DatetimeIndex.month` starts from 1 (1=January)+- `pd.DatetimeIndex.weekday` starts from 0 (0=Monday, 4=Friday)+- Seasonal strategies are statistical regularities, not deterministic signals, so pay attention to sample size in backtests+- Neutral months (neither in `bullish` nor `bearish`) should output 0 and must not be skipped++## Dependencies++```bash+pip install pandas numpy+```++## Signal Convention++- `1` = long (bullish window), `-1` = short (bearish window), `0` = stand asidediff --git a/agent/src/skills/seasonal/example_signal_engine.py b/agent/src/skills/seasonal/example_signal_engine.pynew file mode 100644index 000000000..c80b86bfe--- /dev/null+++ b/agent/src/skills/seasonal/example_signal_engine.py@@ -0,0 +1,145 @@+"""ๅญฃ่ๆง/ๆฅๅๆๅบ็ญ็ฅไฟกๅทๅผๆใ++ๅบไบๆไปฝๆๅบใๅจๅ ๆๅบ็ญๆถ้ด่งๅพ็ๆไบคๆไฟกๅทใ+็บฏ pandas ๅฎ็ฐ๏ผ้็จไบไปปไฝ OHLCV ๆฐๆฎใ+"""++from typing import Dict, List++import numpy as np+import pandas as pd+++class SignalEngine:+ """ๅญฃ่ๆงๆฅๅๆๅบไฟกๅทๅผๆใ++ ๆ นๆฎๆไปฝๅๅจๅ ๆๅบ็ๆๅๅค/ๅ็ฉบไฟกๅทใ++ Attributes:+ bullish_months: ็ๅคๆไปฝๅ่กจใ+ bearish_months: ็็ฉบๆไปฝๅ่กจใ+ use_weekday: ๆฏๅฆๅฏ็จๅจๅ ๆๅบใ+ bullish_weekdays: ็ๅคๆๆๅ่กจใ+ bearish_weekdays: ็็ฉบๆๆๅ่กจใ++ Example:+ >>> engine = SignalEngine(bullish_months=[1, 2, 3], bearish_months=[5, 6, 7, 8, 9])+ >>> signals = engine.generate({"000001.SZ": df})+ """++ def __init__(+ self,+ bullish_months: List[int] = None,+ bearish_months: List[int] = None,+ use_weekday: bool = False,+ bullish_weekdays: List[int] = None,+ bearish_weekdays: List[int] = None,+ ):+ """ๅๅงๅๅญฃ่ๆงๅผๆใ++ Args:+ bullish_months: ็ๅคๆไปฝ๏ผ1-12๏ผ๏ผ้ป่ฎค [1,2,3,11,12]ใ+ bearish_months: ็็ฉบๆไปฝ๏ผ1-12๏ผ๏ผ้ป่ฎค [5,6,7,8,9]ใ+ use_weekday: ๆฏๅฆๅฏ็จๅจๅ ๆๅบใ+ bullish_weekdays: ็ๅคๆๆ๏ผ0=ๅจไธ, 4=ๅจไบ๏ผ๏ผ้ป่ฎค [4]ใ+ bearish_weekdays: ็็ฉบๆๆ๏ผ้ป่ฎค [0]ใ+ """+ self.bullish_months = bullish_months or [1, 2, 3, 11, 12]+ self.bearish_months = bearish_months or [5, 6, 7, 8, 9]+ self.use_weekday = use_weekday+ self.bullish_weekdays = bullish_weekdays or [4]+ self.bearish_weekdays = bearish_weekdays or [0]++ def generate(self, data_map: Dict[str, pd.DataFrame]) -> Dict[str, pd.Series]:+ """ๆ นๆฎๆฅๅๆๅบ็ๆไบคๆไฟกๅทใ++ Args:+ data_map: ๆ ็ไปฃ็ ๅฐ OHLCV DataFrame ็ๆ ๅฐใ++ Returns:+ ๆ ็ไปฃ็ ๅฐไฟกๅท Series ็ๆ ๅฐ๏ผ1=ๅๅค, -1=ๅ็ฉบ, 0=่งๆ๏ผใ+ """+ result = {}+ for code, df in data_map.items():+ result[code] = self._generate_one(df)+ return result++ def _generate_one(self, df: pd.DataFrame) -> pd.Series:+ """ๅฏนๅไธชๆ ็็ๆๆฅๅไฟกๅทใ++ Args:+ df: OHLCV DataFrame๏ผindex ไธบ DatetimeIndexใ++ Returns:+ ไฟกๅท Seriesใ+ """+ idx = df.index+ month = idx.month+ signal = pd.Series(0, index=idx)++ # ๆไปฝๆๅบ+ signal[month.isin(self.bullish_months)] = 1+ signal[month.isin(self.bearish_months)] = -1++ # ๅจๅ ๆๅบ๏ผๅ ๅ ๆจกๅผ๏ผๅ้็กฎ่ฎค๏ผ+ if self.use_weekday:+ weekday = idx.weekday+ weekday_signal = pd.Series(0, index=idx)+ weekday_signal[weekday.isin(self.bullish_weekdays)] = 1+ weekday_signal[weekday.isin(self.bearish_weekdays)] = -1++ # ๅ้็กฎ่ฎค๏ผๆไปฝๅๅจๅ ๆนๅไธ่ดๆถๆๆไฟกๅท+ combined = signal + weekday_signal+ signal = pd.Series(0, index=idx)+ signal[combined >= 2] = 1 # ๆไปฝ็ๅค + ๅจๅ ็ๅค+ signal[combined <= -2] = -1 # ๆไปฝ็็ฉบ + ๅจๅ ็็ฉบ++ return signal.fillna(0).astype(int)+++if __name__ == "__main__":+ import requests++ def _fetch_okx(inst_id: str, bar: str = "1D", limit: int = 300) -> pd.DataFrame:+ """ไป OKX API ่ทๅ K ็บฟๆฐๆฎใ++ Args:+ inst_id: ไบคๆๅฏนๆ ่ฏ๏ผๅฆ "BTC-USDT"ใ+ bar: K ็บฟๅจๆใ+ limit: ่ทๅๆ นๆฐใ++ Returns:+ OHLCV DataFrameใ+ """+ resp = requests.get(+ "https://www.okx.com/api/v5/market/candles",+ params={"instId": inst_id, "bar": bar, "limit": str(limit)},+ )+ candles = resp.json()["data"]+ columns = ["ts", "open", "high", "low", "close", "vol", "volCcy", "volCcyQuote", "confirm"]+ df = pd.DataFrame(reversed(candles), columns=columns)+ df["ts"] = pd.to_datetime(df["ts"].astype("int64"), unit="ms")+ df = df.set_index("ts")+ for col in ["open", "high", "low", "close"]:+ df[col] = df[col].astype(float)+ df["volume"] = df["vol"].astype(float)+ return df++ symbols = ["BTC-USDT", "ETH-USDT"]+ data_map = {}+ for sym in symbols:+ print(f"Fetching {sym} ...")+ data_map[sym] = _fetch_okx(sym, bar="1D", limit=300)++ engine = SignalEngine(+ bullish_months=[1, 2, 3, 10, 11, 12],+ bearish_months=[5, 6, 7, 8, 9],+ )+ signals = engine.generate(data_map)++ for sym in symbols:+ sig = signals[sym]+ print(f"\n{sym} ({len(sig)} bars)")+ print(f" Bullish days: {(sig == 1).sum()}")+ print(f" Bearish days: {(sig == -1).sum()}")+ print(f" Neutral days: {(sig == 0).sum()}")diff --git a/agent/src/skills/sector-rotation/SKILL.md b/agent/src/skills/sector-rotation/SKILL.mdnew file mode 100644index 000000000..0dca80da2--- /dev/null+++ b/agent/src/skills/sector-rotation/SKILL.md@@ -0,0 +1,191 @@+---+name: sector-rotation+description: ่กไธ่ฝฎๅจๅๆโโ็ณไธ่กไธๆฏๆฐๅบฆ่ฏๅใ่กไธๅจ้ๆๅใไบงไธ้พไผ ๅฏผใไผฐๅผ/็ๅฉ/่ต้ๆตๅค็ปดๆฏ่พๆกๆถ+---++# ่กไธ่ฝฎๅจๅๆ++## ๆฆ่ฟฐ++ๅบไบA่ก็ณไธ่กไธๅ็ฑปไฝ็ณป๏ผ้่ฟๆฏๆฐๅบฆ่ฏๅใๅจ้ๆๅใไผฐๅผๆฏ่พใ่ต้ๆตๅๅไธช็ปดๅบฆ่ฟ่ก่กไธ่ฝฎๅจๅๆ๏ผ่พๅบ่กไธ่ถ ้ /ไฝ้ ๅปบ่ฎฎใ++## ็ณไธ่กไธๅ็ฑปไฝ็ณป++### ไธ็บง่กไธ๏ผ31ไธช๏ผ++| ๅคง็ฑป | ่กไธ | ไปฃ็ ็คบไพ |+|------|------|---------|+| ไธๆธธๅจๆ | ็ ค็ญใๆ่ฒใ็ณๆฒน็ณๅใ้ข้ใๅบ็กๅๅทฅ | ็ ค็ญETF: 515220 |+| ไธญๆธธๅถ้ | ็ตๅ่ฎพๅคใๆบๆขฐ่ฎพๅคใๅฝ้ฒๅๅทฅใๆฑฝ่ฝฆ | ๆฐ่ฝๆบETF: 516160 |+| ไธๆธธๆถ่ดน | ้ฃๅ้ฅฎๆใๅฎถ็จ็ตๅจใๅป่ฏ็็ฉใ็พๅฎนๆค็ | ๆถ่ดนETF: 510150 |+| TMT | ็ตๅญใ่ฎก็ฎๆบใ้ไฟกใไผ ๅช | ็งๆETF: 515000 |+| ้่ๅฐไบง | ้ถ่กใ้้ถ้่ใๆฟๅฐไบง | ้่ETF: 510230 |+| ๅ ฌ็จไบไธ | ๅ ฌ็จไบไธใไบค้่ฟ่พใ็ฏไฟ | ็บขๅฉETF: 510880 |++### ่กไธๅจๆๅฑๆง++| ็ฑปๅ | ่กไธ | ็นๅพ | ้ฉฑๅจๅ ๅญ |+|------|------|------|---------|+| ๅผบๅจๆ | ็ ค็ญ/ๆ่ฒ/้ข้/ๅๅทฅ | ็ๅฉๆณขๅจๅคง๏ผ่ทๅฎ่ง็ดงๅฏ | PPIใPMIใๅๅไปทๆ ผ |+| ๅผฑๅจๆ | ้ฃๅ้ฅฎๆ/ๅป่ฏ/ๅ ฌ็จ | ็ๅฉ็จณๅฎ๏ผ้ฒๅพกๅฑๆง | CPIใๆถ่ดนๆฐๆฎ |+| ๆ้ฟๅ | ็ตๅญ/่ฎก็ฎๆบ/็ตๅ่ฎพๅค | ้ซPE้ซๅข้๏ผๆฟ็ญๆๆ | ไบงไธๆฟ็ญใๆธ้็ |+| ้่ | ้ถ่ก/้้ถ/ไฟ้ฉ | ๅฉๅทฎ้ฉฑๅจ๏ผไธๅฉ็ๆญฃ็ธๅ ณ | ๅฉ็ใ็คพ่ใไฟก่ดท |++## ๆฏๆฐๅบฆ่ฏๅๆกๆถ++### ่ฏๅ็ปดๅบฆ๏ผๆปกๅ100๏ผ++| ็ปดๅบฆ | ๆ้ | ๆๆ | ่ฏๅ่งๅ |+|------|------|------|---------|+| ็ๅฉๅข้ | 30% | ๅๅฉๆถฆๅๆฏๅข้ | >30%=30ๅ, 15-30%=22ๅ, 0-15%=15ๅ, <0%=5ๅ |+| ็ๅฉ่ถๅฟ | 20% | ่ฟ็ปญNๅญฃๅ ้ | ๅ ้3ๅญฃ+=20ๅ, 2ๅญฃ=14ๅ, ๅ้=-5ๅ |+| ๆฏๆฐๆๆ | 20% | PMI/ๅผๅทฅ็/ไปทๆ ผ | ้ซไฝ+ไธ่ก=20ๅ, ้ซไฝๅ่ฝ=12ๅ, ไฝไฝ=5ๅ |+| ๆฟ็ญๆฏๆ | 15% | ไบงไธๆฟ็ญๅๅบฆ | ๆ็กฎๅฉๅฅฝ=15ๅ, ไธญๆง=8ๅ, ๅฉ็ฉบ=2ๅ |+| ไผฐๅผๅฎๅ จ | 15% | PEๅๅฒๅไฝ | <30%ๅไฝ=15ๅ, 30-50%=10ๅ, >70%=3ๅ |++### ๆฏๆฐๅบฆๅๅไฟกๅท++```+ๆฏๆฐๅบฆไธ่กไฟกๅท๏ผ่ถ ้ ๏ผ:+1. ่กไธPMI่ฟ็ปญ2ไธชๆ>50ไธ็ฏๆฏๆนๅ+2. ้พๅคดๅ ฌๅธ่ฎขๅ/ๆถๅ ฅๅๆฏๅ ้+3. ไบงๅไปทๆ ผไธ่ก๏ผๆถจไปทๅจๆ๏ผ+4. ไบง่ฝๅฉ็จ็>80%ไธๅจๆๅ+5. ๆฟ็ญๅฌๅ๏ผ่กฅ่ดด/ๅๅ ฅ/ๅฝไบงๆฟไปฃ๏ผ++ๆฏๆฐๅบฆไธ่กไฟกๅท๏ผไฝ้ ๏ผ:+1. ่กไธPMI่ฟ็ปญ2ไธชๆ<50+2. ๅญ่ดงๅจ่ฝฌๅคฉๆฐไธๅ๏ผๅบๅญ็งฏๅ๏ผ+3. ไบงๅไปทๆ ผไธ่ก+4. ไบง่ฝ่ฟๅฉ๏ผๅฉ็จ็<60%๏ผ+5. ๆฟ็ญๆถ็ดง๏ผ็ฏไฟ/ๅๅๆญ/้้๏ผ+```++## ่กไธๅจ้ๆๅๆนๆณ++### ไปทๆ ผๅจ้++```python+def sector_momentum(sector_returns: pd.DataFrame, lookback: int = 60, skip: int = 5) -> pd.Series:+ """+ Args:+ sector_returns: ่กไธๆฅๆถ็็๏ผcolumns=่กไธๅ+ lookback: ๅ็็ชๅฃ๏ผไบคๆๆฅ๏ผ+ skip: ่ทณ่ฟๆ่ฟNๅคฉ๏ผ้ฟๅ ็ญๆๅ่ฝฌ๏ผ+ Returns:+ ่กไธๅจ้ๅพๅๆๅ+ """+ cum_return = (1 + sector_returns).rolling(lookback).apply(lambda x: x[:-skip].prod() - 1)+ return cum_return.iloc[-1].rank(ascending=False)+```++### ็ๅฉๅจ้++```+็ๅฉๅจ้ = ๅฝๅญฃROEๅๆฏๅๅ - ไธๅญฃROEๅๆฏๅๅ+ๆญฃๅผ = ็ๅฉๅ ้๏ผ่ถ ้ ไฟกๅท๏ผ+่ดๅผ = ็ๅฉๅ้๏ผๅ้ ไฟกๅท๏ผ+```++### ็ปผๅๅจ้ๆๅ++```+็ปผๅๅพๅ = 0.4 ร ไปทๆ ผๅจ้ๆๅ + 0.3 ร ็ๅฉๅจ้ๆๅ + 0.3 ร ่ต้ๆตๆๅ+ๅ Top 5 ่กไธ่ถ ้ ๏ผBottom 5 ่กไธไฝ้ +```++## ไบงไธ้พไธไธๆธธไผ ๅฏผ++### ๅ ธๅไผ ๅฏผ้พๆก++```+ไธๆธธ๏ผๅๆๆ๏ผโ ไธญๆธธ๏ผๅถ้ ๅ ๅทฅ๏ผโ ไธๆธธ๏ผๆถ่ดน/ๅบ็จ๏ผ++็คบไพ1: ้็ตไบงไธ้พ+ ็ขณ้ ธ้๏ผไธๆธธ๏ผโ ๆญฃๆๆๆ๏ผไธญๆธธ๏ผโ ็ตๆฑ ๏ผไธญๆธธ๏ผโ ๆฐ่ฝๆบ่ฝฆ๏ผไธๆธธ๏ผ+ ไผ ๅฏผ๏ผ้ไปทโ โ ๆญฃๆๆๆฌโ โ ็ตๆฑ ไปทๆ ผโ โ ่ฝฆไผๆฏๅฉ็โ++็คบไพ2: ๅๅฏผไฝไบงไธ้พ+ ่ฎพๅค/ๆๆ๏ผไธๆธธ๏ผโ ๆถๅๅถ้ ๏ผไธญๆธธ๏ผโ ๅฐๆต๏ผไธญๆธธ๏ผโ ๆถ่ดน็ตๅญ๏ผไธๆธธ๏ผ+ ไผ ๅฏผ๏ผๆๆบ้ๆฑโ โ ๅฐๆต่ฎขๅโ โ ๆถๅไบง่ฝ็ดง โ ่ฎพๅค่ตๆฌๅผๆฏโ++็คบไพ3: ๅฐไบงไบงไธ้พ+ ๅๅฐ/่่ต๏ผไธๆธธ๏ผโ ๅผๅๅปบ่ฎพ๏ผไธญๆธธ๏ผโ ้ๅฎ/็ฉไธ๏ผไธๆธธ๏ผ+ ไผ ๅฏผ๏ผๆฟ็ญๅฎฝๆพ โ ้ๅฎๅๆ(ไธๆธธๅ ) โ ๆฐๅผๅทฅโ(ไธญๆธธ) โ ๆฟๅฐโ(ไธๆธธ)+```++### ไผ ๅฏผ่งๅพ++| ่งๅพ | ่ฏดๆ | ๆ่ตๅซไน |+|------|------|---------|+| ้ๆฑ้ฉฑๅจ่ชไธ่ไธ | ไธๆธธ้ๆฑ โ ไธญๆธธ่ฎขๅ โ ไธๆธธๅๆๆ | ้ๆฑๆ็น็ไธๆธธๅ ๅจ |+| ๆๆฌไผ ๅฏผ่ชไธ่ไธ | ไธๆธธๆถจไปท โ ไธญๆธธๆๆฌ โ ไธๆธธๆไปท | ไธๆธธๆถจไปทๅฉๅฅฝไธๆธธ๏ผๅฉ็ฉบไธญๆธธ |+| ๅบๅญๅจๆไผ ๅฏผ | ไธปๅจ่กฅๅบโ่ขซๅจ่กฅๅบโไธปๅจๅปๅบโ่ขซๅจๅปๅบ | ่ขซๅจๅปๅบๆฏไนฐๅ ฅ็น |+| ้ขๅ ๆปๅ | ไธๆธธ้ขๅ ไธญๆธธ1-2ๅญฃๅบฆ๏ผไธญๆธธ้ขๅ ไธๆธธ1-2ๅญฃๅบฆ | ๆๅๅธๅฑไธไธ็ฏ่ |++## ่กไธๆฏ่พๆกๆถ++### ไผฐๅผๆฏ่พ++| ๆๆ | ็จ้ | ๆณจๆไบ้กน |+|------|------|---------|+| PE(TTM) | ็ๅฉไผฐๅผ | ๅจๆ่กPEๅคฑ็๏ผไฝPEๅฏ่ฝๆฏ้กถ๏ผ |+| PB | ่ตไบงไผฐๅผ | ้ถ่ก/ๅฐไบง/ๅจๆ่ก็จPBๆดๅ็ |+| PEๅๅฒๅไฝ | ไผฐๅผไฝ็ฝฎ | ็5ๅนดๅไฝๆฐ |+| PEG | ๆ้ฟไผฐๅผ | <1ไธบไฝไผฐ๏ผ>2ไธบ้ซไผฐ |+| ่กๆฏ็ | ๆถ็็ | ้ซ่กๆฏ=้ฒๅพก้ ็ฝฎ |++### ็ๅฉๆฏ่พ++| ๆๆ | ๅซไน |+|------|------|+| ROE | ็ๅฉ่ฝๅ |+| ROEๅๅ | ็ๅฉ่ถๅฟ |+| ๆฏๅฉ็ | ็ซไบๆ ผๅฑ |+| ๅๅฉๆถฆๅข้ | ๆ้ฟๆง |+| ็ฐ้ๆต/ๅๅฉๆถฆ | ็ๅฉ่ดจ้ |++### ่ต้ๆตๆฏ่พ++| ๆๆ | ๆฐๆฎๆบ | ไฟกๅท |+|------|--------|------|+| ๅๅ่ต้ๅๆตๅ ฅ | ๆฒชๆทฑๆธฏ้ | ๅค่ตๅๅฅฝ๏ผ้ขๅ 1-3ไธชๆ |+| ่่ตไฝ้ขๅๅ | ่่ต่ๅธ | ๆ ๆ่ต้ๆนๅ |+| ETFๅ็ณ่ดญ | ๅบ้ๆฐๆฎ | ๆบๆ้ ็ฝฎๆนๅ |+| ๅคงๅฎไบคๆ | ไบคๆๆ | ๆบๆ่ฐไปไฟกๅท |++## ่พๅบๆ ผๅผ++```markdown+## ่กไธ่ฝฎๅจๅๆ++### ๆฏๆฐๅบฆๆๅ Top 10+| ๆๅ | ่กไธ | ๆฏๆฐๅบฆ | ๅๅ | ๆ ธๅฟ้ป่พ |+|------|------|--------|------|---------|+| 1 | ็ตๅญ | 85 | โ+8 | AI็ฎๅ้ๆฑ็ๅ |+| 2 | ๆฑฝ่ฝฆ | 80 | โ+5 | ๅบๅฃ+ๆฐ่ฝๆบๅ่ฝฎ้ฉฑๅจ |+| ... | ... | ... | ... | ... |++### ่กไธ้ ็ฝฎๅปบ่ฎฎ+| ้ ็ฝฎ | ่กไธ | ๆ้ๅปบ่ฎฎ | ๆ ธๅฟ้ป่พ |+|------|------|---------|---------|+| ่ถ ้ | ็ตๅญใๆฑฝ่ฝฆใ้ไฟก | ๅ10-15% | ๆฏๆฐไธ่ก+ๆฟ็ญๅฌๅ |+| ๆ ้ | ้ฃๅ้ฅฎๆใๅป่ฏ | ๅ5-8% | ้ฒๅพกๅฑๆง๏ผไผฐๅผๅ็ |+| ไฝ้ | ๅฐไบงใๅปบๆ | ๅ0-3% | ๆฏๆฐไธ่ก๏ผๆฟ็ญๆๆๅพ ่งๅฏ |++### ไบงไธ้พๆบไผ+- **AIไบงไธ้พ**: ็ฎๅ(ไธๆธธ)โๆจกๅ(ไธญๆธธ)โๅบ็จ(ไธๆธธ)๏ผๅฝๅไธๆธธๆ็กฎๅฎ+- **ๆฐ่ฝๆบ่ฝฆ**: ็ขณ้ ธ้ไปทๆ ผ่งๅบ๏ผ็ตๆฑ ็ฏ่็ๅฉไฟฎๅค้ขๆ++### ้ฃ้ฉๆ็คบ+- ...+```++## ๆณจๆไบ้กน++1. **ๅจๆ่กไผฐๅผ้ท้ฑ**๏ผไฝPEๅฏ่ฝๆฏ็ๅฉ้กถ็น๏ผๅฆ2021ๅนด็ ค็ญPEไป 5xไฝๆฏ้กถ้จ๏ผ๏ผ็จPBๆดๅฎๅ จ+2. **ๆฟ็ญๅ้ๆ้ๅคง**๏ผA่ก่กไธ่ฝฎๅจๅๆฟ็ญ้ฉฑๅจๆๆพ๏ผ้้ใ็ขณไธญๅใAI๏ผ๏ผๆฟ็ญๆ็น>ๅบๆฌ้ขๆ็น+3. **ไธป้ขๆ่ตๅนฒๆฐ**๏ผ็ญๆไธป้ข็ไฝ๏ผๅฆAIๆฆๅฟต๏ผไผๆญๆฒ่กไธๅจ้ไฟกๅท๏ผๆณจๆๅบๅไธป้ข vs ๆฏๆฐ+4. **ๆฐๆฎๆปๅ**๏ผ่ดขๆฅๆฐๆฎๆปๅ1-2ไธชๆ๏ผ้ซ้ขๆฐๆฎ๏ผPMI/ๅผๅทฅ็/ไปทๆ ผ๏ผๆดๅๆถ+5. **่กไธETFๆฟไปฃ**๏ผๅปบ่ฎฎ็จ่กไธETFไปฃ็ ่้ไธช่กๅฎ็ฐ่กไธ้ ็ฝฎ๏ผ้ไฝไธช่ก้ฃ้ฉ+6. **่ฝฎๅจ้ข็**๏ผ่กไธ่ฝฎๅจไธๅฎๅคช้ข็น๏ผๆๅบฆ/ๅญฃๅบฆ่ฐไปไธบๅฎdiff --git a/agent/src/skills/sentiment-analysis/SKILL.md b/agent/src/skills/sentiment-analysis/SKILL.mdnew file mode 100644index 000000000..121491236--- /dev/null+++ b/agent/src/skills/sentiment-analysis/SKILL.md@@ -0,0 +1,272 @@+---+name: sentiment-analysis+description: ๅธๅบๆ ็ปชๅๆโโๆ่ดชๆๆฐ/Put-Call Ratio/่่ต่ๅธ/ๅๅ่ต้ไฟกๅท่งฃ่ฏปใ็คพไบคๅชไฝ่ๆ ้ๅๆกๆถ+---++# ๅธๅบๆ ็ปชๅๆ++## ๆฆ่ฟฐ++้ๅๅธๅบๆ ็ปช๏ผๅฐไธป่ง็"่ดชๅฉชไธๆๆง"่ฝฌๅไธบๅฏ่กก้็ๆๆ ใ่ฆ็ๆ่ดชๆๆฐใๆๆๆ ็ปชใๆ ๆ่ต้ใๅค่ตๆตๅๅ็คพไบค่ๆ ไบๅคง็ปดๅบฆใๆ ็ปชๆๆ ๅธธไฝไธบๅๅๆๆ ไฝฟ็จใ++## ๆ่ดชๆๆฐ++### ๅ ๅฏๆ่ดชๆๆฐ๏ผCrypto Fear & Greed Index๏ผ++```+ๅๅผ่ๅด: 0-100++| ๅๅผ | ๆ ็ปช็ถๆ | ๅๅฒไฟกๅท |+|------|---------|---------|+| 0-20 | ๆๅบฆๆๆง | ๅบ้จๅบๅ๏ผ้ๅไนฐๅ ฅ๏ผ|+| 20-40 | ๆๆง | ๅๅบ้จ |+| 40-60 | ไธญๆง | ่งๆ |+| 60-80 | ่ดชๅฉช | ๅ้กถ้จ |+| 80-100 | ๆๅบฆ่ดชๅฉช | ้กถ้จๅบๅ๏ผ้ๅๅๅบ๏ผ|++ๆๆๅ ๅญ:+- ๆณขๅจ็ (25%): BTC 30ๅคฉ/90ๅคฉๆณขๅจ็+- ๅธๅบๅจ้ (25%): BTCไปทๆ ผ vs MA(30/90)+- ็คพไบคๅชไฝ (15%): Twitter/Redditๆ ็ปช่ฏ้ข+- ่ฐๆฅ (15%): ๆ่ต่ ่ฐๆฅ+- ๆฏ็นๅธๅธๅ ็ (10%): BTC Dominance+- Google่ถๅฟ (10%): "Bitcoin"ๆ็ดข็ญๅบฆ+```++### A่กๆ่ดชๆๆ ++A่กๆฒกๆ็ปไธ็ๆ่ดชๆๆฐ๏ผ็จไปฅไธ็ปๅๆฟไปฃ๏ผ++| ๆๆ | ๆฐๆฎๆบ | ๆๅบฆๆๆง | ๆๅบฆ่ดชๅฉช |+|------|--------|---------|---------|+| ไธ่ฏๆขๆ็ | ไบคๆๆ | <0.5% | >2.5% |+| ๆถจๅๅฎถๆฐ/่ทๅๅฎถๆฐ | ่กๆ ๆฐๆฎ | <0.3 | >5.0 |+| ๆฐๅขๅผๆทๆฐ(ๅจ) | ไธญ็ป | <20ไธ | >100ไธ |+| ่่ตไฝ้ขๅๅ(ๆ) | ไบคๆๆ | ๅๆตๅบ>500ไบฟ | ๅๆตๅ ฅ>1000ไบฟ |+| ETFๅ็ณ่ดญ | ๅบ้ๆฐๆฎ | ๅฎฝๅบETFๅ็ณ่ดญ๏ผๆๅบ๏ผ| ๅ่ตๅ๏ผ่ทๅฉไบ็ป๏ผ|++### ๆ่ดชๆๆฐไฝฟ็จๆนๆณ++```+ๆ ธๅฟๅๅ: ๅซไบบๆๆงๆถ่ดชๅฉช๏ผๅซไบบ่ดชๅฉชๆถๆๆง++ๅฎๆ:+1. ๆๅบฆๆๆง๏ผ<20๏ผ: ๅๆนๅปบไปไฟกๅท+ - ไธ่ฆไธๆฌกๆงๅ จไป๏ผๅ3-5ๆน+ - ็กฎ่ฎคๆๅบๆฌ้ขๆฏๆ๏ผไธๆฏๆด้ทๅฏผ่ด็ๆๆง๏ผ++2. ๆๅบฆ่ดชๅฉช๏ผ>80๏ผ: ้ๆญฅๅไปไฟกๅท+ - ไธ่ฆๅ็ฉบ๏ผ่ถๅฟๅฏ่ฝๆ็ปญ๏ผ+ - ๅไปๅฐๅฎๅ จๆฐดไฝ๏ผๅฆไป80%ไปไฝ้ๅฐ50%๏ผ++3. ไธญๆงๅบ้ด: ๆ ็ปชๆๆ ๅคฑๆ๏ผ็ๅ ถไปๅ ็ด+```++## Put-Call Ratio++### ๅฎไนไธ่งฃ่ฏป++```+Put-Call Ratio = Putๆๆๆไบค้ / Callๆๆๆไบค้++| PCR | ๅซไน | ไฟกๅท๏ผๅๅๆๆ ๏ผ|+|-----|------|----------------|+| > 1.5 | ๆๅบฆ็็ฉบๆ ็ปช | ็ๅค๏ผๆๆง่ฟๅบฆ๏ผ|+| 1.0-1.5 | ๅ็ฉบ | ๅๅค |+| 0.7-1.0 | ไธญๆง | ๆ ๆ็กฎไฟกๅท |+| 0.5-0.7 | ๅๅค | ๅ็ฉบ |+| < 0.5 | ๆๅบฆ็ๅคๆ ็ปช | ็็ฉบ๏ผ่ดชๅฉช่ฟๅบฆ๏ผ|+```++### ไธๅๅธๅบPCRๅ่++| ๅธๅบ | ๆฐๆฎๆบ | ๆญฃๅธธ่ๅด | ๆ็ซฏๅบ้ด |+|------|--------|---------|---------|+| ็พ่ก๏ผCBOE๏ผ | VIXๆๆ | 0.7-1.2 | <0.5 ๆ >1.5 |+| A่ก๏ผไธ่ฏ50ETF๏ผ | ไธไบคๆ | 0.5-1.5 | <0.3 ๆ >2.0 |+| BTC๏ผDeribit๏ผ | Deribit | 0.3-0.8 | <0.2 ๆ >1.2 |++### PCRไธVIX้ ๅไฝฟ็จ++```+PCR้ซ + VIX้ซ = ๆๅบฆๆๆ ๏ผๅผบ็็ๅคๅ่ฝฌไฟกๅท๏ผ+PCRไฝ + VIXไฝ = ๆๅบฆ่ชๆปก๏ผ่ญฆๆ้ปๅคฉ้น ๏ผ+PCR้ซ + VIXไฝ = ๅฏนๅฒ้ๆฑ๏ผๆบๆๅจไฟๆคๅคๅคด๏ผ+PCRไฝ + VIX้ซ = ็็พไฟกๅท๏ผ้่ฆๆดๅค็กฎ่ฎค๏ผ+```++## ่่ต่ๅธไฟกๅท๏ผA่ก๏ผ++### ่่ตไฝ้ขๅๆ++```+่่ต = ๅ้ฑไนฐ่ก๏ผ็ๅคๆ ๆ๏ผ+่ๅธ = ๅ่กๅๅบ๏ผ็็ฉบๆ ๆ๏ผ++่่ตไฝ้ขๆๆ :+- ็ปๅฏนๅผ: ๅๆ ๆ ๆ่ต้ๆป้๏ผ2024ๅนด็บฆ1.5-1.8ไธไบฟ๏ผ+- ๅๅ็: ๅจ็ฏๆฏ/ๆ็ฏๆฏ๏ผๆนๅๆฏ็ปๅฏนๅผ้่ฆ+- ๅ ๆฏ: ่่ตไฝ้ข/A่กๆปๅธๅผ๏ผ้ๅธธ2-3%+```++### ่่ต่ๅธไฟกๅท++| ๆๆ | ็ๅคไฟกๅท | ็็ฉบไฟกๅท |+|------|---------|---------|+| ่่ตไฝ้ข | ๅบ้จไผ็จณๅ่ฟ็ปญๅขๅ | ้ซไฝๅ ้ๅขๅ ๏ผ่ฟ็ญ๏ผ |+| ่่ตๅไนฐๅ ฅ | ่ฟ็ปญ5ๅคฉๅไนฐๅ ฅ | ่ฟ็ปญ5ๅคฉๅๅๅบ |+| ่ๅธไฝ้ข | ๅคงๅน ๅขๅ ๅๅๅฐ๏ผ็ฉบๅคดๅ่กฅ๏ผ | ็ช็ถๅคงๅข๏ผๆไบบๅ็ฉบ๏ผ |+| ่่ต/่ๅธๆฏ | ๆฏๅผๅ่ฝๅๅๅผน | ๆ็ซฏ้ซไฝ๏ผๆ ๆ่ฟ้ซ๏ผ |++### ่่ตไฝ้ขๅๅฒ้ๅผ๏ผA่ก๏ผ++```+2015ๅนด็ๅธ้กถ้จ: 2.27ไธไบฟ๏ผๆ็ซฏ๏ผ+2018ๅนด็ๅธๅบ้จ: 0.76ไธไบฟ+2020ๅนดๆญฃๅธธๅบ้ด: 1.0-1.2ไธไบฟ+2024ๅนดๆญฃๅธธๅบ้ด: 1.4-1.8ไธไบฟ++็ป้ชๆณๅ: ่่ตไฝ้ขๆๅข>10% โ ่ฟ็ญ่ญฆ็คบ+ ่่ตไฝ้ขๆๅ>10% โ ๆๆ ่ญฆ็คบ+```++## ๅๅ่ต้ไฟกๅท๏ผA่ก๏ผ++### ๅๅ่ต้ๅๆๆกๆถ++```+ๅๅ่ต้ = ้่ฟๆฒชๆทฑๆธฏ้ไนฐA่ก็ๅค่ต++ๆ ธๅฟ็นๅพ:+1. ่งๆจก: ็ดฏ่ฎกๅไนฐๅ ฅ็บฆ2ไธไบฟ+2. ้ฃๆ ผ: ๅๅฅฝ็ฝ้ฉฌ๏ผๆถ่ดน+้่+็งๆ้พๅคด๏ผ+3. ๅ็ปๆง: ๅๅฒไธๅคๆฌกๅจๅบ้จๅ ไป+4. ๅฑ้: 2023ๅนดๅไธปๅจๅvs่ขซๅจๅๅๅ+```++### ๅๅ่ต้ไฟกๅท++| ๆๆ | ็ๅคไฟกๅท | ็็ฉบไฟกๅท |+|------|---------|---------|+| ๅๆฅๅๆตๅ ฅ | >100ไบฟ๏ผๅผบ็ไฟกๅท๏ผ | <-100ไบฟ |+| ่ฟ็ปญๆตๅ ฅๅคฉๆฐ | >10ๅคฉ่ฟ็ปญๆตๅ ฅ | >10ๅคฉ่ฟ็ปญๆตๅบ |+| ๆๅบฆๅๆตๅ ฅ | >500ไบฟ | <-500ไบฟ |+| ๆไปๅๅ | ๅขๆไฝไผฐๅผ็ฝ้ฉฌ | ๅๆๅจๆ+ๆฆๅฟต่ก |++### ๅๅ่ต้ไฝฟ็จๆณจๆ++```+2023ๅนดๅๅๅ:+1. ่ขซๅจ่ต้(ETF)ๅ ๆฏไธๅ๏ผไธปๅจ้่กๅ่ไปทๅผไธ้+2. ๅๆฅๅคง้ขๆณขๅจๅฏ่ฝๆฏๅฏนๅฒไบคๆ๏ผ้ๆนๅๆง๏ผ+3. "ๅๅค่ต"๏ผๅ ๅฐ่ต้็ป้้ฆๆธฏ๏ผๅนฒๆฐไฟกๅท++ๅปบ่ฎฎ:+- ็ๅจๅบฆ/ๆๅบฆ็ดฏ่ฎก๏ผๅฟฝ็ฅๅๆฅๆณขๅจ+- ๅบๅไธปๅจๅvs่ขซๅจๅ๏ผๆไบๆฐๆฎๆบๅฏๆๅ๏ผ+- ไธ่่ตไฝ้ขใETF็ณ่ตไบคๅ้ช่ฏ+```++## ็คพไบคๅชไฝ่ๆ ๅๆ++### ่ๆ ้ๅๆกๆถ++```+ๆฐๆฎๆบ:+- ไธญๆ: ้ช็/ไธๆน่ดขๅฏ่กๅง/ๅพฎๅ/ๅพฎไฟกๅ ฌไผๅท+- ่ฑๆ: Twitter(X)/Reddit/Telegram+- ๅ ๅฏ: CryptoTwitter/Discord/Telegram็พค++้ๅ็ปดๅบฆ:+1. ่ฎจ่ฎบ็ญๅบฆ: ๆๅ้ขๆฌก / ๅบๅ้ขๆฌก+2. ๆ ็ปชๅพๅ: ๆญฃ้ข/่ด้ข/ไธญๆงๆฏไพ+3. ๆ ็ปชๅผบๅบฆ: ๆญฃ้ขๅๅผ - ่ด้ขๅๅผ+4. ๆ ็ปชๅๅ: ่พไธๆ็ๅๅๆนๅ+```++### ่ๆ ๆๆ ++| ๆๆ | ่ฎก็ฎ | ๅๅไฟกๅท |+|------|------|---------|+| ็ญๅบฆๆๆฐ | ๆ็ดข้/่ฎจ่ฎบ้ vs MA(30) | ็ญๅบฆๆดๅข=่ฟ็ญ |+| ็ๅคๆฏไพ | ็ๅคๅธๅญ/ๆปๅธๅญ | >80%=ๆๅบฆไน่ง(่ญฆๆ) |+| ๆฐไบบๆๆฐ | ๆฐๆณจๅ่ดฆๅท่ฎจ่ฎบๅ ๆฏ | >50%=ๆฃๆทๆถๅ ฅ(้กถ้จ) |+| KOLไธ่ดๆง | ๅคงV่ง็นไธ่ดๅบฆ | ไธ่ด็ๅค=ๅฑ้ฉ |++### ็คพไบคๅชไฝๆ ็ปชๅจๆ++```+ๅบ้จ: ๆ ไบบ่ฎจ่ฎบ โ ๅฐๆฐไบบๆๅบ โ ไบ่ฎฎๆ+ไธๆถจ: ่ฎจ่ฎบๅขๅ โ ไน่ง่ๅปถ โ ๆฐไบบๆถๅ ฅ+้กถ้จ: ๅ จๆฐ่ฎจ่ฎบ โ ๆๅบฆไน่ง โ ไธ็ๅฅฝ่ ่ขซๅฒ็ฌ+ไธ่ท: ไบ่ฎฎ โ ๆๆ โ ๆ ไบบ่ฎจ่ฎบ๏ผๅๅฐๅบ้จ๏ผ++ๅทด่ฒ็นๆๆ : ๅบ็ง่ฝฆๅธๆบ/็ๅๅธๅผๅง่ฎจ่ฎบ่ก็ฅจ = ้กถ้จ+```++## ็ปผๅๆ ็ปช่ฏๅๆกๆถ++### ่ฏๅๆจกๅ++```+็ปผๅๆ ็ปช = 0.25รๆ่ดช + 0.20รPCR + 0.20ร่่ต + 0.20รๅๅ + 0.15ร่ๆ++ๆฏไธช็ปดๅบฆๆ ๅๅๅฐ 0-100:+0-20: ๆๅบฆๆๆง+20-40: ๆๆง+40-60: ไธญๆง+60-80: ่ดชๅฉช+80-100: ๆๅบฆ่ดชๅฉช+```++### ๆ ็ปช โ ๆไฝๆ ๅฐ++| ็ปผๅๆ ็ปช | ไปไฝๅปบ่ฎฎ | ๆไฝ |+|---------|---------|------|+| 0-20 | 80-100% | ้ๅๆปกไป |+| 20-40 | 60-80% | ้ๆญฅๅ ไป |+| 40-60 | 40-60% | ๆ ๅไปไฝ |+| 60-80 | 20-40% | ้ๆญฅๅไป |+| 80-100 | 0-20% | ้ๅๆธ ไป |++## ่พๅบๆ ผๅผ++```markdown+## ๅธๅบๆ ็ปชๅๆ++### ๆ ็ปชไปช่กจ็+| ๆๆ | ๅฝๅๅผ | ๅไฝ | ไฟกๅท |+|------|--------|------|------|+| ๆ่ดชๆๆฐ(ๅ ๅฏ) | 72 | 75% | ่ดชๅฉช |+| A่กๆขๆ็ | 1.8% | 70% | ๅๆดป่ท |+| PCR(50ETF) | 0.65 | 35% | ๅไน่ง |+| ่่ตไฝ้ขๅๅ(ๅจ) | +280ไบฟ | 80% | ๆ ๆๅ ้ |+| ๅๅๅๆตๅ ฅ(ๅจ) | +120ไบฟ | 60% | ๅๆญฃ้ข |++### ็ปผๅๆ ็ปช่ฏๅ: 68/100๏ผ่ดชๅฉชๅบ้ด๏ผ++### ๆ ็ปช่งฃ่ฏป+ๅฝๅๅธๅบๆ ็ปชๅ่ดชๅฉช๏ผๅคไธชๆๆ ๆๅไน่ง:+- ่่ตไฝ้ขๅ ้ๅข้ฟ๏ผๆ ๆ่ต้็งฏๆ+- ๅๅ่ต้ๆ็ปญๆตๅ ฅ๏ผๅค่ตๆๅบฆๆญฃ้ข+- ไฝPCRๅไฝ๏ผๆๆๅธๅบ็ผบไนๅฏนๅฒๆ่ฏ++### ๆไฝๅปบ่ฎฎ+- ๅปบ่ฎฎไปไฝ: ้่ณ40-50%+- ไธ่ฟฝ้ซ๏ผ็ญๅ่ฐๅๅ ไป+- ๅฏ้ๅฝไนฐๅ ฅ็่ทๆๆๅฏนๅฒ++### ้ฃ้ฉๆ็คบ+- ๆ ็ปชๆๆ ๆฏๅๅๆๆ ๏ผไธๆฏ็ฒพ็กฎๆฉๆถๅทฅๅ ท+- ่ถๅฟๅผบๆถๆ ็ปชๅฏไปฅๆ็ปญๆ็ซฏๅพไน+```++## ๆณจๆไบ้กน++1. **ๅๅๆๆ ไธๆฏ็ฒพ็กฎๆฉๆถ**๏ผๆ ็ปชๅฏไปฅๅจๆ็ซฏๅบๅๆ็ปญๅพไน ๏ผไธ่ฆไป ๅญๆ ็ปชๅ็ฉบ/ๅๅค+2. **ๆ ็ปช+่ถๅฟ็ปๅ**๏ผไธๅ่ถๅฟไธญ็่ดชๅฉชๆฏๆญฃๅธธ็๏ผไธ้่ถๅฟไธญ็ๆๆงไนๆฏๆญฃๅธธ็+3. **ไธๅๅธๅบไธๅ้ๅผ**๏ผA่กใ็พ่กใๅ ๅฏ็ๆ ็ปช้ๅผๅทฎๅผๅคง+4. **ๆฐๆฎ่ทๅ้ๅถ**๏ผ้จๅๆ ็ปชๆฐๆฎ้่ฆไป่ดนAPI๏ผๅฆBloombergๆ ็ปชๆๆ ใGlassnode๏ผ+5. **็คพไบคๅชไฝๅช้ณๅคง**๏ผๆบๅจไบบ/่ฅ้ๅทไผๅนฒๆฐ่ๆ ๅๆ๏ผ้่ฆ่ฟๆปค+6. **ๅๅ่ต้ๅๅ**๏ผ2023ๅนดๅๅๅๆฐๆฎๆซ้ฒ่งๅๅๅ๏ผๅฎๆถๆฐๆฎไธๅฆไปฅๅ้ๆ+7. **่่ตๆฐๆฎT+1**๏ผ่่ต่ๅธๆฐๆฎไธบT+1ๆฅๅ ฌๅธ๏ผๆๆปๅdiff --git a/agent/src/skills/smc/SKILL.md b/agent/src/skills/smc/SKILL.mdnew file mode 100644index 000000000..bfe736e19--- /dev/null+++ b/agent/src/skills/smc/SKILL.md@@ -0,0 +1,41 @@+---+name: smc+description: Smart Money Concepts (ICT) signal engine. Uses the smartmoneyconcepts library to implement institutional-trading-school analysis of BOS, ChoCH, FVG, and order blocks (OB).+---+# Smart Money Concepts++## Purpose++The modern institutional trading school (ICT / Inner Circle Trader), built around the core idea of tracking the behavior of "smart money" (institutional capital):++| Concept | English | Meaning |+|------|------|------|+| Break of structure | BOS (Break of Structure) | Trend continuation signal |+| Change of character | ChoCH (Change of Character) | Trend reversal signal |+| Fair value gap | FVG (Fair Value Gap) | Price refill target |+| Order blocks | Order Blocks | Institutional order concentration zones |+| Liquidity | Liquidity | Stop-hunt target zones |++## Signal Logic++Direction from ChoCH + confirmation from BOS + filtering by FVG:+- **Long**: bullish ChoCH/BOS + bullish FVG exists+- **Short**: bearish ChoCH/BOS + bearish FVG exists+- **Stand aside**: no structural signal or conflicting directions++## Dependencies++```bash+pip install smartmoneyconcepts pandas numpy requests+```++## Parameters++| Parameter | Default | Description |+|------|--------|------|+| swing_length | 10 | Window for swing high/low detection |+| close_break | True | Whether BOS/ChoCH requires a closing-price break |++## Signal Convention++- `1` = long, `-1` = short, `0` = stand asidediff --git a/agent/src/skills/smc/example_signal_engine.py b/agent/src/skills/smc/example_signal_engine.pynew file mode 100644index 000000000..a4a900305--- /dev/null+++ b/agent/src/skills/smc/example_signal_engine.py@@ -0,0 +1,190 @@+"""Smart Money Concepts (ICT) ไฟกๅทๅผๆใ++ๅบไบ smartmoneyconcepts ๅบๅฎ็ฐๆบๆไบคๆๅญฆๆดพ็ๆ ธๅฟๅๆ๏ผ+- ็ปๆ็ช็ ด (BOS) / ๆง่ดจ่ฝฌๅ (ChoCH)+- ๅ ฌๅ ไปทๅผ็ผบๅฃ (FVG)++ไฟกๅท้ป่พ๏ผChoCH ไผๅ ่งฆๅๆนๅ๏ผBOS ็กฎ่ฎค๏ผFVG ๅๅ่ฟๆปคใ+"""++import os+import sys+from typing import Dict, Optional++# smartmoneyconcepts prints emoji on import โ force UTF-8 on Windows+if sys.platform == "win32":+ os.environ.setdefault("PYTHONIOENCODING", "utf-8")+ if hasattr(sys.stdout, "reconfigure"):+ sys.stdout.reconfigure(encoding="utf-8")++import numpy as np+import pandas as pd+from smartmoneyconcepts import smc+++def _fetch_okx(inst_id: str, bar: str = "1D", limit: int = 300) -> pd.DataFrame:+ """ไป OKX ่ทๅK็บฟๆฐๆฎใ++ Args:+ inst_id: ไบคๆๅฏน๏ผๅฆ "BTC-USDT"ใ+ bar: K็บฟๅจๆ๏ผ้ป่ฎคๆฅ็บฟใ+ limit: ่ทๅK็บฟๆฐ้ใ++ Returns:+ ๅ ๅซ open/high/low/close/volume ๅ็ DataFrame๏ผindex ไธบ datetimeใ+ """+ import requests++ resp = requests.get(+ "https://www.okx.com/api/v5/market/candles",+ params={"instId": inst_id, "bar": bar, "limit": str(limit)},+ )+ candles = resp.json()["data"]+ columns = [+ "ts", "open", "high", "low", "close",+ "vol", "volCcy", "volCcyQuote", "confirm",+ ]+ df = pd.DataFrame(reversed(candles), columns=columns)+ df["ts"] = pd.to_datetime(df["ts"].astype("int64"), unit="ms")+ df = df.set_index("ts")+ for col in ["open", "high", "low", "close"]:+ df[col] = df[col].astype(float)+ df["volume"] = df["vol"].astype(float)+ return df+++class SignalEngine:+ """Smart Money Concepts ไฟกๅทๅผๆใ++ ๅบไบ BOS/ChoCH ็ปๆไฟกๅท + FVG ่ฟๆปค๏ผ็ๆๅๅค/ๅ็ฉบ/่งๆไฟกๅทใ++ Attributes:+ swing_length: Swing ้ซไฝ็นๆฃๆต็ชๅฃๅคงๅฐใ+ close_break: BOS/ChoCH ๆฏๅฆ้่ฆๆถ็ไปท็ช็ ด็กฎ่ฎคใ++ Example:+ >>> engine = SignalEngine(swing_length=50)+ >>> signals = engine.generate({"BTC-USDT": df})+ >>> print(signals["BTC-USDT"].value_counts())+ """++ def __init__(self, swing_length: int = 10, close_break: bool = True):+ """ๅๅงๅ SMC ไฟกๅทๅผๆใ++ Args:+ swing_length: Swing ้ซไฝ็นๆฃๆต็ชๅฃ๏ผๅผ่ถๅคงๆฃๆตๅฐ็็ปๆ่ถๅฐไฝ่ถๅฏ้ ใ+ close_break: ๆฏๅฆ่ฆๆฑๆถ็ไปท็ช็ ดๆ็ฎๆๆ BOS/ChoCHใ+ """+ self.swing_length = swing_length+ self.close_break = close_break++ def generate(self, data_map: Dict[str, pd.DataFrame]) -> Dict[str, pd.Series]:+ """ๆ นๆฎ Smart Money Concepts ็ๆไบคๆไฟกๅทใ++ Args:+ data_map: ๆ ็ไปฃ็ ๅฐ OHLCV DataFrame ็ๆ ๅฐใ+ DataFrame ้ๅ ๅซ open/high/low/close/volume ๅ๏ผindex ไธบ datetimeใ++ Returns:+ ๆ ็ไปฃ็ ๅฐไฟกๅท Series ็ๆ ๅฐ๏ผ1=ๅๅค, -1=ๅ็ฉบ, 0=่งๆ๏ผใ+ """+ result = {}+ for code, df in data_map.items():+ signal = pd.Series(0, index=df.index)++ ohlc = df[["open", "high", "low", "close", "volume"]].copy()+ ohlc.columns = ["open", "high", "low", "close", "volume"]++ min_bars = self.swing_length * 2+ if len(ohlc) < min_bars:+ print(f" {code} K็บฟไธ่ถณ {min_bars} ๆ น๏ผ่ทณ่ฟ")+ result[code] = signal+ continue++ try:+ signal = self._compute_signal(ohlc, df.index)+ except Exception as e:+ print(f" {code} SMC่ฎก็ฎๅผๅธธ: {e}")++ result[code] = signal+ return result++ def _compute_signal(+ self, ohlc: pd.DataFrame, original_index: pd.Index+ ) -> pd.Series:+ """ๅฏนๅไธชๆ ็่ฎก็ฎ SMC ไฟกๅทใ++ Args:+ ohlc: ๆ ๅๅ็ OHLCV DataFrameใ+ original_index: ๅๅง DataFrame ็ index๏ผ็จไบๅฏน้ฝ่พๅบใ++ Returns:+ ไฟกๅท Series๏ผ1=ๅๅค, -1=ๅ็ฉบ, 0=่งๆ๏ผใ+ """+ signal = pd.Series(0, index=original_index)++ # 1) Swing ้ซไฝ็นๆฃๆต+ swing_hl = smc.swing_highs_lows(ohlc, swing_length=self.swing_length)++ # 2) BOS / ChoCH ็ปๆ็ช็ ดๆฃๆต+ bos_choch = smc.bos_choch(+ ohlc, swing_highs_lows=swing_hl, close_break=self.close_break+ )++ # 3) FVG ๅ ฌๅ ไปทๅผ็ผบๅฃๆฃๆต+ fvg = smc.fvg(ohlc)++ # ๆๅไฟกๅทๅ๏ผNaN ๅกซ 0๏ผ+ bos_val = bos_choch["BOS"].fillna(0).astype(int)+ choch_val = bos_choch["CHOCH"].fillna(0).astype(int)+ fvg_val = fvg["FVG"].fillna(0).astype(int)++ # ็ปๆไฟกๅท๏ผChoCH ไผๅ ๏ผBOS ่กฅๅ+ structure = choch_val.where(choch_val != 0, bos_val)++ # FVG ่ฟๆปค๏ผๅชๅจ FVG ๅๅๆไธญๆงๆถๅบไฟกๅท+ buy = (structure == 1) & (fvg_val >= 0)+ sell = (structure == -1) & (fvg_val <= 0)++ raw_signal = buy.astype(int) - sell.astype(int)+ signal[:] = raw_signal.values++ return signal+++if __name__ == "__main__":+ instruments = ["BTC-USDT", "ETH-USDT", "SOL-USDT"]+ data_map = {}++ print("=" * 50)+ print("Smart Money Concepts ไฟกๅทๅผๆ E2E ๆต่ฏ")+ print("=" * 50)++ for inst in instruments:+ print(f"\n่ทๅ {inst} ๆฅ็บฟๆฐๆฎ...")+ try:+ data_map[inst] = _fetch_okx(inst, bar="1D", limit=300)+ print(f" {inst}: {len(data_map[inst])} ๆ นK็บฟ")+ except Exception as e:+ print(f" {inst} ่ทๅๅคฑ่ดฅ: {e}")++ if not data_map:+ print("ๆ ๆฐๆฎ๏ผ้ๅบ")+ exit(1)++ engine = SignalEngine(swing_length=10, close_break=True)+ signals = engine.generate(data_map)++ print("\n" + "=" * 50)+ print("ไฟกๅท็ป่ฎก")+ print("=" * 50)+ for code, sig in signals.items():+ buys = sig[sig == 1]+ sells = sig[sig == -1]+ print(f"\n{code} ({len(data_map[code])} ๆ นK็บฟ)")+ print(f" ๅๅคไฟกๅท: {len(buys)} ไธช")+ print(f" ๅ็ฉบไฟกๅท: {len(sells)} ไธช")+ if len(buys) > 0:+ print(f" ๆ่ฟๅๅค: {buys.index[-1]:%Y-%m-%d}")+ if len(sells) > 0:+ print(f" ๆ่ฟๅ็ฉบ: {sells.index[-1]:%Y-%m-%d}")diff --git "a/agent/src/skills/smc/references/\347\273\223\346\236\204\347\252\201\347\240\264.md" "b/agent/src/skills/smc/references/\347\273\223\346\236\204\347\252\201\347\240\264.md"new file mode 100644index 000000000..cf3607c45--- /dev/null+++ "b/agent/src/skills/smc/references/\347\273\223\346\236\204\347\252\201\347\240\264.md"@@ -0,0 +1,24 @@+# ็ปๆ็ช็ ด (BOS) ไธๆง่ดจ่ฝฌๅ (ChoCH)++## BOS (Break of Structure)++็ปๆ็ช็ ดๆฏๅธๅบ่ถๅฟๅปถ็ปญ็ไฟกๅท๏ผ+- **็ๆถจBOS**๏ผไปทๆ ผ็ช็ ดๅไธไธชswing้ซ็น๏ผ็กฎ่ฎคไธๆถจ่ถๅฟๅปถ็ปญ+- **็่ทBOS**๏ผไปทๆ ผ่ท็ ดๅไธไธชswingไฝ็น๏ผ็กฎ่ฎคไธ่ท่ถๅฟๅปถ็ปญ++BOS่กจๆๅฝๅ่ถๅฟๆนๅไป็ถๆๆ๏ผๆบๆ่ต้ไปๅจๅไธๆนๅ่ฟไฝใ++## ChoCH (Change of Character)++ๆง่ดจ่ฝฌๅๆฏ่ถๅฟๅฏ่ฝๅ่ฝฌ็ไฟกๅท๏ผ+- **็ๆถจChoCH**๏ผๅจไธ่ท่ถๅฟไธญ๏ผไปทๆ ผ็ช็ ดๅไธไธชswing้ซ็น+- **็่ทChoCH**๏ผๅจไธๆถจ่ถๅฟไธญ๏ผไปทๆ ผ่ท็ ดๅไธไธชswingไฝ็น++ChoCHๆฏๆฏBOSๆดๅผบ็ไฟกๅท๏ผๅ ไธบๅฎ่กจ็คบๅธๅบ็ปๆๅ็ไบๆ นๆฌๆงๅๅใ++## ไฟกๅทๆ้++ๅจๆฌๅผๆไธญ๏ผ+- ChoCH ไฟกๅทๆ้ๆ้ซ๏ผ่ถๅฟๅ่ฝฌ๏ผ+- BOS ไฟกๅท็จไบ็กฎ่ฎค๏ผ่ถๅฟๅปถ็ปญ๏ผ+- ไธค่ ็ปๅ FVG ่ฟๆปค๏ผๅๅฐๅไฟกๅทdiff --git "a/agent/src/skills/smc/references/\350\256\242\345\215\225\345\235\227\344\270\216\347\274\272\345\217\243.md" "b/agent/src/skills/smc/references/\350\256\242\345\215\225\345\235\227\344\270\216\347\274\272\345\217\243.md"new file mode 100644index 000000000..745d85ab4--- /dev/null+++ "b/agent/src/skills/smc/references/\350\256\242\345\215\225\345\235\227\344\270\216\347\274\272\345\217\243.md"@@ -0,0 +1,28 @@+# ่ฎขๅๅ (Order Blocks) ไธๅ ฌๅ ไปทๅผ็ผบๅฃ (FVG)++## Order Blocks (่ฎขๅๅ)++่ฎขๅๅๆฏๆบๆๅคง้ๅปบไป็ๅบๅ๏ผ้ๅธธ่กจ็ฐไธบ๏ผ+- ไปทๆ ผๅฟซ้็ฆปๅผๆไธชไปทๆ ผๅบๅ+- ่ฏฅๅบๅ้ๅๆไธบๅผบๆฏๆๆ้ปๅ+- ๅฝไปทๆ ผๅๆต่ฎขๅๅๆถ๏ผๅพๅพไผๅบ็ฐๅๅบ++### ็ๆถจ่ฎขๅๅ+ไธ่ท่ถๅฟไธญๆๅไธๆ น้ด็บฟ็ๅบๅ๏ผ้ๅไปทๆ ผๅผบๅไธๆถจใ++### ็่ท่ฎขๅๅ+ไธๆถจ่ถๅฟไธญๆๅไธๆ น้ณ็บฟ็ๅบๅ๏ผ้ๅไปทๆ ผๅผบๅไธ่ทใ++## FVG (Fair Value Gap / ๅ ฌๅ ไปทๅผ็ผบๅฃ)++FVGๆฏไธๆ นK็บฟไธญ้ดๅบ็ฐ็ไปทๆ ผ็ผบๅฃ๏ผ+- **็ๆถจFVG**๏ผ็ฌฌไธๆ นK็บฟ็ไฝ็น > ็ฌฌไธๆ นK็บฟ็้ซ็น๏ผไธญ้ด็ไธ็ฉบ็ฝ๏ผ+- **็่ทFVG**๏ผ็ฌฌไธๆ นK็บฟ็้ซ็น < ็ฌฌไธๆ นK็บฟ็ไฝ็น++FVGไปฃ่กจไนฐๅๅ้็ๆๅบฆไธๅนณ่กก๏ผไปทๆ ผ้ๅธธไผๅๆฅ"ๅกซ่กฅ"่ฟไธช็ผบๅฃใ++## ๅจไฟกๅทไธญ็ไฝ็จ++FVGไฝไธบ่ฟๆปคๅจไฝฟ็จ๏ผ+- ๅฝๅญๅจ็ๆถจFVGๆถ๏ผๅๅคไฟกๅทๆดๅฏ้ ๏ผ่กจๆไนฐๆนๅ้ๅผบๅฒ๏ผ+- ๅฝๅญๅจ็่ทFVGๆถ๏ผๅ็ฉบไฟกๅทๆดๅฏ้ ๏ผ่กจๆๅๆนๅ้ๅผบๅฒ๏ผdiff --git a/agent/src/skills/social-media-intelligence/SKILL.md b/agent/src/skills/social-media-intelligence/SKILL.mdnew file mode 100644index 000000000..d3aac215c--- /dev/null+++ b/agent/src/skills/social-media-intelligence/SKILL.md@@ -0,0 +1,1294 @@+---+name: social-media-intelligence+description: "Social media intelligence: financial signal extraction from Twitter/X, Telegram, Discord, and Reddit for sentiment-driven trading strategies."+---++# Social Media Intelligence++> This skill integrates financial-intelligence collection methods and quantitative applications across Twitter/X, Telegram, Discord, and Reddit.+> Inspired by `himself65/finance-skills` modules such as `discord-reader`, `telegram-reader`, and `twitter-reader`.++---++## 1. Overview of the Four Major Financial Social Platforms++### 1.1 Twitter/X โ The FinTwit Ecosystem++**Core roles**++| Role Type | Representative Account Traits | Signal Value |+|---------|------------|---------|+| Sell-side analyst | Institutional backing, dense posting around earnings | Medium, somewhat lagging |+| Fund manager | Holdings views, industry judgment | High, but mixed with subjective opinion |+| Macro commentator | Fed interpretation, macro-data reaction | High, a good sentiment barometer |+| Crypto KOL | On-chain interpretation, project endorsement | Highly volatile, high manipulation risk |+| Retail noise | Meme spread, herd sentiment | Contrarian signal value at extremes |++**Core FinTwit circles**+- `$TICKER` cashtag system directly maps discussion to the asset+- Earnings-season sentiment patterns before and after reports+- Real-time reaction speed to policy / macro events, often 15-60 minutes ahead of traditional media++---++### 1.2 Telegram โ The Core Venue for Crypto Intelligence++**Channel types**++| Channel Type | Content Traits | How to Use |+|---------|---------|---------|+| Signal channels | Specific buy/sell levels, stop-loss / take-profit | Use as a sentiment thermometer, not for blind copy-trading |+| Research push channels | Institutional PDF reports, on-chain data | Aggregate information and extract key numbers |+| Macro flash channels | Real-time interpretation of FOMC, CPI, etc. | Event-driven signals |+| Official project channels | Tokenomics updates, partnership announcements | Potential alpha, but requires filtering |+| Whale alert channels | Large on-chain transfer alerts | Capital-flow signal |++---++### 1.3 Discord โ Quant Communities and Project Ecosystems++**Important community types**+- Quant / DeFi research communities such as Degen Spartan and Messari Research+- Official crypto project Discords with governance discussion and development progress+- Trader communities focused on options flow and on-chain analysis+- NFT / GameFi projects with floor-price alerts and activity monitoring++**Distinctive value of Discord**+- Community activity directly reflects project health+- Developer channels such as `#dev` and `#build` show implementation activity+- Governance participation indicates the willingness of token holders to stay involved++---++### 1.4 Reddit โ A Barometer of Retail Sentiment++**Core subreddits**++| Subreddit | Core User Base | Main Signal |+|-------|---------|---------|+| r/wallstreetbets | Retail options traders | Meme-stock heat, abnormal options chatter |+| r/investing | Value-oriented retail investors | Long-horizon sentiment, ETF flow |+| r/cryptocurrency | Crypto retail | BTC / ETH cycle sentiment |+| r/stocks | General stock discussants | Earnings-season sentiment |+| r/options | Options-strategy community | Unusual IV-related topics |++---++## 2. Data Collection Methods++### 2.1 Twitter/X Data Collection++**Tooling options**++```python+# Option A: Official API v2 (paid, basic tier starts at $100/month)+# Best for: production environments where compliance is the priority+from tweepy import Client++client = Client(bearer_token=os.getenv("TWITTER_BEARER_TOKEN"))++# Search tweets discussing a cashtag over the last 7 days+def fetch_cashtag_tweets(ticker: str, max_results: int = 100) -> list[dict]:+ """Collect Twitter discussion data for a given ticker.++ Args:+ ticker: Ticker symbol such as AAPL or BTC+ max_results: Max number of returned tweets, between 10 and 100++ Returns:+ List of tweets, each containing id / text / created_at / public_metrics+ """+ query = f"${ticker} -is:retweet lang:en"+ tweets = client.search_recent_tweets(+ query=query,+ max_results=max_results,+ tweet_fields=["created_at", "public_metrics", "author_id"],+ )+ return [t.data for t in tweets.data or []]+++# Option B: ntscraper (unofficial, free, rate-limited)+# Best for: research / historical backtesting+# pip install ntscraper+from ntscraper import Nitter++scraper = Nitter()+tweets = scraper.get_tweets("$AAPL", mode="term", number=50)+```++**Data schema (Twitter JSON Schema)**++```json+{+ "platform": "twitter",+ "collected_at": "2026-03-29T08:00:00Z",+ "query": "$AAPL",+ "items": [+ {+ "id": "tweet_id_string",+ "text": "tweet text",+ "created_at": "ISO8601 timestamp",+ "author": {+ "id": "user_id",+ "username": "handle",+ "followers_count": 50000,+ "verified": false+ },+ "metrics": {+ "like_count": 120,+ "retweet_count": 45,+ "reply_count": 23,+ "quote_count": 8+ },+ "sentiment_score": null,+ "tags": ["$AAPL", "#earnings"]+ }+ ]+}+```++**Suggested collection frequency**+- Earnings season / major events: real time, poll every 5 minutes+- Routine monitoring: hourly+- Historical backfill: daily batch++---++### 2.2 Telegram Data Collection++**Tooling**++```python+# Telethon โ official MTProto client, requires API_ID + API_HASH+# pip install telethon+from telethon.sync import TelegramClient+from telethon import functions++API_ID = int(os.getenv("TELEGRAM_API_ID"))+API_HASH = os.getenv("TELEGRAM_API_HASH")++async def fetch_channel_messages(+ channel_username: str,+ limit: int = 200,+ offset_date: datetime | None = None,+) -> list[dict]:+ """Collect historical messages from a Telegram channel.++ Args:+ channel_username: Channel username without @, e.g. "whale_alert"+ limit: Maximum number of messages+ offset_date: Start time to backtrack from++ Returns:+ List of messages containing id / text / date / views / forwards+ """+ async with TelegramClient("session", API_ID, API_HASH) as client:+ messages = []+ async for msg in client.iter_messages(+ channel_username, limit=limit, offset_date=offset_date+ ):+ if msg.text:+ messages.append({+ "id": msg.id,+ "text": msg.text,+ "date": msg.date.isoformat(),+ "views": getattr(msg, "views", 0),+ "forwards": getattr(msg, "forwards", 0),+ })+ return messages+```++**Data schema (Telegram JSON Schema)**++```json+{+ "platform": "telegram",+ "channel": "whale_alert",+ "collected_at": "2026-03-29T08:00:00Z",+ "items": [+ {+ "id": 12345,+ "text": "message text",+ "date": "ISO8601 timestamp",+ "views": 85000,+ "forwards": 320,+ "has_media": false,+ "reply_to_msg_id": null,+ "sentiment_score": null+ }+ ]+}+```++**Suggested collection frequency**+- Whale-alert / flash channels: real-time push, webhook mode+- Signal channels: every 30 minutes+- Research channels: daily++---++### 2.3 Discord Data Collection++**Tooling**++```python+# discord.py โ official Bot API, requires Bot Token + server invitation permission+# pip install discord.py+import discord+from discord.ext import commands++async def fetch_channel_history(+ channel_id: int,+ limit: int = 500,+ after: datetime | None = None,+) -> list[dict]:+ """Collect message history from a Discord channel.++ Args:+ channel_id: Discord channel ID+ limit: Maximum number of messages, capped at 500 per request+ after: Start timestamp to backtrack from++ Returns:+ List of messages containing id / content / timestamp / author / reactions+ """+ bot = commands.Bot(command_prefix="!")+ messages = []++ @bot.event+ async def on_ready():+ channel = bot.get_channel(channel_id)+ async for msg in channel.history(limit=limit, after=after):+ messages.append({+ "id": str(msg.id),+ "content": msg.content,+ "timestamp": msg.created_at.isoformat(),+ "author": {+ "id": str(msg.author.id),+ "name": msg.author.name,+ "bot": msg.author.bot,+ },+ "reaction_count": sum(r.count for r in msg.reactions),+ "attachments": len(msg.attachments),+ })+ await bot.close()++ await bot.start(os.getenv("DISCORD_BOT_TOKEN"))+ return messages+```++**Data schema (Discord JSON Schema)**++```json+{+ "platform": "discord",+ "guild_id": "server_id_string",+ "channel_id": "channel_id_string",+ "channel_name": "general-trading",+ "collected_at": "2026-03-29T08:00:00Z",+ "items": [+ {+ "id": "message_id_string",+ "content": "message text",+ "timestamp": "ISO8601 timestamp",+ "author": {+ "id": "user_id_string",+ "name": "username#1234",+ "roles": ["Member", "Whale"],+ "bot": false+ },+ "reaction_count": 42,+ "thread_count": 3,+ "sentiment_score": null+ }+ ]+}+```++**Suggested collection frequency**+- Active trading communities: hourly+- Official project channels: every 4 hours+- Governance channels: daily++---++### 2.4 Reddit Data Collection++**Tooling**++```python+# PRAW โ official Reddit Python wrapper, free API+# pip install praw+import praw++def fetch_subreddit_posts(+ subreddit_name: str,+ mode: str = "hot",+ limit: int = 100,+ time_filter: str = "day",+) -> list[dict]:+ """Collect hot posts and related metadata from a subreddit.++ Args:+ subreddit_name: Subreddit name, e.g. "wallstreetbets"+ mode: Sort mode: "hot" / "new" / "top" / "rising"+ limit: Maximum number of posts+ time_filter: Time filter for top mode, e.g. "hour" / "day" / "week"++ Returns:+ List of posts containing id / title / score / comments / created_utc+ """+ reddit = praw.Reddit(+ client_id=os.getenv("REDDIT_CLIENT_ID"),+ client_secret=os.getenv("REDDIT_CLIENT_SECRET"),+ user_agent="vibe-trading/1.0",+ )+ subreddit = reddit.subreddit(subreddit_name)+ posts = []++ fetch_fn = {+ "hot": subreddit.hot,+ "new": subreddit.new,+ "top": lambda limit: subreddit.top(time_filter=time_filter, limit=limit),+ "rising": subreddit.rising,+ }[mode]++ for post in fetch_fn(limit=limit):+ posts.append({+ "id": post.id,+ "title": post.title,+ "selftext": post.selftext[:500], # truncated body+ "score": post.score,+ "upvote_ratio": post.upvote_ratio,+ "num_comments": post.num_comments,+ "created_utc": post.created_utc,+ "url": post.url,+ "flair": post.link_flair_text,+ })+ return posts+```++**Data schema (Reddit JSON Schema)**++```json+{+ "platform": "reddit",+ "subreddit": "wallstreetbets",+ "collected_at": "2026-03-29T08:00:00Z",+ "items": [+ {+ "id": "post_id",+ "title": "post title",+ "selftext": "body summary (500 chars)",+ "score": 12500,+ "upvote_ratio": 0.94,+ "num_comments": 847,+ "created_utc": 1743206400.0,+ "flair": "YOLO",+ "mentioned_tickers": ["GME", "AMC"],+ "sentiment_score": null+ }+ ]+}+```++**Suggested collection frequency**+- r/wallstreetbets around the market open: every 30 minutes+- r/investing / r/stocks: every 4 hours+- r/cryptocurrency: hourly++---++### 2.5 Compliance and Privacy Notes++**Must comply with**+- Twitter API terms: do not resell data to third parties; obey rate limits such as the basic-tier 500,000 tweets/month allowance+- Telegram personal messages must not be collected; only public channels / groups are in scope+- Discord must be accessed through the official Bot API; self-bots violate ToS and may get banned+- Reddit PRAW rate limit: 60 requests/minute for authenticated users++**Data storage rules**+- Store user IDs in masked form such as hashes; do not retain raw usernames+- Store raw text locally only and do not expose it through public APIs+- Periodically purge raw data older than 30 days and keep only aggregated metrics++---++## 3. Sentiment Quantification Methodology++### 3.1 Text Sentiment Scoring++#### Option A: VADER (Lightweight, English, Good for Short Social Posts)++```python+# pip install vaderSentiment+from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer++def vader_score(text: str) -> dict:+ """Score the sentiment of social-media text using VADER.++ Args:+ text: Raw social-media text such as a tweet, post, or message++ Returns:+ {'pos': float, 'neg': float, 'neu': float, 'compound': float}+ compound is in [-1, 1], where > 0.05 is positive and < -0.05 is negative+ """+ analyzer = SentimentIntensityAnalyzer()+ return analyzer.polarity_scores(text)+```++**Characteristics**: No GPU required, suitable for high-frequency batch processing; weaker on finance-specific slang such as "bull" or "moon".++#### Option B: FinBERT (Finance-Specific BERT)++```python+# pip install transformers torch+from transformers import pipeline++_finbert = None++def get_finbert():+ """Lazily load the FinBERT model. First call takes roughly 1-2 seconds."""+ global _finbert+ if _finbert is None:+ _finbert = pipeline(+ "text-classification",+ model="ProsusAI/finbert",+ tokenizer="ProsusAI/finbert",+ )+ return _finbert++def finbert_score(text: str) -> dict:+ """Classify sentiment in finance text using FinBERT.++ Args:+ text: Finance-related text, truncated to 512 tokens++ Returns:+ {'label': 'positive'|'negative'|'neutral', 'score': float}+ """+ result = get_finbert()(text[:512])[0]+ score_map = {"positive": 1.0, "neutral": 0.0, "negative": -1.0}+ return {+ "label": result["label"],+ "score": score_map[result["label"]] * result["score"],+ }+```++**Characteristics**: Stronger understanding of finance terms such as earnings, guidance, beat/miss; GPU acceleration is preferred for large batches.++#### Option C: LLM-Based (Highest Precision, Best for Long and Complex Text)++```python+def llm_sentiment(text: str, ticker: str | None = None) -> dict:+ """Use an LLM to analyze sentiment in complex finance text.++ Args:+ text: Raw text such as a report summary or Discord thread+ ticker: Related asset symbol, if available++ Returns:+ {'score': float[-1,1], 'label': str, 'reason': str}++ Note:+ Each call consumes roughly 500 tokens.+ Use only on samples where VADER / FinBERT confidence is below 0.6.+ """+ context = f"Ticker: {ticker}\n" if ticker else ""+ prompt = f"""{context}Analyze the sentiment of the following finance text and return JSON:+{{"score": <float from -1 to 1>, "label": <"bullish"|"bearish"|"neutral">, "reason": <one-sentence explanation>}}++Text: {text[:1000]}"""+ # Call the current agent's LLM interface+ from src.providers.base import get_llm+ response = get_llm().invoke(prompt)+ import json+ return json.loads(response.content)+```++**Recommendation by scenario**++| Scenario | Recommended Method | Reason |+|-----|---------|------|+| Real-time Twitter / Reddit batch processing | VADER | Low latency, no GPU required |+| Earnings-related text | FinBERT | Strong finance-term understanding |+| Telegram research summaries | LLM-based | Better on long-form and nuanced meaning |+| Multi-turn Discord discussion | FinBERT + LLM | Good balance of precision and cost |++---++### 3.2 Discussion-Buzz Metrics++```python+import pandas as pd+import numpy as np++def compute_buzz_metrics(df: pd.DataFrame, window: str = "1H") -> pd.DataFrame:+ """Compute time-series discussion-buzz metrics.++ Args:+ df: Message DataFrame containing timestamp / platform / ticker columns+ window: Aggregation window, such as "1H" / "4H" / "1D"++ Returns:+ Time-series DataFrame with:+ - msg_count: message volume+ - unique_authors: count of distinct active users+ - topic_freq: topic frequency as ticker volume / total message volume+ - engagement_score: weighted interaction count+ - buzz_zscore: message-volume Z-score for anomaly detection+ """+ df["timestamp"] = pd.to_datetime(df["timestamp"])+ df = df.set_index("timestamp").sort_index()++ result = df.resample(window).agg(+ msg_count=("text", "count"),+ unique_authors=("author_id", "nunique"),+ total_engagement=("engagement", "sum"),+ )++ # Topic frequency, i.e. relative buzz.+ total = df.resample(window)["text"].count()+ result["topic_freq"] = result["msg_count"] / total.replace(0, np.nan)++ # Z-score anomaly detection using a 30-window rolling baseline.+ roll_mean = result["msg_count"].rolling(30, min_periods=5).mean()+ roll_std = result["msg_count"].rolling(30, min_periods=5).std()+ result["buzz_zscore"] = (result["msg_count"] - roll_mean) / roll_std.replace(0, np.nan)++ return result+```++**Key buzz metrics**+- `msg_count`: raw message count, measures absolute attention+- `unique_authors`: distinct users, reduces bot / spam distortion+- `buzz_zscore > 2.0`: abnormal buzz, triggers alerts+- `topic_freq`: relative buzz, controls for broad market-wide sentiment amplification++---++### 3.3 Sentiment Extremes (Fear / Greed Indicator)++```python+def compute_fear_greed_index(+ sentiment_series: pd.Series,+ buzz_series: pd.Series,+ lookback: int = 30,+) -> pd.Series:+ """Construct a CNN-style fear-and-greed index.++ Args:+ sentiment_series: Daily average sentiment in [-1, 1]+ buzz_series: Daily message-volume series+ lookback: Historical window in days used for percentile ranking++ Returns:+ Fear-and-greed index in [0, 100]+ 0-20: extreme fear+ 20-40: fear+ 40-60: neutral+ 60-80: greed+ 80-100: extreme greed++ Note:+ Extreme greed (>80) is often a short-term top signal.+ Extreme fear (<20) is often a short-term bottom signal.+ """+ # Normalize sentiment by percentile rank.+ sentiment_rank = sentiment_series.rolling(lookback).rank(pct=True) * 100++ # Normalize buzz by percentile rank.+ buzz_rank = buzz_series.rolling(lookback).rank(pct=True) * 100++ # Weighted combination: 60% sentiment + 40% buzz.+ fear_greed = 0.6 * sentiment_rank + 0.4 * buzz_rank++ return fear_greed.clip(0, 100)+```++**Extreme-sentiment thresholds**++| Range | State | Historical Meaning | Trading Interpretation |+|---------|-----|---------|---------|+| 0-20 | Extreme fear | Panic selling, liquidity stress | Contrarian long candidate |+| 20-40 | Fear | Pessimism spreading | Wait and watch for stabilization |+| 40-60 | Neutral | Balanced sentiment | Let fundamentals lead |+| 60-80 | Greed | Optimism dominant | Candidate for trimming risk |+| 80-100 | Extreme greed | FOMO-driven retail influx | Contrarian short candidate |++---++### 3.4 Retail vs Institutional Sentiment++```python+def classify_author_type(author: dict) -> str:+ """Classify an account as retail / institutional / KOL using profile traits.++ Args:+ author: Dict containing followers_count / verified / account_age_days /+ tweet_count / following_count++ Returns:+ 'institutional': institutional account+ 'kol': high-impact KOL+ 'retail': retail user+ 'bot_risk': suspected bot++ Note:+ Institutional sentiment should carry more weight than KOL,+ and KOL more than retail. Retail extremes often have contrarian value.+ """+ followers = author.get("followers_count", 0)+ verified = author.get("verified", False)+ age_days = author.get("account_age_days", 0)+ tweet_count = author.get("tweet_count", 0)++ # Bot-risk detection+ if age_days < 30 and tweet_count > 1000:+ return "bot_risk"+ if tweet_count > 0 and (tweet_count / max(age_days, 1)) > 50:+ return "bot_risk"++ # Institutional characteristics: verified plus large audience+ if verified and followers > 100_000:+ return "institutional"++ # KOL: large following but not necessarily verified+ if followers > 10_000:+ return "kol"++ return "retail"+++def weighted_sentiment(+ df: pd.DataFrame,+ weights: dict | None = None,+) -> pd.Series:+ """Compute weighted sentiment by author category.++ Args:+ df: DataFrame containing sentiment_score / author_type / timestamp+ weights: Optional category weights, defaults to institutional:3, kol:2, retail:1++ Returns:+ Daily weighted sentiment time series+ """+ if weights is None:+ weights = {"institutional": 3.0, "kol": 2.0, "retail": 1.0, "bot_risk": 0.0}++ df["weight"] = df["author_type"].map(weights).fillna(1.0)+ df["weighted_sentiment"] = df["sentiment_score"] * df["weight"]++ return (+ df.groupby(df["timestamp"].dt.date)+ .apply(lambda g: g["weighted_sentiment"].sum() / g["weight"].sum())+ .rename("weighted_sentiment")+ )+```++---++## 4. Using Social Signals as Factors++### 4.1 Social-Sentiment Factor Construction and IC / ICIR Testing++```python+import pandas as pd+import numpy as np+from scipy.stats import spearmanr++def compute_ic(+ factor_series: pd.Series,+ forward_return: pd.Series,+ method: str = "spearman",+) -> float:+ """Compute one-period factor IC (information coefficient).++ Args:+ factor_series: Cross-sectional factor values, e.g. same-day sentiment by ticker+ forward_return: Matching forward N-day returns+ method: "spearman" for rank correlation or "pearson"++ Returns:+ IC in [-1, 1]. |IC| > 0.05 is useful and > 0.1 is strong.+ """+ aligned = pd.concat([factor_series, forward_return], axis=1).dropna()+ if len(aligned) < 5:+ return np.nan++ if method == "spearman":+ ic, _ = spearmanr(aligned.iloc[:, 0], aligned.iloc[:, 1])+ else:+ ic = aligned.iloc[:, 0].corr(aligned.iloc[:, 1])+ return ic+++def compute_icir(ic_series: pd.Series) -> float:+ """Compute ICIR, the information ratio of IC.++ Args:+ ic_series: Time series of IC values++ Returns:+ ICIR = mean(IC) / std(IC), where > 0.5 is useful and > 1.0 is strong+ """+ return ic_series.mean() / ic_series.std() if ic_series.std() > 0 else np.nan+++# Example factor-construction workflow+def build_sentiment_factor(+ raw_data: pd.DataFrame,+ forward_days: int = 5,+) -> dict:+ """Build a complete social-sentiment factor and test its effectiveness.++ Args:+ raw_data: Raw data containing date / ticker / sentiment_score / author_type+ forward_days: Forward return horizon in days++ Returns:+ {'factor': DataFrame, 'ic_series': Series, 'icir': float}+ """+ # 1. Cross-sectional standardization+ factor = (+ raw_data.groupby("date")["sentiment_score"]+ .transform(lambda x: (x - x.mean()) / (x.std() + 1e-8))+ )++ # 2. Compute period-by-period IC+ ic_list = []+ dates = raw_data["date"].unique()+ for date in sorted(dates)[:-forward_days]:+ fwd_date = dates[dates > date][:forward_days][-1]+ f = raw_data[raw_data["date"] == date].set_index("ticker")["sentiment_norm"]+ r = raw_data[raw_data["date"] == fwd_date].set_index("ticker")["return"]+ ic_list.append((date, compute_ic(f, r)))++ ic_series = pd.Series(dict(ic_list))+ return {+ "factor": factor,+ "ic_series": ic_series,+ "ic_mean": ic_series.mean(),+ "icir": compute_icir(ic_series),+ }+```++**IC / ICIR grading**++| Metric | Weak | Useful | Strong |+|-----|----|----|---|+| \|IC\| | < 0.03 | 0.03-0.08 | > 0.08 |+| ICIR | < 0.3 | 0.3-0.8 | > 0.8 |+| IC positive-rate | < 50% | 50-60% | > 60% |++---++### 4.2 Orthogonalization Against Traditional Factors++```python+def orthogonalize_sentiment(+ sentiment_factor: pd.Series,+ traditional_factors: pd.DataFrame,+) -> pd.Series:+ """Orthogonalize the sentiment factor against traditional factors.++ Args:+ sentiment_factor: Raw sentiment factor after cross-sectional normalization+ traditional_factors: Matrix of traditional factors such as size / momentum / valuation++ Returns:+ Pure sentiment factor after removing shared components, i.e. the residual++ Note:+ Orthogonalization often lowers IC, but improves factor independence+ and reduces double-counting in multi-factor portfolios.+ """+ from sklearn.linear_model import LinearRegression+ import numpy as np++ # Regress on the traditional factors and keep the residual.+ X = traditional_factors.fillna(0).values+ y = sentiment_factor.fillna(0).values++ reg = LinearRegression(fit_intercept=True).fit(X, y)+ residual = y - reg.predict(X)++ return pd.Series(residual, index=sentiment_factor.index)+```++---++### 4.3 Cross-Platform Sentiment Aggregation Weights++```python+PLATFORM_WEIGHTS = {+ # Weight basis: historical IC contribution + information quality+ "twitter_institutional": 0.35,+ "twitter_kol": 0.20,+ "telegram_signal": 0.15,+ "telegram_research": 0.15,+ "discord_community": 0.10,+ "reddit_wsb": 0.05,+}++def aggregate_platform_sentiment(platform_scores: dict[str, float]) -> float:+ """Aggregate sentiment scores from multiple platforms using weights.++ Args:+ platform_scores: Dict of {platform_key: sentiment_score} with scores in [-1, 1]++ Returns:+ Aggregated sentiment score in [-1, 1]+ """+ total_weight = 0.0+ weighted_sum = 0.0++ for platform, score in platform_scores.items():+ weight = PLATFORM_WEIGHTS.get(platform, 0.05)+ weighted_sum += score * weight+ total_weight += weight++ return weighted_sum / total_weight if total_weight > 0 else 0.0+```++---++### 4.4 Sentiment-Reversal Signals++```python+def detect_sentiment_reversal(+ fg_index: pd.Series,+ price_series: pd.Series,+ extreme_threshold: float = 80.0,+ fear_threshold: float = 20.0,+ confirmation_days: int = 3,+) -> pd.DataFrame:+ """Detect reversal signals from sentiment extremes.++ Args:+ fg_index: Fear-and-greed index in [0, 100]+ price_series: Corresponding price series+ extreme_threshold: Extreme-greed threshold, default 80+ fear_threshold: Extreme-fear threshold, default 20+ confirmation_days: Number of days required for confirmation++ Returns:+ DataFrame containing signal / direction / strength+ signal = 1: short signal due to sustained extreme greed+ signal = -1: long signal due to sustained extreme fear+ signal = 0: no signal++ Note:+ Sentiment reversals usually lag the exact top or bottom,+ but can still lead by roughly 3-10 trading days.+ Use together with price momentum or volume anomalies.+ """+ signals = pd.DataFrame(index=fg_index.index)+ signals["fg"] = fg_index+ signals["signal"] = 0+ signals["direction"] = ""+ signals["strength"] = 0.0++ # Sustained extreme greed โ short signal+ greed_mask = (fg_index > extreme_threshold).rolling(confirmation_days).sum() == confirmation_days+ signals.loc[greed_mask, "signal"] = 1+ signals.loc[greed_mask, "direction"] = "short"+ signals.loc[greed_mask, "strength"] = (fg_index - extreme_threshold).clip(0) / 20++ # Sustained extreme fear โ long signal+ fear_mask = (fg_index < fear_threshold).rolling(confirmation_days).sum() == confirmation_days+ signals.loc[fear_mask, "signal"] = -1+ signals.loc[fear_mask, "direction"] = "long"+ signals.loc[fear_mask, "strength"] = (fear_threshold - fg_index).clip(0) / 20++ return signals+```++---++## 5. Platform-Specific Analysis++### 5.1 Twitter: KOL Influence Tracking + Earnings Sentiment++**KOL influence quantification**++```python+def compute_kol_influence_score(author: dict, recent_tweets: list[dict]) -> float:+ """Quantify the market influence of a Twitter KOL.++ Args:+ author: Account metadata including follower count, verification, and age+ recent_tweets: Most recent 20 tweets including engagement metrics++ Returns:+ Influence score in [0, 100]++ Note:+ KOLs with scores above 70 tend to lift 1-hour realized volatility+ of the related asset by roughly 15% after posting.+ """+ # Follower-quality score, using log follower count+ follower_score = min(np.log10(max(author["followers_count"], 1)) / 7, 1.0) * 40++ # Engagement rate = recent average engagement / follower count+ avg_engagement = np.mean([+ t["metrics"]["like_count"] + t["metrics"]["retweet_count"] * 2+ for t in recent_tweets+ ])+ engagement_rate = avg_engagement / max(author["followers_count"], 1)+ engagement_score = min(engagement_rate * 1000, 1.0) * 30++ # Account-age credibility score+ age_score = min(author["account_age_days"] / 1825, 1.0) * 20 # full score at 5 years++ # Verification bonus+ verified_bonus = 10 if author["verified"] else 0++ return follower_score + engagement_score + age_score + verified_bonus+```++**Pre/post-earnings sentiment shift**++```python+def analyze_earnings_sentiment_shift(+ ticker: str,+ earnings_date: str,+ sentiment_df: pd.DataFrame,+ window_days: int = 5,+) -> dict:+ """Analyze Twitter sentiment changes before and after earnings.++ Args:+ ticker: Stock ticker+ earnings_date: Earnings date in YYYY-MM-DD+ sentiment_df: Daily time series containing date / sentiment_score+ window_days: Observation window on each side of the earnings date++ Returns:+ {+ 'pre_sentiment': float,+ 'post_sentiment': float,+ 'shift': float,+ 'signal': str # 'beat_expected' / 'miss_expected' / 'neutral'+ }+ """+ ed = pd.Timestamp(earnings_date)+ pre = sentiment_df[+ (sentiment_df.index >= ed - pd.Timedelta(days=window_days)) &+ (sentiment_df.index < ed)+ ]["sentiment_score"].mean()+ post = sentiment_df[+ (sentiment_df.index > ed) &+ (sentiment_df.index <= ed + pd.Timedelta(days=window_days))+ ]["sentiment_score"].mean()++ shift = post - pre+ signal = "neutral"+ if shift > 0.2:+ signal = "beat_expected"+ elif shift < -0.2:+ signal = "miss_expected"++ return {"pre_sentiment": pre, "post_sentiment": post, "shift": shift, "signal": signal}+```++---++### 5.2 Telegram: Crypto Project Alpha + Airdrop / IDO Buzz++**Alpha-signal quality filter**++Signal quality varies widely across crypto Telegram channels. Filter with rules like the following:++```python+ALPHA_QUALITY_RULES = {+ # Low-quality signals to filter out directly+ "spam_patterns": [+ r"100x guaranteed",+ r"private sale",+ r"limited spots",+ r"DM me",+ r"pump incoming",+ ],+ # High-quality signals that deserve extra weight+ "quality_signals": [+ r"on-chain data",+ r"tokenomics analysis",+ r"team background",+ r"audit report",+ r"TVL growing",+ ],+}++def score_telegram_alpha(message: str) -> dict:+ """Score the quality of alpha in Telegram crypto-channel messages.++ Args:+ message: Raw channel message++ Returns:+ {'quality_score': int[0-10], 'is_spam': bool, 'alpha_type': str}+ """+ import re+ text_lower = message.lower()++ # Spam detection+ for pattern in ALPHA_QUALITY_RULES["spam_patterns"]:+ if re.search(pattern, text_lower):+ return {"quality_score": 0, "is_spam": True, "alpha_type": "spam"}++ # Quality score+ score = 5+ for pattern in ALPHA_QUALITY_RULES["quality_signals"]:+ if re.search(pattern, text_lower):+ score += 1++ alpha_type = "research" if score >= 7 else "signal" if score >= 5 else "noise"+ return {"quality_score": min(score, 10), "is_spam": False, "alpha_type": alpha_type}+```++**Airdrop / IDO buzz tracking**++- Monitor keyword frequency for tags such as `#airdrop`, `#IDO`, and `#whitelist`+- Buzz peaks where topic frequency exceeds 3ร baseline often lead token-price moves by 2-5 days+- Important caveat: high-buzz IDOs often face heavy Day-1 sell pressure from participants taking quick profits++---++### 5.3 Discord: Community Activity โ Project Health++**Project health index**++```python+def compute_project_health_index(+ discord_stats: dict,+ lookback_days: int = 30,+) -> dict:+ """Build a project-community health index from Discord statistics.++ Args:+ discord_stats: {+ 'daily_messages': list[int],+ 'daily_active_users': list[int],+ 'new_members': list[int],+ 'dev_commits': list[int],+ }+ lookback_days: Historical window used as the baseline++ Returns:+ {+ 'health_score': float[0-100],+ 'trend': 'growing'|'stable'|'declining',+ 'flags': list[str]+ }+ """+ msgs = np.array(discord_stats["daily_messages"][-lookback_days:])+ users = np.array(discord_stats["daily_active_users"][-lookback_days:])+ members = np.array(discord_stats["new_members"][-lookback_days:])++ # Component scores+ msg_trend = np.polyfit(range(len(msgs)), msgs, 1)[0]+ user_trend = np.polyfit(range(len(users)), users, 1)[0]++ msg_score = min(50 + msg_trend / max(msgs.mean(), 1) * 500, 100)+ user_score = min(50 + user_trend / max(users.mean(), 1) * 500, 100)+ retention = (users.mean() / max(members[-7:].sum(), 1)) * 20++ health_score = 0.4 * msg_score + 0.4 * user_score + 0.2 * min(retention, 100)++ # Warning flags+ flags = []+ if msgs[-7:].mean() < msgs[-30:].mean() * 0.5:+ flags.append("Message volume has collapsed: 7-day average is below 50% of the 30-day average")+ if users[-3:].mean() < users[-30:].mean() * 0.3:+ flags.append("Active users have plunged: possible project-abandonment warning")++ trend = "growing" if msg_trend > 0 and user_trend > 0 else \+ "declining" if msg_trend < 0 and user_trend < 0 else "stable"++ return {"health_score": health_score, "trend": trend, "flags": flags}+```++**Whale-discussion monitoring**++- Monitor channels such as `#whale-watch` and `#large-transactions`+- Keywords to watch: `whale alert`, `large transfer`, `moved X BTC`+- Cross-check with Whale Alert Telegram bot data++---++### 5.4 Reddit: WSB Meme-Stock Buzz + Options-Flow Abnormalities++**Meme-stock momentum detection**++```python+def detect_meme_stock_momentum(+ wsb_posts: list[dict],+ top_n: int = 10,+) -> pd.DataFrame:+ """Detect meme-stock momentum on WSB and identify short-squeeze candidates.++ Args:+ wsb_posts: List of WSB posts collected through PRAW+ top_n: Number of top hot tickers to return++ Returns:+ DataFrame containing ticker / mention_count / avg_score / option_buzz++ Note:+ mention_count > 200 in one day plus sentiment > 0.5 is one early short-squeeze warning condition.+ A full squeeze setup still requires short interest above 20%.+ """+ import re+ from collections import defaultdict++ ticker_stats = defaultdict(lambda: {"count": 0, "scores": [], "option_buzz": 0})++ # Common U.S. ticker regex: 2-5 uppercase letters+ ticker_pattern = re.compile(r"\b([A-Z]{2,5})\b")+ option_keywords = ["calls", "puts", "options", "IV", "yolo", "FDs"]++ for post in wsb_posts:+ text = f"{post['title']} {post['selftext']}"+ tickers_found = ticker_pattern.findall(text)++ # Filter common non-ticker words+ stop_words = {"THE", "FOR", "AND", "BUT", "NOT", "ARE", "YOU", "ALL", "CAN"}+ tickers_found = [t for t in tickers_found if t not in stop_words]++ has_options = any(kw.lower() in text.lower() for kw in option_keywords)++ for ticker in set(tickers_found):+ ticker_stats[ticker]["count"] += 1+ ticker_stats[ticker]["scores"].append(post["score"])+ if has_options:+ ticker_stats[ticker]["option_buzz"] += 1++ rows = []+ for ticker, stats in ticker_stats.items():+ rows.append({+ "ticker": ticker,+ "mention_count": stats["count"],+ "avg_score": np.mean(stats["scores"]),+ "option_buzz": stats["option_buzz"],+ })++ df = pd.DataFrame(rows).sort_values("mention_count", ascending=False)+ return df.head(top_n)+```++**WSB short-squeeze checklist**++| Condition | Data Source | Threshold |+|-----|---------|-----|+| WSB mentions | Reddit PRAW | > 200 per day |+| WSB options-discussion heat | Reddit PRAW | option_buzz > 30% |+| Short interest (SI) | Finviz / IEX | > 20% |+| Borrow tightness | Securities-lending data | CTB > 5% |+| Unusual options open interest | Option-chain data | OI day-over-day change > 50% |++---++## 6. Data-Pipeline Integration++### 6.1 Unified Data Collection Interface++```python+# Reference implementation: agent/src/tools/social_media_tool.py++from dataclasses import dataclass+from enum import Enum++class Platform(str, Enum):+ TWITTER = "twitter"+ TELEGRAM = "telegram"+ DISCORD = "discord"+ REDDIT = "reddit"++@dataclass+class SocialMediaQuery:+ """Social-media query parameters."""+ platform: Platform+ query: str+ limit: int = 100+ start_time: str | None = None+ include_sentiment: bool = True++def collect_social_signals(query: SocialMediaQuery) -> dict:+ """Unified entrypoint for collecting social-media data.++ Args:+ query: Query parameters including platform, keyword, time window, and limit++ Returns:+ Standardized JSON data containing platform / items / metadata++ Raises:+ ValueError: Unsupported platform or invalid parameters+ RuntimeError: API call failed, with retry guidance attached+ """+ collectors = {+ Platform.TWITTER: _collect_twitter,+ Platform.TELEGRAM: _collect_telegram,+ Platform.DISCORD: _collect_discord,+ Platform.REDDIT: _collect_reddit,+ }+ collector = collectors.get(query.platform)+ if not collector:+ raise ValueError(f"Unsupported platform: {query.platform}")++ raw_data = collector(query)++ if query.include_sentiment:+ raw_data = _enrich_with_sentiment(raw_data)++ return raw_data+```++### 6.2 Environment Variables++```bash+# Add the following to .env+TWITTER_BEARER_TOKEN=xxx+TELEGRAM_API_ID=xxx+TELEGRAM_API_HASH=xxx+DISCORD_BOT_TOKEN=xxx+REDDIT_CLIENT_ID=xxx+REDDIT_CLIENT_SECRET=xxx++# Sentiment model selection: vader / finbert / llm+SENTIMENT_MODEL=finbert+```++### 6.3 Factor Storage Schema++```sql+-- Social-sentiment factor table (DuckDB / SQLite)+CREATE TABLE social_sentiment_factors (+ date DATE NOT NULL,+ ticker VARCHAR(20) NOT NULL,+ platform VARCHAR(20) NOT NULL,+ sentiment FLOAT, -- [-1, 1]+ buzz_zscore FLOAT, -- Buzz Z-score+ fear_greed FLOAT, -- [0, 100]+ msg_count INTEGER,+ author_type VARCHAR(20), -- institutional / kol / retail+ PRIMARY KEY (date, ticker, platform)+);+```++---++## 7. Caveats and Limitations++1. **Limited lead value**: Social sentiment usually has IC around 0.03-0.06 on broad indices. It works best as a supporting factor, not a primary one.+2. **Manipulation risk**: Telegram and Discord signal channels in crypto contain many paid signal groups and pump rings. Source-quality scoring is mandatory.+3. **Language bias**: VADER and FinBERT are mainly built for English. Chinese social platforms such as Xueqiu or Guba need separate model adaptation.+4. **API cost control**: Twitter API v2 basic tier allows 500,000 tweets/month, and upgrading from $100 to $5000/month changes economics significantly. Budget collection volume explicitly.+5. **Latency vs quality trade-off**: Real-time collection is noisier, while daily aggregation gives cleaner signals. Choose based on the strategy horizon.+6. **Factor decay**: Social-sentiment factor effectiveness decays as more market participants exploit the same signal. Re-test IC regularly.++---++*Version: v1.0 | Created: 2026-03-29 | Scope: quantitative research / factor mining (not for direct live-trading signals)*diff --git a/agent/src/skills/stablecoin-flow/SKILL.md b/agent/src/skills/stablecoin-flow/SKILL.mdnew file mode 100644index 000000000..015db59a0--- /dev/null+++ b/agent/src/skills/stablecoin-flow/SKILL.md@@ -0,0 +1,248 @@+---+name: stablecoin-flow+description: Stablecoin supply and flow analysis โ USDT/USDC mint-burn signals, exchange stablecoin reserves, on-chain stablecoin velocity, and capital rotation indicators for crypto market timing.+---+# Stablecoin Flow Analysis++## Overview++Track stablecoin supply changes, exchange reserve movements, and on-chain velocity to gauge crypto market capital flows. Stablecoins (USDT, USDC, DAI, etc.) are the "dry powder" of crypto โ minting signals new capital entering, burning signals capital leaving, and exchange reserve changes reveal buying/selling intent.++## Core Concepts++### 1. Stablecoin Supply as Market Indicator++**Total stablecoin market cap is the single best proxy for crypto market liquidity.**++```python+# Stablecoin supply growth โ crypto market liquidity expansion+# Historical correlation: BTC price and total stablecoin supply r > 0.85++stablecoin_supply = {+ "USDT": 140_000_000_000, # ~$140B (dominant, ~65% share)+ "USDC": 45_000_000_000, # ~$45B (~20% share)+ "DAI": 5_000_000_000, # ~$5B (decentralized)+ "FDUSD": 3_000_000_000, # ~$3B (Binance ecosystem)+ "USDS": 2_000_000_000, # ~$2B (Sky/MakerDAO)+}+total = sum(stablecoin_supply.values())+```++**Supply change signals:**++| Supply Change (30d) | Interpretation | Signal |+|--------------------|----------------|--------|+| > +5% | Rapid minting, new capital rushing in | Strong bullish |+| +2% to +5% | Steady capital inflow | Bullish |+| 0% to +2% | Stable, no significant new capital | Neutral |+| -2% to 0% | Mild redemptions | Cautious |+| < -2% | Capital exiting crypto ecosystem | Bearish |++### 2. Mint/Burn Event Analysis++**USDT (Tether) minting signals:**+- Tether mints new USDT โ deposits to exchanges โ precedes buying activity+- Large mints ($500M+) historically precede BTC rallies by 1-7 days+- Minting often happens in batches: "pre-mint to Tether treasury" โ later distributed to exchanges++**USDC (Circle) signals:**+- USDC is more regulated and institutional-oriented+- USDC net minting = institutional/TradFi capital entering+- USDC net burning = institutional capital exiting (redeeming for USD)+- USDC/USDT ratio rising = more institutional participation (bullish for market maturity)++```python+def mint_burn_signal(mint_events, burn_events, lookback_days=7):+ """Analyze recent stablecoin mint/burn events."""+ net_mint = sum(e.amount for e in mint_events if e.days_ago <= lookback_days)+ net_burn = sum(e.amount for e in burn_events if e.days_ago <= lookback_days)+ net_flow = net_mint - net_burn++ if net_flow > 1_000_000_000: # >$1B net mint in 7 days+ return "large_capital_inflow"+ elif net_flow > 500_000_000:+ return "moderate_inflow"+ elif net_flow > 0:+ return "mild_inflow"+ elif net_flow > -500_000_000:+ return "mild_outflow"+ else:+ return "large_capital_outflow"+```++### 3. Exchange Stablecoin Reserves++**Stablecoins on exchanges = "buy power sitting on the sidelines"**++```python+# Exchange stablecoin reserve interpretation+def exchange_reserve_signal(reserve_change_7d_pct, total_reserve_usd):+ """+ Rising exchange stablecoin reserves = buying power accumulating+ Falling exchange stablecoin reserves = capital deployed or withdrawn+ """+ if reserve_change_7d_pct > 5:+ return "buy_power_accumulating" # Dry powder building up+ elif reserve_change_7d_pct > 2:+ return "mild_accumulation"+ elif reserve_change_7d_pct < -5:+ return "deployed_or_withdrawn" # Either bought crypto or left exchange+ elif reserve_change_7d_pct < -2:+ return "mild_deployment"+ else:+ return "stable"+```++**Combined with BTC price action:**++| Exchange Stable Reserves | BTC Price Action | Interpretation |+|-------------------------|-----------------|----------------|+| Rising | Rising | Capital inflow + active buying = strong bull |+| Rising | Falling | Capital parking, waiting for bottom = accumulation |+| Falling | Rising | Capital being deployed into BTC = buying pressure |+| Falling | Falling | Capital leaving exchanges entirely = risk-off |++### 4. Stablecoin Dominance++**Stablecoin dominance = total stablecoin market cap / total crypto market cap**++```python+# Stablecoin dominance as a contrarian indicator+stablecoin_dominance = total_stablecoin_mcap / total_crypto_mcap * 100++if stablecoin_dominance > 12:+ signal = "high_cash_allocation" # Market fearful, lots of cash on sidelines+ contrarian = "bullish" # Cash will eventually re-enter+elif stablecoin_dominance > 8:+ signal = "moderate_cash"+ contrarian = "neutral"+elif stablecoin_dominance < 5:+ signal = "low_cash_allocation" # Market fully invested, little dry powder+ contrarian = "bearish" # No marginal buyers left+```++### 5. On-Chain Stablecoin Velocity++**Velocity = on-chain transfer volume / supply**++High velocity = stablecoins are being actively used (trading, DeFi, payments)+Low velocity = stablecoins are sitting idle (holding, waiting)++```python+def velocity_signal(transfer_volume_7d, supply):+ velocity = transfer_volume_7d / supply+ velocity_annualized = velocity * 52 # Weekly to annual++ if velocity_annualized > 50:+ return "high_activity" # Very active usage, likely bull market+ elif velocity_annualized > 20:+ return "moderate_activity"+ elif velocity_annualized < 10:+ return "low_activity" # Stablecoins idle, bear market / accumulation+```++### 6. Chain-Level Stablecoin Distribution++Track where stablecoins are flowing across different blockchains:++| Chain | Primary Stablecoins | What Inflows Signal |+|-------|-------------------|---------------------|+| Ethereum | USDT, USDC, DAI | DeFi activity, institutional usage |+| Tron | USDT (dominant) | OTC trading, emerging market transfers |+| Solana | USDC | High-frequency DeFi, memecoin activity |+| Arbitrum | USDC, USDT | L2 DeFi growth |+| Base | USDC | Coinbase ecosystem growth |+| BSC | USDT, FDUSD | Binance ecosystem, retail trading |++**Cross-chain flow signals:**+- USDT migrating from Tron โ Ethereum: capital moving from OTC/P2P to DeFi (more sophisticated usage)+- Stablecoins flooding into Solana: memecoin season / speculative frenzy+- Stablecoins moving to L2s (Arbitrum, Base, Optimism): DeFi activity shifting to lower-cost chains++### 7. Composite Stablecoin Signal++```python+stablecoin_score = {+ "supply_growth": 0, # -2 to +2: 30-day total supply change+ "mint_burn_net": 0, # -2 to +2: recent large mint/burn events+ "exchange_reserves": 0, # -2 to +2: exchange stablecoin reserve change+ "dominance": 0, # -2 to +2: stablecoin dominance level (contrarian)+ "velocity": 0, # -2 to +2: on-chain activity level+}+# Total range: -10 to +10+# > +5: strong liquidity expansion โ bullish for crypto+# +2 to +5: moderate inflow โ mild bullish+# -2 to +2: neutral+# < -2: liquidity contraction โ bearish+# < -5: capital flight โ strong bearish+```++## Data Sources++| Source | Access | Data Available |+|--------|--------|---------------|+| DeFi Llama (Stablecoins page) | Free | Total supply by chain, mint/burn history |+| Glassnode | Paid (limited free) | Exchange reserves, on-chain velocity |+| CryptoQuant | Paid (limited free) | Exchange stablecoin reserves, flow metrics |+| Tether Transparency | Free | USDT reserves and attestation |+| Circle USDC Stats | Free | USDC supply and redemption data |+| Dune Analytics | Free | Custom stablecoin queries |+| Nansen | Paid | Smart money stablecoin flows |++Use `read_url` tool to access web-based data sources.++## Output Format++```+## Stablecoin Flow Analysis โ [Date Range]++### Supply Overview+| Stablecoin | Supply | 7d Change | 30d Change |+|------------|--------|-----------|------------|+| USDT | $XXX B | +X.X% | +X.X% |+| USDC | $XX B | +X.X% | +X.X% |+| Total | $XXX B | +X.X% | +X.X% |++### Mint/Burn Events (7 days)+- **Net minting**: +$X.X B+- **Largest events**: [Tether minted $500M on DATE, Circle burned $200M on DATE]+- **Signal**: [large capital inflow / mild / outflow]++### Exchange Reserves+- **Total stablecoins on exchanges**: $XX B+- **7d change**: [+/- X.X%]+- **Interpretation**: [buy power accumulating / deployed / withdrawn]++### Stablecoin Dominance+- **Current**: X.X%+- **30d ago**: X.X%+- **Signal**: [high cash = contrarian bullish / low cash = contrarian bearish]++### Chain Distribution Shifts+- **Inflow chains**: [Solana +$XM, Arbitrum +$XM]+- **Outflow chains**: [Tron -$XM]+- **Interpretation**: [DeFi expansion / speculative activity / capital consolidation]++### Composite Signal+| Dimension | Score (-2~+2) | Basis |+|-----------|---------------|-------|+| Supply growth | +2 | +4% in 30 days |+| Mint/burn | +1 | Net $1.2B minted this week |+| Exchange reserves | +1 | Reserves up 3% |+| Dominance | 0 | 8.5%, neutral range |+| Velocity | +1 | Rising on-chain activity |++### Market Implication+- **Liquidity outlook**: [expanding / stable / contracting]+- **Direction**: [bullish / neutral / bearish]+- **Key watch**: [next large mint event, USDC/USDT ratio trend]+```++## Notes++- Stablecoin supply data is publicly verifiable on-chain; it is one of the most transparent indicators in crypto+- USDT on Tron is heavily used for OTC and P2P trading in emerging markets; it does not necessarily correlate with exchange trading activity+- "Pre-minting" by Tether (minting to Tether treasury before distributing) creates false positive signals; track only exchange-deployed mints+- Stablecoin depegging events (e.g., USDC in March 2023) create temporary but severe market disruptions+- Regulatory actions on stablecoin issuers (BUSD shutdown, USDC regulatory clarity) can trigger supply shifts between stablecoins+- This framework is for research purposes only and does not constitute investment advicediff --git a/agent/src/skills/strategy-generate/SKILL.md b/agent/src/skills/strategy-generate/SKILL.mdnew file mode 100644index 000000000..9ec3cee20--- /dev/null+++ b/agent/src/skills/strategy-generate/SKILL.md@@ -0,0 +1,172 @@+---+name: strategy-generate+description: Create, modify, and optimize quantitative trading strategies, then backtest and evaluate them.+---++## Workflow++1. **Requirements parsing**: parse user intent, extract instrument codes, time range, and strategy logic, then write `config.json`+2. **Strategy design**: think through the 5 questions of data / signal / position sizing / backtest / validation+3. **Strategy coding**: write `code/signal_engine.py` (following the `SignalEngine` contract)+4. **Syntax check**: `bash("python -c \"import ast; ast.parse(open('code/signal_engine.py').read()); print('OK')\"")`+5. **Run backtest**: call the `backtest` tool (built into the engine; no need to write `run_backtest.py`)+6. **Evaluate results**: read `artifacts/metrics.csv` and judge by the review criteria+7. **Iterative fixing**: if results are poor, modify with `edit_file` โ run `backtest` โ re-evaluate++**You only need to write `signal_engine.py` and `config.json`. The `backtest` tool automatically handles data loading and backtest execution.**++## Requirements Parsing++Extract the following from the user's description:+- **Instrument codes**: process them according to the normalization rules below+- **Time range**: if the user does not specify dates, default to **10 years back from today** (for example, if today is `2026-03-18`, then `start_date=2016-03-18`, `end_date=2026-03-18`)+- **Strategy logic**: entry / exit conditions and indicator parameters++**If critical information is missing, you must ask the user instead of guessing:**+- Instrument not specified โ ask which instrument they want to backtest (offer several popular suggestions)+- Strategy description is vague (for example, "help me build a strategy") โ provide 2-3 strategy directions for the user to choose from+- Mixed markets but not clearly specified โ confirm the data source++**Write `config.json` first, then write code.** `config.json` must be placed in the root of `run_dir`.++## Strategy Design++Before writing code, think through these 5 questions:++1. **Data requirements**: what fields are needed (basic OHLCV only? or fundamentals such as `pe/pb/roe` as well?), data frequency (daily), and market (which determines the data source)+2. **Signal logic**: what are the entry conditions? What are the exit conditions? Direction (long / short / long-short)? Are there filters (volume, trend confirmation, and so on)?+3. **Position management**: equal-weight allocation or scaling in/out? Risk control (stop-loss, maximum position)? In portfolio strategies, once top N names are selected, each weight = 1/N+4. **Backtest parameters**: time range, initial capital (default 1,000,000), commission (default 0.1%)+5. **Validation checklist**: signal consistency (no NaN signals), position check (normalized to prevent leverage), and completeness of generated artifacts++There is no need to output a JSON design document. Express these design decisions directly in code.++## `SignalEngine` Contract++```python+class SignalEngine:+ def generate(self, data_map: Dict[str, pd.DataFrame]) -> Dict[str, pd.Series]:+ """+ Args:+ data_map: code -> DataFrame (columns: open, high, low, close, volume, DatetimeIndex)+ If config.extra_fields is specified, pe, pb, roe, and similar columns will also be present.+ Returns:+ code -> signal Series, value range [-1.0, 1.0]+ 1.0 = fully long, 0.5 = half position, 0.0 = flat, -1.0 = fully short+ Portfolio strategy: selected stocks split weights equally (for example top 10 -> each 0.1)+ Legacy integer signals {-1, 0, 1} remain compatible (treated as -100% / 0% / 100%)+ """+```++**Hard constraints:**+- The signal `Series` index must align exactly with the input `DataFrame` index+- Include all required imports (`numpy`, `pandas`, and so on)+- Do not hardcode dates or stock codes (read them from `config.json`)+- Do not include an `if __name__ == "__main__"` block+- Pure pandas / numpy implementation, with no external signal libraries+- Output plain Python code, not Markdown fences++## Quality Checklist++Self-check after writing `signal_engine.py`:+- [ ] All imports are included (`numpy`, `pandas`, `typing`, and so on)+- [ ] No undefined variables+- [ ] Signal logic is consistent with the strategy description+- [ ] Boundary handling: for empty data or insufficient history before the lookback window, use `fillna(0)` or skip+- [ ] Portfolio strategy: once N stocks are selected, each weight = 1/N (for example top 10 โ each 0.1), unselected names = 0+- [ ] Signal values stay within `[-1.0, 1.0]`++## Instrument Code Normalization++- 6-digit China A-share codes โ automatically append suffix: codes starting with `600/601/603` โ `.SH`, all others โ `.SZ`+- US stocks: uppercase letters + `.US`, such as `AAPL.US` (`yfinance` converts automatically)+- Hong Kong stocks: digits + `.HK`, such as `700.HK` (`yfinance` converts automatically)+- Cryptocurrencies: `BTC-USDT` format (OKX spot pairs, **must use the hyphen `-`, not slash `/`**)+ - The user may write `BTC/USDT`, but `config.json` must use `"BTC-USDT"`++## Cryptocurrency Notes++- **Code format**: must be `XXX-USDT` (uppercase + hyphen), such as `BTC-USDT` and `ETH-USDT`+- **source**: must be set to `"okx"`+- **extra_fields**: must be `null` (OKX does not support fundamentals)+- **Data format**: `DataLoader` has already normalized the output to match China A-shares exactly: `open, high, low, close, volume` + `DatetimeIndex`+- **No special handling needed in strategy code**: `signal_engine.py` should be written the same way as for China A-shares; do not add extra data conversion for OKX++## Market Detection and Data Sources++| Pattern | Market | source | Extra Fields |+|------|------|--------|----------|+| `^\d{6}\.(SZ\|SH\|BJ)$` | China A-shares | tushare | pe, pb, pe_ttm, ps_ttm, dv_ttm, total_mv, circ_mv, roe |+| `^[A-Z]+\.US$` | US stocks | yfinance | - |+| `^\d{3,5}\.HK$` | Hong Kong stocks | yfinance | - |+| `^[A-Z]+-USDT$` | Cryptocurrency | okx | - |++**`extra_fields` selection logic**: only China A-shares (`tushare`) support fundamentals. If the strategy needs `PE/PB/ROE` and similar fields, specify them in `config.json.extra_fields` and `DataLoader` will retrieve them automatically. Hong Kong stocks, US stocks, and crypto do not support `extra_fields`.++## `config.json` Format++```json+{+ "source": "auto",+ "codes": ["000001.SZ"],+ "start_date": "2016-03-18",+ "end_date": "2026-03-18",+ "interval": "1D",+ "initial_cash": 1000000,+ "commission": 0.001,+ "extra_fields": null,+ "optimizer": null,+ "optimizer_params": {},+ "engine": "daily"+}+```++- `source`: `"auto"` (recommended, auto-select by code format) / `"tushare"` / `"yfinance"` / `"okx"`+ - `"auto"` supports mixed instruments. For example, `["000001.SZ", "BTC-USDT"]` will be automatically routed to `tushare` and `okx`+- `interval`: candlestick interval, default `"1D"`. Supported values: `"1m"` / `"5m"` / `"15m"` / `"30m"` / `"1H"` / `"4H"` / `"1D"`+ - The annualization factor for minute backtests is inferred automatically from `source` (252 trading days for China A-shares, 365 calendar days for crypto)+ - Minute backtests can be very data-heavy. Recommended limits are no more than 30 days for `1m`, or 1 year for `1H`+- `extra_fields`: China A-shares can use values such as `["pe", "pb", "roe"]`; other markets should use `null`+- `optimizer`: optional, one of `"equal_volatility"` / `"risk_parity"` / `"mean_variance"` / `"max_diversification"` / `null` (equal-weight by default)+- `optimizer_params`: optimizer parameters, such as `{"lookback": 60}`. `mean_variance` additionally supports `{"risk_free": 0.0}`+- `engine`: backtest engine, default `"daily"`. For options strategies, set `"options"` (requires `OptionsSignalEngine`)+- `initial_cash`: default 1,000,000+- `commission`: default 0.1%++## Review Criteria++### Hard Gates (any failure โ `passed=false`)++1. `artifacts/metrics.csv` exists and is non-empty+2. `artifacts/equity.csv` exists and is non-empty+3. `exit_code == 0` (backtest exits normally)+4. The `equity` column in `equity.csv` contains no `NaN` values+5. `trade_count > 0` (zero trades = signal bug)++### Scoring Rules++- Successful backtest + complete artifacts + at least 1 trade โ `score โฅ 60` โ **passed**+- Poor return / low Sharpe alone should not push the score below 60; they are optimization suggestions only+- `score โฅ 60` = `passed=true`++### Bug Categories (reduce the score)++1. **Zero trades** (`trade_count=0`): signal-logic bug, conditions may be too strict+2. **Late first trade** (first trade > 2 years after backtest start): data-filtering bug or overly long lookback window+3. **Capital utilization < 50%**: position-management bug, portfolio is flat most of the time+4. **Open position at the end** (positions still open when backtest ends): exit-signal timing bug++### `action_items` Format++If improvements are needed after evaluation, write `action_items`:+- Format: `"Change X from A to B"` or `"Add X logic in signal_engine.py"`+- Must be specific down to parameter values, file names, and function names+- At least 2 items+- Examples:+ - `"Change short MA from 5 to 10 days to reduce whipsaw signals"`+ - `"Add stop-loss: force close when loss exceeds 5%"`+ - `"Add volume filter in signal_engine.py: only trigger buy on high volume"`++## Supporting Files++- [examples.md](examples.md) โ example call sequencediff --git a/agent/src/skills/strategy-generate/examples.md b/agent/src/skills/strategy-generate/examples.mdnew file mode 100644index 000000000..0edceea89--- /dev/null+++ b/agent/src/skills/strategy-generate/examples.md@@ -0,0 +1,49 @@+# Strategy Generate โ Examples++## Example 1: A-share dual MA crossover (tushare)++User: "็จ000001.SZๅๅๅ็บฟ้ๅ็ญ็ฅ๏ผ็ญๆ5ๆฅ้ฟๆ20ๆฅ๏ผๅๆต2024ๅนด"++Tool call sequence:+1. load_skill("strategy-generate") โ ่ทๅพๅทฅไฝๆตๆๅผ+2. write_file("config.json") โ ้ ็ฝฎๆ ็/ๆฅๆ/ๅๆฐ+ ```json+ {"source": "tushare", "codes": ["000001.SZ"], "start_date": "2024-01-01", "end_date": "2024-12-31", "initial_cash": 1000000, "commission": 0.001, "extra_fields": null}+ ```+3. write_file("code/signal_engine.py") โ ๅๅ็บฟ็ญ็ฅไปฃ็ +4. bash("python -c \"import ast; ast.parse(open('code/signal_engine.py').read()); print('OK')\"") โ AST ่ฏญๆณๆฃๆฅ+5. backtest(run_dir=...) โ ๆง่กๅๆต๏ผๅผๆๅ ็ฝฎ๏ผ+6. read_file("artifacts/metrics.csv") โ ๆฅ็็ปๆ๏ผๆ่ฏๅฎกๆ ๅๅคๆญ+7. (ๅฆ้ไฟฎๅค) edit_file("code/signal_engine.py", ...) โ backtest โ read_file++## Example 2: US stock RSI strategy (yfinance)++User: "Build RSI strategy on AAPL, buy when RSI<30 sell when RSI>70, backtest 2024"++Tool call sequence:+1. load_skill("strategy-generate") โ ่ทๅพๅทฅไฝๆตๆๅผ+2. write_file("config.json") โ ้ ็ฝฎ+ ```json+ {"source": "yfinance", "codes": ["AAPL.US"], "start_date": "2024-01-01", "end_date": "2024-12-31", "initial_cash": 1000000, "commission": 0.001, "extra_fields": null}+ ```+3. write_file("code/signal_engine.py") โ RSI ็ญ็ฅไปฃ็ +4. bash("python -c \"import ast; ast.parse(open('code/signal_engine.py').read()); print('OK')\"") โ AST ๆฃๆฅ+5. backtest(run_dir=...) โ ๆง่กๅๆต๏ผๅผๆๅ ็ฝฎ๏ผ+6. read_file("artifacts/metrics.csv") โ ๆฅ็็ปๆ+7. (ๅฆ้ไฟฎๅค) edit_file โ backtest โ read_file++## Example 3: Crypto trend strategy (okx)++User: "BTC-USDT่ถๅฟ่ท่ธช็ญ็ฅ๏ผๅๆต2024ๅนด"++Tool call sequence:+1. load_skill("strategy-generate") โ ่ทๅพๅทฅไฝๆตๆๅผ+2. write_file("config.json") โ ้ ็ฝฎ+ ```json+ {"source": "okx", "codes": ["BTC-USDT"], "start_date": "2024-01-01", "end_date": "2024-12-31", "initial_cash": 1000000, "commission": 0.001, "extra_fields": null}+ ```+3. write_file("code/signal_engine.py") โ ่ถๅฟ็ญ็ฅไปฃ็ +4. bash("python -c \"import ast; ast.parse(open('code/signal_engine.py').read()); print('OK')\"") โ AST ๆฃๆฅ+5. backtest(run_dir=...) โ ๆง่กๅๆต๏ผๅผๆๅ ็ฝฎ๏ผ+6. read_file("artifacts/metrics.csv") โ ๆฅ็็ปๆ+7. (ๅฆ้ไฟฎๅค) edit_file โ backtest โ read_filediff --git a/agent/src/skills/technical-basic/SKILL.md b/agent/src/skills/technical-basic/SKILL.mdnew file mode 100644index 000000000..734a9e2db--- /dev/null+++ b/agent/src/skills/technical-basic/SKILL.md@@ -0,0 +1,56 @@+---+name: technical-basic+description: Core technical indicator collection (trend EMA/ADX + mean-reversion BB/RSI + volume-price OBV/volume ratio), generates a composite signal via three-dimensional voting. Pure pandas implementation for any OHLCV data.+---+# Core Technical Indicator Collection++## Purpose++Combines three classic Western technical analysis approaches into one composite signal engine:++| Dimension | Indicators | Purpose |+|------|------|------|+| Trend | EMA(12/26) + ADX(14) | Determine direction and trend strength |+| Mean reversion | Bollinger Bands(20,2) + RSI(14) | Detect overbought and oversold conditions |+| Volume-price | OBV + volume ratio | Confirm volume participation |++## Signal Logic++Three-dimensional voting mechanism:+- **Long**: trend is bullish + RSI is not overbought + OBV is rising+- **Short**: trend is bearish + RSI is not oversold + OBV is falling+- **Stand aside**: mixed signals++## Key Implementation Details++- RSI and ADX use **Wilder EWM** (`ewm(alpha=1/period)`), not a rolling mean+- Full ADX chain: +DM/-DM โ TR โ +DI/-DI โ DX โ ADX+- OBV = `(volume * sign(close.diff())).cumsum()`++## Parameters++All parameters have default values and can be overridden at instantiation time:++| Parameter | Default | Description |+|------|--------|------|+| ema_fast | 12 | Fast EMA period |+| ema_slow | 26 | Slow EMA period |+| adx_period | 14 | ADX calculation period |+| adx_threshold | 25.0 | ADX trend-strength threshold |+| bb_window | 20 | Bollinger Band window |+| bb_std | 2.0 | Bollinger Band standard deviation multiplier |+| rsi_period | 14 | RSI period |+| rsi_oversold | 30 | RSI oversold threshold |+| rsi_overbought | 70 | RSI overbought threshold |+| vol_ma_period | 20 | Volume moving-average period |+| obv_ma_period | 20 | OBV moving-average period |++## Dependencies++```bash+pip install pandas numpy requests+```++## Signal Convention++- `1` = long, `-1` = short, `0` = stand asidediff --git a/agent/src/skills/technical-basic/example_signal_engine.py b/agent/src/skills/technical-basic/example_signal_engine.pynew file mode 100644index 000000000..219585486--- /dev/null+++ b/agent/src/skills/technical-basic/example_signal_engine.py@@ -0,0 +1,302 @@+"""ๆๆฏ้ขๅบ็กๆๆ ๅ้ไฟกๅทๅผๆใ++ๅฐ่ถๅฟ๏ผEMA/ADX๏ผใๅๅผๅๅฝ๏ผBB/RSI๏ผใ้ไปท๏ผOBV/้ๆฏ๏ผไธ็ปดๅบฆๅๅนถ๏ผ+้่ฟๆ็ฅจๆบๅถ็ๆ็ปผๅไบคๆไฟกๅทใ็บฏ pandas ๅฎ็ฐ๏ผ้็จไบไปปไฝ OHLCV ๆฐๆฎใ+"""++from typing import Dict++import numpy as np+import pandas as pd+++def compute_rsi(close: pd.Series, period: int = 14) -> pd.Series:+ """่ฎก็ฎ RSI๏ผWilder EWM ๅนณๆป๏ผใ++ Args:+ close: ๆถ็ไปทๅบๅใ+ period: RSI ๅจๆใ++ Returns:+ RSI ๅผๅบๅ๏ผ่ๅด 0-100ใ+ """+ delta = close.diff()+ gain = delta.clip(lower=0)+ loss = (-delta).clip(lower=0)+ avg_gain = gain.ewm(alpha=1 / period, min_periods=period).mean()+ avg_loss = loss.ewm(alpha=1 / period, min_periods=period).mean()+ rs = avg_gain / avg_loss+ return 100 - 100 / (1 + rs)+++def compute_adx(+ high: pd.Series, low: pd.Series, close: pd.Series, period: int = 14+) -> pd.DataFrame:+ """่ฎก็ฎ ADX ๅ +DI/-DI๏ผWilder EWM ๅนณๆปๅ จ้พ่ทฏ๏ผใ++ ้พ่ทฏ๏ผ+DM/-DM โ TR โ Wilder ๅนณๆป โ +DI/-DI โ DX โ ADXใ++ Args:+ high: ๆ้ซไปทๅบๅใ+ low: ๆไฝไปทๅบๅใ+ close: ๆถ็ไปทๅบๅใ+ period: ADX ๅจๆใ++ Returns:+ ๅ ๅซ plus_diใminus_diใadx ๅ็ DataFrameใ+ """+ prev_high = high.shift(1)+ prev_low = low.shift(1)+ prev_close = close.shift(1)++ # +DM / -DM+ up_move = high - prev_high+ down_move = prev_low - low++ plus_dm = pd.Series(0.0, index=high.index)+ minus_dm = pd.Series(0.0, index=high.index)+ plus_dm[(up_move > down_move) & (up_move > 0)] = up_move+ minus_dm[(down_move > up_move) & (down_move > 0)] = down_move++ # True Range+ tr1 = high - low+ tr2 = (high - prev_close).abs()+ tr3 = (low - prev_close).abs()+ tr = pd.concat([tr1, tr2, tr3], axis=1).max(axis=1)++ # Wilder ๅนณๆป+ alpha = 1 / period+ smoothed_tr = tr.ewm(alpha=alpha, min_periods=period).mean()+ smoothed_plus_dm = plus_dm.ewm(alpha=alpha, min_periods=period).mean()+ smoothed_minus_dm = minus_dm.ewm(alpha=alpha, min_periods=period).mean()++ # +DI / -DI+ plus_di = 100 * smoothed_plus_dm / smoothed_tr+ minus_di = 100 * smoothed_minus_dm / smoothed_tr++ # DX โ ADX+ di_sum = plus_di + minus_di+ di_sum = di_sum.replace(0, np.nan)+ dx = 100 * (plus_di - minus_di).abs() / di_sum+ adx = dx.ewm(alpha=alpha, min_periods=period).mean()++ return pd.DataFrame({"plus_di": plus_di, "minus_di": minus_di, "adx": adx})+++def compute_bollinger(+ close: pd.Series, window: int = 20, num_std: float = 2.0+) -> pd.DataFrame:+ """่ฎก็ฎๅธๆๅธฆใ++ Args:+ close: ๆถ็ไปทๅบๅใ+ window: ็งปๅจๅนณๅ็ชๅฃใ+ num_std: ๆ ๅๅทฎๅๆฐใ++ Returns:+ ๅ ๅซ bb_midใbb_upperใbb_lower ๅ็ DataFrameใ+ """+ mid = close.rolling(window).mean()+ std = close.rolling(window).std()+ return pd.DataFrame({+ "bb_mid": mid,+ "bb_upper": mid + num_std * std,+ "bb_lower": mid - num_std * std,+ })+++def compute_obv(close: pd.Series, volume: pd.Series) -> pd.Series:+ """่ฎก็ฎ OBV๏ผ่ฝ้ๆฝฎๆๆ ๏ผใ++ Args:+ close: ๆถ็ไปทๅบๅใ+ volume: ๆไบค้ๅบๅใ++ Returns:+ OBV ๅบๅใ+ """+ sign = close.diff().apply(lambda x: 1 if x > 0 else (-1 if x < 0 else 0))+ return (volume * sign).cumsum()+++class SignalEngine:+ """ๆๆฏ้ขๅบ็กๆๆ ๅ้ไฟกๅทๅผๆใ++ ไธ็ปดๅบฆๆ็ฅจ๏ผ่ถๅฟ๏ผEMAไบคๅ+ADXๅผบๅบฆ๏ผใๅๅผๅๅฝ๏ผBB+RSI๏ผใ้ไปท๏ผOBV+้ๆฏ๏ผ๏ผ+ ็ปผๅ็ๆๅๅค/ๅ็ฉบ/่งๆไฟกๅทใ++ Attributes:+ ema_fast: ๅฟซ็บฟ EMA ๅจๆใ+ ema_slow: ๆ ข็บฟ EMA ๅจๆใ+ adx_period: ADX ่ฎก็ฎๅจๆใ+ adx_threshold: ADX ่ถๅฟๅผบๅบฆ้ๅผใ+ bb_window: ๅธๆๅธฆ็ชๅฃใ+ bb_std: ๅธๆๅธฆๆ ๅๅทฎๅๆฐใ+ rsi_period: RSI ๅจๆใ+ rsi_oversold: RSI ่ถ ๅ้ๅผใ+ rsi_overbought: RSI ่ถ ไนฐ้ๅผใ+ vol_ma_period: ๆไบค้ๅ็บฟๅจๆใ+ obv_ma_period: OBV ๅ็บฟๅจๆใ++ Example:+ >>> engine = SignalEngine()+ >>> signals = engine.generate({"BTC-USDT": df})+ >>> signals["BTC-USDT"].value_counts()+ """++ def __init__(+ self,+ ema_fast: int = 12,+ ema_slow: int = 26,+ adx_period: int = 14,+ adx_threshold: float = 25.0,+ bb_window: int = 20,+ bb_std: float = 2.0,+ rsi_period: int = 14,+ rsi_oversold: float = 30,+ rsi_overbought: float = 70,+ vol_ma_period: int = 20,+ obv_ma_period: int = 20,+ ):+ """ๅๅงๅๆๆฏ้ขไฟกๅทๅผๆใ++ Args:+ ema_fast: ๅฟซ็บฟ EMA ๅจๆใ+ ema_slow: ๆ ข็บฟ EMA ๅจๆใ+ adx_period: ADX ่ฎก็ฎๅจๆใ+ adx_threshold: ADX ่ถๅฟๅผบๅบฆ้ๅผใ+ bb_window: ๅธๆๅธฆ็ชๅฃใ+ bb_std: ๅธๆๅธฆๆ ๅๅทฎๅๆฐใ+ rsi_period: RSI ๅจๆใ+ rsi_oversold: RSI ่ถ ๅ้ๅผใ+ rsi_overbought: RSI ่ถ ไนฐ้ๅผใ+ vol_ma_period: ๆไบค้ๅ็บฟๅจๆใ+ obv_ma_period: OBV ๅ็บฟๅจๆใ+ """+ self.ema_fast = ema_fast+ self.ema_slow = ema_slow+ self.adx_period = adx_period+ self.adx_threshold = adx_threshold+ self.bb_window = bb_window+ self.bb_std = bb_std+ self.rsi_period = rsi_period+ self.rsi_oversold = rsi_oversold+ self.rsi_overbought = rsi_overbought+ self.vol_ma_period = vol_ma_period+ self.obv_ma_period = obv_ma_period++ def generate(self, data_map: Dict[str, pd.DataFrame]) -> Dict[str, pd.Series]:+ """ๆ นๆฎไธ็ปดๅบฆๆๆ ๆ็ฅจ็ๆไบคๆไฟกๅทใ++ Args:+ data_map: ๆ ็ไปฃ็ ๅฐ OHLCV DataFrame ็ๆ ๅฐใ+ DataFrame ้ๅ ๅซ open/high/low/close/volume ๅ๏ผindex ไธบ datetimeใ++ Returns:+ ๆ ็ไปฃ็ ๅฐไฟกๅท Series ็ๆ ๅฐ๏ผ1=ๅๅค, -1=ๅ็ฉบ, 0=่งๆ๏ผใ+ """+ result = {}+ for code, df in data_map.items():+ result[code] = self._generate_one(df)+ return result++ def _generate_one(self, df: pd.DataFrame) -> pd.Series:+ """ๅฏนๅไธชๆ ็็ๆไฟกๅทใ++ Args:+ df: OHLCV DataFrame๏ผindex ไธบ datetimeใ++ Returns:+ ไฟกๅท Series๏ผ1=ๅๅค, -1=ๅ็ฉบ, 0=่งๆ๏ผใ+ """+ close = df["close"]+ high = df["high"]+ low = df["low"]+ volume = df["volume"]++ # --- ่ถๅฟ็ปดๅบฆ ---+ ema_f = close.ewm(span=self.ema_fast, adjust=False).mean()+ ema_s = close.ewm(span=self.ema_slow, adjust=False).mean()+ adx_df = compute_adx(high, low, close, self.adx_period)+ adx = adx_df["adx"]++ trend_bull = (ema_f > ema_s) & (adx > self.adx_threshold)+ trend_bear = (ema_f < ema_s) & (adx > self.adx_threshold)++ # --- ๅๅผๅๅฝ็ปดๅบฆ ---+ bb = compute_bollinger(close, self.bb_window, self.bb_std)+ rsi = compute_rsi(close, self.rsi_period)++ mr_oversold = (close < bb["bb_lower"]) & (rsi < self.rsi_oversold)+ mr_overbought = (close > bb["bb_upper"]) & (rsi > self.rsi_overbought)++ # --- ้ไปท็ปดๅบฆ ---+ obv = compute_obv(close, volume)+ obv_ma = obv.rolling(self.obv_ma_period).mean()++ vol_bull = obv > obv_ma+ vol_bear = obv < obv_ma++ # --- ไธ็ปดๅบฆๆ็ฅจ ---+ buy = (trend_bull | mr_oversold) & vol_bull & ~mr_overbought+ sell = (trend_bear | mr_overbought) & vol_bear & ~mr_oversold++ signal = buy.astype(int) - sell.astype(int)+ signal = signal.fillna(0).astype(int)+ return signal+++def _fetch_okx(inst_id: str, bar: str = "1D", limit: int = 300) -> pd.DataFrame:+ """ไป OKX API ่ทๅ K ็บฟๆฐๆฎใ++ Args:+ inst_id: ไบคๆๅฏนๆ ่ฏ๏ผๅฆ "BTC-USDT"ใ+ bar: K ็บฟๅจๆ๏ผ้ป่ฎค "1D"ใ+ limit: ่ทๅๆ นๆฐ๏ผ้ป่ฎค 300ใ++ Returns:+ OHLCV DataFrame๏ผindex ไธบ datetimeใ+ """+ import requests++ resp = requests.get(+ "https://www.okx.com/api/v5/market/candles",+ params={"instId": inst_id, "bar": bar, "limit": str(limit)},+ )+ candles = resp.json()["data"]+ columns = [+ "ts", "open", "high", "low", "close",+ "vol", "volCcy", "volCcyQuote", "confirm",+ ]+ df = pd.DataFrame(reversed(candles), columns=columns)+ df["ts"] = pd.to_datetime(df["ts"].astype("int64"), unit="ms")+ df = df.set_index("ts")+ for col in ["open", "high", "low", "close"]:+ df[col] = df[col].astype(float)+ df["volume"] = df["vol"].astype(float)+ return df+++if __name__ == "__main__":+ symbols = ["BTC-USDT", "ETH-USDT", "SOL-USDT"]+ data_map = {}+ for sym in symbols:+ print(f"Fetching {sym} ...")+ data_map[sym] = _fetch_okx(sym, bar="1D", limit=300)++ engine = SignalEngine()+ signals = engine.generate(data_map)++ for sym in symbols:+ sig = signals[sym]+ n_bars = len(data_map[sym])+ buys = sig[sig == 1]+ sells = sig[sig == -1]+ print(f"\n{sym} ({n_bars} bars)")+ print(f" Buy signals: {len(buys)}")+ print(f" Sell signals: {len(sells)}")+ print(f" Neutral: {n_bars - len(buys) - len(sells)}")+ if len(buys) > 0:+ print(f" Last buy: {buys.index[-1]:%Y-%m-%d}")+ if len(sells) > 0:+ print(f" Last sell: {sells.index[-1]:%Y-%m-%d}")diff --git a/agent/src/skills/token-unlock-treasury/SKILL.md b/agent/src/skills/token-unlock-treasury/SKILL.mdnew file mode 100644index 000000000..caa6e0f58--- /dev/null+++ b/agent/src/skills/token-unlock-treasury/SKILL.md@@ -0,0 +1,271 @@+---+name: token-unlock-treasury+description: Token unlock schedule analysis and project treasury tracking โ vesting cliffs, linear unlocks, team/investor/ecosystem token releases, treasury diversification, and sell pressure forecasting.+---+# Token Unlock & Treasury Analysis++## Overview++Track token vesting schedules, upcoming unlock events, and project treasury holdings to forecast sell pressure and assess project sustainability. Token unlocks are one of the most predictable and high-impact supply-side events in crypto โ large unlocks consistently create short-term selling pressure.++## Core Concepts++### 1. Token Distribution Taxonomy++**Standard allocation categories:**++| Category | Typical % | Lock Period | Vesting | Sell Pressure Risk |+|----------|-----------|------------|---------|-------------------|+| Team / Founders | 15-25% | 12-24 months cliff | 2-4 year linear | High (sell to fund lifestyle / diversify) |+| Investors (Seed) | 5-15% | 6-12 months cliff | 1-2 year linear | Very high (VC fund lifecycle: must return capital) |+| Investors (Series A+) | 10-20% | 6-12 months cliff | 1-2 year linear | Very high |+| Ecosystem / Community | 20-40% | Variable | Ongoing emissions | Medium (depends on incentive design) |+| Treasury / Foundation | 10-20% | None (discretionary) | DAO-governed | Low-medium (depends on governance) |+| Public Sale / Airdrop | 5-15% | None | Immediately liquid | Initial dump, then stabilizes |+| Advisors | 2-5% | 6-12 months cliff | 1-2 year linear | Medium |++### 2. Unlock Event Types++**Cliff unlock:**+- Large one-time release after lock period expires+- Most impactful: 5-30% of supply unlocking in a single event+- Typical impact: -5% to -20% price decline in the 7 days around a cliff unlock++**Linear / continuous unlock:**+- Steady stream of tokens released over time (daily/weekly/monthly)+- Creates persistent but predictable sell pressure+- Impact depends on rate relative to trading volume++**Milestone-based unlock:**+- Triggered by protocol metrics (TVL target, user count, etc.)+- Less predictable but usually positive signal (means protocol is growing)++### 3. Unlock Impact Assessment++```python+def assess_unlock_impact(unlock_amount, circulating_supply, daily_volume, recipient_type):+ """+ Assess the market impact of an upcoming token unlock.+ """+ # Unlock as % of circulating supply+ supply_pct = unlock_amount / circulating_supply * 100++ # Unlock as multiple of daily volume+ volume_multiple = unlock_amount / daily_volume++ # Base impact score+ if supply_pct > 10:+ base_impact = "critical" # >10% of supply = very high impact+ elif supply_pct > 5:+ base_impact = "high"+ elif supply_pct > 2:+ base_impact = "medium"+ elif supply_pct > 0.5:+ base_impact = "low"+ else:+ base_impact = "negligible"++ # Adjust for recipient type (who receives the tokens)+ recipient_multiplier = {+ "team": 0.7, # Team sells ~70% within 6 months historically+ "investor_seed": 0.8, # VCs must return capital, sell aggressively+ "investor_later": 0.6,+ "ecosystem": 0.3, # Ecosystem tokens often re-staked or used+ "treasury": 0.2, # Treasury rarely dumps (governance constraints)+ "community": 0.5, # Mixed behavior+ }++ effective_sell_pressure = supply_pct * recipient_multiplier.get(recipient_type, 0.5)++ # Volume absorption capacity+ if volume_multiple > 5:+ absorption = "illiquid" # Market cannot absorb easily+ elif volume_multiple > 2:+ absorption = "difficult"+ elif volume_multiple > 0.5:+ absorption = "manageable"+ else:+ absorption = "easily_absorbed"++ return {+ "supply_impact_pct": supply_pct,+ "base_impact": base_impact,+ "effective_sell_pct": effective_sell_pressure,+ "volume_absorption": absorption,+ }+```++### 4. Historical Unlock Price Patterns++**Empirical observations (2021-2025 data):**++| Unlock Size (% of circ.) | Pre-unlock (7d) | Post-unlock (7d) | Post-unlock (30d) |+|--------------------------|-----------------|------------------|-------------------|+| >10% | -8 to -15% | -5 to -20% | -10 to -30% (often no recovery) |+| 5-10% | -3 to -8% | -3 to -10% | Mixed (depends on market regime) |+| 2-5% | -1 to -5% | -2 to -5% | Usually recovers within 30d |+| <2% | Minimal | -1 to -3% | Negligible long-term impact |++**Key patterns:**+1. **Pre-unlock front-running**: market starts selling 3-7 days before known unlock dates+2. **Post-unlock recovery**: if broader market is bullish, 2-5% unlocks often fully recover within 2-4 weeks+3. **Continuous unlock drag**: tokens with >5% monthly emission rate tend to underperform BTC by 10-20% annualized+4. **Cliff + bear market = disaster**: large cliff unlocks during bear markets create cascading selling++### 5. Treasury Health Analysis++**Treasury assessment framework:**++```python+treasury_health = {+ "total_value_usd": 500_000_000, # Total treasury value+ "runway_months": 36, # Treasury / monthly burn+ "diversification": {+ "native_token_pct": 60, # % held in own token (risky)+ "stablecoins_pct": 25, # USDC/USDT/DAI (safe)+ "eth_btc_pct": 10, # Blue-chip crypto+ "other_pct": 5, # Other assets+ },+ "monthly_burn_usd": 5_000_000, # Operating expenses per month+ "revenue_coverage": 0.6, # Revenue / burn ratio+}++def treasury_signal(health):+ # Runway assessment+ if health["runway_months"] < 12:+ runway_signal = "critical" # Less than 1 year of funding+ elif health["runway_months"] < 24:+ runway_signal = "concerning"+ else:+ runway_signal = "healthy"++ # Diversification assessment+ native_pct = health["diversification"]["native_token_pct"]+ if native_pct > 80:+ diversity_signal = "concentrated_risk" # Treasury value crashes with token price+ elif native_pct > 50:+ diversity_signal = "moderate_risk"+ else:+ diversity_signal = "diversified" # Healthy treasury management++ # Revenue sustainability+ if health["revenue_coverage"] > 1.0:+ revenue_signal = "self_sustaining" # Revenue covers all expenses+ elif health["revenue_coverage"] > 0.5:+ revenue_signal = "partially_funded"+ else:+ revenue_signal = "treasury_dependent" # Fully reliant on treasury++ return runway_signal, diversity_signal, revenue_signal+```++**Red flags in treasury management:**+1. Treasury >80% in native token โ death spiral risk (token drops โ treasury drops โ must sell more)+2. Runway < 12 months โ protocol may cut development or do emergency token sale+3. Large OTC sales by treasury โ dilution signal (often sold at 20-30% discount)+4. Treasury spending on non-core activities (acquisitions, marketing burns) โ poor capital allocation+5. No revenue or declining revenue โ unsustainable token emissions subsidizing usage++### 6. Emission Rate Analysis++```python+def emission_analysis(token):+ """Analyze ongoing token emission sustainability."""+ # Monthly emission rate+ monthly_new_tokens = token.monthly_unlock + token.staking_rewards + token.mining_rewards+ monthly_emission_pct = monthly_new_tokens / token.circulating_supply * 100++ # Inflation-adjusted real yield+ staking_yield_nominal = token.staking_apy+ inflation_rate = monthly_emission_pct * 12 # Annualized+ real_yield = staking_yield_nominal - inflation_rate++ # Assessment+ if monthly_emission_pct > 5:+ emission_verdict = "hyperinflation" # Unsustainable+ elif monthly_emission_pct > 2:+ emission_verdict = "high_inflation" # Significant dilution+ elif monthly_emission_pct > 0.5:+ emission_verdict = "moderate" # Manageable+ else:+ emission_verdict = "low_emission" # Minimal dilution++ if real_yield < 0:+ yield_verdict = "negative_real_yield" # Staking rewards < inflation = value destruction+ else:+ yield_verdict = "positive_real_yield"++ return emission_verdict, yield_verdict, real_yield+```++### 7. Major Protocol Unlock Calendars++**Tier 1 protocols to track:**++| Protocol | Token | Key Unlock Events | Data Source |+|----------|-------|-------------------|-------------|+| Solana | SOL | Foundation + early investor unlocks | Token Unlocks |+| Aptos | APT | Monthly investor/team unlocks | Token Unlocks |+| Arbitrum | ARB | Massive team + investor cliff (Mar 2025) | Token Unlocks |+| Sui | SUI | Investor and contributor unlocks | Token Unlocks |+| Celestia | TIA | Investor cliff unlock | Token Unlocks |+| Starknet | STRK | Large early investor vesting | Token Unlocks |+| Optimism | OP | Ongoing core contributor vesting | Token Unlocks |+| dYdX | DYDX | Trading rewards + team vesting | Token Unlocks |++**Data sources:**+- tokenunlocks.app โ most comprehensive unlock calendar+- messari.io/asset/{token}/profile โ tokenomics breakdown+- Protocol governance forums โ treasury proposals and spending++## Output Format++```+## Token Unlock & Treasury Analysis โ [Protocol/Token]++### Tokenomics Overview+- **Total supply**: X,XXX,XXX,XXX+- **Circulating supply**: X,XXX,XXX,XXX (X% of total)+- **Fully diluted valuation (FDV)**: $X.XB+- **Market cap / FDV ratio**: X.X% (lower = more future dilution)++### Upcoming Unlocks (next 90 days)+| Date | Amount | % of Circ. | Recipient | Impact |+|------|--------|-----------|-----------|--------|+| YYYY-MM-DD | X,XXX,XXX | X.X% | Team | High |+| YYYY-MM-DD | X,XXX,XXX | X.X% | Investor | Medium |++### Emission Rate+- **Monthly new supply**: X.X% of circulating+- **Annualized inflation**: X.X%+- **Staking nominal yield**: X.X%+- **Real yield (yield - inflation)**: X.X%+- **Verdict**: [hyperinflation / high / moderate / low]++### Treasury Health+- **Total value**: $XXX M+- **Composition**: X% native token, X% stablecoins, X% ETH/BTC+- **Monthly burn**: $X.X M+- **Runway**: XX months+- **Revenue coverage**: X.X%+- **Diversification risk**: [concentrated / moderate / diversified]++### Sell Pressure Forecast+- **Next 30 days**: [X tokens unlocking โ $X.XM at current price โ X days of volume]+- **Next 90 days**: [summary]+- **Absorption capacity**: [easily / manageable / difficult / illiquid]++### Signal+- **Short-term (pre-unlock)**: [avoid / reduce / hold / accumulate]+- **Medium-term (post-unlock)**: [recovery expected / persistent pressure / unclear]+- **Long-term (tokenomics health)**: [sustainable / concerning / unsustainable]+```++## Notes++- Token unlock data requires external sources (tokenunlocks.app, protocol docs); not available via OKX API+- Unlock dates can change if governance votes to modify vesting schedules+- Market cap / FDV ratio < 30% means >70% of tokens are still locked โ significant future dilution risk+- Always compare unlock impact relative to daily trading volume, not just supply percentage+- Some protocols have buyback / burn mechanisms that offset emissions โ check net inflation, not gross+- This framework is for research purposes only and does not constitute investment advicediff --git a/agent/src/skills/tushare/SKILL.md b/agent/src/skills/tushare/SKILL.mdnew file mode 100644index 000000000..b4c7dc059--- /dev/null+++ b/agent/src/skills/tushare/SKILL.md@@ -0,0 +1,287 @@+---+name: tushare+description: tushareๆฏไธไธช่ดข็ปๆฐๆฎๆฅๅฃๅ ๏ผๆฅๆไธฐๅฏ็ๆฐๆฎๅ ๅฎน๏ผๅฆ่ก็ฅจใๅบ้ใๆ่ดงใๆฐๅญ่ดงๅธ็ญ่กๆ ๆฐๆฎ๏ผๅ ฌๅธ่ดขๅกใๅบ้็ป็็ญๅบๆฌ้ขๆฐๆฎใ่ฏฅๆจกๅ้่ฟๆ ๅๅAPIๆนๅผ็ปไธไบๆฐๆฎ่ตไบง็ๅฏนๅคๆๅกๆนๅผ๏ผไปฅๅธฎๅฉๆ้่ฆ็ๆๆฏ็จๆทๆดๅฎๆถใ็ฎๆดใ่ฝป้็ไฝฟ็จ็ธๅ ณๆฐๆฎใ+---+# Tushare++## ๆฆ่ฟฐ++tushareๆฏไธไธช่ดข็ปๆฐๆฎๆฅๅฃๅ ๏ผๆฅๆไธฐๅฏ็ๆฐๆฎๅ ๅฎน๏ผๅฆ่ก็ฅจใๅบ้ใๆ่ดงใๆฐๅญ่ดงๅธ็ญ่กๆ ๆฐๆฎ๏ผๅ ฌๅธ่ดขๅกใๅบ้็ป็็ญๅบๆฌ้ขๆฐๆฎใ่ฏฅๆจกๅ้่ฟๆ ๅๅAPIๆนๅผ็ปไธไบๆฐๆฎ่ตไบง็ๅฏนๅคๆๅกๆนๅผ๏ผไปฅๅธฎๅฉๆ้่ฆ็ๆๆฏ็จๆทๆดๅฎๆถใ็ฎๆดใ่ฝป้็ไฝฟ็จ็ธๅ ณๆฐๆฎใ++## ๅฟซ้ไธๆ++- ๅฎ่ฃ python่ฟ่ก็ฏๅข(ๆจ่python3.7+)๏ผๅนถๅฎ่ฃ tushareไพ่ตๅ (ๆจ่ไปๆธ ๅpypi้ๅๅฎ่ฃ )ใ++```bash+pip install tushare -i https://pypi.tuna.tsinghua.edu.cn/simple+```++- Tushareๅฎ็ฝๆณจๅ๏ผ่ทๅtoken๏ผๅนถ้ ็ฝฎ็ฏๅขๅ้ใ [ๆณจๅๅฐๅ](https://tushare.pro/register)++```bash+export TUSHARE_TOKEN=your_token+```++- ๆฅ่ฏขTushareๆฅๅฃๆๆกฃ๏ผๆพๅฐๅฏนๅบ็ๆฅๅฃใ [ๅจ็บฟๆฐๆฎๆฅๅฃๆๆกฃ](https://tushare.pro/document/2)+- ๆ นๆฎๆฅๅฃๆๆกฃ๏ผไฝฟ็จpythonไปฃ็ ่ทๅๆฐๆฎใ๏ผๅฆ**่ก็ฅจๅ่กจ**ๆฅๅฃ๏ผ++```python+import os+import tushare as ts++# ่ฏปๅ็ฏๅขๅ้ไธญ็token, ๆ่ ่ฏปๅๆฌๅฐ่ฎฐๅฝ็token+token = os.getenv('TUSHARE_TOKEN') or ts.get_token()++# ๅๅงๅproๆฅๅฃๅฎไพ+pro = ts.pro_api(token)++# ๆฅ่ฏขๆฐๆฎๆฅๅฃ๏ผ*่ก็ฅจๅ่กจ*๏ผ๏ผ่ทๅไธๅธไบคๆ็่ก็ฅจๅ่กจ+df = pro.stock_basic(list_status='L', fields='ts_code,symbol,name,area,industry,list_date')+print(df)+```++## ๅๆฐๆ ผๅผ่ฏดๆ++- ๆฅๆ๏ผYYYYMMDD๏ผๅฆ 20241231๏ผ+- ่ก็ฅจไปฃ็ ๏ผts_code ๆ ผๅผ๏ผๅฆ 000001.SZ, 600000.SH๏ผ+- ่ฟๅๆ ผๅผ๏ผpandas DataFrame++## python่ๆฌ็คบไพ++- [่ก็ฅจๆฐๆฎ่ทๅ็คบไพ](scripts/stock_data_example.py)+- [ๅบ้ๆฐๆฎ่ทๅ็คบไพ](scripts/fund_data_example.py)++## ๆฐๆฎๆฅๅฃๅ่กจ+++| ID | ๆฅๅฃๅ | ๆ ้ข(่ฏฆ็ปๆๆกฃ) | ๅ็ฑป | ๆ่ฟฐ |+| ----: | :------------------- | :--------------------------------------------------------------------------------------------------------- | :---------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |+| 416 | rt_min | [ETFๅฎๆถๅ้](references/ETFไธ้ข/ETFๅฎๆถๅ้.md) | ETFไธ้ข | ่ทๅETFๅฎๆถๅ้ๆฐๆฎ๏ผๅ ๆฌ1~60min |+| 400 | rt_etf_k | [ETFๅฎๆถๆฅ็บฟ](references/ETFไธ้ข/ETFๅฎๆถๆฅ็บฟ.md) | ETFไธ้ข | ่ทๅETFๅฎๆถๆฅk็บฟ่กๆ ๏ผๆฏๆๆETFไปฃ็ ๆไปฃ็ ้้ ็ฌฆไธๆฌกๆงๆๅๅ จ้จETFๅฎๆถๆฅk็บฟ่กๆ |+| 387 | stk_mins | [ETFๅๅฒๅ้](references/ETFไธ้ข/ETFๅๅฒๅ้.md) | ETFไธ้ข | ่ทๅETFๅ้ๆฐๆฎ๏ผๆฏๆ1min/5min/15min/30min/60min่กๆ ๏ผๆไพPython SDKๅ http Restful APIไธค็งๆนๅผ |+| 386 | etf_index | [ETFๅบๅๆๆฐ](references/ETFไธ้ข/ETFๅบๅๆๆฐ.md) | ETFไธ้ข | ่ทๅETFๅบๅๆๆฐๅ่กจไฟกๆฏ |+| 385 | etf_basic | [ETFๅบๆฌไฟกๆฏ](references/ETFไธ้ข/ETFๅบๆฌไฟกๆฏ.md) | ETFไธ้ข | ่ทๅๅฝๅ ETFๅบ็กไฟกๆฏ๏ผๅ ๆฌไบQDIIใๆฐๆฎๆฅๆบไธๆฒชๆทฑไบคๆๆๅ ฌๅผๆซ้ฒไฟกๆฏใ |+| 199 | fund_adj | [ETFๅคๆๅ ๅญ](references/ETFไธ้ข/ETFๅคๆๅ ๅญ.md) | ETFไธ้ข | ่ทๅๅบ้ๅคๆๅ ๅญ๏ผ็จไบ่ฎก็ฎๅบ้ๅคๆ่กๆ |+| 127 | fund_daily | [ETFๆฅ็บฟ่กๆ ](references/ETFไธ้ข/ETFๆฅ็บฟ่กๆ .md) | ETFไธ้ข | ่ทๅETF่กๆ ๆฏๆฅๆถ็ๅๆไบคๆฐๆฎ๏ผๅๅฒ่ถ ่ฟ10ๅนด |+| 408 | etf_share_size | [ETFไปฝ้ข่งๆจก](references/ETFไธ้ข/ETFไปฝ้ข่งๆจก.md) | ETFไธ้ข | ่ทๅๆฒชๆทฑETFๆฏๆฅไปฝ้ขๅ่งๆจกๆฐๆฎ๏ผ่ฝไฝ็ฐ่งๆจกไปฝ้ข็ๅๅ๏ผๆๆกETF่ต้ๅจๅ๏ผๅๆถๆไพๆฏๆฅๅๅผๅๆถ็ไปท๏ผๆฐๆฎๆๆ ๆฏๅๆนๅ ฅๅบ๏ผๅปบ่ฎฎๅจๆฏๆฅ19็นๅๆๅ๏ผๅฆๅค๏ผๆถๅๆตทๅค็ETFๆฐๆฎๆดๆฐไผๆไธไบๅฑไบๆญฃๅธธๆ ๅตใ |+| 322 | bc_otcqt | [ๆๅฐๆต้ๅผๅบๅธๆฅไปท](references/ๅบๅธไธ้ข/ๆๅฐๆต้ๅผๅบๅธๆฅไปท.md) | ๅบๅธไธ้ข | ๆๅฐๆต้ๅผๅบๅธๆฅไปท |+| 305 | cb_rate | [ๅฏ่ฝฌๅบ็ฅจ้ขๅฉ็](references/ๅบๅธไธ้ข/ๅฏ่ฝฌๅบ็ฅจ้ขๅฉ็.md) | ๅบๅธไธ้ข | ่ทๅๅฏ่ฝฌๅบ็ฅจ้ขๅฉ็ |+| 272 | bond_blk_detail | [ๅคงๅฎไบคๆๆ็ป](references/ๅบๅธไธ้ข/ๅคงๅฎไบคๆๆ็ป.md) | ๅบๅธไธ้ข | ่ทๅๆฒชๆทฑไบคๆๆๅบๅธๅคงๅฎไบคๆๆฐๆฎ๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ |+| 271 | bond_blk | [ๅคงๅฎไบคๆ](references/ๅบๅธไธ้ข/ๅคงๅฎไบคๆ.md) | ๅบๅธไธ้ข | ่ทๅๆฒชๆทฑไบคๆๆๅบๅธๅคงๅฎไบคๆๆฐๆฎ๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ |+| 269 | cb_call | [ๅฏ่ฝฌๅบ่ตๅไฟกๆฏ](references/ๅบๅธไธ้ข/ๅฏ่ฝฌๅบ่ตๅไฟกๆฏ.md) | ๅบๅธไธ้ข | ่ทๅๅฏ่ฝฌๅบๅฐๆ่ตๅใๅผบๅถ่ตๅ็ญไฟกๆฏใๆฐๆฎๆฅๆบไบๅ ฌๅผๆซ้ฒๆธ ้๏ผไพไธชไบบๅๆบๆ็ ็ฉถไฝฟ็จ๏ผ่ฏทไธ่ฆ็จไบๆฐๆฎๅไธ็ฎ็ใ |+| 256 | repo_daily | [ๅบๅธๅ่ดญๆฅ่กๆ ](references/ๅบๅธไธ้ข/ๅบๅธๅ่ดญๆฅ่กๆ .md) | ๅบๅธไธ้ข | ๅบๅธๅ่ดญๆฅ่กๆ |+| 323 | bc_bestotcqt | [ๆๅฐๆต้ๅผๅบๅธๆไผๆฅไปท](references/ๅบๅธไธ้ข/ๆๅฐๆต้ๅผๅบๅธๆไผๆฅไปท.md) | ๅบๅธไธ้ข | ๆๅฐๆต้ๅผๅบๅธๆไผๆฅไปท |+| 392 | cb_factor_pro | [ๅฏ่ฝฌๅบๆๆฏ้ขๅ ๅญ(ไธไธ็)](references/ๅบๅธไธ้ข/ๅฏ่ฝฌๅบๆๆฏ้ขๅ ๅญ(ไธไธ็).md) | ๅบๅธไธ้ข | ่ทๅๅฏ่ฝฌๅบๆฏๆฅๆๆฏ้ขๅ ๅญๆฐๆฎ๏ผ็จไบ่ท่ธชๅฏ่ฝฌๅบๅฝๅ่ตฐๅฟๆ ๅต๏ผๆฐๆฎ็ฑTushare็คพๅบ่ชไบง๏ผ่ฆ็ๅ จๅๅฒ๏ผ่พๅบๅๆฐ_bfq่กจ็คบไธๅคๆ๏ผ_qfq่กจ็คบๅๅคๆ _hfq่กจ็คบๅๅคๆ๏ผๆ่ฟฐไธญ่ฏดๆไบๅ ๅญ็้ป่ฎคไผ ๅ๏ผๅฆ้่ฆ็นๆฎๅๆฐๆ่ ๆดๅคๅ ๅญๅฏไปฅ่็ณป็ฎก็ๅ่ฏไผฐ |+| 246 | cb_price_chg | [ๅฏ่ฝฌๅบ่ฝฌ่กไปทๅๅจ](references/ๅบๅธไธ้ข/ๅฏ่ฝฌๅบ่ฝฌ่กไปทๅๅจ.md) | ๅบๅธไธ้ข | ่ทๅๅฏ่ฝฌๅบ่ฝฌ่กไปทๅๅจ |+| 233 | eco_cal | [ๅ จ็่ดข็ปไบไปถ](references/ๅบๅธไธ้ข/ๅ จ็่ดข็ปไบไปถ.md) | ๅบๅธไธ้ข | ่ทๅๅ จ็่ดข็ปๆฅๅใๅ ๆฌ็ปๆตไบไปถๆฐๆฎๆดๆฐ |+| 201 | yc_cb | [ๅฝๅบๆถ็็ๆฒ็บฟ](references/ๅบๅธไธ้ข/ๅฝๅบๆถ็็ๆฒ็บฟ.md) | ๅบๅธไธ้ข | ่ทๅไธญๅบๆถ็็ๆฒ็บฟ๏ผ็ฎๅๅฏ่ทๅไธญๅบๅฝๅบๆถ็็ๆฒ็บฟๅณๆๅๅฐๆๆถ็็ๆฒ็บฟๆฐๆฎ |+| 187 | cb_daily | [ๅฏ่ฝฌๅบ่กๆ ](references/ๅบๅธไธ้ข/ๅฏ่ฝฌๅบ่กๆ .md) | ๅบๅธไธ้ข | ่ทๅๅฏ่ฝฌๅบ่กๆ |+| 186 | cb_issue | [ๅฏ่ฝฌๅบๅ่ก](references/ๅบๅธไธ้ข/ๅฏ่ฝฌๅบๅ่ก.md) | ๅบๅธไธ้ข | ่ทๅๅฏ่ฝฌๅบๅ่กๆฐๆฎ |+| 185 | cb_basic | [ๅฏ่ฝฌๅบๅบ็กไฟกๆฏ](references/ๅบๅธไธ้ข/ๅฏ่ฝฌๅบๅบ็กไฟกๆฏ.md) | ๅบๅธไธ้ข | ่ทๅๅฏ่ฝฌๅบๅบๆฌไฟกๆฏ |+| 247 | cb_share | [ๅฏ่ฝฌๅบ่ฝฌ่ก็ปๆ](references/ๅบๅธไธ้ข/ๅฏ่ฝฌๅบ่ฝฌ่ก็ปๆ.md) | ๅบๅธไธ้ข | ่ทๅๅฏ่ฝฌๅบ่ฝฌ่ก็ปๆ |+| 208 | fund_manager | [ๅบ้็ป็](references/ๅ ฌๅๅบ้/ๅบ้็ป็.md) | ๅ ฌๅๅบ้ | ่ทๅๅ ฌๅๅบ้็ป็ๆฐๆฎ๏ผๅ ๆฌๅบ้็ป็็ฎๅ็ญๆฐๆฎ |+| 207 | fund_share | [ๅบ้่งๆจก](references/ๅ ฌๅๅบ้/ๅบ้่งๆจก.md) | ๅ ฌๅๅบ้ | ่ทๅๅบ้่งๆจกๆฐๆฎ๏ผๅ ๅซไธๆตทๅๆทฑๅณETFๅบ้ |+| 121 | fund_portfolio | [ๅบ้ๆไป](references/ๅ ฌๅๅบ้/ๅบ้ๆไป.md) | ๅ ฌๅๅบ้ | ่ทๅๅ ฌๅๅบ้ๆไปๆฐๆฎ๏ผๅญฃๅบฆๆดๆฐ |+| 120 | fund_div | [ๅบ้ๅ็บข](references/ๅ ฌๅๅบ้/ๅบ้ๅ็บข.md) | ๅ ฌๅๅบ้ | ่ทๅๅ ฌๅๅบ้ๅ็บขๆฐๆฎ |+| 119 | fund_nav | [ๅบ้ๅๅผ](references/ๅ ฌๅๅบ้/ๅบ้ๅๅผ.md) | ๅ ฌๅๅบ้ | ่ทๅๅ ฌๅๅบ้ๅๅผๆฐๆฎ |+| 118 | fund_company | [ๅบ้็ฎก็ไบบ](references/ๅ ฌๅๅบ้/ๅบ้็ฎก็ไบบ.md) | ๅ ฌๅๅบ้ | ่ทๅๅ ฌๅๅบ้็ฎก็ไบบๅ่กจ |+| 19 | fund_basic | [ๅบ้ๅ่กจ](references/ๅ ฌๅๅบ้/ๅบ้ๅ่กจ.md) | ๅ ฌๅๅบ้ | ่ทๅๅ ฌๅๅบ้ๆฐๆฎๅ่กจ๏ผๅ ๆฌๅบๅ ๅๅบๅคๅบ้ |+| 359 | fund_factor_pro | [ๅบ้ๆๆฏ้ขๅ ๅญ(ไธไธ็)](references/ๅ ฌๅๅบ้/ๅบ้ๆๆฏ้ขๅ ๅญ(ไธไธ็).md) | ๅ ฌๅๅบ้ | ่ทๅๅบๅ ๅบ้ๆฏๆฅๆๆฏ้ขๅ ๅญๆฐๆฎ๏ผ็จไบ่ท่ธชๅบๅ ๅบ้ๅฝๅ่ตฐๅฟๆ ๅต๏ผๆฐๆฎ็ฑTushare็คพๅบ่ชไบง๏ผ่ฆ็ๅ จๅๅฒ๏ผ่พๅบๅๆฐ_bfq่กจ็คบไธๅคๆ๏ผๆ่ฟฐไธญ่ฏดๆไบๅ ๅญ็้ป่ฎคไผ ๅ๏ผๅฆ้่ฆ็นๆฎๅๆฐๆ่ ๆดๅคๅ ๅญๅฏไปฅ่็ณป็ฎก็ๅ่ฏไผฐ |+| 178 | fx_obasic | [ๅคๆฑๅบ็กไฟกๆฏ(ๆตทๅค)](references/ๅคๆฑๆฐๆฎ/ๅคๆฑๅบ็กไฟกๆฏ(ๆตทๅค).md) | ๅคๆฑๆฐๆฎ | ่ทๅๆตทๅคๅคๆฑๅบ็กไฟกๆฏ๏ผ็ฎๅๅชๆFXCMไบคๆๅ็ๆฐๆฎ |+| 179 | fx_daily | [ๅคๆฑๆฅ็บฟ่กๆ ](references/ๅคๆฑๆฐๆฎ/ๅคๆฑๆฅ็บฟ่กๆ .md) | ๅคๆฑๆฐๆฎ | ่ทๅๅคๆฑๆฅ็บฟ่กๆ |+| 415 | research_report | [ๅธๅ็ ็ฉถๆฅๅ](references/ๅคงๆจกๅ่ฏญๆไธ้ขๆฐๆฎ/ๅธๅ็ ็ฉถๆฅๅ.md) | ๅคงๆจกๅ่ฏญๆไธ้ขๆฐๆฎ | ่ทๅๅธๅ็ ็ฉถๆฅๅ-ไธช่กใ่กไธ็ญ๏ผๅๅฒๆฐๆฎไป20170101ๅผๅงๆไพ๏ผๅข้ๆฏๅคฉไธคๆฌกๆดๆฐ |+| 143 | news | [ๆฐ้ปๅฟซ่ฎฏ(็ญ่ฎฏ)](references/ๅคงๆจกๅ่ฏญๆไธ้ขๆฐๆฎ/ๆฐ้ปๅฟซ่ฎฏ(็ญ่ฎฏ).md) | ๅคงๆจกๅ่ฏญๆไธ้ขๆฐๆฎ | ่ทๅไธปๆตๆฐ้ป็ฝ็ซ็ๅฟซ่ฎฏๆฐ้ปๆฐๆฎ,ๆไพ่ถ ่ฟ6ๅนดไปฅไธๅๅฒๆฐ้ปใ |+| 154 | cctv_news | [ๆฐ้ป่ๆญๆๅญ็จฟ](references/ๅคงๆจกๅ่ฏญๆไธ้ขๆฐๆฎ/ๆฐ้ป่ๆญๆๅญ็จฟ.md) | ๅคงๆจกๅ่ฏญๆไธ้ขๆฐๆฎ | ่ทๅๆฐ้ป่ๆญๆๅญ็จฟๆฐๆฎ๏ผๆฐๆฎๅผๅงไบ2017ๅนดใ |+| 176 | anns_d | [ไธๅธๅ ฌๅธๅ ฌๅ](references/ๅคงๆจกๅ่ฏญๆไธ้ขๆฐๆฎ/ไธๅธๅ ฌๅธๅ ฌๅ.md) | ๅคงๆจกๅ่ฏญๆไธ้ขๆฐๆฎ | ่ทๅๅ จ้ๅ ฌๅๆฐๆฎ๏ผๆไพpdfไธ่ฝฝURL |+| 367 | irm_qa_sz | [ๆทฑ่ฏๆไบๅจ้ฎ็ญ](references/ๅคงๆจกๅ่ฏญๆไธ้ขๆฐๆฎ/ๆทฑ่ฏๆไบๅจ้ฎ็ญ.md) | ๅคงๆจกๅ่ฏญๆไธ้ขๆฐๆฎ | |+| 366 | irm_qa_sh | [ไธ่ฏeไบๅจ้ฎ็ญ](references/ๅคงๆจกๅ่ฏญๆไธ้ขๆฐๆฎ/ไธ่ฏeไบๅจ้ฎ็ญ.md) | ๅคงๆจกๅ่ฏญๆไธ้ขๆฐๆฎ | |+| 195 | major_news | [ๆฐ้ป้่ฎฏ(้ฟ็ฏ)](references/ๅคงๆจกๅ่ฏญๆไธ้ขๆฐๆฎ/ๆฐ้ป้่ฎฏ(้ฟ็ฏ).md) | ๅคงๆจกๅ่ฏญๆไธ้ขๆฐๆฎ | ่ทๅ้ฟ็ฏ้่ฎฏไฟกๆฏ๏ผ่ฆ็ไธป่ฆๆฐ้ป่ต่ฎฏ็ฝ็ซ๏ผๆไพ่ถ ่ฟ8ๅนดๅๅฒๆฐ้ปใ |+| 406 | npr | [ๅฝๅฎถๆฟ็ญๅบ](references/ๅคงๆจกๅ่ฏญๆไธ้ขๆฐๆฎ/ๅฝๅฎถๆฟ็ญๅบ.md) | ๅคงๆจกๅ่ฏญๆไธ้ขๆฐๆฎ | ่ทๅๅฝๅฎถ่กๆฟๆบๅ ณๅ ฌๅผๆซ้ฒ็ๅ็ฑปๆณ่งใๆกไพๆฟ็ญใๆนๅคใ้็ฅ็ญๆๆฌๆฐๆฎใ |+| 245 | cn_ppi | [ๅทฅไธ็ไบง่ ๅบๅไปทๆ ผๆๆฐ(PPI)](references/ๅฎ่ง็ปๆต/ๅฝๅ ๅฎ่ง/ไปทๆ ผๆๆฐ/ๅทฅไธ็ไบง่ ๅบๅไปทๆ ผๆๆฐ(PPI).md) | ๅฎ่ง็ปๆต,ๅฝๅ ๅฎ่ง,ไปทๆ ผๆๆฐ | ่ทๅPPIๅทฅไธ็ไบง่ ๅบๅไปทๆ ผๆๆฐๆฐๆฎ |+| 228 | cn_cpi | [ๅฑ ๆฐๆถ่ดนไปทๆ ผๆๆฐ(CPI)](references/ๅฎ่ง็ปๆต/ๅฝๅ ๅฎ่ง/ไปทๆ ผๆๆฐ/ๅฑ ๆฐๆถ่ดนไปทๆ ผๆๆฐ(CPI).md) | ๅฎ่ง็ปๆต,ๅฝๅ ๅฎ่ง,ไปทๆ ผๆๆฐ | ่ทๅCPIๅฑ ๆฐๆถ่ดนไปทๆ ผๆฐๆฎ๏ผๅ ๆฌๅ จๅฝใๅๅธๅๅๆ็ๆฐๆฎ |+| 149 | shibor | [Shiborๅฉ็](references/ๅฎ่ง็ปๆต/ๅฝๅ ๅฎ่ง/ๅฉ็ๆฐๆฎ/Shiborๅฉ็.md) | ๅฎ่ง็ปๆต,ๅฝๅ ๅฎ่ง,ๅฉ็ๆฐๆฎ | shiborๅฉ็ |+| 151 | shibor_lpr | [LPR่ดทๆฌพๅบ็กๅฉ็](references/ๅฎ่ง็ปๆต/ๅฝๅ ๅฎ่ง/ๅฉ็ๆฐๆฎ/LPR่ดทๆฌพๅบ็กๅฉ็.md) | ๅฎ่ง็ปๆต,ๅฝๅ ๅฎ่ง,ๅฉ็ๆฐๆฎ | LPR่ดทๆฌพๅบ็กๅฉ็ |+| 152 | libor | [Liborๅฉ็](references/ๅฎ่ง็ปๆต/ๅฝๅ ๅฎ่ง/ๅฉ็ๆฐๆฎ/Liborๅฉ็.md) | ๅฎ่ง็ปๆต,ๅฝๅ ๅฎ่ง,ๅฉ็ๆฐๆฎ | Liborๆๅๅฉ็ |+| 150 | shibor_quote | [Shiborๆฅไปทๆฐๆฎ](references/ๅฎ่ง็ปๆต/ๅฝๅ ๅฎ่ง/ๅฉ็ๆฐๆฎ/Shiborๆฅไปทๆฐๆฎ.md) | ๅฎ่ง็ปๆต,ๅฝๅ ๅฎ่ง,ๅฉ็ๆฐๆฎ | Shiborๆฅไปทๆฐๆฎ |+| 173 | wz_index | [ๆธฉๅทๆฐ้ดๅ่ดทๅฉ็](references/ๅฎ่ง็ปๆต/ๅฝๅ ๅฎ่ง/ๅฉ็ๆฐๆฎ/ๆธฉๅทๆฐ้ดๅ่ดทๅฉ็.md) | ๅฎ่ง็ปๆต,ๅฝๅ ๅฎ่ง,ๅฉ็ๆฐๆฎ | ๆธฉๅทๆฐ้ดๅ่ดทๅฉ็๏ผๅณๆธฉๅทๆๆฐ |+| 153 | hibor | [Hiborๅฉ็](references/ๅฎ่ง็ปๆต/ๅฝๅ ๅฎ่ง/ๅฉ็ๆฐๆฎ/Hiborๅฉ็.md) | ๅฎ่ง็ปๆต,ๅฝๅ ๅฎ่ง,ๅฉ็ๆฐๆฎ | Hiborๅฉ็ |+| 174 | gz_index | [ๅนฟๅทๆฐ้ดๅ่ดทๅฉ็](references/ๅฎ่ง็ปๆต/ๅฝๅ ๅฎ่ง/ๅฉ็ๆฐๆฎ/ๅนฟๅทๆฐ้ดๅ่ดทๅฉ็.md) | ๅฎ่ง็ปๆต,ๅฝๅ ๅฎ่ง,ๅฉ็ๆฐๆฎ | ๅนฟๅทๆฐ้ดๅ่ดทๅฉ็ |+| 227 | cn_gdp | [ๅฝๅ ็ไบงๆปๅผ(GDP)](references/ๅฎ่ง็ปๆต/ๅฝๅ ๅฎ่ง/ๅฝๆฐ็ปๆต/ๅฝๅ ็ไบงๆปๅผ(GDP).md) | ๅฎ่ง็ปๆต,ๅฝๅ ๅฎ่ง,ๅฝๆฐ็ปๆต | ่ทๅๅฝๆฐ็ปๆตไนGDPๆฐๆฎ |+| 325 | cn_pmi | [้่ดญ็ป็ๆๆฐ(PMI)](references/ๅฎ่ง็ปๆต/ๅฝๅ ๅฎ่ง/ๆฏๆฐๅบฆ/้่ดญ็ป็ๆๆฐ(PMI).md) | ๅฎ่ง็ปๆต,ๅฝๅ ๅฎ่ง,ๆฏๆฐๅบฆ | ้่ดญ็ป็ไบบๆๆฐ |+| 310 | sf_month | [็คพ่ๅข้(ๆๅบฆ)](references/ๅฎ่ง็ปๆต/ๅฝๅ ๅฎ่ง/้่/็คพไผ่่ต/็คพ่ๅข้(ๆๅบฆ).md) | ๅฎ่ง็ปๆต,ๅฝๅ ๅฎ่ง,้่,็คพไผ่่ต | ่ทๅๆๅบฆ็คพไผ่่ตๆฐๆฎ |+| 242 | cn_m | [่ดงๅธไพๅบ้(ๆ)](references/ๅฎ่ง็ปๆต/ๅฝๅ ๅฎ่ง/้่/่ดงๅธไพๅบ้/่ดงๅธไพๅบ้(ๆ).md) | ๅฎ่ง็ปๆต,ๅฝๅ ๅฎ่ง,้่,่ดงๅธไพๅบ้ | ่ทๅ่ดงๅธไพๅบ้ไนๆๅบฆๆฐๆฎ |+| 221 | us_tbr | [็ญๆๅฝๅบๅฉ็](references/ๅฎ่ง็ปๆต/ๅฝ้ ๅฎ่ง/็พๅฝๅฉ็/็ญๆๅฝๅบๅฉ็.md) | ๅฎ่ง็ปๆต,ๅฝ้ ๅฎ่ง,็พๅฝๅฉ็ | ่ทๅ็พๅฝ็ญๆๅฝๅบๅฉ็ๆฐๆฎ |+| 220 | us_trycr | [ๅฝๅบๅฎ้ ๆถ็็ๆฒ็บฟๅฉ็](references/ๅฎ่ง็ปๆต/ๅฝ้ ๅฎ่ง/็พๅฝๅฉ็/ๅฝๅบๅฎ้ ๆถ็็ๆฒ็บฟๅฉ็.md) | ๅฎ่ง็ปๆต,ๅฝ้ ๅฎ่ง,็พๅฝๅฉ็ | ๅฝๅบๅฎ้ ๆถ็็ๆฒ็บฟๅฉ็ |+| 222 | us_tltr | [ๅฝๅบ้ฟๆๅฉ็](references/ๅฎ่ง็ปๆต/ๅฝ้ ๅฎ่ง/็พๅฝๅฉ็/ๅฝๅบ้ฟๆๅฉ็.md) | ๅฎ่ง็ปๆต,ๅฝ้ ๅฎ่ง,็พๅฝๅฉ็ | ๅฝๅบ้ฟๆๅฉ็ |+| 223 | us_trltr | [ๅฝๅบ้ฟๆๅฉ็ๅนณๅๅผ](references/ๅฎ่ง็ปๆต/ๅฝ้ ๅฎ่ง/็พๅฝๅฉ็/ๅฝๅบ้ฟๆๅฉ็ๅนณๅๅผ.md) | ๅฎ่ง็ปๆต,ๅฝ้ ๅฎ่ง,็พๅฝๅฉ็ | ๅฝๅบๅฎ้ ้ฟๆๅฉ็ๅนณๅๅผ |+| 219 | us_tycr | [ๅฝๅบๆถ็็ๆฒ็บฟๅฉ็](references/ๅฎ่ง็ปๆต/ๅฝ้ ๅฎ่ง/็พๅฝๅฉ็/ๅฝๅบๆถ็็ๆฒ็บฟๅฉ็.md) | ๅฎ่ง็ปๆต,ๅฝ้ ๅฎ่ง,็พๅฝๅฉ็ | ่ทๅ็พๅฝๆฏๆฅๅฝๅบๆถ็็ๆฒ็บฟๅฉ็ |+| 420 | rt_idx_min | [ๆๆฐๅฎๆถๅ้](references/ๆๆฐไธ้ข/ๆๆฐๅฎๆถๅ้.md) | ๆๆฐไธ้ข | ่ทๅไบคๆๆๆๆฐๅฎๆถๅ้ๆฐๆฎ๏ผๅ ๆฌ1~60min |+| 419 | idx_mins | [ๆๆฐๅๅฒๅ้](references/ๆๆฐไธ้ข/ๆๆฐๅๅฒๅ้.md) | ๆๆฐไธ้ข | ่ทๅไบคๆๆๆๆฐๅ้ๆฐๆฎ๏ผๆฏๆ1min/5min/15min/30min/60min่กๆ ๏ผๆไพPython SDKๅ http Restful APIไธค็งๆนๅผ |+| 215 | daily_info | [ๆฒชๆทฑๅธๅบๆฏๆฅไบคๆ็ป่ฎก](references/ๆๆฐไธ้ข/ๆฒชๆทฑๅธๅบๆฏๆฅไบคๆ็ป่ฎก.md) | ๆๆฐไธ้ข | ่ทๅไบคๆๆ่ก็ฅจไบคๆ็ป่ฎก๏ผๅ ๆฌๅๆฟๅๆ็ป |+| 211 | index_global | [ๅฝ้ ไธป่ฆๆๆฐ](references/ๆๆฐไธ้ข/ๅฝ้ ไธป่ฆๆๆฐ.md) | ๆๆฐไธ้ข | ่ทๅๅฝ้ ไธป่ฆๆๆฐๆฅ็บฟ่กๆ |+| 181 | index_classify | [็ณไธ่กไธๅ็ฑป](references/ๆๆฐไธ้ข/็ณไธ่กไธๅ็ฑป.md) | ๆๆฐไธ้ข | ่ทๅ็ณไธ่กไธๅ็ฑป๏ผๅฏไปฅ่ทๅ็ณไธ2014ๅนด็ๆฌ๏ผ28ไธชไธ็บงๅ็ฑป๏ผ104ไธชไบ็บงๅ็ฑป๏ผ227ไธชไธ็บงๅ็ฑป๏ผๅ2021ๅนดๆฌ็๏ผ31ไธชไธ็บงๅ็ฑป๏ผ134ไธชไบ็บงๅ็ฑป๏ผ346ไธชไธ็บงๅ็ฑป๏ผๅ่กจไฟกๆฏ |+| 268 | sz_daily_info | [ๆทฑๅณๅธๅบๆฏๆฅไบคๆๆ ๅต](references/ๆๆฐไธ้ข/ๆทฑๅณๅธๅบๆฏๆฅไบคๆๆ ๅต.md) | ๆๆฐไธ้ข | ่ทๅๆทฑๅณๅธๅบๆฏๆฅไบคๆๆฆๅต |+| 128 | index_dailybasic | [ๅคง็ๆๆฐๆฏๆฅๆๆ ](references/ๆๆฐไธ้ข/ๅคง็ๆๆฐๆฏๆฅๆๆ .md) | ๆๆฐไธ้ข | ็ฎๅๅชๆไพไธ่ฏ็ปผๆ๏ผๆทฑ่ฏๆๆ๏ผไธ่ฏ50๏ผไธญ่ฏ500๏ผไธญๅฐๆฟๆ๏ผๅไธๆฟๆ็ๆฏๆฅๆๆ ๆฐๆฎ |+| 403 | rt_idx_k | [ๆๆฐๅฎๆถๆฅ็บฟ](references/ๆๆฐไธ้ข/ๆๆฐๅฎๆถๆฅ็บฟ.md) | ๆๆฐไธ้ข | ่ทๅไบคๆๆๆๆฐๅฎๆถๆฅ็บฟ่กๆ ๏ผๆฏๆๆไปฃ็ ๆไปฃ็ ้้ ็ฌฆไธๆฌกๆงๆๅๅ จ้จไบคๆๆๆๆฐๅฎๆถๆฅk็บฟ่กๆ |+| 96 | index_weight | [ๆๆฐๆๅๅๆ้](references/ๆๆฐไธ้ข/ๆๆฐๆๅๅๆ้.md) | ๆๆฐไธ้ข | ่ทๅๅ็ฑปๆๆฐๆๅๅๆ้๏ผ**ๆๅบฆๆฐๆฎ** ๏ผๅปบ่ฎฎ่พๅ ฅๅๆฐ้ๅผๅงๆฅๆๅ็ปๆๆฅๅๅซ่พๅ ฅๅฝๆ็ฌฌไธๅคฉๅๆๅไธๅคฉ็ๆฅๆใ |+| 373 | ci_index_member | [ไธญไฟก่กไธๆๅ](references/ๆๆฐไธ้ข/ไธญไฟก่กไธๆๅ.md) | ๆๆฐไธ้ข | ๆไธ็บงๅ็ฑปๆๅไธญไฟก่กไธๆๅ๏ผๅฏๆไพๆไธชๅ็ฑป็ๆๆๆๅ๏ผไนๅฏๆ่ก็ฅจไปฃ็ ๆๅๆๅฑๅ็ฑป๏ผๅๆฐ็ตๆดป |+| 358 | idx_factor_pro | [ๆๆฐๆๆฏ้ขๅ ๅญ(ไธไธ็)](references/ๆๆฐไธ้ข/ๆๆฐๆๆฏ้ขๅ ๅญ(ไธไธ็).md) | ๆๆฐไธ้ข | ่ทๅๆๆฐๆฏๆฅๆๆฏ้ขๅ ๅญๆฐๆฎ๏ผ็จไบ่ท่ธชๆๆฐๅฝๅ่ตฐๅฟๆ ๅต๏ผๆฐๆฎ็ฑTushare็คพๅบ่ชไบง๏ผ่ฆ็ๅ จๅๅฒ๏ผ่พๅบๅๆฐ_bfq่กจ็คบไธๅคๆๆ่ฟฐไธญ่ฏดๆไบๅ ๅญ็้ป่ฎคไผ ๅ๏ผๅฆ้่ฆ็นๆฎๅๆฐๆ่ ๆดๅคๅ ๅญๅฏไปฅ่็ณป็ฎก็ๅ่ฏไผฐ๏ผๆๆฐๅ ๆฌๅคง็ๆๆฐ ็ณไธ่กไธๆๆฐ ไธญไฟกๆๆฐ |+| 335 | index_member_all | [็ณไธ่กไธๆๅ(ๅ็บง)](references/ๆๆฐไธ้ข/็ณไธ่กไธๆๅ(ๅ็บง).md) | ๆๆฐไธ้ข | ๆไธ็บงๅ็ฑปๆๅ็ณไธ่กไธๆๅ๏ผๅฏๆไพๆไธชๅ็ฑป็ๆๆๆๅ๏ผไนๅฏๆ่ก็ฅจไปฃ็ ๆๅๆๅฑๅ็ฑป๏ผๅๆฐ็ตๆดป |+| 417 | rt_sw_k | [็ณไธๅฎๆถ่กๆ ](references/ๆๆฐไธ้ข/็ณไธๅฎๆถ่กๆ .md) | ๆๆฐไธ้ข | ่ทๅ็ณไธ่กไธๆๆฐ็ๆๆฐๆช้ขๆฐๆฎ |+| 172 | index_monthly | [ๆๆฐๆ็บฟ่กๆ ](references/ๆๆฐไธ้ข/ๆๆฐๆ็บฟ่กๆ .md) | ๆๆฐไธ้ข | ่ทๅๆๆฐๆ็บฟ่กๆ ,ๆฏๆๆดๆฐไธๆฌก |+| 308 | ci_daily | [ไธญไฟก่กไธๆๆฐๆฅ่กๆ ](references/ๆๆฐไธ้ข/ไธญไฟก่กไธๆๆฐๆฅ่กๆ .md) | ๆๆฐไธ้ข | ่ทๅไธญไฟก่กไธๆๆฐๆฅ็บฟ่กๆ |+| 171 | index_weekly | [ๆๆฐๅจ็บฟ่กๆ ](references/ๆๆฐไธ้ข/ๆๆฐๅจ็บฟ่กๆ .md) | ๆๆฐไธ้ข | ่ทๅๆๆฐๅจ็บฟ่กๆ |+| 327 | sw_daily | [็ณไธ่กไธๆๆฐๆฅ่กๆ ](references/ๆๆฐไธ้ข/็ณไธ่กไธๆๆฐๆฅ่กๆ .md) | ๆๆฐไธ้ข | ่ทๅ็ณไธ่กไธๆฅ็บฟ่กๆ ๏ผ้ป่ฎคๆฏ็ณไธ2021็่กๆ ๏ผ |+| 95 | index_daily | [ๆๆฐๆฅ็บฟ่กๆ ](references/ๆๆฐไธ้ข/ๆๆฐๆฅ็บฟ่กๆ .md) | ๆๆฐไธ้ข | ่ทๅๆๆฐๆฏๆฅ่กๆ ๏ผ่ฟๅฏไปฅ้่ฟbarๆฅๅฃ่ทๅใ็ฑไบๆๅกๅจๅๅ๏ผ็ฎๅ่งๅๆฏๅๆฌก่ฐๅๆๅคๅ8000่ก่ฎฐๅฝ๏ผๅฏไปฅ่ฎพ็ฝฎstartๅendๆฅๆ่กฅๅ จใๆๆฐ่กๆ ไนๅฏไปฅ้่ฟ[**้็จ่กๆ ๆฅๅฃ**](https://tushare.pro/document/2?doc_id=109)่ทๅๆฐๆฎ๏ผ |+| 94 | index_basic | [ๆๆฐๅบๆฌไฟกๆฏ](references/ๆๆฐไธ้ข/ๆๆฐๅบๆฌไฟกๆฏ.md) | ๆๆฐไธ้ข | ่ทๅๆๆฐๅบ็กไฟกๆฏใ |+| 341 | opt_mins | [ๆๆๅ้่กๆ ](references/ๆๆๆฐๆฎ/ๆๆๅ้่กๆ .md) | ๆๆๆฐๆฎ | ่ทๅๅ จๅธๅบๆๆๅ็บฆๅ้ๆฐๆฎ๏ผๆฏๆ1min/5min/15min/30min/60min่กๆ ๏ผๆไพPython SDKๅ http Restful APIไธค็งๆนๅผใ |+| 159 | opt_daily | [ๆๆๆฅ็บฟ่กๆ ](references/ๆๆๆฐๆฎ/ๆๆๆฅ็บฟ่กๆ .md) | ๆๆๆฐๆฎ | ่ทๅๆๆๆฅ็บฟ่กๆ |+| 158 | opt_basic | [ๆๆๅ็บฆไฟกๆฏ](references/ๆๆๆฐๆฎ/ๆๆๅ็บฆไฟกๆฏ.md) | ๆๆๆฐๆฎ | ่ทๅๆๆๅ็บฆไฟกๆฏ |+| 216 | fut_weekly_detail | [ๆ่ดงไธป่ฆๅ็งไบคๆๅจๆฅ](references/ๆ่ดงๆฐๆฎ/ๆ่ดงไธป่ฆๅ็งไบคๆๅจๆฅ.md) | ๆ่ดงๆฐๆฎ | ่ทๅๆ่ดงไบคๆๆไธป่ฆๅ็งๆฏๅจไบคๆ็ป่ฎกไฟกๆฏ๏ผๆฐๆฎไป2010ๅนด3ๆๅผๅง |+| 368 | ft_limit | [ๆ่ดงๅ็บฆๆถจ่ทๅไปทๆ ผ](references/ๆ่ดงๆฐๆฎ/ๆ่ดงๅ็บฆๆถจ่ทๅไปทๆ ผ.md) | ๆ่ดงๆฐๆฎ | ่ทๅๆๆๆ่ดงๅ็บฆๆฏๅคฉ็ๆถจ่ทๅไปทๆ ผๅๆไฝไฟ่ฏ้็๏ผๆฐๆฎๅผๅงไบ2005ๅนดใ |+| 340 | rt_fut_min | [ๅฎๆถๅ้่กๆ ](references/ๆ่ดงๆฐๆฎ/ๅฎๆถๅ้่กๆ .md) | ๆ่ดงๆฐๆฎ | ่ทๅๅ จๅธๅบๆ่ดงๅ็บฆๅฎๆถๅ้ๆฐๆฎ๏ผๆฏๆ1min/5min/15min/30min/60min่กๆ ๏ผๆไพPython SDKใ http Restful APIๅwebsocketไธ็งๆนๅผ๏ผๅฆๆ้่ฆไธปๅๅ็บฆๅ้๏ผ่ฏทๅ ้่ฟไธปๅ[mapping](https://tushare.pro/document/2?doc_id=189)ๆฅๅฃ่ทๅๅฏนๅบ็ๅ็บฆไปฃ็ ๅๆๅๅ้ใ |+| 135 | fut_basic | [ๅ็บฆไฟกๆฏ](references/ๆ่ดงๆฐๆฎ/ๅ็บฆไฟกๆฏ.md) | ๆ่ดงๆฐๆฎ | ่ทๅๆ่ดงๅ็บฆๅ่กจๆฐๆฎ |+| 137 | trade_cal | [ไบคๆๆฅๅ](references/ๆ่ดงๆฐๆฎ/ไบคๆๆฅๅ.md) | ๆ่ดงๆฐๆฎ | ่ทๅๅๅคงๆ่ดงไบคๆๆไบคๆๆฅๅๆฐๆฎ |+| 138 | fut_daily | [ๆฅ็บฟ่กๆ ](references/ๆ่ดงๆฐๆฎ/ๆฅ็บฟ่กๆ .md) | ๆ่ดงๆฐๆฎ | ๆ่ดงๆฅ็บฟ่กๆ ๆฐๆฎ |+| 139 | fut_holding | [ๆฏๆฅๆไปๆๅ](references/ๆ่ดงๆฐๆฎ/ๆฏๆฅๆไปๆๅ.md) | ๆ่ดงๆฐๆฎ | ่ทๅๆฏๆฅๆไบคๆไปๆๅๆฐๆฎ |+| 140 | fut_wsr | [ไปๅๆฅๆฅ](references/ๆ่ดงๆฐๆฎ/ไปๅๆฅๆฅ.md) | ๆ่ดงๆฐๆฎ | ่ทๅไปๅๆฅๆฅๆฐๆฎ๏ผไบ่งฃๅไปๅบ/ๅๅบ็ไปๅๅๅ |+| 141 | fut_settle | [ๆฏๆฅ็ป็ฎๅๆฐ](references/ๆ่ดงๆฐๆฎ/ๆฏๆฅ็ป็ฎๅๆฐ.md) | ๆ่ดงๆฐๆฎ | ่ทๅๆฏๆฅ็ป็ฎๅๆฐๆฐๆฎ๏ผๅ ๆฌไบคๆๅไบคๅฒ่ดน็็ญ |+| 155 | index_daily | [ๅๅๆ่ดงๆๆฐ่กๆ ](references/ๆ่ดงๆฐๆฎ/ๅๅๆ่ดงๆๆฐ่กๆ .md) | ๆ่ดงๆฐๆฎ | ่ทๅๅๅๆๆฐๆฏๆฅ่กๆ ๏ผๆๆฐ่กๆ ไนๅฏไปฅ้่ฟ[**้็จ่กๆ ๆฅๅฃ**](https://tushare.pro/document/2?doc_id=109)่ทๅๆฐๆฎ๏ผ |+| 189 | fut_mapping | [ๆ่ดงไธปๅไธ่ฟ็ปญๅ็บฆ](references/ๆ่ดงๆฐๆฎ/ๆ่ดงไธปๅไธ่ฟ็ปญๅ็บฆ.md) | ๆ่ดงๆฐๆฎ | ่ทๅๆ่ดงไธปๅ๏ผๆ่ฟ็ปญ๏ผๅ็บฆไธๆๅ็บฆๆ ๅฐๆฐๆฎ |+| 313 | ft_mins | [ๅๅฒๅ้่กๆ ](references/ๆ่ดงๆฐๆฎ/ๅๅฒๅ้่กๆ .md) | ๆ่ดงๆฐๆฎ | ่ทๅๅ จๅธๅบๆ่ดงๅ็บฆๅ้ๆฐๆฎ๏ผๆฏๆ1min/5min/15min/30min/60min่กๆ ๏ผๆไพPython SDKๅ http Restful APIไธค็งๆนๅผ๏ผๅฆๆ้่ฆไธปๅๅ็บฆๅ้๏ผ่ฏทๅ ้่ฟไธปๅ[mapping](https://tushare.pro/document/2?doc_id=189)ๆฅๅฃ่ทๅๅฏนๅบ็ๅ็บฆไปฃ็ ๅๆๅๅ้ใ |+| 337 | fut_weekly_monthly | [ๆ่ดงๅจๆ็บฟ่กๆ (ๆฏๆฅๆดๆฐ)](references/ๆ่ดงๆฐๆฎ/ๆ่ดงๅจๆ็บฟ่กๆ (ๆฏๆฅๆดๆฐ).md) | ๆ่ดงๆฐๆฎ | ๆ่ดงๅจ/ๆ็บฟ่กๆ (ๆฏๆฅๆดๆฐ) |+| 391 | hk_cashflow | [ๆธฏ่ก็ฐ้ๆต้่กจ](references/ๆธฏ่กๆฐๆฎ/ๆธฏ่ก็ฐ้ๆต้่กจ.md) | ๆธฏ่กๆฐๆฎ | ่ทๅๆธฏ่กไธๅธๅ ฌๅธ็ฐ้ๆต้่กจๆฐๆฎ |+| 390 | hk_balancesheet | [ๆธฏ่ก่ตไบง่ดๅบ่กจ](references/ๆธฏ่กๆฐๆฎ/ๆธฏ่ก่ตไบง่ดๅบ่กจ.md) | ๆธฏ่กๆฐๆฎ | ่ทๅๆธฏ่กไธๅธๅ ฌๅธ่ตไบง่ดๅบ่กจ |+| 389 | hk_income | [ๆธฏ่กๅฉๆถฆ่กจ](references/ๆธฏ่กๆฐๆฎ/ๆธฏ่กๅฉๆถฆ่กจ.md) | ๆธฏ่กๆฐๆฎ | ่ทๅๆธฏ่กไธๅธๅ ฌๅธ่ดขๅกๅฉๆถฆ่กจๆฐๆฎ |+| 388 | hk_fina_indicator | [ๆธฏ่ก่ดขๅกๆๆ ๆฐๆฎ](references/ๆธฏ่กๆฐๆฎ/ๆธฏ่ก่ดขๅกๆๆ ๆฐๆฎ.md) | ๆธฏ่กๆฐๆฎ | ่ทๅๆธฏ่กไธๅธๅ ฌๅธ่ดขๅกๆๆ ๆฐๆฎ๏ผไธบ้ฟๅ ๆๅกๅจๅๅ๏ผ็ฐ้ถๆฎตๆฏๆฌก่ฏทๆฑๆๅค่ฟๅ200ๆก่ฎฐๅฝ๏ผๅฏ้่ฟ่ฎพ็ฝฎๆฅๆๅคๆฌก่ฏทๆฑ่ทๅๆดๅคๆฐๆฎใ |+| 401 | hk_adjfactor | [ๆธฏ่กๅคๆๅ ๅญ](references/ๆธฏ่กๆฐๆฎ/ๆธฏ่กๅคๆๅ ๅญ.md) | ๆธฏ่กๆฐๆฎ | ่ทๅๆธฏ่กๆฏๆฅๅคๆๅ ๅญๆฐๆฎ๏ผๆฏๅคฉๆปๅจๅทๆฐ |+| 339 | hk_daily_adj | [ๆธฏ่กๅคๆ่กๆ ](references/ๆธฏ่กๆฐๆฎ/ๆธฏ่กๅคๆ่กๆ .md) | ๆธฏ่กๆฐๆฎ | ่ทๅๆธฏ่กๅคๆ่กๆ ๏ผๆไพ่ก็ฅจ่กๆฌใๅธๅผๅๆไบคๅๆขๆๅคไธชๆฐๆฎๆๆ |+| 383 | rt_hk_k | [ๆธฏ่กๅฎๆถๆฅ็บฟ](references/ๆธฏ่กๆฐๆฎ/ๆธฏ่กๅฎๆถๆฅ็บฟ.md) | ๆธฏ่กๆฐๆฎ | ่ทๅๆธฏ่กๅฎๆถๆฅk็บฟ่กๆ ๏ผๆฏๆๆ่ก็ฅจไปฃ็ ๅ่ก็ฅจไปฃ็ ้้ ็ฌฆไธๆฌกๆงๆๅๅ จ้จ่ก็ฅจๅฎๆถๆฅk็บฟ่กๆ |+| 191 | hk_basic | [ๆธฏ่กๅบ็กไฟกๆฏ](references/ๆธฏ่กๆฐๆฎ/ๆธฏ่กๅบ็กไฟกๆฏ.md) | ๆธฏ่กๆฐๆฎ | ่ทๅๆธฏ่กๅ่กจไฟกๆฏ |+| 192 | hk_daily | [ๆธฏ่กๆฅ็บฟ่กๆ ](references/ๆธฏ่กๆฐๆฎ/ๆธฏ่กๆฅ็บฟ่กๆ .md) | ๆธฏ่กๆฐๆฎ | ่ทๅๆธฏ่กๆฏๆฅๅข้ๅๅๅฒ่กๆ ๏ผๆฏๆฅ18็นๅทฆๅณๆดๆฐๅฝๆฅๆฐๆฎ |+| 304 | hk_mins | [ๆธฏ่กๅ้่กๆ ](references/ๆธฏ่กๆฐๆฎ/ๆธฏ่กๅ้่กๆ .md) | ๆธฏ่กๆฐๆฎ | ๆธฏ่กๅ้ๆฐๆฎ๏ผๆฏๆ1min/5min/15min/30min/60min่กๆ ๏ผๆไพPython SDKๅ http Restful APIไธค็งๆนๅผ |+| 250 | hk_tradecal | [ๆธฏ่กไบคๆๆฅๅ](references/ๆธฏ่กๆฐๆฎ/ๆธฏ่กไบคๆๆฅๅ.md) | ๆธฏ่กๆฐๆฎ | ่ทๅไบคๆๆฅๅ |+| 285 | sge_daily | [ไธๆตท้ป้็ฐ่ดงๆฅ่กๆ ](references/็ฐ่ดงๆฐๆฎ/ไธๆตท้ป้็ฐ่ดงๆฅ่กๆ .md) | ็ฐ่ดงๆฐๆฎ | ่ทๅไธๆตท้ป้ไบคๆๆ็ฐ่ดงๅ็บฆๆฅ็บฟ่กๆ |+| 284 | sge_basic | [ไธๆตท้ป้ๅบ็กไฟกๆฏ](references/็ฐ่ดงๆฐๆฎ/ไธๆตท้ป้ๅบ็กไฟกๆฏ.md) | ็ฐ่ดงๆฐๆฎ | ่ทๅไธๆตท้ป้ไบคๆๆ็ฐ่ดงๅ็บฆๅบ็กไฟกๆฏ |+| 393 | us_fina_indicator | [็พ่ก่ดขๅกๆๆ ๆฐๆฎ](references/็พ่กๆฐๆฎ/็พ่ก่ดขๅกๆๆ ๆฐๆฎ.md) | ็พ่กๆฐๆฎ | ่ทๅ็พ่กไธๅธๅ ฌๅธ่ดขๅกๆๆ ๆฐๆฎ๏ผ็ฎๅๅช่ฆ็ไธป่ฆ็พ่กๅไธญๆฆ่กใไธบ้ฟๅ ๆๅกๅจๅๅ๏ผ็ฐ้ถๆฎตๆฏๆฌก่ฏทๆฑๆๅค่ฟๅ200ๆก่ฎฐๅฝ๏ผๅฏ้่ฟ่ฎพ็ฝฎๆฅๆๅคๆฌก่ฏทๆฑ่ทๅๆดๅคๆฐๆฎใ |+| 402 | us_adjfactor | [็พ่กๅคๆๅ ๅญ](references/็พ่กๆฐๆฎ/็พ่กๅคๆๅ ๅญ.md) | ็พ่กๆฐๆฎ | ่ทๅ็พ่กๆฏๆฅๅคๆๅ ๅญๆฐๆฎ๏ผๅจๆฏๅคฉ็พ่กๆถ็ๅๆปๅจๅทๆฐ |+| 396 | us_cashflow | [็พ่ก็ฐ้ๆต้่กจ](references/็พ่กๆฐๆฎ/็พ่ก็ฐ้ๆต้่กจ.md) | ็พ่กๆฐๆฎ | ่ทๅ็พ่กไธๅธๅ ฌๅธ็ฐ้ๆต้่กจๆฐๆฎ๏ผ็ฎๅๅช่ฆ็ไธป่ฆ็พ่กๅไธญๆฆ่ก๏ผ |+| 395 | us_balancesheet | [็พ่ก่ตไบง่ดๅบ่กจ](references/็พ่กๆฐๆฎ/็พ่ก่ตไบง่ดๅบ่กจ.md) | ็พ่กๆฐๆฎ | ่ทๅ็พ่กไธๅธๅ ฌๅธ่ตไบง่ดๅบ่กจ๏ผ็ฎๅๅช่ฆ็ไธป่ฆ็พ่กๅไธญๆฆ่ก๏ผ |+| 394 | us_income | [็พ่กๅฉๆถฆ่กจ](references/็พ่กๆฐๆฎ/็พ่กๅฉๆถฆ่กจ.md) | ็พ่กๆฐๆฎ | ่ทๅ็พ่กไธๅธๅ ฌๅธ่ดขๅกๅฉๆถฆ่กจๆฐๆฎ๏ผ็ฎๅๅช่ฆ็ไธป่ฆ็พ่กๅไธญๆฆ่ก๏ผ |+| 254 | us_daily | [็พ่กๆฅ็บฟ่กๆ ](references/็พ่กๆฐๆฎ/็พ่กๆฅ็บฟ่กๆ .md) | ็พ่กๆฐๆฎ | ่ทๅ็พ่ก่กๆ ๏ผๆชๅคๆ๏ผ๏ผๅ ๆฌๅ จ้จ่ก็ฅจๅ จๅๅฒ่กๆ ๏ผไปฅๅ้่ฆ็ๅธๅบๅไผฐๅผๆๆ |+| 253 | us_tradecal | [็พ่กไบคๆๆฅๅ](references/็พ่กๆฐๆฎ/็พ่กไบคๆๆฅๅ.md) | ็พ่กๆฐๆฎ | ่ทๅ็พ่กไบคๆๆฅๅไฟกๆฏ |+| 252 | us_basic | [็พ่กๅบ็กไฟกๆฏ](references/็พ่กๆฐๆฎ/็พ่กๅบ็กไฟกๆฏ.md) | ็พ่กๆฐๆฎ | ่ทๅ็พ่กๅ่กจไฟกๆฏ |+| 338 | us_daily_adj | [็พ่กๅคๆ่กๆ ](references/็พ่กๆฐๆฎ/็พ่กๅคๆ่กๆ .md) | ็พ่กๆฐๆฎ | ่ทๅ็พ่กๅคๆ่กๆ ๏ผๆฏๆ็พ่กๅ จๅธๅบ่ก็ฅจ๏ผๆไพ่กๆฌใๅธๅผใๅคๆๅ ๅญๅๆไบคไฟกๆฏ็ญๅคไธชๆฐๆฎๆๆ |+| 326 | margin_secs | [่่ต่ๅธๆ ็(็ๅ)](references/่ก็ฅจๆฐๆฎ/ไธค่ๅ่ฝฌ่้/่่ต่ๅธๆ ็(็ๅ).md) | ่ก็ฅจๆฐๆฎ,ไธค่ๅ่ฝฌ่้ | ่ทๅๆฒชๆทฑไบฌไธๅคงไบคๆๆ่่ต่ๅธๆ ็๏ผๅ ๆฌETF๏ผ๏ผๆฏๅคฉ็ๅๆดๆฐ |+| 331 | slb_len | [่ฝฌ่่ตไบคๆๆฑๆป](references/่ก็ฅจๆฐๆฎ/ไธค่ๅ่ฝฌ่้/่ฝฌ่่ตไบคๆๆฑๆป.md) | ่ก็ฅจๆฐๆฎ,ไธค่ๅ่ฝฌ่้ | ่ฝฌ่้่่ตๆฑๆป |+| 332 | slb_sec | [่ฝฌ่ๅธไบคๆๆฑๆป(ๅ)](references/่ก็ฅจๆฐๆฎ/ไธค่ๅ่ฝฌ่้/่ฝฌ่ๅธไบคๆๆฑๆป(ๅ).md) | ่ก็ฅจๆฐๆฎ,ไธค่ๅ่ฝฌ่้ | ่ฝฌ่้่ฝฌ่ๅธไบคๆๆฑๆป |+| 333 | slb_sec_detail | [่ฝฌ่ๅธไบคๆๆ็ป(ๅ)](references/่ก็ฅจๆฐๆฎ/ไธค่ๅ่ฝฌ่้/่ฝฌ่ๅธไบคๆๆ็ป(ๅ).md) | ่ก็ฅจๆฐๆฎ,ไธค่ๅ่ฝฌ่้ | ่ฝฌ่ๅธไบคๆๆ็ป |+| 59 | margin_detail | [่่ต่ๅธไบคๆๆ็ป](references/่ก็ฅจๆฐๆฎ/ไธค่ๅ่ฝฌ่้/่่ต่ๅธไบคๆๆ็ป.md) | ่ก็ฅจๆฐๆฎ,ไธค่ๅ่ฝฌ่้ | ่ทๅๆฒชๆทฑไธคๅธๆฏๆฅ่่ต่ๅธๆ็ป |+| 58 | margin | [่่ต่ๅธไบคๆๆฑๆป](references/่ก็ฅจๆฐๆฎ/ไธค่ๅ่ฝฌ่้/่่ต่ๅธไบคๆๆฑๆป.md) | ่ก็ฅจๆฐๆฎ,ไธค่ๅ่ฝฌ่้ | ่ทๅ่่ต่ๅธๆฏๆฅไบคๆๆฑๆปๆฐๆฎ |+| 334 | slb_len_mm | [ๅๅธๅๅธไบคๆๆฑๆป(ๅ)](references/่ก็ฅจๆฐๆฎ/ไธค่ๅ่ฝฌ่้/ๅๅธๅๅธไบคๆๆฑๆป(ๅ).md) | ่ก็ฅจๆฐๆฎ,ไธค่ๅ่ฝฌ่้ | ๅๅธๅๅธไบคๆๆฑๆป |+| 124 | repurchase | [่ก็ฅจๅ่ดญ](references/่ก็ฅจๆฐๆฎ/ๅ่ๆฐๆฎ/่ก็ฅจๅ่ดญ.md) | ่ก็ฅจๆฐๆฎ,ๅ่ๆฐๆฎ | ่ทๅไธๅธๅ ฌๅธๅ่ดญ่ก็ฅจๆฐๆฎ |+| 110 | pledge_stat | [่กๆ่ดจๆผ็ป่ฎกๆฐๆฎ](references/่ก็ฅจๆฐๆฎ/ๅ่ๆฐๆฎ/่กๆ่ดจๆผ็ป่ฎกๆฐๆฎ.md) | ่ก็ฅจๆฐๆฎ,ๅ่ๆฐๆฎ | ่ทๅ่ก็ฅจ่ดจๆผ็ป่ฎกๆฐๆฎ |+| 160 | share_float | [้ๅฎ่ก่งฃ็ฆ](references/่ก็ฅจๆฐๆฎ/ๅ่ๆฐๆฎ/้ๅฎ่ก่งฃ็ฆ.md) | ่ก็ฅจๆฐๆฎ,ๅ่ๆฐๆฎ | ่ทๅ้ๅฎ่ก่งฃ็ฆ |+| 161 | block_trade | [ๅคงๅฎไบคๆ](references/่ก็ฅจๆฐๆฎ/ๅ่ๆฐๆฎ/ๅคงๅฎไบคๆ.md) | ่ก็ฅจๆฐๆฎ,ๅ่ๆฐๆฎ | ๅคงๅฎไบคๆ |+| 164 | stk_account | [่ก็ฅจๅผๆทๆฐๆฎ(ๅ)](references/่ก็ฅจๆฐๆฎ/ๅ่ๆฐๆฎ/่ก็ฅจๅผๆทๆฐๆฎ(ๅ).md) | ่ก็ฅจๆฐๆฎ,ๅ่ๆฐๆฎ | ่ทๅ่ก็ฅจ่ดฆๆทๅผๆทๆฐๆฎ๏ผ็ป่ฎกๅจๆไธบไธๅจ |+| 165 | stk_account_old | [่ก็ฅจๅผๆทๆฐๆฎ(ๆง)](references/่ก็ฅจๆฐๆฎ/ๅ่ๆฐๆฎ/่ก็ฅจๅผๆทๆฐๆฎ(ๆง).md) | ่ก็ฅจๆฐๆฎ,ๅ่ๆฐๆฎ | ่ทๅ่ก็ฅจ่ดฆๆทๅผๆทๆฐๆฎๆง็ๆ ผๅผๆฐๆฎ๏ผๆฐๆฎไป2008ๅนด1ๆๅผๅง๏ผๅฐ2015ๅนด5ๆ29๏ผๆฐๆฐๆฎ่ฏท้่ฟ[่ก็ฅจๅผๆทๆฐๆฎ](https://tushare.pro/document/2?doc_id=164)่ทๅใ |+| 166 | stk_holdernumber | [่กไธไบบๆฐ](references/่ก็ฅจๆฐๆฎ/ๅ่ๆฐๆฎ/่กไธไบบๆฐ.md) | ่ก็ฅจๆฐๆฎ,ๅ่ๆฐๆฎ | ่ทๅไธๅธๅ ฌๅธ่กไธๆทๆฐๆฐๆฎ๏ผๆฐๆฎไธๅฎๆๅ ฌๅธ |+| 175 | stk_holdertrade | [่กไธๅขๅๆ](references/่ก็ฅจๆฐๆฎ/ๅ่ๆฐๆฎ/่กไธๅขๅๆ.md) | ่ก็ฅจๆฐๆฎ,ๅ่ๆฐๆฎ | ่ทๅไธๅธๅ ฌๅธๅขๅๆๆฐๆฎ๏ผไบ่งฃ้่ฆ่กไธ่ฟๆๅๅๅฒไธ็่กไปฝๅขๅๅๅ |+| 61 | top10_holders | [ๅๅๅคง่กไธ](references/่ก็ฅจๆฐๆฎ/ๅ่ๆฐๆฎ/ๅๅๅคง่กไธ.md) | ่ก็ฅจๆฐๆฎ,ๅ่ๆฐๆฎ | ่ทๅไธๅธๅ ฌๅธๅๅๅคง่กไธๆฐๆฎ๏ผๅ ๆฌๆๆๆฐ้ๅๆฏไพ็ญไฟกๆฏ |+| 111 | pledge_detail | [่กๆ่ดจๆผๆ็ปๆฐๆฎ](references/่ก็ฅจๆฐๆฎ/ๅ่ๆฐๆฎ/่กๆ่ดจๆผๆ็ปๆฐๆฎ.md) | ่ก็ฅจๆฐๆฎ,ๅ่ๆฐๆฎ | ่ทๅ่ก็ฅจ่ดจๆผๆ็ปๆฐๆฎ |+| 62 | top10_floatholders | [ๅๅๅคงๆต้่กไธ](references/่ก็ฅจๆฐๆฎ/ๅ่ๆฐๆฎ/ๅๅๅคงๆต้่กไธ.md) | ่ก็ฅจๆฐๆฎ,ๅ่ๆฐๆฎ | ่ทๅไธๅธๅ ฌๅธๅๅๅคงๆต้่กไธๆฐๆฎ |+| 423 | st | [ST้ฃ้ฉ่ญฆ็คบๆฟ่ก็ฅจ](references/่ก็ฅจๆฐๆฎ/ๅบ็กๆฐๆฎ/ST้ฃ้ฉ่ญฆ็คบๆฟ่ก็ฅจ.md) | ่ก็ฅจๆฐๆฎ,ๅบ็กๆฐๆฎ | ST้ฃ้ฉ่ญฆ็คบๆฟ่ก็ฅจๅ่กจ |+| 398 | stock_hsgt | [ๆฒชๆทฑๆธฏ้่ก็ฅจๅ่กจ](references/่ก็ฅจๆฐๆฎ/ๅบ็กๆฐๆฎ/ๆฒชๆทฑๆธฏ้่ก็ฅจๅ่กจ.md) | ่ก็ฅจๆฐๆฎ,ๅบ็กๆฐๆฎ | ่ทๅๆฒชๆทฑๆธฏ้่ก็ฅจๅ่กจ |+| 397 | stock_st | [ST่ก็ฅจๅ่กจ](references/่ก็ฅจๆฐๆฎ/ๅบ็กๆฐๆฎ/ST่ก็ฅจๅ่กจ.md) | ่ก็ฅจๆฐๆฎ,ๅบ็กๆฐๆฎ | ่ทๅST่ก็ฅจๅ่กจ๏ผๅฏๆ นๆฎไบคๆๆฅๆ่ทๅๅๅฒไธๆฏๅคฉ็STๅ่กจ |+| 375 | bse_mapping | [ๅไบคๆๆฐๆงไปฃ็ ๅฏน็ ง](references/่ก็ฅจๆฐๆฎ/ๅบ็กๆฐๆฎ/ๅไบคๆๆฐๆงไปฃ็ ๅฏน็ ง.md) | ่ก็ฅจๆฐๆฎ,ๅบ็กๆฐๆฎ | ่ทๅๅไบคๆ่ก็ฅจไปฃ็ ๅๆดๅๆฐๆงไปฃ็ ๆ ๅฐ่กจๆฐๆฎ |+| 329 | stk_premarket | [ๆฏๆฅ่กๆฌ(็ๅ)](references/่ก็ฅจๆฐๆฎ/ๅบ็กๆฐๆฎ/ๆฏๆฅ่กๆฌ(็ๅ).md) | ่ก็ฅจๆฐๆฎ,ๅบ็กๆฐๆฎ | ๆฏๆฅๅผ็ๅ่ทๅๅฝๆฅ่ก็ฅจ็่กๆฌๆ ๅต๏ผๅ ๆฌๆป่กๆฌๅๆต้่กๆฌ๏ผๆถจ่ทๅไปทๆ ผ็ญใ |+| 123 | new_share | [IPOๆฐ่กไธๅธ](references/่ก็ฅจๆฐๆฎ/ๅบ็กๆฐๆฎ/IPOๆฐ่กไธๅธ.md) | ่ก็ฅจๆฐๆฎ,ๅบ็กๆฐๆฎ | ่ทๅๆฐ่กไธๅธๅ่กจๆฐๆฎ |+| 194 | stk_rewards | [็ฎก็ๅฑ่ช้ ฌๅๆ่ก](references/่ก็ฅจๆฐๆฎ/ๅบ็กๆฐๆฎ/็ฎก็ๅฑ่ช้ ฌๅๆ่ก.md) | ่ก็ฅจๆฐๆฎ,ๅบ็กๆฐๆฎ | ่ทๅไธๅธๅ ฌๅธ็ฎก็ๅฑ่ช้ ฌๅๆ่ก |+| 193 | stk_managers | [ไธๅธๅ ฌๅธ็ฎก็ๅฑ](references/่ก็ฅจๆฐๆฎ/ๅบ็กๆฐๆฎ/ไธๅธๅ ฌๅธ็ฎก็ๅฑ.md) | ่ก็ฅจๆฐๆฎ,ๅบ็กๆฐๆฎ | ่ทๅไธๅธๅ ฌๅธ็ฎก็ๅฑ |+| 112 | stock_company | [ไธๅธๅ ฌๅธๅบๆฌไฟกๆฏ](references/่ก็ฅจๆฐๆฎ/ๅบ็กๆฐๆฎ/ไธๅธๅ ฌๅธๅบๆฌไฟกๆฏ.md) | ่ก็ฅจๆฐๆฎ,ๅบ็กๆฐๆฎ | ่ทๅไธๅธๅ ฌๅธๅบ็กไฟกๆฏ๏ผๅๆฌกๆๅ4500ๆก๏ผๅฏไปฅๆ นๆฎไบคๆๆๅๆนๆๅ |+| 100 | namechange | [่ก็ฅจๆพ็จๅ](references/่ก็ฅจๆฐๆฎ/ๅบ็กๆฐๆฎ/่ก็ฅจๆพ็จๅ.md) | ่ก็ฅจๆฐๆฎ,ๅบ็กๆฐๆฎ | ๅๅฒๅ็งฐๅๆด่ฎฐๅฝ |+| 26 | trade_cal | [ไบคๆๆฅๅ](references/่ก็ฅจๆฐๆฎ/ๅบ็กๆฐๆฎ/ไบคๆๆฅๅ.md) | ่ก็ฅจๆฐๆฎ,ๅบ็กๆฐๆฎ | ่ทๅๅๅคงไบคๆๆไบคๆๆฅๅๆฐๆฎ,้ป่ฎคๆๅ็ๆฏไธไบคๆ |+| 25 | stock_basic | [่ก็ฅจๅ่กจ](references/่ก็ฅจๆฐๆฎ/ๅบ็กๆฐๆฎ/่ก็ฅจๅ่กจ.md) | ่ก็ฅจๆฐๆฎ,ๅบ็กๆฐๆฎ | ่ทๅๅบ็กไฟกๆฏๆฐๆฎ๏ผๅ ๆฌ่ก็ฅจไปฃ็ ใๅ็งฐใไธๅธๆฅๆใ้ๅธๆฅๆ็ญ |+| 262 | bak_basic | [่ก็ฅจๅๅฒๅ่กจ](references/่ก็ฅจๆฐๆฎ/ๅบ็กๆฐๆฎ/่ก็ฅจๅๅฒๅ่กจ.md) | ่ก็ฅจๆฐๆฎ,ๅบ็กๆฐๆฎ | ่ทๅๅค็จๅบ็กๅ่กจ๏ผๆฐๆฎไป2016ๅนดๅผๅง |+| 382 | dc_daily | [ไธ่ดขๆฆๅฟตๅ่กไธๆๆฐ่กๆ ](references/่ก็ฅจๆฐๆฎ/ๆๆฟไธ้ขๆฐๆฎ/ไธ่ดขๆฆๅฟตๅ่กไธๆๆฐ่กๆ .md) | ่ก็ฅจๆฐๆฎ,ๆๆฟไธ้ขๆฐๆฎ | ่ทๅไธ่ดขๆฆๅฟตๆฟๅใ่กไธๆๆฐๆฟๅใๅฐๅๆฟๅ่กๆ ๆฐๆฎ๏ผๅๅฒๆฐๆฎๅผๅงไบ2020ๅนด |+| 321 | dc_hot | [ไธๆน่ดขๅฏApp็ญๆฆ](references/่ก็ฅจๆฐๆฎ/ๆๆฟไธ้ขๆฐๆฎ/ไธๆน่ดขๅฏApp็ญๆฆ.md) | ่ก็ฅจๆฐๆฎ,ๆๆฟไธ้ขๆฐๆฎ | ่ทๅไธๆน่ดขๅฏApp็ญๆฆๆฐๆฎ๏ผๅ ๆฌA่กๅธๅบใETFๅบ้ใๆธฏ่กๅธๅบใ็พ่กๅธๅบ็ญ็ญ๏ผๆฏๆฅ็ไธญๆๅ4ๆฌก๏ผๆถ็ๅ4ๆฌก๏ผๆๆ22็นๆๅไธๆฌกใ |+| 298 | limit_list_d | [ๆถจ่ทๅๅ็ธๆฟๆฐๆฎ](references/่ก็ฅจๆฐๆฎ/ๆๆฟไธ้ขๆฐๆฎ/ๆถจ่ทๅๅ็ธๆฟๆฐๆฎ.md) | ่ก็ฅจๆฐๆฎ,ๆๆฟไธ้ขๆฐๆฎ | ่ทๅA่กๆฏๆฅๆถจ่ทๅใ็ธๆฟๆฐๆฎๆ ๅต๏ผๆฐๆฎไป2020ๅนดๅผๅง๏ผไธๆไพST่ก็ฅจ็็ป่ฎก๏ผ |+| 311 | hm_list | [ๅธๅบๆธธ่ตๆๅ จๅๅฝ](references/่ก็ฅจๆฐๆฎ/ๆๆฟไธ้ขๆฐๆฎ/ๅธๅบๆธธ่ตๆๅ จๅๅฝ.md) | ่ก็ฅจๆฐๆฎ,ๆๆฟไธ้ขๆฐๆฎ | ่ทๅๆธธ่ตๅ็ฑปๅๅฝไฟกๆฏ |+| 347 | kpl_list | [ๆฆๅๆฐๆฎ(ๅผ็ๅฆ)](references/่ก็ฅจๆฐๆฎ/ๆๆฟไธ้ขๆฐๆฎ/ๆฆๅๆฐๆฎ(ๅผ็ๅฆ).md) | ่ก็ฅจๆฐๆฎ,ๆๆฟไธ้ขๆฐๆฎ | ่ทๅๅผ็ๅฆๆถจๅใ่ทๅใ็ธๆฟ็ญๆฆๅๆฐๆฎ |+| 261 | ths_member | [ๅ่ฑ้กบ่กไธๆฆๅฟตๆๅ](references/่ก็ฅจๆฐๆฎ/ๆๆฟไธ้ขๆฐๆฎ/ๅ่ฑ้กบ่กไธๆฆๅฟตๆๅ.md) | ่ก็ฅจๆฐๆฎ,ๆๆฟไธ้ขๆฐๆฎ | ่ทๅๅ่ฑ้กบๆฆๅฟตๆฟๅๆๅๅ่กจๆณจ๏ผๆฐๆฎ็ๆๅฝๅฑๅ่ฑ้กบ๏ผๅฆๅๅไธ็จ้๏ผ่ฏทไธปๅจ่็ณปๅ่ฑ้กบใ |+| 260 | ths_daily | [ๅ่ฑ้กบๆฆๅฟตๅ่กไธๆๆฐ่กๆ ](references/่ก็ฅจๆฐๆฎ/ๆๆฟไธ้ขๆฐๆฎ/ๅ่ฑ้กบๆฆๅฟตๅ่กไธๆๆฐ่กๆ .md) | ่ก็ฅจๆฐๆฎ,ๆๆฟไธ้ขๆฐๆฎ | ่ทๅๅ่ฑ้กบๆฟๅๆๆฐ่กๆ ใๆณจ๏ผๆฐๆฎ็ๆๅฝๅฑๅ่ฑ้กบ๏ผๅฆๅๅไธ็จ้๏ผ่ฏทไธปๅจ่็ณปๅ่ฑ้กบ๏ผๅฆ้ๅธฎๅฉ่ฏท่็ณปๅพฎไฟก๏ผwaditu_a |+| 259 | ths_index | [ๅ่ฑ้กบ่กไธๆฆๅฟตๆฟๅ](references/่ก็ฅจๆฐๆฎ/ๆๆฟไธ้ขๆฐๆฎ/ๅ่ฑ้กบ่กไธๆฆๅฟตๆฟๅ.md) | ่ก็ฅจๆฐๆฎ,ๆๆฟไธ้ขๆฐๆฎ | ่ทๅๅ่ฑ้กบๆฟๅๆๆฐใๆณจ๏ผๆฐๆฎ็ๆๅฝๅฑๅ่ฑ้กบ๏ผๅฆๅๅไธ็จ้๏ผ่ฏทไธปๅจ่็ณปๅ่ฑ้กบ๏ผๅฆ้ๅธฎๅฉ่ฏท่็ณปๅพฎไฟก๏ผwaditu_a |+| 107 | top_inst | [้พ่ๆฆๆบๆไบคๆๅ](references/่ก็ฅจๆฐๆฎ/ๆๆฟไธ้ขๆฐๆฎ/้พ่ๆฆๆบๆไบคๆๅ.md) | ่ก็ฅจๆฐๆฎ,ๆๆฟไธ้ขๆฐๆฎ | ้พ่ๆฆๆบๆๆไบคๆ็ป |+| 351 | kpl_concept_cons | [้ขๆๆๅ(ๅผ็ๅฆ)](references/่ก็ฅจๆฐๆฎ/ๆๆฟไธ้ขๆฐๆฎ/้ขๆๆๅ(ๅผ็ๅฆ).md) | ่ก็ฅจๆฐๆฎ,ๆๆฟไธ้ขๆฐๆฎ | ่ทๅๅผ็ๅฆๆฆๅฟต้ขๆ็ๆๅ่ก |+| 355 | limit_list_ths | [ๅ่ฑ้กบๆถจ่ทๅๆฆๅ](references/่ก็ฅจๆฐๆฎ/ๆๆฟไธ้ขๆฐๆฎ/ๅ่ฑ้กบๆถจ่ทๅๆฆๅ.md) | ่ก็ฅจๆฐๆฎ,ๆๆฟไธ้ขๆฐๆฎ | ่ทๅๅ่ฑ้กบๆฏๆฅๆถจ่ทๅๆฆๅๆฐๆฎ๏ผๅๅฒๆฐๆฎไป20231101ๅผๅงๆไพ๏ผๅข้ๆฏๅคฉ16็นๅทฆๅณๆดๆฐ |+| 356 | limit_step | [ๆถจๅ่ก็ฅจ่ฟๆฟๅคฉๆขฏ](references/่ก็ฅจๆฐๆฎ/ๆๆฟไธ้ขๆฐๆฎ/ๆถจๅ่ก็ฅจ่ฟๆฟๅคฉๆขฏ.md) | ่ก็ฅจๆฐๆฎ,ๆๆฟไธ้ขๆฐๆฎ | ่ทๅๆฏๅคฉ่ฟๆฟไธชๆฐๆ็บง็่ก็ฅจ๏ผๅฏไปฅๅๆๅบๆฏๅคฉ่ฟ็ปญๆถจๅ่ฟ้ถไธชๆฐ๏ผๅคๆญๅผบๅฟ็ญๅบฆ |+| 357 | limit_cpt_list | [ๆถจๅๆๅผบๆฟๅ็ป่ฎก](references/่ก็ฅจๆฐๆฎ/ๆๆฟไธ้ขๆฐๆฎ/ๆถจๅๆๅผบๆฟๅ็ป่ฎก.md) | ่ก็ฅจๆฐๆฎ,ๆๆฟไธ้ขๆฐๆฎ | ่ทๅๆฏๅคฉๆถจๅ่ก็ฅจๆๅคๆๅผบ็ๆฆๅฟตๆฟๅ๏ผๅฏไปฅๅๆๅผบๅฟๆฟๅ็่ฝฎๅจ๏ผๅคๆญ่ต้ๅจๅ |+| 362 | dc_index | [ไธๆน่ดขๅฏๆฆๅฟตๆฟๅ](references/่ก็ฅจๆฐๆฎ/ๆๆฟไธ้ขๆฐๆฎ/ไธๆน่ดขๅฏๆฆๅฟตๆฟๅ.md) | ่ก็ฅจๆฐๆฎ,ๆๆฟไธ้ขๆฐๆฎ | ่ทๅไธๆน่ดขๅฏๆฏไธชไบคๆๆฅ็ๆฆๅฟตๆฟๅๆฐๆฎ๏ผๆฏๆๆๆฅๆๆฅ่ฏข |+| 363 | dc_member | [ไธๆน่ดขๅฏๆฆๅฟตๆๅ](references/่ก็ฅจๆฐๆฎ/ๆๆฟไธ้ขๆฐๆฎ/ไธๆน่ดขๅฏๆฆๅฟตๆๅ.md) | ่ก็ฅจๆฐๆฎ,ๆๆฟไธ้ขๆฐๆฎ | ่ทๅไธๆน่ดขๅฏๆฟๅๆฏๆฅๆๅๆฐๆฎ๏ผๅฏไปฅๆ นๆฎๆฆๅฟตๆฟๅไปฃ็ ๅไบคๆๆฅๆ๏ผ่ทๅๅๅฒๆๅ |+| 369 | stk_auction | [ๅผ็็ซไปทๆไบค(ๅฝๆฅ)](references/่ก็ฅจๆฐๆฎ/ๆๆฟไธ้ขๆฐๆฎ/ๅผ็็ซไปทๆไบค(ๅฝๆฅ).md) | ่ก็ฅจๆฐๆฎ,ๆๆฟไธ้ขๆฐๆฎ | ่ทๅๅฝๆฅไธช่กๅETF็้ๅ็ซไปทๆไบคๆ ๅต๏ผๆฏๅคฉ9็น25~29ๅไน้ดๅฏไปฅ่ทๅๅฝๆฅ็้ๅ็ซไปทๆไบคๆฐๆฎ |+| 376 | tdx_index | [้่พพไฟกๆฟๅไฟกๆฏ](references/่ก็ฅจๆฐๆฎ/ๆๆฟไธ้ขๆฐๆฎ/้่พพไฟกๆฟๅไฟกๆฏ.md) | ่ก็ฅจๆฐๆฎ,ๆๆฟไธ้ขๆฐๆฎ | ่ทๅ้่พพไฟกๆฟๅๅบ็กไฟกๆฏ๏ผๅ ๆฌๆฆๅฟตๆฟๅใ่กไธใ้ฃๆ ผใๅฐๅ็ญ |+| 106 | top_list | [้พ่ๆฆๆฏๆฅ็ป่ฎกๅ](references/่ก็ฅจๆฐๆฎ/ๆๆฟไธ้ขๆฐๆฎ/้พ่ๆฆๆฏๆฅ็ป่ฎกๅ.md) | ่ก็ฅจๆฐๆฎ,ๆๆฟไธ้ขๆฐๆฎ | ้พ่ๆฆๆฏๆฅไบคๆๆ็ป |+| 377 | tdx_member | [้่พพไฟกๆฟๅๆๅ](references/่ก็ฅจๆฐๆฎ/ๆๆฟไธ้ขๆฐๆฎ/้่พพไฟกๆฟๅๆๅ.md) | ่ก็ฅจๆฐๆฎ,ๆๆฟไธ้ขๆฐๆฎ | ่ทๅ้่พพไฟกๅๆฟๅๆๅ่กไฟกๆฏ |+| 378 | tdx_daily | [้่พพไฟกๆฟๅ่กๆ ](references/่ก็ฅจๆฐๆฎ/ๆๆฟไธ้ขๆฐๆฎ/้่พพไฟกๆฟๅ่กๆ .md) | ่ก็ฅจๆฐๆฎ,ๆๆฟไธ้ขๆฐๆฎ | ่ทๅ้่พพไฟกๅๆฟๅ่กๆ ๏ผๅ ๆฌๆไบคๅไผฐๅผ็ญๆฐๆฎ |+| 312 | hm_detail | [ๆธธ่ตไบคๆๆฏๆฅๆ็ป](references/่ก็ฅจๆฐๆฎ/ๆๆฟไธ้ขๆฐๆฎ/ๆธธ่ตไบคๆๆฏๆฅๆ็ป.md) | ่ก็ฅจๆฐๆฎ,ๆๆฟไธ้ขๆฐๆฎ | ่ทๅๆฏๆฅๆธธ่ตไบคๆๆ็ป๏ผๆฐๆฎๅผๅงไบ2022ๅนด8ใๆธธ่ตๅ็ฑปๅๅฝ๏ผ่ฏท็นๅป<a href="https://tushare.pro/document/2?doc_id=311">ๆธธ่ตๅๅฝ</a> |+| 320 | ths_hot | [ๅ่ฑ้กบApp็ญๆฆๆฐ](references/่ก็ฅจๆฐๆฎ/ๆๆฟไธ้ขๆฐๆฎ/ๅ่ฑ้กบApp็ญๆฆๆฐ.md) | ่ก็ฅจๆฐๆฎ,ๆๆฟไธ้ขๆฐๆฎ | ่ทๅๅ่ฑ้กบApp็ญๆฆๆฐๆฎ๏ผๅ ๆฌ็ญ่กใๆฆๅฟตๆฟๅใETFใๅฏ่ฝฌๅบใๆธฏ็พ่ก็ญ็ญ๏ผๆฏๆฅ็ไธญๆๅ4ๆฌก๏ผๆถ็ๅ4ๆฌก๏ผๆๆ22็นๆๅไธๆฌกใ |+| 364 | stk_nineturn | [็ฅๅฅไน่ฝฌๆๆ ](references/่ก็ฅจๆฐๆฎ/็น่ฒๆฐๆฎ/็ฅๅฅไน่ฝฌๆๆ .md) | ่ก็ฅจๆฐๆฎ,็น่ฒๆฐๆฎ | ็ฅๅฅไน่ฝฌ๏ผๅ็งฐโไน่ฝฌๅบๅโ๏ผๆฏไธ็งๅบไบๆๆฏๅๆ็่ก็ฅจ่ถๅฟๅ่ฝฌๆๆ ๏ผๅ ถๆๆณๆฅๆบไบๆๆฏๅๆๅคงๅธๆฑคๅงยท่ฟช้ฉฌๅ ๏ผTom DeMark๏ผ็TDๅบๅใ่ฏฅๆๆ ็ๆ ธๅฟๅ่ฝๆฏ้่ฟ่ฏๅซ่กไปทๅจไธๆถจๆไธ่ท่ฟ็จไธญ่ฟ็ปญ9ๅคฉ็็นๅฎ่ตฐๅฟ๏ผๆฅๅคๆญ่กไปท็ๆฝๅจๅ่ฝฌ็น๏ผไป่ๅธฎๅฉๆ่ต่ ๆ้ซๆๅบๅ้้กถ็ๆๅ็๏ผๆฅ็บฟ็บงๅซ้ ๅ60min็ไน่ฝฌๆๆๆดๅฅฝ๏ผๆฐๆฎไป20230101ๅผๅงใ |+| 188 | hk_hold | [ๆฒชๆทฑ่ก้ๆ่กๆ็ป](references/่ก็ฅจๆฐๆฎ/็น่ฒๆฐๆฎ/ๆฒชๆทฑ่ก้ๆ่กๆ็ป.md) | ่ก็ฅจๆฐๆฎ,็น่ฒๆฐๆฎ | ่ทๅๆฒชๆทฑๆธฏ่ก้ๆ่กๆ็ป๏ผๆฐๆฎๆฅๆบๆธฏไบคๆใ |+| 267 | broker_recommend | [ๅธๅๆๅบฆ้่ก](references/่ก็ฅจๆฐๆฎ/็น่ฒๆฐๆฎ/ๅธๅๆๅบฆ้่ก.md) | ่ก็ฅจๆฐๆฎ,็น่ฒๆฐๆฎ | ่ทๅๅธๅๆๅบฆ้่ก๏ผไธ่ฌ1ๆฅ~3ๆฅๅ ๆดๆฐๅฝๆๆฐๆฎ |+| 274 | ccass_hold_detail | [ไธญๅคฎ็ป็ฎ็ณป็ปๆ่กๆ็ป](references/่ก็ฅจๆฐๆฎ/็น่ฒๆฐๆฎ/ไธญๅคฎ็ป็ฎ็ณป็ปๆ่กๆ็ป.md) | ่ก็ฅจๆฐๆฎ,็น่ฒๆฐๆฎ | ่ทๅไธญๅคฎ็ป็ฎ็ณป็ปๆบๆๅธญไฝๆ่กๆ็ป๏ผๆฐๆฎ่ฆ็**ๅ จๅๅฒ**๏ผๆ นๆฎไบคๆๆๆซ้ฒๆถ้ด๏ผๅฝๆฅๆฐๆฎๅจไธไธไบคๆๆฅๆฉไธ9็นๅๅฎๆ |+| 275 | stk_surv | [ๆบๆ่ฐ็ ๆฐๆฎ](references/่ก็ฅจๆฐๆฎ/็น่ฒๆฐๆฎ/ๆบๆ่ฐ็ ๆฐๆฎ.md) | ่ก็ฅจๆฐๆฎ,็น่ฒๆฐๆฎ | ่ทๅไธๅธๅ ฌๅธๆบๆ่ฐ็ ่ฎฐๅฝๆฐๆฎ |+| 292 | report_rc | [ๅธๅ็ๅฉ้ขๆตๆฐๆฎ](references/่ก็ฅจๆฐๆฎ/็น่ฒๆฐๆฎ/ๅธๅ็ๅฉ้ขๆตๆฐๆฎ.md) | ่ก็ฅจๆฐๆฎ,็น่ฒๆฐๆฎ | ่ทๅๅธๅ๏ผๅๆน๏ผๆฏๅคฉ็ ๆฅ็็ๅฉ้ขๆตๆฐๆฎ๏ผๆฐๆฎไป2010ๅนดๅผๅง๏ผๆฏๆ19~22็นๆดๆฐๅฝๆฅๆฐๆฎ |+| 293 | cyq_perf | [ๆฏๆฅ็ญน็ ๅ่็](references/่ก็ฅจๆฐๆฎ/็น่ฒๆฐๆฎ/ๆฏๆฅ็ญน็ ๅ่็.md) | ่ก็ฅจๆฐๆฎ,็น่ฒๆฐๆฎ | ่ทๅA่กๆฏๆฅ็ญน็ ๅนณๅๆๆฌๅ่็ๆ ๅต๏ผๆฏๅคฉ18~19็นๅทฆๅณๆดๆฐ๏ผๆฐๆฎไป2018ๅนดๅผๅง |+| 294 | cyq_chips | [ๆฏๆฅ็ญน็ ๅๅธ](references/่ก็ฅจๆฐๆฎ/็น่ฒๆฐๆฎ/ๆฏๆฅ็ญน็ ๅๅธ.md) | ่ก็ฅจๆฐๆฎ,็น่ฒๆฐๆฎ | ่ทๅA่กๆฏๆฅ็็ญน็ ๅๅธๆ ๅต๏ผๆไพๅไปทไฝๅ ๆฏ๏ผๆฐๆฎไป2018ๅนดๅผๅง๏ผๆฏๅคฉ18~19็นไน้ดๆดๆฐๅฝๆฅๆฐๆฎ |+| 295 | ccass_hold | [ไธญๅคฎ็ป็ฎ็ณป็ปๆ่ก็ป่ฎก](references/่ก็ฅจๆฐๆฎ/็น่ฒๆฐๆฎ/ไธญๅคฎ็ป็ฎ็ณป็ปๆ่ก็ป่ฎก.md) | ่ก็ฅจๆฐๆฎ,็น่ฒๆฐๆฎ | ่ทๅไธญๅคฎ็ป็ฎ็ณป็ปๆ่กๆฑๆปๆฐๆฎ๏ผ่ฆ็ๅ จ้จๅๅฒๆฐๆฎ๏ผๆ นๆฎไบคๆๆๆซ้ฒๆถ้ด๏ผๅฝๆฅๆฐๆฎๅจไธไธไบคๆๆฅๆฉไธ9็นๅๅฎๆๅ ฅๅบ |+| 353 | stk_auction_o | [่ก็ฅจๅผ็้ๅ็ซไปทๆฐๆฎ](references/่ก็ฅจๆฐๆฎ/็น่ฒๆฐๆฎ/่ก็ฅจๅผ็้ๅ็ซไปทๆฐๆฎ.md) | ่ก็ฅจๆฐๆฎ,็น่ฒๆฐๆฎ | ่ก็ฅจๅผ็9:30้ๅ็ซไปทๆฐๆฎ๏ผๆฏๅคฉ็ๅๆดๆฐ |+| 354 | stk_auction_c | [่ก็ฅจๆถ็้ๅ็ซไปทๆฐๆฎ](references/่ก็ฅจๆฐๆฎ/็น่ฒๆฐๆฎ/่ก็ฅจๆถ็้ๅ็ซไปทๆฐๆฎ.md) | ่ก็ฅจๆฐๆฎ,็น่ฒๆฐๆฎ | ่ก็ฅจๆถ็15:00้ๅ็ซไปทๆฐๆฎ๏ผๆฏๅคฉ็ๅๆดๆฐ |+| 399 | stk_ah_comparison | [AH่กๆฏไปท](references/่ก็ฅจๆฐๆฎ/็น่ฒๆฐๆฎ/AH่กๆฏไปท.md) | ่ก็ฅจๆฐๆฎ,็น่ฒๆฐๆฎ | AH่กๆฏไปทๆฐๆฎ๏ผๅฏๆ นๆฎไบคๆๆฅๆ่ทๅๅๅฒ |+| 328 | stk_factor_pro | [่ก็ฅจๆๆฏ้ขๅ ๅญ(ไธไธ็)](references/่ก็ฅจๆฐๆฎ/็น่ฒๆฐๆฎ/่ก็ฅจๆๆฏ้ขๅ ๅญ(ไธไธ็).md) | ่ก็ฅจๆฐๆฎ,็น่ฒๆฐๆฎ | ่ทๅ่ก็ฅจๆฏๆฅๆๆฏ้ขๅ ๅญๆฐๆฎ๏ผ็จไบ่ท่ธช่ก็ฅจๅฝๅ่ตฐๅฟๆ ๅต๏ผๆฐๆฎ็ฑTushare็คพๅบ่ชไบง๏ผ่ฆ็ๅ จๅๅฒ๏ผ่พๅบๅๆฐ_bfq่กจ็คบไธๅคๆ๏ผ_qfq่กจ็คบๅๅคๆ _hfq่กจ็คบๅๅคๆ๏ผๆ่ฟฐไธญ่ฏดๆไบๅ ๅญ็้ป่ฎคไผ ๅ๏ผๅฆ้่ฆ็นๆฎๅๆฐๆ่ ๆดๅคๅ ๅญๅฏไปฅ่็ณป็ฎก็ๅ่ฏไผฐ |+| 27 | daily | [ๅๅฒๆฅ็บฟ](references/่ก็ฅจๆฐๆฎ/่กๆ ๆฐๆฎ/ๅๅฒๆฅ็บฟ.md) | ่ก็ฅจๆฐๆฎ,่กๆ ๆฐๆฎ | ่ทๅ่ก็ฅจ่กๆ ๆฐๆฎ๏ผๆ้่ฟ[**้็จ่กๆ ๆฅๅฃ**](https://tushare.pro/document/2?doc_id=109)่ทๅๆฐๆฎ๏ผๅ ๅซไบๅๅๅคๆๆฐๆฎ |+| 146 | pro_bar | [ๅคๆ่กๆ ](references/่ก็ฅจๆฐๆฎ/่กๆ ๆฐๆฎ/ๅคๆ่กๆ .md) | ่ก็ฅจๆฐๆฎ,่กๆ ๆฐๆฎ | |+| 145 | monthly | [ๆ็บฟ่กๆ ](references/่ก็ฅจๆฐๆฎ/่กๆ ๆฐๆฎ/ๆ็บฟ่กๆ .md) | ่ก็ฅจๆฐๆฎ,่กๆ ๆฐๆฎ | ่ทๅA่กๆ็บฟๆฐๆฎ |+| 374 | rt_min | [ๅฎๆถๅ้](references/่ก็ฅจๆฐๆฎ/่กๆ ๆฐๆฎ/ๅฎๆถๅ้.md) | ่ก็ฅจๆฐๆฎ,่กๆ ๆฐๆฎ | ่ทๅๅ จA่ก็ฅจๅฎๆถๅ้ๆฐๆฎ๏ผๅ ๆฌ1~60min |+| 372 | rt_k | [ๅฎๆถๆฅ็บฟ](references/่ก็ฅจๆฐๆฎ/่กๆ ๆฐๆฎ/ๅฎๆถๆฅ็บฟ.md) | ่ก็ฅจๆฐๆฎ,่กๆ ๆฐๆฎ | ่ทๅๅฎๆถๆฅk็บฟ่กๆ ๏ผๆฏๆๆ่ก็ฅจไปฃ็ ๅ่ก็ฅจไปฃ็ ้้ ็ฌฆไธๆฌกๆงๆๅๅ จ้จ่ก็ฅจๅฎๆถๆฅk็บฟ่กๆ |+| 370 | stk_mins | [ๅๅฒๅ้](references/่ก็ฅจๆฐๆฎ/่กๆ ๆฐๆฎ/ๅๅฒๅ้.md) | ่ก็ฅจๆฐๆฎ,่กๆ ๆฐๆฎ | ่ทๅA่กๅ้ๆฐๆฎ๏ผๆฏๆ1min/5min/15min/30min/60min่กๆ ๏ผๆไพPython SDKๅ http Restful APIไธค็งๆนๅผ |+| 365 | stk_week_month_adj | [ๅจๆ็บฟๅคๆ่กๆ (ๆฏๆฅๆดๆฐ)](references/่ก็ฅจๆฐๆฎ/่กๆ ๆฐๆฎ/ๅจๆ็บฟๅคๆ่กๆ (ๆฏๆฅๆดๆฐ).md) | ่ก็ฅจๆฐๆฎ,่กๆ ๆฐๆฎ | ่ก็ฅจๅจ/ๆ็บฟ่กๆ (ๅคๆ--ๆฏๆฅๆดๆฐ) |+| 336 | stk_weekly_monthly | [ๅจๆ็บฟ่กๆ (ๆฏๆฅๆดๆฐ)](references/่ก็ฅจๆฐๆฎ/่กๆ ๆฐๆฎ/ๅจๆ็บฟ่กๆ (ๆฏๆฅๆดๆฐ).md) | ่ก็ฅจๆฐๆฎ,่กๆ ๆฐๆฎ | ่ก็ฅจๅจ/ๆ็บฟ่กๆ (ๆฏๆฅๆดๆฐ) |+| 255 | bak_daily | [ๅค็จ่กๆ ](references/่ก็ฅจๆฐๆฎ/่กๆ ๆฐๆฎ/ๅค็จ่กๆ .md) | ่ก็ฅจๆฐๆฎ,่กๆ ๆฐๆฎ | ่ทๅๅค็จ่กๆ ๏ผๅ ๆฌ็นๅฎ็่กๆ ๆๆ (ๆฐๆฎไป2017ๅนดไธญๅทฆๅณๅผๅง๏ผๆฉๆๆๅ ๅคฉๆฐๆฎ็ผบๅคฑ๏ผ่ฟๆๆญฃๅธธ) |+| 144 | weekly | [ๅจ็บฟ่กๆ ](references/่ก็ฅจๆฐๆฎ/่กๆ ๆฐๆฎ/ๅจ็บฟ่กๆ .md) | ่ก็ฅจๆฐๆฎ,่กๆ ๆฐๆฎ | ่ทๅA่กๅจ็บฟ่กๆ ๏ผๆฌๆฅๅฃๆฏๅจๆๅไธไธชไบคๆๆฅๆดๆฐ๏ผๅฆ้่ฆไฝฟ็จๆฏๅคฉๆดๆฐ็ๅจ็บฟๆฐๆฎ๏ผ่ฏทไฝฟ็จ[ๆฅๅบฆๆดๆฐ็ๅจ็บฟ่กๆ ๆฅๅฃ](https://tushare.pro/document/2?doc_id=336)ใ |+| 214 | suspend_d | [ๆฏๆฅๅๅค็ไฟกๆฏ](references/่ก็ฅจๆฐๆฎ/่กๆ ๆฐๆฎ/ๆฏๆฅๅๅค็ไฟกๆฏ.md) | ่ก็ฅจๆฐๆฎ,่กๆ ๆฐๆฎ | ๆๆฅๆๆนๅผ่ทๅ่ก็ฅจๆฏๆฅๅๅค็ไฟกๆฏ |+| 196 | ggt_daily | [ๆธฏ่ก้ๆฏๆฅๆไบค็ป่ฎก](references/่ก็ฅจๆฐๆฎ/่กๆ ๆฐๆฎ/ๆธฏ่ก้ๆฏๆฅๆไบค็ป่ฎก.md) | ่ก็ฅจๆฐๆฎ,่กๆ ๆฐๆฎ | ่ทๅๆธฏ่ก้ๆฏๆฅๆไบคไฟกๆฏ๏ผๆฐๆฎไป2014ๅนดๅผๅง |+| 183 | stk_limit | [ๆฏๆฅๆถจ่ทๅไปทๆ ผ](references/่ก็ฅจๆฐๆฎ/่กๆ ๆฐๆฎ/ๆฏๆฅๆถจ่ทๅไปทๆ ผ.md) | ่ก็ฅจๆฐๆฎ,่กๆ ๆฐๆฎ | ่ทๅๅ จๅธๅบ๏ผๅ ๅซA/B่กๅๅบ้๏ผๆฏๆฅๆถจ่ทๅไปทๆ ผ๏ผๅ ๆฌๆถจๅไปทๆ ผ๏ผ่ทๅไปทๆ ผ็ญ๏ผๆฏไธชไบคๆๆฅ8็น40ๅทฆๅณๆดๆฐๅฝๆฅ่ก็ฅจๆถจ่ทๅไปทๆ ผใ |+| 109 | pro_bar | [้็จ่กๆ ๆฅๅฃ](references/่ก็ฅจๆฐๆฎ/่กๆ ๆฐๆฎ/้็จ่กๆ ๆฅๅฃ.md) | ่ก็ฅจๆฐๆฎ,่กๆ ๆฐๆฎ | |+| 49 | ggt_top10 | [ๆธฏ่ก้ๅๅคงๆไบค่ก](references/่ก็ฅจๆฐๆฎ/่กๆ ๆฐๆฎ/ๆธฏ่ก้ๅๅคงๆไบค่ก.md) | ่ก็ฅจๆฐๆฎ,่กๆ ๆฐๆฎ | ่ทๅๆธฏ่ก้ๆฏๆฅๆไบคๆฐๆฎ๏ผๅ ถไธญๅ ๆฌๆฒชๅธใๆทฑๅธ่ฏฆ็ปๆฐๆฎ๏ผๆฏๅคฉ18~20็นไน้ดๅฎๆๅฝๆฅๆดๆฐ |+| 48 | hsgt_top10 | [ๆฒชๆทฑ่ก้ๅๅคงๆไบค่ก](references/่ก็ฅจๆฐๆฎ/่กๆ ๆฐๆฎ/ๆฒชๆทฑ่ก้ๅๅคงๆไบค่ก.md) | ่ก็ฅจๆฐๆฎ,่กๆ ๆฐๆฎ | ่ทๅๆฒช่ก้ใๆทฑ่ก้ๆฏๆฅๅๅๅคงๆไบค่ฏฆ็ปๆฐๆฎ๏ผๆฏๅคฉ18~20็นไน้ดๅฎๆๅฝๆฅๆดๆฐ |+| 32 | daily_basic | [ๆฏๆฅๆๆ ](references/่ก็ฅจๆฐๆฎ/่กๆ ๆฐๆฎ/ๆฏๆฅๆๆ .md) | ่ก็ฅจๆฐๆฎ,่กๆ ๆฐๆฎ | ่ทๅๅ จ้จ่ก็ฅจๆฏๆฅ้่ฆ็ๅบๆฌ้ขๆๆ ๏ผๅฏ็จไบ้่กๅๆใๆฅ่กจๅฑ็คบ็ญใๅๆฌก่ฏทๆฑๆๅคง่ฟๅ6000ๆกๆฐๆฎ๏ผๅฏๆๆฅ็บฟๅพช็ฏๆๅๅ จ้จๅๅฒใ |+| 28 | adj_factor | [ๅคๆๅ ๅญ](references/่ก็ฅจๆฐๆฎ/่กๆ ๆฐๆฎ/ๅคๆๅ ๅญ.md) | ่ก็ฅจๆฐๆฎ,่กๆ ๆฐๆฎ | ๆฌๆฅๅฃ็ฑTushare่ช่ก็ไบง๏ผ่ทๅ่ก็ฅจๅคๆๅ ๅญ๏ผๅฏๆๅๅๅช่ก็ฅจๅ จ้จๅๅฒๅคๆๅ ๅญ๏ผไนๅฏไปฅๆๅๅๆฅๅ จ้จ่ก็ฅจ็ๅคๆๅ ๅญใ |+| 197 | ggt_monthly | [ๆธฏ่ก้ๆฏๆๆไบค็ป่ฎก](references/่ก็ฅจๆฐๆฎ/่กๆ ๆฐๆฎ/ๆธฏ่ก้ๆฏๆๆไบค็ป่ฎก.md) | ่ก็ฅจๆฐๆฎ,่กๆ ๆฐๆฎ | ๆธฏ่ก้ๆฏๆๆไบคไฟกๆฏ๏ผๆฐๆฎไป2014ๅนดๅผๅง |+| 33 | income | [ๅฉๆถฆ่กจ](references/่ก็ฅจๆฐๆฎ/่ดขๅกๆฐๆฎ/ๅฉๆถฆ่กจ.md) | ่ก็ฅจๆฐๆฎ,่ดขๅกๆฐๆฎ | ่ทๅไธๅธๅ ฌๅธ่ดขๅกๅฉๆถฆ่กจๆฐๆฎ |+| 44 | cashflow | [็ฐ้ๆต้่กจ](references/่ก็ฅจๆฐๆฎ/่ดขๅกๆฐๆฎ/็ฐ้ๆต้่กจ.md) | ่ก็ฅจๆฐๆฎ,่ดขๅกๆฐๆฎ | ่ทๅไธๅธๅ ฌๅธ็ฐ้ๆต้่กจ |+| 36 | balancesheet | [่ตไบง่ดๅบ่กจ](references/่ก็ฅจๆฐๆฎ/่ดขๅกๆฐๆฎ/่ตไบง่ดๅบ่กจ.md) | ่ก็ฅจๆฐๆฎ,่ดขๅกๆฐๆฎ | ่ทๅไธๅธๅ ฌๅธ่ตไบง่ดๅบ่กจ |+| 46 | express | [ไธ็ปฉๅฟซๆฅ](references/่ก็ฅจๆฐๆฎ/่ดขๅกๆฐๆฎ/ไธ็ปฉๅฟซๆฅ.md) | ่ก็ฅจๆฐๆฎ,่ดขๅกๆฐๆฎ | ่ทๅไธๅธๅ ฌๅธไธ็ปฉๅฟซๆฅ |+| 79 | fina_indicator | [่ดขๅกๆๆ ๆฐๆฎ](references/่ก็ฅจๆฐๆฎ/่ดขๅกๆฐๆฎ/่ดขๅกๆๆ ๆฐๆฎ.md) | ่ก็ฅจๆฐๆฎ,่ดขๅกๆฐๆฎ | ่ทๅไธๅธๅ ฌๅธ่ดขๅกๆๆ ๆฐๆฎ๏ผไธบ้ฟๅ ๆๅกๅจๅๅ๏ผ็ฐ้ถๆฎตๆฏๆฌก่ฏทๆฑๆๅค่ฟๅ100ๆก่ฎฐๅฝ๏ผๅฏ้่ฟ่ฎพ็ฝฎๆฅๆๅคๆฌก่ฏทๆฑ่ทๅๆดๅคๆฐๆฎใ |+| 81 | fina_mainbz | [ไธป่ฅไธๅกๆๆ](references/่ก็ฅจๆฐๆฎ/่ดขๅกๆฐๆฎ/ไธป่ฅไธๅกๆๆ.md) | ่ก็ฅจๆฐๆฎ,่ดขๅกๆฐๆฎ | ่ทๅพไธๅธๅ ฌๅธไธป่ฅไธๅกๆๆ๏ผๅๅฐๅบๅไบงๅไธค็งๆนๅผ |+| 103 | dividend | [ๅ็บข้่กๆฐๆฎ](references/่ก็ฅจๆฐๆฎ/่ดขๅกๆฐๆฎ/ๅ็บข้่กๆฐๆฎ.md) | ่ก็ฅจๆฐๆฎ,่ดขๅกๆฐๆฎ | ๅ็บข้่กๆฐๆฎ |+| 162 | disclosure_date | [่ดขๆฅๆซ้ฒๆฅๆ่กจ](references/่ก็ฅจๆฐๆฎ/่ดขๅกๆฐๆฎ/่ดขๆฅๆซ้ฒๆฅๆ่กจ.md) | ่ก็ฅจๆฐๆฎ,่ดขๅกๆฐๆฎ | ่ทๅ่ดขๆฅๆซ้ฒ่ฎกๅๆฅๆ |+| 45 | forecast | [ไธ็ปฉ้ขๅ](references/่ก็ฅจๆฐๆฎ/่ดขๅกๆฐๆฎ/ไธ็ปฉ้ขๅ.md) | ่ก็ฅจๆฐๆฎ,่ดขๅกๆฐๆฎ | ่ทๅไธ็ปฉ้ขๅๆฐๆฎ |+| 80 | fina_audit | [่ดขๅกๅฎก่ฎกๆ่ง](references/่ก็ฅจๆฐๆฎ/่ดขๅกๆฐๆฎ/่ดขๅกๅฎก่ฎกๆ่ง.md) | ่ก็ฅจๆฐๆฎ,่ดขๅกๆฐๆฎ | ่ทๅไธๅธๅ ฌๅธๅฎๆ่ดขๅกๅฎก่ฎกๆ่งๆฐๆฎ |+| 47 | moneyflow_hsgt | [ๆฒชๆทฑๆธฏ้่ต้ๆตๅ](references/่ก็ฅจๆฐๆฎ/่ต้ๆตๅๆฐๆฎ/ๆฒชๆทฑๆธฏ้่ต้ๆตๅ.md) | ่ก็ฅจๆฐๆฎ,่ต้ๆตๅๆฐๆฎ | ่ทๅๆฒช่ก้ใๆทฑ่ก้ใๆธฏ่ก้ๆฏๆฅ่ต้ๆตๅๆฐๆฎ๏ผๆฏๆฌกๆๅค่ฟๅ300ๆก่ฎฐๅฝ๏ผๆป้ไธ้ๅถใ |+| 170 | moneyflow | [ไธช่ก่ต้ๆตๅ](references/่ก็ฅจๆฐๆฎ/่ต้ๆตๅๆฐๆฎ/ไธช่ก่ต้ๆตๅ.md) | ่ก็ฅจๆฐๆฎ,่ต้ๆตๅๆฐๆฎ | ่ทๅๆฒชๆทฑA่ก็ฅจ่ต้ๆตๅๆฐๆฎ๏ผๅๆๅคงๅๅฐๅๆไบคๆ ๅต๏ผ็จไบๅคๅซ่ต้ๅจๅ๏ผๆฐๆฎๅผๅงไบ2010ๅนดใ |+| 343 | moneyflow_ind_ths | [่กไธ่ต้ๆตๅ(THS)](references/่ก็ฅจๆฐๆฎ/่ต้ๆตๅๆฐๆฎ/่กไธ่ต้ๆตๅ(THS).md) | ่ก็ฅจๆฐๆฎ,่ต้ๆตๅๆฐๆฎ | ่ทๅๅ่ฑ้กบ่กไธ่ต้ๆตๅ๏ผๆฏๆฅ็ๅๆดๆฐ |+| 344 | moneyflow_ind_dc | [ๆฟๅ่ต้ๆตๅ(DC)](references/่ก็ฅจๆฐๆฎ/่ต้ๆตๅๆฐๆฎ/ๆฟๅ่ต้ๆตๅ(DC).md) | ่ก็ฅจๆฐๆฎ,่ต้ๆตๅๆฐๆฎ | ่ทๅไธๆน่ดขๅฏๆฟๅ่ต้ๆตๅ๏ผๆฏๅคฉ็ๅๆดๆฐ |+| 345 | moneyflow_mkt_dc | [ๅคง็่ต้ๆตๅ(DC)](references/่ก็ฅจๆฐๆฎ/่ต้ๆตๅๆฐๆฎ/ๅคง็่ต้ๆตๅ(DC).md) | ่ก็ฅจๆฐๆฎ,่ต้ๆตๅๆฐๆฎ | ่ทๅไธๆน่ดขๅฏๅคง็่ต้ๆตๅๆฐๆฎ๏ผๆฏๆฅ็ๅๆดๆฐ |+| 348 | moneyflow_ths | [ไธช่ก่ต้ๆตๅ(THS)](references/่ก็ฅจๆฐๆฎ/่ต้ๆตๅๆฐๆฎ/ไธช่ก่ต้ๆตๅ(THS).md) | ่ก็ฅจๆฐๆฎ,่ต้ๆตๅๆฐๆฎ | ่ทๅๅ่ฑ้กบไธช่ก่ต้ๆตๅๆฐๆฎ๏ผๆฏๆฅ็ๅๆดๆฐ |+| 349 | moneyflow_dc | [ไธช่ก่ต้ๆตๅ(DC)](references/่ก็ฅจๆฐๆฎ/่ต้ๆตๅๆฐๆฎ/ไธช่ก่ต้ๆตๅ(DC).md) | ่ก็ฅจๆฐๆฎ,่ต้ๆตๅๆฐๆฎ | ่ทๅไธๆน่ดขๅฏไธช่ก่ต้ๆตๅๆฐๆฎ๏ผๆฏๆฅ็ๅๆดๆฐ๏ผๆฐๆฎๅผๅงไบ20230911 |+| 371 | moneyflow_cnt_ths | [ๆฟๅ่ต้ๆตๅ(THS)](references/่ก็ฅจๆฐๆฎ/่ต้ๆตๅๆฐๆฎ/ๆฟๅ่ต้ๆตๅ(THS).md) | ่ก็ฅจๆฐๆฎ,่ต้ๆตๅๆฐๆฎ | ่ทๅๅ่ฑ้กบๆฆๅฟตๆฟๅๆฏๆฅ่ต้ๆตๅ |+| 156 | film_record | [ๅ จๅฝ็ตๅฝฑๅงๆฌๅคๆกๆฐๆฎ](references/่กไธ็ปๆต/TMT่กไธ/ๅ จๅฝ็ตๅฝฑๅงๆฌๅคๆกๆฐๆฎ.md) | ่กไธ็ปๆต,TMT่กไธ | ่ทๅๅ จๅฝ็ตๅฝฑๅงๆฌๅคๆก็ๅ ฌ็คบๆฐๆฎ |+| 180 | teleplay_record | [ๅ จๅฝ็ต่งๅงๅคๆกๅ ฌ็คบๆฐๆฎ](references/่กไธ็ปๆต/TMT่กไธ/ๅ จๅฝ็ต่งๅงๅคๆกๅ ฌ็คบๆฐๆฎ.md) | ่กไธ็ปๆต,TMT่กไธ | ่ทๅ2009ๅนดไปฅๆฅๅ จๅฝๆๆๅถไฝ็ต่งๅงๅคๆกๅ ฌ็คบๆฐๆฎ |+| 87 | tmt_twincomedetail | [ๅฐๆนพ็ตๅญไบงไธๆ่ฅๆถๆ็ป](references/่กไธ็ปๆต/TMT่กไธ/ๅฐๆนพ็ตๅญไบงไธๆ่ฅๆถๆ็ป.md) | ่กไธ็ปๆต,TMT่กไธ | ่ทๅๅฐๆนพTMT่กไธไธๅธๅ ฌๅธๅ็ฑปไบงๅๆๅบฆ่ฅๆถๆ ๅตใ |+| 88 | tmt_twincome | [ๅฐๆนพ็ตๅญไบงไธๆ่ฅๆถ](references/่กไธ็ปๆต/TMT่กไธ/ๅฐๆนพ็ตๅญไบงไธๆ่ฅๆถ.md) | ่กไธ็ปๆต,TMT่กไธ | ่ทๅๅฐๆนพTMT็ตๅญไบงไธ้ขๅๅ็ฑปไบงๅๆๅบฆ่ฅๆถๆฐๆฎใ |+| 113 | bo_monthly | [็ตๅฝฑๆๅบฆ็ฅจๆฟ](references/่กไธ็ปๆต/TMT่กไธ/็ตๅฝฑๆๅบฆ็ฅจๆฟ.md) | ่กไธ็ปๆต,TMT่กไธ | ่ทๅ็ตๅฝฑๆๅบฆ็ฅจๆฟๆฐๆฎ |+| 115 | bo_daily | [็ตๅฝฑๆฅๅบฆ็ฅจๆฟ](references/่กไธ็ปๆต/TMT่กไธ/็ตๅฝฑๆฅๅบฆ็ฅจๆฟ.md) | ่กไธ็ปๆต,TMT่กไธ | ่ทๅ็ตๅฝฑๆฅๅบฆ็ฅจๆฟ |+| 116 | bo_cinema | [ๅฝฑ้ขๆฅๅบฆ็ฅจๆฟ](references/่กไธ็ปๆต/TMT่กไธ/ๅฝฑ้ขๆฅๅบฆ็ฅจๆฟ.md) | ่กไธ็ปๆต,TMT่กไธ | ่ทๅๆฏๆฅๅๅฝฑ้ข็็ฅจๆฟๆฐๆฎ |+| 114 | bo_weekly | [็ตๅฝฑๅจๅบฆ็ฅจๆฟ](references/่กไธ็ปๆต/TMT่กไธ/็ตๅฝฑๅจๅบฆ็ฅจๆฟ.md) | ่กไธ็ปๆต,TMT่กไธ | ่ทๅๅจๅบฆ็ฅจๆฟๆฐๆฎ |+| 265 | fund_sales_ratio | [ๅๆธ ้ๅ ฌๅๅบ้้ๅฎไฟๆ่งๆจกๅ ๆฏ](references/่ดขๅฏ็ฎก็/ๅบ้้ๅฎ่กไธๆฐๆฎ/ๅๆธ ้ๅ ฌๅๅบ้้ๅฎไฟๆ่งๆจกๅ ๆฏ.md) | ่ดขๅฏ็ฎก็,ๅบ้้ๅฎ่กไธๆฐๆฎ | ่ทๅๅๆธ ้ๅ ฌๅๅบ้้ๅฎไฟๆ่งๆจกๅ ๆฏๆฐๆฎ๏ผๅนดๅบฆๆดๆฐ |+| 266 | fund_sales_vol | [้ๅฎๆบๆๅ ฌๅๅบ้้ๅฎไฟๆ่งๆจก](references/่ดขๅฏ็ฎก็/ๅบ้้ๅฎ่กไธๆฐๆฎ/้ๅฎๆบๆๅ ฌๅๅบ้้ๅฎไฟๆ่งๆจก.md) | ่ดขๅฏ็ฎก็,ๅบ้้ๅฎ่กไธๆฐๆฎ | ่ทๅ้ๅฎๆบๆๅ ฌๅๅบ้้ๅฎไฟๆ่งๆจกๆฐๆฎ๏ผๆฌๆฐๆฎไป2021ๅนดQ1ๅผๅงๅ ฌๅธ๏ผๅญฃๅบฆๆดๆฐ |diff --git "a/agent/src/skills/tushare/references/ETF\344\270\223\351\242\230/ETF\344\273\275\351\242\235\350\247\204\346\250\241.md" "b/agent/src/skills/tushare/references/ETF\344\270\223\351\242\230/ETF\344\273\275\351\242\235\350\247\204\346\250\241.md"new file mode 100644index 000000000..6167ca510--- /dev/null+++ "b/agent/src/skills/tushare/references/ETF\344\270\223\351\242\230/ETF\344\273\275\351\242\235\350\247\204\346\250\241.md"@@ -0,0 +1,61 @@+# ETFไปฝ้ข่งๆจก+++### ๆฅๅฃไป็ป+ๆฅๅฃ๏ผetf_share_size+ๆ่ฟฐ๏ผ่ทๅๆฒชๆทฑETFๆฏๆฅไปฝ้ขๅ่งๆจกๆฐๆฎ๏ผ่ฝไฝ็ฐ่งๆจกไปฝ้ข็ๅๅ๏ผๆๆกETF่ต้ๅจๅ๏ผๅๆถๆไพๆฏๆฅๅๅผๅๆถ็ไปท๏ผๆฐๆฎๆๆ ๆฏๅๆนๅ ฅๅบ๏ผๅปบ่ฎฎๅจๆฏๆฅ19็นๅๆๅ๏ผๅฆๅค๏ผๆถๅๆตทๅค็ETFๆฐๆฎๆดๆฐไผๆไธไบๅฑไบๆญฃๅธธๆ ๅตใ+้้๏ผๅๆฌกๆๅคง5000ๆก๏ผๅฏๆ นๆฎไปฃ็ ๆๆฅๆๅพช็ฏๆๅ+็งฏๅ๏ผ้่ฆ8000็งฏๅๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>++### ่พๅ ฅๅๆฐ+ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ๅบ้ไปฃ็ ๏ผๅฏไปETFๅบ็กไฟกๆฏๆฅๅฃๆๅ๏ผ+trade_date | str | N | ไบคๆๆฅๆ๏ผYYYYMMDDๆ ผๅผ๏ผไธๅ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+exchange | str | N | ไบคๆๆ๏ผSSEไธไบคๆ SZSEๆทฑไบคๆ๏ผ++<br>++### ่พๅบๅๆฐ+ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+---- | ---- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ+ts_code | str | Y | ETFไปฃ็ +etf_name | str | Y | ๅบ้ๅ็งฐ+total_share | float | Y | ๆปไปฝ้ข๏ผไธไปฝ๏ผ+total_size | float | Y | ๆป่งๆจก๏ผไธๅ ๏ผ+nav | float | N | ๅบ้ไปฝ้ขๅๅผ(ๅ )+close | float | N | ๆถ็ไปท๏ผๅ ๏ผ+exchange | str | Y | ไบคๆๆ๏ผSSEไธไบคๆ SZSEๆทฑไบคๆ BSEๅไบคๆ๏ผ++++### ไปฃ็ ็คบไพ+```python++#่ทๅโๆฒชๆทฑ300ETFๅๅคโETF2025ๅนดไปฅๆฅๆฏไธชไบคๆๆฅ็ไปฝ้ขๅ่งๆจกๆ ๅต+df = pro.etf_share_size(ts_code='510330.SH', start_date='20250101', end_date='20251224')++#่ทๅ2025ๅนด12ๆ24ๆฅไธไบคๆ็ๆๆETFไปฝ้ขๅ่งๆจกๆ ๅต+df = pro.etf_share_size(trade_date='20251224', exchange='SSE')++```++### ๆฐๆฎ็ปๆ++ trade_date ts_code etf_name total_share total_size exchange+ 0 20251224 510330.SH ๆฒชๆทฑ300ETFๅๅค 4741854.98 2.287898e+07 SSE+ 1 20251222 510330.SH ๆฒชๆทฑ300ETFๅๅค 4746894.98 2.279127e+07 SSE+ 2 20251219 510330.SH ๆฒชๆทฑ300ETFๅๅค 4756974.98 2.262512e+07 SSE+ 3 20251218 510330.SH ๆฒชๆทฑ300ETFๅๅค 4757514.98 2.253778e+07 SSE+ 4 20251217 510330.SH ๆฒชๆทฑ300ETFๅๅค 4756884.98 2.266418e+07 SSE+ .. ... ... ... ... ... ...+ 232 20250108 510330.SH ๆฒชๆทฑ300ETFๅๅค 4032384.98 1.599808e+07 SSE+ 233 20250107 510330.SH ๆฒชๆทฑ300ETFๅๅค 4009164.98 1.592962e+07 SSE+ 234 20250106 510330.SH ๆฒชๆทฑ300ETFๅๅค 3999084.98 1.577239e+07 SSE+ 235 20250103 510330.SH ๆฒชๆทฑ300ETFๅๅค 3994674.98 1.578176e+07 SSE+ 236 20250102 510330.SH ๆฒชๆทฑ300ETFๅๅค 3986754.98 1.593905e+07 SSE\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/ETF\344\270\223\351\242\230/ETF\345\216\206\345\217\262\345\210\206\351\222\237.md" "b/agent/src/skills/tushare/references/ETF\344\270\223\351\242\230/ETF\345\216\206\345\217\262\345\210\206\351\222\237.md"new file mode 100644index 000000000..56d786d98--- /dev/null+++ "b/agent/src/skills/tushare/references/ETF\344\270\223\351\242\230/ETF\345\216\206\345\217\262\345\210\206\351\222\237.md"@@ -0,0 +1,84 @@+## ETFๅๅฒๅ้่กๆ+----++ๆฅๅฃ๏ผstk_mins+ๆ่ฟฐ๏ผ่ทๅETFๅ้ๆฐๆฎ๏ผๆฏๆ1min/5min/15min/30min/60min่กๆ ๏ผๆไพPython SDKๅ http Restful APIไธค็งๆนๅผ+้้๏ผๅๆฌกๆๅคง8000่กๆฐๆฎ๏ผๅฏไปฅ้่ฟ่ก็ฅจไปฃ็ ๅๆถ้ดๅพช็ฏ่ทๅ๏ผๆฌๆฅๅฃๅฏไปฅๆไพ่ถ ่ฟ10ๅนดETFๅๅฒๅ้ๆฐๆฎ+ๆ้๏ผๆญฃๅผๆ้่ฏทๅ้ <u>[ๆ้่ฏดๆ](https://tushare.pro/document/1?doc_id=290) </u>++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ETFไปฃ็ ๏ผe.g. 159001.SZ+freq | str | Y | ๅ้้ขๅบฆ๏ผ1min/5min/15min/30min/60min๏ผ+start_date | datetime | N | ๅผๅงๆฅๆ ๆ ผๅผ๏ผ2025-06-01 09:00:00+end_date | datetime | N | ็ปๆๆถ้ด ๆ ผๅผ๏ผ2025-06-20 19:00:00++<br>+<br>+++**freqๅๆฐ่ฏดๆ**++freq | ่ฏดๆ+--- | ----+1min | 1ๅ้+5min | 5ๅ้+15min | 15ๅ้+30min | 30ๅ้+60min | 60ๅ้++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ETFไปฃ็ +trade_time | str | Y | ไบคๆๆถ้ด+open | float | Y | ๅผ็ไปท+close | float | Y | ๆถ็ไปท+high | float | Y | ๆ้ซไปท+low | float | Y | ๆไฝไปท+vol | int | Y | ๆไบค้๏ผ่ก๏ผ+amount | float | Y | ๆไบค้้ข๏ผๅ ๏ผ++<br>+<br>++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++#่ทๅๆฒชๆทฑ300ETFๅๅค510330.SH็ๅๅฒๅ้ๆฐๆฎ+df = pro.stk_mins(ts_code='510330.SH', freq='1min', start_date='2025-06-20 09:00:00', end_date='2025-06-20 19:00:00')++```++<br>+<br>+++**ๆฐๆฎๆ ทไพ**++ ts_code trade_time close open high low vol amount+ 0 510330.SH 2025-06-20 15:00:00 3.991 3.991 3.992 3.990 800600.0 3194805.0+ 1 510330.SH 2025-06-20 14:59:00 3.991 3.990 3.991 3.989 182500.0 728177.0+ 2 510330.SH 2025-06-20 14:58:00 3.990 3.992 3.992 3.990 113700.0 453763.0+ 3 510330.SH 2025-06-20 14:57:00 3.992 3.992 3.992 3.991 17400.0 69460.0+ 4 510330.SH 2025-06-20 14:56:00 3.992 3.992 3.992 3.991 447500.0 1786373.0+ .. ... ... ... ... ... ... ... ...+ 236 510330.SH 2025-06-20 09:34:00 3.994 3.994 3.995 3.994 2528100.0 10097818.0+ 237 510330.SH 2025-06-20 09:33:00 3.994 3.991 3.994 3.991 143300.0 572084.0+ 238 510330.SH 2025-06-20 09:32:00 3.992 3.990 3.993 3.990 1118500.0 4463264.0+ 239 510330.SH 2025-06-20 09:31:00 3.988 3.984 3.992 3.984 1176100.0 4691600.0+ 240 510330.SH 2025-06-20 09:30:00 3.983 3.983 3.983 3.983 20700.0 82448.0++diff --git "a/agent/src/skills/tushare/references/ETF\344\270\223\351\242\230/ETF\345\237\272\345\207\206\346\214\207\346\225\260.md" "b/agent/src/skills/tushare/references/ETF\344\270\223\351\242\230/ETF\345\237\272\345\207\206\346\214\207\346\225\260.md"new file mode 100644index 000000000..7f5175ba1--- /dev/null+++ "b/agent/src/skills/tushare/references/ETF\344\270\223\351\242\230/ETF\345\237\272\345\207\206\346\214\207\346\225\260.md"@@ -0,0 +1,63 @@+## ETFๅบๅๆๆฐๅ่กจ+----++ๆฅๅฃ๏ผetf_index+ๆ่ฟฐ๏ผ่ทๅETFๅบๅๆๆฐๅ่กจไฟกๆฏ+้้๏ผๅๆฌก่ฏทๆฑๆๅคง่ฟๅ5000่กๆฐๆฎ๏ผๅฝๅๆช่ถ ่ฟ2000ไธช๏ผ+ๆ้๏ผ็จๆท็งฏ็ดฏ8000็งฏๅๅฏ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ๆๆฐไปฃ็ +pub_date | str | N | ๅๅธๆฅๆ๏ผๆ ผๅผ๏ผYYYYMMDD๏ผ+base_date | str | N | ๆๆฐๅบๆ๏ผๆ ผๅผ๏ผYYYYMMDD๏ผ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ๆๆฐไปฃ็ +indx_name | str | Y | ๆๆฐๅ จ็งฐ+indx_csname | str | Y | ๆๆฐ็ฎ็งฐ+pub_party_name | str | Y | ๆๆฐๅๅธๆบๆ+pub_date | str | Y | ๆๆฐๅๅธๆฅๆ+base_date | str | Y | ๆๆฐๅบๆฅ+bp | float | Y | ๆๆฐๅบ็น(็น)+adj_circle | str | Y | ๆๆฐๆไปฝ่ฏๅธ่ฐๆดๅจๆ++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++#่ทๅๅฝๅETF่ท่ธช็ๅบๅๆๆฐๅ่กจ+df = pro.etf_index(fields='ts_code,indx_name,pub_date,bp')+++```+<br>+<br>+++**ๆฐๆฎ็คบไพ**++ ts_code indx_name pub_date bp+ 0 000068.SH ไธ่ฏ่ช็ถ่ตๆบๆๆฐ 20100528 1000.000000+ 1 000001.SH ไธ่ฏ็ปผๅๆๆฐ 19910715 100.000000+ 2 000989.SH ไธญ่ฏๅ จๆๅฏ้ๆถ่ดนๆๆฐ 20110802 1000.000000+ 3 000990.CSI ไธญ่ฏๅ จๆไธป่ฆๆถ่ดนๆๆฐ 20110802 1000.000000+ 4 000043.SH ไธ่ฏ่ถ ็บงๅคง็ๆๆฐ 20090423 1000.000000+ ... ... ... ... ...+ 1458 932368.CSI ไธญ่ฏ800่ช็ฑ็ฐ้ๆตๆๆฐ 20241211 1000.000000+ 1460 000680.SH ไธ่ฏ็งๅๆฟ็ปผๅๆๆฐ 20250120 1000.000000+ 1461 000681.SH ไธ่ฏ็งๅๆฟ็ปผๅไปทๆ ผๆๆฐ 20250120 1000.000000diff --git "a/agent/src/skills/tushare/references/ETF\344\270\223\351\242\230/ETF\345\237\272\346\234\254\344\277\241\346\201\257.md" "b/agent/src/skills/tushare/references/ETF\344\270\223\351\242\230/ETF\345\237\272\346\234\254\344\277\241\346\201\257.md"new file mode 100644index 000000000..b2b3e6358--- /dev/null+++ "b/agent/src/skills/tushare/references/ETF\344\270\223\351\242\230/ETF\345\237\272\346\234\254\344\277\241\346\201\257.md"@@ -0,0 +1,109 @@+## ETFๅบ็กไฟกๆฏ+----++ๆฅๅฃ๏ผetf_basic+ๆ่ฟฐ๏ผ่ทๅๅฝๅ ETFๅบ็กไฟกๆฏ๏ผๅ ๆฌไบQDIIใๆฐๆฎๆฅๆบไธๆฒชๆทฑไบคๆๆๅ ฌๅผๆซ้ฒไฟกๆฏใ+้้๏ผๅๆฌก่ฏทๆฑๆๅคงๆพๅ5000ๆกๆฐๆฎ๏ผๅฝๅETFๆปๆฐๆช่ถ ่ฟ2000๏ผ+ๆ้๏ผ็จๆท็งฏ8000็งฏๅๅฏ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ETFไปฃ็ ๏ผๅธฆ.SZ/.SHๅ็ผ็6ไฝๆฐๅญ๏ผๅฆ๏ผ159526.SZ๏ผ+index_code | str | N | ่ท่ธชๆๆฐไปฃ็ +list_date | str | N | ไธๅธๆฅๆ๏ผๆ ผๅผ๏ผYYYYMMDD๏ผ+list_status | str | N | ไธๅธ็ถๆ๏ผLไธๅธ D้ๅธ Pๅพ ไธๅธ๏ผ+exchange | str | N | ไบคๆๆ๏ผSHไธไบคๆ SZๆทฑไบคๆ๏ผ+mgr | str | N | ็ฎก็ไบบ๏ผ็ฎ็งฐ๏ผe.g.ๅๅคๅบ้)+++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ๅบ้ไบคๆไปฃ็ +csname | str | Y | ETFไธญๆ็ฎ็งฐ+extname | str | Y | ETFๆฉไฝ็ฎ็งฐ(ๅฏนๅบไบคๆๆ็ฎ็งฐ)+cname | str | Y | ๅบ้ไธญๆๅ จ็งฐ+index_code | str | Y | ETFๅบๅๆๆฐไปฃ็ +index_name | str | Y | ETFๅบๅๆๆฐไธญๆๅ จ็งฐ+setup_date | str | Y | ่ฎพ็ซๆฅๆ๏ผๆ ผๅผ๏ผYYYYMMDD๏ผ+list_date | str | Y | ไธๅธๆฅๆ๏ผๆ ผๅผ๏ผYYYYMMDD๏ผ+list_status | str | Y | ๅญ็ปญ็ถๆ๏ผLไธๅธ D้ๅธ Pๅพ ไธๅธ๏ผ+exchange | str | Y | ไบคๆๆ๏ผไธไบคๆSH ๆทฑไบคๆSZ๏ผ+mgr_name | str | Y | ๅบ้็ฎก็ไบบ็ฎ็งฐ+custod_name | str | Y | ๅบ้ๆ็ฎกไบบๅ็งฐ+mgt_fee | float | Y | ๅบ้็ฎก็ไบบๆถๅ็่ดน็จ+etf_type | str | Y | ๅบ้ๆ่ต้้็ฑปๅ๏ผๅขๅ ใQDII๏ผ++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++#่ทๅๅฝๅๆๆไธๅธ็ETFๅ่กจ+df = pro.etf_basic(list_status='L', fields='ts_code,extname,index_code,index_name,exchange,mgr_name')+++#่ทๅโๅๅฎๅบ้โๆๆไธๅธ็ETFๅ่กจ+df = pro.etf_basic(mgr='ๅๅฎๅบ้'๏ผ list_status='L', fields='ts_code,extname,index_code,index_name,exchange,etf_type')+++#่ทๅโๅๅฎๅบ้โๅจๆทฑไบคๆไธๅธ็ๆๆETFๅ่กจ+df = pro.etf_basic(mgr='ๅๅฎๅบ้'๏ผ list_status='L', exchange='SZ', fields='ts_code,extname,index_code,index_name,exchange,etf_type')+++#่ทๅไปฅๆฒชๆทฑ300ๆๆฐไธบ่ท่ธชๆๆฐ็ๆๆไธๅธ็ETFๅ่กจ+df = pro.etf_basic(index_code='000300.SH', fields='ts_code,extname,index_code,index_name,exchange,mgr_name')++```+++<br>+<br>+++**ๆฐๆฎ็คบไพ**++ ts_code extname index_code index_name exchange mgr_name+ 0 159238.SZ 300ETFๅขๅผบ 000300.SH ๆฒชๆทฑ300ๆๆฐ SZ ๆฏ้กบ้ฟๅๅบ้+ 1 159300.SZ 300ETF 000300.SH ๆฒชๆทฑ300ๆๆฐ SZ ๅฏๅฝๅบ้+ 2 159330.SZ ๆฒชๆทฑ300ETFๅบ้ 000300.SH ๆฒชๆทฑ300ๆๆฐ SZ ่ฅฟ่ไธ่ดขๅบ้+ 3 159393.SZ ๆฒชๆทฑ300ๆๆฐETF 000300.SH ๆฒชๆทฑ300ๆๆฐ SZ ไธๅฎถๅบ้+ 4 159673.SZ ๆฒชๆทฑ300ETF้นๅ 000300.SH ๆฒชๆทฑ300ๆๆฐ SZ ้นๅๅบ้+ 5 159919.SZ ๆฒชๆทฑ300ETF 000300.SH ๆฒชๆทฑ300ๆๆฐ SZ ๅๅฎๅบ้+ 6 159925.SZ ๆฒชๆทฑ300ETFๅๆน 000300.SH ๆฒชๆทฑ300ๆๆฐ SZ ๅๆนๅบ้+ 7 159927.SZ ้นๅๆฒชๆทฑ300ๆๆฐ 000300.SH ๆฒชๆทฑ300ๆๆฐ SZ ้นๅๅบ้+ 8 510300.SH ๆฒชๆทฑ300ETF 000300.SH ๆฒชๆทฑ300ๆๆฐ SH ๅๆณฐๆ็ๅบ้+ 9 510310.SH ๆฒชๆทฑ300ETFๆๆน่พพ 000300.SH ๆฒชๆทฑ300ๆๆฐ SH ๆๆน่พพๅบ้+ 10 510320.SH ๆฒชๆทฑ300ETFไธญ้ 000300.SH ๆฒชๆทฑ300ๆๆฐ SH ไธญ้ๅบ้+ 11 510330.SH ๆฒชๆทฑ300ETFๅๅค 000300.SH ๆฒชๆทฑ300ๆๆฐ SH ๅๅคๅบ้+ 12 510350.SH ๆฒชๆทฑ300ETFๅทฅ้ถ 000300.SH ๆฒชๆทฑ300ๆๆฐ SH ๅทฅ้ถ็ไฟกๅบ้+ 13 510360.SH ๆฒชๆทฑ300ETFๅบ้ 000300.SH ๆฒชๆทฑ300ๆๆฐ SH ๅนฟๅๅบ้+ 14 510370.SH 300ๆๆฐETF 000300.SH ๆฒชๆทฑ300ๆๆฐ SH ๅ ดไธๅบ้+ 15 510380.SH ๅฝๅฏฟ300ETF 000300.SH ๆฒชๆทฑ300ๆๆฐ SH ๅฝๅฏฟๅฎไฟๅบ้+ 16 510390.SH ๆฒชๆทฑ300ETFๅนณๅฎ 000300.SH ๆฒชๆทฑ300ๆๆฐ SH ๅนณๅฎๅบ้+ 17 515130.SH ๆฒชๆทฑ300ETFๅๆถ 000300.SH ๆฒชๆทฑ300ๆๆฐ SH ๅๆถๅบ้+ 18 515310.SH ๆฒชๆทฑ300ๆๆฐETF 000300.SH ๆฒชๆทฑ300ๆๆฐ SH ๆฑๆทปๅฏๅบ้+ 19 515330.SH ๆฒชๆทฑ300ETFๅคฉๅผ 000300.SH ๆฒชๆทฑ300ๆๆฐ SH ๅคฉๅผๅบ้+ 20 515350.SH ๆฐ็ๅ ้ถ300ETF 000300.SH ๆฒชๆทฑ300ๆๆฐ SH ๆฐ็ๅ ้ถๅบ้+ 21 515360.SH ๆนๆญฃๆฒชๆทฑ300ETF 000300.SH ๆฒชๆทฑ300ๆๆฐ SH ๆนๆญฃๅฏ้ฆๅบ้+ 22 515380.SH ๆฒชๆทฑ300ETFๆณฐๅบท 000300.SH ๆฒชๆทฑ300ๆๆฐ SH ๆณฐๅบทๅบ้+ 23 515390.SH ๆฒชๆทฑ300ETFๆๆฐๅบ้ 000300.SH ๆฒชๆทฑ300ๆๆฐ SH ๅๅฎๅบ้+ 24 515660.SH ๆฒชๆทฑ300ETFๅฝ่ๅฎ 000300.SH ๆฒชๆทฑ300ๆๆฐ SH ๅฝ่ๅฎๅบ้+ 25 515930.SH ๆฐธ่ตขๆฒชๆทฑ300ETF 000300.SH ๆฒชๆทฑ300ๆๆฐ SH ๆฐธ่ตขๅบ้+ 26 561000.SH ๆฒชๆทฑ300ETFๅขๅผบๅบ้ 000300.SH ๆฒชๆทฑ300ๆๆฐ SH ๅๅฎๅบ้+ 27 561300.SH 300ๅขๅผบETF 000300.SH ๆฒชๆทฑ300ๆๆฐ SH ๅฝๆณฐๅบ้+ 28 561930.SH ๆฒชๆทฑ300ETFๆๅ 000300.SH ๆฒชๆทฑ300ๆๆฐ SH ๆๅๅบ้+ 29 561990.SH ๆฒชๆทฑ300ๅขๅผบETF 000300.SH ๆฒชๆทฑ300ๆๆฐ SH ๆๅๅบ้+ 30 563520.SH ๆฒชๆทฑ300ETFๆฐธ่ตข 000300.SH ๆฒชๆทฑ300ๆๆฐ SH ๆฐธ่ตขๅบ้diff --git "a/agent/src/skills/tushare/references/ETF\344\270\223\351\242\230/ETF\345\244\215\346\235\203\345\233\240\345\255\220.md" "b/agent/src/skills/tushare/references/ETF\344\270\223\351\242\230/ETF\345\244\215\346\235\203\345\233\240\345\255\220.md"new file mode 100644index 000000000..9f2b909f9--- /dev/null+++ "b/agent/src/skills/tushare/references/ETF\344\270\223\351\242\230/ETF\345\244\215\346\235\203\345\233\240\345\255\220.md"@@ -0,0 +1,80 @@+## ๅบ้ๅคๆๅ ๅญ+----++ๆฅๅฃ๏ผfund_adj+ๆ่ฟฐ๏ผ่ทๅๅบ้ๅคๆๅ ๅญ๏ผ็จไบ่ฎก็ฎๅบ้ๅคๆ่กๆ+้้๏ผๅๆฌกๆๅคงๆๅ2000่ก่ฎฐๅฝ๏ผๅฏๅพช็ฏๆๅ๏ผๆฐๆฎๆป้ไธ้ๅถ+็งฏๅ๏ผ็จๆท็งฏ600็งฏๅๅฏ่ฐๅ๏ผ่ถ ่ฟ5000็งฏๅไปฅไธ้ขๆฌก็ธๅฏน่พ้ซใๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++<!--+**ๅคๆ่กๆ ๅฎ็ฐๅ่๏ผ**++ๅๅคๆ = ๅฝๆฅๆๆฐไปท ร ๅฝๆฅๅคๆๅ ๅญ+ๅๅคๆ = ๅฝๆฅๆๆฐไปท รท ๆๆฐๅคๆๅ ๅญ+-->+++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | TSๅบ้ไปฃ็ ๏ผๆฏๆๅคๅชๅบ้่พๅ ฅ๏ผ+trade_date | str | N | ไบคๆๆฅๆ๏ผๆ ผๅผ๏ผyyyymmdd๏ผไธๅ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+offset | str | N | ๅผๅง่กๆฐ+limit | str | N | ๆๅคง่กๆฐ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | tsๅบ้ไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+adj_factor | float | Y | ๅคๆๅ ๅญ+++**ๆฅๅฃไฝฟ็จ**++```pyhton++pro = ts.pro_api()++df = pro.fund_adj(ts_code='513100.SH', start_date='20190101', end_date='20190926')++```++<br>+<br>+++**ๆฐๆฎ็คบไพ**++ ts_code trade_date adj_factor+ 0 513100.SH 20190926 1.0+ 1 513100.SH 20190925 1.0+ 2 513100.SH 20190924 1.0+ 3 513100.SH 20190923 1.0+ 4 513100.SH 20190920 1.0+ 5 513100.SH 20190919 1.0+ 6 513100.SH 20190918 1.0+ 7 513100.SH 20190917 1.0+ 8 513100.SH 20190916 1.0+ 9 513100.SH 20190912 1.0+ 10 513100.SH 20190911 1.0+ 11 513100.SH 20190910 1.0+ 12 513100.SH 20190909 1.0+ 13 513100.SH 20190906 1.0+ 14 513100.SH 20190905 1.0+ 15 513100.SH 20190904 1.0+ 16 513100.SH 20190903 1.0+ 17 513100.SH 20190902 1.0+ 18 513100.SH 20190830 1.0+ 19 513100.SH 20190829 1.0+ 20 513100.SH 20190828 1.0diff --git "a/agent/src/skills/tushare/references/ETF\344\270\223\351\242\230/ETF\345\256\236\346\227\266\345\210\206\351\222\237.md" "b/agent/src/skills/tushare/references/ETF\344\270\223\351\242\230/ETF\345\256\236\346\227\266\345\210\206\351\222\237.md"new file mode 100644index 000000000..826dfb265--- /dev/null+++ "b/agent/src/skills/tushare/references/ETF\344\270\223\351\242\230/ETF\345\256\236\346\227\266\345\210\206\351\222\237.md"@@ -0,0 +1,65 @@+## ETFๅฎๆถๅ้+----++ๆฅๅฃ๏ผrt_min+ๆ่ฟฐ๏ผ่ทๅETFๅฎๆถๅ้ๆฐๆฎ๏ผๅ ๆฌ1~60min+้้๏ผๅๆฌกๆๅคง1000่กๆฐๆฎ๏ผๅฏไปฅ้่ฟETFไปฃ็ ๆๅๆฐๆฎ๏ผๆฏๆ้ๅทๅ้็ๅคไธชไปฃ็ ๅๆถๆๅ+ๆ้๏ผๆญฃๅผๆ้่ฏทๅ้ <u>[ๆ้่ฏดๆ](https://tushare.pro/document/1?doc_id=290) </u>++ๆณจ๏ผๆฏๆ่ก็ฅจๅฝๆฅๅผ็ไปฅๆฅ็ๆๆETFๅๅฒๅ้ๆฐๆฎๆๅ๏ผๆฅๅฃๅ๏ผrt_min_daily๏ผไป ๆฏๆไธไธชไธชไปฃ็ ๆๅ๏ผไธๅๅๆถๆๅๅคไธช๏ผ๏ผๅฏไปฅ[ๅจ็บฟๅผ้](https://tushare.pro/weborder/#/permission)ๆ้ใ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+freq | str | Y | 1MIN,5MIN,15MIN,30MIN,60MIN ๏ผๅคงๅ๏ผ+ts_code | str | Y | ๆฏๆๅไธชๅๅคไธช๏ผ589960.SH ๆ่ 589960.SH,159100.SZ+++<br>+<br>++**freqๅๆฐ่ฏดๆ**++freq | ่ฏดๆ+--- | ----+1MIN | 1ๅ้+5MIN | 5ๅ้+15MIN | 15ๅ้+30MIN | 30ๅ้+60MIN | 60ๅ้++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +time | None | Y | ไบคๆๆถ้ด+open | float | Y | ๅผ็ไปท+close | float | Y | ๆถ็ไปท+high | float | Y | ๆ้ซไปท+low | float | Y | ๆไฝไปท+vol | float | Y | ๆไบค้(่ก๏ผ+amount | float | Y | ๆไบค้ข๏ผๅ ๏ผ++++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++#่ทๅ็งๅๆฐ่ฝๆบETFๆๆน่พพ589960.SH็ๅฎๆถๅ้ๆฐๆฎ+df = pro.rt_min(ts_code='589960.SH', freq='1MIN')++```++<br>+<br>\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/ETF\344\270\223\351\242\230/ETF\345\256\236\346\227\266\346\227\245\347\272\277.md" "b/agent/src/skills/tushare/references/ETF\344\270\223\351\242\230/ETF\345\256\236\346\227\266\346\227\245\347\272\277.md"new file mode 100644index 000000000..f32dca531--- /dev/null+++ "b/agent/src/skills/tushare/references/ETF\344\270\223\351\242\230/ETF\345\256\236\346\227\266\346\227\245\347\272\277.md"@@ -0,0 +1,77 @@+## ETFๅฎๆถๆฅ็บฟ+----++ๆฅๅฃ๏ผrt_etf_k+ๆ่ฟฐ๏ผ่ทๅETFๅฎๆถๆฅk็บฟ่กๆ ๏ผๆฏๆๆETFไปฃ็ ๆไปฃ็ ้้ ็ฌฆไธๆฌกๆงๆๅๅ จ้จETFๅฎๆถๆฅk็บฟ่กๆ+็งฏๅ๏ผๆฌๆฅๅฃๆฏๅ็ฌๅผๆ้็ๆฐๆฎ๏ผๅ็ฌ็ณ่ฏทๆ้่ฏทๅ่[ๆ้ๅ่กจ](https://tushare.pro/document/1?doc_id=290)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ๆฏๆ้้ ็ฌฆๆนๅผ๏ผe.g. 5\*.SHใ15\*.SZใ159101.SZ+topic | str | Y | ๅ็ฑปๅๆฐ๏ผๅไธๆตทETFๆถ๏ผ้่ฆ่พๅ ฅ'HQ_FND_TICK'๏ผๅ่ไธ้ขไพๅญ++<br>+ๆณจ๏ผts_codeไปฃ็ ไธๅฎ่ฆๅธฆ<font color="red">.SH/.SZ/.BJ</font>ๅ็ผ+++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ETFไปฃ็ +name | None | Y | ETFๅ็งฐ+pre_close | float | Y | ๆจๆถไปท+high | float | Y | ๆ้ซไปท+open | float | Y | ๅผ็ไปท+low | float | Y | ๆไฝไปท+close | float | Y | ๆถ็ไปท๏ผๆๆฐไปท๏ผ+vol | int | Y | ๆไบค้๏ผ่ก๏ผ+amount | int | Y | ๆไบค้้ข๏ผๅ ๏ผ+num | int | Y | ๅผ็ไปฅๆฅๆไบค็ฌๆฐ+ask_volume1 | int | N | ๅงๆๅ็๏ผ่ก๏ผ+bid_volume1 | int | N | ๅงๆไนฐ็๏ผ่ก๏ผ+trade_time | str | N | ไบคๆๆถ้ด++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++#่ทๅไปๆฅๆๆๆทฑๅธETFๅฎๆถๆฅ็บฟๅๆไบค็ฌๆฐ+df = pro.rt_etf_k(ts_code='1*.SZ')++#่ทๅไปๆฅๆฒชๅธๆๆETFๅฎๆถๆฅ็บฟๅๆไบค็ฌๆฐ+df = pro.rt_etf_k(ts_code='5*.SH', topic='HQ_FND_TICK')+++```+++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code name pre_close high open low close vol amount num+ 0 520860.SH ๆธฏ่ก้็ง 1.024 1.054 1.048 1.041 1.048 15071600 15780985 307+ 1 515320.SH ็ตๅญ50 1.173 1.211 1.184 1.184 1.206 1830600 2191339 98+ 2 511600.SH ่ดงๅธETF 100.008 100.003 100.002 99.999 100.000 12022 1202204 28+ 3 501075.SH ็งๅไธป้ข 2.350 2.400 2.357 2.357 2.400 4200 10040 11+ 4 589990.SH ็งๅๆฟ็ปผ 1.282 1.311 1.280 1.280 1.305 4178600 5413728 147+ .. ... ... ... ... ... ... ... ... ... ...+ 933 516590.SH ็ตๅจๆฑฝ่ฝฆ 1.244 1.277 1.252 1.252 1.270 1380800 1748398 79+ 934 502048.SH 50LOF 1.224 1.238 1.235 1.214 1.218 3200 3908 5+ 935 515850.SH ่ฏๅธ้พๅคด 1.519 1.538 1.523 1.520 1.523 11460000 17484157 688+ 936 515790.SH ๅ ไผETF 0.912 0.929 0.919 0.910 0.923 411566128 379094370 14939+ 937 516190.SH ๆๅจฑETF 1.137 1.154 1.151 1.146 1.151 1031700 1186303 87\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/ETF\344\270\223\351\242\230/ETF\346\227\245\347\272\277\350\241\214\346\203\205.md" "b/agent/src/skills/tushare/references/ETF\344\270\223\351\242\230/ETF\346\227\245\347\272\277\350\241\214\346\203\205.md"new file mode 100644index 000000000..926ccc4ab--- /dev/null+++ "b/agent/src/skills/tushare/references/ETF\344\270\223\351\242\230/ETF\346\227\245\347\272\277\350\241\214\346\203\205.md"@@ -0,0 +1,75 @@+## ETFๆฅ็บฟ่กๆ+----++ๆฅๅฃ๏ผfund_daily+ๆ่ฟฐ๏ผ่ทๅETF่กๆ ๆฏๆฅๆถ็ๅๆไบคๆฐๆฎ๏ผๅๅฒ่ถ ่ฟ10ๅนด+้้๏ผๅๆฌกๆๅคง2000่ก่ฎฐๅฝ๏ผๅฏไปฅๆ นๆฎETFไปฃ็ ๅๆฅๆๅพช็ฏ่ทๅๅๅฒ๏ผๆป้ไธ้ๅถ+็งฏๅ๏ผ้่ฆ่ณๅฐ5000็งฏๅๆๅฏไปฅ่ฐๅ๏ผ5000็งฏๅ้ขๆฌกๆด้ซ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)+++<br>+<br>+++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ๅบ้ไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ(YYYYMMDDๆ ผๅผ๏ผไธๅ)+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | TSไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+open | float | Y | ๅผ็ไปท(ๅ )+high | float | Y | ๆ้ซไปท(ๅ )+low | float | Y | ๆไฝไปท(ๅ )+close | float | Y | ๆถ็ไปท(ๅ )+pre_close | float | Y | ๆจๆถ็ไปท(ๅ )+change | float | Y | ๆถจ่ท้ข(ๅ )+pct_chg | float | Y | ๆถจ่ทๅน (%)+vol | float | Y | ๆไบค้(ๆ)+amount | float | Y | ๆไบค้ข(ๅๅ )+++<br>+<br>+++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++#่ทๅโๆฒชๆทฑ300ETFๅๅคโETF2025ๅนดไปฅๆฅ็่กๆ ๏ผๅนถ้่ฟfieldsๅๆฐๆๅฎ่พๅบไบ้จๅๅญๆฎต+df = pro.fund_daily(ts_code='510330.SH', start_date='20250101', end_date='20250618', fields='trade_date,open,high,low,close,vol,amount')++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ trade_date open high low close vol amount+ 0 20250618 4.008 4.024 3.996 4.017 382896.00 153574.446+ 1 20250617 4.015 4.022 4.000 4.014 440272.04 176617.125+ 2 20250616 4.000 4.018 3.996 4.015 423526.00 169788.251+ 3 20250613 4.023 4.028 3.992 4.004 1216787.53 487632.318+ 4 20250612 4.023 4.039 4.005 4.032 574727.00 231356.321+ .. ... ... ... ... ... ... ...+ 104 20250108 3.971 3.992 3.908 3.963 3200416.00 1267465.456+ 105 20250107 3.939 3.974 3.929 3.973 2239739.00 885818.954+ 106 20250106 3.950 3.964 3.917 3.943 1583794.00 624004.760+ 107 20250103 4.002 4.013 3.944 3.963 2025111.00 805573.289+ 108 20250102 4.110 4.117 3.973 4.001 1768592.00 714820.885\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\200\272\345\210\270\345\233\236\350\264\255\346\227\245\350\241\214\346\203\205.md" "b/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\200\272\345\210\270\345\233\236\350\264\255\346\227\245\350\241\214\346\203\205.md"new file mode 100644index 000000000..6fb4b0050--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\200\272\345\210\270\345\233\236\350\264\255\346\227\245\350\241\214\346\203\205.md"@@ -0,0 +1,106 @@+## ๅบๅธๅ่ดญๆฅ่กๆ+----++ๆฅๅฃ๏ผrepo_daily+ๆ่ฟฐ๏ผๅบๅธๅ่ดญๆฅ่กๆ+้้๏ผๅๆฌกๆๅคง2000ๆก๏ผๅฏๅคๆฌกๆๅ๏ผๆป้ไธ้ๅถ+ๆ้๏ผ็จๆท้่ฆ็ดฏ็งฏ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | TSไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ(YYYYMMDDๆ ผๅผ๏ผไธๅ)+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | TSไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+repo_maturity | str | Y | ๆ้ๅ็ง+pre_close | float | Y | ๅๆถ็(%)+open | float | Y | ๅผ็ไปท(%)+high | float | Y | ๆ้ซไปท(%)+low | float | Y | ๆไฝไปท(%)+close | float | Y | ๆถ็ไปท(%)+weight | float | Y | ๅ ๆไปท(%)+weight_r | float | Y | ๅ ๆไปท(ๅฉ็ๅบ)(%)+amount | float | Y | ๆไบค้้ข(ไธๅ )+num | int | Y | ๆไบค็ฌๆฐ(็ฌ)++<br>+<br>++**ๆฅๅฃไฝฟ็จ**++```python++pro = ts.pro_api()++#่ทๅ2020ๅนด8ๆ4ๆฅๅบๅธๅ่ดญๆฅ่กๆ+df = pro.repo_daily(trade_date='20200804')+++```++<br>+<br>++**ๆฐๆฎๆ ทไพ**++ ts_code trade_date repo_maturity weight amount+ 0 131800.SZ 20200804 R-003 2.02150000 42783.000000+ 1 131801.SZ 20200804 R-007 2.23240000 618050.300000+ 2 131802.SZ 20200804 R-014 2.24820000 59506.300000+ 3 131803.SZ 20200804 R-028 2.35080000 21210.700000+ 4 131805.SZ 20200804 R-091 2.35550000 2566.000000+ 5 131806.SZ 20200804 R-182 2.10840000 113.200000+ 6 131809.SZ 20200804 R-004 2.06990000 24218.900000+ 7 131810.SZ 20200804 R-001 2.03600000 10748048.000000+ 8 131811.SZ 20200804 R-002 2.01270000 39459.200000+ 9 131981.SZ 20200804 RR-001 6.70000000 1000.000000+ 10 131982.SZ 20200804 RR-007 6.05000000 22800.000000+ 11 131983.SZ 20200804 RR-014 5.82000000 18500.000000+ 12 131985.SZ 20200804 RR-1M 7.00000000 4900.000000+ 13 204001.SH 20200804 GC001 2.10000000 85393260.000000+ 14 204002.SH 20200804 GC002 2.09200000 488300.000000+ 15 204003.SH 20200804 GC003 2.11900000 1260240.000000+ 16 204004.SH 20200804 GC004 2.16500000 352040.000000+ 17 204007.SH 20200804 GC007 2.21200000 13110650.000000+ 18 204014.SH 20200804 GC014 2.25900000 2318820.000000+ 19 204028.SH 20200804 GC028 2.32100000 1204850.000000+ 20 204091.SH 20200804 GC091 2.41500000 16330.000000+ 21 204182.SH 20200804 GC182 2.25800000 80.000000+ 22 206001.SH 20200804 R001 4.00300000 66518.000000+ 23 206007.SH 20200804 R007 4.36600000 530473.000000+ 24 206014.SH 20200804 R014 5.16900000 344245.000000+ 25 206021.SH 20200804 R021 5.97600000 17976.000000+ 26 206030.SH 20200804 R1M 5.33200000 56671.000000+ 27 206090.SH 20200804 R3M 7.59900000 9285.000000+ 28 207007.SH 20200804 TPR007 2.29900000 37500.000000+ 29 DR001.IB 20200804 DR001 1.90740000 196463895.000000+ 30 DR007.IB 20200804 DR007 2.11440000 8751142.000000+ 31 DR014.IB 20200804 DR014 1.99320000 2810816.000000+ 32 DR021.IB 20200804 DR021 2.08610000 1800794.000000+ 33 DR1M.IB 20200804 DR1M 2.02160000 239369.000000+ 34 DR3M.IB 20200804 DR3M 2.58500000 49956.000000+ 35 DR6M.IB 20200804 DR6M 2.60000000 10000.000000+ 36 OR001.IB 20200804 OR001 1.91850000 2677840.000000+ 37 OR007.IB 20200804 OR007 2.05950000 358750.000000+ 38 OR014.IB 20200804 OR014 2.41020000 129650.000000+ 39 OR021.IB 20200804 OR021 1.76630000 42000.000000+ 40 OR1M.IB 20200804 OR1M 2.36910000 34000.000000+ 41 R001.IB 20200804 R001 1.96000000 350750823.000000+ 42 R007.IB 20200804 R007 2.17850000 42502804.000000+ 43 R014.IB 20200804 R014 2.24390000 8123663.000000+ 44 R021.IB 20200804 R021 1.97400000 6072093.000000+ 45 R1M.IB 20200804 R1M 2.44950000 1163185.000000+ 46 R2M.IB 20200804 R2M 3.91140000 37170.000000+ 47 R3M.IB 20200804 R3M 2.92950000 88436.000000+ 48 R4M.IB 20200804 R4M 6.50000000 1750.000000+ 49 R6M.IB 20200804 R6M 2.60000000 10000.000000\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\205\250\347\220\203\350\264\242\347\273\217\344\272\213\344\273\266.md" "b/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\205\250\347\220\203\350\264\242\347\273\217\344\272\213\344\273\266.md"new file mode 100644index 000000000..06e881fa6--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\205\250\347\220\203\350\264\242\347\273\217\344\272\213\344\273\266.md"@@ -0,0 +1,100 @@+## ่ดข็ปๆฅๅ+----++ๆฅๅฃ๏ผeco_cal+ๆ่ฟฐ๏ผ่ทๅๅ จ็่ดข็ปๆฅๅใๅ ๆฌ็ปๆตไบไปถๆฐๆฎๆดๆฐ+้้๏ผๅๆฌกๆๅคง่ทๅ100่กๆฐๆฎ+็งฏๅ๏ผ2000็งฏๅๅฏ่ฐๅ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+date | str | N | ๆฅๆ๏ผYYYYMMDDๆ ผๅผ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+currency | str | N | ่ดงๅธไปฃ็ +country | str | N | ๅฝๅฎถ๏ผๆฏๅฆ๏ผไธญๅฝใ็พๅฝ๏ผ+event | str | N | ไบไปถ ๏ผๆฏๆๆจก็ณๅน้ ๏ผ \*้ๅ\*๏ผ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+date | str | Y | ๆฅๆ+time | str | Y | ๆถ้ด+currency | str | Y | ่ดงๅธไปฃ็ +country | str | Y | ๅฝๅฎถ+event | str | Y | ็ปๆตไบไปถ+value | str | Y | ไปๅผ+pre_value | str | Y | ๅๅผ+fore_value | str | Y | ้ขๆตๅผ+++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()+++#่ทๅๆๅฎๆฅๆๅ จ็็ปๆตๆฅๅ+df = pro.eco_cal(date='20200403')+++#่ทๅไธญๅฝ็ปๆตไบไปถ+df = pro.eco_cal(country='ไธญๅฝ')++#่ทๅ็พๅฝ้ๅๆฐๆฎ+df = pro.eco_cal(event='็พๅฝๅญฃ่ฐๅ้ๅ*', fields='date,time,country,event,value,pre_value,fore_value')++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ date time country event value pre_value fore_value+ 0 20200410 09:30 ไธญๅฝ ไธญๅฝPPIๅนด็(%)(ๅนดๅบฆ)(ไธๆ) -0.4% -1.1%+ 1 20200410 09:30 ไธญๅฝ ไธญๅฝCPIๆ็(%)(ๆๅบฆ)(ไธๆ) 0.8% -0.7%+ 2 20200410 09:30 ไธญๅฝ ไธญๅฝCPIๅนด็(%)(ๅนดๅบฆ)(ไธๆ) 5.2% 4.9%+ 3 20200407 15:00 ไธญๅฝ ไธญๅฝๅคๆฑๅจๅค(็พๅ ) 3.107T+ 4 20200403 09:45 ไธญๅฝ ไธญๅฝ่ดขๆฐๆๅกไธPMI(ไธๆ) 43.0 26.5+ .. ... ... ... ... ... ... ...+ 95 20200229 09:00 ไธญๅฝ ไธญๅฝๅฎๆน้ๅถ้ ไธPMI(ไบๆ) 29.6 54.1+ 96 20200229 09:00 ไธญๅฝ ไธญๅฝๅฎๆนๅถ้ ไธPMI(ไบๆ) 35.7 50.0 46.0+ 97 20200229 09:00 ไธญๅฝ ไธญๅฝๅฎๆน็ปผๅPMI(ไบๆ) 28.9 53.0+ 98 20200308 00:17 ไธญๅฝ ไธญๅฝ่ดธๆๅธ(็พๅ )(ไบๆ) 47.21B 12.75B+ 99 20200308 00:17 ไธญๅฝ ไธญๅฝ่ฟๅฃๅนด็-็พๅ ่ฎกไปท(%)(ๅนดๅบฆ)(ไบๆ) 16.5% -9.0%+++<br>+<br>++็พๅฝ้ๅๆฐๆฎ๏ผ+++ date time country event value pre_value fore_value+ 0 20200403 20:30 ็พๅฝ ็พๅฝๅญฃ่ฐๅ้ๅๅฐฑไธไบบๅฃๅๅจ(ไธๆ) -701K 275K -100K+ 1 20200403 20:30 ็พๅฝ ็พๅฝๅญฃ่ฐๅ้ๅๅฐฑไธไบบๅฃๅๅจ(ไธๆ) 273K -100K+ 2 20200403 20:30 ็พๅฝ ็พๅฝๅญฃ่ฐๅ้ๅๅฐฑไธไบบๅฃๅๅจ(ไธๆ) 273K -124K+ 3 20200403 20:30 ็พๅฝ ็พๅฝๅญฃ่ฐๅ้ๅๅฐฑไธไบบๅฃๅๅจ(ไธๆ) 273K -100K+ 4 20200403 20:30 ็พๅฝ ็พๅฝๅญฃ่ฐๅ้ๅๅฐฑไธไบบๅฃๅๅจ(ไธๆ) 273K -123K+ .. ... ... ... ... ... ... ...+ 95 20190308 21:30 ็พๅฝ ็พๅฝๅญฃ่ฐๅ้ๅๅฐฑไธไบบๅฃๅๅจ(ไบๆ) 304K 181K+ 96 20190308 21:30 ็พๅฝ ็พๅฝๅญฃ่ฐๅ้ๅๅฐฑไธไบบๅฃๅๅจ(ไบๆ) 304K 180K+ 97 20190308 21:30 ็พๅฝ ็พๅฝๅญฃ่ฐๅ้ๅๅฐฑไธไบบๅฃๅๅจ(ไบๆ) 304K 185K+ 98 20190308 21:30 ็พๅฝ ็พๅฝๅญฃ่ฐๅ้ๅๅฐฑไธไบบๅฃๅๅจ(ไบๆ) 304K 180K+ 99 20190308 21:30 ็พๅฝ ็พๅฝๅญฃ่ฐๅ้ๅๅฐฑไธไบบๅฃๅๅจ(ไบๆ) 304K 185K++diff --git "a/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\217\257\350\275\254\345\200\272\345\217\221\350\241\214.md" "b/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\217\257\350\275\254\345\200\272\345\217\221\350\241\214.md"new file mode 100644index 000000000..943340573--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\217\257\350\275\254\345\200\272\345\217\221\350\241\214.md"@@ -0,0 +1,100 @@+## ๅฏ่ฝฌๅบๅ่ก+----++ๆฅๅฃ๏ผcb_issue+ๆ่ฟฐ๏ผ่ทๅๅฏ่ฝฌๅบๅ่กๆฐๆฎ+้้๏ผๅๆฌกๆๅคง2000๏ผๅฏๅคๆฌกๆๅ๏ผๆป้ไธ้ๅถ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผ5000็งฏๅไปฅไธ้ขๆฌก็ธๅฏน่พ้ซ๏ผ็งฏๅ่ถๅคๆ้่ถๅคง๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | TSไปฃ็ +ann_date | str | N | ๅ่กๅ ฌๅๆฅ+start_date | str | N | ๅ ฌๅๅผๅงๆฅๆ+end_date | str | N | ๅ ฌๅ็ปๆๆฅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ฝฌๅบไปฃ็ +ann_date | str | Y | ๅ่กๅ ฌๅๆฅ+res_ann_date | str | Y | ๅ่ก็ปๆๅ ฌๅๆฅ+plan_issue_size | float | Y | ่ฎกๅๅ่กๆป้ข๏ผๅ ๏ผ+issue_size | float | Y | ๅ่กๆป้ข๏ผๅ ๏ผ+issue_price | float | Y | ๅ่กไปทๆ ผ+issue_type | str | Y | ๅ่กๆนๅผ+issue_cost | float | N | ๅ่ก่ดน็จ๏ผๅ ๏ผ+onl_code | str | Y | ็ฝไธ็ณ่ดญไปฃ็ +onl_name | str | Y | ็ฝไธ็ณ่ดญ็ฎ็งฐ+onl_date | str | Y | ็ฝไธๅ่กๆฅๆ+onl_size | float | Y | ็ฝไธๅ่กๆป้ข๏ผๅผ ๏ผ+onl_pch_vol | float | Y | ็ฝไธๅ่กๆๆ็ณ่ดญๆฐ้๏ผๅผ ๏ผ+onl_pch_num | int | Y | ็ฝไธๅ่กๆๆ็ณ่ดญๆทๆฐ+onl_pch_excess | float | Y | ็ฝไธๅ่ก่ถ ้ข่ฎค่ดญๅๆฐ+onl_winning_rate | float | N | ็ฝไธๅ่กไธญ็ญพ็๏ผ%๏ผ+shd_ration_code | str | Y | ่่กไธ้ ๅฎไปฃ็ +shd_ration_name | str | Y | ่่กไธ้ ๅฎ็ฎ็งฐ+shd_ration_date | str | Y | ่่กไธ้ ๅฎๆฅ+shd_ration_record_date | str | Y | ่่กไธ้ ๅฎ่กๆ็ป่ฎฐๆฅ+shd_ration_pay_date | str | Y | ่่กไธ้ ๅฎ็ผดๆฌพๆฅ+shd_ration_price | float | Y | ่่กไธ้ ๅฎไปทๆ ผ+shd_ration_ratio | float | Y | ่่กไธ้ ๅฎๆฏไพ+shd_ration_size | float | Y | ่่กไธ้ ๅฎๆฐ้๏ผๅผ ๏ผ+shd_ration_vol | float | N | ่่กไธ้ ๅฎๆๆ็ณ่ดญๆฐ้๏ผๅผ ๏ผ+shd_ration_num | int | N | ่่กไธ้ ๅฎๆๆ็ณ่ดญๆทๆฐ+shd_ration_excess | float | N | ่่กไธ้ ๅฎ่ถ ้ข่ฎค่ดญๅๆฐ+offl_size | float | Y | ็ฝไธๅ่กๆป้ข๏ผๅผ ๏ผ+offl_deposit | float | N | ็ฝไธๅ่กๅฎ้ๆฏไพ๏ผ%๏ผ+offl_pch_vol | float | N | ็ฝไธๅ่กๆๆ็ณ่ดญๆฐ้๏ผๅผ ๏ผ+offl_pch_num | int | N | ็ฝไธๅ่กๆๆ็ณ่ดญๆทๆฐ+offl_pch_excess | float | N | ็ฝไธๅ่ก่ถ ้ข่ฎค่ดญๅๆฐ+offl_winning_rate | float | N | ็ฝไธๅ่กไธญ็ญพ็+lead_underwriter | str | N | ไธปๆฟ้ๅ+lead_underwriter_vol | float | N | ไธปๆฟ้ๅๅ ้ๆฐ้๏ผๅผ ๏ผ+++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()+++#่ทๅๅฏ่ฝฌๅบๅ่กๆฐๆฎ+df = pro.cb_issue(ann_date='20190612')+++#่ทๅๅฏ่ฝฌๅบๅ่กๆฐๆฎ๏ผ่ชๅฎไนๅญๆฎต+df = pro.cb_issue(fields='ts_code,ann_date,issue_size')++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code ann_date issue_size+ 0 110072.SH 20200814 33.7000+ 1 113600.SH 20200811 5.9500+ 2 113598.SH 20200729 3.3000+ 3 113038.SH 20200729 50.0000+ 4 128125.SZ 20200728 4.5000+ .. ... ... ...+ 489 100009.SH 20000223 13.5000+ 490 125302.SZ 19990727 15.0000+ 491 125301.SZ 19980826 2.0000+ 492 100001.SH 19980730 1.5000+ 493 125009.SZ None 5.0000\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\217\257\350\275\254\345\200\272\345\237\272\347\241\200\344\277\241\346\201\257.md" "b/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\217\257\350\275\254\345\200\272\345\237\272\347\241\200\344\277\241\346\201\257.md"new file mode 100644index 000000000..2067a5990--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\217\257\350\275\254\345\200\272\345\237\272\347\241\200\344\277\241\346\201\257.md"@@ -0,0 +1,89 @@+## ๅฏ่ฝฌๅบๅบๆฌไฟกๆฏ+----++ๆฅๅฃ๏ผcb_basic+ๆ่ฟฐ๏ผ่ทๅๅฏ่ฝฌๅบๅบๆฌไฟกๆฏ+้้๏ผๅๆฌกๆๅคง2000๏ผๆป้ไธ้ๅถ+ๆ้๏ผ็จๆท้่ฆ่ณๅฐ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผไฝๆๆต้ๆงๅถ๏ผ5000็งฏๅไปฅไธ้ขๆฌก็ธๅฏน่พ้ซ๏ผ็งฏๅ่ถๅคๆ้่ถๅคง๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ฝฌๅบไปฃ็ +list_date | str | N | ไธๅธๆฅๆ+exchange | str | N | ไธๅธไบคๆๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ฝฌๅบไปฃ็ +bond_full_name | str | Y | ่ฝฌๅบๅ็งฐ+bond_short_name | str | Y | ่ฝฌๅบ็ฎ็งฐ+cb_code | str | Y | ่ฝฌ่ก็ณๆฅไปฃ็ +stk_code | str | Y | ๆญฃ่กไปฃ็ +stk_short_name | str | Y | ๆญฃ่ก็ฎ็งฐ+maturity | float | Y | ๅ่กๆ้๏ผๅนด๏ผ+par | float | Y | ้ขๅผ+issue_price | float | Y | ๅ่กไปทๆ ผ+issue_size | float | Y | ๅ่กๆป้ข๏ผๅ ๏ผ+remain_size | float | Y | ๅบๅธไฝ้ข๏ผๅ ๏ผ+value_date | str | Y | ่ตทๆฏๆฅๆ+maturity_date | str | Y | ๅฐๆๆฅๆ+rate_type | str | Y | ๅฉ็็ฑปๅ+coupon_rate | float | Y | ็ฅจ้ขๅฉ็๏ผ%๏ผ+add_rate | float | Y | ่กฅๅฟๅฉ็๏ผ%๏ผ+pay_per_year | int | Y | ๅนดไปๆฏๆฌกๆฐ+list_date | str | Y | ไธๅธๆฅๆ+delist_date | str | Y | ๆ็ๆฅ+exchange | str | Y | ไธๅธไบคๆๆ+conv_start_date | str | Y | ่ฝฌ่ก่ตทๅงๆฅ+conv_end_date | str | Y | ่ฝฌ่กๆชๆญขๆฅ+conv_stop_date | str | Y | ๅๆญข่ฝฌ่กๆฅ(ๆๅๅฐๆ)+first_conv_price | float | Y | ๅๅง่ฝฌ่กไปท+conv_price | float | Y | ๆๆฐ่ฝฌ่กไปท+rate_clause | str | Y | ๅฉ็่ฏดๆ+put_clause | str | N | ่ตๅๆกๆฌพ+maturity_put_price | str | N | ๅฐๆ่ตๅไปทๆ ผ(ๅซ็จ)+call_clause | str | N | ๅๅฎๆกๆฌพ+reset_clause | str | N | ็นๅซๅไธไฟฎๆญฃๆกๆฌพ+conv_clause | str | N | ่ฝฌ่กๆกๆฌพ+guarantor | str | N | ๆ ไฟไบบ+guarantee_type | str | N | ๆ ไฟๆนๅผ+issue_rating | str | N | ๅ่กไฟก็จ็ญ็บง+newest_rating | str | N | ๆๆฐไฟก็จ็ญ็บง+rating_comp | str | N | ๆๆฐ่ฏ็บงๆบๆ+++<br>+<br>+++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api(your token)+#่ทๅๅฏ่ฝฌๅบๅบ็กไฟกๆฏๅ่กจ+df = pro.cb_basic(fields="ts_code,bond_short_name,stk_code,stk_short_name,list_date,delist_date")++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code bond_short_name stk_code stk_short_name list_date delist_date+ 0 125002.SZ ไธ็ง่ฝฌๅบ 000002.SZ ไธ็ง๏ผก 2002-06-28 2004-04-30+ 1 125009.SZ ๅฎๅฎ่ฝฌๅธ 000009.SZ ไธญๅฝๅฎๅฎ 1993-02-10 1996-01-01+ 2 125069.SZ ไพจๅ่ฝฌๅบ 000069.SZ ๅไพจๅ๏ผก 2004-01-16 2005-04-29+ 3 125301.SZ ไธ็ปธ่ฝฌๅบ 000301.SZ ไธๆน็่น 1998-09-15 2003-08-28+ 4 126301.SZ ไธ็ปธ่ฝฌ2 000301.SZ ไธๆน็่น 2002-09-24 2006-09-18diff --git "a/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\217\257\350\275\254\345\200\272\346\212\200\346\234\257\351\235\242\345\233\240\345\255\220(\344\270\223\344\270\232\347\211\210).md" "b/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\217\257\350\275\254\345\200\272\346\212\200\346\234\257\351\235\242\345\233\240\345\255\220(\344\270\223\344\270\232\347\211\210).md"new file mode 100644index 000000000..15081c444--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\217\257\350\275\254\345\200\272\346\212\200\346\234\257\351\235\242\345\233\240\345\255\220(\344\270\223\344\270\232\347\211\210).md"@@ -0,0 +1,143 @@+## ๅฏ่ฝฌๅบๆๆฏๅ ๅญ(ไธไธ็)+----++ๆฅๅฃ๏ผcb_factor_pro+ๆ่ฟฐ๏ผ่ทๅๅฏ่ฝฌๅบๆฏๆฅๆๆฏ้ขๅ ๅญๆฐๆฎ๏ผ็จไบ่ท่ธชๅฏ่ฝฌๅบๅฝๅ่ตฐๅฟๆ ๅต๏ผๆฐๆฎ็ฑTushare็คพๅบ่ชไบง๏ผ่ฆ็ๅ จๅๅฒ๏ผ่พๅบๅๆฐ_bfq่กจ็คบไธๅคๆ๏ผ_qfq่กจ็คบๅๅคๆ _hfq่กจ็คบๅๅคๆ๏ผๆ่ฟฐไธญ่ฏดๆไบๅ ๅญ็้ป่ฎคไผ ๅ๏ผๅฆ้่ฆ็นๆฎๅๆฐๆ่ ๆดๅคๅ ๅญๅฏไปฅ่็ณป็ฎก็ๅ่ฏไผฐ+้้๏ผๅๆฌก่ฐๅๆๅค่ฟๅ10000ๆกๆฐๆฎ๏ผๅฏไปฅ้่ฟๆฅๆๅๆฐๅพช็ฏ+็งฏๅ๏ผ5000็งฏๅๆฏๅ้ๅฏไปฅ่ฏทๆฑ30ๆฌก๏ผ8000็งฏๅไปฅไธๆฏๅ้500ๆฌก๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ๅฏ่ฝฌๅบไปฃ็ +start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+trade_date | str | N | ไบคๆๆฅๆ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ฝฌๅบไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+open | float | Y | ๅผ็ไปท+high | float | Y | ๆ้ซไปท+low | float | Y | ๆไฝไปท+close | float | Y | ๆถ็ไปท+pre_close | float | Y | ๆจๆถไปท+change | float | Y | ๆถจ่ท้ข+pct_change | float | Y | ๆถจ่ทๅน ๏ผๆชๅคๆ๏ผๅฆๆๆฏๅคๆ่ฏท็จย ้็จ่กๆ ๆฅๅฃย ๏ผ+vol | float | Y | ๆไบค้ ๏ผๆ๏ผ+amount | float | Y | ๆไบค้้ข(ไธๅ )+asi_bfq | float | Y | ๆฏๅจๅ้ๆๆ -OPEN, CLOSE, HIGH, LOW, M1=26, M2=10+asit_bfq | float | Y | ๆฏๅจๅ้ๆๆ -OPEN, CLOSE, HIGH, LOW, M1=26, M2=10+atr_bfq | float | Y | ็ๅฎๆณขๅจNๆฅๅนณๅๅผ-CLOSE, HIGH, LOW, N=20+bbi_bfq | float | Y | BBIๅค็ฉบๆๆ -CLOSE, M1=3, M2=6, M3=12, M4=20+bias1_bfq | float | Y | BIASไน็ฆป็-CLOSE, L1=6, L2=12, L3=24+bias2_bfq | float | Y | BIASไน็ฆป็-CLOSE, L1=6, L2=12, L3=24+bias3_bfq | float | Y | BIASไน็ฆป็-CLOSE, L1=6, L2=12, L3=24+boll_lower_bfq | float | Y | BOLLๆๆ ๏ผๅธๆๅธฆ-CLOSE, N=20, P=2+boll_mid_bfq | float | Y | BOLLๆๆ ๏ผๅธๆๅธฆ-CLOSE, N=20, P=2+boll_upper_bfq | float | Y | BOLLๆๆ ๏ผๅธๆๅธฆ-CLOSE, N=20, P=2+brar_ar_bfq | float | Y | BRARๆ ็ปชๆๆ -OPEN, CLOSE, HIGH, LOW, M1=26+brar_br_bfq | float | Y | BRARๆ ็ปชๆๆ -OPEN, CLOSE, HIGH, LOW, M1=26+cci_bfq | float | Y | ้กบๅฟๆๆ ๅๅซCCIๆๆ -CLOSE, HIGH, LOW, N=14+cr_bfq | float | Y | CRไปทๆ ผๅจ้ๆๆ -CLOSE, HIGH, LOW, N=20+dfma_dif_bfq | float | Y | ๅนณ่ก็บฟๅทฎๆๆ -CLOSE, N1=10, N2=50, M=10+dfma_difma_bfq | float | Y | ๅนณ่ก็บฟๅทฎๆๆ -CLOSE, N1=10, N2=50, M=10+dmi_adx_bfq | float | Y | ๅจๅๆๆ -CLOSE, HIGH, LOW, M1=14, M2=6+dmi_adxr_bfq | float | Y | ๅจๅๆๆ -CLOSE, HIGH, LOW, M1=14, M2=6+dmi_mdi_bfq | float | Y | ๅจๅๆๆ -CLOSE, HIGH, LOW, M1=14, M2=6+dmi_pdi_bfq | float | Y | ๅจๅๆๆ -CLOSE, HIGH, LOW, M1=14, M2=6+downdays | float | Y | ่ฟ่ทๅคฉๆฐ+updays | float | Y | ่ฟๆถจๅคฉๆฐ+dpo_bfq | float | Y | ๅบ้ด้่ก็บฟ-CLOSE, M1=20, M2=10, M3=6+madpo_bfq | float | Y | ๅบ้ด้่ก็บฟ-CLOSE, M1=20, M2=10, M3=6+ema_bfq_10 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=10+ema_bfq_20 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=20+ema_bfq_250 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=250+ema_bfq_30 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=30+ema_bfq_5 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=5+ema_bfq_60 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=60+ema_bfq_90 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=90+emv_bfq | float | Y | ็ฎๆๆณขๅจๆๆ -HIGH, LOW, VOL, N=14, M=9+maemv_bfq | float | Y | ็ฎๆๆณขๅจๆๆ -HIGH, LOW, VOL, N=14, M=9+expma_12_bfq | float | Y | EMAๆๆฐๅนณๅๆฐๆๆ -CLOSE, N1=12, N2=50+expma_50_bfq | float | Y | EMAๆๆฐๅนณๅๆฐๆๆ -CLOSE, N1=12, N2=50+kdj_bfq | float | Y | KDJๆๆ -CLOSE, HIGH, LOW, N=9, M1=3, M2=3+kdj_d_bfq | float | Y | KDJๆๆ -CLOSE, HIGH, LOW, N=9, M1=3, M2=3+kdj_k_bfq | float | Y | KDJๆๆ -CLOSE, HIGH, LOW, N=9, M1=3, M2=3+ktn_down_bfq | float | Y | ่ฏ็น็บณไบคๆ้้, N้20ๆฅ๏ผATR้10ๆฅ-CLOSE, HIGH, LOW, N=20, M=10+ktn_mid_bfq | float | Y | ่ฏ็น็บณไบคๆ้้, N้20ๆฅ๏ผATR้10ๆฅ-CLOSE, HIGH, LOW, N=20, M=10+ktn_upper_bfq | float | Y | ่ฏ็น็บณไบคๆ้้, N้20ๆฅ๏ผATR้10ๆฅ-CLOSE, HIGH, LOW, N=20, M=10+lowdays | float | Y | LOWRANGE(LOW)่กจ็คบๅฝๅๆไฝไปทๆฏ่ฟๅคๅฐๅจๆๅ ๆไฝไปท็ๆๅฐๅผ+topdays | float | Y | TOPRANGE(HIGH)่กจ็คบๅฝๅๆ้ซไปทๆฏ่ฟๅคๅฐๅจๆๅ ๆ้ซไปท็ๆๅคงๅผ+ma_bfq_10 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=10+ma_bfq_20 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=20+ma_bfq_250 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=250+ma_bfq_30 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=30+ma_bfq_5 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=5+ma_bfq_60 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=60+ma_bfq_90 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=90+macd_bfq | float | Y | MACDๆๆ -CLOSE, SHORT=12, LONG=26, M=9+macd_dea_bfq | float | Y | MACDๆๆ -CLOSE, SHORT=12, LONG=26, M=9+macd_dif_bfq | float | Y | MACDๆๆ -CLOSE, SHORT=12, LONG=26, M=9+mass_bfq | float | Y | ๆข ๆฏ็บฟ-HIGH, LOW, N1=9, N2=25, M=6+ma_mass_bfq | float | Y | ๆข ๆฏ็บฟ-HIGH, LOW, N1=9, N2=25, M=6+mfi_bfq | float | Y | MFIๆๆ ๆฏๆไบค้็RSIๆๆ -CLOSE, HIGH, LOW, VOL, N=14+mtm_bfq | float | Y | ๅจ้ๆๆ -CLOSE, N=12, M=6+mtmma_bfq | float | Y | ๅจ้ๆๆ -CLOSE, N=12, M=6+obv_bfq | float | Y | ่ฝ้ๆฝฎๆๆ -CLOSE, VOL+psy_bfq | float | Y | ๆ่ต่ ๅฏน่กๅธๆถจ่ทไบง็ๅฟ็ๆณขๅจ็ๆ ็ปชๆๆ -CLOSE, N=12, M=6+psyma_bfq | float | Y | ๆ่ต่ ๅฏน่กๅธๆถจ่ทไบง็ๅฟ็ๆณขๅจ็ๆ ็ปชๆๆ -CLOSE, N=12, M=6+roc_bfq | float | Y | ๅๅจ็ๆๆ -CLOSE, N=12, M=6+maroc_bfq | float | Y | ๅๅจ็ๆๆ -CLOSE, N=12, M=6+rsi_bfq_12 | float | Y | RSIๆๆ -CLOSE, N=12+rsi_bfq_24 | float | Y | RSIๆๆ -CLOSE, N=24+rsi_bfq_6 | float | Y | RSIๆๆ -CLOSE, N=6+taq_down_bfq | float | Y | ๅๅฎๅฅ้้(ๆตท้พ)ไบคๆๆๆ -HIGH, LOW, 20+taq_mid_bfq | float | Y | ๅๅฎๅฅ้้(ๆตท้พ)ไบคๆๆๆ -HIGH, LOW, 20+taq_up_bfq | float | Y | ๅๅฎๅฅ้้(ๆตท้พ)ไบคๆๆๆ -HIGH, LOW, 20+trix_bfq | float | Y | ไธ้ๆๆฐๅนณๆปๅนณๅ็บฟ-CLOSE, M1=12, M2=20+trma_bfq | float | Y | ไธ้ๆๆฐๅนณๆปๅนณๅ็บฟ-CLOSE, M1=12, M2=20+vr_bfq | float | Y | VRๅฎน้ๆฏ็-CLOSE, VOL, M1=26+wr_bfq | float | Y | W&R ๅจๅปๆๆ -CLOSE, HIGH, LOW, N=10, N1=6+wr1_bfq | float | Y | W&R ๅจๅปๆๆ -CLOSE, HIGH, LOW, N=10, N1=6+xsii_td1_bfq | float | Y | ่ๆฏ้้II-CLOSE, HIGH, LOW, N=102, M=7+xsii_td2_bfq | float | Y | ่ๆฏ้้II-CLOSE, HIGH, LOW, N=102, M=7+xsii_td3_bfq | float | Y | ่ๆฏ้้II-CLOSE, HIGH, LOW, N=102, M=7+xsii_td4_bfq | float | Y | ่ๆฏ้้II-CLOSE, HIGH, LOW, N=102, M=7++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++#่ทๅ้นค21่ฝฌๅบ113632.SHๆไปฅๆๅๅฒๅ ๅญๆฐๆฎ+df = pro.cb_factor_pro(ts_code=113632.SH')++#่ทๅไบคๆๆฅๆไธบ20250724ๅฝๅคฉๆๆๅฏ่ฝฌๅบ็ๅ ๅญๆฐๆฎ+df = pro.hk_income(trade_date='20250724')++```++<br>+<br>++**ๆฐๆฎๆ ทไพ**++ ts_code trade_date open ... xsii_td2_bfq xsii_td3_bfq xsii_td4_bfq+ 0 113632.SH 20250724 129.050 ... 125.93711 133.15621 115.73390+ 1 113632.SH 20250723 129.323 ... 125.15884 132.97290 115.57458+ 2 113632.SH 20250722 128.783 ... 124.46147 132.83027 115.45061+ 3 113632.SH 20250721 126.404 ... 123.75651 132.68214 115.32186+ 4 113632.SH 20250718 126.229 ... 123.16743 132.56631 115.22119+ .. ... ... ... ... ... ... ...+ 873 113632.SH 20211215 130.950 ... 128.94497 139.66710 121.39290+ 874 113632.SH 20211214 131.010 ... NaN 140.18070 121.83930+ 875 113632.SH 20211213 133.890 ... NaN 141.11160 122.64840+ 876 113632.SH 20211210 129.990 ... NaN 143.65820 124.86180+ 877 113632.SH 20211209 127.000 ... NaN 140.12720 121.79280\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\217\257\350\275\254\345\200\272\347\245\250\351\235\242\345\210\251\347\216\207.md" "b/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\217\257\350\275\254\345\200\272\347\245\250\351\235\242\345\210\251\347\216\207.md"new file mode 100644index 000000000..27e01d692--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\217\257\350\275\254\345\200\272\347\245\250\351\235\242\345\210\251\347\216\207.md"@@ -0,0 +1,58 @@+## ๅฏ่ฝฌๅบ็ฅจ้ขๅฉ็+----++ๆฅๅฃ๏ผcb_rate+ๆ่ฟฐ๏ผ่ทๅๅฏ่ฝฌๅบ็ฅจ้ขๅฉ็+้้๏ผๅๆฌกๆๅคง2000๏ผๆป้ไธ้ๅถ+ๆ้๏ผ็จๆท้่ฆ่ณๅฐ5000็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ่ฝฌๅบไปฃ็ ๏ผๆฏๆๅคๅผ่พๅ ฅ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ฝฌๅบไปฃ็ +rate_freq | int | N | ไปๆฏ้ข็(ๆฌก/ๅนด)+rate_start_date | str | N | ไปๆฏๅผๅงๆฅๆ+rate_end_date | str | N | ไปๆฏ็ปๆๆฅๆ+coupon_rate | float | N | ็ฅจ้ขๅฉ็(%)+++<br>+<br>+++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api(your token)+#่ทๅๅฏ่ฝฌๅบๅบ็กไฟกๆฏๅ่กจ+df = pro.cb_rate(ts_code='123046.SZ,127064.SZ',fields="ts_code,rate_freq,rate_start_date,rate_end_date,coupon_rate")++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code rate_freq rate_start_date rate_end_date coupon_rate+ 0 123046.SZ 1 20200319 20210318 0.500000+ 1 123046.SZ 1 20210319 20220318 0.700000+ 2 123046.SZ 1 20220319 20230318 1.000000+ 3 123046.SZ 1 20230319 20240318 1.500000+ 4 123046.SZ 1 20240319 20250318 2.500000+ 5 123046.SZ 1 20250319 20260318 3.000000+ 6 127064.SZ 1 20220519 20230518 0.200000+ 7 127064.SZ 1 20230519 20240518 0.400000+ 8 127064.SZ 1 20240519 20250518 0.600000+ 9 127064.SZ 1 20250519 20260518 1.500000+ 10 127064.SZ 1 20260519 20270518 1.800000+ 11 127064.SZ 1 20270519 20280518 2.000000\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\217\257\350\275\254\345\200\272\350\241\214\346\203\205.md" "b/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\217\257\350\275\254\345\200\272\350\241\214\346\203\205.md"new file mode 100644index 000000000..642996d05--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\217\257\350\275\254\345\200\272\350\241\214\346\203\205.md"@@ -0,0 +1,111 @@+## ๅฏ่ฝฌๅบ่กๆ+----++ๆฅๅฃ๏ผcb_daily+ๆ่ฟฐ๏ผ่ทๅๅฏ่ฝฌๅบ่กๆ+้้๏ผๅๆฌกๆๅคง2000ๆก๏ผๅฏๅคๆฌกๆๅ๏ผๆป้ไธ้ๅถ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผ5000็งฏๅไปฅไธ้ขๆฌก็ธๅฏน่พ้ซ๏ผ็งฏๅ่ถๅคๆ้่ถๅคง๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | TSไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ(YYYYMMDDๆ ผๅผ๏ผไธๅ)+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ฝฌๅบไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+pre_close | float | Y | ๆจๆถ็ไปท(ๅ )+open | float | Y | ๅผ็ไปท(ๅ )+high | float | Y | ๆ้ซไปท(ๅ )+low | float | Y | ๆไฝไปท(ๅ )+close | float | Y | ๆถ็ไปท(ๅ )+change | float | Y | ๆถจ่ท(ๅ )+pct_chg | float | Y | ๆถจ่ทๅน (%)+vol | float | Y | ๆไบค้(ๆ)+amount | float | Y | ๆไบค้้ข(ไธๅ )+bond_value | float | N | ็บฏๅบไปทๅผ+bond_over_rate | float | N | ็บฏๅบๆบขไปท็(%)+cb_value | float | N | ่ฝฌ่กไปทๅผ+cb_over_rate | float | N | ่ฝฌ่กๆบขไปท็(%)++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()+++#่ทๅๅฏ่ฝฌๅบ่กๆ+df = pro.cb_daily(trade_date='20190719', fields='ts_code,trade_date, pre_close,open,high,low,close')++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code trade_date pre_close open high low close \+ 0 110030.SH 20190719 104.700 104.710 104.960 104.540 104.660+ 1 113008.SH 20190719 112.600 113.390 113.600 112.800 113.200+ 2 110031.SH 20190719 107.500 107.500 107.940 107.380 107.520+ 3 123001.SZ 20190719 114.300 115.500 120.780 114.884 118.879+ 4 110033.SH 20190719 111.910 111.640 112.500 111.640 112.200+ 5 110034.SH 20190719 102.360 102.230 102.500 102.230 102.320+ 6 113009.SH 20190719 107.500 108.000 108.200 107.790 107.800+ 7 128010.SZ 20190719 100.900 100.900 101.300 100.897 101.000+ 8 128012.SZ 20190719 97.021 97.013 97.200 97.007 97.029+ 9 127003.SZ 20190719 101.850 101.850 102.896 101.850 102.399+ 10 128013.SZ 20190719 96.500 96.307 96.647 96.306 96.500+ 11 113011.SH 20190719 109.680 109.780 110.990 109.780 110.530+ 12 113012.SH 20190719 101.330 101.710 103.000 101.590 101.810+ 13 128014.SZ 20190719 97.000 97.498 97.498 97.103 97.158+ 14 127004.SZ 20190719 92.252 92.256 92.450 92.256 92.262+ 15 128015.SZ 20190719 92.799 92.799 93.060 92.790 92.920+ 16 113013.SH 20190719 113.840 113.860 114.770 113.860 114.060+ 17 128016.SZ 20190719 114.000 114.125 114.742 112.021 113.800+ 18 113014.SH 20190719 96.910 96.790 97.230 96.780 96.880+ 19 128017.SZ 20190719 109.501 109.501 111.880 109.011 109.501+ 20 113015.SH 20190719 130.070 131.500 132.800 130.000 131.250+++ change pct_chg vol amount+ 0 -0.040 -0.0382 3576.0 374.1486+ 1 0.600 0.5329 5347.0 605.9335+ 2 0.020 0.0186 16.0 1.7213+ 3 4.579 4.0061 85105.8 10134.7401+ 4 0.290 0.2591 5453.0 611.6870+ 5 -0.040 -0.0391 3330.0 340.9462+ 6 0.300 0.2791 9004.0 972.8459+ 7 0.100 0.0991 2037.3 205.7750+ 8 0.008 0.0082 4909.5 476.4216+ 9 0.549 0.5390 3961.0 405.5685+ 10 0.000 0.0000 6175.4 596.0637+ 11 0.850 0.7750 140352.0 15524.5109+ 12 0.480 0.4737 2005.0 204.9667+ 13 0.158 0.1629 174.0 16.9261+ 14 0.010 0.0108 3853.0 355.7765+ 15 0.121 0.1304 9438.1 877.6806+ 16 0.220 0.1933 19904.0 2278.7127+ 17 -0.200 -0.1754 21462.9 2434.8231+ 18 -0.030 -0.0310 1750.0 169.4889+ 19 0.000 0.0000 364.2 40.3436+ 20 1.180 0.9072 30730.0 4047.7157\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\217\257\350\275\254\345\200\272\350\265\216\345\233\236\344\277\241\346\201\257.md" "b/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\217\257\350\275\254\345\200\272\350\265\216\345\233\236\344\277\241\346\201\257.md"new file mode 100644index 000000000..d44708ba5--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\217\257\350\275\254\345\200\272\350\265\216\345\233\236\344\277\241\346\201\257.md"@@ -0,0 +1,63 @@+## ๅฏ่ฝฌๅบ่ตๅไฟกๆฏ+----++ๆฅๅฃ๏ผcb_call๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆ่ฟฐ๏ผ่ทๅๅฏ่ฝฌๅบๅฐๆ่ตๅใๅผบๅถ่ตๅ็ญไฟกๆฏใๆฐๆฎๆฅๆบไบๅ ฌๅผๆซ้ฒๆธ ้๏ผไพไธชไบบๅๆบๆ็ ็ฉถไฝฟ็จ๏ผ่ฏทไธ่ฆ็จไบๆฐๆฎๅไธ็ฎ็ใ+้้๏ผๅๆฌกๆๅคง2000ๆกๆฐๆฎ๏ผๅฏไปฅๆ นๆฎๆฅๆๅพช็ฏๆๅ๏ผๆฌๆฅๅฃ้5000็งฏๅใ++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ฝฌๅบไปฃ็ ๏ผๆฏๆๅคๅผ่พๅ ฅ+ann_date | str | N | ๅ ฌๅๆฅๆ(YYYYMMDDๆ ผๅผ๏ผไธๅ)+start_date | str | N | ๅ ฌๅๅผๅงๆฅๆ+end_date | str | N | ๅ ฌๅ็ปๆๆฅๆ++++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ฝฌๅบไปฃ็ +call_type | str | Y | ่ตๅ็ฑปๅ๏ผๅฐ่ตใๅผบ่ต+is_call | str | Y | ๆฏๅฆ่ตๅ๏ผๅทฒๆปก่ถณๅผบ่ตๆกไปถใๅ ฌๅๆ็คบๅผบ่ตใๅ ฌๅๅฎๆฝๅผบ่ตใๅ ฌๅๅฐๆ่ตๅใๅ ฌๅไธๅผบ่ต+ann_date | str | Y | ๅ ฌๅ/ๆ็คบๆฅๆ+call_date | str | Y | ่ตๅๆฅๆ+call_price | float | Y | ่ตๅไปทๆ ผ(ๅซ็จ๏ผๅ /ๅผ )+call_price_tax | float | Y | ่ตๅไปทๆ ผ(ๆฃ็จ๏ผๅ /ๅผ )+call_vol | float | Y | ่ตๅๅบๅธๆฐ้(ๅผ )+call_amount | float | Y | ่ตๅ้้ข(ไธๅ )+payment_date | str | Y | ่กๆๅๆฌพ้กนๅฐ่ดฆๆฅ+call_reg_date | str | Y | ่ตๅ็ป่ฎฐๆฅ+++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api('your token')++#่ทๅๅฏ่ฝฌๅบ่กๆ+df = pro.cb_call(fields='ts_code,call_type,is_call,ann_date,call_date,call_price')++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code call_type is_call ann_date call_date call_price+ 0 123069.SZ ๅผบ่ต ๅ ฌๅไธๅผบ่ต 20210821 None None+ 1 113621.SH ๅผบ่ต ๅ ฌๅไธๅผบ่ต 20210821 None None+ 2 113528.SH ๅผบ่ต ๅ ฌๅไธๅผบ่ต 20210821 None None+ 3 113012.SH ๅผบ่ต ๅ ฌๅๅผบ่ต 20210818 20210903 100.6700+ 4 128113.SZ ๅผบ่ต ๅ ฌๅไธๅผบ่ต 20210818 None None+ .. ... ... ... ... ... ...+ 466 125069.SZ ๅผบ่ต ๅ ฌๅๅผบ่ต 20050429 20050422 101.8000+ 467 125630.SZ ๅผบ่ต ๅ ฌๅไธๅผบ่ต 20040624 None None+ 468 100009.SH ๅผบ่ต ๅ ฌๅๅผบ่ต 20040511 20040423 100.1300+ 469 125002.SZ ๅผบ่ต ๅ ฌๅๅผบ่ต 20040430 20040423 101.5000+ 470 125629.SZ ๅผบ่ต ๅ ฌๅๅผบ่ต 20040414 20040406 105.0000diff --git "a/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\217\257\350\275\254\345\200\272\350\275\254\350\202\241\344\273\267\345\217\230\345\212\250.md" "b/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\217\257\350\275\254\345\200\272\350\275\254\350\202\241\344\273\267\345\217\230\345\212\250.md"new file mode 100644index 000000000..a4dc36b58--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\217\257\350\275\254\345\200\272\350\275\254\350\202\241\344\273\267\345\217\230\345\212\250.md"@@ -0,0 +1,51 @@+## ๅฏ่ฝฌๅบ่ฝฌ่กไปทๅๅจ+----++ๆฅๅฃ๏ผcb_price_chg+ๆ่ฟฐ๏ผ่ทๅๅฏ่ฝฌๅบ่ฝฌ่กไปทๅๅจ+้้๏ผๅๆฌกๆๅคง2000๏ผๆป้ไธ้ๅถ+ๆ้๏ผๆฌๆฅๅฃ้ๅ็ฌๅผๆ้๏ผ่ท็งฏๅๆฒกๅ ณ็ณป๏ผ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=290)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ่ฝฌๅบไปฃ็ ๏ผๆฏๆๅคๅผ่พๅ ฅ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ฝฌๅบไปฃ็ +bond_short_name | str | Y | ่ฝฌๅบ็ฎ็งฐ+publish_date | str | Y | ๅ ฌๅๆฅๆ+change_date | str | Y | ๅๅจๆฅๆ+convert_price_initial | float | Y | ๅๅง่ฝฌ่กไปทๆ ผ+convertprice_bef | float | Y | ไฟฎๆญฃๅ่ฝฌ่กไปทๆ ผ+convertprice_aft | float | Y | ไฟฎๆญฃๅ่ฝฌ่กไปทๆ ผ++<br>+<br>+++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api(your token)+#่ทๅๅฏ่ฝฌๅบ่ฝฌ่กไปทๅๅจ+df = pro.cb_price_chg(ts_code="113556.SH,128114.SZ,128110.SZ",fields="ts_code,bond_short_name,change_date,convert_price_initial,convertprice_bef,convertprice_aft")++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code bond_short_name change_date convert_price_initial convertprice_bef convertprice_aft+ 0 113556.SH ่ณ็บฏ่ฝฌๅบ 20191220 29.4700 None None+ 1 113556.SH ่ณ็บฏ่ฝฌๅบ 20200629 29.4700 29.4700 29.3800+ 2 128110.SZ ๆฐธๅ ด่ฝฌๅบ 20200609 17.1600 None None+ 3 128114.SZ ๆญฃ้ฆ่ฝฌๅบ 20200617 16.0900 None None\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\217\257\350\275\254\345\200\272\350\275\254\350\202\241\347\273\223\346\236\234.md" "b/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\217\257\350\275\254\345\200\272\350\275\254\350\202\241\347\273\223\346\236\234.md"new file mode 100644index 000000000..417334365--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\217\257\350\275\254\345\200\272\350\275\254\350\202\241\347\273\223\346\236\234.md"@@ -0,0 +1,74 @@+## ๅฏ่ฝฌๅบ่ฝฌ่ก็ปๆ+----++ๆฅๅฃ๏ผcb_share+ๆ่ฟฐ๏ผ่ทๅๅฏ่ฝฌๅบ่ฝฌ่ก็ปๆ+้้๏ผๅๆฌกๆๅคง2000๏ผๆป้ไธ้ๅถ+ๆ้๏ผ็จๆท้่ฆ่ณๅฐ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผไฝๆๆต้ๆงๅถ๏ผ5000็งฏๅไปฅไธ้ขๆฌก็ธๅฏน่พ้ซ๏ผ็งฏๅ่ถๅคๆ้่ถๅคง๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ่ฝฌๅบไปฃ็ ๏ผๆฏๆๅคๅผ่พๅ ฅ+ann_date | str | Y | ๅ ฌๅๆฅๆ๏ผYYYYMMDDๆ ผๅผ๏ผไธๅ๏ผ+start_date | str | N | ๅ ฌๅๅผๅงๆฅๆ+end_date | str | N | ๅ ฌๅ็ปๆๆฅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ๅบๅธไปฃ็ +bond_short_name | str | Y | ๅบๅธ็ฎ็งฐ+publish_date | str | Y | ๅ ฌๅๆฅๆ+end_date | str | Y | ็ป่ฎกๆชๆญขๆฅๆ+issue_size | float | Y | ๅฏ่ฝฌๅบๅ่กๆป้ข+convert_price_initial | float | Y | ๅๅง่ฝฌๆขไปทๆ ผ+convert_price | float | Y | ๆฌๆฌก่ฝฌๆขไปทๆ ผ+convert_val | float | Y | ๆฌๆฌก่ฝฌ่ก้้ข+convert_vol | float | Y | ๆฌๆฌก่ฝฌ่กๆฐ้+convert_ratio | float | Y | ๆฌๆฌก่ฝฌ่กๆฏไพ+acc_convert_val | float | Y | ็ดฏ่ฎก่ฝฌ่ก้้ข+acc_convert_vol | float | Y | ็ดฏ่ฎก่ฝฌ่กๆฐ้+acc_convert_ratio | float | Y | ็ดฏ่ฎก่ฝฌ่กๆฏไพ+remain_size | float | Y | ๅฏ่ฝฌๅบๅฉไฝ้้ข+total_shares | float | Y | ่ฝฌ่กๅๆป่กๆฌ++<br>+<br>+++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api(your token)+#่ทๅๅฏ่ฝฌๅบ่ฝฌ่ก็ปๆ+df = pro.cb_share(ts_code="113001.SH,110027.SH",fields="ts_code,end_date,convert_price,convert_val,convert_ratio,acc_convert_ratio")++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code end_date convert_price convert_val convert_ratio acc_convert_ratio+ 0 110027.SH 2015-02-16 12.0000 117572928.00 2.939323 99.9126+ 1 110027.SH 2015-02-13 12.0000 521211288.00 13.030282 96.9733+ 2 110027.SH 2015-02-12 12.0000 486077580.00 12.151940 83.9430+ 3 110027.SH 2015-02-11 12.0000 304362204.00 7.609055 71.7910+ 4 110027.SH 2015-02-10 12.0000 334752476.00 8.368812 64.1820+ .. ... ... ... ... ... ...+ 244 113001.SH 2010-12-10 3.7800 5998.86 0.000015 0.0002+ 245 113001.SH 2010-12-09 3.7800 5998.86 0.000015 0.0002+ 246 113001.SH 2010-12-06 3.7800 18994.50 0.000047 0.0002+ 247 113001.SH 2010-12-03 3.7800 12991.86 0.000032 0.0001+ 248 113001.SH 2010-12-02 3.7800 33982.20 0.000085 0.0001diff --git "a/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\233\275\345\200\272\346\224\266\347\233\212\347\216\207\346\233\262\347\272\277.md" "b/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\233\275\345\200\272\346\224\266\347\233\212\347\216\207\346\233\262\347\272\277.md"new file mode 100644index 000000000..233598241--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\233\275\345\200\272\346\224\266\347\233\212\347\216\207\346\233\262\347\272\277.md"@@ -0,0 +1,67 @@+## ๅฝๅบๆถ็็ๆฒ็บฟ+----++ๆฅๅฃ๏ผyc_cb+ๆ่ฟฐ๏ผ่ทๅไธญๅบๆถ็็ๆฒ็บฟ๏ผ็ฎๅๅฏ่ทๅไธญๅบๅฝๅบๆถ็็ๆฒ็บฟๅณๆๅๅฐๆๆถ็็ๆฒ็บฟๆฐๆฎ+้้๏ผๅๆฌกๆๅคง2000๏ผๆป้ไธ้ๅถ๏ผๅฏๅพช็ฏๆๅ+ๆ้๏ผๅฑไบๅ็ฌ็ๆ้ๆฅๅฃ๏ผ่ฏทๅจ็พค้่็ณป็พคไธปๆ็ฎก็ๅ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ๆถ็็ๆฒ็บฟ็ผ็ ๏ผ1001.CB-ๅฝๅบๆถ็็ๆฒ็บฟ+curve_type | str | N | ๆฒ็บฟ็ฑปๅ๏ผ0-ๅฐๆ๏ผ1-ๅณๆ+trade_date | str | N | ไบคๆๆฅๆ+start_date | str | N | ๆฅ่ฏข่ตทๅงๆฅๆ+end_date | str | N | ๆฅ่ฏข็ปๆๆฅๆ+curve_term | float | N | ๆ้+++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ+ts_code | str | Y | ๆฒ็บฟ็ผ็ +curve_name | str | Y | ๆฒ็บฟๅ็งฐ+curve_type | str | Y | ๆฒ็บฟ็ฑปๅ๏ผ0-ๅฐๆ๏ผ1-ๅณๆ+curve_term | float | Y | ๆ้(ๅนด)+yield | float | Y | ๆถ็็(%)+++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python+pro = ts.pro_api(your token)+#่ทๅไธญๅบๆถ็็ๆฒ็บฟ+df = pro.yc_cb(ts_code='1001.CB',curve_type='0',trade_date='20200203')++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ trade_date ts_code curve_name curve_type curve_term yield+ 0 20200203 101 ไธญๅบๅฝๅบๆถ็็ๆฒ็บฟ 0 0.0000 1.697300+ 1 20200203 101 ไธญๅบๅฝๅบๆถ็็ๆฒ็บฟ 0 0.0800 1.770000+ 2 20200203 101 ไธญๅบๅฝๅบๆถ็็ๆฒ็บฟ 0 0.1000 1.770100+ 3 20200203 101 ไธญๅบๅฝๅบๆถ็็ๆฒ็บฟ 0 0.1700 1.770300+ 4 20200203 101 ไธญๅบๅฝๅบๆถ็็ๆฒ็บฟ 0 0.2000 1.772300+ ... ... ... ... ... ... ...+ 1001 20200203 101 ไธญๅบๅฝๅบๆถ็็ๆฒ็บฟ 1 49.6000 3.774100+ 1002 20200203 101 ไธญๅบๅฝๅบๆถ็็ๆฒ็บฟ 1 49.7000 3.774700+ 1003 20200203 101 ไธญๅบๅฝๅบๆถ็็ๆฒ็บฟ 1 49.8000 3.775400+ 1004 20200203 101 ไธญๅบๅฝๅบๆถ็็ๆฒ็บฟ 1 49.9000 3.776100+ 1005 20200203 101 ไธญๅบๅฝๅบๆถ็็ๆฒ็บฟ 1 50.0000 3.776800\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\244\247\345\256\227\344\272\244\346\230\223.md" "b/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\244\247\345\256\227\344\272\244\346\230\223.md"new file mode 100644index 000000000..85d9bbe99--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\244\247\345\256\227\344\272\244\346\230\223.md"@@ -0,0 +1,67 @@+## ๅบๅธๅคงๅฎไบคๆ+----++ๆฅๅฃ๏ผbond_blk+ๆ้๏ผ็จๆทๆปก5000็งฏๅๆๆฐๆฎๆ้๏ผๅๆฌกๆๅคง1000ๆก๏ผๅฏๆ นๆฎๆฅๆๅพช็ฏๆๅ๏ผๆป้ไธ้ๅถ+ๆ่ฟฐ๏ผ่ทๅๆฒชๆทฑไบคๆๆๅบๅธๅคงๅฎไบคๆๆฐๆฎ๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ๅบๅธไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ๏ผYYYYMMDDๆ ผๅผ๏ผไธๅ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ+ts_code | str | Y | ๅบๅธไปฃ็ +name | str | Y | ๅบๅธๅ็งฐ+price | float | Y | ๆไบคไปท๏ผๅ ๏ผ+vol | float | Y | ็ดฏ่ฎกๆไบคๆฐ้๏ผไธ่ก/ไธไปฝ/ไธๅผ /ไธๆ๏ผ+amount | float | Y | ็ดฏ่ฎกๆไบค้้ข๏ผไธๅ ๏ผ+++<br>+<br>+++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++df = pro.bond_blk(start_date='20210701', end_date='20210930')++```+++<br>+<br>++**ๆฐๆฎๆ ทไพ**+++ trade_date ts_code name price vol amount+ 0 20210930 152497.SH 20้ป่ฅฟๅ 75.00 35.00 2625.00+ 1 20210930 152497.SH 20้ป่ฅฟๅ 75.00 20.00 1500.00+ 2 20210930 152497.SH 20้ป่ฅฟๅ 75.00 19.20 1440.00+ 3 20210930 152497.SH 20้ป่ฅฟๅ 75.00 18.00 1350.00+ 4 20210930 152497.SH 20้ป่ฅฟๅ 75.00 17.00 1275.00+ .. ... ... ... ... ... ...+ 995 20210917 136225.SZ 21ๅฅฅๅA 99.98 6.50 649.90+ 996 20210917 133073.SZ 21็ปๅผ02 99.34 10.00 993.40+ 997 20210917 133068.SZ 21ไนๆฑ01 100.18 50.00 5009.05+ 998 20210917 133063.SZ 21ๆฐๆฒ04 100.56 6.47 650.63+ 999 20210917 133050.SZ 21ๆฑๆปจ01 100.25 50.00 5012.50\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\244\247\345\256\227\344\272\244\346\230\223\346\230\216\347\273\206.md" "b/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\244\247\345\256\227\344\272\244\346\230\223\346\230\216\347\273\206.md"new file mode 100644index 000000000..6f803c10b--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\345\244\247\345\256\227\344\272\244\346\230\223\346\230\216\347\273\206.md"@@ -0,0 +1,67 @@+## ๅคงๅฎไบคๆๆ็ป+----++ๆฅๅฃ๏ผbond_blk_detail+ๆ้๏ผ็จๆทๆปก5000็งฏๅๆๆฐๆฎๆ้๏ผๅๆฌกๆๅคง1000ๆก๏ผๅฏๆ นๆฎๆฅๆๅพช็ฏๆๅ๏ผๆป้ไธ้ๅถ+ๆ่ฟฐ๏ผ่ทๅๆฒชๆทฑไบคๆๆๅบๅธๅคงๅฎไบคๆๆฐๆฎ๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ++**ๆณจ๏ผๆฌๆฅๅฃ็ฎๅๅชๆๆทฑไบคๆ็ๅคงๅฎไบคๆๆ็ป๏ผไธไบคๆๆ็ปๅทฒ็ปๅ ๅซๅจๅคงๅฎไบคๆๆฅๅฃ้๏ผๆชๅ็ฌ็ฝๅใ**++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ๅบๅธไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ๏ผYYYYMMDDๆ ผๅผ๏ผไธๅ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ+ts_code | str | Y | ๅบๅธไปฃ็ +name | str | Y | ๅบๅธๅ็งฐ+price | float | Y | ๆไบคไปท๏ผๅ ๏ผ+vol | float | Y | ๆไบคๆฐ้๏ผไธ่ก/ไธไปฝ/ไธๅผ /ไธๆ๏ผ+amount | float | Y | ๆไบค้้ข๏ผไธๅ ๏ผ+buy_dp | str | Y | ไนฐๆน่ฅไธ้จ+sell_dp | str | Y | ๅๆน่ฅไธ้จ+++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++df = pro.bond_blk_detail(start_date='20210701', end_date='20210930')++```+++<br>+<br>++**ๆฐๆฎๆ ทไพ**++ trade_date ts_code name price vol amount buy_dp sell_dp+ 0 20210930 149642.SZ 21้ฟๅ08 100.07 50.00 5003.50 ๆบๆไธ็จ ๆบๆไธ็จ+ 1 20210930 149642.SZ 21้ฟๅ08 100.00 65.00 6500.00 ๆบๆไธ็จ ๆบๆไธ็จ+ 2 20210930 149641.SZ 21้ฟๅ07 100.00 100.00 10000.00 ๆบๆไธ็จ ๆบๆไธ็จ+ 3 20210930 149633.SZ 21ๅนฟๅ10 99.83 25.00 2495.75 ๆบๆไธ็จ ๆบๆไธ็จ+ 4 20210930 149633.SZ 21ๅนฟๅ10 99.82 25.00 2495.50 ๆบๆไธ็จ ๆบๆไธ็จ+ .. ... ... ... ... ... ... ... ...+ 995 20210924 138246.SZ ไธ้02D1 110.17 26.30 2897.47 ไธญๅฝๅฝ้ ้่่กไปฝๆ้ๅ ฌๅธไธๆตท้ปๆตฆๅบๆนๆปจ่ทฏ่ฏๅธ่ฅไธ้จ ๆบๆไธ็จ+ 996 20210924 137995.SZ 21ๅณๅขจA3 101.75 15.00 1526.25 ๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธไธดๆฒ้้ๅฑฑ่ทฏ่ฏๅธ่ฅไธ้จ ๆบๆไธ็จ+ 997 20210924 137995.SZ 21ๅณๅขจA3 101.74 15.00 1526.10 ๆบๆไธ็จ ๆบๆไธ็จ+ 998 20210924 137995.SZ 21ๅณๅขจA3 101.73 15.00 1525.95 ๆบๆไธ็จ ๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅฑฑไธๅๅ ฌๅธ+ 999 20210924 137942.SZ ็พๆปก03ๆฌก 103.61 30.00 3108.30 ไธญๅฝๅฝ้ ้่่กไปฝๆ้ๅ ฌๅธไธๆตท้ปๆตฆๅบๆนๆปจ่ทฏ่ฏๅธ่ฅไธ้จ\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\346\237\234\345\217\260\346\265\201\351\200\232\345\274\217\345\200\272\345\210\270\346\212\245\344\273\267.md" "b/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\346\237\234\345\217\260\346\265\201\351\200\232\345\274\217\345\200\272\345\210\270\346\212\245\344\273\267.md"new file mode 100644index 000000000..0de0559b6--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\346\237\234\345\217\260\346\265\201\351\200\232\345\274\217\345\200\272\345\210\270\346\212\245\344\273\267.md"@@ -0,0 +1,63 @@+## ๆๅฐๆต้ๅผๅบๅธๆฅไปท+----++ๆฅๅฃ๏ผbc_otcqt+ๆ่ฟฐ๏ผๆๅฐๆต้ๅผๅบๅธๆฅไปท+้้๏ผๅๆฌกๆๅคง2000ๆก๏ผๅฏๅคๆฌกๆๅ๏ผๆป้ไธ้ๅถ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ500็งฏๅๅฏไปฅ่ฏ็จ่ฐๅ๏ผ2000็งฏๅไปฅไธ้ขๆฌก็ธๅฏน่พ้ซ๏ผ็งฏๅ่ถๅคๆ้่ถๅคง๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+trade_date | str | N | ไบคๆๆฅๆ(YYYYMMDDๆ ผๅผ๏ผไธๅ)+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+ts_code | str | N | TSไปฃ็ +bank | str | N | ๆฅไปทๆบๆ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | N | ๆฅไปทๆฅๆ+qt_time | str | N | ๆฅไปทๆถ้ด+bank | str | N | ๆฅไปทๆบๆ+ts_code | str | N | ๅบๅธ็ผ็ +name | str | N | ๅบๅธ็ฎ็งฐ+maturity | str | N | ๆ้+remain_maturity | str | N | ๅฉไฝๆ้+bond_type | str | N | ๅบๅธ็ฑปๅ+coupon_rate | float | N | ็ฅจ้ขๅฉ็๏ผ%๏ผ+buy_price | float | N | ๆ่ต่ ไนฐๅ ฅๅ จไปท+sell_price | float | N | ๆ่ต่ ๅๅบๅ จไปท+buy_yield | float | N | ๆ่ต่ ไนฐๅ ฅๅฐๆๆถ็็๏ผ%๏ผ+sell_yield | float | N | ๆ่ต่ ๅๅบๅฐๆๆถ็็๏ผ%๏ผ++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python+pro = ts.pro_api(your token)+#ๆๅฐๆต้ๅผๅบๅธๆฅไปท+df = pro.bc_otcqt(start_date='20240325',end_date='20240329',ts_code='200013.BC',fields='trade_date,qt_time,bank,ts_code,name,remain_maturity,buy_yield,sell_yield')++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ trade_date qt_time bank ts_code name remain_maturity buy_yield sell_yield+ 0 20240329 08:11:02 ๆตฆๅ้ถ่ก 200013.BC 20้ๆฏๅฝๅบ13 1ๅนด207ๅคฉ 1.9263 1.7977+ 1 20240329 09:05:28 ๆๅ้ถ่ก 200013.BC 20้ๆฏๅฝๅบ13 1ๅนด207ๅคฉ 1.8950 1.8350+ 2 20240329 09:10:24 ๅทฅๅ้ถ่ก 200013.BC 20้ๆฏๅฝๅบ13 1ๅนด207ๅคฉ 1.8850 1.8528+ 3 20240329 09:14:48 ๅปบ่ฎพ้ถ่ก 200013.BC 20้ๆฏๅฝๅบ13 1ๅนด207ๅคฉ 1.8837 1.8451+ 4 20240329 09:18:18 ไธญๅฝ้ถ่ก 200013.BC 20้ๆฏๅฝๅบ13 1ๅนด207ๅคฉ 1.9040 1.8200+ 5 20240329 10:40:09 ๅไบฌ้ถ่ก 200013.BC 20้ๆฏๅฝๅบ13 1ๅนด207ๅคฉ 1.9043 1.8271+ 6 20240329 15:46:38 ๅไธ้ถ่ก 200013.BC 20้ๆฏๅฝๅบ13 1ๅนด207ๅคฉ 1.8697 1.8054+ 7 20240329 18:36:29 ไบค้้ถ่ก 200013.BC 20้ๆฏๅฝๅบ13 1ๅนด207ๅคฉ 1.8464 1.8142\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\346\237\234\345\217\260\346\265\201\351\200\232\345\274\217\345\200\272\345\210\270\346\234\200\344\274\230\346\212\245\344\273\267.md" "b/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\346\237\234\345\217\260\346\265\201\351\200\232\345\274\217\345\200\272\345\210\270\346\234\200\344\274\230\346\212\245\344\273\267.md"new file mode 100644index 000000000..8c68378f5--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\200\272\345\210\270\344\270\223\351\242\230/\346\237\234\345\217\260\346\265\201\351\200\232\345\274\217\345\200\272\345\210\270\346\234\200\344\274\230\346\212\245\344\273\267.md"@@ -0,0 +1,57 @@+## ๆๅฐๆต้ๅผๅบๅธๆไผๆฅไปท+----++ๆฅๅฃ๏ผbc_bestotcqt+ๆ่ฟฐ๏ผๆๅฐๆต้ๅผๅบๅธๆไผๆฅไปท+้้๏ผๅๆฌกๆๅคง2000๏ผๅฏๅคๆฌกๆๅ๏ผๆป้ไธ้ๅถ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ500็งฏๅๅฏไปฅ่ฏ็จ่ฐๅ๏ผ2000็งฏๅไปฅไธ้ขๆฌก็ธๅฏน่พ้ซ๏ผ็งฏๅ่ถๅคๆ้่ถๅคง๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+trade_date | str | N | ๆฅไปทๆฅๆ(YYYYMMDDๆ ผๅผ๏ผไธๅ)+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+ts_code | str | N | TSไปฃ็ +++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | N | ๆฅไปทๆฅๆ+ts_code | str | N | ๅบๅธ็ผ็ +name | str | N | ๅบๅธ็ฎ็งฐ+remain_maturity | str | N | ๅฉไฝๆ้+bond_type | str | N | ๅบๅธ็ฑปๅ+best_buy_bank | str | N | ๆไผๆฅไนฐไปทๆน+best_buy_yield | float | N | ๆ่ต่ ๆไผไนฐๅ ฅไปทๅฐๆๆถ็็๏ผ%๏ผ+best_buy_price | float | N | ๆ่ต่ ๆไผไนฐๅ ฅๅ จไปท+best_sell_bank | str | N | ๆไผๅๆฅไปทๆน+best_sell_yield | float | N | ๆ่ต่ ๆไผๅๅบไปทๅฐๆๆถ็็๏ผ%๏ผ+best_sell_price | float | N | ๆ่ต่ ๆไผๅๅบๅ จไปท++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python+pro = ts.pro_api(your token)+#่ทๅๆๅฐๆต้ๅผๅบๅธๆไผๆฅไปท+df = pro.bc_bestotcqt(ts_code='200013.BC',start_date='20240325',end_date='20240329',fields='trade_date,ts_code,name,remain_maturity,best_buy_bank,best_buy_yield,best_sell_bank,best_sell_yield')++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ trade_date ts_code name remain_maturity best_buy_bank best_buy_yield best_sell_bank best_sell_yield+ 0 20240325 200013.BC 20้ๆฏๅฝๅบ13 1ๅนด211ๅคฉ ๅปบ่ฎพ้ถ่ก 1.9041 ๅทฅๅ้ถ่ก 1.9227+ 1 20240326 200013.BC 20้ๆฏๅฝๅบ13 1ๅนด210ๅคฉ ๅทฅๅ้ถ่ก 1.8813 ๅทฅๅ้ถ่ก 1.9133+ 2 20240327 200013.BC 20้ๆฏๅฝๅบ13 1ๅนด209ๅคฉ ๅทฅๅ้ถ่ก 1.8718 ๅทฅๅ้ถ่ก 1.9039+ 3 20240328 200013.BC 20้ๆฏๅฝๅบ13 1ๅนด208ๅคฉ ๅทฅๅ้ถ่ก 1.8623 ๅปบ่ฎพ้ถ่ก 1.8921+ 4 20240329 200013.BC 20้ๆฏๅฝๅบ13 1ๅนด207ๅคฉ ๅทฅๅ้ถ่ก 1.8528 ไบค้้ถ่ก 1.8464\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\205\254\345\213\237\345\237\272\351\207\221/\345\237\272\351\207\221\345\207\200\345\200\274.md" "b/agent/src/skills/tushare/references/\345\205\254\345\213\237\345\237\272\351\207\221/\345\237\272\351\207\221\345\207\200\345\200\274.md"new file mode 100644index 000000000..4b89ccec0--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\205\254\345\213\237\345\237\272\351\207\221/\345\237\272\351\207\221\345\207\200\345\200\274.md"@@ -0,0 +1,58 @@+## ๅ ฌๅๅบ้ๅๅผ+----++ๆฅๅฃ๏ผfund_nav๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆ่ฟฐ๏ผ่ทๅๅ ฌๅๅบ้ๅๅผๆฐๆฎ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | TSๅบ้ไปฃ็ ๏ผไบ้ไธ๏ผ+nav_date | str | N | ๅๅผๆฅๆ ๏ผไบ้ไธ๏ผ+market | str | N | Eๅบๅ Oๅบๅค+start_date | str | N | ๅๅผๅผๅงๆฅๆ+end_date | str | N | ๅๅผ็ปๆๆฅๆ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | TSไปฃ็ +ann_date | str | Y | ๅ ฌๅๆฅๆ+nav_date | str | Y | ๅๅผๆฅๆ+unit_nav | float | Y | ๅไฝๅๅผ+accum_nav | float | Y | ็ดฏ่ฎกๅๅผ+accum_div | float | Y | ็ดฏ่ฎกๅ็บข+net_asset | float | Y | ่ตไบงๅๅผ+total_netasset | float | Y | ๅ่ฎก่ตไบงๅๅผ+adj_nav | float | Y | ๅคๆๅไฝๅๅผ+++**ไปฃ็ ็คบไพ**++```python++pro = ts.pro_api()++df = pro.fund_nav(ts_code='165509.SZ')++```++**ๆฐๆฎ็คบไพ**++ ts_code ann_date nav_date unit_nav accum_nav accum_div \+ 0 165509.SZ 20181019 20181018 1.104 1.587 None+ 1 165509.SZ 20181018 20181017 1.110 1.587 None+ 2 165509.SZ 20181017 20181016 1.110 1.587 None+ 3 165509.SZ 20181016 20181015 1.110 1.587 None+ 4 165509.SZ 20181013 20181012 1.110 1.587 None+ 5 165509.SZ 20181012 20181011 1.110 1.587 None+ 6 165509.SZ 20181011 20181010 1.110 1.587 None+ 7 165509.SZ 20181010 20181009 1.110 1.587 None+ 8 165509.SZ 20181009 20181008 1.109 1.586 None+ 9 165509.SZ 20180929 20180928 1.109 1.586 None+ 10 165509.SZ 20180928 20180927 1.109 1.586 None+diff --git "a/agent/src/skills/tushare/references/\345\205\254\345\213\237\345\237\272\351\207\221/\345\237\272\351\207\221\345\210\206\347\272\242.md" "b/agent/src/skills/tushare/references/\345\205\254\345\213\237\345\237\272\351\207\221/\345\237\272\351\207\221\345\210\206\347\272\242.md"new file mode 100644index 000000000..92ed9b03d--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\205\254\345\213\237\345\237\272\351\207\221/\345\237\272\351\207\221\345\210\206\347\272\242.md"@@ -0,0 +1,70 @@+## ๅ ฌๅๅบ้ๅ็บข+----++ๆฅๅฃ๏ผfund_div+ๆ่ฟฐ๏ผ่ทๅๅ ฌๅๅบ้ๅ็บขๆฐๆฎ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ400็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ann_date | str | N | ๅ ฌๅๆฅ๏ผไปฅไธๅๆฐๅ้ไธ๏ผ+ex_date | str | N | ้คๆฏๆฅ+pay_date | str | N | ๆดพๆฏๆฅ+ts_code | str | N | ๅบ้ไปฃ็ +++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | TSไปฃ็ +ann_date | str | Y | ๅ ฌๅๆฅๆ+imp_anndate | str | Y | ๅ็บขๅฎๆฝๅ ฌๅๆฅ+base_date | str | Y | ๅ้ ๆถ็ๅบๅๆฅ+div_proc | str | Y | ๆนๆก่ฟๅบฆ+record_date | str | Y | ๆ็็ป่ฎฐๆฅ+ex_date | str | Y | ้คๆฏๆฅ+pay_date | str | Y | ๆดพๆฏๆฅ+earpay_date | str | Y | ๆถ็ๆฏไปๆฅ+net_ex_date | str | Y | ๅๅผ้คๆๆฅ+div_cash | float | Y | ๆฏ่กๆดพๆฏ(ๅ )+base_unit | float | Y | ๅบๅๅบ้ไปฝ้ข(ไธไปฝ)+ear_distr | float | Y | ๅฏๅ้ ๆถ็(ๅ )+ear_amount | float | Y | ๆถ็ๅ้ ้้ข(ๅ )+account_date | str | Y | ็บขๅฉๅๆ่ตๅฐ่ดฆๆฅ+base_year | str | Y | ไปฝ้ขๅบๅๅนดๅบฆ+++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++df = pro.fund_div(ann_date='20181018')++```++**ๆฐๆฎ็คบไพ**++ ts_code ann_date imp_anndate base_date div_proc record_date ex_date \+ 0 161618.OF 20181018 20181018 20180928 ๅฎๆฝ 20181022 20181022+ 1 161619.OF 20181018 20181018 20180928 ๅฎๆฝ 20181022 20181022+ 2 005485.OF 20181018 20181018 20181015 ๅฎๆฝ 20181022 20181022+ 3 519330.OF 20181018 20181018 20181012 ๅฎๆฝ 20181022 20181022+ 4 519331.OF 20181018 20181018 20181012 ๅฎๆฝ 20181022 20181022+ 5 164702.SZ 20181018 20181018 20180930 ๅฎๆฝ 20181022 20181023+ 6 005068.OF 20181018 20181018 20181016 ๅฎๆฝ 20181022 20181022+ 7 519953.OF 20181018 20181018 20181016 ๅฎๆฝ 20181022 20181022++ pay_date earpay_date net_ex_date div_cash base_unit ear_distr \+ 0 20181024 None None 0.0170 14982.2740 5018943.83+ 1 20181024 None None 0.0150 2894.7015 823800.02+ 2 20181024 None None 0.0180 101004.4450 18689411.19+ 3 20181024 None None 0.0060 219742.3332 65922699.95+ 4 20181024 None None 0.0050 4.8656 1216.42+ 5 20181024 None None 0.0150 41287.3653 8058271.35+ 6 20181024 None None 0.0237 4953.9392 1174773.90+ 7 20181024 None None 0.0191 23038.2415 4408682.75\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\205\254\345\213\237\345\237\272\351\207\221/\345\237\272\351\207\221\345\210\227\350\241\250.md" "b/agent/src/skills/tushare/references/\345\205\254\345\213\237\345\237\272\351\207\221/\345\237\272\351\207\221\345\210\227\350\241\250.md"new file mode 100644index 000000000..ccf156a71--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\205\254\345\213\237\345\237\272\351\207\221/\345\237\272\351\207\221\345\210\227\350\241\250.md"@@ -0,0 +1,69 @@+## ๅ ฌๅๅบ้ๅ่กจ+----++ๆฅๅฃ๏ผfund_basic๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆ่ฟฐ๏ผ่ทๅๅ ฌๅๅบ้ๆฐๆฎๅ่กจ๏ผๅ ๆฌๅบๅ ๅๅบๅคๅบ้+็งฏๅ๏ผ็จๆท้่ฆ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅๆฌกๆๅคงๅฏไปฅๆๅ15000ๆกๆฐๆฎ๏ผ5000็งฏๅไปฅไธๆ้ๆด้ซ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ๅบ้ไปฃ็ +market | str | N | ไบคๆๅธๅบ: Eๅบๅ Oๅบๅค๏ผ้ป่ฎคE๏ผ+status | str | N | ๅญ็ปญ็ถๆ Dๆ็ Iๅ่ก Lไธๅธไธญ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ๅบ้ไปฃ็ +name | str | Y | ็ฎ็งฐ+management | str | Y | ็ฎก็ไบบ+custodian | str | Y | ๆ็ฎกไบบ+fund_type | str | Y | ๆ่ต็ฑปๅ+found_date | str | Y | ๆ็ซๆฅๆ+due_date | str | Y | ๅฐๆๆฅๆ+list_date | str | Y | ไธๅธๆถ้ด+issue_date | str | Y | ๅ่กๆฅๆ+delist_date | str | Y | ้ๅธๆฅๆ+issue_amount | float | Y | ๅ่กไปฝ้ข(ไบฟ)+m_fee | float | Y | ็ฎก็่ดน+c_fee | float | Y | ๆ็ฎก่ดน+duration_year | float | Y | ๅญ็ปญๆ+p_value | float | Y | ้ขๅผ+min_amount | float | Y | ่ตท็น้้ข(ไธๅ )+exp_return | float | Y | ้ขๆๆถ็็+benchmark | str | Y | ไธ็ปฉๆฏ่พๅบๅ+status | str | Y | ๅญ็ปญ็ถๆDๆ็ Iๅ่ก Lๅทฒไธๅธ+invest_type | str | Y | ๆ่ต้ฃๆ ผ+type | str | Y | ๅบ้็ฑปๅ+trustee | str | Y | ๅๆไบบ+purc_startdate | str | Y | ๆฅๅธธ็ณ่ดญ่ตทๅงๆฅ+redm_startdate | str | Y | ๆฅๅธธ่ตๅ่ตทๅงๆฅ+market | str | Y | Eๅบๅ Oๅบๅค+++**ๆฅๅฃ็จไพ**++```python++pro = ts.pro_api()++df = pro.fund_basic(market='E')++```++**ๆฐๆฎๆ ทไพ**++ ts_code name management custodian fund_type found_date \+ 1 512850.SH ไธญไฟกๅปบๆๅไบฌ50ETF ไธญไฟกๅปบๆๅบ้ ๆๅ้ถ่ก ่ก็ฅจๅ 20180927+ 2 168601.SZ ๆฑๅฎ่ฃ้ณไธๅนดๅฎๆๅผๆพ ๆฑๅฎๅบ้ ไธญๅฝๅ ๅคง้ถ่ก ๆททๅๅ 20180927+ 3 512860.SH ๅๅฎไธญๅฝA่กETF ๅๅฎๅบ้ ไธญๅฝๅไธ้ถ่ก ่ก็ฅจๅ 20180927+ 4 159960.SZ ๆ็ๅฝไผ ๅนณๅฎๅคงๅๅบ้ ไธญๅฝ้ถ่ก ่ก็ฅจๅ 20180921+ 5 501062.SH ๅๆน็ๅไธๅนด ๅๆนๅบ้ ไธญๅฝๅปบ่ฎพ้ถ่ก ๆททๅๅ 20180906+ 6 510600.SH ๆฒช50ETF ็ณไธ่ฑไฟกๅบ้ ไธญๅฝๅทฅๅ้ถ่ก ่ก็ฅจๅ 20180903+ 7 501061.SH ้้300C ไธญ้ๅบ้ ไธญๅฝๅปบ่ฎพ้ถ่ก ่ก็ฅจๅ 20180830+ 8 501060.SH ้้300A ไธญ้ๅบ้ ไธญๅฝๅปบ่ฎพ้ถ่ก ่ก็ฅจๅ 20180830+ 9 166802.SZ ๆตๅ300 ๆตๅๅบ้ ๅๅค้ถ่ก ่ก็ฅจๅ 20180820\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\205\254\345\213\237\345\237\272\351\207\221/\345\237\272\351\207\221\346\212\200\346\234\257\351\235\242\345\233\240\345\255\220(\344\270\223\344\270\232\347\211\210).md" "b/agent/src/skills/tushare/references/\345\205\254\345\213\237\345\237\272\351\207\221/\345\237\272\351\207\221\346\212\200\346\234\257\351\235\242\345\233\240\345\255\220(\344\270\223\344\270\232\347\211\210).md"new file mode 100644index 000000000..d947f602e--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\205\254\345\213\237\345\237\272\351\207\221/\345\237\272\351\207\221\346\212\200\346\234\257\351\235\242\345\233\240\345\255\220(\344\270\223\344\270\232\347\211\210).md"@@ -0,0 +1,113 @@+## ๅบๅ ๅบ้ๆๆฏๅ ๅญ(ไธไธ็)+----++ๆฅๅฃ๏ผfund_factor_pro+ๆ่ฟฐ๏ผ่ทๅๅบๅ ๅบ้ๆฏๆฅๆๆฏ้ขๅ ๅญๆฐๆฎ๏ผ็จไบ่ท่ธชๅบๅ ๅบ้ๅฝๅ่ตฐๅฟๆ ๅต๏ผๆฐๆฎ็ฑTushare็คพๅบ่ชไบง๏ผ่ฆ็ๅ จๅๅฒ๏ผ่พๅบๅๆฐ_bfq่กจ็คบไธๅคๆ๏ผๆ่ฟฐไธญ่ฏดๆไบๅ ๅญ็้ป่ฎคไผ ๅ๏ผๅฆ้่ฆ็นๆฎๅๆฐๆ่ ๆดๅคๅ ๅญๅฏไปฅ่็ณป็ฎก็ๅ่ฏไผฐ+้้๏ผๅๆฌกๆๅคง8000+็งฏๅ๏ผ5000็งฏๅๆฏๅ้ๅฏไปฅ่ฏทๆฑ30ๆฌก๏ผ8000็งฏๅไปฅไธๆฏๅ้500ๆฌก++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ๅบ้ไปฃ็ +start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+trade_date | str | N | ไบคๆๆฅๆ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ๅบ้ไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+trade_date_doris | None | Y | ๆฅๆ+open | float | Y | ๅผ็ไปท+high | float | Y | ๆ้ซไปท+low | float | Y | ๆไฝไปท+close | float | Y | ๆถ็ไปท+pre_close | float | Y | ๆจๆถไปท+change | float | Y | ๆถจ่ท้ข+pct_change | float | Y | ๆถจ่ทๅน ๏ผๆชๅคๆ๏ผๅฆๆๆฏๅคๆ่ฏท็จย ้็จ่กๆ ๆฅๅฃย ๏ผ+vol | float | Y | ๆไบค้ ๏ผๆ๏ผ+amount | float | Y | ๆไบค้ข ๏ผๅๅ ๏ผ+asi_bfq | float | Y | ๆฏๅจๅ้ๆๆ -OPEN, CLOSE, HIGH, LOW, M1=26, M2=10+asit_bfq | float | Y | ๆฏๅจๅ้ๆๆ -OPEN, CLOSE, HIGH, LOW, M1=26, M2=10+atr_bfq | float | Y | ็ๅฎๆณขๅจNๆฅๅนณๅๅผ-CLOSE, HIGH, LOW, N=20+bbi_bfq | float | Y | BBIๅค็ฉบๆๆ -CLOSE, M1=3, M2=6, M3=12, M4=20+bias1_bfq | float | Y | BIASไน็ฆป็-CLOSE, L1=6, L2=12, L3=24+bias2_bfq | float | Y | BIASไน็ฆป็-CLOSE, L1=6, L2=12, L3=24+bias3_bfq | float | Y | BIASไน็ฆป็-CLOSE, L1=6, L2=12, L3=24+boll_lower_bfq | float | Y | BOLLๆๆ ๏ผๅธๆๅธฆ-CLOSE, N=20, P=2+boll_mid_bfq | float | Y | BOLLๆๆ ๏ผๅธๆๅธฆ-CLOSE, N=20, P=2+boll_upper_bfq | float | Y | BOLLๆๆ ๏ผๅธๆๅธฆ-CLOSE, N=20, P=2+brar_ar_bfq | float | Y | BRARๆ ็ปชๆๆ -OPEN, CLOSE, HIGH, LOW, M1=26+brar_br_bfq | float | Y | BRARๆ ็ปชๆๆ -OPEN, CLOSE, HIGH, LOW, M1=26+cci_bfq | float | Y | ้กบๅฟๆๆ ๅๅซCCIๆๆ -CLOSE, HIGH, LOW, N=14+cr_bfq | float | Y | CRไปทๆ ผๅจ้ๆๆ -CLOSE, HIGH, LOW, N=20+dfma_dif_bfq | float | Y | ๅนณ่ก็บฟๅทฎๆๆ -CLOSE, N1=10, N2=50, M=10+dfma_difma_bfq | float | Y | ๅนณ่ก็บฟๅทฎๆๆ -CLOSE, N1=10, N2=50, M=10+dmi_adx_bfq | float | Y | ๅจๅๆๆ -CLOSE, HIGH, LOW, M1=14, M2=6+dmi_adxr_bfq | float | Y | ๅจๅๆๆ -CLOSE, HIGH, LOW, M1=14, M2=6+dmi_mdi_bfq | float | Y | ๅจๅๆๆ -CLOSE, HIGH, LOW, M1=14, M2=6+dmi_pdi_bfq | float | Y | ๅจๅๆๆ -CLOSE, HIGH, LOW, M1=14, M2=6+downdays | float | Y | ่ฟ่ทๅคฉๆฐ+updays | float | Y | ่ฟๆถจๅคฉๆฐ+dpo_bfq | float | Y | ๅบ้ด้่ก็บฟ-CLOSE, M1=20, M2=10, M3=6+madpo_bfq | float | Y | ๅบ้ด้่ก็บฟ-CLOSE, M1=20, M2=10, M3=6+ema_bfq_10 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=10+ema_bfq_20 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=20+ema_bfq_250 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=250+ema_bfq_30 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=30+ema_bfq_5 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=5+ema_bfq_60 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=60+ema_bfq_90 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=90+emv_bfq | float | Y | ็ฎๆๆณขๅจๆๆ -HIGH, LOW, VOL, N=14, M=9+maemv_bfq | float | Y | ็ฎๆๆณขๅจๆๆ -HIGH, LOW, VOL, N=14, M=9+expma_12_bfq | float | Y | EMAๆๆฐๅนณๅๆฐๆๆ -CLOSE, N1=12, N2=50+expma_50_bfq | float | Y | EMAๆๆฐๅนณๅๆฐๆๆ -CLOSE, N1=12, N2=50+kdj_bfq | float | Y | KDJๆๆ -CLOSE, HIGH, LOW, N=9, M1=3, M2=3+kdj_d_bfq | float | Y | KDJๆๆ -CLOSE, HIGH, LOW, N=9, M1=3, M2=3+kdj_k_bfq | float | Y | KDJๆๆ -CLOSE, HIGH, LOW, N=9, M1=3, M2=3+ktn_down_bfq | float | Y | ่ฏ็น็บณไบคๆ้้, N้20ๆฅ๏ผATR้10ๆฅ-CLOSE, HIGH, LOW, N=20, M=10+ktn_mid_bfq | float | Y | ่ฏ็น็บณไบคๆ้้, N้20ๆฅ๏ผATR้10ๆฅ-CLOSE, HIGH, LOW, N=20, M=10+ktn_upper_bfq | float | Y | ่ฏ็น็บณไบคๆ้้, N้20ๆฅ๏ผATR้10ๆฅ-CLOSE, HIGH, LOW, N=20, M=10+lowdays | float | Y | LOWRANGE(LOW)่กจ็คบๅฝๅๆไฝไปทๆฏ่ฟๅคๅฐๅจๆๅ ๆไฝไปท็ๆๅฐๅผ+topdays | float | Y | TOPRANGE(HIGH)่กจ็คบๅฝๅๆ้ซไปทๆฏ่ฟๅคๅฐๅจๆๅ ๆ้ซไปท็ๆๅคงๅผ+ma_bfq_10 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=10+ma_bfq_20 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=20+ma_bfq_250 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=250+ma_bfq_30 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=30+ma_bfq_5 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=5+ma_bfq_60 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=60+ma_bfq_90 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=90+macd_bfq | float | Y | MACDๆๆ -CLOSE, SHORT=12, LONG=26, M=9+macd_dea_bfq | float | Y | MACDๆๆ -CLOSE, SHORT=12, LONG=26, M=9+macd_dif_bfq | float | Y | MACDๆๆ -CLOSE, SHORT=12, LONG=26, M=9+mass_bfq | float | Y | ๆข ๆฏ็บฟ-HIGH, LOW, N1=9, N2=25, M=6+ma_mass_bfq | float | Y | ๆข ๆฏ็บฟ-HIGH, LOW, N1=9, N2=25, M=6+mfi_bfq | float | Y | MFIๆๆ ๆฏๆไบค้็RSIๆๆ -CLOSE, HIGH, LOW, VOL, N=14+mtm_bfq | float | Y | ๅจ้ๆๆ -CLOSE, N=12, M=6+mtmma_bfq | float | Y | ๅจ้ๆๆ -CLOSE, N=12, M=6+obv_bfq | float | Y | ่ฝ้ๆฝฎๆๆ -CLOSE, VOL+psy_bfq | float | Y | ๆ่ต่ ๅฏน่กๅธๆถจ่ทไบง็ๅฟ็ๆณขๅจ็ๆ ็ปชๆๆ -CLOSE, N=12, M=6+psyma_bfq | float | Y | ๆ่ต่ ๅฏน่กๅธๆถจ่ทไบง็ๅฟ็ๆณขๅจ็ๆ ็ปชๆๆ -CLOSE, N=12, M=6+roc_bfq | float | Y | ๅๅจ็ๆๆ -CLOSE, N=12, M=6+maroc_bfq | float | Y | ๅๅจ็ๆๆ -CLOSE, N=12, M=6+rsi_bfq_12 | float | Y | RSIๆๆ -CLOSE, N=12+rsi_bfq_24 | float | Y | RSIๆๆ -CLOSE, N=24+rsi_bfq_6 | float | Y | RSIๆๆ -CLOSE, N=6+taq_down_bfq | float | Y | ๅๅฎๅฅ้้(ๆตท้พ)ไบคๆๆๆ -HIGH, LOW, 20+taq_mid_bfq | float | Y | ๅๅฎๅฅ้้(ๆตท้พ)ไบคๆๆๆ -HIGH, LOW, 20+taq_up_bfq | float | Y | ๅๅฎๅฅ้้(ๆตท้พ)ไบคๆๆๆ -HIGH, LOW, 20+trix_bfq | float | Y | ไธ้ๆๆฐๅนณๆปๅนณๅ็บฟ-CLOSE, M1=12, M2=20+trma_bfq | float | Y | ไธ้ๆๆฐๅนณๆปๅนณๅ็บฟ-CLOSE, M1=12, M2=20+vr_bfq | float | Y | VRๅฎน้ๆฏ็-CLOSE, VOL, M1=26+wr_bfq | float | Y | W&R ๅจๅปๆๆ -CLOSE, HIGH, LOW, N=10, N1=6+wr1_bfq | float | Y | W&R ๅจๅปๆๆ -CLOSE, HIGH, LOW, N=10, N1=6+xsii_td1_bfq | float | Y | ่ๆฏ้้II-CLOSE, HIGH, LOW, N=102, M=7+xsii_td2_bfq | float | Y | ่ๆฏ้้II-CLOSE, HIGH, LOW, N=102, M=7+xsii_td3_bfq | float | Y | ่ๆฏ้้II-CLOSE, HIGH, LOW, N=102, M=7+xsii_td4_bfq | float | Y | ่ๆฏ้้II-CLOSE, HIGH, LOW, N=102, M=7+diff --git "a/agent/src/skills/tushare/references/\345\205\254\345\213\237\345\237\272\351\207\221/\345\237\272\351\207\221\346\214\201\344\273\223.md" "b/agent/src/skills/tushare/references/\345\205\254\345\213\237\345\237\272\351\207\221/\345\237\272\351\207\221\346\214\201\344\273\223.md"new file mode 100644index 000000000..1055a3e63--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\205\254\345\213\237\345\237\272\351\207\221/\345\237\272\351\207\221\346\214\201\344\273\223.md"@@ -0,0 +1,71 @@+## ๅ ฌๅๅบ้ๆไปๆฐๆฎ+----++ๆฅๅฃ๏ผfund_portfolio+ๆ่ฟฐ๏ผ่ทๅๅ ฌๅๅบ้ๆไปๆฐๆฎ๏ผๅญฃๅบฆๆดๆฐ+็งฏๅ๏ผ5000็งฏๅไปฅไธๆฏๅ้่ฏทๆฑ200ๆฌก๏ผ8000็งฏๅไปฅไธๆฏๅ้่ฏทๆฑ500ๆฌก๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)+++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ๅบ้ไปฃ็ (ts_code,ann_date,period่ณๅฐ่พๅ ฅไธไธชๅๆฐ)+symbol | str | N | ่ก็ฅจไปฃ็ +ann_date | str | N | ๅ ฌๅๆฅๆ๏ผYYYYMMDDๆ ผๅผ๏ผ+period | str | N | ๅญฃๅบฆ๏ผๆฏไธชๅญฃๅบฆๆๅไธๅคฉ็ๆฅๆ๏ผๆฏๅฆ20131231่กจ็คบ2013ๅนดๅนดๆฅ๏ผ+start_date | str | N | ๆฅๅๆๅผๅงๆฅๆ๏ผYYYYMMDDๆ ผๅผ๏ผ+end_date | str | N | ๆฅๅๆ็ปๆๆฅๆ๏ผYYYYMMDDๆ ผๅผ๏ผ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | TSๅบ้ไปฃ็ +ann_date | str | Y | ๅ ฌๅๆฅๆ+end_date | str | Y | ๆชๆญขๆฅๆ+symbol | str | Y | ่ก็ฅจไปฃ็ +mkv | float | Y | ๆๆ่ก็ฅจๅธๅผ(ๅ )+amount | float | Y | ๆๆ่ก็ฅจๆฐ้๏ผ่ก๏ผ+stk_mkv_ratio | float | Y | ๅ ่ก็ฅจๅธๅผๆฏ+stk_float_ratio | float | Y | ๅ ๆต้่กๆฌๆฏไพ+++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++df = pro.fund_portfolio(ts_code='001753.OF')++```++**ๆฐๆฎ็คบไพ**++ ts_code ann_date end_date symbol mkv amount \+ 0 001753.OF 20180823 20180630 603019.SH 3130994.46 68258.0+ 1 001753.OF 20180718 20180630 600845.SH 3594140.00 136400.0+ 2 001753.OF 20180718 20180630 600596.SH 5428107.30 335690.0+ 3 001753.OF 20180718 20180630 600588.SH 3811672.65 155515.0+ 4 001753.OF 20180718 20180630 600271.SH 3770284.00 149200.0+ 5 001753.OF 20180823 20180630 300616.SZ 10900.00 100.0+ 6 001753.OF 20180718 20180630 300577.SZ 4544793.54 110257.0+ 7 001753.OF 20180718 20180630 300476.SZ 3783780.00 245700.0+ 8 001753.OF 20180823 20180630 300409.SZ 2895942.00 72200.0+ 9 001753.OF 20180718 20180630 300208.SZ 5768280.00 588000.0+ 10 001753.OF 20180823 20180630 300188.SZ 2535922.50 138575.0++ stk_mkv_ratio stk_float_ratio+ 0 4.37 0.01+ 1 5.02 0.02+ 2 7.57 0.05+ 3 5.32 0.01+ 4 5.26 0.01+ 5 0.02 0.00+ 6 6.34 0.17+ 7 5.28 0.07+ 8 4.04 0.05+ 9 8.05 0.10+ 10 3.54 0.03\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\205\254\345\213\237\345\237\272\351\207\221/\345\237\272\351\207\221\347\256\241\347\220\206\344\272\272.md" "b/agent/src/skills/tushare/references/\345\205\254\345\213\237\345\237\272\351\207\221/\345\237\272\351\207\221\347\256\241\347\220\206\344\272\272.md"new file mode 100644index 000000000..8282ee3cc--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\205\254\345\213\237\345\237\272\351\207\221/\345\237\272\351\207\221\347\256\241\347\220\206\344\272\272.md"@@ -0,0 +1,60 @@+## ๅ ฌๅๅบ้ๅ ฌๅธ+----++ๆฅๅฃ๏ผfund_company+ๆ่ฟฐ๏ผ่ทๅๅ ฌๅๅบ้็ฎก็ไบบๅ่กจ+็งฏๅ๏ผ็จๆท้่ฆ1500็งฏๅๆๅฏไปฅ่ฐๅ๏ผไธๆฌกๅฏไปฅๆๅๅ จ้จๆฐๆฎใๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๆ ๏ผๅฏๆๅๅ จ้จ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+name | str | Y | ๅบ้ๅ ฌๅธๅ็งฐ+shortname | str | Y | ็ฎ็งฐ+short_enname | str | N | ่ฑๆ็ผฉๅ+province | str | Y | ็ไปฝ+city | str | Y | ๅๅธ+address | str | Y | ๆณจๅๅฐๅ+phone | str | Y | ็ต่ฏ+office | str | Y | ๅๅ ฌๅฐๅ+website | str | Y | ๅ ฌๅธ็ฝๅ+chairman | str | Y | ๆณไบบไปฃ่กจ+manager | str | Y | ๆป็ป็+reg_capital | float | Y | ๆณจๅ่ตๆฌ+setup_date | str | Y | ๆ็ซๆฅๆ+end_date | str | Y | ๅ ฌๅธ็ปๆญขๆฅๆ+employees | float | Y | ๅๅทฅๆปๆฐ+main_business | str | Y | ไธป่ฆไบงๅๅไธๅก+org_code | str | Y | ็ป็ปๆบๆไปฃ็ +credit_code | str | Y | ็ปไธ็คพไผไฟก็จไปฃ็ ++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++df = pro.fund_company()++```++**ๆฐๆฎ็คบไพ**++ name shortname province city \+ 0 ๅไบฌๅนฟ่ฝๆ่ตๅบ้็ฎก็ๆ้ๅ ฌๅธ ๅนฟ่ฝๅบ้ ๅไบฌ ๅไบฌๅธ+ 1 ๅนณๅฎ้ถ่ก่กไปฝๆ้ๅ ฌๅธ ๅนณๅฎ้ถ่ก ๅนฟไธ ๆทฑๅณๅธ+ 2 ๅฎๆบ่ฏๅธ่กไปฝๆ้ๅ ฌๅธ ๅฎๆบ่ฏๅธ ๆฐ็ ไน้ฒๆจ้ฝๅธ+ 3 ้่ฅฟ็ๅฝ้ ไฟกๆ่กไปฝๆ้ๅ ฌๅธ ้ๅฝๆ ้่ฅฟ ่ฅฟๅฎๅธ+ 4 ไธๅ่ฏๅธ่กไปฝๆ้ๅ ฌๅธ ไธๅ่ฏๅธ ๅๆ ้ฟๆฅๅธ+ 5 ๅฝๅ ่ฏๅธ่กไปฝๆ้ๅ ฌๅธ ๅฝๅ ่ฏๅธ ๅฎๅพฝ ๅ่ฅๅธ+ 6 ๅฝๆตท่ฏๅธ่กไปฝๆ้ๅ ฌๅธ ๅฝๆตท่ฏๅธ ๅนฟ่ฅฟ ๆกๆๅธ+ 7 ๅนฟๅ่ฏๅธ่กไปฝๆ้ๅ ฌๅธ ๅนฟๅ่ฏๅธ ๅนฟไธ ๅนฟๅทๅธ+ 8 ้ฟๆฑ่ฏๅธ่กไปฝๆ้ๅ ฌๅธ ้ฟๆฑ่ฏๅธ ๆนๅ ๆญฆๆฑๅธ+ 9 ไธๆตทๆตฆไธๅๅฑ้ถ่ก่กไปฝๆ้ๅ ฌๅธ ๆตฆๅ้ถ่ก ไธๆตท ไธๆตทๅธ+ 10 ไธๆน้้ฐ่กไปฝๆ้ๅ ฌๅธ ไธๆน้้ฐ ๆนๅ ้ๅทๅธ+ 11 ๅฝ้่ฏๅธ่กไปฝๆ้ๅ ฌๅธ ๅฝ้่ฏๅธ ๅๅท ๆ้ฝๅธdiff --git "a/agent/src/skills/tushare/references/\345\205\254\345\213\237\345\237\272\351\207\221/\345\237\272\351\207\221\347\273\217\347\220\206.md" "b/agent/src/skills/tushare/references/\345\205\254\345\213\237\345\237\272\351\207\221/\345\237\272\351\207\221\347\273\217\347\220\206.md"new file mode 100644index 000000000..0561745ca--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\205\254\345\213\237\345\237\272\351\207\221/\345\237\272\351\207\221\347\273\217\347\220\206.md"@@ -0,0 +1,65 @@+## ๅบ้็ป็+----++ๆฅๅฃ๏ผfund_manager+ๆ่ฟฐ๏ผ่ทๅๅ ฌๅๅบ้็ป็ๆฐๆฎ๏ผๅ ๆฌๅบ้็ป็็ฎๅ็ญๆฐๆฎ+้้๏ผๅๆฌกๆๅคง5000๏ผๆฏๆๅ้กตๆๅๆฐๆฎ+็งฏๅ๏ผ็จๆทๆ500็งฏๅๅฏ่ทๅๆฐๆฎ๏ผ2000็งฏๅไปฅไธๅฏไปฅๆ้ซ่ฎฟ้ฎ้ขๆฌก++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ๅบ้ไปฃ็ ๏ผๆฏๆๅคๅชๅบ้๏ผ้ๅทๅ้+ann_date | str | N | ๅ ฌๅๆฅๆ๏ผๆ ผๅผ๏ผYYYYMMDD+name | str | N | ๅบ้็ป็ๅงๅ+offset | intint | N | ๅผๅง่กๆฐ+limit | int | N | ๆฏ้กต่กๆฐ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ๅบ้ไปฃ็ +ann_date | str | Y | ๅ ฌๅๆฅๆ+name | str | Y | ๅบ้็ป็ๅงๅ+gender | str | Y | ๆงๅซ+birth_year | str | Y | ๅบ็ๅนดไปฝ+edu | str | Y | ๅญฆๅ+nationality | str | Y | ๅฝ็ฑ+begin_date | str | Y | ไปป่ๆฅๆ+end_date | str | Y | ็ฆปไปปๆฅๆ+resume | str | Y | ็ฎๅ++<br>+<br>++**ไปฃ็ ็คบไพ**++```python+#ๅๅงๆฅๅฃ+pro = ts.pro_api()++#ๅๅชๅบ้+df = pro.fund_manager(ts_code='150018.SZ')++#ๅคๅชๅบ้+df = pro.fund_manager(ts_code='150018.SZ,150008.SZ')++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code ann_date name gender birth_year edu nationality begin_date end_date resume+ 0 150018.SZ 20100508 ๅจๆฏ M None ็กๅฃซ ็พๅฝ 20100507 None CFA๏ผ็กๅฃซๅญฆไฝ๏ผๆฏไธไบๅไบฌๅคงๅญฆ๏ผ็พๅฝๅๅก็ฝ่ฑ็บณๅคงๅญฆ๏ผ็พๅฝ็บฆ็ฟฐ้ๆฎ้ๆฏๅคงๅญฆใๆพไปป็พๅฝๆฎๅๆฐธ้...+ 1 150018.SZ 20190831 ๅผ ๅฏ M None ็กๅฃซ ไธญๅฝ 20190829 None CFA๏ผ็กๅฃซๅญฆไฝ๏ผๆฏไธไบๆธ ๅๅคงๅญฆใ2009ๅนด7ๆๅ ็้ถๅๅบ้็ฎก็ๆ้ๅ ฌๅธ๏ผไปไบ้ๅ็ญ็ฅ็ ๅๅ...+ 2 150018.SZ 20100927 ่ทฏๅฟๅ M 1969 ๅๅฃซ ไธญๅฝ 20100507 20100927 ๆจๅๅคงๅญฆ้่ๅญฆๅๅฃซใๆพไปปๅนฟไธๅปบ่ฎพๅฎไธ้ๅขๅ ฌๅธ่ดขๅกไธป็ฎก๏ผๅนฟๅท่ฏๅธๆ้ๅ ฌๅธๅ่ก้จใ่ฅไธ้จ็ป็๏ผ้...\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\205\254\345\213\237\345\237\272\351\207\221/\345\237\272\351\207\221\350\247\204\346\250\241.md" "b/agent/src/skills/tushare/references/\345\205\254\345\213\237\345\237\272\351\207\221/\345\237\272\351\207\221\350\247\204\346\250\241.md"new file mode 100644index 000000000..03a5f9bf8--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\205\254\345\213\237\345\237\272\351\207\221/\345\237\272\351\207\221\350\247\204\346\250\241.md"@@ -0,0 +1,72 @@+## ๅบ้่งๆจกๆฐๆฎ+----++ๆฅๅฃ๏ผfund_share๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆ่ฟฐ๏ผ่ทๅๅบ้่งๆจกๆฐๆฎ๏ผๅ ๅซไธๆตทๅๆทฑๅณETFๅบ้+้้๏ผๅๆฌกๆๅคงๆๅ2000่กๆฐๆฎ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ2000็งฏๅๅฏไปฅ่ฐๅ๏ผ5000็งฏๅไปฅไธ้ขๆฌก่พ้ซ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | TSๅบ้ไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+market | str | N | ๅธๅบไปฃ็ ๏ผSHไธไบคๆ ๏ผSZๆทฑไบคๆ๏ผ++<br>+<br>++++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ๅบ้ไปฃ็ ๏ผๆฏๆๅคๅชๅบ้ๅๆถๆๅ๏ผ็จ้ๅทๅ้+trade_date | str | Y | ไบคๆ๏ผๅๅจ๏ผๆฅๆ๏ผๆ ผๅผYYYYMMDD+fd_share | float | Y | ๅบ้ไปฝ้ข๏ผไธ๏ผ++++<br>+<br>++**ไปฃ็ ็คบไพ**++```python+#ๅๅงๆฅๅฃ+pro = ts.pro_api()++#ๅๅชๅบ้+df = pro.fund_share(ts_code='150018.SZ')++#ๅคๅชๅบ้+df = pro.fund_share(ts_code='150018.SZ,150008.SZ')++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code trade_date fd_share+ 0 150018.SZ 20200214 206733.2898+ 1 150018.SZ 20200213 209274.0911+ 2 150018.SZ 20200212 211859.8666+ 3 150018.SZ 20200211 215224.2959+ 4 150018.SZ 20200210 216739.3881+ ... ... ... ...+ 1995 150018.SZ 20111129 319525.0658+ 1996 150018.SZ 20111128 317324.2829+ 1997 150018.SZ 20111125 317324.2131+ 1998 150018.SZ 20111124 316113.2233+ 1999 150018.SZ 20111123 314305.3576++diff --git "a/agent/src/skills/tushare/references/\345\244\226\346\261\207\346\225\260\346\215\256/\345\244\226\346\261\207\345\237\272\347\241\200\344\277\241\346\201\257(\346\265\267\345\244\226).md" "b/agent/src/skills/tushare/references/\345\244\226\346\261\207\346\225\260\346\215\256/\345\244\226\346\261\207\345\237\272\347\241\200\344\277\241\346\201\257(\346\265\267\345\244\226).md"new file mode 100644index 000000000..3724672a0--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\244\226\346\261\207\346\225\260\346\215\256/\345\244\226\346\261\207\345\237\272\347\241\200\344\277\241\346\201\257(\346\265\267\345\244\226).md"@@ -0,0 +1,87 @@+## ๅคๆฑๅบ็กไฟกๆฏ๏ผๆตทๅค๏ผ+----++ๆฅๅฃ๏ผfx_obasic+ๆ่ฟฐ๏ผ่ทๅๆตทๅคๅคๆฑๅบ็กไฟกๆฏ๏ผ็ฎๅๅชๆFXCMไบคๆๅ็ๆฐๆฎ+ๆฐ้๏ผๅๆฌกๅฏๆๅๅ จ้จๆฐๆฎ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+exchange | str | N | ไบคๆๅ+classify | str | N | ๅ็ฑป+ts_code | str | N | TSไปฃ็ ++<br>+<br>++classifyๅ็ฑป่ฏดๆ++ๅบๅท|ๅ็ฑปไปฃ็ |ๅ็ฑปๅ็งฐ|ๆ ทไพ+---- | ----- | ---- | ----+1 | FX | ๅคๆฑ่ดงๅธๅฏน | USDCNH๏ผ็พๅ ไบบๆฐๅธๅฏน๏ผ+2 | INDEX | ๆๆฐ | US30๏ผ็พๅฝ้็ผๆฏๅทฅไธๅนณๅๆๆฐ๏ผ+3 | COMMODITY | ๅคงๅฎๅๅ | SOYF๏ผๅคง่ฑ๏ผ+4 | METAL | ้ๅฑ | XAUUSD ๏ผ้ป้๏ผ+5 | BUND | ๅฝๅบๅบๅธ | Bund๏ผ้ฟๆๆฌงๅ ๅบๅธ๏ผ+6 | CRYPTO | ๅ ๅฏๆฐๅญ่ดงๅธ | BTCUSD (ๆฏ็นๅธ)+7 | FX_BASKET | ๅคๆฑ็ฏฎๅญ | USDOLLAR ๏ผ็พๅ ๆๆฐ๏ผ+++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ๅคๆฑไปฃ็ +name | str | Y | ๅ็งฐ+classify | str | Y | ๅ็ฑป+exchange | str | Y | ไบคๆๅ+min_unit | float | Y | ๆๅฐไบคๆๅไฝ+max_unit | float | Y | ๆๅคงไบคๆๅไฝ+pip | float | Y | ็น+pip_cost | float | Y | ็นๅผ+traget_spread | float | Y | ็ฎๆ ๅทฎไปท+min_stop_distance | float | Y | ๆๅฐๆญขๆ่ท็ฆป๏ผ็นๅญ๏ผ+trading_hours | str | Y | ไบคๆๆถ้ด+break_time | str | Y | ไผๅธๆถ้ด+++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++#่ทๅๅทฎไปทๅ็บฆ(CFD)ไธญๆๆฐไบง็ๅบ็กไฟกๆฏ+df = pro.fx_obasic(exchange='FXCM', classify='INDEX', fields='ts_code,name,min_unit,max_unit,pip,pip_cost')++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code name min_unit max_unit pip pip_cost+ 0 AUS200.FXCM ๆพณๅคงๅฉไบๆ ๅๆฎๅฐ200ๆๆฐ 1.0 2000.0 1.0 0.1+ 1 CHN50.FXCM ๅฏๆถไธญๅฝA50ๆๆฐ 1.0 100.0 1.0 0.1+ 2 ESP35.FXCM ่ฅฟ็ญ็IBEX35ๆๆฐ 1.0 5000.0 1.0 0.1+ 3 EUSTX50.FXCM ๆฌงๆดฒๆฏๆๅ 50ๆๆฐ 1.0 5000.0 1.0 0.1+ 4 FRA40.FXCM ๆณๅฝCAC40ๆๆฐ 1.0 5000.0 1.0 0.1+ 5 GER30.FXCM ๅพทๅฝDAXๆๆฐ 1.0 1000.0 1.0 0.1+ 6 HKG33.FXCM ้ฆๆธฏๆ็ๆๆฐ 1.0 300.0 1.0 1.0+ 7 JPN225.FXCM ๆฅ็ป225ๆๆฐ 10.0 1000.0 1.0 10.0+ 8 NAS100.FXCM ็พๅฝ็บณๆฏ่พพๅ 100ๆๆฐ 1.0 5000.0 1.0 0.1+ 9 SPX500.FXCM ็พๅฝๆ ๆฎ500ๆๆฐ 1.0 5000.0 0.1 0.1+ 10 UK100.FXCM ่ฑๅฝๅฏๆถ100ๆๆฐ 1.0 4000.0 1.0 0.1+ 11 US30.FXCM ้็ผๆฏๅทฅไธๅนณๅๆๆฐ 1.0 4000.0 1.0 0.1+ 12 US2000.FXCM ็พๅฝ็ฝ็ด 2000ๆๆฐ 1.0 5000.0 0.1 0.1\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\244\226\346\261\207\346\225\260\346\215\256/\345\244\226\346\261\207\346\227\245\347\272\277\350\241\214\346\203\205.md" "b/agent/src/skills/tushare/references/\345\244\226\346\261\207\346\225\260\346\215\256/\345\244\226\346\261\207\346\227\245\347\272\277\350\241\214\346\203\205.md"new file mode 100644index 000000000..9babf2420--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\244\226\346\261\207\346\225\260\346\215\256/\345\244\226\346\261\207\346\227\245\347\272\277\350\241\214\346\203\205.md"@@ -0,0 +1,107 @@+## ๅคๆฑๆฅ็บฟ่กๆ+----++ๆฅๅฃ๏ผfx_daily+ๆ่ฟฐ๏ผ่ทๅๅคๆฑๆฅ็บฟ่กๆ+้้๏ผๅๆฌกๆๅคงๆๅ1000่ก่ฎฐๅฝ๏ผๅฏๅคๆฌกๆๅ๏ผๆป้ไธ้ๅถ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผไฝๆๆต้ๆงๅถ๏ผ5000็งฏๅไปฅไธ้ขๆฌก็ธๅฏน่พ้ซ๏ผ็งฏๅ่ถๅคๆ้่ถๅคง๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>+++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | TSไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ๏ผGMT๏ผๆฅๆๆฏๆ ผๆๅฐผๆฒปๆถ้ด๏ผๆฏๅไบฌๆถ้ดๆไธๅคฉ๏ผ+start_date | str | N | ๅผๅงๆฅๆ๏ผGMT๏ผ+end_date | str | N | ็ปๆๆฅๆ๏ผGMT๏ผ+exchange | str | N | ไบคๆๅ๏ผ็ฎๅๅชๆFXCM++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ๅคๆฑไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+bid_open | float | Y | ไนฐๅ ฅๅผ็ไปท+bid_close | float | Y | ไนฐๅ ฅๆถ็ไปท+bid_high | float | Y | ไนฐๅ ฅๆ้ซไปท+bid_low | float | Y | ไนฐๅ ฅๆไฝไปท+ask_open | float | Y | ๅๅบๅผ็ไปท+ask_close | float | Y | ๅๅบๆถ็ไปท+ask_high | float | Y | ๅๅบๆ้ซไปท+ask_low | float | Y | ๅๅบๆไฝไปท+tick_qty | int | Y | ๆฅไปท็ฌๆฐ+exchange | str | N | ไบคๆๅ++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()+++#่ทๅ็พๅ ไบบๆฐๅธไบคๆๅฏน็ๆฅ็บฟ่กๆ+df = pro.fx_daily(ts_code='USDCNH.FXCM', start_date='20190101', end_date='20190524')++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code trade_date bid_open bid_close bid_high bid_low ask_open \+ 0 USDCNH.FXCM 20190524 6.9261 6.9326 6.9342 6.9248 6.9277+ 1 USDCNH.FXCM 20190523 6.9309 6.9261 6.9431 6.9253 6.9376+ 2 USDCNH.FXCM 20190522 6.9334 6.9309 6.9409 6.9236 6.9348+ 3 USDCNH.FXCM 20190521 6.9373 6.9334 6.9463 6.9205 6.9408+ 4 USDCNH.FXCM 20190520 6.9366 6.9373 6.9459 6.9358 6.9373+ 5 USDCNH.FXCM 20190517 6.9259 6.9476 6.9489 6.9211 6.9313+ 6 USDCNH.FXCM 20190516 6.9029 6.9259 6.9315 6.9011 6.9079+ 7 USDCNH.FXCM 20190515 6.9029 6.9029 6.9173 6.8937 6.9050+ 8 USDCNH.FXCM 20190514 6.9114 6.9029 6.9191 6.8872 6.9128+ 9 USDCNH.FXCM 20190513 6.8628 6.9114 6.9183 6.8628 6.8642+ 10 USDCNH.FXCM 20190510 6.8341 6.8424 6.8646 6.8166 6.8409+ 11 USDCNH.FXCM 20190509 6.8052 6.8341 6.8636 6.8012 6.8096+ 12 USDCNH.FXCM 20190508 6.7941 6.8052 6.8101 6.7810 6.7958+ 13 USDCNH.FXCM 20190507 6.7699 6.7941 6.8021 6.7699 6.7772+ 14 USDCNH.FXCM 20190506 6.8017 6.7699 6.8213 6.7679 6.8037+ 15 USDCNH.FXCM 20190503 6.7451 6.7335 6.7508 6.7333 6.7457+ 16 USDCNH.FXCM 20190502 6.7322 6.7471 6.7476 6.7250 6.7343+ 17 USDCNH.FXCM 20190501 6.7360 6.7322 6.7409 6.7177 6.7379+ 18 USDCNH.FXCM 20190430 6.7383 6.7360 6.7485 6.7347 6.7393+ 19 USDCNH.FXCM 20190429 6.7357 6.7383 6.7447 6.7325 6.7362+ 20 USDCNH.FXCM 20190426 6.7488 6.7342 6.7503 6.7280 6.7515++ ask_close ask_high ask_low tick_qty+ 0 6.9330 6.9347 6.9252 18080+ 1 6.9277 6.9436 6.9261 105229+ 2 6.9376 6.9414 6.9242 111350+ 3 6.9348 6.9468 6.9209 222996+ 4 6.9408 6.9465 6.9362 79531+ 5 6.9490 6.9495 6.9217 157554+ 6 6.9313 6.9328 6.9021 120162+ 7 6.9079 6.9179 6.8943 121021+ 8 6.9050 6.9201 6.8880 300896+ 9 6.9128 6.9186 6.8639 155367+ 10 6.8469 6.8651 6.8177 229059+ 11 6.8409 6.8639 6.8016 205422+ 12 6.8096 6.8105 6.7815 147058+ 13 6.7958 6.8026 6.7722 310025+ 14 6.7772 6.8224 6.7685 165912+ 15 6.7351 6.7528 6.7339 88842+ 16 6.7478 6.7483 6.7256 99287+ 17 6.7343 6.7442 6.7183 94834+ 18 6.7379 6.7491 6.7362 163001+ 19 6.7393 6.7452 6.7331 60621+ 20 6.7437 6.7515 6.7285 133640\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\244\247\346\250\241\345\236\213\350\257\255\346\226\231\344\270\223\351\242\230\346\225\260\346\215\256/\344\270\212\345\270\202\345\205\254\345\217\270\345\205\254\345\221\212.md" "b/agent/src/skills/tushare/references/\345\244\247\346\250\241\345\236\213\350\257\255\346\226\231\344\270\223\351\242\230\346\225\260\346\215\256/\344\270\212\345\270\202\345\205\254\345\217\270\345\205\254\345\221\212.md"new file mode 100644index 000000000..7cb8cef58--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\244\247\346\250\241\345\236\213\350\257\255\346\226\231\344\270\223\351\242\230\346\225\260\346\215\256/\344\270\212\345\270\202\345\205\254\345\217\270\345\205\254\345\221\212.md"@@ -0,0 +1,63 @@+## ไธๅธๅ ฌๅธๅ จ้ๅ ฌๅ+----++ๆฅๅฃ๏ผanns_d+ๆ่ฟฐ๏ผ่ทๅๅ จ้ๅ ฌๅๆฐๆฎ๏ผๆไพpdfไธ่ฝฝURL+้้๏ผๅๆฌกๆๅคง2000ๆกๆฐ๏ผๅฏไปฅ่ท่ฟๆฅๆๅพช็ฏ่ทๅๅ จ้+ๆ้๏ผๆฌๆฅๅฃไธบๅ็ฌๆ้๏ผ่ฏทๅ่[ๆ้่ฏดๆ](https://tushare.pro/document/1?doc_id=290)++<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ +ann_date | str | N | ๅ ฌๅๆฅๆ๏ผyyyymmddๆ ผๅผ๏ผไธๅ๏ผ+start_date | str | N | ๅ ฌๅๅผๅงๆฅๆ+end_date | str | N | ๅ ฌๅ็ปๆๆฅๆ++<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ann_date | str | Y | ๅ ฌๅๆฅๆ+ts_code | str | Y | ่ก็ฅจไปฃ็ +name | str | Y | ่ก็ฅจๅ็งฐ+title | str | Y | ๆ ้ข+url | str | Y | URL๏ผๅๆไธ่ฝฝ้พๆฅ+rec_time | datetime | N | ๅๅธๆถ้ด++<br>++**ๆฅๅฃ่ฐ็จ**++```python++pro = ts.pro_api()++df = pro.anns_d(ann_date='20230621')++```++<br>++**ๆฐๆฎๆ ทไพ**+++ ann_date ts_code name title+ 0 20230621 600590.SH ๆณฐ่ฑช็งๆ ็ฌฌๅ ซๅฑ่ฃไบไผ็ฌฌๅไบๆฌกไผ่ฎฎๅณ่ฎฎๅ ฌๅ+ 1 20230621 300504.SZ ๅคฉ้่กไปฝ ๅคฉ้่กไปฝ๏ผๅ ณไบๅ่ดญๆณจ้้จๅ้ๅถๆง่ก็ฅจ็ๅ ฌๅ+ 2 20230621 002815.SZ ๅด่พพๆๆฏ ๅด่พพๆๆฏ๏ผไธญไฟกๅปบๆ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅ ณไบๅด่พพๆๆฏ่กไปฝๆ้ๅ ฌๅธ2022ๅนด้ๅถๆง่ก็ฅจๆฟๅฑ่ฎกๅ้ฆๆฌกๆ...+ 3 20230621 600212.SH ็ปฟ่ฝๆ งๅ ็ปฟ่ฝๆ งๅ 2022ๅนดๅนดๅบฆ่กไธๅคงไผไผ่ฎฎ่ตๆ+ 4 20230621 002508.SZ ่ๆฟ็ตๅจ ่ๆฟ็ตๅจ๏ผๅ ณไบๅๆฟๅฑๅฏน่ฑกๆไบ่ก็ฅจๆๆ็ๅ ฌๅ+ ... ... ... ... ...+ 1995 20230620 600152.SH ็ปด็งๆๆฏ ็ปด็งๆๆฏๅ ณไบๅ2022ๅนด่ก็ฅจๆๆๆฟๅฑ่ฎกๅๆฟๅฑๅฏน่ฑกๆไบ้ข็้จๅ่ก็ฅจๆๆ๏ผ็ฌฌไบๆนๆฌก๏ผ็ๅ ฌๅ+ 1996 20230620 301290.SZ ไธๆๅป็ ไธๆๅป็๏ผๅ ณไบๅฏนๆทฑๅณ่ฏๅธไบคๆๆๅ ณๆณจๅฝ็ๅๅคๅ ฌๅ+ 1997 20230620 600998.SH ไนๅท้ ไนๅท้ๅ ณไบๆง่ก่กไธ2022ๅนด้ๅ ฌๅผๅ่กๅฏไบคๆขๅ ฌๅธๅบๅธ๏ผ็ฌฌไบใไธๆ๏ผ่ฟๅ ฅๆข่กๆ็ๆ็คบๆงๅ ฌๅ+ 1998 20230620 300371.SZ ๆฑไธญ่กไปฝ ๆฑไธญ่กไปฝ๏ผๅ ณไบๅญๅ ฌๅธๅฎๆๅทฅๅๅๆด็ๅ ฌๅ+ 1999 20230620 300061.SZ ๆๅคฉ็งๆ ๆๅคฉ็งๆ๏ผๅ ณไบไธบๅญๅ ฌๅธๆไพๆ ไฟ็ๅ ฌๅ++ [2000 rows x 4 columns]\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\244\247\346\250\241\345\236\213\350\257\255\346\226\231\344\270\223\351\242\230\346\225\260\346\215\256/\344\270\212\350\257\201e\344\272\222\345\212\250\351\227\256\347\255\224.md" "b/agent/src/skills/tushare/references/\345\244\247\346\250\241\345\236\213\350\257\255\346\226\231\344\270\223\351\242\230\346\225\260\346\215\256/\344\270\212\350\257\201e\344\272\222\345\212\250\351\227\256\347\255\224.md"new file mode 100644index 000000000..106e97db2--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\244\247\346\250\241\345\236\213\350\257\255\346\226\231\344\270\223\351\242\230\346\225\260\346\215\256/\344\270\212\350\257\201e\344\272\222\345\212\250\351\227\256\347\255\224.md"@@ -0,0 +1,72 @@+## ไธ่ฏEไบๅจ+----++**ๆฅๅฃ**๏ผirm_qa_sh๏ผๅๅฒๆฐๆฎๅผๅงไบ2023ๅนด6ๆใ+**ๆ่ฟฐ**๏ผ่ทๅไธไบคๆeไบๅจ่ฃ็ง้ฎ็ญๆๆฌๆฐๆฎใไธ่ฏeไบๅจๆฏ็ฑไธๆตท่ฏๅธไบคๆๆๅปบ็ซใไธๆตท่ฏๅธๅธๅบๆๆๅไธไธปไฝๆ ๅฟไฝฟ็จ็ๆฒ้ๅนณๅฐ,ๆจๅจๅผๅฏผๅไฟ่ฟไธๅธๅ ฌๅธใๆ่ต่ ็ญๅๅธๅบๅไธไธปไฝไน้ด็ไฟกๆฏๆฒ้,ๆๅปบ้ไธญใไพฟๆท็ไบๅจๆธ ้ใๆฌๆฅๅฃๆฐๆฎ่ฎฐๅฝไบไปฅไธๆฒ้้ฎ็ญ็ๆๆฌๆฐๆฎใ+**้้**๏ผๅๆฌก่ฏทๆฑๆๅคง่ฟๅ3000่กๆฐๆฎ๏ผๅฏๆ นๆฎ่ก็ฅจไปฃ็ ๏ผๆฅๆ็ญๅๆฐๅพช็ฏๆๅๅ จ้จๆฐๆฎ+**ๆ้**๏ผ็จๆทๅ120็งฏๅๅฏไปฅ่ฏ็จ๏ผๆญฃๅผๆ้ไธบ10000็งฏๅ๏ผๆ็ณ่ฏทๅ็ฌๅผๆ้๏ผ่ฏทๅ่[ๆ้่ฏดๆ](https://tushare.pro/document/1?doc_id=290)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ๏ผๆ ผๅผYYYYMMDD๏ผไธๅ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+pub_date | str | N | ๅๅธๅผๅงๆฅๆ(ๆ ผๅผ๏ผ2025-06-03 16:43:03)+pub_date | str | N | ๅๅธ็ปๆๆฅๆ(ๆ ผๅผ๏ผ2025-06-03 18:43:23)+++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +name | str | Y | ๅ ฌๅธๅ็งฐ+trade_date | str | Y | ๆฅๆ+q | str | Y | ้ฎ้ข+a | str | Y | ๅๅค+pub_time | datetime | Y | ๅๅคๆถ้ด++<br>+<br>++**ๆฅๅฃ่ฐ็จ**++```python++pro = ts.pro_api()++#่ทๅ2025ๅนด2ๆ12ๆฅไธ่ฏeไบๅจ็้ฎ็ญๆๆฌ+df = pro.irm_qa_sh(ann_date='20250212')++```++<br>++**ๆฐๆฎๆ ทไพ**++<img src='https://tushare.pro/files/web/e.png'>+++ ts_code name q a+ 0 601121.SH ๅฎๅฐ็ฟไธ ่กไปทๅฉๅคๅ ็ด ไธป่ฆ็ๅบๆฌ้ข๏ผๅ ณ้ฎๆฏไธ็ปฉ๏ผๅฉ็ฉบๅ ็ด ๅฐฑๆฏๅๆๅไฝไปทๅขๅ๏ผ็ฎๅๅฎๅฐ็ไธ็ปฉ้พไปฅๆตๆถ่กไธ... ๅฐๆฌ็ๆ่ต่ ๏ผๆจๅฅฝ๏ผ่กทๅฟๆ่ฐขๆจๅฏนๅฎๅฐ็ฟไธ็ๅ ณๆณจไธ้ญ็ญใๅ ฌๅธๅฐๅ ๅฟซๆจ่ฟ้็น้กน็ฎๅปบ่ฎพ๏ผๅๅฅฝ็ไบง็ป...+ 1 600615.SH ไธฐๅ่กไปฝ ๆจๅฅฝ๏ผๆๆฏไธๅๅๅธๅฑ ๆฐ๏ผ้ฟๆๅ ณๆณจ็ฉบๆฐๆฑกๆ้ฎ้ขใๆณ่ฏท้ฎ่ดตๅ ฌๅธๅจๆฅๅธธ็ป่ฅ่ฟ็จไธญ๏ผๆฏๅฆ้ๅไบๆๆ็... ๅฐๆฌ็ๆ่ต่ ๆจๅฅฝ๏ผๅ ฌๅธไธๅฑไบ้็นๆๆฑกๅไฝใๅ ฌๅธ้ซๅบฆ้่ง็ฏๅขไฟๆคๅทฅไฝ๏ผ้ๅๆๆๆชๆฝไธๆญๆ้ซ็ฏๅข...+ 2 600615.SH ไธฐๅ่กไปฝ ๅ ฌๅธ้ๅ้็ญๆๆๅจๆบๅจไบบ่กไธๅบ็จๅๆฏ่ฟๅคงใๅ ฌๅธๆฏไธๆฏๅฏไปฅ่่ๅ ๅคงๅจๆบๅจไบบๆน้ข็ๆ็ฅๅธๅฑ๏ผ ๅฐๆฌ็ๆ่ต่ ๆจๅฅฝ๏ผ้ๅ้ๆๆๅจ่ฝป้ๅๆน้ขๅบ็จ้ขๅๅฎฝๆณ๏ผ็ฎๅๅ ฌๅธ็้ๅ้ไบงๅไธป่ฆๅบ็จไบไบค้ๅทฅๅ ท...+ 3 601121.SH ๅฎๅฐ็ฟไธ ๅฆๆๅฎๅฐ็ฟไธ่ฃไบไผ็ๅฅฝ่ชๅทฑๅ ฌๅธ็ๆ่ตไปทๅผ๏ผไธบไปไนๅฎๅฏๅงๆ็ณไธๅฎๆบ่ฏๅธๆ่ต็่ดข๏ผไนไธ็จ่ชๆ่ต้... ๅฐๆฌ็ๆ่ต่ ๏ผๆจๅฅฝใๆ่ฐขๆจๅฏนๅฎๅฐ็ฟไธ็ๅ ณๆณจไธๅปบ่ฎฎใๅ ฌๅธๅง็ป็งๆ็จณๅฅ็่ดขๅก็ฎก็ๅ่ต้ไฝฟ็จๅๅ๏ผ...+ 4 600615.SH ไธฐๅ่กไปฝ ๅฐๆฌ็่ฃ็งๆจๅฅฝ๏ผๆฎๆฅ้ไบบๅฝขๆบๅจไบบๆไฝฟ็จ้คpeekๆๆไนๅค๏ผๆๅค็ๅฐฑๆฏ้ๅ้็ธๅ ณๆ่ดจ๏ผ่ฏท้ฎๅ ฌๅธ... ๅฐๆฌ็ๆ่ต่ ๆจๅฅฝ๏ผ็ฎๅๅ ฌๅธๆฒกๆไบบๅฝขๆบๅจไบบ้กน็ฎๅจๅค๏ผๆ่ฐขๆจ็ๅ ณๆณจ๏ผ+ .. ... ... ... ...+ 95 600423.SH ๆณๅ่กไปฝ ้ขๅฏผๆจๅฅฝ๏ผๆๆฏไธๅๅฟ็ณป็ฏๅข็ๆฎ้ๅฑ ๆฐ๏ผ้ฟๆๅฏน็ฉบๆฐๆฑกๆ้ฎ้ขไฟๆ้ซๅบฆๅ ณๆณจใ่ฏท้ฎ่ดตๅ ฌๅธๅจ็ไบง่ฟ็จไธญ... ๆ่ต่ ๏ผๆจๅฅฝ๏ผๅ ฌๅธๅๅ้่ง็ฏๅข้ฎ้ข๏ผ็งฏๆๆจๅจ่่ฝๅๆ็ๅฟต๏ผไธๅบๆๆพไธฅๆ ผๆ็ งๅฝๅฎถๆ ๅๆง่ก๏ผๅ ทไฝ...+ 96 600190.SH ST้ฆๆธฏ ๅ ฌๅธ่ฃไบไผ๏ผไฝ ๅ ฌๅธ2024ไนๅ้ฎ้ขๅพๅคง๏ผๆถๅไบ็ญไผๅค้ฎ้ข๏ผๅ ฌๅธๅฟ ้กปๅๅธๆ้ ๅๅฝปๆฅไธ็ปฉๅทจไบ้ฎ้ข... ๅฐๆฌ็ๆ่ต่ ๏ผๆจๅฅฝ๏ผๅ ฌๅธๅฏน็ธๅ ณไบ้กน่ฟๅฑๅฐๅๆถๅฑฅ่กไฟกๆฏๆซ้ฒไนๅก๏ผ่ฏทไปฅๅ ฌๅธๅฏนๅคๆซ้ฒ็ๅ ฌๅไธบๅ๏ผๆ...+ 97 688120.SH ๅๆตทๆธ ็ง ไฝ ๅ ฌๅธๅจๅฝๅ ่กไธ็็ซไบไผๅฟๆๅชไบ๏ผๆฏๅฆๅฐ่ฟไบไผๅฟ่ฝฌๅไธบไบๅ ฌๅธ็ๅๅฑๆๆ๏ผ ๅฐๆฌ็ๆ่ต่ ๆจๅฅฝ๏ผๅ ฌๅธๆฏไธๅฎถๆฅๆๆ ธๅฟ่ชไธป็ฅ่ฏไบงๆ็้ซ็ซฏๅๅฏผไฝ่ฃ ๅคๅถ้ ๅ๏ผไบงๅไธป่ฆๅบ็จไบ่ฏ็ๅถ...+ 98 688120.SH ๅๆตทๆธ ็ง ไฝ ๅ ฌๅธ่ขซ็ๅฅฝๆ่ฎคๅฏ็ๅฐๆนๅจๅช้๏ผ ๅฐๆฌ็ๆ่ต่ ๆจๅฅฝ๏ผๅ ฌๅธๆฏไธๅฎถๆฅๆๆ ธๅฟ่ชไธป็ฅ่ฏไบงๆ็้ซ็ซฏๅๅฏผไฝ่ฃ ๅคๅถ้ ๅ๏ผไบงๅไธป่ฆๅบ็จไบ่ฏ็ๅถ...+ 99 600630.SH ้พๅคด่กไปฝ ่ฏท้ฎๅ ฌๅธๆฅๅ ฅๅพฎไฟกๅฐๅบๅทฒๆไธๆฎตๆถ้ด๏ผ่ฏท้ฎๅพฎไฟกๅฐๅบ็้ๅฎๆ ๅตๅฆไฝ๏ผ ๅฐๆฌ็ๆ่ต่ ๏ผๆจๅฅฝ๏ผๅ ฌๅธๆไธไธๆชๅ็็ฎๅๅทฒๅ ฅ้ฉปๅพฎไฟก็ฌฌไธๆนๅนณๅฐๆ่ตๅๅใๆจๅฏๅจๅพฎไฟกๅฐ็จๅบๆ็ดขโ...++diff --git "a/agent/src/skills/tushare/references/\345\244\247\346\250\241\345\236\213\350\257\255\346\226\231\344\270\223\351\242\230\346\225\260\346\215\256/\345\210\270\345\225\206\347\240\224\347\251\266\346\212\245\345\221\212.md" "b/agent/src/skills/tushare/references/\345\244\247\346\250\241\345\236\213\350\257\255\346\226\231\344\270\223\351\242\230\346\225\260\346\215\256/\345\210\270\345\225\206\347\240\224\347\251\266\346\212\245\345\221\212.md"new file mode 100644index 000000000..1d42edc01--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\244\247\346\250\241\345\236\213\350\257\255\346\226\231\344\270\223\351\242\230\346\225\260\346\215\256/\345\210\270\345\225\206\347\240\224\347\251\266\346\212\245\345\221\212.md"@@ -0,0 +1,71 @@+# ๅธๅ็ ็ฉถๆฅๅ+++ๆฅๅฃ๏ผresearch_report+ๆ่ฟฐ๏ผ่ทๅๅธๅ็ ็ฉถๆฅๅ-ไธช่กใ่กไธ็ญ๏ผๅๅฒๆฐๆฎไป20170101ๅผๅงๆไพ๏ผๅข้ๆฏๅคฉไธคๆฌกๆดๆฐ+้้๏ผๅๆฌกๆๅคง1000ๆก๏ผๅฏๆ นๆฎๆฅๆๆๅธๅๅ็งฐไปฃ็ ๅพช็ฏๆๅ๏ผๆฏๅคฉๆป้ไธ้ๅถ+ๆ้๏ผๆฌๆฅๅฃ้ๅ็ฌๅผๆ้๏ผ่ท็งฏๅๆฒกๅ ณ็ณป๏ผ๏ผๅ ทไฝ่ฏทๅ้ [ๆ้่ฏดๆ](https://tushare.pro/document/1?doc_id=290)++<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+trade_date | str | N | ็ ๆฅๆฅๆ๏ผๆ ผๅผ๏ผYYYYMMDD๏ผไธๅ๏ผ+start_date | str | N | ็ ๆฅๅผๅงๆฅๆ+end_date | str | N | ็ ๆฅ็ปๆๆฅๆ+report_type | str | N | ็ ๆฅ็ฑปๅซ๏ผไธช่ก็ ๆฅ/่กไธ็ ๆฅ+ts_code | str | N | ่ก็ฅจไปฃ็ +inst_csname | str | N | ๅธๅๅ็งฐ+ind_name | str | N | ่กไธๅ็งฐ++<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+---- | ---- | ---- | ----+trade_date | str | Y | ็ ๆฅๅๅธๆถ้ด+abstr | str | Y | ็ ๆฅๆ่ฆ+title | str | Y | ็ ๆฅๆ ้ข+report_type | str | Y | ็ ๆฅ็ฑปๅซ+author | str | Y | ไฝ่+name | str | Y | ่ก็ฅจๅ็งฐ+ts_code | str | Y | ่ก็ฅจไปฃ็ +inst_csname | str | Y | ๆบๆ็ฎ็งฐ+ind_name | str | Y | ่กไธๅ็งฐ+url | str | Y | ไธ่ฝฝ้พๆฅ++<br>++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++#่ทๅ2026ๅนด1ๆ21ๆฅๅธๅ็ ๆฅๆฐๆฎ+df = pro.research_report(trade_date='20260121', fields='trade_date,file_name,author,inst_csname')++```+++**ๆฐๆฎๆ ทไพ**++ trade_date file_name author inst_csname+ 0 20260121 ไธๅด่ฏๅธ_2025ๅนดไธ็ปฉ้ขๅข็น่ฏ๏ผฮฑไธฮฒๅ ฑๆฏ๏ผ้ช่ฏ้่ไฟกๆฏๆๅก้พๅคด้ซๅผนๆง_20260121.pdf ๅญๅฉท,ๅผ ่ฏๅซ,ๆญฆๆฌฃๅง ไธๅด่ฏๅธ+ 1 20260121 ไธ็บช่ฏๅธ_TMT่กไธๅจๆฅ๏ผ1ๆ็ฌฌ2ๅจ๏ผ๏ผ้ฟ้ๅทดๅทดไธพๅๅ้ฎไบงๅๅๅธไผ_20260121.pdf ๆๆถๆจ,็ฝๆด ไธ็บช่ฏๅธ+ 2 20260121 ไธญ้ถ่ฏๅธ_ๆถ่ดญDFSๅคงไธญๅๅบไธๅก๏ผๆบๆLVMH๏ผๅ จ้ขๆทฑๅๅฝ้ ไธๅกๅธๅฑ_20260121.pdf ๆๅฐๆฐ,ๅฎ็ฏ็ฟ ไธญ้ถ่ฏๅธ+ 3 20260121 ๅฝ้่ฏๅธ_ๆถ่ดญDFSๅคงไธญๅๅบไธๅก๏ผๆ็ฅๅไฝLVMH_20260121.pdf ไบๅฅ,่ฐทไบฆๆธ ๅฝ้่ฏๅธ+ 4 20260121 ๅคชๅนณๆด_ไธๆๅป็๏ผๅพฎๅๅค็งๅนณๅฐๅๅฐๅทจไบบ๏ผๅคๅ ๅธๅฑไฟๅๅฑ_20260121.pdf ่ฐญ็ดซๅช,ๆๅธๅฒฉ ๅคชๅนณๆด+ .. ... ... ... ...+ 80 20260121 ไธญๅฝ้ถๆฒณ_ๅไธ่ชๅคฉ็ณปๅๆฅๅไนไธ๏ผไปฐๆๆ็ฉบ๏ผๅๅคฉ็ชๅด_20260121.pdf ๆ่ฏ,่กๆตฉๆทผ ไธญๅฝ้ถๆฒณ+ 81 20260121 ่ พๆฏๆฐ็ _2025ๅนดๅ จ็ๆธ ๆด็ตๅจๅๅฑๆฅๅ๏ผๅธๅบๆ้ฟ้ฟๆๅๅฅฝ ่กไธ่ฟๅๅผๅพๆๅพ _2026012... ้ฉฌไฝณ ่ พๆฏๆฐ็ + 82 20260121 ๅคชๅนณๆด_ๅไธๅจๆฅ๏ผ็ชไปทๆบๅญฃๅๅผน๏ผไบง่ฝๆ็ปญๅปๅ_20260121.pdf ็จๆไธ ๅคชๅนณๆด+ 83 20260121 ไธๅด่ฏๅธ_2025ๅนดไธ็ปฉ้ขๅ็น่ฏ๏ผ่ดๆ็ๅฉๆ็นๅทฒ็ฐ๏ผๅคไธๅกๆฟๅๆ็ปญๅๅฅฝ_20260121.pdf ๆพๆต็บข,้ฎๅทง็,ๅฒณๆฏ็ถ ไธๅด่ฏๅธ+ 84 20260121 ไธญๅฝ้ถๆฒณ_ๆบๆDFS+LVMH๏ผ้ซ็ซฏๅค่+ๅฝ่ดงๅบๆตทๅนณๅฐ้ป่พๅผบๅ_20260121.pdf ้กพ็น้ฝ ไธญๅฝ้ถๆฒณ++ [85 rows x 4 columns]++\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\244\247\346\250\241\345\236\213\350\257\255\346\226\231\344\270\223\351\242\230\346\225\260\346\215\256/\345\233\275\345\256\266\346\224\277\347\255\226\345\272\223.md" "b/agent/src/skills/tushare/references/\345\244\247\346\250\241\345\236\213\350\257\255\346\226\231\344\270\223\351\242\230\346\225\260\346\215\256/\345\233\275\345\256\266\346\224\277\347\255\226\345\272\223.md"new file mode 100644index 000000000..c4710b15f--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\244\247\346\250\241\345\236\213\350\257\255\346\226\231\344\270\223\351\242\230\346\225\260\346\215\256/\345\233\275\345\256\266\346\224\277\347\255\226\345\272\223.md"@@ -0,0 +1,68 @@+# ๅฝๅฎถๆฟ็ญๆณ่งๅบ++### ๆฅๅฃไป็ป+<font color="red">+ไธบๆดๅฅฝๅฐๅญฆไน ๅ็ๆๅฝๅฎถๆๅ ณ้จ้จๅๅธ็ๆฟ็ญๆณ่งๅๅ็ฑปๆนๅคๆ่ง๏ผๅๆถไธบๅคง่ฏญ่จๆจกๅๆไพๆด็ฒพๅ็่ฏญๆๅไธไธ็ฅ่ฏๅบ๏ผๆไปฌๆ้ๆด็ไบ็ฑๅฝๅฎถๆๅ ณ้จ้จ**ๅ ฌๅผๆซ้ฒ**็ๆฟ็ญๆณ่งๆไปถ๏ผๆๆๆๅญๅไธบๅๅง่พๅบ๏ผๆชไฝไปปไฝไบๆฌกๅ ๅทฅๅค็๏ผๅๆถๆไพๅๅงๅบๅคใ+</font>++ๆฅๅฃ๏ผnpr๏ผ๏ผNational Policy Repository๏ผ+ๆ่ฟฐ๏ผ่ทๅๅฝๅฎถ่กๆฟๆบๅ ณๅ ฌๅผๆซ้ฒ็ๅ็ฑปๆณ่งใๆกไพๆฟ็ญใๆนๅคใ้็ฅ็ญๆๆฌๆฐๆฎใ+้้๏ผๅๆฌกๆๅคง500ๆก๏ผๅฏๆ นๆฎๅๆฐๅพช็ฏๆๅ+็งฏๅ๏ผๆฌๆฅๅฃ้ๅ็ฌๅผๆ้๏ผ่ท็งฏๅๆฒกๅ ณ็ณป๏ผ๏ผๅ ทไฝ่ฏทๅ้ [ๆ้่ฏดๆ](https://tushare.pro/document/1?doc_id=290)++<br>++### ่พๅ ฅๅๆฐ+ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ | ๅฏ้ๅ ๅฎน+---- | ----- | ---- | ---- | ----+org | str | N | ๅๅธๆบๆ | ๅฝๅก้ขๅๅ ฌๅ /ๅฝๅก้ขๅๅ ฌๅ /ๅฝๅก้ขใไธญๅคฎๅๅง/ๅฝๅก้ขๅบๆฅ็ฎก็ๅๅ ฌๅฎค+start_date | datetime | N | ๅๅธๅผๅงๆถ้ด | ๆ ผๅผๆ ทไพ๏ผ2024-11-21 00:00:00+end_date | datetime | N | ๅๅธ็ปๆๆถ้ด| ๆ ผๅผๆ ทไพ๏ผ2024-11-28 00:00:00+ptype | str | N | ็ฑปๅ | ๅฏนๅค็ป่ดธๅไฝ/ๅไธใ็็งไธใๆธไธ/ๆตทๅ ณ/ๅๅธ่งๅ/ๅๅฐ/็งๆ/ๆ่ฒ/ๅซ็/ๆฐ่ช ็ญ110็ฑป++<br>++### ่พๅบๅๆฐ+ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+---- | ---- | ---- | ----+pubtime | datetime | Y | ๅๅธๆถ้ด+title | str | Y | ๆ ้ข+url | str | N | ๆฟ็ญๆไปถurl+content_html | str | N | ๆญฃๆๅ ๅฎน+pcode | str | Y | ๅๆๅญๅท+puborg | str | Y | ๅๆๆบๅ ณ+ptype | str | Y | ไธป้ขๅ็ฑป++<br>++### ไปฃ็ ็คบไพ+```python++pro = ts.pro_api()++#่ทๅ็ฑๅฝๅก้ขๅๅธ็็ธๅ ณๆฟ็ญๆไปถ+df = pro.npr(org='ๅฝๅก้ข')++#่ทๅ็ฑโๅฝๅก้ขโๅๅธ็โ็งๆโ็ธๅ ณๆฟ็ญๅๆนๅคๆไปถ+df = pro.npr(org='ๅฝๅก้ข',+ ptype='็งๆ',+ end_date='2025-08-26 17:00:00',+ fields='pubtime,title,pcode')+```+<br>+++### ๆฐๆฎ็ปๆ++ pubtime title pcode+ 0 2025-08-26 17:00:00 ๅฝๅก้ขๅ ณไบๆทฑๅ ฅๅฎๆฝโไบบๅทฅๆบ่ฝ+โ่กๅจ็ๆ่ง ๅฝๅใ2025ใ11ๅท+ 1 2024-11-14 19:00:00 ๅฝๅฎถ่ช็ถ็งๅญฆๅบ้ๆกไพ ๅฝไปค็ฌฌ796ๅท+ 2 2024-05-30 18:57:00 ๅฝๅก้ขๅ ณไบไฟฎๆนใๅฝๅฎถ็งๅญฆๆๆฏๅฅๅฑๆกไพใ็ๅณๅฎ ๅฝไปค็ฌฌ782ๅท+ 3 2023-08-29 16:55:00 ๅฝๅก้ขๅ ณไบๅฐๅใๆฒณๅฅๆทฑๆธฏ็งๆๅๆฐๅไฝๅบๆทฑๅณๅญๅบๅๅฑ่งๅใ็้็ฅ ๅฝๅใ2023ใ12ๅท+ 4 2023-06-16 16:57:00 ๅฝๅก้ขๅ ณไบๅๆ้ฟๅ ่้ฟๆๅฐ้ซๆฐๆๆฏไบงไธๅผๅๅบๅ็บงไธบๅฝๅฎถ้ซๆฐๆๆฏไบงไธๅผๅๅบ็ๆนๅค ๅฝๅฝใ2023ใ48ๅท+ .. ... ... ...+ 111 2008-03-28 08:00:00 ๅฝๅก้ขๅ ณไบๅๆไธๆตท้ซๆฐๆๆฏไบงไธๅผๅๅบๆดๅไธบไธๆตทๅผ ๆฑ้ซๆฐๆๆฏไบงไธๅผๅๅบ็ๆนๅค ๅฝๅฝใ2006ใ14ๅท+ 112 2008-03-28 08:00:00 ๅฝๅฎถ่ช็ถ็งๅญฆๅบ้ๆกไพ ๅฝไปค็ฌฌ487ๅท+ 113 2008-03-28 08:00:00 ๅฝๅก้ขๅ ณไบ2002ๅนดๅบฆๅฝๅฎถ็งๅญฆๆๆฏๅฅๅฑ็ๅณๅฎ ๅฝๅใ2003ใ4ๅท+ 114 2008-03-28 08:00:00 ๅฝๅก้ขๅ ณไบๅฐๅๅ จๆฐ็งๅญฆ็ด ่ดจ่กๅจ่ฎกๅ็บฒ่ฆ(2006โ2010โ2020ๅนด)็้็ฅ ๅฝๅใ2006ใ7ๅท+ 115 2008-03-28 08:00:00 ๅฝๅก้ขๅ ณไบ2005ๅนดๅบฆๅฝๅฎถ็งๅญฆๆๆฏๅฅๅฑ็ๅณๅฎ ๅฝๅใ2006ใ2ๅท\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\244\247\346\250\241\345\236\213\350\257\255\346\226\231\344\270\223\351\242\230\346\225\260\346\215\256/\346\226\260\351\227\273\345\277\253\350\256\257(\347\237\255\350\256\257).md" "b/agent/src/skills/tushare/references/\345\244\247\346\250\241\345\236\213\350\257\255\346\226\231\344\270\223\351\242\230\346\225\260\346\215\256/\346\226\260\351\227\273\345\277\253\350\256\257(\347\237\255\350\256\257).md"new file mode 100644index 000000000..10a91991c--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\244\247\346\250\241\345\236\213\350\257\255\346\226\231\344\270\223\351\242\230\346\225\260\346\215\256/\346\226\260\351\227\273\345\277\253\350\256\257(\347\237\255\350\256\257).md"@@ -0,0 +1,76 @@+## ๆฐ้ปๅฟซ่ฎฏ+----++ๆฅๅฃ๏ผnews+ๆ่ฟฐ๏ผ่ทๅไธปๆตๆฐ้ป็ฝ็ซ็ๅฟซ่ฎฏๆฐ้ปๆฐๆฎ,ๆไพ่ถ ่ฟ6ๅนดไปฅไธๅๅฒๆฐ้ปใ+้้๏ผๅๆฌกๆๅคง1500ๆกๆฐ้ป๏ผๅฏๆ นๆฎๆถ้ดๅๆฐๅพช็ฏๆๅๅๅฒ+็งฏๅ๏ผๆฌๆฅๅฃ้ๅ็ฌๅผๆ้๏ผ่ท็งฏๅๆฒกๅ ณ็ณป๏ผ๏ผๅ ทไฝ่ฏทๅ้ [ๆ้่ฏดๆ](https://tushare.pro/document/1?doc_id=290)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+start_date | datetime | Y | ๅผๅงๆฅๆ(ๆ ผๅผ๏ผ2018-11-20 09:00:00๏ผ+end_date | datetime | Y | ็ปๆๆฅๆ+src | str | Y | ๆฐ้ปๆฅๆบ ่งไธ่กจ++<br>++ๆฐๆฎๆบ++| ๆฅๆบๅ็งฐ | srcๆ ่ฏ | ๆ่ฟฐ |+| -------- | -------- | -------- |+| ๆฐๆตช่ดข็ป | sina | ่ทๅๆฐๆตช่ดข็ปๅฎๆถ่ต่ฎฏ |+| ๅๅฐ่ก่ง้ป | wallstreetcn | ๅๅฐ่ก่ง้ปๅฟซ่ฎฏ |+| ๅ่ฑ้กบ | 10jqka | ๅ่ฑ้กบ่ดข็ปๆฐ้ป |+| ไธๆน่ดขๅฏ | eastmoney | ไธๆน่ดขๅฏ่ดข็ปๆฐ้ป+| ไบ่ดข็ป | yuncaijing | ไบ่ดข็ปๆฐ้ป+| ๅคๅฐๆฐ้ป | fenghuang | ๅคๅฐๆฐ้ป+| ้่็ | jinrongjie | ้่็ๆฐ้ป+| ่ดข่็คพ | cls| ่ดข่็คพๅฟซ่ฎฏ+| ็ฌฌไธ่ดข็ป | yicai | ็ฌฌไธ่ดข็ปๅฟซ่ฎฏ+++<br>+<br>+ๆฅๆ่พๅ ฅ่ฏดๆ๏ผ+<br><br>++* ๆถ้ดๅๆฐๆ ผๅผไพๅญ๏ผstart_date='2018-11-20 09:00:00', end_date='2018-11-20 22:05:03'+++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+datetime | str | Y | ๆฐ้ปๆถ้ด+content | str | Y | ๅ ๅฎน+title | str | Y | ๆ ้ข+channels | str | N | ๅ็ฑป+++<br><br>++**ๆฅๅฃ่ฐ็จ**++```python++pro = ts.pro_api()++df = pro.news(src='sina', start_date='2018-11-21 09:00:00', end_date='2018-11-22 10:10:00')++```++<br><br>++**ๆฐๆฎๆ ทไพ**++<img src="https://tushare.pro/files/img/news_sp.png">++<br><br>++ๆดๅคๆฐๆฎ้ข่ง๏ผ่ฏท็นๅป็ฝ็ซๅคด้จ่ๅ็[่ต่ฎฏๆฐๆฎ](https://tushare.pro/news)ใ\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\244\247\346\250\241\345\236\213\350\257\255\346\226\231\344\270\223\351\242\230\346\225\260\346\215\256/\346\226\260\351\227\273\350\201\224\346\222\255\346\226\207\345\255\227\347\250\277.md" "b/agent/src/skills/tushare/references/\345\244\247\346\250\241\345\236\213\350\257\255\346\226\231\344\270\223\351\242\230\346\225\260\346\215\256/\346\226\260\351\227\273\350\201\224\346\222\255\346\226\207\345\255\227\347\250\277.md"new file mode 100644index 000000000..55242514b--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\244\247\346\250\241\345\236\213\350\257\255\346\226\231\344\270\223\351\242\230\346\225\260\346\215\256/\346\226\260\351\227\273\350\201\224\346\222\255\346\226\207\345\255\227\347\250\277.md"@@ -0,0 +1,74 @@+## ๆฐ้ป่ๆญ+----+<font color="red">+ไธบไบๆดๅ ๆทฑๅ ฅๅฐๅญฆไน ่ดฏๅฝปๆๅ ็้่ฆๆ็คบ็ฒพ็ฅ๏ผๅฉ็จๆฐๆถไปฃ็ๆฐๆๆฏๅผๆฌ็คพไผไธปไนๆฐไปทๅผ่ง๏ผ็นๅฐๆด็ไบ่ฟๅปๅๅนดๆฐ้ป่ๆญ็ๆๅญ็จฟไพๅคงๅฎถ็ ็ฉถใๅ่ๅญฆไน ใๅธๆๅคงๅฎถ้ขๆๅจๅฟ๏ผๅฎๅกๅจ่ก๏ผๅๆถไนๅซๅฟไบๆไฝๆ่ตๆบไผใ+</font>++<br>+<br>++ๆฅๅฃ๏ผcctv_news+ๆ่ฟฐ๏ผ่ทๅๆฐ้ป่ๆญๆๅญ็จฟๆฐๆฎ๏ผๆฐๆฎๅผๅงไบ2017ๅนดใ+้้๏ผๅฏๆ นๆฎๆฅๆๅๆฐๅพช็ฏๆๅ๏ผๆป้ไธ้ๅถ+็งฏๅ๏ผๆฌๆฅๅฃ้ๅ็ฌๅผๆ้๏ผ่ท็งฏๅๆฒกๅ ณ็ณป๏ผ๏ผๅ ทไฝ่ฏทๅ้ [ๆ้่ฏดๆ](https://tushare.pro/document/1?doc_id=290)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+date | str | Y | ๆฅๆ๏ผ่พๅ ฅๆ ผๅผ๏ผYYYYMMDD ๆฏๅฆ๏ผ20181211๏ผ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+date | str | Y | ๆฅๆ+title | str | Y | ๆ ้ข+content | str | Y | ๅ ๅฎน++<br>+<br>++**ๆฅๅฃ่ฐ็จ**++```python++pro = ts.pro_api()++#่ทๅ2018ๅนด12ๆ11ๆฅๆฐ้ป่ๆญๆๅญ็จฟๅ ๅฎน+df = pro.cctv_news(date='20181211')++```++<br><br>++**ๆฐๆฎๆ ทไพ**++ๆไปฌๅฏนๆฐ้ป่ๆญ่ฟ่กไบๅๆฎตๅค็๏ผๅณๆฏไธไธชๅคงๆฎต้ฝๅ ไบๆ ้ขๅค็๏ผไพฟไบๅคงๅฎถ้ๆฉๅ่ฟๆปค๏ผไนๅฏไปฅๅๆๅฐไธ่ตท่ฟ่กๅๆใ++<img src="https://tushare.pro/files/img/cctv_news.png">+++<br>+<br>++ content+ 0 ไธญๅ ฑไธญๅคฎๅ ๅฒๅๆ็ฎ็ ็ฉถ้ข็ผ่พ็ใไน ่ฟๅนณ่ฐโไธๅธฆไธ่ทฏโใไธไนฆ๏ผๅทฒ็ฑไธญๅคฎๆ็ฎๅบ็็คพๅบ็๏ผๅณๆฅ่ตทๅจ...+ 1 ไน ่ฟๅนณๆปไนฆ่ฎฐ่งๅฏๅไบฌๆถๅผบ่ฐ๏ผ่ฆๅๆไบบๆฐๅๅธไธบไบบๆฐ๏ผไปฅๅไบฌๅธๆฐๆๅ ณๅฟ็้ฎ้ขไธบๅฏผๅ๏ผๅฏนๅคงๆฐๆฑกๆใ...+ 2 ไธญๅ ฑไธญๅคฎๆฟๆฒปๅฑๅธธๅงใๅ จๅฝๆฟๅไธปๅธญใไธญๅคฎไปฃ่กจๅขๅข้ฟๆฑชๆด๏ผ11ๆฅ็ไธญๅคฎไปฃ่กจๅขไธๅๅขๅจๅๅฎ็ๆๆ ฐ้ฎ...+ 3 ่ฟๆฅ๏ผๅฝๅก้ขๅๅ ฌๅ ๅฐๅใๅ ณไบๅฝๅฎถ็ปผๅๆงๆถ้ฒๆๆด่ฝฆ่พๆฌๆๅบๆฅๆๆดไธ็จๅท็ๆๅ ณไบ้กน็้็ฅใ๏ผๅฏนๅบ...+ 4 ๆน้ฉๅผๆพ40ๅนด๏ผๆๅฝๅฏนๅค่ดธๆๅฎ็ฐๅๅฒๆง่ทจ่ถ๏ผๅคๅๆ่ต็ฏๅขๆ็ปญๆนๅ๏ผๅฏนๅคๆ่ตๅไฝๆทฑๅ ฅๆจ่ฟใไปๅคฉ...+ 5 ๆญฃๅจๅฝๅฎถๅ็ฉ้ฆไธพ่ก็ไผๅคง็ๅ้ฉ--ๅบ็ฅๆน้ฉๅผๆพ40ๅจๅนดๅคงๅๅฑ่ง๏ผ็จไธไธชไธชไฝ ๆๅฐๅฎถ็ๅๅ๏ผ่ฎฐๅฝ...+ 6 ไธบ้้ๅบ็ฅๆน้ฉๅผๆพ40ๅจๅนด๏ผๅ จๆนไฝๅฑ็คบๆน้ฉๅผๆพๆณขๆพๅฃฎ้็ไผๅคงๅ็จ๏ผ็ฑไธญๅคฎๅฎฃไผ ้จใไธญๅคฎๆน้ฉๅใ...+ 7 ๅๅฑไธๆน้ฉ็็ฎๆ ๏ผๆฏ่ฎฉ็พๅงๆๅนธ็ฆใๅพๅฎๆ ใๅจๅนฟ่ฅฟ๏ผ่ฟ็ปญๆจ่ฟ็ๆฐ็ๅปบ่ฎพ๏ผๆๆนๅไบบๆฐ็ๆดปใๅข่ฟ็พ...+ 8 ๅฝๅก้ขๆฐ้ปๅๅ ฌๅฎคไปๅคฉๅฐฑโๆน้ฉๅผๆพไธ็ฅ่ฏไบงๆไบไธๅๅฑโไธพ่กไธญๅค่ฎฐ่ ่ง้ขไผ๏ผๅฝๅฎถ็ฅ่ฏไบงๆ้ขๅไปฃ่กจ...+ 9 ไธๅญฃๅบฆๅฝๅฎถ้ๅคงๆฟ็ญๆชๆฝ่ฝๅฎๆ ๅต่ท่ธชๅฎก่ฎก็ปๆๅๅธไธๅญฃๅบฆๅฝๅฎถ้ๅคงๆฟ็ญๆชๆฝ่ฝๅฎๆ ๅต่ท่ธชๅฎก่ฎก็ปๆ10...+ 10 10ๆฅ๏ผๅจๆณขๅ ฐๅกๆ็ปดๅ นไธพ่ก็่ๅๅฝๆฐๅๅๅๅคงไผๆ้ด๏ผ็ฑไธญๅฝๅ่ตทๆ็ซ็ๅ จ็่ฝๆบไบ่็ฝๅๅฑๅไฝ็ป...+ 11 ่ฑๅฝ่ฎฎไผไธ้ขๅๅฎไบ11ๆฅๅฐฑ่ฑๅฝๆฟๅบไธๆฌง็ๆญคๅ่พพๆ็โ่ฑๆฌงโๅ่ฎฎ่ๆก่ฟ่กๆ็ฅจ่กจๅณ๏ผไธ่ฟ่ฑๅฝ้ฆ็ธ...+ 12 ไนๅฐ็ปๆญขใไนไฟๅๅฅฝๆก็บฆใ ไฟ่กจ้ๆพไนๅ ๅ ฐๆป็ปๆณข็ฝ็ณ็ง10ๆฅ็ญพ็ฝฒไบๅ ณไบไนๆนๅณๅฎไธๅๅปถ้ฟใไนไฟๅ...\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\244\247\346\250\241\345\236\213\350\257\255\346\226\231\344\270\223\351\242\230\346\225\260\346\215\256/\346\226\260\351\227\273\351\200\232\350\256\257(\351\225\277\347\257\207).md" "b/agent/src/skills/tushare/references/\345\244\247\346\250\241\345\236\213\350\257\255\346\226\231\344\270\223\351\242\230\346\225\260\346\215\256/\346\226\260\351\227\273\351\200\232\350\256\257(\351\225\277\347\257\207).md"new file mode 100644index 000000000..ddbd665a7--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\244\247\346\250\241\345\236\213\350\257\255\346\226\231\344\270\223\351\242\230\346\225\260\346\215\256/\346\226\260\351\227\273\351\200\232\350\256\257(\351\225\277\347\257\207).md"@@ -0,0 +1,70 @@+## ๆฐ้ป้่ฎฏ+----++ๆฅๅฃ๏ผmajor_news+ๆ่ฟฐ๏ผ่ทๅ้ฟ็ฏ้่ฎฏไฟกๆฏ๏ผ่ฆ็ไธป่ฆๆฐ้ป่ต่ฎฏ็ฝ็ซ๏ผๆไพ่ถ ่ฟ8ๅนดๅๅฒๆฐ้ปใ+้้๏ผๅๆฌกๆๅคง400่ก่ฎฐๅฝ๏ผๅฏๅพช็ฏๆๅไฟๅญๅฐๆฌๅฐใ+็งฏๅ๏ผๆฌๆฅๅฃ้ๅ็ฌๅผๆ้๏ผ่ท็งฏๅๆฒกๅ ณ็ณป๏ผ๏ผๅ ทไฝ่ฏทๅ้ [ๆ้่ฏดๆ](https://tushare.pro/document/1?doc_id=290)++<br><br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+src | str | N | ๆฐ้ปๆฅๆบ๏ผๆฐๅ็ฝใๅคๅฐ่ดข็ปใๅ่ฑ้กบใๆฐๆตช่ดข็ปใๅๅฐ่ก่ง้ปใไธญ่ฏ็ฝใ่ดขๆฐ็ฝใ็ฌฌไธ่ดข็ปใ่ดข่็คพ๏ผ+start_date | str | N | ๆฐ้ปๅๅธๅผๅงๆถ้ด๏ผe.g. 2018-11-21 00:00:00+end_date | str | N | ๆฐ้ปๅๅธ็ปๆๆถ้ด๏ผe.g. 2018-11-22 00:00:00++<br><br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+title | str | Y | ๆ ้ข+content | str | N | ๅ ๅฎน (้ป่ฎคไธๆพ็คบ๏ผ้่ฆๅจfields้ๆๅฎ)+pub_time | str | Y | ๅๅธๆถ้ด+src | str | Y | ๆฅๆบ็ฝ็ซ+++<br><br>++**ๆฅๅฃ่ฐ็จ**++```python++pro = ts.pro_api()++df = pro.major_news(src='ๆฐๆตช่ดข็ป', start_date='2018-11-21 00:00:00', end_date='2018-11-22 00:00:00')++#ๆๅๆฐ้ปๅ ๅฎน+df = pro.major_news(src='ๆฐๆตช่ดข็ป', start_date='2018-11-21 00:00:00', end_date='2018-11-22 00:00:00', fields='title,content')+```++<br><br>++**ๆฐๆฎๆ ทไพ**++ title ... src_site+ 0 ๆบ่ฝ็ฏๅข๏ผไธญๆ 2.5ไบฟๅ ่ๅ ๅธ้คๅจๅบๅผ็ฉๅๆฑกๆณฅๅค็็น่ฎธ็ป่ฅ้กน็ฎ ... ็็ๆ็ๆ+ 1 ๅไฟก่กไปฝ๏ผๆ6900ไธๅ ๅบๅฎๅๆๅธๆฟ100%่กๆ ... ็็ๆ็ๆ+ 2 ็้ฉฌ้ฒ็โๆ ็ญพ้จโไพต็ฏไบ่ฐ๏ผ ... ๆฐๆตช่ดข็ป+ 3 ็ปๆตๆงไธไฝณๆ่ด็พๅคๅบงๆ ธ็ต็ซๆๅๅ ณๅ ... ไธญๅฝๅจ่ฝ็ฝ+ 4 ๆฑๆฃฎ่ชๆง๏ผๆฐๆถไปฃๆบๆ งๅป้ข็ฝ็ฎไนฆ๏ผ้ไธ่ฝฝ๏ผ ... 199IT+ 5 Gartner L2๏ผๅชๆ13%็ไผไธ่ฝๆไพๅ ทๆ้ซๅบฆ้ๅฏนๆง็ๆถๆฏ ... 199IT+ 6 ๆ่ฝฆๅธ๏ผ2018ๆฑฝ่ฝฆ่กไธๅคงๆฐๆฎๆฅๅ๏ผ้ไธ่ฝฝ๏ผ ... 199IT+ 7 ไบ่ฎฎไบๆ้ ๅบโ2000ๅ โ็ฝๅ ... ๅไบฌๅๆฅ+ 8 ๆ่ถ ๏ผๅ ๅฟซๆจๅจ่ตๆฌๅธๅบๆฐๅญๅ่ฝฌๅ ... ่ฏๅธๆถๆฅ็ฝ+ 9 ่ดข้ฉๅธๅบๅ้ฉโๅฒๅปโไผ ็ปไผฐๅผๆจกๅ ... ่ฏๅธๆถๆฅ็ฝ+ 10 A่กๆฏ้่ฆๆ่ตๆนๅไธป่ฆๅ ณๆณจไธคไธช้ขๅ ... ่ฏๅธๆถๆฅ็ฝ+ 11 ไธๅญฃๅบฆ็ฝ่ดทไบคๆ้ๆฎ่ทๆๆ่ดทใไนไฟกๆ่ท่ฝๅๅผบ ... ่ฏๅธๆถๆฅ็ฝ+ 12 ๆบๆๅ็บงๆบ่ฝไบคๆ ไธ้ฎ่ถ ้ขๅฟซ่ต่ดงๅธๅบ้ ... ่ฏๅธๆถๆฅ็ฝ+ 13 ๅ่ก่กไปฝ้็ปๅ็ๆถ้ดไธ่ถ ่ฟ10ไธชไบคๆๆฅ ... ่ฏๅธๆถๆฅ็ฝ+ 14 ๆทฑๆฒช่ฏๅธๅธๅบๆฏๆฅ่กๆ ... ่ฏๅธๆถๆฅ็ฝ+ 15 ๅ ณไบๆฐๅๆ็จณๆทปๅฉๅบๅธๅ่ฏๅธๆ่ตๅบ้ๅขๅ A็ฑปไปฝ้ขๅนถไฟฎๆนๅบ้ๅๅๅๆ็ฎกๅ่ฎฎ็ๅ ฌๅ ... ่ฏๅธๆถๆฅ็ฝ+ 16 ๅ ณไบๆฐๅข่ฏบไบๆญฃ่ก๏ผไธๆตท๏ผๅบ้้ๅฎๆ่ต้กพ้ฎๆ้ๅ ฌๅธไธบๅฏๅฎ่พพๆฐๅ ดๆ้ฟ็ตๆดป้ ็ฝฎๆททๅๅ่ฏๅธๆ่ตๅบ้ไปฃ... ... ่ฏๅธๆถๆฅ็ฝ+ 17 ๅๅฎๅบ้็ฎก็ๆ้ๅ ฌๅธๅ ฌๅ๏ผ็ณปๅ๏ผ ... ่ฏๅธๆถๆฅ็ฝ+ 18 ๅ ดไธ้ซๅคฉ็่ดงๅธๅธๅบๅบ้่ฐๆดๅคง้ข็ณ่ดญ(ๅซ่ฝฌๆข่ฝฌๅ ฅๅๅฎๆๅฎ้ขๆ่ต)้้ข็ๅ ฌๅ ... ่ฏๅธๆถๆฅ็ฝ+ 19 ่ดตๅท็พ็ตไผไธ้ๅขๅถ่ฏ่กไปฝๆ้ๅ ฌๅธๅ ณไบ้จๅ่ฃไบใ็ไบใ้ซ็บง็ฎก็ไบบๅใ่ฏๅธไบๅกไปฃ่กจๅขๆๅ ฌๅธ่กไปฝ่ฎก... ... ่ฏๅธๆถๆฅ็ฝ+ 20 ๅนฟๅทๆบๅ ็ตๆฐ่กไปฝๆ้ๅ ฌๅธๅ ณไบๅฌๅผๅ ฌๅธ2018ๅนด็ฌฌไบๆฌกไธดๆถ่กไธๅคงไผ็้็ฅ ... ่ฏๅธๆถๆฅ็ฝ\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\244\247\346\250\241\345\236\213\350\257\255\346\226\231\344\270\223\351\242\230\346\225\260\346\215\256/\346\267\261\350\257\201\346\230\223\344\272\222\345\212\250\351\227\256\347\255\224.md" "b/agent/src/skills/tushare/references/\345\244\247\346\250\241\345\236\213\350\257\255\346\226\231\344\270\223\351\242\230\346\225\260\346\215\256/\346\267\261\350\257\201\346\230\223\344\272\222\345\212\250\351\227\256\347\255\224.md"new file mode 100644index 000000000..580ab3710--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\244\247\346\250\241\345\236\213\350\257\255\346\226\231\344\270\223\351\242\230\346\225\260\346\215\256/\346\267\261\350\257\201\346\230\223\344\272\222\345\212\250\351\227\256\347\255\224.md"@@ -0,0 +1,82 @@+## ๆทฑ่ฏไบๅจๆ+----++**ๆฅๅฃ**๏ผirm_qa_sz๏ผๅๅฒๆฐๆฎๅผๅงไบ2010ๅนด10ๆใ+**ๆ่ฟฐ**๏ผไบๅจๆๆฏ็ฑๆทฑไบคๆๅฎๆนๆจๅบ,ไพๆ่ต่ ไธไธๅธๅ ฌๅธ็ดๆฅๆฒ้็ๅนณๅฐ,ไธ็ซๅผๅ ฌๅธ่ต่ฎฏๆฑ้,ๆไพ็ฌฌไธๆ็ไบๅจ้ฎ็ญใๆ่ต่ ๅ ณ็ณปไฟกๆฏใๅ ฌๅธๅฃฐ้ณ็ญๅ ๅฎนใ+**้้**๏ผๅๆฌก่ฏทๆฑๆๅคง่ฟๅ3000่กๆฐๆฎ๏ผๅฏๆ นๆฎ่ก็ฅจไปฃ็ ๏ผๆฅๆ็ญๅๆฐๅพช็ฏๆๅๅ จ้จๆฐๆฎ+**ๆ้**๏ผ็จๆทๅ120็งฏๅๅฏไปฅ่ฏ็จ๏ผๆญฃๅผๆ้ไธบ10000็งฏๅ๏ผๆ็ณ่ฏทๅ็ฌๅผๆ้๏ผ่ฏทๅ่[ๆ้่ฏดๆ](https://tushare.pro/document/1?doc_id=290)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ๏ผๆ ผๅผYYYYMMDD๏ผไธๅ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+pub_date | str | N | ๅๅธๅผๅงๆฅๆ(ๆ ผๅผ๏ผ2025-06-03 16:43:03)+pub_date | str | N | ๅๅธ็ปๆๆฅๆ(ๆ ผๅผ๏ผ2025-06-03 18:43:23)++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +name | str | Y | ๅ ฌๅธๅ็งฐ+trade_date | str | Y | ๅๅธๆถ้ด+q | str | Y | ้ฎ้ข+a | str | Y | ๅๅค+pub_time | str | Y | ็ญๅคๆถ้ด+industry | str | Y | ๆถๅ่กไธ++<br>+<br>++**ๆฅๅฃ่ฐ็จ**++```python++pro = ts.pro_api()++#่ทๅ2025ๅนด2ๆ12ๆฅๆทฑ่ฏไบๅจๆ็้ฎ็ญๆๆฌ+df = pro.irm_qa_sz(ann_date='20250212')++```++<br>++**ๆฐๆฎๆ ทไพ**++<img src='https://tushare.pro/files/web/e.png'>++ ts_code name trade_date q a pub_time industry+ 0 002254 ๆณฐๅๆฐๆ 20250212 ่ฏท้ฎๅฎๆปๅ ฌๅธๆๆ F12่ณ็บถ็็ ็ฉถๆๆ๏ผๆๆ ้ๆฉไธๅฎถๅพๆๅๅฑๅ้็ๅ ฌๅธๅนถ่ดญ้็ป๏ผๆๅ ฌๅธๅๅคงๅๅผบใ ๆจๅฅฝ๏ผ้ๅธธๆ่ฐขๆจๅฏนๅ ฌๅธ็ๅ ณๆณจใๅ ฌๅธๆญฃ็ ๅ็ฑปไผผไบงๅ๏ผไปฅไธฐๅฏๅ ฌๅธ็ไบงๅๅ็ฑปใ่ฐข่ฐข๏ผ 2025-02-12 21:46:32 ๅถ้ ไธ+ 1 002122 ๆฑๆดฒๆบ่ฝ 20250212 ๅฐๆฌ็่ฃ็ง๏ผ่ฝๅฆๅ็ญไธไธ๏ผๅ ฌๅธๆง่กๅญๅ ฌๅธ็ญ็ญๆๅไธๅนปๆน้ๅๆฏๅฆๆๅไฝ๏ผ ๆจๅฅฝ๏ผ็ปๆ ธๆฅ๏ผๅ ฌๅธๅๆง่กๅ ฌๅธ็ญ็ญๆๅไธโๅนปๆน้ๅโๆ ๅไฝๅ ณ็ณปใใ่ฏๅธๆถๆฅใๅๅทจๆฝฎ่ต่ฎฏ็ฝ๏ผht... 2025-02-12 15:02:17 ๅถ้ ไธ+ 2 300675 ๅปบ็ง้ข 20250212 ๅ ฌๅธๅญๅ ฌๅธ้ๅฎ็ปฟ็ ๆบๅบๆๆฒกๆทฑๅบฆๅไธ้จ็ฝฒ้ๅฎไธญๅฟdeepseekๅปบๆจก๏ผ ๆจๅฅฝ๏ผๅ ฌๅธๅๅญๅ ฌๅธ้ๅฎ็ปฟ็ ๆบๅบๆ้ๅ ฌๅธๆช็ฅๆ้ฎ้ขๆๆถไบ้กนใๆ่ฐขๆจ็ๅ ณๆณจใ 2025-02-12 18:31:18 ็งๅญฆ็ ็ฉถๅๆๆฏๆๅกไธ+ 3 002531 ๅคฉ้กบ้ฃ่ฝ 20250212 ๆฑๆปใๅฑๅ ฌๅธๅพทๅฝ็็ไบงๅบๅฐ่ฟๅฑๅฆไฝโฆ๏ผไปไนๆถๅ้ไบง๏ผๅฑๅ ฌๅธ่่ธๅฎๅฐ็จณๆญฅๅ่กโฆๆฏๅฆๆ็ฎๅไธ็ๆฉ... ๆ่ต่ ไฝ ๅฅฝ๏ผๅพทๅฝๅบๅฐๅปบ่ฎพ้กบๅฉๆจ่ฟ๏ผๅ ทไฝๆไบงๆถ้ดไปฅๅฎๆๆฅๅๆซ้ฒไธบๅใ็ฎๅๅ ฌๅธๆๆ ไธ็็ไบงๅบๅฐไปฅ... 2025-02-12 17:59:40 ๅถ้ ไธ+ 4 301162 ๅฝ่ฝๆฅๆฐ 20250212 ๅฐๆฌ็่ฃ็งๆจๅฅฝ๏ผ็ฎๅๅฝๅ ไปฅDEEPSEEKไธบไปฃ่กจ็ไบบๅทฅๆบ่ฝๅฟซ้ๅๅฑ๏ผๅ ฌๅธไฝไธบๅ็้ขๆต็ธๅ ณ็ๆ... ๆจๅฅฝ๏ผDeepSeekๅฝไบงๅผๆบๅคงๆจกๅๅฐไธบไผๅค็่กไธๅบ็จๅจๆๆฏๅๆฐไผๅใๆๆฌๆงๅถๅๆๅก่ฝๅไธๅธฆ... 2025-02-12 17:34:33 ไฟกๆฏไผ ่พใ่ฝฏไปถๅไฟกๆฏๆๆฏๆๅกไธ+ 5 300856 ็งๆ่กไปฝ 20250212 ่ฏท้ฎ๏ผๆช่ณ2025ๅนดไบๆ 10ๆฅๅ ฌๅธ็่กไธๆปๆฐๆฏๅคๅฐ๏ผ่ฐข่ฐข ๅฐๆฌ็ๆ่ต่ ๏ผๆจๅฅฝ๏ผๆช่ณ2025ๅนด2ๆ10ๆฅ๏ผๅ ฌๅธ่กไธไบบๆฐไธบ22,400ไฝๆทใๆ่ฐขๆจ็ๅ ณๆณจ๏ผ 2025-02-12 17:33:46 ๅถ้ ไธ+ 6 300558 ่ด่พพ่ฏไธ 20250212 ่ฏท้ฎ่ดตๅ ฌๅธๆ่ฟ่กไปท็ฆปๅฅ่ฟ็ปญๆด่ท๏ผๅ ฌๅธๆฏๅฆๅญๅจ้ๅคง็ป่ฅ้ฎ้ขๆชๆซ้ฒ๏ผ\nๅฆๅค๏ผๅ ฌๅธๅจ่ฏ็ฉ็ ๅไธๆฏ... ๆจๅฅฝ๏ผ็ฎๅ๏ผๅ ฌๅธ็ไบง็ป่ฅๆดปๅจไธๅๆญฃๅธธ๏ผไธๅญๅจๅบๆซ้ฒๆชๆซ้ฒไบ้กนใ็ญๆๅ ่กไปทๅๅธๅบๅ ็ด ็ญๅฝฑๅ่ๆณข... 2025-02-12 17:09:35 ๅถ้ ไธ+ 7 301399 ่ฑ็น็งๆ 20250212 ๅ ฌๅธ็ฎๅ่กไธไบบๆฐๆฏๅคๅฐ๏ผ ๆจๅฅฝ๏ผๆ นๆฎๅ ฌๅธ2024ๅนด็ฌฌไธๅญฃๅบฆๆฅๅ๏ผๆฅๅๆๆซๆฎ้่ก่กไธๆปๆฐไธบ11,007ๆทใๅ ฌๅธ่กไธๆทๆฐๅฐ... 2025-02-12 16:02:15 ๅถ้ ไธ+ 8 300597 ๅๅคง้ไฟก 20250212 ไฝ ๅฅฝ๏ผ่ฏท้ฎ่ดตๅ ฌๅธๆฏๅฆไธ้ฟ้ๅทดๅทดๆๅไฝ๏ผ ๆ่ฐขๆจ็ๅ ณๆณจ๏ผๆช่ณ็ฎๅๅ ฌๅธไธ้ฟ้ๅทดๅทดๆๆ ็ดๆฅๅไฝใ 2025-02-12 15:59:17 ไฟกๆฏไผ ่พใ่ฝฏไปถๅไฟกๆฏๆๆฏๆๅกไธ+ 9 002926 ๅ่ฅฟ่ฏๅธ 20250212 ๅฐๆฌ็่ฃ็ง๏ผ่ฏท้ฎๆชๆญข2025ๅนด2ๆ10ๆฅ๏ผๆๆฐ็่กไธๆทๆฐๆฏๅคๅฐ๏ผ่ฐข่ฐขใ ๅฐๆฌ็ๆ่ต่ ๏ผๅ ฌๅธๅจๅฎๆๆฅๅไธญๆซ้ฒ่กไธไบบๆฐ๏ผ่ฏท็ๆๅ ฌๅธๅฎๆๆฅๅใๆ่ฐขๆจ็ๅ ณๆณจใ 2025-02-12 15:58:48 ้่ไธ+ 10 002480 ๆฐ็ญ่กไปฝ 20250212 ่ฏท้ฎๆชๆญข2025ๅนด2ๆ10ๆฅ๏ผๅ ฌๅธ่กไธไบบๆฐๅคๅฐ๏ผ ๆจๅฅฝ๏ผๆชๆญข2025ๅนด2ๆ10ๆฅ๏ผๅ ฌๅธ่กไธๆทๆฐไธบ32,833๏ผ่ฐข่ฐขใ 2025-02-12 15:56:08 ๅถ้ ไธ+ 11 301125 ่ พไบ็ฒพๅทฅ 20250212 ่ฏท้ฎ๏ผๆช่ณ2025ๅนดไบๆ 10ๆฅๅ ฌๅธ็่กไธๆปๆฐๆฏๅคๅฐ๏ผ่ฐข่ฐข ๅฐๆฌ็ๆ่ต่ ๏ผๆจๅฅฝ๏ผๆ นๆฎไธญๅฝ่ฏๅธ็ป่ฎฐ็ป็ฎๆ้่ดฃไปปๅ ฌๅธๆทฑๅณๅๅ ฌๅธๆๆฐไธๅ็่กไธๅๅ๏ผๆช่ณ202... 2025-02-12 15:55:07 ๅถ้ ไธ+ 12 002203 ๆตทไบฎ่กไปฝ 20250212 ่ฃ็ง๏ผ่ดตๅธๆฏๅฝๅ ๅ่กไธ็ๅคด้จไผไธ๏ผไธๅจๅฝ้ ็ธๅ ณ่กไธๅๅฑไธญๆฅๆ่พๅผบ็็ซไบๅๅฐไฝใ็นๅซๆฏ่ฟๅนดๆฅ๏ผ... ๆจๅฅฝ๏ผ้ๅธธๆ่ฐขๆจๅฏนๅ ฌๅธ็ๅ ณๆณจใๅ ฌๅธ่กไปทๅๅค้ๅ ็ด ๅฝฑๅ๏ผๅญๅจ็ญๆไธ็กฎๅฎๆงใๅ ฌๅธไธๆณจ่ช่บซไธๅกๅๅฑ... 2025-02-12 17:02:11 ๅถ้ ไธ+ 13 003041 ็็ฑ็พๅฎถ 20250212 ่ฏท้ฎ๏ผๆช่ณ2025ๅนดไบๆ 10ๆฅๅ ฌๅธ็่กไธๆปๆฐๆฏๅคๅฐ๏ผ่ฐข่ฐข ๅฐๆฌ็ๆ่ต่ ๏ผ ๆ่ฐขๆจๅฏน็็ฑ็พๅฎถ็ๅ ณๆณจ๏ผ ๆ นๆฎไธญ่ฏ็ปๆๆฐๆฐๆฎ๏ผๆช่ณ2025ๅนด2ๆ10ๆฅ๏ผๅๅนถ... 2025-02-12 15:53:38 ๅถ้ ไธ+ 14 002182 ๅฎๆญฆ้ไธ 20250212 ๆจๅฅฝ๏ผ่ฏท้ฎๆช่ณ2ๆ10ๆฅๆถ็ๅ ฌๅธ่กไธไบบๆฐๆฏๅคๅฐ๏ผ่ฐข่ฐข๏ผ ๆจๅฅฝ,ๆช่ณ2025ๅนด2ๆ10ๆฅ็่กไธๆทๆฐไธบ59093,่ฐข่ฐขใ 2025-02-12 15:52:07 ๅถ้ ไธ+ 15 300534 ้็ฅๆๅ 20250212 ่ฃ็งๆจๅฅฝ๏ผ่ฏท้ฎๆชๆญขๅฐ2ๆ10ๆฅๅ ฌๅธ่กไธไบบๆฐๆฏๅคๅฐ๏ผ่ฐข่ฐขใ ๅฐๆฌ็ๆ่ต่ ๆจๅฅฝ๏ผๆ นๆฎไธญๅฝ่ฏๅธ็ป่ฎฐ็ป็ฎๆ้่ดฃไปปๅ ฌๅธๆไพ็ๆฐๆฎ๏ผๆชๆญข2025ๅนด2ๆ10ๆฅๅ ฌๅธ่ก... 2025-02-12 15:48:30 ๅถ้ ไธ+ 16 300760 ่ฟ็ๅป็ 20250212 ๅ ฌๅธAiๅบ็จๆฏๅฆๅฏไปฅๆฅๅ ฅๆๅทฒ็ปๆฅๅ ฅdeepseek๏ผ ๆจๅฅฝ๏ผ่ฐข่ฐขๅ ณๆณจใ่ฟ็่ดๅไบๆ้ ็งๅฎค็บงๅบ็จ็ๅ็ดๅคงๆจกๅ๏ผไปๅบๅบงๅฐๅ็ดๅบ็จ๏ผ่ฟๆฏๅๆฅ่ฟ็ไธดๅบไผๅฟ... 2025-02-12 16:56:09 ๅถ้ ไธ+ 17 000785 ๅฑ ็ถๆบๅฎถ 20250212 ่ดตๅธ้คไบๅจๆพณ้จ๏ผๆฐๅ ๅกๅๆฌๅๅฏจๆๅๅบ๏ผๆฅไธๆฅๅ ๅนด้๏ผ่ฟๆๆ็ฎๅจๅชไบๅฐๆนๅผๅบ็่ฎกๅๅ๏ผ่ฝๅฆ้้ฒ... ๅฐๆฌ็ๆ่ตไบบๆจๅฅฝ๏ผ2024ๅนดๅ ฌๅธๅ ๅๅจๆฌๅๅฏจๅๆพณ้จๅผ่ฎพไธคๅฎถๅๅบ๏ผๆฐๅ ๅกๆฒกๆๅๅบใ่ฏฆๆ ่ฏทๅ ณๆณจๅ ฌ... 2025-02-12 15:35:57 ็ง่ตๅๅๅกๆๅกไธ+ 18 002250 ่ๅ็งๆ 20250212 ๅ ฌๅธ็็ฉบๅท่ฎพๅค่ฝไธ่ฝๅบ็จไบๆฐๆฎไธญๅฟๅทๅด๏ผ ๆจๅฅฝ๏ผๅ ฌๅธไผ็งฏๆๅขๅผบ็ ๅๅฎๅๅๆๆฏๅจๅค๏ผๅๅคงๅๅผบๅ ฌๅธไธๅกใๆ่ฐขๆจ็ๅ ณๆณจ๏ผ 2025-02-12 16:41:46 ๅถ้ ไธ+ 19 002387 ็ปดไฟก่ฏบ 20250212 ๅ ฌๅธ็ฐๅจ๏ผ่ฟๆๅคๅฐ่กๆฐใ้็ป่ฟๅฑๅฐ้ฃไธช้ถๆฎตไบใ ๆ่ฐขๆจ็ๅ ณๆณจใๆช่ณ2025ๅนด2ๆ10ๆฅ๏ผๅ ฌๅธ่กไธไบบๆฐไธบ74,343ๆทใๅ ฌๅธๆญฃๅจๆ็ปญๆจ่ฟ้ๅคง่ต... 2025-02-12 15:34:59 ๅถ้ ไธ+ 20 002250 ่ๅ็งๆ 20250212 ่ดตๅธๆๆฒกๆๆฅๅ ฅDeepseek ๅคงๆจกๅ๏ผ ๆจๅฅฝ๏ผๅ ฌๅธๆๆชๆฅๅ ฅDeepseek๏ผๅ ฌๅธไผ็งฏๆๅขๅผบ็ ๅๅฎๅๅๆๆฏๅจๅค๏ผๅๅคงๅๅผบๅ ฌๅธไธๅกใๆ่ฐข... 2025-02-12 16:41:21 ๅถ้ ไธ+ 21 002567 ๅไบบ็ฅ 20250212 ่ฃ็งไฝ ๅฅฝ ่ฏท้ฎๅ ฌๅธ2025ๅนด็็ชๅฎๅ จๅ ปๆฎๆๆฌ็ฎๆ ๆฏๅคๅฐ ่ฐข่ฐขๆจ็ๅ ณๆณจใๅ ฌๅธๅง็ป่ดๅไบไฝๆๆฌ็ไบงไฝ็ณปๅปบ่ฎพ๏ผ็ฎๅๅ ฌๅธไธป่ฆ้่ฟไผๅ้ฅฒๆ้ ๆนใ้ไฝๅๆ้่ดญไปท... 2025-02-12 15:34:27 ๅถ้ ไธ+ 22 300989 ่พๅฅฅ่งๅ 20250212 ่ฏท้ฎ๏ผๆช่ณ2025ๅนดไบๆ 10ๆฅๅ ฌๅธ็่กไธๆปๆฐๆฏๅคๅฐ๏ผ่ฐข่ฐข ๅฐๆฌ็ๆ่ต่ ๏ผๆจๅฅฝ๏ผๆชๆญข่ณ2025ๅนด2ๆ10ๆฅ๏ผๅ ฌๅธ่กไธๆปๆทๆฐ9,267ๆท๏ผๅ ถไธญๆบๆ่กไธๆปๆท... 2025-02-12 15:30:46 ็งๅญฆ็ ็ฉถๅๆๆฏๆๅกไธ+ 23 003031 ไธญ็ท็ตๅญ 20250212 ่ฃ็ง่พ่ฆไบ๏ผ็ฒพๅฏ้ถ็ท้ถ้จไปถ็จๆฐงๅ้ใๆฐฎๅ้ๆ ธๅฟๆๆๅ้ ๅฅ็้ๅฑๅไฝ็ณปๅจๅฆ็ซๅฆ่ผ็ๅๅฏผไฝไบงไธๆ... ๅฐๆฌ็ๆ่ต่ ๏ผๆจๅฅฝใๅ ฌๅธ็ฒพๅฏ้ถ็ท้ถ้จไปถๆฏ้็จๆฐงๅ้ใๆฐฎๅ้็ญๅ ่ฟ้ถ็ท็ป็ฒพๅฏๅ ๅทฅๅๅถๅค็ๅๅฏผไฝ... 2025-02-12 16:25:55 ๅถ้ ไธ\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\344\273\267\346\240\274\346\214\207\346\225\260/\345\261\205\346\260\221\346\266\210\350\264\271\344\273\267\346\240\274\346\214\207\346\225\260(CPI).md" "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\344\273\267\346\240\274\346\214\207\346\225\260/\345\261\205\346\260\221\346\266\210\350\264\271\344\273\267\346\240\274\346\214\207\346\225\260(CPI).md"new file mode 100644index 000000000..94cb5d083--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\344\273\267\346\240\274\346\214\207\346\225\260/\345\261\205\346\260\221\346\266\210\350\264\271\344\273\267\346\240\274\346\214\207\346\225\260(CPI).md"@@ -0,0 +1,77 @@+## ๅฑ ๆฐๆถ่ดนไปทๆ ผๆๆฐ+----++ๆฅๅฃ๏ผcn_cpi+ๆ่ฟฐ๏ผ่ทๅCPIๅฑ ๆฐๆถ่ดนไปทๆ ผๆฐๆฎ๏ผๅ ๆฌๅ จๅฝใๅๅธๅๅๆ็ๆฐๆฎ+้้๏ผๅๆฌกๆๅคง5000่ก๏ผไธๆฌกๅฏไปฅๆๅๅ จ้จๆฐๆฎ+ๆ้๏ผ็จๆท็งฏ็ดฏ600็งฏๅๅฏไปฅไฝฟ็จ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+m | str | N | ๆไปฝ๏ผYYYYMM๏ผไธๅ๏ผ๏ผๆฏๆๅคไธชๆไปฝๅๆถ่พๅ ฅ๏ผ้ๅทๅ้+start_m | str | N | ๅผๅงๆไปฝ+end_m | str | N | ็ปๆๆไปฝ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+month | str | Y | ๆไปฝYYYYMM+nt_val | float | Y | ๅ จๅฝๅฝๆๅผ+nt_yoy | float | Y | ๅ จๅฝๅๆฏ๏ผ%๏ผ+nt_mom | float | Y | ๅ จๅฝ็ฏๆฏ๏ผ%๏ผ+nt_accu | float | Y | ๅ จๅฝ็ดฏ่ฎกๅผ+town_val | float | Y | ๅๅธๅฝๆๅผ+town_yoy | float | Y | ๅๅธๅๆฏ๏ผ%๏ผ+town_mom | float | Y | ๅๅธ็ฏๆฏ๏ผ%๏ผ+town_accu | float | Y | ๅๅธ็ดฏ่ฎกๅผ+cnt_val | float | Y | ๅๆๅฝๆๅผ+cnt_yoy | float | Y | ๅๆๅๆฏ๏ผ%๏ผ+cnt_mom | float | Y | ๅๆ็ฏๆฏ๏ผ%๏ผ+cnt_accu | float | Y | ๅๆ็ดฏ่ฎกๅผ++<br>+<br>++**ๆฅๅฃ่ฐ็จ**++```python++pro = ts.pro_api()++df = pro.cn_cpi(start_m='201801', end_m='201903')+++#่ทๅๆๅฎๅญๆฎต+df = pro.cn_cpi(start_q='201801', end_q='201903', fields='month,nt_val,nt_yoy')++```++<br>++**ๆฐๆฎๆ ทไพ**++ month nt_val nt_yoy nt_mom nt_accu town_val town_yoy town_mom town_accu cnt_val cnt_yoy cnt_mom cnt_accu+ 0 201903 102.30 2.30 -0.40 101.80 102.30 2.30 -0.40 101.90 102.30 2.30 -0.30 101.80+ 1 201902 101.50 1.50 1.00 101.60 101.50 1.50 1.00 101.60 101.40 1.40 0.90 101.50+ 2 201901 101.70 1.70 0.50 101.70 101.80 1.80 0.50 101.80 101.70 1.70 0.40 101.70+ 3 201812 101.90 1.90 0.00 102.10 101.90 1.90 0.00 102.10 101.90 1.90 0.00 102.10+ 4 201811 102.20 2.20 -0.30 102.10 102.20 2.20 -0.40 102.10 102.20 2.20 -0.30 102.10+ 5 201810 102.50 2.50 0.20 102.10 102.50 2.50 0.20 102.10 102.60 2.60 0.20 102.10+ 6 201809 102.50 2.50 0.70 102.10 102.40 2.40 0.70 102.10 102.50 2.50 0.80 102.00+ 7 201808 102.30 2.30 0.70 102.00 102.30 2.30 0.60 102.00 102.30 2.30 0.80 102.00+ 8 201807 102.10 2.10 0.30 102.00 102.10 2.10 0.40 102.00 102.00 2.00 0.10 101.90+ 9 201806 101.90 1.90 -0.10 102.00 101.80 1.80 0.00 102.00 101.90 1.90 -0.10 101.90+ 10 201805 101.80 1.80 -0.20 102.00 101.80 1.80 -0.20 102.00 101.70 1.70 -0.10 101.90+ 11 201804 101.80 1.80 -0.20 102.10 101.80 1.80 -0.20 102.10 101.70 1.70 -0.30 101.90+ 12 201803 102.10 2.10 -1.10 102.10 102.10 2.10 -1.10 102.20 101.90 1.90 -1.20 102.00+ 13 201802 102.90 2.90 1.20 102.20 103.00 3.00 1.30 102.20 102.70 2.70 1.10 102.10+ 14 201801 101.50 1.50 0.60 101.50 101.50 1.50 0.60 101.50 101.50 1.50 0.60 101.50diff --git "a/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\344\273\267\346\240\274\346\214\207\346\225\260/\345\267\245\344\270\232\347\224\237\344\272\247\350\200\205\345\207\272\345\216\202\344\273\267\346\240\274\346\214\207\346\225\260(PPI).md" "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\344\273\267\346\240\274\346\214\207\346\225\260/\345\267\245\344\270\232\347\224\237\344\272\247\350\200\205\345\207\272\345\216\202\344\273\267\346\240\274\346\214\207\346\225\260(PPI).md"new file mode 100644index 000000000..c6ef77cdb--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\344\273\267\346\240\274\346\214\207\346\225\260/\345\267\245\344\270\232\347\224\237\344\272\247\350\200\205\345\207\272\345\216\202\344\273\267\346\240\274\346\214\207\346\225\260(PPI).md"@@ -0,0 +1,90 @@+## ๅทฅไธ็ไบง่ ๅบๅไปทๆ ผๆๆฐ+----++ๆฅๅฃ๏ผcn_ppi+ๆ่ฟฐ๏ผ่ทๅPPIๅทฅไธ็ไบง่ ๅบๅไปทๆ ผๆๆฐๆฐๆฎ+้้๏ผๅๆฌกๆๅคง5000๏ผไธๆฌกๅฏไปฅๆๅๅ จ้จๆฐๆฎ+ๆ้๏ผ็จๆท600็งฏๅๅฏไปฅไฝฟ็จ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)+++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+m | str | N | ๆไปฝ๏ผYYYYMM๏ผไธๅ๏ผ๏ผๆฏๆๅคไธชๆไปฝๅๆถ่พๅ ฅ๏ผ้ๅทๅ้+start_m | str | N | ๅผๅงๆไปฝ+end_m | str | N | ็ปๆๆไปฝ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+month | str | Y | ๆไปฝYYYYMM+ppi_yoy | float | Y | PPI๏ผๅ จ้จๅทฅไธๅ๏ผๅฝๆๅๆฏ+ppi_mp_yoy | float | Y | PPI๏ผ็ไบง่ตๆ๏ผๅฝๆๅๆฏ+ppi_mp_qm_yoy | float | Y | PPI๏ผ็ไบง่ตๆ๏ผ้ๆไธ๏ผๅฝๆๅๆฏ+ppi_mp_rm_yoy | float | Y | PPI๏ผ็ไบง่ตๆ๏ผๅๆไธ๏ผๅฝๆๅๆฏ+ppi_mp_p_yoy | float | Y | PPI๏ผ็ไบง่ตๆ๏ผๅ ๅทฅไธ๏ผๅฝๆๅๆฏ+ppi_cg_yoy | float | Y | PPI๏ผ็ๆดป่ตๆ๏ผๅฝๆๅๆฏ+ppi_cg_f_yoy | float | Y | PPI๏ผ็ๆดป่ตๆ๏ผ้ฃๅ็ฑป๏ผๅฝๆๅๆฏ+ppi_cg_c_yoy | float | Y | PPI๏ผ็ๆดป่ตๆ๏ผ่กฃ็็ฑป๏ผๅฝๆๅๆฏ+ppi_cg_adu_yoy | float | Y | PPI๏ผ็ๆดป่ตๆ๏ผไธ่ฌๆฅ็จๅ็ฑป๏ผๅฝๆๅๆฏ+ppi_cg_dcg_yoy | float | Y | PPI๏ผ็ๆดป่ตๆ๏ผ่็จๆถ่ดนๅ็ฑป๏ผๅฝๆๅๆฏ+ppi_mom | float | Y | PPI๏ผๅ จ้จๅทฅไธๅ๏ผ็ฏๆฏ+ppi_mp_mom | float | Y | PPI๏ผ็ไบง่ตๆ๏ผ็ฏๆฏ+ppi_mp_qm_mom | float | Y | PPI๏ผ็ไบง่ตๆ๏ผ้ๆไธ๏ผ็ฏๆฏ+ppi_mp_rm_mom | float | Y | PPI๏ผ็ไบง่ตๆ๏ผๅๆไธ๏ผ็ฏๆฏ+ppi_mp_p_mom | float | Y | PPI๏ผ็ไบง่ตๆ๏ผๅ ๅทฅไธ๏ผ็ฏๆฏ+ppi_cg_mom | float | Y | PPI๏ผ็ๆดป่ตๆ๏ผ็ฏๆฏ+ppi_cg_f_mom | float | Y | PPI๏ผ็ๆดป่ตๆ๏ผ้ฃๅ็ฑป๏ผ็ฏๆฏ+ppi_cg_c_mom | float | Y | PPI๏ผ็ๆดป่ตๆ๏ผ่กฃ็็ฑป๏ผ็ฏๆฏ+ppi_cg_adu_mom | float | Y | PPI๏ผ็ๆดป่ตๆ๏ผไธ่ฌๆฅ็จๅ็ฑป๏ผ็ฏๆฏ+ppi_cg_dcg_mom | float | Y | PPI๏ผ็ๆดป่ตๆ๏ผ่็จๆถ่ดนๅ็ฑป๏ผ็ฏๆฏ+ppi_accu | float | Y | PPI๏ผๅ จ้จๅทฅไธๅ๏ผ็ดฏ่ฎกๅๆฏ+ppi_mp_accu | float | Y | PPI๏ผ็ไบง่ตๆ๏ผ็ดฏ่ฎกๅๆฏ+ppi_mp_qm_accu | float | Y | PPI๏ผ็ไบง่ตๆ๏ผ้ๆไธ๏ผ็ดฏ่ฎกๅๆฏ+ppi_mp_rm_accu | float | Y | PPI๏ผ็ไบง่ตๆ๏ผๅๆไธ๏ผ็ดฏ่ฎกๅๆฏ+ppi_mp_p_accu | float | Y | PPI๏ผ็ไบง่ตๆ๏ผๅ ๅทฅไธ๏ผ็ดฏ่ฎกๅๆฏ+ppi_cg_accu | float | Y | PPI๏ผ็ๆดป่ตๆ๏ผ็ดฏ่ฎกๅๆฏ+ppi_cg_f_accu | float | Y | PPI๏ผ็ๆดป่ตๆ๏ผ้ฃๅ็ฑป๏ผ็ดฏ่ฎกๅๆฏ+ppi_cg_c_accu | float | Y | PPI๏ผ็ๆดป่ตๆ๏ผ่กฃ็็ฑป๏ผ็ดฏ่ฎกๅๆฏ+ppi_cg_adu_accu | float | Y | PPI๏ผ็ๆดป่ตๆ๏ผไธ่ฌๆฅ็จๅ็ฑป๏ผ็ดฏ่ฎกๅๆฏ+ppi_cg_dcg_accu | float | Y | PPI๏ผ็ๆดป่ตๆ๏ผ่็จๆถ่ดนๅ็ฑป๏ผ็ดฏ่ฎกๅๆฏ++<br>+<br>++**ๆฅๅฃ่ฐ็จ**++```python++pro = ts.pro_api()++df = pro.cn_ppi(start_m='201905', end_m='202005')+++#่ทๅๆๅฎๅญๆฎต+df = pro.cn_ppi(start_m='201905', end_m='202005', fields='month,ppi_yoy,ppi_mom,ppi_accu')++```++<br>++**ๆฐๆฎๆ ทไพ**++ month ppi_yoy ppi_mom ppi_accu+ 0 202005 -3.70 -0.40 -1.70+ 1 202004 -3.10 -1.30 -1.20+ 2 202003 -1.50 -1.00 -0.60+ 3 202002 -0.40 -0.50 -0.20+ 4 202001 0.10 0.00 0.10+ 5 201912 -0.50 0.00 -0.30+ 6 201911 -1.40 -0.10 -0.30+ 7 201910 -1.60 0.10 -0.20+ 8 201909 -1.20 0.10 0.00+ 9 201908 -0.80 -0.10 0.10+ 10 201907 -0.30 -0.20 0.20+ 11 201906 0.00 -0.30 0.30+ 12 201905 0.60 0.20 0.40+diff --git "a/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\345\210\251\347\216\207\346\225\260\346\215\256/Hibor\345\210\251\347\216\207.md" "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\345\210\251\347\216\207\346\225\260\346\215\256/Hibor\345\210\251\347\216\207.md"new file mode 100644index 000000000..15679d164--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\345\210\251\347\216\207\346\225\260\346\215\256/Hibor\345\210\251\347\216\207.md"@@ -0,0 +1,100 @@+## Hiborๅฉ็+----++ๆฅๅฃ๏ผhibor+ๆ่ฟฐ๏ผHiborๅฉ็+้้๏ผๅๆฌกๆๅคง4000่กๆฐๆฎ๏ผๆป้ไธ้ๅถ๏ผๅฏ้่ฟ่ฎพ็ฝฎๅผๅงๅ็ปๆๆฅๆๅๆฎต่ทๅ+็งฏๅ๏ผ็จๆท็งฏ็ดฏ120็งฏๅๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++> HIBOR (Hongkong InterBank Offered Rate)๏ผๆฏ้ฆๆธฏ้ถ่กๅ่กไธๆๅๅฉ็ใๆ้ฆๆธฏ่ดงๅธๅธๅบไธ๏ผ้ถ่กไธ้ถ่กไน้ด็ไธๅนดๆไปฅไธ็็ญๆ่ต้ๅ่ดทๅฉ็๏ผไปไผฆๆฆๅไธๆๅๅฉ็๏ผLIBOR๏ผๅๅๅบๆฅ็ใ++<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+date | str | N | ๆฅๆ (ๆฅๆ่พๅ ฅๆ ผๅผ๏ผYYYYMMDD๏ผไธๅ)+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+date | str | Y | ๆฅๆ+on | float | Y | ้ๅค+1w | float | Y | 1ๅจ+2w | float | Y | 2ๅจ+1m | float | Y | 1ไธชๆ+2m | float | Y | 2ไธชๆ+3m | float | Y | 3ไธชๆ+6m | float | Y | 6ไธชๆ+12m | float | Y | 12ไธชๆ++<br>++**ๆฅๅฃ่ฐ็จ**++```python++pro = ts.pro_api()++df = pro.hibor(start_date='20180101', end_date='20181130')++```++<br>++**ๆฐๆฎๆ ทไพ**++ date on 1w 2w 1m 2m 3m 6m \+ 0 20181130 1.52500 1.10125 1.08000 1.20286 1.83030 2.03786 2.32821+ 1 20181129 0.76143 0.95643 1.01036 1.12357 1.80493 2.01018 2.31643+ 2 20181128 0.66786 0.95607 0.99929 1.10964 1.77104 1.97643 2.30143+ 3 20181127 0.71357 0.95536 0.99786 1.09321 1.76321 1.98351 2.30374+ 4 20181126 0.68821 0.92821 0.99107 1.08214 1.75161 1.97742 2.29957+ 5 20181123 0.68571 0.84000 0.91036 1.08214 1.75304 1.97591 2.30088+ 6 20181122 0.47161 0.59750 0.76750 1.01214 1.73125 1.96500 2.29250+ 7 20181121 0.36893 0.56571 0.74429 0.98929 1.71071 1.96569 2.29286+ 8 20181120 0.38964 0.58214 0.75464 1.01107 1.70839 1.96571 2.28893+ 9 20181119 0.39672 0.59893 0.77464 1.04143 1.71143 1.96643 2.28643+ 10 20181116 0.44429 0.60321 0.75214 1.04429 1.71500 1.96750 2.28893+ 11 20181115 0.39179 0.63571 0.77857 1.04627 1.71722 1.97607 2.28697+ 12 20181114 0.34571 0.64026 0.78821 1.06393 1.72875 2.00000 2.29554+ 13 20181113 0.59232 0.82643 0.91643 1.09286 1.77786 2.06920 2.30982+ 14 20181112 0.53571 0.75419 0.83321 1.03536 1.75734 2.08286 2.29929+ 15 20181109 0.51571 0.75393 0.83321 1.03464 1.76018 2.08179 2.30283+ 16 20181108 0.60536 0.75293 0.85179 1.03357 1.75866 2.08107 2.29907+ 17 20181107 0.58071 0.72679 0.83107 1.04714 1.74804 2.08467 2.30446+ 18 20181106 0.48714 0.67750 0.78786 1.02536 1.72821 2.08071 2.30589+ 19 20181105 0.44929 0.68500 0.80214 1.04321 1.72500 2.08179 2.31941+ 20 20181102 0.45571 0.73542 0.87679 1.10536 1.73732 2.10018 2.33276++ 12m+ 0 2.65929+ 1 2.65500+ 2 2.65643+ 3 2.65571+ 4 2.65446+ 5 2.65375+ 6 2.64750+ 7 2.64618+ 8 2.63946+ 9 2.63960+ 10 2.64321+ 11 2.64286+ 12 2.64857+ 13 2.66286+ 14 2.65607+ 15 2.65857+ 16 2.65357+ 17 2.65596+ 18 2.65464+ 19 2.65857+ 20 2.67857\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\345\210\251\347\216\207\346\225\260\346\215\256/LPR\350\264\267\346\254\276\345\237\272\347\241\200\345\210\251\347\216\207.md" "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\345\210\251\347\216\207\346\225\260\346\215\256/LPR\350\264\267\346\254\276\345\237\272\347\241\200\345\210\251\347\216\207.md"new file mode 100644index 000000000..e500a8c1d--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\345\210\251\347\216\207\346\225\260\346\215\256/LPR\350\264\267\346\254\276\345\237\272\347\241\200\345\210\251\347\216\207.md"@@ -0,0 +1,78 @@+## LPR่ดทๆฌพๅบ็กๅฉ็+----++ๆฅๅฃ๏ผshibor_lpr+ๆ่ฟฐ๏ผLPR่ดทๆฌพๅบ็กๅฉ็+้้๏ผๅๆฌกๆๅคง4000(็ธๅฝไบๅๆฌกๅฏๆๅ18ๅนดๅๅฒ)๏ผๆป้ไธ้ๅถ๏ผๅฏ้่ฟ่ฎพ็ฝฎๅผๅงๅ็ปๆๆฅๆๅๆฎต่ทๅ+็งฏๅ๏ผ็จๆท็งฏ็ดฏ120็งฏๅๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>++**LPRไป็ป**++> ่ดทๆฌพๅบ็กๅฉ็๏ผLoan Prime Rate๏ผ็ฎ็งฐLPR๏ผ๏ผๆฏๅบไบๆฅไปท่ก่ชไธปๆฅๅบ็ๆไผ่ดทๆฌพๅฉ็่ฎก็ฎๅนถๅๅธ็่ดทๆฌพๅธๅบๅ่ๅฉ็ใ็ฎๅ๏ผๅฏน็คพไผๅ ฌๅธ1ๅนดๆ่ดทๆฌพๅบ็กๅฉ็ใ+>+> LPRๆฅไปท้ถ่กๅข็ฐ็ฑ10ๅฎถๅไธ้ถ่ก็ปๆใๆฅไปท้ถ่กๅบ็ฌฆๅ่ดขๅก็กฌ็บฆๆๆกไปถๅๅฎ่งๅฎกๆ ๆฟ็ญๆกๆถ่ฆๆฑ๏ผ็ณป็ป้่ฆๆง็จๅบฆ้ซใๅธๅบๅฝฑๅๅๅคงใ็ปผๅๅฎๅๅผบ๏ผๅทฒๅปบ็ซๅ ้จๆถ็็ๆฒ็บฟๅๅ ้จ่ฝฌ็งปๅฎไปทๆบๅถ๏ผๅ ทๆ่พๅผบ็่ชไธปๅฎไปท่ฝๅ๏ผๅทฒๅถๅฎๆฌ่ก่ดทๆฌพๅบ็กๅฉ็็ฎก็ๅๆณ๏ผไปฅๅๆๅฉไบๅผๅฑๆฅไปทๅทฅไฝ็ๅ ถไปๆกไปถใๅธๅบๅฉ็ๅฎไปท่ชๅพๆบๅถไพๆฎใ่ดทๆฌพๅบ็กๅฉ็้ไธญๆฅไปทๅๅๅธ่งๅใ็กฎๅฎๅ่ฐๆดๆฅไปท่กๆๅ๏ผ็็ฃๅ็ฎก็่ดทๆฌพๅบ็กๅฉ็่ฟ่ก๏ผ่ง่ๆฅไปท่กไธๆๅฎๅๅธไบบ่กไธบใ+>+> ๅ จๅฝ้ถ่ก้ดๅไธๆๅไธญๅฟๅๆ่ดทๆฌพๅบ็กๅฉ็็ๆฅไปท่ฎก็ฎๅไฟกๆฏๅๅธใๆฏไธชไบคๆๆฅๆ นๆฎๅๆฅไปท่ก็ๆฅไปท๏ผๅ้คๆ้ซใๆไฝๅ1ๅฎถๆฅไปท๏ผๅฏนๅ ถไฝๆฅไปท่ฟ่กๅ ๆๅนณๅ่ฎก็ฎๅ๏ผๅพๅบ่ดทๆฌพๅบ็กๅฉ็ๆฅไปทๅนณๅๅฉ็๏ผๅนถไบ11:30ๅฏนๅคๅๅธใ+++<br>+++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+date | str | N | ๆฅๆ (ๆฅๆ่พๅ ฅๆ ผๅผ๏ผYYYYMMDD๏ผไธๅ)+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+date | str | Y | ๆฅๆ+1y | float | Y | 1ๅนด่ดทๆฌพๅฉ็+5y | float | Y | 5ๅนด่ดทๆฌพๅฉ็++<br>++**ๆฅๅฃ่ฐ็จ**++```python++pro = ts.pro_api()++df = pro.shibor_lpr(start_date='20180101', end_date='20181130', fields='date,1y')++```++<br>++**ๆฐๆฎๆ ทไพ**++ date 1y+ 0 20181130 4.31+ 1 20181129 4.31+ 2 20181128 4.31+ 3 20181127 4.31+ 4 20181126 4.31+ 5 20181123 4.31+ 6 20181122 4.31+ 7 20181121 4.31+ 8 20181120 4.31+ 9 20181119 4.31+ 10 20181116 4.31+ 11 20181115 4.31+ 12 20181114 4.31+ 13 20181113 4.31+ 14 20181112 4.31+ 15 20181109 4.31+ 16 20181108 4.31+ 17 20181107 4.31+ 18 20181106 4.31+ 19 20181105 4.31+ 20 20181102 4.31\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\345\210\251\347\216\207\346\225\260\346\215\256/Libor\345\210\251\347\216\207.md" "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\345\210\251\347\216\207\346\225\260\346\215\256/Libor\345\210\251\347\216\207.md"new file mode 100644index 000000000..91ed85a45--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\345\210\251\347\216\207\346\225\260\346\215\256/Libor\345\210\251\347\216\207.md"@@ -0,0 +1,102 @@+## Liborๆๅๅฉ็+----++ๆฅๅฃ๏ผlibor+ๆ่ฟฐ๏ผLiborๆๅๅฉ็+้้๏ผๅๆฌกๆๅคง4000่กๆฐๆฎ๏ผๆป้ไธ้ๅถ๏ผๅฏ้่ฟ่ฎพ็ฝฎๅผๅงๅ็ปๆๆฅๆๅๆฎต่ทๅ+็งฏๅ๏ผ็จๆท็งฏ็ดฏ120็งฏๅๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++> Libor๏ผLondon Interbank Offered Rate ๏ผ๏ผๅณไผฆๆฆๅไธๆๅๅฉ็๏ผๆฏๆไผฆๆฆ็็ฌฌไธๆต้ถ่กไน้ด็ญๆ่ต้ๅ่ดท็ๅฉ็๏ผๆฏๅฝ้ ้่ๅธๅบไธญๅคงๅคๆฐๆตฎๅจๅฉ็็ๅบ็กๅฉ็ใไฝไธบ้ถ่กไปๅธๅบไธ็ญน้่ต้่ฟ่ก่ฝฌ่ดท็่่ตๆๆฌ๏ผ่ดทๆฌพๅ่ฎฎไธญ่ฎฎๅฎ็LIBOR้ๅธธๆฏ็ฑๅ ๅฎถๆๅฎ็ๅ่้ถ่ก๏ผๅจ่งๅฎ็ๆถ้ด๏ผไธ่ฌๆฏไผฆๆฆๆถ้ดไธๅ11๏ผ00๏ผๆฅไปท็ๅนณๅๅฉ็ใ++<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+date | str | N | ๆฅๆ (ๆฅๆ่พๅ ฅๆ ผๅผ๏ผYYYYMMDD๏ผไธๅ)+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+curr_type | str | N | ่ดงๅธไปฃ็ (USD็พๅ EURๆฌงๅ JPYๆฅๅ GBP่ฑ้ CHF็้๏ผ้ป่ฎคๆฏUSD)++<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+date | str | Y | ๆฅๆ+curr_type | str | Y | ่ดงๅธ+on | float | Y | ้ๅค+1w | float | Y | 1ๅจ+1m | float | Y | 1ไธชๆ+2m | float | Y | 2ไธชๆ+3m | float | Y | 3ไธชๆ+6m | float | Y | 6ไธชๆ+12m | float | Y | 12ไธชๆ+++<br>++**ๆฅๅฃ่ฐ็จ**++```python++pro = ts.pro_api()++df = pro.libor(curr_type='USD', start_date='20180101', end_date='20181130')++```++<br>++**ๆฐๆฎๆ ทไพ**++ date curr_type on 1w 1m 2m 3m 6m \+ 0 20181130 USD 2.17750 2.22131 2.34694 2.51006 2.73613 2.89463+ 1 20181129 USD 2.18275 2.22881 2.34925 2.51125 2.73813 2.88519+ 2 20181128 USD 2.18250 2.22450 2.34463 2.49500 2.70663 2.88663+ 3 20181127 USD 2.17850 2.23494 2.34931 2.49900 2.70600 2.88444+ 4 20181126 USD 2.18300 2.21900 2.33675 2.49525 2.70681 2.89275+ 5 20181123 USD 2.17700 2.22188 2.32188 2.49538 2.69119 2.88625+ 6 20181122 USD NaN 2.22213 2.31488 2.48013 2.68925 2.88725+ 7 20181121 USD 2.18050 2.22100 2.31513 2.47313 2.67694 2.88588+ 8 20181120 USD 2.17288 2.21638 2.30550 2.45850 2.65313 2.86325+ 9 20181119 USD 2.18075 2.21725 2.30025 2.45769 2.64581 2.86575+ 10 20181116 USD 2.17538 2.21225 2.30088 2.45213 2.64450 2.86263+ 11 20181115 USD 2.17938 2.21125 2.30250 2.44913 2.64000 2.86019+ 12 20181114 USD 2.17575 2.20963 2.31038 2.44531 2.62900 2.86344+ 13 20181113 USD 2.17788 2.21613 2.30650 2.44413 2.61613 2.85500+ 14 20181112 USD NaN 2.21550 2.30663 2.44525 2.61413 2.85538+ 15 20181109 USD 2.17500 2.21913 2.31438 2.45513 2.61813 2.85800+ 16 20181108 USD 2.17988 2.21619 2.31844 2.45863 2.61463 2.85763+ 17 20181107 USD 2.17725 2.21588 2.31531 2.44550 2.60113 2.84350+ 18 20181106 USD 2.17663 2.21138 2.31688 2.42863 2.59125 2.84150+ 19 20181105 USD 2.17525 2.21425 2.31600 2.42950 2.58925 2.83575+ 20 20181102 USD 2.17463 2.21400 2.31788 2.42625 2.59238 2.82888++ 12m+ 0 3.12025+ 1 3.11869+ 2 3.13413+ 3 3.13075+ 4 3.12838+ 5 3.12075+ 6 3.10950+ 7 3.11038+ 8 3.09713+ 9 3.10738+ 10 3.12363+ 11 3.11838+ 12 3.12963+ 13 3.13206+ 14 3.13475+ 15 3.14413+ 16 3.14075+ 17 3.12513+ 18 3.11638+ 19 3.11688+ 20 3.10488\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\345\210\251\347\216\207\346\225\260\346\215\256/Shibor\345\210\251\347\216\207.md" "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\345\210\251\347\216\207\346\225\260\346\215\256/Shibor\345\210\251\347\216\207.md"new file mode 100644index 000000000..4a18888d2--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\345\210\251\347\216\207\346\225\260\346\215\256/Shibor\345\210\251\347\216\207.md"@@ -0,0 +1,85 @@+## Shiborๅฉ็ๆฐๆฎ+----++ๆฅๅฃ๏ผshibor+ๆ่ฟฐ๏ผshiborๅฉ็+้้๏ผๅๆฌกๆๅคง2000๏ผๆป้ไธ้ๅถ๏ผๅฏ้่ฟ่ฎพ็ฝฎๅผๅงๅ็ปๆๆฅๆๅๆฎต่ทๅ+็งฏๅ๏ผ็จๆท็งฏ็ดฏ120็งฏๅๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>++**Shiborๅฉ็ไป็ป**++> ไธๆตท้ถ่ก้ดๅไธๆๆพๅฉ็๏ผShanghai Interbank Offered Rate๏ผ็ฎ็งฐShibor๏ผ๏ผไปฅไฝไบไธๆตท็ๅ จๅฝ้ถ่ก้ดๅไธๆๅไธญๅฟไธบๆๆฏๅนณๅฐ่ฎก็ฎใๅๅธๅนถๅฝๅ๏ผๆฏ็ฑไฟก็จ็ญ็บง่พ้ซ็้ถ่ก็ปๆๆฅไปทๅข่ชไธปๆฅๅบ็ไบบๆฐๅธๅไธๆๅบๅฉ็่ฎก็ฎ็กฎๅฎ็็ฎๆฏๅนณๅๅฉ็๏ผๆฏๅๅฉใๆ ๆ ไฟใๆนๅๆงๅฉ็ใ็ฎๅ๏ผๅฏน็คพไผๅ ฌๅธ็Shiborๅ็งๅ ๆฌ้ๅคใ1ๅจใ2ๅจใ1ไธชๆใ3ไธชๆใ6ไธชๆใ9ไธชๆๅ1ๅนดใ+>+> Shiborๆฅไปท้ถ่กๅข็ฐ็ฑ18ๅฎถๅไธ้ถ่ก็ปๆใๆฅไปท้ถ่กๆฏๅ ฌๅผๅธๅบไธ็บงไบคๆๅๆๅคๆฑๅธๅบๅๅธๅ๏ผๅจไธญๅฝ่ดงๅธๅธๅบไธไบบๆฐๅธไบคๆ็ธๅฏนๆดป่ทใไฟกๆฏๆซ้ฒๆฏ่พๅ ๅ็้ถ่กใไธญๅฝไบบๆฐ้ถ่กๆ็ซShiborๅทฅไฝๅฐ็ป๏ผไพๆฎใไธๆตท้ถ่ก้ดๅไธๆๆพๅฉ็๏ผShibor๏ผๅฎๆฝๅๅใ็กฎๅฎๅ่ฐๆดๆฅไปท้ถ่กๅขๆๅใ็็ฃๅ็ฎก็Shibor่ฟ่กใ่ง่ๆฅไปท่กไธๆๅฎๅๅธไบบ่กไธบใ+>+> ๅ จๅฝ้ถ่ก้ดๅไธๆๅไธญๅฟๅๆShibor็ๆฅไปท่ฎก็ฎๅไฟกๆฏๅๅธใๆฏไธชไบคๆๆฅๆ นๆฎๅๆฅไปท่ก็ๆฅไปท๏ผๅ้คๆ้ซใๆไฝๅ4ๅฎถๆฅไปท๏ผๅฏนๅ ถไฝๆฅไปท่ฟ่ก็ฎๆฏๅนณๅ่ฎก็ฎๅ๏ผๅพๅบๆฏไธๆ้ๅ็ง็Shibor๏ผๅนถไบ11:00ๅฏนๅคๅๅธใ+++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+date | str | N | ๆฅๆ (ๆฅๆ่พๅ ฅๆ ผๅผ๏ผYYYYMMDD๏ผไธๅ)+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+date | str | Y | ๆฅๆ+on | float | Y | ้ๅค+1w | float | Y | 1ๅจ+2w | float | Y | 2ๅจ+1m | float | Y | 1ไธชๆ+3m | float | Y | 3ไธชๆ+6m | float | Y | 6ไธชๆ+9m | float | Y | 9ไธชๆ+1y | float | Y | 1ๅนด++<br>++**ๆฅๅฃ่ฐ็จ**++```python++pro = ts.pro_api()++df = pro.shibor(start_date='20180101', end_date='20181101')++```++<br>++**ๆฐๆฎๆ ทไพ**++ date on 1w 2w 1m 3m 6m 9m 1y+ 0 20181101 2.5470 2.6730 2.6910 2.6960 2.9760 3.2970 3.5040 3.5500+ 1 20181031 2.3700 2.7150 2.7300 2.6890 2.9630 3.2980 3.5040 3.5500+ 2 20181030 1.5660 2.5980 2.6400 2.6630 2.9570 3.2950 3.5010 3.5500+ 3 20181029 1.8520 2.6090 2.6510 2.6720 2.9580 3.2970 3.5020 3.5500+ 4 20181026 2.0670 2.6180 2.6500 2.6730 2.9520 3.2970 3.5020 3.5500+ 5 20181025 2.2150 2.6300 2.6510 2.6750 2.9480 3.2970 3.5050 3.5520+ 6 20181024 2.3930 2.6310 2.6530 2.6750 2.9240 3.2960 3.4980 3.5440+ 7 20181023 2.4510 2.6350 2.6530 2.6720 2.9030 3.2890 3.4880 3.5320+ 8 20181022 2.4750 2.6320 2.6500 2.6630 2.8710 3.2770 3.4710 3.5160+ 9 20181019 2.4450 2.6220 2.6480 2.6550 2.8420 3.2670 3.4560 3.5070+ 10 20181018 2.4270 2.6110 2.6370 2.6510 2.8320 3.2600 3.4530 3.5040+ 11 20181017 2.3530 2.6040 2.6320 2.6510 2.8180 3.2540 3.4500 3.5050+ 12 20181016 2.3730 2.6030 2.6330 2.6580 2.8000 3.2530 3.4500 3.5050+ 13 20181015 2.3770 2.6120 2.6370 2.6680 2.8010 3.2530 3.4510 3.5050+ 14 20181012 2.4390 2.6150 2.6440 2.6820 2.8000 3.2500 3.4530 3.5050+ 15 20181011 2.3600 2.6110 2.6500 2.6920 2.8010 3.2510 3.4550 3.5060+ 16 20181010 2.3980 2.6180 2.6730 2.7050 2.8100 3.2530 3.4590 3.5020+ 17 20181009 2.5020 2.6330 2.7030 2.7340 2.8160 3.2580 3.4640 3.5040+ 18 20181008 2.5360 2.6570 2.7660 2.7810 2.8360 3.2690 3.4760 3.5120+ 19 20180930 2.6530 2.7660 3.4730 2.8020 2.8470 3.2870 3.4890 3.5210+ 20 20180929 2.0730 2.7830 3.3100 2.8020 2.8460 3.2850 3.4890 3.5210\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\345\210\251\347\216\207\346\225\260\346\215\256/Shibor\346\212\245\344\273\267\346\225\260\346\215\256.md" "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\345\210\251\347\216\207\346\225\260\346\215\256/Shibor\346\212\245\344\273\267\346\225\260\346\215\256.md"new file mode 100644index 000000000..02b80fa51--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\345\210\251\347\216\207\346\225\260\346\215\256/Shibor\346\212\245\344\273\267\346\225\260\346\215\256.md"@@ -0,0 +1,106 @@+## Shiborๆฅไปทๆฐๆฎ+----++ๆฅๅฃ๏ผshibor_quote+ๆ่ฟฐ๏ผShiborๆฅไปทๆฐๆฎ+้้๏ผๅๆฌกๆๅคง4000่กๆฐๆฎ๏ผๆป้ไธ้ๅถ๏ผๅฏ้่ฟ่ฎพ็ฝฎๅผๅงๅ็ปๆๆฅๆๅๆฎต่ทๅ+็งฏๅ๏ผ็จๆท็งฏ็ดฏ120็งฏๅๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+date | str | N | ๆฅๆ (ๆฅๆ่พๅ ฅๆ ผๅผ๏ผYYYYMMDD๏ผไธๅ)+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+bank | str | N | ้ถ่กๅ็งฐ ๏ผไธญๆๅ็งฐ๏ผไพๅฆ ๅไธ้ถ่ก๏ผ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+date | str | Y | ๆฅๆ+bank | str | Y | ๆฅไปท้ถ่ก+on_b | float | Y | ้ๅค_Bid+on_a | float | Y | ้ๅค_Ask+1w_b | float | Y | 1ๅจ_Bid+1w_a | float | Y | 1ๅจ_Ask+2w_b | float | Y | 2ๅจ_Bid+2w_a | float | Y | 2ๅจ_Ask+1m_b | float | Y | 1ๆ_Bid+1m_a | float | Y | 1ๆ_Ask+3m_b | float | Y | 3ๆ_Bid+3m_a | float | Y | 3ๆ_Ask+6m_b | float | Y | 6ๆ_Bid+6m_a | float | Y | 6ๆ_Ask+9m_b | float | Y | 9ๆ_Bid+9m_a | float | Y | 9ๆ_Ask+1y_b | float | Y | 1ๅนด_Bid+1y_a | float | Y | 1ๅนด_Ask+++<br>++**ๆฅๅฃ่ฐ็จ**++```python++pro = ts.pro_api()++df = pro.shibor_quote(start_date='20180101', end_date='20181101')++```++<br>++**ๆฐๆฎๆ ทไพ**++ date bank on_b on_a 1w_b 1w_a 2w_b 2w_a 1m_b 1m_a \+ 0 20181101 ๆฐ็้ถ่ก 2.540 2.540 2.65 2.65 2.67 2.67 2.680 2.680+ 1 20181101 ๅฝๅผ่ก 2.570 2.570 2.71 2.71 2.75 2.75 2.690 2.690+ 2 20181101 ้ฎๅจ้ถ่ก 2.550 2.550 2.72 2.72 2.72 2.72 2.690 2.690+ 3 20181101 ๅนฟๅ้ถ่ก 2.560 2.560 2.66 2.66 2.68 2.68 2.720 2.720+ 4 20181101 ๅๅค้ถ่ก 2.550 2.550 2.72 2.72 2.73 2.73 2.690 2.690+ 5 20181101 ๆฑไธฐไธญๅฝ 2.550 2.550 2.65 2.65 2.68 2.68 2.690 2.690+ 6 20181101 ไธๆตท้ถ่ก 2.560 2.560 2.70 2.70 2.73 2.73 2.690 2.690+ 7 20181101 ๅไบฌ้ถ่ก 2.570 2.570 2.67 2.67 2.65 2.65 2.600 2.600+ 8 20181101 ๆตฆๅ้ถ่ก 2.560 2.560 2.75 2.75 2.65 2.65 2.700 2.700+ 9 20181101 ๅ ดไธ้ถ่ก 2.530 2.530 2.65 2.65 2.60 2.60 2.500 2.500+ 10 20181101 ๅ ๅคง้ถ่ก 2.540 2.540 2.65 2.65 2.70 2.70 2.720 2.720+ 11 20181101 ไธญไฟก้ถ่ก 2.550 2.550 2.65 2.65 2.70 2.70 2.700 2.700+ 12 20181101 ๆๅ้ถ่ก 2.540 2.540 2.67 2.67 2.65 2.65 2.700 2.700+ 13 20181101 ไบค้้ถ่ก 2.540 2.540 2.68 2.68 2.72 2.72 2.690 2.690+ 14 20181101 ๅปบ่ฎพ้ถ่ก 2.530 2.530 2.67 2.67 2.68 2.68 2.720 2.720+ 15 20181101 ไธญๅฝ้ถ่ก 2.540 2.540 2.65 2.65 2.66 2.66 2.680 2.680+ 16 20181101 ๅไธ้ถ่ก 2.550 2.550 2.70 2.70 2.75 2.75 2.760 2.760+ 17 20181101 ๅทฅๅ้ถ่ก 2.500 2.500 2.68 2.68 2.70 2.70 2.720 2.720+ 18 20181031 ๆฐ็้ถ่ก 2.310 2.310 2.72 2.72 2.73 2.73 2.730 2.730+ 19 20181031 ๅฝๅผ่ก 2.370 2.370 2.75 2.75 2.76 2.76 2.690 2.690+ 20 20181031 ้ฎๅจ้ถ่ก 2.350 2.350 2.73 2.73 2.72 2.72 2.670 2.670++ 3m_b 3m_a 6m_b 6m_a 9m_b 9m_a 1y_b 1y_a+ 0 2.960 2.960 3.290 3.290 3.510 3.510 3.550 3.550+ 1 2.970 2.970 3.320 3.320 3.530 3.530 3.570 3.570+ 2 2.960 2.960 3.300 3.300 3.500 3.500 3.550 3.550+ 3 3.000 3.000 3.250 3.250 3.500 3.500 3.550 3.550+ 4 2.970 2.970 3.300 3.300 3.510 3.510 3.550 3.550+ 5 2.970 2.970 3.300 3.300 3.500 3.500 3.550 3.550+ 6 2.960 2.960 3.300 3.300 3.510 3.510 3.550 3.550+ 7 3.000 3.000 3.400 3.400 3.550 3.550 3.600 3.600+ 8 2.960 2.960 3.300 3.300 3.500 3.500 3.550 3.550+ 9 2.950 2.950 3.100 3.100 3.400 3.400 3.500 3.500+ 10 3.000 3.000 3.300 3.300 3.500 3.500 3.550 3.550+ 11 3.000 3.000 3.300 3.300 3.550 3.550 3.550 3.550+ 12 3.100 3.100 3.300 3.300 3.550 3.550 3.550 3.550+ 13 2.970 2.970 3.300 3.300 3.510 3.510 3.560 3.560+ 14 3.000 3.000 3.260 3.260 3.500 3.500 3.550 3.550+ 15 2.940 2.940 3.280 3.280 3.480 3.480 3.520 3.520+ 16 3.000 3.000 3.300 3.300 3.500 3.500 3.550 3.550+ 17 2.880 2.880 3.240 3.240 3.420 3.420 3.470 3.470+ 18 2.970 2.970 3.300 3.300 3.500 3.500 3.550 3.550+ 19 2.960 2.960 3.320 3.320 3.520 3.520 3.560 3.560+ 20 2.960 2.960 3.300 3.300 3.500 3.500 3.550 3.550\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\345\210\251\347\216\207\346\225\260\346\215\256/\345\271\277\345\267\236\346\260\221\351\227\264\345\200\237\350\264\267\345\210\251\347\216\207.md" "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\345\210\251\347\216\207\346\225\260\346\215\256/\345\271\277\345\267\236\346\260\221\351\227\264\345\200\237\350\264\267\345\210\251\347\216\207.md"new file mode 100644index 000000000..996ab08fc--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\345\210\251\347\216\207\346\225\260\346\215\256/\345\271\277\345\267\236\346\260\221\351\227\264\345\200\237\350\264\267\345\210\251\347\216\207.md"@@ -0,0 +1,74 @@+## ๅนฟๅทๆฐ้ดๅ่ดทๅฉ็+----++ๆฅๅฃ๏ผgz_index+ๆ่ฟฐ๏ผๅนฟๅทๆฐ้ดๅ่ดทๅฉ็+้้๏ผไธ้้๏ผไธๆฌกๅฏๅๅ จ้จๆๆ ๅ จ้จๅๅฒๆฐๆฎ+็งฏๅ๏ผ็จๆท้่ฆ็งฏๆ2000็งฏๅๅฏ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)+ๆฐๆฎๆฅๆบ๏ผๅนฟๅทๆฐ้ด้่่ก++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+date | str | N | ๆฅๆ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+date | str | Y | ๆฅๆ+d10_rate | float | Y | ๅฐ้ข่ดทๅธๅบๅนณๅๅฉ็๏ผๅๅคฉ๏ผ ๏ผๅไฝ๏ผ%๏ผไธๅ๏ผ+m1_rate | float | Y | ๅฐ้ข่ดทๅธๅบๅนณๅๅฉ็๏ผไธๆๆ๏ผ+m3_rate | float | Y | ๅฐ้ข่ดทๅธๅบๅนณๅๅฉ็๏ผไธๆๆ๏ผ+m6_rate | float | Y | ๅฐ้ข่ดทๅธๅบๅนณๅๅฉ็๏ผๅ ญๆๆ๏ผ+m12_rate | float | Y | ๅฐ้ข่ดทๅธๅบๅนณๅๅฉ็๏ผไธๅนดๆ๏ผ+long_rate | float | Y | ๅฐ้ข่ดทๅธๅบๅนณๅๅฉ็๏ผ้ฟๆ๏ผ++<br>+<br>++**ๆฅๅฃ็จๆณ**+```python++pro = ts.pro_api()++df = pro.gz_index(start_date='20180101', end_date='20190401')++```+++<br>+<br>++**ๆฐๆฎๆ ทไพ**++ date d10_rate m1_rate m3_rate m6_rate m12_rate long_rate+ 0 20180327 12.00 19.20 19.20 12.77 14.40 12.00+ 1 20180404 12.00 19.20 19.20 13.27 14.40 12.00+ 2 20180410 12.00 19.20 19.20 13.35 14.40 12.00+ 3 20180802 12.00 15.90 15.85 14.35 14.40 15.00+ 4 20180822 12.00 19.20 19.20 13.35 14.40 12.00+ 5 20180920 13.00 14.41 13.55 12.03 9.78 11.46+ 6 20180925 13.00 14.94 13.59 12.24 9.47 11.55+ 7 20180926 13.00 14.79 13.60 12.29 9.56 11.42+ 8 20180927 13.00 13.74 13.62 12.26 9.57 11.52+ 9 20180928 19.00 13.58 13.63 12.41 9.69 11.31+ 10 20180929 19.05 13.41 13.66 12.42 10.34 10.83+ 11 20180930 19.05 13.23 13.66 12.44 10.31 10.90+ 12 20181009 17.41 12.28 13.64 12.58 10.97 11.22+ 13 20181015 17.20 11.91 13.63 11.61 11.46 11.50+ 14 20181016 16.55 11.56 13.59 11.64 11.45 11.40+ 15 20181017 16.55 11.18 13.58 11.63 11.50 11.26+ 16 20181018 16.55 11.08 13.59 12.45 11.55 11.21+ 17 20181019 16.55 10.95 13.60 12.44 11.31 11.14+ 18 20181020 15.71 10.71 13.57 12.44 11.31 11.25+ 19 20181021 15.71 10.71 13.52 12.46 11.28 11.10\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\345\210\251\347\216\207\346\225\260\346\215\256/\346\270\251\345\267\236\346\260\221\351\227\264\345\200\237\350\264\267\345\210\251\347\216\207.md" "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\345\210\251\347\216\207\346\225\260\346\215\256/\346\270\251\345\267\236\346\260\221\351\227\264\345\200\237\350\264\267\345\210\251\347\216\207.md"new file mode 100644index 000000000..602e6dbfe--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\345\210\251\347\216\207\346\225\260\346\215\256/\346\270\251\345\267\236\346\260\221\351\227\264\345\200\237\350\264\267\345\210\251\347\216\207.md"@@ -0,0 +1,107 @@+## ๆธฉๅทๆฐ้ดๅ่ดทๅฉ็+----++ๆฅๅฃ๏ผwz_index+ๆ่ฟฐ๏ผๆธฉๅทๆฐ้ดๅ่ดทๅฉ็๏ผๅณๆธฉๅทๆๆฐ+้้๏ผไธ้้๏ผไธๆฌกๅฏๅๅ จ้จๆๆ ๅ จ้จๅๅฒๆฐๆฎ+็งฏๅ๏ผ็จๆท้่ฆ็งฏๆ2000็งฏๅๅฏ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)+ๆฐๆฎๆฅๆบ๏ผๆธฉๅทๆๆฐ็ฝ+<br>+ๆณจ๏ผ+ๆธฉๅทๆๆฐ ๏ผๅณๆธฉๅทๆฐ้ด่่ต็ปผๅๅฉ็ๆๆฐ๏ผ่ฏฅๆๆฐๅๆถๅๆ ๆฐ้ด้่ไบคๆๆดป่ทๅบฆๅไบคๆไปทๆ ผใ่ฏฅๆๆฐๆ ทๆฟๆฐๆฎไธป่ฆ้้ไบๅไธชๆน้ข๏ผ็ฑๆธฉๅทๅธ่ฎพ็ซ็ๅ ็พๅฎถไผไธๆตๆฅ็น๏ผๆๅ่ชๅๅ ฅ็ๆฐ้ด่ตๆฌๅฉ็้่ฟๅๅฐๆน้่ๅไธ่ฎฐๅ็ณๆฅๆถ้่ตทๆฅ๏ผๅฏนๅๅฐ้ข่ดทๆฌพๅ ฌๅธๅๅบ็ๅฉ็่ฟ่กๅ ๆๅนณๅ๏ผ่่ตๆงๆ ไฟๅ ฌๅธๅฆๅ ธๅฝ่กๅจ่่ต่ฟ็จไธญ็ๅฉ็๏ผ็ฑๆธฉๅท็ปไฟกๅงๅๅๅกๅฑ่ด่ดฃๆตๆฅ๏ผๆฐ้ดๅ่ดทๆๅกไธญๅฟ็ๅฎๆถๅฉ็ใ่ฟไบๅฉ็่ฟ่กๅ ๆๅนณๅ๏ผๅฐฑๅพๅบไบโๆธฉๅทๆๆฐโใๅฎๆฏๆธฉๅทๆฐ้ด่่ตๅฉ็็้ฃๅๆ ใ2012ๅนด12ๆ7ๆฅ๏ผๆธฉๅทๆๆฐๆญฃๅผๅฏนๅคๅๅธใ+<br>+<img src="https://tushare.pro/files/img/wz_idx.png">++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+date | str | N | ๆฅๆ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+date | str | Y | ๆฅๆ+comp_rate | float | Y | ๆธฉๅทๆฐ้ด่่ต็ปผๅๅฉ็ๆๆฐ (%๏ผไธๅ)+center_rate | float | Y | ๆฐ้ดๅ่ดทๆๅกไธญๅฟๅฉ็+micro_rate | float | Y | ๅฐ้ข่ดทๆฌพๅ ฌๅธๆพๆฌพๅฉ็+cm_rate | float | Y | ๆฐ้ด่ตๆฌ็ฎก็ๅ ฌๅธ่่ตไปทๆ ผ+sdb_rate | float | Y | ็คพไผ็ดๆฅๅ่ดทๅฉ็+om_rate | float | Y | ๅ ถไปๅธๅบไธปไฝๅฉ็+aa_rate | float | Y | ๅๆไบๅฉไผไบๅฉ้่ดน็+m1_rate | float | Y | ๆธฉๅทๅฐๅบๆฐ้ดๅ่ดทๅๆ้ๅฉ็๏ผไธๆๆ๏ผ+m3_rate | float | Y | ๆธฉๅทๅฐๅบๆฐ้ดๅ่ดทๅๆ้ๅฉ็๏ผไธๆๆ๏ผ+m6_rate | float | Y | ๆธฉๅทๅฐๅบๆฐ้ดๅ่ดทๅๆ้ๅฉ็๏ผๅ ญๆๆ๏ผ+m12_rate | float | Y | ๆธฉๅทๅฐๅบๆฐ้ดๅ่ดทๅๆ้ๅฉ็๏ผไธๅนดๆ๏ผ+long_rate | float | Y | ๆธฉๅทๅฐๅบๆฐ้ดๅ่ดทๅๆ้ๅฉ็๏ผ้ฟๆ๏ผ++<br>+<br>++**ๆฅๅฃ็จๆณ**+```python++pro = ts.pro_api()++df = pro.wz_index(start_date='20180101', end_date='20190401')++```+++<br>+<br>++**ๆฐๆฎๆ ทไพ**++ date comp_rate center_rate micro_rate cm_rate sdb_rate om_rate \+ 0 20180102 15.05 16.58 14.74 15.0 14.43 22.99+ 1 20180103 15.58 14.72 15.59 15.0 14.43 22.99+ 2 20180104 15.91 15.73 15.91 15.0 14.43 22.99+ 3 20180105 15.26 17.19 13.89 15.0 14.23 23.02+ 4 20180108 16.26 16.70 16.30 15.0 14.23 23.02+ 5 20180109 16.42 19.01 17.14 15.0 14.23 23.02+ 6 20180110 15.92 13.30 16.97 15.0 14.23 23.02+ 7 20180111 15.98 15.57 15.47 15.0 14.23 23.02+ 8 20180112 15.44 15.46 15.85 15.0 13.91 20.48+ 9 20180115 15.27 13.82 16.38 15.0 13.91 20.48+ 10 20180116 15.12 14.94 15.84 15.0 13.91 20.48+ 11 20180117 15.13 14.13 14.34 15.0 13.91 20.48+ 12 20180118 15.33 16.31 15.19 15.0 13.91 20.48+ 13 20180119 15.36 13.97 17.09 15.0 14.19 22.27+ 14 20180122 16.03 14.66 18.18 15.0 14.19 22.27+ 15 20180123 16.18 14.57 18.29 15.0 14.19 22.27+ 16 20180124 15.25 15.82 15.38 15.0 14.19 22.27+ 17 20180125 15.17 16.12 15.90 15.0 14.19 22.27+ 18 20180126 15.99 14.15 17.40 15.0 14.67 23.11+ 19 20180129 16.02 14.08 15.17 15.0 14.67 23.11++ aa_rate m1_rate m3_rate m6_rate m12_rate long_rate+ 0 12.26 17.35 16.72 14.87 12.97 15.78+ 1 12.87 20.93 15.94 15.07 14.04 15.91+ 2 14.11 20.79 16.33 15.12 14.23 16.22+ 3 15.82 21.09 14.71 14.04 14.30 13.86+ 4 15.22 21.35 18.79 13.42 15.02 13.88+ 5 14.78 21.03 18.01 14.46 15.28 13.64+ 6 14.56 21.24 17.94 14.19 14.42 13.27+ 7 13.44 20.82 17.66 14.08 14.62 13.31+ 8 15.66 19.70 15.14 15.33 13.27 15.71+ 9 15.37 19.59 14.66 14.48 14.17 15.49+ 10 13.32 18.30 17.20 14.73 13.52 14.97+ 11 13.15 19.33 14.18 13.95 14.23 16.98+ 12 13.28 19.99 14.60 14.23 14.06 17.46+ 13 13.97 21.34 14.27 14.85 14.03 16.88+ 14 15.79 20.81 17.37 14.88 14.08 16.03+ 15 13.15 21.43 16.25 14.91 14.14 15.60+ 16 12.48 21.41 15.48 14.88 13.58 16.07+ 17 14.94 21.24 16.57 14.47 13.84 16.28+ 18 14.71 21.34 15.13 15.52 14.61 15.08+ 19 14.71 21.44 17.47 14.88 13.87 14.49\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\345\233\275\346\260\221\347\273\217\346\265\216/\345\233\275\345\206\205\347\224\237\344\272\247\346\200\273\345\200\274(GDP).md" "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\345\233\275\346\260\221\347\273\217\346\265\216/\345\233\275\345\206\205\347\224\237\344\272\247\346\200\273\345\200\274(GDP).md"new file mode 100644index 000000000..c98b4a4a1--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\345\233\275\346\260\221\347\273\217\346\265\216/\345\233\275\345\206\205\347\224\237\344\272\247\346\200\273\345\200\274(GDP).md"@@ -0,0 +1,72 @@+## GDPๆฐๆฎ+----++ๆฅๅฃ๏ผcn_gdp+ๆ่ฟฐ๏ผ่ทๅๅฝๆฐ็ปๆตไนGDPๆฐๆฎ+้้๏ผๅๆฌกๆๅคง10000๏ผไธๆฌกๅฏไปฅๆๅๅ จ้จๆฐๆฎ+ๆ้๏ผ็จๆท็งฏ็ดฏ600็งฏๅๅฏไปฅไฝฟ็จ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+q | str | N | ๅญฃๅบฆ๏ผ2019Q1่กจ็คบ๏ผ2019ๅนด็ฌฌไธๅญฃๅบฆ๏ผ+start_q | str | N | ๅผๅงๅญฃๅบฆ+end_q | str | N | ็ปๆๅญฃๅบฆ+fields | str | N | ๆๅฎ่พๅบๅญๆฎต๏ผe.g. fields='quarter,gdp,gdp_yoy'๏ผ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+quarter | str | Y | ๅญฃๅบฆ+gdp | float | Y | GDP็ดฏ่ฎกๅผ๏ผไบฟๅ ๏ผ+gdp_yoy | float | Y | ๅฝๅญฃๅๆฏๅข้๏ผ%๏ผ+pi | float | Y | ็ฌฌไธไบงไธ็ดฏ่ฎกๅผ๏ผไบฟๅ ๏ผ+pi_yoy | float | Y | ็ฌฌไธไบงไธๅๆฏๅข้๏ผ%๏ผ+si | float | Y | ็ฌฌไบไบงไธ็ดฏ่ฎกๅผ๏ผไบฟๅ ๏ผ+si_yoy | float | Y | ็ฌฌไบไบงไธๅๆฏๅข้๏ผ%๏ผ+ti | float | Y | ็ฌฌไธไบงไธ็ดฏ่ฎกๅผ๏ผไบฟๅ ๏ผ+ti_yoy | float | Y | ็ฌฌไธไบงไธๅๆฏๅข้๏ผ%๏ผ+++<br>+<br>++**ๆฅๅฃ่ฐ็จ**++```python++pro = ts.pro_api()++df = pro.cn_gdp(start_q='2018Q1', end_q='2019Q3')+++#่ทๅๆๅฎๅญๆฎต+df = pro.cn_gdp(start_q='2018Q1', end_q='2019Q3', fields='quarter,gdp,gdp_yoy')++```++<br>++**ๆฐๆฎๆ ทไพ**+++ quarter gdp gdp_yoy pi pi_yoy si si_yoy ti ti_yoy+ 0 2019Q4 990865.1000 6.10 70466.7000 3.10 386165.3000 5.70 534233.1000 6.90+ 1 2019Q3 712845.4000 6.20 43005.0000 2.90 276912.5000 5.60 392927.9000 7.00+ 2 2019Q2 460636.7000 6.30 23207.0000 3.00 179122.1000 5.80 258307.5000 7.00+ 3 2019Q1 218062.8000 6.40 8769.4000 2.70 81806.5000 6.10 127486.9000 7.00+ 4 2018Q4 900309.5000 6.60 64734.0000 3.50 366000.9000 5.80 469574.6000 7.60+ .. ... ... ... ... ... ... ... ... ...+ 147 1956Q4 1028.0000 15.00 443.9000 4.70 280.7000 34.50 303.4000 14.10+ 148 1955Q4 910.0000 6.80 421.0000 7.90 222.2000 7.60 266.8000 4.60+ 149 1954Q4 859.0000 4.20 392.0000 1.70 211.7000 15.70 255.3000 -0.60+ 150 1953Q4 824.0000 15.60 378.0000 1.90 192.5000 35.80 253.5000 27.30+ 151 1952Q4 679.0000 None 342.9000 None 141.8000 None 194.3000 None\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\346\231\257\346\260\224\345\272\246/\351\207\207\350\264\255\347\273\217\347\220\206\346\214\207\346\225\260(PMI).md" "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\346\231\257\346\260\224\345\272\246/\351\207\207\350\264\255\347\273\217\347\220\206\346\214\207\346\225\260(PMI).md"new file mode 100644index 000000000..03c5ce153--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\346\231\257\346\260\224\345\272\246/\351\207\207\350\264\255\347\273\217\347\220\206\346\214\207\346\225\260(PMI).md"@@ -0,0 +1,112 @@+## ้่ดญ็ป็ไบบๆๆฐ+----++ๆฅๅฃ๏ผcn_pmi+ๆ่ฟฐ๏ผ้่ดญ็ป็ไบบๆๆฐ+้้๏ผๅๆฌกๆๅคง2000๏ผไธๆฌกๅฏไปฅๆๅๅ จ้จๆฐๆฎ+ๆ้๏ผ็จๆท็งฏ็ดฏ2000็งฏๅๅฏไปฅไฝฟ็จ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+m | str | N | ๆๅบฆ๏ผ202401่กจ็คบ๏ผ2024ๅนด1ๆ๏ผ+start_m | str | N | ๅผๅงๆๅบฆ+end_m | str | N | ็ปๆๆๅบฆ๏ผe.g. fields='month,pmi010000,pmi010400'๏ผ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+month | str | N | ๆไปฝYYYYMM+pmi010000 | float | N | ๅถ้ ไธPMI+pmi010100 | float | N | ๅถ้ ไธPMI:ไผไธ่งๆจก/ๅคงๅไผไธ+pmi010200 | float | N | ๅถ้ ไธPMI:ไผไธ่งๆจก/ไธญๅไผไธ+pmi010300 | float | N | ๅถ้ ไธPMI:ไผไธ่งๆจก/ๅฐๅไผไธ+pmi010400 | float | N | ๅถ้ ไธPMI:ๆๆๆๆฐ/็ไบงๆๆฐ+pmi010401 | float | N | ๅถ้ ไธPMI:ๆๆๆๆฐ/็ไบงๆๆฐ:ไผไธ่งๆจก/ๅคงๅไผไธ+pmi010402 | float | N | ๅถ้ ไธPMI:ๆๆๆๆฐ/็ไบงๆๆฐ:ไผไธ่งๆจก/ไธญๅไผไธ+pmi010403 | float | N | ๅถ้ ไธPMI:ๆๆๆๆฐ/็ไบงๆๆฐ:ไผไธ่งๆจก/ๅฐๅไผไธ+pmi010500 | float | N | ๅถ้ ไธPMI:ๆๆๆๆฐ/ๆฐ่ฎขๅๆๆฐ+pmi010501 | float | N | ๅถ้ ไธPMI:ๆๆๆๆฐ/ๆฐ่ฎขๅๆๆฐ:ไผไธ่งๆจก/ๅคงๅไผไธ+pmi010502 | float | N | ๅถ้ ไธPMI:ๆๆๆๆฐ/ๆฐ่ฎขๅๆๆฐ:ไผไธ่งๆจก/ไธญๅไผไธ+pmi010503 | float | N | ๅถ้ ไธPMI:ๆๆๆๆฐ/ๆฐ่ฎขๅๆๆฐ:ไผไธ่งๆจก/ๅฐๅไผไธ+pmi010600 | float | N | ๅถ้ ไธPMI:ๆๆๆๆฐ/ไพๅบๅ้ ้ๆถ้ดๆๆฐ+pmi010601 | float | N | ๅถ้ ไธPMI:ๆๆๆๆฐ/ไพๅบๅ้ ้ๆถ้ดๆๆฐ:ไผไธ่งๆจก/ๅคงๅไผไธ+pmi010602 | float | N | ๅถ้ ไธPMI:ๆๆๆๆฐ/ไพๅบๅ้ ้ๆถ้ดๆๆฐ:ไผไธ่งๆจก/ไธญๅไผไธ+pmi010603 | float | N | ๅถ้ ไธPMI:ๆๆๆๆฐ/ไพๅบๅ้ ้ๆถ้ดๆๆฐ:ไผไธ่งๆจก/ๅฐๅไผไธ+pmi010700 | float | N | ๅถ้ ไธPMI:ๆๆๆๆฐ/ๅๆๆๅบๅญๆๆฐ+pmi010701 | float | N | ๅถ้ ไธPMI:ๆๆๆๆฐ/ๅๆๆๅบๅญๆๆฐ:ไผไธ่งๆจก/ๅคงๅไผไธ+pmi010702 | float | N | ๅถ้ ไธPMI:ๆๆๆๆฐ/ๅๆๆๅบๅญๆๆฐ:ไผไธ่งๆจก/ไธญๅไผไธ+pmi010703 | float | N | ๅถ้ ไธPMI:ๆๆๆๆฐ/ๅๆๆๅบๅญๆๆฐ:ไผไธ่งๆจก/ๅฐๅไผไธ+pmi010800 | float | N | ๅถ้ ไธPMI:ๆๆๆๆฐ/ไปไธไบบๅๆๆฐ+pmi010801 | float | N | ๅถ้ ไธPMI:ๆๆๆๆฐ/ไปไธไบบๅๆๆฐ:ไผไธ่งๆจก/ๅคงๅไผไธ+pmi010802 | float | N | ๅถ้ ไธPMI:ๆๆๆๆฐ/ไปไธไบบๅๆๆฐ:ไผไธ่งๆจก/ไธญๅไผไธ+pmi010803 | float | N | ๅถ้ ไธPMI:ๆๆๆๆฐ/ไปไธไบบๅๆๆฐ:ไผไธ่งๆจก/ๅฐๅไผไธ+pmi010900 | float | N | ๅถ้ ไธPMI:ๅ ถไป/ๆฐๅบๅฃ่ฎขๅ+pmi011000 | float | N | ๅถ้ ไธPMI:ๅ ถไป/่ฟๅฃ+pmi011100 | float | N | ๅถ้ ไธPMI:ๅ ถไป/้่ดญ้+pmi011200 | float | N | ๅถ้ ไธPMI:ๅ ถไป/ไธป่ฆๅๆๆ่ดญ่ฟไปทๆ ผ+pmi011300 | float | N | ๅถ้ ไธPMI:ๅ ถไป/ๅบๅไปทๆ ผ+pmi011400 | float | N | ๅถ้ ไธPMI:ๅ ถไป/ไบงๆๅๅบๅญ+pmi011500 | float | N | ๅถ้ ไธPMI:ๅ ถไป/ๅจๆ่ฎขๅ+pmi011600 | float | N | ๅถ้ ไธPMI:ๅ ถไป/็ไบง็ป่ฅๆดปๅจ้ขๆ+pmi011700 | float | N | ๅถ้ ไธPMI:ๅ่กไธ/่ฃ ๅคๅถ้ ไธ+pmi011800 | float | N | ๅถ้ ไธPMI:ๅ่กไธ/้ซๆๆฏๅถ้ ไธ+pmi011900 | float | N | ๅถ้ ไธPMI:ๅ่กไธ/ๅบ็กๅๆๆๅถ้ ไธ+pmi012000 | float | N | ๅถ้ ไธPMI:ๅ่กไธ/ๆถ่ดนๅๅถ้ ไธ+pmi020100 | float | N | ้ๅถ้ ไธPMI:ๅๅกๆดปๅจ+pmi020101 | float | N | ้ๅถ้ ไธPMI:ๅๅกๆดปๅจ:ๅ่กไธ/ๅปบ็ญไธ+pmi020102 | float | N | ้ๅถ้ ไธPMI:ๅๅกๆดปๅจ:ๅ่กไธ/ๆๅกไธไธ+pmi020200 | float | N | ้ๅถ้ ไธPMI:ๆฐ่ฎขๅๆๆฐ+pmi020201 | float | N | ้ๅถ้ ไธPMI:ๆฐ่ฎขๅๆๆฐ:ๅ่กไธ/ๅปบ็ญไธ+pmi020202 | float | N | ้ๅถ้ ไธPMI:ๆฐ่ฎขๅๆๆฐ:ๅ่กไธ/ๆๅกไธ+pmi020300 | float | N | ้ๅถ้ ไธPMI:ๆๅ ฅๅไปทๆ ผๆๆฐ+pmi020301 | float | N | ้ๅถ้ ไธPMI:ๆๅ ฅๅไปทๆ ผๆๆฐ:ๅ่กไธ/ๅปบ็ญไธ+pmi020302 | float | N | ้ๅถ้ ไธPMI:ๆๅ ฅๅไปทๆ ผๆๆฐ:ๅ่กไธ/ๆๅกไธ+pmi020400 | float | N | ้ๅถ้ ไธPMI:้ๅฎไปทๆ ผๆๆฐ+pmi020401 | float | N | ้ๅถ้ ไธPMI:้ๅฎไปทๆ ผๆๆฐ:ๅ่กไธ/ๅปบ็ญไธ+pmi020402 | float | N | ้ๅถ้ ไธPMI:้ๅฎไปทๆ ผๆๆฐ:ๅ่กไธ/ๆๅกไธ+pmi020500 | float | N | ้ๅถ้ ไธPMI:ไปไธไบบๅๆๆฐ+pmi020501 | float | N | ้ๅถ้ ไธPMI:ไปไธไบบๅๆๆฐ:ๅ่กไธ/ๅปบ็ญไธ+pmi020502 | float | N | ้ๅถ้ ไธPMI:ไปไธไบบๅๆๆฐ:ๅ่กไธ/ๆๅกไธ+pmi020600 | float | N | ้ๅถ้ ไธPMI:ไธๅกๆดปๅจ้ขๆๆๆฐ+pmi020601 | float | N | ้ๅถ้ ไธPMI:ไธๅกๆดปๅจ้ขๆๆๆฐ:ๅ่กไธ/ๅปบ็ญไธ+pmi020602 | float | N | ้ๅถ้ ไธPMI:ไธๅกๆดปๅจ้ขๆๆๆฐ:ๅ่กไธ/ๆๅกไธ+pmi020700 | float | N | ้ๅถ้ ไธPMI:ๆฐๅบๅฃ่ฎขๅ+pmi020800 | float | N | ้ๅถ้ ไธPMI:ๅจๆ่ฎขๅ+pmi020900 | float | N | ้ๅถ้ ไธPMI:ๅญ่ดง+pmi021000 | float | N | ้ๅถ้ ไธPMI:ไพๅบๅ้ ้ๆถ้ด+pmi030000 | float | N | ไธญๅฝ็ปผๅPMI:ไบงๅบๆๆฐ++**ๆฅๅฃ่ฐ็จ**++```python+pro = ts.pro_api()++#่ทๅๆๅฎๅญๆฎต+df = pro.cn_pmi(start_m='201901', end_m='202003', fields='month,pmi010000,pmi010400')++```++<br>++**ๆฐๆฎๆ ทไพ**++ month pmi010000 pmi010100 pmi010200 pmi010300 pmi010400 pmi010401 pmi010402+ 0 202403 50.80 51.10 50.60 50.30 52.20 52.70 51.50+ 1 202402 49.10 50.40 49.10 46.40 49.80 51.20 49.60+ 2 202401 49.20 50.40 48.90 47.20 51.30 52.30 52.40+ 3 202312 49.00 50.00 48.70 47.30 50.20 51.50 50.10+ 4 202311 49.40 50.50 48.80 47.80 50.70 52.10 50.50+ 5 202310 49.50 50.70 48.70 47.90 50.90 53.10 49.00+ 6 202309 50.20 51.60 49.60 48.00 52.70 54.40 52.40+ 7 202308 49.70 50.80 49.60 47.70 51.90 53.70 51.60+ 8 202307 49.30 50.30 49.00 47.40 50.20 52.00 49.50+ 9 202306 49.00 50.30 48.90 46.40 50.30 52.70 50.20+ 10 202305 48.80 50.00 47.60 47.90 49.60 51.50 48.00+ 11 202304 49.20 49.30 49.20 49.00 50.20 50.10 49.80+ 12 202303 51.90 53.60 50.30 50.40 54.60 57.20 52.60+ 13 202302 52.60 53.70 52.00 51.20 56.70 58.20 56.60+ 14 202301 50.10 52.30 48.60 47.20 49.80 53.10 47.20diff --git "a/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\351\207\221\350\236\215/\347\244\276\344\274\232\350\236\215\350\265\204/\347\244\276\350\236\215\345\242\236\351\207\217(\346\234\210\345\272\246).md" "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\351\207\221\350\236\215/\347\244\276\344\274\232\350\236\215\350\265\204/\347\244\276\350\236\215\345\242\236\351\207\217(\346\234\210\345\272\246).md"new file mode 100644index 000000000..6718be36e--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\351\207\221\350\236\215/\347\244\276\344\274\232\350\236\215\350\265\204/\347\244\276\350\236\215\345\242\236\351\207\217(\346\234\210\345\272\246).md"@@ -0,0 +1,76 @@+## ็คพ่ๆฐๆฎ๏ผๆๅบฆ๏ผ+----++ๆฅๅฃ๏ผsf_month+ๆ่ฟฐ๏ผ่ทๅๆๅบฆ็คพไผ่่ตๆฐๆฎ+้้๏ผๅๆฌกๆๅคง2000ๆกๆฐๆฎ๏ผๅฏๅพช็ฏๆๅ+็งฏๅ๏ผ้2000็งฏๅ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+m | str | N | ๆไปฝ๏ผYYYYMM๏ผไธๅ๏ผ๏ผๆฏๆๅคไธชๆไปฝๅๆถ่พๅ ฅ๏ผ้ๅทๅ้+start_m | str | N | ๅผๅงๆไปฝ+end_m | str | N | ็ปๆๆไปฝ+++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+month | str | Y | ๆๅบฆ+inc_month | float | Y | ็คพ่ๅข้ๅฝๆๅผ๏ผไบฟๅ ๏ผ+inc_cumval | float | Y | ็คพ่ๅข้็ดฏ่ฎกๅผ๏ผไบฟๅ ๏ผ+stk_endval | float | Y | ็คพ่ๅญ้ๆๆซๅผ๏ผไธไบฟๅ ๏ผ++<br>+<br>++**ๆฅๅฃ่ฐ็จ**++```python++pro = ts.pro_api()++df = pro.sf_month(start_m='201901', end_m='202307')+++```++<br>++**ๆฐๆฎๆ ทไพ**++ month inc_month inc_cumval stk_endval+ 0 202307 5282.00 220800.00 365.77+ 1 202306 42241.00 215487.00 365.45+ 2 202305 15555.00 173246.00 361.42+ 3 202304 12253.00 157691.00 359.95+ 4 202303 53862.00 145438.00 359.02+ 5 202302 31623.00 91576.00 353.97+ 6 202301 59953.00 59953.00 350.93+ 7 202212 13058.00 320099.00 344.21+ 8 202211 19837.00 307041.00 343.19+ 9 202210 9134.00 287204.00 341.42+ 10 202209 35411.00 278070.00 340.65+ 11 202208 24712.00 242659.00 337.22+ 12 202207 7785.00 217947.00 334.90+ 13 202206 51926.00 210162.00 334.28+ 14 202205 28415.00 158236.00 329.20+ 15 202204 9327.00 129821.00 326.47+ 16 202203 46565.00 120494.00 325.63+ 17 202202 12170.00 73929.00 321.12+ 18 202201 61759.00 61759.00 320.03+ 19 202112 23580.00 313408.00 314.12+ 20 202111 25983.00 289828.00 311.90+ 21 202110 16176.00 263845.00 309.45+ 22 202109 29026.00 247669.00 308.05+ 23 202108 29893.00 218643.00 305.29+ 24 202107 10752.00 188750.00 302.47\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\351\207\221\350\236\215/\350\264\247\345\270\201\344\276\233\345\272\224\351\207\217/\350\264\247\345\270\201\344\276\233\345\272\224\351\207\217(\346\234\210).md" "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\351\207\221\350\236\215/\350\264\247\345\270\201\344\276\233\345\272\224\351\207\217/\350\264\247\345\270\201\344\276\233\345\272\224\351\207\217(\346\234\210).md"new file mode 100644index 000000000..a32f7bba3--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\345\206\205\345\256\217\350\247\202/\351\207\221\350\236\215/\350\264\247\345\270\201\344\276\233\345\272\224\351\207\217/\350\264\247\345\270\201\344\276\233\345\272\224\351\207\217(\346\234\210).md"@@ -0,0 +1,63 @@+## ่ดงๅธไพๅบ้+----++ๆฅๅฃ๏ผcn_m+ๆ่ฟฐ๏ผ่ทๅ่ดงๅธไพๅบ้ไนๆๅบฆๆฐๆฎ+้้๏ผๅๆฌกๆๅคง5000๏ผไธๆฌกๅฏไปฅๆๅๅ จ้จๆฐๆฎ+ๆ้๏ผ็จๆท็งฏ็ดฏ600็งฏๅๅฏไปฅไฝฟ็จ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+m | str | N | ๆๅบฆ๏ผ202001่กจ็คบ๏ผ2020ๅนด1ๆ๏ผ+start_m | str | N | ๅผๅงๆๅบฆ+end_m | str | N | ็ปๆๆๅบฆ+fields | str | N | ๆๅฎ่พๅบๅญๆฎต๏ผe.g. fields='month,m0,m1,m2'๏ผ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+month | str | Y | ๆไปฝYYYYMM+m0 | float | Y | M0๏ผไบฟๅ ๏ผ+m0_yoy | float | Y | M0ๅๆฏ๏ผ%๏ผ+m0_mom | float | Y | M0็ฏๆฏ๏ผ%๏ผ+m1 | float | Y | M1๏ผไบฟๅ ๏ผ+m1_yoy | float | Y | M1ๅๆฏ๏ผ%๏ผ+m1_mom | float | Y | M1็ฏๆฏ๏ผ%๏ผ+m2 | float | Y | M2๏ผไบฟๅ ๏ผ+m2_yoy | float | Y | M2ๅๆฏ๏ผ%๏ผ+m2_mom | float | Y | M2็ฏๆฏ๏ผ%๏ผ++**ๆฅๅฃ่ฐ็จ**++```python+pro = ts.pro_api()+df = pro.cn_m(start_m='201901', end_m='202003')+#่ทๅๆๅฎๅญๆฎต+df = pro.cn_m(start_m='201901', end_m='202003', fields='month,m0,m1,m2')++```++<br>++**ๆฐๆฎๆ ทไพ**++ month m0 m0_yoy m0_mom m1 m1_yoy m1_mom m2 m2_yoy m2_mom+ 0 202003 83000.00 10.80 -5.90 575100.00 5.00 4.05 2080900.00 10.10 2.47+ 1 202002 88200.00 10.90 -5.36 552700.00 4.80 1.32 2030800.00 8.80 0.38+ 2 202001 93200.00 6.60 20.73 545500.00 0.00 -5.30 2023100.00 8.40 1.84+ 3 201912 77200.00 5.40 4.36 576000.00 4.40 2.40 1986500.00 8.70 1.28+ 4 201911 73973.82 4.80 0.79 562486.52 3.50 0.78 1961429.56 8.20 0.81+ 5 201910 73395.40 4.70 -0.99 558143.92 3.30 0.18 1945600.55 8.40 -0.34+ 6 201909 74129.75 4.00 1.34 557137.95 3.40 0.06 1952250.49 8.40 0.87+ 7 201908 73152.62 4.80 0.64 556798.09 3.40 0.68 1935492.43 8.20 0.84+ 8 201907 72689.25 4.50 0.15 553043.11 3.10 -2.58 1919410.82 8.10 -0.10+ 9 201906 72580.96 4.30 -0.30 567696.18 4.40 4.29 1921360.19 8.50 1.60+ 10 201905 72798.46 4.30 -1.58 544355.64 3.40 0.69 1891153.70 8.50 0.34+ 11 201904 73965.76 3.50 -1.30 540614.60 2.90 -1.27 1884670.33 8.50 -0.25+ 12 201903 74941.58 3.10 -5.72 547575.54 4.60 3.87 1889412.14 8.60 1.18+ 13 201902 79484.72 -2.40 -9.13 527190.48 1.60 -3.38 1867427.45 8.00 0.08+ 14 201901 87470.62 17.20 19.48 545638.46 0.40 -1.10 1865935.33 8.40 2.15\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\351\231\205\345\256\217\350\247\202/\347\276\216\345\233\275\345\210\251\347\216\207/\345\233\275\345\200\272\345\256\236\351\231\205\346\224\266\347\233\212\347\216\207\346\233\262\347\272\277\345\210\251\347\216\207.md" "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\351\231\205\345\256\217\350\247\202/\347\276\216\345\233\275\345\210\251\347\216\207/\345\233\275\345\200\272\345\256\236\351\231\205\346\224\266\347\233\212\347\216\207\346\233\262\347\272\277\345\210\251\347\216\207.md"new file mode 100644index 000000000..b7d85d179--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\351\231\205\345\256\217\350\247\202/\347\276\216\345\233\275\345\210\251\347\216\207/\345\233\275\345\200\272\345\256\236\351\231\205\346\224\266\347\233\212\347\216\207\346\233\262\347\272\277\345\210\251\347\216\207.md"@@ -0,0 +1,69 @@+## ๅฝๅบๅฎ้ ๆถ็็ๆฒ็บฟๅฉ็+----++ๆฅๅฃ๏ผus_trycr+ๆ่ฟฐ๏ผๅฝๅบๅฎ้ ๆถ็็ๆฒ็บฟๅฉ็+้้๏ผๅๆฌกๆๅคงๅฏ่ทๅ2000่กๆฐๆฎ๏ผๅฏๅพช็ฏ่ทๅ+ๆ้๏ผ็จๆท็งฏ็ดฏ120็งฏๅๅฏไปฅไฝฟ็จ๏ผ็งฏๅ่ถ้ซ้ขๆฌก่ถ้ซใๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+date | str | N | ๆฅๆ ๏ผYYYYMMDDๆ ผๅผ๏ผไธๅ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+fields | str | N | ๆๅฎ่พๅบๅญๆฎต++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+date | str | Y | ๆฅๆ+y5 | float | Y | 5ๅนดๆ+y7 | float | Y | 7ๅนดๆ+y10 | float | Y | 10ๅนดๆ+y20 | float | Y | 20ๅนดๆ+y30 | float | Y | 30ๅนดๆ++<br>+<br>+++**ๆฅๅฃ่ฐ็จ**++```python++pro = ts.pro_api()++df = pro.us_trycr(start_date='20180101', end_date='20200327')+++#่ทๅ5ๅนดๆๅ20ๅนดๆๆฐๆฎ+df = pro.us_trycr(start_date='20180101', end_date='20200327', fields='y5,y20')++```++<br>++**ๆฐๆฎๆ ทไพ**++ date y5 y7 y10 y20 y30+ 0 20200327 -0.13 -0.20 -0.22 -0.12 -0.03+ 1 20200326 -0.21 -0.24 -0.24 -0.14 -0.05+ 2 20200325 -0.13 -0.18 -0.19 -0.09 0.00+ 3 20200324 -0.03 -0.11 -0.13 -0.09 -0.07+ 4 20200323 0.01 -0.03 -0.04 -0.02 -0.01+ ... ... ... ... ... ... ...+ 1995 20120404 -0.91 -0.46 -0.05 0.62 0.94+ 1996 20120403 -0.94 -0.48 -0.06 0.62 0.94+ 1997 20120402 -1.01 -0.55 -0.14 0.56 0.89+ 1998 20120330 -0.98 -0.53 -0.09 0.61 0.93+ 1999 20120329 -0.98 -0.53 -0.13 0.55 0.87diff --git "a/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\351\231\205\345\256\217\350\247\202/\347\276\216\345\233\275\345\210\251\347\216\207/\345\233\275\345\200\272\346\224\266\347\233\212\347\216\207\346\233\262\347\272\277\345\210\251\347\216\207.md" "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\351\231\205\345\256\217\350\247\202/\347\276\216\345\233\275\345\210\251\347\216\207/\345\233\275\345\200\272\346\224\266\347\233\212\347\216\207\346\233\262\347\272\277\345\210\251\347\216\207.md"new file mode 100644index 000000000..5d37894ff--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\351\231\205\345\256\217\350\247\202/\347\276\216\345\233\275\345\210\251\347\216\207/\345\233\275\345\200\272\346\224\266\347\233\212\347\216\207\346\233\262\347\272\277\345\210\251\347\216\207.md"@@ -0,0 +1,81 @@+## ๅฝๅบๆถ็็ๆฒ็บฟๅฉ็๏ผๆฅ้ข๏ผ+----++ๆฅๅฃ๏ผus_tycr+ๆ่ฟฐ๏ผ่ทๅ็พๅฝๆฏๆฅๅฝๅบๆถ็็ๆฒ็บฟๅฉ็+้้๏ผๅๆฌกๆๅคงๅฏ่ทๅ2000ๆกๆฐๆฎ+ๆ้๏ผ็จๆท็งฏ็ดฏ120็งฏๅๅฏไปฅไฝฟ็จ๏ผ็งฏๅ่ถ้ซ้ขๆฌก่ถ้ซใๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>+++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+date | str | N | ๆฅๆ ๏ผYYYYMMDDๆ ผๅผ๏ผไธๅ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+fields | str | N | ๆๅฎ่พๅบๅญๆฎต๏ผe.g. fields='m1,y1'๏ผ++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+date | str | Y | ๆฅๆ+m1 | float | Y | 1ๆๆ+m2 | float | Y | 2ๆๆ+m3 | float | Y | 3ๆๆ+m4 | float | Y | 4ๆๆ๏ผๆฐๆฎไป20221019ๅผๅง๏ผ+m6 | float | Y | 6ๆๆ+y1 | float | Y | 1ๅนดๆ+y2 | float | Y | 2ๅนดๆ+y3 | float | Y | 3ๅนดๆ+y5 | float | Y | 5ๅนดๆ+y7 | float | Y | 7ๅนดๆ+y10 | float | Y | 10ๅนดๆ+y20 | float | Y | 20ๅนดๆ+y30 | float | Y | 30ๅนดๆ+++<br>+<br>++**ๆฅๅฃ่ฐ็จ**++```python++pro = ts.pro_api()++df = pro.us_tycr(start_date='20180101', end_date='20200327')+++#่ทๅ1ๆๆๅ1ๅนดๆๆฐๆฎ+df = pro.us_tycr(start_date='20180101', end_date='20200327', fields='m1,y1')++```++<br>++**ๆฐๆฎๆ ทไพ**++++ date m1 m2 m3 m6 y1 y2 y3 y5 y7 y10 y20 y30+ 0 20200327 0.01 0.03 0.03 0.02 0.11 0.25 0.30 0.41 0.60 0.72 1.09 1.29+ 1 20200326 0.01 0.01 0.00 0.04 0.13 0.30 0.36 0.51 0.72 0.83 1.20 1.42+ 2 20200325 0.00 0.00 0.00 0.07 0.19 0.34 0.41 0.56 0.77 0.88 1.23 1.45+ 3 20200324 0.01 0.01 0.01 0.09 0.25 0.38 0.44 0.52 0.75 0.84 1.19 1.39+ 4 20200323 0.01 0.04 0.02 0.08 0.17 0.28 0.31 0.38 0.63 0.76 1.12 1.33+ ... ... ... ... ... ... ... ... ... ... ... ... ... ...+ 1995 20120405 0.07 None 0.08 0.14 0.19 0.35 0.50 1.01 1.56 2.19 2.97 3.32+ 1996 20120404 0.08 None 0.08 0.14 0.19 0.35 0.53 1.05 1.62 2.25 3.02 3.37+ 1997 20120403 0.07 None 0.08 0.15 0.20 0.36 0.56 1.10 1.68 2.30 3.07 3.41+ 1998 20120402 0.05 None 0.08 0.14 0.18 0.33 0.50 1.03 1.60 2.22 3.00 3.35+ 1999 20120330 0.05 None 0.07 0.15 0.19 0.33 0.51 1.04 1.61 2.23 3.00 3.35+diff --git "a/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\351\231\205\345\256\217\350\247\202/\347\276\216\345\233\275\345\210\251\347\216\207/\345\233\275\345\200\272\351\225\277\346\234\237\345\210\251\347\216\207.md" "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\351\231\205\345\256\217\350\247\202/\347\276\216\345\233\275\345\210\251\347\216\207/\345\233\275\345\200\272\351\225\277\346\234\237\345\210\251\347\216\207.md"new file mode 100644index 000000000..a6308cbce--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\351\231\205\345\256\217\350\247\202/\347\276\216\345\233\275\345\210\251\347\216\207/\345\233\275\345\200\272\351\225\277\346\234\237\345\210\251\347\216\207.md"@@ -0,0 +1,65 @@+## ๅฝๅบ้ฟๆๅฉ็+----++ๆฅๅฃ๏ผus_tltr+ๆ่ฟฐ๏ผๅฝๅบ้ฟๆๅฉ็+้้๏ผๅๆฌกๆๅคงๅฏ่ทๅ2000่กๆฐๆฎ๏ผๅฏๅพช็ฏ่ทๅ+ๆ้๏ผ็จๆท็งฏ็ดฏ120็งฏๅๅฏไปฅไฝฟ็จ๏ผ็งฏๅ่ถ้ซ้ขๆฌก่ถ้ซใๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+date | str | N | ๆฅๆ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+fields | str | N | ๆๅฎๅญๆฎต++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+date | str | Y | ๆฅๆ+ltc | float | Y | ๆถ็็ LT COMPOSITE (>10 Yrs)+cmt | float | Y | 20ๅนดๆCMTๅฉ็(TREASURY 20-Yr CMT)+e_factor | float | Y | ๅคๆจๅ ๅญEXTRAPOLATION FACTOR++<br>+<br>++**ๆฅๅฃ่ฐ็จ**++```python++pro = ts.pro_api()++df = pro.us_tltr(start_date='20180101', end_date='20200327')+++#่ทๅ5ๅนดๆๅ20ๅนดๆๆฐๆฎ+df = pro.us_tltr(start_date='20180101', end_date='20200327', fields='ltc,cmt')++```++<br>++**ๆฐๆฎๆ ทไพ**++ date ltc cmt e_factor+ 0 20200327 1.19 1.09 None+ 1 20200326 1.32 1.20 None+ 2 20200325 1.35 1.23 None+ 3 20200324 1.30 1.19 None+ 4 20200323 1.25 1.12 None+ ... ... ... ... ...+ 1995 20120404 2.98 3.02 None+ 1996 20120403 3.02 3.07 None+ 1997 20120402 2.96 3.00 None+ 1998 20120330 2.96 3.00 None+ 1999 20120329 2.89 2.93 Nonediff --git "a/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\351\231\205\345\256\217\350\247\202/\347\276\216\345\233\275\345\210\251\347\216\207/\345\233\275\345\200\272\351\225\277\346\234\237\345\210\251\347\216\207\345\271\263\345\235\207\345\200\274.md" "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\351\231\205\345\256\217\350\247\202/\347\276\216\345\233\275\345\210\251\347\216\207/\345\233\275\345\200\272\351\225\277\346\234\237\345\210\251\347\216\207\345\271\263\345\235\207\345\200\274.md"new file mode 100644index 000000000..413a8e9f8--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\351\231\205\345\256\217\350\247\202/\347\276\216\345\233\275\345\210\251\347\216\207/\345\233\275\345\200\272\351\225\277\346\234\237\345\210\251\347\216\207\345\271\263\345\235\207\345\200\274.md"@@ -0,0 +1,65 @@+## ๅฝๅบๅฎ้ ้ฟๆๅฉ็ๅนณๅๅผ+----++ๆฅๅฃ๏ผus_trltr+ๆ่ฟฐ๏ผๅฝๅบๅฎ้ ้ฟๆๅฉ็ๅนณๅๅผ+้้๏ผๅๆฌกๆๅคงๅฏ่ทๅ2000่กๆฐๆฎ๏ผๅฏๅพช็ฏ่ทๅ+ๆ้๏ผ็จๆท็งฏ็ดฏ120็งฏๅๅฏไปฅไฝฟ็จ๏ผ็งฏๅ่ถ้ซ้ขๆฌก่ถ้ซใๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)+++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+date | str | N | ๆฅๆ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+fields | str | N | ๆๅฎๅญๆฎต++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+date | str | Y | ๆฅๆ+ltr_avg | float | Y | ๅฎ้ ๅนณๅๅฉ็LT Real Average (10> Yrs)++<br>+<br>++**ๆฅๅฃ่ฐ็จ**++```python++pro = ts.pro_api()++df = pro.us_trltr(start_date='20180101', end_date='20200327')+++#่ทๅๆๅฎๅญๆฎต+df = pro.us_trltr(start_date='20180101', end_date='20200327', fields='ltr_avg')++```++<br>++**ๆฐๆฎๆ ทไพ**++ date ltr_avg+ 0 20200327 -0.02+ 1 20200326 -0.05+ 2 20200325 0.01+ 3 20200324 -0.04+ 4 20200323 0.04+ ... ... ...+ 1995 20120404 0.57+ 1996 20120403 0.58+ 1997 20120402 0.53+ 1998 20120330 0.57+ 1999 20120329 0.51+diff --git "a/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\351\231\205\345\256\217\350\247\202/\347\276\216\345\233\275\345\210\251\347\216\207/\347\237\255\346\234\237\345\233\275\345\200\272\345\210\251\347\216\207.md" "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\351\231\205\345\256\217\350\247\202/\347\276\216\345\233\275\345\210\251\347\216\207/\347\237\255\346\234\237\345\233\275\345\200\272\345\210\251\347\216\207.md"new file mode 100644index 000000000..dbb67dda6--- /dev/null+++ "b/agent/src/skills/tushare/references/\345\256\217\350\247\202\347\273\217\346\265\216/\345\233\275\351\231\205\345\256\217\350\247\202/\347\276\216\345\233\275\345\210\251\347\216\207/\347\237\255\346\234\237\345\233\275\345\200\272\345\210\251\347\216\207.md"@@ -0,0 +1,79 @@+## ็ญๆๅฝๅบๅฉ็+----++ๆฅๅฃ๏ผus_tbr+ๆ่ฟฐ๏ผ่ทๅ็พๅฝ็ญๆๅฝๅบๅฉ็ๆฐๆฎ+้้๏ผๅๆฌกๆๅคงๅฏ่ทๅ2000่กๆฐๆฎ๏ผๅฏๅพช็ฏ่ทๅ+ๆ้๏ผ็จๆท็งฏ็ดฏ120็งฏๅๅฏไปฅไฝฟ็จ๏ผ็งฏๅ่ถ้ซ้ขๆฌก่ถ้ซใๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+date | str | N | ๆฅๆ+start_date | str | N | ๅผๅงๆฅๆ(YYYYMMDDๆ ผๅผ)+end_date | str | N | ็ปๆๆฅๆ+fields | str | N | ๆๅฎ่พๅบๅญๆฎต(e.g. fields='w4_bd,w52_ce')++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+date | str | Y | ๆฅๆ+w4_bd | float | Y | 4ๅจ้ถ่กๆ็ฐๆถ็็+w4_ce | float | Y | 4ๅจ็ฅจ้ขๅฉ็+w8_bd | float | Y | 8ๅจ้ถ่กๆ็ฐๆถ็็+w8_ce | float | Y | 8ๅจ็ฅจ้ขๅฉ็+w13_bd | float | Y | 13ๅจ้ถ่กๆ็ฐๆถ็็+w13_ce | float | Y | 13ๅจ็ฅจ้ขๅฉ็+w17_bd | float | Y | 17ๅจ้ถ่กๆ็ฐๆถ็็๏ผๆฐๆฎไป20221019ๅผๅง๏ผ+w17_ce | float | Y | 17ๅจ็ฅจ้ขๅฉ็๏ผๆฐๆฎไป20221019ๅผๅง๏ผ+w26_bd | float | Y | 26ๅจ้ถ่กๆ็ฐๆถ็็+w26_ce | float | Y | 26ๅจ็ฅจ้ขๅฉ็+w52_bd | float | Y | 52ๅจ้ถ่กๆ็ฐๆถ็็+w52_ce | float | Y | 52ๅจ็ฅจ้ขๅฉ็+++<br>+<br>++**ๆฅๅฃ่ฐ็จ**++```python++pro = ts.pro_api()++df = pro.us_tbr(start_date='20180101', end_date='20200327')+++#่ทๅๆๅฎๅญๆฎตๆฐๆฎ+df = pro.us_tbr(start_date='20180101', end_date='20200327', fields='w4_bd,w52_ce')++```++<br>+<br>++**ๆฐๆฎๆ ทไพ**+++ date w4_bd w4_ce w8_bd w8_ce w13_bd w13_ce w26_bd w26_ce w52_bd w52_ce+ 0 20200327 0.01 0.01 0.03 0.03 0.03 0.03 0.02 0.02 0.11 0.11+ 1 20200326 0.01 0.01 0.01 0.01 -0.05 -0.05 0.04 0.04 0.13 0.13+ 2 20200325 -0.04 -0.04 -0.03 -0.03 -0.04 -0.04 0.07 0.07 0.19 0.19+ 3 20200324 0.01 0.01 0.01 0.01 0.01 0.01 0.09 0.09 0.25 0.25+ 4 20200323 0.01 0.01 0.04 0.04 0.02 0.02 0.08 0.08 0.16 0.16+ ... ... ... ... ... ... ... ... ... ... ... ...+ 1995 20120405 0.07 0.07 None None 0.08 0.08 0.14 0.14 0.19 0.19+ 1996 20120404 0.08 0.08 None None 0.08 0.08 0.14 0.14 0.19 0.19+ 1997 20120403 0.07 0.07 None None 0.08 0.08 0.15 0.15 0.20 0.20+ 1998 20120402 0.05 0.05 None None 0.08 0.08 0.14 0.14 0.17 0.17+ 1999 20120330 0.05 0.05 None None 0.07 0.07 0.15 0.15 0.18 0.18++diff --git "a/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\344\270\255\344\277\241\350\241\214\344\270\232\346\210\220\345\210\206.md" "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\344\270\255\344\277\241\350\241\214\344\270\232\346\210\220\345\210\206.md"new file mode 100644index 000000000..9a2b6c02e--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\344\270\255\344\277\241\350\241\214\344\270\232\346\210\220\345\210\206.md"@@ -0,0 +1,124 @@+## ไธญไฟก่กไธๆๅ+----++ๆฅๅฃ๏ผci_index_member+ๆ่ฟฐ๏ผๆไธ็บงๅ็ฑปๆๅไธญไฟก่กไธๆๅ๏ผๅฏๆไพๆไธชๅ็ฑป็ๆๆๆๅ๏ผไนๅฏๆ่ก็ฅจไปฃ็ ๆๅๆๅฑๅ็ฑป๏ผๅๆฐ็ตๆดป+้้๏ผๅๆฌกๆๅคง5000่ก๏ผๆป้ไธ้ๅถ+ๆ้๏ผ็จๆท้5000็งฏๅๅฏ่ฐๅ๏ผ็งฏๅ่ทๅๆนๆณ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+l1_code | str | N | ไธ็บง่กไธไปฃ็ +l2_code | str | N | ไบ็บง่กไธไปฃ็ +l3_code | str | N | ไธ็บง่กไธไปฃ็ +ts_code | str | N | ่ก็ฅจไปฃ็ +is_new | str | N | ๆฏๅฆๆๆฐ๏ผ้ป่ฎคไธบโYๆฏโ๏ผ+++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+l1_code | str | Y | ไธ็บง่กไธไปฃ็ +l1_name | str | Y | ไธ็บง่กไธๅ็งฐ+l2_code | str | Y | ไบ็บง่กไธไปฃ็ +l2_name | str | Y | ไบ็บง่กไธๅ็งฐ+l3_code | str | Y | ไธ็บง่กไธไปฃ็ +l3_name | str | Y | ไธ็บง่กไธๅ็งฐ+ts_code | str | Y | ๆๅ่ก็ฅจไปฃ็ +name | str | Y | ๆๅ่ก็ฅจๅ็งฐ+in_date | str | Y | ็บณๅ ฅๆฅๆ+out_date | str | Y | ๅ้คๆฅๆ+is_new | str | Y | ๆฏๅฆๆๆฐYๆฏNๅฆ++<br>+<br>+++**ๆฅๅฃ็คบไพ**++```python++#่ทๅไบ็บงๅ็ฑปๅ ๅจไปถ็ๆไปฝ่ก+df = pro.ci_index_member(l2_code='CI005835.CI', fields='l2_code,l1_name,ts_code,name')++#่ทๅ000001.SZๆๅฑ่กไธ+df = pro.ci_index_member(ts_code='000001.SZ')++```+++<br>+<br>++**ๆฐๆฎ็คบไพ**++ l2_code l1_name ts_code name+ 0 CI005835.CI ็ตๅญ 301628.SZ ๅผบ่พพ็ต่ทฏ+ 1 CI005835.CI ็ตๅญ 920060.BJ ไธๆบ้+ 2 CI005835.CI ็ตๅญ 301251.SZ ๅจๅฐ้ซ+ 3 CI005835.CI ็ตๅญ 002552.SZ ๅฎ้ผ็งๆ+ 4 CI005835.CI ็ตๅญ 301566.SZ ่พพๅฉๅฏๆฎ+ 5 CI005835.CI ็ตๅญ 688519.SH ๅไบๆฐๆ+ 6 CI005835.CI ็ตๅญ 603920.SH ไธ่ฟ็ต่ทฏ+ 7 CI005835.CI ็ตๅญ 603936.SH ๅๆ็ตๅญ+ 8 CI005835.CI ็ตๅญ 603989.SH ่พๅ้ๅข+ 9 CI005835.CI ็ตๅญ 688020.SH ๆน้ฆ่กไปฝ+ 10 CI005835.CI ็ตๅญ 300852.SZ ๅไผๅฏไป+ 11 CI005835.CI ็ตๅญ 688655.SH ่ฟ ๆทๅ ด+ 12 CI005835.CI ็ตๅญ 688183.SH ็็็ตๅญ+ 13 CI005835.CI ็ตๅญ 301132.SZ ๆปกๅค็งๆ+ 14 CI005835.CI ็ตๅญ 001389.SZ ๅนฟๅ็งๆ+ 15 CI005835.CI ็ตๅญ 002288.SZ *ST่ถ ๅ(้ๅธ)+ 16 CI005835.CI ็ตๅญ 600563.SH ๆณๆ็ตๅญ+ 17 CI005835.CI ็ตๅญ 603186.SH ๅๆญฃๆฐๆ+ 18 CI005835.CI ็ตๅญ 603228.SH ๆฏๆบ็ตๅญ+ 19 CI005835.CI ็ตๅญ 603328.SH ไพ้กฟ็ตๅญ+ 20 CI005835.CI ็ตๅญ 000636.SZ ้ฃๅ้ซ็ง+ 21 CI005835.CI ็ตๅญ 000823.SZ ่ถ ๅฃฐ็ตๅญ+ 22 CI005835.CI ็ตๅญ 002134.SZ ๅคฉๆดฅๆฎๆ+ 23 CI005835.CI ็ตๅญ 002138.SZ ้กบ็ป็ตๅญ+ 24 CI005835.CI ็ตๅญ 002199.SZ *STไธๆถ+ 25 CI005835.CI ็ตๅญ 002436.SZ ๅ ดๆฃฎ็งๆ+ 26 CI005835.CI ็ตๅญ 002463.SZ ๆฒช็ต่กไปฝ+ 27 CI005835.CI ็ตๅญ 002484.SZ ๆฑๆตท่กไปฝ+ 28 CI005835.CI ็ตๅญ 002579.SZ ไธญไบฌ็ตๅญ+ 29 CI005835.CI ็ตๅญ 002618.SZ ไธน้ฆ้(้ๅธ)+ 30 CI005835.CI ็ตๅญ 002636.SZ ้ๅฎๅฝ็บช+ 31 CI005835.CI ็ตๅญ 300814.SZ ไธญๅฏ็ต่ทฏ+ 32 CI005835.CI ็ตๅญ 300964.SZ ๆฌๅทๆบ่ฝ+ 33 CI005835.CI ็ตๅญ 002815.SZ ๅด่พพๆๆฏ+ 34 CI005835.CI ็ตๅญ 002859.SZ ๆด็พ็งๆ+ 35 CI005835.CI ็ตๅญ 002913.SZ ๅฅฅๅฃซๅบท+ 36 CI005835.CI ็ตๅญ 002916.SZ ๆทฑๅ็ต่ทฏ+ 37 CI005835.CI ็ตๅญ 301366.SZ ไธๅ็งๆ+ 38 CI005835.CI ็ตๅญ 300319.SZ ้บฆๆท็งๆ+ 39 CI005835.CI ็ตๅญ 300408.SZ ไธ็ฏ้ๅข+ 40 CI005835.CI ็ตๅญ 300476.SZ ่ๅฎ็งๆ+ 41 CI005835.CI ็ตๅญ 688630.SH ่ฏ็ขๅพฎ่ฃ+ 42 CI005835.CI ็ตๅญ 300975.SZ ๅ็ป็ตๅญ+ 43 CI005835.CI ็ตๅญ 837821.BJ ๅๆ็ตๅญ+ 44 CI005835.CI ็ตๅญ 871981.BJ ๆถ่ต็งๆ+ 45 CI005835.CI ็ตๅญ 300657.SZ ๅผไฟก็ตๅญ+ 46 CI005835.CI ็ตๅญ 301282.SZ ้็ฆ็ตๅญ+ 47 CI005835.CI ็ตๅญ 300739.SZ ๆ้ณ็ต่ทฏ+ 48 CI005835.CI ็ตๅญ 600183.SH ็็็งๆ+ 49 CI005835.CI ็ตๅญ 600237.SH ้ๅณฐ็ตๅญ+ 50 CI005835.CI ็ตๅญ 603386.SH ้ชไบ็งๆ+ 51 CI005835.CI ็ตๅญ 605258.SH ๅๅ็ตๅญ+ 52 CI005835.CI ็ตๅญ 300903.SZ ็ง็ฟ่กไปฝ+ 53 CI005835.CI ็ตๅญ 605058.SH ๆพณๅผ็ตๅญ+ 54 CI005835.CI ็ตๅญ 301041.SZ ้็พๆณฝ+++++\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\344\270\255\344\277\241\350\241\214\344\270\232\346\214\207\346\225\260\346\227\245\350\241\214\346\203\205.md" "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\344\270\255\344\277\241\350\241\214\344\270\232\346\214\207\346\225\260\346\227\245\350\241\214\346\203\205.md"new file mode 100644index 000000000..e18eac9d2--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\344\270\255\344\277\241\350\241\214\344\270\232\346\214\207\346\225\260\346\227\245\350\241\214\346\203\205.md"@@ -0,0 +1,73 @@+## ไธญไฟก่กไธๆๆฐ่กๆ+----++ๆฅๅฃ๏ผci_daily+ๆ่ฟฐ๏ผ่ทๅไธญไฟก่กไธๆๆฐๆฅ็บฟ่กๆ+้้๏ผๅๆฌกๆๅคง4000ๆก๏ผๅฏๅพช็ฏๆๅ+็งฏๅ๏ผ5000็งฏๅๅฏ่ฐๅ๏ผๅฏ้่ฟๆๆฐไปฃ็ ๅๆฅๆๅๆฐๅพช็ฏ่ทๅๆๆๆฐๆฎ++<br>+<br>+++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่กไธไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ๏ผYYYYMMDDๆ ผๅผ๏ผไธๅ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ๆๆฐไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+open | float | Y | ๅผ็็นไฝ+low | float | Y | ๆไฝ็นไฝ+high | float | Y | ๆ้ซ็นไฝ+close | float | Y | ๆถ็็นไฝ+pre_close | float | Y | ๆจๆฅๆถ็็นไฝ+change | float | Y | ๆถจ่ท็นไฝ+pct_change | float | Y | ๆถจ่ทๅน+vol | float | Y | ๆไบค้๏ผไธ่ก๏ผ+amount | float | Y | ๆไบค้ข๏ผไธๅ ๏ผ++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api('your token')++df = pro.ci_daily(trade_date='20230705', fields='ts_code,trade_date,open,low,high,close')++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code trade_date open low high close+ 0 CI005001.CI 20230705 2757.5662 2736.8198 2764.1863 2754.2617+ 1 CI005002.CI 20230705 3006.7166 3000.1382 3039.3916 3029.7837+ 2 CI005003.CI 20230705 6443.6250 6431.1250 6597.5933 6588.1401+ 3 CI005004.CI 20230705 2675.3940 2672.7278 2693.6438 2676.9941+ 4 CI005005.CI 20230705 1575.1489 1571.6997 1597.4792 1593.6205+ .. ... ... ... ... ... ...+ 435 CI005920.CI 20230705 6585.6924 6521.1846 6599.1216 6529.9458+ 436 CI005921.CI 20230705 2759.9133 2753.9324 2781.3979 2757.9863+ 437 CI005922.CI 20230705 5690.3843 5645.3955 5690.4165 5652.8184+ 438 CI005923.CI 20230705 5855.1333 5808.8325 5855.1470 5816.7471+ 439 CI005924.CI 20230705 5782.8662 5737.0601 5782.8984 5744.5962++ [440 rows x 6 columns]\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\345\233\275\351\231\205\344\270\273\350\246\201\346\214\207\346\225\260.md" "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\345\233\275\351\231\205\344\270\273\350\246\201\346\214\207\346\225\260.md"new file mode 100644index 000000000..27aac1ad9--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\345\233\275\351\231\205\344\270\273\350\246\201\346\214\207\346\225\260.md"@@ -0,0 +1,120 @@+## ๅฝ้ ๆๆฐ+----++ๆฅๅฃ๏ผindex_global๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆ่ฟฐ๏ผ่ทๅๅฝ้ ไธป่ฆๆๆฐๆฅ็บฟ่กๆ+้้๏ผๅๆฌกๆๅคงๆๅ4000่กๆ ๆฐๆฎ๏ผๅฏๅพช็ฏ่ทๅ๏ผๆป้ไธ้ๅถ+็งฏๅ๏ผ็จๆท็งฏ6000็งฏๅๅฏ่ฐๅ๏ผ็งฏๅ่ถ้ซ้ขๆฌก่ถ้ซ๏ผ่ฏท่ช่กๆ้ซ็งฏๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>+++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | TSๆๆฐไปฃ็ ๏ผ่งไธ่กจ+trade_date | str | N | ไบคๆๆฅๆ๏ผYYYYMMDDๆ ผๅผ๏ผไธๅ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>+++| TSๆๆฐไปฃ็ | ๆๆฐๅ็งฐ |+| -------- | -------- |+| XIN9 | ๅฏๆถไธญๅฝA50ๆๆฐ (ๅฏๆถA50) |+| HSI | ๆ็ๆๆฐ |+| HKTECH | ๆ็็งๆๆๆฐ |+| HKAH | ๆ็AH่กHๆๆฐ |+| DJI | ้็ผๆฏๅทฅไธๆๆฐ |+| SPX | ๆ ๆฎ500ๆๆฐ |+| IXIC | ็บณๆฏ่พพๅ ๆๆฐ |+| FTSE | ๅฏๆถ100ๆๆฐ |+| FCHI | ๆณๅฝCAC40ๆๆฐ |+| GDAXI | ๅพทๅฝDAXๆๆฐ |+| N225 | ๆฅ็ป225ๆๆฐ |+| KS11 | ้ฉๅฝ็ปผๅๆๆฐ |+| AS51 | ๆพณๅคงๅฉไบๆ ๆฎ200ๆๆฐ |+| SENSEX | ๅฐๅบฆๅญไนฐSENSEXๆๆฐ |+| IBOVESPA | ๅทด่ฅฟIBOVESPAๆๆฐ |+| RTS | ไฟ็ฝๆฏRTSๆๆฐ |+| TWII | ๅฐๆนพๅ ๆๆๆฐ |+|CKLSE | ้ฉฌๆฅ่ฅฟไบๆๆฐ |+|SPTSX | ๅ ๆฟๅคงS&P/TSXๆๆฐ |+|CSX5P |STOXXๆฌงๆดฒ50ๆๆฐ |+|RUT |็ฝ็ด 2000ๆๆฐ |++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | TSๆๆฐไปฃ็ +trade_date | str | Y | ไบคๆๆฅ+open | float | Y | ๅผ็็นไฝ+close | float | Y | ๆถ็็นไฝ+high | float | Y | ๆ้ซ็นไฝ+low | float | Y | ๆไฝ็นไฝ+pre_close | float | Y | ๆจๆฅๆถ็็น+change | float | Y | ๆถจ่ท็นไฝ+pct_chg | float | Y | ๆถจ่ทๅน+swing | float | Y | ๆฏๅน+vol | float | Y | ๆไบค้ ๏ผๅคง้จๅๆ ๆญค้กนๆฐๆฎ๏ผ+amount | float | N | ๆไบค้ข ๏ผๅคง้จๅๆ ๆญค้กนๆฐๆฎ๏ผ++<br>+<br>++**ๆฅๅฃไฝฟ็จ**++```pyhton++pro = ts.pro_api()++#่ทๅๅฏๆถไธญๅฝ50ๆๆฐ+df = pro.index_global(ts_code='XIN9', start_date='20200201', end_date='20200220')++```++<br>+<br>+++**ๆฐๆฎ็คบไพ**++ trade_date open close high low pre_close change \+ 0 20200220 13750.45 14009.40 14023.88 13750.45 13750.45 258.95+ 1 20200219 13712.13 13750.45 13815.63 13674.43 13712.13 38.32+ 2 20200218 13859.23 13712.13 13859.32 13671.89 13859.23 -147.10+ 3 20200217 13646.93 13859.23 13859.23 13632.23 13646.93 212.30+ 4 20200214 13547.16 13646.93 13660.84 13518.83 13547.16 99.77+ 5 20200213 13638.49 13547.16 13696.95 13535.21 13638.49 -91.33+ 6 20200212 13603.43 13638.49 13639.14 13529.55 13603.43 35.06+ 7 20200211 13420.83 13603.43 13661.80 13420.70 13420.83 182.60+ 8 20200210 13426.71 13420.83 13455.79 13260.81 13426.71 -5.88+ 9 20200207 13481.92 13426.71 13481.92 13286.61 13481.92 -55.21+ 10 20200206 13301.97 13481.92 13532.73 13273.11 13301.97 179.95+ 11 20200205 13187.05 13301.97 13389.27 13145.93 13187.05 114.92+ 12 20200204 12815.75 13187.05 13195.82 12815.01 12815.75 371.30+ 13 20200203 13791.36 12815.75 13791.36 12622.61 13791.36 -975.61++ pct_chg ts_code+ 0 1.8832 XIN9+ 1 0.2795 XIN9+ 2 -1.0614 XIN9+ 3 1.5557 XIN9+ 4 0.7365 XIN9+ 5 -0.6696 XIN9+ 6 0.2577 XIN9+ 7 1.3606 XIN9+ 8 -0.0438 XIN9+ 9 -0.4095 XIN9+ 10 1.3528 XIN9+ 11 0.8715 XIN9+ 12 2.8972 XIN9+ 13 -7.0741 XIN9diff --git "a/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\345\244\247\347\233\230\346\214\207\346\225\260\346\257\217\346\227\245\346\214\207\346\240\207.md" "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\345\244\247\347\233\230\346\214\207\346\225\260\346\257\217\346\227\245\346\214\207\346\240\207.md"new file mode 100644index 000000000..b83986c83--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\345\244\247\347\233\230\346\214\207\346\225\260\346\257\217\346\227\245\346\214\207\346\240\207.md"@@ -0,0 +1,62 @@+## ๅคง็ๆๆฐๆฏๆฅๆๆ +----++ๆฅๅฃ๏ผindex_dailybasic๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆ่ฟฐ๏ผ็ฎๅๅชๆไพไธ่ฏ็ปผๆ๏ผๆทฑ่ฏๆๆ๏ผไธ่ฏ50๏ผไธญ่ฏ500๏ผไธญๅฐๆฟๆ๏ผๅไธๆฟๆ็ๆฏๆฅๆๆ ๆฐๆฎ+ๆฐๆฎๆฅๆบ๏ผTushare็คพๅบ็ป่ฎก่ฎก็ฎ+ๆฐๆฎๅๅฒ๏ผไป2004ๅนด1ๆๅผๅงๆไพ+ๆฐๆฎๆ้๏ผ็จๆท้่ฆ่ณๅฐ400็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+trade_date | str | N | ไบคๆๆฅๆ ๏ผๆ ผๅผ๏ผYYYYMMDD๏ผๆฏๅฆ20181018๏ผไธๅ๏ผ+ts_code | str | N | TSไปฃ็ +start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++ๆณจ๏ผtrade_date๏ผts_code ่ณๅฐ่ฆ่พๅ ฅไธไธชๅๆฐ๏ผๅๆฌก้้3000ๆก๏ผๅณ๏ผๅไธๆๆฐๅๆฌกๅฏๆๅ่ถ ่ฟ12ๅนดๅๅฒ๏ผ๏ผๆป้ไธ้ๅถใ++++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | TSไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+total_mv | float | Y | ๅฝๆฅๆปๅธๅผ๏ผๅ ๏ผ+float_mv | float | Y | ๅฝๆฅๆต้ๅธๅผ๏ผๅ ๏ผ+total_share | float | Y | ๅฝๆฅๆป่กๆฌ๏ผ่ก๏ผ+float_share | float | Y | ๅฝๆฅๆต้่กๆฌ๏ผ่ก๏ผ+free_share | float | Y | ๅฝๆฅ่ช็ฑๆต้่กๆฌ๏ผ่ก๏ผ+turnover_rate | float | Y | ๆขๆ็+turnover_rate_f | float | Y | ๆขๆ็(ๅบไบ่ช็ฑๆต้่กๆฌ)+pe | float | Y | ๅธ็็+pe_ttm | float | Y | ๅธ็็TTM+pb | float | Y | ๅธๅ็+++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++df = pro.index_dailybasic(trade_date='20181018', fields='ts_code,trade_date,turnover_rate,pe')++```++**ๆฐๆฎ็คบไพ**+++ ts_code trade_date turnover_rate pe+ 0 000001.SH 20181018 0.38 11.92+ 1 000300.SH 20181018 0.27 11.17+ 2 000905.SH 20181018 0.82 18.03+ 3 399001.SZ 20181018 0.88 17.48+ 4 399005.SZ 20181018 0.85 21.43+ 5 399006.SZ 20181018 1.50 29.56+ 6 399016.SZ 20181018 1.06 18.86+ 7 399300.SZ 20181018 0.27 11.17\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\346\214\207\346\225\260\345\216\206\345\217\262\345\210\206\351\222\237.md" "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\346\214\207\346\225\260\345\216\206\345\217\262\345\210\206\351\222\237.md"new file mode 100644index 000000000..d2b71e66e--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\346\214\207\346\225\260\345\216\206\345\217\262\345\210\206\351\222\237.md"@@ -0,0 +1,82 @@+## ่ก็ฅจๅๅฒๅ้่กๆ+----++ๆฅๅฃ๏ผidx_mins+ๆ่ฟฐ๏ผ่ทๅไบคๆๆๆๆฐๅ้ๆฐๆฎ๏ผๆฏๆ1min/5min/15min/30min/60min่กๆ ๏ผๆไพPython SDKๅ http Restful APIไธค็งๆนๅผ+้้๏ผๅๆฌกๆๅคง8000่กๆฐๆฎ๏ผๅฏไปฅ้่ฟๆๆฐไปฃ็ ๅๆถ้ดๅพช็ฏ่ทๅ๏ผๆฌๆฅๅฃๅฏไปฅๆไพ่ถ ่ฟ10ๅนดๅๅฒๅ้ๆฐๆฎ+ๆ้๏ผ้ๅ็ฌๅผๆ้๏ผๆญฃๅผๆ้่ฏทๅ้ <u>[ๆ้่ฏดๆ](https://tushare.pro/document/1?doc_id=290) </u> ๏ผๅฏไปฅ[ๅจ็บฟๅผ้](https://tushare.pro/weborder/#/permission)ๅ้ๆ้ใ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ๆๆฐไปฃ็ ๏ผe.g. 000001.SH+freq | str | Y | ๅ้้ขๅบฆ๏ผ1min/5min/15min/30min/60min๏ผ+start_date | datetime | N | ๅผๅงๆฅๆ ๆ ผๅผ๏ผ2023-08-25 09:00:00+end_date | datetime | N | ็ปๆๆถ้ด ๆ ผๅผ๏ผ2023-08-25 19:00:00++<br>+<br>+++**freqๅๆฐ่ฏดๆ**++freq | ่ฏดๆ+--- | ----+1min | 1ๅ้+5min | 5ๅ้+15min | 15ๅ้+30min | 30ๅ้+60min | 60ๅ้++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ๆๆฐไปฃ็ +trade_time | str | Y | ไบคๆๆถ้ด+open | float | Y | ๅผ็ไปท+close | float | Y | ๆถ็ไปท+high | float | Y | ๆ้ซไปท+low | float | Y | ๆไฝไปท+vol | int | Y | ๆไบค้(่ก)+amount | float | Y | ๆไบค้้ข๏ผๅ ๏ผ++<br>+<br>++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++#่ทๅไธ่ฏ็ปผๆ000001.SH็ๅๅฒๅ้ๆฐๆฎ+df = pro.idx_mins(ts_code='000001.SH', freq='1min', start_date='2023-08-25 09:00:00', end_date='2023-08-25 19:00:00')++```++<br>+<br>+++**ๆฐๆฎๆ ทไพ**++ ts_code trade_time close open high low vol amount+ 0 000001.SH 2023-08-25 15:00:00 3064.0747 3065.2124 3065.2124 3064.0747 315294700.0 3.375271e+09+ 1 000001.SH 2023-08-25 14:59:00 3065.6626 3065.6626 3065.6626 3065.6626 0.0 0.000000e+00+ 2 000001.SH 2023-08-25 14:58:00 3065.6626 3065.6570 3065.6626 3065.6570 4073500.0 4.559007e+07+ 3 000001.SH 2023-08-25 14:57:00 3065.7598 3065.7424 3065.9077 3065.0298 186465300.0 1.920655e+09+ 4 000001.SH 2023-08-25 14:56:00 3065.5800 3065.7822 3066.4700 3065.3257 166403300.0 1.804927e+09+ .. ... ... ... ... ... ... ... ...+ 236 000001.SH 2023-08-25 09:34:00 3064.0361 3067.4740 3068.0984 3064.0361 394884900.0 4.478565e+09+ 237 000001.SH 2023-08-25 09:33:00 3066.8120 3064.5352 3067.5325 3063.8894 448783200.0 5.006195e+09+ 238 000001.SH 2023-08-25 09:32:00 3064.6367 3069.6433 3070.4116 3063.8950 525851800.0 5.696113e+09+ 239 000001.SH 2023-08-25 09:31:00 3069.0334 3067.8394 3069.0334 3066.2466 826002900.0 9.270067e+09+ 240 000001.SH 2023-08-25 09:30:00 3068.6150 3068.6150 3068.6150 3068.6150 241406700.0 2.880646e+09diff --git "a/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\346\214\207\346\225\260\345\221\250\347\272\277\350\241\214\346\203\205.md" "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\346\214\207\346\225\260\345\221\250\347\272\277\350\241\214\346\203\205.md"new file mode 100644index 000000000..2bc0b1535--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\346\214\207\346\225\260\345\221\250\347\272\277\350\241\214\346\203\205.md"@@ -0,0 +1,96 @@+## ๆๆฐๅจ็บฟ่กๆ+----++ๆฅๅฃ๏ผindex_weekly+ๆ่ฟฐ๏ผ่ทๅๆๆฐๅจ็บฟ่กๆ+้้๏ผๅๆฌกๆๅคง1000่ก่ฎฐๅฝ๏ผๅฏๅๆน่ทๅ๏ผๆป้ไธ้ๅถ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ600็งฏๅๆๅฏไปฅ่ฐๅ๏ผ็งฏๅ่ถๅค้ขๆฌก่ถ้ซ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | TSไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | TSๆๆฐไปฃ็ +trade_date | str | Y | ไบคๆๆฅ+close | float | Y | ๆถ็็นไฝ+open | float | Y | ๅผ็็นไฝ+high | float | Y | ๆ้ซ็นไฝ+low | float | Y | ๆไฝ็นไฝ+pre_close | float | Y | ๆจๆฅๆถ็็น+change | float | Y | ๆถจ่ท็นไฝ+pct_chg | float | Y | ๆถจ่ทๅน+vol | float | Y |ๆไบค้๏ผๆ๏ผ+amount | float | Y | ๆไบค้ข๏ผๅๅ ๏ผ++++**ๆฅๅฃ็จๆณ**+```python++pro = ts.pro_api()++df = pro.index_weekly(ts_code='000001.SH', start_date='20180101', end_date='20190329', fields='ts_code,trade_date,open,high,low,close,vol,amount')++```++ๆ่++```python++df = pro.index_weekly(trade_date='20190329', fields='ts_code,trade_date,open,high,low,close,vol,amount')++```++**ๆฐๆฎๆ ทไพ**++ ts_code trade_date close open high low \+ 0 000001.SH 20190329 3090.7580 3058.8016 3093.0329 2987.7717+ 1 000001.SH 20190322 3104.1487 3027.8012 3125.0192 3009.5071+ 2 000001.SH 20190315 3021.7512 2969.0802 3093.3913 2963.5834+ 3 000001.SH 20190308 2969.8614 3015.9427 3129.9395 2969.5815+ 4 000001.SH 20190301 2994.0050 2838.3896 2997.4882 2838.3896+ 5 000001.SH 20190222 2804.2262 2699.8171 2804.2262 2699.8171+ 6 000001.SH 20190215 2682.3850 2613.1742 2729.4550 2613.1742+ 7 000001.SH 20190201 2618.2323 2615.7118 2630.3183 2559.9820+ 8 000001.SH 20190125 2601.7234 2599.0575 2618.9801 2569.7004+ 9 000001.SH 20190118 2596.0056 2553.3284 2598.8836 2532.4333+ 10 000001.SH 20190111 2553.8313 2528.6987 2574.4079 2515.5083+ 11 000001.SH 20190104 2514.8682 2497.8805 2515.3160 2440.9066+ 12 000001.SH 20181228 2493.8962 2506.7372 2532.0022 2462.8448+ 13 000001.SH 20181221 2516.2506 2587.2632 2599.1479 2498.6937+ 14 000001.SH 20181214 2593.7407 2589.1940 2645.8367 2576.2424+ 15 000001.SH 20181207 2605.8876 2647.1319 2666.0784 2599.2775+ 16 000001.SH 20181130 2588.1875 2580.8424 2617.5479 2555.3223+ 17 000001.SH 20181123 2579.4831 2681.8988 2703.5116 2577.3511+ 18 000001.SH 20181116 2679.1097 2593.2004 2695.5689 2590.2106++ vol amount+ 0 1.688357e+11 1.688151e+12+ 1 1.886363e+11 1.861600e+12+ 2 2.104949e+11 2.043644e+12+ 3 2.666471e+11 2.400174e+12+ 4 2.265186e+11 1.976327e+12+ 5 1.394586e+11 1.194304e+12+ 6 9.758357e+10 8.413281e+11+ 7 7.093562e+10 5.928545e+11+ 8 7.608258e+10 6.350025e+11+ 9 8.076279e+10 6.593113e+11+ 10 8.366105e+10 6.847728e+11+ 11 4.032072e+10 3.438140e+11+ 12 6.014621e+10 5.129771e+11+ 13 5.782961e+10 5.008462e+11+ 14 6.147029e+10 5.296716e+11+ 15 7.806582e+10 6.925260e+11+ 16 7.004342e+10 5.716554e+11+ 17 9.709342e+10 8.023547e+11+ 18 1.112811e+11 8.857952e+11\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\346\214\207\346\225\260\345\237\272\346\234\254\344\277\241\346\201\257.md" "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\346\214\207\346\225\260\345\237\272\346\234\254\344\277\241\346\201\257.md"new file mode 100644index 000000000..945e2bcd0--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\346\214\207\346\225\260\345\237\272\346\234\254\344\277\241\346\201\257.md"@@ -0,0 +1,102 @@+## ๆๆฐๅบๆฌไฟกๆฏ+----++ๆฅๅฃ๏ผindex_basic๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆ่ฟฐ๏ผ่ทๅๆๆฐๅบ็กไฟกๆฏใ++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ๆๆฐไปฃ็ +name | str | N | ๆๆฐ็ฎ็งฐ+market | str | N | ไบคๆๆๆๆๅกๅ(้ป่ฎคSSE)+publisher | str | N | ๅๅธๅ+category | str | N | ๆๆฐ็ฑปๅซ++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๆ่ฟฐ+--- | ---- | ----+ts_code | str | TSไปฃ็ +name | str | ็ฎ็งฐ+fullname | str | ๆๆฐๅ จ็งฐ+market | str | ๅธๅบ+publisher | str | ๅๅธๆน+index_type | str | ๆๆฐ้ฃๆ ผ+category | str | ๆๆฐ็ฑปๅซ+base_date | str | ๅบๆ+base_point | float | ๅบ็น+list_date | str | ๅๅธๆฅๆ+weight_rule | str | ๅ ๆๆนๅผ+desc | str | ๆ่ฟฐ+exp_date | str | ็ปๆญขๆฅๆ++**ๅธๅบ่ฏดๆ(market)**+++ๅธๅบไปฃ็ | ่ฏดๆ+-- | --+MSCI | MSCIๆๆฐ+CSI | ไธญ่ฏๆๆฐ+SSE | ไธไบคๆๆๆฐ+SZSE | ๆทฑไบคๆๆๆฐ+CICC | ไธญ้ๆๆฐ+SW | ็ณไธๆๆฐ+OTH | ๅ ถไปๆๆฐ++**ๆๆฐๅ่กจ**++- ไธป้ขๆๆฐ+- ่งๆจกๆๆฐ+- ็ญ็ฅๆๆฐ+- ้ฃๆ ผๆๆฐ+- ็ปผๅๆๆฐ+- ๆ้ฟๆๆฐ+- ไปทๅผๆๆฐ+- ๆ่ฒๆๆฐ+- ๅๅทฅๆๆฐ+- ่ฝๆบๆๆฐ+- ๅ ถไปๆๆฐ+- ๅคๆฑๆๆฐ+- ๅบ้ๆๆฐ+- ๅๅๆๆฐ+- ๅบๅธๆๆฐ+- ่กไธๆๆฐ+- ่ดต้ๅฑๆๆฐ+- ๅๅฏไบงๅๆๆฐ+- ่ฝฏๅๅๆๆฐ+- ๆฒน่ๆฒนๆๆๆฐ+- ้้ๅฑๅปบๆๆๆฐ+- ็ ค็ฆ้ข็ฟๆๆฐ+- ่ฐท็ฉๆๆฐ+++**ๆฅๅฃไฝฟ็จ**++```python++pro = ts.pro_api()++df = pro.index_basic(market='SW')++```+++**ๆฐๆฎๆ ทไพ**++ ts_code name market publisher category base_date base_point \+ 5 801010.SI ๅๆ็งๆธ SW ็ณไธ ไธ็บง่กไธๆๆฐ 19991230 1000.0+ 6 801011.SI ๆไธโ ก SW ็ณไธ ไบ็บง่กไธๆๆฐ 19991230 1000.0+ 7 801012.SI ๅไบงๅๅ ๅทฅ SW ็ณไธ ไบ็บง่กไธๆๆฐ 19991230 1000.0+ 8 801013.SI ๅไธ็ปผๅโ ก SW ็ณไธ ไบ็บง่กไธๆๆฐ 19991230 1000.0+ 9 801014.SI ้ฅฒๆโ ก SW ็ณไธ ไบ็บง่กไธๆๆฐ 19991230 1000.0+ 10 801015.SI ๆธไธ SW ็ณไธ ไบ็บง่กไธๆๆฐ 19991230 1000.0+ 11 801016.SI ็งๆคไธ SW ็ณไธ ไบ็บง่กไธๆๆฐ 19991230 1000.0+ 12 801017.SI ็็ฆฝๅ ปๆฎโ ก SW ็ณไธ ไบ็บง่กไธๆๆฐ 20111010 1000.0+ 13 801018.SI ๅจ็ฉไฟๅฅโ ก SW ็ณไธ็ ไบ็บง่กไธๆๆฐ 19991230 1000.0+ 14 801020.SI ้ๆ SW ็ณไธ ไธ็บง่กไธๆๆฐ 19991230 1000.0+ 15 801021.SI ็ ค็ญๅผ้โ ก SW ็ณไธ ไบ็บง่กไธๆๆฐ 19991230 1000.0+ 16 801022.SI ๅ ถไป้ๆโ ก SW ็ณไธ ไบ็บง่กไธๆๆฐ 19991230 1000.0+ 17 801023.SI ็ณๆฒนๅผ้โ ก SW ็ณไธ ไบ็บง่กไธๆๆฐ 19991230 1000.0+ 18 801024.SI ้ๆๆๅกโ ก SW ็ณไธ ไบ็บง่กไธๆๆฐ 19991230 1000.0\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\346\214\207\346\225\260\345\256\236\346\227\266\345\210\206\351\222\237.md" "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\346\214\207\346\225\260\345\256\236\346\227\266\345\210\206\351\222\237.md"new file mode 100644index 000000000..bd2e606b7--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\346\214\207\346\225\260\345\256\236\346\227\266\345\210\206\351\222\237.md"@@ -0,0 +1,65 @@+## A่กๅฎๆถๅ้+----++ๆฅๅฃ๏ผrt_idx_min+ๆ่ฟฐ๏ผ่ทๅไบคๆๆๆๆฐๅฎๆถๅ้ๆฐๆฎ๏ผๅ ๆฌ1~60min+้้๏ผๅๆฌกๆๅคง1000่กๆฐๆฎ๏ผๅฏไปฅ้่ฟ่ก็ฅจไปฃ็ ๆๅๆฐๆฎ๏ผๆฏๆ้ๅทๅ้็ๅคไธชไปฃ็ ๅๆถๆๅ+ๆ้๏ผๆญฃๅผๆ้่ฏทๅ้ <u>[ๆ้่ฏดๆ](https://tushare.pro/document/1?doc_id=290) </u>++ๆณจ๏ผๆฏๆ่ก็ฅจๅฝๆฅๅผ็ไปฅๆฅ็ๆๆๅๅฒๅ้ๆฐๆฎๆๅ๏ผๆฅๅฃๅ๏ผrt_idx_min_daily๏ผไป ๆฏๆไธไธชไธชๆๆฐๆๅ๏ผไธๅๅๆถๆๅๅคไธช๏ผ๏ผๅฏไปฅ[ๅจ็บฟๅผ้](https://tushare.pro/weborder/#/permission)ๆ้ใ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+freq | str | Y | 1MIN,5MIN,15MIN,30MIN,60MIN ๏ผๅคงๅ๏ผ+ts_code | str | Y | ๆฏๆๅไธชๅๅคไธช๏ผ000001.SH ๆ่ 000001.SH,399300.SZ+++<br>+<br>++**freqๅๆฐ่ฏดๆ**++freq | ่ฏดๆ+--- | ----+1MIN | 1ๅ้+5MIN | 5ๅ้+15MIN | 15ๅ้+30MIN | 30ๅ้+60MIN | 60ๅ้++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +time | None | Y | ไบคๆๆถ้ด+open | float | Y | ๅผ็ไปท+close | float | Y | ๆถ็ไปท+high | float | Y | ๆ้ซไปท+low | float | Y | ๆไฝไปท+vol | float | Y | ๆไบค้(่ก๏ผ+amount | float | Y | ๆไบค้ข๏ผๅ ๏ผ++++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++#่ทๅไธ่ฏ็ปผๆ000001.SH็ๅฎๆถๅ้ๆฐๆฎ+df = pro.rt_idx_min(ts_code='000001.SH', freq='1MIN')++```++<br>+<br>\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\346\214\207\346\225\260\345\256\236\346\227\266\346\227\245\347\272\277.md" "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\346\214\207\346\225\260\345\256\236\346\227\266\346\227\245\347\272\277.md"new file mode 100644index 000000000..ceafecac6--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\346\214\207\346\225\260\345\256\236\346\227\266\346\227\245\347\272\277.md"@@ -0,0 +1,63 @@+# ไบคๆๆๆๆฐๅฎๆถๆฅ็บฟ++----++ๆฅๅฃ๏ผrt_idx_k+ๆ่ฟฐ๏ผ่ทๅไบคๆๆๆๆฐๅฎๆถๆฅ็บฟ่กๆ ๏ผๆฏๆๆไปฃ็ ๆไปฃ็ ้้ ็ฌฆไธๆฌกๆงๆๅๅ จ้จไบคๆๆๆๆฐๅฎๆถๆฅk็บฟ่กๆ+็งฏๅ๏ผๆฌๆฅๅฃๆฏๅ็ฌๅผๆ้็ๆฐๆฎ๏ผๅ็ฌ็ณ่ฏทๆ้่ฏทๅ่[ๆ้ๅ่กจ](https://tushare.pro/document/1?doc_id=290)++<br>++### ่พๅ ฅๅๆฐ+ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ๆๆฐไปฃ็ ๏ผๆฏๆ้้ ็ฌฆๆนๅผ๏ผe.g. 0\*.SHใ3\*.SZใ000001.SH++<br>++### ่พๅบๅๆฐ+ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+---- | ---- | ---- | ----+ts_code | str | Y | ๆๆฐไปฃ็ +name | str | Y | ๆๆฐๅ็งฐ+trade_time | str | Y | ไบคๆๆถ้ด+close | float | Y | ็ฐไปท+pre_close | float | Y | ๆจๆถ+high | float | Y | ๆ้ซไปท+open | float | Y | ๅผ็ไปท+low | float | Y | ๆไฝไปท+vol | float | Y | ๆไบค้+amount | float | Y | ๆไบค้้ข๏ผๅ ๏ผ++<br>++### ไปฃ็ ็คบไพ+```python++#่ทๅๅไธชๆๆฐๅฎๆถ่กๆ+df = pro.rt_idx_k(ts_code='000001.SH')++#่ทๅๅคไธชๆๆฐๅฎๆถ่กๆ ,ไปฅไธ่ฏ็ปผๆๅๆทฑ่ฏAๆไธบไพ+df = pro.rt_idx_k(ts_code='000001.SH,399107.SZ')++#่ทๅไธไบคๆๆๆๆๆฐๅฎๆถ่กๆ ๏ผๅๆถๆๅฎ่พๅบๅญๆฎต+df = pro.rt_idx_k(ts_code='0*.SH', fields='ts_code,name,close,vol')++```++<br>++### ๆฐๆฎ็ปๆ++ ts_code name close vol+ 0 000851.SH ็พๅ100 19517.5514 2.035695e+07+ 1 000934.SH ไธญ่ฏ้่ 6203.0781 6.711314e+07+ 2 000010.SH ไธ่ฏ180 9773.2466 1.135439e+08+ 3 000065.SH ไธ่ฏ้พๅคด 3527.1942 5.541939e+07+ 4 000033.SH ไธ่ฏๆๆ 3232.1719 2.889464e+07+ .. ... ... ... ...+ 195 000888.SH ไธ่ฏๆถ็ 4420.1632 4.787276e+08+ 196 000011.SH ๅบ้ๆๆฐ 7103.0192 1.107185e+09+ 197 000008.SH ็ปผๅๆๆฐ 3668.1847 1.011677e+08+ 198 000075.SH ๅป่ฏ็ญๆ 7170.0801 4.000854e+06+ 199 000029.SH 180ไปทๅผ 4396.8748 5.572026e+07\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\346\214\207\346\225\260\346\210\220\345\210\206\345\222\214\346\235\203\351\207\215.md" "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\346\214\207\346\225\260\346\210\220\345\210\206\345\222\214\346\235\203\351\207\215.md"new file mode 100644index 000000000..196f79c64--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\346\214\207\346\225\260\346\210\220\345\210\206\345\222\214\346\235\203\351\207\215.md"@@ -0,0 +1,52 @@+## ๆๆฐๆๅๅๆ้+----++ๆฅๅฃ๏ผindex_weight+ๆ่ฟฐ๏ผ่ทๅๅ็ฑปๆๆฐๆๅๅๆ้๏ผ**ๆๅบฆๆฐๆฎ** ๏ผๅปบ่ฎฎ่พๅ ฅๅๆฐ้ๅผๅงๆฅๆๅ็ปๆๆฅๅๅซ่พๅ ฅๅฝๆ็ฌฌไธๅคฉๅๆๅไธๅคฉ็ๆฅๆใ+ๆฅๆบ๏ผๆๆฐๅ ฌๅธ็ฝ็ซๅ ฌๅผๆฐๆฎ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+index_code | str | Y | ๆๆฐไปฃ็ ๏ผๆฅๆบ<a href="https://tushare.pro/document/2?doc_id=94">ๆๆฐๅบ็กไฟกๆฏๆฅๅฃ</a>+trade_date | str | N | ไบคๆๆฅๆ๏ผๆ ผๅผYYYYMMDD๏ผไธๅ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | None | N | ็ปๆๆฅๆ++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๆ่ฟฐ+--- | ---- | ----+index_code | str | ๆๆฐไปฃ็ +con_code | str | ๆๅไปฃ็ +trade_date | str | ไบคๆๆฅๆ+weight | float | ๆ้++**ๆฅๅฃ่ฐ็จ**++```python++pro = ts.pro_api()++#ๆๅๆฒชๆทฑ300ๆๆฐ2018ๅนด9ๆๆๅๅๆ้+df = pro.index_weight(index_code='399300.SZ', start_date='20180901', end_date='20180930')++```+++**ๆฐๆฎๆ ทไพ**++ index_code con_code trade_date weight+ 0 399300.SZ 000001.SZ 20180903 0.8656+ 1 399300.SZ 000002.SZ 20180903 1.1330+ 2 399300.SZ 000060.SZ 20180903 0.1125+ 3 399300.SZ 000063.SZ 20180903 0.4273+ 4 399300.SZ 000069.SZ 20180903 0.2010+ 5 399300.SZ 000157.SZ 20180903 0.1699+ 6 399300.SZ 000402.SZ 20180903 0.0816+ 7 399300.SZ 000413.SZ 20180903 0.2023+ 8 399300.SZ 000415.SZ 20180903 0.0648+ 9 399300.SZ 000423.SZ 20180903 0.2100+ 10 399300.SZ 000425.SZ 20180903 0.1884\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\346\214\207\346\225\260\346\212\200\346\234\257\351\235\242\345\233\240\345\255\220(\344\270\223\344\270\232\347\211\210).md" "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\346\214\207\346\225\260\346\212\200\346\234\257\351\235\242\345\233\240\345\255\220(\344\270\223\344\270\232\347\211\210).md"new file mode 100644index 000000000..daac38c68--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\346\214\207\346\225\260\346\212\200\346\234\257\351\235\242\345\233\240\345\255\220(\344\270\223\344\270\232\347\211\210).md"@@ -0,0 +1,112 @@+## ๆๆฐๆๆฏๅ ๅญ(ไธไธ็)+----++ๆฅๅฃ๏ผidx_factor_pro+ๆ่ฟฐ๏ผ่ทๅๆๆฐๆฏๆฅๆๆฏ้ขๅ ๅญๆฐๆฎ๏ผ็จไบ่ท่ธชๆๆฐๅฝๅ่ตฐๅฟๆ ๅต๏ผๆฐๆฎ็ฑTushare็คพๅบ่ชไบง๏ผ่ฆ็ๅ จๅๅฒ๏ผ่พๅบๅๆฐ_bfq่กจ็คบไธๅคๆๆ่ฟฐไธญ่ฏดๆไบๅ ๅญ็้ป่ฎคไผ ๅ๏ผๅฆ้่ฆ็นๆฎๅๆฐๆ่ ๆดๅคๅ ๅญๅฏไปฅ่็ณป็ฎก็ๅ่ฏไผฐ๏ผๆๆฐๅ ๆฌๅคง็ๆๆฐ ็ณไธ่กไธๆๆฐ ไธญไฟกๆๆฐ+้้๏ผๅๆฌกๆๅคง8000+็งฏๅ๏ผ5000็งฏๅๆฏๅ้ๅฏไปฅ่ฏทๆฑ30ๆฌก๏ผ8000็งฏๅไปฅไธๆฏๅ้500ๆฌก++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ๆๆฐไปฃ็ (ๅคง็ๆๆฐ ็ณไธๆๆฐ ไธญไฟกๆๆฐ)+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+trade_date | str | N | ไบคๆๆฅๆ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ๆๆฐไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+open | float | Y | ๅผ็ไปท+high | float | Y | ๆ้ซไปท+low | float | Y | ๆไฝไปท+close | float | Y | ๆถ็ไปท+pre_close | float | Y | ๆจๆถไปท+change | float | Y | ๆถจ่ท้ข+pct_change | float | Y | ๆถจ่ทๅน ๏ผๆชๅคๆ๏ผๅฆๆๆฏๅคๆ่ฏท็จย ้็จ่กๆ ๆฅๅฃย ๏ผ+vol | float | Y | ๆไบค้ ๏ผๆ๏ผ+amount | float | Y | ๆไบค้ข ๏ผๅๅ ๏ผ+asi_bfq | float | Y | ๆฏๅจๅ้ๆๆ -OPEN, CLOSE, HIGH, LOW, M1=26, M2=10+asit_bfq | float | Y | ๆฏๅจๅ้ๆๆ -OPEN, CLOSE, HIGH, LOW, M1=26, M2=10+atr_bfq | float | Y | ็ๅฎๆณขๅจNๆฅๅนณๅๅผ-CLOSE, HIGH, LOW, N=20+bbi_bfq | float | Y | BBIๅค็ฉบๆๆ -CLOSE, M1=3, M2=6, M3=12, M4=20+bias1_bfq | float | Y | BIASไน็ฆป็-CLOSE, L1=6, L2=12, L3=24+bias2_bfq | float | Y | BIASไน็ฆป็-CLOSE, L1=6, L2=12, L3=24+bias3_bfq | float | Y | BIASไน็ฆป็-CLOSE, L1=6, L2=12, L3=24+boll_lower_bfq | float | Y | BOLLๆๆ ๏ผๅธๆๅธฆ-CLOSE, N=20, P=2+boll_mid_bfq | float | Y | BOLLๆๆ ๏ผๅธๆๅธฆ-CLOSE, N=20, P=2+boll_upper_bfq | float | Y | BOLLๆๆ ๏ผๅธๆๅธฆ-CLOSE, N=20, P=2+brar_ar_bfq | float | Y | BRARๆ ็ปชๆๆ -OPEN, CLOSE, HIGH, LOW, M1=26+brar_br_bfq | float | Y | BRARๆ ็ปชๆๆ -OPEN, CLOSE, HIGH, LOW, M1=26+cci_bfq | float | Y | ้กบๅฟๆๆ ๅๅซCCIๆๆ -CLOSE, HIGH, LOW, N=14+cr_bfq | float | Y | CRไปทๆ ผๅจ้ๆๆ -CLOSE, HIGH, LOW, N=20+dfma_dif_bfq | float | Y | ๅนณ่ก็บฟๅทฎๆๆ -CLOSE, N1=10, N2=50, M=10+dfma_difma_bfq | float | Y | ๅนณ่ก็บฟๅทฎๆๆ -CLOSE, N1=10, N2=50, M=10+dmi_adx_bfq | float | Y | ๅจๅๆๆ -CLOSE, HIGH, LOW, M1=14, M2=6+dmi_adxr_bfq | float | Y | ๅจๅๆๆ -CLOSE, HIGH, LOW, M1=14, M2=6+dmi_mdi_bfq | float | Y | ๅจๅๆๆ -CLOSE, HIGH, LOW, M1=14, M2=6+dmi_pdi_bfq | float | Y | ๅจๅๆๆ -CLOSE, HIGH, LOW, M1=14, M2=6+downdays | float | Y | ่ฟ่ทๅคฉๆฐ+updays | float | Y | ่ฟๆถจๅคฉๆฐ+dpo_bfq | float | Y | ๅบ้ด้่ก็บฟ-CLOSE, M1=20, M2=10, M3=6+madpo_bfq | float | Y | ๅบ้ด้่ก็บฟ-CLOSE, M1=20, M2=10, M3=6+ema_bfq_10 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=10+ema_bfq_20 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=20+ema_bfq_250 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=250+ema_bfq_30 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=30+ema_bfq_5 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=5+ema_bfq_60 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=60+ema_bfq_90 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=90+emv_bfq | float | Y | ็ฎๆๆณขๅจๆๆ -HIGH, LOW, VOL, N=14, M=9+maemv_bfq | float | Y | ็ฎๆๆณขๅจๆๆ -HIGH, LOW, VOL, N=14, M=9+expma_12_bfq | float | Y | EMAๆๆฐๅนณๅๆฐๆๆ -CLOSE, N1=12, N2=50+expma_50_bfq | float | Y | EMAๆๆฐๅนณๅๆฐๆๆ -CLOSE, N1=12, N2=50+kdj_bfq | float | Y | KDJๆๆ -CLOSE, HIGH, LOW, N=9, M1=3, M2=3+kdj_d_bfq | float | Y | KDJๆๆ -CLOSE, HIGH, LOW, N=9, M1=3, M2=3+kdj_k_bfq | float | Y | KDJๆๆ -CLOSE, HIGH, LOW, N=9, M1=3, M2=3+ktn_down_bfq | float | Y | ่ฏ็น็บณไบคๆ้้, N้20ๆฅ๏ผATR้10ๆฅ-CLOSE, HIGH, LOW, N=20, M=10+ktn_mid_bfq | float | Y | ่ฏ็น็บณไบคๆ้้, N้20ๆฅ๏ผATR้10ๆฅ-CLOSE, HIGH, LOW, N=20, M=10+ktn_upper_bfq | float | Y | ่ฏ็น็บณไบคๆ้้, N้20ๆฅ๏ผATR้10ๆฅ-CLOSE, HIGH, LOW, N=20, M=10+lowdays | float | Y | LOWRANGE(LOW)่กจ็คบๅฝๅๆไฝไปทๆฏ่ฟๅคๅฐๅจๆๅ ๆไฝไปท็ๆๅฐๅผ+topdays | float | Y | TOPRANGE(HIGH)่กจ็คบๅฝๅๆ้ซไปทๆฏ่ฟๅคๅฐๅจๆๅ ๆ้ซไปท็ๆๅคงๅผ+ma_bfq_10 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=10+ma_bfq_20 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=20+ma_bfq_250 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=250+ma_bfq_30 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=30+ma_bfq_5 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=5+ma_bfq_60 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=60+ma_bfq_90 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=90+macd_bfq | float | Y | MACDๆๆ -CLOSE, SHORT=12, LONG=26, M=9+macd_dea_bfq | float | Y | MACDๆๆ -CLOSE, SHORT=12, LONG=26, M=9+macd_dif_bfq | float | Y | MACDๆๆ -CLOSE, SHORT=12, LONG=26, M=9+mass_bfq | float | Y | ๆข ๆฏ็บฟ-HIGH, LOW, N1=9, N2=25, M=6+ma_mass_bfq | float | Y | ๆข ๆฏ็บฟ-HIGH, LOW, N1=9, N2=25, M=6+mfi_bfq | float | Y | MFIๆๆ ๆฏๆไบค้็RSIๆๆ -CLOSE, HIGH, LOW, VOL, N=14+mtm_bfq | float | Y | ๅจ้ๆๆ -CLOSE, N=12, M=6+mtmma_bfq | float | Y | ๅจ้ๆๆ -CLOSE, N=12, M=6+obv_bfq | float | Y | ่ฝ้ๆฝฎๆๆ -CLOSE, VOL+psy_bfq | float | Y | ๆ่ต่ ๅฏน่กๅธๆถจ่ทไบง็ๅฟ็ๆณขๅจ็ๆ ็ปชๆๆ -CLOSE, N=12, M=6+psyma_bfq | float | Y | ๆ่ต่ ๅฏน่กๅธๆถจ่ทไบง็ๅฟ็ๆณขๅจ็ๆ ็ปชๆๆ -CLOSE, N=12, M=6+roc_bfq | float | Y | ๅๅจ็ๆๆ -CLOSE, N=12, M=6+maroc_bfq | float | Y | ๅๅจ็ๆๆ -CLOSE, N=12, M=6+rsi_bfq_12 | float | Y | RSIๆๆ -CLOSE, N=12+rsi_bfq_24 | float | Y | RSIๆๆ -CLOSE, N=24+rsi_bfq_6 | float | Y | RSIๆๆ -CLOSE, N=6+taq_down_bfq | float | Y | ๅๅฎๅฅ้้(ๆตท้พ)ไบคๆๆๆ -HIGH, LOW, 20+taq_mid_bfq | float | Y | ๅๅฎๅฅ้้(ๆตท้พ)ไบคๆๆๆ -HIGH, LOW, 20+taq_up_bfq | float | Y | ๅๅฎๅฅ้้(ๆตท้พ)ไบคๆๆๆ -HIGH, LOW, 20+trix_bfq | float | Y | ไธ้ๆๆฐๅนณๆปๅนณๅ็บฟ-CLOSE, M1=12, M2=20+trma_bfq | float | Y | ไธ้ๆๆฐๅนณๆปๅนณๅ็บฟ-CLOSE, M1=12, M2=20+vr_bfq | float | Y | VRๅฎน้ๆฏ็-CLOSE, VOL, M1=26+wr_bfq | float | Y | W&R ๅจๅปๆๆ -CLOSE, HIGH, LOW, N=10, N1=6+wr1_bfq | float | Y | W&R ๅจๅปๆๆ -CLOSE, HIGH, LOW, N=10, N1=6+xsii_td1_bfq | float | Y | ่ๆฏ้้II-CLOSE, HIGH, LOW, N=102, M=7+xsii_td2_bfq | float | Y | ่ๆฏ้้II-CLOSE, HIGH, LOW, N=102, M=7+xsii_td3_bfq | float | Y | ่ๆฏ้้II-CLOSE, HIGH, LOW, N=102, M=7+xsii_td4_bfq | float | Y | ่ๆฏ้้II-CLOSE, HIGH, LOW, N=102, M=7+diff --git "a/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\346\214\207\346\225\260\346\227\245\347\272\277\350\241\214\346\203\205.md" "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\346\214\207\346\225\260\346\227\245\347\272\277\350\241\214\346\203\205.md"new file mode 100644index 000000000..9216263ce--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\346\214\207\346\225\260\346\227\245\347\272\277\350\241\214\346\203\205.md"@@ -0,0 +1,82 @@+## ๆๆฐๆฅ็บฟ่กๆ+----++ๆฅๅฃ๏ผindex_daily๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆ่ฟฐ๏ผ่ทๅๆๆฐๆฏๆฅ่กๆ ๏ผ่ฟๅฏไปฅ้่ฟbarๆฅๅฃ่ทๅใ็ฑไบๆๅกๅจๅๅ๏ผ็ฎๅ่งๅๆฏๅๆฌก่ฐๅๆๅคๅ8000่ก่ฎฐๅฝ๏ผๅฏไปฅ่ฎพ็ฝฎstartๅendๆฅๆ่กฅๅ จใๆๆฐ่กๆ ไนๅฏไปฅ้่ฟ[**้็จ่กๆ ๆฅๅฃ**]( https://tushare.pro/document/2?doc_id=109)่ทๅๆฐๆฎ๏ผ+ๆ้๏ผ็จๆท็ดฏ็งฏ2000็งฏๅๅฏ่ฐๅ๏ผ5000็งฏๅไปฅไธ้ขๆฌก็ธๅฏน่พ้ซใๆฌๆฅๅฃไธๅ ๆฌ็ณไธ่กๆ ๆฐๆฎ๏ผ็ณไธ็ญ่กไธๆๆฐ่กๆ ้5000็งฏๅไปฅไธ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>++<font color="red">+ๆณจๆ๏ผๆทฑ่ฏๆๆ๏ผ399001.SZ๏ผ่ขซๆฎ้็ไฝๅๆ ๆทฑ่ฏA่กๆดไฝ่กจ็ฐ็ๅคง็๏ผ่ๅฎ้ ไธ่ฏฅๆๆฐๅชๅ ๅซ500ๅชๆๅ่กใ่ๅ็ฑป่กๆ ่ฝฏไปถไธๅฑ็คบ็ๆไบค้ใๆไบค้้ขๆฏๆทฑๅธๆๆA่ก็่ก็ฅจๆไบคๆ ๅต๏ผๅฆๆ้่ฆ่ทๅพไธ่กๆ ่ฝฏไปถไธไธๆ ท็ๆไบคๆฐๆฎ๏ผๅฏไปฅ่ฐๅๆทฑ่ฏAๆ๏ผ399107.SZ๏ผใ+</font>++<br><br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ๆๆฐไปฃ็ ๏ผๆฅๆบ<a href="https://tushare.pro/document/2?doc_id=94">ๆๆฐๅบ็กไฟกๆฏๆฅๅฃ</a>+trade_date | str | N | ไบคๆๆฅๆ ๏ผๆฅๆๆ ผๅผ๏ผYYYYMMDD๏ผไธๅ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br><br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๆ่ฟฐ+--- | ---- | ----+ts_code | str | TSๆๆฐไปฃ็ +trade_date | str | ไบคๆๆฅ+close | float | ๆถ็็นไฝ+open | float | ๅผ็็นไฝ+high | float | ๆ้ซ็นไฝ+low | float | ๆไฝ็นไฝ+pre_close | float | ๆจๆฅๆถ็็น+change | float | ๆถจ่ท็น+pct_chg | float | ๆถจ่ทๅน ๏ผ%๏ผ+vol | float | ๆไบค้๏ผๆ๏ผ+amount | float | ๆไบค้ข๏ผๅๅ ๏ผ++<br><br>+++**ๆฅๅฃไฝฟ็จ**++```python++pro = ts.pro_api()++df = pro.index_daily(ts_code='399300.SZ')++#ๆ่ ๆๆฅๆๅ++df = pro.index_daily(ts_code='399300.SZ', start_date='20180101', end_date='20181010')++```++<br><br>++**ๆฐๆฎๆ ทไพ**++ ts_code trade_date close open high low \+ 0 399300.SZ 20180903 3321.8248 3320.6898 3325.6070 3291.7842+ 1 399300.SZ 20180831 3334.5036 3333.3801 3356.5757 3310.8726+ 2 399300.SZ 20180830 3351.0942 3385.8052 3402.5626 3349.4688+ 3 399300.SZ 20180829 3386.5736 3393.0527 3398.7139 3377.1231+ 4 399300.SZ 20180828 3400.1705 3408.1502 3416.5929 3388.8143+ 5 399300.SZ 20180827 3406.5735 3339.3894 3406.5735 3339.2646+ 6 399300.SZ 20180824 3325.3347 3308.4778 3353.0445 3291.8654+ 7 399300.SZ 20180823 3320.0257 3308.4589 3336.1123 3285.8141+ 8 399300.SZ 20180822 3307.9545 3328.9693 3328.9693 3299.3938+ 9 399300.SZ 20180821 3326.6489 3271.8402 3331.7077 3270.0302+ 10 399300.SZ 20180820 3267.2498 3238.2150 3267.2498 3209.0115+ 11 399300.SZ 20180817 3229.6198 3305.8954 3311.5729 3224.0999+ 12 399300.SZ 20180816 3276.7276 3251.8556 3315.2031 3231.5561+ 13 399300.SZ 20180815 3291.9760 3371.9590 3372.1369 3288.7088+ 14 399300.SZ 20180814 3372.9137 3386.4832 3391.7290 3356.6142+ 15 399300.SZ 20180813 3390.3441 3369.9812 3396.1883 3336.6956+ 16 399300.SZ 20180810 3405.0191 3398.4139 3424.0411 3380.5731\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\346\214\207\346\225\260\346\234\210\347\272\277\350\241\214\346\203\205.md" "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\346\214\207\346\225\260\346\234\210\347\272\277\350\241\214\346\203\205.md"new file mode 100644index 000000000..d48988aa5--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\346\214\207\346\225\260\346\234\210\347\272\277\350\241\214\346\203\205.md"@@ -0,0 +1,97 @@+## ๆๆฐๆ็บฟ่กๆ+----++ๆฅๅฃ๏ผindex_monthly+ๆ่ฟฐ๏ผ่ทๅๆๆฐๆ็บฟ่กๆ ,ๆฏๆๆดๆฐไธๆฌก+้้๏ผๅๆฌกๆๅคง1000่ก่ฎฐๅฝ,ๅฏๅคๆฌก่ทๅ,ๆป้ไธ้ๅถ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ600็งฏๅๆๅฏไปฅ่ฐๅ๏ผ็งฏๅ่ถๅค้ขๆฌก่ถ้ซ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | TSไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | TSๆๆฐไปฃ็ +trade_date | str | Y | ไบคๆๆฅ+close | float | Y | ๆถ็็นไฝ+open | float | Y | ๅผ็็นไฝ+high | float | Y | ๆ้ซ็นไฝ+low | float | Y | ๆไฝ็นไฝ+pre_close | float | Y | ๆจๆฅๆถ็็น+change | float | Y | ๆถจ่ท็นไฝ+pct_chg | float | Y | ๆถจ่ทๅน+vol | float | ๆไบค้๏ผๆ๏ผ+amount | float | ๆไบค้ข๏ผๅๅ ๏ผ++<br>+<br>++**ๆฅๅฃ็จๆณ**+```python++pro = ts.pro_api()++df = pro.index_monthly(ts_code='000001.SH', start_date='20180101', end_date='20190330', fields='ts_code,trade_date,open,high,low,close,vol,amount')++```++ๆ่++```python++df = pro.index_monthly(trade_date='20190329', fields='ts_code,trade_date,open,high,low,close,vol,amount')++```++<br>+<br>++**ๆฐๆฎๆ ทไพ**++ ts_code trade_date close open high low \+ 0 000001.SH 20190329 3090.758 2954.402 3129.940 2930.835+ 1 000001.SH 20190228 2940.954 2597.778 2997.488 2590.554+ 2 000001.SH 20190131 2584.572 2497.881 2630.318 2440.907+ 3 000001.SH 20181228 2493.896 2647.132 2666.078 2462.845+ 4 000001.SH 20181130 2588.188 2617.033 2703.512 2555.322+ 5 000001.SH 20181031 2602.783 2768.208 2771.938 2449.197+ 6 000001.SH 20180928 2821.350 2716.404 2827.341 2644.296+ 7 000001.SH 20180831 2725.250 2882.506 2897.400 2653.112+ 8 000001.SH 20180731 2876.401 2841.580 2915.297 2691.021+ 9 000001.SH 20180629 2847.418 3084.754 3128.715 2782.381+ 10 000001.SH 20180531 3095.474 3087.409 3219.740 3041.000+ 11 000001.SH 20180427 3082.232 3169.779 3220.845 3041.625+ 12 000001.SH 20180330 3168.897 3235.089 3333.875 3091.458+ 13 000001.SH 20180228 3259.408 3478.670 3495.093 3062.743+ 14 000001.SH 20180131 3480.833 3314.031 3587.032 3314.031++ vol amount+ 0 8.691925e+11 8.300906e+12+ 1 4.421808e+11 3.816145e+12+ 2 3.385641e+11 2.804232e+12+ 3 2.575119e+11 2.236021e+12+ 4 4.052823e+11 3.352502e+12+ 5 2.740242e+11 2.449081e+12+ 6 2.148359e+11 2.152910e+12+ 7 2.821389e+11 2.872973e+12+ 8 3.049095e+11 3.259243e+12+ 9 2.623979e+11 3.100450e+12+ 10 2.979289e+11 3.810441e+12+ 11 2.698985e+11 3.372116e+12+ 12 3.704084e+11 4.396937e+12+ 13 2.888959e+11 3.262255e+12+ 14 4.797771e+11 5.772056e+12diff --git "a/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\346\262\252\346\267\261\345\270\202\345\234\272\346\257\217\346\227\245\344\272\244\346\230\223\347\273\237\350\256\241.md" "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\346\262\252\346\267\261\345\270\202\345\234\272\346\257\217\346\227\245\344\272\244\346\230\223\347\273\237\350\256\241.md"new file mode 100644index 000000000..4474eab16--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\346\262\252\346\267\261\345\270\202\345\234\272\346\257\217\346\227\245\344\272\244\346\230\223\347\273\237\350\256\241.md"@@ -0,0 +1,116 @@+## ๅธๅบไบคๆ็ป่ฎก+----++ๆฅๅฃ๏ผdaily_info+ๆ่ฟฐ๏ผ่ทๅไบคๆๆ่ก็ฅจไบคๆ็ป่ฎก๏ผๅ ๆฌๅๆฟๅๆ็ป+้้๏ผๅๆฌกๆๅคง4000๏ผๅฏๅพช็ฏ่ทๅ๏ผๆป้ไธ้ๅถ+ๆ้๏ผ็จๆท็งฏ600็งฏๅๅฏ่ฐๅ๏ผ ้ขๆฌกๆ้ๅถ๏ผ็งฏๅ่ถ้ซๆฏๅ้่ฐๅ้ขๆฌก่ถ้ซ๏ผ5000็งฏๅไปฅไธ้ขๆฌก็ธๅฏน่พ้ซ๏ผ็งฏๅ่ทๅๆนๆณ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+trade_date | str | N | ไบคๆๆฅๆ๏ผYYYYMMDDๆ ผๅผ๏ผไธๅ๏ผ+ts_code | str | N | ๆฟๅไปฃ็ ๏ผ่ฏทๅ้ ไธๆนๅ่กจ๏ผ+exchange | str | N | ่ก็ฅจๅธๅบ๏ผSHไธไบคๆ SZๆทฑไบคๆ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+fields | str | N | ๆๅฎๆๅๅญๆฎต++<br>+<br>++| ๆฟๅไปฃ็ ๏ผTS_CODE๏ผ | ๆฟๅๅ็งฐ๏ผTS_NAME๏ผ | ๆฐๆฎๅผๅงๆฅๆ |+| -------- | -------- | -------- |+| SZ_MARKET | ๆทฑๅณๅธๅบ | 20041231 |+| SZ_MAIN | ๆทฑๅณไธปๆฟ | 20081231 |+| SZ_A | ๆทฑๅณA่ก | 20080103 |+| SZ_B | ๆทฑๅณB่ก | 20080103 |+| SZ_GEM | ๅไธๆฟ | 20091030 |+| SZ_SME | ไธญๅฐไผไธๆฟ | 20040602 |+|SZ_FUND | ๆทฑๅณๅบ้ๅธๅบ | 20080103+|SZ_FUND_ETF | ๆทฑๅณๅบ้ETF | 20080103+|SZ_FUND_LOF | ๆทฑๅณๅบ้LOF | 20080103+|SZ_FUND_CEF | ๆทฑๅณๅฐ้ญๅบ้ | 20080103+|SZ_FUND_SF | ๆทฑๅณๅ็บงๅบ้ | 20080103+|SZ_BOND | ๆทฑๅณๅบๅธ | 20080103+|SZ_BOND_CN | ๆทฑๅณๅบๅธ็ฐๅธ | 20080103+|SZ_BOND_REP | ๆทฑๅณๅบๅธๅ่ดญ | 20080103+|SZ_BOND_ABS | ๆทฑๅณๅบๅธABS | 20080103+|SZ_BOND_GOV | ๆทฑๅณๅฝๅบ | 20080103+|SZ_BOND_ENT | ๆทฑๅณไผไธๅบ | 20080103+|SZ_BOND_COR | ๆทฑๅณๅ ฌๅธๅบ | 20080103+|SZ_BOND_CB | ๆทฑๅณๅฏ่ฝฌๅบ | 20080103+|SZ_WR | ๆทฑๅณๆ่ฏ | 20080103+| ---- | ---- | --- |+| SH_MARKET | ไธๆตทๅธๅบ | 20190102 |+| SH_A | ไธๆตทA่ก | 19910102 |+| SH_B | ไธๆตทB่ก | 19920221 |+| SH_STAR | ็งๅๆฟ | 20190722 |+| SH_REP | ่ก็ฅจๅ่ดญ | 20190102 |+|SH_FUND | ไธๆตทๅบ้ๅธๅบ | 19901219+|SH_FUND_ETF | ไธๆตทๅบ้ETF | 19901219+|SH_FUND_LOF | ไธๆตทๅบ้LOF | 19901219+|SH_FUND_REP | ไธๆตทๅบ้ๅ่ดญ | 19901219+|SH_FUND_CEF| ไธๆตทๅฐ้ญๅผๅบ้ | 19901219+|SH_FUND_METF | ไธๆตทไบคๆๅ่ดงๅธๅบ้| 19901219+++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ+ts_code | str | Y | ๅธๅบไปฃ็ +ts_name | str | Y | ๅธๅบๅ็งฐ+com_count | int | Y | ๆ็ๆฐ+total_share | float | Y | ๆป่กๆฌ๏ผไบฟ่ก๏ผ+float_share | float | Y | ๆต้่กๆฌ๏ผไบฟ่ก๏ผ+total_mv | float | Y | ๆปๅธๅผ๏ผไบฟๅ ๏ผ+float_mv | float | Y | ๆต้ๅธๅผ๏ผไบฟๅ ๏ผ+amount | float | Y | ไบคๆ้้ข๏ผไบฟๅ ๏ผ+vol | float | Y | ๆไบค้๏ผไบฟ่ก๏ผ+trans_count | int | Y | ๆไบค็ฌๆฐ๏ผไธ็ฌ๏ผ+pe | float | Y | ๅนณๅๅธ็็+tr | float | Y | ๆขๆ็๏ผ๏ผ ๏ผ๏ผๆณจ๏ผๆทฑไบคๆๆๆ ๆญคๅ+exchange | str | Y | ไบคๆๆ๏ผSHไธไบคๆ SZๆทฑไบคๆ๏ผ++<br>+<br>+++**ๆฅๅฃ็คบไพ**++```python++#่ทๅๆทฑๅณๅธๅบ20200320ๅๆฟๅไบคๆๆฐๆฎ+df = pro.daily_info(trade_date='20200320', exchange='SZ')++#่ทๅๆทฑๅณๅไธๆตทๅธๅบ20200320ๅๆฟๅไบคๆๆๅฎๅญๆฎต็ๆฐๆฎ+df = pro.daily_info(trade_date='20200320', exchange='SZ,SH', fields='trade_date,ts_name,pe')++```+++<br>+<br>++**ๆฐๆฎ็คบไพ**++ trade_date ts_code ts_name com_count total_share float_share \+ 0 20200320 SZ_GME ๅไธๆฟ 802 4124.04 3159.24+ 1 20200320 SZ_MAIN ๆทฑๅธไธปๆฟ 470 8177.40 7176.03+ 2 20200320 SZ_MARKET ๆทฑๅณๅธๅบ 2220 21657.12 17674.90+ 3 20200320 SZ_SME ไธญๅฐไผไธๆฟ 948 9355.67 7339.62++ total_mv float_mv amount vol trans_count pe tr exchange+ 0 66494.71 44955.24 1475.76 99.65 830.0 50.37 NaN SZ+ 1 70732.59 62551.44 961.92 102.30 554.0 16.12 NaN SZ+ 2 236813.99 184009.16 4363.01 NaN NaN 25.46 2.18 SZ+ 3 99586.67 76502.47 1925.32 179.21 1208.0 27.74 NaN SZ\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\346\267\261\345\234\263\345\270\202\345\234\272\346\257\217\346\227\245\344\272\244\346\230\223\346\203\205\345\206\265.md" "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\346\267\261\345\234\263\345\270\202\345\234\272\346\257\217\346\227\245\344\272\244\346\230\223\346\203\205\345\206\265.md"new file mode 100644index 000000000..19e87a708--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\346\267\261\345\234\263\345\270\202\345\234\272\346\257\217\346\227\245\344\272\244\346\230\223\346\203\205\345\206\265.md"@@ -0,0 +1,101 @@+## ๆทฑๅณๅธๅบๆฏๆฅไบคๆๆฆๅต+----++ๆฅๅฃ๏ผsz_daily_info+ๆ่ฟฐ๏ผ่ทๅๆทฑๅณๅธๅบๆฏๆฅไบคๆๆฆๅต+้้๏ผๅๆฌกๆๅคง2000๏ผๅฏๅพช็ฏ่ทๅ๏ผๆป้ไธ้ๅถ+ๆ้๏ผ็จๆท็งฏ2000็งฏๅๅฏ่ฐๅ๏ผ ้ขๆฌกๆ้ๅถ๏ผ็งฏๅ่ถ้ซๆฏๅ้่ฐๅ้ขๆฌก่ถ้ซ๏ผ5000็งฏๅไปฅไธ้ขๆฌก็ธๅฏน่พ้ซ๏ผ็งฏๅ่ทๅๆนๆณ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)+++<br>+<br>+++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+trade_date | str | N | ไบคๆๆฅๆ๏ผYYYYMMDDๆ ผๅผ๏ผไธๅ๏ผ+ts_code | str | N | ๆฟๅไปฃ็ +start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+++ts_codeไธป่ฆๅ ๆฌ๏ผ+++| ๆฟๅไปฃ็ ๏ผTS_CODE๏ผ | ๆฟๅ่ฏดๆ | ๆฐๆฎๅผๅงๆฅๆ |+| -------- | -------- | -------- |+| ่ก็ฅจ | ๆทฑๅณๅธๅบ่ก็ฅจๆปๅ | 20080102 |+| ไธปๆฟA่ก | ๆทฑๅณไธปๆฟA่กๆ ๅต | 20080102 |+| ไธปๆฟB่ก | ๆทฑๅณไธปๆฟB่กๆ ๅต | 20080102 |+| ๅไธๆฟA่ก | ๆทฑๅณๅไธๆฟๆ ๅต | 20080102 |+| ๅบ้ | ๆทฑๅณๅธๅบๅบ้ๆปๅ | 20080102 |+| ETF | ๆทฑๅณETFไบคๆๆ ๅต | 20080102 |+| LOF | ๆทฑๅณLOFไบคๆๆ ๅต | 20080102 |+| ๅฐ้ญๅผๅบ้ | ๆทฑๅณๅฐ้ญๅผๅบ้ไบคๆๆ ๅต | 20080102 |+| ๅบ็ก่ฎพๆฝๅบ้ | ๆทฑๅณRETISๅบ้ไบคๆๆ ๅต | 20210621 |+| ๅบๅธ | ๆทฑๅณๅบๅธๅธๅบๆปๅ | 20080102 |+| ๅบๅธ็ฐๅธ | ๆทฑๅณ็ฐๅธไบคๆๆ ๅต | 20080102 |+| ๅบๅธๅ่ดญ | ๆทฑๅณๅบๅธๅ่ดญไบคๆๆ ๅต | 20080102 |+| ABS | ๆทฑๅณABSไบคๆๆ ๅต | 20080102 |+| ๆๆ | ๆทฑๅณๆๆๆปๅ | 20080102 |+++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | Y |+ts_code | str | Y | ๅธๅบ็ฑปๅ+count | int | Y | ่ก็ฅจไธชๆฐ+amount | float | Y | ๆไบค้้ข+vol | None | Y | ๆไบค้+total_share | float | Y | ๆป่กๆฌ+total_mv | float | Y | ๆปๅธๅผ+float_share | float | Y | ๆต้่ก็ฅจ+float_mv | float | Y | ๆต้ๅธๅผ++<br>+<br>+++**ๆฅๅฃ็คบไพ**++```python++#่ทๅๆทฑๅณๅธๅบ20200320ไบคๆๆฐๆฎ+df = pro.sz_daily_info(trade_date='20200320')++#่ทๅๆทฑๅณๅธๅบไบคๆๆ ๅต+df = pro.sz_daily_info(trade_date='20200320', ts_code='่ก็ฅจ')++```+++<br>+<br>++**ๆฐๆฎ็คบไพ**+++ trade_date ts_code count amount vol total_share total_mv float_share float_mv+ 0 20200320 ABS 541 504804930.72 4843368 5004918501.00 472061975980.53 5004918501.00 472061975980.53+ 1 20200320 ETF 86 10960679423.49 8003777630 99210471704.00 153213629317.87 99210471704.00 153213629317.87+ 2 20200320 LOF 249 1202089548.18 2029753496 42142809618.00 37448346544.52 42142809618.00 37448346544.52+ 3 20200320 ไธญๅฐๆฟ 948 192532630530.61 17921759322 935567938002.00 9958667914529.80 733962624249.00 7650247307737.14+ 4 20200320 ไธปๆฟA่ก 460 96090513214.35 10211776104 805063702685.00 7028091416467.25 705056618283.00 6210675551047.30+ 5 20200320 ไธปๆฟB่ก 46 102202260.47 18980673 12676603056.00 45168496735.09 12546456576.00 44469314083.06+ 6 20200320 ๅบๅธ 6558 170830629708.59 1386734301 None None None None+ 7 20200320 ๅบๅธๅ่ดญ 12 97006833500.00 970873520 None None None None+ 8 20200320 ๅบๅธ็ฐๅธ 6005 73318991277.87 411017413 342674191457.00 34325230393533.29 17044369724.00 1754190029091.49+ 9 20200320 ๅ็บงๅบ้ 208 1162654854.49 1242992337 42039852135.00 39427148230.75 42039852135.00 39427148230.75+ 10 20200320 ๅไธๆฟA่ก 802 147576399405.00 9965011014 412404300212.00 6649471689968.69 315924775647.00 4495524754972.39+ 11 20200320 ๅบ้ 544 13326523128.60 11276535453 183401248132.00 230833320937.40 183401248132.00 230833320937.40+ 12 20200320 ๅฐ้ญๅผๅบ้ 1 1099302.43 11990 8114675.00 744196844.25 8114675.00 744196844.25+ 13 20200320 ๆๆ 128 388976963.00 447009 None None None None+ 14 20200320 ่ก็ฅจ 2256 436301745410.43 38117527113 2165712543955.00 23681399517700.83 1767490474755.00 18400916927839.89\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\347\224\263\344\270\207\345\256\236\346\227\266\350\241\214\346\203\205.md" "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\347\224\263\344\270\207\345\256\236\346\227\266\350\241\214\346\203\205.md"new file mode 100644index 000000000..8d51846b3--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\347\224\263\344\270\207\345\256\236\346\227\266\350\241\214\346\203\205.md"@@ -0,0 +1,58 @@+# ็ณไธๅฎๆถ่กๆ+++### ๆฅๅฃไป็ป+ๆฅๅฃ๏ผrt_sw_k+ๆ่ฟฐ๏ผ่ทๅ็ณไธ่กไธๆๆฐ็ๆๆฐๆช้ขๆฐๆฎ+็งฏๅ๏ผๆฌๆฅๅฃๆฏๅ็ฌๅผๆ้็ๆฐๆฎ๏ผๅ็ฌ็ณ่ฏทๆ้่ฏทๅ่[ๆ้ๅ่กจ](https://tushare.pro/document/1?doc_id=290)+++### ่พๅ ฅๅๆฐ+ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ๆๆฐไปฃ็ ๏ผๅฆ: 801005.SI๏ผๅฏไปฅๆฏ้ๅท้ๅผ็ๅคไธช๏ผๅฆ: 801005.SI,801001.SI++++### ่พๅบๅๆฐ+ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+---- | ---- | ---- | ----+ts_code | str | Y | ๆๆฐไปฃ็ +name | str | Y | ๆๆฐๅ็งฐ+trade_time | str | Y | ไบคๆๆถ้ด+close | float | Y | ็ฐไปท+pre_close | float | Y | ๆจๆถ+high | float | Y | ๆ้ซไปท+open | float | Y | ๅผ็ไปท+low | float | Y | ๆไฝไปท+vol | float | Y | ๆไบค้๏ผ่ก๏ผ+amount | float | Y | ๆไบค้้ข๏ผๅ ๏ผ+pct_change | float | Y | ๅข้ฟ็++++### ไปฃ็ ็คบไพ+```python++pro = ts.pro_api()++# ไธๆฌกๆงๆๅๅ จ้จ็ณไธๆๆฐๅฎๆถๆฐๆฎ+df = pro.rt_sw_k()++# ๆts_codeๆๅ่กๆ ๆฐๆฎ๏ผไพๅฆๆๅ801053.SI(่ดต้ๅฑ) ๅฎๆถ่กๆ+df = pro.rt_sw_k(ts_code='801053.SI')+```++### ๆฐๆฎ็ปๆ+ts_code | name | trade_time | close | pre_close | high | open | low | vol | amount | pct_change+---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ----+801001.SI | ็ณไธ50 | 2026-01-29 11:20:15 | 3787.9120 | 3798.2100 | 3813.4650 | 3813.4650 | 3774.6250 | 3705199982 | 222824326266 | -0.27+801002.SI | ็ณไธไธญๅฐ | 2026-01-29 11:20:15 | 8806.2050 | 8809.4800 | 8838.5460 | 8775.2190 | 8730.5520 | 25634196750 | 360691370056 | -0.04+801003.SI | ็ณไธ๏ผกๆ | 2026-01-29 11:20:15 | 4974.9430 | 4970.4900 | 4986.6610 | 4968.8140 | 4950.5050 | 115336604744 | 1936675504044 | 0.09+801005.SI | ็ณไธๅไธ | 2026-01-29 11:20:15 | 4094.8600 | 4081.5400 | 4123.7230 | 4070.4380 | 4041.4720 | 19045101938 | 494472518112 | 0.33+801010.SI | ๅๆ็งๆธ | 2026-01-29 11:20:15 | 2931.1360 | 2915.1700 | 2950.3920 | 2910.8210 | 2904.0440 | 2594579310 | 22663408519 | 0.55+801012.SI | ๅไบงๅๅ ๅทฅ | 2026-01-29 11:20:15 | 2544.5850 | 2526.3300 | 2560.6810 | 2522.3710 | 2517.1980 | 227870337 | 2384134145 | 0.72+801014.SI | ้ฅฒๆ | 2026-01-29 11:20:15 | 4421.3600 | 4371.4000 | 4446.7450 | 4377.4080 | 4372.6460 | 437877589 | 2850725238 | 1.14+801015.SI | ๆธไธ | 2026-01-29 11:20:15 | 881.9780 | 873.6900 | 884.1620 | 871.7710 | 864.7650 | 100200890 | 447089570 | 0.95+801016.SI | ็งๆคไธ | 2026-01-29 11:20:15 | 2953.6730 | 2887.6000 | 2995.5200 | 2892.5670 | 2892.5670 | 1044165536 | 8740207605 | 2.29+801017.SI | ๅ ปๆฎไธ | 2026-01-29 11:20:15 | 2988.3250 | 2978.0600 | 3012.0680 | 2971.0800 | 2963.3590 | 397154376 | 4079931700 | 0.34diff --git "a/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\347\224\263\344\270\207\350\241\214\344\270\232\345\210\206\347\261\273.md" "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\347\224\263\344\270\207\350\241\214\344\270\232\345\210\206\347\261\273.md"new file mode 100644index 000000000..6b6fa9852--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\347\224\263\344\270\207\350\241\214\344\270\232\345\210\206\347\261\273.md"@@ -0,0 +1,614 @@+## ็ณไธ่กไธๅ็ฑป+----++ๆฅๅฃ๏ผindex_classify+ๆ่ฟฐ๏ผ่ทๅ็ณไธ่กไธๅ็ฑป๏ผๅฏไปฅ่ทๅ็ณไธ2014ๅนด็ๆฌ๏ผ28ไธชไธ็บงๅ็ฑป๏ผ104ไธชไบ็บงๅ็ฑป๏ผ227ไธชไธ็บงๅ็ฑป๏ผๅ2021ๅนดๆฌ็๏ผ31ไธชไธ็บงๅ็ฑป๏ผ134ไธชไบ็บงๅ็ฑป๏ผ346ไธชไธ็บงๅ็ฑป๏ผๅ่กจไฟกๆฏ+ๆ้๏ผ็จๆท้2000็งฏๅๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++<font color='red'>**็ณไธ่กไธๆๆฐๅ็ฑปๆ ๅ2021็**</font>++ๆณจ๏ผๆๆฐๆๅ่กๅฐไบ5ๆก่ฏฅๆๆฐ่กๆ ไธๅๅธ++่กไธไปฃ็ | ๆๆฐไปฃ็ | ไธ็บง่กไธ | ไบ็บง่กไธ | ไธ็บง่กไธ | ๆๆฐ็ฑปๅซ | ๆฏๅฆๅๅธ | ๅๅจๅๅ | ๆๅ่กๆฐ |+---- | ----- | ---- | ---- | ----- | ---- | ---- | ---- | ---- |+110000 | 801010 | ๅๆ็งๆธ | | | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 100 |+110100 | 801016 | ๅๆ็งๆธ | ็งๆคไธ | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 20 |+110101 | 850111 | ๅๆ็งๆธ | ็งๆคไธ | ็งๅญ | ไธ็บง่กไธ | 1 | 2021ๆนๅ | 8 |+110102 | 850112 | ๅๆ็งๆธ | ็งๆคไธ | ็ฒฎ้ฃ็งๆค | ไธ็บง่กไธ | 0 | 2021ไฟ็ | 2 |+110103 | 850113 | ๅๆ็งๆธ | ็งๆคไธ | ๅ ถไป็งๆคไธ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 6 |+110104 | 850114 | ๅๆ็งๆธ | ็งๆคไธ | ้ฃ็จ่ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 4 |+110200 | 801015 | ๅๆ็งๆธ | ๆธไธ | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 11 |+110201 | 850121 | ๅๆ็งๆธ | ๆธไธ | ๆตทๆดๆๆ | ไธ็บง่กไธ | 0 | 2021ไฟ็ | 2 |+110202 | 850122 | ๅๆ็งๆธ | ๆธไธ | ๆฐดไบงๅ ปๆฎ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 9 |+110300 | 801011 | ๅๆ็งๆธ | ๆไธโ ก | | ไบ็บง่กไธ | 0 | 2021ไฟ็ | 3 |+110301 | 850131 | ๅๆ็งๆธ | ๆไธโ ก | ๆไธโ ข | ไธ็บง่กไธ | 0 | 2021ไฟ็ | 3 |+110400 | 801014 | ๅๆ็งๆธ | ้ฅฒๆ | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 11 |+110402 | 850142 | ๅๆ็งๆธ | ้ฅฒๆ | ็็ฆฝ้ฅฒๆ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 7 |+110403 | 850143 | ๅๆ็งๆธ | ้ฅฒๆ | ๆฐดไบง้ฅฒๆ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 2 |+110404 | 850144 | ๅๆ็งๆธ | ้ฅฒๆ | ๅฎ ็ฉ้ฃๅ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 2 |+110500 | 801012 | ๅๆ็งๆธ | ๅไบงๅๅ ๅทฅ | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 23 |+110501 | 850151 | ๅๆ็งๆธ | ๅไบงๅๅ ๅทฅ | ๆ่ฌๅ ๅทฅ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 5 |+110502 | 850152 | ๅๆ็งๆธ | ๅไบงๅๅ ๅทฅ | ็ฒฎๆฒนๅ ๅทฅ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 6 |+110504 | 850154 | ๅๆ็งๆธ | ๅไบงๅๅ ๅทฅ | ๅ ถไปๅไบงๅๅ ๅทฅ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 12 |+110700 | 801017 | ๅๆ็งๆธ | ๅ ปๆฎไธ | | ไบ็บง่กไธ | 1 | 2021ๆนๅ | 20 |+110702 | 850172 | ๅๆ็งๆธ | ๅ ปๆฎไธ | ็็ชๅ ปๆฎ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 9 |+110703 | 850173 | ๅๆ็งๆธ | ๅ ปๆฎไธ | ่้ธกๅ ปๆฎ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 7 |+110704 | 850174 | ๅๆ็งๆธ | ๅ ปๆฎไธ | ๅ ถไปๅ ปๆฎ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 4 |+110800 | 801018 | ๅๆ็งๆธ | ๅจ็ฉไฟๅฅโ ก | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 10 |+110801 | 850181 | ๅๆ็งๆธ | ๅจ็ฉไฟๅฅโ ก | ๅจ็ฉไฟๅฅโ ข | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 10 |+110900 | 801019 | ๅๆ็งๆธ | ๅไธ็ปผๅโ ก | | ไบ็บง่กไธ | 0 | 2021ๆฐๅข | 2 |+110901 | 850191 | ๅๆ็งๆธ | ๅไธ็ปผๅโ ก | ๅไธ็ปผๅโ ข | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 2 |+220000 | 801030 | ๅบ็กๅๅทฅ | | | ไธ็บง่กไธ | 1 | 2021ๆนๅ | 311 |+220200 | 801033 | ๅบ็กๅๅทฅ | ๅๅญฆๅๆ | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 52 |+220201 | 850321 | ๅบ็กๅๅทฅ | ๅๅญฆๅๆ | ็บฏ็ขฑ | ไธ็บง่กไธ | 0 | 2021ไฟ็ | 4 |+220202 | 850322 | ๅบ็กๅๅทฅ | ๅๅญฆๅๆ | ๆฐฏ็ขฑ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 17 |+220203 | 850323 | ๅบ็กๅๅทฅ | ๅๅญฆๅๆ | ๆ ๆบ็ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 12 |+220204 | 850324 | ๅบ็กๅๅทฅ | ๅๅญฆๅๆ | ๅ ถไปๅๅญฆๅๆ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 6 |+220205 | 850325 | ๅบ็กๅๅทฅ | ๅๅญฆๅๆ | ็ คๅๅทฅ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 7 |+220206 | 850326 | ๅบ็กๅๅทฅ | ๅๅญฆๅๆ | ้็ฝ็ฒ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 6 |+220300 | 801034 | ๅบ็กๅๅทฅ | ๅๅญฆๅถๅ | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 109 |+220305 | 850335 | ๅบ็กๅๅทฅ | ๅๅญฆๅถๅ | ๆถๆๆฒนๅขจ | ไธ็บง่กไธ | 1 | 2021ๆนๅ | 10 |+220307 | 850337 | ๅบ็กๅๅทฅ | ๅๅญฆๅถๅ | ๆฐ็ๅถๅ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 13 |+220308 | 850338 | ๅบ็กๅๅทฅ | ๅๅญฆๅถๅ | ็บบ็ปๅๅญฆๅถๅ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 10 |+220309 | 850339 | ๅบ็กๅๅทฅ | ๅๅญฆๅถๅ | ๅ ถไปๅๅญฆๅถๅ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 37 |+220311 | 850382 | ๅบ็กๅๅทฅ | ๅๅญฆๅถๅ | ๆฐๅๅทฅ | ไธ็บง่กไธ | 1 | 2021ๆนๅ | 8 |+220313 | 850372 | ๅบ็กๅๅทฅ | ๅๅญฆๅถๅ | ่ๆฐจ้ ฏ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 8 |+220315 | 850135 | ๅบ็กๅๅทฅ | ๅๅญฆๅถๅ | ้ฃๅๅ้ฅฒๆๆทปๅ ๅ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 11 |+220316 | 850136 | ๅบ็กๅๅทฅ | ๅๅญฆๅถๅ | ๆๆบ็ก | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 9 |+220317 | 850137 | ๅบ็กๅๅทฅ | ๅๅญฆๅถๅ | ่ถ้ปๅๅ่ถๅธฆ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 3 |+220400 | 801032 | ๅบ็กๅๅทฅ | ๅๅญฆ็บค็ปด | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 21 |+220401 | 850341 | ๅบ็กๅๅทฅ | ๅๅญฆ็บค็ปด | ๆถค็บถ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 8 |+220403 | 850343 | ๅบ็กๅๅทฅ | ๅๅญฆ็บค็ปด | ็ฒ่ถ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 5 |+220404 | 850344 | ๅบ็กๅๅทฅ | ๅๅญฆ็บค็ปด | ๅ ถไปๅๅญฆ็บค็ปด | ไธ็บง่กไธ | 0 | 2021ๆนๅ | 2 |+220405 | 850345 | ๅบ็กๅๅทฅ | ๅๅญฆ็บค็ปด | ๆฐจ็บถ | ไธ็บง่กไธ | 0 | 2021ไฟ็ | 3 |+220406 | 850346 | ๅบ็กๅๅทฅ | ๅๅญฆ็บค็ปด | ้ฆ็บถ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 3 |+220500 | 801036 | ๅบ็กๅๅทฅ | ๅกๆ | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 57 |+220501 | 850351 | ๅบ็กๅๅทฅ | ๅกๆ | ๅ ถไปๅกๆๅถๅ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 26 |+220503 | 850353 | ๅบ็กๅๅทฅ | ๅกๆ | ๆนๆงๅกๆ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 13 |+220504 | 850354 | ๅบ็กๅๅทฅ | ๅกๆ | ๅๆๆ ่ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 6 |+220505 | 850355 | ๅบ็กๅๅทฅ | ๅกๆ | ่ๆๆ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 12 |+220600 | 801037 | ๅบ็กๅๅทฅ | ๆฉก่ถ | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 14 |+220602 | 850362 | ๅบ็กๅๅทฅ | ๆฉก่ถ | ๅ ถไปๆฉก่ถๅถๅ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 7 |+220603 | 850363 | ๅบ็กๅๅทฅ | ๆฉก่ถ | ็ญ้ป | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 5 |+220604 | 850364 | ๅบ็กๅๅทฅ | ๆฉก่ถ | ๆฉก่ถๅฉๅ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 2 |+220800 | 801038 | ๅบ็กๅๅทฅ | ๅๅๅถๅ | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 53 |+220801 | 850331 | ๅบ็กๅๅทฅ | ๅๅๅถๅ | ๆฐฎ่ฅ | ไธ็บง่กไธ | 1 | 2021ๆฟๆขไปฃ็ 220301 | 5 |+220802 | 850332 | ๅบ็กๅๅทฅ | ๅๅๅถๅ | ็ฃท่ฅๅ็ฃทๅๅทฅ | ไธ็บง่กไธ | 1 | 2021ๆฟๆขไปฃ็ -ๆนๅ220302 | 7 |+220803 | 850333 | ๅบ็กๅๅทฅ | ๅๅๅถๅ | ๅ่ฏ | ไธ็บง่กไธ | 1 | 2021ๆฟๆขไปฃ็ 220303 | 28 |+220804 | 850336 | ๅบ็กๅๅทฅ | ๅๅๅถๅ | ้พ่ฅ | ไธ็บง่กไธ | 0 | 2021ๆฟๆขไปฃ็ 220306 | 4 |+220805 | 850381 | ๅบ็กๅๅทฅ | ๅๅๅถๅ | ๅคๅ่ฅ | ไธ็บง่กไธ | 1 | 2021ๆฟๆขไปฃ็ 220310 | 9 |+220900 | 801039 | ๅบ็กๅๅทฅ | ้้ๅฑๆๆโ ก | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 5 |+220901 | 850523 | ๅบ็กๅๅทฅ | ้้ๅฑๆๆโ ก | ้้ๅฑๆๆโ ข | ไธ็บง่กไธ | 1 | 2021ๆฟๆขไปฃ็ 240203 | 5 |+230000 | 801040 | ้ข้ | | | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 43 |+230300 | 801043 | ้ข้ | ๅถ้ขๅๆ | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 7 |+230301 | 850431 | ้ข้ | ๅถ้ขๅๆ | ้็ฟ็ณ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 4 |+230302 | 850432 | ้ข้ | ๅถ้ขๅๆ | ๅถ้ข่พ ๆ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 3 |+230400 | 801044 | ้ข้ | ๆฎ้ข | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 24 |+230401 | 850441 | ้ข้ | ๆฎ้ข | ้ฟๆ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 3 |+230402 | 850442 | ้ข้ | ๆฎ้ข | ๆฟๆ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 18 |+230403 | 850443 | ้ข้ | ๆฎ้ข | ้ข้็ฎกๆ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 3 |+230500 | 801045 | ้ข้ | ็น้ขโ ก | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 12 |+230501 | 850412 | ้ข้ | ็น้ขโ ก | ็น้ขโ ข | ไธ็บง่กไธ | 1 | 2021ๆฟๆขไปฃ็ 230102 | 12 |+240000 | 801050 | ๆ่ฒ้ๅฑ | | | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 125 |+240200 | 801051 | ๆ่ฒ้ๅฑ | ้ๅฑๆฐๆๆ | | ไบ็บง่กไธ | 1 | 2021ๆนๅ | 20 |+240201 | 850521 | ๆ่ฒ้ๅฑ | ้ๅฑๆฐๆๆ | ๅ ถไป้ๅฑๆฐๆๆ | ไธ็บง่กไธ | 1 | 2021ๆนๅ | 9 |+240202 | 850522 | ๆ่ฒ้ๅฑ | ้ๅฑๆฐๆๆ | ็ฃๆงๆๆ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 11 |+240300 | 801055 | ๆ่ฒ้ๅฑ | ๅทฅไธ้ๅฑ | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 56 |+240301 | 850551 | ๆ่ฒ้ๅฑ | ๅทฅไธ้ๅฑ | ้ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 31 |+240302 | 850552 | ๆ่ฒ้ๅฑ | ๅทฅไธ้ๅฑ | ้ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 13 |+240303 | 850553 | ๆ่ฒ้ๅฑ | ๅทฅไธ้ๅฑ | ้ ้ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 12 |+240400 | 801053 | ๆ่ฒ้ๅฑ | ่ดต้ๅฑ | | ไบ็บง่กไธ | 1 | 2021ๆนๅ | 13 |+240401 | 850531 | ๆ่ฒ้ๅฑ | ่ดต้ๅฑ | ้ป้ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 11 |+240402 | 850532 | ๆ่ฒ้ๅฑ | ่ดต้ๅฑ | ็ฝ้ถ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 2 |+240500 | 801054 | ๆ่ฒ้ๅฑ | ๅฐ้ๅฑ | | ไบ็บง่กไธ | 1 | 2021ๆนๅ | 29 |+240501 | 850541 | ๆ่ฒ้ๅฑ | ๅฐ้ๅฑ | ็จๅ | ไธ็บง่กไธ | 0 | 2021ไฟ็ | 4 |+240502 | 850542 | ๆ่ฒ้ๅฑ | ๅฐ้ๅฑ | ้จ | ไธ็บง่กไธ | 0 | 2021ไฟ็ | 4 |+240504 | 850544 | ๆ่ฒ้ๅฑ | ๅฐ้ๅฑ | ๅ ถไปๅฐ้ๅฑ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 18 |+240505 | 850545 | ๆ่ฒ้ๅฑ | ๅฐ้ๅฑ | ้ผ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 3 |+240600 | 801056 | ๆ่ฒ้ๅฑ | ่ฝๆบ้ๅฑ | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 7 |+240601 | 850561 | ๆ่ฒ้ๅฑ | ่ฝๆบ้ๅฑ | ้ด | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 3 |+240602 | 850562 | ๆ่ฒ้ๅฑ | ่ฝๆบ้ๅฑ | ้ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 0 |+240603 | 850543 | ๆ่ฒ้ๅฑ | ่ฝๆบ้ๅฑ | ้ | ไธ็บง่กไธ | 0 | 2021ๆฟๆขไปฃ็ 240503 | 4 |+270000 | 801080 | ็ตๅญ | | | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 284 |+270100 | 801081 | ็ตๅญ | ๅๅฏผไฝ | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 49 |+270102 | 850812 | ็ตๅญ | ๅๅฏผไฝ | ๅ็ซๅจไปถ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 9 |+270103 | 850813 | ็ตๅญ | ๅๅฏผไฝ | ๅๅฏผไฝๆๆ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 8 |+270104 | 850814 | ็ตๅญ | ๅๅฏผไฝ | ๆฐๅญ่ฏ็่ฎพ่ฎก | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 14 |+270105 | 850815 | ็ตๅญ | ๅๅฏผไฝ | ๆจกๆ่ฏ็่ฎพ่ฎก | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 6 |+270106 | 850816 | ็ตๅญ | ๅๅฏผไฝ | ้ๆ็ต่ทฏๅถ้ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 1 |+270107 | 850817 | ็ตๅญ | ๅๅฏผไฝ | ้ๆ็ต่ทฏๅฐๆต | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 6 |+270108 | 850818 | ็ตๅญ | ๅๅฏผไฝ | ๅๅฏผไฝ่ฎพๅค | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 5 |+270200 | 801083 | ็ตๅญ | ๅ ไปถ | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 43 |+270202 | 850822 | ็ตๅญ | ๅ ไปถ | ๅฐๅถ็ต่ทฏๆฟ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 32 |+270203 | 850823 | ็ตๅญ | ๅ ไปถ | ่ขซๅจๅ ไปถ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 11 |+270300 | 801084 | ็ตๅญ | ๅ ๅญฆๅ ็ตๅญ | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 76 |+270301 | 850831 | ็ตๅญ | ๅ ๅญฆๅ ็ตๅญ | ้ขๆฟ | ไธ็บง่กไธ | 1 | 2021ๆนๅ | 33 |+270302 | 850832 | ็ตๅญ | ๅ ๅญฆๅ ็ตๅญ | LED | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 29 |+270303 | 850833 | ็ตๅญ | ๅ ๅญฆๅ ็ตๅญ | ๅ ๅญฆๅ ไปถ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 14 |+270400 | 801082 | ็ตๅญ | ๅ ถไป็ตๅญโ ก | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 26 |+270401 | 850841 | ็ตๅญ | ๅ ถไป็ตๅญโ ก | ๅ ถไป็ตๅญโ ข | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 26 |+270500 | 801085 | ็ตๅญ | ๆถ่ดน็ตๅญ | | ไบ็บง่กไธ | 1 | 2021ๆนๅ | 74 |+270503 | 850853 | ็ตๅญ | ๆถ่ดน็ตๅญ | ๅ็ๆถ่ดน็ตๅญ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 5 |+270504 | 850854 | ็ตๅญ | ๆถ่ดน็ตๅญ | ๆถ่ดน็ตๅญ้ถ้จไปถๅ็ป่ฃ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 69 |+270600 | 801086 | ็ตๅญ | ็ตๅญๅๅญฆๅโ ก | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 16 |+270601 | 850861 | ็ตๅญ | ็ตๅญๅๅญฆๅโ ก | ็ตๅญๅๅญฆๅโ ข | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 16 |+280000 | 801880 | ๆฑฝ่ฝฆ | | | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 221 |+280200 | 801093 | ๆฑฝ่ฝฆ | ๆฑฝ่ฝฆ้ถ้จไปถ | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 171 |+280202 | 850922 | ๆฑฝ่ฝฆ | ๆฑฝ่ฝฆ้ถ้จไปถ | ่ฝฆ่บซ้ไปถๅ้ฅฐไปถ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 23 |+280203 | 850923 | ๆฑฝ่ฝฆ | ๆฑฝ่ฝฆ้ถ้จไปถ | ๅบ็ไธๅๅจๆบ็ณป็ป | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 78 |+280204 | 850924 | ๆฑฝ่ฝฆ | ๆฑฝ่ฝฆ้ถ้จไปถ | ่ฝฎ่่ฝฎๆฏ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 18 |+280205 | 850925 | ๆฑฝ่ฝฆ | ๆฑฝ่ฝฆ้ถ้จไปถ | ๅ ถไปๆฑฝ่ฝฆ้ถ้จไปถ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 33 |+280206 | 850926 | ๆฑฝ่ฝฆ | ๆฑฝ่ฝฆ้ถ้จไปถ | ๆฑฝ่ฝฆ็ตๅญ็ตๆฐ็ณป็ป | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 19 |+280300 | 801092 | ๆฑฝ่ฝฆ | ๆฑฝ่ฝฆๆๅก | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 14 |+280302 | 850232 | ๆฑฝ่ฝฆ | ๆฑฝ่ฝฆๆๅก | ๆฑฝ่ฝฆ็ป้ๅ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 9 |+280303 | 850233 | ๆฑฝ่ฝฆ | ๆฑฝ่ฝฆๆๅก | ๆฑฝ่ฝฆ็ปผๅๆๅก | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 5 |+280400 | 801881 | ๆฑฝ่ฝฆ | ๆฉๆ่ฝฆๅๅ ถไป | | ไบ็บง่กไธ | 1 | 2021ๆนๅ | 14 |+280401 | 858811 | ๆฑฝ่ฝฆ | ๆฉๆ่ฝฆๅๅ ถไป | ๅ ถไป่ฟ่พ่ฎพๅค | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 6 |+280402 | 858812 | ๆฑฝ่ฝฆ | ๆฉๆ่ฝฆๅๅ ถไป | ๆฉๆ่ฝฆ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 8 |+280500 | 801095 | ๆฑฝ่ฝฆ | ไน็จ่ฝฆ | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 9 |+280501 | 850951 | ๆฑฝ่ฝฆ | ไน็จ่ฝฆ | ็ตๅจไน็จ่ฝฆ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 1 |+280502 | 850952 | ๆฑฝ่ฝฆ | ไน็จ่ฝฆ | ็ปผๅไน็จ่ฝฆ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 8 |+280600 | 801096 | ๆฑฝ่ฝฆ | ๅ็จ่ฝฆ | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 13 |+280601 | 850912 | ๆฑฝ่ฝฆ | ๅ็จ่ฝฆ | ๅ็จ่ฝฝ่ดง่ฝฆ | ไธ็บง่กไธ | 1 | 2021ๆฟๆขไปฃ็ 280102 | 7 |+280602 | 850913 | ๆฑฝ่ฝฆ | ๅ็จ่ฝฆ | ๅ็จ่ฝฝๅฎข่ฝฆ | ไธ็บง่กไธ | 1 | 2021ๆฟๆขไปฃ็ 280103 | 6 |+330000 | 801110 | ๅฎถ็จ็ตๅจ | | | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 77 |+330100 | 801111 | ๅฎถ็จ็ตๅจ | ็ฝ่ฒๅฎถ็ต | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 10 |+330102 | 851112 | ๅฎถ็จ็ตๅจ | ็ฝ่ฒๅฎถ็ต | ็ฉบ่ฐ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 5 |+330106 | 851116 | ๅฎถ็จ็ตๅจ | ็ฝ่ฒๅฎถ็ต | ๅฐๆด | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 5 |+330200 | 801112 | ๅฎถ็จ็ตๅจ | ้ป่ฒๅฎถ็ต | | ไบ็บง่กไธ | 1 | 2021ๆนๅ | 9 |+330201 | 851121 | ๅฎถ็จ็ตๅจ | ้ป่ฒๅฎถ็ต | ๅฝฉ็ต | ไธ็บง่กไธ | 0 | 2021ไฟ็ | 4 |+330202 | 851122 | ๅฎถ็จ็ตๅจ | ้ป่ฒๅฎถ็ต | ๅ ถไป้ป่ฒๅฎถ็ต | ไธ็บง่กไธ | 1 | 2021ๆนๅ | 5 |+330300 | 801113 | ๅฎถ็จ็ตๅจ | ๅฐๅฎถ็ต | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 14 |+330301 | 851131 | ๅฎถ็จ็ตๅจ | ๅฐๅฎถ็ต | ๅจๆฟๅฐๅฎถ็ต | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 11 |+330302 | 851132 | ๅฎถ็จ็ตๅจ | ๅฐๅฎถ็ต | ๆธ ๆดๅฐๅฎถ็ต | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 2 |+330303 | 851133 | ๅฎถ็จ็ตๅจ | ๅฐๅฎถ็ต | ไธชๆคๅฐๅฎถ็ต | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 1 |+330400 | 801114 | ๅฎถ็จ็ตๅจ | ๅจๅซ็ตๅจ | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 9 |+330401 | 851141 | ๅฎถ็จ็ตๅจ | ๅจๅซ็ตๅจ | ๅจๆฟ็ตๅจ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 6 |+330402 | 851142 | ๅฎถ็จ็ตๅจ | ๅจๅซ็ตๅจ | ๅซๆตด็ตๅจ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 3 |+330500 | 801115 | ๅฎถ็จ็ตๅจ | ็ งๆ่ฎพๅคโ ก | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 8 |+330501 | 851151 | ๅฎถ็จ็ตๅจ | ็ งๆ่ฎพๅคโ ก | ็ งๆ่ฎพๅคโ ข | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 8 |+330600 | 801116 | ๅฎถ็จ็ตๅจ | ๅฎถ็ต้ถ้จไปถโ ก | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 24 |+330601 | 851161 | ๅฎถ็จ็ตๅจ | ๅฎถ็ต้ถ้จไปถโ ก | ๅฎถ็ต้ถ้จไปถโ ข | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 24 |+330700 | 801117 | ๅฎถ็จ็ตๅจ | ๅ ถไปๅฎถ็ตโ ก | | ไบ็บง่กไธ | 0 | 2021ๆฐๅข | 3 |+330701 | 851171 | ๅฎถ็จ็ตๅจ | ๅ ถไปๅฎถ็ตโ ก | ๅ ถไปๅฎถ็ตโ ข | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 3 |+340000 | 801120 | ้ฃๅ้ฅฎๆ | | | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 113 |+340400 | 801124 | ้ฃๅ้ฅฎๆ | ้ฃๅๅ ๅทฅ | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 18 |+340401 | 851241 | ้ฃๅ้ฅฎๆ | ้ฃๅๅ ๅทฅ | ่ๅถๅ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 6 |+340404 | 851244 | ้ฃๅ้ฅฎๆ | ้ฃๅๅ ๅทฅ | ๅ ถไป้ฃๅ | ไธ็บง่กไธ | 0 | 2021ๆนๅ | 0 |+340406 | 851246 | ้ฃๅ้ฅฎๆ | ้ฃๅๅ ๅทฅ | ้ขๅ ๅทฅ้ฃๅ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 7 |+340407 | 851247 | ้ฃๅ้ฅฎๆ | ้ฃๅๅ ๅทฅ | ไฟๅฅๅ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 5 |+340500 | 801125 | ้ฃๅ้ฅฎๆ | ็ฝ้ โ ก | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 19 |+340501 | 851251 | ้ฃๅ้ฅฎๆ | ็ฝ้ โ ก | ็ฝ้ โ ข | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 19 |+340600 | 801126 | ้ฃๅ้ฅฎๆ | ้็ฝ้ | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 17 |+340601 | 851232 | ้ฃๅ้ฅฎๆ | ้็ฝ้ | ๅค้ | ไธ็บง่กไธ | 1 | 2021ๆฟๆขไปฃ็ 340302 | 7 |+340602 | 851233 | ้ฃๅ้ฅฎๆ | ้็ฝ้ | ๅ ถไป้ ็ฑป | ไธ็บง่กไธ | 1 | 2021ๆฟๆขไปฃ็ 340303 | 10 |+340700 | 801127 | ้ฃๅ้ฅฎๆ | ้ฅฎๆไนณๅ | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 26 |+340701 | 851271 | ้ฃๅ้ฅฎๆ | ้ฅฎๆไนณๅ | ่ฝฏ้ฅฎๆ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 8 |+340702 | 851243 | ้ฃๅ้ฅฎๆ | ้ฅฎๆไนณๅ | ไนณๅ | ไธ็บง่กไธ | 1 | 2021ๆฟๆขไปฃ็ 340403 | 18 |+340800 | 801128 | ้ฃๅ้ฅฎๆ | ไผ้ฒ้ฃๅ | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 19 |+340801 | 851281 | ้ฃๅ้ฅฎๆ | ไผ้ฒ้ฃๅ | ้ถ้ฃ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 9 |+340802 | 851282 | ้ฃๅ้ฅฎๆ | ไผ้ฒ้ฃๅ | ็็้ฃๅ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 8 |+340803 | 851283 | ้ฃๅ้ฅฎๆ | ไผ้ฒ้ฃๅ | ็้ฃ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 2 |+340900 | 801129 | ้ฃๅ้ฅฎๆ | ่ฐๅณๅ้ ตๅโ ก | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 14 |+340901 | 851242 | ้ฃๅ้ฅฎๆ | ่ฐๅณๅ้ ตๅโ ก | ่ฐๅณๅ้ ตๅโ ข | ไธ็บง่กไธ | 1 | 2021ๆฟๆขไปฃ็ 340402 | 14 |+350000 | 801130 | ็บบ็ปๆ้ฅฐ | | | ไธ็บง่กไธ | 1 | 2021ๆนๅ | 113 |+350100 | 801131 | ็บบ็ปๆ้ฅฐ | ็บบ็ปๅถ้ | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 38 |+350102 | 851312 | ็บบ็ปๆ้ฅฐ | ็บบ็ปๅถ้ | ๆฃ็บบ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 9 |+350104 | 851314 | ็บบ็ปๆ้ฅฐ | ็บบ็ปๅถ้ | ๅฐๆ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 5 |+350105 | 851315 | ็บบ็ปๆ้ฅฐ | ็บบ็ปๅถ้ | ่พ ๆ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 5 |+350106 | 851316 | ็บบ็ปๆ้ฅฐ | ็บบ็ปๅถ้ | ๅ ถไป็บบ็ป | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 18 |+350107 | 851317 | ็บบ็ปๆ้ฅฐ | ็บบ็ปๅถ้ | ็บบ็ป้็ฑปๅถ้ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 1 |+350200 | 801132 | ็บบ็ปๆ้ฅฐ | ๆ่ฃ ๅฎถ็บบ | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 59 |+350205 | 851325 | ็บบ็ปๆ้ฅฐ | ๆ่ฃ ๅฎถ็บบ | ้ๅธฝๅๅ ถไป | ไธ็บง่กไธ | 1 | 2021ๆนๅ | 16 |+350206 | 851326 | ็บบ็ปๆ้ฅฐ | ๆ่ฃ ๅฎถ็บบ | ๅฎถ็บบ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 6 |+350208 | 851328 | ็บบ็ปๆ้ฅฐ | ๆ่ฃ ๅฎถ็บบ | ่ฟๅจๆ่ฃ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 3 |+350209 | 851329 | ็บบ็ปๆ้ฅฐ | ๆ่ฃ ๅฎถ็บบ | ้่ฟๅจๆ่ฃ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 34 |+350300 | 801133 | ็บบ็ปๆ้ฅฐ | ้ฅฐๅ | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 16 |+350301 | 851331 | ็บบ็ปๆ้ฅฐ | ้ฅฐๅ | ้่กจ็ ๅฎ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 14 |+350302 | 851332 | ็บบ็ปๆ้ฅฐ | ้ฅฐๅ | ๅคๅ็ฑปๅฅขไพๅ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 0 |+350303 | 851333 | ็บบ็ปๆ้ฅฐ | ้ฅฐๅ | ๅ ถไป้ฅฐๅ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 2 |+360000 | 801140 | ่ฝปๅทฅๅถ้ | | | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 131 |+360100 | 801143 | ่ฝปๅทฅๅถ้ | ้ ็บธ | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 22 |+360102 | 851412 | ่ฝปๅทฅๅถ้ | ้ ็บธ | ๅคงๅฎ็จ็บธ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 11 |+360103 | 851413 | ่ฝปๅทฅๅถ้ | ้ ็บธ | ็น็ง็บธ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 11 |+360200 | 801141 | ่ฝปๅทฅๅถ้ | ๅ ่ฃ ๅฐๅท | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 37 |+360202 | 851422 | ่ฝปๅทฅๅถ้ | ๅ ่ฃ ๅฐๅท | ๅฐๅท | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 5 |+360203 | 851423 | ่ฝปๅทฅๅถ้ | ๅ ่ฃ ๅฐๅท | ้ๅฑๅ ่ฃ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 7 |+360204 | 851424 | ่ฝปๅทฅๅถ้ | ๅ ่ฃ ๅฐๅท | ๅกๆๅ ่ฃ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 5 |+360205 | 851425 | ่ฝปๅทฅๅถ้ | ๅ ่ฃ ๅฐๅท | ็บธๅ ่ฃ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 16 |+360206 | 851426 | ่ฝปๅทฅๅถ้ | ๅ ่ฃ ๅฐๅท | ็ปผๅๅ ่ฃ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 4 |+360300 | 801142 | ่ฝปๅทฅๅถ้ | ๅฎถๅฑ ็จๅ | | ไบ็บง่กไธ | 1 | 2021ๆนๅ | 58 |+360306 | 851436 | ่ฝปๅทฅๅถ้ | ๅฎถๅฑ ็จๅ | ็ท็ ๅฐๆฟ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 10 |+360307 | 851437 | ่ฝปๅทฅๅถ้ | ๅฎถๅฑ ็จๅ | ๆๅๅฎถๅฑ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 14 |+360308 | 851438 | ่ฝปๅทฅๅถ้ | ๅฎถๅฑ ็จๅ | ๅฎๅถๅฎถๅฑ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 13 |+360309 | 851439 | ่ฝปๅทฅๅถ้ | ๅฎถๅฑ ็จๅ | ๅซๆตดๅถๅ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 5 |+360311 | 851491 | ่ฝปๅทฅๅถ้ | ๅฎถๅฑ ็จๅ | ๅ ถไปๅฎถๅฑ ็จๅ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 16 |+360500 | 801145 | ่ฝปๅทฅๅถ้ | ๆๅจฑ็จๅ | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 14 |+360501 | 851451 | ่ฝปๅทฅๅถ้ | ๆๅจฑ็จๅ | ๆๅ็จๅ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 3 |+360502 | 851452 | ่ฝปๅทฅๅถ้ | ๆๅจฑ็จๅ | ๅจฑไน็จๅ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 11 |+370000 | 801150 | ๅป่ฏ็็ฉ | | | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 331 |+370100 | 801151 | ๅป่ฏ็็ฉ | ๅๅญฆๅถ่ฏ | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 111 |+370101 | 851511 | ๅป่ฏ็็ฉ | ๅๅญฆๅถ่ฏ | ๅๆ่ฏ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 29 |+370102 | 851512 | ๅป่ฏ็็ฉ | ๅๅญฆๅถ่ฏ | ๅๅญฆๅถๅ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 82 |+370200 | 801155 | ๅป่ฏ็็ฉ | ไธญ่ฏโ ก | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 70 |+370201 | 851521 | ๅป่ฏ็็ฉ | ไธญ่ฏโ ก | ไธญ่ฏโ ข | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 70 |+370300 | 801152 | ๅป่ฏ็็ฉ | ็็ฉๅถๅ | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 27 |+370302 | 851522 | ๅป่ฏ็็ฉ | ็็ฉๅถๅ | ่กๆถฒๅถๅ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 6 |+370303 | 851523 | ๅป่ฏ็็ฉ | ็็ฉๅถๅ | ็ซ่ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 5 |+370304 | 851524 | ๅป่ฏ็็ฉ | ็็ฉๅถๅ | ๅ ถไป็็ฉๅถๅ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 16 |+370400 | 801154 | ๅป่ฏ็็ฉ | ๅป่ฏๅไธ | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 32 |+370402 | 851542 | ๅป่ฏ็็ฉ | ๅป่ฏๅไธ | ๅป่ฏๆต้ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 25 |+370403 | 851543 | ๅป่ฏ็็ฉ | ๅป่ฏๅไธ | ็บฟไธ่ฏๅบ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 7 |+370404 | 851544 | ๅป่ฏ็็ฉ | ๅป่ฏๅไธ | ไบ่็ฝ่ฏๅบ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 0 |+370500 | 801153 | ๅป่ฏ็็ฉ | ๅป็ๅจๆขฐ | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 62 |+370502 | 851532 | ๅป่ฏ็็ฉ | ๅป็ๅจๆขฐ | ๅป็่ฎพๅค | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 18 |+370503 | 851533 | ๅป่ฏ็็ฉ | ๅป็ๅจๆขฐ | ๅป็่ๆ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 23 |+370504 | 851534 | ๅป่ฏ็็ฉ | ๅป็ๅจๆขฐ | ไฝๅค่ฏๆญ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 21 |+370600 | 801156 | ๅป่ฏ็็ฉ | ๅป็ๆๅก | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 29 |+370602 | 851562 | ๅป่ฏ็็ฉ | ๅป็ๆๅก | ่ฏๆญๆๅก | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 4 |+370603 | 851563 | ๅป่ฏ็็ฉ | ๅป็ๆๅก | ๅป็็ ๅๅคๅ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 12 |+370604 | 851564 | ๅป่ฏ็็ฉ | ๅป็ๆๅก | ๅป้ข | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 12 |+370605 | 851565 | ๅป่ฏ็็ฉ | ๅป็ๆๅก | ๅ ถไปๅป็ๆๅก | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 1 |+410000 | 801160 | ๅ ฌ็จไบไธ | | | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 120 |+410100 | 801161 | ๅ ฌ็จไบไธ | ็ตๅ | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 92 |+410101 | 851611 | ๅ ฌ็จไบไธ | ็ตๅ | ็ซๅๅ็ต | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 28 |+410102 | 851612 | ๅ ฌ็จไบไธ | ็ตๅ | ๆฐดๅๅ็ต | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 11 |+410104 | 851614 | ๅ ฌ็จไบไธ | ็ตๅ | ็ญๅๆๅก | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 15 |+410106 | 851616 | ๅ ฌ็จไบไธ | ็ตๅ | ๅ ไผๅ็ต | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 13 |+410107 | 851617 | ๅ ฌ็จไบไธ | ็ตๅ | ้ฃๅๅ็ต | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 8 |+410108 | 851618 | ๅ ฌ็จไบไธ | ็ตๅ | ๆ ธๅๅ็ต | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 2 |+410109 | 851619 | ๅ ฌ็จไบไธ | ็ตๅ | ๅ ถไป่ฝๆบๅ็ต | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 1 |+410110 | 851610 | ๅ ฌ็จไบไธ | ็ตๅ | ็ต่ฝ็ปผๅๆๅก | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 14 |+410300 | 801163 | ๅ ฌ็จไบไธ | ็ๆฐโ ก | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 28 |+410301 | 851631 | ๅ ฌ็จไบไธ | ็ๆฐโ ก | ็ๆฐโ ข | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 28 |+420000 | 801170 | ไบค้่ฟ่พ | | | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 128 |+420800 | 801178 | ไบค้่ฟ่พ | ็ฉๆต | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 49 |+420802 | 851782 | ไบค้่ฟ่พ | ็ฉๆต | ๅๆๆไพๅบ้พๆๅก | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 14 |+420803 | 851783 | ไบค้่ฟ่พ | ็ฉๆต | ไธญ้ดไบงๅๅๆถ่ดนๅไพๅบ้พๆๅก | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 8 |+420804 | 851784 | ไบค้่ฟ่พ | ็ฉๆต | ๅฟซ้ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 5 |+420805 | 851785 | ไบค้่ฟ่พ | ็ฉๆต | ่ทจๅข็ฉๆต | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 9 |+420806 | 851786 | ไบค้่ฟ่พ | ็ฉๆต | ไปๅจ็ฉๆต | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 5 |+420807 | 851787 | ไบค้่ฟ่พ | ็ฉๆต | ๅ ฌ่ทฏ่ดง่ฟ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 8 |+420900 | 801179 | ไบค้่ฟ่พ | ้่ทฏๅ ฌ่ทฏ | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 38 |+420901 | 851731 | ไบค้่ฟ่พ | ้่ทฏๅ ฌ่ทฏ | ้ซ้ๅ ฌ่ทฏ | ไธ็บง่กไธ | 1 | 2021ๆฟๆขไปฃ็ 420201 | 22 |+420902 | 851721 | ไบค้่ฟ่พ | ้่ทฏๅ ฌ่ทฏ | ๅ ฌไบค | ไธ็บง่กไธ | 1 | 2021ๆฟๆขไปฃ็ 420301 | 9 |+420903 | 851771 | ไบค้่ฟ่พ | ้่ทฏๅ ฌ่ทฏ | ้่ทฏ่ฟ่พ | ไธ็บง่กไธ | 1 | 2021ๆฟๆขไปฃ็ 420701 | 7 |+421000 | 801991 | ไบค้่ฟ่พ | ่ช็ฉบๆบๅบ | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 12 |+421001 | 851741 | ไบค้่ฟ่พ | ่ช็ฉบๆบๅบ | ่ช็ฉบ่ฟ่พ | ไธ็บง่กไธ | 1 | 2021ๆฟๆขไปฃ็ 420401 | 8 |+421002 | 851751 | ไบค้่ฟ่พ | ่ช็ฉบๆบๅบ | ๆบๅบ | ไธ็บง่กไธ | 0 | 2021ๆฟๆขไปฃ็ 420501 | 4 |+421100 | 801992 | ไบค้่ฟ่พ | ่ช่ฟๆธฏๅฃ | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 29 |+421101 | 851761 | ไบค้่ฟ่พ | ่ช่ฟๆธฏๅฃ | ่ช่ฟ | ไธ็บง่กไธ | 1 | 2021ๆฟๆขไปฃ็ 420601 | 12 |+421102 | 851711 | ไบค้่ฟ่พ | ่ช่ฟๆธฏๅฃ | ๆธฏๅฃ | ไธ็บง่กไธ | 1 | 2021ๆฟๆขไปฃ็ 420101 | 17 |+430000 | 801180 | ๆฟๅฐไบง | | | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 131 |+430100 | 801181 | ๆฟๅฐไบง | ๆฟๅฐไบงๅผๅ | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 122 |+430101 | 851811 | ๆฟๅฐไบง | ๆฟๅฐไบงๅผๅ | ไฝๅฎ ๅผๅ | ไธ็บง่กไธ | 1 | 2021ๆนๅ | 101 |+430102 | 851812 | ๆฟๅฐไบง | ๆฟๅฐไบงๅผๅ | ๅไธๅฐไบง | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 10 |+430103 | 851813 | ๆฟๅฐไบง | ๆฟๅฐไบงๅผๅ | ไบงไธๅฐไบง | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 11 |+430300 | 801183 | ๆฟๅฐไบง | ๆฟๅฐไบงๆๅก | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 9 |+430301 | 851831 | ๆฟๅฐไบง | ๆฟๅฐไบงๆๅก | ็ฉไธ็ฎก็ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 6 |+430302 | 851832 | ๆฟๅฐไบง | ๆฟๅฐไบงๆๅก | ๆฟไบง็ง่ต็ป็บช | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 3 |+430303 | 851833 | ๆฟๅฐไบง | ๆฟๅฐไบงๆๅก | ๆฟๅฐไบง็ปผๅๆๅก | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 0 |+450000 | 801200 | ๅ่ดธ้ถๅฎ | | | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 104 |+450200 | 801202 | ๅ่ดธ้ถๅฎ | ่ดธๆโ ก | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 15 |+450201 | 852021 | ๅ่ดธ้ถๅฎ | ่ดธๆโ ก | ่ดธๆโ ข | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 15 |+450300 | 801203 | ๅ่ดธ้ถๅฎ | ไธ่ฌ้ถๅฎ | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 68 |+450301 | 852031 | ๅ่ดธ้ถๅฎ | ไธ่ฌ้ถๅฎ | ็พ่ดง | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 25 |+450302 | 852032 | ๅ่ดธ้ถๅฎ | ไธ่ฌ้ถๅฎ | ่ถ ๅธ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 11 |+450303 | 852033 | ๅ่ดธ้ถๅฎ | ไธ่ฌ้ถๅฎ | ๅคไธๆ้ถๅฎ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 16 |+450304 | 852034 | ๅ่ดธ้ถๅฎ | ไธ่ฌ้ถๅฎ | ๅไธ็ฉไธ็ป่ฅ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 16 |+450400 | 801204 | ๅ่ดธ้ถๅฎ | ไธไธ่ฟ้โ ก | | ไบ็บง่กไธ | 1 | 2021ๆนๅ | 7 |+450401 | 852041 | ๅ่ดธ้ถๅฎ | ไธไธ่ฟ้โ ก | ไธไธ่ฟ้โ ข | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 7 |+450600 | 801206 | ๅ่ดธ้ถๅฎ | ไบ่็ฝ็ตๅ | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 13 |+450601 | 852061 | ๅ่ดธ้ถๅฎ | ไบ่็ฝ็ตๅ | ็ปผๅ็ตๅ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 2 |+450602 | 852062 | ๅ่ดธ้ถๅฎ | ไบ่็ฝ็ตๅ | ่ทจๅข็ตๅ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 6 |+450603 | 852063 | ๅ่ดธ้ถๅฎ | ไบ่็ฝ็ตๅ | ็ตๅๆๅก | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 5 |+450700 | 801207 | ๅ่ดธ้ถๅฎ | ๆ ๆธธ้ถๅฎโ ก | | ไบ็บง่กไธ | 0 | 2021ๆฐๅข | 1 |+450701 | 852071 | ๅ่ดธ้ถๅฎ | ๆ ๆธธ้ถๅฎโ ก | ๆ ๆธธ้ถๅฎโ ข | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 1 |+460000 | 801210 | ็คพไผๆๅก | | | ไธ็บง่กไธ | 1 | 2021ๆนๅ | 72 |+460600 | 801216 | ็คพไผๆๅก | ไฝ่ฒโ ก | | ไบ็บง่กไธ | 0 | 2021ๆฐๅข | 4 |+460601 | 852161 | ็คพไผๆๅก | ไฝ่ฒโ ก | ไฝ่ฒโ ข | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 4 |+460700 | 801217 | ็คพไผๆๅก | ๆฌๅฐ็ๆดปๆๅกโ ก | | ไบ็บง่กไธ | 0 | 2021ๆฐๅข | 0 |+460701 | 852171 | ็คพไผๆๅก | ๆฌๅฐ็ๆดปๆๅกโ ก | ๆฌๅฐ็ๆดปๆๅกโ ข | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 0 |+460800 | 801218 | ็คพไผๆๅก | ไธไธๆๅก | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 16 |+460801 | 852181 | ็คพไผๆๅก | ไธไธๆๅก | ไบบๅ่ตๆบๆๅก | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 1 |+460802 | 852182 | ็คพไผๆๅก | ไธไธๆๅก | ๆฃๆตๆๅก | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 9 |+460803 | 852183 | ็คพไผๆๅก | ไธไธๆๅก | ไผๅฑๆๅก | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 5 |+460804 | 852184 | ็คพไผๆๅก | ไธไธๆๅก | ๅ ถไปไธไธๆๅก | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 1 |+460900 | 801219 | ็คพไผๆๅก | ้ ๅบ้ค้ฅฎ | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 10 |+460901 | 852121 | ็คพไผๆๅก | ้ ๅบ้ค้ฅฎ | ้ ๅบ | ไธ็บง่กไธ | 1 | 2021ๆฟๆขไปฃ็ 460201 | 6 |+460902 | 852141 | ็คพไผๆๅก | ้ ๅบ้ค้ฅฎ | ้ค้ฅฎ | ไธ็บง่กไธ | 0 | 2021ๆฟๆขไปฃ็ 460401 | 4 |+461000 | 801993 | ็คพไผๆๅก | ๆ ๆธธๅๆฏๅบ | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 21 |+461001 | 859931 | ็คพไผๆๅก | ๆ ๆธธๅๆฏๅบ | ๅๅฝฉ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 0 |+461002 | 852111 | ็คพไผๆๅก | ๆ ๆธธๅๆฏๅบ | ไบบๅทฅๆฏๅบ | ไธ็บง่กไธ | 1 | 2021ๆฟๆขไปฃ็ 460101 | 6 |+461003 | 852112 | ็คพไผๆๅก | ๆ ๆธธๅๆฏๅบ | ่ช็ถๆฏๅบ | ไธ็บง่กไธ | 1 | 2021ๆฟๆขไปฃ็ 460102 | 10 |+461004 | 852131 | ็คพไผๆๅก | ๆ ๆธธๅๆฏๅบ | ๆ ๆธธ็ปผๅ | ไธ็บง่กไธ | 1 | 2021ๆฟๆขไปฃ็ 460301 | 5 |+461100 | 801994 | ็คพไผๆๅก | ๆ่ฒ | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 21 |+461101 | 859851 | ็คพไผๆๅก | ๆ่ฒ | ๅญฆๅๆ่ฒ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 2 |+461102 | 859852 | ็คพไผๆๅก | ๆ่ฒ | ๅน่ฎญๆ่ฒ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 15 |+461103 | 859853 | ็คพไผๆๅก | ๆ่ฒ | ๆ่ฒ่ฟ่ฅๅๅ ถไป | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 4 |+480000 | 801780 | ้ถ่ก | | | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 41 |+480200 | 801782 | ้ถ่ก | ๅฝๆๅคงๅ้ถ่กโ ก | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 6 |+480201 | 857821 | ้ถ่ก | ๅฝๆๅคงๅ้ถ่กโ ก | ๅฝๆๅคงๅ้ถ่กโ ข | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 6 |+480300 | 801783 | ้ถ่ก | ่กไปฝๅถ้ถ่กโ ก | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 9 |+480301 | 857831 | ้ถ่ก | ่กไปฝๅถ้ถ่กโ ก | ่กไปฝๅถ้ถ่กโ ข | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 9 |+480400 | 801784 | ้ถ่ก | ๅๅ่กโ ก | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 16 |+480401 | 857841 | ้ถ่ก | ๅๅ่กโ ก | ๅๅ่กโ ข | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 16 |+480500 | 801785 | ้ถ่ก | ๅๅ่กโ ก | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 10 |+480501 | 857851 | ้ถ่ก | ๅๅ่กโ ก | ๅๅ่กโ ข | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 10 |+480600 | 801786 | ้ถ่ก | ๅ ถไป้ถ่กโ ก | | ไบ็บง่กไธ | 0 | 2021ๆฐๅข | 0 |+480601 | 857861 | ้ถ่ก | ๅ ถไป้ถ่กโ ก | ๅ ถไป้ถ่กโ ข | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 0 |+490000 | 801790 | ้้ถ้่ | | | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 87 |+490100 | 801193 | ้้ถ้่ | ่ฏๅธโ ก | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 49 |+490101 | 851931 | ้้ถ้่ | ่ฏๅธโ ก | ่ฏๅธโ ข | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 49 |+490200 | 801194 | ้้ถ้่ | ไฟ้ฉโ ก | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 7 |+490201 | 851941 | ้้ถ้่ | ไฟ้ฉโ ก | ไฟ้ฉโ ข | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 7 |+490300 | 801191 | ้้ถ้่ | ๅคๅ ้่ | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 31 |+490302 | 851922 | ้้ถ้่ | ๅคๅ ้่ | ้่ๆง่ก | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 13 |+490303 | 851923 | ้้ถ้่ | ๅคๅ ้่ | ๆ่ดง | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 2 |+490304 | 851924 | ้้ถ้่ | ๅคๅ ้่ | ไฟกๆ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 3 |+490305 | 851925 | ้้ถ้่ | ๅคๅ ้่ | ็ง่ต | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 4 |+490306 | 851926 | ้้ถ้่ | ๅคๅ ้่ | ้่ไฟกๆฏๆๅก | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 3 |+490307 | 851927 | ้้ถ้่ | ๅคๅ ้่ | ่ตไบง็ฎก็ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 5 |+490308 | 851928 | ้้ถ้่ | ๅคๅ ้่ | ๅ ถไปๅคๅ ้่ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 1 |+510000 | 801230 | ็ปผๅ | | | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 40 |+510100 | 801231 | ็ปผๅ | ็ปผๅโ ก | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 40 |+510101 | 852311 | ็ปผๅ | ็ปผๅโ ก | ็ปผๅโ ข | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 40 |+610000 | 801710 | ๅปบ็ญๆๆ | | | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 76 |+610100 | 801711 | ๅปบ็ญๆๆ | ๆฐดๆณฅ | | ไบ็บง่กไธ | 1 | 2021ๆนๅ | 25 |+610101 | 857111 | ๅปบ็ญๆๆ | ๆฐดๆณฅ | ๆฐดๆณฅๅถ้ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 18 |+610102 | 857112 | ๅปบ็ญๆๆ | ๆฐดๆณฅ | ๆฐดๆณฅๅถๅ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 7 |+610200 | 801712 | ๅปบ็ญๆๆ | ็ป็็ป็บค | | ไบ็บง่กไธ | 1 | 2021ๆนๅ | 16 |+610201 | 857121 | ๅปบ็ญๆๆ | ็ป็็ป็บค | ็ป็ๅถ้ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 9 |+610202 | 857122 | ๅปบ็ญๆๆ | ็ป็็ป็บค | ็ป็บคๅถ้ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 7 |+610300 | 801713 | ๅปบ็ญๆๆ | ่ฃ ไฟฎๅปบๆ | | ไบ็บง่กไธ | 1 | 2021ๆนๅ | 35 |+610301 | 850615 | ๅปบ็ญๆๆ | ่ฃ ไฟฎๅปบๆ | ่็ซๆๆ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 5 |+610302 | 850616 | ๅปบ็ญๆๆ | ่ฃ ไฟฎๅปบๆ | ็ฎกๆ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 8 |+610303 | 850614 | ๅปบ็ญๆๆ | ่ฃ ไฟฎๅปบๆ | ๅ ถไปๅปบๆ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 17 |+610304 | 850617 | ๅปบ็ญๆๆ | ่ฃ ไฟฎๅปบๆ | ้ฒๆฐดๆๆ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 3 |+610305 | 850618 | ๅปบ็ญๆๆ | ่ฃ ไฟฎๅปบๆ | ๆถๆ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 2 |+620000 | 801720 | ๅปบ็ญ่ฃ ้ฅฐ | | | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 147 |+620100 | 801721 | ๅปบ็ญ่ฃ ้ฅฐ | ๆฟๅฑๅปบ่ฎพโ ก | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 9 |+620101 | 850623 | ๅปบ็ญ่ฃ ้ฅฐ | ๆฟๅฑๅปบ่ฎพโ ก | ๆฟๅฑๅปบ่ฎพโ ข | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 9 |+620200 | 801722 | ๅปบ็ญ่ฃ ้ฅฐ | ่ฃ ไฟฎ่ฃ ้ฅฐโ ก | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 28 |+620201 | 857221 | ๅปบ็ญ่ฃ ้ฅฐ | ่ฃ ไฟฎ่ฃ ้ฅฐโ ก | ่ฃ ไฟฎ่ฃ ้ฅฐโ ข | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 28 |+620300 | 801723 | ๅปบ็ญ่ฃ ้ฅฐ | ๅบ็กๅปบ่ฎพ | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 46 |+620306 | 857236 | ๅปบ็ญ่ฃ ้ฅฐ | ๅบ็กๅปบ่ฎพ | ๅบๅปบๅธๆฟๅทฅ็จ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 23 |+620307 | 857251 | ๅปบ็ญ่ฃ ้ฅฐ | ๅบ็กๅปบ่ฎพ | ๅญๆๅทฅ็จ | ไธ็บง่กไธ | 1 | 2021ๆฟๆขไปฃ็ 620501 | 23 |+620400 | 801724 | ๅปบ็ญ่ฃ ้ฅฐ | ไธไธๅทฅ็จ | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 34 |+620401 | 857241 | ๅปบ็ญ่ฃ ้ฅฐ | ไธไธๅทฅ็จ | ้ข็ปๆ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 9 |+620402 | 857242 | ๅปบ็ญ่ฃ ้ฅฐ | ไธไธๅทฅ็จ | ๅๅญฆๅทฅ็จ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 7 |+620403 | 857243 | ๅปบ็ญ่ฃ ้ฅฐ | ไธไธๅทฅ็จ | ๅฝ้ ๅทฅ็จ | ไธ็บง่กไธ | 1 | 2021ๆนๅ | 5 |+620404 | 857244 | ๅปบ็ญ่ฃ ้ฅฐ | ไธไธๅทฅ็จ | ๅ ถไปไธไธๅทฅ็จ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 13 |+620600 | 801726 | ๅปบ็ญ่ฃ ้ฅฐ | ๅทฅ็จๅจ่ฏขๆๅกโ ก | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 30 |+620601 | 857261 | ๅปบ็ญ่ฃ ้ฅฐ | ๅทฅ็จๅจ่ฏขๆๅกโ ก | ๅทฅ็จๅจ่ฏขๆๅกโ ข | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 30 |+630000 | 801730 | ็ตๅ่ฎพๅค | | | ไธ็บง่กไธ | 1 | 2021ๆนๅ | 239 |+630100 | 801731 | ็ตๅ่ฎพๅค | ็ตๆบโ ก | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 19 |+630101 | 850741 | ็ตๅ่ฎพๅค | ็ตๆบโ ก | ็ตๆบโ ข | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 19 |+630300 | 801733 | ็ตๅ่ฎพๅค | ๅ ถไป็ตๆบ่ฎพๅคโ ก | | ไบ็บง่กไธ | 1 | 2021ๆนๅ | 25 |+630301 | 857331 | ็ตๅ่ฎพๅค | ๅ ถไป็ตๆบ่ฎพๅคโ ก | ็ปผๅ็ตๅ่ฎพๅคๅ | ไธ็บง่กไธ | 0 | 2021ไฟ็ | 3 |+630304 | 857334 | ็ตๅ่ฎพๅค | ๅ ถไป็ตๆบ่ฎพๅคโ ก | ็ซ็ต่ฎพๅค | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 6 |+630306 | 857336 | ็ตๅ่ฎพๅค | ๅ ถไป็ตๆบ่ฎพๅคโ ก | ๅ ถไป็ตๆบ่ฎพๅคโ ข | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 16 |+630500 | 801735 | ็ตๅ่ฎพๅค | ๅ ไผ่ฎพๅค | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 32 |+630501 | 857351 | ็ตๅ่ฎพๅค | ๅ ไผ่ฎพๅค | ็ก ๆ็ก ็ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 3 |+630502 | 857352 | ็ตๅ่ฎพๅค | ๅ ไผ่ฎพๅค | ๅ ไผ็ตๆฑ ็ปไปถ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 9 |+630503 | 857353 | ็ตๅ่ฎพๅค | ๅ ไผ่ฎพๅค | ้ๅๅจ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 3 |+630504 | 857354 | ็ตๅ่ฎพๅค | ๅ ไผ่ฎพๅค | ๅ ไผ่พ ๆ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 10 |+630505 | 857355 | ็ตๅ่ฎพๅค | ๅ ไผ่ฎพๅค | ๅ ไผๅ ๅทฅ่ฎพๅค | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 7 |+630600 | 801736 | ็ตๅ่ฎพๅค | ้ฃ็ต่ฎพๅค | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 18 |+630601 | 857361 | ็ตๅ่ฎพๅค | ้ฃ็ต่ฎพๅค | ้ฃ็ตๆดๆบ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 4 |+630602 | 857362 | ็ตๅ่ฎพๅค | ้ฃ็ต่ฎพๅค | ้ฃ็ต้ถ้จไปถ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 14 |+630700 | 801737 | ็ตๅ่ฎพๅค | ็ตๆฑ | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 41 |+630701 | 857371 | ็ตๅ่ฎพๅค | ็ตๆฑ | ้็ตๆฑ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 12 |+630702 | 857372 | ็ตๅ่ฎพๅค | ็ตๆฑ | ็ตๆฑ ๅๅญฆๅ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 17 |+630703 | 857373 | ็ตๅ่ฎพๅค | ็ตๆฑ | ้็ตไธ็จ่ฎพๅค | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 5 |+630704 | 857374 | ็ตๅ่ฎพๅค | ็ตๆฑ | ็ๆ็ตๆฑ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 0 |+630705 | 857375 | ็ตๅ่ฎพๅค | ็ตๆฑ | ่็ตๆฑ ๅๅ ถไป็ตๆฑ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 7 |+630800 | 801738 | ็ตๅ่ฎพๅค | ็ต็ฝ่ฎพๅค | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 104 |+630801 | 857381 | ็ตๅ่ฎพๅค | ็ต็ฝ่ฎพๅค | ่พๅ็ต่ฎพๅค | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 27 |+630802 | 857382 | ็ตๅ่ฎพๅค | ็ต็ฝ่ฎพๅค | ้ ็ต่ฎพๅค | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 16 |+630803 | 857321 | ็ตๅ่ฎพๅค | ็ต็ฝ่ฎพๅค | ็ต็ฝ่ชๅจๅ่ฎพๅค | ไธ็บง่กไธ | 1 | 2021ๆฟๆขไปฃ็ 630201 | 18 |+630804 | 857323 | ็ตๅ่ฎพๅค | ็ต็ฝ่ฎพๅค | ็ตๅทฅไปชๅจไปช่กจ | ไธ็บง่กไธ | 1 | 2021ๆฟๆขไปฃ็ -ๆนๅ630203 | 14 |+630805 | 857344 | ็ตๅ่ฎพๅค | ็ต็ฝ่ฎพๅค | ็บฟ็ผ้จไปถๅๅ ถไป | ไธ็บง่กไธ | 1 | 2021ๆฟๆขไปฃ็ 630204 | 29 |+640000 | 801890 | ๆบๆขฐ่ฎพๅค | | | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 379 |+640100 | 801072 | ๆบๆขฐ่ฎพๅค | ้็จ่ฎพๅค | | ไบ็บง่กไธ | 1 | 2021ๆนๅ | 161 |+640101 | 850711 | ๆบๆขฐ่ฎพๅค | ้็จ่ฎพๅค | ๆบๅบๅทฅๅ ท | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 13 |+640103 | 850713 | ๆบๆขฐ่ฎพๅค | ้็จ่ฎพๅค | ็ฃจๅ ท็ฃจๆ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 13 |+640105 | 850715 | ๆบๆขฐ่ฎพๅค | ้็จ่ฎพๅค | ๅถๅท็ฉบ่ฐ่ฎพๅค | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 12 |+640106 | 850716 | ๆบๆขฐ่ฎพๅค | ้็จ่ฎพๅค | ๅ ถไป้็จ่ฎพๅค | ไธ็บง่กไธ | 1 | 2021ๆนๅ | 31 |+640107 | 850731 | ๆบๆขฐ่ฎพๅค | ้็จ่ฎพๅค | ไปชๅจไปช่กจ | ไธ็บง่กไธ | 1 | 2021ๆฟๆขไปฃ็ 640301 | 32 |+640108 | 850751 | ๆบๆขฐ่ฎพๅค | ้็จ่ฎพๅค | ้ๅฑๅถๅ | ไธ็บง่กไธ | 1 | 2021ๆฟๆขไปฃ็ 640401 | 60 |+640200 | 801074 | ๆบๆขฐ่ฎพๅค | ไธ็จ่ฎพๅค | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 133 |+640203 | 850725 | ๆบๆขฐ่ฎพๅค | ไธ็จ่ฎพๅค | ่ฝๆบๅ้ๅ่ฎพๅค | ไธ็บง่กไธ | 1 | 2021ๆนๅ | 38 |+640204 | 850728 | ๆบๆขฐ่ฎพๅค | ไธ็จ่ฎพๅค | ๆฅผๅฎ่ฎพๅค | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 15 |+640206 | 850721 | ๆบๆขฐ่ฎพๅค | ไธ็จ่ฎพๅค | ็บบ็ปๆ่ฃ ่ฎพๅค | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 10 |+640207 | 850723 | ๆบๆขฐ่ฎพๅค | ไธ็จ่ฎพๅค | ๅ็จๆบๆขฐ | ไธ็บง่กไธ | 0 | 2021ไฟ็ | 3 |+640208 | 850726 | ๆบๆขฐ่ฎพๅค | ไธ็จ่ฎพๅค | ๅฐๅทๅ ่ฃ ๆบๆขฐ | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 9 |+640209 | 850727 | ๆบๆขฐ่ฎพๅค | ไธ็จ่ฎพๅค | ๅ ถไปไธ็จ่ฎพๅค | ไธ็บง่กไธ | 1 | 2021ๆนๅ | 58 |+640500 | 801076 | ๆบๆขฐ่ฎพๅค | ่ฝจไบค่ฎพๅคโ ก | | ไบ็บง่กไธ | 1 | 2021ๆนๅ | 21 |+640501 | 850936 | ๆบๆขฐ่ฎพๅค | ่ฝจไบค่ฎพๅคโ ก | ่ฝจไบค่ฎพๅคโ ข | ไธ็บง่กไธ | 1 | 2021ๆนๅ | 21 |+640600 | 801077 | ๆบๆขฐ่ฎพๅค | ๅทฅ็จๆบๆขฐ | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 21 |+640601 | 850771 | ๆบๆขฐ่ฎพๅค | ๅทฅ็จๆบๆขฐ | ๅทฅ็จๆบๆขฐๆดๆบ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 16 |+640602 | 850772 | ๆบๆขฐ่ฎพๅค | ๅทฅ็จๆบๆขฐ | ๅทฅ็จๆบๆขฐๅจไปถ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 5 |+640700 | 801078 | ๆบๆขฐ่ฎพๅค | ่ชๅจๅ่ฎพๅค | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 43 |+640701 | 850781 | ๆบๆขฐ่ฎพๅค | ่ชๅจๅ่ฎพๅค | ๆบๅจไบบ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 11 |+640702 | 850782 | ๆบๆขฐ่ฎพๅค | ่ชๅจๅ่ฎพๅค | ๅทฅๆง่ฎพๅค | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 17 |+640703 | 850783 | ๆบๆขฐ่ฎพๅค | ่ชๅจๅ่ฎพๅค | ๆฟๅ ่ฎพๅค | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 6 |+640704 | 850784 | ๆบๆขฐ่ฎพๅค | ่ชๅจๅ่ฎพๅค | ๅ ถไป่ชๅจๅ่ฎพๅค | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 9 |+650000 | 801740 | ๅฝ้ฒๅๅทฅ | | | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 97 |+650100 | 801741 | ๅฝ้ฒๅๅทฅ | ่ชๅคฉ่ฃ ๅคโ ก | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 8 |+650101 | 857411 | ๅฝ้ฒๅๅทฅ | ่ชๅคฉ่ฃ ๅคโ ก | ่ชๅคฉ่ฃ ๅคโ ข | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 8 |+650200 | 801742 | ๅฝ้ฒๅๅทฅ | ่ช็ฉบ่ฃ ๅคโ ก | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 35 |+650201 | 857421 | ๅฝ้ฒๅๅทฅ | ่ช็ฉบ่ฃ ๅคโ ก | ่ช็ฉบ่ฃ ๅคโ ข | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 35 |+650300 | 801743 | ๅฝ้ฒๅๅทฅ | ๅฐ้ขๅ ต่ฃ โ ก | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 9 |+650301 | 857431 | ๅฝ้ฒๅๅทฅ | ๅฐ้ขๅ ต่ฃ โ ก | ๅฐ้ขๅ ต่ฃ โ ข | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 9 |+650400 | 801744 | ๅฝ้ฒๅๅทฅ | ่ชๆตท่ฃ ๅคโ ก | | ไบ็บง่กไธ | 1 | 2021ๆนๅ | 12 |+650401 | 850935 | ๅฝ้ฒๅๅทฅ | ่ชๆตท่ฃ ๅคโ ก | ่ชๆตท่ฃ ๅคโ ข | ไธ็บง่กไธ | 1 | 2021ๆนๅ | 12 |+650500 | 801745 | ๅฝ้ฒๅๅทฅ | ๅๅทฅ็ตๅญโ ก | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 33 |+650501 | 857451 | ๅฝ้ฒๅๅทฅ | ๅๅทฅ็ตๅญโ ก | ๅๅทฅ็ตๅญโ ข | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 33 |+710000 | 801750 | ่ฎก็ฎๆบ | | | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 239 |+710100 | 801101 | ่ฎก็ฎๆบ | ่ฎก็ฎๆบ่ฎพๅค | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 64 |+710102 | 850702 | ่ฎก็ฎๆบ | ่ฎก็ฎๆบ่ฎพๅค | ๅฎ้ฒ่ฎพๅค | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 16 |+710103 | 850703 | ่ฎก็ฎๆบ | ่ฎก็ฎๆบ่ฎพๅค | ๅ ถไป่ฎก็ฎๆบ่ฎพๅค | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 48 |+710300 | 801103 | ่ฎก็ฎๆบ | ITๆๅกโ ก | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 90 |+710301 | 852226 | ่ฎก็ฎๆบ | ITๆๅกโ ก | ITๆๅกโ ข | ไธ็บง่กไธ | 1 | 2021ๆฟๆขไปฃ็ 710202 | 90 |+710400 | 801104 | ่ฎก็ฎๆบ | ่ฝฏไปถๅผๅ | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 85 |+710401 | 851041 | ่ฎก็ฎๆบ | ่ฝฏไปถๅผๅ | ๅ็ดๅบ็จ่ฝฏไปถ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 69 |+710402 | 851042 | ่ฎก็ฎๆบ | ่ฝฏไปถๅผๅ | ๆจชๅ้็จ่ฝฏไปถ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 16 |+720000 | 801760 | ไผ ๅช | | | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 149 |+720400 | 801764 | ไผ ๅช | ๆธธๆโ ก | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 38 |+720401 | 857641 | ไผ ๅช | ๆธธๆโ ก | ๆธธๆโ ข | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 38 |+720500 | 801765 | ไผ ๅช | ๅนฟๅ่ฅ้ | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 38 |+720501 | 857651 | ไผ ๅช | ๅนฟๅ่ฅ้ | ่ฅ้ไปฃ็ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 34 |+720502 | 857652 | ไผ ๅช | ๅนฟๅ่ฅ้ | ๅนฟๅๅชไฝ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 4 |+720600 | 801766 | ไผ ๅช | ๅฝฑ่ง้ข็บฟ | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 23 |+720601 | 857661 | ไผ ๅช | ๅฝฑ่ง้ข็บฟ | ๅฝฑ่งๅจๆผซๅถไฝ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 19 |+720602 | 857662 | ไผ ๅช | ๅฝฑ่ง้ข็บฟ | ้ข็บฟ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 4 |+720700 | 801767 | ไผ ๅช | ๆฐๅญๅชไฝ | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 11 |+720701 | 857671 | ไผ ๅช | ๆฐๅญๅชไฝ | ่ง้ขๅชไฝ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 2 |+720702 | 857672 | ไผ ๅช | ๆฐๅญๅชไฝ | ้ณ้ขๅชไฝ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 0 |+720703 | 857673 | ไผ ๅช | ๆฐๅญๅชไฝ | ๅพ็ๅชไฝ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 1 |+720704 | 857674 | ไผ ๅช | ๆฐๅญๅชไฝ | ้จๆท็ฝ็ซ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 7 |+720705 | 857675 | ไผ ๅช | ๆฐๅญๅชไฝ | ๆๅญๅชไฝ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 1 |+720706 | 857676 | ไผ ๅช | ๆฐๅญๅชไฝ | ๅ ถไปๆฐๅญๅชไฝ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 0 |+720800 | 801768 | ไผ ๅช | ็คพไบคโ ก | | ไบ็บง่กไธ | 0 | 2021ๆฐๅข | 0 |+720801 | 857681 | ไผ ๅช | ็คพไบคโ ก | ็คพไบคโ ข | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 0 |+720900 | 801769 | ไผ ๅช | ๅบ็ | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 27 |+720901 | 857691 | ไผ ๅช | ๅบ็ | ๆ่ฒๅบ็ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 10 |+720902 | 857692 | ไผ ๅช | ๅบ็ | ๅคงไผๅบ็ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 17 |+720903 | 857693 | ไผ ๅช | ๅบ็ | ๅ ถไปๅบ็ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 0 |+721000 | 801995 | ไผ ๅช | ็ต่งๅนฟๆญโ ก | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 12 |+721001 | 859951 | ไผ ๅช | ็ต่งๅนฟๆญโ ก | ็ต่งๅนฟๆญโ ข | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 12 |+730000 | 801770 | ้ไฟก | | | ไธ็บง่กไธ | 1 | 2021ไฟ็ | 100 |+730100 | 801223 | ้ไฟก | ้ไฟกๆๅก | | ไบ็บง่กไธ | 1 | 2021ๆนๅ | 34 |+730102 | 852212 | ้ไฟก | ้ไฟกๆๅก | ็ตไฟก่ฟ่ฅๅ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 4 |+730103 | 852213 | ้ไฟก | ้ไฟกๆๅก | ้ไฟกๅทฅ็จๅๆๅก | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 19 |+730104 | 852214 | ้ไฟก | ้ไฟกๆๅก | ้ไฟกๅบ็จๅขๅผๆๅก | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 11 |+730200 | 801102 | ้ไฟก | ้ไฟก่ฎพๅค | | ไบ็บง่กไธ | 1 | 2021ไฟ็ | 66 |+730204 | 851024 | ้ไฟก | ้ไฟก่ฎพๅค | ้ไฟก็ฝ็ป่ฎพๅคๅๅจไปถ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 24 |+730205 | 851025 | ้ไฟก | ้ไฟก่ฎพๅค | ้ไฟก็บฟ็ผๅ้ ๅฅ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 11 |+730206 | 851026 | ้ไฟก | ้ไฟก่ฎพๅค | ้ไฟก็ป็ซฏๅ้ ไปถ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 23 |+730207 | 851027 | ้ไฟก | ้ไฟก่ฎพๅค | ๅ ถไป้ไฟก่ฎพๅค | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 8 |+740000 | 801950 | ็ ค็ญ | | | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 38 |+740100 | 801951 | ็ ค็ญ | ็ ค็ญๅผ้ | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 29 |+740101 | 859511 | ็ ค็ญ | ็ ค็ญๅผ้ | ๅจๅ็ ค | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 18 |+740102 | 859512 | ็ ค็ญ | ็ ค็ญๅผ้ | ็ฆ็ ค | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 11 |+740200 | 801952 | ็ ค็ญ | ็ฆ็ญโ ก | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 9 |+740201 | 859521 | ็ ค็ญ | ็ฆ็ญโ ก | ็ฆ็ญโ ข | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 9 |+750000 | 801960 | ็ณๆฒน็ณๅ | | | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 47 |+750100 | 801961 | ็ณๆฒน็ณๅ | ๆฒนๆฐๅผ้โ ก | | ไบ็บง่กไธ | 0 | 2021ๆฐๅข | 4 |+750101 | 859611 | ็ณๆฒน็ณๅ | ๆฒนๆฐๅผ้โ ก | ๆฒนๆฐๅผ้โ ข | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 4 |+750200 | 801962 | ็ณๆฒน็ณๅ | ๆฒนๆๅทฅ็จ | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 14 |+750201 | 859621 | ็ณๆฒน็ณๅ | ๆฒนๆๅทฅ็จ | ๆฒน็ฐๆๅก | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 7 |+750202 | 859622 | ็ณๆฒน็ณๅ | ๆฒนๆๅทฅ็จ | ๆฒนๆฐๅ็ผๅๅทฅ็จ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 7 |+750300 | 801963 | ็ณๆฒน็ณๅ | ็ผๅๅ่ดธๆ | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 29 |+750301 | 859631 | ็ณๆฒน็ณๅ | ็ผๅๅ่ดธๆ | ็ผๆฒนๅๅทฅ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 9 |+750302 | 859632 | ็ณๆฒน็ณๅ | ็ผๅๅ่ดธๆ | ๆฒนๅ็ณๅ่ดธๆ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 6 |+750303 | 859633 | ็ณๆฒน็ณๅ | ็ผๅๅ่ดธๆ | ๅ ถไป็ณๅ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 14 |+760000 | 801970 | ็ฏไฟ | | | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 97 |+760100 | 801971 | ็ฏไฟ | ็ฏๅขๆฒป็ | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 82 |+760101 | 859711 | ็ฏไฟ | ็ฏๅขๆฒป็ | ๅคงๆฐๆฒป็ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 8 |+760102 | 859712 | ็ฏไฟ | ็ฏๅขๆฒป็ | ๆฐดๅกๅๆฐดๆฒป็ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 40 |+760103 | 859713 | ็ฏไฟ | ็ฏๅขๆฒป็ | ๅบๅบๆฒป็ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 23 |+760104 | 859714 | ็ฏไฟ | ็ฏๅขๆฒป็ | ็ปผๅ็ฏๅขๆฒป็ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 11 |+760200 | 801972 | ็ฏไฟ | ็ฏไฟ่ฎพๅคโ ก | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 15 |+760201 | 859721 | ็ฏไฟ | ็ฏไฟ่ฎพๅคโ ก | ็ฏไฟ่ฎพๅคโ ข | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 15 |+770000 | 801980 | ็พๅฎนๆค็ | | | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 27 |+770100 | 801981 | ็พๅฎนๆค็ | ไธชๆค็จๅ | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 12 |+770101 | 859811 | ็พๅฎนๆค็ | ไธชๆค็จๅ | ็ๆดป็จ็บธ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 8 |+770102 | 859812 | ็พๅฎนๆค็ | ไธชๆค็จๅ | ๆดๆค็จๅ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 4 |+770200 | 801982 | ็พๅฎนๆค็ | ๅๅฆๅ | | ไบ็บง่กไธ | 1 | 2021ๆฐๅข | 13 |+770201 | 859821 | ็พๅฎนๆค็ | ๅๅฆๅ | ๅๅฆๅๅถ้ ๅๅ ถไป | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 7 |+770202 | 859822 | ็พๅฎนๆค็ | ๅๅฆๅ | ๅ็ๅๅฆๅ | ไธ็บง่กไธ | 1 | 2021ๆฐๅข | 6 |+770300 | 801983 | ็พๅฎนๆค็ | ๅป็็พๅฎน | | ไบ็บง่กไธ | 0 | 2021ๆฐๅข | 2 |+770301 | 859831 | ็พๅฎนๆค็ | ๅป็็พๅฎน | ๅป็พ่ๆ | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 1 |+770302 | 859832 | ็พๅฎนๆค็ | ๅป็็พๅฎน | ๅป็พๆๅก | ไธ็บง่กไธ | 0 | 2021ๆฐๅข | 1 |++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+index_code | str | N | ๆๆฐไปฃ็ +level | str | N | ่กไธๅ็บง๏ผL1/L2/L3๏ผ+parent_code | str | N | ็ถ็บงไปฃ็ ๏ผไธ็บงไธบ0๏ผ+src | str | N | ๆๆฐๆฅๆบ๏ผSW2014๏ผ็ณไธ2014ๅนด็ๆฌ๏ผSW2021๏ผ็ณไธ2021ๅนด็ๆฌ๏ผ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+index_code | str | Y | ๆๆฐไปฃ็ +industry_name | str | Y | ่กไธๅ็งฐ+parent_code | str | Y | ็ถ็บงไปฃ็ +level | str | Y | ่กไธๅฑ็บง+industry_code | str | Y | ่กไธไปฃ็ +is_pub | str | Y | ๆฏๅฆๅๅธไบๆๆฐ+src | str | N | ่กไธๅ็ฑป๏ผSW็ณไธ๏ผ++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++#่ทๅ็ณไธไธ็บง่กไธๅ่กจ+df = pro.index_classify(level='L1', src='SW2021')++#่ทๅ็ณไธไบ็บง่กไธๅ่กจ+df = pro.index_classify(level='L2', src='SW2021')++#่ทๅ็ณไธไธ็บง็บง่กไธๅ่กจ+df = pro.index_classify(level='L3', src='SW2021')++```+++<br>+<br>++**ๆฐๆฎ็คบไพ**++ index_code industry_name level+ 0 801020.SI ้ๆ L1+ 1 801030.SI ๅๅทฅ L1+ 2 801040.SI ้ข้ L1+ 3 801050.SI ๆ่ฒ้ๅฑ L1+ 4 801710.SI ๅปบ็ญๆๆ L1+ 5 801720.SI ๅปบ็ญ่ฃ ้ฅฐ L1+ 6 801730.SI ็ตๆฐ่ฎพๅค L1+ 7 801890.SI ๆบๆขฐ่ฎพๅค L1+ 8 801740.SI ๅฝ้ฒๅๅทฅ L1+ 9 801880.SI ๆฑฝ่ฝฆ L1+ 10 801110.SI ๅฎถ็จ็ตๅจ L1+ 11 801130.SI ็บบ็ปๆ่ฃ L1+ 12 801140.SI ่ฝปๅทฅๅถ้ L1+ 13 801200.SI ๅไธ่ดธๆ L1+ 14 801010.SI ๅๆ็งๆธ L1+ 15 801120.SI ้ฃๅ้ฅฎๆ L1+ 16 801210.SI ไผ้ฒๆๅก L1+ 17 801150.SI ๅป่ฏ็็ฉ L1+ 18 801160.SI ๅ ฌ็จไบไธ L1+ 19 801170.SI ไบค้่ฟ่พ L1+ 20 801180.SI ๆฟๅฐไบง L1+ 21 801080.SI ็ตๅญ L1+ 22 801750.SI ่ฎก็ฎๆบ L1+ 23 801760.SI ไผ ๅช L1+ 24 801770.SI ้ไฟก L1+ 25 801780.SI ้ถ่ก L1+ 26 801790.SI ้้ถ้่ L1+ 27 801230.SI ็ปผๅ L1++++++diff --git "a/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\347\224\263\344\270\207\350\241\214\344\270\232\346\210\220\345\210\206(\345\210\206\347\272\247).md" "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\347\224\263\344\270\207\350\241\214\344\270\232\346\210\220\345\210\206(\345\210\206\347\272\247).md"new file mode 100644index 000000000..743bfcd1b--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\347\224\263\344\270\207\350\241\214\344\270\232\346\210\220\345\210\206(\345\210\206\347\272\247).md"@@ -0,0 +1,82 @@+## ็ณไธ่กไธๆๅๆๆ(ๅ็บง)+----++ๆฅๅฃ๏ผindex_member_all+ๆ่ฟฐ๏ผๆไธ็บงๅ็ฑปๆๅ็ณไธ่กไธๆๅ๏ผๅฏๆไพๆไธชๅ็ฑป็ๆๆๆๅ๏ผไนๅฏๆ่ก็ฅจไปฃ็ ๆๅๆๅฑๅ็ฑป๏ผๅๆฐ็ตๆดป+้้๏ผๅๆฌกๆๅคง2000่ก๏ผๆป้ไธ้ๅถ+ๆ้๏ผ็จๆท้2000็งฏๅๅฏ่ฐๅ๏ผ็งฏๅ่ทๅๆนๆณ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+l1_code | str | N | ไธ็บง่กไธไปฃ็ +l2_code | str | N | ไบ็บง่กไธไปฃ็ +l3_code | str | N | ไธ็บง่กไธไปฃ็ +ts_code | str | N | ่ก็ฅจไปฃ็ +is_new | str | N | ๆฏๅฆๆๆฐ๏ผ้ป่ฎคไธบโYๆฏโ๏ผ+++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+l1_code | str | Y | ไธ็บง่กไธไปฃ็ +l1_name | str | Y | ไธ็บง่กไธๅ็งฐ+l2_code | str | Y | ไบ็บง่กไธไปฃ็ +l2_name | str | Y | ไบ็บง่กไธๅ็งฐ+l3_code | str | Y | ไธ็บง่กไธไปฃ็ +l3_name | str | Y | ไธ็บง่กไธๅ็งฐ+ts_code | str | Y | ๆๅ่ก็ฅจไปฃ็ +name | str | Y | ๆๅ่ก็ฅจๅ็งฐ+in_date | str | Y | ็บณๅ ฅๆฅๆ+out_date | str | Y | ๅ้คๆฅๆ+is_new | str | Y | ๆฏๅฆๆๆฐYๆฏNๅฆ++<br>+<br>+++**ๆฅๅฃ็คบไพ**++```python++#่ทๅ้ป้ๅ็ฑป็ๆไปฝ่ก+df = pro.index_member_all(l3_code='850531.SI')++#่ทๅ000001.SZๆๅฑ่กไธ+df = pro.index_member_all(ts_code='000001.SZ')++```+++<br>+<br>++**ๆฐๆฎ็คบไพ**++ l1_code l1_name l2_code l2_name l3_code l3_name ts_code name in_date+ 0 801050.SI ๆ่ฒ้ๅฑ 801053.SI ่ดต้ๅฑ 850531.SI ้ป้ 000506.SZ *STไธญๆถฆ 20220729+ 1 801050.SI ๆ่ฒ้ๅฑ 801053.SI ่ดต้ๅฑ 850531.SI ้ป้ 001337.SZ ๅๅท้ป้ 20230224+ 2 801050.SI ๆ่ฒ้ๅฑ 801053.SI ่ดต้ๅฑ 850531.SI ้ป้ 600988.SH ่ตคๅณฐ้ป้ 20040414+ 3 801050.SI ๆ่ฒ้ๅฑ 801053.SI ่ดต้ๅฑ 850531.SI ้ป้ 600489.SH ไธญ้้ป้ 20030812+ 4 801050.SI ๆ่ฒ้ๅฑ 801053.SI ่ดต้ๅฑ 850531.SI ้ป้ 600547.SH ๅฑฑไธ้ป้ 20030826+ 5 801050.SI ๆ่ฒ้ๅฑ 801053.SI ่ดต้ๅฑ 850531.SI ้ป้ 002155.SZ ๆนๅ้ป้ 20070815+ 6 801050.SI ๆ่ฒ้ๅฑ 801053.SI ่ดต้ๅฑ 850531.SI ้ป้ 002237.SZ ๆ้ฆ่กไปฝ 20080428+ 7 801050.SI ๆ่ฒ้ๅฑ 801053.SI ่ดต้ๅฑ 850531.SI ้ป้ 601069.SH ่ฅฟ้จ้ป้ 20150115+ 8 801050.SI ๆ่ฒ้ๅฑ 801053.SI ่ดต้ๅฑ 850531.SI ้ป้ 000975.SZ ้ถๆณฐ้ป้ 20190724+ 9 801050.SI ๆ่ฒ้ๅฑ 801053.SI ่ดต้ๅฑ 850531.SI ้ป้ 300139.SZ ๆ็จ็งๆ 20220729+ 10 801050.SI ๆ่ฒ้ๅฑ 801053.SI ่ดต้ๅฑ 850531.SI ้ป้ 600687.SH ้ๅธๅๆณฐ(้ๅธ) 20130701+ 11 801050.SI ๆ่ฒ้ๅฑ 801053.SI ่ดต้ๅฑ 850531.SI ้ป้ 600807.SH ๆตๅ้ซๆฐ 20220729+ 12 801050.SI ๆ่ฒ้ๅฑ 801053.SI ่ดต้ๅฑ 850531.SI ้ป้ 600311.SH *ST่ฃๅ(้ๅธ) 20140102+++++\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\347\224\263\344\270\207\350\241\214\344\270\232\346\214\207\346\225\260\346\227\245\350\241\214\346\203\205.md" "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\347\224\263\344\270\207\350\241\214\344\270\232\346\214\207\346\225\260\346\227\245\350\241\214\346\203\205.md"new file mode 100644index 000000000..a81a479f5--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\214\207\346\225\260\344\270\223\351\242\230/\347\224\263\344\270\207\350\241\214\344\270\232\346\214\207\346\225\260\346\227\245\350\241\214\346\203\205.md"@@ -0,0 +1,73 @@+## ็ณไธ่กไธๆฅ็บฟ่กๆ+----++ๆฅๅฃ๏ผsw_daily+ๆ่ฟฐ๏ผ่ทๅ็ณไธ่กไธๆฅ็บฟ่กๆ ๏ผ้ป่ฎคๆฏ็ณไธ2021็่กๆ ๏ผ+้้๏ผๅๆฌกๆๅคง4000่กๆฐๆฎ๏ผๅฏ้่ฟๆๆฐไปฃ็ ๅๆฅๆๅๆฐๅพช็ฏๆๅ๏ผ5000็งฏๅๅฏ่ฐๅ+++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่กไธไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ๆๆฐไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+name | str | Y | ๆๆฐๅ็งฐ+open | float | Y | ๅผ็็นไฝ+low | float | Y | ๆไฝ็นไฝ+high | float | Y | ๆ้ซ็นไฝ+close | float | Y | ๆถ็็นไฝ+change | float | Y | ๆถจ่ท็นไฝ+pct_change | float | Y | ๆถจ่ทๅน+vol | float | Y | ๆไบค้๏ผไธ่ก๏ผ+amount | float | Y | ๆไบค้ข๏ผไธๅ ๏ผ+pe | float | Y | ๅธ็็+pb | float | Y | ๅธๅ็+float_mv | float | Y | ๆต้ๅธๅผ๏ผไธๅ ๏ผ+total_mv | float | Y | ๆปๅธๅผ๏ผไธๅ ๏ผ+++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api('your token')++#่ทๅ20230705ๅฝๆฅๆๆ็ณไธ่กไธๆๆฐ็ts_code,name,open,close,vol,pe,pbๆฐๆฎ+df = pro.sw_daily(trade_date='20230705', fields='ts_code,name,open,close,vol,pe,pb')++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code name open close vol pe pb+ 0 801001.SI ็ณไธ50 2972.86 2946.53 275984.00 13.99 1.91+ 1 801002.SI ็ณไธไธญๅฐ 6963.37 6896.69 1540720.00 21.19 2.47+ 2 801003.SI ็ณไธ๏ผกๆ 3793.91 3769.63 6294567.00 16.56 1.78+ 3 801005.SI ็ณไธๅไธ 2841.32 2815.48 1220719.00 35.90 3.72+ 4 801010.SI ๅๆ็งๆธ 2986.75 2946.60 83532.00 28.32 2.66+ .. ... ... ... ... ... ... ...+ 434 859811.SI ็ๆดป็จ็บธ 1438.09 1418.16 2542.00 23.25 2.32+ 435 859821.SI ๅๅฆๅๅถ้ ๅๅ ถไป 2674.85 2674.57 2069.00 40.63 2.33+ 436 859822.SI ๅ็ๅๅฆๅ 12094.45 11877.03 2809.00 44.55 5.52+ 437 859852.SI ๅน่ฎญๆ่ฒ 780.30 770.10 20889.00 106.12 5.73+ 438 859951.SI ็ต่งๅนฟๆญโ ข 1121.00 1122.06 24413.00 51.46 1.05\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\346\234\237\346\235\203\346\225\260\346\215\256/\346\234\237\346\235\203\345\210\206\351\222\237\350\241\214\346\203\205.md" "b/agent/src/skills/tushare/references/\346\234\237\346\235\203\346\225\260\346\215\256/\346\234\237\346\235\203\345\210\206\351\222\237\350\241\214\346\203\205.md"new file mode 100644index 000000000..7448a039b--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\234\237\346\235\203\346\225\260\346\215\256/\346\234\237\346\235\203\345\210\206\351\222\237\350\241\214\346\203\205.md"@@ -0,0 +1,85 @@+## ๆๆๅๅฒๅ้่กๆ+----++ๆฅๅฃ๏ผopt_mins+ๆ่ฟฐ๏ผ่ทๅๅ จๅธๅบๆๆๅ็บฆๅ้ๆฐๆฎ๏ผๆฏๆ1min/5min/15min/30min/60min่กๆ ๏ผๆไพPython SDKๅ http Restful APIไธค็งๆนๅผใ+้้๏ผๅๆฌกๆๅคง8000่กๆฐๆฎ๏ผๅฏไปฅ้่ฟๅ็บฆไปฃ็ ๅๆถ้ดๅพช็ฏ่ทๅใ+ๆ้๏ผ120็งฏๅๅฏไปฅ่ฐๅ2ๆฌกๆฅๅฃๆฅ็ๆฐๆฎ๏ผๆญฃๅผๆ้่ฏทๅ้ <u>[ๆ้่ฏดๆ](https://tushare.pro/document/1?doc_id=290) </u> ใ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ ๏ผe.g๏ผ10007976.SH+freq | str | Y | ๅ้้ขๅบฆ๏ผ1min/5min/15min/30min/60min๏ผ+start_date | datetime | N | ๅผๅงๆฅๆ ๆ ผๅผ๏ผ2024-08-25 09:00:00+end_date | datetime | N | ็ปๆๆถ้ด ๆ ผๅผ๏ผ2024-08-25 19:00:00++<br>+<br>+++**freqๅๆฐ่ฏดๆ**++freq | ่ฏดๆ+--- | ----+1min | 1ๅ้+5min | 5ๅ้+15min | 15ๅ้+30min | 30ๅ้+60min | 60ๅ้++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +trade_time | str | Y | ไบคๆๆถ้ด+open | float | Y | ๅผ็ไปท+close | float | Y | ๆถ็ไปท+high | float | Y | ๆ้ซไปท+low | float | Y | ๆไฝไปท+vol | int | Y | ๆไบค้+amount | float | Y | ๆไบค้้ข+oi | float | Y | ๆไป้++<br>+<br>++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++df = pro.df = pro.opt_mins(ts_code='10007976.SH', freq='1min', start_date='2024-09-27 09:00:00', end_date='2024-09-27 19:00:00')++```++<br>+<br>+++**ๆฐๆฎๆ ทไพ**+++ ts_code trade_time open close high low vol amount oi+ 0 10007976.SH 2024-09-27T15:00:00 0.1267 0.1370 0.1370 0.1267 44.0 60280.0 6499.0+ 1 10007976.SH 2024-09-27T14:59:00 0.1267 0.1267 0.1267 0.1267 0.0 0.0 6480.0+ 2 10007976.SH 2024-09-27T14:58:00 0.1267 0.1267 0.1267 0.1267 0.0 0.0 6480.0+ 3 10007976.SH 2024-09-27T14:57:00 0.1207 0.1267 0.1267 0.1207 25.0 31585.0 6480.0+ 4 10007976.SH 2024-09-27T14:56:00 0.1199 0.1207 0.1235 0.1194 259.0 312561.0 6464.0+ .. ... ... ... ... ... ... ... ... ...+ 236 10007976.SH 2024-09-27T09:34:00 0.0386 0.0386 0.0386 0.0386 0.0 0.0 86.0+ 237 10007976.SH 2024-09-27T09:33:00 0.0386 0.0386 0.0386 0.0386 0.0 0.0 86.0+ 238 10007976.SH 2024-09-27T09:32:00 0.0352 0.0386 0.0386 0.0348 6.0 2224.0 86.0+ 239 10007976.SH 2024-09-27T09:31:00 0.0261 0.0352 0.0368 0.0261 76.0 24668.0 80.0+ 240 10007976.SH 2024-09-27T09:30:00 0.0254 0.0254 0.0254 0.0254 4.0 1016.0 4.0++diff --git "a/agent/src/skills/tushare/references/\346\234\237\346\235\203\346\225\260\346\215\256/\346\234\237\346\235\203\345\220\210\347\272\246\344\277\241\346\201\257.md" "b/agent/src/skills/tushare/references/\346\234\237\346\235\203\346\225\260\346\215\256/\346\234\237\346\235\203\345\220\210\347\272\246\344\277\241\346\201\257.md"new file mode 100644index 000000000..12349f162--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\234\237\346\235\203\346\225\260\346\215\256/\346\234\237\346\235\203\345\220\210\347\272\246\344\277\241\346\201\257.md"@@ -0,0 +1,86 @@+## ๆๆๅ็บฆไฟกๆฏ+----++ๆฅๅฃ๏ผopt_basic+ๆ่ฟฐ๏ผ่ทๅๆๆๅ็บฆไฟกๆฏ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ5000็งฏๅๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | TSๆๆไปฃ็ +exchange | str | N | ไบคๆๆไปฃ็ ๏ผๅ ๆฌไธไบคๆSSE็ญ[ไบคๆๆ](https://tushare.pro/document/2?doc_id=157)๏ผ+list_date | str | N | ไธๅธไบคๆๆฅ+opt_code | str | N | ๆ ๅๅ็บฆไปฃ็ ๏ผOP+ๆ่ดงๅ็บฆTS_CODE๏ผๅฆๆฃๆฆๆฒน2207ๅ็บฆ๏ผ่พๅ ฅOPP2207.DCE+call_put | str | N | ๆๆ็ฑปๅ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | TSไปฃ็ +exchange | str | Y | ไบคๆๅธๅบ+name | str | Y | ๅ็บฆๅ็งฐ+per_unit | str | Y | ๅ็บฆๅไฝ+opt_code | str | Y | ๆ ็ๅ็บฆไปฃ็ +opt_type | str | Y | ๅ็บฆ็ฑปๅ+call_put | str | Y | ๆๆ็ฑปๅ+exercise_type | str | Y | ่กๆๆนๅผ+exercise_price | float | Y | ่กๆไปทๆ ผ+s_month | str | Y | ็ป็ฎๆ+maturity_date | str | Y | ๅฐๆๆฅ+list_price | float | Y | ๆ็ๅบๅไปท+list_date | str | Y | ๅผๅงไบคๆๆฅๆ+delist_date | str | Y | ๆๅไบคๆๆฅๆ+last_edate | str | Y | ๆๅ่กๆๆฅๆ+last_ddate | str | Y | ๆๅไบคๅฒๆฅๆ+quote_unit | str | Y | ๆฅไปทๅไฝ+min_price_chg | str | Y | ๆๅฐไปทๆ ผๆณขๅน++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api('your token')++df = pro.opt_basic(exchange='DCE', fields='ts_code,name,exercise_type,list_date,delist_date')++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code name exercise_type list_date delist_date+ 0 M1707-C-2400.DCE ่ฑ็ฒๆๆ1707่ฎค่ดญ2400 ็พๅผ 20170605 20170607+ 1 M1707-P-2400.DCE ่ฑ็ฒๆๆ1707่ฎคๆฒฝ2400 ็พๅผ 20170605 20170607+ 2 M1803-P-2550.DCE ่ฑ็ฒๆๆ1803่ฎคๆฒฝ2550 ็พๅผ 20170407 20180207+ 3 M1707-C-2500.DCE ่ฑ็ฒๆๆ1707่ฎค่ดญ2500 ็พๅผ 20170410 20170607+ 4 M1707-P-2500.DCE ่ฑ็ฒๆๆ1707่ฎคๆฒฝ2500 ็พๅผ 20170410 20170607+ 5 M1803-C-2550.DCE ่ฑ็ฒๆๆ1803่ฎค่ดญ2550 ็พๅผ 20170407 20180207+ 6 M1808-C-3550.DCE ่ฑ็ฒๆๆ1808่ฎค่ดญ3550 ็พๅผ 20180409 20180706+ 7 M1808-P-3550.DCE ่ฑ็ฒๆๆ1808่ฎคๆฒฝ3550 ็พๅผ 20180409 20180706+ 8 M1809-C-3550.DCE ่ฑ็ฒๆๆ1809่ฎค่ดญ3550 ็พๅผ 20180409 20180807+ 9 M1809-P-3550.DCE ่ฑ็ฒๆๆ1809่ฎคๆฒฝ3550 ็พๅผ 20180409 20180807+ 10 M1811-C-3550.DCE ่ฑ็ฒๆๆ1811่ฎค่ดญ3550 ็พๅผ 20180409 20181012+ 11 M1811-P-3550.DCE ่ฑ็ฒๆๆ1811่ฎคๆฒฝ3550 ็พๅผ 20180409 20181012+ 12 M1812-C-3500.DCE ่ฑ็ฒๆๆ1812่ฎค่ดญ3500 ็พๅผ 20180409 20181107+ 13 M1812-C-3550.DCE ่ฑ็ฒๆๆ1812่ฎค่ดญ3550 ็พๅผ 20180409 20181107+ 14 M1711-P-2450.DCE ่ฑ็ฒๆๆ1711่ฎคๆฒฝ2450 ็พๅผ 20170601 20171013+ 15 M1712-C-2450.DCE ่ฑ็ฒๆๆ1712่ฎค่ดญ2450 ็พๅผ 20170601 20171107+ 16 M1712-P-2450.DCE ่ฑ็ฒๆๆ1712่ฎคๆฒฝ2450 ็พๅผ 20170601 20171107+ 17 M1801-C-2450.DCE ่ฑ็ฒๆๆ1801่ฎค่ดญ2450 ็พๅผ 20170601 20171207+ 18 M1801-P-2450.DCE ่ฑ็ฒๆๆ1801่ฎคๆฒฝ2450 ็พๅผ 20170601 20171207+ 19 M1803-C-2450.DCE ่ฑ็ฒๆๆ1803่ฎค่ดญ2450 ็พๅผ 20170601 20180207+ 20 M1803-P-2450.DCE ่ฑ็ฒๆๆ1803่ฎคๆฒฝ2450 ็พๅผ 20170601 20180207\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\346\234\237\346\235\203\346\225\260\346\215\256/\346\234\237\346\235\203\346\227\245\347\272\277\350\241\214\346\203\205.md" "b/agent/src/skills/tushare/references/\346\234\237\346\235\203\346\225\260\346\215\256/\346\234\237\346\235\203\346\227\245\347\272\277\350\241\214\346\203\205.md"new file mode 100644index 000000000..6a191e306--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\234\237\346\235\203\346\225\260\346\215\256/\346\234\237\346\235\203\346\227\245\347\272\277\350\241\214\346\203\205.md"@@ -0,0 +1,73 @@+## ๆๆๆฅ็บฟ่กๆ+----++ๆฅๅฃ๏ผopt_daily+ๆ่ฟฐ๏ผ่ทๅๆๆๆฅ็บฟ่กๆ+้้๏ผๅๆฌกๆๅคง15000ๆกๆฐๆฎ๏ผๅฏ่ท่ฟๆฅ็บฟๆ่ ไปฃ็ ๅพช็ฏ๏ผๆป้ไธ้ๅถ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผไฝๆๆต้ๆงๅถ๏ผ่ฏท่ช่กๆ้ซ็งฏๅ๏ผ็งฏๅ่ถๅคๆ้่ถๅคง๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | TSๅ็บฆไปฃ็ ๏ผ่พๅ ฅไปฃ็ ๆๆถ้ด่ณๅฐไปปๆไธไธชๅๆฐ๏ผ+trade_date | str | N | ไบคๆๆฅๆ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+exchange | str | N | ไบคๆๆ(SSE/SZSE/CFFEX/DCE/SHFE/CZCE๏ผ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | TSไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+exchange | str | Y | ไบคๆๅธๅบ+pre_settle | float | Y | ๆจ็ป็ฎไปท+pre_close | float | Y | ๅๆถ็ไปท+open | float | Y | ๅผ็ไปท+high | float | Y | ๆ้ซไปท+low | float | Y | ๆไฝไปท+close | float | Y | ๆถ็ไปท+settle | float | Y | ็ป็ฎไปท+vol | float | Y | ๆไบค้(ๆ)+amount | float | Y | ๆไบค้้ข(ไธๅ )+oi | float | Y | ๆไป้(ๆ)++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api('your token')++df = pro.opt_daily(trade_date='20181212')++```++<br>+<br>++**ๆฐๆฎ็คบไพ**+++ ts_code trade_date exchange ... vol amount oi+ 0 10001313.SH 20181212 SSE ... 38354.0 1261.435472 98882.0+ 1 10001314.SH 20181212 SSE ... 14472.0 234.933288 79980.0+ 2 10001315.SH 20181212 SSE ... 10092.0 69.311776 72370.0+ 3 10001316.SH 20181212 SSE ... 5434.0 16.107224 55117.0+ 4 10001317.SH 20181212 SSE ... 4240.0 5.798919 61746.0+ .. ... ... ... ... ... ... ...+ 753 M1911-P-2900.DCE 20181212 DCE ... 0.0 0.000000 20.0+ 754 M1911-P-2950.DCE 20181212 DCE ... 0.0 0.000000 20.0+ 755 M1911-P-3000.DCE 20181212 DCE ... 0.0 0.000000 20.0+ 756 M1911-P-3050.DCE 20181212 DCE ... 0.0 0.000000 20.0+ 757 M1911-P-3100.DCE 20181212 DCE ... 0.0 0.000000 0.0\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\344\272\244\346\230\223\346\227\245\345\216\206.md" "b/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\344\272\244\346\230\223\346\227\245\345\216\206.md"new file mode 100644index 000000000..c0e01083c--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\344\272\244\346\230\223\346\227\245\345\216\206.md"@@ -0,0 +1,108 @@+## ไบคๆๆฅๅ+----++ๆฅๅฃ๏ผtrade_cal+ๆ่ฟฐ๏ผ่ทๅๅๅคงๆ่ดงไบคๆๆไบคๆๆฅๅๆฐๆฎ+็งฏๅ๏ผ้2000็งฏๅๆๅฏไปฅๆๅๆฐๆฎ++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+exchange | str | N | ไบคๆๆ SHFE ไธๆๆ DCE ๅคงๅๆ CFFEXไธญ้ๆ CZCE้ๅๆ INEไธๆตทๅฝ้ ่ฝๆบไบคๆๆ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+is_open | int | N | ๆฏๅฆไบคๆ 0ไผๅธ 1ไบคๆ++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+exchange | str | Y | ไบคๆๆ ๅๅๆฐ้จๅๆ่ฟฐ+cal_date | str | Y | ๆฅๅๆฅๆ+is_open | int | Y | ๆฏๅฆไบคๆ 0ไผๅธ 1ไบคๆ+pretrade_date | str | N | ไธไธไธชไบคๆๆฅ++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api('your token')+++df = pro.trade_cal(exchange='DCE', start_date='20180101', end_date='20181231')++```++ๆ่++```python++df = pro.query('trade_cal', exchange='DCE', start_date='20180101', end_date='20181231')++```++**ๆฐๆฎๆ ทไพ**++ exchange cal_date is_open+ 0 DCE 20180101 0+ 1 DCE 20180102 1+ 2 DCE 20180103 1+ 3 DCE 20180104 1+ 4 DCE 20180105 1+ 5 DCE 20180106 0+ 6 DCE 20180107 0+ 7 DCE 20180108 1+ 8 DCE 20180109 1+ 9 DCE 20180110 1+ 10 DCE 20180111 1+ 11 DCE 20180112 1+ 12 DCE 20180113 0+ 13 DCE 20180114 0+ 14 DCE 20180115 1+ 15 DCE 20180116 1+ 16 DCE 20180117 1+ 17 DCE 20180118 1+ 18 DCE 20180119 1+ 19 DCE 20180120 0+ 20 DCE 20180121 0+ 21 DCE 20180122 1+ 22 DCE 20180123 1+ 23 DCE 20180124 1+ 24 DCE 20180125 1+ 25 DCE 20180126 1+ 26 DCE 20180127 0+ 27 DCE 20180128 0+ 28 DCE 20180129 1+ 29 DCE 20180130 1+ .. ... ... ...+ 335 DCE 20181202 0+ 336 DCE 20181203 1+ 337 DCE 20181204 1+ 338 DCE 20181205 1+ 339 DCE 20181206 1+ 340 DCE 20181207 1+ 341 DCE 20181208 0+ 342 DCE 20181209 0+ 343 DCE 20181210 1+ 344 DCE 20181211 1+ 345 DCE 20181212 1+ 346 DCE 20181213 1+ 347 DCE 20181214 1+ 348 DCE 20181215 0+ 349 DCE 20181216 0+ 350 DCE 20181217 1+ 351 DCE 20181218 1+ 352 DCE 20181219 1+ 353 DCE 20181220 1+ 354 DCE 20181221 1+ 355 DCE 20181222 0+ 356 DCE 20181223 0+ 357 DCE 20181224 1+ 358 DCE 20181225 1+ 359 DCE 20181226 1+ 360 DCE 20181227 1+ 361 DCE 20181228 1+ 362 DCE 20181229 0+ 363 DCE 20181230 0+ 364 DCE 20181231 1\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\344\273\223\345\215\225\346\227\245\346\212\245.md" "b/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\344\273\223\345\215\225\346\227\245\346\212\245.md"new file mode 100644index 000000000..c725b4a32--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\344\273\223\345\215\225\346\227\245\346\212\245.md"@@ -0,0 +1,78 @@+## ไปๅๆฅๆฅ+----++ๆฅๅฃ๏ผfut_wsr+ๆ่ฟฐ๏ผ่ทๅไปๅๆฅๆฅๆฐๆฎ๏ผไบ่งฃๅไปๅบ/ๅๅบ็ไปๅๅๅ+้้๏ผๅๆฌกๆๅคง1000๏ผๆป้ไธ้ๅถ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+trade_date | str | N | ไบคๆๆฅๆ+symbol | str | N | ไบงๅไปฃ็ +start_date | str | N | ๅผๅงๆฅๆ(YYYYMMDDๆ ผๅผ๏ผไธๅ)+end_date | str | N | ็ปๆๆฅๆ+exchange | str | N | ไบคๆๆไปฃ็ +++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ+symbol | str | Y | ไบงๅไปฃ็ +fut_name | str | Y | ไบงๅๅ็งฐ+warehouse | str | Y | ไปๅบๅ็งฐ+wh_id | str | N | ไปๅบ็ผๅท+pre_vol | int | Y | ๆจๆฅไปๅ้+vol | int | Y | ไปๆฅไปๅ้+vol_chg | int | Y | ๅขๅ้+area | str | N | ๅฐๅบ+year | str | N | ๅนดๅบฆ+grade | str | N | ็ญ็บง+brand | str | N | ๅ็+place | str | N | ไบงๅฐ+pd | int | N | ๅ่ดดๆฐด+is_ct | str | N | ๆฏๅฆๆ็ฎไปๅ+unit | str | Y | ๅไฝ+exchange | str | N | ไบคๆๆ+++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api('your token')++df = pro.fut_wsr(trade_date='20181113', symbol='ZN')++```++**ๆฐๆฎ็คบไพ**+++ trade_date symbol fut_name warehouse pre_vol vol vol_chg unit+ 0 20181113 ZN ้ ไธๆตท่ฃๅผบ 4960 4960 0 ๅจ+ 1 20181113 ZN ้ ไธๆธฏ็ฉๆต 702 702 0 ๅจ+ 2 20181113 ZN ้ ไธๆธฏ็ฉๆต่ๅท 0 0 0 ๅจ+ 3 20181113 ZN ้ ไธญๅจๅดๆท 0 0 0 ๅจ+ 4 20181113 ZN ้ ไธญๅจๅคงๅบ 0 0 0 ๅจ+ 5 20181113 ZN ้ ไธญๅจๆไธ 0 0 0 ๅจ+ 6 20181113 ZN ้ ไธญ้ๅฃๆบ 428 353 -75 ๅจ+ 7 20181113 ZN ้ ๅ จ่็ฉๆต 2882 2882 0 ๅจ+ 8 20181113 ZN ้ ๅๅจไปๅจ 25 25 0 ๅจ+ 9 20181113 ZN ้ ๅ็ๆพๆฑ 0 0 0 ๅจ+ 10 20181113 ZN ้ ๅฝๅจ837ๅค 0 0 0 ๅจ+ 11 20181113 ZN ้ ๅฝๅจๅคฉๅจ 0 0 0 ๅจ+ 12 20181113 ZN ้ ๅฝ่ฝ็ฉๆตๅธธๅท 200 200 0 ๅจ+ 13 20181113 ZN ้ ๅค่ฟๅไธๅผ ๅๆต 0 0 0 ๅจ+ 14 20181113 ZN ้ ๅฎๆณขไน้พไป 0 0 0 ๅจ+ 15 20181113 ZN ้ ๅนฟๅจ830ไธๆฐด่ฅฟ 0 0 0 ๅจ+ 16 20181113 ZN ้ ๅบท่ฟ่งๅฑฑ 0 0 0 ๅจ+ 17 20181113 ZN ้ ๆ ้กๅฝ่ 0 0 0 ๅจ+ 18 20181113 ZN ้ ๆๆๅ ฌๅธ 449 226 -223 ๅจ+ 19 20181113 ZN ้ ๆตๆฑๅบท่ฟ 25 25 0 ๅจ+ 20 20181113 ZN ้ ็พ้ๆฑ็ฉๆต 0 0 0 ๅจ+ 21 20181113 ZN ้ ่ฃๅผบ้ต่ก 0 0 0 ๅจ\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\345\215\227\345\215\216\346\234\237\350\264\247\346\214\207\346\225\260\350\241\214\346\203\205.md" "b/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\345\215\227\345\215\216\346\234\237\350\264\247\346\214\207\346\225\260\350\241\214\346\203\205.md"new file mode 100644index 000000000..e14e0ed28--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\345\215\227\345\215\216\346\234\237\350\264\247\346\214\207\346\225\260\350\241\214\346\203\205.md"@@ -0,0 +1,141 @@+## ๅๅๆ่ดงๆๆฐๆฅ็บฟ่กๆ+----++ๆฅๅฃ๏ผindex_daily+ๆ่ฟฐ๏ผ่ทๅๅๅๆๆฐๆฏๆฅ่กๆ ๏ผๆๆฐ่กๆ ไนๅฏไปฅ้่ฟ[**้็จ่กๆ ๆฅๅฃ**]( https://tushare.pro/document/2?doc_id=109)่ทๅๆฐๆฎ๏ผ+ๆ้๏ผ็จๆท้่ฆ็ดฏ็งฏ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>+++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ๆๆฐไปฃ็ ๏ผๅๅๆ่ดงๆๆฐไปฅ .NH ็ปๅฐพ๏ผๅ ทไฝ่ฏทๅ่ๆฌๆๆไธๆน๏ผ+trade_date | str | N | ไบคๆๆฅๆ ๏ผๆฅๆๆ ผๅผ๏ผYYYYMMDD๏ผไธๅ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | None | N | ็ปๆๆฅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๆ่ฟฐ+--- | ---- | ----+ts_code | str | TSๆๆฐไปฃ็ +trade_date | str | ไบคๆๆฅ+close | float | ๆถ็็นไฝ+open | float | ๅผ็็นไฝ+high | float | ๆ้ซ็นไฝ+low | float | ๆไฝ็นไฝ+pre_close | float | ๆจๆฅๆถ็็น+change | float | ๆถจ่ท็น+pct_chg | float | ๆถจ่ทๅน+vol | float | ๆไบค้๏ผๆ๏ผ+amount | float | ๆไบค้ข๏ผๅๅ ๏ผ++<br>+<br>++**ๆฅๅฃไฝฟ็จ**++```python++pro = ts.pro_api()++#่ทๅๅๅๆฒช้ๆๆฐ+df = pro.index_daily(ts_code='CU.NH', start_date='20180101', end_date='20181201')+++```++<br>+<br>++**ๆฐๆฎๆ ทไพ**++ ts_code trade_date close open high low pre_close \+ 0 CU.NH 20181130 3928.773 3918.501 3928.773 3907.438 3916.130+ 1 CU.NH 20181129 3916.130 3891.634 3936.675 3880.572 3894.005+ 2 CU.NH 20181128 3894.005 3863.978 3895.585 3841.853 3862.398+ 3 CU.NH 20181127 3862.398 3905.068 3906.648 3844.224 3895.585+ 4 CU.NH 20181126 3895.585 3895.585 3907.438 3875.831 3903.487+ 5 CU.NH 20181123 3903.487 3915.340 3937.465 3897.956 3916.920+ 6 CU.NH 20181122 3916.920 3919.291 3927.983 3892.425 3904.277+ 7 CU.NH 20181121 3904.277 3931.143 3950.898 3851.335 3917.710+ 8 CU.NH 20181120 3917.710 3939.045 3953.268 3914.550 3933.514+ 9 CU.NH 20181119 3933.514 3909.018 3944.577 3903.487 3917.710+ 10 CU.NH 20181116 3917.710 3916.130 3932.724 3904.277 3912.969+ 11 CU.NH 20181115 3912.969 3869.509 3917.710 3865.559 3857.657+ 12 CU.NH 20181114 3857.657 3878.992 3899.536 3849.755 3879.782+ 13 CU.NH 20181113 3879.782 3866.349 3882.152 3845.804 3865.559+ 14 CU.NH 20181112 3865.559 3877.411 3884.523 3853.706 3886.103+ 15 CU.NH 20181109 3886.103 3889.264 3916.130 3877.411 3901.117+ 16 CU.NH 20181108 3901.117 3921.661 3926.402 3896.376 3909.018++<br>+<br>++**ๆๆฐๅ่กจ**++ๆๆฐไปฃ็ | ๆๆฐๅ็งฐ+---- | -----+NHAI.NH|ๅๅๅไบงๅๆๆฐ+NHCI.NH|ๅๅๅๅๆๆฐ+NHECI.NH|ๅๅ่ฝๅๆๆฐ+NHFI.NH|ๅๅ้ป่ฒๆๆฐ+NHII.NH|ๅๅๅทฅไธๅๆๆฐ+NHMI.NH|ๅๅ้ๅฑๆๆฐ+NHNFI.NH|ๅๅๆ่ฒ้ๅฑ+NHPMI.NH|ๅๅ่ดต้ๅฑๆๆฐ+A.NH|ๅๅ่ฟๅคง่ฑๆๆฐ+AG.NH|ๅๅๆฒช้ถๆๆฐ+AL.NH|ๅๅๆฒช้ๆๆฐ+AP.NH|ๅๅ้่นๆๆๆฐ+AU.NH|ๅๅๆฒช้ป้ๆๆฐ+BB.NH|ๅๅ่ฟ่ถๅๆฟๆๆฐ+BU.NH|ๅๅๆฒช็ณๆฒนๆฒฅ้ๆๆฐ+C.NH|ๅๅ่ฟ็็ฑณๆๆฐ+CF.NH|ๅๅ้ๆฃ่ฑๆๆฐ+CS.NH|ๅๅ่ฟ็็ฑณๆท็ฒๆๆฐ+CU.NH|ๅๅๆฒช้ๆๆฐ+CY.NH|ๅๅๆฃ็บฑๆๆฐ+ER.NH|ๅๅ้็ฑผ็จปๆๆฐ+FB.NH|ๅๅ่ฟ็บค็ปดๆฟๆๆฐ+FG.NH|ๅๅ้็ป็ๆๆฐ+FU.NH|ๅๅๆฒช็ๆฒนๆๆฐ+HC.NH|ๅๅๆฒช็ญ่ฝงๅทๆฟๆๆฐ+I.NH|ๅๅ่ฟ้็ฟ็ณๆๆฐ+J.NH|ๅๅ่ฟ็ฆ็ญๆๆฐ+JD.NH|ๅๅ่ฟ้ธก่ๆๆฐ+JM.NH|ๅๅ่ฟ็ฆ็ คๆๆฐ+JR.NH|ๅๅ้็ฒณ็จปๆๆฐ+L.NH|ๅๅ่ฟไน็ฏๆๆฐ+LR.NH|ๅๅ้ๆ็ฑผ็จปๆๆฐ+M.NH|ๅๅ่ฟ่ฑ็ฒๆๆฐ+ME.NH|ๅๅ้็ฒ้ๆๆฐ+NI.NH|ๅๅๆฒช้ๆๆฐ+P.NH|ๅๅ่ฟๆฃๆฒนๆๆฐ+PB.NH|ๅๅๆฒช้ ๆๆฐ+PP.NH|ๅๅ่ฟ่ไธ็ฏๆๆฐ+RB.NH|ๅๅๆฒช่บ้ขๆๆฐ+RM.NH|ๅๅ้่็ฑฝ็ฒๆๆฐ+RO.NH|ๅๅ้่ๆฒนๆๆฐ+RS.NH|ๅๅ้ๆฒน่็ฑฝๆๆฐ+RU.NH|ๅๅๆฒชๅคฉ่ถๆๆฐ+SC.NH|ๅๅๅๆฒนๆๆฐ+SF.NH|ๅๅ้็ก ้ๆๆฐ+SM.NH|ๅๅ้้ฐ็ก ๆๆฐ+SN.NH|ๅๅๆฒช้กๆๆฐ+SP.NH|ๅๅ็บธๆตๆๆฐ+SR.NH|ๅๅ้็ฝ็ณๆๆฐ+TA.NH|ๅๅ้็ฒพๅฏน่ฏไบ็ฒ้ ธๆๆฐ+TC.NH|ๅๅ้ๅจๅ็ คๆๆฐ+V.NH|ๅๅ่ฟ่ๆฐฏไน็ฏๆๆฐ+WR.NH|ๅๅๆฒช็บฟๆๆๆฐ+WS.NH|ๅๅ้ๅผบ้บฆๆๆฐ+Y.NH|ๅๅ่ฟ่ฑๆฒนๆๆฐ+ZN.NH|ๅๅๆฒช้ๆๆฐ\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\345\216\206\345\217\262\345\210\206\351\222\237\350\241\214\346\203\205.md" "b/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\345\216\206\345\217\262\345\210\206\351\222\237\350\241\214\346\203\205.md"new file mode 100644index 000000000..564764c4c--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\345\216\206\345\217\262\345\210\206\351\222\237\350\241\214\346\203\205.md"@@ -0,0 +1,87 @@+## ๆ่ดงๅๅฒๅ้่กๆ+----++ๆฅๅฃ๏ผft_mins+ๆ่ฟฐ๏ผ่ทๅๅ จๅธๅบๆ่ดงๅ็บฆๅ้ๆฐๆฎ๏ผๆฏๆ1min/5min/15min/30min/60min่กๆ ๏ผๆไพPython SDKๅ http Restful APIไธค็งๆนๅผ๏ผๅฆๆ้่ฆไธปๅๅ็บฆๅ้๏ผ่ฏทๅ ้่ฟไธปๅ[mapping](https://tushare.pro/document/2?doc_id=189)ๆฅๅฃ่ทๅๅฏนๅบ็ๅ็บฆไปฃ็ ๅๆๅๅ้ใ+้้๏ผๅๆฌกๆๅคง8000่กๆฐๆฎ๏ผๅฏไปฅ้่ฟๆ่ดงๅ็บฆไปฃ็ ๅๆถ้ดๅพช็ฏ่ทๅ๏ผๆฌๆฅๅฃๅฏไปฅๆไพ่ถ ่ฟ10ๅนดๅๅฒๅ้ๆฐๆฎใ+ๆ้๏ผ120็งฏๅๅฏไปฅ่ฐๅ2ๆฌกๆฅๅฃๆฅ็ๆฐๆฎ๏ผๆญฃๅผๆ้่ฏทๅ้ <u>[ๆ้่ฏดๆ](https://tushare.pro/document/1?doc_id=290) </u> ใ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ ๏ผe.g.CU2310.SHF+freq | str | Y | ๅ้้ขๅบฆ๏ผ1min/5min/15min/30min/60min๏ผ+start_date | datetime | N | ๅผๅงๆฅๆ ๆ ผๅผ๏ผ2023-08-25 09:00:00+end_date | datetime | N | ็ปๆๆถ้ด ๆ ผๅผ๏ผ2023-08-25 19:00:00++<br>+<br>+++**freqๅๆฐ่ฏดๆ**++freq | ่ฏดๆ+--- | ----+1min | 1ๅ้+5min | 5ๅ้+15min | 15ๅ้+30min | 30ๅ้+60min | 60ๅ้++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +trade_time | str | Y | ไบคๆๆถ้ด+open | float | Y | ๅผ็ไปท๏ผๅ ๏ผ+close | float | Y | ๆถ็ไปท๏ผๅ ๏ผ+high | float | Y | ๆ้ซไปท๏ผๅ ๏ผ+low | float | Y | ๆไฝไปท๏ผๅ ๏ผ+vol | int | Y | ๆไบค้๏ผๆ๏ผ+amount | float | Y | ๆไบค้้ข๏ผๅ ๏ผ+oi | float | Y | ๆไป้๏ผๆ๏ผ++<br>+<br>++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++df = pro.df = pro.ft_mins(ts_code='CU2310.SHF', freq='1min', start_date='2023-08-25 09:00:00', end_date='2023-08-25 19:00:00')++```++<br>+<br>+++**ๆฐๆฎๆ ทไพ**+++ ts_code trade_time open close high low vol amount oi+ 0 CU2310.SHF 2023-08-25 15:00:00 68920.0 68930.0 68940.0 68910.0 373.0 128543250.0 146733.0+ 1 CU2310.SHF 2023-08-25 14:59:00 68910.0 68920.0 68930.0 68910.0 300.0 103379650.0 146751.0+ 2 CU2310.SHF 2023-08-25 14:58:00 68930.0 68920.0 68940.0 68910.0 207.0 71340500.0 146777.0+ 3 CU2310.SHF 2023-08-25 14:57:00 68910.0 68930.0 68930.0 68910.0 317.0 109246900.0 146812.0+ 4 CU2310.SHF 2023-08-25 14:56:00 68900.0 68910.0 68920.0 68900.0 237.0 81659550.0 146852.0+ .. ... ... ... ... ... ... ... ... ...+ 220 CU2310.SHF 2023-08-25 09:05:00 68750.0 68760.0 68770.0 68740.0 103.0 35412050.0 145101.0+ 221 CU2310.SHF 2023-08-25 09:04:00 68750.0 68750.0 68770.0 68730.0 232.0 79741550.0 145105.0+ 222 CU2310.SHF 2023-08-25 09:03:00 68740.0 68750.0 68750.0 68720.0 205.0 70453700.0 145087.0+ 223 CU2310.SHF 2023-08-25 09:02:00 68710.0 68740.0 68740.0 68690.0 278.0 95514550.0 145132.0+ 224 CU2310.SHF 2023-08-25 09:01:00 68680.0 68710.0 68740.0 68680.0 868.0 298156350.0 145178.0++ [225 rows x 9 columns]++diff --git "a/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\345\220\210\347\272\246\344\277\241\346\201\257.md" "b/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\345\220\210\347\272\246\344\277\241\346\201\257.md"new file mode 100644index 000000000..5f7d58845--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\345\220\210\347\272\246\344\277\241\346\201\257.md"@@ -0,0 +1,78 @@+## ๆ่ดงๅ็บฆไฟกๆฏ่กจ+----++ๆฅๅฃ๏ผfut_basic+ๆ่ฟฐ๏ผ่ทๅๆ่ดงๅ็บฆๅ่กจๆฐๆฎ+้้๏ผๅๆฌกๆๅคง10000+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+exchange | str | Y | ไบคๆๆไปฃ็ CFFEX-ไธญ้ๆ DCE-ๅคงๅๆ CZCE-้ๅๆ SHFE-ไธๆๆ INE-ไธๆตทๅฝ้ ่ฝๆบไบคๆไธญๅฟ GFEX-ๅนฟๅทๆ่ดงไบคๆๆ+fut_type | str | N | ๅ็บฆ็ฑปๅ (1 ๆฎ้ๅ็บฆ 2ไธปๅไธ่ฟ็ปญๅ็บฆ ้ป่ฎคๅๅ จ้จ)+fut_code | str | N | ๆ ๅๅ็บฆไปฃ็ ๏ผๅฆ็ฝ้ถAGใAP้ฒ่นๆ็ญ+list_date | str | N | ไธๅธๅผๅงๆฅๆ(ๆ ผๅผYYYYMMDD๏ผไปๆๆฅๅผๅงไปฅๆฅๆๆๅ็บฆ๏ผ++++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ๅ็บฆไปฃ็ +symbol | str | Y | ไบคๆๆ ่ฏ+exchange | str | Y | ไบคๆๅธๅบ+name | str | Y | ไธญๆ็ฎ็งฐ+fut_code | str | Y | ๅ็บฆไบงๅไปฃ็ +multiplier | float | Y | ๅ็บฆไนๆฐ(ๅช้็จไบๅฝๅบๆ่ดงใๆๆฐๆ่ดง)+trade_unit | str | Y | ไบคๆ่ฎก้ๅไฝ+per_unit | float | Y | ไบคๆๅไฝ(ๆฏๆ)+quote_unit | str | Y | ๆฅไปทๅไฝ+quote_unit_desc | str | Y | ๆๅฐๆฅไปทๅไฝ่ฏดๆ+d_mode_desc | str | Y | ไบคๅฒๆนๅผ่ฏดๆ+list_date | str | Y | ไธๅธๆฅๆ+delist_date | str | Y | ๆๅไบคๆๆฅๆ+d_month | str | Y | ไบคๅฒๆไปฝ+last_ddate | str | Y | ๆๅไบคๅฒๆฅ+trade_time_desc | str | N | ไบคๆๆถ้ด่ฏดๆ+++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api('your token')++df = pro.fut_basic(exchange='DCE', fut_type='1', fields='ts_code,symbol,name,list_date,delist_date')++```++**ๆฐๆฎ็คบไพ**++ ts_code symbol name list_date delist_date+ 0 P0805.DCE P0805 ๆฃๆฆๆฒน0805 20071029 20080516+ 1 P0806.DCE P0806 ๆฃๆฆๆฒน0806 20071029 20080616+ 2 P0807.DCE P0807 ๆฃๆฆๆฒน0807 20071029 20080714+ 3 P0808.DCE P0808 ๆฃๆฆๆฒน0808 20071029 20080814+ 4 P0811.DCE P0811 ๆฃๆฆๆฒน0811 20071115 20081114+ 5 P0812.DCE P0812 ๆฃๆฆๆฒน0812 20071217 20081212+ 6 P0901.DCE P0901 ๆฃๆฆๆฒน0901 20080116 20090116+ 7 P0903.DCE P0903 ๆฃๆฆๆฒน0903 20080317 20090313+ 8 P0906.DCE P0906 ๆฃๆฆๆฒน0906 20080617 20090612+ 9 P0908.DCE P0908 ๆฃๆฆๆฒน0908 20080815 20090814+ 10 P0911.DCE P0911 ๆฃๆฆๆฒน0911 20081117 20091113+ 11 P1001.DCE P1001 ๆฃๆฆๆฒน1001 20090119 20100115+ 12 P1002.DCE P1002 ๆฃๆฆๆฒน1002 20090216 20100212+ 13 P1003.DCE P1003 ๆฃๆฆๆฒน1003 20090316 20100312+ 14 P1004.DCE P1004 ๆฃๆฆๆฒน1004 20090416 20100415+ 15 Y0607.DCE Y0607 ่ฑๆฒน0607 20060109 20060714+ 16 Y0611.DCE Y0611 ่ฑๆฒน0611 20060118 20061114+ 17 Y0612.DCE Y0612 ่ฑๆฒน0612 20060315 20061214+ 18 Y0701.DCE Y0701 ่ฑๆฒน0701 20060315 20070117+ 19 Y0708.DCE Y0708 ่ฑๆฒน0708 20060815 20070814+ 20 Y0709.DCE Y0709 ่ฑๆฒน0709 20060915 20070914+++diff --git "a/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\345\256\236\346\227\266\345\210\206\351\222\237\350\241\214\346\203\205.md" "b/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\345\256\236\346\227\266\345\210\206\351\222\237\350\241\214\346\203\205.md"new file mode 100644index 000000000..3fa1bc54e--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\345\256\236\346\227\266\345\210\206\351\222\237\350\241\214\346\203\205.md"@@ -0,0 +1,83 @@+## ๆ่ดงๅฎๆถๅ้่กๆ+----++ๆฅๅฃ๏ผrt_fut_min+ๆ่ฟฐ๏ผ่ทๅๅ จๅธๅบๆ่ดงๅ็บฆๅฎๆถๅ้ๆฐๆฎ๏ผๆฏๆ1min/5min/15min/30min/60min่กๆ ๏ผๆไพPython SDKใ http Restful APIๅwebsocketไธ็งๆนๅผ๏ผๅฆๆ้่ฆไธปๅๅ็บฆๅ้๏ผ่ฏทๅ ้่ฟไธปๅ[mapping](https://tushare.pro/document/2?doc_id=189)ๆฅๅฃ่ทๅๅฏนๅบ็ๅ็บฆไปฃ็ ๅๆๅๅ้ใ+้้๏ผๆฏๅ้ๅฏไปฅ่ฏทๆฑ500ๆฌก๏ผๆฏๆๅคไธชๅ็บฆๅๆถๆๅ+ๆ้๏ผ้ๅ็ฌๅผๆ้๏ผๆญฃๅผๆ้่ฏทๅ้ <u>[ๆ้่ฏดๆ](https://tushare.pro/document/1?doc_id=290) </u> ใ++<br>+<br>++**rt_fut_min่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ ๏ผe.g.CU2310.SHF๏ผๆฏๆๅคไธชๅ็บฆ๏ผ้ๅทๅ้๏ผ+freq | str | Y | ๅ้้ขๅบฆ๏ผ1MIN/5MIN/15MIN/30MIN/60MIN๏ผ++<br>+<br>++<font color="red">ๅๆถๆไพๅฝๆฅๅผๅธไปฅๆฅๆๆๅๅฒๅ้๏ผๅณ๏ผๅ้ๅฟซ็ งๅๆพ๏ผ๏ผๆฅๅฃๅ๏ผrt_fut_min_daily๏ผๅชๆฏๆไธไธชไธชๅ็บฆๆๅใ</font>++**rt_fut_min_daily่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ ๏ผe.g.CU2310.SHF๏ผไป ๆฏๆไธๆฌกไธไธชๅ็บฆ็ๅๆพ+freq | str | Y | ๅ้้ขๅบฆ๏ผ1MIN/5MIN/15MIN/30MIN/60MIN๏ผ+date_str | str | N | ๅๆพๆฅๆ๏ผๆ ผๅผ๏ผYYYY-MM-DD๏ผ้ป่ฎคไธบไบคๆๅฝๆฅ๏ผๆฏๆๅๆบฏไธๅคฉ๏ผ++<br>+<br>+++**freqๅๆฐ่ฏดๆ**++freq | ่ฏดๆ+--- | ----+1MIN | 1ๅ้+5MIN | 5ๅ้+15MIN | 15ๅ้+30MIN | 30ๅ้+60MIN | 60ๅ้++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+code | str | Y | ่ก็ฅจไปฃ็ +freq | str | Y | ้ขๅบฆ+time | str | Y | ไบคๆๆถ้ด+open | float | Y | ๅผ็ไปท+close | float | Y | ๆถ็ไปท+high | float | Y | ๆ้ซไปท+low | float | Y | ๆไฝไปท+vol | int | Y | ๆไบค้+amount | float | Y | ๆไบค้้ข+oi | float | Y | ๆไป้++<br>+<br>++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++#ๅไธชๅ็บฆ+df = pro.df = pro.rt_fut_min(ts_code='CU2501.SHF', freq='1MIN')++#ๅคไธชๅ็บฆ+df = pro.df = pro.rt_fut_min(ts_code='CU2501.SHF,CU2502.SHF', freq='1MIN')++```++<br>++diff --git "a/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\346\227\245\347\272\277\350\241\214\346\203\205.md" "b/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\346\227\245\347\272\277\350\241\214\346\203\205.md"new file mode 100644index 000000000..6a1c099d7--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\346\227\245\347\272\277\350\241\214\346\203\205.md"@@ -0,0 +1,127 @@+## ๆ่ดงๆฅ็บฟ่กๆ+----++ๆฅๅฃ๏ผfut_daily๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆ่ฟฐ๏ผๆ่ดงๆฅ็บฟ่กๆ ๆฐๆฎ+้้๏ผๅๆฌกๆๅคง2000ๆก๏ผๆป้ไธ้ๅถ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผๆชๆฅๅฏ่ฝ่ฐๆด็งฏๅ๏ผ่ฏทๅฐฝ้ๅค็็งฏ็ดฏ็งฏๅใๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+trade_date | str | N | ไบคๆๆฅๆ(YYYYMMDDๆ ผๅผ๏ผไธๅ)+ts_code | str | N | ๅ็บฆไปฃ็ +exchange | str | N | ไบคๆๆไปฃ็ +start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | TSๅ็บฆไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+pre_close | float | Y | ๆจๆถ็ไปท+pre_settle | float | Y | ๆจ็ป็ฎไปท+open | float | Y | ๅผ็ไปท+high | float | Y | ๆ้ซไปท+low | float | Y | ๆไฝไปท+close | float | Y | ๆถ็ไปท+settle | float | Y | ็ป็ฎไปท+change1 | float | Y | ๆถจ่ท1 ๆถ็ไปท-ๆจ็ป็ฎไปท+change2 | float | Y | ๆถจ่ท2 ็ป็ฎไปท-ๆจ็ป็ฎไปท+vol | float | Y | ๆไบค้(ๆ)+amount | float | Y | ๆไบค้้ข(ไธๅ )+oi | float | Y | ๆไป้(ๆ)+oi_chg | float | Y | ๆไป้ๅๅ+delv_settle | float | N | ไบคๅฒ็ป็ฎไปท+++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++#่ทๅCU1811ๅ็บฆ20180101๏ฝ20181113ๆ้ด็่กๆ+df = pro.fut_daily(ts_code='CU1811.SHF', start_date='20180101', end_date='20181113')++#่ทๅ2018ๅนด11ๆ13ๆฅๅคงๅๆๅ จ้จๅ็บฆ่กๆ ๆฐๆฎ+df = pro.fut_daily(trade_date='20181113', exchange='DCE', fields='ts_code,trade_date,pre_close,pre_settle,open,high,low,close,settle,vol')++```++**ๆฐๆฎ็คบไพ**++ ts_code trade_date pre_close pre_settle open high low \+ 0 CU1811.SHF 20181113 48900.0 49030.0 48910.0 49040.0 48700.0+ 1 CU1811.SHF 20181112 49270.0 49340.0 49130.0 49200.0 48860.0+ 2 CU1811.SHF 20181109 49440.0 49500.0 49340.0 49530.0 49120.0+ 3 CU1811.SHF 20181108 49470.0 49460.0 49600.0 49680.0 49350.0+ 4 CU1811.SHF 20181107 49670.0 49630.0 49640.0 49850.0 49260.0+ 5 CU1811.SHF 20181106 49780.0 49890.0 49800.0 49860.0 49500.0+ 6 CU1811.SHF 20181105 49820.0 49340.0 49820.0 50290.0 49720.0+ 7 CU1811.SHF 20181102 48680.0 48720.0 48780.0 49930.0 48750.0+ 8 CU1811.SHF 20181101 49100.0 49120.0 49050.0 49170.0 48510.0+ 9 CU1811.SHF 20181031 49650.0 49680.0 49480.0 49480.0 48900.0+ 10 CU1811.SHF 20181030 49700.0 49830.0 50020.0 50050.0 49530.0+ 11 CU1811.SHF 20181029 49680.0 49930.0 49680.0 50100.0 49560.0+ 12 CU1811.SHF 20181026 49750.0 49680.0 49960.0 50300.0 49670.0+ 13 CU1811.SHF 20181025 50270.0 50090.0 50070.0 50170.0 49350.0+ 14 CU1811.SHF 20181024 50100.0 50330.0 49920.0 50290.0 49850.0+ 15 CU1811.SHF 20181023 50540.0 50450.0 50710.0 50780.0 50040.0+ 16 CU1811.SHF 20181022 50270.0 50080.0 50480.0 50610.0 50250.0+ 17 CU1811.SHF 20181019 50130.0 50280.0 50000.0 50310.0 49850.0+ 18 CU1811.SHF 20181018 50290.0 50230.0 50380.0 50560.0 50000.0+ 19 CU1811.SHF 20181017 50190.0 50510.0 50330.0 50380.0 50030.0+ 20 CU1811.SHF 20181016 50570.0 50780.0 50780.0 50960.0 50130.0++ close settle change1 change2 vol amount oi \+ 0 49030.0 48830.0 0.0 -200.0 17270.0 421721.70 16110.0+ 1 48900.0 49030.0 -440.0 -310.0 27710.0 679447.85 22940.0+ 2 49270.0 49340.0 -230.0 -160.0 22530.0 555910.15 30100.0+ 3 49440.0 49500.0 -20.0 40.0 22290.0 551708.00 34800.0+ 4 49470.0 49460.0 -160.0 -170.0 26850.0 664040.10 38330.0+ 5 49670.0 49630.0 -220.0 -260.0 21920.0 543949.90 42890.0+ 6 49780.0 49890.0 440.0 550.0 30430.0 759128.50 46570.0+ 7 49820.0 49340.0 1100.0 620.0 33220.0 819667.00 50030.0+ 8 48680.0 48720.0 -440.0 -400.0 34450.0 839294.60 54440.0+ 9 49100.0 49120.0 -580.0 -560.0 57280.0 1406889.52 56170.0+ 10 49650.0 49680.0 -180.0 -150.0 55614.0 1381482.82 64048.0+ 11 49700.0 49830.0 -230.0 -100.0 53786.0 1340288.82 73114.0+ 12 49680.0 49930.0 0.0 250.0 49496.0 1235819.76 80648.0+ 13 49750.0 49680.0 -340.0 -410.0 91260.0 2266903.68 84580.0+ 14 50270.0 50090.0 -60.0 -240.0 94348.0 2363108.67 95734.0+ 15 50100.0 50330.0 -350.0 -120.0 82700.0 2081209.96 116458.0+ 16 50540.0 50450.0 460.0 370.0 90744.0 2289330.09 131412.0+ 17 50270.0 50080.0 -10.0 -200.0 109650.0 2745775.65 140034.0+ 18 50130.0 50280.0 -100.0 50.0 120742.0 3035613.40 147102.0+ 19 50290.0 50230.0 -220.0 -280.0 111464.0 2799654.18 160952.0+ 20 50190.0 50510.0 -590.0 -270.0 149838.0 3784650.23 168606.0++ oi_chg+ 0 0.0+ 1 -440.0+ 2 -230.0+ 3 -20.0+ 4 -160.0+ 5 -220.0+ 6 440.0+ 7 1100.0+ 8 -440.0+ 9 -580.0+ 10 -180.0+ 11 -230.0+ 12 0.0+ 13 -340.0+ 14 -60.0+ 15 -350.0+ 16 460.0+ 17 -10.0+ 18 -100.0+ 19 -220.0+ 20 -590.0++diff --git "a/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\346\234\237\350\264\247\344\270\273\345\212\233\344\270\216\350\277\236\347\273\255\345\220\210\347\272\246.md" "b/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\346\234\237\350\264\247\344\270\273\345\212\233\344\270\216\350\277\236\347\273\255\345\220\210\347\272\246.md"new file mode 100644index 000000000..700d5c8b9--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\346\234\237\350\264\247\344\270\273\345\212\233\344\270\216\350\277\236\347\273\255\345\220\210\347\272\246.md"@@ -0,0 +1,75 @@+## ๆ่ดงไธปๅไธ่ฟ็ปญๅ็บฆ+----++ๆฅๅฃ๏ผfut_mapping+ๆ่ฟฐ๏ผ่ทๅๆ่ดงไธปๅ๏ผๆ่ฟ็ปญ๏ผๅ็บฆไธๆๅ็บฆๆ ๅฐๆฐๆฎ+้้๏ผๅๆฌกๆๅคง2000ๆก๏ผๆป้ไธ้ๅถ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผๆชๆฅๅฏ่ฝ่ฐๆด็งฏๅ๏ผ่ฏทๅฐฝๅฏ่ฝๅค็งฏ็ดฏ็งฏๅใๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ๅ็บฆไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ(YYYYMMDDๆ ผๅผ๏ผไธๅ)+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ฟ็ปญๅ็บฆไปฃ็ +trade_date | str | Y | ่ตทๅงๆฅๆ+mapping_ts_code | str | Y | ๆ่ดงๅ็บฆไปฃ็ ++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++#่ทๅไธปๅๅ็บฆTF.CFXๆฏๆฅๅฏนๅบ็ๆๅ็บฆ+df = pro.fut_mapping(ts_code='TF.CFX')++```+++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code trade_date mapping_ts_code+ 0 TF.CFX 20190823 TF1912.CFX+ 1 TF.CFX 20190822 TF1912.CFX+ 2 TF.CFX 20190821 TF1912.CFX+ 3 TF.CFX 20190820 TF1912.CFX+ 4 TF.CFX 20190819 TF1912.CFX+ 5 TF.CFX 20190816 TF1912.CFX+ 6 TF.CFX 20190815 TF1912.CFX+ 7 TF.CFX 20190814 TF1912.CFX+ 8 TF.CFX 20190813 TF1912.CFX+ 9 TF.CFX 20190812 TF1909.CFX+ 10 TF.CFX 20190809 TF1909.CFX+ 11 TF.CFX 20190808 TF1909.CFX+ 12 TF.CFX 20190807 TF1909.CFX+ 13 TF.CFX 20190806 TF1909.CFX+ 14 TF.CFX 20190805 TF1909.CFX+ 15 TF.CFX 20190802 TF1909.CFX+ 16 TF.CFX 20190801 TF1909.CFX+ 17 TF.CFX 20190731 TF1909.CFX+ 18 TF.CFX 20190730 TF1909.CFX+ 19 TF.CFX 20190729 TF1909.CFX+ 20 TF.CFX 20190726 TF1909.CFXdiff --git "a/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\346\234\237\350\264\247\344\270\273\350\246\201\345\223\201\347\247\215\344\272\244\346\230\223\345\221\250\346\212\245.md" "b/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\346\234\237\350\264\247\344\270\273\350\246\201\345\223\201\347\247\215\344\272\244\346\230\223\345\221\250\346\212\245.md"new file mode 100644index 000000000..b85734527--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\346\234\237\350\264\247\344\270\273\350\246\201\345\223\201\347\247\215\344\272\244\346\230\223\345\221\250\346\212\245.md"@@ -0,0 +1,139 @@+## ๆ่ดงไธป่ฆๅ็งไบคๆๅจๆฅ+----++ๆฅๅฃ๏ผfut_weekly_detail+ๆ่ฟฐ๏ผ่ทๅๆ่ดงไบคๆๆไธป่ฆๅ็งๆฏๅจไบคๆ็ป่ฎกไฟกๆฏ๏ผๆฐๆฎไป2010ๅนด3ๆๅผๅง+ๆ้๏ผ600็งฏๅๅฏ่ฐๅ๏ผๅๆฌกๆๅคง่ทๅ4000่กๆฐๆฎ๏ผ็งฏๅ่ถ้ซ้ขๆฌก่ถ้ซ๏ผ5000็งฏๅไปฅไธๆญฃๅธธ่ฐๅไธๅ้ๅถ+ๆฐๆฎๆฅๆบ๏ผไธญๅฝ่ฏ็ไผ๏ผๆฌๆฐๆฎ็ฑTushare็คพๅบๆๅCEๅฎๆ่งๅๅ้้++++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+week | str | N | ๅจๆ๏ผๆฏๅนด็ฌฌๅ ๅจ๏ผe.g. 202001 ่กจ็คบ2020็ฌฌ1ๅจ๏ผ+prd | str | N | ๆ่ดงๅ็ง๏ผๆฏๆๅคๅ็ง่พๅ ฅ๏ผ้ๅทๅ้๏ผ+start_week | str | N | ๅผๅงๅจๆ+end_week | str | N | ็ปๆๅจๆ+exchange | str | N | ไบคๆๆ๏ผ่ฏทๅ่[ไบคๆๆ่ฏดๆ]( https://tushare.pro/document/2?doc_id=134)๏ผ+fields | str | N | ๆๅ็ๅญๆฎต๏ผe.g. fields='prd,name,vol'++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+exchange | str | Y | ไบคๆๆไปฃ็ +prd | str | Y | ๆ่ดงๅ็งไปฃ็ +name | str | Y | ๅ็งๅ็งฐ+vol | int | Y | ๆไบค้๏ผๆ๏ผ+vol_yoy | float | Y | ๅๆฏๅขๅ๏ผ%๏ผ+amount | float | Y | ๆไบค้้ข๏ผไบฟๅ ๏ผ+amout_yoy | float | Y | ๅๆฏๅขๅ๏ผ%๏ผ+cumvol | int | Y | ๅนด็ดฏ่ฎกๆไบคๆป้๏ผๆ๏ผ+cumvol_yoy | float | Y | ๅๆฏๅขๅ๏ผ%๏ผ+cumamt | float | Y | ๅนด็ดฏ่ฎกๆไบค้้ข๏ผไบฟๅ ๏ผ+cumamt_yoy | float | Y | ๅๆฏๅขๅ๏ผ%๏ผ+open_interest | int | Y | ๆไป้๏ผๆ๏ผ+interest_wow | float | Y | ็ฏๆฏๅขๅ๏ผ%๏ผ+mc_close | float | Y | ๆฌๅจไธปๅๅ็บฆๆถ็ไปท+close_wow | float | Y | ็ฏๆฏๆถจ่ท๏ผ%๏ผ+week | str | Y | ๅจๆ+week_date | str | Y | ๅจๆฅๆ++<br>+<br>+++**ๆฅๅฃ็คบไพ**++```python++#่ทๅๆ่ดง้ๆฏๅจไบคๆ็ป่ฎกไฟกๆฏ+df = pro.fut_weekly_detail(prd='CU')++#่ทๅๆ่ดง้ๆฏๅจไบคๆ็ป่ฎกไฟกๆฏ+df = pro.fut_weekly_detail(prd='CU', start_week='202001', end_week='202003', fields='prd,name,vol,amount')++```++<br>+<br>++**ๆฐๆฎ็คบไพ**+++ exchange prd name vol vol_yoy amount amout_yoy cumvol \+ 0 SHFE CU ้ 1078970.0 5.9664 2363.843445 -5.7003 6848849+ 1 SHFE CU ้ 719180.0 -39.2551 1629.243739 -44.6199 5769879+ 2 SHFE CU ้ 853051.0 -18.3270 1939.496318 -25.9779 5050699+ 3 SHFE CU ้ 631162.0 -31.7424 1461.354730 -35.9592 4197648+ 4 SHFE CU ้ 578056.0 -9.3746 1322.589156 -14.0750 3566486+ 5 SHFE CU ้ 730785.0 -6.5397 1660.914895 -11.1342 2988430+ 6 SHFE CU ้ 527482.0 -26.9089 1282.416054 -25.2899 2257645+ 7 SHFE CU ้ 705489.0 -23.1581 1734.699836 -19.9661 1730163+ 8 SHFE CU ้ 708250.0 -26.6082 1729.664611 -24.3423 1024674+ 9 SHFE CU ้ 658216.0 -14.7655 1621.641588 -10.9408 36830247+ 10 SHFE CU ้ 1044471.0 1.0854 2620.159590 -4.1661 6765968+ 11 SHFE CU ้ 924676.0 142.4229 2281.911847 123.2715 5721497+ 12 SHFE CU ้ 637852.0 12.2380 1539.237496 4.3256 4796821+ 13 SHFE CU ้ 744155.0 -16.7387 1840.043986 -14.4320 36172031+ 14 SHFE CU ้ 853989.0 -7.5109 2097.493940 -6.3866 35427876+ 15 SHFE CU ้ 1198852.0 62.8039 2915.899164 61.1575 34573887+ 16 SHFE CU ้ 781920.0 -21.2678 1869.015441 -29.4290 4158969+ 17 SHFE CU ้ 534402.0 -45.4224 1260.985602 -48.0350 33375035+ 18 SHFE CU ้ 548735.0 -52.4718 1296.078577 -54.3935 32840633+ 19 SHFE CU ้ 509696.0 -46.3713 1197.544717 -49.1703 32291898+ 20 SHFE CU ้ 598537.0 -35.6818 1408.258269 -38.4052 31782202++ cumvol_yoy cumamt cumamt_yoy open_interest interest_wow \+ 0 -23.6312 15901.272297 -26.8907 404849 5.4921+ 1 -27.4220 13537.428852 -29.6511 383772 4.0396+ 2 -25.3514 11908.185114 -26.9496 368871 3.2304+ 3 -26.6337 9968.688796 -27.1357 357328 1.4024+ 4 -25.6490 8507.334067 -25.3694 352386 11.7232+ 5 -28.1449 7184.744911 -27.1326 315410 16.4089+ 6 -33.1474 5523.830016 -30.8745 270950 -8.5351+ 7 -34.8429 4241.413962 -32.4022 296234 -2.5203+ 8 -41.0180 2506.714126 -38.9653 303893 3.5125+ 9 -29.1989 88012.598030 -33.1154 293581 -11.9243+ 10 -15.0339 16301.336253 -23.4456 335685 1.0746+ 11 -17.4373 13681.176663 -26.2857 332116 8.1808+ 12 -26.7487 11399.264817 -35.0014 307001 5.9925+ 13 -29.4164 86390.956443 -33.4266 333328 9.7672+ 14 -29.6414 84550.912457 -33.7467 303668 -0.8305+ 15 -30.0548 82453.418517 -34.2356 306211 18.2994+ 16 -9.9760 9860.027321 -21.0060 289644 -3.5256+ 17 -31.4591 79537.519353 -35.6324 258844 0.1846+ 18 -31.1725 78276.533751 -35.3840 258367 -4.1665+ 19 -30.6444 76980.455175 -34.9273 269600 -0.1237+ 20 -30.3166 75782.910458 -34.6379 269934 2.0379++ mc_close close_wow week week_date+ 0 43520.0 -3.2028 202011 20200313+ 1 44900.0 0.2008 202010 20200306+ 2 44390.0 -3.9177 202009 20200228+ 3 45990.0 -0.1303 202008 20200221+ 4 45930.0 0.4593 202007 20200214+ 5 45690.0 -5.1287 202006 20200207+ 6 48020.0 -2.6556 202004 20200124+ 7 49250.0 0.6334 202003 20200117+ 8 49010.0 -0.1223 202002 20200110+ 9 48900.0 -1.8269 202001 20200103+ 10 50500.0 1.5892 20199 20190301+ 11 49920.0 3.2472 20198 20190222+ 12 48200.0 -0.0829 20197 20190215+ 13 49730.0 1.0156 201952 20191227+ 14 49030.0 -0.0204 201951 20191220+ 15 49010.0 3.4621 201950 20191213+ 16 48270.0 2.0507 20195 20190201+ 17 47320.0 0.0846 201949 20191206+ 18 47320.0 0.8955 201948 20191129+ 19 46870.0 0.0000 201947 20191122+ 20 46930.0 -1.0959 201946 20191115\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\346\234\237\350\264\247\345\220\210\347\272\246\346\266\250\350\267\214\345\201\234\344\273\267\346\240\274.md" "b/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\346\234\237\350\264\247\345\220\210\347\272\246\346\266\250\350\267\214\345\201\234\344\273\267\346\240\274.md"new file mode 100644index 000000000..2983036bb--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\346\234\237\350\264\247\345\220\210\347\272\246\346\266\250\350\267\214\345\201\234\344\273\267\346\240\274.md"@@ -0,0 +1,75 @@+## ๆ่ดงๅ็บฆๆถจ่ทๅไปทๆ ผ๏ผ็ๅ๏ผ+----++ๆฅๅฃ๏ผft_limit+ๆ่ฟฐ๏ผ่ทๅๆๆๆ่ดงๅ็บฆๆฏๅคฉ็ๆถจ่ทๅไปทๆ ผๅๆไฝไฟ่ฏ้็๏ผๆฐๆฎๅผๅงไบ2005ๅนดใ+้้๏ผๅๆฌกๆๅคง่ทๅ4000่กๆฐๆฎ๏ผๅฏไปฅ้่ฟๆฅๆใๅ็บฆไปฃ็ ็ญๅๆฐๅพช็ฏ่ทๅๆๆๅๅฒ+็งฏๅ๏ผ็จๆท็งฏ5000็งฏๅๅฏ่ฐๅ๏ผ็งฏๅ่ทๅๆนๆณๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ๅ็บฆไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ๏ผๆ ผๅผ๏ผYYYYMMDD๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+cont | str | N | ๅ็บฆไปฃ็ ๏ผไพๅฆ๏ผcont='CU')+exchange | str | N | ไบคๆๆไปฃ็ ๏ผไพๅฆ๏ผexchange='DCE')++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ+ts_code | str | Y | TS่ก็ฅจไปฃ็ +name | str | Y | ๅ็บฆๅ็งฐ+up_limit | float | Y | ๆถจๅไปท+down_limit | float | Y | ่ทๅไปท+m_ratio | float | Y | ๆไฝไบคๆไฟ่ฏ้็๏ผ%๏ผ+cont | str | Y | ๅ็บฆไปฃ็ +exchange | str | Y | ไบคๆๆไปฃ็ ++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++#่ทๅๅๆฅๅ จ้จๆ่ดงๅ็บฆๆถจ่ทๅไปทๆ ผ+df = pro.ft_limit(trade_date='20250213')++#่ทๅๅไธชๅ็งๆๆๅ็บฆๆถจ่ทๅไปทๆ ผ+df = pro.ft_limit(cont='CU')+++```++<br>+<br>+++**ๆฐๆฎๆ ทไพ**++ trade_date ts_code name up_limit down_limit m_ratio cont exchange+ 0 20250213 A2503.DCE ่ฟ่ฑไธ2503 4229.000 3751.000 7.000 A DCE+ 1 20250213 A2505.DCE ่ฟ่ฑไธ2505 4249.000 3769.000 7.000 A DCE+ 2 20250213 A2507.DCE ่ฟ่ฑไธ2507 4258.000 3776.000 7.000 A DCE+ 3 20250213 A2509.DCE ่ฟ่ฑไธ2509 4268.000 3786.000 7.000 A DCE+ 4 20250213 A2511.DCE ่ฟ่ฑไธ2511 4234.000 3756.000 7.000 A DCE+ .. ... ... ... ... ... ... ... ...+ 783 20250213 ZN2509.SHF ๆฒช้2509 24890.000 21635.000 9.000 ZN SHFE+ 784 20250213 ZN2510.SHF ๆฒช้2510 24885.000 21630.000 9.000 ZN SHFE+ 785 20250213 ZN2511.SHF ๆฒช้2511 24780.000 21535.000 9.000 ZN SHFE+ 786 20250213 ZN2512.SHF ๆฒช้2512 24700.000 21465.000 9.000 ZN SHFE+ 787 20250213 ZN2601.SHF ๆฒช้2601 24710.000 21475.000 9.000 ZN SHFE\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\346\234\237\350\264\247\345\221\250\346\234\210\347\272\277\350\241\214\346\203\205(\346\257\217\346\227\245\346\233\264\346\226\260).md" "b/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\346\234\237\350\264\247\345\221\250\346\234\210\347\272\277\350\241\214\346\203\205(\346\257\217\346\227\245\346\233\264\346\226\260).md"new file mode 100644index 000000000..07e2141ac--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\346\234\237\350\264\247\345\221\250\346\234\210\347\272\277\350\241\214\346\203\205(\346\257\217\346\227\245\346\233\264\346\226\260).md"@@ -0,0 +1,42 @@+## ๆ่ดงๅจ/ๆ็บฟ่กๆ (ๆฏๆฅๆดๆฐ)+----++ๆฅๅฃ๏ผfut_weekly_monthly+ๆ่ฟฐ๏ผๆ่ดงๅจ/ๆ็บฟ่กๆ (ๆฏๆฅๆดๆฐ)+้้๏ผๅๆฌกๆๅคง6000++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | TSไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ+start_date | str | N | ๅผๅงไบคๆๆฅๆ+end_date | str | N | ็ปๆไบคๆๆฅๆ+freq | str | Y | ้ข็weekๅจ๏ผmonthๆ+exchange | str | N | ไบคๆๆ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ๆ่ดงไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ๏ผๆฏๅจไบๆ่ ๆๆซๆฅๆ๏ผ+end_date | str | Y | ่ฎก็ฎๆช่ณๆฅๆ+freq | str | Y | ้ข็(ๅจweek,ๆmonth)+open | float | Y | (ๅจ/ๆ)ๅผ็ไปท+high | float | Y | (ๅจ/ๆ)ๆ้ซไปท+low | float | Y | (ๅจ/ๆ)ๆไฝไปท+close | float | Y | (ๅจ/ๆ)ๆถ็ไปท+pre_close | float | Y | ๅไธ(ๅจ/ๆ)ๆถ็ไปท+settle | float | Y | (ๅจ/ๆ)็ป็ฎไปท+pre_settle | float | Y | ๅไธ(ๅจ/ๆ)็ป็ฎไปท+vol | float | Y | (ๅจ/ๆ)ๆไบค้(ๆ)+amount | float | Y | (ๅจ/ๆ)ๆไบค้้ข(ไธๅ )+oi | float | Y | (ๅจ/ๆ)ๆไป้(ๆ)+oi_chg | float | Y | (ๅจ/ๆ)ๆไป้ๅๅ+exchange | str | Y | ไบคๆๆ+change1 | float | Y | (ๅจ/ๆ)ๆถจ่ท1 ๆถ็ไปท-ๆจ็ป็ฎไปท+change2 | float | Y | (ๅจ/ๆ)ๆถจ่ท2 ็ป็ฎไปท-ๆจ็ป็ฎไปท+diff --git "a/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\346\257\217\346\227\245\346\214\201\344\273\223\346\216\222\345\220\215.md" "b/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\346\257\217\346\227\245\346\214\201\344\273\223\346\216\222\345\220\215.md"new file mode 100644index 000000000..d9ea6f9db--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\346\257\217\346\227\245\346\214\201\344\273\223\346\216\222\345\220\215.md"@@ -0,0 +1,92 @@+## ๆฏๆฅๆไบคๆไปๆๅ+----++ๆฅๅฃ๏ผfut_holding+ๆ่ฟฐ๏ผ่ทๅๆฏๆฅๆไบคๆไปๆๅๆฐๆฎ+้้๏ผๅๆฌกๆๅคง2000๏ผๆป้ไธ้ๅถ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+trade_date | str | N | ไบคๆๆฅๆ ๏ผtrade_date/symbol่ณๅฐ่พๅ ฅไธไธชๅๆฐ๏ผ+symbol | str | N | ๅ็บฆๆไบงๅไปฃ็ +start_date | str | N | ๅผๅงๆฅๆ(YYYYMMDDๆ ผๅผ๏ผไธๅ)+end_date | str | N | ็ปๆๆฅๆ+exchange | str | N | ไบคๆๆไปฃ็ +++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ+symbol | str | Y | ๅ็บฆไปฃ็ ๆ็ฑปๅ+broker | str | Y | ๆ่ดงๅ ฌๅธไผๅ็ฎ็งฐ+vol | int | Y | ๆไบค้+vol_chg | int | Y | ๆไบค้ๅๅ+long_hld | int | Y | ๆไนฐไป้+long_chg | int | Y | ๆไนฐไป้ๅๅ+short_hld | int | Y | ๆๅไป้+short_chg | int | Y | ๆๅไป้ๅๅ+exchange | str | N | ไบคๆๆ+++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++df = pro.fut_holding(trade_date='20181113', symbol='C1905', exchange='DCE')++```++**ๆฐๆฎ็คบไพ**++ trade_date symbol broker vol vol_chg long_hld long_chg \+ 0 20181113 C ไธ่ฏๆ่ดง 37161.0 -6435.0 15432.0 1837.0+ 1 20181113 C ไธญไฟกๅปบๆ 12293.0 -1737.0 NaN NaN+ 2 20181113 C ไธญไฟกๆ่ดง 31284.0 -4508.0 31672.0 102.0+ 3 20181113 C ไธญ็ฒฎๆ่ดง 12331.0 -5430.0 45350.0 3705.0+ 4 20181113 C ไธญ่ๆฑไฟก NaN NaN NaN NaN+ 5 20181113 C ไธญ้ๆ่ดง NaN NaN 18321.0 1491.0+ 6 20181113 C ไบ็ฟ็ปๆ NaN NaN 17828.0 1729.0+ 7 20181113 C ๅ็นๆ่ดง NaN NaN 15271.0 123.0+ 8 20181113 C ๅ ๅคงๆ่ดง 72795.0 -29668.0 36988.0 752.0+ 9 20181113 C ๅ ด่ฏๆ่ดง 21058.0 -4901.0 24372.0 -8720.0+ 10 20181113 C ๅไบฌ้ฆๅ NaN NaN NaN NaN+ 11 20181113 C ๅๅฎๆ่ดง 12550.0 -919.0 NaN NaN+ 12 20181113 C ๅๆณฐๆ่ดง 16339.0 4783.0 30374.0 -806.0+ 13 20181113 C ๅฝๅฏๆ่ดง NaN NaN NaN NaN+ 14 20181113 C ๅฝๆๅฎไฟก 49251.0 -43610.0 84537.0 4253.0+ 15 20181113 C ๅฝๆณฐๅๅฎ 13095.0 -3810.0 16019.0 88.0+ 16 20181113 C ๅคฉ้ฃๆ่ดง NaN NaN NaN NaN+ 17 20181113 C ๅฎ็ฒฎๆ่ดง NaN NaN 15294.0 1651.0+ 18 20181113 C ๅฑฑ่ฅฟไธ็ซ NaN NaN 14686.0 457.0+ 19 20181113 C ๅนฟๅๆ่ดง 15539.0 -10927.0 NaN NaN+ 20 20181113 C ๅนฟๅท้ๆง 11303.0 1810.0 NaN NaN++ short_hld short_chg+ 0 14281.0 -384.0+ 1 NaN NaN+ 2 15634.0 -6336.0+ 3 70184.0 -2658.0+ 4 12279.0 467.0+ 5 NaN NaN+ 6 NaN NaN+ 7 NaN NaN+ 8 42506.0 -279.0+ 9 NaN NaN+ 10 11456.0 -4974.0+ 11 NaN NaN+ 12 NaN NaN+ 13 10935.0 288.0+ 14 105797.0 7326.0+ 15 15811.0 -1489.0+ 16 33336.0 567.0+ 17 NaN NaN+ 18 NaN NaN+ 19 NaN NaN+ 20 NaN NaN\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\346\257\217\346\227\245\347\273\223\347\256\227\345\217\202\346\225\260.md" "b/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\346\257\217\346\227\245\347\273\223\347\256\227\345\217\202\346\225\260.md"new file mode 100644index 000000000..5bf349936--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\234\237\350\264\247\346\225\260\346\215\256/\346\257\217\346\227\245\347\273\223\347\256\227\345\217\202\346\225\260.md"@@ -0,0 +1,117 @@+## ็ป็ฎๅๆฐ+----++ๆฅๅฃ๏ผfut_settle+ๆ่ฟฐ๏ผ่ทๅๆฏๆฅ็ป็ฎๅๆฐๆฐๆฎ๏ผๅ ๆฌไบคๆๅไบคๅฒ่ดน็็ญ+้้๏ผๅๆฌกๆๅคง่ฟๅ1600่กๆฐๆฎ๏ผๅฏๆ นๆฎๆฅๆๅพช็ฏ๏ผๆป้ไธ้ๅถ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+trade_date | str | N | ไบคๆๆฅๆ ๏ผtrade_date/ts_code่ณๅฐ้่ฆ่พๅ ฅไธไธชๅๆฐ๏ผ+ts_code | str | N | ๅ็บฆไปฃ็ +start_date | str | N | ๅผๅงๆฅๆ(YYYYMMDDๆ ผๅผ๏ผไธๅ)+end_date | str | N | ็ปๆๆฅๆ+exchange | str | N | ไบคๆๆไปฃ็ +++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ๅ็บฆไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+settle | float | Y | ็ป็ฎไปท+trading_fee_rate | float | Y | ไบคๆๆ็ปญ่ดน็+trading_fee | float | Y | ไบคๆๆ็ปญ่ดน+delivery_fee | float | Y | ไบคๅฒๆ็ปญ่ดน+b_hedging_margin_rate | float | Y | ไนฐๅฅไฟไบคๆไฟ่ฏ้็+s_hedging_margin_rate | float | Y | ๅๅฅไฟไบคๆไฟ่ฏ้็+long_margin_rate | float | Y | ไนฐๆๆบไบคๆไฟ่ฏ้็+short_margin_rate | float | Y | ๅๆๆบไบคๆไฟ่ฏ้็+offset_today_fee | float | N | ๅนณไปไปๆ็ปญ็+exchange | str | N | ไบคๆๆ+++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api('your token')++df = pro.fut_settle(trade_date='20181114', exchange='SHFE')++```++**ๆฐๆฎ็คบไพ**++ ts_code trade_date settle trading_fee_rate trading_fee \+ 0 CU1811.SHF 20181114 48840.00 0.050 0.0+ 1 CU1812.SHF 20181114 48990.00 0.050 0.0+ 2 CU1901.SHF 20181114 48980.00 0.050 0.0+ 3 CU1902.SHF 20181114 48980.00 0.050 0.0+ 4 CU1903.SHF 20181114 49020.00 0.050 0.0+ 5 CU1904.SHF 20181114 49040.00 0.050 0.0+ 6 CU1905.SHF 20181114 49150.00 0.050 0.0+ 7 CU1906.SHF 20181114 49260.00 0.050 0.0+ 8 CU1907.SHF 20181114 49200.00 0.050 0.0+ 9 CU1908.SHF 20181114 49370.00 0.050 0.0+ 10 CU1909.SHF 20181114 49350.00 0.050 0.0+ 11 CU1910.SHF 20181114 49490.00 0.050 0.0+ 12 AL1811.SHF 20181114 13695.00 0.000 3.0+ 13 AL1812.SHF 20181114 13770.00 0.000 3.0+ 14 AL1901.SHF 20181114 13775.00 0.000 3.0+ 15 AL1902.SHF 20181114 13810.00 0.000 3.0+ 16 AL1903.SHF 20181114 13860.00 0.000 3.0+ 17 AL1904.SHF 20181114 13905.00 0.000 3.0+ 18 AL1905.SHF 20181114 13950.00 0.000 3.0+ 19 AL1906.SHF 20181114 13965.00 0.000 3.0+ 20 AL1907.SHF 20181114 14015.00 0.000 3.0++ delivery_fee b_hedging_margin_rate s_hedging_margin_rate \+ 0 2.00 0.20 0.20+ 1 2.00 0.10 0.10+ 2 2.00 0.07 0.07+ 3 2.00 0.07 0.07+ 4 2.00 0.07 0.07+ 5 2.00 0.07 0.07+ 6 2.00 0.07 0.07+ 7 2.00 0.07 0.07+ 8 2.00 0.07 0.07+ 9 2.00 0.07 0.07+ 10 2.00 0.07 0.07+ 11 2.00 0.07 0.07+ 12 2.00 0.20 0.20+ 13 2.00 0.10 0.10+ 14 2.00 0.07 0.07+ 15 2.00 0.07 0.07+ 16 2.00 0.07 0.07+ 17 2.00 0.07 0.07+ 18 2.00 0.07 0.07+ 19 2.00 0.07 0.07+ 20 2.00 0.07 0.07++ long_margin_rate short_margin_rate+ 0 0.20 0.20+ 1 0.10 0.10+ 2 0.07 0.07+ 3 0.07 0.07+ 4 0.07 0.07+ 5 0.07 0.07+ 6 0.07 0.07+ 7 0.07 0.07+ 8 0.07 0.07+ 9 0.07 0.07+ 10 0.07 0.07+ 11 0.07 0.07+ 12 0.20 0.20+ 13 0.10 0.10+ 14 0.07 0.07+ 15 0.07 0.07+ 16 0.07 0.07+ 17 0.07 0.07+ 18 0.07 0.07+ 19 0.07 0.07+ 20 0.07 0.07\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\346\270\257\350\202\241\346\225\260\346\215\256/\346\270\257\350\202\241\344\272\244\346\230\223\346\227\245\345\216\206.md" "b/agent/src/skills/tushare/references/\346\270\257\350\202\241\346\225\260\346\215\256/\346\270\257\350\202\241\344\272\244\346\230\223\346\227\245\345\216\206.md"new file mode 100644index 000000000..791c0966d--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\270\257\350\202\241\346\225\260\346\215\256/\346\270\257\350\202\241\344\272\244\346\230\223\346\227\245\345\216\206.md"@@ -0,0 +1,62 @@+## ๆธฏ่กไบคๆๆฅๅ+----++ๆฅๅฃ๏ผhk_tradecal+ๆ่ฟฐ๏ผ่ทๅไบคๆๆฅๅ+้้๏ผๅๆฌกๆๅคง2000+ๆ้๏ผ็จๆท็งฏ็ดฏ2000็งฏๅๆๅฏ่ฐๅ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+is_open | str | N | ๆฏๅฆไบคๆ '0'ไผๅธ '1'ไบคๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+cal_date | str | Y | ๆฅๅๆฅๆ+is_open | int | Y | ๆฏๅฆไบคๆ '0'ไผๅธ '1'ไบคๆ+pretrade_date | str | Y | ไธไธไธชไบคๆๆฅ++++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++df = pro.hk_tradecal(start_date='20200101', end_date='20200708')+++```++<br>+<br>++**ๆฐๆฎ็คบไพ**+++ cal_date is_open pretrade_date+ 0 20200708 1 20200707+ 1 20200707 1 20200706+ 2 20200706 1 20200703+ 3 20200705 0 20200702+ 4 20200704 0 20200702+ 5 20200703 1 20200702+ 6 20200702 1 20200630+ 7 20200701 0 20200629+diff --git "a/agent/src/skills/tushare/references/\346\270\257\350\202\241\346\225\260\346\215\256/\346\270\257\350\202\241\345\210\206\351\222\237\350\241\214\346\203\205.md" "b/agent/src/skills/tushare/references/\346\270\257\350\202\241\346\225\260\346\215\256/\346\270\257\350\202\241\345\210\206\351\222\237\350\241\214\346\203\205.md"new file mode 100644index 000000000..05863c4fc--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\270\257\350\202\241\346\225\260\346\215\256/\346\270\257\350\202\241\345\210\206\351\222\237\350\241\214\346\203\205.md"@@ -0,0 +1,83 @@+## ๆธฏ่กๅ้่กๆ+----++ๆฅๅฃ๏ผhk_mins+ๆ่ฟฐ๏ผๆธฏ่กๅ้ๆฐๆฎ๏ผๆฏๆ1min/5min/15min/30min/60min่กๆ ๏ผๆไพPython SDKๅ http Restful APIไธค็งๆนๅผ+้้๏ผๅๆฌกๆๅคง8000่กๆฐๆฎ๏ผๅฏไปฅ้่ฟ่ก็ฅจไปฃ็ ๅๆฅๆๅพช็ฏ่ทๅ+ๆ้๏ผ120็งฏๅๅฏไปฅ่ฐๅ2ๆฌกๆฅๅฃๆฅ็ๆฐๆฎ๏ผๆญฃๅผๆ้่ฏทๅ้ <u>[ๆ้่ฏดๆ](https://tushare.pro/document/1?doc_id=290) </u> ใ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ ๏ผe.g.00001.HK+freq | str | Y | ๅ้้ขๅบฆ๏ผ1min/5min/15min/30min/60min๏ผ+start_date | datetime | N | ๅผๅงๆฅๆ ๆ ผๅผ๏ผ2023-03-13 09:00:00+end_date | datetime | N | ็ปๆๆถ้ด ๆ ผๅผ๏ผ2023-03-13 19:00:00++<br>+<br>+++**freqๅๆฐ่ฏดๆ**++freq | ่ฏดๆ+--- | ----+1min | 1ๅ้+5min | 5ๅ้+15min | 15ๅ้+30min | 30ๅ้+60min | 60ๅ้++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +trade_time | str | Y | ไบคๆๆถ้ด+open | float | Y | ๅผ็ไปท+close | float | Y | ๆถ็ไปท+high | float | Y | ๆ้ซไปท+low | float | Y | ๆไฝไปท+vol | int | Y | ๆไบค้+amount | float | Y | ๆไบค้้ข++<br>+<br>++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++df = pro.hk_mins(ts_code='00001.HK', freq='1min', start_date='2023-03-13 09:00:00', end_date='2023-03-13 19:00:00')++```++<br>+<br>+++**ๆฐๆฎๆ ทไพ**++ ts_code trade_time open close high low vol amount+ 0 00001.HK 2023-03-13 16:10:00 48.80 48.75 48.80 48.75 375500.0 18305625.0+ 1 00001.HK 2023-03-13 16:00:00 48.80 48.80 48.85 48.75 12000.0 585575.0+ 2 00001.HK 2023-03-13 15:59:00 48.80 48.80 48.80 48.75 12500.0 609825.0+ 3 00001.HK 2023-03-13 15:58:00 48.85 48.80 48.85 48.75 9500.0 463725.0+ 4 00001.HK 2023-03-13 15:57:00 48.80 48.80 48.85 48.75 24000.0 1171450.0+ .. ... ... ... ... ... ... ... ...+ 327 00001.HK 2023-03-13 09:34:00 47.40 47.35 47.45 47.35 17000.0 805975.0+ 328 00001.HK 2023-03-13 09:33:00 47.55 47.40 47.55 47.40 11000.0 521725.0+ 329 00001.HK 2023-03-13 09:32:00 47.60 47.55 47.70 47.50 52500.0 2497550.0+ 330 00001.HK 2023-03-13 09:31:00 47.30 47.60 47.60 47.30 44229.0 2097256.7+ 331 00001.HK 2023-03-13 09:30:00 47.30 47.30 47.30 47.30 469900.0 22298550.0++diff --git "a/agent/src/skills/tushare/references/\346\270\257\350\202\241\346\225\260\346\215\256/\346\270\257\350\202\241\345\210\251\346\266\246\350\241\250.md" "b/agent/src/skills/tushare/references/\346\270\257\350\202\241\346\225\260\346\215\256/\346\270\257\350\202\241\345\210\251\346\266\246\350\241\250.md"new file mode 100644index 000000000..bb6721310--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\270\257\350\202\241\346\225\260\346\215\256/\346\270\257\350\202\241\345\210\251\346\266\246\350\241\250.md"@@ -0,0 +1,85 @@+## ๆธฏ่กๅฉๆถฆ่กจ+----++ๆฅๅฃ๏ผhk_income๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆ่ฟฐ๏ผ่ทๅๆธฏ่กไธๅธๅ ฌๅธ่ดขๅกๅฉๆถฆ่กจๆฐๆฎ+ๆ้๏ผ้ๅ็ฌๅผๆ้ๆๆ15000็งฏๅ๏ผๅ ทไฝๆ้ไฟกๆฏ่ฏทๅ่[ๆ้ๅ่กจ](https://tushare.pro/document/1?doc_id=290)+ๆ็คบ๏ผๅฝๅๆฅๅฃๆๅๅช่ก็ฅจ่ทๅๅ ถๅๅฒๆฐๆฎ๏ผๅๆฌก่ฏทๆฑๆๅคง่ฟๅ10000่กๆฐๆฎ๏ผๅฏๅพช็ฏๆๅ+++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +period | str | N | ๆฅๅๆ(ๆ ผๅผ๏ผYYYYMMDD๏ผ+ind_name | str | N | ๆๆ ๅ๏ผๅฆ๏ผ่ฅไธ้ข๏ผ+start_date | str | N | ๆฅๅๆๅผๅงๆฅๆ๏ผๆ ผๅผ๏ผYYYYMMDD๏ผ+end_date | str | N | ๆฅๅ็ปๆๅงๆฅๆ๏ผๆ ผๅผ๏ผYYYYMMDD๏ผ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +end_date | str | Y | ๆฅๅๆ+name | str | Y | ่ก็ฅจๅ็งฐ+ind_name | str | Y | ่ดขๅก็ง็ฎๅ็งฐ+ind_value | float | Y | ่ดขๅก็ง็ฎๅผ++<br>+<br>++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++#่ทๅ่ พ่ฎฏๆง่ก00700.HK่ก็ฅจ็2024ๅนดๅบฆๅฉๆถฆ่กจๆฐๆฎ+df = pro.hk_income(ts_code='00700.HK', period='20241231')++#่ทๅ่ พ่ฎฏๆง่ก00700.HK่ก็ฅจๅฉๆถฆ่กจๅๅนด่ฅไธ้ขๆฐๆฎ+df = pro.hk_income(ts_code='00700.HK', ind_name='่ฅไธ้ข')++```++<br>+<br>++**ๆฐๆฎๆ ทไพ**++ ts_code end_date name ind_name ind_value+ 0 00700.HK 20241231 ่ พ่ฎฏๆง่ก ่ฅไธ้ข 6.524980e+11+ 1 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๅ ถไปๅ จ้ขๆถ็ๅ ถไป้กน็ฎ 8.787500e+10+ 2 00700.HK 20241231 ่ พ่ฎฏๆง่ก ่ฅ่ฟๆถๅ ฅ 6.602570e+11+ 3 00700.HK 20241231 ่ พ่ฎฏๆง่ก ่ฅ่ฟๆฏๅบ 3.110110e+11+ 4 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๆฏๅฉ 3.492460e+11+ 5 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๅ ถไปๆถ็ 8.002000e+09+ 6 00700.HK 20241231 ่ พ่ฎฏๆง่ก ้ๅฎๅๅ้่ดน็จ 3.638800e+10+ 7 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๅ ถไป่ฅไธๆถๅ ฅ 7.759000e+09+ 8 00700.HK 20241231 ่ พ่ฎฏๆง่ก ็ป่ฅๆบขๅฉ 2.080990e+11+ 9 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๅฉๆฏๆถๅ ฅ 1.600400e+10+ 10 00700.HK 20241231 ่ พ่ฎฏๆง่ก ่่ตๆๆฌ 1.198100e+10+ 11 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๅบๅ ่่ฅๅ ฌๅธๆบขๅฉ 2.517600e+10+ 12 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๆบขๅฉๅ ถไป้กน็ฎ 4.187000e+09+ 13 00700.HK 20241231 ่ พ่ฎฏๆง่ก ้ค็จๅๆบขๅฉ 2.414850e+11+ 14 00700.HK 20241231 ่ พ่ฎฏๆง่ก ็จ้กน 4.501800e+10+ 15 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๆ็ปญ็ป่ฅไธๅก็จๅๅฉๆถฆ 1.964670e+11+ 16 00700.HK 20241231 ่ พ่ฎฏๆง่ก ้ค็จๅๆบขๅฉ 1.964670e+11+ 17 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๅฐๆฐ่กไธๆ็ 2.394000e+09+ 18 00700.HK 20241231 ่ พ่ฎฏๆง่ก ่กไธๅบๅ ๆบขๅฉ 1.940730e+11+ 19 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๆฏ่กๅบๆฌ็ๅฉ 2.094000e+01+ 20 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๆฏ่กๆ่็ๅฉ 2.049000e+01+ 21 00700.HK 20241231 ่ พ่ฎฏๆง่ก ้่ฟ็ฎ้กน็ฎ -3.110110e+11+ 22 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๅ ถไปๅ จ้ขๆถ็ 8.787500e+10+ 23 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๅ จ้ขๆถ็ๆป้ข 2.843420e+11+ 24 00700.HK 20241231 ่ พ่ฎฏๆง่ก ้ๆง่กๆ็ๅบๅ ๅ จ้ขๆถ็ๆป้ข 5.333000e+09+ 25 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๆฌๅ ฌๅธๆฅๆไบบๅบๅ ๅ จ้ขๆถ็ๆป้ข 2.790090e+11+ 26 00700.HK 20241231 ่ พ่ฎฏๆง่ก ่กๆฟๅผๆฏ 1.127610e+11\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\346\270\257\350\202\241\346\225\260\346\215\256/\346\270\257\350\202\241\345\237\272\347\241\200\344\277\241\346\201\257.md" "b/agent/src/skills/tushare/references/\346\270\257\350\202\241\346\225\260\346\215\256/\346\270\257\350\202\241\345\237\272\347\241\200\344\277\241\346\201\257.md"new file mode 100644index 000000000..f91bfa753--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\270\257\350\202\241\346\225\260\346\215\256/\346\270\257\350\202\241\345\237\272\347\241\200\344\277\241\346\201\257.md"@@ -0,0 +1,84 @@+## ๆธฏ่กๅ่กจ+----++ๆฅๅฃ๏ผhk_basic+ๆ่ฟฐ๏ผ่ทๅๆธฏ่กๅ่กจไฟกๆฏ+ๆฐ้๏ผๅๆฌกๅฏๆๅๅ จ้จๅจไบคๆ็ๆธฏ่กๅ่กจๆฐๆฎ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | TSไปฃ็ +list_status | str | N | ไธๅธ็ถๆ Lไธๅธ D้ๅธ Pๆๅไธๅธ ๏ผ้ป่ฎคL++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y |+name | str | Y | ่ก็ฅจ็ฎ็งฐ+fullname | str | Y | ๅ ฌๅธๅ จ็งฐ+enname | str | Y | ่ฑๆๅ็งฐ+cn_spell | str | Y | ๆผ้ณ+market | str | Y | ๅธๅบ็ฑปๅซ+list_status | str | Y | ไธๅธ็ถๆ+list_date | str | Y | ไธๅธๆฅๆ+delist_date | str | Y | ้ๅธๆฅๆ+trade_unit | float | Y | ไบคๆๅไฝ+isin | str | Y | ISINไปฃ็ +curr_type | str | Y | ่ดงๅธไปฃ็ +++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++#่ทๅๅ จ้จๅฏไบคๆ่ก็ฅจๅบ็กไฟกๆฏ+df = pro.hk_basic()++#่ทๅๅ จ้จ้ๅธ่ก็ฅจๅบ็กไฟกๆฏ+df = pro.hk_basic(list_status='D')++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code name ... isin curr_type+ 0 00001.HK ้ฟๅ ... KYG217651051 HKD+ 1 00002.HK ไธญ็ตๆง่ก ... HK0002007356 HKD+ 2 00003.HK ้ฆๆธฏไธญๅ็ คๆฐ ... HK0003000038 HKD+ 3 00004.HK ไน้พไป้ๅข ... HK0004000045 HKD+ 4 00005.HK ๆฑไธฐๆง่ก ... GB0005405286 HKD+ 5 00006.HK ็ต่ฝๅฎไธ ... HK0006000050 HKD+ 6 00007.HK ้ฆๆธฏ้่้ๅข ... BMG4613K1099 HKD+ 7 00008.HK ็ต่ฎฏ็็ง ... HK0008011667 HKD+ 8 00009.HK ไนๅท่ฟ้ ... BMG6547Y1057 HKD+ 9 00010.HK ๆ้้ๅข ... HK0010000088 HKD+ 10 00011.HK ๆ็้ถ่ก ... HK0011000095 HKD+ 11 00012.HK ๆๅบๅฐไบง ... HK0012000102 HKD+ 12 00014.HK ๅธๆ ๅ ดไธ ... HK0014000126 HKD+ 13 00015.HK ็ไฟกๆง่ก ... BMG932121434 HKD+ 14 00016.HK ๆฐ้ธฟๅบๅฐไบง ... HK0016000132 HKD+ 15 00017.HK ๆฐไธ็ๅๅฑ ... HK0017000149 HKD+ 16 00018.HK ไธๆนๆฅไธ้ๅข ... HK0018000155 HKD+ 17 00019.HK ๅคชๅค่กไปฝๅ ฌๅธA ... HK0019000162 HKD+ 18 00020.HK ไผๅพทไธฐ ... HK0020000177 HKD+ 19 00021.HK ๅคงไธญๅๅฐไบงๆง่ก ... HK0000132420 HKD+ 20 00022.HK ่็ๆง่ก ... BMG6051D1175 HKD\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\346\270\257\350\202\241\346\225\260\346\215\256/\346\270\257\350\202\241\345\244\215\346\235\203\345\233\240\345\255\220.md" "b/agent/src/skills/tushare/references/\346\270\257\350\202\241\346\225\260\346\215\256/\346\270\257\350\202\241\345\244\215\346\235\203\345\233\240\345\255\220.md"new file mode 100644index 000000000..715a1c5a9--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\270\257\350\202\241\346\225\260\346\215\256/\346\270\257\350\202\241\345\244\215\346\235\203\345\233\240\345\255\220.md"@@ -0,0 +1,68 @@+## ๆธฏ่กๅคๆๅ ๅญ+----++ๆฅๅฃ๏ผhk_adjfactor+ๆ่ฟฐ๏ผ่ทๅๆธฏ่กๆฏๆฅๅคๆๅ ๅญๆฐๆฎ๏ผๆฏๅคฉๆปๅจๅทๆฐ+้้๏ผๅๆฌกๆๅคง6000่กๆฐๆฎ๏ผๅฏไปฅๆ นๆฎๆฅๆๅพช็ฏ+ๆ้๏ผๆฌๆฅๅฃๆฏๅจๅผ้ๆธฏ่กๆฅ็บฟๆ้ๅ่ชๅจ่ทๅๆ้๏ผๆ้่ฏทๅ่[ๆ้่ฏดๆๆๆกฃ](https://tushare.pro/document/1?doc_id=290)++<br>+<br>+++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ๏ผๆ ผๅผ๏ผYYYYMMDD๏ผไธๅ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+cum_adjfactor | float | Y | ็ดฏ่ฎกๅคๆๅ ๅญ+close_price | float | Y | ๆถ็ไปท++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++#่ทๅๆธฏ่กๅไธ่ก็ฅจๅคๆๅ ๅญ+df = pro.hk_adjfactor(ts_code='00001.HK', start_date='20240101', end_date='20251022')++#่ทๅๆธฏ่กๆไธๆฅๅ จ้จ่ก็ฅจ็ๅคๆๅ ๅญ+df = pro.hk_adjfactor(trade_date='20251031')++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code trade_date cum_adjfactor close_price+ 0 00380.HK 20251031 1.000000 0.150000+ 1 00698.HK 20251031 1.000000 4.610000+ 2 00865.HK 20251031 1.000000 0.038000+ 3 08111.HK 20251031 1.000000 0.068000+ 4 00039.HK 20251031 1.000000 0.088000+ ... ... ... ... ...+ 4086 01384.HK 20251031 1.000000 113.700000+ 4087 02954.HK 20251031 1.000000 0.265000+ 4088 03460.HK 20251031 1.000000 7.440000+ 4089 83460.HK 20251031 1.000000 6.840000+ 4090 09460.HK 20251031 1.000000 0.960000diff --git "a/agent/src/skills/tushare/references/\346\270\257\350\202\241\346\225\260\346\215\256/\346\270\257\350\202\241\345\244\215\346\235\203\350\241\214\346\203\205.md" "b/agent/src/skills/tushare/references/\346\270\257\350\202\241\346\225\260\346\215\256/\346\270\257\350\202\241\345\244\215\346\235\203\350\241\214\346\203\205.md"new file mode 100644index 000000000..5ae8d0c2d--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\270\257\350\202\241\346\225\260\346\215\256/\346\270\257\350\202\241\345\244\215\346\235\203\350\241\214\346\203\205.md"@@ -0,0 +1,86 @@+## ๆธฏ่กๅคๆ่กๆ+----++ๆฅๅฃ๏ผhk_daily_adj๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆ่ฟฐ๏ผ่ทๅๆธฏ่กๅคๆ่กๆ ๏ผๆไพ่ก็ฅจ่กๆฌใๅธๅผๅๆไบคๅๆขๆๅคไธชๆฐๆฎๆๆ +้้๏ผๅๆฌกๆๅคงๅฏไปฅๆๅ6000ๆกๆฐๆฎ๏ผๅฏๅพช็ฏ่ทๅๅ จ้จ๏ผๆฏๆๅ้กตๆๅ+่ฆๆฑ๏ผ120็งฏๅๅฏไปฅ่ฏ็จๆฅ็ๆฐๆฎ๏ผๅผ้ๆญฃๅผๆ้่ฏทๅ่[ๆ้่ฏดๆๆๆกฃ](https://tushare.pro/document/1?doc_id=290)++ๆณจ๏ผๆธฏ่กๅคๆ้ป่พๆฏ๏ผไปทๆ ผ * ๅคๆๅ ๅญ = ๅคๆไปทๆ ผ๏ผๆฏๅฆclose * adj_factor = ๅๅคๆๆถ็ไปทใๅคๆๅ ๅญๅๅฒๆฐๆฎๅฏ่ฝ้คๆ็ญ่ขซๅทๆฐ๏ผ่ฏทๆณจๆๅจๆๆดๆฐใ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ ๏ผe.g. 00001.HK๏ผ+trade_date | str | N | ไบคๆๆฅๆ๏ผYYYYMMDD๏ผ+start_date | str | N | ๅผๅงๆฅๆ๏ผYYYYMMDD๏ผ+end_date | str | N | ็ปๆๆฅๆ๏ผYYYYMMDD๏ผ++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+close | float | Y | ๆถ็ไปท+open | float | Y | ๅผ็ไปท+high | float | Y | ๆ้ซไปท+low | float | Y | ๆไฝไปท+pre_close | float | Y | ๆจๆถไปท+change | float | Y | ๆถจ่ท้ข+pct_change | float | Y | ๆถจ่ทๅน+vol | None | Y | ๆไบค้+amount | float | Y | ๆไบค้ข+vwap | float | Y | ๅนณๅไปท+adj_factor | float | Y | ๅคๆๅ ๅญ+turnover_ratio | float | Y | ๆขๆ็(ๅบไบๆป่กๆฌ)+free_share | None | Y | ๆต้่กๆฌ+total_share | None | Y | ๆป่กๆฌ+free_mv | float | Y | ๆต้ๅธๅผ+total_mv | float | Y | ๆปๅธๅผ+++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++#่ทๅๅไธ่ก็ฅจ่กๆ+df = pro.hk_daily_adj(ts_code='00001.HK', start_date='20240101', end_date='20240722')++#่ทๅๆไธๆฅๆไธชไบคๆๆ็ๅ จ้จ่ก็ฅจ+df = pro.hk_daily_adj(trade_date='20240722')++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code trade_date close pre_close vol adj_factor turnover_ratio+ 0 00001.HK 20240722 40.95 40.90 2799284 1.0000 0.07+ 1 00001.HK 20240719 40.90 40.85 6472801 1.0000 0.17+ 2 00001.HK 20240718 40.85 40.50 5498406 1.0000 0.14+ 3 00001.HK 20240717 40.50 39.95 4151953 1.0000 0.11+ 4 00001.HK 20240716 39.95 40.15 3978223 1.0000 0.10+ .. ... ... ... ... ... ... ...+ 131 00001.HK 20240108 38.91 39.05 3271763 0.9572 0.09+ 132 00001.HK 20240105 39.05 39.24 2731319 0.9572 0.07+ 133 00001.HK 20240104 39.24 39.58 2800255 0.9572 0.07+ 134 00001.HK 20240103 39.58 39.48 3498817 0.9572 0.09+ 135 00001.HK 20240102 39.48 40.06 2782895 0.9572 0.07++ [136 rows x 7 columns]diff --git "a/agent/src/skills/tushare/references/\346\270\257\350\202\241\346\225\260\346\215\256/\346\270\257\350\202\241\345\256\236\346\227\266\346\227\245\347\272\277.md" "b/agent/src/skills/tushare/references/\346\270\257\350\202\241\346\225\260\346\215\256/\346\270\257\350\202\241\345\256\236\346\227\266\346\227\245\347\272\277.md"new file mode 100644index 000000000..f47ada9d1--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\270\257\350\202\241\346\225\260\346\215\256/\346\270\257\350\202\241\345\256\236\346\227\266\346\227\245\347\272\277.md"@@ -0,0 +1,71 @@+## ๆธฏ่กๅฎๆถๆฅ็บฟ+----++ๆฅๅฃ๏ผrt_hk_k+ๆ่ฟฐ๏ผ่ทๅๆธฏ่กๅฎๆถๆฅk็บฟ่กๆ ๏ผๆฏๆๆ่ก็ฅจไปฃ็ ๅ่ก็ฅจไปฃ็ ้้ ็ฌฆไธๆฌกๆงๆๅๅ จ้จ่ก็ฅจๅฎๆถๆฅk็บฟ่กๆ+้้๏ผๅๆฌกๆๅคงๅฏๆๅ5000ๆกๆฐๆฎ+็งฏๅ๏ผๆฌๆฅๅฃๆฏๅ็ฌๅผๆ้็ๆฐๆฎ๏ผๅ็ฌ็ณ่ฏทๆ้่ฏทๅ่[ๆ้ๅ่กจ](https://tushare.pro/document/1?doc_id=290)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ๆฏๆ้้ ็ฌฆๆนๅผ๏ผe.g. 00001.HKใ02*.HK++<br>+ๆณจ๏ผts_codeไปฃ็ ไธๅฎ่ฆๅธฆ<font color="red">.HK</font>ๅ็ผ++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +pre_close | float | Y | ๆจๆถไปท+close | float | Y | ๆถ็ไปท+high | float | Y | ๆ้ซไปท+open | float | Y | ๅผ็ไปท+low | float | Y | ๆไฝไปท+vol | float | Y | ๆไบค้๏ผ่ก๏ผ+amount | float | Y | ๆไบค้ข(ๅ )+++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++#่ทๅ็นๅฎ่ก็ฅจๅฎๆถๆฅ็บฟ+df = pro.rt_hk_k(ts_code='00001.HK')++#่ทๅไปๆฅๅผ็ไปฅๆฅ้จๅๆธฏ่กๅฎๆถๆฅ็บฟ+df = pro.rt_hk_k(ts_code='01*.HK')++```+++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code pre_close close high open low vol amount+ 0 01508.HK 1.040 1.030 1.050 1.040 1.030 14971000.0 15564320.00+ 1 01314.HK 0.210 0.211 0.211 0.210 0.210 40000.0 8420.00+ 2 01848.HK 3.940 3.910 3.950 3.940 3.890 300500.0 1176380.00+ 3 01150.HK 0.091 0.103 0.106 0.106 0.100 45000.0 4580.00+ 4 01875.HK 1.860 1.970 1.970 1.930 1.890 164000.0 316064.00+ .. ... ... ... ... ... ... ... ...+ 746 01653.HK 0.260 0.000 0.000 0.000 0.000 0.0 0.00+ 747 01729.HK 5.440 5.790 5.800 5.440 5.380 6778621.0 37845706.87+ 748 01608.HK 0.290 0.285 0.290 0.290 0.285 142000.0 41170.00+ 749 01247.HK 1.700 1.700 1.750 1.740 1.700 120400.0 206708.00+ 750 01878.HK 1.890 1.900 1.950 1.900 1.840 191100.0 362691.00\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\346\270\257\350\202\241\346\225\260\346\215\256/\346\270\257\350\202\241\346\227\245\347\272\277\350\241\214\346\203\205.md" "b/agent/src/skills/tushare/references/\346\270\257\350\202\241\346\225\260\346\215\256/\346\270\257\350\202\241\346\227\245\347\272\277\350\241\214\346\203\205.md"new file mode 100644index 000000000..723921ffc--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\270\257\350\202\241\346\225\260\346\215\256/\346\270\257\350\202\241\346\227\245\347\272\277\350\241\214\346\203\205.md"@@ -0,0 +1,86 @@+## ๆธฏ่ก่กๆ+----++ๆฅๅฃ๏ผhk_daily๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆ่ฟฐ๏ผ่ทๅๆธฏ่กๆฏๆฅๅข้ๅๅๅฒ่กๆ ๏ผๆฏๆฅ18็นๅทฆๅณๆดๆฐๅฝๆฅๆฐๆฎ+้้๏ผๅๆฌกๆๅคงๆๅ5000่ก่ฎฐๅฝ๏ผๅฏๅคๆฌกๆๅ๏ผๆป้ไธ้ๅถ+็งฏๅ๏ผๆฌๆฅๅฃๅ็ฌๅผๆ้๏ผๅ ทไฝ่ฏทๅ้ [ๆ้่ฏดๆ](https://tushare.pro/document/1?doc_id=290)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+open | float | Y | ๅผ็ไปท+high | float | Y | ๆ้ซไปท+low | float | Y | ๆไฝไปท+close | float | Y | ๆถ็ไปท+pre_close | float | Y | ๆจๆถไปท+change | float | Y | ๆถจ่ท้ข+pct_chg | float | Y | ๆถจ่ทๅน (%)+vol | float | Y | ๆไบค้(่ก)+amount | float | Y | ๆไบค้ข(ๅ )+++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++#่ทๅๅไธ่ก็ฅจ่กๆ+df = pro.hk_daily(ts_code='00001.HK', start_date='20190101', end_date='20190904')++#่ทๅๆไธๆฅๆๆ่ก็ฅจ+df = pro.hk_daily(trade_date='20190904')++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code trade_date open ... pct_chg vol amount+ 0 00001.HK 20190904 66.90 ... 3.45 8212577.0 5.619534e+08+ 1 00001.HK 20190903 66.40 ... -0.52 3905632.0 2.598397e+08+ 2 00001.HK 20190902 67.50 ... -0.71 6547427.0 4.397896e+08+ 3 00001.HK 20190830 69.60 ... -0.73 7731576.0 5.299299e+08+ 4 00001.HK 20190829 69.05 ... 0.36 7902900.0 5.428812e+08+ 5 00001.HK 20190828 69.05 ... -1.08 8973397.0 6.183098e+08+ 6 00001.HK 20190827 70.50 ... 0.00 6286907.0 4.359607e+08+ 7 00001.HK 20190826 69.40 ... -1.91 8054636.0 5.554714e+08+ 8 00001.HK 20190823 70.45 ... -0.42 5449506.0 3.863469e+08+ 9 00001.HK 20190822 71.50 ... -0.49 5299641.0 3.750118e+08+ 10 00001.HK 20190821 70.00 ... 1.71 7045145.0 5.019940e+08+ 11 00001.HK 20190820 70.60 ... 0.21 7844342.0 5.522724e+08+ 12 00001.HK 20190819 68.30 ... 3.02 10498548.0 7.332229e+08+ 13 00001.HK 20190816 66.30 ... 2.03 8311992.0 5.599711e+08+ 14 00001.HK 20190815 64.40 ... 2.23 9695771.0 6.378087e+08+ 15 00001.HK 20190814 66.25 ... -1.29 10816336.0 7.058398e+08+ 16 00001.HK 20190813 67.00 ... -2.58 12104207.0 8.037089e+08+ 17 00001.HK 20190812 67.35 ... -0.37 5775321.0 3.921880e+08+ 18 00001.HK 20190809 67.65 ... -0.15 5996124.0 4.078781e+08+ 19 00001.HK 20190808 67.65 ... 0.52 8208977.0 5.587438e+08+ 20 00001.HK 20190807 68.20 ... -1.31 8215702.0 5.567659e+08\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\346\270\257\350\202\241\346\225\260\346\215\256/\346\270\257\350\202\241\347\216\260\351\207\221\346\265\201\351\207\217\350\241\250.md" "b/agent/src/skills/tushare/references/\346\270\257\350\202\241\346\225\260\346\215\256/\346\270\257\350\202\241\347\216\260\351\207\221\346\265\201\351\207\217\350\241\250.md"new file mode 100644index 000000000..46e3619d4--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\270\257\350\202\241\346\225\260\346\215\256/\346\270\257\350\202\241\347\216\260\351\207\221\346\265\201\351\207\217\350\241\250.md"@@ -0,0 +1,110 @@+## ๆธฏ่ก็ฐ้ๆต้่กจ+----++ๆฅๅฃ๏ผhk_cashflow๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆ่ฟฐ๏ผ่ทๅๆธฏ่กไธๅธๅ ฌๅธ็ฐ้ๆต้่กจๆฐๆฎ+ๆ้๏ผ้ๅ็ฌๅผๆ้ๆๆ15000็งฏๅ๏ผๅ ทไฝๆ้ไฟกๆฏ่ฏทๅ่[ๆ้ๅ่กจ](https://tushare.pro/document/1?doc_id=290)+ๆ็คบ๏ผๅฝๅๆฅๅฃๆๅๅช่ก็ฅจ่ทๅๅ ถๅๅฒๆฐๆฎ๏ผๅๆฌก่ฏทๆฑๆๅคง่ฟๅ10000่กๆฐๆฎ๏ผๅฏๅพช็ฏๆๅ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +period | str | N | ๆฅๅๆ(ๆ ผๅผ๏ผYYYYMMDD๏ผ+ind_name | str | N | ๆๆ ๅ๏ผๅฆ๏ผๆฐๅข่ดทๆฌพ๏ผ+start_date | str | N | ๆฅๅๆๅผๅงๆฅๆ๏ผๆ ผๅผ๏ผYYYYMMDD๏ผ+end_date | str | N | ๆฅๅ็ปๆๅงๆฅๆ๏ผๆ ผๅผ๏ผYYYYMMDD๏ผ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +end_date | str | Y | ๆฅๅๆ+name | str | Y | ่ก็ฅจๅ็งฐ+ind_name | str | Y | ่ดขๅก็ง็ฎๅ็งฐ+ind_value | float | Y | ่ดขๅก็ง็ฎๅผ++<br>+<br>+++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()+++#่ทๅ่ พ่ฎฏๆง่ก00700.HK่ก็ฅจ็2024ๅนดๅบฆ่ตไบง่ดๅบ่กจๆฐๆฎ+df = pro.hk_cashflow(ts_code='00700.HK', period='20241231')++#่ทๅ่ พ่ฎฏๆง่ก00700.HK่ก็ฅจ่ตไบง่ดๅบ่กจๅๅนดๆฐๅขๅๆฌพๆฐๆฎ+df = pro.hk_cashflow(ts_code='00700.HK', ind_name='ๆฐๅขๅๆฌพ')++```++<br>+<br>+++**ๆฐๆฎๆ ทไพ**++ ts_code end_date name ind_name ind_value+ 0 00700.HK 20241231 ่ พ่ฎฏๆง่ก ้ค็จๅๆบขๅฉ(ไธๅกๅฉๆถฆ) 2.414850e+11+ 1 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๅ่ก่กไปฝ 2.093000e+09+ 2 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๅ :ๅฉๆฏๆฏๅบ 1.244700e+10+ 3 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๅ:ๆ่ตๆถ็ 7.150000e+08+ 4 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๅ:ๅบๅ ้ๅฑๅ ฌๅธๆบขๅฉ 2.517600e+10+ 5 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๅ :ๅๅผๅๆจๅค 9.983000e+09+ 6 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๅ:้ไผฐ็ไฝ 2.641000e+09+ 7 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๅ:ๅบๅฎ่ตไบงไนๆบขๅฉ 1.300400e+10+ 8 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๅ :ๆๆงๅๆ้ 5.621300e+10+ 9 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๅ:ๆฑๅ ๆถ็ 4.660000e+08+ 10 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๅ :็ป่ฅ่ฐๆดๅ ถไป้กน็ฎ 2.070200e+10+ 11 00700.HK 20241231 ่ พ่ฎฏๆง่ก ่ฅ่ฟ่ต้ๅๅจๅ็ป่ฅๆบขๅฉ 2.828240e+11+ 12 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๅญ่ดง(ๅขๅ )ๅๅฐ 2.000000e+07+ 13 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๅ:ๅฉๆฏๆถๅ ฅ 1.600400e+10+ 14 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๅบไปๅธๆฌพๅๅบ่ฎก่ดน็จๅขๅ (ๅๅฐ) 1.087200e+10+ 15 00700.HK 20241231 ่ พ่ฎฏๆง่ก ่ฅ่ฟ่ตๆฌๅๅจๅ ถไป้กน็ฎ -3.630000e+08+ 16 00700.HK 20241231 ่ พ่ฎฏๆง่ก ้ขไปๆฌพ้กนใๆ้ๅๅ ถไปๅบๆถๆฌพ้กนๅๅฐ(ๅขๅ ) 2.632000e+09+ 17 00700.HK 20241231 ่ พ่ฎฏๆง่ก ้ขๆถ่ดฆๆฌพใๆ้ๅๅ ถไปๅบไปๆฌพๅขๅ (ๅๅฐ) -6.765000e+09+ 18 00700.HK 20241231 ่ พ่ฎฏๆง่ก ้ๅปถๆถๅ ฅ(ๅขๅ )ๅๅฐ 1.653300e+10+ 19 00700.HK 20241231 ่ พ่ฎฏๆง่ก ็ป่ฅไบง็็ฐ้ 3.047050e+11+ 20 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๅทฒไป็จ้กน 4.618400e+10+ 21 00700.HK 20241231 ่ พ่ฎฏๆง่ก ็ป่ฅไธๅก็ฐ้ๅ้ข 2.585210e+11+ 22 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๅทฒๆถๅฉๆฏ(ๆ่ต) 1.491300e+10+ 23 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๅทฒๆถ่กๆฏ(ๆ่ต) 3.521000e+09+ 24 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๅญๆฌพๅๅฐ(ๅขๅ ) -5.227700e+10+ 25 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๅค็ฝฎๅบๅฎ่ตไบง 2.030000e+08+ 26 00700.HK 20241231 ่ พ่ฎฏๆง่ก ่ดญๅปบๆ ๅฝข่ตไบงๅๅ ถไป่ตไบง 3.312100e+10+ 27 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๅบๅฎ้ๅฑๅ ฌๅธ 4.895000e+09+ 28 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๆถ่ดญ้ๅฑๅ ฌๅธ 9.836000e+09+ 29 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๆถๅๆ่ตๆๅพ็ฐ้ 9.505200e+10+ 30 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๆ่ตๆฏไป็ฐ้ 8.246500e+10+ 31 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๆ่ตไธๅกๅ ถไป้กน็ฎ -6.307200e+10+ 32 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๆ่ตไธๅก็ฐ้ๅ้ข -1.221870e+11+ 33 00700.HK 20241231 ่ พ่ฎฏๆง่ก ่่ตๅ็ฐ้ๅ้ข 1.363340e+11+ 34 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๆฐๅขๅๆฌพ 1.145840e+11+ 35 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๅฟ่ฟๅๆฌพ 1.146910e+11+ 36 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๅทฒไปๅฉๆฏ(่่ต) 1.241700e+10+ 37 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๅทฒไป่กๆฏ(่่ต) 3.124400e+10+ 38 00700.HK 20241231 ่ พ่ฎฏๆง่ก ้่ฟ็ฎ้กน็ฎ 2.414850e+11+ 39 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๅ่ดญ่กไปฝ 1.057510e+11+ 40 00700.HK 20241231 ่ พ่ฎฏๆง่ก ่ตๅๅบๅธ 1.421300e+10+ 41 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๅฟ่ฟ่่ต็ง่ต 6.369000e+09+ 42 00700.HK 20241231 ่ พ่ฎฏๆง่ก ่ดญไนฐๅญๅ ฌๅธๅฐๆฐ่กๆ่ๆฏไป็็ฐ้ 8.381000e+09+ 43 00700.HK 20241231 ่ พ่ฎฏๆง่ก ่่ตไธๅกๅ ถไป้กน็ฎ -1.050000e+08+ 44 00700.HK 20241231 ่ พ่ฎฏๆง่ก ่่ตไธๅก็ฐ้ๅ้ข -1.764940e+11+ 45 00700.HK 20241231 ่ พ่ฎฏๆง่ก ็ฐ้ๅ้ข -4.016000e+10+ 46 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๆๅ็ฐ้ 1.723200e+11+ 47 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๆ้ดๅๅจๅ ถไป้กน็ฎ 3.590000e+08+ 48 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๆๆซ็ฐ้ 1.325190e+11+ 49 00700.HK 20241231 ่ พ่ฎฏๆง่ก ๅบๆถๅธๆฌพๅๅฐ -1.048000e+09diff --git "a/agent/src/skills/tushare/references/\346\270\257\350\202\241\346\225\260\346\215\256/\346\270\257\350\202\241\350\264\242\345\212\241\346\214\207\346\240\207\346\225\260\346\215\256.md" "b/agent/src/skills/tushare/references/\346\270\257\350\202\241\346\225\260\346\215\256/\346\270\257\350\202\241\350\264\242\345\212\241\346\214\207\346\240\207\346\225\260\346\215\256.md"new file mode 100644index 000000000..162d93dee--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\270\257\350\202\241\346\225\260\346\215\256/\346\270\257\350\202\241\350\264\242\345\212\241\346\214\207\346\240\207\346\225\260\346\215\256.md"@@ -0,0 +1,153 @@+## ๆธฏ่ก่ดขๅกๆๆ ๆฐๆฎ+----+ๆฅๅฃ๏ผhk_fina_indicator๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆ่ฟฐ๏ผ่ทๅๆธฏ่กไธๅธๅ ฌๅธ่ดขๅกๆๆ ๆฐๆฎ๏ผไธบ้ฟๅ ๆๅกๅจๅๅ๏ผ็ฐ้ถๆฎตๆฏๆฌก่ฏทๆฑๆๅค่ฟๅ200ๆก่ฎฐๅฝ๏ผๅฏ้่ฟ่ฎพ็ฝฎๆฅๆๅคๆฌก่ฏทๆฑ่ทๅๆดๅคๆฐๆฎใ+ๆ้๏ผ้ๅ็ฌๅผๆ้ๆๆ15000็งฏๅ๏ผๅ ทไฝๆ้ไฟกๆฏ่ฏทๅ่[ๆ้ๅ่กจ](https://tushare.pro/document/1?doc_id=290)+ๆ็คบ๏ผๅฝๅๆฅๅฃๆๅๅช่ก็ฅจ่ทๅๅ ถๅๅฒๆฐๆฎ๏ผๅๆฌก่ฏทๆฑๆๅคง่ฟๅ10000่กๆฐๆฎ๏ผๅฏๅพช็ฏๆๅ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +period | str | N | ๆฅๅๆ(ๆ ผๅผ๏ผYYYYMMDD๏ผ+report_type | str | N | ๆฅๅๆ็ฑปๅ๏ผQ1ไธๅญฃๆฅQ2ๅๅนดๆฅQ3ไธๅญฃๆฅQ4ๅนดๆฅ๏ผ+start_date | str | N | ๆฅๅๆๅผๅงๆฅๆ(ๆ ผๅผ๏ผYYYYMMDD๏ผ+end_date | str | N | ๆฅๅ็ปๆๆฅๆ(ๆ ผๅผ๏ผYYYYMMDD๏ผ++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +name | str | Y | ่ก็ฅจๅ็งฐ+end_date | str | Y | ๆฅๅๆ+ind_type | str | Y | ๆฅๅ็ฑปๅ,Q-ๆๆฅๅๆ(ๅญฃๅบฆ),Y-ๆๅนดๅบฆ+report_type | str | Y | ๆฅๅๆ็ฑปๅ+std_report_date | str | Y | ๆ ๅๆฅๅๆ+per_netcash_operate | float | Y | ๆฏ่ก็ป่ฅ็ฐ้ๆต(ๅ )+per_oi | float | Y | ๆฏ่ก่ฅไธๆถๅ ฅ(ๅ )+bps | float | Y | ๆฏ่กๅ่ตไบง(ๅ )+basic_eps | float | Y | ๅบๆฌๆฏ่กๆถ็(ๅ )+diluted_eps | float | Y | ็จ้ๆฏ่กๆถ็(ๅ )+operate_income | float | Y | ่ฅไธๆปๆถๅ ฅ(ๅ )+operate_income_yoy | float | Y | ่ฅไธๆปๆถๅ ฅๅๆฏๅข้ฟ(%)+gross_profit | float | Y | ๆฏๅฉๆถฆ(ๅ )+gross_profit_yoy | float | Y | ๆฏๅฉๆถฆๅๆฏๅข้ฟ(%)+holder_profit | float | Y | ๅฝๆฏๅๅฉๆถฆ(ๅ )+holder_profit_yoy | float | Y | ๅฝๆฏๅๅฉๆถฆๅๆฏๅข้ฟ(%)+gross_profit_ratio | float | Y | ๆฏๅฉ็(%)+eps_ttm | float | Y | ttmๆฏ่กๆถ็(ๅ )+operate_income_qoq | float | Y | ่ฅไธๆปๆถๅ ฅๆปๅจ็ฏๆฏๅข้ฟ(%)+net_profit_ratio | float | Y | ๅๅฉ็(%)+roe_avg | float | Y | ๅนณๅๅ่ตไบงๆถ็็(%)+gross_profit_qoq | float | Y | ๆฏๅฉๆถฆๆปๅจ็ฏๆฏๅข้ฟ(%)+roa | float | Y | ๆป่ตไบงๅๅฉ็(%)+holder_profit_qoq | float | Y | ๅฝๆฏๅๅฉๆถฆๆปๅจ็ฏๆฏๅข้ฟ(%)+roe_yearly | float | Y | ๅนดๅๅ่ตไบงๆถ็็(%)+roic_yearly | float | Y | ๅนดๅๆ่ตๅๆฅ็(%)+total_assets | float | Y | ่ตไบงๆป้ข+total_liabilities | float | Y | ่ดๅบๆป้ข+tax_ebt | float | Y | ๆๅพ็จ/ๅฉๆถฆๆป้ข(%)+ocf_sales | float | Y | ็ป่ฅ็ฐ้ๆต/่ฅไธๆถๅ ฅ(%)+total_parent_equity | float | Y | ๆฌๅ ฌๅธๆ็ๆๆไบบๅบๅ ๆ็+debt_asset_ratio | float | Y | ่ตไบง่ดๅบ็(%)+operate_profit | float | Y | ็ป่ฅ็ๅฉ+pretax_profit | float | Y | ้ค็จๅ็ๅฉ+netcash_operate | float | Y | ็ป่ฅๆดปๅจๆๅพ็ฐ้ๆต้ๅ้ข+netcash_invest | float | Y | ๆ่ตๆดปๅจ่็จ็ฐ้ๆต้ๅ้ข+netcash_finance | float | Y | ่่ตๆดปๅจ่็จ็ฐ้ๆต้ๅ้ข+end_cash | float | Y | ๆๆซ็็ฐ้ๅ็ฐ้็ญไปท็ฉ+divi_ratio | float | Y | ๅ็บขๆฏไพ+dividend_rate | float | Y | ่กๆฏ็+current_ratio | float | Y | ๆตๅจๆฏ็(ๅ)+common_acs | float | Y | ๆฎ้่กๅบ่ฎก่กๆฏ+currentdebt_debt | float | Y | ๆตๅจ่ดๅบ/ๆป่ดๅบ(%)+issued_common_shares | float | Y | ๅทฒๅ่กๆฎ้่ก+hk_common_shares | float | Y | ๆธฏ่กๆฌ(**ไธๅปบ่ฎฎไฝฟ็จๆฐๆฎๆบๆ่ฏฏ**)+per_shares | float | Y | ๆฏๆ่กๆฐ+total_market_cap | float | Y | ๆปๅธๅผ+hksk_market_cap | float | Y | ๆธฏ่กๅธๅผ+pe_ttm | float | Y | ๆปๅจๅธ็็+pb_ttm | float | Y | ๆปๅจๅธๅ็+report_date_sq | str | Y | ๅญฃๆฅๆฅๆ+report_type_sq | str | Y | ๆฅๅ็ฑปๅ+operate_income_sq | float | Y | ่ฅไธๆถๅ ฅ+dps_hkd | float | Y | ๆฏ่ก่กๆฏ๏ผๆธฏๅ ๏ผ+operate_income_qoq_sq | float | Y | ่ฅไธๆถๅ ฅ็ฏๆฏ+net_profit_ratio_sq | float | Y | ๅๅฉๆถฆ็+holder_profit_sq | float | Y | ๅฝๅฑไบ่กไธๅๅฉๆถฆ+holder_profit_qoq_sq | float | Y | ๅฝๆฏๅๅฉๆถฆ็ฏๆฏ+roe_avg_sq | float | Y | ๅนณๅๅ่ตไบงๆถ็็+pe_ttm_sq | float | Y | ๅญฃๆฅๆปๅจๅธ็็+pb_ttm_sq | float | Y | ๅญฃๆฅๆปๅจๅธๅ็+roa_sq | float | Y | ๆป่ตไบงๆถ็็+start_date | float | Y | ไผ่ฎกๅนดๅบฆ่ตทๅงๆฅ+fiscal_year | float | Y | ไผ่ฎกๅนดๅบฆๆชๆญขๆฅ+currency | str | Y | ๅธ็งโๆธฏๅ ๏ผhkd๏ผ+is_cny_code | float | Y | ๆฏๅฆไบบๆฐๅธไปฃ็ +dps_hkd_ly | float | Y | ไธไธๅนดๆฏ่ก่กๆฏ+org_type | str | Y | ไผไธ็ฑปๅ+premium_income | float | Y | ไฟ่ดนๆถๅ ฅ+premium_income_yoy | float | Y | ไฟ่ดนๆถๅ ฅๅๆฏ+net_interest_income | float | Y | ๅๅฉๆฏๆถๅ ฅ+net_interest_income_yoy | float | Y | ๅๅฉๆฏๆถๅ ฅๅๆฏ+fee_commission_income | float | Y | ๆ็ปญ่ดนๅไฝฃ้ๆถๅ ฅ+fee_commission_income_yoy | float | Y | ๆ็ปญ่ดนๅไฝฃ้ๆถๅ ฅๅๆฏ+accounts_rece_tdays | float | Y | ๅบๆถ่ดฆๆฌพๅจ่ฝฌ็(ๆฌก)+inventory_tdays | float | Y | ๅญ่ดงๅจ่ฝฌ็(ๆฌก)+current_assets_tdays | float | Y | ๆตๅจ่ตไบงๅจ่ฝฌ็(ๆฌก)+total_assets_tdays | float | Y | ๆป่ตไบงๅจ่ฝฌ็(ๆฌก)+premium_expense | float | Y | ไฟ้ฉ่ตไปๆฏๅบ+loan_deposit | float | Y | ่ดทๆฌพ/ๅญๆฌพ+loan_equity | float | Y | ่ดทๆฌพ/่กไธๆ็+loan_assets | float | Y | ่ดทๆฌพ/ๆป่ตไบง+deposit_equity | float | Y | ๅญๆฌพ/่กไธๆ็+deposit_assets | float | Y | ๅญๆฌพ/ๆป่ตไบง+equity_multiplier | float | Y | ๆ็ไนๆฐ+equity_ratio | float | Y | ไบงๆๆฏ็++ๆณจ๏ผ่พๅบๆๆ ๅคชๅคๅฏๅจๆฅๅฃfieldsๅๆฐ่ฎพๅฎไฝ ้่ฆ็ๆๆ ๏ผไพๅฆ๏ผfields='ts_coe,bps,basic_eps'+<br>+<br>++++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++#่ทๅๆธฏ่ก่ พ่ฎฏๆง่ก00700.HK่ก็ฅจ2014ๅนดๅบฆ็่ดขๅกๆๆ ๆฐๆฎ+df = pro.hk_fina_indicator(ts_code='00700.HK', period='20241231')++#่ทๅๆธฏ่ก่ พ่ฎฏๆง่ก00700.HK่ก็ฅจๅๅนดๅนดๆฅ่ดขๅกๆๆ ๆฐๆฎ+df = pro.hk_fina_indicator(ts_code='00700.HK', report_type='Q4')++```++<br>+<br>++**ๆฐๆฎๆ ทไพ**++ ts_code name end_date ... deposit_assets equity_multiplier equity_ratio+ 0 00700.HK ่ พ่ฎฏๆง่ก 20250331 ... None 1.7083 0.7644+ 1 00700.HK ่ พ่ฎฏๆง่ก 20241231 ... None 1.6899 0.7469+ 2 00700.HK ่ พ่ฎฏๆง่ก 20240930 ... None 1.7576 0.8140+ 3 00700.HK ่ พ่ฎฏๆง่ก 20240630 ... None 1.7841 0.8451+ 4 00700.HK ่ พ่ฎฏๆง่ก 20240331 ... None 1.7962 0.8601+ .. ... ... ... ... ... ... ...+ 86 00700.HK ่ พ่ฎฏๆง่ก 20030930 ... None NaN NaN+ 87 00700.HK ่ พ่ฎฏๆง่ก 20030630 ... None NaN NaN+ 88 00700.HK ่ พ่ฎฏๆง่ก 20030331 ... None NaN NaN+ 89 00700.HK ่ พ่ฎฏๆง่ก 20021231 ... None 1.0794 0.0794+ 90 00700.HK ่ พ่ฎฏๆง่ก 20011231 ... None 1.3563 0.3563\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\346\270\257\350\202\241\346\225\260\346\215\256/\346\270\257\350\202\241\350\265\204\344\272\247\350\264\237\345\200\272\350\241\250.md" "b/agent/src/skills/tushare/references/\346\270\257\350\202\241\346\225\260\346\215\256/\346\270\257\350\202\241\350\265\204\344\272\247\350\264\237\345\200\272\350\241\250.md"new file mode 100644index 000000000..1f51ec74f--- /dev/null+++ "b/agent/src/skills/tushare/references/\346\270\257\350\202\241\346\225\260\346\215\256/\346\270\257\350\202\241\350\265\204\344\272\247\350\264\237\345\200\272\350\241\250.md"@@ -0,0 +1,112 @@+## ๆธฏ่ก่ตไบง่ดๅบ่กจ+----+ๆฅๅฃ๏ผhk_balancesheet๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆ่ฟฐ๏ผ่ทๅๆธฏ่กไธๅธๅ ฌๅธ่ตไบง่ดๅบ่กจ+ๆ้๏ผ้ๅ็ฌๅผๆ้ๆๆ15000็งฏๅ๏ผๅ ทไฝๆ้ไฟกๆฏ่ฏทๅ่[ๆ้ๅ่กจ](https://tushare.pro/document/1?doc_id=290)+ๆ็คบ๏ผๅฝๅๆฅๅฃๆๅๅช่ก็ฅจ่ทๅๅ ถๅๅฒๆฐๆฎ๏ผๅๆฌก่ฏทๆฑๆๅคง่ฟๅ10000่กๆฐๆฎ๏ผๅฏๅพช็ฏๆๅ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +period | str | N | ๆฅๅๆ(ๆ ผๅผ๏ผYYYYMMDD๏ผ+ind_name | str | N | ๆๆ ๅ๏ผๅฆ๏ผๅบๆถๅธๆฌพ๏ผ+start_date | str | N | ๆฅๅๆๅผๅงๆฅๆ๏ผๆ ผๅผ๏ผYYYYMMDD๏ผ+end_date | str | N | ๆฅๅ็ปๆๅงๆฅๆ๏ผๆ ผๅผ๏ผYYYYMMDD๏ผ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +name | str | Y | ่ก็ฅจๅ็งฐ+end_date | str | Y | ๆฅๅๆ+ind_name | str | Y | ่ดขๅก็ง็ฎๅ็งฐ+ind_value | float | Y | ่ดขๅก็ง็ฎๅผ++<br>+<br>++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++#่ทๅๆธฏ่ก่ พ่ฎฏๆง่ก00700.HK่ก็ฅจ2014ๅนดๅบฆ็่ตไบง่ดๅบ่กจๆฐๆฎ+df = pro.hk_balancesheet(ts_code='00700.HK', period='20241231')++#่ทๅๆธฏ่ก่ พ่ฎฏๆง่ก00700.HK่ก็ฅจๅๅนดๅบๆถๅธๆฌพๆๆ ๆฐๆฎ+df = pro.hk_balancesheet(ts_code='00700.HK', ind_name='ๅบๆถๅธๆฌพ')++```++<br>+<br>+++**ๆฐๆฎๆ ทไพ**++ ts_code name end_date ind_name ind_value+ 0 00700.HK ่ พ่ฎฏๆง่ก 20241231 ็ฉไธๅๆฟๅ่ฎพๅค 8.018500e+10+ 1 00700.HK ่ พ่ฎฏๆง่ก 20241231 ้ๆตๅจ่ดๅบๅ่ฎก 3.301900e+11+ 2 00700.HK ่ พ่ฎฏๆง่ก 20241231 ๆ ๅฝข่ตไบง 1.961270e+11+ 3 00700.HK ่ พ่ฎฏๆง่ก 20241231 ๅๅฐไฝฟ็จๆ 2.311700e+10+ 4 00700.HK ่ พ่ฎฏๆง่ก 20241231 ๅจๅปบๅทฅ็จ 1.230200e+10+ 5 00700.HK ่ พ่ฎฏๆง่ก 20241231 ้ๅปถ็จ้กน่ตไบง 2.832500e+10+ 6 00700.HK ่ พ่ฎฏๆง่ก 20241231 ้ขไปๆฌพ้กน 4.282800e+10+ 7 00700.HK ่ พ่ฎฏๆง่ก 20241231 ่่ฅๅ ฌๅธๆ็ 2.903430e+11+ 8 00700.HK ่ พ่ฎฏๆง่ก 20241231 ๅ่ฅๅ ฌๅธๆ็ 7.072000e+09+ 9 00700.HK ่ พ่ฎฏๆง่ก 20241231 ๆๅฎไปฅๅ ฌๅ ไปทๅผ่ฎฐ่ดฆไน้่่ตไบง 5.073590e+11+ 10 00700.HK ่ พ่ฎฏๆง่ก 20241231 ไธญ้ฟๆๅญๆฌพ 7.760100e+10+ 11 00700.HK ่ พ่ฎฏๆง่ก 20241231 ๅ ถไป้่่ตไบง(้ๆตๅจ) 1.076000e+09+ 12 00700.HK ่ พ่ฎฏๆง่ก 20241231 ้ๆตๅจ่ตไบงๅ ถไป้กน็ฎ 1.767900e+10+ 13 00700.HK ่ พ่ฎฏๆง่ก 20241231 ้ๆตๅจ่ตไบงๅ่ฎก 1.284815e+12+ 14 00700.HK ่ พ่ฎฏๆง่ก 20241231 ๆ่ต็ฉไธ 8.010000e+08+ 15 00700.HK ่ พ่ฎฏๆง่ก 20241231 ๅบๆถๅธๆฌพ 4.820300e+10+ 16 00700.HK ่ พ่ฎฏๆง่ก 20241231 ้ขไปๆฌพๆ้ๅๅ ถไปๅบๆถๆฌพ 1.010440e+11+ 17 00700.HK ่ พ่ฎฏๆง่ก 20241231 ๅ้ๅถๅญๆฌพๅ็ฐ้ 3.334000e+09+ 18 00700.HK ่ พ่ฎฏๆง่ก 20241231 ็ฐ้ๅ็ญไปท็ฉ 1.325190e+11+ 19 00700.HK ่ พ่ฎฏๆง่ก 20241231 ็ญๆๅญๆฌพ 1.929770e+11+ 20 00700.HK ่ พ่ฎฏๆง่ก 20241231 ๆๅฎไปฅๅ ฌๅ ไปทๅผ่ฎฐ่ดฆไน้่่ตไบง(ๆตๅจ) 1.291300e+10+ 21 00700.HK ่ พ่ฎฏๆง่ก 20241231 ๅ ถไป้่่ตไบง(ๆตๅจ) 4.750000e+09+ 22 00700.HK ่ พ่ฎฏๆง่ก 20241231 ๆตๅจ่ตไบงๅ่ฎก 4.961800e+11+ 23 00700.HK ่ พ่ฎฏๆง่ก 20241231 ๆป่ตไบง 1.780995e+12+ 24 00700.HK ่ พ่ฎฏๆง่ก 20241231 ๅบไปๅธๆฌพ 1.187120e+11+ 25 00700.HK ่ พ่ฎฏๆง่ก 20241231 ๅบไป็ฅจๆฎ 8.623000e+09+ 26 00700.HK ่ พ่ฎฏๆง่ก 20241231 ๅบไป็จ้กน 2.062400e+10+ 27 00700.HK ่ พ่ฎฏๆง่ก 20241231 ่่ต็ง่ต่ดๅบ(ๆตๅจ) 5.600000e+09+ 28 00700.HK ่ พ่ฎฏๆง่ก 20241231 ้ๅปถๆถๅ ฅ(ๆตๅจ) 1.000970e+11+ 29 00700.HK ่ พ่ฎฏๆง่ก 20241231 ๅ ถไปๅบไปๆฌพๅๅบ่ฎก่ดน็จ 8.403200e+10+ 30 00700.HK ่ พ่ฎฏๆง่ก 20241231 ็ญๆ่ดทๆฌพ 5.288500e+10+ 31 00700.HK ่ พ่ฎฏๆง่ก 20241231 ๅ ถไป้่่ดๅบ(ๆตๅจ) 6.336000e+09+ 32 00700.HK ่ พ่ฎฏๆง่ก 20241231 ๆตๅจ่ดๅบๅ่ฎก 3.969090e+11+ 33 00700.HK ่ พ่ฎฏๆง่ก 20241231 ๅๆตๅจ่ตไบง 9.927100e+10+ 34 00700.HK ่ พ่ฎฏๆง่ก 20241231 ๆป่ตไบงๅๆตๅจ่ดๅบ 1.384086e+12+ 35 00700.HK ่ พ่ฎฏๆง่ก 20241231 ้ฟๆ่ดทๆฌพ 1.465210e+11+ 36 00700.HK ่ พ่ฎฏๆง่ก 20241231 ้ๅปถ็จ้กน่ดๅบ 1.854600e+10+ 37 00700.HK ่ พ่ฎฏๆง่ก 20241231 ่่ต็ง่ต่ดๅบ(้ๆตๅจ) 1.389700e+10+ 38 00700.HK ่ พ่ฎฏๆง่ก 20241231 ้ๅปถๆถๅ ฅ(้ๆตๅจ) 6.236000e+09+ 39 00700.HK ่ พ่ฎฏๆง่ก 20241231 ้ฟๆๅบไปๆฌพ 1.020100e+10+ 40 00700.HK ่ พ่ฎฏๆง่ก 20241231 ๅบไป็ฅจๆฎ(้ๆตๅจ) 1.305860e+11+ 41 00700.HK ่ พ่ฎฏๆง่ก 20241231 ๅ ถไป้่่ดๅบ(้ๆตๅจ) 4.203000e+09+ 42 00700.HK ่ พ่ฎฏๆง่ก 20241231 ๆปๆ็ๅๆป่ดๅบ 1.780995e+12+ 43 00700.HK ่ พ่ฎฏๆง่ก 20241231 ๆป่ดๅบ 7.270990e+11+ 44 00700.HK ่ พ่ฎฏๆง่ก 20241231 ๅฐๆฐ่กไธๆ็ 8.034800e+10+ 45 00700.HK ่ พ่ฎฏๆง่ก 20241231 ๅ่ตไบง 1.053896e+12+ 46 00700.HK ่ พ่ฎฏๆง่ก 20241231 ่กๆฌ NaN+ 47 00700.HK ่ พ่ฎฏๆง่ก 20241231 ่กๆฌๆบขไปท 4.307900e+10+ 48 00700.HK ่ พ่ฎฏๆง่ก 20241231 ไฟ็ๆบขๅฉ(็ดฏ่ฎกไบๆ) 8.920300e+11+ 49 00700.HK ่ พ่ฎฏๆง่ก 20241231 ๅ ถไปๅจๅค 4.203600e+10+ 50 00700.HK ่ พ่ฎฏๆง่ก 20241231 ๅบๅญ่ก -3.597000e+09+ 51 00700.HK ่ พ่ฎฏๆง่ก 20241231 ่กไธๆ็ 9.735480e+11+ 52 00700.HK ่ พ่ฎฏๆง่ก 20241231 ๆปๆ็ 1.053896e+12+ 53 00700.HK ่ พ่ฎฏๆง่ก 20241231 ๆปๆ็ๅ้ๆตๅจ่ดๅบ 1.384086e+12+ 54 00700.HK ่ พ่ฎฏๆง่ก 20241231 ๅญ่ดง 4.400000e+08\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\347\216\260\350\264\247\346\225\260\346\215\256/\344\270\212\346\265\267\351\273\204\351\207\221\345\237\272\347\241\200\344\277\241\346\201\257.md" "b/agent/src/skills/tushare/references/\347\216\260\350\264\247\346\225\260\346\215\256/\344\270\212\346\265\267\351\273\204\351\207\221\345\237\272\347\241\200\344\277\241\346\201\257.md"new file mode 100644index 000000000..f1de5e2dd--- /dev/null+++ "b/agent/src/skills/tushare/references/\347\216\260\350\264\247\346\225\260\346\215\256/\344\270\212\346\265\267\351\273\204\351\207\221\345\237\272\347\241\200\344\277\241\346\201\257.md"@@ -0,0 +1,68 @@+## ้ป้็ฐ่ดงๅบ็กไฟกๆฏ+----++ๆฅๅฃ๏ผsge_basic+ๆ่ฟฐ๏ผ่ทๅไธๆตท้ป้ไบคๆๆ็ฐ่ดงๅ็บฆๅบ็กไฟกๆฏ+้้๏ผๅๆฌกๆๅคง100ๆก๏ผๅฝๅ็ฐ่ดงๅ็บฆๆฐไธ่ถณ20ไธช๏ผๅฏไปฅไธๆฌกๆๅๅ จ้จ๏ผไธ้่ฆๅพช็ฏๆๅ+็งฏๅ๏ผ็จๆท็งฏ5000็งฏๅๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ๅ็บฆไปฃ็ ๏ผๆฏๆๅคไธช๏ผ้ๅทๅ้๏ผไธ่พๅ ฅไธบ่ทๅๅ จ้จ๏ผ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ๅ็งไปฃ็ +ts_name | str | Y | ๅ็งๅ็งฐ+trade_type | str | Y | ไบคๆ็ฑปๅ+t_unit | float | Y | ไบคๆๅไฝ(ๅ /ๆ)+p_unit | float | Y | ๆฅไปทๅไฝ+min_change | float | Y | ๆๅฐๅๅจไปทไฝ+price_limit | float | Y | ๆฏๆฅไปทๆ ผๆๅคงๆณขๅจ้ๅถ+min_vol | int | Y | ๆๅฐๅ็ฌๆฅไปท้(ๆ)+max_vol | int | Y | ๆๅคงๅ็ฌๆฅไปท้(ๆ)+trade_mode | str | Y | ไบคๆๆ้+margin_rate | float | Y | ไฟ่ฏ้ๆฏไพ+liq_rate | float | Y | ่ฟ็บฆ้ๆฏไพ(%)+trade_time | str | Y | ไบคๆๆถ้ด+list_date | str | Y | ไธๅธๆฅๆ+++**ๆฅๅฃ็จๆณ**+```python++pro = ts.pro_api()++df = pro.sge_basic()++```++ๆ่++```python++df = pro.sge_basic(ts_code='Au99.95')++```++**ๆฐๆฎๆ ทไพ**++ ts_code ts_name min_vol max_vol trade_time+ 0 Au99.95 ้ป้9995 1 500 ็ฝๅคฉ๏ผ9:00่ณ15:30๏ผๅค้ด:19:50 ่ณๆฌกๆฅ 02:30+ 1 Au99.99 ้ป้9999 1 50000 ็ฝๅคฉ๏ผ9:00่ณ15:30๏ผๅค้ด:19:50 ่ณๆฌกๆฅ 02:30+ 2 Au(T+D) ้ป้ๅปถๆ 1 200 ไธๅ:9:00 ่ณ 11:30๏ผไธๅ ...+ 3 Pt99.95 ้้9995 1 1000 ็ฝๅคฉ๏ผ9:00่ณ15:30๏ผๅค้ด:19:50 ่ณๆฌกๆฅ 02:30+ 4 Ag(T+D) ็ฝ้ถๅปถๆ 1 2000 ไธๅ:9:00 ่ณ 11:30๏ผไธๅ:...+ 5 Au100g 100ๅ ้ๆก 1 1000 ็ฝๅคฉ๏ผ9:00่ณ15:30๏ผๅค้ด:19:50 ่ณๆฌกๆฅ 02:30+ 6 Au(T+N1) ้ป้T+N1 1 2000 ไธๅ:9:00 ่ณ 11:30๏ผไธๅ:13:30 ่ณ ...+ 7 Au(T+N2) ้ป้T+N2 1 2000 ไธๅ:9:00 ่ณ 11:30๏ผไธๅ:13:30 ่ณ ...+ 8 mAu(T+D) ่ฟทไฝ ้ป้ๅปถๆ 1 2000 ไธๅ:9:00 ่ณ 11:30๏ผไธๅ:13:30 ่ณ ...+ 9 iAu99.99 ๅฝ้ ๆฟ้ป้9999 1 50000 ็ฝๅคฉ๏ผ9:00่ณ15:30๏ผๅค้ด:19:50 ่ณๆฌกๆฅ 02:30+ 10 PGC30g ็็ซ้ๅธ30ๅ 1 1000 ็ฝๅคฉ๏ผ9:00่ณ15:30๏ผๅค้ด๏ผ20:00่ณๆฌกๆฅ02:30+ 11 NYAuTN06 ๆฒช็บฝ้AuTN06 1 2000 ็ฝๅคฉ๏ผ9:00่ณ15:30๏ผๅค้ด:19:50 ่ณๆฌกๆฅ 02:30+ 12 NYAuTN12 ๆฒช็บฝ้AuTN12 1 2000 ็ฝๅคฉ๏ผ9:00่ณ15:30๏ผๅค้ด:19:50 ่ณๆฌกๆฅ 02:30\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\347\216\260\350\264\247\346\225\260\346\215\256/\344\270\212\346\265\267\351\273\204\351\207\221\347\216\260\350\264\247\346\227\245\350\241\214\346\203\205.md" "b/agent/src/skills/tushare/references/\347\216\260\350\264\247\346\225\260\346\215\256/\344\270\212\346\265\267\351\273\204\351\207\221\347\216\260\350\264\247\346\227\245\350\241\214\346\203\205.md"new file mode 100644index 000000000..1e37125e9--- /dev/null+++ "b/agent/src/skills/tushare/references/\347\216\260\350\264\247\346\225\260\346\215\256/\344\270\212\346\265\267\351\273\204\351\207\221\347\216\260\350\264\247\346\227\245\350\241\214\346\203\205.md"@@ -0,0 +1,85 @@+## ็ฐ่ดง้ป้ๆฅ่กๆ+----++ๆฅๅฃ๏ผsge_daily+ๆ่ฟฐ๏ผ่ทๅไธๆตท้ป้ไบคๆๆ็ฐ่ดงๅ็บฆๆฅ็บฟ่กๆ+้้๏ผๅๆฌกๆๅคง2000๏ผๅฏๅพช็ฏๆ่ ๅ้กตๆๅ+็งฏๅ๏ผ็จๆท็งฏ2000็งฏๅๅฏ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)+<br>++ๆณจ๏ผๆฐๆฎ็ฑๅฝๆฅ9:00่ณ15:30็ไบคๆๅๅไธๆฅๅค็็20:00่ณ2:30ๆฐๆฎๆๆ๏ผๆไบค้ๅๆไบค้้ขไธบๅๅ่ฎก้ใ+++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ๅ็บฆไปฃ็ ๏ผๅฏ้่ฟ[ๅบ็กไฟกๆฏ](https://tushare.pro/document/2?doc_id=284)่ทๅพ+trade_date | str | N | ไบคๆๆฅๆ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ็ฐ่ดงๅ็บฆไปฃ็ +trade_date | str | Y | ไบคๆๆฅ+close | float | Y | ๆถ็็น(ๅ /ๅ )+open | float | Y | ๅผ็็น(ๅ /ๅ )+high | float | Y | ๆ้ซ็น(ๅ /ๅ )+low | float | Y | ๆไฝ็น(ๅ /ๅ )+price_avg | float | Y | ๅ ๆๅนณๅไปท(ๅ /ๅ )+change | float | Y | ๆถจ่ท็นไฝ(ๅ /ๅ )+pct_change | float | Y | ๆถจ่ทๅน+vol | float | Y | ๆไบค้(ๅๅ )+amount | float | Y | ๆไบค้้ข(ๅ )+oi | float | Y | ๅธๅบๆไป+settle_vol | float | Y | ไบคๆถ้+settle_dire | str | Y | ๆไปๆนๅ++<br>+<br>+++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++#่ทๅๅๆฅ็ป่ฎกๆฐๆฎ+df = pro.sge_daily(trade_date='20220311')++#่ทๅๆๅ็บฆๆๅฎๆฅๆ๏ผๆๅฎๅญๆฎต่พๅบ็ๆฐๆฎ+df = pro.sge_daily(ts_code='', start_date='20220301', end_date='20220311', fields='ts_code,close,open,vol')+++```+++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code trade_date close open high low vol settle_dire+ 0 Au99.95 20220311 403.3000 403.2000 403.3000 403.2000 24.00 None+ 1 Au99.99 20220311 403.6000 405.9700 408.0000 402.8000 13667.66 None+ 2 Au(T+D) 20220311 403.2200 405.0100 407.7000 402.5300 27196.00 ็ฉบๆฏไป็ปๅค+ 3 Pt99.95 20220311 227.0400 228.0000 228.0000 226.3000 384.00 None+ 4 Ag(T+D) 20220311 5.1340 5.1820 5.1850 5.1090 2428664.00 ็ฉบๆฏไป็ปๅค+ 5 Au100g 20220311 403.0300 405.4500 406.0000 402.3600 29.40 None+ 6 Au(T+N1) 20220311 405.7000 408.0000 408.0000 402.2000 21.80 None+ 7 Au(T+N2) 20220311 408.1000 411.0000 414.5000 408.0500 91.20 None+ 8 mAu(T+D) 20220311 403.4400 406.6200 407.7500 402.7500 4367.80 ็ฉบๆฏไป็ปๅค+ 9 iAu99.99 20220311 405.3400 406.3000 408.0000 405.0000 2.06 None+ 10 PGC30g 20220311 409.3200 410.0000 410.0000 408.9000 0.36 None+ 11 NYAuTN06 20220311 404.5500 407.8500 408.8000 404.0000 15.80 None+ 12 NYAuTN12 20220311 409.0500 413.8500 413.8500 408.9000 214.40 None\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\347\276\216\350\202\241\346\225\260\346\215\256/\347\276\216\350\202\241\344\272\244\346\230\223\346\227\245\345\216\206.md" "b/agent/src/skills/tushare/references/\347\276\216\350\202\241\346\225\260\346\215\256/\347\276\216\350\202\241\344\272\244\346\230\223\346\227\245\345\216\206.md"new file mode 100644index 000000000..4d5de7a36--- /dev/null+++ "b/agent/src/skills/tushare/references/\347\276\216\350\202\241\346\225\260\346\215\256/\347\276\216\350\202\241\344\272\244\346\230\223\346\227\245\345\216\206.md"@@ -0,0 +1,62 @@+## ็พ่กไบคๆๆฅๅ+----++ๆฅๅฃ๏ผus_tradecal+ๆ่ฟฐ๏ผ่ทๅ็พ่กไบคๆๆฅๅไฟกๆฏ+้้๏ผๅๆฌกๆๅคง6000๏ผๅฏๆ นๆฎๆฅๆ้ถๆฎต่ทๅ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ | ็คบไพ+---- | ----- | ---- | ---- | ----+start_date | str | N | ๅผๅงๆฅๆ | 20200101+end_date | str | N | ็ปๆๆฅๆ | 20200701+is_open | str | N | ๆฏๅฆไบคๆ | 0๏ผไผๅธ ใ1๏ผไบคๆ+++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+cal_date | str | Y | ๆฅๅๆฅๆ+is_open | int | Y | ๆฏๅฆไบคๆ '0'ไผๅธ '1'ไบคๆ+pretrade_date | str | Y | ไธไธไธชไบคๆๆฅ+++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++df = pro.us_tradecal(start_date='20200101', end_date='20200701')+++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ cal_date is_open pretrade_date+ 0 20200701 1 20200630+ 1 20200630 1 20200629+ 2 20200629 1 20200626+ 3 20200628 0 20200625+ 4 20200627 0 20200625+ .. ... ... ...+ 178 20200105 0 20200102+ 179 20200104 0 20200102+ 180 20200103 1 20200102+ 181 20200102 1 20191231+ 182 20200101 0 20191230\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\347\276\216\350\202\241\346\225\260\346\215\256/\347\276\216\350\202\241\345\210\251\346\266\246\350\241\250.md" "b/agent/src/skills/tushare/references/\347\276\216\350\202\241\346\225\260\346\215\256/\347\276\216\350\202\241\345\210\251\346\266\246\350\241\250.md"new file mode 100644index 000000000..f1d9b71e3--- /dev/null+++ "b/agent/src/skills/tushare/references/\347\276\216\350\202\241\346\225\260\346\215\256/\347\276\216\350\202\241\345\210\251\346\266\246\350\241\250.md"@@ -0,0 +1,73 @@+## ็พ่กๅฉๆถฆ่กจ+----+++ๆฅๅฃ๏ผus_income๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆ่ฟฐ๏ผ่ทๅ็พ่กไธๅธๅ ฌๅธ่ดขๅกๅฉๆถฆ่กจๆฐๆฎ๏ผ็ฎๅๅช่ฆ็ไธป่ฆ็พ่กๅไธญๆฆ่ก๏ผ+ๆ้๏ผ้ๅ็ฌๅผๆ้ๆๆ15000็งฏๅ๏ผๅ ทไฝๆ้ไฟกๆฏ่ฏทๅ่[ๆ้ๅ่กจ](https://tushare.pro/document/1?doc_id=290)+ๆ็คบ๏ผๅฝๅๆฅๅฃๆๅๅช่ก็ฅจ่ทๅๅ ถๅๅฒๆฐๆฎ๏ผๅๆฌก่ฏทๆฑๆๅคง่ฟๅ10000่กๆฐๆฎ๏ผๅฏๅพช็ฏๆๅ+++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +period | str | N | ๆฅๅๆ๏ผๆ ผๅผ๏ผYYYYMMDD๏ผๆฏไธชๅญฃๅบฆๆๅไธๅคฉ็ๆฅๆ๏ผๅฆ20241231)+ind_name | str | N | ๆๆ ๅ(ๅฆ๏ผๆฐๅขๅๆฌพ๏ผ+report_type | str | N | ๆฅๅๆ็ฑปๅ(Q1ไธๅญฃๆฅQ2ๅๅนดๆฅQ3ไธๅญฃๆฅQ4ๅนดๆฅ)+start_date | str | N | ๆฅๅๆๅผๅงๆถ้ด๏ผๆ ผๅผ๏ผYYYYMMDD๏ผ+end_date | str | N | ๆฅๅ็ปๆๅงๆถ้ด๏ผๆ ผๅผ๏ผYYYYMMDD๏ผ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +end_date | str | Y | ๆฅๅๆ+ind_type | str | Y | ๆฅๅๆ็ฑปๅ(Q1ไธๅญฃๆฅQ2ๅๅนดๆฅQ3ไธๅญฃๆฅQ4ๅนดๆฅ)+name | str | Y | ่ก็ฅจๅ็งฐ+ind_name | str | Y | ่ดขๅก็ง็ฎๅ็งฐ+ind_value | float | Y | ่ดขๅก็ง็ฎๅผ+report_type | str | Y | ๆฅๅ็ฑปๅ++<br>+<br>++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++#่ทๅ็พ่ก่ฑไผ่พพNVDA่ก็ฅจ็2024ๅนดๅบฆๅฉๆถฆ่กจๆฐๆฎ+df = pro.us_income(ts_code='NVDA', period='20241231')++#่ทๅ็พ่ก่ฑไผ่พพNVDA่ก็ฅจๅฉๆถฆ่กจๅๅนด่ฅไธ้ขๆฐๆฎ+df = pro.us_income(ts_code='NVDA', ind_name='่ฅไธ้ข')++```++<br>+<br>++**ๆฐๆฎๆ ทไพ**++ ts_code end_date ind_type name ind_name ind_value report_type+ 0 NVDA 20250427 Q1 ่ฑไผ่พพ ้่ฟ็ฎ้กน็ฎ 2.271500e+10 ๅๅญฃๆฅ+ 1 NVDA 20250427 Q1 ่ฑไผ่พพ ๅ จ้ขๆถ็ๆป้ข 1.893300e+10 ๅๅญฃๆฅ+ 2 NVDA 20250427 Q1 ่ฑไผ่พพ ๅ ถไปๅ จ้ขๆถ็ๅ่ฎก้กน 1.580000e+08 ๅๅญฃๆฅ+ 3 NVDA 20250427 Q1 ่ฑไผ่พพ ๅ ถไปๅ จ้ขๆถ็ๅ ถไป้กน็ฎ 1.580000e+08 ๅๅญฃๆฅ+ 4 NVDA 20250427 Q1 ่ฑไผ่พพ ๆฌๅ ฌๅธๆฅๆไบบๅ ๅ จ้ขๆถ็ๆป้ข 1.893300e+10 ๅๅญฃๆฅ+ ... ... ... ... ... ... ... ...+ 1929 NVDA 20050501 Q1 ่ฑไผ่พพ ่ฅ้่ดน็จ 4.805800e+07 ๅๅญฃๆฅ+ 1930 NVDA 20050501 Q1 ่ฑไผ่พพ ็ ๅ่ดน็จ 8.591300e+07 ๅๅญฃๆฅ+ 1931 NVDA 20050501 Q1 ่ฑไผ่พพ ๆฏๅฉ 2.101530e+08 ๅๅญฃๆฅ+ 1932 NVDA 20050501 Q1 ่ฑไผ่พพ ่ฅไธๆๆฌ 3.736930e+08 ๅๅญฃๆฅ+ 1933 NVDA 20050501 Q1 ่ฑไผ่พพ ่ฅไธๆถๅ ฅ 5.838460e+08 ๅๅญฃๆฅ\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\347\276\216\350\202\241\346\225\260\346\215\256/\347\276\216\350\202\241\345\237\272\347\241\200\344\277\241\346\201\257.md" "b/agent/src/skills/tushare/references/\347\276\216\350\202\241\346\225\260\346\215\256/\347\276\216\350\202\241\345\237\272\347\241\200\344\277\241\346\201\257.md"new file mode 100644index 000000000..9e2e34459--- /dev/null+++ "b/agent/src/skills/tushare/references/\347\276\216\350\202\241\346\225\260\346\215\256/\347\276\216\350\202\241\345\237\272\347\241\200\344\277\241\346\201\257.md"@@ -0,0 +1,68 @@+## ็พ่กๅ่กจ+----++ๆฅๅฃ๏ผus_basic+ๆ่ฟฐ๏ผ่ทๅ็พ่กๅ่กจไฟกๆฏ+้้๏ผๅๆฌกๆๅคง6000๏ผๅฏๅ้กตๆๅ+็งฏๅ๏ผ120็งฏๅๅฏไปฅ่ฏ็จ๏ผ5000็งฏๅๆๆญฃๅผๆ้++<br>+<br>+++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ|็คบไพ+---- | ----- | ---- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ | AAPL๏ผ่นๆ๏ผ+classify | str | N | ่ก็ฅจๅ็ฑป | ADR/GDR/EQ+offset | str | N | ๅผๅง่กๆฐ | 1๏ผ็ฌฌไธ่ก+limit | str | N | ๆฏ้กตๆๅคง่กๆฐ | 500๏ผๆฏ้กต500่ก++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ็พ่กไปฃ็ +name | str | Y | ไธญๆๅ็งฐ+enname | str | N | ่ฑๆๅ็งฐ+classify | str | Y | ๅ็ฑปADR/GDR/EQ+list_date | str | Y | ไธๅธๆฅๆ+delist_date | str | Y | ้ๅธๆฅๆ++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++#่ทๅ้ป่ฎค็พๅฝ่ก็ฅจๅบ็กไฟกๆฏ๏ผๅๆฌก6000่ก+df = pro.us_basic()+++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code name classify list_date delist_date+ 0 ONCY None EQT 20011005 None+ 1 SCCO None EQT 19950124 None+ 2 KAOCF None EQT 19740319 None+ 3 BOIRF None EQT 19880628 None+ 4 SDXOF None EQT 19830304 None+ ... ... ... ... ... ...+ 5995 ESESQ None EQT 20031014 None+ 5996 TRKX None EQT 20000718 None+ 5997 ELAMF None EQT 19960320 None+ 5998 CZNB None EQT 20120724 None+ 5999 CRRSQ None EQT 20010619 Nonediff --git "a/agent/src/skills/tushare/references/\347\276\216\350\202\241\346\225\260\346\215\256/\347\276\216\350\202\241\345\244\215\346\235\203\345\233\240\345\255\220.md" "b/agent/src/skills/tushare/references/\347\276\216\350\202\241\346\225\260\346\215\256/\347\276\216\350\202\241\345\244\215\346\235\203\345\233\240\345\255\220.md"new file mode 100644index 000000000..a3bda6273--- /dev/null+++ "b/agent/src/skills/tushare/references/\347\276\216\350\202\241\346\225\260\346\215\256/\347\276\216\350\202\241\345\244\215\346\235\203\345\233\240\345\255\220.md"@@ -0,0 +1,70 @@+## ็พ่กๅคๆๅ ๅญ+----++ๆฅๅฃ๏ผus_adjfactor+ๆ่ฟฐ๏ผ่ทๅ็พ่กๆฏๆฅๅคๆๅ ๅญๆฐๆฎ๏ผๅจๆฏๅคฉ็พ่กๆถ็ๅๆปๅจๅทๆฐ+้้๏ผๅๆฌกๆๅคง15000่กๆฐๆฎ๏ผๅฏไปฅๆ นๆฎๆฅๆๅพช็ฏ+ๆ้๏ผๆฌๆฅๅฃๆฏๅจๅผ้็พ่กๆฅ็บฟๆ้ๅ่ชๅจ่ทๅๆ้๏ผๆ้่ฏทๅ่[ๆ้่ฏดๆๆๆกฃ](https://tushare.pro/document/1?doc_id=290)++<br>+<br>+++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ๏ผๆ ผๅผ๏ผYYYYMMDD๏ผไธๅ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+exchange | str | Y | ไบคๆๆ+cum_adjfactor | float | Y | ็ดฏ่ฎกๅคๆๅ ๅญ+close_price | float | Y | ๆถ็ไปท++<br>+<br>+++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++#่ทๅ็พ่กๅไธ่ก็ฅจๅคๆๅ ๅญ+df = pro.us_adjfactor(ts_code='AAPL', start_date='20240101', end_date='20251022')++#่ทๅ็พ่กๆไธๆฅๅ จ้จ่ก็ฅจ็ๅคๆๅ ๅญ+df = pro.us_adjfactor(trade_date='20251031')++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code trade_date exchange cum_adjfactor close_price+ 0 TAGOF 20251031 OTC 1.000000 None+ 1 BABA 20251031 NYS 1.000000 170.430000+ 2 CZR 20251031 NAS 1.000000 20.100000+ 3 DEEP 20251031 ARC 1.000000 35.025100+ 4 AVAL 20251031 NYS 1.000000 4.220000+ ... ... ... ... ... ...+ 14995 MRETF 20251031 OTC 1.000000 7.150000+ 14996 CHI 20251031 NAS 1.000000 11.390000+ 14997 TBHC 20251031 NAS 1.000000 1.510000+ 14998 MQMIF 20251031 OTC 1.000000 0.127600+ 14999 TAC 20251031 NYS 1.000000 17.670000\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\347\276\216\350\202\241\346\225\260\346\215\256/\347\276\216\350\202\241\345\244\215\346\235\203\350\241\214\346\203\205.md" "b/agent/src/skills/tushare/references/\347\276\216\350\202\241\346\225\260\346\215\256/\347\276\216\350\202\241\345\244\215\346\235\203\350\241\214\346\203\205.md"new file mode 100644index 000000000..d9a6c55b9--- /dev/null+++ "b/agent/src/skills/tushare/references/\347\276\216\350\202\241\346\225\260\346\215\256/\347\276\216\350\202\241\345\244\215\346\235\203\350\241\214\346\203\205.md"@@ -0,0 +1,86 @@+## ็พ่กๅคๆ่กๆ+----++ๆฅๅฃ๏ผus_daily_adj๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆ่ฟฐ๏ผ่ทๅ็พ่กๅคๆ่กๆ ๏ผๆฏๆ็พ่กๅ จๅธๅบ่ก็ฅจ๏ผๆไพ่กๆฌใๅธๅผใๅคๆๅ ๅญๅๆไบคไฟกๆฏ็ญๅคไธชๆฐๆฎๆๆ +้้๏ผๅๆฌกๆๅคงๅฏไปฅๆๅ8000ๆกๆฐๆฎ๏ผๅฏๅพช็ฏ่ทๅๅ จ้จ๏ผๆฏๆๅ้กตๆๅ+่ฆๆฑ๏ผ120็งฏๅๅฏไปฅ่ฏ็จๆฅ็ๆฐๆฎ๏ผๅผ้ๆญฃๅผๆ้่ฏทๅ่[ๆ้่ฏดๆๆๆกฃ](https://tushare.pro/document/1?doc_id=290)++ๆณจ๏ผ็พ่กๅคๆ้ป่พๆฏ๏ผไปทๆ ผ * ๅคๆๅ ๅญ = ๅคๆไปทๆ ผ๏ผๆฏๅฆclose * adj_factor = ๅๅคๆๆถ็ไปทใๅคๆๅ ๅญๅๅฒๆฐๆฎๅฏ่ฝ้คๆ็ญ่ขซๅทๆฐ๏ผ่ฏทๆณจๆๅจๆๆดๆฐใ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ ๏ผe.g. AAPL๏ผ+trade_date | str | N | ไบคๆๆฅๆ๏ผYYYYMMDD๏ผ+start_date | str | N | ๅผๅงๆฅๆ๏ผYYYYMMDD๏ผ+end_date | str | N | ็ปๆๆฅๆ๏ผYYYYMMDD๏ผ+exchange | str | N | ไบคๆๆ๏ผNAS/NYS/OTC)+offset | int | N | ๅผๅง่กๆฐ+limit | int | N | ๆฏ้กต่กๆฐ่กๆฐ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+close | float | Y | ๆถ็ไปท+open | float | Y | ๅผ็ไปท+high | float | Y | ๆ้ซไปท+low | float | Y | ๆไฝไปท+pre_close | float | Y | ๆจๆถไปท+change | float | Y | ๆถจ่ท้ข+pct_change | float | Y | ๆถจ่ทๅน+vol | int | Y | ๆไบค้+amount | float | Y | ๆไบค้ข+vwap | float | Y | ๅนณๅไปท+adj_factor | float | Y | ๅคๆๅ ๅญ+turnover_ratio | float | Y | ๆขๆ็+free_share | int | Y | ๆต้่กๆฌ+total_share | int | Y | ๆป่กๆฌ+free_mv | float | Y | ๆต้ๅธๅผ+total_mv | float | Y | ๆปๅธๅผ+exchange | str | Y | ไบคๆๆไปฃ็ ++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++#่ทๅๅไธ่ก็ฅจ่กๆ+df = pro.us_daily_adj(ts_code='AAPL', start_date='20240101', end_date='20240722')++#่ทๅๆไธๆฅๆไธชไบคๆๆ็ๅ จ้จ่ก็ฅจ+df = pro.us_daily_adj(trade_date='20240722', exhange='NAS')++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code trade_date close pre_close pct_change vol amount vwap adj_factor turnover_ratio+ 0 AAPL 20240722 223.96 224.31 0.00 48201836 10846348215.6184 225.02 1.0000 0.31+ 1 AAPL 20240719 224.31 224.18 0.00 49151454 11046273687.7475 224.74 1.0000 0.32+ 2 AAPL 20240718 224.18 228.88 -0.02 66034563 14869485263.3655 225.18 1.0000 0.43+ 3 AAPL 20240717 228.88 234.82 -0.03 57345883 13120715665.5056 228.80 1.0000 0.37+ 4 AAPL 20240716 234.82 234.40 0.00 43234278 10128420808.7874 234.27 1.0000 0.28+ .. ... ... ... ... ... ... ... ... ... ...+ 134 AAPL 20240108 185.07 180.70 0.02 59144469 10903064025.6147 183.86 0.9974 0.38+ 135 AAPL 20240105 180.70 181.43 0.00 62379661 11321622148.8560 181.02 0.9974 0.40+ 136 AAPL 20240104 181.43 183.77 -0.01 71983563 13102384071.8889 181.54 0.9974 0.47+ 137 AAPL 20240103 183.77 185.15 -0.01 58414461 10767233840.9328 183.84 0.9974 0.38+ 138 AAPL 20240102 185.15 192.02 -0.04 82488688 15330365936.2928 185.36 0.9974 0.53diff --git "a/agent/src/skills/tushare/references/\347\276\216\350\202\241\346\225\260\346\215\256/\347\276\216\350\202\241\346\227\245\347\272\277\350\241\214\346\203\205.md" "b/agent/src/skills/tushare/references/\347\276\216\350\202\241\346\225\260\346\215\256/\347\276\216\350\202\241\346\227\245\347\272\277\350\241\214\346\203\205.md"new file mode 100644index 000000000..42cb693cc--- /dev/null+++ "b/agent/src/skills/tushare/references/\347\276\216\350\202\241\346\225\260\346\215\256/\347\276\216\350\202\241\346\227\245\347\272\277\350\241\214\346\203\205.md"@@ -0,0 +1,77 @@+## ็พ่ก่กๆ+----++ๆฅๅฃ๏ผus_daily+ๆ่ฟฐ๏ผ่ทๅ็พ่ก่กๆ ๏ผๆชๅคๆ๏ผ๏ผๅ ๆฌๅ จ้จ่ก็ฅจๅ จๅๅฒ่กๆ ๏ผไปฅๅ้่ฆ็ๅธๅบๅไผฐๅผๆๆ +้้๏ผๅๆฌกๆๅคง6000่กๆฐๆฎ๏ผๅฏๆ นๆฎๆฅๆๅๆฐๅพช็ฏๆๅ๏ผๅผ้ๆญฃๅผๆ้ๅไนๅฏๆฏๆๅ้กตๆๅๅ จ้จๅๅฒ+่ฆๆฑ๏ผ120็งฏๅๅฏไปฅ่ฏ็จๆฅ็ๆฐๆฎ๏ผๅผ้ๆญฃๅผๆ้่ฏทๅ่[ๆ้่ฏดๆๆๆกฃ](https://tushare.pro/document/1?doc_id=290)ใ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ ๏ผe.g. AAPL๏ผ+trade_date | str | N | ไบคๆๆฅๆ๏ผYYYYMMDD๏ผ+start_date | str | N | ๅผๅงๆฅๆ๏ผYYYYMMDD๏ผ+end_date | str | N | ็ปๆๆฅๆ๏ผYYYYMMDD๏ผ++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+close | float | Y | ๆถ็ไปท+open | float | Y | ๅผ็ไปท+high | float | Y | ๆ้ซไปท+low | float | Y | ๆไฝไปท+pre_close | float | Y | ๆจๆถไปท+change | float | N | ๆถจ่ท้ข+pct_change | float | Y | ๆถจ่ทๅน+vol | float | Y | ๆไบค้+amount | float | Y | ๆไบค้ข+vwap | float | Y | ๅนณๅไปท+turnover_ratio | float | N | ๆขๆ็+total_mv | float | N | ๆปๅธๅผ+pe | float | N | PE+pb | float | N | PB+++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++#่ทๅๅไธ่ก็ฅจ่กๆ+df = pro.us_daily(ts_code='AAPL', start_date='20190101', end_date='20190904')++#่ทๅๆไธๆฅๆๆ่ก็ฅจ+df = pro.us_daily(trade_date='20190904')++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code trade_date close open high low pre_close pct_change vol amount vwap+ 0 AAPL 20190904 209.19 208.39 209.48 207.32 205.70 1.70 19216821 4008342529.970000 208.59+ 1 AAPL 20190903 205.70 206.43 206.98 204.22 208.74 -1.46 20059575 4120106317.760000 205.39+ 2 AAPL 20190830 208.74 210.16 210.45 207.20 209.01 -0.13 21162563 4410472824.780000 208.41+ 3 AAPL 20190829 209.01 208.50 209.32 206.66 205.53 1.69 21007653 4380322743.230000 208.51+ 4 AAPL 20190828 205.53 204.10 205.72 203.32 204.16 0.67 15957633 3269889907.950000 204.91+ .. ... ... ... ... ... ... ... ... ... ... ...+ 165 AAPL 20190108 150.75 149.56 151.82 148.52 147.93 1.91 41025313 6159076907.780000 150.13+ 166 AAPL 20190107 147.93 148.70 148.83 145.90 148.26 -0.22 54777766 8071925608.900000 147.36+ 167 AAPL 20190104 148.26 144.53 148.55 143.80 142.19 4.27 58607071 8605786116.450000 146.84+ 168 AAPL 20190103 142.19 143.98 145.72 142.00 157.92 -9.96 91312188 13108586866.810000 143.56+ 169 AAPL 20190102 157.92 154.89 158.85 154.23 157.74 0.11 37039739 5814198206.330000 156.97diff --git "a/agent/src/skills/tushare/references/\347\276\216\350\202\241\346\225\260\346\215\256/\347\276\216\350\202\241\347\216\260\351\207\221\346\265\201\351\207\217\350\241\250.md" "b/agent/src/skills/tushare/references/\347\276\216\350\202\241\346\225\260\346\215\256/\347\276\216\350\202\241\347\216\260\351\207\221\346\265\201\351\207\217\350\241\250.md"new file mode 100644index 000000000..618236b9b--- /dev/null+++ "b/agent/src/skills/tushare/references/\347\276\216\350\202\241\346\225\260\346\215\256/\347\276\216\350\202\241\347\216\260\351\207\221\346\265\201\351\207\217\350\241\250.md"@@ -0,0 +1,77 @@+## ็พ่ก็ฐ้ๆต้่กจ+----+++ๆฅๅฃ๏ผus_cashflow๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆ่ฟฐ๏ผ่ทๅ็พ่กไธๅธๅ ฌๅธ็ฐ้ๆต้่กจๆฐๆฎ๏ผ็ฎๅๅช่ฆ็ไธป่ฆ็พ่กๅไธญๆฆ่ก๏ผ+ๆ้๏ผ้ๅ็ฌๅผๆ้ๆๆ15000็งฏๅ๏ผๅ ทไฝๆ้ไฟกๆฏ่ฏทๅ่[ๆ้ๅ่กจ](https://tushare.pro/document/1?doc_id=290)+ๆ็คบ๏ผๅฝๅๆฅๅฃๆๅๅช่ก็ฅจ่ทๅๅ ถๅๅฒๆฐๆฎ๏ผๅๆฌก่ฏทๆฑๆๅคง่ฟๅ10000่กๆฐๆฎ๏ผๅฏๅพช็ฏๆๅ++<br>+<br>+++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +period | str | N | ๆฅๅๆ๏ผๆ ผๅผ๏ผYYYYMMDD๏ผๆฏไธชๅญฃๅบฆๆๅไธๅคฉ็ๆฅๆ๏ผๅฆ20241231)+ind_name | str | N | ๆๆ ๅ(ๅฆ๏ผๆฐๅขๅๆฌพ๏ผ+report_type | str | N | ๆฅๅๆ็ฑปๅ(Q1ไธๅญฃๆฅQ2ๅๅนดๆฅQ3ไธๅญฃๆฅQ4ๅนดๆฅ)+start_date | str | N | ๆฅๅๆๅผๅงๆถ้ด๏ผๆ ผๅผ๏ผYYYYMMDD๏ผ+end_date | str | N | ๆฅๅ็ปๆๅงๆถ้ด๏ผๆ ผๅผ๏ผYYYYMMDD๏ผ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +end_date | str | Y | ๆฅๅๆ+ind_type | str | Y | ๆฅๅๆ็ฑปๅ(Q1ไธๅญฃๆฅQ2ๅๅนดๆฅQ3ไธๅญฃๆฅQ4ๅนดๆฅ)+name | str | Y | ่ก็ฅจๅ็งฐ+ind_name | str | Y | ่ดขๅก็ง็ฎๅ็งฐ+ind_value | float | Y | ่ดขๅก็ง็ฎๅผ+report_type | str | Y | ๆฅๅ็ฑปๅ++<br>+<br>+++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()+++#่ทๅ็พ่ก่ฑไผ่พพNVDA่ก็ฅจ็2024ๅนดๅบฆ็ฐ้ๆต้่กจๆฐๆฎ+df = pro.us_cashflow(ts_code='NVDA', period='20241231')++#่ทๅ็พ่ก่ฑไผ่พพNVDA่ก็ฅจ็ฐ้ๆต้่กจๅๅนดๆฐๅขๅๆฌพๆฐๆฎ+df = pro.us_cashflow(ts_code='NVDA', ind_name='ๆฐๅขๅๆฌพ')++```++<br>+<br>+++**ๆฐๆฎๆ ทไพ**++ ts_code end_date ind_type name ind_name ind_value report_type+ 0 NVDA 20250427 Q1 ่ฑไผ่พพ ็ฐ้ๅ็ฐ้็ญไปท็ฉๆๆซไฝ้ข 1.523400e+10 ๅๅญฃๆฅ+ 1 NVDA 20250427 Q1 ่ฑไผ่พพ ็ฐ้ๅ็ฐ้็ญไปท็ฉๆๅไฝ้ข 8.589000e+09 ๅๅญฃๆฅ+ 2 NVDA 20250427 Q1 ่ฑไผ่พพ ็ฐ้ๅ็ฐ้็ญไปท็ฉๅขๅ (ๅๅฐ)้ข 6.645000e+09 ๅๅญฃๆฅ+ 3 NVDA 20250427 Q1 ่ฑไผ่พพ ็ญน่ตๆดปๅจไบง็็็ฐ้ๆต้ๅ้ข -1.555300e+10 ๅๅญฃๆฅ+ 4 NVDA 20250427 Q1 ่ฑไผ่พพ ็ญน่ตไธๅกๅ ถไป้กน็ฎ -1.584000e+09 ๅๅญฃๆฅ+ ... ... ... ... ... ... ... ...+ 2001 NVDA 20050501 Q1 ่ฑไผ่พพ ็ป่ฅไธๅก่ฐๆดๅ ถไป้กน็ฎ 0.000000e+00 ๅๅญฃๆฅ+ 2002 NVDA 20050501 Q1 ่ฑไผ่พพ ๅๅผๅๆจๅค -3.410000e+05 ๅๅญฃๆฅ+ 2003 NVDA 20050501 Q1 ่ฑไผ่พพ ๅบไบ่ก็ฅจ็่กฅๅฟ่ดน 2.850000e+05 ๅๅญฃๆฅ+ 2004 NVDA 20050501 Q1 ่ฑไผ่พพ ๆๆงๅๆ้ 2.489700e+07 ๅๅญฃๆฅ+ 2005 NVDA 20050501 Q1 ่ฑไผ่พพ ๅๅฉๆถฆ 6.444400e+07 ๅๅญฃๆฅ+diff --git "a/agent/src/skills/tushare/references/\347\276\216\350\202\241\346\225\260\346\215\256/\347\276\216\350\202\241\350\264\242\345\212\241\346\214\207\346\240\207\346\225\260\346\215\256.md" "b/agent/src/skills/tushare/references/\347\276\216\350\202\241\346\225\260\346\215\256/\347\276\216\350\202\241\350\264\242\345\212\241\346\214\207\346\240\207\346\225\260\346\215\256.md"new file mode 100644index 000000000..8e6e6e494--- /dev/null+++ "b/agent/src/skills/tushare/references/\347\276\216\350\202\241\346\225\260\346\215\256/\347\276\216\350\202\241\350\264\242\345\212\241\346\214\207\346\240\207\346\225\260\346\215\256.md"@@ -0,0 +1,138 @@+## ็พ่ก่ดขๅกๆๆ ๆฐๆฎ+----++ๆฅๅฃ๏ผus_fina_indicator๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆ่ฟฐ๏ผ่ทๅ็พ่กไธๅธๅ ฌๅธ่ดขๅกๆๆ ๆฐๆฎ๏ผ็ฎๅๅช่ฆ็ไธป่ฆ็พ่กๅไธญๆฆ่กใไธบ้ฟๅ ๆๅกๅจๅๅ๏ผ็ฐ้ถๆฎตๆฏๆฌก่ฏทๆฑๆๅค่ฟๅ200ๆก่ฎฐๅฝ๏ผๅฏ้่ฟ่ฎพ็ฝฎๆฅๆๅคๆฌก่ฏทๆฑ่ทๅๆดๅคๆฐๆฎใ+ๆ้๏ผ้ๅ็ฌๅผๆ้ๆๆ15000็งฏๅ๏ผๅ ทไฝๆ้ไฟกๆฏ่ฏทๅ่[ๆ้ๅ่กจ](https://tushare.pro/document/1?doc_id=290)+ๆ็คบ๏ผๅฝๅๆฅๅฃๆๅๅช่ก็ฅจ่ทๅๅ ถๅๅฒๆฐๆฎ๏ผๅๆฌก่ฏทๆฑๆๅคง่ฟๅ10000่กๆฐๆฎ๏ผๅฏๅพช็ฏๆๅ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +period | str | N | ๆฅๅๆ๏ผๆ ผๅผ๏ผYYYYMMDD๏ผๆฏไธชๅญฃๅบฆๆๅไธๅคฉ็ๆฅๆ๏ผๅฆ20241231)+report_type | str | N | ๆฅๅๆ็ฑปๅ(Q1ไธๅญฃๆฅQ2ๅๅนดๆฅQ3ไธๅญฃๆฅQ4ๅนดๆฅ)+start_date | str | N | ๆฅๅๆๅผๅงๆถ้ด๏ผๆ ผๅผ๏ผYYYYMMDD๏ผ+end_date | str | N | ๆฅๅ็ปๆๅงๆถ้ด๏ผๆ ผๅผ๏ผYYYYMMDD๏ผ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +end_date | str | Y | ๆฅๅๆ+ind_type | str | Y | ๆฅๅ็ฑปๅ,Q1ไธๅญฃๆฅ,Q2ไธญๆฅ,Q3ไธๅญฃๆฅ,Q4ๅนดๆฅ+security_name_abbr | str | Y | ่ก็ฅจๅ็งฐ+accounting_standards | str | Y | ไผ่ฎกๅๅ+notice_date | str | Y | ๅ ฌๅๆฅๆ+start_date | str | Y | ๆฅๅๆๅผๅงๆถ้ด+std_report_date | str | Y | ๆ ๅๆฅๅๆ+financial_date | str | Y | ๅนด็ปๆฅ+currency | str | Y | ๅธ็ง+date_type | str | Y | ๆฅๅๆ็ฑปๅ+report_type | str | Y | ๆฅๅ็ฑปๅ+operate_income | float | Y | ๆถๅ ฅ+operate_income_yoy | float | Y | ๆถๅ ฅๅข้ฟ+gross_profit | float | Y | ๆฏๅฉ+gross_profit_yoy | float | Y | ๆฏๅฉๅข้ฟ+parent_holder_netprofit | float | Y | ๅฝๆฏๅๅฉๆถฆ+parent_holder_netprofit_yoy | float | Y | ๅฝๆฏๅๅฉๆถฆๅข้ฟ+basic_eps | float | Y | ๅบๆฌๆฏ่กๆถ็+diluted_eps | float | Y | ็จ้ๆฏ่กๆถ็+gross_profit_ratio | float | Y | ้ๅฎๆฏๅฉ็+net_profit_ratio | float | Y | ้ๅฎๅๅฉ็+accounts_rece_tr | float | Y | ๅบๆถ่ดฆๆฌพๅจ่ฝฌ็(ๆฌก)+inventory_tr | float | Y | ๅญ่ดงๅจ่ฝฌ็(ๆฌก)+total_assets_tr | float | Y | ๆป่ตไบงๅจ่ฝฌ็(ๆฌก)+accounts_rece_tdays | float | Y | ๅบๆถ่ดฆๆฌพๅจ่ฝฌๅคฉๆฐ+inventory_tdays | float | Y | ๅญ่ดงๅจ่ฝฌๅคฉๆฐ+total_assets_tdays | float | Y | ๆป่ตไบงๅจ่ฝฌๅคฉๆฐ+roe_avg | float | Y | ๅ่ตไบงๆถ็็+roa | float | Y | ๆป่ตไบงๅๅฉ็+current_ratio | float | Y | ๆตๅจๆฏ็(ๅ)+speed_ratio | float | Y | ้ๅจๆฏ็(ๅ)+ocf_liqdebt | float | Y | ็ป่ฅไธๅก็ฐ้ๅ้ข/ๆตๅจ่ดๅบ+debt_asset_ratio | float | Y | ่ตไบง่ดๅบ็+equity_ratio | float | Y | ไบงๆๆฏ็+basic_eps_yoy | float | Y | ๅบๆฌๆฏ่กๆถ็ๅๆฏๅข้ฟ+gross_profit_ratio_yoy | float | Y | ๆฏๅฉ็ๅๆฏๅข้ฟ(%)+net_profit_ratio_yoy | float | Y | ๅๅฉ็ๅๆฏๅข้ฟ(%)+roe_avg_yoy | float | Y | ๅนณๅๅ่ตไบงๆถ็็ๅๆฏๅข้ฟ(%)+roa_yoy | float | Y | ๅ่ตไบงๆถ็็ๅๆฏๅข้ฟ(%)+debt_asset_ratio_yoy | float | Y | ่ตไบง่ดๅบ็ๅๆฏๅข้ฟ(%)+current_ratio_yoy | float | Y | ๆตๅจๆฏ็ๅๆฏๅข้ฟ(%)+speed_ratio_yoy | float | Y | ้ๅจๆฏ็ๅๆฏๅข้ฟ(%)+currency_abbr | str | Y | ๅธ็ง+total_income | float | Y | ๆถๅ ฅๆป้ข+total_income_yoy | float | Y | ๆถๅ ฅๆป้ขๅๆฏๅข้ฟ+premium_income | float | Y | ไฟ่ดนๆถๅ ฅ+premium_income_yoy | float | Y | ไฟ่ดนๆถๅ ฅๅๆฏ+basic_eps_cs | float | Y | ๅบๆฌๆฏ่กๆถ็+basic_eps_cs_yoy | float | Y | ๅบๆฌๆฏ่กๆถ็ๅๆฏๅข้ฟ+diluted_eps_cs | float | Y | ็จ้ๆฏ่กๆถ็+payout_ratio | float | Y | ไฟ่ดนๆถๅ ฅ/่ตไปๆฏๅบ+capitial_ratio | float | Y | ๆป่ตไบงๅจ่ฝฌ็+roe | float | Y | ๅ่ตไบงๆถ็็+roe_yoy | float | Y | ๅ่ตไบงๆถ็็ๅๆฏๅข้ฟ+debt_ratio | float | Y | ่ตไบง่ดๅบ็+debt_ratio_yoy | float | Y | ่ตไบง่ดๅบ็ๅๆฏๅข้ฟ+net_interest_income | float | Y | ๅๅฉๆฏๆถๅ ฅ+net_interest_income_yoy | float | Y | ๅๅฉๆฏๆถๅ ฅๅข้ฟ+diluted_eps_cs_yoy | float | Y | ็จ้ๆฏ่กๆถ็ๅข้ฟ+loan_loss_provision | float | Y | ่ดทๆฌพๆๅคฑๅๅค+loan_loss_provision_yoy | float | Y | ่ดทๆฌพๆๅคฑๅๅคๅข้ฟ+loan_deposit | float | Y | ่ดทๆฌพ/ๅญๆฌพ+loan_equity | float | Y | ่ดทๆฌพ/่กไธๆ็(ๅ)+loan_assets | float | Y | ่ดทๆฌพ/ๆป่ตไบง+deposit_equity | float | Y | ๅญๆฌพ/่กไธๆ็(ๅ)+deposit_assets | float | Y | ๅญๆฌพ/ๆป่ตไบง+rol | float | Y | ่ดทๆฌพๅๆฅ็+rod | float | Y | ๅญๆฌพๅๆฅ็++ๆณจ๏ผ่พๅบๆๆ ๅคชๅคๅฏๅจๆฅๅฃfieldsๅๆฐ่ฎพๅฎไฝ ้่ฆ็ๆๆ ๏ผไพๅฆ๏ผfields='ts_coe,bps,basic_eps'+<br>+<br>+++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++#่ทๅ็พ่ก่ฑไผ่พพNVDA่ก็ฅจ2024ๅนดๅบฆ็่ดขๅกๆๆ ๆฐๆฎ+df = pro.us_fina_indicator(ts_code='NVDA', period='20241231')++#่ทๅ็พ่ก่ฑไผ่พพNVDA่ก็ฅจๅๅนดๅนดๆฅ่ดขๅกๆๆ ๆฐๆฎ+df = pro.us_fina_indicator(ts_code='NVDA', report_type='Q4')++```++<br>+<br>++**ๆฐๆฎๆ ทไพ**++ ts_code end_date ind_type security_name_abbr accounting_standards notice_date start_date std_report_date financial_date currency date_type report_type operate_income operate_income_yoy \+ 0 NVDA 20250427 Q1 ่ฑไผ่พพ ็พๅฝไผ่ฎกๅๅ 20250528 20250127 20250331 2-1 ็พๅ ๅๅญฃๆฅ 2025/Q1 4.406200e+10 69.1829+ 1 NVDA 20250126 Q4 ่ฑไผ่พพ ็พๅฝไผ่ฎกๅๅ 20250226 20240129 20241231 1-26 ็พๅ ๅนดๆฅ 2024/FY 1.304970e+11 114.2034+ 2 NVDA 20241027 Q3 ่ฑไผ่พพ ็พๅฝไผ่ฎกๅๅ 20241120 20240129 20240930 1-26 ็พๅ ็ดฏ่ฎกๅญฃๆฅ 2024/Q9 9.116600e+10 134.8489+ 3 NVDA 20240728 Q2 ่ฑไผ่พพ ็พๅฝไผ่ฎกๅๅ 20240828 20240129 20240630 1-26 ็พๅ ็ดฏ่ฎกๅญฃๆฅ 2024/Q6 5.608400e+10 170.9503+ 4 NVDA 20240428 Q1 ่ฑไผ่พพ ็พๅฝไผ่ฎกๅๅ 20250528 20240129 20240331 1-26 ็พๅ ๅๅญฃๆฅ 2024/Q1 2.604400e+10 262.1246+ 5 NVDA 20240128 Q4 ่ฑไผ่พพ ็พๅฝไผ่ฎกๅๅ 20250226 20230130 20231231 1-28 ็พๅ ๅนดๆฅ 2023/FY 6.092200e+10 125.8545+ 6 NVDA 20231029 Q3 ่ฑไผ่พพ ็พๅฝไผ่ฎกๅๅ 20241120 20230130 20230930 1-28 ็พๅ ็ดฏ่ฎกๅญฃๆฅ 2023/Q9 3.881900e+10 85.5327+ 7 NVDA 20230730 Q2 ่ฑไผ่พพ ็พๅฝไผ่ฎกๅๅ 20240828 20230131 20230630 1-28 ็พๅ ็ดฏ่ฎกๅญฃๆฅ 2023/Q6 2.069900e+10 38.0670+ 8 NVDA 20230430 Q1 ่ฑไผ่พพ ็พๅฝไผ่ฎกๅๅ 20240529 20230130 20230331 1-28 ็พๅ ๅๅญฃๆฅ 2023/Q1 7.192000e+09 -13.2239+ 9 NVDA 20230129 Q4 ่ฑไผ่พพ ็พๅฝไผ่ฎกๅๅ 20250226 20220131 20221231 1-29 ็พๅ ๅนดๆฅ 2022/FY 2.697400e+10 0.2229+ 10 NVDA 20221030 Q3 ่ฑไผ่พพ ็พๅฝไผ่ฎกๅๅ 20231121 20220131 20220930 1-29 ็พๅ ็ดฏ่ฎกๅญฃๆฅ 2022/Q9 2.092300e+10 8.5725+ 11 NVDA 20220731 Q2 ่ฑไผ่พพ ็พๅฝไผ่ฎกๅๅ 20230828 20220201 20220630 1-29 ็พๅ ็ดฏ่ฎกๅญฃๆฅ 2022/Q6 1.499200e+10 23.2084+ 12 NVDA 20220501 Q1 ่ฑไผ่พพ ็พๅฝไผ่ฎกๅๅ 20230526 20220131 20220331 1-29 ็พๅ ๅๅญฃๆฅ 2022/Q1 8.288000e+09 46.4052+ 13 NVDA 20220130 Q4 ่ฑไผ่พพ ็พๅฝไผ่ฎกๅๅ 20240221 20210201 20211231 1-30 ็พๅ ๅนดๆฅ 2021/FY 2.691400e+10 61.4033+ 14 NVDA 20211031 Q3 ่ฑไผ่พพ ็พๅฝไผ่ฎกๅๅ 20221118 20210201 20210930 1-30 ็พๅ ็ดฏ่ฎกๅญฃๆฅ 2021/Q9 1.927100e+10 65.1045\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\347\276\216\350\202\241\346\225\260\346\215\256/\347\276\216\350\202\241\350\265\204\344\272\247\350\264\237\345\200\272\350\241\250.md" "b/agent/src/skills/tushare/references/\347\276\216\350\202\241\346\225\260\346\215\256/\347\276\216\350\202\241\350\265\204\344\272\247\350\264\237\345\200\272\350\241\250.md"new file mode 100644index 000000000..7df7e8718--- /dev/null+++ "b/agent/src/skills/tushare/references/\347\276\216\350\202\241\346\225\260\346\215\256/\347\276\216\350\202\241\350\265\204\344\272\247\350\264\237\345\200\272\350\241\250.md"@@ -0,0 +1,74 @@+## ็พ่ก่ตไบง่ดๅบ่กจ+----++ๆฅๅฃ๏ผus_balancesheet๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆ่ฟฐ๏ผ่ทๅ็พ่กไธๅธๅ ฌๅธ่ตไบง่ดๅบ่กจ๏ผ็ฎๅๅช่ฆ็ไธป่ฆ็พ่กๅไธญๆฆ่ก๏ผ+ๆ้๏ผ้ๅ็ฌๅผๆ้ๆๆ15000็งฏๅ๏ผๅ ทไฝๆ้ไฟกๆฏ่ฏทๅ่[ๆ้ๅ่กจ](https://tushare.pro/document/1?doc_id=290)+ๆ็คบ๏ผๅฝๅๆฅๅฃๆๅๅช่ก็ฅจ่ทๅๅ ถๅๅฒๆฐๆฎ๏ผๅๆฌก่ฏทๆฑๆๅคง่ฟๅ10000่กๆฐๆฎ๏ผๅฏๅพช็ฏๆๅ++<br>+<br>+++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +period | str | N | ๆฅๅๆ๏ผๆ ผๅผ๏ผYYYYMMDD๏ผๆฏไธชๅญฃๅบฆๆๅไธๅคฉ็ๆฅๆ๏ผๅฆ20241231)+ind_name | str | N | ๆๆ ๅ(ๅฆ๏ผๆฐๅขๅๆฌพ๏ผ+report_type | str | N | ๆฅๅๆ็ฑปๅ(Q1ไธๅญฃๆฅQ2ๅๅนดๆฅQ3ไธๅญฃๆฅQ4ๅนดๆฅ)+start_date | str | N | ๆฅๅๆๅผๅงๆถ้ด๏ผๆ ผๅผ๏ผYYYYMMDD๏ผ+end_date | str | N | ๆฅๅ็ปๆๅงๆถ้ด๏ผๆ ผๅผ๏ผYYYYMMDD๏ผ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +end_date | str | Y | ๆฅๅๆ+ind_type | str | Y | ๆฅๅๆ็ฑปๅ(Q1ไธๅญฃๆฅQ2ๅๅนดๆฅQ3ไธๅญฃๆฅQ4ๅนดๆฅ)+name | str | Y | ่ก็ฅจๅ็งฐ+ind_name | str | Y | ่ดขๅก็ง็ฎๅ็งฐ+ind_value | float | Y | ่ดขๅก็ง็ฎๅผ+report_type | str | Y | ๆฅๅ็ฑปๅ++<br>+<br>+++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++#่ทๅ็พ่ก่ฑไผ่พพNVDA่ก็ฅจQ4็่ตไบง่ดๅบ่กจๆฐๆฎ+df = pro.us_balancesheet(ts_code='NVDA', report_type='Q4')++#่ทๅ็พ่ก่ฑไผ่พพNVDA่ก็ฅจๅๅนดๅบๆถๅธๆฌพๆๆ ๆฐๆฎ+df = pro.us_balancesheet(ts_code='NVDA', ind_name='ๅบๆถๅธๆฌพ')++```++<br>+<br>+++**ๆฐๆฎๆ ทไพ**++ ts_code end_date ind_type name ind_name ind_value report_type+ 0 NVDA 20250427 Q1 ่ฑไผ่พพ ่ดๅบๅ่กไธๆ็ๅ่ฎก 1.252540e+11 ไธๅญฃๆฅ+ 1 NVDA 20250427 Q1 ่ฑไผ่พพ ่กไธๆ็ๅ่ฎก 8.384300e+10 ไธๅญฃๆฅ+ 2 NVDA 20250427 Q1 ่ฑไผ่พพ ๅฝๅฑไบๆฏๅ ฌๅธ่กไธๆ็ 8.384300e+10 ไธๅญฃๆฅ+ 3 NVDA 20250427 Q1 ่ฑไผ่พพ ๅ ถไป็ปผๅๆถ็ 1.860000e+08 ไธๅญฃๆฅ+ 4 NVDA 20250427 Q1 ่ฑไผ่พพ ่กๆฌๆบขไปท 1.147500e+10 ไธๅญฃๆฅ+ ... ... ... ... ... ... ... ...+ 2459 NVDA 20060129 Q4 ่ฑไผ่พพ ้ขไปๆฌพ้กน(ๆตๅจ) 2.438700e+07 ๅนดๆฅ+ 2460 NVDA 20060129 Q4 ่ฑไผ่พพ ้ๅปถๆๅพ็จ่ตไบง(ๆตๅจ) 2.682000e+06 ๅนดๆฅ+ 2461 NVDA 20060129 Q4 ่ฑไผ่พพ ๅญ่ดง 2.548700e+08 ๅนดๆฅ+ 2462 NVDA 20060129 Q4 ่ฑไผ่พพ ๅบๆถ่ดฆๆฌพ 3.181860e+08 ๅนดๆฅ+ 2463 NVDA 20060129 Q4 ่ฑไผ่พพ ็ฐ้ๅ็ฐ้็ญไปท็ฉ 5.517560e+08 ๅนดๆฅdiff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\344\270\244\350\236\215\345\217\212\350\275\254\350\236\215\351\200\232/\345\201\232\345\270\202\345\200\237\345\210\270\344\272\244\346\230\223\346\261\207\346\200\273(\345\201\234).md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\344\270\244\350\236\215\345\217\212\350\275\254\350\236\215\351\200\232/\345\201\232\345\270\202\345\200\237\345\210\270\344\272\244\346\230\223\346\261\207\346\200\273(\345\201\234).md"new file mode 100644index 000000000..6915f6f0b--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\344\270\244\350\236\215\345\217\212\350\275\254\350\236\215\351\200\232/\345\201\232\345\270\202\345\200\237\345\210\270\344\272\244\346\230\223\346\261\207\346\200\273(\345\201\234).md"@@ -0,0 +1,66 @@+## ๅๅธๅๅธไบคๆๆฑๆป+----++ๆฅๅฃ๏ผslb_len_mm+ๆ่ฟฐ๏ผๅๅธๅๅธไบคๆๆฑๆป+้้๏ผๅๆฌกๆๅคงๅฏไปฅๆๅ5000่กๆฐๆฎ๏ผๅฏๅพช็ฏ่ทๅๆๆๅๅฒ+็งฏๅ๏ผ2000็งฏๅๆฏๅ้่ฏทๆฑ200ๆฌก๏ผ5000็งฏๅ500ๆฌก่ฏทๆฑ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+trade_date | str | N | ไบคๆๆฅๆ๏ผYYYYMMDDๆ ผๅผ๏ผไธๅ๏ผ+ts_code | str | N | ่ก็ฅจไปฃ็ +start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ๏ผYYYYMMDD๏ผ+ts_code | str | Y | ่ก็ฅจไปฃ็ +name | str | Y | ่ก็ฅจๅ็งฐ+ope_inv | float | Y | ๆๅไฝ้(ไธ่ก)+lent_qnt | float | Y | ่ๅบๆฐ้(ไธ่ก)+cls_inv | float | Y | ๆๆซไฝ้(ไธ่ก)+end_bal | float | Y | ๆๆซไฝ้ข(ไธๅ )++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++df = pro.slb_len_mm(trade_date='20240620')+++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ trade_date ts_code name ope_inv lent_qnt cls_inv end_bal+ 0 20240620 688002.SH ็ฟๅๅพฎ็บณ 18.49 None 18.49 558.21+ 1 20240620 688005.SH ๅฎน็พ็งๆ 12.24 None 12.24 309.06+ 2 20240620 688006.SH ๆญๅฏ็งๆ 6.92 None 6.92 129.89+ 3 20240620 688007.SH ๅ ๅณฐ็งๆ 9.66 None 9.66 167.99+ 4 20240620 688008.SH ๆพ่ตท็งๆ 38.13 None 38.13 2138.33+ .. ... ... ... ... ... ... ...+ 126 20240620 688789.SH ๅฎๅๆฐ็ง 1.49 None 1.49 155.14+ 127 20240620 688798.SH XD่พไธบ็ต 3.41 None 3.41 200.54+ 128 20240620 688819.SH ๅคฉ่ฝ่กไปฝ 15.77 None 15.77 395.51+ 129 20240620 688981.SH ไธญ่ฏๅฝ้ 57.08 None 57.08 2785.50+ 130 20240620 689009.SH ไนๅทๅ ฌๅธ 12.84 None 12.84 535.81\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\344\270\244\350\236\215\345\217\212\350\275\254\350\236\215\351\200\232/\350\236\215\350\265\204\350\236\215\345\210\270\344\272\244\346\230\223\346\230\216\347\273\206.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\344\270\244\350\236\215\345\217\212\350\275\254\350\236\215\351\200\232/\350\236\215\350\265\204\350\236\215\345\210\270\344\272\244\346\230\223\346\230\216\347\273\206.md"new file mode 100644index 000000000..11e775e9a--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\344\270\244\350\236\215\345\217\212\350\275\254\350\236\215\351\200\232/\350\236\215\350\265\204\350\236\215\345\210\270\344\272\244\346\230\223\346\230\216\347\273\206.md"@@ -0,0 +1,126 @@+## ่่ต่ๅธไบคๆๆ็ป+----++ๆฅๅฃ๏ผmargin_detail+ๆ่ฟฐ๏ผ่ทๅๆฒชๆทฑไธคๅธๆฏๆฅ่่ต่ๅธๆ็ป+้้๏ผๅๆฌก่ฏทๆฑๆๅคง่ฟๅ6000่กๆฐๆฎ๏ผๅฏๆ นๆฎๆฅๆๅพช็ฏ+ๆ้๏ผ2000็งฏๅๅฏ่ทๅพๆฌๆฅๅฃๆ้๏ผ็งฏๅ่ถ้ซๆ้่ถๅคง๏ผๅ ทไฝๅ่[ๆ้่ฏดๆ](https://tushare.pro/document/1?doc_id=290)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+trade_date | str | N | ไบคๆๆฅๆ๏ผๆ ผๅผ๏ผYYYYMMDD๏ผไธๅ๏ผ+ts_code | str | N | TSไปฃ็ +start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+++<br>+<br>++**่พๅบๅๆฐ**+++ๅ็งฐ | ็ฑปๅ | ๆ่ฟฐ+--- | ---- | ----+trade_date | str | ไบคๆๆฅๆ+ts_code | str | TS่ก็ฅจไปฃ็ +name | str | ่ก็ฅจๅ็งฐ ๏ผ20190910ๅๆๆฐๆฎ๏ผ+rzye | float | ่่ตไฝ้ข(ๅ )+rqye | float | ่ๅธไฝ้ข(ๅ )+rzmre | float | ่่ตไนฐๅ ฅ้ข(ๅ )+rqyl | float | ่ๅธไฝ้๏ผ่ก๏ผ+rzche | float | ่่ตๅฟ่ฟ้ข(ๅ )+rqchl | float | ่ๅธๅฟ่ฟ้(่ก)+rqmcl | float | ่ๅธๅๅบ้(่ก,ไปฝ,ๆ)+rzrqye | float | ่่ต่ๅธไฝ้ข(ๅ )++<br>+<br>++**ๆฅๅฃไฝฟ็จ**++```python++pro = ts.pro_api()++df = pro.margin_detail(trade_date='20180802')++```++ๆ่++```python++df = pro.query('margin_detail', trade_date='20180802')++```++<br>+<br>++**ๆฐๆฎๆ ทไพ**++ trade_date ts_code rzye rqye rzmre rqyl \+ 0 20180802 000001.SZ 4.430811e+09 8238210.0 78800436.0 921500.0+ 1 20180802 000002.SZ 2.613071e+09 30772020.0 186176338.0 1439290.0+ 2 20180802 000006.SZ 8.214685e+08 1008250.0 15199626.0 185000.0+ 3 20180802 000009.SZ 1.318175e+09 74451.0 8010979.0 15674.0+ 4 20180802 000012.SZ 6.422077e+08 190201.0 7831261.0 38347.0+ 5 20180802 000022.SZ 1.891423e+08 1761368.0 8868547.0 99400.0+ 6 20180802 000027.SZ 3.583209e+08 104157.0 4235209.0 21300.0+ 7 20180802 000028.SZ 2.885056e+08 524656.0 4737219.0 12100.0+ 8 20180802 000030.SZ 1.076096e+08 965944.0 2717503.0 200820.0+ 9 20180802 000031.SZ 5.659868e+08 90675.0 2056441.0 15500.0+ 10 20180802 000036.SZ 3.974383e+08 620420.0 5980093.0 110199.0+ 11 20180802 000039.SZ 1.047953e+09 2519010.0 17651054.0 215300.0+ 12 20180802 000043.SZ 3.496989e+08 14532.0 2299872.0 2100.0+ 13 20180802 000046.SZ 7.221042e+08 2208480.0 17142811.0 344000.0+ 14 20180802 000049.SZ 3.914922e+08 1795218.0 12595082.0 65783.0+ 15 20180802 000050.SZ 1.884433e+09 517992.0 51120876.0 38200.0+ 16 20180802 000059.SZ 7.077480e+08 587805.0 49392632.0 78900.0+ 17 20180802 000060.SZ 1.425264e+09 2372025.0 21992232.0 520181.0+ 18 20180802 000061.SZ 6.317999e+08 547716.0 5760238.0 105128.0+ 19 20180802 000062.SZ 5.627777e+08 795577.0 3060551.0 39191.0+ 20 20180802 000063.SZ 2.581872e+09 3873697.0 194982814.0 276101.0++ rzche rqchl rqmcl rzrqye+ 0 147005397.0 544400.0 260000.0 4.439049e+09+ 1 133408689.0 437600.0 516700.0 2.643843e+09+ 2 16084617.0 90000.0 100.0 8.224767e+08+ 3 11337406.0 80000.0 2000.0 1.318249e+09+ 4 8260616.0 0.0 26700.0 6.423979e+08+ 5 8464082.0 10000.0 19400.0 1.909037e+08+ 6 2999201.0 21700.0 0.0 3.584250e+08+ 7 4526179.0 4400.0 0.0 2.890302e+08+ 8 1906548.0 14140.0 171700.0 1.085755e+08+ 9 4193433.0 37600.0 7500.0 5.660775e+08+ 10 5291427.0 0.0 0.0 3.980587e+08+ 11 24101032.0 1700.0 33900.0 1.050472e+09+ 12 2852687.0 17200.0 0.0 3.497134e+08+ 13 8927796.0 147100.0 48600.0 7.243127e+08+ 14 12113754.0 1800.0 12900.0 3.932874e+08+ 15 59634348.0 0.0 8600.0 1.884951e+09+ 16 52573324.0 0.0 69700.0 7.083358e+08+ 17 19472310.0 365340.0 458531.0 1.427636e+09+ 18 3299825.0 6000.0 46728.0 6.323476e+08+ 19 9640216.0 7420.0 32296.0 5.635733e+08+ 20 201355327.0 63900.0 10900.0 2.585746e+09+++**่ฏดๆ**++ๆฌๆฅ่กจๅบไบ่ฏๅธๅ ฌๅธๆฅ้็่่ต่ๅธไฝ้ขๆฐๆฎๆฑๆป็ๆ๏ผๅ ถไธญ๏ผ+ๆฌๆฅ่่ตไฝ้ข(ๅ )=ๅๆฅ่่ตไฝ้ข๏ผๆฌๆฅ่่ตไนฐๅ ฅ-ๆฌๆฅ่่ตๅฟ่ฟ้ข+ๆฌๆฅ่ๅธไฝ้(่ก)=ๅๆฅ่ๅธไฝ้๏ผๆฌๆฅ่ๅธๅๅบ้-ๆฌๆฅ่ๅธไนฐๅ ฅ้-ๆฌๆฅ็ฐๅธๅฟ่ฟ้+ๆฌๆฅ่ๅธไฝ้ข(ๅ )=ๆฌๆฅ่ๅธไฝ้รๆฌๆฅๆถ็ไปท+ๆฌๆฅ่่ต่ๅธไฝ้ข(ๅ )=ๆฌๆฅ่่ตไฝ้ข๏ผๆฌๆฅ่ๅธไฝ้ข+++ๅไฝ่ฏดๆ๏ผ่ก๏ผๆ ็่ฏๅธไธบ่ก็ฅจ๏ผใไปฝ๏ผๆ ็่ฏๅธไธบๅบ้๏ผใๆ๏ผๆ ็่ฏๅธไธบๅบๅธ๏ผใ++2014ๅนด9ๆ22ๆฅ่ตท๏ผโ่่ต่ๅธไบคๆๆป้โๆฐๆฎๅ ๅซ่ฐๅบๆ ็่ฏๅธๅๅ็่ฏๅธ็่่ต่ๅธไฝ้ขใ\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\344\270\244\350\236\215\345\217\212\350\275\254\350\236\215\351\200\232/\350\236\215\350\265\204\350\236\215\345\210\270\344\272\244\346\230\223\346\261\207\346\200\273.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\344\270\244\350\236\215\345\217\212\350\275\254\350\236\215\351\200\232/\350\236\215\350\265\204\350\236\215\345\210\270\344\272\244\346\230\223\346\261\207\346\200\273.md"new file mode 100644index 000000000..8ef39f7c8--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\344\270\244\350\236\215\345\217\212\350\275\254\350\236\215\351\200\232/\350\236\215\350\265\204\350\236\215\345\210\270\344\272\244\346\230\223\346\261\207\346\200\273.md"@@ -0,0 +1,82 @@+## ่่ต่ๅธไบคๆๆฑๆป+----++ๆฅๅฃ๏ผmargin+ๆ่ฟฐ๏ผ่ทๅ่่ต่ๅธๆฏๆฅไบคๆๆฑๆปๆฐๆฎ+้้๏ผๅๆฌก่ฏทๆฑๆๅคง่ฟๅ4000่กๆฐๆฎ๏ผๅฏๆ นๆฎๆฅๆๅพช็ฏ+ๆ้๏ผ2000็งฏๅๅฏ่ทๅพๆฌๆฅๅฃๆ้๏ผ็งฏๅ่ถ้ซๆ้่ถๅคง๏ผๅ ทไฝๅ่[ๆ้่ฏดๆ](https://tushare.pro/document/1?doc_id=290)++<br>+<br>+++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+trade_date | str | N | ไบคๆๆฅๆ๏ผๆ ผๅผ๏ผYYYYMMDD๏ผไธๅ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+exchange_id | str | N | ไบคๆๆไปฃ็ ๏ผSSEไธไบคๆSZSEๆทฑไบคๆBSEๅไบคๆ๏ผ++**่พๅบๅๆฐ**++<br>+<br>++ๅ็งฐ | ็ฑปๅ | ๆ่ฟฐ+--- | ---- | ----+trade_date | str | ไบคๆๆฅๆ+exchange_id | str | ไบคๆๆไปฃ็ ๏ผSSEไธไบคๆSZSEๆทฑไบคๆBSEๅไบคๆ๏ผ+rzye | float | ่่ตไฝ้ข(ๅ )+rzmre | float | ่่ตไนฐๅ ฅ้ข(ๅ )+rzche | float | ่่ตๅฟ่ฟ้ข(ๅ )+rqye | float | ่ๅธไฝ้ข(ๅ )+rqmcl | float | ่ๅธๅๅบ้(่ก,ไปฝ,ๆ)+rzrqye | float | ่่ต่ๅธไฝ้ข(ๅ )+rqyl | float | ่ๅธไฝ้(่ก,ไปฝ,ๆ)++<br>+<br>++**ๆฅๅฃไฝฟ็จ**++```python++pro = ts.pro_api()++df = pro.margin(trade_date='20180802')++```++ๆ่++```python++df = pro.query('margin', trade_date='20180802', exchange_id='SSE')++```++**ๆฐๆฎๆ ทไพ**++ trade_date exchange_id rzye rzmre rzche \+ 0 20180802 SZSE 3.495054e+11 1.347549e+10 1.463921e+10+ 1 20180802 SSE 5.311746e+11 1.484584e+10 1.573947e+10++ rqye rqmcl rzrqye+ 0 1.083380e+09 24418046.0 3.505888e+11+ 1 6.029618e+09 83721012.0 5.372042e+11++++**่ฏดๆ**+่่ต่ๅธๆฐๆฎไป่ฏๅธไบคๆๆ็ฝ็ซ็ดๆฅ่ทๅ๏ผๆไพไบๆ่ฎฐๅฝไปฅๆฅ็ๅ จ้จๆฑๆปๅๆ็ปๆฐๆฎใ+ๆ นๆฎไบคๆ็ฝ็ซๆ็คบ๏ผๆฐๆฎๆ นๆฎๅธๅ็ณๆฅ็ๆฐๆฎๆฑๆป๏ผ็ฑๅธๅไฟ่ฏๆฐๆฎ็็ๅฎใๅฎๆดใๅ็กฎใ++ๅ ถไธญ๏ผ+ๆฌๆฅ่่ตไฝ้ข(ๅ )=ๅๆฅ่่ตไฝ้ข๏ผๆฌๆฅ่่ตไนฐๅ ฅ-ๆฌๆฅ่่ตๅฟ่ฟ้ข+ๆฌๆฅ่ๅธไฝ้(่ก)=ๅๆฅ่ๅธไฝ้๏ผๆฌๆฅ่ๅธๅๅบ้-ๆฌๆฅ่ๅธไนฐๅ ฅ้-ๆฌๆฅ็ฐๅธๅฟ่ฟ้+ๆฌๆฅ่ๅธไฝ้ข(ๅ )=ๆฌๆฅ่ๅธไฝ้รๆฌๆฅๆถ็ไปท+ๆฌๆฅ่่ต่ๅธไฝ้ข(ๅ )=ๆฌๆฅ่่ตไฝ้ข๏ผๆฌๆฅ่ๅธไฝ้ข++2014ๅนด9ๆ22ๆฅ่ตท๏ผโ่่ต่ๅธไบคๆๆป้โๆฐๆฎๅ ๅซ่ฐๅบๆ ็่ฏๅธๅๅ็่ฏๅธ็่่ต่ๅธไฝ้ข\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\344\270\244\350\236\215\345\217\212\350\275\254\350\236\215\351\200\232/\350\236\215\350\265\204\350\236\215\345\210\270\346\240\207\347\232\204(\347\233\230\345\211\215).md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\344\270\244\350\236\215\345\217\212\350\275\254\350\236\215\351\200\232/\350\236\215\350\265\204\350\236\215\345\210\270\346\240\207\347\232\204(\347\233\230\345\211\215).md"new file mode 100644index 000000000..2052c4533--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\344\270\244\350\236\215\345\217\212\350\275\254\350\236\215\351\200\232/\350\236\215\350\265\204\350\236\215\345\210\270\346\240\207\347\232\204(\347\233\230\345\211\215).md"@@ -0,0 +1,67 @@+## ่่ต่ๅธๆ ็๏ผ็ๅๆดๆฐ๏ผ+----++ๆฅๅฃ๏ผmargin_secs+ๆ่ฟฐ๏ผ่ทๅๆฒชๆทฑไบฌไธๅคงไบคๆๆ่่ต่ๅธๆ ็๏ผๅ ๆฌETF๏ผ๏ผๆฏๅคฉ็ๅๆดๆฐ+้้๏ผๅๆฌกๆๅคง6000่กๆฐๆฎ๏ผๅฏๆ นๆฎ่ก็ฅจไปฃ็ ใไบคๆๆฅๆใไบคๆๆไปฃ็ ๅพช็ฏๆๅ+็งฏๅ๏ผ2000็งฏๅๅฏ่ฐๅ๏ผ5000็งฏๅๆ ๆป้้ๅถ๏ผ็งฏๅ่ถ้ซๆ้่ถๅคง๏ผๅ ทไฝๅ่[ๆ้่ฏดๆ](https://tushare.pro/document/1?doc_id=290)+++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ๆ ็ไปฃ็ +trade_date | str | N | ไบคๆๆฅ+exchange | str | N | ไบคๆๆ๏ผSSEไธไบคๆ SZSEๆทฑไบคๆ BSEๅไบคๆ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ+ts_code | str | Y | ๆ ็ไปฃ็ +name | str | Y | ๆ ็ๅ็งฐ+exchange | str | Y | ไบคๆๆ+++<br>+<br>++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++#่ทๅ2024ๅนด4ๆ17ๆฅไธไบคๆ่่ต่ๅธๆ ็+df = pro.margin_secs(trade_date='20240417', exchange='SSE')++```++<br>+<br>+++**ๆฐๆฎๆ ทไพ**++ trade_date ts_code name exchange+ 0 20240417 510050 .SH 50ETF SSE+ 1 20240417 510100 .SH SZ50ETF SSE+ 2 20240417 510150 .SH ๆถ่ดนETF SSE+ 3 20240417 510180 .SH 180ETF SSE+ 4 20240417 510210 .SH ็ปผๆETF SSE+ ... ... ... ... ...+ 1781 20240417 688799 .SH ๅ็บณ่ฏๅ SSE+ 1782 20240417 688800 .SH ็ๅฏ่พพ SSE+ 1783 20240417 688819 .SH ๅคฉ่ฝ่กไปฝ SSE+ 1784 20240417 688981 .SH ไธญ่ฏๅฝ้ SSE+ 1785 20240417 689009 .SH ไนๅทๅ ฌๅธ SSEdiff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\344\270\244\350\236\215\345\217\212\350\275\254\350\236\215\351\200\232/\350\275\254\350\236\215\345\210\270\344\272\244\346\230\223\346\230\216\347\273\206(\345\201\234).md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\344\270\244\350\236\215\345\217\212\350\275\254\350\236\215\351\200\232/\350\275\254\350\236\215\345\210\270\344\272\244\346\230\223\346\230\216\347\273\206(\345\201\234).md"new file mode 100644index 000000000..f807c5db9--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\344\270\244\350\236\215\345\217\212\350\275\254\350\236\215\351\200\232/\350\275\254\350\236\215\345\210\270\344\272\244\346\230\223\346\230\216\347\273\206(\345\201\234).md"@@ -0,0 +1,66 @@+## ่ฝฌ่ๅธไบคๆๆ็ป+----++ๆฅๅฃ๏ผslb_sec_detail+ๆ่ฟฐ๏ผ่ฝฌ่ๅธไบคๆๆ็ป+้้๏ผๅๆฌกๆๅคงๅฏไปฅๆๅ5000่กๆฐๆฎ๏ผๅฏๅพช็ฏ่ทๅๆๆๅๅฒ+็งฏๅ๏ผ2000็งฏๅๆฏๅ้่ฏทๆฑ200ๆฌก๏ผ5000็งฏๅ500ๆฌก่ฏทๆฑ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+trade_date | str | N | ไบคๆๆฅๆ๏ผYYYYMMDDๆ ผๅผ๏ผไธๅ๏ผ+ts_code | str | N | ่ก็ฅจไปฃ็ +start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ๏ผYYYYMMDD๏ผ+ts_code | str | Y | ่ก็ฅจไปฃ็ +name | str | Y | ่ก็ฅจๅ็งฐ+tenor | str | Y | ๆ ้(ๅคฉ)+fee_rate | float | Y | ่ๅบ่ดน็(%)+lent_qnt | float | Y | ่ฝฌ่ๅธ่ๅบๆฐ้(ไธ่ก)++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++df = pro.slb_sec_detail(trade_date='20240620')+++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ trade_date ts_code name tenor fee_rate lent_qnt+ 0 20240620 000001.SZ ๅนณๅฎ้ถ่ก 14 2.20 1.43+ 1 20240620 000002.SZ ไธ็ง๏ผก 14 4.60 2.27+ 2 20240620 000009.SZ ไธญๅฝๅฎๅฎ 14 7.10 0.66+ 3 20240620 000016.SZ ๆทฑๅบทไฝณ๏ผก 14 1.40 9.68+ 4 20240620 000031.SZ ๅคงๆฆๅ 14 3.80 0.22+ .. ... ... ... ... ... ...+ 932 20240620 688789.SH ๅฎๅๆฐ็ง 14 1.40 0.84+ 933 20240620 688798.SH XD่พไธบ็ต 14 1.40 1.32+ 934 20240620 688819.SH ๅคฉ่ฝ่กไปฝ 14 2.10 0.74+ 935 20240620 688981.SH ไธญ่ฏๅฝ้ 14 3.10 0.10+ 936 20240620 689009.SH ไนๅทๅ ฌๅธ 14 1.40 5.72diff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\344\270\244\350\236\215\345\217\212\350\275\254\350\236\215\351\200\232/\350\275\254\350\236\215\345\210\270\344\272\244\346\230\223\346\261\207\346\200\273(\345\201\234).md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\344\270\244\350\236\215\345\217\212\350\275\254\350\236\215\351\200\232/\350\275\254\350\236\215\345\210\270\344\272\244\346\230\223\346\261\207\346\200\273(\345\201\234).md"new file mode 100644index 000000000..12099f5fd--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\344\270\244\350\236\215\345\217\212\350\275\254\350\236\215\351\200\232/\350\275\254\350\236\215\345\210\270\344\272\244\346\230\223\346\261\207\346\200\273(\345\201\234).md"@@ -0,0 +1,67 @@+## ่ฝฌ่ๅธไบคๆๆฑๆป+----++ๆฅๅฃ๏ผslb_sec+ๆ่ฟฐ๏ผ่ฝฌ่้่ฝฌ่ๅธไบคๆๆฑๆป+้้๏ผๅๆฌกๆๅคงๅฏไปฅๆๅ5000่กๆฐๆฎ๏ผๅฏๅพช็ฏ่ทๅๆๆๅๅฒ+็งฏๅ๏ผ2000็งฏๅๆฏๅ้่ฏทๆฑ200ๆฌก๏ผ5000็งฏๅ500ๆฌก่ฏทๆฑ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+trade_date | str | N | ไบคๆๆฅๆ๏ผYYYYMMDDๆ ผๅผ๏ผไธๅ๏ผ+ts_code | str | N | ่ก็ฅจไปฃ็ +start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ๏ผYYYYMMDD๏ผ+ts_code | str | Y | ่ก็ฅจไปฃ็ +name | str | Y | ่ก็ฅจๅ็งฐ+ope_inv | float | Y | ๆๅไฝ้(ไธ่ก)+lent_qnt | float | Y | ่ฝฌ่ๅธ่ๅบๆฐ้(ไธ่ก)+cls_inv | float | Y | ๆๆซไฝ้(ไธ่ก)+end_bal | float | Y | ๆๆซไฝ้ข(ไธๅ )++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++df = pro.slb_sec(trade_date='20240620')+++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ trade_date ts_code name ope_inv lent_qnt cls_inv end_bal+ 0 20240620 000001.SZ ๅนณๅฎ้ถ่ก 186.97 1.43 188.40 2004.70+ 1 20240620 000002.SZ ไธ็ง๏ผก 3456.26 3.18 3376.80 24346.73+ 2 20240620 000006.SZ ๆทฑๆฏไธ๏ผก 17.08 None 17.08 64.56+ 3 20240620 000008.SZ ็ฅๅท้ซ้ 17.07 None 17.07 33.97+ 4 20240620 000009.SZ ไธญๅฝๅฎๅฎ 315.61 0.66 310.56 2822.99+ ... ... ... ... ... ... ... ...+ 2249 20240620 688798.SH XD่พไธบ็ต 65.35 1.32 63.40 3727.91+ 2250 20240620 688800.SH ็ๅฏ่พพ 6.49 None 6.36 191.18+ 2251 20240620 688819.SH ๅคฉ่ฝ่กไปฝ 108.34 1.05 108.44 2717.34+ 2252 20240620 688981.SH ไธญ่ฏๅฝ้ 303.00 22.45 315.30 15386.64+ 2253 20240620 689009.SH ไนๅทๅ ฌๅธ 259.35 5.72 253.62 10583.56\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\344\270\244\350\236\215\345\217\212\350\275\254\350\236\215\351\200\232/\350\275\254\350\236\215\350\265\204\344\272\244\346\230\223\346\261\207\346\200\273.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\344\270\244\350\236\215\345\217\212\350\275\254\350\236\215\351\200\232/\350\275\254\350\236\215\350\265\204\344\272\244\346\230\223\346\261\207\346\200\273.md"new file mode 100644index 000000000..716fa8497--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\344\270\244\350\236\215\345\217\212\350\275\254\350\236\215\351\200\232/\350\275\254\350\236\215\350\265\204\344\272\244\346\230\223\346\261\207\346\200\273.md"@@ -0,0 +1,66 @@+## ่ฝฌ่่ตไบคๆๆฑๆป+----++ๆฅๅฃ๏ผslb_len+ๆ่ฟฐ๏ผ่ฝฌ่้่่ตๆฑๆป+้้๏ผๅๆฌกๆๅคงๅฏไปฅๆๅ5000่กๆฐๆฎ๏ผๅฏๅพช็ฏ่ทๅๆๆๅๅฒ+็งฏๅ๏ผ2000็งฏๅๆฏๅ้่ฏทๆฑ200ๆฌก๏ผ5000็งฏๅ500ๆฌก่ฏทๆฑ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+trade_date | str | N | ไบคๆๆฅๆ๏ผYYYYMMDDๆ ผๅผ๏ผไธๅ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ+ob | float | Y | ๆๅไฝ้ข(ไบฟๅ )+auc_amount | float | Y | ็ซไปทๆไบค้้ข(ไบฟๅ )+repo_amount | float | Y | ๅๅๆไบค้้ข(ไบฟๅ )+repay_amount | float | Y | ๅฟ่ฟ้้ข(ไบฟๅ )+cb | float | Y | ๆๆซไฝ้ข(ไบฟๅ )++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++df = pro.slb_len(start_date='20240601', end_date='20240620')+++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ trade_date ob auc_amount repo_amount repay_amount cb+ 0 20240620 1435.50 None 3.10 3.10 1435.50+ 1 20240619 1435.50 None 2.70 2.70 1435.50+ 2 20240618 1440.20 None 29.50 34.20 1435.50+ 3 20240617 1442.20 None 3.00 5.00 1440.20+ 4 20240614 1442.20 None None None 1442.20+ 5 20240613 1445.20 None 2.90 5.90 1442.20+ 6 20240612 1445.20 None 3.30 3.30 1445.20+ 7 20240611 1454.20 None 2.70 11.70 1445.20+ 8 20240607 1454.20 None None None 1454.20+ 9 20240606 1454.20 None 26.00 26.00 1454.20+ 10 20240605 1455.60 None 6.00 7.40 1454.20+ 11 20240604 1406.00 50.00 6.40 6.80 1455.60+ 12 20240603 1406.00 None 1.00 1.00 1406.00\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\217\202\350\200\203\346\225\260\346\215\256/\345\211\215\345\215\201\345\244\247\346\265\201\351\200\232\350\202\241\344\270\234.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\217\202\350\200\203\346\225\260\346\215\256/\345\211\215\345\215\201\345\244\247\346\265\201\351\200\232\350\202\241\344\270\234.md"new file mode 100644index 000000000..75f133f5e--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\217\202\350\200\203\346\225\260\346\215\256/\345\211\215\345\215\201\345\244\247\346\265\201\351\200\232\350\202\241\344\270\234.md"@@ -0,0 +1,64 @@+## ๅๅๅคงๆต้่กไธ+----++ๆฅๅฃ๏ผtop10_floatholders+ๆ่ฟฐ๏ผ่ทๅไธๅธๅ ฌๅธๅๅๅคงๆต้่กไธๆฐๆฎ+็งฏๅ๏ผ้2000็งฏๅไปฅไธๆๅฏไปฅ่ฐๅๆฌๆฅๅฃ๏ผ5000็งฏๅไปฅไธ้ขๆฌกไผๆด้ซ++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | TSไปฃ็ +period | str | N | ๆฅๅๆ๏ผYYYYMMDDๆ ผๅผ๏ผไธ่ฌไธบๆฏไธชๅญฃๅบฆๆๅไธๅคฉ๏ผ+ann_date | str | N | ๅ ฌๅๆฅๆ+start_date | str | N | ๆฅๅๆๅผๅงๆฅๆ+end_date | str | N | ๆฅๅๆ็ปๆๆฅๆ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๆ่ฟฐ+--- | ---- | ----+ts_code | str | TS่ก็ฅจไปฃ็ +ann_date | str | ๅ ฌๅๆฅๆ+end_date | str | ๆฅๅๆ+holder_name | str | ่กไธๅ็งฐ+hold_amount | float | ๆๆๆฐ้๏ผ่ก๏ผ+hold_ratio | float | ๅ ๆป่กๆฌๆฏไพ(%)+hold_float_ratio | float | ๅ ๆต้่กๆฌๆฏไพ(%)+hold_change | float | ๆ่กๅๅจ+holder_type | str | ่กไธ็ฑปๅ+++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++df = pro.top10_floatholders(ts_code='600000.SH', start_date='20170101', end_date='20171231')++```++ๆ่++```python++df = pro.query('top10_floatholders', ts_code='600000.SH', start_date='20170101', end_date='20171231')++```++**ๆฐๆฎๆ ทไพ**++ ts_code ann_date end_date holder_name hold_amount+ 0 600000.SH 20180428 20171231 ๅฏๅพท็ๅฝไบบๅฏฟไฟ้ฉ่กไปฝๆ้ๅ ฌๅธ-่ตๆฌ้ 1.763232e+09+ 1 600000.SH 20180428 20171231 ไธๆตทๅฝ้ ้ๅขๆ้ๅ ฌๅธ 5.489319e+09+ 2 600000.SH 20180428 20171231 ๅฏๅพท็ๅฝไบบๅฏฟไฟ้ฉ่กไปฝๆ้ๅ ฌๅธ-ไผ ็ป 2.779437e+09+ 3 600000.SH 20180428 20171231 ไธญๅฝ่ฏๅธ้่่กไปฝๆ้ๅ ฌๅธ 1.216979e+09+ 4 600000.SH 20180428 20171231 ๆขงๆกๆ ๆ่ตๅนณๅฐๆ้่ดฃไปปๅ ฌๅธ 8.861313e+08+ 5 600000.SH 20180428 20171231 ไธๆตทไธๅฝๆ่ตไบง็ฎก็ๆ้ๅ ฌๅธ 1.395571e+09+ 6 600000.SH 20180428 20171231 ๅฏๅพท็ๅฝไบบๅฏฟไฟ้ฉ่กไปฝๆ้ๅ ฌๅธ-ไธ่ฝH 1.270429e+09+ 7 600000.SH 20180428 20171231 ไธๆตทๅฝ้ซๆ่ตๅๅฑๆ้ๅ ฌๅธ 5.392559e+08+ 8 600000.SH 20180428 20171231 ไธญๅคฎๆฑ้่ตไบง็ฎก็ๆ้่ดฃไปปๅ ฌๅธ 3.985214e+08+ 9 600000.SH 20180428 20171231 ไธญๅฝ็งปๅจ้ไฟก้ๅขๅนฟไธๆ้ๅ ฌๅธ 5.334893e+09\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\217\202\350\200\203\346\225\260\346\215\256/\345\211\215\345\215\201\345\244\247\350\202\241\344\270\234.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\217\202\350\200\203\346\225\260\346\215\256/\345\211\215\345\215\201\345\244\247\350\202\241\344\270\234.md"new file mode 100644index 000000000..092ab5ffe--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\217\202\350\200\203\346\225\260\346\215\256/\345\211\215\345\215\201\345\244\247\350\202\241\344\270\234.md"@@ -0,0 +1,65 @@+## ๅๅๅคง่กไธ+----++ๆฅๅฃ๏ผtop10_holders+ๆ่ฟฐ๏ผ่ทๅไธๅธๅ ฌๅธๅๅๅคง่กไธๆฐๆฎ๏ผๅ ๆฌๆๆๆฐ้ๅๆฏไพ็ญไฟกๆฏ+็งฏๅ๏ผ้2000็งฏๅไปฅไธๆๅฏไปฅ่ฐๅๆฌๆฅๅฃ๏ผ5000็งฏๅไปฅไธ้ขๆฌกไผๆด้ซ++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | TSไปฃ็ +period | str | N | ๆฅๅๆ๏ผYYYYMMDDๆ ผๅผ๏ผไธ่ฌไธบๆฏไธชๅญฃๅบฆๆๅไธๅคฉ๏ผ+ann_date | str | N | ๅ ฌๅๆฅๆ+start_date | str | N | ๆฅๅๆๅผๅงๆฅๆ+end_date | str | N | ๆฅๅๆ็ปๆๆฅๆ+++**่พๅบๅๆฐ**+++ๅ็งฐ | ็ฑปๅ | ๆ่ฟฐ+--- | ---- | ----+ts_code | str | TS่ก็ฅจไปฃ็ +ann_date | str | ๅ ฌๅๆฅๆ+end_date | str | ๆฅๅๆ+holder_name | str | ่กไธๅ็งฐ+hold_amount | float | ๆๆๆฐ้๏ผ่ก๏ผ+hold_ratio | float | ๅ ๆป่กๆฌๆฏไพ(%)+hold_float_ratio | float | ๅ ๆต้่กๆฌๆฏไพ(%)+hold_change | float | ๆ่กๅๅจ+holder_type | str | ่กไธ็ฑปๅ++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++df = pro.top10_holders(ts_code='600000.SH', start_date='20170101', end_date='20171231')++```++ๆ่++```python++df = pro.query('top10_holders', ts_code='600000.SH', start_date='20170101', end_date='20171231')++```+++**ๆฐๆฎๆ ทไพ**++ ts_code ann_date end_date holder_name hold_amount hold_ratio+ 0 600000.SH 20180428 20171231 ๅฏๅพท็ๅฝไบบๅฏฟไฟ้ฉ่กไปฝๆ้ๅ ฌๅธ-ไผ ็ป 2.779437e+09 9.47+ 1 600000.SH 20180428 20171231 ไธๆตทๅฝ้ซๆ่ตๅๅฑๆ้ๅ ฌๅธ 9.455690e+08 3.22+ 2 600000.SH 20180428 20171231 ๅฏๅพท็ๅฝไบบๅฏฟไฟ้ฉ่กไปฝๆ้ๅ ฌๅธ-ไธ่ฝH 1.270429e+09 4.33+ 3 600000.SH 20180428 20171231 ๅฏๅพท็ๅฝไบบๅฏฟไฟ้ฉ่กไปฝๆ้ๅ ฌๅธ-่ตๆฌ้ 1.763232e+09 6.01+ 4 600000.SH 20180428 20171231 ไธๆตทๅฝ้ ้ๅขๆ้ๅ ฌๅธ 6.331323e+09 21.57+ 5 600000.SH 20180428 20171231 ไธญๅฝ็งปๅจ้ไฟก้ๅขๅนฟไธๆ้ๅ ฌๅธ 5.334893e+09 18.18+ 6 600000.SH 20180428 20171231 ไธญๅฝ่ฏๅธ้่่กไปฝๆ้ๅ ฌๅธ 1.216979e+09 4.15+ 7 600000.SH 20180428 20171231 ๆขงๆกๆ ๆ่ตๅนณๅฐๆ้่ดฃไปปๅ ฌๅธ 8.861313e+08 3.02+ 8 600000.SH 20180428 20171231 ไธญๅคฎๆฑ้่ตไบง็ฎก็ๆ้่ดฃไปปๅ ฌๅธ 3.985214e+08 1.36+ 9 600000.SH 20180428 20171231 ไธๆตทไธๅฝๆ่ตไบง็ฎก็ๆ้ๅ ฌๅธ 1.395571e+09 4.75\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\217\202\350\200\203\346\225\260\346\215\256/\345\244\247\345\256\227\344\272\244\346\230\223.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\217\202\350\200\203\346\225\260\346\215\256/\345\244\247\345\256\227\344\272\244\346\230\223.md"new file mode 100644index 000000000..8d14f99cd--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\217\202\350\200\203\346\225\260\346\215\256/\345\244\247\345\256\227\344\272\244\346\230\223.md"@@ -0,0 +1,94 @@+## ๅคงๅฎไบคๆ+----++ๆฅๅฃ๏ผblock_trade+ๆ่ฟฐ๏ผๅคงๅฎไบคๆ+้้๏ผๅๆฌกๆๅคง1000ๆก๏ผๆป้ไธ้ๅถ+็งฏๅ๏ผ300็งฏๅๅฏ่ฐๅ๏ผๆฏๅ้ๅ ้ๅถๆฌกๆฐ๏ผ่ถ ่ฟ5000็งฏๅ้ขๆฌก็ธๅฏน่พ้ซ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | TSไปฃ็ ๏ผ่ก็ฅจไปฃ็ ๅๆฅๆ่ณๅฐ่พๅ ฅไธไธชๅๆฐ๏ผ+trade_date | str | N | ไบคๆๆฅๆ๏ผๆ ผๅผ๏ผYYYYMMDD๏ผไธๅ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | TSไปฃ็ +trade_date | str | Y | ไบคๆๆฅๅ+price | float | Y | ๆไบคไปท+vol | float | Y | ๆไบค้๏ผไธ่ก๏ผ+amount | float | Y | ๆไบค้้ข+buyer | str | Y | ไนฐๆน่ฅไธ้จ+seller | str | Y | ๅๆน่ฅไธ้จ++<br>+<br>++**ๆฅๅฃไฝฟ็จ**++```pyhton++pro = ts.pro_api()++df = pro.block_trade(trade_date='20181227')++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code trade_date price vol amount \+ 0 600436.SH 20181227 86.95 9.49 825.16+ 1 603160.SH 20181227 70.00 28.57 2000.00+ 2 601318.SH 20181227 55.76 1800.00 100368.00+ 3 601318.SH 20181227 55.76 332.00 18512.32+ 4 601318.SH 20181227 55.76 288.00 16058.88+ 5 601318.SH 20181227 55.76 170.00 9479.20+ 6 601318.SH 20181227 55.76 72.00 4014.72+ 7 603508.SH 20181227 35.72 56.00 2000.32+ 8 600681.SH 20181227 10.69 111.00 1186.59+ 9 603606.SH 20181227 8.93 23.92 213.61+ 10 601108.SH 20181227 6.76 2000.00 13520.00+ 11 601108.SH 20181227 6.41 700.00 4487.00+ 12 600746.SH 20181227 5.75 244.71 1407.08+ 13 600016.SH 20181227 5.65 1326.00 7491.90+ 14 600016.SH 20181227 5.54 3500.00 19390.00+ 15 601011.SH 20181227 5.00 659.26 3296.30+ 16 601011.SH 20181227 5.00 596.75 2983.77+ 17 600984.SH 20181227 4.96 296.00 1468.16+ 18 601398.SH 20181227 4.74 172.20 816.23++ buyer seller+ 0 ๅฎไฟก่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆ้ฝไบคๅญๅคง้่ฏๅธ่ฅไธ้จ ๅฎไฟก่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆ้ฝไบคๅญๅคง้่ฏๅธ่ฅไธ้จ+ 1 ไธญๅฝ้ถๆฒณ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆป้จ ้ฟๆฑ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆญฆๆฑๅทจ้พๅคง้่ฏๅธ่ฅไธ้จ+ 2 ๆๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆป้จ ๆบๆไธ็จ+ 3 ๅ้ซ่ฏๅธๆ้่ดฃไปปๅ ฌๅธๅ่ฅๆข ๅฑฑ่ทฏ่ฏๅธ่ฅไธ้จ ๆบๆไธ็จ+ 4 ๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธไธๆตทๅพๆฑๅบๅคฉ้ฅๆกฅ่ทฏ่ฏๅธ่ฅไธ้จ ๆบๆไธ็จ+ 5 ไธๅ ด่ฏๅธ่กไปฝๆ้ๅ ฌๅธไธๆตท่ๅๆต่ทฏ่ฏๅธ่ฅไธ้จ ๆบๆไธ็จ+ 6 ้ฟๆฑ่ฏๅธ่กไปฝๆ้ๅ ฌๅธ่ๅทๅไบฌ่ฅฟ่ทฏ่ฏๅธ่ฅไธ้จ ๆบๆไธ็จ+ 7 ไธๆน่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅ ฌๅธๆป้จ ๆฑๆตท่ฏๅธๆ้ๅ ฌๅธๆทฑๅณๆฐ็ฐ่ทฏ่ฏๅธ่ฅไธ้จ+ 8 ๅฝไฟก่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทฑๅณๆฏๅ่ทฏ่ฏๅธ่ฅไธ้จ ไธญ่ช่ฏๅธๆ้ๅ ฌๅธๆทฑๅณๆฅ้ฃ่ทฏ่ฏๅธ่ฅไธ้จ+ 9 ๅนฟๅ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅนฟๅทๅคฉๆฒณๅ่ทฏๅคง้ฝไผๅนฟๅบ่ฏๅธ่ฅไธ้จ ็ฌฌไธๅไธ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทฑๅณๆทฑๅๅคง้่ฏๅธ่ฅไธ้จ+ 10 ไธญๅฝๅฝ้ ้่่กไปฝๆ้ๅ ฌๅธๅไบฌๅปบๅฝ้จๅคๅคง่ก่ฏๅธ่ฅไธ้จ ่ดข้่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆญๅทไฝ่ฒ้ฆ่ฏๅธ่ฅไธ้จ+ 11 ไธญๅฝ้ถๆฒณ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆญๅทๅบๆฅ่ทฏ่ฏๅธ่ฅไธ้จ ่ดข้่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทณๅฎๆฐๅฎๅคง่ก่ฏๅธ่ฅไธ้จ+ 12 ไธญไฟก่ฏๅธ่กไปฝๆ้ๅ ฌๅธ้ๆฑๆญฃไธ่ทฏ่ฏๅธ่ฅไธ้จ ไธญไฟก่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆป้จ(้่ฅไธๅบๆ)+ 13 ๅคชๅนณๆด่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅฆ้จ้ซๆไธญ่ทฏ่ฏๅธ่ฅไธ้จ ๅ็ฆ่ฏๅธๆ้่ดฃไปปๅ ฌๅธๅฆ้จๆนๆปจๅ่ทฏ่ฏๅธ่ฅไธ้จ+ 14 ไธญไฟก่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅไบฌๅฎๅคๅคง่ก่ฏๅธ่ฅไธ้จ ๆบๆไธ็จ+ 15 ไธญๅฝไธญๆ่ฏๅธๆ้่ดฃไปปๅ ฌๅธๅ่ฅ้ฟๆฑไธญ่ทฏ่ฏๅธ่ฅไธ้จ ไธญไฟก่ฏๅธ่กไปฝๆ้ๅ ฌๅธไธญๅฑฑไธญๅฑฑๅ่ทฏ่ฏๅธ่ฅไธ้จ+ 16 ไธญๅฝไธญๆ่ฏๅธๆ้่ดฃไปปๅ ฌๅธๅ่ฅ้ฟๆฑไธญ่ทฏ่ฏๅธ่ฅไธ้จ ๆตท้่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅไบฌๅ ๅ่ทฏ่ฅไธ้จ+ 17 ่ดขๅฏ่ฏๅธๆ้่ดฃไปปๅ ฌๅธ้ฟๆฒๅ ซไธ่ทฏ่ฏๅธ่ฅไธ้จ ไธญ่ช่ฏๅธๆ้ๅ ฌๅธๅไบฌๆ งๅฟ ่ทฏ่ฏๅธ่ฅไธ้จ+ 18 ไนๅท่ฏๅธ่กไปฝๆ้ๅ ฌๅธ้ๅบๅๅ ฌๅธ ไนๅท่ฏๅธ่กไปฝๆ้ๅ ฌๅธ้ๅบๅๅ ฌๅธ\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\217\202\350\200\203\346\225\260\346\215\256/\350\202\241\344\270\234\344\272\272\346\225\260.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\217\202\350\200\203\346\225\260\346\215\256/\350\202\241\344\270\234\344\272\272\346\225\260.md"new file mode 100644index 000000000..0f3839b67--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\217\202\350\200\203\346\225\260\346\215\256/\350\202\241\344\270\234\344\272\272\346\225\260.md"@@ -0,0 +1,68 @@+## ่กไธไบบๆฐ+----++ๆฅๅฃ๏ผstk_holdernumber+ๆ่ฟฐ๏ผ่ทๅไธๅธๅ ฌๅธ่กไธๆทๆฐๆฐๆฎ๏ผๆฐๆฎไธๅฎๆๅ ฌๅธ+้้๏ผๅๆฌกๆๅคง3000,ๆป้ไธ้ๅถ+็งฏๅ๏ผ600็งฏๅๅฏ่ฐๅ๏ผๅบ็ก็งฏๅๆฏๅ้่ฐๅ100ๆฌก๏ผ5000็งฏๅไปฅไธ้ขๆฌก็ธๅฏน่พ้ซใๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | TS่ก็ฅจไปฃ็ +ann_date | str | N | ๅ ฌๅๆฅๆ+enddate | str | N | ๆชๆญขๆฅๆ+start_date | str | N | ๅ ฌๅๅผๅงๆฅๆ+end_date | str | N | ๅ ฌๅ็ปๆๆฅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | TS่ก็ฅจไปฃ็ +ann_date | str | Y | ๅ ฌๅๆฅๆ+end_date | str | Y | ๆชๆญขๆฅๆ+holder_num | int | Y | ่กไธๆทๆฐ++<br>+<br>++++**ๆฅๅฃไฝฟ็จ**++```pyhton++pro = ts.pro_api()++df = pro.stk_holdernumber(ts_code='300199.SZ', start_date='20160101', end_date='20181231')++```++<br>+<br>+++**ๆฐๆฎ็คบไพ**++ ts_code ann_date end_date holder_num+ 0 300199.SZ 20181025 20180930 25135+ 1 300199.SZ 20180808 20180630 25785+ 2 300199.SZ 20180426 20180331 23384+ 3 300199.SZ 20180316 20180228 23490+ 4 300199.SZ 20180316 20171231 24086+ 5 300199.SZ 20171026 20170930 24121+ 6 300199.SZ 20170817 20170630 26271+ 7 300199.SZ 20170427 20170331 24531+ 8 300199.SZ 20170427 20161231 22972+ 9 300199.SZ 20161028 20161027 19787+ 10 300199.SZ 20161027 20160930 19787+ 11 300199.SZ 20160804 20160630 20050+ 12 300199.SZ 20160428 20160331 23367diff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\217\202\350\200\203\346\225\260\346\215\256/\350\202\241\344\270\234\345\242\236\345\207\217\346\214\201.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\217\202\350\200\203\346\225\260\346\215\256/\350\202\241\344\270\234\345\242\236\345\207\217\346\214\201.md"new file mode 100644index 000000000..3b40aad6f--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\217\202\350\200\203\346\225\260\346\215\256/\350\202\241\344\270\234\345\242\236\345\207\217\346\214\201.md"@@ -0,0 +1,92 @@+## ่กไธๅขๅๆ+----++ๆฅๅฃ๏ผstk_holdertrade+ๆ่ฟฐ๏ผ่ทๅไธๅธๅ ฌๅธๅขๅๆๆฐๆฎ๏ผไบ่งฃ้่ฆ่กไธ่ฟๆๅๅๅฒไธ็่กไปฝๅขๅๅๅ+้้๏ผๅๆฌกๆๅคงๆๅ3000่ก่ฎฐๅฝ๏ผๆป้ไธ้ๅถ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ2000็งฏๅๆๅฏไปฅ่ฐๅใๅบ็ก็งฏๅๆๆต้ๆงๅถ๏ผ็งฏๅ่ถๅคๆ้่ถๅคง๏ผ5000็งฏๅไปฅไธๆ ๆๆพ้ๅถ๏ผ่ฏท่ช่กๆ้ซ็งฏๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | TS่ก็ฅจไปฃ็ +ann_date | str | N | ๅ ฌๅๆฅๆ+start_date | str | N | ๅ ฌๅๅผๅงๆฅๆ+end_date | str | N | ๅ ฌๅ็ปๆๆฅๆ+trade_type | str | N | ไบคๆ็ฑปๅINๅขๆDEๅๆ+holder_type | str | N | ่กไธ็ฑปๅCๅ ฌๅธPไธชไบบG้ซ็ฎก++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | TSไปฃ็ +ann_date | str | Y | ๅ ฌๅๆฅๆ+holder_name | str | Y | ่กไธๅ็งฐ+holder_type | str | Y | ่กไธ็ฑปๅG้ซ็ฎกPไธชไบบCๅ ฌๅธ+in_de | str | Y | ็ฑปๅINๅขๆDEๅๆ+change_vol | float | Y | ๅๅจๆฐ้+change_ratio | float | Y | ๅ ๆต้ๆฏไพ๏ผ%๏ผ+after_share | float | Y | ๅๅจๅๆ่ก+after_ratio | float | Y | ๅๅจๅๅ ๆต้ๆฏไพ๏ผ%๏ผ+avg_price | float | Y | ๅนณๅไปทๆ ผ+total_share | float | Y | ๆ่กๆปๆฐ+begin_date | str | N | ๅขๅๆๅผๅงๆฅๆ+close_date | str | N | ๅขๅๆ็ปๆๆฅๆ++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++#่ทๅๅๆฅๅ จ้จๅขๅๆๆฐๆฎ+df = pro.stk_holdertrade(ann_date='20190426')++#่ทๅๅไธช่ก็ฅจๆฐๆฎ+df = pro.stk_holdertrade(ts_code='002149.SZ')++#่ทๅๅฝๆฅๅขๆๆฐๆฎ+df = pro.stk_holdertrade(ann_date='20190426', trade_type='IN')++```+++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code ann_date holder_name holder_type in_de \+ 0 300216.SZ 20190426 ้ๅฝ่ P DE+ 1 300216.SZ 20190426 ้ป็็ง P DE+ 2 300216.SZ 20190426 ๅ็ G DE+ 3 300216.SZ 20190426 ้้ๅฑฑ G DE+ 4 002806.SZ 20190426 ๅนฟไธ็็งๆๅไธๆ่ตๆ้ๅ ฌๅธ C DE+ 5 603801.SH 20190426 ๅฐๅฟๆ้ๅ ฌๅธ C DE+ 6 600728.SH 20190426 ้ๅบไธญๆฐ่้ซๆ่ตไธญๅฟ(ๆ้ๅไผ) C DE+ 7 300115.SZ 20190426 ๆฐ็้ฟ็็ฒคๅฏ่กๆๆ่ตๆ้ๅ ฌๅธ C DE+ 8 300115.SZ 20190426 ๆฐ็้ฟ็็ฒคๅฏ่กๆๆ่ตๆ้ๅ ฌๅธ C DE+ 9 601288.SH 20190426 ไธๆตท้ฆๆฑๅฝ้ ๆ ๆธธ่กไปฝๆ้ๅ ฌๅธ C DE+ 10 603906.SH 20190426 ๅปบๆๅ้ฉฐ(ไธๆตท)ๆ่ตๆ้ๅ ฌๅธ C DE++ change_vol change_ratio after_share after_ratio avg_price total_share+ 0 387871.0 0.1356 3385659.0 1.1834 3.8100 3385659.0+ 1 49056.0 0.0171 1194457.0 0.4175 3.7800 1194457.0+ 2 498062.0 0.1741 0.0 NaN 3.6700 8892000.0+ 3 2358900.0 0.8245 25.0 0.0000 3.2100 7076800.0+ 4 1086100.0 1.8826 10836700.0 18.7838 21.5100 25499200.0+ 5 3200000.0 3.8450 6808299.0 8.1806 31.5500 6808299.0+ 6 14710000.0 0.9170 76942195.0 4.7965 9.9400 76942195.0+ 7 9470000.0 1.0457 378846759.0 41.8343 13.6400 378846759.0+ 8 8690000.0 0.9596 370156759.0 40.8748 13.6800 370156759.0+ 9 14868500.0 0.0051 0.0 NaN NaN 0.0+ 10 2540640.0 2.7223 22144800.0 23.7286 13.0241 22144800.0diff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\217\202\350\200\203\346\225\260\346\215\256/\350\202\241\346\235\203\350\264\250\346\212\274\346\230\216\347\273\206\346\225\260\346\215\256.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\217\202\350\200\203\346\225\260\346\215\256/\350\202\241\346\235\203\350\264\250\346\212\274\346\230\216\347\273\206\346\225\260\346\215\256.md"new file mode 100644index 000000000..710b66fea--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\217\202\350\200\203\346\225\260\346\215\256/\350\202\241\346\235\203\350\264\250\346\212\274\346\230\216\347\273\206\346\225\260\346\215\256.md"@@ -0,0 +1,64 @@+## ่กๆ่ดจๆผๆ็ป+----++ๆฅๅฃ๏ผpledge_detail+ๆ่ฟฐ๏ผ่ทๅ่ก็ฅจ่ดจๆผๆ็ปๆฐๆฎ+้้๏ผๅๆฌกๆๅคง1000+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ500็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | TS่ก็ฅจไปฃ็ +ann_date | str | Y | ๅ ฌๅๆฅๆ+holder_name | str | Y | ่กไธๅ็งฐ+pledge_amount | float | Y | ่ดจๆผๆฐ้๏ผไธ่ก๏ผ+start_date | str | Y | ่ดจๆผๅผๅงๆฅๆ+end_date | str | Y | ่ดจๆผ็ปๆๆฅๆ+is_release | str | Y | ๆฏๅฆๅทฒ่งฃๆผ+release_date | str | Y | ่งฃๆผๆฅๆ+pledgor | str | Y | ่ดจๆผๆน+holding_amount | float | Y | ๆ่กๆปๆฐ๏ผไธ่ก๏ผ+pledged_amount | float | Y | ่ดจๆผๆปๆฐ๏ผไธ่ก๏ผ+p_total_ratio | float | Y | ๆฌๆฌก่ดจๆผๅ ๆป่กๆฌๆฏไพ+h_total_ratio | float | Y | ๆ่กๆปๆฐๅ ๆป่กๆฌๆฏไพ+is_buyback | str | Y | ๆฏๅฆๅ่ดญ๏ผ0ๅฆ 1ๆฏ๏ผ+++**ๆฅๅฃไฝฟ็จ**+```pyhton+pro = ts.pro_api()+#ๆ่+#pro = ts.pro_api('your token')+++df = pro.pledge_detail(ts_code='000014.SZ')++```++ๆ่++```python++df = pro.query('pledge_detail', ts_code='000014.SZ')++```++**ๆฐๆฎ็คบไพ**++ ts_code ann_date holder_name pledge_amount start_date \+ 0 000014.SZ 20180106 ไธญ็งๆฑ้(ๆทฑๅณ)่กๆๆ่ตๅบ้ๆ้ๅ ฌๅธ 500.0000 20171114+ 1 000014.SZ 20180106 ไธญ็งๆฑ้(ๆทฑๅณ)่กๆๆ่ตๅบ้ๆ้ๅ ฌๅธ 922.0055 20171114+ 2 000014.SZ 20171221 ไธญ็งๆฑ้(ๆทฑๅณ)่กๆๆ่ตๅบ้ๆ้ๅ ฌๅธ 600.0000 20171114+ 3 000014.SZ 20171216 ไธญ็งๆฑ้(ๆทฑๅณ)่กๆๆ่ตๅบ้ๆ้ๅ ฌๅธ 300.0000 20171114+ 4 000014.SZ 20171111 ไธญ็งๆฑ้(ๆทฑๅณ)่กๆๆ่ตๅบ้ๆ้ๅ ฌๅธ 2321.9955 20151127+ 5 000014.SZ 20170616 ไธญ็งๆฑ้(ๆทฑๅณ)่กๆๆ่ตๅบ้ๆ้ๅ ฌๅธ 0.0100 20151127+ 6 000014.SZ 20060927 ๆทฑๅณๅธๆฒๆฒณๅฎไธ(้ๅข)ๆ้ๅ ฌๅธ 1936.3698 20050119\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\217\202\350\200\203\346\225\260\346\215\256/\350\202\241\346\235\203\350\264\250\346\212\274\347\273\237\350\256\241\346\225\260\346\215\256.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\217\202\350\200\203\346\225\260\346\215\256/\350\202\241\346\235\203\350\264\250\346\212\274\347\273\237\350\256\241\346\225\260\346\215\256.md"new file mode 100644index 000000000..6d9b4f630--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\217\202\350\200\203\346\225\260\346\215\256/\350\202\241\346\235\203\350\264\250\346\212\274\347\273\237\350\256\241\346\225\260\346\215\256.md"@@ -0,0 +1,67 @@+## ่กๆ่ดจๆผ็ป่ฎกๆฐๆฎ+----++ๆฅๅฃ๏ผpledge_stat+ๆ่ฟฐ๏ผ่ทๅ่ก็ฅจ่ดจๆผ็ป่ฎกๆฐๆฎ+้้๏ผๅๆฌกๆๅคง1000+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ500็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ +end_date | str | N | ๆชๆญขๆฅๆ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | TSไปฃ็ +end_date | str | Y | ๆชๆญขๆฅๆ+pledge_count | int | Y | ่ดจๆผๆฌกๆฐ+unrest_pledge | float | Y | ๆ ้ๅฎ่ก่ดจๆผๆฐ้๏ผไธ๏ผ+rest_pledge | float | Y | ้ๅฎ่กไปฝ่ดจๆผๆฐ้๏ผไธ๏ผ+total_share | float | Y | ๆป่กๆฌ+pledge_ratio | float | Y | ่ดจๆผๆฏไพ+++**ๆฅๅฃไฝฟ็จ**+```pyhton+pro = ts.pro_api()+#ๆ่+#pro = ts.pro_api('your token')+++df = pro.pledge_stat(ts_code='000014.SZ')++```++ๆ่++```python++df = pro.query('pledge_stat', ts_code='000014.SZ')++```++**ๆฐๆฎ็คบไพ**++ ts_code end_date pledge_count unrest_pledge rest_pledge \+ 0 000014.SZ 20180928 23 63.16 0.0+ 1 000014.SZ 20180921 24 63.17 0.0+ 2 000014.SZ 20180914 24 63.17 0.0+ 3 000014.SZ 20180907 28 63.69 0.0+ 4 000014.SZ 20180831 28 63.69 0.0+ 5 000014.SZ 20180824 29 64.74 0.0+ 6 000014.SZ 20180817 29 64.74 0.0+ 7 000014.SZ 20180810 29 64.74 0.0+ 8 000014.SZ 20180803 29 64.74 0.0+ 9 000014.SZ 20180727 29 64.74 0.0+ 10 000014.SZ 20180720 29 64.74 0.0+ 11 000014.SZ 20180713 29 64.74 0.0+ 12 000014.SZ 20180706 30 64.77 0.0+ 13 000014.SZ 20180629 30 64.77 0.0+ 14 000014.SZ 20180622 30 64.77 0.0+ 15 000014.SZ 20180615 28 66.50 0.0\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\217\202\350\200\203\346\225\260\346\215\256/\350\202\241\347\245\250\345\233\236\350\264\255.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\217\202\350\200\203\346\225\260\346\215\256/\350\202\241\347\245\250\345\233\236\350\264\255.md"new file mode 100644index 000000000..d3eed39ea--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\217\202\350\200\203\346\225\260\346\215\256/\350\202\241\347\245\250\345\233\236\350\264\255.md"@@ -0,0 +1,77 @@+## ่ก็ฅจๅ่ดญ+----++ๆฅๅฃ๏ผrepurchase+ๆ่ฟฐ๏ผ่ทๅไธๅธๅ ฌๅธๅ่ดญ่ก็ฅจๆฐๆฎ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ600็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ann_date | str | N | ๅ ฌๅๆฅๆ๏ผไปปๆๅกซๅๆฐ๏ผๅฆๆ้ฝไธๅกซ๏ผๅๆฌก้ป่ฎค่ฟๅ2000ๆก๏ผ+start_date | str | N | ๅ ฌๅๅผๅงๆฅๆ+end_date | str | N | ๅ ฌๅ็ปๆๆฅๆ++ไปฅไธๆฅๆๆ ผๅผไธบ๏ผYYYYMMDD๏ผๆฏๅฆ20181010+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | TSไปฃ็ +ann_date | str | Y | ๅ ฌๅๆฅๆ+end_date | str | Y | ๆชๆญขๆฅๆ+proc | str | Y | ่ฟๅบฆ+exp_date | str | Y | ่ฟๆๆฅๆ+vol | float | Y | ๅ่ดญๆฐ้+amount | float | Y | ๅ่ดญ้้ข+high_limit | float | Y | ๅ่ดญๆ้ซไปท+low_limit | float | Y | ๅ่ดญๆไฝไปท+++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++df = pro.repurchase(ann_date='', start_date='20180101', end_date='20180510')++#ๅๆๆฅ+df = pro.repurchase(ann_date='20181010')++```+++**ๆฐๆฎ็คบไพ**++ ts_code ann_date end_date proc exp_date vol amount \+ 0 300451.SZ 20181010 20181008 ๅฎๆ None 51900.0 4.498500e+05+ 1 300396.SZ 20181010 None ่กไธๅคงไผ้่ฟ 20191010 NaN 5.000000e+07+ 2 000813.SZ 20181010 20180930 ๅฎๆฝ None 15450767.0 1.243010e+08+ 3 300451.SZ 20181010 20181008 ๅฎๆ None 4500.0 3.708000e+04+ 4 002334.SZ 20181010 20181009 ๅฎๆฝ None 7749553.0 3.826948e+07+ 5 600351.SH 20181010 20181010 ๅฎๆฝ None 7035198.0 4.999188e+07+ 6 002104.SZ 20181010 20180930 ๅฎๆฝ None 569100.0 3.584390e+06+ 7 603017.SH 20181010 20181009 ๅฎๆฝ None 4418358.0 4.398425e+07+ 8 002511.SZ 20181010 None ่กไธๅคงไผ้่ฟ 20190410 NaN 2.000000e+08+ 9 603180.SH 20181010 20181009 ๅฎๆฝ None 315700.0 1.817800e+07+ 10 002567.SZ 20181010 20180930 ๅฎๆฝ None 1743273.0 7.815226e+06+++ high_limit low_limit+ 0 12.350 8.240+ 1 21.000 NaN+ 2 8.400 7.800+ 3 8.240 8.240+ 4 6.060 4.370+ 5 7.490 6.850+ 6 6.352 6.160+ 7 10.600 9.080+ 8 9.500 NaN+ 9 59.860 55.060+ 10 4.600 4.370++diff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\217\202\350\200\203\346\225\260\346\215\256/\350\202\241\347\245\250\345\274\200\346\210\267\346\225\260\346\215\256(\345\201\234).md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\217\202\350\200\203\346\225\260\346\215\256/\350\202\241\347\245\250\345\274\200\346\210\267\346\225\260\346\215\256(\345\201\234).md"new file mode 100644index 000000000..3a9cbee02--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\217\202\350\200\203\346\225\260\346\215\256/\350\202\241\347\245\250\345\274\200\346\210\267\346\225\260\346\215\256(\345\201\234).md"@@ -0,0 +1,80 @@+## ่ก็ฅจ่ดฆๆทๅผๆทๆฐๆฎ+----++ๆฅๅฃ๏ผstk_account+ๆ่ฟฐ๏ผ่ทๅ่ก็ฅจ่ดฆๆทๅผๆทๆฐๆฎ๏ผ็ป่ฎกๅจๆไธบไธๅจ+็งฏๅ๏ผ600็งฏๅๅฏ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++ๆณจ๏ผๆญคๆฐๆฎๅฎๆนๅทฒ็ปๅๆญขๆดๆฐใ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+date | str | N | ๆฅๆ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+date | str | Y | ็ป่ฎกๅจๆ+weekly_new | float | Y | ๆฌๅจๆฐๅข๏ผไธ๏ผ+total | float | Y | ๆๆซๆป่ดฆๆทๆฐ๏ผไธ๏ผ+weekly_hold | float | Y | ๆฌๅจๆไป่ดฆๆทๆฐ๏ผไธ๏ผ+weekly_trade | float | Y | ๆฌๅจๅไธไบคๆ่ดฆๆทๆฐ๏ผไธ๏ผ+++<br>+<br>++**ๆฅๅฃไฝฟ็จ**++```pyhton++pro = ts.pro_api()++df = pro.stk_account(start_date='20180101', end_date='20181231')++```++<br>+<br>+++**ๆฐๆฎ็คบไพ**++ date weekly_new total weekly_hold weekly_trade+ 0 20181228 20.81 14650.44 None None+ 1 20181221 21.04 14629.63 None None+ 2 20181214 21.21 14608.59 None None+ 3 20181207 22.28 14587.38 None None+ 4 20181130 23.56 14565.10 None None+ 5 20181123 24.16 14541.54 None None+ 6 20181116 24.57 14517.38 None None+ 7 20181109 24.11 14492.81 None None+ 8 20181102 23.97 14468.70 None None+ 9 20181026 26.00 14444.73 None None+ 10 20181019 24.13 14418.73 None None+ 11 20181012 25.30 14394.60 None None+ 12 20180928 20.09 14369.30 None None+ 13 20180921 23.24 14349.21 None None+ 14 20180914 24.08 14325.97 None None+ 15 20180907 23.58 14301.89 None None+ 16 20180831 24.06 14278.31 None None+ 17 20180824 23.12 14254.25 None None+ 18 20180817 23.04 14231.12 None None+ 19 20180810 23.96 14208.09 None None+ 20 20180803 24.22 14184.12 None None++<br>+<br>++ๆฐๆฎ่ฏดๆ๏ผไป2017ๅนด2ๆ10ๆฅๅผๅง๏ผไธญๅฝ่ฏๅธ็ป่ฎฐ็ป็ฎๅ ฌๅธๅๆญขไบๅๅธๆฌๅจๆไป่ดฆๆทๆฐๅๆฌๅจไบคๆ่ดฆๆทๆฐ๏ผๅฆๅค๏ผ2015ๅนด5ๆ8ๆฅไนๅ็ๆฐๆฎ็ปๆไนไธๅ๏ผๅ ทไฝ่ฏทๅ้ [่ก็ฅจๅผๆทๆงๆฐๆฎ](https://tushare.pro/document/2?doc_id=165)ๆฅๅฃใdiff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\217\202\350\200\203\346\225\260\346\215\256/\350\202\241\347\245\250\345\274\200\346\210\267\346\225\260\346\215\256(\346\227\247).md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\217\202\350\200\203\346\225\260\346\215\256/\350\202\241\347\245\250\345\274\200\346\210\267\346\225\260\346\215\256(\346\227\247).md"new file mode 100644index 000000000..39f9b5c92--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\217\202\350\200\203\346\225\260\346\215\256/\350\202\241\347\245\250\345\274\200\346\210\267\346\225\260\346\215\256(\346\227\247).md"@@ -0,0 +1,101 @@+## ่ก็ฅจ่ดฆๆทๅผๆทๆฐๆฎ๏ผๆง๏ผ+----++ๆฅๅฃ๏ผstk_account_old+ๆ่ฟฐ๏ผ่ทๅ่ก็ฅจ่ดฆๆทๅผๆทๆฐๆฎๆง็ๆ ผๅผๆฐๆฎ๏ผๆฐๆฎไป2008ๅนด1ๆๅผๅง๏ผๅฐ2015ๅนด5ๆ29๏ผๆฐๆฐๆฎ่ฏท้่ฟ[่ก็ฅจๅผๆทๆฐๆฎ](https://tushare.pro/document/2?doc_id=164)่ทๅใ+็งฏๅ๏ผ600็งฏๅๅฏ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)+++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+date | str | Y | ็ป่ฎกๅจๆ+new_sh | int | Y | ๆฌๅจๆฐๅข๏ผไธๆตท๏ผๆท๏ผ+new_sz | int | Y | ๆฌๅจๆฐๅข๏ผๆทฑๅณ๏ผๆท๏ผ+active_sh | float | Y | ๆๆซๆๆ่ดฆๆท๏ผไธๆตท๏ผไธๆท๏ผ+active_sz | float | Y | ๆๆซๆๆ่ดฆๆท๏ผๆทฑๅณ๏ผไธๆท๏ผ+total_sh | float | Y | ๆๆซ่ดฆๆทๆฐ๏ผไธๆตท๏ผไธๆท๏ผ+total_sz | float | Y | ๆๆซ่ดฆๆทๆฐ๏ผๆทฑๅณ๏ผไธๆท๏ผ+trade_sh | float | Y | ๅไธไบคๆ่ดฆๆทๆฐ๏ผไธๆตท๏ผไธๆท๏ผ+trade_sz | float | Y | ๅไธไบคๆ่ดฆๆทๆฐ๏ผๆทฑๅณ๏ผไธๆท๏ผ++<br>+<br>++++**ๆฅๅฃไฝฟ็จ**++```pyhton++pro = ts.pro_api()++df = pro.stk_account_old(start_date='20140101', end_date='20141231')++```++<br>+<br>+++**ๆฐๆฎ็คบไพ**++ date new_sh new_sz active_sh active_sz total_sh total_sz \+ 0 20141229~0102 157871 152943 7187.12 7027.58 9269.40 9131.77+ 1 20141222~1226 279044 268562 7171.13 7011.97 9254.69 9117.34+ 2 20141215~1219 322400 310114 7142.80 6984.49 9228.68 9092.02+ 3 20141208~1212 454796 437448 7109.96 6952.60 9198.74 9062.83+ 4 20141201~1205 306085 292176 7063.30 6907.28 9156.27 9021.43+ 5 20141124~1128 190694 179377 7031.79 6876.74 9127.81 8993.78+ 6 20141117~1121 121884 112181 7012.31 6858.11 9110.03 8976.76+ 7 20141110~1114 125695 117912 7000.00 6846.61 9098.66 8966.15+ 8 20141103~1107 121205 114562 6987.25 6834.46 9086.97 8954.99+ 9 20141027~1031 111282 106319 6974.95 6822.66 9075.72 8944.18+ 10 20141020~1024 106926 103467 6963.70 6811.77 9065.35 8934.12+ 11 20141013~1017 122201 120783 6952.91 6801.17 9055.43 8924.35+ 12 20141008~1010 77637 77278 6940.49 6788.71 9044.10 8912.93+ 13 20140929~1003 48397 47825 6932.63 6780.71 9036.90 8905.59+ 14 20140922~0926 110845 108871 6927.75 6775.81 9032.46 8901.11+ 15 20140915~0919 109261 107790 6916.49 6764.56 9022.26 8890.85+ 16 20140909~0912 89155 88151 6905.34 6753.39 9012.24 8880.75+ 17 20140901~0905 82987 82151 6896.25 6744.24 9004.09 8872.48+ 18 20140825~0829 80279 79732 6887.85 6735.80 8996.52 8864.80+ 19 20140818~0822 87261 86458 6879.80 6727.66 8989.21 8857.35+ 20 20140811~0815 76158 75789 6871.01 6718.81 8981.23 8849.26++ trade_sh trade_sz+ 0 962.11 770.00+ 1 1262.57 1010.97+ 2 1328.72 1118.42+ 3 1423.32 1209.22+ 4 1291.36 1142.27+ 5 1047.42 979.97+ 6 720.30 696.37+ 7 875.06 810.11+ 8 839.16 803.56+ 9 793.85 783.00+ 10 676.26 715.03+ 11 805.18 845.42+ 12 635.07 707.21+ 13 469.69 527.89+ 14 746.12 806.42+ 15 803.06 847.07+ 16 708.86 766.22+ 17 745.14 798.20+ 18 617.42 696.66+ 19 693.70 776.73+ 20 656.34 728.21\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\217\202\350\200\203\346\225\260\346\215\256/\351\231\220\345\224\256\350\202\241\350\247\243\347\246\201.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\217\202\350\200\203\346\225\260\346\215\256/\351\231\220\345\224\256\350\202\241\350\247\243\347\246\201.md"new file mode 100644index 000000000..94c70ea9d--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\217\202\350\200\203\346\225\260\346\215\256/\351\231\220\345\224\256\350\202\241\350\247\243\347\246\201.md"@@ -0,0 +1,99 @@+## ้ๅฎ่ก่งฃ็ฆ+----++ๆฅๅฃ๏ผshare_float+ๆ่ฟฐ๏ผ่ทๅ้ๅฎ่ก่งฃ็ฆ+้้๏ผๅๆฌกๆๅคง6000ๆก๏ผๆป้ไธ้ๅถ+็งฏๅ๏ผ120ๅๅฏ่ฐๅ๏ผๆฏๅ้ๅ ้ๅถๆฌกๆฐ๏ผ่ถ ่ฟ5000็งฏๅ้ขๆฌก็ธๅฏน่พ้ซ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | TS่ก็ฅจไปฃ็ +ann_date | str | N | ๅ ฌๅๆฅๆ๏ผๆฅๆๆ ผๅผ๏ผYYYYMMDD๏ผไธๅ๏ผ+float_date | str | N | ่งฃ็ฆๆฅๆ+start_date | str | N | ่งฃ็ฆๅผๅงๆฅๆ+end_date | str | N | ่งฃ็ฆ็ปๆๆฅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | TSไปฃ็ +ann_date | str | Y | ๅ ฌๅๆฅๆ+float_date | str | Y | ่งฃ็ฆๆฅๆ+float_share | float | Y | ๆต้่กไปฝ(่ก)+float_ratio | float | Y | ๆต้่กไปฝๅ ๆป่กๆฌๆฏ็+holder_name | str | Y | ่กไธๅ็งฐ+share_type | str | Y | ่กไปฝ็ฑปๅ++<br>+<br>++**ๆฅๅฃไฝฟ็จ**++```pyhton++pro = ts.pro_api()++df = pro.share_float(ann_date='20181220')++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code ann_date float_date float_share float_ratio holder_name \+ 0 000998.SZ 20181220 20211221 25076106.0 1.9041 ็ไนๆณข+ 1 000998.SZ 20181220 20211221 11265340.0 0.8554 ๅฝญๆณฝๆ+ 2 000998.SZ 20181220 20211221 10820446.0 0.8216 ๆจ่+ 3 000998.SZ 20181220 20211221 2704317.0 0.2053 ็ๅฎ+ 4 000998.SZ 20181220 20211221 2704317.0 0.2053 ๅงไนฆ่ดค+ 5 000998.SZ 20181220 20211221 2952186.0 0.2242 ่ฐข็่ฟ+ 6 000998.SZ 20181220 20211221 3022098.0 0.2295 ้ๅฉ่ก+ 7 000998.SZ 20181220 20211221 190668.0 0.0145 ๅฒๆณฝ็ช+ 8 000998.SZ 20181220 20211221 190668.0 0.0145 ๅผ ๆ+ 9 000998.SZ 20181220 20211221 95334.0 0.0072 ๅญ็ปงๆ+ 10 000998.SZ 20181220 20211221 95334.0 0.0072 ็้ๆ+ 11 000998.SZ 20181220 20211221 95334.0 0.0072 ๅๆฆ+ 12 000998.SZ 20181220 20211221 63556.0 0.0048 ๆฑ้+ 13 000998.SZ 20181220 20211221 63556.0 0.0048 ้ไบฎไบฎ+ 14 000998.SZ 20181220 20211221 63556.0 0.0048 ๆๅนๆ+ 15 000998.SZ 20181220 20211221 63556.0 0.0048 ้ซ้ฃ+ 16 000998.SZ 20181220 20211221 63556.0 0.0048 ่ก็ด ๅ+ 17 000998.SZ 20181220 20211221 63556.0 0.0048 ็ๆ็ฃ+ 18 000998.SZ 20181220 20211221 63556.0 0.0048 ๅๅ ๆ+ 19 000998.SZ 20181220 20211221 63556.0 0.0048 ๅ ๅ ไฝ+ 20 000998.SZ 20181220 20211221 63556.0 0.0048 ๅบ้ถ้พ++ share_type+ 0 ๅฎๅข่กไปฝ+ 1 ๅฎๅข่กไปฝ+ 2 ๅฎๅข่กไปฝ+ 3 ๅฎๅข่กไปฝ+ 4 ๅฎๅข่กไปฝ+ 5 ๅฎๅข่กไปฝ+ 6 ๅฎๅข่กไปฝ+ 7 ๅฎๅข่กไปฝ+ 8 ๅฎๅข่กไปฝ+ 9 ๅฎๅข่กไปฝ+ 10 ๅฎๅข่กไปฝ+ 11 ๅฎๅข่กไปฝ+ 12 ๅฎๅข่กไปฝ+ 13 ๅฎๅข่กไปฝ+ 14 ๅฎๅข่กไปฝ+ 15 ๅฎๅข่กไปฝ+ 16 ๅฎๅข่กไปฝ+ 17 ๅฎๅข่กไปฝ+ 18 ๅฎๅข่กไปฝ+ 19 ๅฎๅข่กไปฝ+ 20 ๅฎๅข่กไปฝ\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/IPO\346\226\260\350\202\241\344\270\212\345\270\202.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/IPO\346\226\260\350\202\241\344\270\212\345\270\202.md"new file mode 100644index 000000000..34825dac0--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/IPO\346\226\260\350\202\241\344\270\212\345\270\202.md"@@ -0,0 +1,74 @@+## IPOๆฐ่กๅ่กจ+----++ๆฅๅฃ๏ผnew_share+ๆ่ฟฐ๏ผ่ทๅๆฐ่กไธๅธๅ่กจๆฐๆฎ+้้๏ผๅๆฌกๆๅคง2000ๆก๏ผๆป้ไธ้ๅถ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ120็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+start_date | str | N | ไธ็ฝๅ่กๅผๅงๆฅๆ+end_date | str | N | ไธ็ฝๅ่ก็ปๆๆฅๆ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | TS่ก็ฅจไปฃ็ +sub_code | str | Y | ็ณ่ดญไปฃ็ +name | str | Y | ๅ็งฐ+ipo_date | str | Y | ไธ็ฝๅ่กๆฅๆ+issue_date | str | Y | ไธๅธๆฅๆ+amount | float | Y | ๅ่กๆป้๏ผไธ่ก๏ผ+market_amount | float | Y | ไธ็ฝๅ่กๆป้๏ผไธ่ก๏ผ+price | float | Y | ๅ่กไปทๆ ผ+pe | float | Y | ๅธ็็+limit_amount | float | Y | ไธชไบบ็ณ่ดญไธ้๏ผไธ่ก๏ผ+funds | float | Y | ๅ้่ต้๏ผไบฟๅ ๏ผ+ballot | float | Y | ไธญ็ญพ็++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++df = pro.new_share(start_date='20180901', end_date='20181018')++```++**ๆฐๆฎ็คบไพ**++ ts_code sub_code name ipo_date issue_date amount market_amount \+ 0 002939.SZ 002939 ้ฟๅ่ฏๅธ 20181017 None 31034.0 27931.0+ 1 002940.SZ 002940 ๆๅฉๅบท 20181011 20181023 2250.0 2025.0+ 2 601162.SH 780162 ๅคฉ้ฃ่ฏๅธ 20181009 20181019 51800.0 46620.0+ 3 300694.SZ 300694 ่ กๆน่กไปฝ 20180927 20181015 5383.0 4845.0+ 4 300760.SZ 300760 ่ฟ็ๅป็ 20180927 20181016 12160.0 10944.0+ 5 300749.SZ 300749 ้กถๅบ้ๅ 20180913 20180925 2850.0 2565.0+ 6 002937.SZ 002937 ๅ ด็็งๆ 20180912 20180926 4600.0 4140.0+ 7 601577.SH 780577 ้ฟๆฒ้ถ่ก 20180912 20180926 34216.0 30794.0+ 8 603583.SH 732583 ๆทๆ้ฉฑๅจ 20180911 20180921 3020.0 2718.0+ 9 002936.SZ 002936 ้ๅท้ถ่ก 20180907 20180919 60000.0 54000.0+ 10 300748.SZ 300748 ้ๅๆฐธ็ฃ 20180906 20180921 4160.0 3744.0+ 11 603810.SH 732810 ไธฐๅฑฑ้ๅข 20180906 20180917 2000.0 2000.0+ 12 002938.SZ 002938 ้น้ผๆง่ก 20180905 20180918 23114.0 20803.0++ price pe limit_amount funds ballot+ 0 6.31 22.98 9.30 19.582 0.16+ 1 23.07 22.99 0.90 5.191 0.03+ 2 1.79 22.86 15.50 0.000 0.25+ 3 9.89 22.98 2.15 5.324 0.04+ 4 48.80 22.99 3.60 59.341 0.08+ 5 12.22 22.99 1.10 3.483 0.03+ 6 9.94 22.99 1.80 4.572 0.04+ 7 7.99 6.97 10.20 27.338 0.17+ 8 29.17 22.99 1.20 8.809 0.03+ 9 4.59 6.50 18.00 27.540 0.25+ 10 5.39 22.98 1.20 2.242 0.05+ 11 25.43 20.39 2.00 5.086 0.02+ 12 16.07 22.99 6.90 37.145 0.12\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/ST\350\202\241\347\245\250\345\210\227\350\241\250.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/ST\350\202\241\347\245\250\345\210\227\350\241\250.md"new file mode 100644index 000000000..900938403--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/ST\350\202\241\347\245\250\345\210\227\350\241\250.md"@@ -0,0 +1,66 @@+## ST่ก็ฅจๅ่กจ+----++ๆฅๅฃ๏ผstock_st๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆ่ฟฐ๏ผ่ทๅST่ก็ฅจๅ่กจ๏ผๅฏๆ นๆฎไบคๆๆฅๆ่ทๅๅๅฒไธๆฏๅคฉ็STๅ่กจ+ๆ้๏ผ3000็งฏๅ่ตท+ๆ็คบ๏ผๆฏๅคฉไธๅ9:20ๆดๆฐ๏ผๅๆฌก่ฏทๆฑๆๅคง่ฟๅ1000่กๆฐๆฎ๏ผๅฏๅพช็ฏๆๅ,ๆฌๆฅๅฃๆฐๆฎไป20160101ๅผๅง,ๅคชๆฉๅๅฒๆ ๆณ่กฅ้ฝ+++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ๏ผๆ ผๅผ๏ผYYYYMMDDไธๅ๏ผ+start_date | str | N | ๅผๅงๆถ้ด+end_date | str | N | ็ปๆๆถ้ด++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +name | str | Y | ่ก็ฅจๅ็งฐ+trade_date | str | Y | ไบคๆๆฅๆ+type | str | Y | ็ฑปๅ+type_name | str | Y | ็ฑปๅๅ็งฐ++<br>+<br>++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++#่ทๅ20250813ๆฅๆๆ็ST่ก็ฅจ+df = pro.stock_st(trade_date='20250813')+++```++<br>+<br>++**ๆฐๆฎๆ ทไพ**++ ts_code name trade_date type type_name+ 0 300313.SZ *STๅคฉๅฑฑ 20250813 ST ้ฃ้ฉ่ญฆ็คบๆฟ+ 1 605081.SH *STๅคชๅ 20250813 ST ้ฃ้ฉ่ญฆ็คบๆฟ+ 2 300391.SZ *ST้ฟ่ฏ 20250813 ST ้ฃ้ฉ่ญฆ็คบๆฟ+ 3 300343.SZ ST่ๅ 20250813 ST ้ฃ้ฉ่ญฆ็คบๆฟ+ 4 300044.SZ ST่ตไธบ 20250813 ST ้ฃ้ฉ่ญฆ็คบๆฟ+ .. ... ... ... ... ...+ 170 300175.SZ STๆๆบ 20250813 ST ้ฃ้ฉ่ญฆ็คบๆฟ+ 171 603721.SH *STๅคฉๆฉ 20250813 ST ้ฃ้ฉ่ญฆ็คบๆฟ+ 172 600289.SH STไฟก้ 20250813 ST ้ฃ้ฉ่ญฆ็คบๆฟ+ 173 000929.SZ *STๅ ฐ้ป 20250813 ST ้ฃ้ฉ่ญฆ็คบๆฟ+ 174 000638.SZ *STไธๆน 20250813 ST ้ฃ้ฉ่ญฆ็คบๆฟ\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/ST\351\243\216\351\231\251\350\255\246\347\244\272\346\235\277\350\202\241\347\245\250.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/ST\351\243\216\351\231\251\350\255\246\347\244\272\346\235\277\350\202\241\347\245\250.md"new file mode 100644index 000000000..600484a5a--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/ST\351\243\216\351\231\251\350\255\246\347\244\272\346\235\277\350\202\241\347\245\250.md"@@ -0,0 +1,59 @@+# ST้ฃ้ฉ่ญฆ็คบๆฟ่ก็ฅจ+++### ๆฅๅฃไป็ป+ๆฅๅฃ๏ผst+ๆ่ฟฐ๏ผST้ฃ้ฉ่ญฆ็คบๆฟ่ก็ฅจๅ่กจ+้้๏ผๅๆฌกๆๅคง1000๏ผๅฏๆ นๆฎ่ก็ฅจไปฃ็ ๅพช็ฏ่ทๅๅๅฒๆฐๆฎ+็งฏๅ๏ผ6000็งฏๅๅฏๆๅๆฐๆฎ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)+++### ่พๅ ฅๅๆฐ+ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ +pub_date | str | N | ๅๅธๆฅๆ+imp_date | str | N | ๅฎๆฝๆฅๆ++++### ่พๅบๅๆฐ+ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+---- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +name | str | Y | ่ก็ฅจๅ็งฐ+pub_date | str | Y | ๅๅธๆฅๆ+imp_date | str | Y | ๅฎๆฝๆฅๆ+st_tpye | str | Y | ็ฑปๅ+st_reason | str | Y | stๅๆดๅๅ+st_explain | str | Y | stๅๆด่ฏฆ็ปๅๅ++++### ไปฃ็ ็คบไพ+```+ # ๆๅๆฅๅฃstๆฐๆฎ+ df = pro.st(**{+ "ts_code": "300125.SZ",+ "pub_date": "",+ "imp_date": ""+}, fields=[+ "ts_code",+ "name",+ "pub_date",+ "imp_date",+ "st_tpye",+ "st_reason",+ "st_explain"+])+ print(df)+```++### ๆฐๆฎ็ปๆ+ts_code | name | pub_date | imp_date | st_tpye | st_reason | st_explain+---- | ---- | ---- | ---- | ---- | ---- | ----+300125.SZ | *ST่่พพ | 20260127 | 20260128 | ๆค้ๅ ๅ *ST | ้ๆดๅฎๆๆๅ่งฃๅ่ฎฎๆง่กๅฎๆๆๆกไปถ็ปๆ | ๅ ฌๅธ้ๆด่ฎกๅๅทฒ็ปๆง่กๅฎๆฏ,ๆ นๆฎใไธๅธ่งๅใ็ฌฌ10.4.14ๆก็ฌฌไธๆฌพ็่งๅฎ,ๅ ฌๅธ็ฌฆๅ็ณ่ฏทๆค้ๅ ้ๆด่ๅฎๆฝ็้ๅธ้ฃ้ฉ่ญฆ็คบ็ๆกไปถ,ๅ ฌๅธๅทฒไบ2026ๅนด1ๆ8ๆฅๅๆทฑๅณ่ฏๅธไบคๆๆ(ไปฅไธ็ฎ็งฐ:ๆทฑไบคๆ)็ณ่ฏทๆค้ๅ ้ๆด่ๅฎๆฝ็้ๅธ้ฃ้ฉ่ญฆ็คบใ2026ๅนด1ๆ27ๆฅ,ๆทฑไบคๆๅฎกๆ ธๅๆๆค้ๅ ฌๅธๅ ้ๆด่ๅฎๆฝ็้ๅธ้ฃ้ฉ่ญฆ็คบ,ๅ ฌๅธ่งฆๅ่ดขๅก็ฑป้ๅธ้ฃ้ฉ่ญฆ็คบๅๅ ถไป้ฃ้ฉ่ญฆ็คบ็ๆ ๅฝขไฟๆไธๅใ+300125.SZ | *ST่่พพ | 20251119 | 20251119 | ๅ ๅ *ST | ๆณ้ขไพๆณๅ็ๅ ฌๅธ้ๆดใๅ่งฃๆ่ ็ ดไบงๆธ ็ฎ็ณ่ฏท | ๅ ฌๅธ2024ๅนดๆฃ้ค้็ปๅธธๆงๆ็ๅ็ๅๅฉๆถฆไธบ่ดไธๆฃ้คๅ่ฅไธๆถๅ ฅไฝไบ1ไบฟๅ ;ๆ่ฟไธไธชไผ่ฎกๅนดๅบฆ็ปๅฎก่ฎก็ๆๆซๅ่ตไบงไธบ่ดๅผ,ๅ ฌๅธ่ก็ฅจไบคๆไบ2025ๅนด4ๆ25ๆฅ่ตท่ขซๅฎๆฝ้ๅธ้ฃ้ฉ่ญฆ็คบ;ๅ ๅ ญๅฎไธญ้ขไพๆณ่ฃๅฎๅ็็ณ่ฏทไบบๅฏนๅ ฌๅธ็้ๆด็ณ่ฏท,ๆ นๆฎใๆทฑไบคๆๅไธๆฟ่ก็ฅจไธๅธ่งๅใ็่งๅฎ,ๅ ฌๅธ่ก็ฅจๅฐไบ2025ๅนด11ๆ19ๅผๅธ่ขซๅ ๅ ๅฎๆฝ้ๅธ้ฃ้ฉ่ญฆ็คบใ+300125.SZ | *ST่่พพ | 20250424 | 20250425 | ไปSTๅไธบ*ST | ๆ่ฟไธไธชไผ่ฎกๅนดๅบฆ็ปๅฎก่ฎก็ๅฉๆถฆๆป้ขใๅๅฉๆถฆๆ่ ๆฃ้ค้็ปๅธธๆงๆ็ๅ็ๅๅฉๆถฆๅญฐไฝ่ ไธบ่ดๅผไธ่ฅไธๆถๅ ฅไฝไบ1ไบฟๅ ๏ผๆ่ ่ฟฝๆบฏ้่ฟฐๅๆ่ฟไธไธชไผ่ฎกๅนดๅบฆๅฉๆถฆๆป้ขใๅๅฉๆถฆๆ่ ๆฃ้ค้็ปๅธธๆงๆ็ๅ็ๅๅฉๆถฆๅญฐไฝ่ ไธบ่ดๅผไธ่ฅไธๆถๅ ฅไฝไบ1ไบฟๅ | ๅ ฌๅธ2024ๅนดๅบฆ็ปๅฎก่ฎก็ๆฃ้ค้็ปๅธธๆงๆ็ๅ็ๅๅฉๆถฆไธบ-85,579ไธๅ ไธๆฃ้คๅ่ฅไธๆถๅ ฅไธบ5,785ไธๅ ,ๆๆซๅ่ตไบงไธบ-53,841ไธๅ ใๆ นๆฎใไธๅธ่งๅใ็ฌฌ10.3.1ๆก็ฌฌไธๆฌพ็ฌฌ(ไธ)(ไบ)้กน่งๅฎ:ไธๅธๅ ฌๅธๅบ็ฐโๆ่ฟไธไธชไผ่ฎกๅนดๅบฆ็ปๅฎก่ฎก็ๅฉๆถฆๆป้ขใๅๅฉๆถฆใๆฃ้ค้็ปๅธธๆงๆ็ๅ็ๅๅฉๆถฆไธ่ ๅญฐไฝไธบ่ดๅผ,ไธๆฃ้คๅ็่ฅไธๆถๅ ฅไฝไบ1ไบฟๅ ็ๆ ๅฝขใโ;โๆ่ฟไธไธชไผ่ฎกๅนดๅบฆ็ปๅฎก่ฎก็ๆๆซๅ่ตไบงไธบ่ดๅผโ,ๅ ฌๅธ่ก็ฅจไบคๆๅฐ่ขซๅฎๆฝ้ๅธ้ฃ้ฉ่ญฆ็คบใ+300125.SZ | ST่่พพ | 20240819 | 20240819 | ๅ ๅ ST | ๅ ฌๅธๅๆง่ก่กไธๆๅ ถๅ ณ่ๆนๆไพ่ต้ๆ่ฟๅ่งๅฎ็จๅบๅฏนๅคๆไพๆ ไฟไธๆ ๅฝขไธฅ้ | ๅ ฌๅธๅๅญๅ ฌๅธ้ๅฏจๅๆฆๆฐ่ฝๆบ็งๆๆ้ๅ ฌๅธใๆ ผๅฐๆจ็ฅๅ ๆฐ่ฝๆบๆ้ๅ ฌๅธๅจๆชๅฑฅ่ก่ฃไบไผๅฎก่ฎฎ็จๅบๅไฟกๆฏๆซ้ฒไนๅก็ๆ ๅตไธ,่ฟ่งไธบไธญ่ดขๆๅๆ่ต้ๅขๅไธไฟ็ๆ้ๅ ฌๅธไธ้ๅฏจๅๆฆๆญฃไธฐๆฐ่ฝๆบๆ้ๅ ฌๅธ็ๅๆฌพๅๅๆไพๆ ไฟ,ๆถๅๆ ไฟ้้ข1600ไธๅ ใ+300125.SZ | ST่่พพ | 20240427 | 20240430 | ST | ๅ ฌๅธๆ่ฟไธๅนด่ขซๅบๅ ทๆ ๆณ่กจ็คบๆ่งๆ่ ๅฆๅฎๆ่ง็ๅ ้จๆงๅถๅฎก่ฎกๆฅๅๆ่ ้ด่ฏๆฅๅ | ๆ นๆฎใๆทฑๅณ่ฏๅธไบคๆๆๅไธๆฟ่ก็ฅจไธๅธ่งๅใ็ฌฌ9.7ๆก็ญ็ธๅ ณ่งๅฎ,ๅ ฌๅธ่ก็ฅจๅฐไบ2024ๅนด4ๆ29ๆฅๅ็ไธๅคฉ,2024ๅนด4ๆ30ๆฅๅฎๆฝๅ ถไป้ฃ้ฉ่ญฆ็คบ,ๅฎๆฝๅ ถไป้ฃ้ฉ่ญฆ็คบๅๅ ฌๅธ่กไปท็ๆฅๆถจ่ทๅน ้ๅถไธบ20%ใdiff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/\344\270\212\345\270\202\345\205\254\345\217\270\345\237\272\346\234\254\344\277\241\346\201\257.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/\344\270\212\345\270\202\345\205\254\345\217\270\345\237\272\346\234\254\344\277\241\346\201\257.md"new file mode 100644index 000000000..7d7a1f5fa--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/\344\270\212\345\270\202\345\205\254\345\217\270\345\237\272\346\234\254\344\277\241\346\201\257.md"@@ -0,0 +1,71 @@+## ไธๅธๅ ฌๅธๅบๆฌไฟกๆฏ+----++ๆฅๅฃ๏ผstock_company๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆ่ฟฐ๏ผ่ทๅไธๅธๅ ฌๅธๅบ็กไฟกๆฏ๏ผๅๆฌกๆๅ4500ๆก๏ผๅฏไปฅๆ นๆฎไบคๆๆๅๆนๆๅ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ120็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้กป | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ +exchange | str | N | ไบคๆๆไปฃ็ ๏ผSSEไธไบคๆ SZSEๆทฑไบคๆ BSEๅไบคๆ++++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +com_name | str | Y | ๅ ฌๅธๅ จ็งฐ+com_id | str | Y | ็ปไธ็คพไผไฟก็จไปฃ็ +exchange | str | Y | ไบคๆๆไปฃ็ +chairman | str | Y | ๆณไบบไปฃ่กจ+manager | str | Y | ๆป็ป็+secretary | str | Y | ่ฃ็ง+reg_capital | float | Y | ๆณจๅ่ตๆฌ(ไธๅ )+setup_date | str | Y | ๆณจๅๆฅๆ+province | str | Y | ๆๅจ็ไปฝ+city | str | Y | ๆๅจๅๅธ+introduction | str | N | ๅ ฌๅธไป็ป+website | str | Y | ๅ ฌๅธไธป้กต+email | str | Y | ็ตๅญ้ฎไปถ+office | str | N | ๅๅ ฌๅฎค+employees | int | Y | ๅๅทฅไบบๆฐ+main_business | str | N | ไธป่ฆไธๅกๅไบงๅ+business_scope | str | N | ็ป่ฅ่ๅด+++**ๆฅๅฃ็คบไพ**++```python+pro = ts.pro_api()++#ๆ่+#pro = ts.pro_api('your token')++df = pro.stock_company(exchange='SZSE', fields='ts_code,chairman,manager,secretary,reg_capital,setup_date,province')++```++**ๆฐๆฎ็คบไพ**++ ts_code chairman manager secretary reg_capital setup_date province \+ 0 000001.SZ ่ฐขๆฐธๆ ่ก่ท้ฃ ๅจๅผบ 1.717041e+06 19871222 ๅนฟไธ+ 1 000002.SZ ้ไบฎ ็ฅไน่ ๆฑๆญ 1.103915e+06 19840530 ๅนฟไธ+ 2 000003.SZ ้ฉฌ้้ธฟ ้ฉฌ้้ธฟ ๅฎๆฑช 3.334336e+04 19880208 ๅนฟไธ+ 3 000004.SZ ๆๆ็ณ ๆๆ็ณ ๅพๆ่ 8.397668e+03 19860505 ๅนฟไธ+ 4 000005.SZ ไธ่ ้ๅๅ ็ฝๆๆฅ 1.058537e+05 19870730 ๅนฟไธ+ 5 000006.SZ ่ตตๅฎไผ ๆฑๆฐๅฎ ๆๆฑ 1.349995e+05 19850525 ๅนฟไธ+ 6 000007.SZ ๆบๅพทๅฎ ๆบๅพทๅฎ ้ไผๅฝฌ 3.464480e+04 19830311 ๅนฟไธ+ 7 000008.SZ ็ๅฟๅ จ ้ๅฒฉ ็ๅฟๅ 2.818330e+05 19891011 ๅไบฌ+ 8 000009.SZ ้ๆฟ็ซ ้ๆฟ็ซ ้ญๅฑฑๆธ 2.149345e+05 19830706 ๅนฟไธ+ 9 000010.SZ ๆพๅต ๆๅพทๅ ้ๅฐๅ 8.198547e+04 19881231 ๅนฟไธ+ 10 000011.SZ ๅๅฃฐๅ ็่ชๅ ่็ปดๅนณ 5.959791e+04 19830117 ๅนฟไธ+ 11 000012.SZ ้็ณ ็ๅฅ ๆจๆๅฎ 2.863277e+05 19840910 ๅนฟไธ+ 12 000013.SZ ๅๆๆฑ ้ฎๅ ็ซ ๅๆธๆ 3.033550e+04 19920114 ๅนฟไธ+ 13 000014.SZ ้ๅ ๆธฉๆฏ ็ๅก 2.017052e+04 19870727 ๅนฟไธ+ 14 000015.SZ ๅฎฟๅๅ ้ฉฌ้ชง ่ๅญๅฎ 1.598761e+05 19880408 ๅนฟไธ+ 15 000016.SZ ๅๅคๅ ๅจๅฝฌ ๅดๅๅ 2.407945e+05 19801001 ๅนฟไธ\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/\344\270\212\345\270\202\345\205\254\345\217\270\347\256\241\347\220\206\345\261\202.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/\344\270\212\345\270\202\345\205\254\345\217\270\347\256\241\347\220\206\345\261\202.md"new file mode 100644index 000000000..062759a0c--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/\344\270\212\345\270\202\345\205\254\345\217\270\347\256\241\347\220\206\345\261\202.md"@@ -0,0 +1,87 @@+## ไธๅธๅ ฌๅธ็ฎก็ๅฑ+----++ๆฅๅฃ๏ผstk_managers+ๆ่ฟฐ๏ผ่ทๅไธๅธๅ ฌๅธ็ฎก็ๅฑ+็งฏๅ๏ผ็จๆท้่ฆ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผ5000็งฏๅไปฅไธ้ขๆฌก็ธๅฏน่พ้ซ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ ๏ผๆฏๆๅไธชๆๅคไธช่ก็ฅจ่พๅ ฅ+ann_date | str | N | ๅ ฌๅๆฅๆ๏ผYYYYMMDDๆ ผๅผ๏ผไธๅ๏ผ+start_date | str | N | ๅ ฌๅๅผๅงๆฅๆ+end_date | str | N | ๅ ฌๅ็ปๆๆฅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | TS่ก็ฅจไปฃ็ +ann_date | str | Y | ๅ ฌๅๆฅๆ+name | str | Y | ๅงๅ+gender | str | Y | ๆงๅซ+lev | str | Y | ๅฒไฝ็ฑปๅซ+title | str | Y | ๅฒไฝ+edu | str | Y | ๅญฆๅ+national | str | Y | ๅฝ็ฑ+birthday | str | Y | ๅบ็ๅนดๆ+begin_date | str | Y | ไธไปปๆฅๆ+end_date | str | Y | ็ฆปไปปๆฅๆ+resume | str | N | ไธชไบบ็ฎๅ++<br>+<br>++**ๆฅๅฃ็จไพ**++```python++pro = ts.pro_api()++#่ทๅๅไธชๅ ฌๅธ้ซ็ฎกๅ จ้จๆฐๆฎ+df = pro.stk_managers(ts_code='000001.SZ')++#่ทๅๅคไธชๅ ฌๅธ้ซ็ฎกๅ จ้จๆฐๆฎ+df = pro.stk_managers(ts_code='000001.SZ,600000.SH')++```++<br>+<br>++**ๆฐๆฎๆ ทไพ**++ ts_code ann_date name gender ... national birthday begin_date end_date+ 0 000001.SZ 20190604 ๅง่ดตๅนณ M ... ไธญๅฝ 1961 20180815 20190604+ 1 000001.SZ 20190604 ๅง่ดตๅนณ M ... ไธญๅฝ 1961 20170629 20190604+ 2 000001.SZ 20190604 ๅง่ดตๅนณ M ... ไธญๅฝ 1961 20180129 20190604+ 3 000001.SZ 20190309 ๅด้น M ... ไธญๅฝ 1965 20110817 20190309+ 4 000001.SZ 20190307 ๅญๆฐธๆกข F ... ไธญๅฝ 1968 20181025 None+ 5 000001.SZ 20180816 ๆจๅฟ็พค M ... ไธญๅฝ 1970 20180815 None+ 6 000001.SZ 20180816 ้ญไธ้ฆ M ... ไธญๅฝ 1965 20180815 None+ 7 000001.SZ 20180405 ไฝไนๆฑ M ... ไธญๅฝ 1965 20170513 20180405+ 8 000001.SZ 20180203 ้กนๆๅฟ M ... ไธญๅฝ 1964 20170913 None+ 9 000001.SZ 20180130 ๆจๅฆ็ M ... ไธญๅฝ 196802 20161107 None+ 10 000001.SZ 20180130 ่กๆนๆน F ... ไธญๅฝ 1974 20161107 None+ 11 000001.SZ 20180130 ้ญ็ฐๅ M ... ไธญๅฝ 196808 20161107 None+ 12 000001.SZ 20180130 ้ญๅปบ M ... ไธญๅฝ 1964 20161107 None+ 13 000001.SZ 20180130 ๆจๅฆ็ M ... ไธญๅฝ 196802 20161107 None+ 14 000001.SZ 20180130 ๆจๅฆ็ M ... ไธญๅฝ 196802 20161107 None+ 15 000001.SZ 20180130 ๅงๆณข M ... ไธญๅฝ 1971 20101227 None+ 16 000001.SZ 20180130 ็ๆฅๆฑ M ... ไธญๅฝ 1951 20160811 None+ 17 000001.SZ 20180130 ้ญ็ฐๅ M ... ไธญๅฝ 196808 20160811 None+ 18 000001.SZ 20180130 ้ญ็ฐๅ M ... ไธญๅฝ 196808 20160811 None+ 19 000001.SZ 20180130 ้ฉๅฐไบฌ M ... ไธญๅฝ 1955 20140121 None+ 20 000001.SZ 20180130 ้ๅฟ้ข F ... ๆฐๅ ๅก 1977 20140121 None+ 21 000001.SZ 20180130 ่กๆนๆน F ... ไธญๅฝ 1974 20140121 None+ 22 000001.SZ 20180130 ็ๆพๅฅ M ... ไธญๅฝ 1952 20140121 None+ 23 000001.SZ 20180130 ็ๆฅๆฑ M ... ไธญๅฝ 1951 20140121 None+ 24 000001.SZ 20180130 ้ฉๅฐไบฌ M ... ไธญๅฝ 1955 20140121 None\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/\344\272\244\346\230\223\346\227\245\345\216\206.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/\344\272\244\346\230\223\346\227\245\345\216\206.md"new file mode 100644index 000000000..43e49f61b--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/\344\272\244\346\230\223\346\227\245\345\216\206.md"@@ -0,0 +1,68 @@+## ไบคๆๆฅๅ+----++ๆฅๅฃ๏ผtrade_cal๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆ่ฟฐ๏ผ่ทๅๅๅคงไบคๆๆไบคๆๆฅๅๆฐๆฎ,้ป่ฎคๆๅ็ๆฏไธไบคๆ+็งฏๅ๏ผ้2000็งฏๅ++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+exchange | str | N | ไบคๆๆ SSEไธไบคๆ,SZSEๆทฑไบคๆ,CFFEX ไธญ้ๆ,SHFE ไธๆๆ,CZCE ้ๅๆ,DCE ๅคงๅๆ,INE ไธ่ฝๆบ+start_date | str | N | ๅผๅงๆฅๆ ๏ผๆ ผๅผ๏ผYYYYMMDD ไธๅ๏ผ+end_date | str | N | ็ปๆๆฅๆ+is_open | str | N | ๆฏๅฆไบคๆ '0'ไผๅธ '1'ไบคๆ++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ|ๆ่ฟฐ+--- | ---- | ---- | ----+exchange | str | Y | ไบคๆๆ SSEไธไบคๆ SZSEๆทฑไบคๆ+cal_date | str | Y | ๆฅๅๆฅๆ+is_open | str | Y | ๆฏๅฆไบคๆ 0ไผๅธ 1ไบคๆ+pretrade_date | str | Y | ไธไธไธชไบคๆๆฅ++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()+++df = pro.trade_cal(exchange='', start_date='20180101', end_date='20181231')++```++ๆ่++```python++df = pro.query('trade_cal', start_date='20180101', end_date='20181231')++```++**ๆฐๆฎๆ ทไพ**++ exchange cal_date is_open+ 0 SSE 20180101 0+ 1 SSE 20180102 1+ 2 SSE 20180103 1+ 3 SSE 20180104 1+ 4 SSE 20180105 1+ 5 SSE 20180106 0+ 6 SSE 20180107 0+ 7 SSE 20180108 1+ 8 SSE 20180109 1+ 9 SSE 20180110 1+ 10 SSE 20180111 1+ 11 SSE 20180112 1+ 12 SSE 20180113 0+ 13 SSE 20180114 0+ 14 SSE 20180115 1+ 15 SSE 20180116 1+ 16 SSE 20180117 1+ 17 SSE 20180118 1+ 18 SSE 20180119 1+ 19 SSE 20180120 0+ 20 SSE 20180121 0\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/\345\214\227\344\272\244\346\211\200\346\226\260\346\227\247\344\273\243\347\240\201\345\257\271\347\205\247.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/\345\214\227\344\272\244\346\211\200\346\226\260\346\227\247\344\273\243\347\240\201\345\257\271\347\205\247.md"new file mode 100644index 000000000..22cb2a76d--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/\345\214\227\344\272\244\346\211\200\346\226\260\346\227\247\344\273\243\347\240\201\345\257\271\347\205\247.md"@@ -0,0 +1,55 @@+## ๅไบคๆๆฐๆงไปฃ็ ๅฏน็ ง่กจ+----++ๆฅๅฃ๏ผbse_mapping+ๆ่ฟฐ๏ผ่ทๅๅไบคๆ่ก็ฅจไปฃ็ ๅๆดๅๆฐๆงไปฃ็ ๆ ๅฐ่กจๆฐๆฎ+้้๏ผๅๆฌกๆๅคง1000ๆก๏ผๆฌๆฅๅฃๆปๆฐๆฎ้300ไปฅๅ ๏ผ+็งฏๅ๏ผ120็งฏๅๅณๅฏ่ฐๅ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+o_code | str | N | ๆงไปฃ็ +n_code | str | N | ๆฐไปฃ็ ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+name | str | Y | ่ก็ฅจๅ็งฐ+o_code | str | Y | ๅไปฃ็ +n_code | str | Y | ๆฐไปฃ็ +list_date | str | Y | ไธๅธๆฅๆ++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++#่ทๅๆนๅคงๆฐๆๆฐๆงไปฃ็ ๅฏน็ งๆฐๆฎ+df = pro.bse_mapping(o_code='838163.BJ')+++#่ทๅๅ จ้จๅๆด็่ก็ฅจไปฃ็ ๅฏน็ ง่กจ+df = pro.bse_mapping()+++```+++<br>+<br>++**ๆฐๆฎ็คบไพ**++ name o_code n_code list_date+ 0 ๆนๅคงๆฐๆ 838163.BJ 920163.BJ 20200727\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/\346\257\217\346\227\245\350\202\241\346\234\254(\347\233\230\345\211\215).md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/\346\257\217\346\227\245\350\202\241\346\234\254(\347\233\230\345\211\215).md"new file mode 100644index 000000000..f7749cf36--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/\346\257\217\346\227\245\350\202\241\346\234\254(\347\233\230\345\211\215).md"@@ -0,0 +1,68 @@+## ่กๆฌๆ ๅต๏ผ็ๅ๏ผ+----++ๆฅๅฃ๏ผstk_premarket+ๆ่ฟฐ๏ผๆฏๆฅๅผ็ๅ่ทๅๅฝๆฅ่ก็ฅจ็่กๆฌๆ ๅต๏ผๅ ๆฌๆป่กๆฌๅๆต้่กๆฌ๏ผๆถจ่ทๅไปทๆ ผ็ญใ+้้๏ผๅๆฌกๆๅคง8000ๆกๆฐๆฎ๏ผๅฏๅพช็ฏๆๅ+ๆ้๏ผไธ็งฏๅๆ ๅ ณ๏ผๅฏไปฅ[ๅจ็บฟๅผ้](https://tushare.pro/weborder/#/permission)ๆ้ใ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ(YYYYMMDDๆ ผๅผ๏ผไธๅ)+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ+ts_code | str | Y | TS่ก็ฅจไปฃ็ +total_share | float | Y | ๆป่กๆฌ๏ผไธ่ก๏ผ+float_share | float | Y | ๆต้่กๆฌ๏ผไธ่ก๏ผ+pre_close | float | Y | ๆจๆฅๆถ็ไปท+up_limit | float | Y | ไปๆฅๆถจๅไปท+down_limit | float | Y | ไปๆฅ่ทๅไปท++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++#่ทๅๆไธๆฅ็ๅๆๆ่ก็ฅจๅฝๆฅ็ๆๆฐ่กๆฌ+df = pro.stk_premarket(trade_date='20240603')+++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ trade_date ts_code total_share float_share pre_close up_limit down_limit+ 0 20240603 001387.SZ 17778.8000 4355.7297 17.000 18.700 15.300+ 1 20240603 600460.SH 166407.1845 166407.1845 18.790 20.670 16.910+ 2 20240603 603052.SH 13484.8000 4096.4000 30.270 33.300 27.240+ 3 20240603 603269.SH 22053.6977 22053.6977 10.140 11.150 9.130+ 4 20240603 001339.SZ 24974.4000 7157.2575 29.210 32.130 26.290+ ... ... ... ... ... ... ... ...+ 5335 20240603 603567.SH 94196.3592 93954.0524 12.340 13.570 11.110+ 5336 20240603 301188.SZ 23245.0244 15044.4508 17.740 21.290 14.190+ 5337 20240603 603939.SH 101057.9797 100811.6102 45.060 49.570 40.550+ 5338 20240603 300441.SZ 65225.6868 63480.0236 6.460 7.750 5.170+ 5339 20240603 920002.BJ 3175.2120 475.0000 None 77.840 41.920\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/\346\262\252\346\267\261\346\270\257\351\200\232\350\202\241\347\245\250\345\210\227\350\241\250.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/\346\262\252\346\267\261\346\270\257\351\200\232\350\202\241\347\245\250\345\210\227\350\241\250.md"new file mode 100644index 000000000..c3a9e16a8--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/\346\262\252\346\267\261\346\270\257\351\200\232\350\202\241\347\245\250\345\210\227\350\241\250.md"@@ -0,0 +1,79 @@+## ๆฒชๆทฑๆธฏ้่ก็ฅจๅ่กจ+----++ๆฅๅฃ๏ผstock_hsgt๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆ่ฟฐ๏ผ่ทๅๆฒชๆทฑๆธฏ้่ก็ฅจๅ่กจ+ๆ้๏ผ3000็งฏๅ่ตท+ๆ็คบ๏ผๆฏๅคฉไธๅ9:20ๆดๆฐ๏ผๅๆฌก่ฏทๆฑๆๅคง่ฟๅ2000่กๆฐๆฎ๏ผๅฏๆ นๆฎ็ฑปๅๅพช็ฏๆๅ,ๆฌๆฅๅฃๆฐๆฎไป20250812ๅผๅง+++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ๏ผๆ ผๅผ๏ผYYYYMMDD๏ผ+type | str | Y | ็ฑปๅ๏ผๅ่ไธ่กจ๏ผ+start_date | str | N | ๅผๅงๆถ้ด+end_date | str | N | ็ปๆๆถ้ด++็ฑปๅ่ฏดๆๅฆไธ๏ผ++| ็ฑปๅ | ็ฑปๅๅ็งฐ |+--- | ---- |+| HK_SZ | ๆทฑ่ก้(ๆธฏ>ๆทฑ) |+| SZ_HK | ๆธฏ่ก้(ๆทฑ>ๆธฏ) |+| HK_SH | ๆฒช่ก้(ๆธฏ>ๆฒช) |+| SH_HK | ๆธฏ่ก้(ๆฒช>ๆธฏ) |+++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+type | str | Y | ็ฑปๅ+name | str | Y | ่ก็ฅจๅ็งฐ+type_name | str | Y | ็ฑปๅๅ็งฐ++++<br>+<br>++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++#่ทๅ20250813ๆฅๆทฑ่ก้็่ก็ฅจๅ่กจ+df = pro.stock_hsgt(trade_date='20250813',type='HK_SZ')+++```++<br>+<br>++**ๆฐๆฎๆ ทไพ**++ ts_code trade_date type name type_name+ 0 001258.SZ 20250813 HK_SZ ็ซๆฐ่ฝๆบ ๆทฑ่ก้(ๆธฏ>ๆทฑ)+ 1 00019.HK 20250813 SZ_HK ๅคชๅค่กไปฝๅ ฌๅธA ๆธฏ่ก้(ๆทฑ>ๆธฏ)+ 2 000513.SZ 20250813 HK_SZ ไธฝ็ ้ๅข ๆทฑ่ก้(ๆธฏ>ๆทฑ)+ 3 002044.SZ 20250813 HK_SZ ็พๅนดๅฅๅบท ๆทฑ่ก้(ๆธฏ>ๆทฑ)+ 4 000338.SZ 20250813 HK_SZ ๆฝๆดๅจๅ ๆทฑ่ก้(ๆธฏ>ๆทฑ)+ .. ... ... ... ... ...+ 995 300206.SZ 20250813 HK_SZ ็้ฆไปชๅจ ๆทฑ่ก้(ๆธฏ>ๆทฑ)+ 996 02331.HK 20250813 SH_HK ๆๅฎ ๆธฏ่ก้(ๆฒช>ๆธฏ)+ 997 01855.HK 20250813 SH_HK ไธญๅบ่กไปฝ ๆธฏ่ก้(ๆฒช>ๆธฏ)+ 998 300726.SZ 20250813 HK_SZ ๅฎ่พพ็ตๅญ ๆทฑ่ก้(ๆธฏ>ๆทฑ)+ 999 06127.HK 20250813 SH_HK ๆญ่กๆฐ่ฏ ๆธฏ่ก้(ๆฒช>ๆธฏ)diff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/\347\256\241\347\220\206\345\261\202\350\226\252\351\205\254\345\222\214\346\214\201\350\202\241.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/\347\256\241\347\220\206\345\261\202\350\226\252\351\205\254\345\222\214\346\214\201\350\202\241.md"new file mode 100644index 000000000..9b894ab0b--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/\347\256\241\347\220\206\345\261\202\350\226\252\351\205\254\345\222\214\346\214\201\350\202\241.md"@@ -0,0 +1,75 @@+## ็ฎก็ๅฑ่ช้ ฌๅๆ่ก+----++ๆฅๅฃ๏ผstk_rewards+ๆ่ฟฐ๏ผ่ทๅไธๅธๅ ฌๅธ็ฎก็ๅฑ่ช้ ฌๅๆ่ก+็งฏๅ๏ผ็จๆท้่ฆ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผ5000็งฏๅไปฅไธ้ขๆฌก็ธๅฏน่พ้ซ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | TS่ก็ฅจไปฃ็ ๏ผๆฏๆๅไธชๆๅคไธชไปฃ็ ่พๅ ฅ+end_date | str | N | ๆฅๅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | TS่ก็ฅจไปฃ็ +ann_date | str | Y | ๅ ฌๅๆฅๆ+end_date | str | Y | ๆชๆญขๆฅๆ+name | str | Y | ๅงๅ+title | str | Y | ่ๅก+reward | float | Y | ๆฅ้ ฌ+hold_vol | float | Y | ๆ่กๆฐ+++<br>+<br>++**ๆฅๅฃ็จไพ**++```python++pro = ts.pro_api()++#่ทๅๅไธชๅ ฌๅธ้ซ็ฎกๅ จ้จๆฐๆฎ+df = pro.stk_rewards(ts_code='000001.SZ')++#่ทๅๅคไธชๅ ฌๅธ้ซ็ฎกๅ จ้จๆฐๆฎ+df = pro.stk_rewards(ts_code='000001.SZ,600000.SH')++```++<br>+<br>++**ๆฐๆฎๆ ทไพ**++ ts_code ann_date end_date name title reward hold_vol+ 0 000001.SZ 20190808 20190630 ่ฐขๆฐธๆ ่ฃไบ้ฟ NaN 0.0+ 1 000001.SZ 20190808 20190630 ่ก่ท้ฃ ่ฃไบ,่ก้ฟ NaN 4104.0+ 2 000001.SZ 20190808 20190630 ้ๅฟ้ข ่ฃไบ NaN 0.0+ 3 000001.SZ 20190808 20190630 ๅงๆณข ่ฃไบ NaN 0.0+ 4 000001.SZ 20190808 20190630 ๅถ็ด ๅ ฐ ่ฃไบ NaN 0.0+ 5 000001.SZ 20190808 20190630 ้ฉๅฐไบฌ ็ฌ็ซ่ฃไบ NaN 0.0+ 6 000001.SZ 20190808 20190630 ่กๆนๆน ่ฃไบ NaN 0.0+ 7 000001.SZ 20190808 20190630 ้ญๅปบ ่ฃไบ NaN 0.0+ 8 000001.SZ 20190808 20190630 ้ญไธ้ฆ ่ฃไบ,ๅฏ่ก้ฟ NaN 0.0+ 9 000001.SZ 20190808 20190630 ็ๆฅๆฑ ็ฌ็ซ่ฃไบ NaN 0.0+ 10 000001.SZ 20190808 20190630 ็ๆพๅฅ ็ฌ็ซ่ฃไบ NaN 0.0+ 11 000001.SZ 20190808 20190630 ้ญ็ฐๅ ็ฌ็ซ่ฃไบ NaN 0.0+ 12 000001.SZ 20190808 20190630 ๆจๅฆ็ ็ฌ็ซ่ฃไบ NaN 0.0+ 13 000001.SZ 20190808 20190630 ้ฑไผ ็ไบ้ฟ,่ๅทฅ็ไบ NaN 0.0+ 14 000001.SZ 20190808 20190630 ่ฝฆๅฝๅฎ ่กไธ็ไบ NaN 0.0+ 15 000001.SZ 20190808 20190630 ๅจๅปบๅฝ ๅค้จ็ไบ NaN 0.0+ 16 000001.SZ 20190808 20190630 ้ชๅไธ ๅค้จ็ไบ NaN 0.0+ 17 000001.SZ 20190808 20190630 ๅจไธๆ ๅค้จ็ไบ NaN 0.0+ 18 000001.SZ 20190808 20190630 ๅญๆฐธๆกข ่ๅทฅ็ไบ NaN 0.0\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/\350\202\241\347\245\250\345\210\227\350\241\250.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/\350\202\241\347\245\250\345\210\227\350\241\250.md"new file mode 100644index 000000000..5f4a2f38b--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/\350\202\241\347\245\250\345\210\227\350\241\250.md"@@ -0,0 +1,91 @@+## ๅบ็กไฟกๆฏ+----++ๆฅๅฃ๏ผstock_basic๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎ+ๆ่ฟฐ๏ผ่ทๅๅบ็กไฟกๆฏๆฐๆฎ๏ผๅ ๆฌ่ก็ฅจไปฃ็ ใๅ็งฐใไธๅธๆฅๆใ้ๅธๆฅๆ็ญ+ๆ้๏ผ2000็งฏๅ่ตทใๆญคๆฅๅฃๆฏๅบ็กไฟกๆฏ๏ผ่ฐๅไธๆฌกๅฐฑๅฏไปฅๆๅๅฎ๏ผๅปบ่ฎฎไฟๅญๅๆฌๅฐๅญๅจๅไฝฟ็จ++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | TS่ก็ฅจไปฃ็ (<a href="https://tushare.pro/document/2?doc_id=14">ๆ ผๅผ่ฏดๆ</a>)+name | str | N | ๅ็งฐ+market | str | N | ๅธๅบ็ฑปๅซ ๏ผไธปๆฟ/ๅไธๆฟ/็งๅๆฟ/CDR/ๅไบคๆ๏ผ+list_status | str | N | ไธๅธ็ถๆ Lไธๅธ D้ๅธ Pๆๅไธๅธ G่ฟไผๆชไบคๆ๏ผ้ป่ฎคๆฏL+exchange | str | N | ไบคๆๆ SSEไธไบคๆ SZSEๆทฑไบคๆ BSEๅไบคๆ+is_hs | str | N | ๆฏๅฆๆฒชๆทฑๆธฏ้ๆ ็๏ผNๅฆ Hๆฒช่ก้ Sๆทฑ่ก้+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | TSไปฃ็ +symbol | str | Y | ่ก็ฅจไปฃ็ +name | str | Y | ่ก็ฅจๅ็งฐ+area | str | Y | ๅฐๅ+industry | str | Y | ๆๅฑ่กไธ+fullname | str | N | ่ก็ฅจๅ จ็งฐ+enname | str | N | ่ฑๆๅ จ็งฐ+cnspell | str | Y | ๆผ้ณ็ผฉๅ+market | str | Y | ๅธๅบ็ฑปๅ๏ผไธปๆฟ/ๅไธๆฟ/็งๅๆฟ/CDR๏ผ+exchange | str | N | ไบคๆๆไปฃ็ +curr_type | str | N | ไบคๆ่ดงๅธ+list_status | str | N | ไธๅธ็ถๆ Lไธๅธ D้ๅธ G่ฟไผๆชไบคๆ Pๆๅไธๅธ+list_date | str | Y | ไธๅธๆฅๆ+delist_date | str | N | ้ๅธๆฅๆ+is_hs | str | N | ๆฏๅฆๆฒชๆทฑๆธฏ้ๆ ็๏ผNๅฆ Hๆฒช่ก้ Sๆทฑ่ก้+act_name | str | Y | ๅฎๆงไบบๅ็งฐ+act_ent_type | str | Y | ๅฎๆงไบบไผไธๆง่ดจ+++่ฏดๆ๏ผๆง็ไธ็PE/PB/่กๆฌ็ญๅญๆฎต๏ผ่ฏทๅจ่กๆ ๆฅๅฃ[โๆฏๆฅๆๆ โ](https://tushare.pro/document/2?doc_id=32)ไธญ่ทๅใ++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++#ๆฅ่ฏขๅฝๅๆๆๆญฃๅธธไธๅธไบคๆ็่ก็ฅจๅ่กจ++data = pro.stock_basic(exchange='', list_status='L', fields='ts_code,symbol,name,area,industry,list_date')++```++<br>+ๆ่ ๏ผ+<br>++```python++#ๆฅ่ฏขๅฝๅๆๆๆญฃๅธธไธๅธไบคๆ็่ก็ฅจๅ่กจ++data = pro.query('stock_basic', exchange='', list_status='L', fields='ts_code,symbol,name,area,industry,list_date')+```++**ๆฐๆฎๆ ทไพ**++ ts_code symbol name area industry list_date+ 0 000001.SZ 000001 ๅนณๅฎ้ถ่ก ๆทฑๅณ ้ถ่ก 19910403+ 1 000002.SZ 000002 ไธ็งA ๆทฑๅณ ๅ จๅฝๅฐไบง 19910129+ 2 000004.SZ 000004 ๅฝๅ็งๆ ๆทฑๅณ ็็ฉๅถ่ฏ 19910114+ 3 000005.SZ 000005 ไธ็บชๆๆบ ๆทฑๅณ ๆฟไบงๆๅก 19901210+ 4 000006.SZ 000006 ๆทฑๆฏไธA ๆทฑๅณ ๅบๅๅฐไบง 19920427+ 5 000007.SZ 000007 ๅ จๆฐๅฅฝ ๆทฑๅณ ้ ๅบ้ค้ฅฎ 19920413+ 6 000008.SZ 000008 ็ฅๅท้ซ้ ๅไบฌ ่ฟ่พ่ฎพๅค 19920507+ 7 000009.SZ 000009 ไธญๅฝๅฎๅฎ ๆทฑๅณ ็ปผๅ็ฑป 19910625+ 8 000010.SZ 000010 ็พไธฝ็ๆ ๆทฑๅณ ๅปบ็ญๆฝๅทฅ 19951027+ 9 000011.SZ 000011 ๆทฑ็ฉไธA ๆทฑๅณ ๅบๅๅฐไบง 19920330+ 10 000012.SZ 000012 ๅ็ปA ๆทฑๅณ ็ป็ 19920228+ 11 000014.SZ 000014 ๆฒๆฒณ่กไปฝ ๆทฑๅณ ๅ จๅฝๅฐไบง 19920602+ 12 000016.SZ 000016 ๆทฑๅบทไฝณA ๆทฑๅณ ๅฎถ็จ็ตๅจ 19920327+ 13 000017.SZ 000017 ๆทฑไธญๅA ๆทฑๅณ ๆๆไผ้ฒ 19920331+ 14 000018.SZ 000018 ็ฅๅท้ฟๅ ๆทฑๅณ ่ฃ ไฟฎ่ฃ ้ฅฐ 19920616+ 15 000019.SZ 000019 ๆทฑๆทฑๅฎA ๆทฑๅณ ่ฝฏ้ฅฎๆ 19921012+ 16 000020.SZ 000020 ๆทฑๅๅA ๆทฑๅณ ๅ ๅจไปถ 19920428+ 17 000021.SZ 000021 ๆทฑ็งๆ ๆทฑๅณ ็ต่่ฎพๅค 19940202+ 18 000022.SZ 000022 ๆทฑ่ตคๆนพA ๆทฑๅณ ๆธฏๅฃ 19930505+ 19 000023.SZ 000023 ๆทฑๅคฉๅฐA ๆทฑๅณ ๅ ถไปๅปบๆ 19930429+ 20 000025.SZ 000025 ็นๅA ๆทฑๅณ ๆฑฝ่ฝฆๆๅก 19930621\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/\350\202\241\347\245\250\345\216\206\345\217\262\345\210\227\350\241\250.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/\350\202\241\347\245\250\345\216\206\345\217\262\345\210\227\350\241\250.md"new file mode 100644index 000000000..5ccb593fb--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/\350\202\241\347\245\250\345\216\206\345\217\262\345\210\227\350\241\250.md"@@ -0,0 +1,68 @@+## ่ก็ฅจๅๅฒๅ่กจ๏ผๅๅฒๆฏๅคฉ่ก็ฅจๅ่กจ๏ผ+----++ๆฅๅฃ๏ผbak_basic+ๆ่ฟฐ๏ผ่ทๅๅค็จๅบ็กๅ่กจ๏ผๆฐๆฎไป2016ๅนดๅผๅง+้้๏ผๅๆฌกๆๅคง7000ๆก๏ผๅฏไปฅๆ นๆฎๆฅๆๅๆฐๅพช็ฏ่ทๅๅๅฒ๏ผๆญฃๅผๆ้้่ฆ5000็งฏๅใ++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+trade_date | str | N | ไบคๆๆฅๆ+ts_code | str | N | ่ก็ฅจไปฃ็ +++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ+ts_code | str | Y | TS่ก็ฅจไปฃ็ +name | str | Y | ่ก็ฅจๅ็งฐ+industry | str | Y | ่กไธ+area | str | Y | ๅฐๅ+pe | float | Y | ๅธ็็๏ผๅจ๏ผ+float_share | float | Y | ๆต้่กๆฌ๏ผไบฟ๏ผ+total_share | float | Y | ๆป่กๆฌ๏ผไบฟ๏ผ+total_assets | float | Y | ๆป่ตไบง๏ผไบฟ๏ผ+liquid_assets | float | Y | ๆตๅจ่ตไบง๏ผไบฟ๏ผ+fixed_assets | float | Y | ๅบๅฎ่ตไบง๏ผไบฟ๏ผ+reserved | float | Y | ๅ ฌ็งฏ้+reserved_pershare | float | Y | ๆฏ่กๅ ฌ็งฏ้+eps | float | Y | ๆฏ่กๆถ็+bvps | float | Y | ๆฏ่กๅ่ตไบง+pb | float | Y | ๅธๅ็+list_date | str | Y | ไธๅธๆฅๆ+undp | float | Y | ๆชๅ้ ๅฉๆถฆ+per_undp | float | Y | ๆฏ่กๆชๅ้ ๅฉๆถฆ+rev_yoy | float | Y | ๆถๅ ฅๅๆฏ๏ผ%๏ผ+profit_yoy | float | Y | ๅฉๆถฆๅๆฏ๏ผ%๏ผ+gpr | float | Y | ๆฏๅฉ็๏ผ%๏ผ+npr | float | Y | ๅๅฉๆถฆ็๏ผ%๏ผ+holder_num | int | Y | ่กไธไบบๆฐ++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++df = pro.bak_basic(trade_date='20211012', fields='trade_date,ts_code,name,industry,pe')++```++**ๆฐๆฎๆ ทไพ**++ trade_date ts_code name industry pe+ 0 20211012 300605.SZ ๆ้ไฟกๆฏ ่ฝฏไปถๆๅก 56.4400+ 1 20211012 301017.SZ ๆผฑ็ๅนณๆฐ ๅป่ฏๅไธ 58.7600+ 2 20211012 300755.SZ ๅ่ด้ ่ก ๅ ถไปๅไธ 23.0000+ 3 20211012 300255.SZ ๅธธๅฑฑ่ฏไธ ็็ฉๅถ่ฏ 24.9900+ 4 20211012 688378.SH ๅฅฅๆฅๅพท ไธ็จๆบๆขฐ 24.9600+ ... ... ... ... ... ...+ 4529 20211012 688257.SH ๆฐ้่กไปฝ ๆบๆขฐๅบไปถ 0.0000+ 4530 20211012 688255.SH ๅฏๅฐ่พพ ๆบๆขฐๅบไปถ 0.0000+ 4531 20211012 688211.SH ไธญ็งๅพฎ่ณ ไธ็จๆบๆขฐ 0.0000+ 4532 20211012 605567.SH ๆฅ้ช้ฃๅ ้ฃๅ 0.0000+ 4533 20211012 605566.SH ็ฆ่ฑ่ฝ็น ๆๆๆถๆ 0.0000\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/\350\202\241\347\245\250\346\233\276\347\224\250\345\220\215.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/\350\202\241\347\245\250\346\233\276\347\224\250\345\220\215.md"new file mode 100644index 000000000..3b72a6552--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\345\237\272\347\241\200\346\225\260\346\215\256/\350\202\241\347\245\250\346\233\276\347\224\250\345\220\215.md"@@ -0,0 +1,46 @@+## ่ก็ฅจๆพ็จๅ+----++ๆฅๅฃ๏ผnamechange+ๆ่ฟฐ๏ผๅๅฒๅ็งฐๅๆด่ฎฐๅฝ+++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | TSไปฃ็ +start_date | str | N | ๅ ฌๅๅผๅงๆฅๆ+end_date | str | N | ๅ ฌๅ็ปๆๆฅๆ++**่พๅบๅๆฐ**+++ๅ็งฐ | ็ฑปๅ | ้ป่ฎค่พๅบ | ๆ่ฟฐ+--- | ---- | ---- | ---+ts_code | str | Y | TSไปฃ็ +name | str | Y | ่ฏๅธๅ็งฐ+start_date | str | Y | ๅผๅงๆฅๆ+end_date | str | Y | ็ปๆๆฅๆ+ann_date | str | Y | ๅ ฌๅๆฅๆ+change_reason | str | Y | ๅๆดๅๅ++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++df = pro.namechange(ts_code='600848.SH', fields='ts_code,name,start_date,end_date,change_reason')++```++**ๆฐๆฎๆ ทไพ**++ ts_code name start_date end_date change_reason+ 0 600848.SH ไธๆตทไธดๆธฏ 20151118 None ๆนๅ+ 1 600848.SH ่ชไปช่กไปฝ 20070514 20151117 ๆค้ST+ 2 600848.SH ST่ชไปช 20061026 20070513 ๅฎๆ่กๆน+ 3 600848.SH SST่ชไปช 20061009 20061025 ๆช่กๆนๅ S+ 4 600848.SH ST่ชไปช 20010508 20061008 ST+ 5 600848.SH ่ชไปช่กไปฝ 19940324 20010507 ๅ ถไป\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\344\270\234\346\226\271\350\264\242\345\257\214App\347\203\255\346\246\234.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\344\270\234\346\226\271\350\264\242\345\257\214App\347\203\255\346\246\234.md"new file mode 100644index 000000000..51238e947--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\344\270\234\346\226\271\350\264\242\345\257\214App\347\203\255\346\246\234.md"@@ -0,0 +1,77 @@+## ไธๆน่ดขๅฏ็ญๆฟ+----++ๆฅๅฃ๏ผdc_hot+ๆ่ฟฐ๏ผ่ทๅไธๆน่ดขๅฏApp็ญๆฆๆฐๆฎ๏ผๅ ๆฌA่กๅธๅบใETFๅบ้ใๆธฏ่กๅธๅบใ็พ่กๅธๅบ็ญ็ญ๏ผๆฏๆฅ็ไธญๆๅ4ๆฌก๏ผๆถ็ๅ4ๆฌก๏ผๆๆ22็นๆๅไธๆฌกใ+้้๏ผๅๆฌกๆๅคง2000ๆก๏ผๅฏๆ นๆฎๆฅๆ็ญๅๆฐๅพช็ฏ่ทๅๅ จ้จๆฐๆฎ+็งฏๅ๏ผ็จๆท็งฏ8000็งฏๅๅฏ่ฐๅไฝฟ็จ๏ผ็งฏๅ่ทๅๅๆณ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)+<br><br>+ๆณจๆ๏ผๆฌๆฅๅฃๅช้ไธชไบบๅญฆไน ๅ็ ็ฉถไฝฟ็จ๏ผๅฆ้ๅไธ็จ้๏ผ่ฏท่ช่ก่็ณปไธๆน่ดขๅฏ่งฃๅณๆฐๆฎ้่ดญ้ฎ้ขใ+<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+trade_date | str | N | ไบคๆๆฅๆ+ts_code | str | N | TSไปฃ็ +market | str | N | ็ฑปๅ(A่กๅธๅบใETFๅบ้ใๆธฏ่กๅธๅบใ็พ่กๅธๅบ)+hot_type | str | N | ็ญ็น็ฑปๅ(ไบบๆฐๆฆใ้ฃๅๆฆ)+is_new | str | N | ๆฏๅฆๆๆฐ๏ผ้ป่ฎคY๏ผๅฆๆไธบNๅไธบ็ไธญๅ็ๅ้ถๆฎต้้๏ผๅ ทไฝๆถ้ดๅฏๅ่rank_timeๅญๆฎต๏ผ็ถๆNๆฏๅฐๆถๆดๆฐไธๆฌก๏ผ็ถๆYๆดๆฐๆถ้ดไธบ22๏ผ30๏ผ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ+data_type | str | Y | ๆฐๆฎ็ฑปๅ+ts_code | str | Y | ่ก็ฅจไปฃ็ +ts_name | str | Y | ่ก็ฅจๅ็งฐ+rank | int | Y | ๆ่กๆ่ ็ญๅบฆ+pct_change | float | Y | ๆถจ่ทๅน %+current_price | float | Y | ๅฝๅไปท+rank_time | str | Y | ๆ่กๆฆ่ทๅๆถ้ด++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++#่ทๅๆฅ่ฏขๆไปฝๅธๅ้่ก+df = pro.dc_hot(trade_date='20240415', market='A่กๅธๅบ',hot_type='ไบบๆฐๆฆ', fields='ts_code,ts_name,rank')++```++<br>+<br>+++**ๆฐๆฎ็คบไพ**++ ts_code ts_name rank+ 0 601099.SH ๅคชๅนณๆด 1+ 1 601995.SH ไธญ้ๅ ฌๅธ 2+ 2 002235.SZ ๅฎๅฆฎ่กไปฝ 3+ 3 601136.SH ้ฆๅ่ฏๅธ 4+ 4 600127.SH ้ๅฅ็ฑณไธ 5+ .. ... ... ...+ 95 300675.SZ ๅปบ็ง้ข 96+ 96 601900.SH ๅๆนไผ ๅช 97+ 97 600280.SH ไธญๅคฎๅๅบ 98+ 98 300898.SZ ็็ซไนณๅ 99+ 99 600519.SH ่ดตๅท่ ๅฐ 100++<br>+<br>++**ๆฐๆฎๆฅๆบ**++<img src='https://tushare.pro/files/web/dc1.jpg' width="300" height="600">++<img src='https://tushare.pro/files/web/dc2.png' width="300" height="600">\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\344\270\234\346\226\271\350\264\242\345\257\214\346\246\202\345\277\265\346\210\220\345\210\206.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\344\270\234\346\226\271\350\264\242\345\257\214\346\246\202\345\277\265\346\210\220\345\210\206.md"new file mode 100644index 000000000..06aad9255--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\344\270\234\346\226\271\350\264\242\345\257\214\346\246\202\345\277\265\346\210\220\345\210\206.md"@@ -0,0 +1,65 @@+## ไธๆน่ดขๅฏๆฟๅๆๅ+----++ๆฅๅฃ๏ผdc_member+ๆ่ฟฐ๏ผ่ทๅไธๆน่ดขๅฏๆฟๅๆฏๆฅๆๅๆฐๆฎ๏ผๅฏไปฅๆ นๆฎๆฆๅฟตๆฟๅไปฃ็ ๅไบคๆๆฅๆ๏ผ่ทๅๅๅฒๆๅ+้้๏ผๅๆฌกๆๅคง่ทๅ5000ๆกๆฐๆฎ๏ผๅฏไปฅ้่ฟๆฅๆๅไปฃ็ ๅพช็ฏ่ทๅ+ๆ้๏ผ็จๆท็งฏ็ดฏ6000็งฏๅๅฏ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)+<br><br>+ๆณจๆ๏ผๆฌๆฅๅฃๅช้ไธชไบบๅญฆไน ๅ็ ็ฉถไฝฟ็จ๏ผๅฆ้ๅไธ็จ้๏ผ่ฏท่ช่ก่็ณปไธๆน่ดขๅฏ่งฃๅณๆฐๆฎ้่ดญ้ฎ้ขใ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ๆฟๅๆๆฐไปฃ็ +con_code | str | N | ๆๅ่ก็ฅจไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ๏ผYYYYMMDDๆ ผๅผ๏ผ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ+ts_code | str | Y | ๆฆๅฟตไปฃ็ +con_code | str | Y | ๆๅไปฃ็ +name | str | Y | ๆๅ่กๅ็งฐ++<br>+<br>+++**ๆฅๅฃ็คบไพ**++```python++#่ทๅไธๆน่ดขๅฏ2025ๅนด1ๆ2ๆฅ็ไบบๅฝขๆบๅจไบบๆฆๅฟตๆฟๅๆๅๅ่กจ+df = pro.dc_member(trade_date='20250102', ts_code='BK1184.DC')+++```+++<br>+<br>++**ๆฐๆฎ็คบไพ**++ trade_date ts_code con_code name+ 0 20250102 BK1184.DC 002117.SZ ไธๆธฏ่กไปฝ+ 1 20250102 BK1184.DC 603662.SH ๆฏๅไผ ๆ+ 2 20250102 BK1184.DC 688165.SH ๅๅคซ็น-U+ 3 20250102 BK1184.DC 300660.SZ ๆฑ่้ทๅฉ+ 4 20250102 BK1184.DC 873593.BJ ้ผๆบ็งๆ+ .. ... ... ... ...+ 59 20250102 BK1184.DC 002139.SZ ๆ้ฆ่กไปฝ+ 60 20250102 BK1184.DC 301236.SZ ่ฝฏ้ๅจๅ+ 61 20250102 BK1184.DC 601727.SH ไธๆตท็ตๆฐ+ 62 20250102 BK1184.DC 300432.SZ ๅฏไธด็ฒพๅทฅ+ 63 20250102 BK1184.DC 300843.SZ ่่่กไปฝdiff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\344\270\234\346\226\271\350\264\242\345\257\214\346\246\202\345\277\265\346\235\277\345\235\227.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\344\270\234\346\226\271\350\264\242\345\257\214\346\246\202\345\277\265\346\235\277\345\235\227.md"new file mode 100644index 000000000..253de7218--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\344\270\234\346\226\271\350\264\242\345\257\214\346\246\202\345\277\265\346\235\277\345\235\227.md"@@ -0,0 +1,76 @@+## ไธๆน่ดขๅฏๆฆๅฟตๆฟๅ+----++ๆฅๅฃ๏ผdc_index+ๆ่ฟฐ๏ผ่ทๅไธๆน่ดขๅฏๆฏไธชไบคๆๆฅ็ๆฆๅฟตๆฟๅๆฐๆฎ๏ผๆฏๆๆๆฅๆๆฅ่ฏข+้้๏ผๅๆฌกๆๅคงๅฏ่ทๅ5000ๆกๆฐๆฎ๏ผๅๅฒๆฐๆฎๅฏๆ นๆฎๆฅๆๅพช็ฏ่ทๅ+ๆ้๏ผ็จๆท็งฏ็ดฏ6000็งฏๅๅฏ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++ๆณจๆ๏ผๆฌๆฅๅฃๅช้ไธชไบบๅญฆไน ๅ็ ็ฉถไฝฟ็จ๏ผๅฆ้ๅไธ็จ้๏ผ่ฏท่ช่ก่็ณปไธๆน่ดขๅฏ่งฃๅณๆฐๆฎ้่ดญ้ฎ้ขใ+<br>+++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ๆๆฐไปฃ็ ๏ผๆฏๆๅคไธชไปฃ็ ๅๆถ่พๅ ฅ๏ผ็จ้ๅทๅ้๏ผ+name | str | N | ๆฟๅๅ็งฐ๏ผไพๅฆ๏ผไบบๅฝขๆบๅจไบบ๏ผ+trade_date | str | N | ไบคๆๆฅๆ๏ผYYYYMMDDๆ ผๅผ๏ผไธๅ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+idx_type | str | Y | ๆฟๅ็ฑปๅ(่กไธๆฟๅใๆฆๅฟตๆฟๅใๅฐๅๆฟๅ)++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ๆฆๅฟตไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+name | str | Y | ๆฆๅฟตๅ็งฐ+leading | str | Y | ้ขๆถจ่ก็ฅจๅ็งฐ+leading_code | str | Y | ้ขๆถจ่ก็ฅจไปฃ็ +pct_change | float | Y | ๆถจ่ทๅน+leading_pct | float | Y | ้ขๆถจ่ก็ฅจๆถจ่ทๅน+total_mv | float | Y | ๆปๅธๅผ๏ผไธๅ ๏ผ+turnover_rate | float | Y | ๆขๆ็+up_num | int | Y | ไธๆถจๅฎถๆฐ+down_num | int | Y | ไธ้ๅฎถๆฐ+idx_type | str | Y | ๆฟๅ็ฑปๅ(่กไธๆฟๅใๆฆๅฟตๆฟๅใๅฐๅๆฟๅ)+level | str | Y | ่กไธๅฑ็บง++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++#่ทๅไธๆน่ดขๅฏ2025ๅนด1ๆ3ๆฅ็ๆฆๅฟตๆฟๅๅ่กจ+df = pro.dc_index(trade_date='20250103', fields='ts_code,name,turnover_rate,up_num,down_num')+++```+++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code name turnover_rate up_num down_num+ 0 BK1186.DC ้ฆๅ็ปๆต 8.3700 4 31+ 1 BK1185.DC ๅฐ้ช็ปๆต 4.0800 2 32+ 2 BK1184.DC ไบบๅฝขๆบๅจไบบ 4.0800 2 62+ 3 BK1183.DC ่ฐทๅญ็ปๆต 4.6300 2 55+ 4 BK1182.DC ๆบ่ฐฑAI 5.4000 0 33+ .. ... ... ... ... ...+ 453 BK0498.DC AB่ก 1.7300 4 67+ 454 BK0494.DC ่่ฝ็ฏไฟ 2.1600 32 378+ 455 BK0493.DC ๆฐ่ฝๆบ 1.4800 19 184+ 456 BK0492.DC ็ คๅๅทฅ 1.7000 16 56+ 457 BK0490.DC ๅๅทฅ 2.5200 32 465+diff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\344\270\234\350\264\242\346\246\202\345\277\265\345\222\214\350\241\214\344\270\232\346\214\207\346\225\260\350\241\214\346\203\205.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\344\270\234\350\264\242\346\246\202\345\277\265\345\222\214\350\241\214\344\270\232\346\214\207\346\225\260\350\241\214\346\203\205.md"new file mode 100644index 000000000..d313b96a4--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\344\270\234\350\264\242\346\246\202\345\277\265\345\222\214\350\241\214\344\270\232\346\214\207\346\225\260\350\241\214\346\203\205.md"@@ -0,0 +1,75 @@+## ไธ่ดขๆฆๅฟตๆฟๅ่กๆ+----++ๆฅๅฃ๏ผdc_daily+ๆ่ฟฐ๏ผ่ทๅไธ่ดขๆฆๅฟตๆฟๅใ่กไธๆๆฐๆฟๅใๅฐๅๆฟๅ่กๆ ๆฐๆฎ๏ผๅๅฒๆฐๆฎๅผๅงไบ2020ๅนด+้้๏ผๅๆฌกๆๅคง2000ๆกๆฐๆฎ๏ผๅฏๆ นๆฎๆฅๆๅๆฐๅพช็ฏ่ทๅ+ๆ้๏ผ็จๆท็งฏ็ดฏ6000็งฏๅๅฏ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)+<br><br>+ๆณจๆ๏ผๆฌๆฅๅฃๅช้ไธชไบบๅญฆไน ๅ็ ็ฉถไฝฟ็จ๏ผๅฆ้ๅไธ็จ้๏ผ่ฏท่ช่ก่็ณปไธๆน่ดขๅฏ่งฃๅณๆฐๆฎ้่ดญ้ฎ้ขใ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ๆฟๅไปฃ็ ๏ผๆ ผๅผ๏ผxxxxx.DC)+trade_date | str | N | ไบคๆๆฅๆ(ๆ ผๅผ๏ผYYYYMMDDไธๅ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+idx_type | str | N | ๆฟๅ็ฑปๅ๏ผ ๆฆๅฟตๆฟๅใ่กไธๆฟๅใๅฐๅๆฟๅ++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ๆฟๅไปฃ็ +trade_date | str | Y | ไบคๆๆฅ+close | float | Y | ๆถ็็นไฝ+open | float | Y | ๅผ็็นไฝ+high | float | Y | ๆ้ซ็นไฝ+low | float | Y | ๆไฝ็นไฝ+change | float | Y | ๆถจ่ท็นไฝ+pct_change | float | Y | ๆถจ่ทๅน+vol | float | Y | ๆไบค้(่ก)+amount | float | Y | ๆไบค้ข(ๅ )+swing | float | Y | ๆฏๅน+turnover_rate | float | Y | ๆขๆ็++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++#่ทๅไธๆน่ดขๅฏ2025ๅนด5ๆ13ๆฅๆฆๅฟตๆฟๅ่กๆ+df = pro.dc_daily(trade_date='20250513')+++```+++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code trade_date close open high low pct_change+ 0 BK1063.DC 20250513 792.5200 793.5200 795.0400 786.9000 0.8700+ 1 BK1051.DC 20250513 12408.8600 12510.2500 12573.2800 12350.8900 4.3700+ 2 BK0816.DC 20250513 65.8600 66.6700 67.0200 65.4500 3.7700+ 3 BK0547.DC 20250513 12810.7600 12745.7200 12823.3500 12691.3900 0.6000+ 4 BK1082.DC 20250513 1306.9800 1337.2300 1342.8900 1302.9700 -1.3900+ .. ... ... ... ... ... ... ...+ 430 BK0915.DC 20250513 1136.7400 1159.1800 1162.3600 1133.9400 -1.0200+ 431 BK1084.DC 20250513 1481.1500 1514.2300 1517.7200 1476.3200 -0.6100+ 432 BK0957.DC 20250513 1277.3800 1295.2900 1303.0000 1275.1900 -0.3500+ 433 BK1156.DC 20250513 1350.4700 1356.8500 1372.2800 1344.9400 0.0100+ 434 BK0881.DC 20250513 1156.1600 1181.2600 1184.1800 1154.0800 -0.5700\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\345\220\214\350\212\261\351\241\272App\347\203\255\346\246\234\346\225\260.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\345\220\214\350\212\261\351\241\272App\347\203\255\346\246\234\346\225\260.md"new file mode 100644index 000000000..fe34dcd9c--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\345\220\214\350\212\261\351\241\272App\347\203\255\346\246\234\346\225\260.md"@@ -0,0 +1,80 @@+## ๅ่ฑ้กบ็ญๆฆ+----++ๆฅๅฃ๏ผths_hot+ๆ่ฟฐ๏ผ่ทๅๅ่ฑ้กบApp็ญๆฆๆฐๆฎ๏ผๅ ๆฌ็ญ่กใๆฆๅฟตๆฟๅใETFใๅฏ่ฝฌๅบใๆธฏ็พ่ก็ญ็ญ๏ผๆฏๆฅ็ไธญๆๅ4ๆฌก๏ผๆถ็ๅ4ๆฌก๏ผๆๆ22็นๆๅไธๆฌกใ+้้๏ผๅๆฌกๆๅคง2000ๆก๏ผๅฏๆ นๆฎๆฅๆ็ญๅๆฐๅพช็ฏ่ทๅๅ จ้จๆฐๆฎ+็งฏๅ๏ผ็จๆท็งฏ6000็งฏๅๅฏ่ฐๅไฝฟ็จ๏ผ็งฏๅ่ทๅๅๆณ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)+<br><br>+ๆณจๆ๏ผๆฌๆฅๅฃๅช้ไธชไบบๅญฆไน ๅ็ ็ฉถไฝฟ็จ๏ผๅฆ้ๅไธ็จ้๏ผ่ฏท่ช่ก่็ณปๅ่ฑ้กบ่งฃๅณๆฐๆฎ้่ดญ้ฎ้ขใ+<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+trade_date | str | N | ไบคๆๆฅๆ+ts_code | str | N | TSไปฃ็ +market | str | N | ็ญๆฆ็ฑปๅ(็ญ่กใETFใๅฏ่ฝฌๅบใ่กไธๆฟๅใๆฆๅฟตๆฟๅใๆ่ดงใๆธฏ่กใ็ญๅบใ็พ่ก)+is_new | str | N | ๆฏๅฆๆๆฐ๏ผ้ป่ฎคY๏ผๅฆๆไธบNๅไธบ็ไธญๅ็ๅ้ถๆฎต้้๏ผๅ ทไฝๆถ้ดๅฏๅ่rank_timeๅญๆฎต๏ผ็ถๆNๆฏๅฐๆถๆดๆฐไธๆฌก๏ผ็ถๆYๆดๆฐๆถ้ดไธบ22๏ผ30๏ผ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ+data_type | str | Y | ๆฐๆฎ็ฑปๅ+ts_code | str | Y | ่ก็ฅจไปฃ็ +ts_name | str | Y | ่ก็ฅจๅ็งฐ+rank | int | Y | ๆ่ก+pct_change | float | Y | ๆถจ่ทๅน %+current_price | float | Y | ๅฝๅไปทๆ ผ+concept | str | Y | ๆ ็ญพ+rank_reason | str | Y | ไธๆฆ่งฃ่ฏป+hot | float | Y | ็ญๅบฆๅผ+rank_time | str | Y | ๆ่กๆฆ่ทๅๆถ้ด++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++#่ทๅๆฅ่ฏขๆไปฝๅธๅ้่ก+df = pro.ths_hot(trade_date='20240315', market='็ญ่ก', fields='ts_code,ts_name,hot,concept')++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code ts_name hot concept+ 0 300750.SZ ๅฎๅพทๆถไปฃ 214462.0 ["้ ็ฆปๅญ็ตๆฑ ", "ๅ่ฑ้กบๆผไบฎ100"]+ 1 603580.SH ่พ่พ็ฒพๅทฅ 185431.0 ["ไบบๆฐๅธ่ดฌๅผๅ็", "ๅฐๆนพๆฆๅฟต่ก"]+ 2 002085.SZ ไธไธฐๅฅฅๅจ 180332.0 ["้ฃ่กๆฑฝ่ฝฆ(eVTOL)", "ไฝ็ฉบ็ปๆต"]+ 3 600733.SH ๅๆฑฝ่่ฐท 156000.0 ["ไธไฝๅๅ้ธ", "ๅไธบๆฑฝ่ฝฆ"]+ 4 603259.SH ่ฏๆๅบทๅพท 154360.0 ["CROๆฆๅฟต", "ๅๆฐ่ฏ"]+ .. ... ... ... ...+ 95 300735.SZ ๅ ๅผ็งๆ 28528.0 ["ๆบ่ฝ็ฉฟๆด", "EDRๆฆๅฟต"]+ 96 002632.SZ ้ๆๅ ๅญฆ 28101.0 ["AIๆๆบ", "ๆถ่ดน็ตๅญๆฆๅฟต"]+ 97 601086.SH ๅฝ่ณ้ๅข 28006.0 ["ๆฐ้ถๅฎ", "็ฝ็ป็ดๆญ"]+ 98 002406.SZ ่ฟไธไผ ๅจ 28003.0 ["ๅทฅไธไบ่็ฝ", "ๆบ่ฝๅถ้ "]+ 99 600160.SH ๅทจๅ่กไปฝ 27979.0 ["PVDFๆฆๅฟต", "ๆฐๅๅทฅๆฆๅฟต"]++<br>+<br>++**ๆฐๆฎๆฅๆบ**++<img src='https://tushare.pro/files/web/ths1.jpg' width="250" height="500">++<img src='https://tushare.pro/files/web/ths2.png' width="250" height="500">++<img src='https://tushare.pro/files/web/ths3.png' width="250" height="500">\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\345\220\214\350\212\261\351\241\272\346\246\202\345\277\265\345\222\214\350\241\214\344\270\232\346\214\207\346\225\260\350\241\214\346\203\205.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\345\220\214\350\212\261\351\241\272\346\246\202\345\277\265\345\222\214\350\241\214\344\270\232\346\214\207\346\225\260\350\241\214\346\203\205.md"new file mode 100644index 000000000..ac8c26197--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\345\220\214\350\212\261\351\241\272\346\246\202\345\277\265\345\222\214\350\241\214\344\270\232\346\214\207\346\225\260\350\241\214\346\203\205.md"@@ -0,0 +1,74 @@+## ๅ่ฑ้กบๆฟๅๆๆฐ่กๆ+----++ๆฅๅฃ๏ผths_daily+ๆ่ฟฐ๏ผ่ทๅๅ่ฑ้กบๆฟๅๆๆฐ่กๆ ใๆณจ๏ผๆฐๆฎ็ๆๅฝๅฑๅ่ฑ้กบ๏ผๅฆๅๅไธ็จ้๏ผ่ฏทไธปๅจ่็ณปๅ่ฑ้กบ๏ผๅฆ้ๅธฎๅฉ่ฏท่็ณปๅพฎไฟก๏ผwaditu_a+้้๏ผๅๆฌกๆๅคง3000่กๆฐๆฎ๏ผ้6000็งฏๅ๏ผ๏ผๅฏๆ นๆฎๆๆฐไปฃ็ ใๆฅๆๅๆฐๅพช็ฏๆๅใ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ๆๆฐไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ๏ผYYYYMMDDๆ ผๅผ๏ผไธๅ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | TSๆๆฐไปฃ็ +trade_date | str | Y | ไบคๆๆฅ+close | float | Y | ๆถ็็นไฝ+open | float | Y | ๅผ็็นไฝ+high | float | Y | ๆ้ซ็นไฝ+low | float | Y | ๆไฝ็นไฝ+pre_close | float | Y | ๆจๆฅๆถ็็น+avg_price | float | Y | ๅนณๅไปท+change | float | Y | ๆถจ่ท็นไฝ+pct_change | float | Y | ๆถจ่ทๅน+vol | float | Y | ๆไบค้+turnover_rate | float | Y | ๆขๆ็+total_mv | float | N | ๆปๅธๅผ+float_mv | float | N | ๆต้ๅธๅผ++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++df = pro.ths_daily(ts_code='865001.TI', start_date='20200101', end_date='20210101', fields='ts_code,trade_date,open,close,high,low,pct_change')++```+++<br>+<br>+++**ๆฐๆฎๆ ทไพ**++ ts_code trade_date close open high low pct_change vol+ 0 865001.TI 20201231 1664.7530 1660.7060 1671.2290 1649.4200 0.5646 13224.260000+ 1 865001.TI 20201230 1655.4070 1644.5950 1664.2290 1638.1100 0.3073 10815.800000+ 2 865001.TI 20201229 1650.3360 1686.1620 1686.1620 1639.0530 -1.6263 11763.170000+ 3 865001.TI 20201228 1677.6190 1682.5670 1689.8980 1667.2110 0.6698 11813.210000+ 4 865001.TI 20201224 1666.4570 1663.3270 1668.8490 1648.7920 0.6533 6571.630000+ .. ... ... ... ... ... ... ... ...+ 229 865001.TI 20200108 1315.8190 1313.4520 1323.2140 1312.7090 0.2567 33180.860000+ 230 865001.TI 20200107 1312.4500 1319.8580 1323.1850 1311.2390 -0.6790 20959.510000+ 231 865001.TI 20200106 1321.4230 1322.8090 1328.0270 1314.8890 -0.5953 21283.400000+ 232 865001.TI 20200103 1329.3370 1309.6150 1330.6640 1309.2810 0.6505 28610.530000+ 233 865001.TI 20200102 1320.7460 1342.6220 1343.1260 1308.6630 -1.1273 26149.740000\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\345\220\214\350\212\261\351\241\272\346\266\250\350\267\214\345\201\234\346\246\234\345\215\225.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\345\220\214\350\212\261\351\241\272\346\266\250\350\267\214\345\201\234\346\246\234\345\215\225.md"new file mode 100644index 000000000..f07501b3a--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\345\220\214\350\212\261\351\241\272\346\266\250\350\267\214\345\201\234\346\246\234\345\215\225.md"@@ -0,0 +1,82 @@+## ๆถจ่ทๅๆฆๅ๏ผๅ่ฑ้กบ๏ผ+----++ๆฅๅฃ๏ผlimit_list_ths+ๆ่ฟฐ๏ผ่ทๅๅ่ฑ้กบๆฏๆฅๆถจ่ทๅๆฆๅๆฐๆฎ๏ผๅๅฒๆฐๆฎไป20231101ๅผๅงๆไพ๏ผๅข้ๆฏๅคฉ16็นๅทฆๅณๆดๆฐ+้้๏ผๅๆฌกๆๅคง4000ๆก๏ผๅฏๆ นๆฎๆฅๆๆ่ก็ฅจไปฃ็ ๅพช็ฏๆๅ+็งฏๅ๏ผ8000็งฏๅไปฅไธๆฏๅ้500ๆฌก๏ผๆฏๅคฉๆป้ไธ้ๅถ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)+<br><br>+ๆณจๆ๏ผๆฌๆฅๅฃๅช้ไธชไบบๅญฆไน ๅ็ ็ฉถไฝฟ็จ๏ผๅฆ้ๅไธ็จ้๏ผ่ฏท่ช่ก่็ณปๅ่ฑ้กบ่งฃๅณๆฐๆฎ้่ดญ้ฎ้ขใ+<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+trade_date | str | N | ไบคๆๆฅๆ+ts_code | str | N | ่ก็ฅจไปฃ็ +limit_type | str | N | ๆถจๅๆฑ ใ่ฟๆณๆฑ ใๅฒๅบๆถจๅใ็ธๆฟๆฑ ใ่ทๅๆฑ ๏ผ้ป่ฎค๏ผๆถจๅๆฑ+market | str | N | HS-ๆฒชๆทฑไธปๆฟ GEM-ๅไธๆฟ STAR-็งๅๆฟ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ+ts_code | str | Y | ่ก็ฅจไปฃ็ +name | str | Y | ่ก็ฅจๅ็งฐ+price | float | Y | ๆถ็ไปท(ๅ )+pct_chg | float | Y | ๆถจ่ทๅน %+open_num | int | Y | ๆๅผๆฌกๆฐ+lu_desc | str | Y | ๆถจๅๅๅ+limit_type | str | Y | ๆฟๅ็ฑปๅซ+tag | str | Y | ๆถจๅๆ ็ญพ+status | str | Y | ๆถจๅ็ถๆ๏ผN่ฟๆฟใไธๅญๆฟ๏ผ+first_lu_time | str | N | ้ฆๆฌกๆถจๅๆถ้ด+last_lu_time | str | N | ๆๅๆถจๅๆถ้ด+first_ld_time | str | N | ้ฆๆฌก่ทๅๆถ้ด+last_ld_time | str | N | ๆๅ่ทๅๆถ้ด+limit_order | float | Y | ๅฐๅ้(ๅ |ไธช)+limit_amount | float | Y | ๅฐๅ้ข(ๅ |ไธช)+turnover_rate | float | Y | ๆขๆ็%+free_float | float | Y | ๅฎ้ ๆต้(ๅ |ไธช)+lu_limit_order | float | Y | ๆๅคงๅฐๅ(ๅ |ไธช)+limit_up_suc_rate | float | Y | ่ฟไธๅนดๆถจๅๅฐๆฟ็+turnover | float | Y | ๆไบค้ข+rise_rate | float | N | ๆถจ้+sum_float | float | N | ๆปๅธๅผ๏ผไบฟๅ ๏ผ+market_type | str | Y | ่ก็ฅจ็ฑปๅ๏ผHSๆฒชๆทฑไธปๆฟใGEMๅไธๆฟใSTAR็งๅๆฟ++<br>+<br>++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++df = pro.limit_list_ths(trade_date='20241125', limit_type='ๆถจๅๆฑ ', fields='ts_code,trade_date,tag,status,lu_desc')++```++**ๆฐๆฎๆ ทไพ**++ trade_date ts_code lu_desc tag status+ 0 20241125 603518.SH ๆ่ฃ ๅฎถ็บบ+็ตๅ ้ฆๆฟ ๆขๆๆฟ+ 1 20241125 003036.SZ ้ซ็ซฏ็บบ็ปๆบๆขฐ่ฎพๅค+่ฟๅนดๆฅๆถ่ดญไบ2ๅฎถๅ ฌๅธ 4ๅคฉ4ๆฟ Tๅญๆฟ+ 2 20241125 301268.SZ ็ฒพๅฏ็ปๆไปถ+ๅไธบ+ๅ ไผ+ไธไฝๅๅ้ธ ้ฆๆฟ ๆขๆๆฟ+ 3 20241125 603655.SH ๆฉก่ถ+ๆฑฝ่ฝฆ้ถ้จไปถ+้ดๆฅไพ่ดง็นๆฏๆ 2ๅคฉ2ๆฟ ๆขๆๆฟ+ 4 20241125 600119.SH ไธๆตทๅฝ่ต+ไบงไธๆ่ต+็ฉๆต+่ทจๅข็ตๅ 4ๅคฉ2ๆฟ ๆขๆๆฟ+ .. ... ... ... ... ...+ 149 20241125 002348.SZ ๅบๆ็ตๆฑ +็ฉๅ ท+ไบ่็ฝๆ่ฒ 4ๅคฉ2ๆฟ ไธๅญๆฟ+ 150 20241125 002175.SZ โไธๆน็ณปโ+่ฏ็+ๆบ่ฝๅถ้ +็ฉไธ็ฎก็ 4ๅคฉ4ๆฟ ไธๅญๆฟ+ 151 20241125 002155.SZ ๆนๅไธๅค้็ฟ็ฐๆข็ฟ่ท้ๅคง็ช็ ด 3ๅคฉ3ๆฟ ไธๅญๆฟ+ 152 20241125 002117.SZ ๆบ่ฝๆบๅจไบบ+ๆๅๅญๅ ฌๅธๅข่ต+AIๅบ็จ 2ๅคฉ2ๆฟ ไธๅญๆฟ+ 153 20241125 002103.SZ IPไบงๅ+ๅนฟๅ่ฅ้+่ทจๅข็ตๅ 7ๅคฉ5ๆฟ ไธๅญๆฟ\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\345\220\214\350\212\261\351\241\272\350\241\214\344\270\232\346\246\202\345\277\265\346\210\220\345\210\206.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\345\220\214\350\212\261\351\241\272\350\241\214\344\270\232\346\246\202\345\277\265\346\210\220\345\210\206.md"new file mode 100644index 000000000..e4265122f--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\345\220\214\350\212\261\351\241\272\350\241\214\344\270\232\346\246\202\345\277\265\346\210\220\345\210\206.md"@@ -0,0 +1,68 @@++## ๅ่ฑ้กบๆฆๅฟตๆฟๅๆๅ+----++ๆฅๅฃ๏ผths_member+ๆ่ฟฐ๏ผ่ทๅๅ่ฑ้กบๆฆๅฟตๆฟๅๆๅๅ่กจๆณจ๏ผๆฐๆฎ็ๆๅฝๅฑๅ่ฑ้กบ๏ผๅฆๅๅไธ็จ้๏ผ่ฏทไธปๅจ่็ณปๅ่ฑ้กบใ+้้๏ผ็จๆท็งฏ็ดฏ6000็งฏๅๅฏ่ฐๅ๏ผๆฏๅ้ๅฏ่ฐๅ200ๆฌก๏ผๅฏๆๆฆๅฟตๆฟๅไปฃ็ ๅพช็ฏๆๅๆๆๆๅ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ๆฟๅๆๆฐไปฃ็ +con_code | str | N | ่ก็ฅจไปฃ็ ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ๆๆฐไปฃ็ +con_code | str | Y | ่ก็ฅจไปฃ็ +con_name | str | Y | ่ก็ฅจๅ็งฐ+weight | float | N | ๆ้(ๆๆ )+in_date | str | N | ็บณๅ ฅๆฅๆ(ๆๆ )+out_date | str | N | ๅ้คๆฅๆ(ๆๆ )+is_new | str | N | ๆฏๅฆๆๆฐYๆฏNๅฆ+++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++df = pro.ths_member(ts_code='885800.TI')++```+++<br>+<br>+++**ๆฐๆฎๆ ทไพ**++ ts_code con_code con_name+ 0 885800.TI 000016.SZ ๆทฑๅบทไฝณA+ 1 885800.TI 000049.SZ ๅพท่ต็ตๆฑ+ 2 885800.TI 002008.SZ ๅคงๆๆฟๅ + 3 885800.TI 002036.SZ ่ๅ็ตๅญ+ 4 885800.TI 002055.SZ ๅพๆถฆ็ตๅญ+ .. ... ... ...+ 87 885800.TI 688127.SH ่็นๅ ๅญฆ+ 88 885800.TI 688157.SH ๆพไบ่กไปฝ+ 89 885800.TI 688286.SH ๆ่ฏ่กไปฝ+ 90 885800.TI 688312.SH ็้บฆ็งๆ+ 91 885800.TI 688386.SH ๆณไบๅพฎ้++ [92 rows x 3 columns]\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\345\220\214\350\212\261\351\241\272\350\241\214\344\270\232\346\246\202\345\277\265\346\235\277\345\235\227.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\345\220\214\350\212\261\351\241\272\350\241\214\344\270\232\346\246\202\345\277\265\346\235\277\345\235\227.md"new file mode 100644index 000000000..64d3244cc--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\345\220\214\350\212\261\351\241\272\350\241\214\344\270\232\346\246\202\345\277\265\346\235\277\345\235\227.md"@@ -0,0 +1,66 @@+## ๅ่ฑ้กบๆฆๅฟตๅ่กไธๆๆฐ+----++ๆฅๅฃ๏ผths_index+ๆ่ฟฐ๏ผ่ทๅๅ่ฑ้กบๆฟๅๆๆฐใๆณจ๏ผๆฐๆฎ็ๆๅฝๅฑๅ่ฑ้กบ๏ผๅฆๅๅไธ็จ้๏ผ่ฏทไธปๅจ่็ณปๅ่ฑ้กบ๏ผๅฆ้ๅธฎๅฉ่ฏท่็ณปๅพฎไฟก๏ผwaditu_a+ๆ้๏ผๆฌๆฅๅฃ้ๆ6000็งฏๅ๏ผๅๆฌกๆๅคง่ฟๅ5000่กๆฐๆฎ๏ผไธๆฌกๅฏๆๅๅ จ้จๆฐๆฎ๏ผ่ฏทๅฟๅพช็ฏๆๅใ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ๆๆฐไปฃ็ +exchange | str | N | ๅธๅบ็ฑปๅA-a่ก HK-ๆธฏ่ก US-็พ่ก+type | str | N | ๆๆฐ็ฑปๅ N-ๆฆๅฟตๆๆฐ I-่กไธๆๆฐ R-ๅฐๅๆๆฐ S-ๅ่ฑ้กบ็น่ฒๆๆฐ ST-ๅ่ฑ้กบ้ฃๆ ผๆๆฐ TH-ๅ่ฑ้กบไธป้ขๆๆฐ BB-ๅ่ฑ้กบๅฎฝๅบๆๆฐ++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ไปฃ็ +name | str | Y | ๅ็งฐ+count | int | Y | ๆๅไธชๆฐ+exchange | str | Y | ไบคๆๆ+list_date | str | Y | ไธๅธๆฅๆ+type | str | Y | NๆฆๅฟตๆๆฐS็น่ฒๆๆฐ+++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++df = pro.ths_index()++```+++<br>+<br>+++**ๆฐๆฎๆ ทไพ**++ ts_code name count exchange list_date type+ 0 885835.TI ๅ่ก้ถ่ก 126 A 20190416 N+ 1 885472.TI ไธๆตท่ช่ดธๅบ 51 A 20130813 N+ 2 885788.TI ็ฝ็ป็ดๆญ 63 A 20180312 N+ 3 885881.TI ไบๅๅ ฌ 29 A 20200203 N+ 4 885785.TI ๅฐ็ฑณๆฆๅฟต 91 A 20180306 N+ .. ... ... ... ... ... ...+ 266 885566.TI ๅคง้ฃๆบ 58 A 20140519 N+ 267 885841.TI ่ๅฐ่ดชๅค่พ้ฒๆฒป 18 A 20190517 N+ 268 885760.TI ่ฃ ้ ๅผๅปบ็ญ 50 A 20170918 N+ 269 885909.TI ่พ ๅฉ็ๆฎ 15 A 20201023 N+ 270 885883.TI ๅป็ๅบ็ฉๅค็ 25 A 20200207 Ndiff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\345\270\202\345\234\272\346\270\270\350\265\204\346\234\200\345\205\250\345\220\215\345\275\225.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\345\270\202\345\234\272\346\270\270\350\265\204\346\234\200\345\205\250\345\220\215\345\275\225.md"new file mode 100644index 000000000..3c62d7aea--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\345\270\202\345\234\272\346\270\270\350\265\204\346\234\200\345\205\250\345\220\215\345\275\225.md"@@ -0,0 +1,141 @@+## ๆธธ่ตๅๅฝ+----++ๆฅๅฃ๏ผhm_list+ๆ่ฟฐ๏ผ่ทๅๆธธ่ตๅ็ฑปๅๅฝไฟกๆฏ+้้๏ผๅๆฌกๆๅคง1000ๆกๆฐๆฎ๏ผ็ฎๅๆป้ๆช่ถ ่ฟ500+็งฏๅ๏ผ5000็งฏๅๅฏไปฅ่ฐๅ๏ผ็งฏๅ่ทๅๅๆณ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)+++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+name | str | N | ๆธธ่ตๅ็งฐ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+name | str | Y | ๆธธ่ตๅ็งฐ+desc | str | Y | ่ฏดๆ+orgs | None | Y | ๅ ณ่ๆบๆ++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python+#ไปฃ็ ็คบไพ+pro = ts.pro_api()++df = pro.hm_list()++```++<br>+<br>++**ๆฐๆฎๅ่กจ**++<br>+ๆณจ๏ผไปฅไธ่กจๆ ผๅชๆฏ็คบไพ๏ผๆฐๆฎไปฅAPIๆฅๅฃ่ฟๅ็ๆฐๆฎไธบๅใ+<br>++ๅ็งฐ | ่ฏดๆ | ๅ ณ่ๆบๆ+---- | ----- | ----+้พ้ฃ่|้พ้ฃ่(ๅ ๆ็พไนฆ)่ก็พๆ้ดๆพไธบๆกๅฟ็ฒพ็ฅ้ข่ข๏ผ็ๆ้ขๅคๅ่จ๏ผๅฏ่งไบบๅ่กๅใ|ๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅไบฌๅ ญๅ้ๅท่ฅฟ่ทฏ่ฏๅธ่ฅไธ้จ+้ซ้่ฝฌไธๅฎถ|ๆ ้ฟๅจ้ซ้่ฝฌไธช่ก่ฟ่กๆณขๆฎตๆไฝ|่ดข้่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅธธ็ๆซๆ่ทฏ่ฏๅธ่ฅไธ้จ+้ซๆฏ ้ปๅฑฑ|ไปทๆๅคง็ฅโ่ ๅฐ03\"๏ผ็ๅๅฏๆณใ่ช่ฟฐๆพๆ9ๅนดๆถ้ดๅค่พพ93%็ๅนดๅคๅฉๅๆฅใ็ผๅ ็ๅฉ็ฌๅฐ๏ผ้ฃๆ ผไปฅไธญ้ฟ็บฟไธบไธป๏ผ็ขฐไธ็ญ็บฟ้ฃๅฃไผไธปๅจ้ ๅ็ไฝ่ฟ ้ๆจๅ่กไปทใ|ๅฝไฟก่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทฑๅณ็ฝๆนๅฎๅฎๅ่ทฏ่ฏๅธ่ฅไธ้จ+้ช็|ๆขไบ่ฟฝๆถจ๏ผ้ไป๏ผไนๆขไบๅฒ่ใ|ไธญๅฝ้ถๆฒณ่ฏๅธ่กไปฝๆ้ๅ ฌๅธ้ๅบๆฐๆ่ทฏ่ฏๅธ่ฅไธ้จ+้ฆๆฟๆๆ|ๅไบๅๆไฝไฝ้ฆๆฟๆ่ท้ฃๆฟ๏ผๅธๅบไธๆดป่ท็ๆๆ่ต้๏ผๆ ้ฟๅจ้ขๆ็ๅๅๆๆ่กฅๆถจๆบไผ๏ผไธๆฆๅบ็ฐ้ซไฝๅๆญงๅฐฑไผๅๆถ็ฆปๅบใ|็ณไธๅฎๆบ่ฏๅธๆ้ๅ ฌๅธๅไบฌๅฒๆพไนๅบ่ฏๅธ่ฅไธ้จใๆน่ดข่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆญฆๆฑๅ่ฐๅคง้่ฏๅธ่ฅไธ้จใๅฝ้ฝ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅไบฌ้ๅคๅคง่ก่ฏๅธ่ฅไธ้จใๅ้ซ่ฏๅธๆ้่ดฃไปปๅ ฌๅธๆณๅทๅฎๆดฒ่ทฏ่ฏๅธ่ฅไธ้จใๅ้ซ่ฏๅธๆ้่ดฃไปปๅ ฌๅธๆฑ่ๅๅ ฌๅธใๅ้ซ่ฏๅธๆ้่ดฃไปปๅ ฌๅธๅฑฑไธๅๅ ฌๅธใๅ ดไธ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅฆ้จๅๅ ฌๅธใไธญไฟก่ฏๅธ่กไปฝๆ้ๅ ฌๅธ้ๅๅๅ ฌๅธใไธญไฟกๅปบๆ่ฏๅธ่กไปฝๆ้ๅ ฌๅธ่ฅฟๅฎๅๅคง่ก่ฏๅธ่ฅไธ้จใไธ่่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทฑๅณๅๆตทๅทฅไธๅ ซ่ทฏ่ฏๅธ่ฅไธ้จใไธ่่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅฆ้จๅๅ ฌๅธใไธๆน่ดขๅฏ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆฑ่ๅๅ ฌๅธใไธๅ่ฏๅธ่กไปฝๆ้ๅ ฌๅธ็ฆๅปบๅๅ ฌๅธ+้ฃไบๆฑ่ทฏ|็ฅๅๆธธ่ต๏ผ่ฟๆฅๅด่ตท็ๆฑๆต่ต้ๅธญไฝ๏ผๆฅๅๆไฝไธบไธป๏ผๅฐคๆ ็น็ซๆไฝ๏ผ่ต้่งๆจก้ไธญ๏ผไฝๆดป่ทๅๅบฆ่พ้ซใ|ๅ้ซ่ฏๅธๆ้่ดฃไปปๅ ฌๅธๆญๅท้ฃไบๆฑ่ทฏ่ฏๅธ่ฅไธ้จ+้็ง่ทฏ|ๆญๅท้็ง่ทฏ๏ผ60ๅ๏ผไปฃ่กจไฝๅๅคฉไฟกๆฏ๏ผๆทฑๆก่พพใ้็ง่ทฏๆไบบ็งฐๅ ถไธบๆฃๆทๆถๅฒๆบ๏ผไนๅๆ ๅบไธไธๆ ท็ๆๆณๆไฝ๏ผๅธๅบ็่งฃ่ถ ไบๅธธไบบ๏ผไฟกๅๆฆๅฟต่กไธชไบบไฟๅฎไผฐ่ฎกๆตฎ็็บฆ1ไบฟใๆไฝๆๆณไธๆต๏ผๅฐๆ้ๅๅฐๆ่ด๏ผๅๆฌขไธๅฎถ็ฌๅคงใ|ๅ้ซ่ฏๅธๆ้่ดฃไปปๅ ฌๅธๆญๅท้็ง่ทฏ่ฏๅธ่ฅไธ้จ+้ๅฐ็พค|ๆดป่ทไบ็ฝ็ป่ฎบๅ็ๅฎๅๆธธ่ต๏ผๆ ้ฟ่ถๅฟ้พๅคด๏ผๅๆญงๆๆฟไปๅ ฅ๏ผ็่งฃๅๅฐคๅ ถไผ็งใ|ไธญๅฝ้ถๆฒณ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅคง่ฟ้ปๆฒณ่ทฏ่ฏๅธ่ฅไธ้จใไธญๅฝ้ถๆฒณ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅคง่ฟ้้ฉฌ่ทฏ่ฏๅธ่ฅไธ้จ+้็ฐ่ทฏ|ไบคๆๆๆณ็ฎๅ็ฒๆด๏ผ่ฟฝ้พๅคด๏ผไธๅ้ซไฝๆฅๅๆฟ๏ผๆขๆถๆขๅฒ๏ผๅจๅธๅบๅฅฝ็ๆถๅๆขๅจ้ซไฝ่ฟ็ปญๅ ไป๏ผ้ญ้่กๆ ไธๅฅฝ็ๆถๅๅฒ็้ๅธธๆๆญ๏ผๆฏซไธ็น่ฑซใ|ๅ ๅคง่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทฑๅณ้็ฐ่ทฏ่ฏๅธ่ฅไธ้จใไธญๅคฉ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทฑๅณๅๅ ฌๅธใไธญๅคฉ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅฐๅทๅธๅบๅคง้่ฏๅธ่ฅไธ้จ+้ๅๆๆฟ|้ๅๆๆฟ๏ผ็ปๅคงๅคๆฐๆไฝไปฅ้ฆๆฟไบๆฟไธบไธป๏ผๆฌกๆฅไธ่ฝ็งๆฟๅผ็้ฝไผๅ ๅ ็ฐไธๅ๏ผไธๆฟ็บ ้ไนฐๅ้จๅไปไฝ๏ผไธ่ฝ่ตฐๅผบๅ็ดๆฅๆธ ไปใ|ๅ้ซ่ฏๅธๆ้่ดฃไปปๅ ฌๅธไธๆตทๅๅ ฌๅธใๅๅ่ฏๅธๆ้่ดฃไปปๅ ฌๅธไธๆตท็ฌฌไบๅๅ ฌๅธ+้ๅๅบ้|20ๅนดๅไธไบฌ็ฒฎๆง่ก้ฆๆฌกๆบๅๆบๆๅ ฅๅบ๏ผๅญๅๆบๆๅธญไฝๆบขไปทๆฌกๆฅ่ทๅพไธๅญๆฟ๏ผๅฐ็ฐๅจ้ๅๅบ้ๅทฒ็ปๆฏๅธๅบไธ้ๅธธๆดป่ท็ไธ่กๅ้๏ผๅ ้จ่ต้ๆๅๅคๆ๏ผๅคๅฎถๆบๆๆททๆๅจๅ ถไธญ๏ผไฝๆฏๆดไฝ็ญ็ฅๅๆ ทๆฏ่ตทๅฐๅฉๆถจๅฉ่ท็ไฝ็จ๏ผไผ้ข็นๅTใ|ๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆป้จใไธญๅฝๅฝ้ ้่่กไปฝๆ้ๅ ฌๅธไธๆตท้ปๆตฆๅบๆนๆปจ่ทฏ่ฏๅธ่ฅไธ้จใไธญๅฝๅฝ้ ้่่กไปฝๆ้ๅ ฌๅธไธๆตทๅๅ ฌๅธใไธญๅฝไธญ้่ดขๅฏ่ฏๅธๆ้ๅ ฌๅธๅไบฌๅฎๅบ่ทฏ่ฏๅธ่ฅไธ้จใไธๅ่ฏๅธ่กไปฝๆ้ๅ ฌๅธ็ปๅ ด้ๆฏๆกฅๅคง้่ฏๅธ่ฅไธ้จ+่ตต่ๅฅ|ไปฅ็ญ็บฟ็น็ซๆๆฟไธบไธป๏ผๆ ้ฟไธป็บฟ้ขๆ็ไฝ๏ผไธปๆ้พๅคด่กใไธป่ฆๅไธๅธๅบ้ฃๅฃ็้พๅคด่กๆฅๅๆฟ๏ผๆฟๅๅธๅบ่ต้ๆ็ปญๆฅๅใ็ไธญๆไฝๆๆณไธป่ฆไปฅๆฅ้ๆด้ๆซ่ดงๅฐๆฟไธบไธป๏ผๅฉ็จ่ต้ไผๅฟไธๆๅคงๅๆๆฟใ|้ถๆณฐ่ฏๅธๆ้่ดฃไปปๅ ฌๅธไธๆตทๅๅ่ทฏ่ฏๅธ่ฅไธ้จใๆน่ดข่ฏๅธ่กไปฝๆ้ๅ ฌๅธไธๆตท้ๅฎถๅด่ฏๅธ่ฅไธ้จใๆตๅ่ฏๅธ่กไปฝๆ้ๅ ฌๅธ็ปๅ ดๅๅ ฌๅธใๆตๅ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆนๅทๅๅญๅคงๅฆ่ฏๅธ่ฅไธ้จใๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆตๆฑๅๅ ฌๅธใไธญๅฝ้ถๆฒณ่ฏๅธ่กไปฝๆ้ๅ ฌๅธ็ปๅ ด่ฏๅธ่ฅไธ้จใไธญๅฝ้ถๆฒณ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅไบฌ้ๆ่ทฏ่ฏๅธ่ฅไธ้จ+่ฅฟๆนๅฝ่ดธ|้กถ็บงไปทๆๅ่ต้๏ผ้กถ็บง็่งฃๅ๏ผๅไบๆๆไฝไฝ็่ถๅฟ็่ก๏ผๆณขๆฎตๆ่กไธบไธปใ|่ดขไฟก่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆญๅท่ฅฟๆนๅฝ่ดธไธญๅฟ่ฏๅธ่ฅไธ้จ+่ๅซไธ|่ๅซไธๅ็ฑ็งๆ่ก๏ผๅ ถๆฌกๆฏๅป่ฏ่ก๏ผๅบๆฌไปฅไธญใ้ฟ็บฟๆ่ตไธบไธป๏ผไนฐๅ ฅ่ก็ฅจๅๅพๅพไผๆๆๅ ๅนดๆถ้ด็ด่ณ่กไปท่ตท้ฃ\r\n|ๅฝๆณฐๅๅฎ่ฏๅธ่กไปฝๆ้ๅ ฌๅธไธๆตทๅๅ ฌๅธ+่ๅๅบๅฎข|ๆดป่ทไบ่กๅงใ่ฎบๅ็ๅฐๆธธ่ต๏ผๆ ้ฟ้พๅคด่ก้ไปใ|ๆตท้่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅไบฌ้ๅคๅคง่ก่ฏๅธ่ฅไธ้จใไธ่่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅไบฌๅๅ ฌๅธ+่ฝๅ(ๆฑๅ็ฅ้นฐ)|่ฝๅ(ๆฑๅ็ฅ้นฐ)03ๅนด็่ก่ฏ็บข้็ฝ็ป05ๅนดๅบ้ๅฑ ้ๅฑ 3ๅนด็่ต112ๅไป็ๆ ไบ็ฝไธๆ่ฏฆ็ป่ฎฐ่ฝฝๆฎ่งๅฏๅ ถๅ่ช็ถไบบๅ็ฝ็ณ๏ผๅ็ๆฏ่ฐ้ณ๏ผๅคง็ๅธๆ็ปฉๆ็ถ๏ผไปคไบบๆๅน๏ผๆธธ่ต็ๆฉๅนด็ฝ็บขๆดพใ|ๅ ๅคง่ฏๅธ่กไปฝๆ้ๅ ฌๅธ้ๅๅฎพ่น่ทฏ่ฏๅธ่ฅไธ้จ+่ๅทๅธฎ|ไปฅๅ็ญ็บฟไธบไธป๏ผๅธธ่ง้ซๆไฝๅธ๏ผๅT่ฅไธ้จใ|ๆตท้่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆญๅทๅธๅฟๅ่ทฏ่ฏๅธ่ฅไธ้จใๅนฟๅ่ฏๅธ่กไปฝๆ้ๅ ฌๅธ่ๅทไธๅดๅ่ทฏ่ฏๅธ่ฅไธ้จใๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธ่ๅทไบบๆฐ่ทฏ่ฏๅธ่ฅไธ้จใๅ ดไธ่ฏๅธ่กไปฝๆ้ๅ ฌๅธไธๆตท้้ตไธ่ทฏ่ฏๅธ่ฅไธ้จใไธๅด่ฏๅธ่กไปฝๆ้ๅ ฌๅธ่ๅท่ฅฟๅ่ก่ฏๅธ่ฅไธ้จใไธๅด่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅธธๅท้ๆฑไธญ่ทฏ่ฏๅธ่ฅไธ้จ+่ๅๅธฎ|็ญๅบๆธธ่ต๏ผ่ต้ไฝ้่พๅคงไธไบบๅไผๅค๏ผๅธญไฝๅคไธบๆฑ่ๆฌๅฐๅธญไฝ่ๅจๆไฝ๏ผ3/4ๆฟๅคไธบๅผบ้กถไธๅญๆฟใ|้ฟๆฑ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆญฆๆฑๅ่ฐ่ทฏ่ฏๅธ่ฅไธ้จใ้ฟๆฑ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅไบฌไธญๅฑฑไธ่ทฏ่ฏๅธ่ฅไธ้จใ็ณไธๅฎๆบ่ฅฟ้จ่ฏๅธๆ้ๅ ฌๅธๅๅฎ่ฑๅ่ทฏ่ฏๅธ่ฅไธ้จใๆตท้่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆญฆๆฑๅ ่ฐท่ฏๅธ่ฅไธ้จใๆตท้่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅไบฌๅนฟๅท่ทฏ่ฏๅธ่ฅไธ้จใๅคฉ้ฃ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทฑๅณ็ฆๅ่ทฏ่ฏๅธ่ฅไธ้จใๅคฉ้ฃ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทฑๅณๅๆตท่ฏๅธ่ฅไธ้จใๅฝๆณฐๅๅฎ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทฑๅณ็ป่ฏ่ทฏ่ฏๅธ่ฅไธ้จใๅฝๆณฐๅๅฎ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅไบฌ้่ๅ่ฏๅธ่ฅไธ้จใๅไบฌ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅผ ๅฎถๆธฏไธ็ฏ่ทฏ่ฏๅธ่ฅไธ้จใๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธ้ๆฑๅฅๅฎนๅ้ณๅ่ทฏ่ฏๅธ่ฅไธ้จใๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆ ้ก้่ไธ่ก่ฏๅธ่ฅไธ้จใๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅฎๆณขๆณๆฑ่ก่ฏๅธ่ฅไธ้จใๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅๅฎๆฐๆๅคง้่ฏๅธ่ฅไธ้จใๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅไบฌๆฑๅฎๅคฉๅ ไธ่ทฏ่ฏๅธ่ฅไธ้จใๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅไบฌๅบๅฑฑ่ทฏ่ฏๅธ่ฅไธ้จใๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅไบฌไธญๅ่ทฏ่ฏๅธ่ฅไธ้จใไธญๅฝ้ถๆฒณ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅไบฌๅญฆ้ขๅ่ทฏ่ฏๅธ่ฅไธ้จใไธ่่ฏๅธ่กไปฝๆ้ๅ ฌๅธ่ๅท่่่ก่ทฏ่ฏๅธ่ฅไธ้จใไธ่่ฏๅธ่กไปฝๆ้ๅ ฌๅธ็ฆๅปบๅๅ ฌๅธใไธ่่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆตๆฑๅๅ ฌๅธใไธ่่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅๅทๅๅ ฌๅธใไธๆตท่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅไบฌๆดชๆญฆๅ่ทฏ่ฏๅธ่ฅไธ้จใไธๆตท่ฏๅธๆ้่ดฃไปปๅ ฌๅธ้ปๆตฆๅบๅปถๅฎไธ่ทฏ่ฏๅธ่ฅไธ้จใไธๆตท่ฏๅธๆ้่ดฃไปปๅ ฌๅธๅไบฌ่ๅคช่ทฏ่ฏๅธ่ฅไธ้จใไธๆตท่ฏๅธๆ้่ดฃไปปๅ ฌๅธๅไบฌๆบงๆฐด่ด่ฟ่ทฏ่ฏๅธ่ฅไธ้จ+็บขๅฒญ่ทฏ|่ๅไฝๆ๏ผๅๆฌข่ฟไฝ็ๅผบๅฟไธปๅไนไธ๏ผๅพๅพๅจๆ ธๅฟไธช่ก็ฌฌไธๆณข็้ๅๅธ็ญน่ฟๅบ๏ผ้ๅ็ปดๆค่กไปท๏ผ็ญๅพ ๆถๆบๅฏๅจไบๆณขใ|ๅนณๅฎ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทฑๅณ่ๅฃๆๅ่ทฏๆๅๅคงๅฆ่ฏๅธ่ฅไธ้จใๅนณๅฎ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทฑๅณๅๅ ฌๅธใๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทฑๅณๅฝฉ็ฐ่ทฏ่ฏๅธ่ฅไธ้จ+็ฒ่|ๆ ้ฟ่ถๅฟ็ญ้จ่ก๏ผๆๆฟไบคๆ|ไธไบๅๆตท่ฏๅธๆ้่ดฃไปปๅ ฌๅธๆทฑๅณๅๅ ฌๅธ+็ซ ็ไธป|ๆฑๆตๅฐๅบๅ ่็บง้กถ็บงๆธธ่ตไนไธ๏ผ90ๅนดไปฃ5ไธๅ ๅ ฅๅธใ็ฐๅจ่ต้ไฝ้็พไบฟ๏ผ20ๅนด20ไธๅ๏ผๆไฝ้ธๆฐ๏ผๅฐคๅฅฝๅจๆ้ๅคง็ฅจไธไธปๅๆตชไธ้ไปๅบๅปใ|ๆตท้่ฏๅธ่กไปฝๆ้ๅ ฌๅธไธๆตทๅพๆฑๅบๅปบๅฝ่ฅฟ่ทฏ่ฏๅธ่ฅไธ้จใๆนๆญฃ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆญๅทๅปถๅฎ่ทฏ่ฏๅธ่ฅไธ้จใๅฝๆณฐๅๅฎ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅฎๆณขๅนฟ็ฆ่ก่ฏๅธ่ฅไธ้จใๅฝๆณฐๅๅฎ่ฏๅธ่กไปฝๆ้ๅ ฌๅธไธๆตทๆฑ่่ทฏ่ฏๅธ่ฅไธ้จใไธญไฟก่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆญๅทๅปถๅฎ่ทฏ่ฏๅธ่ฅไธ้จใไธญไฟก่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆญๅทๅฏๆฅ่ทฏ่ฏๅธ่ฅไธ้จ+็ซไปทๆข็ญน|้ๅไบคๆ๏ผๅฐคๅ ถๆ ้ฟๅๆญงๅๆๆฅ็ซไปทๆๅๆถ้ดๆซ่ดง๏ผๆ่ฝๅๅถ้ ๅผฑ่ฝฌๅผบๅๆถๅธๅผๅธๅบ่ต้ๆตๅ ฅ|ไธญๅฝ้ถๆฒณ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅไบฌไธญๅ ณๆๅคง่ก่ฏๅธ่ฅไธ้จ+็็ฐ่ทฏ|้กถ็บงๆ ็ปช่ต้๏ผๅฏนไปทๆไบฆๆ็ฌๅฐ็่งฃใ็็ฐ่ทฏๆธธ่ตๅบๆฌไธๅคๆฏไปฅ่ชไนฐ่ชๅ็ๅฝขๅผๅบ็ฐๅจ้พ่ๆฆไธใ|ๅ้ซ่ฏๅธๆ้่ดฃไปปๅ ฌๅธๆทฑๅณ็็ฐ่ทฏ่ฏๅธ่ฅไธ้จ+็ณๆธฏๅนฟไธๅ|ๆ ็ปชๅจๆๅ ่ก่ ,ๅฎๅๅฝชๆๆง่กๅๅกๅฟ ๅๅณ|็ณๆธฏ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅนฟไธๅๅ ฌๅธ+็้นคไป|2011ๅนดๅ ฅๅธ๏ผๅจๅฝๆถ็็ๅธไธญไพ็ถๆๅๆซ้ก๏ผๅ ฅๅธ3ๅนด่ต้ๅฐฑไปๆฐๅไธ่พพๅฐไธไบฟใไปฅ็ฝ่กฃ้ชๅฃซ่ชๅฑ ๏ผๆไฝ้ฃๆ ผ็ฌๆฅ็ฌๅพใ|่ฏ้่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅฎๆไธๅฑฑๅคง้่ฏๅธ่ฅไธ้จใไธญๅฝ้ถๆฒณ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅฎๆๆฐไธ็บช่ฏๅธ่ฅไธ้จใไธญไฟกๅปบๆ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅฎๆ่งฃๆพ่ทฏ่ฏๅธ่ฅไธ้จ+็ๅ ฐ่ทฏ|่ฟๆฅๅด่ตท็่ต้ๅธญไฝ๏ผๆฅๅๆไฝไธบไธป๏ผ้ฃๆ ผๆฟ่ฟ๏ผๆ ้ฟ้พๅคด่ก้ไป|ไธ่่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅไบฌๅๅ ฌๅธ+็ฌ่กไธๅ|็ฝๅ๏ผ็ฌ่กไธๅ๏ผๅคฉๆถฏ่ฎบๅๆๆฉๅธ้่ ๏ผๅฝฑๅไบไธๅคงๆนๅๆฅ่ ๏ผๅ ไนๆฏๆกๅฟๅๆฐ่ถ ็ญๆ็ๅฏ่่ๅธ๏ผๆๆฉๆฏๅคฉๆถฏ็ดๆญไบคๅฒๅ็ซ่ตทๆฅ็ใไนๅธฎไธปไพฟๆฏๅจ07ๅนดๅ ฅๅธ7ๅนดไนๅๆฅ่งฆๅ ถไบคๅฒๅๅ้กฟๆ๏ผๅคงๅผๅคงๅ๏ผไธๅนด่ฟไบฟ็ใ|ๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅไบฌๆๅๅ่ก่ฏๅธ่ฅไธ้จ+็ๆฃๆฑๅฝฌ|ๆฑๅฝฌๅฎ้ ๆงๅถๅนถไฝฟ็จ็่ดฆๆทโๆฑๅฝฌโโๆฑๆๅฎโๅโๆๆไธฝโ่ฏๅธ่ดฆๆท๏ผไปฅไธ็ฎ็งฐ่ดฆๆท็ป๏ผ็ฑๆฑๅฝฌๅฎ้ ๆงๅถๅนถไฝฟ็จใๅ ถไธญๆฑๆๅฎใๆๆไธฝๆฏๆฑๅฝฌ็็ถๆฏ๏ผ่ดฆๆท็ปๅ ็่ต้ไธป่ฆไธบๆฑๅฝฌๆๆใ่ดฆๆท็ปๆไฝฟ็จ็ไบคๆ็ป็ซฏๅจไธญๆณฐ่ฏๅธๅฎๆณขๆฑไธๅ่ทฏ่ฅไธ้จๅคงๆทๅฎค๏ผไธ่ดฆๆท็ปไบคๆ่ตๆๆ ธๅฏนไธ่ด๏ผๅนถ็ฑๆฑๅฝฌไบไปฅ็กฎ่ฎคใ|ไธญๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅฎๆณขๆฑไธๅ่ทฏ่ฏๅธ่ฅไธ้จ+็ๆฃๅๆฑ่ฅ|็ๆฃๅๆฑ่ฅ๏ผๅๆฌขๅทจ้ๅบๅป๏ผๅๅฐๆฟ็ฉๅพไธ้๏ผไฝไนๆไน่ง็ฝ๏ผ300104๏ผ็กฌๅฐๅฒ่็ๆถๅ๏ผๆขๅนฒๆขๅฒๆญป้ๆๅไนไธ๏ผ่ต้้ไนๅจ10ไฝไนไธ๏ผ็กฌๆดพ้ๆ๏ผๅๅ ็ไผ ๅ่ก่ทๅไนไธ7ไธชไบฟๆญปๆๆตๅฏๆง่กใ|้ฆๅ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅไบฌ้ๅๅฎซ่ฏๅธ่ฅไธ้จใๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅไบฌ้ๅๅฎซ่ฏๅธ่ฅไธ้จ+็่กๅ ปๅฎถ|็ฎๅ่ต้้ๆๅคง๏ผๅฏนๅธๅบๅไธช่ก้ฝๆๅพ็ฌๅฐ็็่งฃๅ๏ผ้้ไผๅฟ่พๅผบ๏ผๅธธๅธธๅฉ็จ้้ไฝฟไธช่กไธๅญๆถจๅ๏ผ้ๆฅ้ซไฝ้ๆญฅ็ฆปๅบใๅไบๆๆ้ขๆ้พๅคดใ|ๆตๅ่ฏๅธ่กไปฝๆ้ๅ ฌๅธ็ปๅ ด่งฃๆพๅ่ทฏ่ฏๅธ่ฅไธ้จใๅ้ซ่ฏๅธๆ้่ดฃไปปๅ ฌๅธ้ฉฌ้ๅฑฑๅๅ ฌๅธใๅ้ซ่ฏๅธๆ้่ดฃไปปๅ ฌๅธ่ฅฟๅฎๅไบ็ฏ่ฏๅธ่ฅไธ้จใๅ้ซ่ฏๅธๆ้่ดฃไปปๅ ฌๅธ็ ๆตทๆตทๆปจๅ่ทฏ่ฏๅธ่ฅไธ้จใๅ้ซ่ฏๅธๆ้่ดฃไปปๅ ฌๅธๅๆๅๅ ฌๅธใๅ้ซ่ฏๅธๆ้่ดฃไปปๅ ฌๅธๅไบฌๅ ๅ่ทฏ่ฏๅธ่ฅไธ้จใๅ้ซ่ฏๅธๆ้่ดฃไปปๅ ฌๅธไธๆตท่ๅบ่ฏๅธ่ฅไธ้จใๅ้ซ่ฏๅธๆ้่ดฃไปปๅ ฌๅธไธๆตท่ ๅฐ่ทฏ่ฏๅธ่ฅไธ้จใๅ้ซ่ฏๅธๆ้่ดฃไปปๅ ฌๅธไธๆตท็บขๅฎ็ณ่ทฏ่ฏๅธ่ฅไธ้จใๅ้ซ่ฏๅธๆ้่ดฃไปปๅ ฌๅธไธๆตทๆพๆฑ่ฏๅธ่ฅไธ้จใๅ้ซ่ฏๅธๆ้่ดฃไปปๅ ฌๅธไธๆตทๅฎๅนณๅ่ทฏ่ฏๅธ่ฅไธ้จใๅๅ่ฏๅธๆ้่ดฃไปปๅ ฌๅธไธๆตทๅคง่ฟ่ทฏ่ฏๅธ่ฅไธ้จ+็ๆฐไธๆ|ๅธๅบไธไธๅๆฌกๆฐ่ก็ๅ ไธชๆธธ่ต๏ผ่ฟๆๅไธไบๅฝฉ่ฎฏใ้้พ๏ผไป้นค่กไปฝ็ๆฅๅ๏ผไธป่ฆๆฏไธๆตท็ๅ ไธชๅธญไฝ๏ผๅๅซๆฏไธๆตทๅ ฑๅๆฐ่ทฏใไธๆตทๆญฆๅฎ่ทฏใไธๆตทๆพณ้จ่ทฏใ่ฟๅ ไธชๅธญไฝ็ปๅธธ่ๅๅบๅจ๏ผๅฉ็จ่ต้ไผๅฟๆๅๅผๆฟๆฌกๆฐ๏ผ้ฃๆ ผไนๆฏ่ถ ็ญไธบไธป๏ผไธๆฅๆธธๅฑ ๅคใ|ๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆ ้ก่งฃๆพ่ฅฟ่ทฏ่ฏๅธ่ฅไธ้จใๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธไธๆตท้ๅฎๅบๅนฟไธญ่ฅฟ่ทฏ่ฏๅธ่ฅไธ้จใๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธไธๆตทๆญฆๅฎ่ทฏ่ฏๅธ่ฅไธ้จใๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธไธๆตทๆฎ้ๅบๆฑๅฎ่ทฏ่ฏๅธ่ฅไธ้จ+ๆน้ๅคง้|ๅฆ้จไธ็บฟๆธธ่ต๏ผ็ผๅ ็ฌๅฐ๏ผๅบๆๅคงๆฐ|ๅ ดไธ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅฆ้จๆน้ๅคง้่ฏๅธ่ฅไธ้จ+ๆนๅทๅณๅจ่ทฏ|ๆนๅทๅฎๅๆธธ่ต๏ผๅ็ฅจไปฅๆฅๅๅฑ ๅค๏ผ้ฃๆ ผๅฝๆ๏ผๅฐคๅฅฝๆๆง๏ผๅธธๅธธไธๆฑๆต่ต้่ๅจๅบๆฒกใ|ๅ้ซ่ฏๅธๆ้่ดฃไปปๅ ฌๅธๆนๅทๅณๅจ่ทฏๆตๅ้่ไธญๅฟ่ฏๅธ่ฅไธ้จใๅ้ซ่ฏๅธๆ้่ดฃไปปๅ ฌๅธๆทฑๅณๅๅ ฌๅธใๅ้ซ่ฏๅธๆ้่ดฃไปปๅ ฌๅธๅไบฌๆธ ๅ้จๅคง่ก่ฏๅธ่ฅไธ้จ+ๆธฉๅทๅธฎ|2016ๅนดๆไฝๆฌกๆฐ่กไธๆๆๅ๏ผๆๆณๅฝชๆ๏ผ็ปๅธธ่ฟ็ปญๆๅ3ไธชๆถจๅๆฟใๆไฝๆๆณๅพๅพๅคๅธญไฝ่ๅๅบๅจ๏ผๅๆถ็่ธๅจๆฐๅชๆฌกๆฐ่ก๏ผๅปบไป่ฟ ้๏ผๆทฑๅบฆๆง็๏ผๅฟซ้ๅฏนๅๆๅใ|้ถๆณฐ่ฏๅธๆ้่ดฃไปปๅ ฌๅธๆตๅๅคง็บฌไบ่ทฏ่ฏๅธ่ฅไธ้จใ่ดขไฟก่ฏๅธ่กไปฝๆ้ๅ ฌๅธไธๆตทๅคง่ฟ่ทฏ่ฏๅธ่ฅไธ้จใ่ฅฟๅ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆธฉๅทๆฑคๅฎถๆกฅ่ทฏ่ฏๅธ่ฅไธ้จใ็ฌฌไธๅไธ่ฏๅธ่กไปฝๆ้ๅ ฌๅธ้ๅฒ็งฆๅฒญ่ทฏ่ฏๅธ่ฅไธ้จใ็ณไธๅฎๆบ่ฏๅธๆ้ๅ ฌๅธๆธฉๅท่ฝฆ็ซๅคง้่ฏๅธ่ฅไธ้จใ็ณไธๅฎๆบ่ฏๅธๆ้ๅ ฌๅธๆฌๅทๅๅ ฌๅธใๅนณๅฎ่ฏๅธ่กไปฝๆ้ๅ ฌๅธไธๆตทๅธธ็่ทฏ่ฏๅธ่ฅไธ้จใๅ้ซ่ฏๅธๆ้่ดฃไปปๅ ฌๅธไนๆธ ๅ้่ทฏ่ฏๅธ่ฅไธ้จใๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธ้ๅท็ปไธ่ทฏ่ฏๅธ่ฅไธ้จใ ็ณไธๅฎๆบ่ฅฟ้จ่ฏๅธ็ฆๅทๅค็ฐ่ทฏ่ฏๅธ่ฅไธ้จ+ๆทฑ่ก้ไธ็จ|ๆทฑๆธฏ้๏ผๆฏๆทฑๆธฏ่ก็ฅจๅธๅบไบคๆไบ่ไบ้ๆบๅถ็็ฎ็งฐ๏ผๆๆทฑๅณ่ฏๅธไบคๆๆๅ้ฆๆธฏ่ๅไบคๆๆๆ้ๅ ฌๅธๅปบ็ซๆๆฏ่ฟๆฅ๏ผไฝฟๅ ๅฐๅ้ฆๆธฏๆ่ต่ ๅฏไปฅ้่ฟๅฝๅฐ่ฏๅธๅ ฌๅธๆ็ป็บชๅไนฐๅ่งๅฎ่ๅดๅ ็ๅฏนๆนไบคๆๆไธๅธ็่ก็ฅจใ|ๆทฑ่ก้ไธ็จ+ๆทฑๅณๅธฎ|ๆทฑๅณ่ฅไธ้จๅTๅ็้ฃ่ตท๏ผ็ปๅธธๅฏไปฅ็่งๆทฑๅณๅธฎๅT๏ผๅๆ ทๆดป่ท่ฟๆไธๆตทๅธฎใๆญๅทๅธฎ๏ผๆๆไฝๆ ็ๅฝผๆญคไน้ด้ๅๅบฆๅพ้ซใ|่ดข้่ฏๅธ่กไปฝๆ้ๅ ฌๅธ็ปๅ ดๆฏๆกฅๅบ้ฑๆธ ้ฑ้จๅคง้่ฏๅธ่ฅไธ้จใๆๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทฑๅณๆข ๆ่ทฏ่ฏๅธ่ฅไธ้จใๆๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆญฆๆฑๆฐๅ่ทฏ่ฏๅธ่ฅไธ้จใๅ้พ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทฑๅณๆฐ็ฐ่ทฏ่ฏๅธ่ฅไธ้จใๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธ็ฆๅทไบไธๅ่ทฏ่ฏๅธ่ฅไธ้จ+ๆถช้ตๅนฟๅบ่ทฏ|่ฅฟๅๅฐๅบ๏ผๅทจๅๆๆฟๆธธ่ต๏ผ่ต้ๅฎๅ้ๅ๏ผๅบๆ้ข็ไธ้ซ๏ผไฝๅฐคๅฅฝ้ไปๅคงๆ็ฌๅบๆ๏ผ้ฃๆ ผๅฝๆ๏ผ็ปๅธธๅ็ฌ่ฟไบฟ๏ผๆพๅจ็พ้ฆ่ฝๆบใๆณฐ็ฆพ้ๅขใๅๆๆ้ไธๅคงๆ็ฌๅบๆใ|ๆนๆญฃ่ฏๅธ่กไปฝๆ้ๅ ฌๅธ้ๅบ้ๅผๅคง้่ฏๅธ่ฅไธ้จใไธญไฟกๅปบๆ่ฏๅธ่กไปฝๆ้ๅ ฌๅธ้ๅบๆถช้ต่ฏๅธ่ฅไธ้จ+ๆถ ็้ๅ|90ๅ็ฅๅ้ๆ๏ผๆพๆๅๅนด็พๅๆ็ปฉ|้ฟๅ่ฏๅธ่กไปฝๆ้ๅ ฌๅธ่ต้ณ่ไนกๅคง้่ฏๅธ่ฅไธ้จใไธๆตท่ฏๅธๆ้่ดฃไปปๅ ฌๅธ่ๅทๅคชๆน่ฅฟ่ทฏ่ฏๅธ่ฅไธ้จ+ๆตๆฑๅธฎ|ๆตๆฑๅธฎ็็น็นๆฏๅบ่ดง็ๆถๅไธๆนๅๆฌขๆๅบ้ๅธธๅค็่ชๅทฑ็ไนฐๅ๏ผๆไฝ็้ขไธไธ่ท๏ผๅ็จๅฟซ้ๆๅๆณๅฟซ้ๆ้ซ่กไปท๏ผๅธๅผๆฃๆท่ฟฝ้ซ๏ผ็จๅฏ้็ไธญๅฐๅๆ่ดง๏ผ่บฒ่ฟๆฃๆท็็ผ็๏ผไปๆตๆฑๅธฎ้่ก็็น็นๆฅ็๏ผไปไปฌๅๆฌข้ไธไบไฝไปท่ก๏ผ่ฟๆ ทไผๆ้ๅธธๅค็ไนฐๅๅ๏ผ่ฟๅบไนๆฏ้ๅธธ้ข็นๅฏ้๏ผ่ฟๆ ทๆฏๅพๅฎนๆ่บฒ่ฟๆฃๆท็็ผ็็ใ|่ฅฟ้จ่ฏๅธ่กไปฝๆ้ๅ ฌๅธ่ฅฟๅฎ้ซๆฐ่ทฏ่ฏๅธ่ฅไธ้จใ็ณไธๅฎๆบ่ฏๅธๆ้ๅ ฌๅธ็ๅฎ็ฝ้ณๅคง้่ฏๅธ่ฅไธ้จใๆตๅ่ฏๅธ่กไปฝๆ้ๅ ฌๅธ่ทฏๆกฅๆฐ็ ่ก่ฏๅธ่ฅไธ้จใๅ ดไธ่ฏๅธ่กไปฝๆ้ๅ ฌๅธ็ณ็ฎๅฎๅฒไธญ่ทฏ่ฏๅธ่ฅไธ้จใไนๅท่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅฆ้จๅๅ ฌๅธใไธ่่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅนฟๅท็ช็ฆบๆธ ๆฒณไธ่ทฏ่ฏๅธ่ฅไธ้จ+ๆตๆฒๆฒณ|ๆๅไบ็ฝ็ป่ฎบๅ๏ผๅผๅธธๆดป่ท็ๆธธ่ตๅธญไฝใไธไธ็ๆๆฟ้ๆ๏ผไธปๅไฝไฝๆฟใๅๆฌขๅ้กถๆฟใ็งๆฟ๏ผๅฟซ้ๆๅ็ๅๆถๅผบๅฟไธช่กใ|ไธญไฟก่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅไบฌ่ฟๅคง่ทฏ่ฏๅธ่ฅไธ้จ+ๆฒช่ก้ไธ็จ|ๆฒชๆธฏ้ๆฏๆไธๆตท่ฏๅธไบคๆๆๅ้ฆๆธฏ่ๅไบคๆๆๅ ่ฎธไธคๅฐๆ่ต่ ้่ฟๅฝๅฐ่ฏๅธๅ ฌๅธ๏ผๆ็ป็บชๅ๏ผไนฐๅ่งๅฎ่ๅดๅ ็ๅฏนๆนไบคๆๆไธๅธ็่ก็ฅจ๏ผๆฏๆฒชๆธฏ่ก็ฅจๅธๅบไบคๆไบ่ไบ้ๆบๅถใ|ๆฒช่ก้ไธ็จ+ๆฏ่ๆฟ|ๆ้ฝๆฏ่ๆฟ๏ผ็ฐๆนๅๅกๅๆฏ๏ผๅฏนๅผบๅบๆฌ้ขไธช่กๆ่ชๅทฑ็ฌๅฐ็็่งฃ๏ผๆดๆฉไนๅๆฏ่ๆฟๆฏ้ ๅฆๅคงๅธ้็ฐ่ทฏ๏ผๅ้ข่ฝฌๅ่ถๅฟๆๆณๆทกๅบ็ญ็บฟๅธๅบ|็ณไธๅฎๆบ่ฏๅธๆ้ๅ ฌๅธๆทฑๅณ้็ฐ่ทฏ่ฏๅธ่ฅไธ้จใๅนฟๅ่ฏๅธ่กไปฝๆ้ๅ ฌๅธไธๆตทไธๆน่ทฏ่ฏๅธ่ฅไธ้จใๅฝๆณฐๅๅฎ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅไบฌๅ ๅ่ทฏ่ฏๅธ่ฅไธ้จใไธๅ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆ้ฝ้็่ก่ฏๅธ่ฅไธ้จ+ๆญ็ฅ|ๅๆถ็็ๅ๏ผๆ ็ปช้ขๆๆง็ๅพๅฐไฝใ|ๅ ดไธ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆญๅทไฝ่ฒๅบ่ทฏ่ฏๅธ่ฅไธ้จใไธญๅฝไธญ้่ดขๅฏ่ฏๅธๆ้ๅ ฌๅธๆญๅทๆฑๆฒณๆฑ่ฏๅธ่ฅไธ้จใไธญไฟก่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆญๅท้ๅ่ทฏ่ฏๅธ่ฅไธ้จ+ๆฌขไนๆตทๅฒธ|ๆๅฐๆถๅ้ฆๆฟ๏ผไธ่ฌ้ฝๆฏ้ซไฝๆฟ๏ผ็ปๅธธๅคๅธญไฝ่ๅจ๏ผๅคงๆ็ฌๅฐๅ๏ผๆป้ข็ปๅธธไธไบฟ๏ผไปๅ ฅๅ็ปๅธธ้ไป๏ผไนไธ่ฝปๆ็ ธ็๏ผๅพๅพ็ฆปๅบไนๅๅฐพ็ไนไผๆๅ่ฟ่กๅๅใ|็ฌฌไธๅไธ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทฑๅณ็ฆๅไธ่ทฏๆป้จ่ฏๅธ่ฅไธ้จใๆๅ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทฑๅณๆทฑๅๅคง้่ฝฆๅ ฌๅบ่ฏๅธ่ฅไธ้จใๅนฟๅ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทฑๅณ็ฆๅไธ่ทฏ่ฏๅธ่ฅไธ้จใๅนณๅฎ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทฑๅณ้็ฐ่ทฏ่ฏๅธ่ฅไธ้จใๅฝ้่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทฑๅณๆนพไธๅท่ฏๅธ่ฅไธ้จใๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทฑๅณ็ง่ๅ่ทฏๅๆถฆๅคงๅฆ่ฏๅธ่ฅไธ้จใๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทฑๅณๆทฑๅๅคง้ๅบ้ๅคงๅฆ่ฏๅธ่ฅไธ้จใๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทฑๅณๅๅ ฌๅธใไธญๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทฑๅณ็ง่ๅ่ทฏ่ฏๅธ่ฅไธ้จใไธญๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทฑๅณๅฎๆบๅ่ทฏ่ฏๅธ่ฅไธ้จใไธญๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทฑๅณๅๅ ฌๅธใไธญๅฝไธญ้่ดขๅฏ่ฏๅธๆ้ๅ ฌๅธๆทฑๅณๅฎๅฎๅ ดๅ่ทฏ่ฏๅธ่ฅไธ้จใไธญๅฝไธญ้่ดขๅฏ่ฏๅธๆ้ๅ ฌๅธไบๆตฎๆฐๅ ดไธๅ คๅ่ทฏ่ฏๅธ่ฅไธ้จใไธญไฟก่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทฑๅณ็งๆๅญ่ฏๅธ่ฅไธ้จใไธญไฟก่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทฑๅณๅๆตท่ฏๅธ่ฅไธ้จใไธญไฟก่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทฑๅณๅๅ ฌๅธ+ๆญๅทๅธฎ|ๆญๅท็ณป็ญ็บฟๆธธ่ต๏ผ่ต้้่พๅคง๏ผๅๆฌขๅจ็จๅคไธช่ฅไธ้จๅๆถๆไฝไธ่ก๏ผๆณขๆฎตๆไฝ๏ผๆดไฝๆๅ็่พ้ซใๅๅฅฝไธๅธ3ๅนดไปฅไธ็่่ก็ฅจ๏ผ่งๆจกไธ๏ผๅคง็่กไธๅฐ็่ก้ฝๆฏไป็ๆ็ฑ๏ผๆดไฝๅๅธ่พไธบๅนณๅใ|ๆตๅ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆญๅท่งๅฑฑๆฐธไน ่ทฏ่ฏๅธ่ฅไธ้จใๅ ๅคง่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆญๅทๅปถๅฎ่ทฏ่ฏๅธ่ฅไธ้จใไธญๅฝ้ถๆฒณ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆญๅทๆฏ่ณ่ฏๅธ่ฅไธ้จใไธญๅฝ้ถๆฒณ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆญๅทๅคฉๅไธ่ทฏ่ฏๅธ่ฅไธ้จใไธญๅฝ้ถๆฒณ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆญๅทๅค่ตท่ทฏ่ฏๅธ่ฅไธ้จใไธญไฟก่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆญๅทๅบๆฅ่ทฏ่ฏๅธ่ฅไธ้จใไธญไฟกๅปบๆ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆญๅทๅบๆฅ่ทฏ่ฏๅธ่ฅไธ้จ+ๆบๆไธ็จ|ๆฐไบคๆ่งๅ่งๅฎ๏ผๆบๆๅธญไฝๆฏๆๅบ้ไธ็จๅธญไฝใๅธๅ่ช่ฅไธ็จๅธญไฝใ็คพไฟไธ็จๅธญไฝใๅธๅ็่ดขไธ็จๅธญไฝใไฟ้ฉๆบๆไธ็จๅธญไฝใไฟ้ฉๆบๆ็ง็จๅธญไฝใQFIIไธ็จๅธญไฝ็ญๆบๆๆ่ต่ ไนฐๅ่ฏๅธ็ไธ็จ้้ๅๅธญไฝใ|ๆบๆไธ็จ5ใๆบๆไธ็จ4ใๆบๆไธ็จ3ใๆบๆไธ็จ2ใๆบๆไธ็จ1ใๆบๆไธ็จ+ๆนๆฐไพ |ไธ่ตต่ๅฅๅๆ็้กถ็บงๆธธ่ต๏ผๆไฝๆๆณๅคงๅผๅคงๅ๏ผๆ ้ฟๅคงๆไบค่ถๅฟ่กใ2020ๅนดไธปๅฏผไบ็ๅนฟ้ๅขๅคงไบๆณขใๆชๅๅป่ฏ็ญ็ฅจใ|ๅ ดไธ่ฏๅธ่กไปฝๆ้ๅ ฌๅธ้่ฅฟๅๅ ฌๅธใไธญไฟก่ฏๅธ่กไปฝๆ้ๅ ฌๅธ่ฅฟๅฎๆฑ้ๅคง่ก่ฏๅธ่ฅไธ้จ+ๆฐ็ไปฃ|ๆฐๆๅธๅบไธปๅ๏ผๆ ้ฟไฝไฝ้ขๆๆๆๆฝไผๅๆ้ ๆฟๅ่กฅๆถจ๏ผ้ๅธธๅๆฌขๆๅๅไผๅบไปใ|้ถๆณฐ่ฏๅธๆ้่ดฃไปปๅ ฌๅธๆ้ฝ้กบๅๅคง่ก่ฏๅธ่ฅไธ้จใๅฎไฟก่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅนฟๅท็ๅพทๅคง้่ฏๅธ่ฅไธ้จใๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธไธๆตท็กไธนๆฑ่ทฏ่ฏๅธ่ฅไธ้จใไธญๅฝ้ถๆฒณ่ฏๅธ่กไปฝๆ้ๅ ฌๅธไธๆตทๆฐ้ธ่ทฏ่ฏๅธ่ฅไธ้จใไธญไฟก่ฏๅธ(ๅฑฑไธ)ๆ้่ดฃไปปๅ ฌๅธ่ฑๅทๆๅไธ่ทฏ่ฏๅธ่ฅไธ้จ+ๆขๆญป้|ๅฎๆณขๆขๆญป้ไธป่ฆ็ฑ4ๅทไบบ็ฉ็ปๆ,ๅๅนถ็งฐไธบโ่ถ ็ญF4โใ1ๅทไบบ็ฉๅซๅพ็ฟ,ๆฏๆขๆญป้ไธญๅนด็บชๆ่ฝป็ไธไฝใ2ๅทไบบ็ฉๅงๅด,ๅคง็บฆ35ๅฒใไธคไบบๅคง็บฆๅจ1999ๅนดไปๅ ถไป่ฅไธ้จ่ฝฌๅฐ้ถๆฒณ่ฏๅธๅฎๆณข่งฃๆพๅ่ทฏ่ฅไธ้จ,ๅฝๆถ่ต้ไธ่ฟๅ ๅไธๅ ,4ๅนดๅ,ไธคไบบ่ดฆๆทไธ็้ฑ้ฝๅๆไบๆฐๅไธๅ ใ3ๅทไบบ็ฉๅพๆตท้ธฅ,1975ๅนดๅบ็,ไธๅคงๅญฆๆถๅฐฑๅผๅง็่ก,1997ๅนดๆฏไธไบๅไบฌๅๅญฆ้ขๅๆฒกๆพๅทฅไฝ,ๅฐฑ็ดๆฅๅๅฎๆณขไธ่็่กใ่้ฉฌไฟก็ชๅจ่ฟไธไฝไนๅ,2002ๅนด5ๆ,่ขซไธด่ฟ็ๅคฉไธ่ฏๅธ(็ฐไธบๅ ๅคง่ฏๅธ)่งฃๆพๅ่ทฏ่ฅไธ้จๆ่ตฐ,ๆฐไฝๅคงๆทไบฆ่ฟฝ้่ๅปใ4ไบบๅนถ็งฐโ่ถ ็ญF4โใๆขๆญป้ไปฅๅๅบๅฎถไธบ็,|ๅนณๅฎ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทฑๅณๆทฑๅไธ่ทฏ็ฝๆนๅๅกไธญๅฟ่ฏๅธ่ฅไธ้จใไธญๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธไธๆตทๅปบๅฝไธญ่ทฏ่ฏๅธ่ฅไธ้จ+ๆฌๆฟ็|้ฃๆ ผไธๅๆฌขๆฌ่ทๅๆฟ๏ผๅฐคๅ ถๆฏ่ฟ็ปญ่ทๅ็ไธช่ก๏ผไบบ็งฐๆฌๆฟ็|ๅ ดไธ่ฏๅธ่กไปฝๆ้ๅ ฌๅธ่ๅทๅๅ ฌๅธใๅ ดไธ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทฑๅณๅๅ ฌๅธ+ๆๅๆทฑๅไธ|ไฝไธบๅฝๅ A่กๅธๅบๆธธ่ตไธปๅ๏ผๆๅ่ฏๅธๆทฑๅไธ่ทฏๆๆณ็ธๅฏนๆธฉๅ๏ผๅจ้่กๆน้ขๅนถไธ็ญ่กทไบๆฌกๆฐ่ก๏ผ่ท่ธชไธๅธๆถ้ดไธๅนดไปฅไธไธช่ก่พๅค๏ผ้ๆฉ็ญ็นๆฟๅๅ ถไธญ็ไบบๆฐไธช่ก๏ผไฝๅคงๅคไธบไธๆถจ่กๆ ่ฟๆฒกๆๅฏๅจ๏ผๆ่ ๅทฒ่ฟๅ ฅ่ฐๆดๆ็ไธช่ก๏ผๅ ถๆไฝๅฅ่ทฏ่ฟๆฏ้ไธญไผๅฟ่ต้่ถๅฟๅ ้๏ผๅธๅผ่ท็่ต้ๆฅ็ๅบ่ดงใ|ๆๅ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทฑๅณๆทฑๅไธ่ทฏ่ฏๅธ่ฅไธ้จ+ๆ้ฝ็ณป|่ถ ็ญๆธธ่ต๏ผๅ ทๅค็ญๆถ้ดๅ ๅผๅฏผไธช่กไปทๆ ผ็่ฝๅ๏ผ้ฃๆ ผ็จณๅฎ๏ผไปฅ่ถ ่ทๆฟไธบไธป๏ผ็ไธญ้ฝๆฏ็ด็บฟๆๅๆถจๅ๏ผๅผๅฏผ่ต้ๅๅๅฐๆฟใๆ ้ฟๅ้ฆๆฟไธช่กๅนถไธ็ไธญๅๆฌข็ด็บฟๆๅ๏ผๆฌกๆฅๅฒ้ซๅ็ฑ็ ธ็๏ผๅ็ฑไธญๅฐ็ไธช่กใ|ๅฎไฟก่ฏๅธๆ้่ดฃไปปๅ ฌๅธๆ้ฝ็ดซ็ซนๅ่ก่ฏๅธ่ฅไธ้จใๅฝ่่ฏๅธ่กไปฝๆ้ๅ ฌๅธ้ๅฒๅๅ ฌๅธใๅฝ่่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆ้ฝ้ฆๅๅคง้่ฏๅธ่ฅไธ้จใๅฝๆณฐๅๅฎ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆ้ฝๅคฉๅบไบ่ก่ฏๅธ่ฅไธ้จใๅฝๆณฐๅๅฎ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆ้ฝๅไธ็ฏ่ทฏ่ฏๅธ่ฅไธ้จใๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆ้ฝๅคฉๅบๅนฟๅบ่ฏๅธ่ฅไธ้จใๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅพท้ณ้ฟๆฑ่ฅฟ่ทฏ้ป็ณๅนฟๅบ่ฏๅธ่ฅไธ้จใไธญๅฝ้ถๆฒณ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆ้ฝ็งๅๅ่ทฏ่ฏๅธ่ฅไธ้จใไธญไฟกๅปบๆ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆ้ฝ้ฉฌๅฎถ่ฑๅญ่ฏๅธ่ฅไธ้จ+ๆๆณ็ณป|ๅๅ็บฟๅคๅคดๅๆฃๅไธ็ไธช่กๅนถๆฏๆๅๅปบไป๏ผๆถจๅๆฟๅพๅพไธๅฐๆญป๏ผๅๅคๆๅผๅนถๅๅบฆๅฐๆฟ๏ผๆฌกๆฅ็ปง็ปญๆถจๅๆฆ็่พไฝใ|ๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅไบฌ่ฅฟไธ็ฏๅฝ้ ่ดข็ปไธญๅฟ่ฏๅธ่ฅไธ้จใไธญๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅไบฌ่ช่ดธ่ฏ้ชๅบ่ฏๅธ่ฅไธ้จใไธญๅฝๅฝ้ ้่่กไปฝๆ้ๅ ฌๅธๅไบฌๅปบๅฝ้จๅคๅคง่ก่ฏๅธ่ฅไธ้จใไธญไฟก่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅไบฌ้่ๅคง่ก่ฏๅธ่ฅไธ้จ+ๆๆๅ่ทฏ|2022ๅนด90ๅๆธธ่ต๏ผ้ฃๆ ผๅคๅไฝ้่กๆฐดๅนณๆ้ซ๏ผๅไธ็ไธช่กๅคงๅคๆๅบๆฌ้ขๆฏๆใ|ไธ่่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆนๅๅๅ ฌๅธใไธไบๅๆตท่ฏๅธๆ้่ดฃไปปๅ ฌๅธไธๆตทๅๅ ฌๅธ+ๅพ็่|่ๅ็ๆฃใ้กถ็บงๆธธ่ตๅพ็่๏ผๆพ่ขซ่ฏ็ไผๅค็ฝ็ฝๆฒก1.1ไบฟใ้ๅธธๅๅฅฝๅคงๆ็ฌๅบๆๅๆณขๆฎต้ไป|ๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทฑๅณ็็ฐ่ทฏ่ฃ่ถ ๅๅกไธญๅฟ่ฏๅธ่ฅไธ้จ+ๅพๆ|ๅคงๆ็ฌใไฝ้ข็ใ่ต้ๅฎๅ้ๅใๅบๆ่็ๆ้ซ๏ผๆไธปๅฏผ็ญ็นๆฟๅ้พๅคด่ก่ถๅฟ่กๆ ็่ฝๅ|ๅฝๅ ่ฏๅธ่กไปฝๆ้ๅ ฌๅธไธๆตท่นๆกฅ่ทฏ่ฏๅธ่ฅไธ้จ+ๅนฟไธๅธฎ|ๆไฝๆๆณไธไน ๆฏ็จโๅคง้ณ็บฟโโ่ฐๆดๆฐๆฅโโๅคง้ณ็บฟโๅๅคๆๅ|่ดข้่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆธฉๅฒญไธญๅ่ทฏ่ฏๅธ่ฅไธ้จใ็ณไธๅฎๆบ่ฏๅธๆ้ๅ ฌๅธๆญๅทๅฏๆธกๆกฅ่ทฏ่ฏๅธ่ฅไธ้จใ็ณไธๅฎๆบ่ฏๅธๆ้ๅ ฌๅธไธๆตท้ปๆตฆๅบไธญๅ่ทฏ่ฏๅธ่ฅไธ้จใๅพท้ฆ่ฏๅธ่กไปฝๆ้ๅ ฌๅธไธๆตทๅฒณๅท่ทฏ่ฏๅธ่ฅไธ้จใๅ็ฆ่ฏๅธๆ้่ดฃไปปๅ ฌๅธๅฆ้จๆนๆปจๅ่ทฏ่ฏๅธ่ฅไธ้จใไธๆน่ฏๅธ่กไปฝๆ้ๅ ฌๅธไธๆตท้ปๆตฆๅบไธญๅ่ทฏ่ฏๅธ่ฅไธ้จ+ๅฑฑไธๅธฎ|ๅ ไธบๅฝๆถๅฑฑไธๅธญไฝไธบๆ่ฐ๏ผๆ ่ขซ็งฐไธบโๅฑฑไธๅธฎโ๏ผๆฌกๆฐ่กๆๆณ,ๅพๅพๆฏๅคๅธญไฝ่ๅ่กๅจ,ๅๆถ็่ธๅจๆฐๅชๆฌกๆฐ่กไธ้ข,ๅปบไป่ฟ ้,ๆทฑๅบฆๆง็,ๅฟซ้ๅฏนๅๆๅใ|ๆนๆญฃ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆธฉๅทๅฐๅ่ทฏ่ฏๅธ่ฅไธ้จใๅนฟๅ่ฏๅธ่กไปฝๆ้ๅ ฌๅธ่ฃๆ็ณๅฒ่ฏๅธ่ฅไธ้จใๅฝๆตท่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆตๅฎ้นๅๅธๅคชๅนณไธ่ทฏ่ฏๅธ่ฅไธ้จใๅฝๆตท่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆตๅๅๅฑฑ่ทฏ่ฏๅธ่ฅไธ้จใๅฝๆตท่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆณฐๅฎๆ้ผ็ณๅคง่ก่ฏๅธ่ฅไธ้จใๅฝๆตท่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅฑฑไธๅๅ ฌๅธใๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅฆ้จๅฆ็ฆพ่ทฏ่ฏๅธ่ฅไธ้จใไธญๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธ่ฃๆ็ณๅฒ้ปๆตทไธญ่ทฏ่ฏๅธ่ฅไธ้จใไธญไฟก่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅฆ้จๅๅ ฌๅธใไธญไฟก่ฏๅธ(ๅฑฑไธ)ๆ้่ดฃไปปๅ ฌๅธ่ฃๆๆๅฑฑๅคง้่ฏๅธ่ฅไธ้จใไธๆตท่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅฆ้จ็ฅฅ็ฆ่ทฏ่ฏๅธ่ฅไธ้จใไธๆน่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅฆ้จไปๅฒณ่ทฏ่ฏๅธ่ฅไธ้จ+ๅฑ ๆๆ|ๅฑ ๆๆๆฏๅฑๅค้ฃไบ็่็ๆธธ่ต๏ผๅๅฅฝๅคงๆต้็ๆฟๅไธญๅ๏ผๅฏ่งๅฏๅ ถๅบๆๆฅๅคๆญๆฟๅๅฐไฝใ|ไธญๅฝ้ถๆฒณ่ฏๅธ่กไปฝๆ้ๅ ฌๅธไธๆตทๆจๆตฆๅบ้ๅฎไธ่ทฏ่ฏๅธ่ฅไธ้จ+ๅฐ้ณ้ฑผ|ๆฐ็ไปฃ90ๅๆธธ่ต๏ผๅธธๅธธๆดป่ทๅจๅๅคง่ฎบๅ็คพๅบ๏ผๆๆณๅฝๆ๏ผ่ต้ไฝ้่ฟไบฟใๅจ่ถๅฟๆง่กๆ ไธไน่ฝไธๆถไฟฑ่ฟ๏ผๅฏนๅบๆฌ้ข็็่งฃ้ๅธธไธ้๏ผ่็่พ้ซใ|้ฟๆฑ่ฏๅธ่กไปฝๆ้ๅ ฌๅธไธๆตทไธ็บชๅคง้่ฏๅธ่ฅไธ้จใๅไบฌ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅไบฌๅคง้ไบญ่ฏๅธ่ฅไธ้จใไธญๅฝไธญ้่ดขๅฏ่ฏๅธๆ้ๅ ฌๅธๅไบฌ้พ่ ไธญ่ทฏ่ฏๅธ่ฅไธ้จใไธๆน่ฏๅธ่กไปฝๆ้ๅ ฌๅธไธๆตทๆตฆไธๆฐๅบๆบๆทฑ่ทฏ่ฏๅธ่ฅไธ้จ+ๅฐๆฃ่ข|ไปทๅผๆๆบๅ้กถ็บง้ๆ๏ผไป้ ็ตๆฑ ๅฐไบบๅทฅๆบ่ฝใ้ป่พ็่กไธไธชไธ่ฝ|ไธๆตท่ฏๅธๆ้่ดฃไปปๅ ฌๅธไธๆตทๅๅ ฌๅธ+ๅฎๆณข่งฃๆพๅ|่็ๆธธ่ตๅธญไฝ๏ผๆฑๆตๅฎๆณขๆขๆญป้่ต้๏ผๅๅฅฝไธๆๅๅบๅ่ๆๆๆฟ๏ผๅฒๅปๅถ้ ๆถจๅ็่ก็ฅจ๏ผไนฐๅๅธๅบๆดป่ทๆ ็ปชๆ |ๅ ๅคง่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅฎๆณข่งฃๆพๅ่ทฏ่ฏๅธ่ฅไธ้จ+ๅฎๆณขๆก็ฐ่ทฏ|ๅฎๆณข็ฅๅ็ๆธธ่ต๏ผ่ต้้่ถ ่ฟ10ไบฟ๏ผๆไฝ้ฃๆ ผๅฝชๆๅๅ๏ผๆฏไผๅค็ฅๅๆธธ่ต้้ขๆบขไปทๆฏ่พ้ซ็ๅธญไฝ๏ผไบคๆ้ฃๆ ผๅคไธบๆๆฟไธบไธป๏ผไธๆๆณฅไบๆฏ้ซไฝๆฟ๏ผ่ฟๆฏไฝไฝๆฟ๏ผๅฏไปฅ้ไปๅTๅพไน ๏ผไนๅฏไปฅ่ท็้ฃๅฟซ|ๅฝ็่ฏๅธๆ้่ดฃไปปๅ ฌๅธๅฎๆณขๆก็ฐ่ทฏ่ฏๅธ่ฅไธ้จ+ๅฎๆณขๅๆบ่ทฏ|ๆไผๆๆญ็็ญ็บฟ้ๆ๏ผ้ซไฝๆฅๅๆขไบ้ไป๏ผๅฏนๆฅๅ ๆ ็ปช่็นๆๆทฑๅป่ฎค่ฏ๏ผไธๆฆไธช่ก้ขๆ่ตฐๅผฑๅบ่ดงไนๆฏๆฏซไธๆๆณฅๅธฆๆฐดใๆญคๅๅธธ็จ่ฏฅๅธญไฝ็็ญ็บฟ่ต้ๅทฒ็บท็บท้ๅบ๏ผไฝไปๆๅคง้้้่ต้ๅจไฝฟ็จๆๅ ณๅธญไฝ๏ผไธป่ฆ็จไบๆไธๅญๆฟใ|็ฌๅ ด่ฏๅธๆ้ๅ ฌๅธๅฎๆณขๅๆบ่ทฏ่ฏๅธ่ฅไธ้จ+ๅขๅคๆบๆ|ๅขๅคๆบๆๆฏๆๅขๅคๅฎๆนใ้ๅฎๆน้่ๆบๆใ้่็ป็ปไปฅๅๆ่ตๅบ้๏ผๅ ถ้่ฟQFIIๅRQFII่ทๅๆ่ตๆๆธฏ่ก้็ญ้้ๆ่ตA่กๅธๅบใๅ ถ่ต้ไฝ้ๅคง่ๆ ้ฟไธญ้ฟ็บฟๆ่ต๏ผ็ฑๅฅฝๆ ธๅฟ่ตไบงๆ่ตใ|็้ถ่ฏๅธๆ้่ดฃไปปๅ ฌๅธไธๆตท่ฑๅญ็ณๆกฅ่ทฏ่ฏๅธ่ฅไธ้จใๆตท้่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅฝ้ ้จใๅฝๆณฐๅๅฎ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆป้จใๅไบฌ้ซๅ่ฏๅธๆ้่ดฃไปปๅ ฌๅธๅไบฌ้่ๅคง่ก่ฏๅธ่ฅไธ้จ+ๅๅนณ่ทฏ|ๅๆฌข้ไปๅบๅปๅฆ่กใ้พๅคด่ก๏ผไธๅๆฌขๆณขๆฎตๆไฝ๏ผๆ ้ฟ่ถๅฟไบคๆ๏ผๆๆฟ๏ผๅ่ทฏ๏ผไฝๅธ|ไธๅ ด่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆๆฑๅๅนณ่ทฏ่ฏๅธ่ฅไธ้จ+ๅถๅบๅ|ๅถๅบๅๅธญไฝ๏ผ่ฟไธชๅธญไฝๅ็่ก็ฅจๅคง้ฝๆฏ็ญ้จ้ฃๅฃ่กใ|ไธญๅฝ้ถๆฒณ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅฎๆณขๅคง้ธๅ่ทฏ่ฏๅธ่ฅไธ้จ+ๅคๅ่ทฏ|้กถ็บงๆธธ่ต๏ผ2016ๅนด11ๆไปฝๅ่ฟ้ป้ปๆ ้ป๏ผ้ๅๅดๅผๅ็ช่ตท๏ผๆไธบ้พ่ๆฆๅธธๅฎข๏ผๅจๅนดๅ็้ๅฎๆฟๅ็ไฝไธญไธๆๆๅ๏ผๆ ้ฟๅถ้ ๆฟๅ่กๆ ๏ผๅๅ ถไปไธ็บฟๆธธ่ต่ๅจ๏ผๆขไบ้ไป๏ผ้่่บซๅ็ๆธธ่ตๅคงไฝฌ๏ผๅญๆฐ็ถๅญใ่ตต่ๅฅๅ่บซๅธญไฝ่ฏธๅคไผ ่จ๏ผๆฑๆนๅคๆฃๆตใ|ไธญไฟก่ฏๅธ่กไปฝๆ้ๅ ฌๅธไธๆตท็บขๅฎ็ณ่ทฏ่ฏๅธ่ฅไธ้จใไธญไฟก่ฏๅธ่กไปฝๆ้ๅ ฌๅธไธๆตท็กไธนๆฑ่ทฏ่ฏๅธ่ฅไธ้จใไธญไฟก่ฏๅธ่กไปฝๆ้ๅ ฌๅธไธๆตทๅฏๆปจ่ทฏ่ฏๅธ่ฅไธ้จ+ๅ้ซๅฎๆณขๅ|1ใ็กฎๅฎไธป็บฟ็ญ็น้ขๆ๏ผ้ๆฉๅผบๅฟไธช่กไฝๅธใ2ใ็กฎๅฎ้ขๆ้พๅคด๏ผไผ่ฟ่กๆๆฟ๏ผไบซๅ้พๅคดๆบขไปทใ3ใ้ๅฎๅธๅบไธป็บฟ็ญ็น๏ผๆขไบๆ็ปญ้ไป็ญๅพ ๅ ถๅ้ ตๆๆฌใ4ใๅฉ็จไบคๆ้้ไผๅฟ๏ผไธๅญๆๆฟไธๅธๆฐ่ก็ไฝไธๅฉๅฅฝๅค็ไธช่กใๆขไบไธปๅจๅผๅฏผๅธๅบ๏ผ่ต้ๆ ผๅฑ่พๅคง|ๅ้ซ่ฏๅธๆ้่ดฃไปปๅ ฌๅธๅฎๆณขๅๅ ฌๅธ+ๅไบฌ็ๅฎถ|ๅไบฌ็ๅฎถ๏ผ็ฝไผ ๆฏๅๅญ่่ทณๅจๅๅทฅ๏ผๆ ้ฟ่ชๅชไฝ่ฟ่ฅ๏ผๅฌๅฃฐ้ณๅนด้พๅบ่ฏฅๆฏ80ๅไน้ด|้ฟๅ่ฏๅธ่กไปฝๆ้ๅ ฌๅธ็ปต้ณ้ฃไบๅคง้่ฏๅธ่ฅไธ้จ+ๅไบฌๅธฎ|ๆๅคงๆ ผๅฑ็ๆธธ่ต๏ผ่ต้้ๅใ|ๆตท้่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅไบฌ็ฅๆฅ่ทฏ่ฅไธ้จใๆๅ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅไบฌ่ฝฆๅ ฌๅบ่ฅฟ่ทฏ่ฏๅธ่ฅไธ้จใๅนฟๅ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆฝฎๅทๆฝฎๆซ่ทฏ่ฏๅธ่ฅไธ้จใไธญๅฝ้ถๆฒณ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅไบฌๆ้ณ้จๅๅคง่ก่ฏๅธ่ฅไธ้จใไธๅ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆ้ฝ่ๆฑ่ทฏ่ฏๅธ่ฅไธ้จ+ๅๅคซ|ไปๅธๅบๆๆดไฝๅฐๆ ็ปชๆดไฝใๆฟๅๆดไฝใไธช่กไธชๆงใ้ซไฝไฝ็ฝฎ๏ผไธปๅๅธๅบ้พๅคด|ๆตท้่ฏๅธ่กไปฝๆ้ๅ ฌๅธ็ปๅ ดๅณๅจ่ทฏ่ฏๅธ่ฅไธ้จ+ไฝๆๆฐไธ|ๆฐ็ไปฃๅฐๆธธ่ต๏ผ่ต้ไฝ้็ธๅฏน่พๅฐ๏ผไฝๅธธๅธธๆดป่ทๅจๅๅคง็คพไบค่ฎบๅ๏ผ็ฅๅๅบฆ็ธๅฏน่พ้ซใ|ๅฝๆณฐๅๅฎ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅไบฌๅคชๅนณๅ่ทฏ่ฏๅธ่ฅไธ้จใไธญๅฝไธญ้่ดขๅฏ่ฏๅธๆ้ๅ ฌๅธๅไบฌไธญๅคฎ่ทฏ่ฏๅธ่ฅไธ้จ+ไฝๅฑฑ็ณป|่ฝๅคๅจ็ญๆถ้ดๅ ไธปๅฏผไธช่ก่ตฐๅฟ๏ผ้ฃๆ ผ่ถ ็ญ๏ผๅ ่งๆๆใๆ ้ฟ็ญ็บฟ๏ผๆฉ็ๅฟซ้ๆๆฟ๏ผๅถ้ ๆฅๅ ้พๅคด๏ผไธๆ น็บฟๆๆฟ๏ผไปๅฐ่ต้ๅ่ตท็ๅ ธ่ใๆ ้ฟๅไธๆฟไธช่ก๏ผๅพๅพไปฅไธๆฅๆธธไธบไธป๏ผๆฌกๆฅๅฒ้ซๅฟซ้่ทๅฉๅบๅฑ๏ผ|้ฟๆฑ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆญฆๆฑๆญฆ็่ทฏ่ฏๅธ่ฅไธ้จใ้ฟๆฑ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆ ๅท้ๅฑฑๆน่ฏๅธ่ฅไธ้จใ้ฟๆฑ่ฏๅธ่กไปฝๆ้ๅ ฌๅธไฝๅฑฑๆฎๆพไบ่ทฏ่ฏๅธ่ฅไธ้จใ่ฏ้่ฏๅธ่กไปฝๆ้ๅ ฌๅธไฝๅฑฑๅๆตทๅคง้่ฏๅธ่ฅไธ้จใๆน่ดข่ฏๅธ่กไปฝๆ้ๅ ฌๅธไฝๅฑฑๆ่พฐ่ทฏ่ฏๅธ่ฅไธ้จใๆตท้่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅนฟๅท็ ๆฑ่ฅฟ่ทฏ่ฏๅธ่ฅไธ้จใๆนๆญฃ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅไบฌๅฎๅฎ้จๅคๅคง่ก่ฏๅธ่ฅไธ้จใๅฝ็่ฏๅธๆ้่ดฃไปปๅ ฌๅธๅ่ฅ็ฟ ๅพฎ่ทฏ่ฏๅธ่ฅไธ้จใๅฝๆณฐๅๅฎ่ฏๅธ่กไปฝๆ้ๅ ฌๅธ้กบๅพทๅคง่ฏ่ฏๅธ่ฅไธ้จใๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅนฟๅทๅ ดๆฐ่ทฏ่ฏๅธ่ฅไธ้จใๅ ๅคง่ฏๅธ่กไปฝๆ้ๅ ฌๅธไฝๅฑฑ็ปฟๆฏ่ทฏ่ฏๅธ่ฅไธ้จใๅ ๅคง่ฏๅธ่กไปฝๆ้ๅ ฌๅธไฝๅฑฑๅญฃๅๅ ญ่ทฏ่ฏๅธ่ฅไธ้จใไธ่่ฏๅธ่กไปฝๆ้ๅ ฌๅธไธ่ๆจชๆฒฅไธญๅฑฑไธ่ทฏ่ฏๅธ่ฅไธ้จใ ้ฟๆฑ่ฏๅธ่กไปฝๆ้ๅ ฌๅธไฝๅฑฑๅๆตทๅคง้่ฏๅธ่ฅไธ้จ+ไฝๅฅ|2022ๅนดๆฐๆๆธธ่ต๏ผ95ๅ๏ผ่ต้ๅข้ฟ้ๅบฆไนๅฟซไปคไบบๅ่๏ผๆ ้ฟๆบๆๆธธ่ตๅๅๅคงๅฆ่ก๏ผๅธๅบ็่งฃๅ้กถ็บงใ|็ณๆธฏ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆตๆฑๅๅ ฌๅธใ็ฌๅ ด่ฏๅธๆ้ๅ ฌๅธ้ๅฒๅๅฎ่ทฏ่ฏๅธ่ฅไธ้จ+ไบคๆ็ฟ|ๆไฝๆๆณ๏ผๅคงๅค้ฝๆฏๆปกไป่ต้ๆขญๅไธๅช่ก็ฅจ๏ผไธ่ฟๅช่ก็ฅจๅๆๅทฒ็ปๆๅทจๅคงๆถจๅน ๏ผๆต้็ใๆไบค้ๅทจๅคง็ๅคง็ฅจ๏ผๅๅคง็ฅจ็ๅ่ทฏไธปๅๆตชใ\r\n\r\n|ๅๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅคฉๆดฅไธไธฝๅผๅๅบไบ็บฌ่ทฏ่ฏๅธ่ฅไธ้จ+ไนๅธฎไธป|ไธ็บฟๆธธ่ต๏ผ่ต้้ไธไบฟ๏ผ้ฃๆ ผๅถๆ๏ผ็บชๅพไธฅๆ ผ๏ผไฝๅธ้ ๅๆๆฟใ|ๆๅ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆทฑๅณ่ๅฃๅทฅไธไธ่ทฏ่ฏๅธ่ฅไธ้จ+ไธญไฟกๆป้จ|ไธญไฟก่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆป้จ(้่ฅไธๅบๆ)|ไธญไฟก่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆป้จ(้่ฅไธๅบๆ)+ไธๆตท่ถ ็ญๅธฎ|ไปฅ็ญ็บฟ้ๅบฆๅปบไปๅธๅ,ๆ่กๅจๆๅจ3-5ๆฅๅ ,็ปๅธธๅๅๆบๆไธ็จๅธญไฝๆๅ๏ผ่ต้ๅฎๅ้ๅ๏ผ้ๅธธ้ๅไธไบๆๆๆพ็ๅบๆฌ้ขๆฏๆ็ๆ ็๏ผๆบๆๆบๆๅธญไฝ๏ผไปฅๅฐๆณขๆฎต่ฟไฝไธบไธป๏ผๆดไฝๆๅ็่พ้ซ|็ณไธๅฎๆบ่ฏๅธๆ้ๅ ฌๅธไธๆตท้ต่กๅบไธๅท่ทฏ่ฏๅธ่ฅไธ้จใๅฝๆณฐๅๅฎ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆตๅฎๅดๆณฐ้ธ่ทฏ่ฏๅธ่ฅไธ้จใๅฝๆณฐๅๅฎ่ฏๅธ่กไปฝๆ้ๅ ฌๅธไธๆตทๆฐ้ธ่ทฏ่ฏๅธ่ฅไธ้จใไธๆน่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆ ้กๆฐ็่ทฏ่ฏๅธ่ฅไธ้จใไธๆน่ฏๅธ่กไปฝๆ้ๅ ฌๅธไธๆตทๆตฆไธๆฐๅบ้ถๅไธญ่ทฏ่ฏๅธ่ฅไธ้จ+ไธๆตทๆบง้ณ่ทฏ|่็ๆธธ่ตๅธญไฝ๏ผๆดไฝๅธญไฝ่ต้่พๆ๏ผๅค่ทฏ่ต้ๅนถๅญ๏ผไฝๆฏๆปไฝๅทฒ่ถ ็ญ้ๅคๆไฝไธบไธป๏ผ่ต้ๅฎๅ้ๅ๏ผไฝ้่พๅคง๏ผๅ ทไฝ็ๆ็ๆๆณๆฏๅๆฌขๆไฝ้พๅคด่ก๏ผๆพๅฐ้พๅคดๅ๏ผๅๅค่ฟๅบ็ๅฅฝ็ไธช่กใ|ไธญไฟก่ฏๅธ่กไปฝๆ้ๅ ฌๅธไธๆตทๆบง้ณ่ทฏ่ฏๅธ่ฅไธ้จ+ไธๅก่ทฏ|้กถ็บง่ๅฅๅคงๅธ๏ผๅธๅบไธๆซๆฟๅฐๆฟ็ๆ้ซ็ๅ ่ทฏ่ต้ไนไธใๆดไฝๆไฝไปฅๅฅๅฉไธบไธป๏ผ็จณไธญๆฑ่ฟ๏ผ็บชๅพไธฅๆใไธๅกๅฏนๆฌกๆฐ็็่งฃ้ๅธธไนๆทฑ๏ผๆ ้ฟๆๆกๅธๅบๆ ็ปช๏ผๅฏน้ฆๆฟ็็่งฃไนๅฑ ๅธๅบๅๅ|่ดข้่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆญๅทไธๅก่ทฏ่ฏๅธ่ฅไธ้จ+ไธ็ฌๆตๅ |ๆ ้ฟ้พๅคดๆๆณ๏ผๅๆญงไนฐๅ ฅ๏ผ่ท้่ถๅฟ๏ผๆณขๆฎตไนฐๅ|ๆตๅ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆตทๅฎๆฐดๆไบญ่ฅฟ่ทฏ่ฏๅธ่ฅไธ้จใไธญๆณฐ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆนๅๅๅ ฌๅธ+zhouyu1933||้ฟๅ่ฏๅธ่กไปฝๆ้ๅ ฌๅธไปๆก้ฑๆฒ่ทฏ่ฏๅธ่ฅไธ้จ+T็|ๆญค็ฑปๅธญไฝๆฏๅคฉๅT๏ผๅ ถไนๆ ็ฉทใ|ๅฝ้่ฏๅธ่กไปฝๆ้ๅ ฌๅธไธๆตทๅฅ่ดคๅบ้็ขง่ทฏ่ฏๅธ่ฅไธ้จใๅฝ้่ฏๅธ่กไปฝๆ้ๅ ฌๅธไธๆตทไบ่็ฝ่ฏๅธๅๅ ฌๅธใไธๆน่ดขๅฏ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆ่จๅข็ป่ทฏ็ฌฌไบ่ฏๅธ่ฅไธ้จใไธๆน่ดขๅฏ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆ่จๅข็ป่ทฏ็ฌฌไธ่ฏๅธ่ฅไธ้จใไธๆน่ดขๅฏ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆ่จไธ็ฏ่ทฏ็ฌฌไบ่ฏๅธ่ฅไธ้จใไธๆน่ดขๅฏ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆ่จไธ็ฏ่ทฏ็ฌฌไธ่ฏๅธ่ฅไธ้จใไธๆน่ดขๅฏ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆ่จไธๅๅบๆฑ่ๅคง้่ฏๅธ่ฅไธ้จใไธๆน่ดขๅฏ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅฑฑๅ้ฆๆฒไธ่ทฏ่ฏๅธ่ฅไธ้จ+Nๅจไบ|ๆ ้ฟไฝๅธๅๆๆฟ๏ผ็ญ็บฟ่ถๅฟไบคๆ|ไธญไฟก่ฏๅธ่กไปฝๆ้ๅ ฌๅธๆญๅทๅค่ตท่ทฏ่ฏๅธ่ฅไธ้จ+bike770|่ฎบๅ็ฅๅ็ญ็บฟ้ๆ๏ผๅฐ่ต้ๅๅคง็ๅ ธ่๏ผๆพๅฎๆๅๅนดไธๅๅ็่ถ ็บงๆ็ปฉใ|ๅฝๆณฐๅๅฎ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅๅฎๆฐๆๅคง้่ฏๅธ่ฅไธ้จ+Asking||ๅ ดไธ่ฏๅธ่กไปฝๆ้ๅ ฌๅธ็ฆๅทๆนไธ่ทฏ่ฏๅธ่ฅไธ้จ+92็งๆฏ|ๆท่กๅง็ฅๅ้ๆ๏ผ็่งฃๅๆไบบ๏ผๅฎๅ จ็่งฃๆๆบๆฌ่ดจ๏ผ็ๆญฃไธบไบคๆ่็ใไฝๅธใ่ฟฝๆถจใๆๆฟๆ ทๆ ท็ฒพ้๏ผๆฏๅ ธๅ็ๆๆฟ้ซๆ๏ผๆ นๆฎๅธๅบๆๅค้ถๆฎตๅๆขๆๆณใ|ๅ ดไธ่ฏๅธ่กไปฝๆ้ๅ ฌๅธๅไบฌๅคฉๅ ไธ่ทฏ่ฏๅธ่ฅไธ้จdiff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\345\274\200\347\233\230\347\253\236\344\273\267\346\210\220\344\272\244(\345\275\223\346\227\245).md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\345\274\200\347\233\230\347\253\236\344\273\267\346\210\220\344\272\244(\345\275\223\346\227\245).md"new file mode 100644index 000000000..5207a55b4--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\345\274\200\347\233\230\347\253\236\344\273\267\346\210\220\344\272\244(\345\275\223\346\227\245).md"@@ -0,0 +1,70 @@+## ๅฝๆฅ้ๅ็ซไปท+----++ๆฅๅฃ๏ผstk_auction+ๆ่ฟฐ๏ผ่ทๅๅฝๆฅไธช่กๅETF็้ๅ็ซไปทๆไบคๆ ๅต๏ผๆฏๅคฉ9็น25~29ๅไน้ดๅฏไปฅ่ทๅๅฝๆฅ็้ๅ็ซไปทๆไบคๆฐๆฎ+้้๏ผๅๆฌกๆๅคง่ฟๅ8000่กๆฐๆฎ๏ผๅฏๆ นๆฎๆฅๆๆไปฃ็ ๅพช็ฏ่ทๅๅๅฒ+็งฏๅ๏ผๆฌๆฅๅฃๆฏๅ็ฌๅผๆ้็ๆฐๆฎ๏ผๅทฒ็ปๅผ้ไบ่ก็ฅจๅ้ๆ้็็จๆทๅฏ่ชๅจ่ทๅพๆฌๆฅๅฃๆ้๏ผๅ็ฌ็ณ่ฏทๆ้่ฏทๅ่[ๆ้ๅ่กจ](https://tushare.pro/document/1?doc_id=290)ใ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ๏ผYYYYMMDDๆ ผๅผ๏ผไธๅ)+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +trade_date | str | Y | ๆฐๆฎๆฅๆ+vol | int | Y | ๆไบค้๏ผ่ก๏ผ+price | int | Y | ๆไบคๅไปท๏ผๅ ๏ผ+amount | float | Y | ๆไบค้้ข๏ผๅ ๏ผ+pre_close | float | Y | ๆจๆถไปท๏ผๅ ๏ผ+turnover_rate | float | Y | ๆขๆ็๏ผ%๏ผ+volume_ratio | float | Y | ้ๆฏ+float_share | float | Y | ๆต้่กๆฌ๏ผไธ่ก๏ผ++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++#่ทๅ2025ๅนด2ๆ18ๆฅๅผ็้ๅ็ซไปทๆไบคๆ ๅต+df = pro.stk_auction(trade_date='20250218',fields='ts_code, trade_date,vol,price,amount,turnover_rate,volume_ratio')+++```+++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code trade_date vol price amount turnover_rate volume_ratio+ 0 600071.SH 20250218 8700 23.240 202188.00 0.003090 0.150628+ 1 300053.SZ 20250218 53300 13.750 732875.00 0.008388 0.230996+ 2 159558.SZ 20250218 18700 1.211 22645.70 NaN NaN+ 3 600879.SH 20250218 195900 9.190 1800320.00 0.005938 0.373839+ 4 159707.SZ 20250218 160800 0.628 100982.00 NaN NaN+ ... ... ... ... ... ... ... ...+ 6507 300616.SZ 20250218 142700 14.370 2050600.00 0.091494 1.184760+ 6508 836957.BJ 20250218 300 12.310 3693.00 0.000702 0.012952+ 6509 123039.SZ 20250218 20 119.777 2395.54 NaN NaN+ 6510 603655.SH 20250218 1400 23.390 32746.00 0.001321 0.107119+ 6511 300949.SZ 20250218 25600 41.210 1054980.00 0.042667 0.830128+diff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\346\246\234\345\215\225\346\225\260\346\215\256(\345\274\200\347\233\230\345\225\246).md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\346\246\234\345\215\225\346\225\260\346\215\256(\345\274\200\347\233\230\345\225\246).md"new file mode 100644index 000000000..600da4eef--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\346\246\234\345\215\225\346\225\260\346\215\256(\345\274\200\347\233\230\345\225\246).md"@@ -0,0 +1,86 @@+## ๅผ็ๅฆๆฆๅๆฐๆฎ+----++ๆฅๅฃ๏ผkpl_list+ๆ่ฟฐ๏ผ่ทๅๅผ็ๅฆๆถจๅใ่ทๅใ็ธๆฟ็ญๆฆๅๆฐๆฎ+้้๏ผๅๆฌกๆๅคง8000ๆกๆฐๆฎ๏ผๅฏๆ นๆฎๆฅๆๅพช็ฏ่ทๅๅๅฒๆฐๆฎ+็งฏๅ๏ผ5000็งฏๅๆฏๅ้ๅฏไปฅ่ฏทๆฑ200ๆฌกๆฏๅคฉๆป้1ไธๆฌก๏ผ8000็งฏๅไปฅไธๆฏๅ้500ๆฌกๆฏๅคฉๆป้ไธ้ๅถ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++ๆณจ๏ผๅผ็ๅฆๆฏไธไธชไผ็ง็ไธไธๆๆฟapp๏ผๆๅ ด่ถฃ็็จๆทๅฏไปฅ่ช่กไธ่ฝฝๅฎ่ฃ ใๆฌๆฅๅฃไป ้็จไบ้ๅ็ ็ฉถ๏ผๅฆ้ๅไธ็จ้๏ผ่ฏท่ช่ก่็ณปๅผ็APPๅฎๆนใๆฐๆฎๆดๆฐๆถ้ดๆฌกๆฅ8:30++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ+tag | str | N | ๆฟๅ็ฑปๅ๏ผๆถจๅ/็ธๆฟ/่ทๅ/่ช็ถๆถจๅ/็ซไปท๏ผ้ป่ฎคไธบๆถจๅ)+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ไปฃ็ +name | str | Y | ๅ็งฐ+trade_date | str | Y | ไบคๆๆถ้ด+lu_time | str | Y | ๆถจๅๆถ้ด+ld_time | str | Y | ่ทๅๆถ้ด+open_time | str | Y | ๅผๆฟๆถ้ด+last_time | str | Y | ๆๅๆถจๅๆถ้ด+lu_desc | str | Y | ๆถจๅๅๅ+tag | str | Y | ๆ ็ญพ|็ฑปๅซ+theme | str | Y | ๆฟๅ+net_change | float | Y | ไธปๅๅ้ข(ๅ )+bid_amount | float | Y | ็ซไปทๆไบค้ข(ๅ )+status | str | Y | ็ถๆ๏ผN่ฟๆฟ๏ผ+bid_change | float | Y | ็ซไปทๅ้ข+bid_turnover | float | Y | ็ซไปทๆขๆ%+lu_bid_vol | float | Y | ๆถจๅๅงไนฐ้ข+pct_chg | float | Y | ๆถจ่ทๅน %+bid_pct_chg | float | Y | ็ซไปทๆถจๅน %+rt_pct_chg | float | Y | ๅฎๆถๆถจๅน %+limit_order | float | Y | ๅฐๅ+amount | float | Y | ๆไบค้ข+turnover_rate | float | Y | ๆขๆ็%+free_float | float | Y | ๅฎ้ ๆต้+lu_limit_order | float | Y | ๆๅคงๅฐๅ++<br>+<br>++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++df = pro.kpl_list(trade_date='20240927', tag='ๆถจๅ', fields='ts_code,name,trade_date,tag,theme,status')++```++<br>+<br>+++**ๆฐๆฎๆ ทไพ**++ ts_code name trade_date tag theme status+ 0 000762.SZ ่ฅฟ่็ฟไธ 20240927 ๆถจๅ ้็ฟใ็ๆนๆ้ ้ฆๆฟ+ 1 300399.SZ ๅคฉๅฉ็งๆ 20240927 ๆถจๅ ไบ่็ฝ้่ใ้่ๆฆๅฟต ้ฆๆฟ+ 2 002673.SZ ่ฅฟ้จ่ฏๅธ 20240927 ๆถจๅ ่ฏๅธใๆงๅ่กๅบ้ ้ฆๆฟ+ 3 002050.SZ ไธ่ฑๆบๆง 20240927 ๆถจๅ ๆฑฝ่ฝฆ็ญ็ฎก็ใๆฏไบ่ฟชไบงไธ้พ ้ฆๆฟ+ 4 600801.SH ๅๆฐๆฐดๆณฅ 20240927 ๆถจๅ ๆฐดๆณฅใๅฐไบง้พ ้ฆๆฟ+ .. ... ... ... .. ... ...+ 126 600696.SH ๅฒฉ็ณ่กไปฝ 20240927 ๆถจๅ ็ฝ้ ใ้ ฟ้ 2่ฟๆฟ+ 127 600606.SH ็ปฟๅฐๆง่ก 20240927 ๆถจๅ ๆฟๅฐไบงใๅฐไบง้พ 2่ฟๆฟ+ 128 000882.SZ ๅ่่กไปฝ 20240927 ๆถจๅ ้ถๅฎใไบ่็ฝ้่ 2่ฟๆฟ+ 129 000069.SZ ๅไพจๅ๏ผก 20240927 ๆถจๅ ๆฟๅฐไบงใๅฐไบง้พ 2่ฟๆฟ+ 130 002570.SZ ่ดๅ ็พ 20240927 ๆถจๅ ๅค่ๆฆๅฟตใไนณไธ ้ฆๆฟdiff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\346\266\250\345\201\234\346\234\200\345\274\272\346\235\277\345\235\227\347\273\237\350\256\241.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\346\266\250\345\201\234\346\234\200\345\274\272\346\235\277\345\235\227\347\273\237\350\256\241.md"new file mode 100644index 000000000..62cbecc65--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\346\266\250\345\201\234\346\234\200\345\274\272\346\235\277\345\235\227\347\273\237\350\256\241.md"@@ -0,0 +1,76 @@+## ๆๅผบๆฟๅ็ป่ฎก+----++ๆฅๅฃ๏ผlimit_cpt_list+ๆ่ฟฐ๏ผ่ทๅๆฏๅคฉๆถจๅ่ก็ฅจๆๅคๆๅผบ็ๆฆๅฟตๆฟๅ๏ผๅฏไปฅๅๆๅผบๅฟๆฟๅ็่ฝฎๅจ๏ผๅคๆญ่ต้ๅจๅ+้้๏ผๅๆฌกๆๅคง2000่กๆฐๆฎ๏ผๅฏๆ นๆฎ่ก็ฅจไปฃ็ ๆ่ ๆฅๆๅพช็ฏๆๅๅ จ้จ+็งฏๅ๏ผ8000็งฏๅไปฅไธๆฏๅ้500ๆฌก๏ผๆฏๅคฉๆป้ไธ้ๅถ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+trade_date | str | N | ไบคๆๆฅๆ๏ผๆ ผๅผ๏ผYYYYMMDD๏ผไธๅ๏ผ+ts_code | str | N | ๆฟๅไปฃ็ +start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ๆฟๅไปฃ็ +name | str | Y | ๆฟๅๅ็งฐ+trade_date | str | Y | ไบคๆๆฅๆ+days | int | Y | ไธๆฆๅคฉๆฐ+up_stat | str | Y | ่ฟๆฟ้ซๅบฆ+cons_nums | int | Y | ่ฟๆฟๅฎถๆฐ+up_nums | int | Y | ๆถจๅๅฎถๆฐ+pct_chg | float | Y | ๆถจ่ทๅน %+rank | str | Y | ๆฟๅ็ญ็นๆๅ+++<br>+<br>++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++df = pro.limit_cpt_list(trade_date='20241127')++```++**ๆฐๆฎๆ ทไพ**+++ ts_code name trade_date days up_stat cons_nums up_nums pct_chg rank+ 0 885728.TI ไบบๅทฅๆบ่ฝ 20241127 18 9ๅคฉ7ๆฟ 9 27 2.8608 1+ 1 885420.TI ็ตๅญๅๅก 20241127 6 9ๅคฉ7ๆฟ 11 25 1.8973 2+ 2 885806.TI ๅไธบๆฆๅฟต 20241127 34 18ๅคฉ14ๆฟ 6 21 2.4648 3+ 3 885418.TI ๆๅไผ ๅชๆฆๅฟต 20241127 2 9ๅคฉ7ๆฟ 6 18 3.5207 4+ 4 885976.TI ๆฐๅญ็ปๆต 20241127 4 9ๅคฉ7ๆฟ 6 17 2.8993 5+ 5 885788.TI ็ฝ็ป็ดๆญ 20241127 6 9ๅคฉ7ๆฟ 9 17 2.5367 6+ 6 886019.TI AIGCๆฆๅฟต 20241127 1 9ๅคฉ7ๆฟ 5 16 4.3615 7+ 7 885756.TI ่ฏ็ๆฆๅฟต 20241127 1 7ๅคฉ7ๆฟ 7 16 2.4840 8+ 8 885642.TI ่ทจๅข็ตๅ 20241127 6 9ๅคฉ7ๆฟ 10 16 2.1974 9+ 9 885517.TI ๆบๅจไบบๆฆๅฟต 20241127 14 6ๅคฉ6ๆฟ 7 16 2.1272 10+ 10 885929.TI ไธ็ฒพ็นๆฐ 20241127 8 7ๅคฉ7ๆฟ 4 16 2.0335 11+ 11 885709.TI ่ๆ็ฐๅฎ 20241127 1 9ๅคฉ7ๆฟ 4 15 3.4553 12+ 12 885934.TI ๅ ๅฎๅฎ 20241127 1 9ๅคฉ7ๆฟ 4 14 3.9264 13+ 13 885757.TI ๅบๅ้พ 20241127 1 18ๅคฉ14ๆฟ 5 14 3.1271 14+ 14 885413.TI ๅๆ 20241127 3 18ๅคฉ14ๆฟ 7 14 1.7311 15+ 15 885779.TI ่ พ่ฎฏๆฆๅฟต 20241127 1 9ๅคฉ7ๆฟ 4 13 3.3722 16+ 16 885876.TI ็ฝ็บข็ปๆต 20241127 1 9ๅคฉ7ๆฟ 5 12 2.9002 17+ 17 885494.TI ไธๅธฆไธ่ทฏ 20241127 2 9ๅคฉ7ๆฟ 1 12 1.3427 18+ 18 885950.TI ่ๆๆฐๅญไบบ 20241127 1 9ๅคฉ7ๆฟ 3 11 4.1545 19+ 19 886013.TI ไฟกๅ 20241127 2 9ๅคฉ7ๆฟ 6 11 3.2298 20diff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\346\266\250\345\201\234\350\202\241\347\245\250\350\277\236\346\235\277\345\244\251\346\242\257.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\346\266\250\345\201\234\350\202\241\347\245\250\350\277\236\346\235\277\345\244\251\346\242\257.md"new file mode 100644index 000000000..0e3222428--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\346\266\250\345\201\234\350\202\241\347\245\250\350\277\236\346\235\277\345\244\251\346\242\257.md"@@ -0,0 +1,100 @@+## ่ฟๆฟๅคฉๆขฏ+----++ๆฅๅฃ๏ผlimit_step+ๆ่ฟฐ๏ผ่ทๅๆฏๅคฉ่ฟๆฟไธชๆฐๆ็บง็่ก็ฅจ๏ผๅฏไปฅๅๆๅบๆฏๅคฉ่ฟ็ปญๆถจๅ่ฟ้ถไธชๆฐ๏ผๅคๆญๅผบๅฟ็ญๅบฆ+้้๏ผๅๆฌกๆๅคง2000่กๆฐๆฎ๏ผๅฏๆ นๆฎ่ก็ฅจไปฃ็ ๆ่ ๆฅๆๅพช็ฏๆๅๅ จ้จ+็งฏๅ๏ผ8000็งฏๅไปฅไธๆฏๅ้500ๆฌก๏ผๆฏๅคฉๆป้ไธ้ๅถ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+trade_date | str | N | ไบคๆๆฅๆ๏ผๆ ผๅผ๏ผYYYYMMDD๏ผไธๅ๏ผ+ts_code | str | N | ่ก็ฅจไปฃ็ +start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+nums | str | N | ่ฟๆฟๆฌกๆฐ๏ผๆฏๆๅคไธช่พๅ ฅ๏ผไพๅฆnums='2,3'+++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ไปฃ็ +name | str | Y | ๅ็งฐ+trade_date | str | Y | ไบคๆๆฅๆ+nums | str | Y | ่ฟๆฟๆฌกๆฐ++<br>+<br>++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++df = pro.limit_step(trade_date='20241125')++```++**ๆฐๆฎๆ ทไพ**++ ts_code name trade_date nums+ 0 000833.SZ ็ฒคๆก่กไปฝ 20241125 11+ 1 002611.SZ ไธๆน็ฒพๅทฅ 20241125 8+ 2 600800.SH ๆธคๆตทๅๅญฆ 20241125 7+ 3 000801.SZ ๅๅทไนๆดฒ 20241125 6+ 4 600889.SH ๅไบฌๅ็บค 20241125 6+ 5 000615.SZ ST็พ่ฐท 20241125 5+ 6 001229.SZ ้ญ ่ง็งๆ 20241125 5+ 7 002095.SZ ็ๆๅฎ 20241125 5+ 8 002403.SZ ็ฑไป่พพ 20241125 5+ 9 600470.SH ๅ ญๅฝๅๅทฅ 20241125 5+ 10 603015.SH ๅผ่ฎฏ็งๆ 20241125 5+ 11 603527.SH ไผๆบๆฐๆ 20241125 5+ 12 002103.SZ ๅนฟๅ่กไปฝ 20241125 4+ 13 002175.SZ ไธๆนๆบ้ 20241125 4+ 14 002467.SZ ไบๅ ญไธ 20241125 4+ 15 002741.SZ ๅ ๅ็งๆ 20241125 4+ 16 002862.SZ ๅฎไธฐๆๅ 20241125 4+ 17 003036.SZ ๆณฐๅฆ่กไปฝ 20241125 4+ 18 603377.SH STไธๆถ 20241125 4+ 19 000573.SZ ็ฒคๅฎ่ฟA 20241125 3+ 20 002155.SZ ๆนๅ้ป้ 20241125 3+ 21 300822.SZ ่ดไป่พพๅ 20241125 3+ 22 600105.SH ๆฐธ้ผ่กไปฝ 20241125 3+ 23 600405.SH ๅจๅๆบ 20241125 3+ 24 600410.SH ๅ่ๅคฉๆ 20241125 3+ 25 600979.SH ๅนฟๅฎ็ฑไผ 20241125 3+ 26 000548.SZ ๆนๅๆ่ต 20241125 2+ 27 000695.SZ ๆปจๆตท่ฝๆบ 20241125 2+ 28 000803.SZ ๅฑฑ้ซ็ฏ่ฝ 20241125 2+ 29 002045.SZ ๅฝๅ ็ตๅจ 20241125 2+ 30 002054.SZ ๅพท็พๅๅทฅ 20241125 2+ 31 002117.SZ ไธๆธฏ่กไปฝ 20241125 2+ 32 002638.SZ ๅคไธ่กไปฝ 20241125 2+ 33 002640.SZ ่ทจๅข้ 20241125 2+ 34 002658.SZ ้ช่ฟช้พ 20241125 2+ 35 002820.SZ ๆกๅ็ฅฅ 20241125 2+ 36 002877.SZ ๆบ่ฝ่ชๆง 20241125 2+ 37 003005.SZ ็ซไธ่พพ 20241125 2+ 38 300220.SZ ้่ฟๆฟๅ 20241125 2+ 39 600228.SH ่ฟๅฉ็งๆ 20241125 2+ 40 600333.SH ้ฟๆฅ็ๆฐ 20241125 2+ 41 600615.SH ไธฐๅ่กไปฝ 20241125 2+ 42 600775.SH ๅไบฌ็็ซ 20241125 2+ 43 601133.SH ๆ่ฏ่กไปฝ 20241125 2+ 44 603026.SH ็ณๅคง่ๅ 20241125 2+ 45 603359.SH ไธ็ ็ๆ 20241125 2+ 46 603585.SH ่ๅฉ่กไปฝ 20241125 2+ 47 603655.SH ๆๅ็งๆ 20241125 2+ 48 603843.SH ๆญฃๅนณ่กไปฝ 20241125 2+diff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\346\266\250\350\267\214\345\201\234\345\222\214\347\202\270\346\235\277\346\225\260\346\215\256.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\346\266\250\350\267\214\345\201\234\345\222\214\347\202\270\346\235\277\346\225\260\346\215\256.md"new file mode 100644index 000000000..4b080d730--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\346\266\250\350\267\214\345\201\234\345\222\214\347\202\270\346\235\277\346\225\260\346\215\256.md"@@ -0,0 +1,76 @@+## ๆถจ่ทๅๅ่กจ๏ผๆฐ๏ผ+----++ๆฅๅฃ๏ผlimit_list_d+ๆ่ฟฐ๏ผ่ทๅA่กๆฏๆฅๆถจ่ทๅใ็ธๆฟๆฐๆฎๆ ๅต๏ผๆฐๆฎไป2020ๅนดๅผๅง๏ผไธๆไพST่ก็ฅจ็็ป่ฎก๏ผ+้้๏ผๅๆฌกๆๅคงๅฏไปฅ่ทๅ2500ๆกๆฐๆฎ๏ผๅฏ้่ฟๆฅๆๆ่ ่ก็ฅจๅพช็ฏๆๅ+็งฏๅ๏ผ5000็งฏๅๆฏๅ้ๅฏไปฅ่ฏทๆฑ200ๆฌกๆฏๅคฉๆป้1ไธๆฌก๏ผ8000็งฏๅไปฅไธๆฏๅ้500ๆฌกๆฏๅคฉๆป้ไธ้ๅถ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+trade_date | str | N | ไบคๆๆฅๆ+ts_code | str | N | ่ก็ฅจไปฃ็ +limit_type | str | N | ๆถจ่ทๅ็ฑปๅ๏ผUๆถจๅD่ทๅZ็ธๆฟ๏ผ+exchange | str | N | ไบคๆๆ๏ผSHไธไบคๆSZๆทฑไบคๆBJๅไบคๆ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ+ts_code | str | Y | ่ก็ฅจไปฃ็ +industry | str | Y | ๆๅฑ่กไธ+name | str | Y | ่ก็ฅจๅ็งฐ+close | float | Y | ๆถ็ไปท+pct_chg | float | Y | ๆถจ่ทๅน+amount | float | Y | ๆไบค้ข+limit_amount | float | Y | ๆฟไธๆไบค้้ข(ๆไบคไปทๆ ผไธบ่ฏฅ่ก็ฅจ่ทๅไปท็ๆๆๆไบค้ข็ๆปๅ๏ผๆถจๅๆ ๆญคๆฐๆฎ)+float_mv | float | Y | ๆต้ๅธๅผ+total_mv | float | Y | ๆปๅธๅผ+turnover_ratio | float | Y | ๆขๆ็+fd_amount | float | Y | ๅฐๅ้้ข๏ผไปฅๆถจๅไปทไนฐๅ ฅๆๅ็่ต้ๆป้๏ผ+first_time | str | Y | ้ฆๆฌกๅฐๆฟๆถ้ด๏ผ่ทๅๆ ๆญคๆฐๆฎ๏ผ+last_time | str | Y | ๆๅๅฐๆฟๆถ้ด+open_times | int | Y | ็ธๆฟๆฌกๆฐ(่ทๅไธบๅผๆฟๆฌกๆฐ)+up_stat | str | Y | ๆถจๅ็ป่ฎก๏ผN/T TๅคฉๆNๆฌกๆถจๅ๏ผ+limit_times | int | Y | ่ฟๆฟๆฐ๏ผไธช่ก่ฟ็ปญๅฐๆฟๆฐ้๏ผ+limit | str | Y | D่ทๅUๆถจๅZ็ธๆฟ++<br>+<br>++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++df = pro.limit_list_d(trade_date='20220615', limit_type='U', fields='ts_code,trade_date,industry,name,close,pct_chg,open_times,up_stat,limit_times')++```++**ๆฐๆฎๆ ทไพ**++ trade_date ts_code industry name close pct_chg open_times up_stat limit_times+ 0 20220615 000017.SZ ไบค่ฟ่ฎพๅค ๆทฑไธญๅA 3.65 9.94 0 1/1 1+ 1 20220615 000025.SZ ๆฑฝ่ฝฆๆๅก ็น ๅ๏ผก 29.54 10.02 5 12/23 1+ 2 20220615 000498.SZ ๅทฅ็จๅปบ่ฎพ ๅฑฑไธ่ทฏๆกฅ 10.41 10.04 3 1/1 1+ 3 20220615 000502.SZ ๆฟๅฐไบงๆ ็ปฟๆฏ้ 0.69 9.52 2 3/3 3+ 4 20220615 000532.SZ ็ปผๅ่กไธ ๅ้่ตๆฌ 12.69 9.97 0 1/1 1+ .. ... ... ... ... ... ... ... ... ...+ 56 20220615 603633.SH ๆถ่ดน็ตๅญ ๅพๆจ่กไปฝ 14.58 10.04 3 2/4 1+ 57 20220615 603668.SH ๅ็ง้ฅฒๆธ ๅคฉ้ฉฌ็งๆ 18.22 10.02 0 2/2 2+ 58 20220615 603918.SH ไบ่็ฝๆ ้ๆกฅไฟกๆฏ 9.49 9.97 6 1/1 1+ 59 20220615 603963.SH ไธญ่ฏ ๅคง็่ฏไธ 14.78 9.97 1 1/1 1+ 60 20220615 605068.SH ๆฑฝ่ฝฆ้ถ้จ ๆๆฐๆญ่ พ 29.03 10.00 1 2/2 2+diff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\346\270\270\350\265\204\344\272\244\346\230\223\346\257\217\346\227\245\346\230\216\347\273\206.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\346\270\270\350\265\204\344\272\244\346\230\223\346\257\217\346\227\245\346\230\216\347\273\206.md"new file mode 100644index 000000000..ad6b5340e--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\346\270\270\350\265\204\344\272\244\346\230\223\346\257\217\346\227\245\346\230\216\347\273\206.md"@@ -0,0 +1,61 @@+## ๆธธ่ตๆฏๆฅๆ็ป+----++ๆฅๅฃ๏ผhm_detail+ๆ่ฟฐ๏ผ่ทๅๆฏๆฅๆธธ่ตไบคๆๆ็ป๏ผๆฐๆฎๅผๅงไบ2022ๅนด8ใๆธธ่ตๅ็ฑปๅๅฝ๏ผ่ฏท็นๅป<a href="https://tushare.pro/document/2?doc_id=311">ๆธธ่ตๅๅฝ</a>+้้๏ผๅๆฌกๆๅคๆๅ2000ๆก่ฎฐๅฝ๏ผๅฏๅพช็ฏ่ฐๅ๏ผๆป้ไธ้ๅถ+็งฏๅ๏ผ็จๆท็งฏ10000็งฏๅๅฏ่ฐๅไฝฟ็จ๏ผ็งฏๅ่ทๅๅๆณ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)+++<img src="https://tushare.pro/files/wx/yzpt.png">++ๆณจ๏ผๆฐๆฎไธบๅฝๆฅ้จๅๆฐๆฎ๏ผๆญคๅคๅชๆชไฝไธบ็คบไพๆๆใ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+trade_date | str | N | ไบคๆๆฅๆ(YYYYMMDD)+ts_code | str | N | ่ก็ฅจไปฃ็ +hm_name | str | N | ๆธธ่ตๅ็งฐ+start_date | str | N | ๅผๅงๆฅๆ(YYYYMMDD)+end_date | str | N | ็ปๆๆฅๆ(YYYYMMDD)++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ+ts_code | str | Y | ่ก็ฅจไปฃ็ +ts_name | str | Y | ่ก็ฅจๅ็งฐ+buy_amount | float | Y | ไนฐๅ ฅ้้ข๏ผๅ ๏ผ+sell_amount | float | Y | ๅๅบ้้ข๏ผๅ ๏ผ+net_amount | float | Y | ๅไนฐๅ๏ผๅ ๏ผ+hm_name | str | Y | ๆธธ่ตๅ็งฐ+hm_orgs | str | Y | ๅ ณ่ๆบๆ๏ผไธ่ฌไธบ่ฅไธ้จๆๆบๆไธ็จ๏ผ+tag | str | N | ๆ ็ญพ++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++#่ทๅๅๆฅๅ จ้จๆ็ป+df = pro.hm_detail(trade_date='20230815')++```+++<br>+<br>+diff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\351\200\232\350\276\276\344\277\241\346\235\277\345\235\227\344\277\241\346\201\257.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\351\200\232\350\276\276\344\277\241\346\235\277\345\235\227\344\277\241\346\201\257.md"new file mode 100644index 000000000..4ef51c9cc--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\351\200\232\350\276\276\344\277\241\346\235\277\345\235\227\344\277\241\346\201\257.md"@@ -0,0 +1,70 @@+## ้่พพไฟกๆฟๅไฟกๆฏ+----++ๆฅๅฃ๏ผtdx_index+ๆ่ฟฐ๏ผ่ทๅ้่พพไฟกๆฟๅๅบ็กไฟกๆฏ๏ผๅ ๆฌๆฆๅฟตๆฟๅใ่กไธใ้ฃๆ ผใๅฐๅ็ญ+้้๏ผๅๆฌกๆๅคง1000ๆกๆฐๆฎ๏ผๅฏๆ นๆฎๆฅๆๅๆฐๅพช็ฏๆๅ+ๆ้๏ผ็จๆท็งฏ็ดฏ6000็งฏๅๅฏ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)+++<br>+<br>+++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ๆฟๅไปฃ็ ๏ผxxxxxx.TDX+trade_date | str | N | ไบคๆๆฅๆ(ๆ ผๅผ๏ผYYYYMMDD๏ผ+idx_type | str | N | ๆฟๅ็ฑปๅ๏ผๆฆๅฟตๆฟๅใ่กไธๆฟๅใ้ฃๆ ผๆฟๅใๅฐๅบๆฟๅ++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ๆฟๅไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+name | str | Y | ๆฟๅๅ็งฐ+idx_type | str | Y | ๆฟๅ็ฑปๅ+idx_count | int | Y | ๆๅไธชๆฐ+total_share | float | Y | ๆป่กๆฌ(ไบฟ)+float_share | float | Y | ๆต้่ก(ไบฟ)+total_mv | float | Y | ๆปๅธๅผ(ไบฟ)+float_mv | float | Y | ๆต้ๅธๅผ(ไบฟ)++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++#่ทๅ้่พพไฟก2025ๅนด5ๆ13ๆฅ็ๆฆๅฟตๆฟๅๅ่กจ+df = pro.tdx_index(trade_date='20250513', fields='ts_code,name,idx_type,idx_count')+++```+++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code name idx_type idx_count+ 0 880559.TDX ่ฆ็บฆๆถ่ดญ ้ฃๆ ผๆฟๅ 6+ 1 880728.TDX ่ช่ฟๆฆๅฟต ๆฆๅฟตๆฟๅ 64+ 2 880355.TDX ๆฅ็จๅๅทฅ ่กไธๆฟๅ 20+ 3 880423.TDX ้ ๅบ้ค้ฅฎ ่กไธๆฟๅ 9+ 4 880875.TDX ไธญๅฐ้ถ่ก ้ฃๆ ผๆฟๅ 28+ .. ... ... ... ...+ 477 880528.TDX ๅๅทฅไฟกๆฏๅ ๆฆๅฟตๆฟๅ 99+ 478 880868.TDX ้ซ่ดๅกๅผ ้ฃๆ ผๆฟๅ 100+ 479 880430.TDX ่ช็ฉบ ่กไธๆฟๅ 52+ 480 880431.TDX ่น่ถ ่กไธๆฟๅ 12+ 481 880914.TDX ๅ่ดธๆฆๅฟต ๆฆๅฟตๆฟๅ 25\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\351\200\232\350\276\276\344\277\241\346\235\277\345\235\227\346\210\220\345\210\206.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\351\200\232\350\276\276\344\277\241\346\235\277\345\235\227\346\210\220\345\210\206.md"new file mode 100644index 000000000..5cce0bc76--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\351\200\232\350\276\276\344\277\241\346\235\277\345\235\227\346\210\220\345\210\206.md"@@ -0,0 +1,63 @@+## ้่พพไฟกๆฟๅๆๅ+----++ๆฅๅฃ๏ผtdx_member+ๆ่ฟฐ๏ผ่ทๅ้่พพไฟกๅๆฟๅๆๅ่กไฟกๆฏ+้้๏ผๅๆฌกๆๅคง3000ๆกๆฐๆฎ๏ผๅฏไปฅๆ นๆฎๆฅๆๅๆฟๅไปฃ็ ๅพช็ฏๆๅ+ๆ้๏ผ็จๆท็งฏ็ดฏ6000็งฏๅๅฏ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>+++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ๆฟๅไปฃ็ ๏ผxxxxxx.TDX+trade_date | str | N | ไบคๆๆฅๆ๏ผๆ ผๅผYYYYMMDD++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ๆฟๅไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+con_code | str | Y | ๆๅ่ก็ฅจไปฃ็ +con_name | str | Y | ๆๅ่ก็ฅจๅ็งฐ++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++#่ทๅ้่พพไฟกๆฟๅ2025ๅนด5ๆ13ๆฅ็่ช่ฟๆฆๅฟตๆฟๅๆๅ่ก+df = pro.tdx_member(trade_date='20250513', ts_code='880728.TDX')+++```+++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code trade_date con_code con_name+ 0 880728.TDX 20250513 000039.SZ ไธญ้้ๅข+ 1 880728.TDX 20250513 000088.SZ ็ ็ฐ ๆธฏ+ 2 880728.TDX 20250513 000507.SZ ็ ๆตทๆธฏ+ 3 880728.TDX 20250513 000520.SZ ๅคๅฐ่ช่ฟ+ 4 880728.TDX 20250513 000582.SZ ๅ้จๆนพๆธฏ+ .. ... ... ... ...+ 59 880728.TDX 20250513 603869.SH STๆบ็ฅ+ 60 880728.TDX 20250513 603967.SH ไธญๅ็ฉๆต+ 61 880728.TDX 20250513 605090.SH ไนไธฐ่ฝๆบ+ 62 880728.TDX 20250513 833171.BJ ๅฝ่ช่ฟๆด+ 63 880728.TDX 20250513 872351.BJ ๅๅ ๆบๆตท\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\351\200\232\350\276\276\344\277\241\346\235\277\345\235\227\350\241\214\346\203\205.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\351\200\232\350\276\276\344\277\241\346\235\277\345\235\227\350\241\214\346\203\205.md"new file mode 100644index 000000000..8e4aa9f4e--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\351\200\232\350\276\276\344\277\241\346\235\277\345\235\227\350\241\214\346\203\205.md"@@ -0,0 +1,98 @@+## ้่พพไฟกๆฟๅ่กๆ+----++ๆฅๅฃ๏ผtdx_daily+ๆ่ฟฐ๏ผ่ทๅ้่พพไฟกๅๆฟๅ่กๆ ๏ผๅ ๆฌๆไบคๅไผฐๅผ็ญๆฐๆฎ+้้๏ผๅๆฌกๆๅๆๅคง3000ๆกๆฐๆฎ๏ผๅฏๆ นๆฎๆฟๅไปฃ็ ๅๆฅๆๅๆฐๅพช็ฏๆๅ+ๆ้๏ผ็จๆท็งฏ็ดฏ6000็งฏๅๅฏ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>+++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ๆฟๅไปฃ็ ๏ผxxxxxx.TDX+trade_date | str | N | ไบคๆๆฅๆ๏ผๆ ผๅผYYYYMMDD,ไธๅ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ๆฟๅไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+close | float | Y | ๆถ็็นไฝ+open | float | Y | ๅผ็็นไฝ+high | float | Y | ๆ้ซ็นไฝ+low | float | Y | ๆไฝ็นไฝ+pre_close | float | Y | ๆจๆฅๆถ็็น+change | float | Y | ๆถจ่ท็นไฝ+pct_change | float | Y | ๆถจ่ทๅน %+vol | float | Y | ๆไบค้๏ผๆ๏ผ+amount | float | Y | ๆไบค้ข๏ผไธๅ ๏ผ, ๅฏนไบๆ่ดงๆๆฐ๏ผ่ฏฅๅญๆฎตๅญๅจๆไป้+rise | str | Y | ๆถ็ๆถจ้%+vol_ratio | float | Y | ้ๆฏ+turnover_rate | float | Y | ๆขๆ%+swing | float | Y | ๆฏๅน %+up_num | int | Y | ไธๆถจๅฎถๆฐ+down_num | int | Y | ไธ่ทๅฎถๆฐ+limit_up_num | int | Y | ๆถจๅๅฎถๆฐ+limit_down_num | int | Y | ่ทๅๅฎถๆฐ+lu_days | int | Y | ่ฟๆถจๅคฉๆฐ+3day | float | Y | 3ๆฅๆถจๅน %+5day | float | Y | 5ๆฅๆถจๅน %+10day | float | Y | 10ๆฅๆถจๅน %+20day | float | Y | 20ๆฅๆถจๅน %+60day | float | Y | 60ๆฅๆถจๅน %+mtd | float | Y | ๆๅ่ณไป%+ytd | float | Y | ๅนดๅ่ณไป%+1year | float | Y | ไธๅนดๆถจๅน %+pe | str | Y | ๅธ็็+pb | str | Y | ๅธๅ็+float_mv | float | Y | ๆต้ๅธๅผ(ไบฟ)+ab_total_mv | float | Y | AB่กๆปๅธๅผ๏ผไบฟ๏ผ+float_share | float | Y | ๆต้่ก(ไบฟ)+total_share | float | Y | ๆป่กๆฌ(ไบฟ)+bm_buy_net | float | Y | ไธปไนฐๅ้ข(ๅ )+bm_buy_ratio | float | Y | ไธปไนฐๅ ๆฏ%+bm_net | float | Y | ไธปๅๅ้ข+bm_ratio | float | Y | ไธปๅๅ ๆฏ%++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++#่ทๅ้่พพไฟก2025ๅนด5ๆ13ๆฅๆฆๅฟตๆฟๅ่กๆ+df = pro.tdx_daily(trade_date='20250513')+++```+++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code trade_date close open high ... total_share bm_buy_net bm_buy_ratio bm_net bm_ratio+ 0 880559.TDX 20250513 4344.82 4243.64 4377.61 ... 63.92 -3711.74 -5.99 3460.16 5.58+ 1 880728.TDX 20250513 1426.69 1417.49 1429.39 ... 2060.22 -6268.93 -0.29 28491.26 1.32+ 2 880355.TDX 20250513 1432.23 1403.51 1445.14 ... 70.76 -923.37 -0.17 58055.81 10.40+ 3 880423.TDX 20250513 919.10 907.35 921.78 ... 56.45 12268.21 8.46 420.44 0.29+ 4 880875.TDX 20250513 1385.67 1365.73 1387.00 ... 1986.86 207359.44 16.90 3214.69 0.26+ .. ... ... ... ... ... ... ... ... ... ... ...+ 482 880528.TDX 20250513 1298.93 1334.78 1335.18 ... 579.52 -566197.66 -12.66 -285997.36 -6.40+ 483 880868.TDX 20250513 1359.55 1412.46 1418.79 ... 108.15 -11975.73 -0.80 -89.57 -0.01+ 484 880430.TDX 20250513 1865.61 1914.31 1914.31 ... 398.07 -333388.49 -10.96 -200437.09 -6.59+ 485 880431.TDX 20250513 796.66 825.16 825.16 ... 367.64 -246591.46 -23.97 -131926.99 -12.82+ 486 880914.TDX 20250513 1009.77 1047.47 1047.55 ... 310.96 -337334.58 -10.57 -423231.69 -13.26\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\351\242\230\346\235\220\346\210\220\345\210\206(\345\274\200\347\233\230\345\225\246).md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\351\242\230\346\235\220\346\210\220\345\210\206(\345\274\200\347\233\230\345\225\246).md"new file mode 100644index 000000000..104a716ac--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\351\242\230\346\235\220\346\210\220\345\210\206(\345\274\200\347\233\230\345\225\246).md"@@ -0,0 +1,69 @@+## ๅผ็ๅฆ้ขๆๆๅ+----++ๆฅๅฃ๏ผkpl_concept_cons+ๆ่ฟฐ๏ผ่ทๅๅผ็ๅฆๆฆๅฟต้ขๆ็ๆๅ่ก+้้๏ผๅๆฌกๆๅคง3000ๆก๏ผๅฏๆ นๆฎไปฃ็ ๅๆฅๆๅพช็ฏ่ทๅๅ จ้จๆฐๆฎ+็งฏๅ๏ผ5000็งฏๅๅฏๆๅๆฐๆฎ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++ๆณจ๏ผๅผ็ๅฆๆฏไธไธชไผ็ง็ไธไธๆๆฟapp๏ผๆๅ ด่ถฃ็็จๆทๅฏไปฅ่ช่กไธ่ฝฝๅฎ่ฃ ใๆฌๆฅๅฃไป ้็จไบ้ๅ็ ็ฉถ๏ผๅฆ้ๅไธ็จ้๏ผ่ฏท่ช่ก่็ณปๅผ็APPๅฎๆนใๆญคๆฅๅฃๅ ๆบ็ซๆน็ๆๆ ๆฐๅขๆฐๆฎ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+trade_date | str | N | ไบคๆๆฅๆ๏ผYYYYMMDDๆ ผๅผ๏ผ+ts_code | str | N | ้ขๆไปฃ็ ๏ผxxxxxx.KPๆ ผๅผ๏ผ+con_code | str | N | ๆๅไปฃ็ ๏ผxxxxxx.SHๆ ผๅผ๏ผ+++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ้ขๆID+name | str | Y | ้ขๆๅ็งฐ+con_name | str | Y | ่ก็ฅจๅ็งฐ+con_code | str | Y | ่ก็ฅจไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+desc | str | Y | ๆ่ฟฐ+hot_num | int | Y | ไบบๆฐๅผ++<br>+<br>++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++df = pro.kpl_concept_cons(trade_date='20241014')++```++<br>+<br>+++**ๆฐๆฎๆ ทไพ**++ ts_code name ts_name con_code trade_date+ 0 000111.KP ๅๅบๆฆๅฟต ไฟก่พพๅฐไบง 600657.SH 20241014+ 1 000111.KP ๅๅบๆฆๅฟต ้ถๅฎๅฑฑๆฐ 002786.SZ 20241014+ 2 000111.KP ๅๅบๆฆๅฟต ๆฉๆฉ็ตๆฐ 002451.SZ 20241014+ 3 000111.KP ๅๅบๆฆๅฟต ๅ ๅคงๅๅฎ 600622.SH 20241014+ 4 000111.KP ๅๅบๆฆๅฟต ๆตทๅพท่กไปฝ 000567.SZ 20241014+ ... ... ... ... ... ...+ 2995 000229.KP ็ตๅ ็นๅ็ตๅทฅ 600089.SH 20241014+ 2996 000229.KP ็ตๅ ไธญๅฝ่ฅฟ็ต 601179.SH 20241014+ 2997 000229.KP ็ตๅ ้็็งๆ 688676.SH 20241014+ 2998 000229.KP ็ตๅ ๆๆบ็ตๆฐ 002028.SZ 20241014+ 2999 000229.KP ็ตๅ ๆ้ณ็ตๆฐ 301291.SZ 20241014+diff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\351\276\231\350\231\216\346\246\234\346\234\272\346\236\204\344\272\244\346\230\223\345\215\225.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\351\276\231\350\231\216\346\246\234\346\234\272\346\236\204\344\272\244\346\230\223\345\215\225.md"new file mode 100644index 000000000..c73d260fc--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\351\276\231\350\231\216\346\246\234\346\234\272\346\236\204\344\272\244\346\230\223\345\215\225.md"@@ -0,0 +1,76 @@+## ้พ่ๆฆๆบๆๆ็ป+----++ๆฅๅฃ๏ผtop_inst+ๆ่ฟฐ๏ผ้พ่ๆฆๆบๆๆไบคๆ็ป+้้๏ผๅๆฌก่ฏทๆฑๆๅคง่ฟๅ10000่กๆฐๆฎ๏ผๅฏๆ นๆฎๅๆฐๅพช็ฏ่ทๅๅ จ้จๅๅฒ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ5000็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ+ts_code | str | N | TSไปฃ็ ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ+ts_code | str | Y | TSไปฃ็ +exalter | str | Y | ่ฅไธ้จๅ็งฐ+side | str | Y | ไนฐๅ็ฑปๅ0๏ผไนฐๅ ฅ้้ขๆๅคง็ๅ5ๅ๏ผ 1๏ผๅๅบ้้ขๆๅคง็ๅ5ๅ+buy | float | Y | ไนฐๅ ฅ้ข๏ผๅ ๏ผ+buy_rate | float | Y | ไนฐๅ ฅๅ ๆปๆไบคๆฏไพ+sell | float | Y | ๅๅบ้ข๏ผๅ ๏ผ+sell_rate | float | Y | ๅๅบๅ ๆปๆไบคๆฏไพ+net_buy | float | Y | ๅๆไบค้ข๏ผๅ ๏ผ+reason | str | Y | ไธๆฆ็็ฑ++<br>+<br>++**ๆฅๅฃ็จๆณ**++ pro = ts.pro_api()++ df = pro.top_inst(trade_date='20210525')++ ๆ่++ df = pro.query('top_inst', trade_date='20210524', ts_code='000592.SZ', fields='trade_date,buy,sell,side,reason')+++<br>+<br>++**ๆฐๆฎๆ ทไพ**++ trade_date buy sell side reason+ 0 20210524 19627524.05 25593683.67 0 ๆถจๅน ๅ็ฆปๅผ่พพ7%็่ฏๅธ+ 1 20210524 9091252.00 18009704.00 0 ๆถจๅน ๅ็ฆปๅผ่พพ7%็่ฏๅธ+ 2 20210524 35168640.99 13344062.12 0 ๆถจๅน ๅ็ฆปๅผ่พพ7%็่ฏๅธ+ 3 20210524 18812912.60 12121352.00 0 ๆถจๅน ๅ็ฆปๅผ่พพ7%็่ฏๅธ+ 4 20210524 1684986.00 12076417.00 0 ๆถจๅน ๅ็ฆปๅผ่พพ7%็่ฏๅธ+ 5 20210524 37071259.81 3956982.00 1 ๆถจๅน ๅ็ฆปๅผ่พพ7%็่ฏๅธ+ 6 20210524 35168640.99 13344062.12 1 ๆถจๅน ๅ็ฆปๅผ่พพ7%็่ฏๅธ+ 7 20210524 21487772.44 84795.00 1 ๆถจๅน ๅ็ฆปๅผ่พพ7%็่ฏๅธ+ 8 20210524 19627524.05 25593683.67 1 ๆถจๅน ๅ็ฆปๅผ่พพ7%็่ฏๅธ+ 9 20210524 18812912.60 12121352.00 1 ๆถจๅน ๅ็ฆปๅผ่พพ7%็่ฏๅธ+ 10 20210524 28720777.05 53009929.06 0 ่ฟ็ปญไธไธชไบคๆๆฅๅ ๏ผๆถจๅน ๅ็ฆปๅผ็ดฏ่ฎก่พพ20%็่ฏๅธ+ 11 20210524 35504648.99 46382533.92 0 ่ฟ็ปญไธไธชไบคๆๆฅๅ ๏ผๆถจๅน ๅ็ฆปๅผ็ดฏ่ฎก่พพ20%็่ฏๅธ+ 12 20210524 35344119.44 46305551.88 0 ่ฟ็ปญไธไธชไบคๆๆฅๅ ๏ผๆถจๅน ๅ็ฆปๅผ็ดฏ่ฎก่พพ20%็่ฏๅธ+ 13 20210524 9091252.00 26481086.00 0 ่ฟ็ปญไธไธชไบคๆๆฅๅ ๏ผๆถจๅน ๅ็ฆปๅผ็ดฏ่ฎก่พพ20%็่ฏๅธ+ 14 20210524 23609443.87 23791701.41 0 ่ฟ็ปญไธไธชไบคๆๆฅๅ ๏ผๆถจๅน ๅ็ฆปๅผ็ดฏ่ฎก่พพ20%็่ฏๅธ+ 15 20210524 49699663.21 3956982.00 1 ่ฟ็ปญไธไธชไบคๆๆฅๅ ๏ผๆถจๅน ๅ็ฆปๅผ็ดฏ่ฎก่พพ20%็่ฏๅธ+ 16 20210524 35504648.99 46382533.92 1 ่ฟ็ปญไธไธชไบคๆๆฅๅ ๏ผๆถจๅน ๅ็ฆปๅผ็ดฏ่ฎก่พพ20%็่ฏๅธ+ 17 20210524 35344119.44 46305551.88 1 ่ฟ็ปญไธไธชไบคๆๆฅๅ ๏ผๆถจๅน ๅ็ฆปๅผ็ดฏ่ฎก่พพ20%็่ฏๅธ+ 18 20210524 29607924.52 19374138.00 1 ่ฟ็ปญไธไธชไบคๆๆฅๅ ๏ผๆถจๅน ๅ็ฆปๅผ็ดฏ่ฎก่พพ20%็่ฏๅธ+ 19 20210524 28720777.05 53009929.06 1 ่ฟ็ปญไธไธชไบคๆๆฅๅ ๏ผๆถจๅน ๅ็ฆปๅผ็ดฏ่ฎก่พพ20%็่ฏๅธ\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\351\276\231\350\231\216\346\246\234\346\257\217\346\227\245\347\273\237\350\256\241\345\215\225.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\351\276\231\350\231\216\346\246\234\346\257\217\346\227\245\347\273\237\350\256\241\345\215\225.md"new file mode 100644index 000000000..c90d94c09--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\346\211\223\346\235\277\344\270\223\351\242\230\346\225\260\346\215\256/\351\276\231\350\231\216\346\246\234\346\257\217\346\227\245\347\273\237\350\256\241\345\215\225.md"@@ -0,0 +1,136 @@+## ้พ่ๆฆๆฏๆฅๆ็ป+----++ๆฅๅฃ๏ผtop_list+ๆ่ฟฐ๏ผ้พ่ๆฆๆฏๆฅไบคๆๆ็ป+ๆฐๆฎๅๅฒ๏ผ 2005ๅนด่ณไป+้้๏ผๅๆฌก่ฏทๆฑ่ฟๅๆๅคง10000่กๆฐๆฎ๏ผๅฏ้่ฟๅๆฐๅพช็ฏ่ทๅๅ จ้จๅๅฒ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>+++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ+ts_code | str | N | ่ก็ฅจไปฃ็ ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ+ts_code | str | Y | TSไปฃ็ +name | str | Y | ๅ็งฐ+close | float | Y | ๆถ็ไปท+pct_change | float | Y | ๆถจ่ทๅน+turnover_rate | float | Y | ๆขๆ็+amount | float | Y | ๆปๆไบค้ข+l_sell | float | Y | ้พ่ๆฆๅๅบ้ข+l_buy | float | Y | ้พ่ๆฆไนฐๅ ฅ้ข+l_amount | float | Y | ้พ่ๆฆๆไบค้ข+net_amount | float | Y | ้พ่ๆฆๅไนฐๅ ฅ้ข+net_rate | float | Y | ้พ่ๆฆๅไนฐ้ขๅ ๆฏ+amount_rate | float | Y | ้พ่ๆฆๆไบค้ขๅ ๆฏ+float_values | float | Y | ๅฝๆฅๆต้ๅธๅผ+reason | str | Y | ไธๆฆ็็ฑ++<br>+<br>++**ๆฅๅฃ็จๆท**++```python++pro = ts.pro_api()++df = pro.top_list(trade_date='20180928')++ๆ่++df = pro.query('top_list', trade_date='20180928', ts_code='002219.SZ')++```++<br>+<br>++**ๆฐๆฎๆ ทไพ**++ trade_date ts_code name close pct_change turnover_rate \+ 0 20180928 000007.SZ ๅ จๆฐๅฅฝ 7.830 -10.0000 0.24+ 1 20180928 000017.SZ ๆทฑไธญๅA 4.660 9.9057 7.44+ 2 20180928 000505.SZ ไบฌ็ฒฎๆง่ก 5.750 9.9426 3.61+ 3 20180928 000566.SZ ๆตทๅๆตท่ฏ 6.120 10.0719 2.51+ 4 20180928 000593.SZ ๅคง้็ๆฐ 7.990 -8.0552 13.37+ 5 20180928 000971.SZ ้ซๅๆง่ก 3.990 -9.9323 0.94+ 6 20180928 002219.SZ ๆๅบทๅป็ 4.360 10.1010 7.11+ 7 20180928 002219.SZ ๆๅบทๅป็ 4.360 10.1010 7.11+ 8 20180928 002333.SZ ็ฝๆฎๆฏ้ 9.500 -9.9526 0.24+ 9 20180928 002445.SZ ไธญๅๆๅ 3.140 -6.5476 11.66+ 10 20180928 002813.SZ ่ทฏ็ ็งๆ 25.500 10.0086 18.48+ 11 20180928 002892.SZ ็งๅๅฐ 29.970 2.8130 25.67+ 12 20180928 002917.SZ ้ๅฅฅๅ 29.120 6.1611 28.33+ 13 20180928 002923.SZ ๆถฆ้ฝ่กไปฝ 26.700 0.0000 25.56+ 14 20180928 002930.SZ ๅฎๅทๆบๆ ง 30.990 10.0106 12.22+ 15 20180928 002931.SZ ้้พ่กไปฝ 35.310 10.0000 20.39++ amount l_sell l_buy l_amount net_amount \+ 0 13736952.0 1.373695e+07 9.071055e+06 2.280801e+07 -4.665897e+06+ 1 101054192.0 7.329639e+06 2.836120e+07 3.569084e+07 2.103156e+07+ 2 74555564.0 8.547019e+06 2.143432e+07 2.998134e+07 1.288731e+07+ 3 165464131.0 2.555165e+07 2.192522e+07 4.747687e+07 -3.626437e+06+ 4 307769383.0 4.250203e+07 1.169383e+07 5.419587e+07 -3.080820e+07+ 5 22255422.0 5.998390e+06 3.371550e+06 9.369940e+06 -2.626840e+06+ 6 550236631.0 4.180139e+07 3.942085e+07 8.122223e+07 -2.380538e+06+ 7 800737935.0 6.724486e+07 5.763500e+07 1.248799e+08 -9.609865e+06+ 8 10943050.0 1.094305e+07 2.862350e+06 1.380540e+07 -8.080700e+06+ 9 477766761.0 3.059160e+07 7.482957e+07 1.054212e+08 4.423796e+07+ 10 138607013.0 1.219620e+07 2.408786e+07 3.628407e+07 1.189166e+07+ 11 199046728.0 5.973278e+07 3.066344e+07 9.039623e+07 -2.906934e+07+ 12 229118953.0 1.285196e+07 1.632610e+07 2.917805e+07 3.474138e+06+ 13 203570158.0 4.148259e+07 2.583138e+07 6.731397e+07 -1.565121e+07+ 14 226882184.0 1.456010e+07 6.502630e+07 7.958640e+07 5.046621e+07+ 15 151875439.0 2.016411e+07 2.434384e+07 4.450795e+07 4.179725e+06++ net_rate amount_rate float_values \+ 0 -33.97 166.03 2.419063e+09+ 1 20.81 35.32 1.411891e+09+ 2 17.29 40.21 2.072708e+09+ 3 -2.19 28.69 6.751556e+09+ 4 -10.01 17.61 2.235541e+09+ 5 -11.80 42.10 2.359132e+09+ 6 -0.43 14.76 8.132328e+09+ 7 -1.20 15.60 8.132328e+09+ 8 -73.84 126.16 4.607212e+09+ 9 9.26 22.07 4.078696e+09+ 10 8.58 26.18 7.650000e+08+ 11 -14.60 45.41 7.892899e+08+ 12 1.52 12.73 8.232224e+08+ 13 -7.69 33.07 8.010000e+08+ 14 22.24 35.08 1.885122e+09+ 15 2.75 29.31 7.845882e+08++ reason+ 0 ๆฅ่ทๅน ๅ็ฆปๅผ่พพๅฐ7%็ๅไบๅช่ฏๅธ+ 1 ๆฅๆถจๅน ๅ็ฆปๅผ่พพๅฐ7%็ๅไบๅช่ฏๅธ+ 2 ๆฅๆถจๅน ๅ็ฆปๅผ่พพๅฐ7%็ๅไบๅช่ฏๅธ+ 3 ๆฅๆถจๅน ๅ็ฆปๅผ่พพๅฐ7%็ๅไบๅช่ฏๅธ+ 4 ๆฅ่ทๅน ๅ็ฆปๅผ่พพๅฐ7%็ๅไบๅช่ฏๅธ+ 5 ๆฅ่ทๅน ๅ็ฆปๅผ่พพๅฐ7%็ๅไบๅช่ฏๅธ+ 6 ๆฅๆถจๅน ๅ็ฆปๅผ่พพๅฐ7%็ๅไบๅช่ฏๅธ+ 7 ่ฟ็ปญไธไธชไบคๆๆฅๅ ๏ผๆถจๅน ๅ็ฆปๅผ็ดฏ่ฎก่พพๅฐ20%็่ฏๅธ+ 8 ๆฅ่ทๅน ๅ็ฆปๅผ่พพๅฐ7%็ๅไบๅช่ฏๅธ+ 9 ๆฅ่ทๅน ๅ็ฆปๅผ่พพๅฐ7%็ๅไบๅช่ฏๅธ+ 10 ๆฅๆถจๅน ๅ็ฆปๅผ่พพๅฐ7%็ๅไบๅช่ฏๅธ+ 11 ๆฅๆขๆ็่พพๅฐ20%็ๅไบๅช่ฏๅธ+ 12 ๆฅๆขๆ็่พพๅฐ20%็ๅไบๅช่ฏๅธ+ 13 ๆฅๆขๆ็่พพๅฐ20%็ๅไบๅช่ฏๅธ+ 14 ๆฅๆถจๅน ๅ็ฆปๅผ่พพๅฐ7%็ๅไบๅช่ฏๅธ+ 15 ๆฅๆถจๅน ๅ็ฆปๅผ่พพๅฐ7%็ๅไบๅช่ฏๅธ\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/AH\350\202\241\346\257\224\344\273\267.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/AH\350\202\241\346\257\224\344\273\267.md"new file mode 100644index 000000000..db116ea4a--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/AH\350\202\241\346\257\224\344\273\267.md"@@ -0,0 +1,74 @@+## AH่กๆฏไปท+----++ๆฅๅฃ๏ผstk_ah_comparison๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆ่ฟฐ๏ผAH่กๆฏไปทๆฐๆฎ๏ผๅฏๆ นๆฎไบคๆๆฅๆ่ทๅๅๅฒ+ๆ้๏ผ5000็งฏๅ่ตท+ๆ็คบ๏ผๆฏๅคฉ็ๅ17:00ๆดๆฐ๏ผๅๆฌก่ฏทๆฑๆๅคง่ฟๅ1000่กๆฐๆฎ๏ผๅฏๅพช็ฏๆๅ,ๆฌๆฅๅฃๆฐๆฎไป20250812ๅผๅง๏ผ็ฑไบๅๅฒไธๅฅฝ่กฅๅ ๏ผๅช่ฝ็ดฏ็งฏ+++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+hk_code | str | N | ๆธฏ่ก่ก็ฅจไปฃ็ ๏ผxxxxx.HK)+ts_code | str | N | A่ก็ฅจไปฃ็ (xxxxxx.SH/SZ/BJ)+trade_date | str | N | ไบคๆๆฅๆ๏ผๆ ผๅผ๏ผYYYYMMDDไธๅ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+hk_code | str | Y | ๆธฏ่ก่ก็ฅจไปฃ็ +ts_code | str | Y | A่ก่ก็ฅจไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+hk_name | str | Y | ๆธฏ่ก่ก็ฅจๅ็งฐ+hk_pct_chg | float | Y | ๆธฏ่ก่ก็ฅจๆถจ่ทๅน+hk_close | float | Y | ๆธฏ่ก่ก็ฅจๆถ็ไปท+name | str | Y | A่ก่ก็ฅจๅ็งฐ+close | float | Y | A่ก่ก็ฅจๆถ็ไปท+pct_chg | float | Y | A่ก่ก็ฅจๆถจ่ทๅน+ah_comparison | float | Y | ๆฏไปท(A/H)+ah_premium | float | Y | ๆบขไปท(A/H)%++<br>+<br>++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++#่ทๅ20250812ๆฅๆๆ็AH่กๆฏไปทๆฐๆฎ+df = pro.stk_ah_comparison(trade_date='20250812')+++```++<br>+<br>++**ๆฐๆฎๆ ทไพ**++ hk_code ts_code trade_date hk_name hk_pct_chg hk_close name close pct_chg ah_comparison ah_premium+ 0 02068.HK 601068.SH 20250812 ไธญ้ๅฝ้ 0.78 2.60 ไธญ้ๅฝ้ 5.14 0.00 2.16 115.84+ 1 03993.HK 603993.SH 20250812 ๆด้ณ้ผไธ 0.60 10.07 ๆด้ณ้ผไธ 9.85 0.31 1.07 6.80+ 2 06066.HK 601066.SH 20250812 ไธญไฟกๅปบๆ่ฏๅธ 1.77 13.25 ไธญไฟกๅปบๆ 26.09 0.66 2.15 114.99+ 3 06680.HK 300748.SZ 20250812 ้ๅๆฐธ็ฃ -5.67 18.30 ้ๅๆฐธ็ฃ 27.30 -3.05 1.63 62.88+ 4 02333.HK 601633.SH 20250812 ้ฟๅๆฑฝ่ฝฆ 3.55 14.60 ้ฟๅๆฑฝ่ฝฆ 22.93 1.82 1.71 71.48+ .. ... ... ... ... ... ... ... ... ... ... ...+ 155 06196.HK 002936.SZ 20250812 ้ๅท้ถ่ก 1.41 1.44 ้ๅท้ถ่ก 2.10 0.48 1.59 59.22+ 156 06818.HK 601818.SH 20250812 ไธญๅฝๅ ๅคง้ถ่ก 1.61 3.78 ๅ ๅคง้ถ่ก 4.10 0.99 1.18 18.43+ 157 06693.HK 600988.SH 20250812 ่ตคๅณฐ้ป้ 1.76 25.44 ่ตคๅณฐ้ป้ 24.58 0.24 1.05 5.49+ 158 02196.HK 600196.SH 20250812 ๅคๆๅป่ฏ 2.22 19.77 ๅคๆๅป่ฏ 27.70 3.36 1.53 52.98+ 159 01065.HK 600874.SH 20250812 ๅคฉๆดฅๅไธ็ฏไฟ่กไปฝ 2.24 4.10 ๅไธ็ฏไฟ 6.01 0.00 1.60 60.05+diff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\344\270\255\345\244\256\347\273\223\347\256\227\347\263\273\347\273\237\346\214\201\350\202\241\346\230\216\347\273\206.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\344\270\255\345\244\256\347\273\223\347\256\227\347\263\273\347\273\237\346\214\201\350\202\241\346\230\216\347\273\206.md"new file mode 100644index 000000000..3aa3eb7a0--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\344\270\255\345\244\256\347\273\223\347\256\227\347\263\273\347\273\237\346\214\201\350\202\241\346\230\216\347\273\206.md"@@ -0,0 +1,63 @@+## ไธญๅคฎ็ป็ฎ็ณป็ปๆ่กๆ็ป+----++ๆฅๅฃ๏ผccass_hold_detail+ๆ่ฟฐ๏ผ่ทๅไธญๅคฎ็ป็ฎ็ณป็ปๆบๆๅธญไฝๆ่กๆ็ป๏ผๆฐๆฎ่ฆ็**ๅ จๅๅฒ**๏ผๆ นๆฎไบคๆๆๆซ้ฒๆถ้ด๏ผๅฝๆฅๆฐๆฎๅจไธไธไบคๆๆฅๆฉไธ9็นๅๅฎๆ+้้๏ผๅๆฌกๆๅคง่ฟๅ6000ๆกๆฐๆฎ๏ผๅฏไปฅๅพช็ฏๆๅ้กตๆๅ+็งฏๅ๏ผ็จๆท็งฏ8000็งฏๅๅฏ่ฐๅ๏ผๆฏๅ้ๅฏไปฅ่ฏทๆฑ300ๆฌก++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ (e.g. 605009.SH)+hk_code | str | N | ๆธฏไบคๆไปฃ็ ๏ผe.g. 95009๏ผ+trade_date | str | N | ไบคๆๆฅๆ(YYYYMMDDๆ ผๅผ๏ผไธๅ)+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ+ts_code | str | Y | ่ก็ฅจไปฃๅท+name | str | Y | ่ก็ฅจๅ็งฐ+col_participant_id | str | Y | ๅไธ่ ็ผๅท+col_participant_name | str | Y | ๆบๆๅ็งฐ+col_shareholding | str | Y | ๆ่ก้(่ก)+col_shareholding_percent | str | Y | ๅ ๅทฒๅ่ก่กไปฝ/ๆ่ฏ/ๅไฝ็พๅๆฏ(%)++<br>+<br>++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++df = pro.ccass_hold_detail(ts_code='00960.HK', trade_date='20211101', fields='trade_date,ts_code,col_participant_id,col_participant_name,col_shareholding')++```++**ๆฐๆฎๆ ทไพ**++ trade_date ts_code col_participant_id col_participant_name col_shareholding+ 0 20211101 00960.HK B01777 ๅคงๅ่ตๆฌๅธๅบ้ฆๆธฏๆ้ๅ ฌๅธ 3000+ 1 20211101 00960.HK B01977 ไธญ่ดข่ฏๅธๆ้ๅ ฌๅธ 3000+ 2 20211101 00960.HK B02068 ๅคไธฐ่ฏๅธๆ้ๅ ฌๅธ 3000+ 3 20211101 00960.HK B01413 ไบฌๅๅฑฑไธๅฝ้ (้ฆๆธฏ)ๆ้ๅ ฌๅธ 2500+ 4 20211101 00960.HK B02120 ๅฉๅผ่ซๅฐ่ฏๅธๆ้ๅ ฌๅธ 2500+ .. ... ... ... ... ...+ 164 20211101 00960.HK B01459 ๅฅไธฐ่ฏๅธ(้ฆๆธฏ)ๆ้ๅ ฌๅธ 3000+ 165 20211101 00960.HK B01508 ่ฅฟ่ฏ(้ฆๆธฏ)่ฏๅธ็ป็บชๆ้ๅ ฌๅธ 3000+ 166 20211101 00960.HK B01511 ่พพๅฉ่ฏๅธๆ้ๅ ฌๅธ 3000+ 167 20211101 00960.HK B01657 ๆฅ็ๅๅฏ่ฏๅธๅฝ้ ๆ้ๅ ฌๅธ 3000+ 168 20211101 00960.HK B01712 ๅ็่ฏๅธๆ้ๅ ฌๅธ 3000\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\344\270\255\345\244\256\347\273\223\347\256\227\347\263\273\347\273\237\346\214\201\350\202\241\347\273\237\350\256\241.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\344\270\255\345\244\256\347\273\223\347\256\227\347\263\273\347\273\237\346\214\201\350\202\241\347\273\237\350\256\241.md"new file mode 100644index 000000000..b7709958d--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\344\270\255\345\244\256\347\273\223\347\256\227\347\263\273\347\273\237\346\214\201\350\202\241\347\273\237\350\256\241.md"@@ -0,0 +1,60 @@+## ไธญๅคฎ็ป็ฎ็ณป็ปๆ่กๆฑๆป+----++ๆฅๅฃ๏ผccass_hold+ๆ่ฟฐ๏ผ่ทๅไธญๅคฎ็ป็ฎ็ณป็ปๆ่กๆฑๆปๆฐๆฎ๏ผ่ฆ็ๅ จ้จๅๅฒๆฐๆฎ๏ผๆ นๆฎไบคๆๆๆซ้ฒๆถ้ด๏ผๅฝๆฅๆฐๆฎๅจไธไธไบคๆๆฅๆฉไธ9็นๅๅฎๆๅ ฅๅบ+้้๏ผๅๆฌกๆๅคง5000ๆกๆฐๆฎ๏ผๅฏๅพช็ฏๆๅ้กตๆไพๅ จ้จ+็งฏๅ๏ผ็จๆท120็งฏๅๅฏไปฅ่ฏ็จ็ๆฐๆฎ๏ผ5000็งฏๅๆฏๅ้ๅฏไปฅ่ฏทๆฑ300ๆฌก๏ผ8000็งฏๅไปฅไธๅฏไปฅ่ฏทๆฑ500ๆฌกๆฏๅ้๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ (e.g. 605009.SH)+hk_code | str | N | ๆธฏไบคๆไปฃ็ ๏ผe.g. 95009๏ผ+trade_date | str | N | ไบคๆๆฅๆ(YYYYMMDDๆ ผๅผ๏ผไธๅ)+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ+ts_code | str | Y | ่ก็ฅจไปฃๅท+name | str | Y | ่ก็ฅจๅ็งฐ+shareholding | str | Y | ไบไธญๅคฎ็ป็ฎ็ณป็ป็ๆ่ก้(่ก)<br>Shareholding in CCASS+hold_nums | str | Y | ๅไธ่ ๆฐ็ฎ๏ผไธช๏ผ+hold_ratio | str | Y | ๅ ไบไธไบคๆไธๅธๅไบคๆ็A่กๆปๆฐ็็พๅๆฏ๏ผ%๏ผ<br>% of the total number of A shares listed and traded on the SSE++Note:+1. The total number of A shares listed and traded on the SSE of the relevant SSE-listed company used for calculating the percentage of shareholding may not have taken into account any change in connection with or as a result of any corporate actions of the relevant company and hence, may not be up-to-date. The percentage of shareholding is for reference only.+2. The total number of A shares listed and traded on the SSE of the relevant SSE-listed company used for calculating the percentage of shareholding may not be equal to the actual total number of issued shares of that company.++<br>+<br>++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++df = pro.ccass_hold(ts_code='00960.HK')++```++**ๆฐๆฎๆ ทไพ**++ trade_date ts_code name shareholding hold_nums hold_ratio+ 0 20220519 00960.HK ้พๆน้ๅ 4576163843 182 75.30+ 1 20220518 00960.HK ้พๆน้ๅ 4576043843 182 75.30+ 2 20220517 00960.HK ้พๆน้ๅ 4575955343 180 75.30+ 3 20220516 00960.HK ้พๆน้ๅ 4575905343 179 75.30+ 4 20220513 00960.HK ้พๆน้ๅ 4575905343 181 75.30\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\345\210\270\345\225\206\346\234\210\345\272\246\351\207\221\350\202\241.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\345\210\270\345\225\206\346\234\210\345\272\246\351\207\221\350\202\241.md"new file mode 100644index 000000000..33bdb2f3e--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\345\210\270\345\225\206\346\234\210\345\272\246\351\207\221\350\202\241.md"@@ -0,0 +1,49 @@+## ๅธๅๆฏๆ่่ก+----++ๆฅๅฃ๏ผbroker_recommend+ๆ่ฟฐ๏ผ่ทๅๅธๅๆๅบฆ้่ก๏ผไธ่ฌ1ๆฅ~3ๆฅๅ ๆดๆฐๅฝๆๆฐๆฎ+้้๏ผๅๆฌกๆๅคง1000่กๆฐๆฎ๏ผๅฏๅพช็ฏๆๅ+็งฏๅ๏ผ็งฏๅ่พพๅฐ6000ๅณๅฏ่ฐ็จ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+month | str | Y | ๆๅบฆ๏ผYYYYMM๏ผ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+month | str | Y | ๆๅบฆ+broker | str | Y | ๅธๅ+ts_code | str | Y | ่ก็ฅจไปฃ็ +name | str | Y | ่ก็ฅจ็ฎ็งฐ+++**ๆฅๅฃ็คบไพ**++```python++#่ทๅๆฅ่ฏขๆไปฝๅธๅ้่ก+df = pro.broker_recommend(month='202106')++```+++**ๆฐๆฎ็คบไพ**++ month broker ts_code name+ 0 202106 ไธๅ ด่ฏๅธ 000066.SZ ไธญๅฝ้ฟๅ+ 1 202106 ไธๅ ด่ฏๅธ 000708.SZ ไธญไฟก็น้ข+ 2 202106 ไธๅ ด่ฏๅธ 002304.SZ ๆดๆฒณ่กไปฝ+ 3 202106 ไธๅ ด่ฏๅธ 003816.SZ ไธญๅฝๅนฟๆ ธ+ 4 202106 ไธๅ ด่ฏๅธ 300196.SZ ้ฟๆตท่กไปฝ+ .. ... ... ... ...+ 263 202106 ้ฟๅ่ฏๅธ 600096.SH ไบๅคฉๅ+ 264 202106 ้ฟๅ่ฏๅธ 600809.SH ๅฑฑ่ฅฟๆฑพ้ + 265 202106 ้ฟๅ่ฏๅธ 603596.SH ไผฏ็นๅฉ+ 266 202106 ้ฟๅ่ฏๅธ 603885.SH ๅ็ฅฅ่ช็ฉบ+ 267 202106 ้ฟๅ่ฏๅธ 605068.SH ๆๆฐๆญ่ พdiff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\345\210\270\345\225\206\347\233\210\345\210\251\351\242\204\346\265\213\346\225\260\346\215\256.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\345\210\270\345\225\206\347\233\210\345\210\251\351\242\204\346\265\213\346\225\260\346\215\256.md"new file mode 100644index 000000000..801ae81e4--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\345\210\270\345\225\206\347\233\210\345\210\251\351\242\204\346\265\213\346\225\260\346\215\256.md"@@ -0,0 +1,80 @@+## ๅๆน็ๅฉ้ขๆตๆฐๆฎ+----++ๆฅๅฃ๏ผreport_rc+ๆ่ฟฐ๏ผ่ทๅๅธๅ๏ผๅๆน๏ผๆฏๅคฉ็ ๆฅ็็ๅฉ้ขๆตๆฐๆฎ๏ผๆฐๆฎไป2010ๅนดๅผๅง๏ผๆฏๆ19~22็นๆดๆฐๅฝๆฅๆฐๆฎ+้้๏ผๅๆฌกๆๅคง3000ๆก๏ผๅฏๅ้กตๅๅพช็ฏๆๅๆๆๆฐๆฎ+ๆ้๏ผๆฌๆฅๅฃ120็งฏๅๅฏไปฅ่ฏ็จ๏ผๆฏๅคฉ10ๆฌก่ฏทๆฑ๏ผๆญฃๅผๆ้้8000็งฏๅ๏ผๆฏๅคฉๅฏ่ฏทๆฑ100000ๆฌก๏ผ10000็งฏๅไปฅไธๆ ๆป้้ๅถใ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ +report_date | str | N | ๆฅๅๆฅๆ+start_date | str | N | ๆฅๅๅผๅงๆฅๆ+end_date | str | N | ๆฅๅ็ปๆๆฅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +name | str | Y | ่ก็ฅจๅ็งฐ+report_date | str | Y | ็ ๆฅๆฅๆ+report_title | str | Y | ๆฅๅๆ ้ข+report_type | str | Y | ๆฅๅ็ฑปๅ+classify | str | Y | ๆฅๅๅ็ฑป+org_name | str | Y | ๆบๆๅ็งฐ+author_name | str | Y | ไฝ่+quarter | str | Y | ้ขๆตๆฅๅๆ+op_rt | float | Y | ้ขๆต่ฅไธๆถๅ ฅ๏ผไธๅ ๏ผ+op_pr | float | Y | ้ขๆต่ฅไธๅฉๆถฆ๏ผไธๅ ๏ผ+tp | float | Y | ้ขๆตๅฉๆถฆๆป้ข๏ผไธๅ ๏ผ+np | float | Y | ้ขๆตๅๅฉๆถฆ๏ผไธๅ ๏ผ+eps | float | Y | ้ขๆตๆฏ่กๆถ็๏ผๅ ๏ผ+pe | float | Y | ้ขๆตๅธ็็+rd | float | Y | ้ขๆต่กๆฏ็+roe | float | Y | ้ขๆตๅ่ตไบงๆถ็็+ev_ebitda | float | Y | ้ขๆตEV/EBITDA+rating | str | Y | ๅๆน่ฏ็บง+max_price | float | Y | ้ขๆตๆ้ซ็ฎๆ ไปท+min_price | float | Y | ้ขๆตๆไฝ็ฎๆ ไปท+imp_dg | str | N | ๆบๆๅ ณๆณจๅบฆ+create_time | datetime | N | TSๆฐๆฎๆดๆฐๆถ้ด++<br>+<br>++**ๆฅๅฃ็จๆณ**+```python++pro = ts.pro_api()++df = pro.report_rc(ts_code='', report_date='20220429')++```++<br>+<br>++**ๆฐๆฎๆ ทไพ**++ ts_code name report_date classify org_name quarter eps pe+ 0 000733.SZ ๆฏๅ็งๆ 20220429 ไธ่ฌๆฅๅ ๅฎไฟก่ฏๅธ 2024Q4 6.7800 14.2000+ 1 000858.SZ ไบ็ฒฎๆถฒ 20220429 ไธ่ฌๆฅๅ ๅ่ฅฟ่ฏๅธ 2022Q4 6.9800 23.7700+ 2 000858.SZ ไบ็ฒฎๆถฒ 20220429 ไธ่ฌๆฅๅ ๅ่ฅฟ่ฏๅธ 2023Q4 8.2200 20.1800+ 3 000858.SZ ไบ็ฒฎๆถฒ 20220429 ไธ่ฌๆฅๅ ๅ่ฅฟ่ฏๅธ 2024Q4 9.5800 17.3100+ 4 000858.SZ ไบ็ฒฎๆถฒ 20220429 ไธ่ฌๆฅๅ ไฟก่พพ่ฏๅธ 2022Q4 7.1100 23.3100+ ... ... ... ... ... ... ... ... ...+ 2552 688385.SH ๅคๆฆๅพฎ็ต 20220429 ไธ่ฌๆฅๅ ๆนๆญฃ่ฏๅธ 2022Q4 0.9100 62.7000+ 2553 688385.SH ๅคๆฆๅพฎ็ต 20220429 ไธ่ฌๆฅๅ ๆนๆญฃ่ฏๅธ 2023Q4 1.1600 49.1900+ 2554 688385.SH ๅคๆฆๅพฎ็ต 20220429 ไธ่ฌๆฅๅ ๆนๆญฃ่ฏๅธ 2024Q4 1.5800 36.3200+ 2555 000733.SZ ๆฏๅ็งๆ 20220429 ไธ่ฌๆฅๅ ๅฎไฟก่ฏๅธ 2022Q4 4.3000 22.4000+ 2556 000733.SZ ๆฏๅ็งๆ 20220429 ไธ่ฌๆฅๅ ๅฎไฟก่ฏๅธ 2023Q4 5.4100 17.8000diff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\346\234\272\346\236\204\350\260\203\347\240\224\346\225\260\346\215\256.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\346\234\272\346\236\204\350\260\203\347\240\224\346\225\260\346\215\256.md"new file mode 100644index 000000000..c8056ce28--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\346\234\272\346\236\204\350\260\203\347\240\224\346\225\260\346\215\256.md"@@ -0,0 +1,66 @@+## ๆบๆ่ฐ็ ่กจ+----++ๆฅๅฃ๏ผstk_surv+ๆ่ฟฐ๏ผ่ทๅไธๅธๅ ฌๅธๆบๆ่ฐ็ ่ฎฐๅฝๆฐๆฎ+้้๏ผๅๆฌกๆๅคง่ทๅ100ๆกๆฐๆฎ๏ผๅฏๅพช็ฏๆๅ้กตๆๅ+็งฏๅ๏ผ็จๆท็งฏ5000็งฏๅๅฏไฝฟ็จ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ +trade_date | str | N | ่ฐ็ ๆฅๆ+start_date | str | N | ่ฐ็ ๅผๅงๆฅๆ+end_date | str | N | ่ฐ็ ็ปๆๆฅๆ++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +name | str | Y | ่ก็ฅจๅ็งฐ+surv_date | str | Y | ่ฐ็ ๆฅๆ+fund_visitors | str | Y | ๆบๆๅไธไบบๅ+rece_place | str | Y | ๆฅๅพ ๅฐ็น+rece_mode | str | Y | ๆฅๅพ ๆนๅผ+rece_org | str | Y | ๆฅๅพ ็ๅ ฌๅธ+org_type | str | Y | ๆฅๅพ ๅ ฌๅธ็ฑปๅ+comp_rece | str | Y | ไธๅธๅ ฌๅธๆฅๅพ ไบบๅ+content | None | N | ่ฐ็ ๅ ๅฎน++<br>+<br>+++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++df = pro.stk_surv(ts_code='002223.SZ', trade_date='20211024', fields='ts_code,name,surv_date,fund_visitors,rece_place,rece_mode,rece_org')++```++**ๆฐๆฎๆ ทไพ**++ ts_code name surv_date fund_visitors rece_place rece_mode rece_org+ 1 002223.SZ ้ฑผ่ทๅป็ 20211024 ้ๆทผ ็ต่ฏไผ่ฎฎ ็นๅฎๅฏน่ฑก่ฐ็ ๅฎ็ๅบ้+ 2 002223.SZ ้ฑผ่ทๅป็ 20211024 ็งฆ็ถๅฝ ็ต่ฏไผ่ฎฎ ็นๅฎๅฏน่ฑก่ฐ็ ่ด่ฑๅพท่ตไบง็ฎก็+ 3 002223.SZ ้ฑผ่ทๅป็ 20211024 ่ฐญ้ฃ ็ต่ฏไผ่ฎฎ ็นๅฎๅฏน่ฑก่ฐ็ ๅ่ฟๅบ้+ 4 002223.SZ ้ฑผ่ทๅป็ 20211024 ๆๆ ็ต่ฏไผ่ฎฎ ็นๅฎๅฏน่ฑก่ฐ็ ๅ้ๅไฟกๅบ้+ .. ... ... ... ... ... ... ...+ 77 002223.SZ ้ฑผ่ทๅป็ 20211024 ๆ่น่พพ ็ต่ฏไผ่ฎฎ ็นๅฎๅฏน่ฑก่ฐ็ ไธญไฟกๅปบๆ+ 78 002223.SZ ้ฑผ่ทๅป็ 20211024 ๆๆ่ ็ต่ฏไผ่ฎฎ ็นๅฎๅฏน่ฑก่ฐ็ ไธญ้ถๅฝ้+ 79 002223.SZ ้ฑผ่ทๅป็ 20211024 ็ไฟ ็ต่ฏไผ่ฎฎ ็นๅฎๅฏน่ฑก่ฐ็ ้ๅบ็ฉฟ็ณๆ่ต+ 80 002223.SZ ้ฑผ่ทๅป็ 20211024 ๆๆฌ ็ต่ฏไผ่ฎฎ ็นๅฎๅฏน่ฑก่ฐ็ ๆฑ้ๅบ้+ 81 002223.SZ ้ฑผ่ทๅป็ 20211024 ๅพ็จ็จ ็ต่ฏไผ่ฎฎ ็นๅฎๅฏน่ฑก่ฐ็ ้ๆต่ตไบง็ฎก็\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\346\257\217\346\227\245\347\255\271\347\240\201\345\210\206\345\270\203.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\346\257\217\346\227\245\347\255\271\347\240\201\345\210\206\345\270\203.md"new file mode 100644index 000000000..aa0c9f0c7--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\346\257\217\346\227\245\347\255\271\347\240\201\345\210\206\345\270\203.md"@@ -0,0 +1,64 @@+## ๆฏๆฅ็ญน็ ๅๅธ+----++ๆฅๅฃ๏ผcyq_chips+ๆ่ฟฐ๏ผ่ทๅA่กๆฏๆฅ็็ญน็ ๅๅธๆ ๅต๏ผๆไพๅไปทไฝๅ ๆฏ๏ผๆฐๆฎไป2018ๅนดๅผๅง๏ผๆฏๅคฉ18~19็นไน้ดๆดๆฐๅฝๆฅๆฐๆฎ+ๆฅๆบ๏ผTushare็คพๅบ+้้๏ผๅๆฌกๆๅคง2000ๆก๏ผๅฏไปฅๆ่ก็ฅจไปฃ็ ๅๆฅๆๅพช็ฏๆๅ+็งฏๅ๏ผ5000็งฏๅๆฏๅคฉ20000ๆฌก๏ผ10000็งฏๅๆฏๅคฉ200000ๆฌก๏ผ15000็งฏๅๆฏๅคฉไธ้ๆป้++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ๏ผYYYYMMDD๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+price | float | Y | ๆๆฌไปทๆ ผ+percent | float | Y | ไปทๆ ผๅ ๆฏ๏ผ%๏ผ++<br>+<br>++**ๆฅๅฃ็จๆณ**+```python++pro = ts.pro_api()++df = pro.cyq_chips(ts_code='600000.SH', start_date='20220101', end_date='20220429')++```++<br>+<br>++**ๆฐๆฎๆ ทไพ**++ ts_code trade_date price percent+ 0 600000.SH 20220429 8.96 0.56+ 1 600000.SH 20220429 8.94 0.40+ 2 600000.SH 20220429 8.92 0.34+ 3 600000.SH 20220429 8.90 0.32+ 4 600000.SH 20220429 8.88 0.27+ .. ... ... ... ...+ 995 600000.SH 20220418 7.26 0.01+ 996 600000.SH 20220418 7.24 0.01+ 997 600000.SH 20220418 7.22 0.01+ 998 600000.SH 20220418 7.20 0.01+ 999 600000.SH 20220418 7.18 0.01\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\346\257\217\346\227\245\347\255\271\347\240\201\345\217\212\350\203\234\347\216\207.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\346\257\217\346\227\245\347\255\271\347\240\201\345\217\212\350\203\234\347\216\207.md"new file mode 100644index 000000000..8f6ac8696--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\346\257\217\346\227\245\347\255\271\347\240\201\345\217\212\350\203\234\347\216\207.md"@@ -0,0 +1,70 @@+## ๆฏๆฅ็ญน็ ๅ่็+----++ๆฅๅฃ๏ผcyq_perf+ๆ่ฟฐ๏ผ่ทๅA่กๆฏๆฅ็ญน็ ๅนณๅๆๆฌๅ่็ๆ ๅต๏ผๆฏๅคฉ18~19็นๅทฆๅณๆดๆฐ๏ผๆฐๆฎไป2018ๅนดๅผๅง+ๆฅๆบ๏ผTushare็คพๅบ+้้๏ผๅๆฌกๆๅคง5000ๆก๏ผๅฏไปฅๅ้กตๆ่ ๅพช็ฏๆๅ+็งฏๅ๏ผ5000็งฏๅๆฏๅคฉ20000ๆฌก๏ผ10000็งฏๅๆฏๅคฉ200000ๆฌก๏ผ15000็งฏๅๆฏๅคฉไธ้ๆป้++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ๏ผYYYYMMDD๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+his_low | float | Y | ๅๅฒๆไฝไปท+his_high | float | Y | ๅๅฒๆ้ซไปท+cost_5pct | float | Y | 5ๅไฝๆๆฌ+cost_15pct | float | Y | 15ๅไฝๆๆฌ+cost_50pct | float | Y | 50ๅไฝๆๆฌ+cost_85pct | float | Y | 85ๅไฝๆๆฌ+cost_95pct | float | Y | 95ๅไฝๆๆฌ+weight_avg | float | Y | ๅ ๆๅนณๅๆๆฌ+winner_rate | float | Y | ่็++<br>+<br>++**ๆฅๅฃ็จๆณ**+```python++pro = ts.pro_api()++df = pro.cyq_perf(ts_code='600000.SH', start_date='20220101', end_date='20220429')++```++<br>+<br>++**ๆฐๆฎๆ ทไพ**++ ts_code trade_date his_low his_high cost_5pct cost_95pct weight_avg winner_rate+ 0 600000.SH 20220429 0.72 12.16 8.18 11.34 9.76 3.52+ 1 600000.SH 20220428 0.72 12.16 8.24 11.34 9.76 3.08+ 2 600000.SH 20220427 0.72 12.16 8.30 11.34 9.76 1.71+ 3 600000.SH 20220426 0.72 12.16 8.34 11.34 9.76 2.02+ 4 600000.SH 20220425 0.72 12.16 8.36 11.34 9.77 1.44+ .. ... ... ... ... ... ... ... ...+ 72 600000.SH 20220110 0.72 12.16 8.60 11.36 9.89 7.62+ 73 600000.SH 20220107 0.72 12.16 8.60 11.36 9.89 7.59+ 74 600000.SH 20220106 0.72 12.16 8.60 11.36 9.89 3.92+ 75 600000.SH 20220105 0.72 12.16 8.60 11.36 9.89 5.65+ 76 600000.SH 20220104 0.72 12.16 8.60 11.36 9.89 3.93\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\346\262\252\346\267\261\350\202\241\351\200\232\346\214\201\350\202\241\346\230\216\347\273\206.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\346\262\252\346\267\261\350\202\241\351\200\232\346\214\201\350\202\241\346\230\216\347\273\206.md"new file mode 100644index 000000000..083ea9388--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\346\262\252\346\267\261\350\202\241\351\200\232\346\214\201\350\202\241\346\230\216\347\273\206.md"@@ -0,0 +1,90 @@+ๆฒชๆทฑๆธฏ่ก้ๆ่กๆ็ป+----++ๆฅๅฃ๏ผhk_hold๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆ่ฟฐ๏ผ่ทๅๆฒชๆทฑๆธฏ่ก้ๆ่กๆ็ป๏ผๆฐๆฎๆฅๆบๆธฏไบคๆใ+้้๏ผๅๆฌกๆๅคๆๅ3800ๆก่ฎฐๅฝ๏ผๅฏๅพช็ฏ่ฐๅ๏ผๆป้ไธ้ๅถ+็งฏๅ๏ผ็จๆท็งฏ120็งฏๅๅฏ่ฐๅ่ฏ็จ๏ผ2000็งฏๅๅฏๆญฃๅธธไฝฟ็จ๏ผๅไฝๅ้ๆๆตๆง๏ผ็งฏๅ่ถ้ซๆต้่ถๅคง๏ผ่ฏท่ช่กๆ้ซ็งฏๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++่ฏดๆ๏ผไบคๆๆไบไป2024ๅนด8ๆ20ๅผๅงๅๆญขๅๅธๆฅๅบฆๅๅ่ต้ๆฐๆฎ๏ผๆนไธบๅญฃๅบฆๆซ้ฒ++<br>+<br>+++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+code | str | N | ไบคๆๆไปฃ็ +ts_code | str | N | TS่ก็ฅจไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+exchange | str | N | ็ฑปๅ๏ผSHๆฒช่ก้๏ผๅๅ๏ผSZๆทฑ่ก้๏ผๅๅ๏ผHKๆธฏ่ก้๏ผๅๅๆ่ก๏ผ+++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+code | str | Y | ๅๅงไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+ts_code | str | Y | TSไปฃ็ +name | str | Y | ่ก็ฅจๅ็งฐ+vol | int | Y | ๆ่กๆฐ้(่ก)+ratio | float | Y | ๆ่กๅ ๆฏ๏ผ%๏ผ๏ผๅ ๅทฒๅ่ก่กไปฝ็พๅๆฏ+exchange | str | Y | ็ฑปๅ๏ผSHๆฒช่ก้SZๆทฑ่ก้HKๆธฏ่ก้+++<br>+<br>+++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++#่ทๅๅๆฅๅ จ้จๆ่ก+df = pro.hk_hold(trade_date='20190625')++#่ทๅๅๆฅไบคๆๆๆๆๆ่ก+df = pro.hk_hold(trade_date='20190625', exchange='SH')+++```+++<br>+<br>++**ๆฐๆฎ็คบไพ**++ code trade_date ts_code name vol ratio exchange+ 0 90000 20190625 600000.SH ๆตฆๅ้ถ่ก 443245164 1.57 SH+ 1 90004 20190625 600004.SH ็ฝไบๆบๅบ 155708039 7.52 SH+ 2 90006 20190625 600006.SH ไธ้ฃๆฑฝ่ฝฆ 601353 0.03 SH+ 3 90007 20190625 600007.SH ไธญๅฝๅฝ่ดธ 17604694 1.74 SH+ 4 90008 20190625 600008.SH ้ฆๅ่กไปฝ 49944370 1.03 SH+ 5 90009 20190625 600009.SH ไธๆตทๆบๅบ 288832383 26.41 SH+ 6 90010 20190625 600010.SH ๅ ้ข่กไปฝ 324923948 1.02 SH+ 7 90011 20190625 600011.SH ๅ่ฝๅฝ้ 58734656 0.55 SH+ 8 90012 20190625 600012.SH ็้้ซ้ 24047942 2.06 SH+ 9 90015 20190625 600015.SH ๅๅค้ถ่ก 121539342 0.94 SH+ 10 90016 20190625 600016.SH ๆฐ็้ถ่ก 541638767 1.52 SH+ 11 90017 20190625 600017.SH ๆฅ็ งๆธฏ 32949908 1.07 SH+ 12 90018 20190625 600018.SH ไธๆธฏ้ๅข 74011645 0.31 SH+ 13 90019 20190625 600019.SH ๅฎ้ข่กไปฝ 511044106 2.31 SH+ 14 90020 20190625 600020.SH ไธญๅ้ซ้ 12439016 0.55 SH+ 15 90021 20190625 600021.SH ไธๆตท็ตๅ 2882596 0.13 SH+ 16 90023 20190625 600023.SH ๆต่ฝ็ตๅ 38130882 0.28 SH+ 17 90025 20190625 600025.SH ๅ่ฝๆฐด็ต 280356836 3.14 SH+ 18 90026 20190625 600026.SH ไธญ่ฟๆตท่ฝ 81911786 2.99 SH+ 19 90027 20190625 600027.SH ๅ็ตๅฝ้ 65877064 0.94 SH+ 20 90028 20190625 600028.SH ไธญๅฝ็ณๅ 709509578 0.74 SHdiff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\347\245\236\345\245\207\344\271\235\350\275\254\346\214\207\346\240\207.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\347\245\236\345\245\207\344\271\235\350\275\254\346\214\207\346\240\207.md"new file mode 100644index 000000000..e7bea4d49--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\347\245\236\345\245\207\344\271\235\350\275\254\346\214\207\346\240\207.md"@@ -0,0 +1,73 @@+## ็ฅๅฅไน่ฝฌๆๆ +----++ๆฅๅฃ๏ผstk_nineturn๏ผ็ฑไบๆถๅๅ้ๆฐๆฎๆฏๅคฉ21็นๆดๆฐ๏ผ+ๆ่ฟฐ๏ผ็ฅๅฅไน่ฝฌ๏ผๅ็งฐโไน่ฝฌๅบๅโ๏ผๆฏไธ็งๅบไบๆๆฏๅๆ็่ก็ฅจ่ถๅฟๅ่ฝฌๆๆ ๏ผๅ ถๆๆณๆฅๆบไบๆๆฏๅๆๅคงๅธๆฑคๅงยท่ฟช้ฉฌๅ ๏ผTom DeMark๏ผ็TDๅบๅใ่ฏฅๆๆ ็ๆ ธๅฟๅ่ฝๆฏ้่ฟ่ฏๅซ่กไปทๅจไธๆถจๆไธ่ท่ฟ็จไธญ่ฟ็ปญ9ๅคฉ็็นๅฎ่ตฐๅฟ๏ผๆฅๅคๆญ่กไปท็ๆฝๅจๅ่ฝฌ็น๏ผไป่ๅธฎๅฉๆ่ต่ ๆ้ซๆๅบๅ้้กถ็ๆๅ็๏ผๆฅ็บฟ็บงๅซ้ ๅ60min็ไน่ฝฌๆๆๆดๅฅฝ๏ผๆฐๆฎไป20230101ๅผๅงใ+้้๏ผๅๆฌกๆๅๆๅคง่ฟๅ10000่กๆฐๆฎ๏ผๅฏ้่ฟ่ก็ฅจไปฃ็ ๅๆฅๆๅพช็ฏ่ทๅๅ จ้จๆฐๆฎ+ๆ้๏ผ่พพๅฐ6000็งฏๅๅฏไปฅ่ฐ็จ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ ๏ผๆ ผๅผ๏ผYYYY-MM-DD HH:MM:SS)+freq | str | N | ้ข็(ๆฅdaily)+start_date | str | N | ๅผๅงๆถ้ด+end_date | str | N | ็ปๆๆถ้ด++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +trade_date | datetime | Y | ไบคๆๆฅๆ+freq | str | Y | ้ข็(ๆฅdaily)+open | float | Y | ๅผ็ไปท+high | float | Y | ๆ้ซไปท+low | float | Y | ๆไฝไปท+close | float | Y | ๆถ็ไปท+vol | float | Y | ๆไบค้+amount | float | Y | ๆไบค้ข+up_count | float | Y | ไธไน่ฝฌ่ฎกๆฐ+down_count | float | Y | ไธไน่ฝฌ่ฎกๆฐ+nine_up_turn | str | Y | ๆฏๅฆไธไน่ฝฌ)+9่กจ็คบไธไน่ฝฌ+nine_down_turn | str | Y | ๆฏๅฆไธไน่ฝฌ-9่กจ็คบไธไน่ฝฌ++<br>+<br>+++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++df=pro.stk_nineturn(ts_code='000001.SZ',freq='daily',fields='ts_code,trade_date,freq,up_count,down_count,nine_up_turn,nine_down_turn')++```++<br>+<br>++**ๆฐๆฎๆ ทไพ**++ ts_code trade_date freq up_count down_count nine_up_turn nine_down_turn+ 0 000001.SZ 2025-01-17 00:00:00 daily 3.0 0.0 None None+ 1 000001.SZ 2025-01-16 00:00:00 daily 2.0 0.0 None None+ 2 000001.SZ 2025-01-15 00:00:00 daily 1.0 0.0 None None+ 3 000001.SZ 2025-01-14 00:00:00 daily 0.0 3.0 None None+ 4 000001.SZ 2025-01-13 00:00:00 daily 0.0 2.0 None None+ .. ... ... ... ... ... ... ...+ 491 000001.SZ 2023-01-09 00:00:00 daily 1.0 0.0 None None+ 492 000001.SZ 2023-01-06 00:00:00 daily 0.0 0.0 None None+ 493 000001.SZ 2023-01-05 00:00:00 daily 0.0 0.0 None None+ 494 000001.SZ 2023-01-04 00:00:00 daily 0.0 0.0 None None+ 495 000001.SZ 2023-01-03 00:00:00 daily 0.0 0.0 None None\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\350\202\241\347\245\250\345\274\200\347\233\230\351\233\206\345\220\210\347\253\236\344\273\267\346\225\260\346\215\256.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\350\202\241\347\245\250\345\274\200\347\233\230\351\233\206\345\220\210\347\253\236\344\273\267\346\225\260\346\215\256.md"new file mode 100644index 000000000..05f651ff2--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\350\202\241\347\245\250\345\274\200\347\233\230\351\233\206\345\220\210\347\253\236\344\273\267\346\225\260\346\215\256.md"@@ -0,0 +1,66 @@+## ่ก็ฅจๅผ็้ๅ็ซไปทๆฐๆฎ+----++ๆฅๅฃ๏ผstk_auction_o+ๆ่ฟฐ๏ผ่ก็ฅจๅผ็9:30้ๅ็ซไปทๆฐๆฎ๏ผๆฏๅคฉ็ๅๆดๆฐ+้้๏ผๅๆฌก่ฏทๆฑๆๅคง่ฟๅ10000่กๆฐๆฎ๏ผๅฏๆ นๆฎๆฅๆๅพช็ฏ+ๆ้๏ผๅผ้ไบ่ก็ฅจๅ้ๆ้ๅๅฏ่ทๅพๆฌๆฅๅฃๆ้๏ผๅ ทไฝๅ่[ๆ้่ฏดๆ](https://tushare.pro/document/1?doc_id=290)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ(YYYYMMDD)+start_date | str | N | ๅผๅงๆฅๆ(YYYYMMDD)+end_date | str | N | ็ปๆๆฅๆ(YYYYMMDD)+++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+close | float | Y | ๅผ็้ๅ็ซไปทๆถ็ไปท+open | float | Y | ๅผ็้ๅ็ซไปทๅผ็ไปท+high | float | Y | ๅผ็้ๅ็ซไปทๆ้ซไปท+low | float | Y | ๅผ็้ๅ็ซไปทๆไฝไปท+vol | float | Y | ๅผ็้ๅ็ซไปทๆไบค้+amount | float | Y | ๅผ็้ๅ็ซไปทๆไบค้ข+vwap | float | Y | ๅผ็้ๅ็ซไปทๅไปท++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++df=pro.stk_auction_o(trade_date='20241122')++```++<br>+<br>++**ๆฐๆฎๆ ทไพ**++ ts_code trade_date close open ... low vol amount vwap+ 0 600502.SH 20241122 5.00 5.00 ... 5.00 45400.0 227000.0 5.000+ 1 600662.SH 20241122 5.28 5.28 ... 5.28 26800.0 141504.0 5.280+ 2 601118.SH 20241122 5.63 5.63 ... 5.63 152200.0 856886.0 5.630+ 3 600938.SH 20241122 26.54 26.54 ... 26.54 340400.0 9034216.0 26.540+ 4 601900.SH 20241122 15.09 15.09 ... 15.09 287600.0 4339884.0 15.090+ ... ... ... ... ... ... ... ... ... ...+ 5719 300504.SZ 20241122 16.80 16.97 ... 16.80 19000.0 320954.0 16.892+ 5720 300535.SZ 20241122 15.26 15.29 ... 15.26 22800.0 348343.0 15.278+ 5721 300588.SZ 20241122 15.58 15.60 ... 15.45 117400.0 1830260.0 15.590+ 5722 300592.SZ 20241122 14.27 14.34 ... 14.23 502600.0 7194406.0 14.314+ 5723 300657.SZ 20241122 21.73 21.88 ... 21.71 545100.0 11902781.0 21.836\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\350\202\241\347\245\250\346\212\200\346\234\257\351\235\242\345\233\240\345\255\220(\344\270\223\344\270\232\347\211\210).md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\350\202\241\347\245\250\346\212\200\346\234\257\351\235\242\345\233\240\345\255\220(\344\270\223\344\270\232\347\211\210).md"new file mode 100644index 000000000..6d42e18f9--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\350\202\241\347\245\250\346\212\200\346\234\257\351\235\242\345\233\240\345\255\220(\344\270\223\344\270\232\347\211\210).md"@@ -0,0 +1,284 @@+## ่ก็ฅจๆๆฏ้ขๅ ๅญ(ไธไธ็)+----++ๆฅๅฃ๏ผstk_factor_pro+ๆ่ฟฐ๏ผ่ทๅ่ก็ฅจๆฏๆฅๆๆฏ้ขๅ ๅญๆฐๆฎ๏ผ็จไบ่ท่ธช่ก็ฅจๅฝๅ่ตฐๅฟๆ ๅต๏ผๆฐๆฎ็ฑTushare็คพๅบ่ชไบง๏ผ่ฆ็ๅ จๅๅฒ๏ผ่พๅบๅๆฐ_bfq่กจ็คบไธๅคๆ๏ผ_qfq่กจ็คบๅๅคๆ _hfq่กจ็คบๅๅคๆ๏ผๆ่ฟฐไธญ่ฏดๆไบๅ ๅญ็้ป่ฎคไผ ๅ๏ผๅฆ้่ฆ็นๆฎๅๆฐๆ่ ๆดๅคๅ ๅญๅฏไปฅ่็ณป็ฎก็ๅ่ฏไผฐ+้้๏ผๅๆฌก่ฐๅๆๅค่ฟๅ10000ๆกๆฐๆฎ๏ผๅฏไปฅ้่ฟๆฅๆๅๆฐๅพช็ฏ+็งฏๅ๏ผ5000็งฏๅๆฏๅ้ๅฏไปฅ่ฏทๆฑ30ๆฌก๏ผ8000็งฏๅไปฅไธๆฏๅ้500ๆฌก๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ(ๆ ผๅผ๏ผyyyymmdd๏ผไธๅ)+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+open | float | Y | ๅผ็ไปท+open_hfq | float | Y | ๅผ็ไปท๏ผๅๅคๆ๏ผ+open_qfq | float | Y | ๅผ็ไปท๏ผๅๅคๆ๏ผ+high | float | Y | ๆ้ซไปท+high_hfq | float | Y | ๆ้ซไปท๏ผๅๅคๆ๏ผ+high_qfq | float | Y | ๆ้ซไปท๏ผๅๅคๆ๏ผ+low | float | Y | ๆไฝไปท+low_hfq | float | Y | ๆไฝไปท๏ผๅๅคๆ๏ผ+low_qfq | float | Y | ๆไฝไปท๏ผๅๅคๆ๏ผ+close | float | Y | ๆถ็ไปท+close_hfq | float | Y | ๆถ็ไปท๏ผๅๅคๆ๏ผ+close_qfq | float | Y | ๆถ็ไปท๏ผๅๅคๆ๏ผ+pre_close | float | Y | ๆจๆถไปท(ๅๅคๆ)--ไธบdailyๆฅๅฃ็pre_close,ไปฅๅฝๆถๅคๆๅ ๅญ่ฎก็ฎๅผ่ทๅไธๆฅclose_qfqๅฏนไธไธ๏ผๅฏไธ็จ+change | float | Y | ๆถจ่ท้ข+pct_chg | float | Y | ๆถจ่ทๅน ๏ผ้คๆๅ็ๆถจ่ทๅน ๏ผ+vol | float | Y | ๆไบค้ ๏ผๆ๏ผ+amount | float | Y | ๆไบค้ข ๏ผๅๅ ๏ผ+turnover_rate | float | Y | ๆขๆ็๏ผ%๏ผ+turnover_rate_f | float | Y | ๆขๆ็๏ผ่ช็ฑๆต้่ก๏ผ+volume_ratio | float | Y | ้ๆฏ+pe | float | Y | ๅธ็็๏ผๆปๅธๅผ/ๅๅฉๆถฆ๏ผ ไบๆ็PEไธบ็ฉบ๏ผ+pe_ttm | float | Y | ๅธ็็๏ผTTM๏ผไบๆ็PEไธบ็ฉบ๏ผ+pb | float | Y | ๅธๅ็๏ผๆปๅธๅผ/ๅ่ตไบง๏ผ+ps | float | Y | ๅธ้็+ps_ttm | float | Y | ๅธ้็๏ผTTM๏ผ+dv_ratio | float | Y | ่กๆฏ็ ๏ผ%๏ผ+dv_ttm | float | Y | ่กๆฏ็๏ผTTM๏ผ๏ผ%๏ผ+total_share | float | Y | ๆป่กๆฌ ๏ผไธ่ก๏ผ+float_share | float | Y | ๆต้่กๆฌ ๏ผไธ่ก๏ผ+free_share | float | Y | ่ช็ฑๆต้่กๆฌ ๏ผไธ๏ผ+total_mv | float | Y | ๆปๅธๅผ ๏ผไธๅ ๏ผ+circ_mv | float | Y | ๆต้ๅธๅผ๏ผไธๅ ๏ผ+adj_factor | float | Y | ๅคๆๅ ๅญ+asi_bfq | float | Y | ๆฏๅจๅ้ๆๆ -OPEN, CLOSE, HIGH, LOW, M1=26, M2=10+asi_hfq | float | Y | ๆฏๅจๅ้ๆๆ -OPEN, CLOSE, HIGH, LOW, M1=26, M2=10+asi_qfq | float | Y | ๆฏๅจๅ้ๆๆ -OPEN, CLOSE, HIGH, LOW, M1=26, M2=10+asit_bfq | float | Y | ๆฏๅจๅ้ๆๆ -OPEN, CLOSE, HIGH, LOW, M1=26, M2=10+asit_hfq | float | Y | ๆฏๅจๅ้ๆๆ -OPEN, CLOSE, HIGH, LOW, M1=26, M2=10+asit_qfq | float | Y | ๆฏๅจๅ้ๆๆ -OPEN, CLOSE, HIGH, LOW, M1=26, M2=10+atr_bfq | float | Y | ็ๅฎๆณขๅจNๆฅๅนณๅๅผ-CLOSE, HIGH, LOW, N=20+atr_hfq | float | Y | ็ๅฎๆณขๅจNๆฅๅนณๅๅผ-CLOSE, HIGH, LOW, N=20+atr_qfq | float | Y | ็ๅฎๆณขๅจNๆฅๅนณๅๅผ-CLOSE, HIGH, LOW, N=20+bbi_bfq | float | Y | BBIๅค็ฉบๆๆ -CLOSE, M1=3, M2=6, M3=12, M4=20+bbi_hfq | float | Y | BBIๅค็ฉบๆๆ -CLOSE, M1=3, M2=6, M3=12, M4=21+bbi_qfq | float | Y | BBIๅค็ฉบๆๆ -CLOSE, M1=3, M2=6, M3=12, M4=22+bias1_bfq | float | Y | BIASไน็ฆป็-CLOSE, L1=6, L2=12, L3=24+bias1_hfq | float | Y | BIASไน็ฆป็-CLOSE, L1=6, L2=12, L3=24+bias1_qfq | float | Y | BIASไน็ฆป็-CLOSE, L1=6, L2=12, L3=24+bias2_bfq | float | Y | BIASไน็ฆป็-CLOSE, L1=6, L2=12, L3=24+bias2_hfq | float | Y | BIASไน็ฆป็-CLOSE, L1=6, L2=12, L3=24+bias2_qfq | float | Y | BIASไน็ฆป็-CLOSE, L1=6, L2=12, L3=24+bias3_bfq | float | Y | BIASไน็ฆป็-CLOSE, L1=6, L2=12, L3=24+bias3_hfq | float | Y | BIASไน็ฆป็-CLOSE, L1=6, L2=12, L3=24+bias3_qfq | float | Y | BIASไน็ฆป็-CLOSE, L1=6, L2=12, L3=24+boll_lower_bfq | float | Y | BOLLๆๆ ๏ผๅธๆๅธฆ-CLOSE, N=20, P=2+boll_lower_hfq | float | Y | BOLLๆๆ ๏ผๅธๆๅธฆ-CLOSE, N=20, P=2+boll_lower_qfq | float | Y | BOLLๆๆ ๏ผๅธๆๅธฆ-CLOSE, N=20, P=2+boll_mid_bfq | float | Y | BOLLๆๆ ๏ผๅธๆๅธฆ-CLOSE, N=20, P=2+boll_mid_hfq | float | Y | BOLLๆๆ ๏ผๅธๆๅธฆ-CLOSE, N=20, P=2+boll_mid_qfq | float | Y | BOLLๆๆ ๏ผๅธๆๅธฆ-CLOSE, N=20, P=2+boll_upper_bfq | float | Y | BOLLๆๆ ๏ผๅธๆๅธฆ-CLOSE, N=20, P=2+boll_upper_hfq | float | Y | BOLLๆๆ ๏ผๅธๆๅธฆ-CLOSE, N=20, P=2+boll_upper_qfq | float | Y | BOLLๆๆ ๏ผๅธๆๅธฆ-CLOSE, N=20, P=2+brar_ar_bfq | float | Y | BRARๆ ็ปชๆๆ -OPEN, CLOSE, HIGH, LOW, M1=26+brar_ar_hfq | float | Y | BRARๆ ็ปชๆๆ -OPEN, CLOSE, HIGH, LOW, M1=26+brar_ar_qfq | float | Y | BRARๆ ็ปชๆๆ -OPEN, CLOSE, HIGH, LOW, M1=26+brar_br_bfq | float | Y | BRARๆ ็ปชๆๆ -OPEN, CLOSE, HIGH, LOW, M1=26+brar_br_hfq | float | Y | BRARๆ ็ปชๆๆ -OPEN, CLOSE, HIGH, LOW, M1=26+brar_br_qfq | float | Y | BRARๆ ็ปชๆๆ -OPEN, CLOSE, HIGH, LOW, M1=26+cci_bfq | float | Y | ้กบๅฟๆๆ ๅๅซCCIๆๆ -CLOSE, HIGH, LOW, N=14+cci_hfq | float | Y | ้กบๅฟๆๆ ๅๅซCCIๆๆ -CLOSE, HIGH, LOW, N=14+cci_qfq | float | Y | ้กบๅฟๆๆ ๅๅซCCIๆๆ -CLOSE, HIGH, LOW, N=14+cr_bfq | float | Y | CRไปทๆ ผๅจ้ๆๆ -CLOSE, HIGH, LOW, N=20+cr_hfq | float | Y | CRไปทๆ ผๅจ้ๆๆ -CLOSE, HIGH, LOW, N=20+cr_qfq | float | Y | CRไปทๆ ผๅจ้ๆๆ -CLOSE, HIGH, LOW, N=20+dfma_dif_bfq | float | Y | ๅนณ่ก็บฟๅทฎๆๆ -CLOSE, N1=10, N2=50, M=10+dfma_dif_hfq | float | Y | ๅนณ่ก็บฟๅทฎๆๆ -CLOSE, N1=10, N2=50, M=10+dfma_dif_qfq | float | Y | ๅนณ่ก็บฟๅทฎๆๆ -CLOSE, N1=10, N2=50, M=10+dfma_difma_bfq | float | Y | ๅนณ่ก็บฟๅทฎๆๆ -CLOSE, N1=10, N2=50, M=10+dfma_difma_hfq | float | Y | ๅนณ่ก็บฟๅทฎๆๆ -CLOSE, N1=10, N2=50, M=10+dfma_difma_qfq | float | Y | ๅนณ่ก็บฟๅทฎๆๆ -CLOSE, N1=10, N2=50, M=10+dmi_adx_bfq | float | Y | ๅจๅๆๆ -CLOSE, HIGH, LOW, M1=14, M2=6+dmi_adx_hfq | float | Y | ๅจๅๆๆ -CLOSE, HIGH, LOW, M1=14, M2=6+dmi_adx_qfq | float | Y | ๅจๅๆๆ -CLOSE, HIGH, LOW, M1=14, M2=6+dmi_adxr_bfq | float | Y | ๅจๅๆๆ -CLOSE, HIGH, LOW, M1=14, M2=6+dmi_adxr_hfq | float | Y | ๅจๅๆๆ -CLOSE, HIGH, LOW, M1=14, M2=6+dmi_adxr_qfq | float | Y | ๅจๅๆๆ -CLOSE, HIGH, LOW, M1=14, M2=6+dmi_mdi_bfq | float | Y | ๅจๅๆๆ -CLOSE, HIGH, LOW, M1=14, M2=6+dmi_mdi_hfq | float | Y | ๅจๅๆๆ -CLOSE, HIGH, LOW, M1=14, M2=6+dmi_mdi_qfq | float | Y | ๅจๅๆๆ -CLOSE, HIGH, LOW, M1=14, M2=6+dmi_pdi_bfq | float | Y | ๅจๅๆๆ -CLOSE, HIGH, LOW, M1=14, M2=6+dmi_pdi_hfq | float | Y | ๅจๅๆๆ -CLOSE, HIGH, LOW, M1=14, M2=6+dmi_pdi_qfq | float | Y | ๅจๅๆๆ -CLOSE, HIGH, LOW, M1=14, M2=6+downdays | float | Y | ่ฟ่ทๅคฉๆฐ+updays | float | Y | ่ฟๆถจๅคฉๆฐ+dpo_bfq | float | Y | ๅบ้ด้่ก็บฟ-CLOSE, M1=20, M2=10, M3=6+dpo_hfq | float | Y | ๅบ้ด้่ก็บฟ-CLOSE, M1=20, M2=10, M3=6+dpo_qfq | float | Y | ๅบ้ด้่ก็บฟ-CLOSE, M1=20, M2=10, M3=6+madpo_bfq | float | Y | ๅบ้ด้่ก็บฟ-CLOSE, M1=20, M2=10, M3=6+madpo_hfq | float | Y | ๅบ้ด้่ก็บฟ-CLOSE, M1=20, M2=10, M3=6+madpo_qfq | float | Y | ๅบ้ด้่ก็บฟ-CLOSE, M1=20, M2=10, M3=6+ema_bfq_10 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=10+ema_bfq_20 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=20+ema_bfq_250 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=250+ema_bfq_30 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=30+ema_bfq_5 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=5+ema_bfq_60 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=60+ema_bfq_90 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=90+ema_hfq_10 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=10+ema_hfq_20 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=20+ema_hfq_250 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=250+ema_hfq_30 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=30+ema_hfq_5 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=5+ema_hfq_60 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=60+ema_hfq_90 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=90+ema_qfq_10 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=10+ema_qfq_20 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=20+ema_qfq_250 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=250+ema_qfq_30 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=30+ema_qfq_5 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=5+ema_qfq_60 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=60+ema_qfq_90 | float | Y | ๆๆฐ็งปๅจๅนณๅ-N=90+emv_bfq | float | Y | ็ฎๆๆณขๅจๆๆ -HIGH, LOW, VOL, N=14, M=9+emv_hfq | float | Y | ็ฎๆๆณขๅจๆๆ -HIGH, LOW, VOL, N=14, M=9+emv_qfq | float | Y | ็ฎๆๆณขๅจๆๆ -HIGH, LOW, VOL, N=14, M=9+maemv_bfq | float | Y | ็ฎๆๆณขๅจๆๆ -HIGH, LOW, VOL, N=14, M=9+maemv_hfq | float | Y | ็ฎๆๆณขๅจๆๆ -HIGH, LOW, VOL, N=14, M=9+maemv_qfq | float | Y | ็ฎๆๆณขๅจๆๆ -HIGH, LOW, VOL, N=14, M=9+expma_12_bfq | float | Y | EMAๆๆฐๅนณๅๆฐๆๆ -CLOSE, N1=12, N2=50+expma_12_hfq | float | Y | EMAๆๆฐๅนณๅๆฐๆๆ -CLOSE, N1=12, N2=50+expma_12_qfq | float | Y | EMAๆๆฐๅนณๅๆฐๆๆ -CLOSE, N1=12, N2=50+expma_50_bfq | float | Y | EMAๆๆฐๅนณๅๆฐๆๆ -CLOSE, N1=12, N2=50+expma_50_hfq | float | Y | EMAๆๆฐๅนณๅๆฐๆๆ -CLOSE, N1=12, N2=50+expma_50_qfq | float | Y | EMAๆๆฐๅนณๅๆฐๆๆ -CLOSE, N1=12, N2=50+kdj_bfq | float | Y | KDJๆๆ -CLOSE, HIGH, LOW, N=9, M1=3, M2=3+kdj_hfq | float | Y | KDJๆๆ -CLOSE, HIGH, LOW, N=9, M1=3, M2=3+kdj_qfq | float | Y | KDJๆๆ -CLOSE, HIGH, LOW, N=9, M1=3, M2=3+kdj_d_bfq | float | Y | KDJๆๆ -CLOSE, HIGH, LOW, N=9, M1=3, M2=3+kdj_d_hfq | float | Y | KDJๆๆ -CLOSE, HIGH, LOW, N=9, M1=3, M2=3+kdj_d_qfq | float | Y | KDJๆๆ -CLOSE, HIGH, LOW, N=9, M1=3, M2=3+kdj_k_bfq | float | Y | KDJๆๆ -CLOSE, HIGH, LOW, N=9, M1=3, M2=3+kdj_k_hfq | float | Y | KDJๆๆ -CLOSE, HIGH, LOW, N=9, M1=3, M2=3+kdj_k_qfq | float | Y | KDJๆๆ -CLOSE, HIGH, LOW, N=9, M1=3, M2=3+ktn_down_bfq | float | Y | ่ฏ็น็บณไบคๆ้้, N้20ๆฅ๏ผATR้10ๆฅ-CLOSE, HIGH, LOW, N=20, M=10+ktn_down_hfq | float | Y | ่ฏ็น็บณไบคๆ้้, N้20ๆฅ๏ผATR้10ๆฅ-CLOSE, HIGH, LOW, N=20, M=10+ktn_down_qfq | float | Y | ่ฏ็น็บณไบคๆ้้, N้20ๆฅ๏ผATR้10ๆฅ-CLOSE, HIGH, LOW, N=20, M=10+ktn_mid_bfq | float | Y | ่ฏ็น็บณไบคๆ้้, N้20ๆฅ๏ผATR้10ๆฅ-CLOSE, HIGH, LOW, N=20, M=10+ktn_mid_hfq | float | Y | ่ฏ็น็บณไบคๆ้้, N้20ๆฅ๏ผATR้10ๆฅ-CLOSE, HIGH, LOW, N=20, M=10+ktn_mid_qfq | float | Y | ่ฏ็น็บณไบคๆ้้, N้20ๆฅ๏ผATR้10ๆฅ-CLOSE, HIGH, LOW, N=20, M=10+ktn_upper_bfq | float | Y | ่ฏ็น็บณไบคๆ้้, N้20ๆฅ๏ผATR้10ๆฅ-CLOSE, HIGH, LOW, N=20, M=10+ktn_upper_hfq | float | Y | ่ฏ็น็บณไบคๆ้้, N้20ๆฅ๏ผATR้10ๆฅ-CLOSE, HIGH, LOW, N=20, M=10+ktn_upper_qfq | float | Y | ่ฏ็น็บณไบคๆ้้, N้20ๆฅ๏ผATR้10ๆฅ-CLOSE, HIGH, LOW, N=20, M=10+lowdays | float | Y | LOWRANGE(LOW)่กจ็คบๅฝๅๆไฝไปทๆฏ่ฟๅคๅฐๅจๆๅ ๆไฝไปท็ๆๅฐๅผ+topdays | float | Y | TOPRANGE(HIGH)่กจ็คบๅฝๅๆ้ซไปทๆฏ่ฟๅคๅฐๅจๆๅ ๆ้ซไปท็ๆๅคงๅผ+ma_bfq_10 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=10+ma_bfq_20 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=20+ma_bfq_250 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=250+ma_bfq_30 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=30+ma_bfq_5 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=5+ma_bfq_60 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=60+ma_bfq_90 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=90+ma_hfq_10 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=10+ma_hfq_20 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=20+ma_hfq_250 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=250+ma_hfq_30 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=30+ma_hfq_5 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=5+ma_hfq_60 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=60+ma_hfq_90 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=90+ma_qfq_10 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=10+ma_qfq_20 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=20+ma_qfq_250 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=250+ma_qfq_30 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=30+ma_qfq_5 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=5+ma_qfq_60 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=60+ma_qfq_90 | float | Y | ็ฎๅ็งปๅจๅนณๅ-N=90+macd_bfq | float | Y | MACDๆๆ -CLOSE, SHORT=12, LONG=26, M=9+macd_hfq | float | Y | MACDๆๆ -CLOSE, SHORT=12, LONG=26, M=9+macd_qfq | float | Y | MACDๆๆ -CLOSE, SHORT=12, LONG=26, M=9+macd_dea_bfq | float | Y | MACDๆๆ -CLOSE, SHORT=12, LONG=26, M=9+macd_dea_hfq | float | Y | MACDๆๆ -CLOSE, SHORT=12, LONG=26, M=9+macd_dea_qfq | float | Y | MACDๆๆ -CLOSE, SHORT=12, LONG=26, M=9+macd_dif_bfq | float | Y | MACDๆๆ -CLOSE, SHORT=12, LONG=26, M=9+macd_dif_hfq | float | Y | MACDๆๆ -CLOSE, SHORT=12, LONG=26, M=9+macd_dif_qfq | float | Y | MACDๆๆ -CLOSE, SHORT=12, LONG=26, M=9+mass_bfq | float | Y | ๆข ๆฏ็บฟ-HIGH, LOW, N1=9, N2=25, M=6+mass_hfq | float | Y | ๆข ๆฏ็บฟ-HIGH, LOW, N1=9, N2=25, M=6+mass_qfq | float | Y | ๆข ๆฏ็บฟ-HIGH, LOW, N1=9, N2=25, M=6+ma_mass_bfq | float | Y | ๆข ๆฏ็บฟ-HIGH, LOW, N1=9, N2=25, M=6+ma_mass_hfq | float | Y | ๆข ๆฏ็บฟ-HIGH, LOW, N1=9, N2=25, M=6+ma_mass_qfq | float | Y | ๆข ๆฏ็บฟ-HIGH, LOW, N1=9, N2=25, M=6+mfi_bfq | float | Y | MFIๆๆ ๆฏๆไบค้็RSIๆๆ -CLOSE, HIGH, LOW, VOL, N=14+mfi_hfq | float | Y | MFIๆๆ ๆฏๆไบค้็RSIๆๆ -CLOSE, HIGH, LOW, VOL, N=14+mfi_qfq | float | Y | MFIๆๆ ๆฏๆไบค้็RSIๆๆ -CLOSE, HIGH, LOW, VOL, N=14+mtm_bfq | float | Y | ๅจ้ๆๆ -CLOSE, N=12, M=6+mtm_hfq | float | Y | ๅจ้ๆๆ -CLOSE, N=12, M=6+mtm_qfq | float | Y | ๅจ้ๆๆ -CLOSE, N=12, M=6+mtmma_bfq | float | Y | ๅจ้ๆๆ -CLOSE, N=12, M=6+mtmma_hfq | float | Y | ๅจ้ๆๆ -CLOSE, N=12, M=6+mtmma_qfq | float | Y | ๅจ้ๆๆ -CLOSE, N=12, M=6+obv_bfq | float | Y | ่ฝ้ๆฝฎๆๆ -CLOSE, VOL+obv_hfq | float | Y | ่ฝ้ๆฝฎๆๆ -CLOSE, VOL+obv_qfq | float | Y | ่ฝ้ๆฝฎๆๆ -CLOSE, VOL+psy_bfq | float | Y | ๆ่ต่ ๅฏน่กๅธๆถจ่ทไบง็ๅฟ็ๆณขๅจ็ๆ ็ปชๆๆ -CLOSE, N=12, M=6+psy_hfq | float | Y | ๆ่ต่ ๅฏน่กๅธๆถจ่ทไบง็ๅฟ็ๆณขๅจ็ๆ ็ปชๆๆ -CLOSE, N=12, M=6+psy_qfq | float | Y | ๆ่ต่ ๅฏน่กๅธๆถจ่ทไบง็ๅฟ็ๆณขๅจ็ๆ ็ปชๆๆ -CLOSE, N=12, M=6+psyma_bfq | float | Y | ๆ่ต่ ๅฏน่กๅธๆถจ่ทไบง็ๅฟ็ๆณขๅจ็ๆ ็ปชๆๆ -CLOSE, N=12, M=6+psyma_hfq | float | Y | ๆ่ต่ ๅฏน่กๅธๆถจ่ทไบง็ๅฟ็ๆณขๅจ็ๆ ็ปชๆๆ -CLOSE, N=12, M=6+psyma_qfq | float | Y | ๆ่ต่ ๅฏน่กๅธๆถจ่ทไบง็ๅฟ็ๆณขๅจ็ๆ ็ปชๆๆ -CLOSE, N=12, M=6+roc_bfq | float | Y | ๅๅจ็ๆๆ -CLOSE, N=12, M=6+roc_hfq | float | Y | ๅๅจ็ๆๆ -CLOSE, N=12, M=6+roc_qfq | float | Y | ๅๅจ็ๆๆ -CLOSE, N=12, M=6+maroc_bfq | float | Y | ๅๅจ็ๆๆ -CLOSE, N=12, M=6+maroc_hfq | float | Y | ๅๅจ็ๆๆ -CLOSE, N=12, M=6+maroc_qfq | float | Y | ๅๅจ็ๆๆ -CLOSE, N=12, M=6+rsi_bfq_12 | float | Y | RSIๆๆ -CLOSE, N=12+rsi_bfq_24 | float | Y | RSIๆๆ -CLOSE, N=24+rsi_bfq_6 | float | Y | RSIๆๆ -CLOSE, N=6+rsi_hfq_12 | float | Y | RSIๆๆ -CLOSE, N=12+rsi_hfq_24 | float | Y | RSIๆๆ -CLOSE, N=24+rsi_hfq_6 | float | Y | RSIๆๆ -CLOSE, N=6+rsi_qfq_12 | float | Y | RSIๆๆ -CLOSE, N=12+rsi_qfq_24 | float | Y | RSIๆๆ -CLOSE, N=24+rsi_qfq_6 | float | Y | RSIๆๆ -CLOSE, N=6+taq_down_bfq | float | Y | ๅๅฎๅฅ้้(ๆตท้พ)ไบคๆๆๆ -HIGH, LOW, 20+taq_down_hfq | float | Y | ๅๅฎๅฅ้้(ๆตท้พ)ไบคๆๆๆ -HIGH, LOW, 20+taq_down_qfq | float | Y | ๅๅฎๅฅ้้(ๆตท้พ)ไบคๆๆๆ -HIGH, LOW, 20+taq_mid_bfq | float | Y | ๅๅฎๅฅ้้(ๆตท้พ)ไบคๆๆๆ -HIGH, LOW, 20+taq_mid_hfq | float | Y | ๅๅฎๅฅ้้(ๆตท้พ)ไบคๆๆๆ -HIGH, LOW, 20+taq_mid_qfq | float | Y | ๅๅฎๅฅ้้(ๆตท้พ)ไบคๆๆๆ -HIGH, LOW, 20+taq_up_bfq | float | Y | ๅๅฎๅฅ้้(ๆตท้พ)ไบคๆๆๆ -HIGH, LOW, 20+taq_up_hfq | float | Y | ๅๅฎๅฅ้้(ๆตท้พ)ไบคๆๆๆ -HIGH, LOW, 20+taq_up_qfq | float | Y | ๅๅฎๅฅ้้(ๆตท้พ)ไบคๆๆๆ -HIGH, LOW, 20+trix_bfq | float | Y | ไธ้ๆๆฐๅนณๆปๅนณๅ็บฟ-CLOSE, M1=12, M2=20+trix_hfq | float | Y | ไธ้ๆๆฐๅนณๆปๅนณๅ็บฟ-CLOSE, M1=12, M2=20+trix_qfq | float | Y | ไธ้ๆๆฐๅนณๆปๅนณๅ็บฟ-CLOSE, M1=12, M2=20+trma_bfq | float | Y | ไธ้ๆๆฐๅนณๆปๅนณๅ็บฟ-CLOSE, M1=12, M2=20+trma_hfq | float | Y | ไธ้ๆๆฐๅนณๆปๅนณๅ็บฟ-CLOSE, M1=12, M2=20+trma_qfq | float | Y | ไธ้ๆๆฐๅนณๆปๅนณๅ็บฟ-CLOSE, M1=12, M2=20+vr_bfq | float | Y | VRๅฎน้ๆฏ็-CLOSE, VOL, M1=26+vr_hfq | float | Y | VRๅฎน้ๆฏ็-CLOSE, VOL, M1=26+vr_qfq | float | Y | VRๅฎน้ๆฏ็-CLOSE, VOL, M1=26+wr_bfq | float | Y | W&R ๅจๅปๆๆ -CLOSE, HIGH, LOW, N=10, N1=6+wr_hfq | float | Y | W&R ๅจๅปๆๆ -CLOSE, HIGH, LOW, N=10, N1=6+wr_qfq | float | Y | W&R ๅจๅปๆๆ -CLOSE, HIGH, LOW, N=10, N1=6+wr1_bfq | float | Y | W&R ๅจๅปๆๆ -CLOSE, HIGH, LOW, N=10, N1=6+wr1_hfq | float | Y | W&R ๅจๅปๆๆ -CLOSE, HIGH, LOW, N=10, N1=6+wr1_qfq | float | Y | W&R ๅจๅปๆๆ -CLOSE, HIGH, LOW, N=10, N1=6+xsii_td1_bfq | float | Y | ่ๆฏ้้II-CLOSE, HIGH, LOW, N=102, M=7+xsii_td1_hfq | float | Y | ่ๆฏ้้II-CLOSE, HIGH, LOW, N=102, M=7+xsii_td1_qfq | float | Y | ่ๆฏ้้II-CLOSE, HIGH, LOW, N=102, M=7+xsii_td2_bfq | float | Y | ่ๆฏ้้II-CLOSE, HIGH, LOW, N=102, M=7+xsii_td2_hfq | float | Y | ่ๆฏ้้II-CLOSE, HIGH, LOW, N=102, M=7+xsii_td2_qfq | float | Y | ่ๆฏ้้II-CLOSE, HIGH, LOW, N=102, M=7+xsii_td3_bfq | float | Y | ่ๆฏ้้II-CLOSE, HIGH, LOW, N=102, M=7+xsii_td3_hfq | float | Y | ่ๆฏ้้II-CLOSE, HIGH, LOW, N=102, M=7+xsii_td3_qfq | float | Y | ่ๆฏ้้II-CLOSE, HIGH, LOW, N=102, M=7+xsii_td4_bfq | float | Y | ่ๆฏ้้II-CLOSE, HIGH, LOW, N=102, M=7+xsii_td4_hfq | float | Y | ่ๆฏ้้II-CLOSE, HIGH, LOW, N=102, M=7+xsii_td4_qfq | float | Y | ่ๆฏ้้II-CLOSE, HIGH, LOW, N=102, M=7+diff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\350\202\241\347\245\250\346\224\266\347\233\230\351\233\206\345\220\210\347\253\236\344\273\267\346\225\260\346\215\256.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\350\202\241\347\245\250\346\224\266\347\233\230\351\233\206\345\220\210\347\253\236\344\273\267\346\225\260\346\215\256.md"new file mode 100644index 000000000..858fad18b--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\347\211\271\350\211\262\346\225\260\346\215\256/\350\202\241\347\245\250\346\224\266\347\233\230\351\233\206\345\220\210\347\253\236\344\273\267\346\225\260\346\215\256.md"@@ -0,0 +1,67 @@+## ่ก็ฅจๆถ็้ๅ็ซไปทๆฐๆฎ+----++ๆฅๅฃ๏ผstk_auction_c+ๆ่ฟฐ๏ผ่ก็ฅจๆถ็15:00้ๅ็ซไปทๆฐๆฎ๏ผๆฏๅคฉ็ๅๆดๆฐ+้้๏ผๅๆฌก่ฏทๆฑๆๅคง่ฟๅ10000่กๆฐๆฎ๏ผๅฏๆ นๆฎๆฅๆๅพช็ฏ+ๆ้๏ผๅผ้ไบ่ก็ฅจๅ้ๆ้ๅๅฏ่ทๅพๆฌๆฅๅฃๆ้๏ผๅ ทไฝๅ่[ๆ้่ฏดๆ](https://tushare.pro/document/1?doc_id=290)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ(YYYYMMDD)+start_date | str | N | ๅผๅงๆฅๆ(YYYYMMDD)+end_date | str | N | ็ปๆๆฅๆ(YYYYMMDD)++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+close | float | Y | ๆถ็้ๅ็ซไปทๆถ็ไปท+open | float | Y | ๆถ็้ๅ็ซไปทๅผ็ไปท+high | float | Y | ๆถ็้ๅ็ซไปทๆ้ซไปท+low | float | Y | ๆถ็้ๅ็ซไปทๆไฝไปท+vol | float | Y | ๆถ็้ๅ็ซไปทๆไบค้+amount | float | Y | ๆถ็้ๅ็ซไปทๆไบค้ข+vwap | float | Y | ๆถ็้ๅ็ซไปทๅไปท++<br>+<br>++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++df=pro.stk_auction_c(trade_date='20241122')++```++<br>+<br>++**ๆฐๆฎๆ ทไพ**++ ts_code trade_date close ... vol amount vwap+ 0 603102.SH 20241122 36.16 ... 557900.0 20347168.0 36.471+ 1 600696.SH 20241122 13.91 ... 3600489.0 50550184.0 14.040+ 2 600769.SH 20241122 12.75 ... 7940892.0 102510940.0 12.909+ 3 601900.SH 20241122 14.91 ... 6348300.0 95537632.0 15.049+ 4 600502.SH 20241122 4.88 ... 9718900.0 47690748.0 4.907+ ... ... ... ... ... ... ... ...+ 5719 300504.SZ 20241122 16.34 ... 2037000.0 33653784.0 16.521+ 5720 300535.SZ 20241122 14.45 ... 638735.0 9340342.0 14.623+ 5721 300588.SZ 20241122 15.39 ... 3232050.0 50313180.0 15.567+ 5722 300592.SZ 20241122 14.43 ... 9910880.0 143872140.0 14.517+ 5723 300657.SZ 20241122 21.13 ... 10916225.0 235013090.0 21.529\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\345\216\206\345\217\262\345\210\206\351\222\237.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\345\216\206\345\217\262\345\210\206\351\222\237.md"new file mode 100644index 000000000..fb94ecc55--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\345\216\206\345\217\262\345\210\206\351\222\237.md"@@ -0,0 +1,85 @@+## ่ก็ฅจๅๅฒๅ้่กๆ+----++ๆฅๅฃ๏ผstk_mins+ๆ่ฟฐ๏ผ่ทๅA่กๅ้ๆฐๆฎ๏ผๆฏๆ1min/5min/15min/30min/60min่กๆ ๏ผๆไพPython SDKๅ http Restful APIไธค็งๆนๅผ+้้๏ผๅๆฌกๆๅคง8000่กๆฐๆฎ๏ผๅฏไปฅ้่ฟ่ก็ฅจไปฃ็ ๅๆถ้ดๅพช็ฏ่ทๅ๏ผๆฌๆฅๅฃๅฏไปฅๆไพ่ถ ่ฟ10ๅนดๅๅฒๅ้ๆฐๆฎ+ๆ้๏ผ้ๅ็ฌๅผๆ้๏ผๆญฃๅผๆ้่ฏทๅ้ <u>[ๆ้่ฏดๆ](https://tushare.pro/document/1?doc_id=290) </u> ๏ผๅฏไปฅ[ๅจ็บฟๅผ้](https://tushare.pro/weborder/#/permission)ๅ้ๆ้ใ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ ๏ผe.g. 600000.SH+freq | str | Y | ๅ้้ขๅบฆ๏ผ1min/5min/15min/30min/60min๏ผ+start_date | datetime | N | ๅผๅงๆฅๆ ๆ ผๅผ๏ผ2023-08-25 09:00:00+end_date | datetime | N | ็ปๆๆถ้ด ๆ ผๅผ๏ผ2023-08-25 19:00:00++<br>+<br>+++**freqๅๆฐ่ฏดๆ**++freq | ่ฏดๆ+--- | ----+1min | 1ๅ้+5min | 5ๅ้+15min | 15ๅ้+30min | 30ๅ้+60min | 60ๅ้++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +trade_time | str | Y | ไบคๆๆถ้ด+open | float | Y | ๅผ็ไปท+close | float | Y | ๆถ็ไปท+high | float | Y | ๆ้ซไปท+low | float | Y | ๆไฝไปท+vol | int | Y | ๆไบค้(่ก)+amount | float | Y | ๆไบค้้ข๏ผๅ ๏ผ++<br>+<br>++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++#่ทๅๆตฆๅ้ถ่ก60000.SH็ๅๅฒๅ้ๆฐๆฎ+df = pro.stk_mins(ts_code='600000.SH', freq='1min', start_date='2023-08-25 09:00:00', end_date='2023-08-25 19:00:00')++```++<br>+<br>+++**ๆฐๆฎๆ ทไพ**+++ ts_code trade_time close open high low vol amount+ 0 600000.SH 2023-08-25 15:00:00 7.05 7.05 7.05 7.05 235500.0 1660275.0+ 1 600000.SH 2023-08-25 14:59:00 7.05 7.05 7.05 7.05 0.0 0.0+ 2 600000.SH 2023-08-25 14:58:00 7.05 7.05 7.05 7.05 0.0 0.0+ 3 600000.SH 2023-08-25 14:57:00 7.05 7.06 7.06 7.05 51800.0 365491.0+ 4 600000.SH 2023-08-25 14:56:00 7.05 7.05 7.06 7.04 92700.0 653831.0+ .. ... ... ... ... ... ... ... ...+ 236 600000.SH 2023-08-25 09:34:00 7.01 7.02 7.02 7.00 120500.0 845311.0+ 237 600000.SH 2023-08-25 09:33:00 7.01 7.01 7.02 7.00 126000.0 883188.0+ 238 600000.SH 2023-08-25 09:32:00 7.01 7.02 7.02 6.99 236699.0 1659260.0+ 239 600000.SH 2023-08-25 09:31:00 7.02 6.99 7.02 6.97 807500.0 5649956.0+ 240 600000.SH 2023-08-25 09:30:00 6.99 6.99 6.99 6.99 103700.0 724863.0++diff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\345\216\206\345\217\262\346\227\245\347\272\277.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\345\216\206\345\217\262\346\227\245\347\272\277.md"new file mode 100644index 000000000..fe11eb12b--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\345\216\206\345\217\262\346\227\245\347\272\277.md"@@ -0,0 +1,80 @@+## A่กๆฅ็บฟ่กๆ+----++ๆฅๅฃ๏ผdaily๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎ+ๆฐๆฎ่ฏดๆ๏ผไบคๆๆฅๆฏๅคฉ15็น๏ฝ16็นไน้ดๅ ฅๅบใๆฌๆฅๅฃๆฏๆชๅคๆ่กๆ ๏ผๅ็ๆ้ดไธๆไพๆฐๆฎ+่ฐๅ่ฏดๆ๏ผๅบ็ก็งฏๅๆฏๅ้ๅ ๅฏ่ฐๅ500ๆฌก๏ผๆฏๆฌก6000ๆกๆฐๆฎ๏ผไธๆฌก่ฏทๆฑ็ธๅฝไบๆๅไธไธช่ก็ฅจ23ๅนดๅๅฒ+ๆ่ฟฐ๏ผ่ทๅ่ก็ฅจ่กๆ ๆฐๆฎ๏ผๆ้่ฟ[**้็จ่กๆ ๆฅๅฃ**]( https://tushare.pro/document/2?doc_id=109)่ทๅๆฐๆฎ๏ผๅ ๅซไบๅๅๅคๆๆฐๆฎ++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ ๏ผๆฏๆๅคไธช่ก็ฅจๅๆถๆๅ๏ผ้ๅทๅ้๏ผ+trade_date | str | N | ไบคๆๆฅๆ๏ผYYYYMMDD๏ผ+start_date | str | N | ๅผๅงๆฅๆ(YYYYMMDD)+end_date | str | N | ็ปๆๆฅๆ(YYYYMMDD)++**ๆณจ๏ผๆฅๆ้ฝๅกซYYYYMMDDๆ ผๅผ๏ผๆฏๅฆ20181010**++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๆ่ฟฐ+--- | ---- | ----+ts_code | str | ่ก็ฅจไปฃ็ +trade_date | str | ไบคๆๆฅๆ+open | float | ๅผ็ไปท+high | float | ๆ้ซไปท+low | float | ๆไฝไปท+close | float | ๆถ็ไปท+pre_close | float | ๆจๆถไปทใ้คๆไปทใ+change | float | ๆถจ่ท้ข+pct_chg | float | ๆถจ่ทๅน ใๅบไบ้คๆๅ็ๆจๆถ่ฎก็ฎ็ๆถจ่ทๅน ๏ผ๏ผไปๆถ-้คๆๆจๆถ๏ผ/้คๆๆจๆถ ใ+vol | float | ๆไบค้ ๏ผๆ๏ผ+amount | float | ๆไบค้ข ๏ผๅๅ ๏ผ+++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++df = pro.daily(ts_code='000001.SZ', start_date='20180701', end_date='20180718')++#ๅคไธช่ก็ฅจ+df = pro.daily(ts_code='000001.SZ,600000.SH', start_date='20180701', end_date='20180718')++```++ๆ่++```python++df = pro.query('daily', ts_code='000001.SZ', start_date='20180701', end_date='20180718')++```++ไนๅฏไปฅ้่ฟๆฅๆๅๅๅฒๆไธๅคฉ็ๅ จ้จๅๅฒ++```python++df = pro.daily(trade_date='20180810')++```+++**ๆฐๆฎๆ ทไพ**++ ts_code trade_date open high low close pre_close change pct_chg vol amount+ 0 000001.SZ 20180718 8.75 8.85 8.69 8.70 8.72 -0.02 -0.23 525152.77 460697.377+ 1 000001.SZ 20180717 8.74 8.75 8.66 8.72 8.73 -0.01 -0.11 375356.33 326396.994+ 2 000001.SZ 20180716 8.85 8.90 8.69 8.73 8.88 -0.15 -1.69 689845.58 603427.713+ 3 000001.SZ 20180713 8.92 8.94 8.82 8.88 8.88 0.00 0.00 603378.21 535401.175+ 4 000001.SZ 20180712 8.60 8.97 8.58 8.88 8.64 0.24 2.78 1140492.31 1008658.828+ 5 000001.SZ 20180711 8.76 8.83 8.68 8.78 8.98 -0.20 -2.23 851296.70 744765.824+ 6 000001.SZ 20180710 9.02 9.02 8.89 8.98 9.03 -0.05 -0.55 896862.02 803038.965+ 7 000001.SZ 20180709 8.69 9.03 8.68 9.03 8.66 0.37 4.27 1409954.60 1255007.609+ 8 000001.SZ 20180706 8.61 8.78 8.45 8.66 8.60 0.06 0.70 988282.69 852071.526+ 9 000001.SZ 20180705 8.62 8.73 8.55 8.60 8.61 -0.01 -0.12 835768.77 722169.579+\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\345\221\250\346\234\210\347\272\277\345\244\215\346\235\203\350\241\214\346\203\205(\346\257\217\346\227\245\346\233\264\346\226\260).md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\345\221\250\346\234\210\347\272\277\345\244\215\346\235\203\350\241\214\346\203\205(\346\257\217\346\227\245\346\233\264\346\226\260).md"new file mode 100644index 000000000..854287e6a--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\345\221\250\346\234\210\347\272\277\345\244\215\346\235\203\350\241\214\346\203\205(\346\257\217\346\227\245\346\233\264\346\226\260).md"@@ -0,0 +1,77 @@+## ่ก็ฅจๅจ/ๆ็บฟ่กๆ (ๅคๆ--ๆฏๆฅๆดๆฐ)+----+ๆฅๅฃ๏ผstk_week_month_adj+ๆ่ฟฐ๏ผ่ก็ฅจๅจ/ๆ็บฟ่กๆ (ๅคๆ--ๆฏๆฅๆดๆฐ)+้้๏ผๅๆฌกๆๅคง6000,ๅฏไฝฟ็จไบคๆๆฅๆๅพช็ฏๆๅ๏ผๆป้ไธ้ๅถ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | TSไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ๏ผๆ ผๅผ๏ผYYYYMMDD๏ผๆฏๅจๆๆฏๆๆๅไธๅคฉ็ๆฅๆ๏ผ+start_date | str | N | ๅผๅงไบคๆๆฅๆ+end_date | str | N | ็ปๆไบคๆๆฅๆ+freq | str | Y | ้ข็weekๅจ๏ผmonthๆ++<br>+<br>+**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ๏ผๆฏๅจไบๆ่ ๆๆซๆฅๆ๏ผ+end_date | str | Y | ่ฎก็ฎๆช่ณๆฅๆ+freq | str | Y | ้ข็(ๅจweek,ๆmonth)+open | float | Y | (ๅจ/ๆ)ๅผ็ไปท+high | float | Y | (ๅจ/ๆ)ๆ้ซไปท+low | float | Y | (ๅจ/ๆ)ๆไฝไปท+close | float | Y | (ๅจ/ๆ)ๆถ็ไปท+pre_close | float | Y | ไธไธ(ๅจ/ๆ)ๆถ็ไปทใ้คๆไปท๏ผๅๅคๆใ+open_qfq | float | Y | ๅๅคๆ(ๅจ/ๆ)ๅผ็ไปท+high_qfq | float | Y | ๅๅคๆ(ๅจ/ๆ)ๆ้ซไปท+low_qfq | float | Y | ๅๅคๆ(ๅจ/ๆ)ๆไฝไปท+close_qfq | float | Y | ๅๅคๆ(ๅจ/ๆ)ๆถ็ไปท+open_hfq | float | Y | ๅๅคๆ(ๅจ/ๆ)ๅผ็ไปท+high_hfq | float | Y | ๅๅคๆ(ๅจ/ๆ)ๆ้ซไปท+low_hfq | float | Y | ๅๅคๆ(ๅจ/ๆ)ๆไฝไปท+close_hfq | float | Y | ๅๅคๆ(ๅจ/ๆ)ๆถ็ไปท+vol | float | Y | (ๅจ/ๆ)ๆไบค้+amount | float | Y | (ๅจ/ๆ)ๆไบค้ข+change | float | Y | (ๅจ/ๆ)ๆถจ่ท้ข+pct_chg | float | Y | (ๅจ/ๆ)ๆถจ่ทๅน ใๅบไบ้คๆๅ็ๆจๆถ่ฎก็ฎ็ๆถจ่ทๅน ๏ผ๏ผไปๆถ-้คๆๆจๆถ๏ผ/้คๆๆจๆถ ใ++<br>+<br>+**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++df=pro.stk_week_month_adj(ts_code='000001.SZ',freq='week')++```++<br>+<br>++**ๆฐๆฎๆ ทไพ**++ ts_code trade_date freq open high low close pre_close open_qfq high_qfq low_qfq close_qfq open_hfq high_hfq low_hfq close_hfq vol amount change pct_chg+ 0 000001.SZ 20250117 week 11.25 11.59 11.08 11.45 11.30 11.25 11.59 11.08 11.45 1437.57 1481.02 1415.85 1463.13 4353954.80 4963695.53 0.15 0.01+ 1 000001.SZ 20250110 week 11.38 11.63 11.22 11.30 11.38 11.38 11.63 11.22 11.30 1454.18 1486.13 1433.74 1443.96 4445402.00 5079074.95 -0.08 -0.01+ 2 000001.SZ 20250103 week 11.78 11.99 11.36 11.38 11.83 11.78 11.99 11.36 11.38 1505.30 1532.13 1451.63 1454.18 5801491.12 6781578.23 -0.45 -0.04+ 3 000001.SZ 20241227 week 11.64 12.02 11.64 11.83 11.62 11.64 12.02 11.64 11.83 1487.41 1535.96 1487.41 1511.69 6775611.59 8011303.78 0.21 0.02+ 4 000001.SZ 20241220 week 11.56 11.74 11.52 11.62 11.56 11.56 11.74 11.52 11.62 1477.18 1500.19 1472.07 1484.85 4036452.70 4689640.57 0.06 0.01+ ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...+ 1687 000001.SZ 19910503 week 43.90 43.90 43.24 43.24 44.34 0.34 0.48 0.34 0.48 43.90 61.24 43.68 60.93 11.00 48.00 -1.10 -0.02+ 1688 000001.SZ 19910426 week 45.00 45.00 44.34 44.34 45.46 0.35 0.35 0.35 0.35 45.00 45.00 44.34 44.34 67.00 300.00 -1.12 -0.02+ 1689 000001.SZ 19910419 week 46.38 46.38 45.69 45.69 47.08 0.36 0.36 0.36 0.36 46.38 46.38 45.69 45.69 9.00 41.00 -1.39 -0.03+ 1690 000001.SZ 19910412 week 48.04 48.04 47.08 47.08 48.52 0.38 0.38 0.37 0.37 48.04 48.04 47.08 47.08 29.00 138.00 -1.44 -0.03+ 1691 000001.SZ 19910405 week 48.76 48.76 48.52 48.52 49.00 0.38 0.38 0.38 0.38 48.76 48.76 48.52 48.52 5.00 25.00 -0.48 -0.01diff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\345\221\250\346\234\210\347\272\277\350\241\214\346\203\205(\346\257\217\346\227\245\346\233\264\346\226\260).md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\345\221\250\346\234\210\347\272\277\350\241\214\346\203\205(\346\257\217\346\227\245\346\233\264\346\226\260).md"new file mode 100644index 000000000..09aeae24a--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\345\221\250\346\234\210\347\272\277\350\241\214\346\203\205(\346\257\217\346\227\245\346\233\264\346\226\260).md"@@ -0,0 +1,74 @@+## ่ก็ฅจๅจ/ๆ็บฟ่กๆ (ๆฏๆฅๆดๆฐ)+----++ๆฅๅฃ๏ผstk_weekly_monthly+ๆ่ฟฐ๏ผ่ก็ฅจๅจ/ๆ็บฟ่กๆ (ๆฏๆฅๆดๆฐ)+้้๏ผๅๆฌกๆๅคง6000,ๅฏไฝฟ็จไบคๆๆฅๆๅพช็ฏๆๅ๏ผๆป้ไธ้ๅถ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | TSไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ(ๆ ผๅผ๏ผYYYYMMDD๏ผๆฏๅจๆๆฏๆๆๅไธๅคฉ็ๆฅๆ๏ผ+start_date | str | N | ๅผๅงไบคๆๆฅๆ+end_date | str | N | ็ปๆไบคๆๆฅๆ+freq | str | Y | ้ข็weekๅจ๏ผmonthๆ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+end_date | str | Y | ่ฎก็ฎๆช่ณๆฅๆ+freq | str | Y | ้ข็(ๅจweek,ๆmonth)+open | float | Y | (ๅจ/ๆ)ๅผ็ไปท+high | float | Y | (ๅจ/ๆ)ๆ้ซไปท+low | float | Y | (ๅจ/ๆ)ๆไฝไปท+close | float | Y | (ๅจ/ๆ)ๆถ็ไปท+pre_close | float | Y | ไธไธ(ๅจ/ๆ)ๆถ็ไปท+vol | float | Y | (ๅจ/ๆ)ๆไบค้+amount | float | Y | (ๅจ/ๆ)ๆไบค้ข+change | float | Y | (ๅจ/ๆ)ๆถจ่ท้ข+pct_chg | float | Y | (ๅจ/ๆ)ๆถจ่ทๅน (ๆชๅคๆ,ๅฆๆๆฏๅคๆ่ฏท็จ ้็จ่กๆ ๆฅๅฃ)++<br>+<br>++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++#่ทๅ20251024่ฟๅจๅจ็บฟๆฐๆฎ+df=pro.stk_weekly_monthly(trade_date='20251024',freq='week')++#่ทๅ202510ๆๆ็บฟๆฐๆฎ+df=pro.stk_weekly_monthly(trade_date='20251031',freq='month')+++```++<br>+<br>++**ๆฐๆฎๆ ทไพ**++ ts_code trade_date end_date ... amount change pct_chg+ 0 600137.SH 20251024 20251023 ... 429206.49 2.18 11.93+ 1 600236.SH 20251024 20251023 ... 510772.77 0.25 3.49+ 2 301262.SZ 20251024 20251023 ... 1140060.52 5.69 24.69+ 3 600114.SH 20251024 20251023 ... 1786514.91 -0.41 -1.39+ 4 301509.SZ 20251024 20251023 ... 225023.73 0.47 1.34+ ... ... ... ... ... ... ... ...+ 5428 920061.BJ 20251024 20251023 ... 153251.70 -0.51 -1.47+ 5429 920100.BJ 20251024 20251023 ... 674924.90 5.01 7.45+ 5430 603196.SH 20251024 20251023 ... 316237.47 0.85 3.69+ 5431 603599.SH 20251024 20251023 ... 370038.63 -0.13 -1.10+ 5432 301195.SZ 20251024 20251023 ... 186490.18 1.86 5.66++\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\345\221\250\347\272\277\350\241\214\346\203\205.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\345\221\250\347\272\277\350\241\214\346\203\205.md"new file mode 100644index 000000000..83521293e--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\345\221\250\347\272\277\350\241\214\346\203\205.md"@@ -0,0 +1,103 @@+## ๅจ็บฟ่กๆ+----++ๆฅๅฃ๏ผweekly+ๆ่ฟฐ๏ผ่ทๅA่กๅจ็บฟ่กๆ ๏ผๆฌๆฅๅฃๆฏๅจๆๅไธไธชไบคๆๆฅๆดๆฐ๏ผๅฆ้่ฆไฝฟ็จๆฏๅคฉๆดๆฐ็ๅจ็บฟๆฐๆฎ๏ผ่ฏทไฝฟ็จ[ๆฅๅบฆๆดๆฐ็ๅจ็บฟ่กๆ ๆฅๅฃ](https://tushare.pro/document/2?doc_id=336)ใ+้้๏ผๅๆฌกๆๅคง6000่ก๏ผๅฏไฝฟ็จไบคๆๆฅๆๅพช็ฏๆๅ๏ผๆป้ไธ้ๅถ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | TSไปฃ็ ๏ผts_code,trade_dateไธคไธชๅๆฐไปป้ไธ๏ผ+trade_date | str | N | ไบคๆๆฅๆ ๏ผๆฏๅจๆๅไธไธชไบคๆๆฅๆ๏ผYYYYMMDDๆ ผๅผ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+close | float | Y | ๅจๆถ็ไปท+open | float | Y | ๅจๅผ็ไปท+high | float | Y | ๅจๆ้ซไปท+low | float | Y | ๅจๆไฝไปท+pre_close | float | Y | ไธไธๅจๆถ็ไปท+change | float | Y | ๅจๆถจ่ท้ข+pct_chg | float | Y | ๅจๆถจ่ท ๏ผๆชๅคๆ๏ผๆช*100๏ผๅฆๆๆฏๅคๆ่ฏท็จ [้็จ่กๆ ๆฅๅฃ](https://tushare.pro/document/2?doc_id=109)๏ผๅฆ้%ๅไฝ่ฏท*100 ๏ผ+vol | float | Y | ๅจๆไบค้+amount | float | Y | ๅจๆไบค้ข++<br>+<br>++**ๆฅๅฃ็จๆณ**+```python++pro = ts.pro_api()++df = pro.weekly(ts_code='000001.SZ', start_date='20180101', end_date='20181101', fields='ts_code,trade_date,open,high,low,close,vol,amount')++```++ๆ่++```python++df = pro.weekly(trade_date='20181123', fields='ts_code,trade_date,open,high,low,close,vol,amount')++```++<br>+<br>++**ๆฐๆฎๆ ทไพ**+++ ts_code trade_date close open high low vol \+ 0 000001.SZ 20181026 11.18 10.81 11.46 10.71 9062500.14+ 1 000001.SZ 20181019 10.76 10.39 10.78 9.92 7235319.55+ 2 000001.SZ 20181012 10.30 10.70 10.79 9.70 7257596.97+ 3 000001.SZ 20180928 11.05 10.52 11.27 10.48 5458134.13+ 4 000001.SZ 20180921 10.67 9.80 10.70 9.68 5120305.29+ 5 000001.SZ 20180914 9.84 10.01 10.10 9.81 3534261.76+ 6 000001.SZ 20180907 10.01 10.09 10.55 9.93 4708303.81+ 7 000001.SZ 20180831 10.13 10.02 10.43 9.97 6715867.92+ 8 000001.SZ 20180824 10.03 8.90 10.28 8.87 6697713.52+ 9 000001.SZ 20180817 8.81 9.12 9.16 8.64 3206923.44+ 10 000001.SZ 20180810 9.23 8.94 9.35 8.88 3054338.56+ 11 000001.SZ 20180803 8.91 9.32 9.50 8.88 3648566.35+ 12 000001.SZ 20180727 9.25 9.04 9.59 9.00 5170189.41+ 13 000001.SZ 20180720 9.11 8.85 9.20 8.61 3806004.47+ 14 000001.SZ 20180713 8.88 8.69 9.03 8.58 4901983.84+ 15 000001.SZ 20180706 8.66 9.05 9.05 8.45 5125563.53+ 16 000001.SZ 20180629 9.09 9.91 9.92 8.87 5150575.93++ amount+ 0 1.002282e+07+ 1 7.482596e+06+ 2 7.483906e+06+ 3 5.904901e+06+ 4 5.225262e+06+ 5 3.501724e+06+ 6 4.796533e+06+ 7 6.858804e+06+ 8 6.358840e+06+ 9 2.854248e+06+ 10 2.787629e+06+ 11 3.363448e+06+ 12 4.826484e+06+ 13 3.371040e+06+ 14 4.346872e+06+ 15 4.446723e+06+ 16 4.764107e+06+\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\345\244\207\347\224\250\350\241\214\346\203\205.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\345\244\207\347\224\250\350\241\214\346\203\205.md"new file mode 100644index 000000000..7ca1871af--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\345\244\207\347\224\250\350\241\214\346\203\205.md"@@ -0,0 +1,80 @@+## ๅค็จ่กๆ+----++ๆฅๅฃ๏ผbak_daily+ๆ่ฟฐ๏ผ่ทๅๅค็จ่กๆ ๏ผๅ ๆฌ็นๅฎ็่กๆ ๆๆ (ๆฐๆฎไป2017ๅนดไธญๅทฆๅณๅผๅง๏ผๆฉๆๆๅ ๅคฉๆฐๆฎ็ผบๅคฑ๏ผ่ฟๆๆญฃๅธธ)+้้๏ผๅๆฌกๆๅคง7000่กๆฐๆฎ๏ผๅฏไปฅๆ นๆฎๆฅๆๅๆฐๅพช็ฏ่ทๅ๏ผๆญฃๅผๆ้้่ฆ5000็งฏๅใ++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+offset | str | N | ๅผๅง่กๆฐ+limit | str | N | ๆๅคง่กๆฐ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+name | str | Y | ่ก็ฅจๅ็งฐ+pct_change | float | Y | ๆถจ่ทๅน+close | float | Y | ๆถ็ไปท+change | float | Y | ๆถจ่ท้ข+open | float | Y | ๅผ็ไปท+high | float | Y | ๆ้ซไปท+low | float | Y | ๆไฝไปท+pre_close | float | Y | ๆจๆถไปท+vol_ratio | float | Y | ้ๆฏ+turn_over | float | Y | ๆขๆ็+swing | float | Y | ๆฏๅน+vol | float | Y | ๆไบค้+amount | float | Y | ๆไบค้ข+selling | float | Y | ๅ ็๏ผไธปๅจๅ๏ผๆ๏ผ+buying | float | Y | ๅค็๏ผไธปๅจไนฐ๏ผ ๆ๏ผ+total_share | float | Y | ๆป่กๆฌ(ไบฟ)+float_share | float | Y | ๆต้่กๆฌ(ไบฟ)+pe | float | Y | ๅธ็(ๅจ)+industry | str | Y | ๆๅฑ่กไธ+area | str | Y | ๆๅฑๅฐๅ+float_mv | float | Y | ๆต้ๅธๅผ+total_mv | float | Y | ๆปๅธๅผ+avg_price | float | Y | ๅนณๅไปท+strength | float | Y | ๅผบๅผฑๅบฆ(%)+activity | float | Y | ๆดป่ทๅบฆ(%)+avg_turnover | float | Y | ็ฌๆขๆ+attack | float | Y | ๆปๅปๆณข(%)+interval_3 | float | Y | ่ฟ3ๆๆถจๅน+interval_6 | float | Y | ่ฟ6ๆๆถจๅน+++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++df = pro.bak_daily(trade_date='20211012', fields='trade_date,ts_code,name,close,open')++```++**ๆฐๆฎๆ ทไพ**++ ts_code trade_date name close open+ 0 300605.SZ 20211012 ๆ้ไฟกๆฏ 14.86 12.65+ 1 301017.SZ 20211012 ๆผฑ็ๅนณๆฐ 25.21 20.82+ 2 300755.SZ 20211012 ๅ่ด้ ่ก 40.45 37.01+ 3 300255.SZ 20211012 ๅธธๅฑฑ่ฏไธ 8.39 7.26+ 4 688378.SH 20211012 ๅฅฅๆฅๅพท 68.62 67.00+ ... ... ... ... ... ...+ 4529 688257.SH 20211012 ๆฐ้่กไปฝ 0.00 0.00+ 4530 688255.SH 20211012 ๅฏๅฐ่พพ 0.00 0.00+ 4531 688211.SH 20211012 ไธญ็งๅพฎ่ณ 0.00 0.00+ 4532 605567.SH 20211012 ๆฅ้ช้ฃๅ 0.00 0.00+ 4533 605566.SH 20211012 ็ฆ่ฑ่ฝ็น 0.00 0.00\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\345\244\215\346\235\203\345\233\240\345\255\220.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\345\244\215\346\235\203\345\233\240\345\255\220.md"new file mode 100644index 000000000..f9a60de5c--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\345\244\215\346\235\203\345\233\240\345\255\220.md"@@ -0,0 +1,75 @@+## ๅคๆๅ ๅญ+----++ๆฅๅฃ๏ผadj_factor๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆดๆฐๆถ้ด๏ผ็ๅ9็น15~20ๅๅฎๆๅฝๆฅๅคๆๅ ๅญๅ ฅๅบ+ๆ่ฟฐ๏ผๆฌๆฅๅฃ็ฑTushare่ช่ก็ไบง๏ผ่ทๅ่ก็ฅจๅคๆๅ ๅญ๏ผๅฏๆๅๅๅช่ก็ฅจๅ จ้จๅๅฒๅคๆๅ ๅญ๏ผไนๅฏไปฅๆๅๅๆฅๅ จ้จ่ก็ฅจ็ๅคๆๅ ๅญใ+็งฏๅ่ฆๆฑ๏ผ2000็งฏๅ่ตท๏ผ5000ไปฅไธๅฏ้ซ้ข่ฐๅ++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ(YYYYMMDD๏ผไธๅ)+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++**ๆณจ๏ผๆฅๆ้ฝๅกซYYYYMMDDๆ ผๅผ๏ผๆฏๅฆ20181010**++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๆ่ฟฐ+--- | ---- | ----+ts_code | str | ่ก็ฅจไปฃ็ +trade_date | str | ไบคๆๆฅๆ+adj_factor | float | ๅคๆๅ ๅญ+++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++#ๆๅ000001ๅ จ้จๅคๆๅ ๅญ+df = pro.adj_factor(ts_code='000001.SZ', trade_date='')+++#ๆๅ2018ๅนด7ๆ18ๆฅๅคๆๅ ๅญ+df = pro.adj_factor(ts_code='', trade_date='20180718')++```++ๆ่++```python++df = pro.query('adj_factor', trade_date='20180718')++```++**ๆฐๆฎๆ ทไพ**++ ts_code trade_date adj_factor+ 0 000001.SZ 20180809 108.031+ 1 000001.SZ 20180808 108.031+ 2 000001.SZ 20180807 108.031+ 3 000001.SZ 20180806 108.031+ 4 000001.SZ 20180803 108.031+ 5 000001.SZ 20180802 108.031+ 6 000001.SZ 20180801 108.031+ 7 000001.SZ 20180731 108.031+ 8 000001.SZ 20180730 108.031+ 9 000001.SZ 20180727 108.031+ 10 000001.SZ 20180726 108.031+ 11 000001.SZ 20180725 108.031+ 12 000001.SZ 20180724 108.031+ 13 000001.SZ 20180723 108.031+ 14 000001.SZ 20180720 108.031+ 15 000001.SZ 20180719 108.031+ 16 000001.SZ 20180718 108.031+ 17 000001.SZ 20180717 108.031+ 18 000001.SZ 20180716 108.031+ 19 000001.SZ 20180713 108.031+ 20 000001.SZ 20180712 108.031\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\345\244\215\346\235\203\350\241\214\346\203\205.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\345\244\215\346\235\203\350\241\214\346\203\205.md"new file mode 100644index 000000000..6f8554c95--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\345\244\215\346\235\203\350\241\214\346\203\205.md"@@ -0,0 +1,85 @@+## A่กๅคๆ่กๆ+----++**ๆฅๅฃๅ็งฐ** ๏ผpro_bar+**ๆฅๅฃ่ฏดๆ** ๏ผๅคๆ่กๆ ้่ฟ[้็จ่กๆ ๆฅๅฃ](https://tushare.pro/document/2?doc_id=109)ๅฎ็ฐ๏ผๅฉ็จTushare Proๆไพ็[ๅคๆๅ ๅญ](https://tushare.pro/document/2?doc_id=28)่ฟ่กๅจๆ่ฎก็ฎ๏ผๅ ๆญคhttpๆนๅผๆ ๆณ่ฐๅใ่ฅ้่ฆ้ๆๅคๆ่กๆ ๏ผๆฏๆhttp๏ผ๏ผ่ฏท่ฎฟ้ฎ[่ก็ฅจๆๆฏๅ ๅญๆฅๅฃ](https://tushare.pro/document/2?doc_id=328)ใ+**Python SDK็ๆฌ่ฆๆฑ**๏ผ >= 1.2.26++<br>+<br>++**ๅคๆ่ฏดๆ**++| ็ฑปๅ | ็ฎๆณ | ๅๆฐๆ ่ฏ |+| -------- | -------- | -------- |+| ไธๅคๆ | ๆ | ็ฉบๆNone |+| ๅๅคๆ | ๅฝๆฅๆถ็ไปท ร ๅฝๆฅๅคๆๅ ๅญ / ๆๆฐๅคๆๅ ๅญ | qfq |+| ๅๅคๆ | ๅฝๆฅๆถ็ไปท ร ๅฝๆฅๅคๆๅ ๅญ | hfq |++<br>+<br>+ๆณจ๏ผ็ฎๅๅชๆฏๆA่ก็ๆฅ็บฟๅคๆใๅจTushareๆฐๆฎๆฅๅฃ้๏ผไธ็ฎกๆฏๆง็็ไธไบๆฅๅฃ่ฟๆฏPro็็่กๆ ๆฅๅฃ๏ผ้ฝๆฏไปฅ็จๆท่ฎพๅฎ็end_dateๅผๅงๅพๅๅคๆ๏ผ่ทๆๆ่กๆ ่ฝฏไปถๆ่ ่ดข็ป็ฝ็ซไธ็ๅฐ็ๅๅคๆๅฏ่ฝๅญๅจๅทฎๅผ๏ผๅ ไธบ่กๆ ่ฝฏไปถ้ฝๆฏไปฅๆ่ฟไธไธชไบคๆๆฅๅผๅงๅพๅๅคๆ็ใๆฏๅฆไปๅคฉๆฏ2018ๅนด10ๆ26ๆฅ๏ผๆจๆณๆฅ2018ๅนด1ๆ5ๆฅ๏ฝ2018ๅนด9ๆ28ๆฅ็ๅๅคๆๆฐๆฎ๏ผTushareๆฏๅ ๆฅๆพ9ๆ28ๆฅ็ๅคๆๅ ๅญ๏ผไป28ๆฅๅผๅงๅคๆ๏ผ่่กๆ ่ฝฏไปถๆฏไป10ๆ26ๆฅ่ฟๅคฉๅผๅงๅคๆ็ใๅๆถ๏ผTushare็ๅคๆ้็จโๅ็บขๅๆโๆจกๅผ่ฎก็ฎใ++<br>+<br>++**ๆฅๅฃๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ่ฏๅธไปฃ็ +start_date | str | N | ๅผๅงๆฅๆ (ๆ ผๅผ๏ผYYYYMMDD)+end_date | str | N | ็ปๆๆฅๆ (ๆ ผๅผ๏ผYYYYMMDD)+asset | str | Y | ่ตไบง็ฑปๅซ๏ผE่ก็ฅจ Iๆฒชๆทฑๆๆฐ Cๆฐๅญ่ดงๅธ FTๆ่ดง FDๅบ้ Oๆๆ๏ผ้ป่ฎคE+adj | str | N | ๅคๆ็ฑปๅ(ๅช้ๅฏน่ก็ฅจ)๏ผNoneๆชๅคๆ qfqๅๅคๆ hfqๅๅคๆ , ้ป่ฎคNone+freq | str | Y | ๆฐๆฎ้ขๅบฆ ๏ผ1MIN่กจ็คบ1ๅ้๏ผ1/5/15/30/60ๅ้๏ผ Dๆฅ็บฟ ๏ผ้ป่ฎคD+ma | list | N | ๅ็บฟ๏ผๆฏๆไปปๆๅจๆ็ๅไปทๅๅ้๏ผ่พๅ ฅไปปๆๅ็intๆฐๅผ++<br>+<br>+++**ๆฅๅฃ็จไพ**+++ๆฅ็บฟๅคๆ++```python++#ๅ000001็ๅๅคๆ่กๆ+df = ts.pro_bar(ts_code='000001.SZ', adj='qfq', start_date='20180101', end_date='20181011')++#ๅ000001็ๅๅคๆ่กๆ+df = ts.pro_bar(ts_code='000001.SZ', adj='hfq', start_date='20180101', end_date='20181011')++```++<br>+++ๅจ็บฟๅคๆ++```python++#ๅ000001็ๅจ็บฟๅๅคๆ่กๆ+df = ts.pro_bar( ts_code='000001.SZ', freq='W', adj='qfq', start_date='20180101', end_date='20181011')++#ๅ000001็ๅจ็บฟๅๅคๆ่กๆ+df = ts.pro_bar(ts_code='000001.SZ', freq='W', adj='hfq', start_date='20180101', end_date='20181011')++```++<br>+++ๆ็บฟๅคๆ++```python++#ๅ000001็ๆ็บฟๅๅคๆ่กๆ+df = ts.pro_bar(ts_code='000001.SZ', freq='M', adj='qfq', start_date='20180101', end_date='20181011')++#ๅ000001็ๆ็บฟๅๅคๆ่กๆ+df = ts.pro_bar(ts_code='000001.SZ', freq='M', adj='hfq', start_date='20180101', end_date='20181011')++```\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\345\256\236\346\227\266\345\210\206\351\222\237.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\345\256\236\346\227\266\345\210\206\351\222\237.md"new file mode 100644index 000000000..af36f09df--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\345\256\236\346\227\266\345\210\206\351\222\237.md"@@ -0,0 +1,65 @@+## A่กๅฎๆถๅ้+----++ๆฅๅฃ๏ผrt_min+ๆ่ฟฐ๏ผ่ทๅๅ จA่ก็ฅจๅฎๆถๅ้ๆฐๆฎ๏ผๅ ๆฌ1~60min+้้๏ผๅๆฌกๆๅคง1000่กๆฐๆฎ๏ผๅฏไปฅ้่ฟ่ก็ฅจไปฃ็ ๆๅๆฐๆฎ๏ผๆฏๆ้ๅทๅ้็ๅคไธชไปฃ็ ๅๆถๆๅ+ๆ้๏ผๆญฃๅผๆ้่ฏทๅ้ <u>[ๆ้่ฏดๆ](https://tushare.pro/document/1?doc_id=290) </u>++ๆณจ๏ผๆฏๆ่ก็ฅจๅฝๆฅๅผ็ไปฅๆฅ็ๆๆๅๅฒๅ้ๆฐๆฎๆๅ๏ผๆฅๅฃๅ๏ผrt_min_daily๏ผไป ๆฏๆไธไธชไธช่ก็ฅจๆๅ๏ผไธๅๅๆถๆๅๅคไธช๏ผ๏ผๅฏไปฅ[ๅจ็บฟๅผ้](https://tushare.pro/weborder/#/permission)ๆ้ใ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+freq | str | Y | 1MIN,5MIN,15MIN,30MIN,60MIN ๏ผๅคงๅ๏ผ+ts_code | str | Y | ๆฏๆๅไธชๅๅคไธช๏ผ600000.SH ๆ่ 600000.SH,000001.SZ+++<br>+<br>++**freqๅๆฐ่ฏดๆ**++freq | ่ฏดๆ+--- | ----+1MIN | 1ๅ้+5MIN | 5ๅ้+15MIN | 15ๅ้+30MIN | 30ๅ้+60MIN | 60ๅ้++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +time | None | Y | ไบคๆๆถ้ด+open | float | Y | ๅผ็ไปท+close | float | Y | ๆถ็ไปท+high | float | Y | ๆ้ซไปท+low | float | Y | ๆไฝไปท+vol | float | Y | ๆไบค้(่ก๏ผ+amount | float | Y | ๆไบค้ข๏ผๅ ๏ผ++++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++#่ทๅๆตฆๅ้ถ่ก60000.SH็ๅฎๆถๅ้ๆฐๆฎ+df = pro.rt_min(ts_code='600000.SH', freq='1MIN')++```++<br>+<br>\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\345\256\236\346\227\266\346\227\245\347\272\277.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\345\256\236\346\227\266\346\227\245\347\272\277.md"new file mode 100644index 000000000..7a050b243--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\345\256\236\346\227\266\346\227\245\347\272\277.md"@@ -0,0 +1,80 @@+## ๆฒชๆทฑไบฌๅฎๆถๆฅ็บฟ+----++ๆฅๅฃ๏ผrt_k+ๆ่ฟฐ๏ผ่ทๅๅฎๆถๆฅk็บฟ่กๆ ๏ผๆฏๆๆ่ก็ฅจไปฃ็ ๅ่ก็ฅจไปฃ็ ้้ ็ฌฆไธๆฌกๆงๆๅๅ จ้จ่ก็ฅจๅฎๆถๆฅk็บฟ่กๆ+้้๏ผๅๆฌกๆๅคงๅฏๆๅ6000ๆกๆฐๆฎ๏ผ็ญๅไบไธๆฌกๆๅๅ จๅธๅบ+็งฏๅ๏ผๆฌๆฅๅฃๆฏๅ็ฌๅผๆ้็ๆฐๆฎ๏ผๅ็ฌ็ณ่ฏทๆ้่ฏทๅ่[ๆ้ๅ่กจ](https://tushare.pro/document/1?doc_id=290)๏ผๅฏไปฅ[ๅจ็บฟๅผ้](https://tushare.pro/weborder/#/permission)ๆ้ใ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ๆฏๆ้้ ็ฌฆๆนๅผ๏ผe.g. ๆๆไธไบคๆ่ก็ฅจ๏ผ6\*.SHใๆๆๅไธๆฟ่ก็ฅจ3\*.SZใๆๆ็งๅๆฟ่ก็ฅจ688*.SH๏ผๆๅไธช่ก็ฅจ600000.SH++<br>+ๆณจ๏ผts_codeไปฃ็ ไธๅฎ่ฆๅธฆ<font color="red">.SH/.SZ/.BJ</font>ๅ็ผ+++<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +name | None | Y | ่ก็ฅจๅ็งฐ+pre_close | float | Y | ๆจๆถไปท+high | float | Y | ๆ้ซไปท+open | float | Y | ๅผ็ไปท+low | float | Y | ๆไฝไปท+close | float | Y | ๆถ็ไปท๏ผๆๆฐไปท๏ผ+vol | int | Y | ๆไบค้๏ผ่ก๏ผ+amount | int | Y | ๆไบค้้ข๏ผๅ ๏ผ+num | int | Y | ๅผ็ไปฅๆฅๆไบค็ฌๆฐ+ask_price1 | float | N | ๅงๆๅ็๏ผๅ ๏ผ+ask_volume1 | int | N | ๅงๆๅ็๏ผ่ก๏ผ+bid_price1 | float | N | ๅงๆไนฐ็๏ผๅ ๏ผ+bid_volume1 | int | N | ๅงๆไนฐ็๏ผ่ก๏ผ+trade_time | str | N | ไบคๆๆถ้ด++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++#่ทๅไปๆฅๅผ็ไปฅๆฅๆๆๅไธๆฟๅฎๆถๆฅ็บฟๅๆไบค็ฌๆฐ+df = pro.rt_k(ts_code='3*.SZ')++#่ทๅไปๆฅๅผ็ไปฅๆฅๅ จๅธๅบๆๆ่ก็ฅจๅฎๆถๆฅ็บฟๅๆไบค็ฌๆฐ๏ผไธๅปบ่ฎฎไธๆฌกๆๅๅ จๅธๅบ๏ผๅฏๅๆนๆๅๆง่ฝๆดๅฅฝ๏ผ+df = pro.rt_k(ts_code='3*.SZ,6*.SH,0*.SZ,9*.BJ')++#่ทๅๅฝๆฅๅผ็ไปฅๆฅๅไธช่ก็ฅจๅฎๆถๆฅ็บฟๅๆไบค็ฌๆฐ+df = pro.rt_k(ts_code='600000.SH,000001.SZ')++```+++<br>+<br>++**ๆฐๆฎ็คบไพ**++ ts_code name pre_close high open low close vol amount num+ 0 601866.SH ไธญ่ฟๆตทๅ 2.28 2.28 2.28 2.23 2.24 55845293 125364882 19904+ 1 601811.SH ๆฐๅๆ่ฝฉ 15.47 15.59 15.42 15.24 15.46 4169900 64212329 10524+ 2 601877.SH ๆญฃๆณฐ็ตๅจ 22.06 22.10 22.06 21.81 21.89 9816735 215350906 21733+ 3 601699.SH ๆฝๅฎ็ฏ่ฝ 11.78 11.77 11.77 11.56 11.61 12121234 140750449 13836+ 4 601858.SH ไธญๅฝ็งไผ 18.45 18.77 18.56 18.36 18.56 2665300 49383660 7033+ .. ... ... ... ... ... ... ... ... ... ...+ 220 601880.SH ่พฝๆธฏ่กไปฝ 1.50 1.50 1.50 1.46 1.47 79855960 117767408 11820+ 221 601616.SH ๅนฟ็ต็ตๆฐ 4.00 4.05 4.02 3.96 4.03 18984200 75975252 18220+ 222 601611.SH ไธญๅฝๆ ธๅปบ 8.86 8.86 8.86 8.62 8.67 27793715 241360488 24970+ 223 601218.SH ๅ้ซ็งๆ 3.00 3.02 2.99 2.96 3.00 10487500 31316964 6327+ 224 601966.SH ็ฒ็่ฝฎ่ 15.31 15.38 15.38 15.18 15.27 11297200 172527086 31828\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\346\234\210\347\272\277\350\241\214\346\203\205.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\346\234\210\347\272\277\350\241\214\346\203\205.md"new file mode 100644index 000000000..edceb5966--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\346\234\210\347\272\277\350\241\214\346\203\205.md"@@ -0,0 +1,102 @@+## ๆ็บฟ่กๆ+----++ๆฅๅฃ๏ผmonthly+ๆ่ฟฐ๏ผ่ทๅA่กๆ็บฟๆฐๆฎ+้้๏ผๅๆฌกๆๅคง4500่ก๏ผๆป้ไธ้ๅถ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | TSไปฃ็ ๏ผts_code,trade_dateไธคไธชๅๆฐไปป้ไธ๏ผ+trade_date | str | N | ไบคๆๆฅๆ ๏ผๆฏๆๆๅไธไธชไบคๆๆฅๆฅๆ๏ผYYYYMMDDๆ ผๅผ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+close | float | Y | ๆๆถ็ไปท+open | float | Y | ๆๅผ็ไปท+high | float | Y | ๆๆ้ซไปท+low | float | Y | ๆๆไฝไปท+pre_close | float | Y | ไธๆๆถ็ไปท+change | float | Y | ๆๆถจ่ท้ข+pct_chg | float | Y | ๆๆถจ่ทๅน ๏ผๆชๅคๆ๏ผๅฆๆๆฏๅคๆ่ฏท็จ [้็จ่กๆ ๆฅๅฃ](https://tushare.pro/document/2?doc_id=109) ๏ผ+vol | float | Y | ๆๆไบค้+amount | float | Y | ๆๆไบค้ข+++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++df = pro.monthly(ts_code='000001.SZ', start_date='20180101', end_date='20181101', fields='ts_code,trade_date,open,high,low,close,vol,amount')++```++ๆ่++```python++df = pro.monthly(trade_date='20181031', fields='ts_code,trade_date,open,high,low,close,vol,amount')++```++**ๆฐๆฎๆ ทไพ**++ ts_code trade_date close open high low vol \+ 0 000001.SZ 20181031 10.91 10.70 11.46 9.70 27801557.09+ 1 000001.SZ 20180930 11.05 10.09 11.27 9.68 18821004.99+ 2 000001.SZ 20180831 10.13 9.42 10.43 8.64 21896873.02+ 3 000001.SZ 20180731 9.42 9.05 9.59 8.45 20430278.02+ 4 000001.SZ 20180630 9.09 10.15 10.46 8.87 18179888.58+ 5 000001.SZ 20180531 10.18 10.97 11.23 10.02 18267177.83+ 6 000001.SZ 20180430 10.85 10.87 11.94 10.51 23495990.53+ 7 000001.SZ 20180331 10.90 11.92 12.34 10.55 23129969.15+ 8 000001.SZ 20180228 12.05 13.95 14.57 11.38 25624473.21+ 9 000001.SZ 20180131 14.05 13.35 15.13 12.86 46145376.46+ 10 000001.SZ 20171231 13.30 13.40 13.86 12.64 29661838.16+ 11 000001.SZ 20171130 13.38 11.56 15.24 11.09 42481293.87+ 12 000001.SZ 20171031 11.54 11.57 11.73 11.12 13951964.07+ 13 000001.SZ 20170930 11.11 11.28 11.94 10.82 16101838.41+ 14 000001.SZ 20170831 11.28 10.64 11.74 9.99 26281362.76+ 15 000001.SZ 20170731 10.67 9.40 11.33 9.27 35360949.04+ 16 000001.SZ 20170630 9.39 9.20 9.49 8.99 12718091.74+ 17 000001.SZ 20170531 9.20 8.96 9.23 8.54 12252646.46+ 18 000001.SZ 20170430 8.99 9.16 9.22 8.89 8024338.26+ 19 000001.SZ 20170331 9.17 9.49 9.55 9.06 12889345.37+ 20 000001.SZ 20170228 9.48 9.34 9.62 9.23 8460527.09+ 21 000001.SZ 20170131 9.33 9.11 9.34 9.07 7629258.66++ amount+ 0 2.960878e+07+ 1 1.942842e+07+ 2 2.088672e+07+ 3 1.832737e+07+ 4 1.791251e+07+ 5 1.965278e+07+ 6 2.655691e+07+ 7 2.692560e+07+ 8 3.322504e+07+ 9 6.454870e+07+ 10 3.914290e+07+ 11 5.604279e+07+ 12 1.597217e+07+ 13 1.827867e+07+ 14 2.859479e+07+ 15 3.736988e+07+ 16 1.171552e+07+ 17 1.083921e+07+ 18 7.268941e+06+ 19 1.197751e+07+ 20 7.977982e+06+ 21 7.001209e+06\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\346\257\217\346\227\245\345\201\234\345\244\215\347\211\214\344\277\241\346\201\257.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\346\257\217\346\227\245\345\201\234\345\244\215\347\211\214\344\277\241\346\201\257.md"new file mode 100644index 000000000..dbf2122d4--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\346\257\217\346\227\245\345\201\234\345\244\215\347\211\214\344\277\241\346\201\257.md"@@ -0,0 +1,70 @@+## ๆฏๆฅๅๅค็ไฟกๆฏ+----++ๆฅๅฃ๏ผsuspend_d+ๆดๆฐๆถ้ด๏ผไธๅฎๆ+ๆ่ฟฐ๏ผๆๆฅๆๆนๅผ่ทๅ่ก็ฅจๆฏๆฅๅๅค็ไฟกๆฏ++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ (ๅฏ่พๅ ฅๅคๅผ)+trade_date| str | N | ไบคๆๆฅๆฅๆ+start_date | str | N | ๅๅค็ๆฅ่ฏขๅผๅงๆฅๆ+end_date | str | N | ๅๅค็ๆฅ่ฏข็ปๆๆฅๆ+suspend_type | str | N | ๅๅค็็ฑปๅ๏ผS-ๅ็,R-ๅค็+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | TSไปฃ็ +trade_date | str | Y | ๅๅค็ๆฅๆ+suspend_timing | str | Y | ๆฅๅ ๅ็ๆถ้ดๆฎต+suspend_type | str | Y | ๅๅค็็ฑปๅ๏ผS-ๅ็๏ผR-ๅค็++++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++#ๆๅ2020-03-12็ๅ็่ก็ฅจ+df = pro.suspend_d(suspend_type='S', trade_date='20200312')++```++**ๆฐๆฎๆ ทไพ**++ ts_code suspend_type trade_date suspend_timing+ 0 000029.SZ S 20200312 None+ 1 000502.SZ S 20200312 None+ 2 000939.SZ S 20200312 None+ 3 000977.SZ S 20200312 None+ 4 000995.SZ S 20200312 None+ 5 002260.SZ S 20200312 None+ 6 002450.SZ S 20200312 None+ 7 002604.SZ S 20200312 None+ 8 300028.SZ S 20200312 None+ 9 300104.SZ S 20200312 None+ 10 300216.SZ S 20200312 None+ 11 300592.SZ S 20200312 None+ 12 300819.SZ S 20200312 09:30-10:00+ 13 300821.SZ S 20200312 09:30-10:00+ 14 600074.SH S 20200312 None+ 15 600145.SH S 20200312 None+ 16 600228.SH S 20200312 None+ 17 600310.SH S 20200312 None+ 18 600610.SH S 20200312 None+ 19 600745.SH S 20200312 None+ 20 600766.SH S 20200312 None+ 21 600891.SH S 20200312 None+ 22 601127.SH S 20200312 None+ 23 601162.SH S 20200312 None+ 24 603002.SH S 20200312 None+ 25 603399.SH S 20200312 None+diff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\346\257\217\346\227\245\346\214\207\346\240\207.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\346\257\217\346\227\245\346\214\207\346\240\207.md"new file mode 100644index 000000000..7c27fd1ce--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\346\257\217\346\227\245\346\214\207\346\240\207.md"@@ -0,0 +1,83 @@+## ๆฏๆฅๆๆ +----++ๆฅๅฃ๏ผdaily_basic๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆดๆฐๆถ้ด๏ผไบคๆๆฅๆฏๆฅ15็น๏ฝ17็นไน้ด+ๆ่ฟฐ๏ผ่ทๅๅ จ้จ่ก็ฅจๆฏๆฅ้่ฆ็ๅบๆฌ้ขๆๆ ๏ผๅฏ็จไบ้่กๅๆใๆฅ่กจๅฑ็คบ็ญใๅๆฌก่ฏทๆฑๆๅคง่ฟๅ6000ๆกๆฐๆฎ๏ผๅฏๆๆฅ็บฟๅพช็ฏๆๅๅ จ้จๅๅฒใ+็งฏๅ๏ผ่ณๅฐ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผ5000็งฏๅๆ ๆป้้ๅถ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ ๏ผไบ้ไธ๏ผ+trade_date | str | N | ไบคๆๆฅๆ ๏ผไบ้ไธ๏ผ+start_date | str | N | ๅผๅงๆฅๆ(YYYYMMDD)+end_date | str | N | ็ปๆๆฅๆ(YYYYMMDD)++**ๆณจ๏ผๆฅๆ้ฝๅกซYYYYMMDDๆ ผๅผ๏ผๆฏๅฆ20181010**++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๆ่ฟฐ+--- | ---- | ----+ts_code | str | TS่ก็ฅจไปฃ็ +trade_date | str | ไบคๆๆฅๆ+close | float | ๅฝๆฅๆถ็ไปท+turnover_rate | float | ๆขๆ็๏ผ%๏ผ+turnover_rate_f | float | ๆขๆ็๏ผ่ช็ฑๆต้่ก๏ผ+volume_ratio | float | ้ๆฏ+pe | float | ๅธ็็๏ผๆปๅธๅผ/ๅๅฉๆถฆ๏ผ ไบๆ็PEไธบ็ฉบ๏ผ+pe_ttm | float | ๅธ็็๏ผTTM๏ผไบๆ็PEไธบ็ฉบ๏ผ+pb | float | ๅธๅ็๏ผๆปๅธๅผ/ๅ่ตไบง๏ผ+ps | float | ๅธ้็+ps_ttm | float | ๅธ้็๏ผTTM๏ผ+dv_ratio | float | ่กๆฏ็ ๏ผ%๏ผ+dv_ttm | float | ่กๆฏ็๏ผTTM๏ผ๏ผ%๏ผ+total_share | float | ๆป่กๆฌ ๏ผไธ่ก๏ผ+float_share | float | ๆต้่กๆฌ ๏ผไธ่ก๏ผ+free_share | float | ่ช็ฑๆต้่กๆฌ ๏ผไธ๏ผ+total_mv | float | ๆปๅธๅผ ๏ผไธๅ ๏ผ+circ_mv | float | ๆต้ๅธๅผ๏ผไธๅ ๏ผ+++**ๆฅๅฃ็จๆณ**+```python++pro = ts.pro_api()++df = pro.daily_basic(ts_code='', trade_date='20180726', fields='ts_code,trade_date,turnover_rate,volume_ratio,pe,pb')++```++ๆ่++```python++df = pro.query('daily_basic', ts_code='', trade_date='20180726',fields='ts_code,trade_date,turnover_rate,volume_ratio,pe,pb')++```++**ๆฐๆฎๆ ทไพ**++ ts_code trade_date turnover_rate volume_ratio pe pb+ 0 600230.SH 20180726 2.4584 0.72 8.6928 3.7203+ 1 600237.SH 20180726 1.4737 0.88 166.4001 1.8868+ 2 002465.SZ 20180726 0.7489 0.72 71.8943 2.6391+ 3 300732.SZ 20180726 6.7083 0.77 21.8101 3.2513+ 4 600007.SH 20180726 0.0381 0.61 23.7696 2.3774+ 5 300068.SZ 20180726 1.4583 0.52 27.8166 1.7549+ 6 300552.SZ 20180726 2.0728 0.95 56.8004 2.9279+ 7 601369.SH 20180726 0.2088 0.95 44.1163 1.8001+ 8 002518.SZ 20180726 0.5814 0.76 15.1004 2.5626+ 9 002913.SZ 20180726 12.1096 1.03 33.1279 2.9217+ 10 601818.SH 20180726 0.1893 0.86 6.3064 0.7209+ 11 600926.SH 20180726 0.6065 0.46 9.1772 0.9808+ 12 002166.SZ 20180726 0.7582 0.82 16.9868 3.3452+ 13 600841.SH 20180726 0.3754 1.02 66.2647 2.2302+ 14 300634.SZ 20180726 23.1127 1.26 120.3053 14.3168+ 15 300126.SZ 20180726 1.2304 1.11 348.4306 1.5171+ 16 300718.SZ 20180726 17.6612 0.92 32.0239 3.8661+ 17 000708.SZ 20180726 0.5575 0.70 10.3674 1.0276+ 18 002626.SZ 20180726 0.6187 0.83 22.7580 4.2446+ 19 600816.SH 20180726 0.6745 0.65 11.0778 3.2214\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\346\257\217\346\227\245\346\266\250\350\267\214\345\201\234\344\273\267\346\240\274.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\346\257\217\346\227\245\346\266\250\350\267\214\345\201\234\344\273\267\346\240\274.md"new file mode 100644index 000000000..4bb374e63--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\346\257\217\346\227\245\346\266\250\350\267\214\345\201\234\344\273\267\346\240\274.md"@@ -0,0 +1,82 @@+## ๆฏๆฅๆถจ่ทๅไปทๆ ผ+----++ๆฅๅฃ๏ผstk_limit+ๆ่ฟฐ๏ผ่ทๅๅ จๅธๅบ๏ผๅ ๅซA/B่กๅๅบ้๏ผๆฏๆฅๆถจ่ทๅไปทๆ ผ๏ผๅ ๆฌๆถจๅไปทๆ ผ๏ผ่ทๅไปทๆ ผ็ญ๏ผๆฏไธชไบคๆๆฅ8็น40ๅทฆๅณๆดๆฐๅฝๆฅ่ก็ฅจๆถจ่ทๅไปทๆ ผใ+้้๏ผๅๆฌกๆๅคๆๅ5800ๆก่ฎฐๅฝ๏ผๅฏๅพช็ฏ่ฐๅ๏ผๆป้ไธ้ๅถ+็งฏๅ๏ผ็จๆท็งฏ2000็งฏๅๅฏ่ฐๅ๏ผๅไฝๅ้ๆๆตๆง๏ผ็งฏๅ่ถ้ซๆต้่ถๅคง๏ผ่ฏท่ช่กๆ้ซ็งฏๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ+ts_code | str | Y | TS่ก็ฅจไปฃ็ +pre_close | float | N | ๆจๆฅๆถ็ไปท+up_limit | float | Y | ๆถจๅไปท+down_limit | float | Y | ่ทๅไปท++<br>+<br>+++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++#่ทๅๅๆฅๅ จ้จ่ก็ฅจๆฐๆฎๆถจ่ทๅไปทๆ ผ+df = pro.stk_limit(trade_date='20190625')++#่ทๅๅไธช่ก็ฅจๆฐๆฎ+df = pro.stk_limit(ts_code='002149.SZ', start_date='20190115', end_date='20190615')+++```+++<br>+<br>++**ๆฐๆฎ็คบไพ**++ trade_date ts_code up_limit down_limit+ 0 20190625 000001.SZ 15.06 12.32+ 1 20190625 000002.SZ 30.94 25.32+ 2 20190625 000004.SZ 25.15 20.57+ 3 20190625 000005.SZ 3.49 2.85+ 4 20190625 000006.SZ 6.14 5.02+ 5 20190625 000007.SZ 7.74 6.34+ 6 20190625 000008.SZ 4.28 3.50+ 7 20190625 000009.SZ 6.36 5.20+ 8 20190625 000010.SZ 3.51 3.17+ 9 20190625 000011.SZ 10.58 8.66+ 10 20190625 000012.SZ 5.16 4.22+ 11 20190625 000014.SZ 10.98 8.98+ 12 20190625 000016.SZ 4.81 3.93+ 13 20190625 000017.SZ 5.15 4.21+ 14 20190625 000018.SZ 1.44 1.30+ 15 20190625 000019.SZ 8.09 6.62+ 16 20190625 000020.SZ 12.21 9.99+ 17 20190625 000021.SZ 9.30 7.61+ 18 20190625 000023.SZ 14.61 11.95+ 19 20190625 000025.SZ 23.08 18.88+ 20 20190625 000026.SZ 8.66 7.08\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\346\262\252\346\267\261\350\202\241\351\200\232\345\215\201\345\244\247\346\210\220\344\272\244\350\202\241.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\346\262\252\346\267\261\350\202\241\351\200\232\345\215\201\345\244\247\346\210\220\344\272\244\350\202\241.md"new file mode 100644index 000000000..e09785735--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\346\262\252\346\267\261\350\202\241\351\200\232\345\215\201\345\244\247\346\210\220\344\272\244\350\202\241.md"@@ -0,0 +1,74 @@+## ๆฒชๆทฑ่ก้ๅๅคงๆไบค่ก+----++ๆฅๅฃ๏ผhsgt_top10+ๆ่ฟฐ๏ผ่ทๅๆฒช่ก้ใๆทฑ่ก้ๆฏๆฅๅๅๅคงๆไบค่ฏฆ็ปๆฐๆฎ๏ผๆฏๅคฉ18~20็นไน้ดๅฎๆๅฝๆฅๆดๆฐ++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ ๏ผไบ้ไธ๏ผ+trade_date | str | N | ไบคๆๆฅๆ๏ผไบ้ไธ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+market_type | str | N | ๅธๅบ็ฑปๅ๏ผ1๏ผๆฒชๅธ 3๏ผๆทฑๅธ๏ผ++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๆ่ฟฐ+--- | ---- | ----+trade_date | str | ไบคๆๆฅๆ+ts_code | str | ่ก็ฅจไปฃ็ +name | str | ่ก็ฅจๅ็งฐ+close | float | ๆถ็ไปท+change | float | ๆถจ่ท้ข+rank | int | ่ต้ๆๅ+market_type | str | ๅธๅบ็ฑปๅ๏ผ1๏ผๆฒชๅธ 3๏ผๆทฑๅธ๏ผ+amount | float | ๆไบค้้ข๏ผๅ ๏ผ+net_amount | float | ๅๆไบค้้ข๏ผๅ ๏ผ+buy | float | ไนฐๅ ฅ้้ข๏ผๅ ๏ผ+sell | float | ๅๅบ้้ข๏ผๅ ๏ผ+++**ๆฅๅฃ็จๆณ**++```python+pro = ts.pro_api()++pro.hsgt_top10(trade_date='20180725', market_type='1')+```++ๆ่++```python++pro.query('hsgt_top10', ts_code='600519.SH', start_date='20180701', end_date='20180725')++```++**ๆฐๆฎๆ ทไพ**++ trade_date ts_code name close change rank market_type \+ 0 20180725 600009.SH ไธๆตทๆบๅบ 62.69 2.0677 9 1+ 1 20180725 600019.SH ๅฎ้ข่กไปฝ 8.62 0.9368 7 1+ 2 20180725 600036.SH ๆๅ้ถ่ก 28.22 1.6937 10 1+ 3 20180725 600276.SH ๆ็ๅป่ฏ 71.89 1.2393 5 1+ 4 20180725 600519.SH ่ดตๅท่ ๅฐ 743.81 -0.2133 2 1+ 5 20180725 600585.SH ๆตท่บๆฐดๆณฅ 38.23 -0.4427 3 1+ 6 20180725 600690.SH ้ๅฒๆตทๅฐ 18.09 0.0000 8 1+ 7 20180725 600887.SH ไผๅฉ่กไปฝ 27.54 -1.7131 6 1+ 8 20180725 601318.SH ไธญๅฝๅนณๅฎ 62.16 0.6803 1 1+ 9 20180725 601888.SH ไธญๅฝๅฝๆ 74.19 5.5184 4 1++ amount net_amount buy sell+ 0 240958518.0 31199144.0 136078831.0 104879687.0+ 1 245582396.0 81732606.0 163657501.0 81924895.0+ 2 240655550.0 142328622.0 191492086.0 49163464.0+ 3 329472455.0 -71519443.0 128976506.0 200495949.0+ 4 508590993.0 226149667.0 367370330.0 141220663.0+ 5 357946144.0 51215890.0 204581017.0 153365127.0+ 6 243840019.0 -55595149.0 94122435.0 149717584.0+ 7 296552611.0 -40273759.0 128139426.0 168413185.0+ 8 534002916.0 287838388.0 410920652.0 123082264.0+ 9 342115066.0 -63262966.0 139426050.0 202689016.0\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\346\270\257\350\202\241\351\200\232\345\215\201\345\244\247\346\210\220\344\272\244\350\202\241.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\346\270\257\350\202\241\351\200\232\345\215\201\345\244\247\346\210\220\344\272\244\350\202\241.md"new file mode 100644index 000000000..8ccbe1b34--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\346\270\257\350\202\241\351\200\232\345\215\201\345\244\247\346\210\220\344\272\244\350\202\241.md"@@ -0,0 +1,123 @@+## ๆธฏ่ก้ๅๅคงๆไบค่ก+----++ๆฅๅฃ๏ผggt_top10+ๆ่ฟฐ๏ผ่ทๅๆธฏ่ก้ๆฏๆฅๆไบคๆฐๆฎ๏ผๅ ถไธญๅ ๆฌๆฒชๅธใๆทฑๅธ่ฏฆ็ปๆฐๆฎ๏ผๆฏๅคฉ18~20็นไน้ดๅฎๆๅฝๆฅๆดๆฐ++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ ๏ผไบ้ไธ๏ผ+trade_date | str | N | ไบคๆๆฅๆ๏ผไบ้ไธ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+market_type | str | N | ๅธๅบ็ฑปๅ 2๏ผๆธฏ่ก้๏ผๆฒช๏ผ 4๏ผๆธฏ่ก้๏ผๆทฑ๏ผ++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๆ่ฟฐ+--- | ---- | ----+trade_date | str | ไบคๆๆฅๆ+ts_code | str | ่ก็ฅจไปฃ็ +name | str | ่ก็ฅจๅ็งฐ+close | float | ๆถ็ไปท+p_change | float | ๆถจ่ทๅน+rank | int | ่ต้ๆๅ+market_type | str | ๅธๅบ็ฑปๅ 2๏ผๆธฏ่ก้๏ผๆฒช๏ผ 4๏ผๆธฏ่ก้๏ผๆทฑ๏ผ+amount | float | ็ดฏ่ฎกๆไบค้้ข๏ผๅ ๏ผ+net_amount | float | ๅไนฐๅ ฅ้้ข๏ผๅ ๏ผ+sh_amount | float | ๆฒชๅธๆไบค้้ข๏ผๅ ๏ผ+sh_net_amount | float | ๆฒชๅธๅไนฐๅ ฅ้้ข๏ผๅ ๏ผ+sh_buy | float | ๆฒชๅธไนฐๅ ฅ้้ข๏ผๅ ๏ผ+sh_sell | float | ๆฒชๅธๅๅบ้้ข+sz_amount | float | ๆทฑๅธๆไบค้้ข๏ผๅ ๏ผ+sz_net_amount | float | ๆทฑๅธๅไนฐๅ ฅ้้ข๏ผๅ ๏ผ+sz_buy | float | ๆทฑๅธไนฐๅ ฅ้้ข๏ผๅ ๏ผ+sz_sell | float | ๆทฑๅธๅๅบ้้ข๏ผๅ ๏ผ++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++pro.ggt_top10(trade_date='20180727')++```++ๆ่++```python++pro.query('ggt_top10', ts_code='00700', start_date='20180701', end_date='20180727')++```++**ๆฐๆฎๆ ทไพ**++ trade_date ts_code name close p_change rank market_type \+ 0 20180727 00175 ๅๅฉๆฑฝ่ฝฆ 18.42 -3.2563 4.0 2+ 1 20180727 00175 ๅๅฉๆฑฝ่ฝฆ 18.42 -3.2563 4.0 4+ 2 20180727 00581 ไธญๅฝไธๆน้ๅข 6.60 5.9390 NaN 4+ 3 20180727 00607 ไธฐ็ๆง่ก 3.48 -2.5210 NaN 4+ 4 20180727 00700 ่ พ่ฎฏๆง่ก 373.00 -0.4803 1.0 2+ 5 20180727 00700 ่ พ่ฎฏๆง่ก 373.00 -0.4803 1.0 4+ 6 20180727 00763 ไธญๅ ด้่ฎฏ 13.74 0.8811 NaN 4+ 7 20180727 00914 ๆตท่บๆฐดๆณฅ 49.10 2.1852 NaN 4+ 8 20180727 00939 ๅปบ่ฎพ้ถ่ก 7.11 -0.5594 2.0 2+ 9 20180727 01088 ไธญๅฝ็ฅๅ 18.24 3.2843 9.0 2+ 10 20180727 01288 ๅไธ้ถ่ก 3.81 0.0000 5.0 2+ 11 20180727 01299 ๅ้ฆไฟ้ฉ 68.65 0.5124 6.0 2+ 12 20180727 01317 ๆซๅถๆ่ฒ 7.07 1.1445 NaN 4+ 13 20180727 01398 ๅทฅๅ้ถ่ก 5.82 0.0000 3.0 2+ 14 20180727 01448 ็ฆๅฏฟๅญ 7.60 -4.6424 NaN 4+ 15 20180727 01918 ่ๅไธญๅฝ 25.25 -0.3945 10.0 2+ 16 20180727 02208 ้้ฃ็งๆ 10.30 4.9949 NaN 4+ 17 20180727 02382 ่ๅฎๅ ๅญฆ็งๆ 138.60 0.8734 8.0 2+ 18 20180727 02382 ่ๅฎๅ ๅญฆ็งๆ 138.60 0.8734 8.0 4+ 19 20180727 03988 ไธญๅฝ้ถ่ก 3.69 0.0000 7.0 2++ amount net_amount sh_amount sh_net_amount sh_buy \+ 0 476991220.0 -71294840.0 182183940.0 -30957820.0 75613060.0+ 1 294807280.0 -71294840.0 182183940.0 -30957820.0 75613060.0+ 2 49196800.0 23544640.0 NaN NaN NaN+ 3 44903050.0 -36431000.0 NaN NaN NaN+ 4 519061900.0 -219372420.0 383183900.0 -189541460.0 96821220.0+ 5 654939900.0 -219372420.0 383183900.0 -189541460.0 96821220.0+ 6 94728576.0 5410088.0 NaN NaN NaN+ 7 97702200.0 97505000.0 NaN NaN NaN+ 8 379189670.0 -294782730.0 379189670.0 -294782730.0 42203470.0+ 9 75536270.0 30045150.0 75536270.0 30045150.0 52790710.0+ 10 143294570.0 19808330.0 143294570.0 19808330.0 81551450.0+ 11 114038360.0 -112839500.0 114038360.0 -112839500.0 599430.0+ 12 50733740.0 13866820.0 NaN NaN NaN+ 13 237510790.0 162518450.0 237510790.0 162518450.0 200014620.0+ 14 54901320.0 24257620.0 NaN NaN NaN+ 15 75175350.0 -4871850.0 75175350.0 -4871850.0 35151750.0+ 16 83730480.0 775296.0 NaN NaN NaN+ 17 272358740.0 130884350.0 108526330.0 85936290.0 97231310.0+ 18 163832410.0 130884350.0 108526330.0 85936290.0 97231310.0+ 19 108853650.0 -106781530.0 108853650.0 -106781530.0 1036060.0++ sh_sell sz_amount sh_net_amount sz_buy sz_sell+ 0 106570880.0 112623340.0 -40337020.0 36143160.0 76480180.0+ 1 106570880.0 112623340.0 -40337020.0 36143160.0 76480180.0+ 2 NaN 49196800.0 23544640.0 36370720.0 12826080.0+ 3 NaN 44903050.0 -36431000.0 4236025.0 40667025.0+ 4 286362680.0 135878000.0 -29830960.0 53023520.0 82854480.0+ 5 286362680.0 135878000.0 -29830960.0 53023520.0 82854480.0+ 6 NaN 94728576.0 5410088.0 50069332.0 44659244.0+ 7 NaN 97702200.0 97505000.0 97603600.0 98600.0+ 8 336986200.0 NaN NaN NaN NaN+ 9 22745560.0 NaN NaN NaN NaN+ 10 61743120.0 NaN NaN NaN NaN+ 11 113438930.0 NaN NaN NaN NaN+ 12 NaN 50733740.0 13866820.0 32300280.0 18433460.0+ 13 37496170.0 NaN NaN NaN NaN+ 14 NaN 54901320.0 24257620.0 39579470.0 15321850.0+ 15 40023600.0 NaN NaN NaN NaN+ 16 NaN 83730480.0 775296.0 42252888.0 41477592.0+ 17 11295020.0 55306080.0 44948060.0 50127070.0 5179010.0+ 18 11295020.0 55306080.0 44948060.0 50127070.0 5179010.0+ 19 107817590.0 NaN NaN NaN NaN\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\346\270\257\350\202\241\351\200\232\346\257\217\346\227\245\346\210\220\344\272\244\347\273\237\350\256\241.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\346\270\257\350\202\241\351\200\232\346\257\217\346\227\245\346\210\220\344\272\244\347\273\237\350\256\241.md"new file mode 100644index 000000000..b80325474--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\346\270\257\350\202\241\351\200\232\346\257\217\346\227\245\346\210\220\344\272\244\347\273\237\350\256\241.md"@@ -0,0 +1,83 @@+## ๆธฏ่ก้ๆฏๆฅๆไบค็ป่ฎก+----++ๆฅๅฃ๏ผggt_daily+ๆ่ฟฐ๏ผ่ทๅๆธฏ่ก้ๆฏๆฅๆไบคไฟกๆฏ๏ผๆฐๆฎไป2014ๅนดๅผๅง+้้๏ผๅๆฌกๆๅคง1000๏ผๆป้ๆฐๆฎไธ้ๅถ+็งฏๅ๏ผ็จๆท็งฏ2000็งฏๅๅฏ่ฐๅ๏ผ5000็งฏๅไปฅไธ้ขๆฌก็ธๅฏน่พ้ซ๏ผ่ฏท่ช่กๆ้ซ็งฏๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+trade_date | str | N | ไบคๆๆฅๆ ๏ผๆ ผๅผYYYYMMDD๏ผไธๅใๆฏๆๅๆฅๅๅคๆฅ่พๅ ฅ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ+buy_amount | float | Y | ไนฐๅ ฅๆไบค้้ข๏ผไบฟๅ ๏ผ+buy_volume | float | Y | ไนฐๅ ฅๆไบค็ฌๆฐ๏ผไธ็ฌ๏ผ+sell_amount | float | Y | ๅๅบๆไบค้้ข๏ผไบฟๅ ๏ผ+sell_volume | float | Y | ๅๅบๆไบค็ฌๆฐ๏ผไธ็ฌ๏ผ++<br>+<br>+++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++#่ทๅๅๆฅๅ จ้จ็ป่ฎก+df = pro.ggt_daily(trade_date='20190625')++#่ทๅๅคๆฅ็ป่ฎกไฟกๆฏ+df = pro.ggt_daily(trade_date='20190925,20180924,20170925')++#่ทๅๆถ้ดๆฎต็ป่ฎกไฟกๆฏ+df = pro.ggt_daily(start_date='20180925', end_date='20190925)+```+++<br>+<br>++**ๆฐๆฎ็คบไพ**++ trade_date buy_amount buy_volume sell_amount sell_volume+ 0 20190925 31.22 5.54 27.07 4.55+ 1 20190924 37.69 5.53 39.14 6.13+ 2 20190923 26.69 4.43 31.50 5.01+ 3 20190920 35.62 6.16 33.41 5.49+ 4 20190919 31.80 5.83 29.34 5.24+ 5 20190918 26.58 5.27 28.93 6.14+ 6 20190917 29.92 5.76 32.70 6.30+ 7 20190916 44.19 7.78 50.91 8.97+ 8 20190910 30.79 6.04 32.89 5.99+ 9 20190909 35.48 7.01 34.05 6.44+ 10 20190906 39.46 6.98 29.47 6.07+ 11 20190905 57.00 10.46 37.84 7.31+ 12 20190904 49.68 8.43 43.17 6.17+ 13 20190903 33.44 6.46 23.18 4.73+ 14 20190902 43.02 6.91 28.06 5.64+ 15 20190830 35.94 6.51 26.58 6.10+ 16 20190829 39.11 6.89 24.95 4.60+ 17 20190828 39.04 7.46 27.54 5.09+ 18 20190827 44.36 9.44 23.12 4.84+ 19 20190826 55.89 9.23 22.58 4.40+ 20 20190823 33.91 6.28 18.83 4.66+ 21 20190822 38.21 7.38 19.00 4.38+ 22 20190821 35.38 6.42 20.39 3.77\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\346\270\257\350\202\241\351\200\232\346\257\217\346\234\210\346\210\220\344\272\244\347\273\237\350\256\241.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\346\270\257\350\202\241\351\200\232\346\257\217\346\234\210\346\210\220\344\272\244\347\273\237\350\256\241.md"new file mode 100644index 000000000..af8d51a0a--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\346\270\257\350\202\241\351\200\232\346\257\217\346\234\210\346\210\220\344\272\244\347\273\237\350\256\241.md"@@ -0,0 +1,83 @@+## ๆธฏ่ก้ๆฏๆๆไบค็ป่ฎก+----++ๆฅๅฃ๏ผggt_monthly+ๆ่ฟฐ๏ผๆธฏ่ก้ๆฏๆๆไบคไฟกๆฏ๏ผๆฐๆฎไป2014ๅนดๅผๅง+้้๏ผๅๆฌกๆๅคง1000+็งฏๅ๏ผ็จๆท็งฏ5000็งฏๅๅฏ่ฐๅ๏ผ่ฏท่ช่กๆ้ซ็งฏๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+month | str | N | ๆๅบฆ๏ผๆ ผๅผYYYYMM๏ผไธๅ๏ผๆฏๆๅคไธช่พๅ ฅ๏ผ+start_month | str | N | ๅผๅงๆๅบฆ+end_month | str | N | ็ปๆๆๅบฆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+month | str | Y | ไบคๆๆฅๆ+day_buy_amt | float | Y | ๅฝๆๆฅๅไนฐๅ ฅๆไบค้้ข๏ผไบฟๅ ๏ผ+day_buy_vol | float | Y | ๅฝๆๆฅๅไนฐๅ ฅๆไบค็ฌๆฐ๏ผไธ็ฌ๏ผ+day_sell_amt | float | Y | ๅฝๆๆฅๅๅๅบๆไบค้้ข๏ผไบฟๅ ๏ผ+day_sell_vol | float | Y | ๅฝๆๆฅๅๅๅบๆไบค็ฌๆฐ๏ผไธ็ฌ๏ผ+total_buy_amt | float | Y | ๆปไนฐๅ ฅๆไบค้้ข๏ผไบฟๅ ๏ผ+total_buy_vol | float | Y | ๆปไนฐๅ ฅๆไบค็ฌๆฐ๏ผไธ็ฌ๏ผ+total_sell_amt | float | Y | ๆปๅๅบๆไบค้้ข๏ผไบฟๅ ๏ผ+total_sell_vol | float | Y | ๆปๅๅบๆไบค็ฌๆฐ๏ผไธ็ฌ๏ผ+++<br>+<br>+++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++#่ทๅๅๆๅ จ้จ็ป่ฎก+df = pro.ggt_monthly(trade_date='201906')++#่ทๅๅคๆ็ป่ฎกไฟกๆฏ+df = pro.ggt_monthly(trade_date='201906,201907,201709')++#่ทๅๆถ้ดๆฎต็ป่ฎกไฟกๆฏ+df = pro.ggt_monthly(start_date='201809', end_date='201908')+```+++<br>+<br>++**ๆฐๆฎ็คบไพ**++ month day_buy_amt ... total_sell_amt total_sell_vol+ 0 201908 37.77 ... 450.97 96.62+ 1 201907 21.84 ... 382.55 80.20+ 2 201906 27.45 ... 379.76 84.01+ 3 201905 32.58 ... 473.15 96.49+ 4 201904 37.52 ... 574.37 107.81+ 5 201903 40.92 ... 734.38 137.88+ 6 201902 34.70 ... 601.37 102.96+ 7 201901 21.44 ... 481.81 121.27+ 8 201812 19.56 ... 299.61 65.57+ 9 201811 20.44 ... 496.59 112.33+ 10 201810 31.36 ... 453.75 96.50+ 11 201809 26.58 ... 334.69 66.25+ 12 201808 25.67 ... 772.85 122.83+ 13 201807 25.25 ... 569.46 98.26+ 14 201806 28.27 ... 689.56 119.53+ 15 201805 29.71 ... 716.09 118.85+ 16 201804 30.49 ... 502.29 86.25+ 17 201803 38.74 ... 879.75 141.66+ 18 201802 75.70 ... 787.44 105.01\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\351\200\232\347\224\250\350\241\214\346\203\205\346\216\245\345\217\243.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\351\200\232\347\224\250\350\241\214\346\203\205\346\216\245\345\217\243.md"new file mode 100644index 000000000..0af634f28--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\241\214\346\203\205\346\225\260\346\215\256/\351\200\232\347\224\250\350\241\214\346\203\205\346\216\245\345\217\243.md"@@ -0,0 +1,127 @@++## ้็จ่กๆ ๆฅๅฃ+----++**ๆฅๅฃๅ็งฐ**๏ผpro_bar๏ผๆฌๆฅๅฃๆฏ้ๆๅผๅๆฅๅฃ๏ผ้จๅๆๆ ๆฏ็ฐ็จ็ฐ็ฎ+**ๆดๆฐๆถ้ด**๏ผ่ก็ฅจๅๆๆฐ้ๅธธๅจ15็น๏ฝ17็นไน้ด๏ผๆฐๅญ่ดงๅธๅฎๆถๆดๆฐ๏ผๅ ทไฝ่ฏทๅ่ๅๆฅๅฃๆๆกฃๆ็ปใ+**ๆ่ฟฐ**๏ผ็ฎๅๆดๅไบ่ก็ฅจ๏ผๆชๅคๆใๅๅคๆใๅๅคๆ๏ผใๆๆฐใๆฐๅญ่ดงๅธใETFๅบ้ใๆ่ดงใๆๆ็่กๆ ๆฐๆฎ๏ผๆชๆฅ่ฟๅฐๆดๅๅ ๆฌๅคๆฑๅจๅ ็ๆๆไบคๆ่กๆ ๆฐๆฎ๏ผๅๆถๆไพๅ้ๆฐๆฎใไธๅๆฐๆฎๅฏนๅบไธๅ็็งฏๅ่ฆๆฑ๏ผๅ ทไฝ่ฏทๅ้ ๆฏ็ฑปๆฐๆฎ็ๆๆกฃ่ฏดๆใ+**ๅ ถๅฎ**๏ผ็ฑไบๆฌๆฅๅฃๆฏ้ๆๆฅๅฃ๏ผๅจSDKๅฑๅไบไธไบ้ป่พๅค็๏ผ็ฎๅๆๆถๆฒกๆณ็จhttp็ๆนๅผ่ฐๅ้็จ่กๆ ๆฅๅฃใ็จๆทๅฏไปฅ่ฎฟ้ฎTushare็Github๏ผๆฅ็ๆบไปฃ็ ๅฎๆ็ฑปไผผๅ่ฝใ++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ่ฏๅธไปฃ็ ๏ผไธๆฏๆๅคๅผ่พๅ ฅ๏ผๅคๅผ่พๅ ฅ่ทๅ็ปๆไผๆ้ๅค่ฎฐๅฝ+start_date | str | N | ๅผๅงๆฅๆ (ๆฅ็บฟๆ ผๅผ๏ผYYYYMMDD๏ผๆๅๅ้ๆฐๆฎ่ฏท็จ2019-09-01 09:00:00่ฟ็งๆ ผๅผ)+end_date | str | N | ็ปๆๆฅๆ (ๆฅ็บฟๆ ผๅผ๏ผYYYYMMDD)+asset | str | Y | ่ตไบง็ฑปๅซ๏ผE่ก็ฅจ Iๆฒชๆทฑๆๆฐ Cๆฐๅญ่ดงๅธ FTๆ่ดง FDๅบ้ Oๆๆ CBๅฏ่ฝฌๅบ๏ผv1.2.39๏ผ๏ผ้ป่ฎคE+adj | str | N | ๅคๆ็ฑปๅ(ๅช้ๅฏน่ก็ฅจ)๏ผNoneๆชๅคๆ qfqๅๅคๆ hfqๅๅคๆ , ้ป่ฎคNone๏ผ**็ฎๅๅชๆฏๆๆฅ็บฟๅคๆ**๏ผๅๆถๅคๆๆบๅถๆฏๆ นๆฎ่ฎพๅฎ็end_dateๅๆฐๅจๆๅคๆ๏ผ้็จๅ็บขๅๆๆจกๅผ๏ผๅ ทไฝ่ฏทๅ่[ๅธธ่ง้ฎ้ขๅ่กจ](https://tushare.pro/document/1?doc_id=122)้็่ฏดๆใ+freq | str | Y | ๆฐๆฎ้ขๅบฆ ๏ผๆฏๆๅ้(min)/ๆฅ(D)/ๅจ(W)/ๆ(M)K็บฟ๏ผๅ ถไธญ1min่กจ็คบ1ๅ้๏ผ็ฑปๆจ1/5/15/30/60ๅ้๏ผ ๏ผ้ป่ฎคDใๅฏนไบๅ้ๆฐๆฎๆ600็งฏๅ็จๆทๅฏไปฅ่ฏ็จ๏ผ่ฏทๆฑ2ๆฌก๏ผ๏ผๆญฃๅผๆ้ๅฏไปฅๅ่<a href="https://tushare.pro/document/1?doc_id=290"><u>ๆ้ๅ่กจ่ฏดๆ</u></a></font> ๏ผไฝฟ็จๆนๆณ่ฏทๅ่<a href="https://tushare.pro/document/1?doc_id=234">่ก็ฅจๅ้ไฝฟ็จๆนๆณ</a>ใ+ma | list | N | ๅ็บฟ๏ผๆฏๆไปปๆๅ็intๆฐๅผใๆณจ๏ผๅ็บฟๆฏๅจๆ่ฎก็ฎ๏ผ่ฆ่ฎพ็ฝฎไธๅฎๆถ้ด่ๅดๆ่ฝ่ทๅพ็ธๅบ็ๅ็บฟ๏ผๆฏๅฆ5ๆฅๅ็บฟ๏ผๅผๅงๅ็ปๆๆฅๆๅๆฐ่ทจๅบฆๅฟ ้กป่ฆ่ถ ่ฟ5ๆฅใ็ฎๅๅชๆฏๆๅไธไธช่ก็ฅจๆๅๅ็บฟ๏ผๅณ้่ฆ่พๅ ฅts_codeๅๆฐใe.g: ma_5่กจ็คบ5ๆฅๅไปท๏ผma_v_5่กจ็คบ5ๆฅๅ้+factors | list | N | ่ก็ฅจๅ ๅญ๏ผasset='E'ๆๆ๏ผๆฏๆ torๆขๆ็ vr้ๆฏ+adjfactor | str | N | ๅคๆๅ ๅญ๏ผๅจๅคๆๆฐๆฎๆถ๏ผๅฆๆๆญคๅๆฐไธบTrue๏ผ่ฟๅ็ๆฐๆฎไธญๅๅธฆๅคๆๅ ๅญ๏ผ้ป่ฎคไธบFalseใ ่ฏฅๅ่ฝไป1.2.33็ๆฌๅผๅง็ๆ+++<br>++**่พๅบๆๆ **++ๅ ทไฝ่พๅบ็ๆฐๆฎๆๆ ๅฏๅ่ๅ่กๆ ๅ ทไฝๆๆ ๏ผ++่ก็ฅจDaily๏ผ<a href="https://tushare.pro/document/2?doc_id=27">https://tushare.pro/document/2?doc_id=27</a>++ๅบ้Daily๏ผ<a href="https://tushare.pro/document/2?doc_id=127">https://tushare.pro/document/2?doc_id=127</a>++ๆ่ดงDaily๏ผ<a href="https://tushare.pro/document/2?doc_id=138">https://tushare.pro/document/2?doc_id=138</a>++ๆๆDaily๏ผ<a href="https://tushare.pro/document/2?doc_id=159">https://tushare.pro/document/2?doc_id=159</a>++ๆๆฐDaily๏ผ<a href="https://tushare.pro/document/2?doc_id=95">https://tushare.pro/document/2?doc_id=95</a>++++**ๆฅๅฃ็จไพ**++```python++#ๅ000001็ๅๅคๆ่กๆ+df = ts.pro_bar(ts_code='000001.SZ', adj='qfq', start_date='20180101', end_date='20181011')++ ts_code trade_date open high low close \+trade_date+20181011 000001.SZ 20181011 1085.71 1097.59 1047.90 1065.19+20181010 000001.SZ 20181010 1138.65 1151.61 1121.36 1128.92+20181009 000001.SZ 20181009 1130.00 1155.93 1122.44 1140.81+20181008 000001.SZ 20181008 1155.93 1165.65 1128.92 1128.92+20180928 000001.SZ 20180928 1164.57 1217.51 1164.57 1193.74++```+++<br>+<br>+++```python++#ๅไธ่ฏๆๆฐ่กๆ ๆฐๆฎ++df = ts.pro_bar(ts_code='000001.SH', asset='I', start_date='20180101', end_date='20181011')++In [10]: df.head()+Out[10]:+ ts_code trade_date close open high low \+0 000001.SH 20181011 2583.4575 2643.0740 2661.2859 2560.3164+1 000001.SH 20181010 2725.8367 2723.7242 2743.5480 2703.0626+2 000001.SH 20181009 2721.0130 2713.7319 2734.3142 2711.1971+3 000001.SH 20181008 2716.5104 2768.2075 2771.9384 2710.1781+4 000001.SH 20180928 2821.3501 2794.2644 2821.7553 2791.8363++ pre_close change pct_chg vol amount+0 2725.8367 -142.3792 -5.2233 197150702.0 170057762.5+1 2721.0130 4.8237 0.1773 113485736.0 111312455.3+2 2716.5104 4.5026 0.1657 116771899.0 110292457.8+3 2821.3501 -104.8397 -3.7159 149501388.0 141531551.8+4 2791.7748 29.5753 1.0594 134290456.0 125369989.4++```++<br>+<br>++```python++#ๅ็บฟ++df = ts.pro_bar(ts_code='000001.SZ', start_date='20180101', end_date='20181011', ma=[5, 20, 50])++```+ๆณจ๏ผTushare pro_barๆฅๅฃ็ๅไปทๅๅ้ๆฐๆฎๆฏๅจๆ่ฎก็ฎ๏ผๆณ่ฆ่ทๅๆไธชๆถ้ดๆฎต็ๅ็บฟ๏ผๅฟ ้กป่ฆ่ฎพ็ฝฎstart_dateๆฅๆๅคงไบๆๅคงๅ็บฟ็ๆฅๆๆฐ๏ผ็ถๅ่ช่กๆชๅๆณ่ฆๆฅๆๆฎตใไพๅฆ๏ผๆณ่ฆ่ทๅ20190801ๅผๅง็3ๆฅๅ็บฟ๏ผๅฟ ้กป่ฎพ็ฝฎstart_date='20190729'๏ผ็ถๅๅ้ค20190801ไนๅ็ๆฅๆ่ฎฐๅฝใ+++<br>+<br>++```python++#ๆขๆ็tor๏ผ้ๆฏvr++df = ts.pro_bar(ts_code='000001.SZ', start_date='20180101', end_date='20181011', factors=['tor', 'vr'])++```++<br>+<br>+++**่ฏดๆ**++ๅฏนไบpro_apiๅๆฐ๏ผๅฆๆๅจไธๅผๅงๅฐฑ้่ฟ ts.set_token('xxxx') ่ฎพ็ฝฎ่ฟtoken็ๆ ๅต๏ผ่ฟไธชๅๆฐๅฐฑไธๆฏๅฟ ้็ใ++ไพๅฆ๏ผ++```python++df = ts.pro_bar(ts_code='000001.SH', asset='I', start_date='20180101', end_date='20181011')++```\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\264\242\345\212\241\346\225\260\346\215\256/\344\270\232\347\273\251\345\277\253\346\212\245.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\264\242\345\212\241\346\225\260\346\215\256/\344\270\232\347\273\251\345\277\253\346\212\245.md"new file mode 100644index 000000000..e29793ea8--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\264\242\345\212\241\346\225\260\346\215\256/\344\270\232\347\273\251\345\277\253\346\212\245.md"@@ -0,0 +1,83 @@+## ไธ็ปฉๅฟซๆฅ+----++ๆฅๅฃ๏ผexpress+ๆ่ฟฐ๏ผ่ทๅไธๅธๅ ฌๅธไธ็ปฉๅฟซๆฅ+ๆ้๏ผ็จๆท้่ฆ่ณๅฐ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)+<font color="red">+ๆ็คบ๏ผๅฝๅๆฅๅฃๅช่ฝๆๅๅช่ก็ฅจ่ทๅๅ ถๅๅฒๆฐๆฎ๏ผๅฆๆ้่ฆ่ทๅๆไธๅญฃๅบฆๅ จ้จไธๅธๅ ฌๅธๆฐๆฎ๏ผ่ฏทไฝฟ็จexpress_vipๆฅๅฃ๏ผๅๆฐไธ่ด๏ผ๏ผ้็งฏๆ5000็งฏๅใ+</font>+++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +ann_date | str | N | ๅ ฌๅๆฅๆ+start_date | str | N | ๅ ฌๅๅผๅงๆฅๆ+end_date | str | N | ๅ ฌๅ็ปๆๆฅๆ+period | str | N | ๆฅๅๆ(ๆฏไธชๅญฃๅบฆๆๅไธๅคฉ็ๆฅๆ,ๆฏๅฆ20171231่กจ็คบๅนดๆฅ๏ผ20170630ๅๅนดๆฅ๏ผ20170930ไธๅญฃๆฅ)+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๆ่ฟฐ+--- | ---- | ----+ts_code | str | TS่ก็ฅจไปฃ็ +ann_date | str | ๅ ฌๅๆฅๆ+end_date | str | ๆฅๅๆ+revenue | float | ่ฅไธๆถๅ ฅ(ๅ )+operate_profit | float | ่ฅไธๅฉๆถฆ(ๅ )+total_profit | float | ๅฉๆถฆๆป้ข(ๅ )+n_income | float | ๅๅฉๆถฆ(ๅ )+total_assets | float | ๆป่ตไบง(ๅ )+total_hldr_eqy_exc_min_int | float | ่กไธๆ็ๅ่ฎก(ไธๅซๅฐๆฐ่กไธๆ็)(ๅ )+diluted_eps | float | ๆฏ่กๆถ็(ๆ่)(ๅ )+diluted_roe | float | ๅ่ตไบงๆถ็็(ๆ่)(%)+yoy_net_profit | float | ๅปๅนดๅๆไฟฎๆญฃๅๅๅฉๆถฆ+bps | float | ๆฏ่กๅ่ตไบง+yoy_sales | float | ๅๆฏๅข้ฟ็:่ฅไธๆถๅ ฅ+yoy_op | float | ๅๆฏๅข้ฟ็:่ฅไธๅฉๆถฆ+yoy_tp | float | ๅๆฏๅข้ฟ็:ๅฉๆถฆๆป้ข+yoy_dedu_np | float | ๅๆฏๅข้ฟ็:ๅฝๅฑๆฏๅ ฌๅธ่กไธ็ๅๅฉๆถฆ+yoy_eps | float | ๅๆฏๅข้ฟ็:ๅบๆฌๆฏ่กๆถ็+yoy_roe | float | ๅๆฏๅขๅ:ๅ ๆๅนณๅๅ่ตไบงๆถ็็+growth_assets | float | ๆฏๅนดๅๅข้ฟ็:ๆป่ตไบง+yoy_equity | float | ๆฏๅนดๅๅข้ฟ็:ๅฝๅฑๆฏๅ ฌๅธ็่กไธๆ็+growth_bps | float | ๆฏๅนดๅๅข้ฟ็:ๅฝๅฑไบๆฏๅ ฌๅธ่กไธ็ๆฏ่กๅ่ตไบง+or_last_year | float | ๅปๅนดๅๆ่ฅไธๆถๅ ฅ+op_last_year | float | ๅปๅนดๅๆ่ฅไธๅฉๆถฆ+tp_last_year | float | ๅปๅนดๅๆๅฉๆถฆๆป้ข+np_last_year | float | ๅปๅนดๅๆๅๅฉๆถฆ+eps_last_year | float | ๅปๅนดๅๆๆฏ่กๆถ็+open_net_assets | float | ๆๅๅ่ตไบง+open_bps | float | ๆๅๆฏ่กๅ่ตไบง+perf_summary | str | ไธ็ปฉ็ฎ่ฆ่ฏดๆ+is_audit | int | ๆฏๅฆๅฎก่ฎก๏ผ 1ๆฏ 0ๅฆ+remark | str | ๅคๆณจ+++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++pro.express(ts_code='600000.SH', start_date='20180101', end_date='20180701', fields='ts_code,ann_date,end_date,revenue,operate_profit,total_profit,n_income,total_assets')++```++่ทๅๆไธๅญฃๅบฆๅ จ้จ่ก็ฅจๆฐๆฎ+```python++df = pro.express_vip(period='20181231',fields='ts_code,ann_date,end_date,revenue,operate_profit,total_profit,n_income,total_assets')++```++**ๆฐๆฎๆ ทไพ**++ ts_code ann_date end_date revenue operate_profit total_profit n_income total_assets \+ 0 603535.SH 20180411 20180331 2.064659e+08 3.345047e+07 3.340047e+07 2.672643e+07 1.682111e+09+ 1 603535.SH 20180208 20171231 1.034262e+09 1.323373e+08 1.440493e+08 1.188325e+08 1.710466e+09+ 2 603535.SH 20171016 20170930 7.064117e+08 9.509520e+07 9.931530e+07 8.202480e+07 1.672986e+09\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\264\242\345\212\241\346\225\260\346\215\256/\344\270\232\347\273\251\351\242\204\345\221\212.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\264\242\345\212\241\346\225\260\346\215\256/\344\270\232\347\273\251\351\242\204\345\221\212.md"new file mode 100644index 000000000..25c3a20e1--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\264\242\345\212\241\346\225\260\346\215\256/\344\270\232\347\273\251\351\242\204\345\221\212.md"@@ -0,0 +1,80 @@+## ไธ็ปฉ้ขๅ+----++ๆฅๅฃ๏ผforecast๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆ่ฟฐ๏ผ่ทๅไธ็ปฉ้ขๅๆฐๆฎ+ๆ้๏ผ็จๆท้่ฆ่ณๅฐ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)+<font color="red">+ๆ็คบ๏ผๅฝๅๆฅๅฃๅช่ฝๆๅๅช่ก็ฅจ่ทๅๅ ถๅๅฒๆฐๆฎ๏ผๅฆๆ้่ฆ่ทๅๆไธๅญฃๅบฆๅ จ้จไธๅธๅ ฌๅธๆฐๆฎ๏ผ่ฏทไฝฟ็จforecast_vipๆฅๅฃ๏ผๅๆฐไธ่ด๏ผ๏ผ้็งฏๆ5000็งฏๅใ+</font>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ (ไบ้ไธ)+ann_date | str | N | ๅ ฌๅๆฅๆ (ไบ้ไธ)+start_date | str | N | ๅ ฌๅๅผๅงๆฅๆ+end_date | str | N | ๅ ฌๅ็ปๆๆฅๆ+period | str | N | ๆฅๅๆ(ๆฏไธชๅญฃๅบฆๆๅไธๅคฉ็ๆฅๆ๏ผๆฏๅฆ20171231่กจ็คบๅนดๆฅ๏ผ20170630ๅๅนดๆฅ๏ผ20170930ไธๅญฃๆฅ)+type | str | N | ้ขๅ็ฑปๅ(้ขๅข/้ขๅ/ๆญไบ/้ฆไบ/็ปญไบ/็ปญ็/็ฅๅข/็ฅๅ)++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๆ่ฟฐ+--- | ---- | ----+ts_code | str | TS่ก็ฅจไปฃ็ +ann_date | str | ๅ ฌๅๆฅๆ+end_date | str | ๆฅๅๆ+type | str | ไธ็ปฉ้ขๅ็ฑปๅ(้ขๅข/้ขๅ/ๆญไบ/้ฆไบ/็ปญไบ/็ปญ็/็ฅๅข/็ฅๅ)+p_change_min | float | ้ขๅๅๅฉๆถฆๅๅจๅน ๅบฆไธ้๏ผ%๏ผ+p_change_max | float | ้ขๅๅๅฉๆถฆๅๅจๅน ๅบฆไธ้๏ผ%๏ผ+net_profit_min | float | ้ขๅๅๅฉๆถฆไธ้๏ผไธๅ ๏ผ+net_profit_max | float | ้ขๅๅๅฉๆถฆไธ้๏ผไธๅ ๏ผ+last_parent_net | float | ไธๅนดๅๆๅฝๅฑๆฏๅ ฌๅธๅๅฉๆถฆ+first_ann_date | str | ้ฆๆฌกๅ ฌๅๆฅ+summary | str | ไธ็ปฉ้ขๅๆ่ฆ+change_reason | str | ไธ็ปฉๅๅจๅๅ++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++pro.forecast(ann_date='20190131', fields='ts_code,ann_date,end_date,type,p_change_min,p_change_max,net_profit_min')++```++่ทๅๆไธๅญฃๅบฆๅ จ้จ่ก็ฅจๆฐๆฎ+```python++df = pro.forecast_vip(period='20181231',fields='ts_code,ann_date,end_date,type,p_change_min,p_change_max,net_profit_min')++```+++**ๆฐๆฎๆ ทไพ**++ ts_code ann_date end_date type p_change_min p_change_max \+ 0 000005.SZ 20190131 20181231 ้ขๅข 618.5600 945.1800+ 1 000825.SZ 20190131 20181231 ็ฅๅข 3.8500 12.5100+ 2 000566.SZ 20190131 20181231 ้ขๅข 50.0000 100.0000+ 3 000932.SZ 20190131 20181231 ้ขๅข 60.8864 68.1664+ 4 000557.SZ 20190131 20181231 ้ขๅข 66.6800 66.6800+ 5 600127.SH 20190131 20181231 ้ฆไบ -601.5517 -510.3604+ 6 600159.SH 20190131 20181231 ้ขๅข 315.0000 315.0000+ 7 600963.SH 20190131 20181231 ็ฅๅข 2.3800 11.5800+ 8 002336.SZ 20190131 20181231 ็ปญไบ 33.1367 47.9952+ 9 601608.SH 20190131 20181231 ้ขๅข 228.5900 274.5700+ 10 600531.SH 20190131 20181231 ้ขๅ -61.8800 -54.3200+ 11 300200.SZ 20190131 20181231 ้ขๅข 82.4000 112.4000+ 12 300441.SZ 20190131 20181231 ็ฅๅ -20.5100 -0.6400+ 13 300157.SZ 20190131 20181231 ๆญไบ 107.3969 108.5176+ 14 300052.SZ 20190131 20181231 ็ฅๅ -30.0000 0.0000+ 15 002328.SZ 20190131 20181231 ็ฅๅข 0.0000 20.0000+ 16 300420.SZ 20190131 20181231 ้ขๅข 61.1500 90.8000+ 17 300109.SZ 20190131 20181231 ็ปญ็ -13.8100 7.7300+ 18 300479.SZ 20190131 20181231 ็ฅๅ -35.8400 -6.6700+ 19 000402.SZ 20190131 20181231 ็ฅๅข 1.0000 10.0000+ 20 002626.SZ 20190131 20181231 ็ฅๅข 37.1200 47.6600\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\264\242\345\212\241\346\225\260\346\215\256/\344\270\273\350\220\245\344\270\232\345\212\241\346\236\204\346\210\220.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\264\242\345\212\241\346\225\260\346\215\256/\344\270\273\350\220\245\344\270\232\345\212\241\346\236\204\346\210\220.md"new file mode 100644index 000000000..8bef3aeec--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\264\242\345\212\241\346\225\260\346\215\256/\344\270\273\350\220\245\344\270\232\345\212\241\346\236\204\346\210\220.md"@@ -0,0 +1,59 @@+## ไธป่ฅไธๅกๆๆ+----++ๆฅๅฃ๏ผfina_mainbz+ๆ่ฟฐ๏ผ่ทๅพไธๅธๅ ฌๅธไธป่ฅไธๅกๆๆ๏ผๅๅฐๅบๅไบงๅไธค็งๆนๅผ+ๆ้๏ผ็จๆท้่ฆ่ณๅฐ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13) ๏ผๅๆฌกๆๅคงๆๅ100่ก๏ผๆป้ไธ้ๅถ๏ผๅฏๅพช็ฏ่ทๅใ+<font color="red">+ๆ็คบ๏ผๅฝๅๆฅๅฃๅช่ฝๆๅๅช่ก็ฅจ่ทๅๅ ถๅๅฒๆฐๆฎ๏ผๅฆๆ้่ฆ่ทๅๆไธๅญฃๅบฆๅ จ้จไธๅธๅ ฌๅธๆฐๆฎ๏ผ่ฏทไฝฟ็จfina_mainbz_vipๆฅๅฃ๏ผๅๆฐไธ่ด๏ผ๏ผ้็งฏๆ5000็งฏๅใ+</font>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +period | str | N | ๆฅๅๆ(ๆฏไธชๅญฃๅบฆๆๅไธๅคฉ็ๆฅๆ,ๆฏๅฆ20171231่กจ็คบๅนดๆฅ)+type | str | N | ็ฑปๅ๏ผPๆไบงๅ Dๆๅฐๅบ Iๆ่กไธ๏ผ่ฏท่พๅ ฅๅคงๅๅญๆฏPๆ่ D๏ผ+start_date | str | N | ๆฅๅๆๅผๅงๆฅๆ+end_date | str | N | ๆฅๅๆ็ปๆๆฅๆ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๆ่ฟฐ+--- | ---- | ----+ts_code | str | TSไปฃ็ +end_date | str | ๆฅๅๆ+bz_item | str | ไธป่ฅไธๅกๆฅๆบ+bz_sales | float | ไธป่ฅไธๅกๆถๅ ฅ(ๅ )+bz_profit | float | ไธป่ฅไธๅกๅฉๆถฆ(ๅ )+bz_cost | float | ไธป่ฅไธๅกๆๆฌ(ๅ )+curr_type | str | ่ดงๅธไปฃ็ +update_flag | str | ๆฏๅฆๆดๆฐ++**ไปฃ็ ็คบไพ**++```python++pro = ts.pro_api()++df = pro.fina_mainbz(ts_code='000627.SZ', type='P')++```++่ทๅๆไธๅญฃๅบฆๅ จ้จ่ก็ฅจๆฐๆฎ+```python++df = pro.fina_mainbz_vip(period='20181231', type='P' ,fields='ts_code,end_date,bz_item,bz_sales')++```++**ๆฐๆฎๆ ทไพ**++ ts_code end_date bz_item bz_sales bz_profit bz_cost curr_type+ 0 000627.SZ 20171231 ๅ ถไปไบงๅ 1.847507e+08 None None CNY+ 1 000627.SZ 20171231 ๅ ถไปไธป่ฅไธๅก 1.847507e+08 None None CNY+ 2 000627.SZ 20171231 ่ไธ็ฏ 6.629111e+07 None None CNY+ 3 000627.SZ 20171231 ๅๆ่ฏไบงๅ 2.685909e+08 None None CNY+ 4 000627.SZ 20171231 ไฟ้ฉไธๅก 5.288595e+10 None None CNY\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\264\242\345\212\241\346\225\260\346\215\256/\345\210\206\347\272\242\351\200\201\350\202\241\346\225\260\346\215\256.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\264\242\345\212\241\346\225\260\346\215\256/\345\210\206\347\272\242\351\200\201\350\202\241\346\225\260\346\215\256.md"new file mode 100644index 000000000..544051b86--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\264\242\345\212\241\346\225\260\346\215\256/\345\210\206\347\272\242\351\200\201\350\202\241\346\225\260\346\215\256.md"@@ -0,0 +1,71 @@+## ๅ็บข้่ก+----++ๆฅๅฃ๏ผdividend+ๆ่ฟฐ๏ผๅ็บข้่กๆฐๆฎ+ๆ้๏ผ็จๆท้่ฆ่ณๅฐ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | TSไปฃ็ +ann_date | str | N | ๅ ฌๅๆฅ+record_date | str | N | ่กๆ็ป่ฎฐๆฅๆ+ex_date | str | N | ้คๆ้คๆฏๆฅ+imp_ann_date | str | N | ๅฎๆฝๅ ฌๅๆฅ++<br>++ไปฅไธๅๆฐ่ณๅฐๆไธไธชไธ่ฝไธบ็ฉบ++<br>+<br>+++**่พๅบๅๆฐ**+++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | TSไปฃ็ +end_date | str | Y | ๅ็บขๅนดๅบฆ+ann_date | str | Y | ้ขๆกๅ ฌๅๆฅ+div_proc | str | Y | ๅฎๆฝ่ฟๅบฆ+stk_div | float | Y | ๆฏ่ก้่ฝฌ+stk_bo_rate | float | Y | ๆฏ่ก้่กๆฏไพ+stk_co_rate | float | Y | ๆฏ่ก่ฝฌๅขๆฏไพ+cash_div | float | Y | ๆฏ่กๅ็บข๏ผ็จๅ๏ผ+cash_div_tax | float | Y | ๆฏ่กๅ็บข๏ผ็จๅ๏ผ+record_date | str | Y | ่กๆ็ป่ฎฐๆฅ+ex_date | str | Y | ้คๆ้คๆฏๆฅ+pay_date | str | Y | ๆดพๆฏๆฅ+div_listdate | str | Y | ็บข่กไธๅธๆฅ+imp_ann_date | str | Y | ๅฎๆฝๅ ฌๅๆฅ+base_date | str | N | ๅบๅๆฅ+base_share | float | N | ๅบๅ่กๆฌ๏ผไธ๏ผ+++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++df = pro.dividend(ts_code='600848.SH', fields='ts_code,div_proc,stk_div,record_date,ex_date')++```++**ๆฐๆฎๆ ทไพ**++```python++ ts_code div_proc stk_div record_date ex_date+ 0 600848.SH ๅฎๆฝ 0.10 19950606 19950607+ 1 600848.SH ๅฎๆฝ 0.10 19970707 19970708+ 2 600848.SH ๅฎๆฝ 0.15 19960701 19960702+ 3 600848.SH ๅฎๆฝ 0.10 19980706 19980707+ 4 600848.SH ้ขๆก 0.00 None None+ 5 600848.SH ๅฎๆฝ 0.00 20180522 20180523++```\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\264\242\345\212\241\346\225\260\346\215\256/\345\210\251\346\266\246\350\241\250.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\264\242\345\212\241\346\225\260\346\215\256/\345\210\251\346\266\246\350\241\250.md"new file mode 100644index 000000000..d9ceac1c0--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\264\242\345\212\241\346\225\260\346\215\256/\345\210\251\346\266\246\350\241\250.md"@@ -0,0 +1,168 @@+## ๅฉๆถฆ่กจ+----++ๆฅๅฃ๏ผincome๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆ่ฟฐ๏ผ่ทๅไธๅธๅ ฌๅธ่ดขๅกๅฉๆถฆ่กจๆฐๆฎ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)+<font color="red">+ๆ็คบ๏ผๅฝๅๆฅๅฃๅช่ฝๆๅๅช่ก็ฅจ่ทๅๅ ถๅๅฒๆฐๆฎ๏ผๅฆๆ้่ฆ่ทๅๆไธๅญฃๅบฆๅ จ้จไธๅธๅ ฌๅธๆฐๆฎ๏ผ่ฏทไฝฟ็จincome_vipๆฅๅฃ๏ผๅๆฐไธ่ด๏ผ๏ผ้็งฏๆ5000็งฏๅใ+</font>+++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +ann_date | str | N | ๅ ฌๅๆฅๆ๏ผYYYYMMDDๆ ผๅผ๏ผไธๅ๏ผ+f_ann_date | str | N | ๅฎ้ ๅ ฌๅๆฅๆ+start_date | str | N | ๅ ฌๅๆฅๅผๅงๆฅๆ+end_date | str | N | ๅ ฌๅๆฅ็ปๆๆฅๆ+period | str | N | ๆฅๅๆ(ๆฏไธชๅญฃๅบฆๆๅไธๅคฉ็ๆฅๆ๏ผๆฏๅฆ20171231่กจ็คบๅนดๆฅ๏ผ20170630ๅๅนดๆฅ๏ผ20170930ไธๅญฃๆฅ)+report_type | str | N | ๆฅๅ็ฑปๅ๏ผๅ่ๆๆกฃๆไธๆน่ฏดๆ+comp_type | str | N | ๅ ฌๅธ็ฑปๅ๏ผ1ไธ่ฌๅทฅๅไธ2้ถ่ก3ไฟ้ฉ4่ฏๅธ๏ผ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | TSไปฃ็ +ann_date | str | Y | ๅ ฌๅๆฅๆ+f_ann_date | str | Y | ๅฎ้ ๅ ฌๅๆฅๆ+end_date | str | Y | ๆฅๅๆ+report_type | str | Y | ๆฅๅ็ฑปๅ ่งๅบ้จ่กจ+comp_type | str | Y | ๅ ฌๅธ็ฑปๅ(1ไธ่ฌๅทฅๅไธ2้ถ่ก3ไฟ้ฉ4่ฏๅธ)+end_type | str | Y | ๆฅๅๆ็ฑปๅ+basic_eps | float | Y | ๅบๆฌๆฏ่กๆถ็+diluted_eps | float | Y | ็จ้ๆฏ่กๆถ็+total_revenue | float | Y | ่ฅไธๆปๆถๅ ฅ+revenue | float | Y | ่ฅไธๆถๅ ฅ+int_income | float | Y | ๅฉๆฏๆถๅ ฅ+prem_earned | float | Y | ๅทฒ่ตไฟ่ดน+comm_income | float | Y | ๆ็ปญ่ดนๅไฝฃ้ๆถๅ ฅ+n_commis_income | float | Y | ๆ็ปญ่ดนๅไฝฃ้ๅๆถๅ ฅ+n_oth_income | float | Y | ๅ ถไป็ป่ฅๅๆถ็+n_oth_b_income | float | Y | ๅ :ๅ ถไปไธๅกๅๆถ็+prem_income | float | Y | ไฟ้ฉไธๅกๆถๅ ฅ+out_prem | float | Y | ๅ:ๅๅบไฟ่ดน+une_prem_reser | float | Y | ๆๅๆชๅฐๆ่ดฃไปปๅๅค้+reins_income | float | Y | ๅ ถไธญ:ๅไฟ่ดนๆถๅ ฅ+n_sec_tb_income | float | Y | ไปฃ็ไนฐๅ่ฏๅธไธๅกๅๆถๅ ฅ+n_sec_uw_income | float | Y | ่ฏๅธๆฟ้ไธๅกๅๆถๅ ฅ+n_asset_mg_income | float | Y | ๅๆๅฎขๆท่ตไบง็ฎก็ไธๅกๅๆถๅ ฅ+oth_b_income | float | Y | ๅ ถไปไธๅกๆถๅ ฅ+fv_value_chg_gain | float | Y | ๅ :ๅ ฌๅ ไปทๅผๅๅจๅๆถ็+invest_income | float | Y | ๅ :ๆ่ตๅๆถ็+ass_invest_income | float | Y | ๅ ถไธญ:ๅฏน่่ฅไผไธๅๅ่ฅไผไธ็ๆ่ตๆถ็+forex_gain | float | Y | ๅ :ๆฑๅ ๅๆถ็+total_cogs | float | Y | ่ฅไธๆปๆๆฌ+oper_cost | float | Y | ๅ:่ฅไธๆๆฌ+int_exp | float | Y | ๅ:ๅฉๆฏๆฏๅบ+comm_exp | float | Y | ๅ:ๆ็ปญ่ดนๅไฝฃ้ๆฏๅบ+biz_tax_surchg | float | Y | ๅ:่ฅไธ็จ้ๅ้ๅ+sell_exp | float | Y | ๅ:้ๅฎ่ดน็จ+admin_exp | float | Y | ๅ:็ฎก็่ดน็จ+fin_exp | float | Y | ๅ:่ดขๅก่ดน็จ+assets_impair_loss | float | Y | ๅ:่ตไบงๅๅผๆๅคฑ+prem_refund | float | Y | ้ไฟ้+compens_payout | float | Y | ่ตไปๆปๆฏๅบ+reser_insur_liab | float | Y | ๆๅไฟ้ฉ่ดฃไปปๅๅค้+div_payt | float | Y | ไฟๆท็บขๅฉๆฏๅบ+reins_exp | float | Y | ๅไฟ่ดน็จ+oper_exp | float | Y | ่ฅไธๆฏๅบ+compens_payout_refu | float | Y | ๅ:ๆๅ่ตไปๆฏๅบ+insur_reser_refu | float | Y | ๅ:ๆๅไฟ้ฉ่ดฃไปปๅๅค้+reins_cost_refund | float | Y | ๅ:ๆๅๅไฟ่ดน็จ+other_bus_cost | float | Y | ๅ ถไปไธๅกๆๆฌ+operate_profit | float | Y | ่ฅไธๅฉๆถฆ+non_oper_income | float | Y | ๅ :่ฅไธๅคๆถๅ ฅ+non_oper_exp | float | Y | ๅ:่ฅไธๅคๆฏๅบ+nca_disploss | float | Y | ๅ ถไธญ:ๅ:้ๆตๅจ่ตไบงๅค็ฝฎๅๆๅคฑ+total_profit | float | Y | ๅฉๆถฆๆป้ข+income_tax | float | Y | ๆๅพ็จ่ดน็จ+n_income | float | Y | ๅๅฉๆถฆ(ๅซๅฐๆฐ่กไธๆ็)+n_income_attr_p | float | Y | ๅๅฉๆถฆ(ไธๅซๅฐๆฐ่กไธๆ็)+minority_gain | float | Y | ๅฐๆฐ่กไธๆ็+oth_compr_income | float | Y | ๅ ถไป็ปผๅๆถ็+t_compr_income | float | Y | ็ปผๅๆถ็ๆป้ข+compr_inc_attr_p | float | Y | ๅฝๅฑไบๆฏๅ ฌๅธ(ๆ่กไธ)็็ปผๅๆถ็ๆป้ข+compr_inc_attr_m_s | float | Y | ๅฝๅฑไบๅฐๆฐ่กไธ็็ปผๅๆถ็ๆป้ข+ebit | float | Y | ๆฏ็จๅๅฉๆถฆ+ebitda | float | Y | ๆฏ็จๆๆงๆ้ๅๅฉๆถฆ+insurance_exp | float | Y | ไฟ้ฉไธๅกๆฏๅบ+undist_profit | float | Y | ๅนดๅๆชๅ้ ๅฉๆถฆ+distable_profit | float | Y | ๅฏๅ้ ๅฉๆถฆ+rd_exp | float | Y | ็ ๅ่ดน็จ+fin_exp_int_exp | float | Y | ่ดขๅก่ดน็จ:ๅฉๆฏ่ดน็จ+fin_exp_int_inc | float | Y | ่ดขๅก่ดน็จ:ๅฉๆฏๆถๅ ฅ+transfer_surplus_rese | float | Y | ็ไฝๅ ฌ็งฏ่ฝฌๅ ฅ+transfer_housing_imprest | float | Y | ไฝๆฟๅจ่ฝฌ้่ฝฌๅ ฅ+transfer_oth | float | Y | ๅ ถไป่ฝฌๅ ฅ+adj_lossgain | float | Y | ่ฐๆดไปฅๅๅนดๅบฆๆ็+withdra_legal_surplus | float | Y | ๆๅๆณๅฎ็ไฝๅ ฌ็งฏ+withdra_legal_pubfund | float | Y | ๆๅๆณๅฎๅ ฌ็้+withdra_biz_devfund | float | Y | ๆๅไผไธๅๅฑๅบ้+withdra_rese_fund | float | Y | ๆๅๅจๅคๅบ้+withdra_oth_ersu | float | Y | ๆๅไปปๆ็ไฝๅ ฌ็งฏ้+workers_welfare | float | Y | ่ๅทฅๅฅ้็ฆๅฉ+distr_profit_shrhder | float | Y | ๅฏไพ่กไธๅ้ ็ๅฉๆถฆ+prfshare_payable_dvd | float | Y | ๅบไปไผๅ ่ก่กๅฉ+comshare_payable_dvd | float | Y | ๅบไปๆฎ้่ก่กๅฉ+capit_comstock_div | float | Y | ่ฝฌไฝ่กๆฌ็ๆฎ้่ก่กๅฉ+net_after_nr_lp_correct | float | N | ๆฃ้ค้็ปๅธธๆงๆ็ๅ็ๅๅฉๆถฆ๏ผๆดๆญฃๅ๏ผ+credit_impa_loss | float | N | ไฟก็จๅๅผๆๅคฑ+net_expo_hedging_benefits | float | N | ๅๆๅฃๅฅๆๆถ็+oth_impair_loss_assets | float | N | ๅ ถไป่ตไบงๅๅผๆๅคฑ+total_opcost | float | N | ่ฅไธๆปๆๆฌ๏ผไบ๏ผ+amodcost_fin_assets | float | N | ไปฅๆไฝๆๆฌ่ฎก้็้่่ตไบง็ปๆญข็กฎ่ฎคๆถ็+oth_income | float | N | ๅ ถไปๆถ็+asset_disp_income | float | N | ่ตไบงๅค็ฝฎๆถ็+continued_net_profit | float | N | ๆ็ปญ็ป่ฅๅๅฉๆถฆ+end_net_profit | float | N | ็ปๆญข็ป่ฅๅๅฉๆถฆ+update_flag | str | Y | ๆดๆฐๆ ่ฏ++++**ๆฅๅฃไฝฟ็จ่ฏดๆ**+```python++pro = ts.pro_api()++df = pro.income(ts_code='600000.SH', start_date='20180101', end_date='20180730', fields='ts_code,ann_date,f_ann_date,end_date,report_type,comp_type,basic_eps,diluted_eps')++```++่ทๅๆไธๅญฃๅบฆๅ จ้จ่ก็ฅจๆฐๆฎ+```python++df = pro.income_vip(period='20181231',fields='ts_code,ann_date,f_ann_date,end_date,report_type,comp_type,basic_eps,diluted_eps')++```++**ๆฐๆฎๆ ทไพ**++ ts_code ann_date f_ann_date end_date report_type comp_type basic_eps diluted_eps \+ 0 600000.SH 20180428 20180428 20180331 1 2 0.46 0.46+ 1 600000.SH 20180428 20180428 20180331 1 2 0.46 0.46+ 2 600000.SH 20180428 20180428 20171231 1 2 1.84 1.84+++++**ไธป่ฆๆฅ่กจ็ฑปๅ่ฏดๆ**++ไปฃ็ | ็ฑปๅ | ่ฏดๆ+---- | ----- | ---- |+1 | ๅๅนถๆฅ่กจ | ไธๅธๅ ฌๅธๆๆฐๆฅ่กจ๏ผ้ป่ฎค๏ผ+2 | ๅๅญฃๅๅนถ | ๅไธๅญฃๅบฆ็ๅๅนถๆฅ่กจ+3 | ่ฐๆดๅๅญฃๅๅนถ่กจ | ่ฐๆดๅ็ๅๅญฃๅๅนถๆฅ่กจ๏ผๅฆๆๆ๏ผ+4 | ่ฐๆดๅๅนถๆฅ่กจ | ๆฌๅนดๅบฆๅ ฌๅธไธๅนดๅๆ็่ดขๅกๆฅ่กจๆฐๆฎ๏ผๆฅๅๆไธบไธๅนดๅบฆ+5 | ่ฐๆดๅๅๅนถๆฅ่กจ | ๆฐๆฎๅ็ๅๆด๏ผๅฐๅๆฐๆฎ่ฟ่กไฟ็๏ผๅณ่ฐๆดๅ็ๅๆฐๆฎ+6 | ๆฏๅ ฌๅธๆฅ่กจ | ่ฏฅๅ ฌๅธๆฏๅ ฌๅธ็่ดขๅกๆฅ่กจๆฐๆฎ+7 | ๆฏๅ ฌๅธๅๅญฃ่กจ | ๆฏๅ ฌๅธ็ๅๅญฃๅบฆ่กจ+8 | ๆฏๅ ฌๅธ่ฐๆดๅๅญฃ่กจ | ๆฏๅ ฌๅธ่ฐๆดๅ็ๅๅญฃ่กจ+9 | ๆฏๅ ฌๅธ่ฐๆด่กจ | ่ฏฅๅ ฌๅธๆฏๅ ฌๅธ็ๆฌๅนดๅบฆๅ ฌๅธไธๅนดๅๆ็่ดขๅกๆฅ่กจๆฐๆฎ+10 | ๆฏๅ ฌๅธ่ฐๆดๅๆฅ่กจ | ๆฏๅ ฌๅธ่ฐๆดไนๅ็ๅๅง่ดขๅกๆฅ่กจๆฐๆฎ+11 | ๆฏๅ ฌๅธ่ฐๆดๅๅๅนถๆฅ่กจ | ๆฏๅ ฌๅธ่ฐๆดไนๅๅๅนถๆฅ่กจๅๆฐๆฎ+12 | ๆฏๅ ฌๅธ่ฐๆดๅๆฅ่กจ | ๆฏๅ ฌๅธๆฅ่กจๅ็ๅๆดๅไฟ็็ๅๆฐๆฎ\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\264\242\345\212\241\346\225\260\346\215\256/\347\216\260\351\207\221\346\265\201\351\207\217\350\241\250.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\264\242\345\212\241\346\225\260\346\215\256/\347\216\260\351\207\221\346\265\201\351\207\217\350\241\250.md"new file mode 100644index 000000000..4b9f8a92f--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\264\242\345\212\241\346\225\260\346\215\256/\347\216\260\351\207\221\346\265\201\351\207\217\350\241\250.md"@@ -0,0 +1,174 @@+## ็ฐ้ๆต้่กจ+----++ๆฅๅฃ๏ผcashflow๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆ่ฟฐ๏ผ่ทๅไธๅธๅ ฌๅธ็ฐ้ๆต้่กจ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)+<font color="red">+ๆ็คบ๏ผๅฝๅๆฅๅฃๅช่ฝๆๅๅช่ก็ฅจ่ทๅๅ ถๅๅฒๆฐๆฎ๏ผๅฆๆ้่ฆ่ทๅๆไธๅญฃๅบฆๅ จ้จไธๅธๅ ฌๅธๆฐๆฎ๏ผ่ฏทไฝฟ็จcashflow_vipๆฅๅฃ๏ผๅๆฐไธ่ด๏ผ๏ผ้็งฏๆ5000็งฏๅใ+</font>+++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +ann_date | str | N | ๅ ฌๅๆฅๆ๏ผYYYYMMDDๆ ผๅผ๏ผไธๅ๏ผ+f_ann_date | str | N | ๅฎ้ ๅ ฌๅๆฅๆ+start_date | str | N | ๅ ฌๅๆฅๅผๅงๆฅๆ+end_date | str | N | ๅ ฌๅๆฅ็ปๆๆฅๆ+period | str | N | ๆฅๅๆ(ๆฏไธชๅญฃๅบฆๆๅไธๅคฉ็ๆฅๆ๏ผๆฏๅฆ20171231่กจ็คบๅนดๆฅ๏ผ20170630ๅๅนดๆฅ๏ผ20170930ไธๅญฃๆฅ)+report_type | str | N | ๆฅๅ็ฑปๅ๏ผ่งไธๆน่ฏฆ็ป่ฏดๆ+comp_type | str | N | ๅ ฌๅธ็ฑปๅ๏ผ1ไธ่ฌๅทฅๅไธ 2้ถ่ก 3ไฟ้ฉ 4่ฏๅธ+is_calc | int | N | ๆฏๅฆ่ฎก็ฎๆฅ่กจ++++++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | TS่ก็ฅจไปฃ็ +ann_date | str | Y | ๅ ฌๅๆฅๆ+f_ann_date | str | Y | ๅฎ้ ๅ ฌๅๆฅๆ+end_date | str | Y | ๆฅๅๆ+comp_type | str | Y | ๅ ฌๅธ็ฑปๅ(1ไธ่ฌๅทฅๅไธ2้ถ่ก3ไฟ้ฉ4่ฏๅธ)+report_type | str | Y | ๆฅ่กจ็ฑปๅ+end_type | str | Y | ๆฅๅๆ็ฑปๅ+net_profit | float | Y | ๅๅฉๆถฆ+finan_exp | float | Y | ่ดขๅก่ดน็จ+c_fr_sale_sg | float | Y | ้ๅฎๅๅใๆไพๅณๅกๆถๅฐ็็ฐ้+recp_tax_rends | float | Y | ๆถๅฐ็็จ่ดน่ฟ่ฟ+n_depos_incr_fi | float | Y | ๅฎขๆทๅญๆฌพๅๅไธๅญๆพๆฌพ้กนๅๅขๅ ้ข+n_incr_loans_cb | float | Y | ๅไธญๅคฎ้ถ่กๅๆฌพๅๅขๅ ้ข+n_inc_borr_oth_fi | float | Y | ๅๅ ถไป้่ๆบๆๆๅ ฅ่ต้ๅๅขๅ ้ข+prem_fr_orig_contr | float | Y | ๆถๅฐๅไฟ้ฉๅๅไฟ่ดนๅๅพ็็ฐ้+n_incr_insured_dep | float | Y | ไฟๆทๅจ้ๅๅขๅ ้ข+n_reinsur_prem | float | Y | ๆถๅฐๅไฟไธๅก็ฐ้ๅ้ข+n_incr_disp_tfa | float | Y | ๅค็ฝฎไบคๆๆง้่่ตไบงๅๅขๅ ้ข+ifc_cash_incr | float | Y | ๆถๅๅฉๆฏๅๆ็ปญ่ดนๅๅขๅ ้ข+n_incr_disp_faas | float | Y | ๅค็ฝฎๅฏไพๅบๅฎ้่่ตไบงๅๅขๅ ้ข+n_incr_loans_oth_bank | float | Y | ๆๅ ฅ่ต้ๅๅขๅ ้ข+n_cap_incr_repur | float | Y | ๅ่ดญไธๅก่ต้ๅๅขๅ ้ข+c_fr_oth_operate_a | float | Y | ๆถๅฐๅ ถไปไธ็ป่ฅๆดปๅจๆๅ ณ็็ฐ้+c_inf_fr_operate_a | float | Y | ็ป่ฅๆดปๅจ็ฐ้ๆตๅ ฅๅฐ่ฎก+c_paid_goods_s | float | Y | ่ดญไนฐๅๅใๆฅๅๅณๅกๆฏไป็็ฐ้+c_paid_to_for_empl | float | Y | ๆฏไป็ป่ๅทฅไปฅๅไธบ่ๅทฅๆฏไป็็ฐ้+c_paid_for_taxes | float | Y | ๆฏไป็ๅ้กน็จ่ดน+n_incr_clt_loan_adv | float | Y | ๅฎขๆท่ดทๆฌพๅๅซๆฌพๅๅขๅ ้ข+n_incr_dep_cbob | float | Y | ๅญๆพๅคฎ่กๅๅไธๆฌพ้กนๅๅขๅ ้ข+c_pay_claims_orig_inco | float | Y | ๆฏไปๅไฟ้ฉๅๅ่ตไปๆฌพ้กน็็ฐ้+pay_handling_chrg | float | Y | ๆฏไปๆ็ปญ่ดน็็ฐ้+pay_comm_insur_plcy | float | Y | ๆฏไปไฟๅ็บขๅฉ็็ฐ้+oth_cash_pay_oper_act | float | Y | ๆฏไปๅ ถไปไธ็ป่ฅๆดปๅจๆๅ ณ็็ฐ้+st_cash_out_act | float | Y | ็ป่ฅๆดปๅจ็ฐ้ๆตๅบๅฐ่ฎก+n_cashflow_act | float | Y | ็ป่ฅๆดปๅจไบง็็็ฐ้ๆต้ๅ้ข+oth_recp_ral_inv_act | float | Y | ๆถๅฐๅ ถไปไธๆ่ตๆดปๅจๆๅ ณ็็ฐ้+c_disp_withdrwl_invest | float | Y | ๆถๅๆ่ตๆถๅฐ็็ฐ้+c_recp_return_invest | float | Y | ๅๅพๆ่ตๆถ็ๆถๅฐ็็ฐ้+n_recp_disp_fiolta | float | Y | ๅค็ฝฎๅบๅฎ่ตไบงใๆ ๅฝข่ตไบงๅๅ ถไป้ฟๆ่ตไบงๆถๅ็็ฐ้ๅ้ข+n_recp_disp_sobu | float | Y | ๅค็ฝฎๅญๅ ฌๅธๅๅ ถไป่ฅไธๅไฝๆถๅฐ็็ฐ้ๅ้ข+stot_inflows_inv_act | float | Y | ๆ่ตๆดปๅจ็ฐ้ๆตๅ ฅๅฐ่ฎก+c_pay_acq_const_fiolta | float | Y | ่ดญๅปบๅบๅฎ่ตไบงใๆ ๅฝข่ตไบงๅๅ ถไป้ฟๆ่ตไบงๆฏไป็็ฐ้+c_paid_invest | float | Y | ๆ่ตๆฏไป็็ฐ้+n_disp_subs_oth_biz | float | Y | ๅๅพๅญๅ ฌๅธๅๅ ถไป่ฅไธๅไฝๆฏไป็็ฐ้ๅ้ข+oth_pay_ral_inv_act | float | Y | ๆฏไปๅ ถไปไธๆ่ตๆดปๅจๆๅ ณ็็ฐ้+n_incr_pledge_loan | float | Y | ่ดจๆผ่ดทๆฌพๅๅขๅ ้ข+stot_out_inv_act | float | Y | ๆ่ตๆดปๅจ็ฐ้ๆตๅบๅฐ่ฎก+n_cashflow_inv_act | float | Y | ๆ่ตๆดปๅจไบง็็็ฐ้ๆต้ๅ้ข+c_recp_borrow | float | Y | ๅๅพๅๆฌพๆถๅฐ็็ฐ้+proc_issue_bonds | float | Y | ๅ่กๅบๅธๆถๅฐ็็ฐ้+oth_cash_recp_ral_fnc_act | float | Y | ๆถๅฐๅ ถไปไธ็ญน่ตๆดปๅจๆๅ ณ็็ฐ้+stot_cash_in_fnc_act | float | Y | ็ญน่ตๆดปๅจ็ฐ้ๆตๅ ฅๅฐ่ฎก+free_cashflow | float | Y | ไผไธ่ช็ฑ็ฐ้ๆต้+c_prepay_amt_borr | float | Y | ๅฟ่ฟๅบๅกๆฏไป็็ฐ้+c_pay_dist_dpcp_int_exp | float | Y | ๅ้ ่กๅฉใๅฉๆถฆๆๅฟไปๅฉๆฏๆฏไป็็ฐ้+incl_dvd_profit_paid_sc_ms | float | Y | ๅ ถไธญ:ๅญๅ ฌๅธๆฏไป็ปๅฐๆฐ่กไธ็่กๅฉใๅฉๆถฆ+oth_cashpay_ral_fnc_act | float | Y | ๆฏไปๅ ถไปไธ็ญน่ตๆดปๅจๆๅ ณ็็ฐ้+stot_cashout_fnc_act | float | Y | ็ญน่ตๆดปๅจ็ฐ้ๆตๅบๅฐ่ฎก+n_cash_flows_fnc_act | float | Y | ็ญน่ตๆดปๅจไบง็็็ฐ้ๆต้ๅ้ข+eff_fx_flu_cash | float | Y | ๆฑ็ๅๅจๅฏน็ฐ้็ๅฝฑๅ+n_incr_cash_cash_equ | float | Y | ็ฐ้ๅ็ฐ้็ญไปท็ฉๅๅขๅ ้ข+c_cash_equ_beg_period | float | Y | ๆๅ็ฐ้ๅ็ฐ้็ญไปท็ฉไฝ้ข+c_cash_equ_end_period | float | Y | ๆๆซ็ฐ้ๅ็ฐ้็ญไปท็ฉไฝ้ข+c_recp_cap_contrib | float | Y | ๅธๆถๆ่ตๆถๅฐ็็ฐ้+incl_cash_rec_saims | float | Y | ๅ ถไธญ:ๅญๅ ฌๅธๅธๆถๅฐๆฐ่กไธๆ่ตๆถๅฐ็็ฐ้+uncon_invest_loss | float | Y | ๆช็กฎ่ฎคๆ่ตๆๅคฑ+prov_depr_assets | float | Y | ๅ :่ตไบงๅๅผๅๅค+depr_fa_coga_dpba | float | Y | ๅบๅฎ่ตไบงๆๆงใๆฒนๆฐ่ตไบงๆ่ใ็ไบงๆง็็ฉ่ตไบงๆๆง+amort_intang_assets | float | Y | ๆ ๅฝข่ตไบงๆ้+lt_amort_deferred_exp | float | Y | ้ฟๆๅพ ๆ่ดน็จๆ้+decr_deferred_exp | float | Y | ๅพ ๆ่ดน็จๅๅฐ+incr_acc_exp | float | Y | ้ขๆ่ดน็จๅขๅ+loss_disp_fiolta | float | Y | ๅค็ฝฎๅบๅฎใๆ ๅฝข่ตไบงๅๅ ถไป้ฟๆ่ตไบง็ๆๅคฑ+loss_scr_fa | float | Y | ๅบๅฎ่ตไบงๆฅๅบๆๅคฑ+loss_fv_chg | float | Y | ๅ ฌๅ ไปทๅผๅๅจๆๅคฑ+invest_loss | float | Y | ๆ่ตๆๅคฑ+decr_def_inc_tax_assets | float | Y | ้ๅปถๆๅพ็จ่ตไบงๅๅฐ+incr_def_inc_tax_liab | float | Y | ้ๅปถๆๅพ็จ่ดๅบๅขๅ+decr_inventories | float | Y | ๅญ่ดง็ๅๅฐ+decr_oper_payable | float | Y | ็ป่ฅๆงๅบๆถ้กน็ฎ็ๅๅฐ+incr_oper_payable | float | Y | ็ป่ฅๆงๅบไป้กน็ฎ็ๅขๅ+others | float | Y | ๅ ถไป+im_net_cashflow_oper_act | float | Y | ็ป่ฅๆดปๅจไบง็็็ฐ้ๆต้ๅ้ข(้ดๆฅๆณ)+conv_debt_into_cap | float | Y | ๅบๅก่ฝฌไธบ่ตๆฌ+conv_copbonds_due_within_1y | float | Y | ไธๅนดๅ ๅฐๆ็ๅฏ่ฝฌๆขๅ ฌๅธๅบๅธ+fa_fnc_leases | float | Y | ่่ต็งๅ ฅๅบๅฎ่ตไบง+im_n_incr_cash_equ | float | Y | ็ฐ้ๅ็ฐ้็ญไปท็ฉๅๅขๅ ้ข(้ดๆฅๆณ)+net_dism_capital_add | float | Y | ๆๅบ่ต้ๅๅขๅ ้ข+net_cash_rece_sec | float | Y | ไปฃ็ไนฐๅ่ฏๅธๆถๅฐ็็ฐ้ๅ้ข(ๅ )+credit_impa_loss | float | Y | ไฟก็จๅๅผๆๅคฑ+use_right_asset_dep | float | Y | ไฝฟ็จๆ่ตไบงๆๆง+oth_loss_asset | float | Y | ๅ ถไป่ตไบงๅๅผๆๅคฑ+end_bal_cash | float | Y | ็ฐ้็ๆๆซไฝ้ข+beg_bal_cash | float | Y | ๅ:็ฐ้็ๆๅไฝ้ข+end_bal_cash_equ | float | Y | ๅ :็ฐ้็ญไปท็ฉ็ๆๆซไฝ้ข+beg_bal_cash_equ | float | Y | ๅ:็ฐ้็ญไปท็ฉ็ๆๅไฝ้ข+update_flag | str | Y | ๆดๆฐๆ ๅฟ(1ๆๆฐ๏ผ+++**่พๅบๅๆฐ**+++**ๆฅๅฃไฝฟ็จ่ฏดๆ**+```python++pro = ts.pro_api()++df = pro.cashflow(ts_code='600000.SH', start_date='20180101', end_date='20180730')++```++่ทๅๆไธๅญฃๅบฆๅ จ้จ่ก็ฅจๆฐๆฎ+```+df2 = pro.cashflow_vip(period='20181231',fields='')++```++**ๆฐๆฎๆ ทไพ**++ ts_code ann_date f_ann_date end_date comp_type report_type net_profit finan_exp \+ 0 600000.SH 20180428 20180428 20180331 2 1 NaN None+ 1 600000.SH 20180428 20180428 20171231 2 1 5.500200e+10 None+ 2 600000.SH 20180428 20180428 20171231 2 1 5.500200e+10 None+++**ไธป่ฆๆฅ่กจ็ฑปๅ่ฏดๆ**++ไปฃ็ | ็ฑปๅ | ่ฏดๆ+---- | ----- | ---- |+1 | ๅๅนถๆฅ่กจ | ไธๅธๅ ฌๅธๆๆฐๆฅ่กจ๏ผ้ป่ฎค๏ผ+2 | ๅๅญฃๅๅนถ | ๅไธๅญฃๅบฆ็ๅๅนถๆฅ่กจ+3 | ่ฐๆดๅๅญฃๅๅนถ่กจ | ่ฐๆดๅ็ๅๅญฃๅๅนถๆฅ่กจ๏ผๅฆๆๆ๏ผ+4 | ่ฐๆดๅๅนถๆฅ่กจ | ๆฌๅนดๅบฆๅ ฌๅธไธๅนดๅๆ็่ดขๅกๆฅ่กจๆฐๆฎ๏ผๆฅๅๆไธบไธๅนดๅบฆ+5 | ่ฐๆดๅๅๅนถๆฅ่กจ | ๆฐๆฎๅ็ๅๆด๏ผๅฐๅๆฐๆฎ่ฟ่กไฟ็๏ผๅณ่ฐๆดๅ็ๅๆฐๆฎ+6 | ๆฏๅ ฌๅธๆฅ่กจ | ่ฏฅๅ ฌๅธๆฏๅ ฌๅธ็่ดขๅกๆฅ่กจๆฐๆฎ+7 | ๆฏๅ ฌๅธๅๅญฃ่กจ | ๆฏๅ ฌๅธ็ๅๅญฃๅบฆ่กจ+8 | ๆฏๅ ฌๅธ่ฐๆดๅๅญฃ่กจ | ๆฏๅ ฌๅธ่ฐๆดๅ็ๅๅญฃ่กจ+9 | ๆฏๅ ฌๅธ่ฐๆด่กจ | ่ฏฅๅ ฌๅธๆฏๅ ฌๅธ็ๆฌๅนดๅบฆๅ ฌๅธไธๅนดๅๆ็่ดขๅกๆฅ่กจๆฐๆฎ+10 | ๆฏๅ ฌๅธ่ฐๆดๅๆฅ่กจ | ๆฏๅ ฌๅธ่ฐๆดไนๅ็ๅๅง่ดขๅกๆฅ่กจๆฐๆฎ+11 | ็ฎๅ ฌๅธ่ฐๆดๅๅๅนถๆฅ่กจ | ๆฏๅ ฌๅธ่ฐๆดไนๅๅๅนถๆฅ่กจๅๆฐๆฎ+12 | ๆฏๅ ฌๅธ่ฐๆดๅๆฅ่กจ | ๆฏๅ ฌๅธๆฅ่กจๅ็ๅๆดๅไฟ็็ๅๆฐๆฎ\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\264\242\345\212\241\346\225\260\346\215\256/\350\264\242\345\212\241\345\256\241\350\256\241\346\204\217\350\247\201.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\264\242\345\212\241\346\225\260\346\215\256/\350\264\242\345\212\241\345\256\241\350\256\241\346\204\217\350\247\201.md"new file mode 100644index 000000000..18d201e43--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\264\242\345\212\241\346\225\260\346\215\256/\350\264\242\345\212\241\345\256\241\350\256\241\346\204\217\350\247\201.md"@@ -0,0 +1,53 @@+## ่ดขๅกๅฎก่ฎกๆ่ง+----++ๆฅๅฃ๏ผfina_audit+ๆ่ฟฐ๏ผ่ทๅไธๅธๅ ฌๅธๅฎๆ่ดขๅกๅฎก่ฎกๆ่งๆฐๆฎ+ๆ้๏ผ็จๆท้่ฆ่ณๅฐ500็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +ann_date | str | N | ๅ ฌๅๆฅๆ+start_date | str | N | ๅ ฌๅๅผๅงๆฅๆ+end_date | str | N | ๅ ฌๅ็ปๆๆฅๆ+period | str | N | ๆฅๅๆ(ๆฏไธชๅญฃๅบฆๆๅไธๅคฉ็ๆฅๆ,ๆฏๅฆ20171231่กจ็คบๅนดๆฅ)++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๆ่ฟฐ+--- | ---- | ----+ts_code | str | TS่ก็ฅจไปฃ็ +ann_date | str | ๅ ฌๅๆฅๆ+end_date | str | ๆฅๅๆ+audit_result | str | ๅฎก่ฎก็ปๆ+audit_fees | float | ๅฎก่ฎกๆป่ดน็จ๏ผๅ ๏ผ+audit_agency | str | ไผ่ฎกไบๅกๆ+audit_sign | str | ็ญพๅญไผ่ฎกๅธ+++**ๆฅๅฃไฝฟ็จ**++```python++pro = ts.pro_api()++df = pro.fina_audit(ts_code='600000.SH', start_date='20100101', end_date='20180808')++```++**ๆฐๆฎ็คบไพ**++ ts_code ann_date end_date audit_result audit_agency audit_sign+ 0 600000.SH 20180428 20171231 ๆ ๅๆ ไฟ็ๆ่ง ๆฎๅๆฐธ้ไธญๅคฉไผ่ฎกๅธไบๅกๆ ๅจ็ซ ,ๅผ ๆญฆ+ 1 600000.SH 20170401 20161231 ๆ ๅๆ ไฟ็ๆ่ง ๆฎๅๆฐธ้ไธญๅคฉไผ่ฎกๅธไบๅกๆ ๅจ็ซ ,ๅผ ๆญฆ+ 2 600000.SH 20160407 20151231 ๆ ๅๆ ไฟ็ๆ่ง ๆฎๅๆฐธ้ไธญๅคฉไผ่ฎกๅธไบๅกๆ ่กไบฎ,ๅผ ๆญฆ+ 3 600000.SH 20150319 20141231 ๆ ๅๆ ไฟ็ๆ่ง ๆฎๅๆฐธ้ไธญๅคฉไผ่ฎกๅธไบๅกๆ ่กไบฎ,ๅผ ๆญฆ+ 4 600000.SH 20140320 20131231 ๆ ๅๆ ไฟ็ๆ่ง ๆฎๅๆฐธ้ไธญๅคฉไผ่ฎกๅธไบๅกๆ ่กไบฎ,ๅจ็ซ+ 5 600000.SH 20130314 20121231 ๆ ๅๆ ไฟ็ๆ่ง ๆฎๅๆฐธ้ไธญๅคฉไผ่ฎกๅธไบๅกๆ ่กไบฎ,ๅจ็ซ+ 6 600000.SH 20120316 20111231 ๆ ๅๆ ไฟ็ๆ่ง ๆฎๅๆฐธ้ไธญๅคฉไผ่ฎกๅธไบๅกๆ ่กไบฎ,ๅจ็ซ+ 7 600000.SH 20110330 20101231 ๆ ๅๆ ไฟ็ๆ่ง ๅฎๆฐธๅๆไผ่ฎกๅธไบๅกๆ ไธฅ็็,ๅจๆ้ช+ 8 600000.SH 20100830 20100630 ๆ ๅๆ ไฟ็ๆ่ง ๅฎๆฐธๅๆไผ่ฎกๅธไบๅกๆ ไธฅ็็,ๅจๆ้ช+ 9 600000.SH 20100407 20091231 ๆ ๅๆ ไฟ็ๆ่ง ๅฎๆฐธๅๆไผ่ฎกๅธไบๅกๆ ไธฅ็็,ๅจๆ้ช\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\264\242\345\212\241\346\225\260\346\215\256/\350\264\242\345\212\241\346\214\207\346\240\207\346\225\260\346\215\256.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\264\242\345\212\241\346\225\260\346\215\256/\350\264\242\345\212\241\346\214\207\346\240\207\346\225\260\346\215\256.md"new file mode 100644index 000000000..476ad652f--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\264\242\345\212\241\346\225\260\346\215\256/\350\264\242\345\212\241\346\214\207\346\240\207\346\225\260\346\215\256.md"@@ -0,0 +1,224 @@+## ่ดขๅกๆๆ ๆฐๆฎ+----++ๆฅๅฃ๏ผfina_indicator๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆ่ฟฐ๏ผ่ทๅไธๅธๅ ฌๅธ่ดขๅกๆๆ ๆฐๆฎ๏ผไธบ้ฟๅ ๆๅกๅจๅๅ๏ผ็ฐ้ถๆฎตๆฏๆฌก่ฏทๆฑๆๅค่ฟๅ100ๆก่ฎฐๅฝ๏ผๅฏ้่ฟ่ฎพ็ฝฎๆฅๆๅคๆฌก่ฏทๆฑ่ทๅๆดๅคๆฐๆฎใ+ๆ้๏ผ็จๆท้่ฆ่ณๅฐ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)+<font color="red">+ๆ็คบ๏ผๅฝๅๆฅๅฃๅช่ฝๆๅๅช่ก็ฅจ่ทๅๅ ถๅๅฒๆฐๆฎ๏ผๅฆๆ้่ฆ่ทๅๆไธๅญฃๅบฆๅ จ้จไธๅธๅ ฌๅธๆฐๆฎ๏ผ่ฏทไฝฟ็จfina_indicator_vipๆฅๅฃ๏ผๅๆฐไธ่ด๏ผ๏ผ้็งฏๆ5000็งฏๅใ+</font>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | TS่ก็ฅจไปฃ็ ,e.g. 600001.SH/000001.SZ+ann_date | str | N | ๅ ฌๅๆฅๆ+start_date | str | N | ๆฅๅๆๅผๅงๆฅๆ+end_date | str | N | ๆฅๅๆ็ปๆๆฅๆ+period | str | N | ๆฅๅๆ(ๆฏไธชๅญฃๅบฆๆๅไธๅคฉ็ๆฅๆ,ๆฏๅฆ20171231่กจ็คบๅนดๆฅ)+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | TSไปฃ็ +ann_date | str | Y | ๅ ฌๅๆฅๆ+end_date | str | Y | ๆฅๅๆ+eps | float | Y | ๅบๆฌๆฏ่กๆถ็+dt_eps | float | Y | ็จ้ๆฏ่กๆถ็+total_revenue_ps | float | Y | ๆฏ่ก่ฅไธๆปๆถๅ ฅ+revenue_ps | float | Y | ๆฏ่ก่ฅไธๆถๅ ฅ+capital_rese_ps | float | Y | ๆฏ่ก่ตๆฌๅ ฌ็งฏ+surplus_rese_ps | float | Y | ๆฏ่ก็ไฝๅ ฌ็งฏ+undist_profit_ps | float | Y | ๆฏ่กๆชๅ้ ๅฉๆถฆ+extra_item | float | Y | ้็ปๅธธๆงๆ็+profit_dedt | float | Y | ๆฃ้ค้็ปๅธธๆงๆ็ๅ็ๅๅฉๆถฆ๏ผๆฃ้ๅๅฉๆถฆ๏ผ+gross_margin | float | Y | ๆฏๅฉ+current_ratio | float | Y | ๆตๅจๆฏ็+quick_ratio | float | Y | ้ๅจๆฏ็+cash_ratio | float | Y | ไฟๅฎ้ๅจๆฏ็+invturn_days | float | N | ๅญ่ดงๅจ่ฝฌๅคฉๆฐ+arturn_days | float | N | ๅบๆถ่ดฆๆฌพๅจ่ฝฌๅคฉๆฐ+inv_turn | float | N | ๅญ่ดงๅจ่ฝฌ็+ar_turn | float | Y | ๅบๆถ่ดฆๆฌพๅจ่ฝฌ็+ca_turn | float | Y | ๆตๅจ่ตไบงๅจ่ฝฌ็+fa_turn | float | Y | ๅบๅฎ่ตไบงๅจ่ฝฌ็+assets_turn | float | Y | ๆป่ตไบงๅจ่ฝฌ็+op_income | float | Y | ็ป่ฅๆดปๅจๅๆถ็+valuechange_income | float | N | ไปทๅผๅๅจๅๆถ็+interst_income | float | N | ๅฉๆฏ่ดน็จ+daa | float | N | ๆๆงไธๆ้+ebit | float | Y | ๆฏ็จๅๅฉๆถฆ+ebitda | float | Y | ๆฏ็จๆๆงๆ้ๅๅฉๆถฆ+fcff | float | Y | ไผไธ่ช็ฑ็ฐ้ๆต้+fcfe | float | Y | ่กๆ่ช็ฑ็ฐ้ๆต้+current_exint | float | Y | ๆ ๆฏๆตๅจ่ดๅบ+noncurrent_exint | float | Y | ๆ ๆฏ้ๆตๅจ่ดๅบ+interestdebt | float | Y | ๅธฆๆฏๅบๅก+netdebt | float | Y | ๅๅบๅก+tangible_asset | float | Y | ๆๅฝข่ตไบง+working_capital | float | Y | ่ฅ่ฟ่ต้+networking_capital | float | Y | ่ฅ่ฟๆตๅจ่ตๆฌ+invest_capital | float | Y | ๅ จ้จๆๅ ฅ่ตๆฌ+retained_earnings | float | Y | ็ๅญๆถ็+diluted2_eps | float | Y | ๆๆซๆ่ๆฏ่กๆถ็+bps | float | Y | ๆฏ่กๅ่ตไบง+ocfps | float | Y | ๆฏ่ก็ป่ฅๆดปๅจไบง็็็ฐ้ๆต้ๅ้ข+retainedps | float | Y | ๆฏ่ก็ๅญๆถ็+cfps | float | Y | ๆฏ่ก็ฐ้ๆต้ๅ้ข+ebit_ps | float | Y | ๆฏ่กๆฏ็จๅๅฉๆถฆ+fcff_ps | float | Y | ๆฏ่กไผไธ่ช็ฑ็ฐ้ๆต้+fcfe_ps | float | Y | ๆฏ่ก่กไธ่ช็ฑ็ฐ้ๆต้+netprofit_margin | float | Y | ้ๅฎๅๅฉ็+grossprofit_margin | float | Y | ้ๅฎๆฏๅฉ็+cogs_of_sales | float | Y | ้ๅฎๆๆฌ็+expense_of_sales | float | Y | ้ๅฎๆ้ด่ดน็จ็+profit_to_gr | float | Y | ๅๅฉๆถฆ/่ฅไธๆปๆถๅ ฅ+saleexp_to_gr | float | Y | ้ๅฎ่ดน็จ/่ฅไธๆปๆถๅ ฅ+adminexp_of_gr | float | Y | ็ฎก็่ดน็จ/่ฅไธๆปๆถๅ ฅ+finaexp_of_gr | float | Y | ่ดขๅก่ดน็จ/่ฅไธๆปๆถๅ ฅ+impai_ttm | float | Y | ่ตไบงๅๅผๆๅคฑ/่ฅไธๆปๆถๅ ฅ+gc_of_gr | float | Y | ่ฅไธๆปๆๆฌ/่ฅไธๆปๆถๅ ฅ+op_of_gr | float | Y | ่ฅไธๅฉๆถฆ/่ฅไธๆปๆถๅ ฅ+ebit_of_gr | float | Y | ๆฏ็จๅๅฉๆถฆ/่ฅไธๆปๆถๅ ฅ+roe | float | Y | ๅ่ตไบงๆถ็็+roe_waa | float | Y | ๅ ๆๅนณๅๅ่ตไบงๆถ็็+roe_dt | float | Y | ๅ่ตไบงๆถ็็(ๆฃ้ค้็ปๅธธๆ็)+roa | float | Y | ๆป่ตไบงๆฅ้ ฌ็+npta | float | Y | ๆป่ตไบงๅๅฉๆถฆ+roic | float | Y | ๆๅ ฅ่ตๆฌๅๆฅ็+roe_yearly | float | Y | ๅนดๅๅ่ตไบงๆถ็็+roa2_yearly | float | Y | ๅนดๅๆป่ตไบงๆฅ้ ฌ็+roe_avg | float | N | ๅนณๅๅ่ตไบงๆถ็็(ๅขๅๆกไปถ)+opincome_of_ebt | float | N | ็ป่ฅๆดปๅจๅๆถ็/ๅฉๆถฆๆป้ข+investincome_of_ebt | float | N | ไปทๅผๅๅจๅๆถ็/ๅฉๆถฆๆป้ข+n_op_profit_of_ebt | float | N | ่ฅไธๅคๆถๆฏๅ้ข/ๅฉๆถฆๆป้ข+tax_to_ebt | float | N | ๆๅพ็จ/ๅฉๆถฆๆป้ข+dtprofit_to_profit | float | N | ๆฃ้ค้็ปๅธธๆ็ๅ็ๅๅฉๆถฆ/ๅๅฉๆถฆ+salescash_to_or | float | N | ้ๅฎๅๅๆไพๅณๅกๆถๅฐ็็ฐ้/่ฅไธๆถๅ ฅ+ocf_to_or | float | N | ็ป่ฅๆดปๅจไบง็็็ฐ้ๆต้ๅ้ข/่ฅไธๆถๅ ฅ+ocf_to_opincome | float | N | ็ป่ฅๆดปๅจไบง็็็ฐ้ๆต้ๅ้ข/็ป่ฅๆดปๅจๅๆถ็+capitalized_to_da | float | N | ่ตๆฌๆฏๅบ/ๆๆงๅๆ้+debt_to_assets | float | Y | ่ตไบง่ดๅบ็+assets_to_eqt | float | Y | ๆ็ไนๆฐ+dp_assets_to_eqt | float | Y | ๆ็ไนๆฐ(ๆ้ฆๅๆ)+ca_to_assets | float | Y | ๆตๅจ่ตไบง/ๆป่ตไบง+nca_to_assets | float | Y | ้ๆตๅจ่ตไบง/ๆป่ตไบง+tbassets_to_totalassets | float | Y | ๆๅฝข่ตไบง/ๆป่ตไบง+int_to_talcap | float | Y | ๅธฆๆฏๅบๅก/ๅ จ้จๆๅ ฅ่ตๆฌ+eqt_to_talcapital | float | Y | ๅฝๅฑไบๆฏๅ ฌๅธ็่กไธๆ็/ๅ จ้จๆๅ ฅ่ตๆฌ+currentdebt_to_debt | float | Y | ๆตๅจ่ดๅบ/่ดๅบๅ่ฎก+longdeb_to_debt | float | Y | ้ๆตๅจ่ดๅบ/่ดๅบๅ่ฎก+ocf_to_shortdebt | float | Y | ็ป่ฅๆดปๅจไบง็็็ฐ้ๆต้ๅ้ข/ๆตๅจ่ดๅบ+debt_to_eqt | float | Y | ไบงๆๆฏ็+eqt_to_debt | float | Y | ๅฝๅฑไบๆฏๅ ฌๅธ็่กไธๆ็/่ดๅบๅ่ฎก+eqt_to_interestdebt | float | Y | ๅฝๅฑไบๆฏๅ ฌๅธ็่กไธๆ็/ๅธฆๆฏๅบๅก+tangibleasset_to_debt | float | Y | ๆๅฝข่ตไบง/่ดๅบๅ่ฎก+tangasset_to_intdebt | float | Y | ๆๅฝข่ตไบง/ๅธฆๆฏๅบๅก+tangibleasset_to_netdebt | float | Y | ๆๅฝข่ตไบง/ๅๅบๅก+ocf_to_debt | float | Y | ็ป่ฅๆดปๅจไบง็็็ฐ้ๆต้ๅ้ข/่ดๅบๅ่ฎก+ocf_to_interestdebt | float | N | ็ป่ฅๆดปๅจไบง็็็ฐ้ๆต้ๅ้ข/ๅธฆๆฏๅบๅก+ocf_to_netdebt | float | N | ็ป่ฅๆดปๅจไบง็็็ฐ้ๆต้ๅ้ข/ๅๅบๅก+ebit_to_interest | float | N | ๅทฒ่ทๅฉๆฏๅๆฐ(EBIT/ๅฉๆฏ่ดน็จ)+longdebt_to_workingcapital | float | N | ้ฟๆๅบๅกไธ่ฅ่ฟ่ต้ๆฏ็+ebitda_to_debt | float | N | ๆฏ็จๆๆงๆ้ๅๅฉๆถฆ/่ดๅบๅ่ฎก+turn_days | float | Y | ่ฅไธๅจๆ+roa_yearly | float | Y | ๅนดๅๆป่ตไบงๅๅฉ็+roa_dp | float | Y | ๆป่ตไบงๅๅฉ็(ๆ้ฆๅๆ)+fixed_assets | float | Y | ๅบๅฎ่ตไบงๅ่ฎก+profit_prefin_exp | float | N | ๆฃ้ค่ดขๅก่ดน็จๅ่ฅไธๅฉๆถฆ+non_op_profit | float | N | ้่ฅไธๅฉๆถฆ+op_to_ebt | float | N | ่ฅไธๅฉๆถฆ๏ผๅฉๆถฆๆป้ข+nop_to_ebt | float | N | ้่ฅไธๅฉๆถฆ๏ผๅฉๆถฆๆป้ข+ocf_to_profit | float | N | ็ป่ฅๆดปๅจไบง็็็ฐ้ๆต้ๅ้ข๏ผ่ฅไธๅฉๆถฆ+cash_to_liqdebt | float | N | ่ดงๅธ่ต้๏ผๆตๅจ่ดๅบ+cash_to_liqdebt_withinterest | float | N | ่ดงๅธ่ต้๏ผๅธฆๆฏๆตๅจ่ดๅบ+op_to_liqdebt | float | N | ่ฅไธๅฉๆถฆ๏ผๆตๅจ่ดๅบ+op_to_debt | float | N | ่ฅไธๅฉๆถฆ๏ผ่ดๅบๅ่ฎก+roic_yearly | float | N | ๅนดๅๆๅ ฅ่ตๆฌๅๆฅ็+total_fa_trun | float | N | ๅบๅฎ่ตไบงๅ่ฎกๅจ่ฝฌ็+profit_to_op | float | Y | ๅฉๆถฆๆป้ข๏ผ่ฅไธๆถๅ ฅ+q_opincome | float | N | ็ป่ฅๆดปๅจๅๅญฃๅบฆๅๆถ็+q_investincome | float | N | ไปทๅผๅๅจๅๅญฃๅบฆๅๆถ็+q_dtprofit | float | N | ๆฃ้ค้็ปๅธธๆ็ๅ็ๅๅญฃๅบฆๅๅฉๆถฆ+q_eps | float | N | ๆฏ่กๆถ็(ๅๅญฃๅบฆ)+q_netprofit_margin | float | N | ้ๅฎๅๅฉ็(ๅๅญฃๅบฆ)+q_gsprofit_margin | float | N | ้ๅฎๆฏๅฉ็(ๅๅญฃๅบฆ)+q_exp_to_sales | float | N | ้ๅฎๆ้ด่ดน็จ็(ๅๅญฃๅบฆ)+q_profit_to_gr | float | N | ๅๅฉๆถฆ๏ผ่ฅไธๆปๆถๅ ฅ(ๅๅญฃๅบฆ)+q_saleexp_to_gr | float | Y | ้ๅฎ่ดน็จ๏ผ่ฅไธๆปๆถๅ ฅ (ๅๅญฃๅบฆ)+q_adminexp_to_gr | float | N | ็ฎก็่ดน็จ๏ผ่ฅไธๆปๆถๅ ฅ (ๅๅญฃๅบฆ)+q_finaexp_to_gr | float | N | ่ดขๅก่ดน็จ๏ผ่ฅไธๆปๆถๅ ฅ (ๅๅญฃๅบฆ)+q_impair_to_gr_ttm | float | N | ่ตไบงๅๅผๆๅคฑ๏ผ่ฅไธๆปๆถๅ ฅ(ๅๅญฃๅบฆ)+q_gc_to_gr | float | Y | ่ฅไธๆปๆๆฌ๏ผ่ฅไธๆปๆถๅ ฅ (ๅๅญฃๅบฆ)+q_op_to_gr | float | N | ่ฅไธๅฉๆถฆ๏ผ่ฅไธๆปๆถๅ ฅ(ๅๅญฃๅบฆ)+q_roe | float | Y | ๅ่ตไบงๆถ็็(ๅๅญฃๅบฆ)+q_dt_roe | float | Y | ๅ่ตไบงๅๅญฃๅบฆๆถ็็(ๆฃ้ค้็ปๅธธๆ็)+q_npta | float | Y | ๆป่ตไบงๅๅฉๆถฆ(ๅๅญฃๅบฆ)+q_opincome_to_ebt | float | N | ็ป่ฅๆดปๅจๅๆถ็๏ผๅฉๆถฆๆป้ข(ๅๅญฃๅบฆ)+q_investincome_to_ebt | float | N | ไปทๅผๅๅจๅๆถ็๏ผๅฉๆถฆๆป้ข(ๅๅญฃๅบฆ)+q_dtprofit_to_profit | float | N | ๆฃ้ค้็ปๅธธๆ็ๅ็ๅๅฉๆถฆ๏ผๅๅฉๆถฆ(ๅๅญฃๅบฆ)+q_salescash_to_or | float | N | ้ๅฎๅๅๆไพๅณๅกๆถๅฐ็็ฐ้๏ผ่ฅไธๆถๅ ฅ(ๅๅญฃๅบฆ)+q_ocf_to_sales | float | Y | ็ป่ฅๆดปๅจไบง็็็ฐ้ๆต้ๅ้ข๏ผ่ฅไธๆถๅ ฅ(ๅๅญฃๅบฆ)+q_ocf_to_or | float | N | ็ป่ฅๆดปๅจไบง็็็ฐ้ๆต้ๅ้ข๏ผ็ป่ฅๆดปๅจๅๆถ็(ๅๅญฃๅบฆ)+basic_eps_yoy | float | Y | ๅบๆฌๆฏ่กๆถ็ๅๆฏๅข้ฟ็(%)+dt_eps_yoy | float | Y | ็จ้ๆฏ่กๆถ็ๅๆฏๅข้ฟ็(%)+cfps_yoy | float | Y | ๆฏ่ก็ป่ฅๆดปๅจไบง็็็ฐ้ๆต้ๅ้ขๅๆฏๅข้ฟ็(%)+op_yoy | float | Y | ่ฅไธๅฉๆถฆๅๆฏๅข้ฟ็(%)+ebt_yoy | float | Y | ๅฉๆถฆๆป้ขๅๆฏๅข้ฟ็(%)+netprofit_yoy | float | Y | ๅฝๅฑๆฏๅ ฌๅธ่กไธ็ๅๅฉๆถฆๅๆฏๅข้ฟ็(%)+dt_netprofit_yoy | float | Y | ๅฝๅฑๆฏๅ ฌๅธ่กไธ็ๅๅฉๆถฆ-ๆฃ้ค้็ปๅธธๆ็ๅๆฏๅข้ฟ็(%)+ocf_yoy | float | Y | ็ป่ฅๆดปๅจไบง็็็ฐ้ๆต้ๅ้ขๅๆฏๅข้ฟ็(%)+roe_yoy | float | Y | ๅ่ตไบงๆถ็็(ๆ่)ๅๆฏๅข้ฟ็(%)+bps_yoy | float | Y | ๆฏ่กๅ่ตไบง็ธๅฏนๅนดๅๅข้ฟ็(%)+assets_yoy | float | Y | ่ตไบงๆป่ฎก็ธๅฏนๅนดๅๅข้ฟ็(%)+eqt_yoy | float | Y | ๅฝๅฑๆฏๅ ฌๅธ็่กไธๆ็็ธๅฏนๅนดๅๅข้ฟ็(%)+tr_yoy | float | Y | ่ฅไธๆปๆถๅ ฅๅๆฏๅข้ฟ็(%)+or_yoy | float | Y | ่ฅไธๆถๅ ฅๅๆฏๅข้ฟ็(%)+q_gr_yoy | float | N | ่ฅไธๆปๆถๅ ฅๅๆฏๅข้ฟ็(%)(ๅๅญฃๅบฆ)+q_gr_qoq | float | N | ่ฅไธๆปๆถๅ ฅ็ฏๆฏๅข้ฟ็(%)(ๅๅญฃๅบฆ)+q_sales_yoy | float | Y | ่ฅไธๆถๅ ฅๅๆฏๅข้ฟ็(%)(ๅๅญฃๅบฆ)+q_sales_qoq | float | N | ่ฅไธๆถๅ ฅ็ฏๆฏๅข้ฟ็(%)(ๅๅญฃๅบฆ)+q_op_yoy | float | N | ่ฅไธๅฉๆถฆๅๆฏๅข้ฟ็(%)(ๅๅญฃๅบฆ)+q_op_qoq | float | Y | ่ฅไธๅฉๆถฆ็ฏๆฏๅข้ฟ็(%)(ๅๅญฃๅบฆ)+q_profit_yoy | float | N | ๅๅฉๆถฆๅๆฏๅข้ฟ็(%)(ๅๅญฃๅบฆ)+q_profit_qoq | float | N | ๅๅฉๆถฆ็ฏๆฏๅข้ฟ็(%)(ๅๅญฃๅบฆ)+q_netprofit_yoy | float | N | ๅฝๅฑๆฏๅ ฌๅธ่กไธ็ๅๅฉๆถฆๅๆฏๅข้ฟ็(%)(ๅๅญฃๅบฆ)+q_netprofit_qoq | float | N | ๅฝๅฑๆฏๅ ฌๅธ่กไธ็ๅๅฉๆถฆ็ฏๆฏๅข้ฟ็(%)(ๅๅญฃๅบฆ)+equity_yoy | float | Y | ๅ่ตไบงๅๆฏๅข้ฟ็+rd_exp | float | N | ็ ๅ่ดน็จ+update_flag | str | N | ๆดๆฐๆ ่ฏ++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++df = pro.fina_indicator(ts_code='600000.SH')++```++ๆ่++```python++df = pro.query('fina_indicator', ts_code='600000.SH', start_date='20170101', end_date='20180801')++```+++**ๆฐๆฎๆ ทไพ**++ ts_code ann_date end_date eps dt_eps total_revenue_ps revenue_ps \+ 0 600000.SH 20180830 20180630 0.95 0.95 2.8024 2.8024+ 1 600000.SH 20180428 20180331 0.46 0.46 1.3501 1.3501+ 2 600000.SH 20180428 20171231 1.84 1.84 5.7447 5.7447+ 3 600000.SH 20180428 20171231 1.84 1.84 5.7447 5.7447+ 4 600000.SH 20171028 20170930 1.45 1.45 4.2507 4.2507+ 5 600000.SH 20171028 20170930 1.45 1.45 4.2507 4.2507+ 6 600000.SH 20170830 20170630 0.97 0.97 2.9659 2.9659+ 7 600000.SH 20170427 20170331 0.63 0.63 1.9595 1.9595+ 8 600000.SH 20170427 20170331 0.63 0.63 1.9595 1.9595\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\264\242\345\212\241\346\225\260\346\215\256/\350\264\242\346\212\245\346\212\253\351\234\262\346\227\245\346\234\237\350\241\250.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\264\242\345\212\241\346\225\260\346\215\256/\350\264\242\346\212\245\346\212\253\351\234\262\346\227\245\346\234\237\350\241\250.md"new file mode 100644index 000000000..40300910b--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\264\242\345\212\241\346\225\260\346\215\256/\350\264\242\346\212\245\346\212\253\351\234\262\346\227\245\346\234\237\350\241\250.md"@@ -0,0 +1,61 @@+## ่ดขๆฅๆซ้ฒ่ฎกๅ+----++ๆฅๅฃ๏ผdisclosure_date+ๆ่ฟฐ๏ผ่ทๅ่ดขๆฅๆซ้ฒ่ฎกๅๆฅๆ+้้๏ผๅๆฌกๆๅคง3000๏ผๆป้ไธ้ๅถ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ500็งฏๅๆๅฏไปฅ่ฐๅ๏ผ็งฏๅ่ถๅคๆ้่ถๅคง๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)+++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | TS่ก็ฅจไปฃ็ +end_date | str | N | ่ดขๆฅๅจๆ๏ผๆฏไธชๅญฃๅบฆๆๅไธๅคฉ็ๆฅๆ๏ผๆฏๅฆ20181231่กจ็คบ2018ๅนดๅนดๆฅ๏ผ20180630่กจ็คบไธญๆฅ)+pre_date | str | N | ่ฎกๅๆซ้ฒๆฅๆ+ann_date | str | N |ๆๆฐๆซ้ฒๅ ฌๅๆฅ+actual_date | str | N | ๅฎ้ ๆซ้ฒๆฅๆ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | TSไปฃ็ +ann_date | str | Y | ๆๆฐๆซ้ฒๅ ฌๅๆฅ+end_date | str | Y | ๆฅๅๆ+pre_date | str | Y | ้ข่ฎกๆซ้ฒๆฅๆ+actual_date | str | Y | ๅฎ้ ๆซ้ฒๆฅๆ+modify_date | str | N | ๆซ้ฒๆฅๆไฟฎๆญฃ่ฎฐๅฝ+++**ๆฅๅฃไฝฟ็จ**++```python++pro = ts.pro_api()++df = pro.disclosure_date(end_date='20181231')++```++**ๆฐๆฎ็คบไพ**++ ts_code ann_date end_date pre_date actual_date modify_date+ 0 300619.SZ 20181228 20181231 20190122 20190122 None+ 1 300125.SZ 20181228 20181231 20190129 20190129 None+ 2 601619.SH 20181227 20181231 20190129 20190129 None+ 3 000055.SZ 20181228 20181231 20190130 20190130 None+ 4 002910.SZ 20181228 20181231 20190131 None None+ 5 002188.SZ 20181228 20181231 20190131 None None+ 6 600738.SH 20190124 20181231 20190131 None None+ 7 002107.SZ 20181228 20181231 20190201 None None+ 8 300748.SZ 20181228 20181231 20190201 None None+ 9 002675.SZ 20181228 20181231 20190201 None None+ 10 002167.SZ 20181228 20181231 20190201 None None+ 11 002211.SZ 20190125 20181231 20190201 None None+ 12 002240.SZ 20181228 20181231 20190201 None None+ 13 002245.SZ 20181228 20181231 20190201 None None+ 14 002552.SZ 20181228 20181231 20190201 None None+ 15 002825.SZ 20181228 20181231 20190201 None None\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\264\242\345\212\241\346\225\260\346\215\256/\350\265\204\344\272\247\350\264\237\345\200\272\350\241\250.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\264\242\345\212\241\346\225\260\346\215\256/\350\265\204\344\272\247\350\264\237\345\200\272\350\241\250.md"new file mode 100644index 000000000..da3269466--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\264\242\345\212\241\346\225\260\346\215\256/\350\265\204\344\272\247\350\264\237\345\200\272\350\241\250.md"@@ -0,0 +1,230 @@+## ่ตไบง่ดๅบ่กจ+----++ๆฅๅฃ๏ผbalancesheet๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆ่ฟฐ๏ผ่ทๅไธๅธๅ ฌๅธ่ตไบง่ดๅบ่กจ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)+<font color="red">+ๆ็คบ๏ผๅฝๅๆฅๅฃๅช่ฝๆๅๅช่ก็ฅจ่ทๅๅ ถๅๅฒๆฐๆฎ๏ผๅฆๆ้่ฆ่ทๅๆไธๅญฃๅบฆๅ จ้จไธๅธๅ ฌๅธๆฐๆฎ๏ผ่ฏทไฝฟ็จbalancesheet_vipๆฅๅฃ๏ผๅๆฐไธ่ด๏ผ๏ผ้็งฏๆ5000็งฏๅใ+</font>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | Y | ่ก็ฅจไปฃ็ +ann_date | str | N | ๅ ฌๅๆฅๆ(YYYYMMDDๆ ผๅผ๏ผไธๅ)+start_date | str | N | ๅ ฌๅๆฅๅผๅงๆฅๆ+end_date | str | N | ๅ ฌๅๆฅ็ปๆๆฅๆ+period | str | N | ๆฅๅๆ(ๆฏไธชๅญฃๅบฆๆๅไธๅคฉ็ๆฅๆ๏ผๆฏๅฆ20171231่กจ็คบๅนดๆฅ๏ผ20170630ๅๅนดๆฅ๏ผ20170930ไธๅญฃๆฅ)+report_type | str | N | ๆฅๅ็ฑปๅ๏ผ่งไธๆน่ฏฆ็ป่ฏดๆ+comp_type | str | N | ๅ ฌๅธ็ฑปๅ๏ผ1ไธ่ฌๅทฅๅไธ 2้ถ่ก 3ไฟ้ฉ 4่ฏๅธ++++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | TS่ก็ฅจไปฃ็ +ann_date | str | Y | ๅ ฌๅๆฅๆ+f_ann_date | str | Y | ๅฎ้ ๅ ฌๅๆฅๆ+end_date | str | Y | ๆฅๅๆ+report_type | str | Y | ๆฅ่กจ็ฑปๅ+comp_type | str | Y | ๅ ฌๅธ็ฑปๅ(1ไธ่ฌๅทฅๅไธ2้ถ่ก3ไฟ้ฉ4่ฏๅธ)+end_type | str | Y | ๆฅๅๆ็ฑปๅ+total_share | float | Y | ๆๆซๆป่กๆฌ+cap_rese | float | Y | ่ตๆฌๅ ฌ็งฏ้+undistr_porfit | float | Y | ๆชๅ้ ๅฉๆถฆ+surplus_rese | float | Y | ็ไฝๅ ฌ็งฏ้+special_rese | float | Y | ไธ้กนๅจๅค+money_cap | float | Y | ่ดงๅธ่ต้+trad_asset | float | Y | ไบคๆๆง้่่ตไบง+notes_receiv | float | Y | ๅบๆถ็ฅจๆฎ+accounts_receiv | float | Y | ๅบๆถ่ดฆๆฌพ+oth_receiv | float | Y | ๅ ถไปๅบๆถๆฌพ+prepayment | float | Y | ้ขไปๆฌพ้กน+div_receiv | float | Y | ๅบๆถ่กๅฉ+int_receiv | float | Y | ๅบๆถๅฉๆฏ+inventories | float | Y | ๅญ่ดง+amor_exp | float | Y | ๅพ ๆ่ดน็จ+nca_within_1y | float | Y | ไธๅนดๅ ๅฐๆ็้ๆตๅจ่ตไบง+sett_rsrv | float | Y | ็ป็ฎๅคไป้+loanto_oth_bank_fi | float | Y | ๆๅบ่ต้+premium_receiv | float | Y | ๅบๆถไฟ่ดน+reinsur_receiv | float | Y | ๅบๆถๅไฟ่ดฆๆฌพ+reinsur_res_receiv | float | Y | ๅบๆถๅไฟๅๅๅๅค้+pur_resale_fa | float | Y | ไนฐๅ ฅ่ฟๅฎ้่่ตไบง+oth_cur_assets | float | Y | ๅ ถไปๆตๅจ่ตไบง+total_cur_assets | float | Y | ๆตๅจ่ตไบงๅ่ฎก+fa_avail_for_sale | float | Y | ๅฏไพๅบๅฎ้่่ตไบง+htm_invest | float | Y | ๆๆ่ณๅฐๆๆ่ต+lt_eqt_invest | float | Y | ้ฟๆ่กๆๆ่ต+invest_real_estate | float | Y | ๆ่ตๆงๆฟๅฐไบง+time_deposits | float | Y | ๅฎๆๅญๆฌพ+oth_assets | float | Y | ๅ ถไป่ตไบง+lt_rec | float | Y | ้ฟๆๅบๆถๆฌพ+fix_assets | float | Y | ๅบๅฎ่ตไบง+cip | float | Y | ๅจๅปบๅทฅ็จ+const_materials | float | Y | ๅทฅ็จ็ฉ่ต+fixed_assets_disp | float | Y | ๅบๅฎ่ตไบงๆธ ็+produc_bio_assets | float | Y | ็ไบงๆง็็ฉ่ตไบง+oil_and_gas_assets | float | Y | ๆฒนๆฐ่ตไบง+intan_assets | float | Y | ๆ ๅฝข่ตไบง+r_and_d | float | Y | ็ ๅๆฏๅบ+goodwill | float | Y | ๅ่ช+lt_amor_exp | float | Y | ้ฟๆๅพ ๆ่ดน็จ+defer_tax_assets | float | Y | ้ๅปถๆๅพ็จ่ตไบง+decr_in_disbur | float | Y | ๅๆพ่ดทๆฌพๅๅซๆฌพ+oth_nca | float | Y | ๅ ถไป้ๆตๅจ่ตไบง+total_nca | float | Y | ้ๆตๅจ่ตไบงๅ่ฎก+cash_reser_cb | float | Y | ็ฐ้ๅๅญๆพไธญๅคฎ้ถ่กๆฌพ้กน+depos_in_oth_bfi | float | Y | ๅญๆพๅไธๅๅ ถๅฎ้่ๆบๆๆฌพ้กน+prec_metals | float | Y | ่ดต้ๅฑ+deriv_assets | float | Y | ่ก็้่่ตไบง+rr_reins_une_prem | float | Y | ๅบๆถๅไฟๆชๅฐๆ่ดฃไปปๅๅค้+rr_reins_outstd_cla | float | Y | ๅบๆถๅไฟๆชๅณ่ตๆฌพๅๅค้+rr_reins_lins_liab | float | Y | ๅบๆถๅไฟๅฏฟ้ฉ่ดฃไปปๅๅค้+rr_reins_lthins_liab | float | Y | ๅบๆถๅไฟ้ฟๆๅฅๅบท้ฉ่ดฃไปปๅๅค้+refund_depos | float | Y | ๅญๅบไฟ่ฏ้+ph_pledge_loans | float | Y | ไฟๆท่ดจๆผ่ดทๆฌพ+refund_cap_depos | float | Y | ๅญๅบ่ตๆฌไฟ่ฏ้+indep_acct_assets | float | Y | ็ฌ็ซ่ดฆๆท่ตไบง+client_depos | float | Y | ๅ ถไธญ๏ผๅฎขๆท่ต้ๅญๆฌพ+client_prov | float | Y | ๅ ถไธญ๏ผๅฎขๆทๅคไป้+transac_seat_fee | float | Y | ๅ ถไธญ:ไบคๆๅธญไฝ่ดน+invest_as_receiv | float | Y | ๅบๆถๆฌพ้กน็ฑปๆ่ต+total_assets | float | Y | ่ตไบงๆป่ฎก+lt_borr | float | Y | ้ฟๆๅๆฌพ+st_borr | float | Y | ็ญๆๅๆฌพ+cb_borr | float | Y | ๅไธญๅคฎ้ถ่กๅๆฌพ+depos_ib_deposits | float | Y | ๅธๆถๅญๆฌพๅๅไธๅญๆพ+loan_oth_bank | float | Y | ๆๅ ฅ่ต้+trading_fl | float | Y | ไบคๆๆง้่่ดๅบ+notes_payable | float | Y | ๅบไป็ฅจๆฎ+acct_payable | float | Y | ๅบไป่ดฆๆฌพ+adv_receipts | float | Y | ้ขๆถๆฌพ้กน+sold_for_repur_fa | float | Y | ๅๅบๅ่ดญ้่่ตไบงๆฌพ+comm_payable | float | Y | ๅบไปๆ็ปญ่ดนๅไฝฃ้+payroll_payable | float | Y | ๅบไป่ๅทฅ่ช้ ฌ+taxes_payable | float | Y | ๅบไบค็จ่ดน+int_payable | float | Y | ๅบไปๅฉๆฏ+div_payable | float | Y | ๅบไป่กๅฉ+oth_payable | float | Y | ๅ ถไปๅบไปๆฌพ+acc_exp | float | Y | ้ขๆ่ดน็จ+deferred_inc | float | Y | ้ๅปถๆถ็+st_bonds_payable | float | Y | ๅบไป็ญๆๅบๅธ+payable_to_reinsurer | float | Y | ๅบไปๅไฟ่ดฆๆฌพ+rsrv_insur_cont | float | Y | ไฟ้ฉๅๅๅๅค้+acting_trading_sec | float | Y | ไปฃ็ไนฐๅ่ฏๅธๆฌพ+acting_uw_sec | float | Y | ไปฃ็ๆฟ้่ฏๅธๆฌพ+non_cur_liab_due_1y | float | Y | ไธๅนดๅ ๅฐๆ็้ๆตๅจ่ดๅบ+oth_cur_liab | float | Y | ๅ ถไปๆตๅจ่ดๅบ+total_cur_liab | float | Y | ๆตๅจ่ดๅบๅ่ฎก+bond_payable | float | Y | ๅบไปๅบๅธ+lt_payable | float | Y | ้ฟๆๅบไปๆฌพ+specific_payables | float | Y | ไธ้กนๅบไปๆฌพ+estimated_liab | float | Y | ้ข่ฎก่ดๅบ+defer_tax_liab | float | Y | ้ๅปถๆๅพ็จ่ดๅบ+defer_inc_non_cur_liab | float | Y | ้ๅปถๆถ็-้ๆตๅจ่ดๅบ+oth_ncl | float | Y | ๅ ถไป้ๆตๅจ่ดๅบ+total_ncl | float | Y | ้ๆตๅจ่ดๅบๅ่ฎก+depos_oth_bfi | float | Y | ๅไธๅๅ ถๅฎ้่ๆบๆๅญๆพๆฌพ้กน+deriv_liab | float | Y | ่ก็้่่ดๅบ+depos | float | Y | ๅธๆถๅญๆฌพ+agency_bus_liab | float | Y | ไปฃ็ไธๅก่ดๅบ+oth_liab | float | Y | ๅ ถไป่ดๅบ+prem_receiv_adva | float | Y | ้ขๆถไฟ่ดน+depos_received | float | Y | ๅญๅ ฅไฟ่ฏ้+ph_invest | float | Y | ไฟๆทๅจ้ๅๆ่ตๆฌพ+reser_une_prem | float | Y | ๆชๅฐๆ่ดฃไปปๅๅค้+reser_outstd_claims | float | Y | ๆชๅณ่ตๆฌพๅๅค้+reser_lins_liab | float | Y | ๅฏฟ้ฉ่ดฃไปปๅๅค้+reser_lthins_liab | float | Y | ้ฟๆๅฅๅบท้ฉ่ดฃไปปๅๅค้+indept_acc_liab | float | Y | ็ฌ็ซ่ดฆๆท่ดๅบ+pledge_borr | float | Y | ๅ ถไธญ:่ดจๆผๅๆฌพ+indem_payable | float | Y | ๅบไป่ตไปๆฌพ+policy_div_payable | float | Y | ๅบไปไฟๅ็บขๅฉ+total_liab | float | Y | ่ดๅบๅ่ฎก+treasury_share | float | Y | ๅ:ๅบๅญ่ก+ordin_risk_reser | float | Y | ไธ่ฌ้ฃ้ฉๅๅค+forex_differ | float | Y | ๅคๅธๆฅ่กจๆ็ฎๅทฎ้ข+invest_loss_unconf | float | Y | ๆช็กฎ่ฎค็ๆ่ตๆๅคฑ+minority_int | float | Y | ๅฐๆฐ่กไธๆ็+total_hldr_eqy_exc_min_int | float | Y | ่กไธๆ็ๅ่ฎก(ไธๅซๅฐๆฐ่กไธๆ็)+total_hldr_eqy_inc_min_int | float | Y | ่กไธๆ็ๅ่ฎก(ๅซๅฐๆฐ่กไธๆ็)+total_liab_hldr_eqy | float | Y | ่ดๅบๅ่กไธๆ็ๆป่ฎก+lt_payroll_payable | float | Y | ้ฟๆๅบไป่ๅทฅ่ช้ ฌ+oth_comp_income | float | Y | ๅ ถไป็ปผๅๆถ็+oth_eqt_tools | float | Y | ๅ ถไปๆ็ๅทฅๅ ท+oth_eqt_tools_p_shr | float | Y | ๅ ถไปๆ็ๅทฅๅ ท(ไผๅ ่ก)+lending_funds | float | Y | ่ๅบ่ต้+acc_receivable | float | Y | ๅบๆถๆฌพ้กน+st_fin_payable | float | Y | ๅบไป็ญๆ่่ตๆฌพ+payables | float | Y | ๅบไปๆฌพ้กน+hfs_assets | float | Y | ๆๆๅพ ๅฎ็่ตไบง+hfs_sales | float | Y | ๆๆๅพ ๅฎ็่ดๅบ+cost_fin_assets | float | Y | ไปฅๆไฝๆๆฌ่ฎก้็้่่ตไบง+fair_value_fin_assets | float | Y | ไปฅๅ ฌๅ ไปทๅผ่ฎก้ไธๅ ถๅๅจ่ฎกๅ ฅๅ ถไป็ปผๅๆถ็็้่่ตไบง+cip_total | float | Y | ๅจๅปบๅทฅ็จ(ๅ่ฎก)(ๅ )+oth_pay_total | float | Y | ๅ ถไปๅบไปๆฌพ(ๅ่ฎก)(ๅ )+long_pay_total | float | Y | ้ฟๆๅบไปๆฌพ(ๅ่ฎก)(ๅ )+debt_invest | float | Y | ๅบๆๆ่ต(ๅ )+oth_debt_invest | float | Y | ๅ ถไปๅบๆๆ่ต(ๅ )+oth_eq_invest | float | N | ๅ ถไปๆ็ๅทฅๅ ทๆ่ต(ๅ )+oth_illiq_fin_assets | float | N | ๅ ถไป้ๆตๅจ้่่ตไบง(ๅ )+oth_eq_ppbond | float | N | ๅ ถไปๆ็ๅทฅๅ ท:ๆฐธ็ปญๅบ(ๅ )+receiv_financing | float | N | ๅบๆถๆฌพ้กน่่ต+use_right_assets | float | N | ไฝฟ็จๆ่ตไบง+lease_liab | float | N | ็ง่ต่ดๅบ+contract_assets | float | Y | ๅๅ่ตไบง+contract_liab | float | Y | ๅๅ่ดๅบ+accounts_receiv_bill | float | Y | ๅบๆถ็ฅจๆฎๅๅบๆถ่ดฆๆฌพ+accounts_pay | float | Y | ๅบไป็ฅจๆฎๅๅบไป่ดฆๆฌพ+oth_rcv_total | float | Y | ๅ ถไปๅบๆถๆฌพ(ๅ่ฎก)๏ผๅ ๏ผ+fix_assets_total | float | Y | ๅบๅฎ่ตไบง(ๅ่ฎก)(ๅ )+update_flag | str | Y | ๆดๆฐๆ ่ฏ++**ๆฅๅฃไฝฟ็จ่ฏดๆ**+```python++pro = ts.pro_api()++df = pro.balancesheet(ts_code='600000.SH', start_date='20180101', end_date='20180730', fields='ts_code,ann_date,f_ann_date,end_date,report_type,comp_type,cap_rese')++```++่ทๅๆไธๅญฃๅบฆๅ จ้จ่ก็ฅจๆฐๆฎ+```+df2 = pro.balancesheet_vip(period='20181231',fields='ts_code,ann_date,f_ann_date,end_date,report_type,comp_type,cap_rese')++```++**ๆฐๆฎๆ ทไพ**++ ts_code ann_date f_ann_date end_date report_type comp_type \+ 0 600000.SH 20180830 20180830 20180630 1 2+ 1 600000.SH 20180428 20180428 20180331 1 2++ cap_rese+ 0 8.176000e+10+ 1 8.176000e+10++++**ไธป่ฆๆฅ่กจ็ฑปๅ่ฏดๆ**++ไปฃ็ | ็ฑปๅ | ่ฏดๆ+---- | ----- | ---- |+1 | ๅๅนถๆฅ่กจ | ไธๅธๅ ฌๅธๆๆฐๆฅ่กจ๏ผ้ป่ฎค๏ผ+2 | ๅๅญฃๅๅนถ | ๅไธๅญฃๅบฆ็ๅๅนถๆฅ่กจ+3 | ่ฐๆดๅๅญฃๅๅนถ่กจ | ่ฐๆดๅ็ๅๅญฃๅๅนถๆฅ่กจ๏ผๅฆๆๆ๏ผ+4 | ่ฐๆดๅๅนถๆฅ่กจ | ๆฌๅนดๅบฆๅ ฌๅธไธๅนดๅๆ็่ดขๅกๆฅ่กจๆฐๆฎ๏ผๆฅๅๆไธบไธๅนดๅบฆ+5 | ่ฐๆดๅๅๅนถๆฅ่กจ | ๆฐๆฎๅ็ๅๆด๏ผๅฐๅๆฐๆฎ่ฟ่กไฟ็๏ผๅณ่ฐๆดๅ็ๅๆฐๆฎ+6 | ๆฏๅ ฌๅธๆฅ่กจ | ่ฏฅๅ ฌๅธๆฏๅ ฌๅธ็่ดขๅกๆฅ่กจๆฐๆฎ+7 | ๆฏๅ ฌๅธๅๅญฃ่กจ | ๆฏๅ ฌๅธ็ๅๅญฃๅบฆ่กจ+8 | ๆฏๅ ฌๅธ่ฐๆดๅๅญฃ่กจ | ๆฏๅ ฌๅธ่ฐๆดๅ็ๅๅญฃ่กจ+9 | ๆฏๅ ฌๅธ่ฐๆด่กจ | ่ฏฅๅ ฌๅธๆฏๅ ฌๅธ็ๆฌๅนดๅบฆๅ ฌๅธไธๅนดๅๆ็่ดขๅกๆฅ่กจๆฐๆฎ+10 | ๆฏๅ ฌๅธ่ฐๆดๅๆฅ่กจ | ๆฏๅ ฌๅธ่ฐๆดไนๅ็ๅๅง่ดขๅกๆฅ่กจๆฐๆฎ+11 | ๆฏๅ ฌๅธ่ฐๆดๅๅๅนถๆฅ่กจ | ๆฏๅ ฌๅธ่ฐๆดไนๅๅๅนถๆฅ่กจๅๆฐๆฎ+12 | ๆฏๅ ฌๅธ่ฐๆดๅๆฅ่กจ | ๆฏๅ ฌๅธๆฅ่กจๅ็ๅๆดๅไฟ็็ๅๆฐๆฎdiff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\265\204\351\207\221\346\265\201\345\220\221\346\225\260\346\215\256/\344\270\252\350\202\241\350\265\204\351\207\221\346\265\201\345\220\221(DC).md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\265\204\351\207\221\346\265\201\345\220\221\346\225\260\346\215\256/\344\270\252\350\202\241\350\265\204\351\207\221\346\265\201\345\220\221(DC).md"new file mode 100644index 000000000..7e214eb88--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\265\204\351\207\221\346\265\201\345\220\221\346\225\260\346\215\256/\344\270\252\350\202\241\350\265\204\351\207\221\346\265\201\345\220\221(DC).md"@@ -0,0 +1,77 @@+## ไธช่ก่ต้ๆตๅ๏ผDC๏ผ+----++ๆฅๅฃ๏ผmoneyflow_dc+ๆ่ฟฐ๏ผ่ทๅไธๆน่ดขๅฏไธช่ก่ต้ๆตๅๆฐๆฎ๏ผๆฏๆฅ็ๅๆดๆฐ๏ผๆฐๆฎๅผๅงไบ20230911+้้๏ผๅๆฌกๆๅคง่ทๅ6000ๆกๆฐๆฎ๏ผๅฏๆ นๆฎๆฅๆๆ่ก็ฅจไปฃ็ ๅพช็ฏๆๅๆฐๆฎ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ5000็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ๏ผYYYYMMDDๆ ผๅผ๏ผไธๅ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ+ts_code | str | Y | ่ก็ฅจไปฃ็ +name | str | Y | ่ก็ฅจๅ็งฐ+pct_change | float | Y | ๆถจ่ทๅน+close | float | Y | ๆๆฐไปท+net_amount | float | Y | ไปๆฅไธปๅๅๆตๅ ฅ้ข๏ผไธๅ ๏ผ+net_amount_rate | float | Y | ไปๆฅไธปๅๅๆตๅ ฅๅๅ ๆฏ๏ผ%๏ผ+buy_elg_amount | float | Y | ไปๆฅ่ถ ๅคงๅๅๆตๅ ฅ้ข๏ผไธๅ ๏ผ+buy_elg_amount_rate | float | Y | ไปๆฅ่ถ ๅคงๅๅๆตๅ ฅๅ ๆฏ๏ผ%๏ผ+buy_lg_amount | float | Y | ไปๆฅๅคงๅๅๆตๅ ฅ้ข๏ผไธๅ ๏ผ+buy_lg_amount_rate | float | Y | ไปๆฅๅคงๅๅๆตๅ ฅๅ ๆฏ๏ผ%๏ผ+buy_md_amount | float | Y | ไปๆฅไธญๅๅๆตๅ ฅ้ข๏ผไธๅ ๏ผ+buy_md_amount_rate | float | Y | ไปๆฅไธญๅๅๆตๅ ฅๅ ๆฏ๏ผ%๏ผ+buy_sm_amount | float | Y | ไปๆฅๅฐๅๅๆตๅ ฅ้ข๏ผไธๅ ๏ผ+buy_sm_amount_rate | float | Y | ไปๆฅๅฐๅๅๆตๅ ฅๅ ๆฏ๏ผ%๏ผ++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++#่ทๅๅๆฅๅ จ้จ่ก็ฅจๆฐๆฎ+df = pro.moneyflow_dc(trade_date='20241011')++#่ทๅๅไธช่ก็ฅจๆฐๆฎ+df = pro.moneyflow_dc(ts_code='002149.SZ', start_date='20240901', end_date='20240913')+++```++<br>+<br>++ trade_date ts_code name pct_change ... buy_md_amount buy_md_amount_rate buy_sm_amount buy_sm_amount_rate+ 0 20240913 002149.SZ ่ฅฟ้จๆๆ -1.34 ... -12.65 -0.35 -62.43 -1.72+ 1 20240912 002149.SZ ่ฅฟ้จๆๆ 1.43 ... 13.71 0.33 -388.43 -9.25+ 2 20240911 002149.SZ ่ฅฟ้จๆๆ -0.79 ... -26.10 -1.68 95.69 6.15+ 3 20240910 002149.SZ ่ฅฟ้จๆๆ -0.08 ... -199.50 -7.26 -69.29 -2.52+ 4 20240909 002149.SZ ่ฅฟ้จๆๆ 1.12 ... 66.76 2.48 -198.12 -7.37+ 5 20240906 002149.SZ ่ฅฟ้จๆๆ -2.49 ... -104.57 -2.74 769.65 20.19+ 6 20240905 002149.SZ ่ฅฟ้จๆๆ -0.70 ... -307.62 -8.11 346.51 9.14+ 7 20240904 002149.SZ ่ฅฟ้จๆๆ -0.92 ... 370.98 9.56 -23.25 -0.60+ 8 20240903 002149.SZ ่ฅฟ้จๆๆ 0.93 ... -195.45 -3.87 643.41 12.75+ 9 20240902 002149.SZ ่ฅฟ้จๆๆ -3.44 ... 195.50 2.32 988.69 11.71++diff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\265\204\351\207\221\346\265\201\345\220\221\346\225\260\346\215\256/\344\270\252\350\202\241\350\265\204\351\207\221\346\265\201\345\220\221(THS).md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\265\204\351\207\221\346\265\201\345\220\221\346\225\260\346\215\256/\344\270\252\350\202\241\350\265\204\351\207\221\346\265\201\345\220\221(THS).md"new file mode 100644index 000000000..009a61e1d--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\265\204\351\207\221\346\265\201\345\220\221\346\225\260\346\215\256/\344\270\252\350\202\241\350\265\204\351\207\221\346\265\201\345\220\221(THS).md"@@ -0,0 +1,68 @@+## ไธช่ก่ต้ๆตๅ๏ผTHS๏ผ+----++ๆฅๅฃ๏ผmoneyflow_ths+ๆ่ฟฐ๏ผ่ทๅๅ่ฑ้กบไธช่ก่ต้ๆตๅๆฐๆฎ๏ผๆฏๆฅ็ๅๆดๆฐ+้้๏ผๅๆฌกๆๅคง6000๏ผๅฏๆ นๆฎๆฅๆๆ่ก็ฅจไปฃ็ ๅพช็ฏๆๅๆฐๆฎ+็งฏๅ๏ผ6000็งฏๅๅฏ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ๏ผYYYYMMDDๆ ผๅผ๏ผไธๅ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ+ts_code | str | Y | ่ก็ฅจไปฃ็ +name | str | Y | ่ก็ฅจๅ็งฐ+pct_change | float | Y | ๆถจ่ทๅน+latest | float | Y | ๆๆฐไปท+net_amount | float | Y | ่ต้ๅๆตๅ ฅ(ไธๅ )+net_d5_amount | float | Y | 5ๆฅไธปๅๅ้ข(ไธๅ )+buy_lg_amount | float | Y | ไปๆฅๅคงๅๅๆตๅ ฅ้ข(ไธๅ )+buy_lg_amount_rate | float | Y | ไปๆฅๅคงๅๅๆตๅ ฅๅ ๆฏ(%)+buy_md_amount | float | Y | ไปๆฅไธญๅๅๆตๅ ฅ้ข(ไธๅ )+buy_md_amount_rate | float | Y | ไปๆฅไธญๅๅๆตๅ ฅๅ ๆฏ(%)+buy_sm_amount | float | Y | ไปๆฅๅฐๅๅๆตๅ ฅ้ข(ไธๅ )+buy_sm_amount_rate | float | Y | ไปๆฅๅฐๅๅๆตๅ ฅๅ ๆฏ(%)++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++#่ทๅๅๆฅๅ จ้จ่ก็ฅจๆฐๆฎ+df = pro.moneyflow_ths(trade_date='20241011')++#่ทๅๅไธช่ก็ฅจๆฐๆฎ+df = pro.moneyflow_ths(ts_code='002149.SZ', start_date='20241001', end_date='20241011')+++```++ trade_date ts_code name pct_change ... buy_md_amount buy_md_amount_rate buy_sm_amount buy_sm_amount_rate+ 0 20241011 002149.SZ ่ฅฟ้จๆๆ 2.47 ... -589.0 5.43 -191.0 1.76+ 1 20241010 002149.SZ ่ฅฟ้จๆๆ 1.22 ... -2732.0 15.38 -1031.0 5.81+ 2 20241009 002149.SZ ่ฅฟ้จๆๆ 7.00 ... -1941.0 9.25 -2079.0 9.90+ 3 20241008 002149.SZ ่ฅฟ้จๆๆ 5.17 ... -2985.0 7.93 -2507.0 6.66+++<br>+<br>\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\265\204\351\207\221\346\265\201\345\220\221\346\225\260\346\215\256/\344\270\252\350\202\241\350\265\204\351\207\221\346\265\201\345\220\221.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\265\204\351\207\221\346\265\201\345\220\221\346\225\260\346\215\256/\344\270\252\350\202\241\350\265\204\351\207\221\346\265\201\345\220\221.md"new file mode 100644index 000000000..0f88362b4--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\265\204\351\207\221\346\265\201\345\220\221\346\225\260\346\215\256/\344\270\252\350\202\241\350\265\204\351\207\221\346\265\201\345\220\221.md"@@ -0,0 +1,127 @@+## ไธช่ก่ต้ๆตๅ+----++ๆฅๅฃ๏ผmoneyflow๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆ่ฟฐ๏ผ่ทๅๆฒชๆทฑA่ก็ฅจ่ต้ๆตๅๆฐๆฎ๏ผๅๆๅคงๅๅฐๅๆไบคๆ ๅต๏ผ็จไบๅคๅซ่ต้ๅจๅ๏ผๆฐๆฎๅผๅงไบ2010ๅนดใ+้้๏ผๅๆฌกๆๅคงๆๅ6000่ก่ฎฐๅฝ๏ผๆป้ไธ้ๅถ+็งฏๅ๏ผ็จๆท้่ฆ่ณๅฐ2000็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅบ็ก็งฏๅๆๆต้ๆงๅถ๏ผ็งฏๅ่ถๅคๆ้่ถๅคง๏ผ่ฏท่ช่กๆ้ซ็งฏๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>+++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ่ก็ฅจไปฃ็ ๏ผ่ก็ฅจๅๆถ้ดๅๆฐ่ณๅฐ่พๅ ฅไธไธช๏ผ+trade_date | str | N | ไบคๆๆฅๆ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+ts_code | str | Y | TSไปฃ็ +trade_date | str | Y | ไบคๆๆฅๆ+buy_sm_vol | int | Y | ๅฐๅไนฐๅ ฅ้๏ผๆ๏ผ+buy_sm_amount | float | Y | ๅฐๅไนฐๅ ฅ้้ข๏ผไธๅ ๏ผ+sell_sm_vol | int | Y | ๅฐๅๅๅบ้๏ผๆ๏ผ+sell_sm_amount | float | Y | ๅฐๅๅๅบ้้ข๏ผไธๅ ๏ผ+buy_md_vol | int | Y | ไธญๅไนฐๅ ฅ้๏ผๆ๏ผ+buy_md_amount | float | Y | ไธญๅไนฐๅ ฅ้้ข๏ผไธๅ ๏ผ+sell_md_vol | int | Y | ไธญๅๅๅบ้๏ผๆ๏ผ+sell_md_amount | float | Y | ไธญๅๅๅบ้้ข๏ผไธๅ ๏ผ+buy_lg_vol | int | Y | ๅคงๅไนฐๅ ฅ้๏ผๆ๏ผ+buy_lg_amount | float | Y | ๅคงๅไนฐๅ ฅ้้ข๏ผไธๅ ๏ผ+sell_lg_vol | int | Y | ๅคงๅๅๅบ้๏ผๆ๏ผ+sell_lg_amount | float | Y | ๅคงๅๅๅบ้้ข๏ผไธๅ ๏ผ+buy_elg_vol | int | Y | ็นๅคงๅไนฐๅ ฅ้๏ผๆ๏ผ+buy_elg_amount | float | Y | ็นๅคงๅไนฐๅ ฅ้้ข๏ผไธๅ ๏ผ+sell_elg_vol | int | Y | ็นๅคงๅๅๅบ้๏ผๆ๏ผ+sell_elg_amount | float | Y | ็นๅคงๅๅๅบ้้ข๏ผไธๅ ๏ผ+net_mf_vol | int | Y | ๅๆตๅ ฅ้๏ผๆ๏ผ+net_mf_amount | float | Y | ๅๆตๅ ฅ้ข๏ผไธๅ ๏ผ++<br>++ๅ็ฑปๅซ็ป่ฎก่งๅๅฆไธ๏ผ+**ๅฐๅ**๏ผ5ไธไปฅไธ **ไธญๅ**๏ผ5ไธ๏ฝ20ไธ **ๅคงๅ**๏ผ20ไธ๏ฝ100ไธ **็นๅคงๅ**๏ผๆไบค้ข>=100ไธ ๏ผๆฐๆฎๅบไบไธปๅจไนฐๅๅ็ป่ฎก+++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api('your token')++#่ทๅๅๆฅๅ จ้จ่ก็ฅจๆฐๆฎ+df = pro.moneyflow(trade_date='20190315')++#่ทๅๅไธช่ก็ฅจๆฐๆฎ+df = pro.moneyflow(ts_code='002149.SZ', start_date='20190115', end_date='20190315')+++```+++<br>+<br>++**ๆฐๆฎ็คบไพ**+++ ts_code trade_date buy_sm_vol buy_sm_amount sell_sm_vol \+ 0 000779.SZ 20190315 11377 1150.17 11100+ 1 000933.SZ 20190315 94220 4803.22 105924+ 2 002270.SZ 20190315 43979 2330.96 45893+ 3 002319.SZ 20190315 21502 2952.88 17155+ 4 002604.SZ 20190315 31944 607.35 58667+ 5 300065.SZ 20190315 16048 2294.71 16425+ 6 600062.SH 20190315 55439 7432.13 65765+ 7 002735.SZ 20190315 3220 797.10 4598+ 8 300196.SZ 20190315 12534 1286.02 8340+ 9 300350.SZ 20190315 15346 1120.12 18853+ 10 600193.SH 20190315 12183 503.73 19576+ 11 002866.SZ 20190315 16932 2213.68 16037+ 12 300481.SZ 20190315 21386 4275.33 21863+ 13 600527.SH 20190315 115462 2975.44 79272+ 14 603980.SH 20190315 13957 1924.69 11718+ 15 600658.SH 20190315 71767 4826.73 69535+ 16 600812.SH 20190315 26140 1247.47 34923+ 17 002013.SZ 20190315 170234 12286.02 148509+ 18 600789.SH 20190315 211012 21644.56 150598+ 19 601636.SH 20190315 70737 3117.43 68073+ 20 000807.SZ 20190315 129668 6361.06 122077++ ...++ sell_sm_amount buy_md_vol buy_md_amount sell_md_vol sell_md_amount \+ 0 1122.97 13012 1316.72 14812 1498.90+ 1 5411.72 135976 6935.40 154023 7863.00+ 2 2435.98 57679 3059.15 47279 2507.55+ 3 2358.68 27245 3742.52 26708 3670.05+ 4 1114.40 69897 1327.41 41108 781.19+ 5 2353.34 31232 4472.05 26771 3834.95+ 6 8817.75 86617 11615.40 79551 10676.99+ 7 1140.61 4602 1141.61 2730 676.72+ 8 855.45 9401 963.72 10478 1074.32+ 9 1380.31 24224 1770.90 21588 1577.92+ 10 812.58 28696 1185.17 31087 1286.11+ 11 2100.70 19197 2511.62 20269 2650.56+ 12 4379.14 31692 6345.72 32873 6578.36+ 13 2046.54 107103 2763.00 84883 2191.24+ 14 1619.33 14621 2019.41 14528 2005.69+ 15 4691.29 92788 6232.80 93273 6280.13+ 16 1669.97 38812 1855.78 39211 1874.05+ 17 10726.22 154979 11190.69 164090 11855.76+ 18 15479.08 269470 27660.18 236958 24338.36+ 19 3000.73 90416 3984.68 115162 5075.50+ 20 5999.66 175692 8627.77 178044 8751.08\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\265\204\351\207\221\346\265\201\345\220\221\346\225\260\346\215\256/\345\244\247\347\233\230\350\265\204\351\207\221\346\265\201\345\220\221(DC).md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\265\204\351\207\221\346\265\201\345\220\221\346\225\260\346\215\256/\345\244\247\347\233\230\350\265\204\351\207\221\346\265\201\345\220\221(DC).md"new file mode 100644index 000000000..a38e8bd47--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\265\204\351\207\221\346\265\201\345\220\221\346\225\260\346\215\256/\345\244\247\347\233\230\350\265\204\351\207\221\346\265\201\345\220\221(DC).md"@@ -0,0 +1,79 @@+## ๅคง็่ต้ๆตๅ๏ผDC๏ผ+----++ๆฅๅฃ๏ผmoneyflow_mkt_dc+ๆ่ฟฐ๏ผ่ทๅไธๆน่ดขๅฏๅคง็่ต้ๆตๅๆฐๆฎ๏ผๆฏๆฅ็ๅๆดๆฐ+้้๏ผๅๆฌกๆๅคง3000ๆก๏ผๅฏๆ นๆฎๆฅๆๆๆฅๆๅบ้ดๅพช็ฏ่ทๅ+็งฏๅ๏ผ120็งฏๅๅฏ่ฏ็จ๏ผ6000็งฏๅๅฏๆญฃๅผ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>+**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+trade_date | str | N | ไบคๆๆฅๆ(YYYYMMDDๆ ผๅผ๏ผไธๅ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ+close_sh | float | Y | ไธ่ฏๆถ็ไปท๏ผ็น๏ผ+pct_change_sh | float | Y | ไธ่ฏๆถจ่ทๅน (%)+close_sz | float | Y | ๆทฑ่ฏๆถ็ไปท๏ผ็น๏ผ+pct_change_sz | float | Y | ๆทฑ่ฏๆถจ่ทๅน (%)+net_amount | float | Y | ไปๆฅไธปๅๅๆตๅ ฅ ๅ้ข๏ผๅ ๏ผ+net_amount_rate | float | Y | ไปๆฅไธปๅๅๆตๅ ฅๅๅ ๆฏ%+buy_elg_amount | float | Y | ไปๆฅ่ถ ๅคงๅๅๆตๅ ฅ ๅ้ข๏ผๅ ๏ผ+buy_elg_amount_rate | float | Y | ไปๆฅ่ถ ๅคงๅๅๆตๅ ฅ ๅๅ ๆฏ%+buy_lg_amount | float | Y | ไปๆฅๅคงๅๅๆตๅ ฅ ๅ้ข๏ผๅ ๏ผ+buy_lg_amount_rate | float | Y | ไปๆฅๅคงๅๅๆตๅ ฅ ๅๅ ๆฏ%+buy_md_amount | float | Y | ไปๆฅไธญๅๅๆตๅ ฅ ๅ้ข๏ผๅ ๏ผ+buy_md_amount_rate | float | Y | ไปๆฅไธญๅๅๆตๅ ฅ ๅๅ ๆฏ%+buy_sm_amount | float | Y | ไปๆฅๅฐๅๅๆตๅ ฅ ๅ้ข๏ผๅ ๏ผ+buy_sm_amount_rate | float | Y | ไปๆฅๅฐๅๅๆตๅ ฅ ๅๅ ๆฏ%++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++#่ทๅๅฝๆฅๆๆๆฟๅ่ต้ๆตๅ+df = pro.moneyflow_mkt_dc(start_date='20240901', end_date='20240930')++```++<br>+<br>+++**ๆฐๆฎ็คบไพ**++ trade_date close_sh ptc_change_sh close_sz pct_change_sz buy_elg_amount buy_lg_amount+ 0 20240930 3336.50 8.06 10529.76 10.67 -6500884480.00 -29199228928.00+ 1 20240927 3087.53 2.89 9514.86 6.71 17175101440.00 -3564773376.00+ 2 20240926 3000.95 3.61 8916.65 4.44 18894807552.00 -2446319616.00+ 3 20240925 2896.31 1.16 8537.73 1.21 -4010342144.00 -10390331392.00+ 4 20240924 2863.13 4.15 8435.70 4.36 22524846080.00 5433212928.00+ 5 20240923 2748.92 0.44 8083.38 0.10 -926530816.00 -5776028928.00+ 6 20240920 2736.81 0.03 8075.14 -0.15 -4991644160.00 -6899648256.00+ 7 20240919 2736.02 0.69 8087.60 1.19 3472006400.00 1882220032.00+ 8 20240918 2717.28 0.49 7992.25 0.11 -5056087040.00 -7836610048.00+ 9 20240913 2704.09 -0.48 7983.55 -0.88 -5527845376.00 -9092720640.00+ 10 20240912 2717.12 -0.17 8054.24 -0.63 -3747197184.00 -5645509632.00+ 11 20240911 2721.80 -0.82 8105.38 0.39 -3585276416.00 -6461025792.00+ 12 20240910 2744.19 0.28 8073.83 0.13 -2726709504.00 -3818158336.00+ 13 20240909 2736.49 -1.06 8063.27 -0.83 -7874987776.00 -8608827904.00+ 14 20240906 2765.81 -0.81 8130.77 -1.44 -5892936960.00 -13908542976.00+ 15 20240905 2788.31 0.14 8249.66 0.28 1211718400.00 -3910650112.00+ 16 20240904 2784.28 -0.67 8226.24 -0.51 -7008298240.00 -11212970496.00+ 17 20240903 2802.98 -0.29 8268.05 1.17 263304192.00 -3680828928.00+ 18 20240902 2811.04 -1.10 8172.21 -2.11 -18689678336.00 -20967354368.00\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\265\204\351\207\221\346\265\201\345\220\221\346\225\260\346\215\256/\346\235\277\345\235\227\350\265\204\351\207\221\346\265\201\345\220\221(DC).md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\265\204\351\207\221\346\265\201\345\220\221\346\225\260\346\215\256/\346\235\277\345\235\227\350\265\204\351\207\221\346\265\201\345\220\221(DC).md"new file mode 100644index 000000000..b693329b5--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\265\204\351\207\221\346\265\201\345\220\221\346\225\260\346\215\256/\346\235\277\345\235\227\350\265\204\351\207\221\346\265\201\345\220\221(DC).md"@@ -0,0 +1,80 @@+## ไธ่ดขๆฆๅฟตๅ่กไธๆฟๅ่ต้ๆตๅ๏ผDC๏ผ+----++ๆฅๅฃ๏ผmoneyflow_ind_dc+ๆ่ฟฐ๏ผ่ทๅไธๆน่ดขๅฏๆฟๅ่ต้ๆตๅ๏ผๆฏๅคฉ็ๅๆดๆฐ+้้๏ผๅๆฌกๆๅคงๅฏ่ฐๅ5000ๆกๆฐๆฎ๏ผๅฏไปฅๆ นๆฎๆฅๆๅไปฃ็ ๅพช็ฏๆๅๅ จ้จๆฐๆฎ+็งฏๅ๏ผ6000็งฏๅๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)+++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ๏ผYYYYMMDDๆ ผๅผ๏ผไธๅ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ+content_type | str | N | ่ต้็ฑปๅ(่กไธใๆฆๅฟตใๅฐๅ)++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ+content_type | str | Y | ๆฐๆฎ็ฑปๅ+ts_code | str | Y | DCๆฟๅไปฃ็ ๏ผ่กไธใๆฆๅฟตใๅฐๅ๏ผ+name | str | Y | ๆฟๅๅ็งฐ+pct_change | float | Y | ๆฟๅๆถจ่ทๅน ๏ผ%๏ผ+close | float | Y | ๆฟๅๆๆฐๆๆฐ+net_amount | float | Y | ไปๆฅไธปๅๅๆตๅ ฅ ๅ้ข๏ผๅ ๏ผ+net_amount_rate | float | Y | ไปๆฅไธปๅๅๆตๅ ฅๅๅ ๆฏ%+buy_elg_amount | float | Y | ไปๆฅ่ถ ๅคงๅๅๆตๅ ฅ ๅ้ข๏ผๅ ๏ผ+buy_elg_amount_rate | float | Y | ไปๆฅ่ถ ๅคงๅๅๆตๅ ฅ ๅๅ ๆฏ%+buy_lg_amount | float | Y | ไปๆฅๅคงๅๅๆตๅ ฅ ๅ้ข๏ผๅ ๏ผ+buy_lg_amount_rate | float | Y | ไปๆฅๅคงๅๅๆตๅ ฅ ๅๅ ๆฏ%+buy_md_amount | float | Y | ไปๆฅไธญๅๅๆตๅ ฅ ๅ้ข๏ผๅ ๏ผ+buy_md_amount_rate | float | Y | ไปๆฅไธญๅๅๆตๅ ฅ ๅๅ ๆฏ%+buy_sm_amount | float | Y | ไปๆฅๅฐๅๅๆตๅ ฅ ๅ้ข๏ผๅ ๏ผ+buy_sm_amount_rate | float | Y | ไปๆฅๅฐๅๅๆตๅ ฅ ๅๅ ๆฏ%+buy_sm_amount_stock | str | Y | ไปๆฅไธปๅๅๆตๅ ฅๆๅคง่ก+rank | int | Y | ๅบๅท++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++#่ทๅๅฝๆฅๆๆๆฟๅ่ต้ๆตๅ+df = pro.moneyflow_ind_dc(trade_date='20240927', fields='trade_date,name,pct_change, close, net_amount,net_amount_rate,rank')++```++<br>+<br>+++**ๆฐๆฎ็คบไพ**++ trade_date name pct_change close net_amount net_amount_rate rank+ 0 20240927 ไบ่็ฝๆๅก 6.28 16883.55 3056382208.00 3.93 1+ 1 20240927 ่ฏๅธ 8.23 135249.80 2875528704.00 4.64 2+ 2 20240927 ่ฝฏไปถๅผๅ 8.28 721.35 2733378816.00 3.18 3+ 3 20240927 ้ ฟ้ ่กไธ 6.47 49330.63 2568183040.00 5.24 4+ 4 20240927 ็ตๆฑ 8.37 731.85 1328346624.00 3.05 5+ .. ... ... ... ... ... ... ...+ 81 20240927 ็ณๆฒน่กไธ 2.31 4654.40 -611530368.00 -9.39 82+ 82 20240927 ๆฑฝ่ฝฆๆด่ฝฆ 4.05 1386.22 -629528064.00 -2.42 83+ 83 20240927 ็ปผๅ่กไธ 3.06 7437.08 -667341600.00 -7.28 84+ 84 20240927 ๅฎถ็ต่กไธ 3.95 15815.68 -670035968.00 -2.37 85+ 85 20240927 ้ถ่ก -0.33 3401.83 -2340180224.00 -6.41 86++diff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\265\204\351\207\221\346\265\201\345\220\221\346\225\260\346\215\256/\346\235\277\345\235\227\350\265\204\351\207\221\346\265\201\345\220\221(THS).md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\265\204\351\207\221\346\265\201\345\220\221\346\225\260\346\215\256/\346\235\277\345\235\227\350\265\204\351\207\221\346\265\201\345\220\221(THS).md"new file mode 100644index 000000000..67f3554e5--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\265\204\351\207\221\346\265\201\345\220\221\346\225\260\346\215\256/\346\235\277\345\235\227\350\265\204\351\207\221\346\265\201\345\220\221(THS).md"@@ -0,0 +1,71 @@+## ๅ่ฑ้กบๆฆๅฟตๆฟๅ่ต้ๆตๅ๏ผTHS๏ผ+----++ๆฅๅฃ๏ผmoneyflow_cnt_ths+ๆ่ฟฐ๏ผ่ทๅๅ่ฑ้กบๆฆๅฟตๆฟๅๆฏๆฅ่ต้ๆตๅ+้้๏ผๅๆฌกๆๅคงๅฏ่ฐๅ5000ๆกๆฐๆฎ๏ผๅฏไปฅๆ นๆฎๆฅๆๅไปฃ็ ๅพช็ฏๆๅๅ จ้จๆฐๆฎ+็งฏๅ๏ผ6000็งฏๅๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ(ๆ ผๅผ๏ผYYYYMMDD๏ผไธๅ)+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ+ts_code | str | Y | ๆฟๅไปฃ็ +name | str | Y | ๆฟๅๅ็งฐ+lead_stock | str | Y | ้ขๆถจ่ก็ฅจๅ็งฐ+close_price | float | Y | ๆๆฐไปท+pct_change | float | Y | ่กไธๆถจ่ทๅน+industry_index | float | Y | ๆฟๅๆๆฐ+company_num | int | Y | ๅ ฌๅธๆฐ้+pct_change_stock | float | Y | ้ขๆถจ่กๆถจ่ทๅน+net_buy_amount | float | Y | ๆตๅ ฅ่ต้(ไบฟๅ )+net_sell_amount | float | Y | ๆตๅบ่ต้(ไบฟๅ )+net_amount | float | Y | ๅ้ข(ไบฟๅ )++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++#่ทๅๅฝๆฅๅ่ฑ้กบๆฟๅ่ต้ๆตๅ+df = pro.moneyflow_cnt_ths(trade_date='20250320')++```++<br>+<br>+++**ๆฐๆฎ็คบไพ**++ trade_date ts_code name lead_stock close_price pct_change industry_index company_num pct_change_stock net_buy_amount net_sell_amount net_amount+ 0 20250320 885748.TI ๅฏ็ๅฐ ๆตท้ป็งๆ 7.99 4.76 1307.56 12 4.76 21.00 19.00 1.00+ 1 20250320 886008.TI ๅ้ๅจ ๅคงๅถ่กไปฝ 21.22 2.60 1862.58 103 2.60 227.00 235.00 -8.00+ 2 20250320 885426.TI ๆตทๅทฅ่ฃ ๅค ๅคฉๆตท้ฒๅก 6.97 2.56 2711.31 85 2.56 171.00 148.00 23.00+ 3 20250320 885372.TI ้กตๅฒฉๆฐ ๆตท้ป็งๆ 7.99 2.21 2103.88 40 2.21 53.00 42.00 10.00+ 4 20250320 886000.TI ไธไฝๅๅ้ธ ไป้ฃๅฏ่พพ 5.57 1.78 1213.60 50 1.78 95.00 86.00 9.00+ .. ... ... ... ... ... ... ... ... ... ... ... ...+ 389 20250320 885881.TI ไบๅๅ ฌ *ST้นๅ 1.72 -1.36 1862.72 45 -1.36 54.00 63.00 -9.00+ 390 20250320 885947.TI DRG/DIP ๅฝๆฐๅฅๅบท 12.82 -1.38 1092.62 23 -1.38 25.00 30.00 -5.00+ 391 20250320 885975.TI ็ตๅญ่บซไปฝ่ฏ ๆๅฐๆ 24.16 -1.40 1438.42 40 -1.40 28.00 39.00 -11.00+ 392 20250320 885874.TI ไบๆธธๆ *ST้นๅ 1.72 -1.75 1330.68 27 -1.75 67.00 91.00 -23.00+ 393 20250320 886091.TI ๅไธบๆๆบ ๅฏๆ ผ็ฒพๆบ 37.23 -2.25 1183.33 35 -2.25 49.00 68.00 -18.00+diff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\265\204\351\207\221\346\265\201\345\220\221\346\225\260\346\215\256/\346\262\252\346\267\261\346\270\257\351\200\232\350\265\204\351\207\221\346\265\201\345\220\221.md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\265\204\351\207\221\346\265\201\345\220\221\346\225\260\346\215\256/\346\262\252\346\267\261\346\270\257\351\200\232\350\265\204\351\207\221\346\265\201\345\220\221.md"new file mode 100644index 000000000..24f4e7581--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\265\204\351\207\221\346\265\201\345\220\221\346\225\260\346\215\256/\346\262\252\346\267\261\346\270\257\351\200\232\350\265\204\351\207\221\346\265\201\345\220\221.md"@@ -0,0 +1,68 @@+## ๆฒชๆทฑๆธฏ้่ต้ๆตๅ+----+ๆฅๅฃ๏ผmoneyflow_hsgt๏ผๅฏไปฅ้่ฟ[**ๆฐๆฎๅทฅๅ ท**](https://tushare.pro/webclient/)่ฐ่ฏๅๆฅ็ๆฐๆฎใ+ๆ่ฟฐ๏ผ่ทๅๆฒช่ก้ใๆทฑ่ก้ใๆธฏ่ก้ๆฏๆฅ่ต้ๆตๅๆฐๆฎ๏ผๆฏๆฌกๆๅค่ฟๅ300ๆก่ฎฐๅฝ๏ผๆป้ไธ้ๅถใ+็งฏๅ่ฆๆฑ๏ผ2000็งฏๅ่ตท๏ผ5000็งฏๅๆฏๅ้ๅฏๆๅ500ๆฌก++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+trade_date | str | N | ไบคๆๆฅๆ (ไบ้ไธ)+start_date | str | N | ๅผๅงๆฅๆ (ไบ้ไธ)+end_date | str | N | ็ปๆๆฅๆ++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๆ่ฟฐ+--- | ---- | ----+trade_date | str | ไบคๆๆฅๆ+ggt_ss | float | ๆธฏ่ก้๏ผไธๆตท๏ผ+ggt_sz | float | ๆธฏ่ก้๏ผๆทฑๅณ๏ผ+hgt | float | ๆฒช่ก้๏ผ็พไธๅ ๏ผ+sgt | float | ๆทฑ่ก้๏ผ็พไธๅ ๏ผ+north_money | float | ๅๅ่ต้๏ผ็พไธๅ ๏ผ+south_money | float | ๅๅ่ต้๏ผ็พไธๅ ๏ผ++**ๆฅๅฃ็จๆณ**++```python++pro = ts.pro_api()++pro.moneyflow_hsgt(start_date='20180125', end_date='20180808')++```++ๆ่++```python++pro.query('moneyflow_hsgt', trade_date='20180725')++```++**ๆฐๆฎๆ ทไพ**++ trade_date ggt_ss ggt_sz hgt sgt north_money south_money+ 0 20180808 -476.0 -188.0 962.68 799.94 1762.62 -664.0+ 1 20180807 -261.0 177.0 2140.85 1079.82 3220.67 -84.0+ 2 20180803 667.0 -32.0 -436.99 1088.07 651.08 635.0+ 3 20180802 -1651.0 -366.0 874.97 -216.65 658.32 -2017.0+ 4 20180801 -1443.0 -443.0 544.36 542.79 1087.15 -1886.0+ 5 20180731 -299.0 -21.0 1923.72 1345.48 3269.20 -320.0+ 6 20180730 -588.0 611.0 2536.54 146.24 2682.78 23.0+ 7 20180727 -13.0 363.0 2182.84 533.06 2715.90 350.0+ 8 20180726 -566.0 -339.0 1113.28 -567.47 545.81 -905.0+ 9 20180725 319.0 370.0 1470.29 311.27 1781.56 689.0+ 10 20180724 924.0 2312.0 1748.88 1053.52 2802.40 3236.0+ 11 20180723 1628.0 1172.0 -279.96 334.82 54.86 2800.0+ 12 20180720 2233.0 1773.0 606.33 1711.77 2318.10 4006.0+ 13 20180719 456.0 206.0 1831.41 874.40 2705.81 662.0+ 14 20180718 -181.0 261.0 126.80 -111.83 14.97 80.0+ 15 20180717 -390.0 187.0 -90.32 -404.24 -494.56 -203.0+ 16 20180716 -539.0 52.0 -457.00 487.60 30.60 -487.0+ 17 20180713 -297.0 751.0 599.38 658.07 1257.45 454.0+ 18 20180712 2635.0 1699.0 1695.62 269.56 1965.18 4334.0+ 19 20180711 19.0 646.0 261.96 -339.20 -77.24 665.0+ 20 20180710 668.0 889.0 514.05 262.33 776.38 1557.0\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\265\204\351\207\221\346\265\201\345\220\221\346\225\260\346\215\256/\350\241\214\344\270\232\350\265\204\351\207\221\346\265\201\345\220\221(THS).md" "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\265\204\351\207\221\346\265\201\345\220\221\346\225\260\346\215\256/\350\241\214\344\270\232\350\265\204\351\207\221\346\265\201\345\220\221(THS).md"new file mode 100644index 000000000..1ed460243--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\202\241\347\245\250\346\225\260\346\215\256/\350\265\204\351\207\221\346\265\201\345\220\221\346\225\260\346\215\256/\350\241\214\344\270\232\350\265\204\351\207\221\346\265\201\345\220\221(THS).md"@@ -0,0 +1,73 @@+## ๅ่ฑ้กบ่กไธ่ต้ๆตๅ๏ผTHS๏ผ+----++ๆฅๅฃ๏ผmoneyflow_ind_ths+ๆ่ฟฐ๏ผ่ทๅๅ่ฑ้กบ่กไธ่ต้ๆตๅ๏ผๆฏๆฅ็ๅๆดๆฐ+้้๏ผๅๆฌกๆๅคงๅฏ่ฐๅ5000ๆกๆฐๆฎ๏ผๅฏไปฅๆ นๆฎๆฅๆๅไปฃ็ ๅพช็ฏๆๅๅ จ้จๆฐๆฎ+็งฏๅ๏ผ6000็งฏๅๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ts_code | str | N | ไปฃ็ +trade_date | str | N | ไบคๆๆฅๆ(YYYYMMDDๆ ผๅผ๏ผไธๅ)+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+trade_date | str | Y | ไบคๆๆฅๆ+ts_code | str | Y | ๆฟๅไปฃ็ +industry | str | Y | ๆฟๅๅ็งฐ+lead_stock | str | Y | ้ขๆถจ่ก็ฅจๅ็งฐ+close | float | Y | ๆถ็ๆๆฐ+pct_change | float | Y | ๆๆฐๆถจ่ทๅน+company_num | int | Y | ๅ ฌๅธๆฐ้+pct_change_stock | float | Y | ้ขๆถจ่กๆถจ่ทๅน+close_price | float | Y | ้ขๆถจ่กๆๆฐไปท+net_buy_amount | float | Y | ๆตๅ ฅ่ต้(ไบฟๅ )+net_sell_amount | float | Y | ๆตๅบ่ต้(ไบฟๅ )+net_amount | float | Y | ๅ้ข(ไบฟๅ )++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++#่ทๅๅฝๆฅๆๆๅ่ฑ้กบ่กไธ่ต้ๆตๅ+df = pro.moneyflow_ind_ths(trade_date='20240927')++```++<br>+<br>+++**ๆฐๆฎ็คบไพ**++ trade_date ts_code industry close company_num net_buy_amount net_sell_amount net_amount+ 0 20240927 881267.TI ่ฝๆบ้ๅฑ 15021.70 16 490.00 46.00 3.00+ 1 20240927 881273.TI ็ฝ้ 3251.85 20 1890.00 179.00 10.00+ 2 20240927 881279.TI ๅ ไผ่ฎพๅค 5940.19 70 1120.00 94.00 17.00+ 3 20240927 881157.TI ่ฏๅธ 1407.41 50 3680.00 319.00 49.00+ 4 20240927 877137.TI ่ฝฏไปถๅผๅ 1375.49 137 2260.00 204.00 22.00+ .. ... ... ... ... ... ... ... ...+ 85 20240927 881148.TI ๆธฏๅฃ่ช่ฟ 901.87 37 190.00 20.00 -1.00+ 86 20240927 881105.TI ็ ค็ญๅผ้ๅ ๅทฅ 2271.57 34 220.00 26.00 -4.00+ 87 20240927 881169.TI ่ดต้ๅฑ 2141.46 12 240.00 32.00 -8.00+ 88 20240927 881149.TI ๅ ฌ่ทฏ้่ทฏ่ฟ่พ 1224.59 31 210.00 29.00 -7.00+ 89 20240927 877035.TI ้ถ่ก 1080.14 84 1190.00 159.00 -40.00++ [90 rows x 8 columns]diff --git "a/agent/src/skills/tushare/references/\350\241\214\344\270\232\347\273\217\346\265\216/TMT\350\241\214\344\270\232/\345\205\250\345\233\275\347\224\265\345\275\261\345\211\247\346\234\254\345\244\207\346\241\210\346\225\260\346\215\256.md" "b/agent/src/skills/tushare/references/\350\241\214\344\270\232\347\273\217\346\265\216/TMT\350\241\214\344\270\232/\345\205\250\345\233\275\347\224\265\345\275\261\345\211\247\346\234\254\345\244\207\346\241\210\346\225\260\346\215\256.md"new file mode 100644index 000000000..26d743bbd--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\241\214\344\270\232\347\273\217\346\265\216/TMT\350\241\214\344\270\232/\345\205\250\345\233\275\347\224\265\345\275\261\345\211\247\346\234\254\345\244\207\346\241\210\346\225\260\346\215\256.md"@@ -0,0 +1,58 @@+## ๅ จๅฝ็ตๅฝฑๅงๆฌๅคๆกๆฐๆฎ+----++ๆฅๅฃ๏ผfilm_record+ๆ่ฟฐ๏ผ่ทๅๅ จๅฝ็ตๅฝฑๅงๆฌๅคๆก็ๅ ฌ็คบๆฐๆฎ+้้๏ผๅๆฌกๆๅคง500๏ผๆป้ไธ้ๅถ+ๆฐๆฎๆ้๏ผ็จๆท้่ฆ่ณๅฐ120็งฏๅๆๅฏไปฅ่ฐๅ๏ผ็งฏๅ่ถๅค่ฐๅ้ขๆฌก่ถ้ซ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ann_date | str | N | ๅ ฌๅธๆฅๆ ๏ผ่ณๅฐ่พๅ ฅไธไธชๅๆฐ๏ผๆ ผๅผ๏ผYYYYMMDD๏ผๆฅๆไธ่ฟ็ปญ๏ผๅฎๆๅ ฌๅธ๏ผ+start_date | str | N | ๅผๅงๆฅๆ+end_date | str | N | ็ปๆๆฅๆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+rec_no | str | Y | ๅคๆกๅท+film_name | str | Y | ๅฝฑ็ๅ็งฐ+rec_org | str | Y | ๅคๆกๅไฝ+script_writer | str | Y | ็ผๅง+rec_result | str | Y | ๅคๆก็ปๆ+rec_area | str | Y | ๅคๆกๅฐ๏ผๅคๆกๆถ้ด๏ผ+classified | str | Y | ๅฝฑ็ๅ็ฑป+date_range | str | Y | ๅคๆกๆฅๆๅบ้ด+ann_date | str | Y | ๅคๆก็ปๆๅๅธๆถ้ด+++<br>+<br>+++**ๆฅๅฃไฝฟ็จ**++```python+pro = ts.pro_api()+#ๆ่+#pro = ts.pro_api('your token')++df = pro.film_record(start_date='20181014', end_date='20181214')+```++<br>+<br>++**ๆฐๆฎ็คบไพ**+++<img src="http://tushare.org/img/film_record.png">\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\241\214\344\270\232\347\273\217\346\265\216/TMT\350\241\214\344\270\232/\345\205\250\345\233\275\347\224\265\350\247\206\345\211\247\345\244\207\346\241\210\345\205\254\347\244\272\346\225\260\346\215\256.md" "b/agent/src/skills/tushare/references/\350\241\214\344\270\232\347\273\217\346\265\216/TMT\350\241\214\344\270\232/\345\205\250\345\233\275\347\224\265\350\247\206\345\211\247\345\244\207\346\241\210\345\205\254\347\244\272\346\225\260\346\215\256.md"new file mode 100644index 000000000..73af3b2e0--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\241\214\344\270\232\347\273\217\346\265\216/TMT\350\241\214\344\270\232/\345\205\250\345\233\275\347\224\265\350\247\206\345\211\247\345\244\207\346\241\210\345\205\254\347\244\272\346\225\260\346\215\256.md"@@ -0,0 +1,127 @@+## ๅ จๅฝๆๆๅถไฝ็ต่งๅงๅคๆกๅ ฌ็คบๆฐๆฎ+----++ๆฅๅฃ๏ผteleplay_record+ๆ่ฟฐ๏ผ่ทๅ2009ๅนดไปฅๆฅๅ จๅฝๆๆๅถไฝ็ต่งๅงๅคๆกๅ ฌ็คบๆฐๆฎ+้้๏ผๅๆฌกๆๅคง1000๏ผๆป้ไธ้ๅถ+ๆฐๆฎๆ้๏ผ็จๆท้่ฆ่ณๅฐ็งฏๅ600ๆๅฏไปฅ่ฐๅ๏ผ็งฏๅ่ถๅค่ฐๅ้ขๆฌก่ถ้ซ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+report_date | str | N | ๅคๆกๆไปฝ๏ผYYYYMM๏ผ+start_date | str | N | ๅคๆกๅผๅงๆไปฝ๏ผYYYYMM๏ผ+end_date | str | N | ๅคๆก็ปๆๆไปฝ๏ผYYYYMM๏ผ+org | str | N | ๅคๆกๆบๆ+name | str | N | ็ต่งๅงๅ็งฐ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+name | str | Y | ็ต่งๅงๅ็งฐ+classify | str | Y | ้ขๆ+types | str | Y | ไฝ่ฃ+org | str | Y | ๆฅๅคๆบๆ+report_date | str | Y | ๆฅๅคๆถ้ด+license_key | str | Y | ่ฎธๅฏ่ฏๅท+episodes | str | Y | ้ๆฐ+shooting_date | str | Y | ๆๆๆถ้ด+prod_cycle | str | Y | ๅถไฝๅจๆ+content | str | Y | ๅ ๅฎนๆ่ฆ+pro_opi | str | Y | ็็บง็ฎก็้จ้จๅคๆกๆ่ง+dept_opi | str | Y | ็ธๅ ณ้จ้จๆ่ง+remarks | str | Y | ๅคๆณจ+++<br>+<br>+++**ๆฅๅฃไฝฟ็จ**++```python+pro = ts.pro_api()++#ๆๅคๆกๆไปฝๆฅ่ฏข+df = pro.teleplay_record(report_date='201905')++df = pro.teleplay_record(start_date='201905', end_date='201906')++#ๆๅคๆกๆบๆๆฅ่ฏข+df = pro.teleplay_record(org='ไธๆตทๆฐๆๅไผ ๅช้ๅข่กไปฝๆ้ๅ ฌๅธ')++#ๆ็ต่งๅงๅ็งฐๆฅ่ฏข+df = pro.teleplay_record(name='ไธไฝ')+```++<br>+<br>++**ๆฐๆฎๆ ทไพ**++ name classify types org report_date license_key \+ 0 ๆฐๅคงๅคดๅฟๅญๅๅฐๅคด็ธ็ธโ ฃ ๅฝไปฃ้ๅฐ ๅๅง ๆกๅ ๅฝ้ ็ปๆตๆๅ้ๅขๆ้ๅ ฌๅธ 201905 ็ฒ็ฌฌ260ๅท+ 1 ไธคๅฒธ้ๅนด ๅฝไปฃ้ฝๅธ ไธ่ฌ ไนๆดฒ้ณๅๅบ็ๅ ฌๅธ 201905 ็ฒ็ฌฌ045ๅท+ 2 ๆธฉๆๅฆๅฐ ๅฝไปฃ้ฝๅธ ไธ่ฌ ๅไบฌ้ ๆณฝๆๅๅๅฑๆ้ๅ ฌๅธ 201905 ๏ผไบฌ๏ผๅญ็ฌฌ7270ๅท+ 3 ไปๅผๅงๅฐ็ฐๅจ ๅฝไปฃ้ฝๅธ ไธ่ฌ ๅไบฌๅฅฝๆ ไบๅฝฑไธๆ้ๅ ฌๅธ 201905 ๏ผไบฌ๏ผๅญ็ฌฌ13150ๅท+ 4 ้ปๅๅกไนๅฏไปฅๅพ็ ๅฝไปฃ้ฝๅธ ไธ่ฌ ๅไบฌ็ๆ ็งๆๆ้ๅ ฌๅธ 201905 ๏ผไบฌ๏ผๅญ็ฌฌ8580ๅท+ 5 ็คพๅทฅๆๅก็คพ ๅฝไปฃ้ฝๅธ ไธ่ฌ ๅไบฌๅคฉๆฒๆๅไผ ๅชๆ้ๅ ฌๅธ 201905 ๏ผไบฌ๏ผๅญ็ฌฌ07874ๅท+ 6 ๅบๆฐด็กไธน ๅฝไปฃ้ฝๅธ ไธ่ฌ ๅไบฌๅคฉๆไบฟๆบๅฝฑ่งๆๅ่กไปฝๆ้ๅ ฌๅธ 201905 ๏ผไบฌ๏ผๅญ็ฌฌ1113ๅท+ 7 ไบไธ่ตท็ๅฅณๅญฉ ๅฝไปฃ้ฝๅธ ไธ่ฌ ๅไบฌ็ฑๅฅ่บ็งๆๆ้ๅ ฌๅธ 201905 ๏ผไบฌ๏ผๅญ็ฌฌ01938ๅท+ 8 ๅนด่ฝป็ๆๅๆฅ็ธไผ ๅฝไปฃ้ฝๅธ ไธ่ฌ ๅไบฌไธป้ขไผ ๅฅๆๅไผ ๅชๆ้ๅ ฌๅธ 201905 ๏ผไบฌ๏ผๅญ็ฌฌ6101ๅท+ 9 ไบฌๆญๅคง่ฟๆฒณ ่ฟไปฃ้ฉๅฝ ไธ่ฌ ๅไบฌไธๆน่ง่พๅฝฑ่งไผ ๅชๆ้ๅ ฌๅธ 201905 ๏ผไบฌ๏ผๅญ็ฌฌ9703ๅท+ 10 ่ชๅคฉๆขฆ ๅฝไปฃๅ ถๅฎ ไธ่ฌ ๅไบฌไบฟ้ญๆน็ฅๆๅไผ ๅชๆ้ๅ ฌๅธ 201905 ๏ผไบฌ๏ผๅญ็ฌฌ13069ๅท+ 11 ่ฃๅชไบบ็ ๅฝไปฃ้ฝๅธ ไธ่ฌ ๅไบฌ็ดซ่ฉๅฝ้ ๆๅไผ ๅชๆ้ๅ ฌๅธ 201905 ๏ผไบฌ๏ผๅญ็ฌฌ08683ๅท+ 12 ็ฑๆ ๆฏ็ขๆฒนๆณผ้ข ๅฝไปฃ้ฝๅธ ไธ่ฌ ๅไบฌ็ๆ ็งๆๆ้ๅ ฌๅธ 201905 ๏ผไบฌ๏ผๅญ็ฌฌ8580ๅท+ 13 ๆตๅจ็ดซ็ฆๅ ่ฟไปฃไผ ๅฅ ไธ่ฌ ๅไบฌๅ่ฐๅ ๅผๅจฑไนๆ่ตๆ้ๅ ฌๅธ 201905 ๏ผไบฌ๏ผๅญ็ฌฌ2217ๅท+ 14 ๅคงๆตท ๅฝไปฃ้ฝๅธ ไธ่ฌ ๅไบฌๅ ๅผๆ ็ปๅฝฑ่งไผ ๅชๆ้ๅ ฌๅธ 201905 ๏ผไบฌ๏ผๅญ็ฌฌ1805ๅท+ 15 ๆตๆฒณไน้ญ ่ฟไปฃ้ฉๅฝ ไธ่ฌ ๅไบฌๅไบ้ฃๆฌๆๅไผ ๅชๆ้ๅ ฌๅธ 201905 ๏ผไบฌ๏ผๅญ็ฌฌ3814ๅท+ 16 ๅ ่ฎธๅๅฟ ๅฝไปฃ้ฝๅธ ไธ่ฌ ๆไปๆ ็ปๅฝฑ่งๆๅไผ ๅช๏ผๅไบฌ๏ผๆ้ๅ ฌๅธ 201905 ๏ผไบฌ๏ผๅญ็ฌฌ2793ๅท+ 17 ๅๅ่่ท ๅฝไปฃ้ฝๅธ ไธ่ฌ ๅไบฌๅๅไน่งๅฝฑ่งๆๅไผ ๅชๆ้ๅ ฌๅธ 201905 ๏ผไบฌ๏ผๅญ็ฌฌ08259ๅท+ 18 ๅ็ฑไบบไธๆ ทๆฅๆฑไฝ ๅฝไปฃ้ฝๅธ ไธ่ฌ ๅไบฌๆๅพท็ฟๆๅไผ ๅชๆ้ๅ ฌๅธ 201905 ๏ผไบฌ๏ผๅญ็ฌฌ6317ๅท+++ episodes shooting_date prod_cycle \+ 0 50 2019.6 3ไธชๆ+ 1 40 2019.3 10ไธชๆ+ 2 30 2020.12 4ไธชๆ+ 3 45 2019.12 18ไธชๆ+ 4 20 2019.1 3ไธชๆ+ 5 40 2019.11 24ไธชๆ+ 6 46 2019.8 12ไธชๆ+ 7 36 2019.4 5ไธชๆ+ 8 36 2019.11 5ไธชๆ+ 9 51 2019.8 9ไธชๆ+ 10 40 2019.9 6ไธชๆ+ 11 30 2019.8 7ไธชๆ+ 12 20 2019.9 3ไธชๆ+ 13 46 2019.1 12ไธชๆ+ 14 40 2019.12 6ไธชๆ+ 15 45 2019.1 12ไธชๆ+ 16 36 2019.8 3ไธชๆ+ 17 40 2019.12 3ไธชๆ+ 18 40 2020.6 18ไธชๆ++ content pro_opi \+ 0 ๅจๆฌ้จไธญๅฟซไน็ๅคงๅคดๅฟๅญไปๆง่ฟ็ๅนธ็ฆ็็ๆดป๏ผๆธฉๆ่ดคๆท็ๅด่ฃๅฆๅฆใ้ฃ่ถฃๅนฝ้ป็ๅฐๅคด็ธ็ธไธๅฆๆขๅพๅฐไผด... ๅๆๅคๆก๏ผๆฅ่ฏทๆปๅฑ็ต่งๅง็ฎก็ๅธๅ ฌ็คบใ+ 1 ๅคง้ๆ ๅฐๆฟ็ญ็ๆจ่ก๏ผๆ่ตทไบๅฐๆนพๅ่ๅฐๅคง้ๆฑ่ๅไธ็็ญๆฝฎใ้กบๅบ็ญๆฝฎ๏ผๅๆฌฃ็ถ็ญไธๆนๅฐๆนพ้ๅนดๆฅๅฐไบ... ๅๆๅคๆก๏ผๆฅ่ฏทๆปๅฑ็ต่งๅง็ฎก็ๅธๅ ฌ็คบใ+ 2 ไนๅๅนดไปฃๆซ๏ผๅ ็ถไบฒๅคฑไธ๏ผๅ ซๅฒ็่ตตๆ่ปไธๅพไธๆพๅผ่ญ่พ๏ผ่ฟๅ ฅไฝๆ กใ็ฑไบ่ช่บซๆกไปถ่พๅฅฝ๏ผ็ป่ฟๅ ๅนดๅป่ฆ... ๅๆๅคๆก๏ผๆฅ่ฏทๆปๅฑ็ต่งๅง็ฎก็ๅธๅ ฌ็คบใ+ 3 ่็ฝๅ็ณๆฎ็1985ๅนด็ๅไธๅคฉๅบ็ๅจๅไบฌไบบๆฐๅป้ขใๅๅนดๅ๏ผ่ๆฏ็็ช็ถ้้พใ่็ถๅ ๆ ๆณๆฟๅๅๅ... ๅๆๅคๆก๏ผๆฅ่ฏทๆปๅฑ็ต่งๅง็ฎก็ๅธๅ ฌ็คบใ+ 4 ้ณๅ ๅธ ๆฐ็ๆๆฐๅฐงๆฏไธๅฎถๅๅกๅบๅ็ๅๅธ๏ผ็็พๅฏ็ฑ็้ณไนไธปๆญๅฎซๆตท้ปๆฏ่ฟๅฎถๅบ็ๅธธๅฎขใๆๆฐๅฐง่ขซๅฎซๆตท้ป... ๅๆๅคๆก๏ผๆฅ่ฏทๆปๅฑ็ต่งๅง็ฎก็ๅธๅ ฌ็คบใ+ 5 ๅนฟๅทๆปจๆฑๅคงๅญฆๅทฅๅ็ฎก็็ณป็้ฉฌ่ทฏๅจๆฏไธๅๆบ็ผๅทงๅไธๆฅๅฐๆทฑๅณไธๅฎถ็คพๅทฅ็ป็ปๅฝ็คพๅทฅ๏ผ้่ฟไธๅนดๆถ้ด้ฉฌ่ทฏไป... ๅๆๅคๆก๏ผๆฅ่ฏทๆปๅฑ็ต่งๅง็ฎก็ๅธๅ ฌ็คบใ+ 6 ๅๆๅธ่ฑๆ ทๆธธๆณณ้ไธปๅ้ๅๆไธน้ๅฝนๅๅบไปป่ฏฅๅธ่ฑๆ ทๆธธๆณณ้็ไธปๆ็ป๏ผๅนถๆไธไธชๅซ็พ็พ็17ๅฒๅงๅจๅธฆ่ฟ... ๅๆๅคๆก๏ผๆฅ่ฏทๆปๅฑ็ต่งๅง็ฎก็ๅธๅ ฌ็คบใ+ 7 ้ๅฏๅๆฒๆๆกๆฏไธคไธชๆงๆ ผ่ฟฅๅผ็ๅฅณๅญฉๅดๆฏๅฏนๆนๆไบฒๅฏ็ๆๅใๆฏไธๆถไธคไบบๅ ๆฒๆๆก้ธ้็ๆงๆ ผๅ ณ็ณป็ ด่ฃ๏ผ... ๅๆๅคๆก๏ผๆฅ่ฏทๆปๅฑ็ต่งๅง็ฎก็ๅธๅ ฌ็คบใ+ 8 1980ๅนด๏ผๆฅ่ช็ฅๅฝๅคฉๅๆตทๅ็ๅ ญไธชๅนด่ฝปไบบ่ตฐ่ฟๅไธๆๅคงๅญฆ๏ผๆไธบไบๅๅฑๅๅญฆใไฝๅฐฑๅจๅคงๅญฆ็ฌฌไบๅนด๏ผๅ... ๅๆๅคๆก๏ผๆฅ่ฏทๆปๅฑ็ต่งๅง็ฎก็ๅธๅ ฌ็คบใ+ 9 ไบฌๆญๅคง่ฟๆฒณไธ็ๅ้ๅท๏ผ่ฟๅฎถ่นๅ่ดฉๅคฉๆ ๆฐไปๅๅ ดๅๆนๅธฆๅไบบๅฐๆฃๅบๆถๅไผค๏ผๅ้ๅทไปฅ็ๆค็็ฏๅกไธบ็ใ... ๅๆๅคๆก๏ผๆฅ่ฏทๆปๅฑ็ต่งๅง็ฎก็ๅธๅ ฌ็คบใ+ 10 ๅไธชไธ็บชไปฅๆฅ๏ผไปฅไปปๆฐๅไธบไปฃ่กจ็่ชๅคฉไบบ๏ผไปไปฌๅจไธญๅฝไธ็ฉทไบ็ฝ็ๅบ็กไธ๏ผ็ปๅ็ง็งๅๅท๏ผๅ ๆ้้ๅฐ้พ... ๅๆๅคๆก๏ผๆฅ่ฏทๆปๅฑ็ต่งๅง็ฎก็ๅธๅ ฌ็คบใ+ 11 ้ฟๆตๅนณ้่ๅฟซไน็็ๆดป๏ผ่ขซๅฝปๅบๆ็ ดไบใ้ฟๆตๅพ็ฅๅทฒ่ฟไธ็่ชๅทฑๅดๆๅ็ฑ็้ฟ่ๅงจๆฏ่ชๅทฑ็็ๆฏใๅฏนๆฏไบฒ... ๅๆๅคๆก๏ผๆฅ่ฏทๆปๅฑ็ต่งๅง็ฎก็ๅธๅ ฌ็คบใ+ 12 ๅๆผไธๅนด็ๅฐ็ฑณๅๅฐไบ่ชๅทฑ็่ๅฎถ่ฅฟๅฎ๏ผๅนถไธ่ฝๅพๅฅฝ็้ๅบ่ฟ้็ไธๅใๆพไบไธไธชๅคๆ็ๅทฅไฝ๏ผ้ซไธๆไฝ... ๅๆๅคๆก๏ผๆฅ่ฏทๆปๅฑ็ต่งๅง็ฎก็ๅธๅ ฌ็คบใ+ 13 1932ๅนด๏ผๆฅๆฌไบบ้ผ่ฟๅนณๆดฅ๏ผ็่ๅจๆ ๅฎซๅ ็ๆฐไปฅ็พไธ่ฎก็ๅฝๅฎๅฐ่ฝๅ ฅๆๆใ้ข้ฟๆๅนๅบๅๅฏ้ข้ฟ้ฉฌ่กก... ๅๆๅคๆก๏ผๆฅ่ฏทๆปๅฑ็ต่งๅง็ฎก็ๅธๅ ฌ็คบใ+ 14 ๅคงๅญฆไนๅข็ๅฐๆ็ดๆๆๆฆๆฆ่ชๅฐๅญฆไน ๅฐๆ็ด๏ผๅดๅ ไธบ็ถไบฒ็ๅปไธ๏ผไธญๆญไบ้ณไนไน่ทฏใๆบ็ผๅทงๅๅไธไบไน็ฑ... ๅๆๅคๆก๏ผๆฅ่ฏทๆปๅฑ็ต่งๅง็ฎก็ๅธๅ ฌ็คบใ+ 15 ๅฒๆฐๅนผๅนดๆถ๏ผไธไน็ถๆณ้ๅไนๅฆนๆณๆ็ธไพไธบๅฝ๏ผๅไธๆณๆ็ปไธบๅคซๅฆปๅนถๅๅๅ ๅ ฅๆๆฅ้ไผใๅจไธๆฌกๆๆไธญ๏ผ... ๅๆๅคๆก๏ผๆฅ่ฏทๆปๅฑ็ต่งๅง็ฎก็ๅธๅ ฌ็คบใ+ 16 2005ๅนด9ๆ๏ผไนไธญๅๅ ญ็ญ่ฟๆฅไบๅไธๅฑ้ซไธๆฐ็๏ผไฝ่ฒ็น้ฟ็ๆฑๅไบ๏ผๅๆฌข็ปๆผซ็ป็ๅฑฑไธด้๏ผๅ็งๅ จ... ๅๆๅคๆก๏ผๆฅ่ฏทๆปๅฑ็ต่งๅง็ฎก็ๅธๅ ฌ็คบใ+ 17 ๅไธชๆญฅๅ ฅ40ๅฒ็ไธญๅนด็ทๆงๅจ้ขๅฏน็ๆดปไธญ็็ง็งๅๅ๏ผๆทฑ้ทไธญๅนดๅฑๆบใ้ฉฌไธๅจๅฅๅบทไธไบไธๅๅฐๅ้ๆๅปๅ... ๅๆๅคๆก๏ผๆฅ่ฏทๆปๅฑ็ต่งๅง็ฎก็ๅธๅ ฌ็คบใ+ 18 ๅฒณๆฏใไปปๆใๆฝไธๅฎๆฏๅไฝๅจไธไธชๅฑๆชไธ็ๅฎคๅ๏ผไธไธช็ทไบบ้ฝๅฐ้ขไธด่็ซไนๅนด็ๅฐๆฅ๏ผ็ถ่ไธไธชๅคๆๆ็ ด... ๅๆๅคๆก๏ผๆฅ่ฏทๆปๅฑ็ต่งๅง็ฎก็ๅธๅ ฌ็คบใ\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\241\214\344\270\232\347\273\217\346\265\216/TMT\350\241\214\344\270\232/\345\217\260\346\271\276\347\224\265\345\255\220\344\272\247\344\270\232\346\234\210\350\220\245\346\224\266.md" "b/agent/src/skills/tushare/references/\350\241\214\344\270\232\347\273\217\346\265\216/TMT\350\241\214\344\270\232/\345\217\260\346\271\276\347\224\265\345\255\220\344\272\247\344\270\232\346\234\210\350\220\245\346\224\266.md"new file mode 100644index 000000000..16a62ecf5--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\241\214\344\270\232\347\273\217\346\265\216/TMT\350\241\214\344\270\232/\345\217\260\346\271\276\347\224\265\345\255\220\344\272\247\344\270\232\346\234\210\350\220\245\346\224\266.md"@@ -0,0 +1,144 @@+## ๅฐๆนพ็ตๅญไบงไธๆ่ฅๆถ+----++ๆฅๅฃ๏ผtmt_twincome+ๆ่ฟฐ๏ผ่ทๅๅฐๆนพTMT็ตๅญไบงไธ้ขๅๅ็ฑปไบงๅๆๅบฆ่ฅๆถๆฐๆฎใ++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+date | str | N | ๆฅๅๆ+item | str | Y | ไบงๅไปฃ็ +start_date | str | N | ๆฅๅๆๅผๅงๆฅๆ+end_date | str | N | ๆฅๅๆ็ปๆๆฅๆ++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๆ่ฟฐ+--- | ---- | ----+date | str | ๆฅๅๆ+item | str | ไบงๅไปฃ็ +op_income | str | ๆๅบฆๆถๅ ฅ++็ฑไบๆๅกๅจๅๅ๏ผๅๆฌกๆๅค่ทๅ30ไธชๆๆฐๆฎ๏ผๅ็ปญๅ้ๆญฅๅ จ้จๅผๆพ๏ผ็ฎๅๅฏๆ นๆฎๆฅๆ่ๅดๅคๆฌก่ทๅๆฐๆฎใ++**่ฐ็จไปฃ็ ็คบไพ**++```python++pro = ts.pro_api()++#่ทๅPCBๆๅบฆ่ฅๆถ+df = pro.tmt_twincome(item='8')++#่ทๅPCBๆๅบฆ่ฅๆถ๏ผ20120101-20181010๏ผ+df = pro.tmt_twincome(item='8', start_date='20120101', end_date='20181010')++```+++**ๆฐๆฎๆ ทไพ**++ date item op_income+ 0 20180731 8 35144753.0+ 1 20180629 8 30940090.0+ 2 20180531 8 30982240.0+ 3 20180430 8 30431976.0+ 4 20180331 8 29491108.0+ 5 20180227 8 24700223.0+ 6 20180131 8 32962014.0+ 7 20171229 8 32850818.0+ 8 20171130 8 34436396.0+ 9 20171031 8 33331667.0+ 10 20170930 8 34220623.0+ 11 20170831 8 32621006.0+ 12 20170731 8 30284562.0+ 13 20170630 8 29003264.0+ 14 20170531 8 28382449.0+ 15 20170428 8 27140270.0+ 16 20170331 8 29015642.0+ 17 20170224 8 26508381.0+ 18 20170124 8 26927481.0+ 19 20161230 8 29784865.0+ 20 20161130 8 31234845.0+ 21 20161031 8 30305625.0+ 22 20160930 8 30523650.0+ 23 20160831 8 30600923.0+ 24 20160729 8 29066800.0+ 25 20160630 8 27350576.0+ 26 20160531 8 27752376.0+ 27 20160429 8 26664433.0+ 28 20160331 8 27428746.0+ 29 20160226 8 22218229.0+++**ไบงๅไปฃ็ ๅ่กจ**++TSไปฃ็ | ็ฑปๅซๅ็งฐ+--- | ----+1 | PC+2 | NB+3 | ไธปๆบๆฟ+4 | ๅฐๅท็ต่ทฏๆฟ+5 | IC่ฝฝๆฟ+6 | PCB็ป่ฃ+7 | ่ฝฏๆฟ+8 | PCB+9 | PCBๅๆ+10 | ้็ฎๅบๆฟ+11 | ็ป็บค็บฑๅธ+12 | FCCL+13 | ๆพ็คบๅก+14 | ็ปๅพๅก+15 | ็ต่งๅก+16 | ๆณๅทฅไธ็ต่+17 | POS+18 | ๅทฅไธ็ต่+19 | ๅ ็ตIO+20 | ็่งๅจ+21 | ๆซๆๅจ+22 | PCๅจ่พน+23 | ๅจๅญๅชไฝ+24 | ๅ ็ข+25 | ็กฌ็็ฃ็+26 | ๅๅ ไบๆไฝ+27 | ๅคช้ณ่ฝ+28 | LCD้ขๆฟ+29 | ่ๅ ๆจก็ป+30 | LCDๅๆ+31 | LCDๅ ถๅฎ+32 | ่งฆๆง้ขๆฟ+33 | ็ๆง็ณป็ป+34 | ๅ ถๅฎๅ ็ต+35 | ็ตๅญ้ถ็ปไปถ+36 | ไบๆไฝๆดๆต+37 | ่ฟๆฅๅจ+38 | ็ตๆบไพๅบๅจ+39 | ๆบๅฃณ+40 | ่ขซๅจๅ ไปถ+41 | ็ณ่ฑๅ ไปถ+42 | 3Cไบๆฌก็ตๆบ+43 | ็ฝ่ทฏ่ฎพๅค+44 | ๆฐๆฎๆบ+45 | ็ฝ่ทฏๅก+46 | ๅๅฏผไฝ+47 | ๆถๅๅถ้+48 | ICๅฐๆต+49 | ็น็จIC+50 | ่ฎฐๅฟไฝๆจก็ป+51 | ๆถๅๆๆ+52 | IC่ฎพ่ฎก+53 | ICๅ ็ฝฉ+54 | ็ตๅญ่ฎพๅค+55 | ๆๆบ+56 | ้่ฎฏ่ฎพๅค+57 | ็ตไฟกไธ+58 | ็ฝ่ทฏๆๅก+59 | ๅซๆ้่ฎฏ+60 | ๅ ็บค้่ฎฏ+61 | 3C้่ทฏ+62 | ๆถ่ดนๆง็ตๅญ+63 | ็ ง็ธๆบ+64 | ่ฝฏไปถๆๅก+65 | ็ณป็ปๆดๅ\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\241\214\344\270\232\347\273\217\346\265\216/TMT\350\241\214\344\270\232/\345\217\260\346\271\276\347\224\265\345\255\220\344\272\247\344\270\232\346\234\210\350\220\245\346\224\266\346\230\216\347\273\206.md" "b/agent/src/skills/tushare/references/\350\241\214\344\270\232\347\273\217\346\265\216/TMT\350\241\214\344\270\232/\345\217\260\346\271\276\347\224\265\345\255\220\344\272\247\344\270\232\346\234\210\350\220\245\346\224\266\346\230\216\347\273\206.md"new file mode 100644index 000000000..532ccae55--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\241\214\344\270\232\347\273\217\346\265\216/TMT\350\241\214\344\270\232/\345\217\260\346\271\276\347\224\265\345\255\220\344\272\247\344\270\232\346\234\210\350\220\245\346\224\266\346\230\216\347\273\206.md"@@ -0,0 +1,1053 @@+## ๅฐๆนพ็ตๅญไบงไธๆ่ฅๆถๆ็ป+----++ๆฅๅฃ๏ผtmt_twincomedetail+ๆ่ฟฐ๏ผ่ทๅๅฐๆนพTMT่กไธไธๅธๅ ฌๅธๅ็ฑปไบงๅๆๅบฆ่ฅๆถๆ ๅตใ++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+date | str | N | ๆฅๅๆ+item | str | N | ไบงๅไปฃ็ +symbol | str | N | ๅ ฌๅธไปฃ็ +start_date | str | N | ๆฅๅๆๅผๅงๆฅๆ+end_date | str | N | ๆฅๅๆ็ปๆๆฅๆ+source | str | N | None++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๆ่ฟฐ+--- | ---- | ----+date | str | ๆฅๅๆ+item | str | ไบงๅไปฃ็ +symbol | str | ๅ ฌๅธไปฃ็ +op_income | str | ๆๅบฆ่ฅๆถ+consop_income | str | ๅๅนถๆๅบฆ่ฅๆถ๏ผ้ป่ฎคไธๅฑ็คบ๏ผ++**ๆฐๆฎ่ฐ็จ็คบไพ**++```python++pro = ts.pro_api()++#่ทๅๅฐๆนพๆพไธ็ตๅญPCB็ๆๅบฆ่ฅๆถๆฐๆฎ+df = pro.tmt_twincomedetail(item='8', symbol='6156')++```++**ๆฐๆฎ็คบไพ**++ date item symbol op_income+ 0 20180731 8 6156 429618.0+ 1 20180629 8 6156 367786.0+ 2 20180531 8 6156 415715.0+ 3 20180430 8 6156 395857.0+ 4 20180331 8 6156 405173.0+ 5 20180227 8 6156 252961.0+ 6 20180131 8 6156 472289.0+ 7 20171229 8 6156 408431.0+ 8 20171130 8 6156 390715.0+ 9 20171031 8 6156 298781.0+ 10 20170930 8 6156 367127.0+ 11 20170831 8 6156 396217.0+ 12 20170731 8 6156 373196.0+ 13 20170630 8 6156 380075.0+ 14 20170531 8 6156 443130.0+ 15 20170428 8 6156 426106.0+ 16 20170331 8 6156 418031.0+ 17 20170224 8 6156 298844.0+ 18 20170124 8 6156 327690.0+ 19 20161230 8 6156 431934.0+ 20 20161130 8 6156 417424.0+ 21 20161031 8 6156 362774.0+ 22 20160930 8 6156 392458.0+ 23 20160831 8 6156 408301.0+ 24 20160729 8 6156 293324.0+ 25 20160630 8 6156 329383.0+ 26 20160531 8 6156 323873.0+ 27 20160429 8 6156 372231.0+ 28 20160331 8 6156 388029.0+ 29 20160226 8 6156 225912.0+++**ๅฐๆนพๅ ฌๅธไปฃ็ **++symbol | name+--|--+1333 | ๆฉๅพๅฉ+1336 | ๅฐ็ฟฐ+1471 | ้ฆๅฉ+1569 | ๆปจๅท+1582 | ไฟก้ฆ+1585 | ้ ้+1595 | ๅทๅฎ+1785 | ๅ ๆด็ง+1815 | ๅฏไน+2059 | ๅทๆน+2301 | ๅ ๅฎ็ง+2302 | ไธฝๆญฃ+2303 | ่็ต+2305 | ๅ จๅ+2308 | ๅฐ่พพ็ต+2312 | ้ๅฎ+2313 | ๅ้+2314 | ๅฐๆฌ+2315 | ็ฅ่พพ็ต่+2316 | ๆฅ ๆข็ต+2317 | ้ธฟๆตท+2321 | ไธ่ฎฏ+2323 | ไธญ็ฏ+2324 | ไปๅฎ+2327 | ๅฝๅทจ+2328 | ๅนฟๅฎ+2329 | ๅๆณฐ+2330 | ๅฐ็งฏ็ต+2331 | ็ฒพ่ฑ+2332 | ๅ่ฎฏ+2337 | ๆบๅฎ+2338 | ๅ ็ฝฉ+2340 | ๅ ็ฃ+2342 | ่็ฝ+2344 | ๅ้ฆ็ต+2345 | ๆบ้ฆ+2347 | ่ๅผบ+2349 | ้ผๅพท+2351 | ้กบๅพท+2352 | ไฝณไธ่พพ+2353 | ๅฎๆฃ+2354 | ้ธฟๅ+2355 | ๆฌ้น+2356 | ่ฑไธ่พพ+2357 | ๅ็ก+2359 | ๆ็ฝ้จ+2360 | ่ด่+2362 | ่ๅคฉ+2363 | ็ฝ็ป+2364 | ไผฆ้ฃ+2365 | ๆ็+2367 | ?dๅ+2368 | ้ๅ็ต+2369 | ่ฑ็+2373 | ้ๆฆ่ก+2374 | ไฝณ่ฝ+2375 | ๆบๅฎ+2376 | ๆๅ+2377 | ๅพฎๆ+2379 | ็ๆฑ+2380 | ่นๅ +2382 | ๅนฟ่พพ+2383 | ๅฐๅ ็ต+2385 | ็พคๅ +2387 | ็ฒพๅ +2388 | ๅจ็+2390 | ไบ่พฐ+2392 | ๆญฃๅดด+2393 | ไบฟๅ +2395 | ็ ๅ+2397 | ๅ้+2399 | ๆ ๆณฐ+2401 | ๅ้ณ+2402 | ๆฏ ๅ+2404 | ๆฑๅ+2405 | ๆตฉ้ซ+2406 | ๅฝ็ก+2408 | ๅไบ็ง+2409 | ๅ่พพ+2412 | ไธญๅ็ต+2413 | ็ฏ็ง+2414 | ็ฒพๆ+2415 | ้ฉๆฐ+2417 | ๅๅ+2419 | ไปฒ็ฆ+2420 | ๆฐๅทจ+2421 | ๅปบๅ+2423 | ๅบ็บฌ+2424 | ้ๅ+2425 | ๆฟๅฏ+2426 | ้ผๅ +2427 | ไธๅ็ต+2428 | ๅ ดๅค+2429 | ้ญๆบ็ง+2430 | ็ฟๅค+2431 | ่ๆ+2433 | ไบ็็ต+2434 | ็ปๆ+2436 | ไผ่ฏ ็ต+2438 | ็ฟ่+2439 | ็พๅพ+2440 | ๅคช็ฉบๆขญ+2441 | ่ถ ไธฐ+2442 | ๆฐ็พ้ฝ+2444 | ๅ ๅฒ+2448 | ๆถ็ต+2449 | ไบฌๅ ็ตๅญ+2450 | ็ฅ่+2451 | ๅ่ง+2453 | ๅ็พค+2454 | ่ๅ็ง+2455 | ๅ จๆฐ+2456 | ๅฅๅๆฐ+2457 | ้ฃๅฎ+2458 | ไน้+2459 | ๆฆๅ+2460 | ๅปบ้+2461 | ๅ ็พค้ท+2462 | ่ฏๅพ็ต+2464 | ็็ซ+2465 | ไธฝๅฐ+2466 | ๅ ่ฅฟ็ต+2467 | ๅฟๅฃ+2468 | ๅ็ป+2471 | ่ต้+2472 | ็ซ้็ต+2474 | ๅฏๆ+2475 | ๅๆ+2476 | ้็ฅฅ+2477 | ็พ้็ต+2478 | ๅคงๆฏ+2480 | ๆฆ้ณ็ง+2481 | ๅผบ่+2482 | ่ฟๅฎ+2483 | ็พๅฎน+2484 | ๅธๅ+2485 | ๅ ่ตซ+2486 | ไธ่ฏ+2488 | ๆฑๅนณ+2489 | ็่ฝฉ+2491 | ๅ็ฅฅๅ จ+2492 | ๅๆฐ็ง+2493 | ๆฌๅ+2495 | ๆฎๅฎ+2496 | ๅ่ถ+2497 | ๆกๅฉ็ต+2498 | ๅฎ่พพ็ต+2499 | ไธ่ด+3002 | ๆฌงๆ ผ+3003 | ๅฅๅๅ ด+3005 | ็ฅๅบ+3006 | ๆถ่ฑช็ง+3008 | ๅคง็ซๅ +3010 | ๅ็ซ+3011 | ไป็+3013 | ๆ้ญ็ต+3014 | ่้ณ+3015 | ๅ จๆฑ+3016 | ๅๆถ+3017 | ๅฅ้+3018 | ๅๅผ+3019 | ไบๅ +3021 | ้ธฟๅ+3022 | ๅจๅผบ็ต+3023 | ไฟก้ฆ+3024 | ๅฟๅฃฐ+3025 | ๆ้+3026 | ็ฆพไผธๅ +3027 | ็่พพ+3028 | ๅขไฝ ๅผบ+3029 | ้ถๅฃน+3030 | ๅพทๅพ+3031 | ไฝฐ้ธฟ+3032 | ไผ่ฎญ+3033 | ๅจๅฅ+3034 | ่ๅ+3035 | ๆบๅ+3036 | ๆๆ+3037 | ๆฌฃๅ ด+3038 | ๅ จๅฐ+3041 | ๆฌๆบ+3042 | ๆถๆ+3043 | ็ง้ฃ+3044 | ๅฅ้ผ+3045 | ๅฐๆนพๅคง+3046 | ๅปบๆฃ+3047 | ่ฎฏ่+3048 | ็็ป+3049 | ๅ้ซ+3050 | ้ฐๅพท+3051 | ๅ็น+3054 | ็ซไธๅฉ+3055 | ่ๅ็ง+3057 | ไน้ผ+3058 | ็ซๅพท+3059 | ๅๆถ็ง+3060 | ้ญๅผ+3062 | ๅปบๆฑ+3066 | ๆๆดฒ+3067 | ๅ จๅ+3071 | ๅ็ฆง+3073 | ๅฏๆๅฎไธ+3078 | ไพจๅจ+3081 | ่ไบ+3085 | ๆฐ้ถๅฎ+3088 | ่พ่ฎฏ+3089 | ๅ ็ฌ+3090 | ๆฅ็ต่ดธ+3092 | ้ธฟ็ก+3093 | ๆธฏๅปบ+3094 | ่ๆฐ+3095 | ๅๆ+3097 | ๆๆกฃ+3105 | ็จณๆ+3114 | ๅฅฝๅพท+3115 | ๅฎๅฒๆ+3117 | ๅนด็จ+3122 | ็ฌๆณ+3128 | ๅ้+3130 | ไธ้ถๅ+3131 | ๅผๅก+3138 | ่็ป+3141 | ๆถๅฎ+3144 | ๆฐๆฌ็ง+3147 | ๅคง็ปผ+3149 | ๆญฃ่พพ+3150 | ้ฐๅฎ+3152 | ๆฏๅพท+3158 | ๅๅฎ+3163 | ๆณข่ฅๅจ+3168 | ไผ็ฆ็ง+3169 | ไบไฟก+3178 | ๅ ฌๅ+3188 | ้ซ้พ่ พ+3189 | ๆฏ็ก+3191 | ๅ่ฟ+3202 | ๆกฆๆ+3206 | ๅฟไธฐ+3207 | ่่+3209 | ๅ จ็ง+3211 | ้กบ่พพ+3213 | ่่ฎฏ+3217 | ไผ็พค+3219 | ๅๅผบ+3221 | ๅฐๅ็ก+3224 | ไธ้กพ+3227 | ๅ็ธ+3228 | ้ไธฝ็ง+3229 | ๆ้+3230 | ้ฆๆ+3231 | ็บฌๅ+3232 | ๆฑๆท+3234 | ๅ ็ฏ+3236 | ๅๅฆ+3257 | ่นๅ ็ต+3259 | ้ซๅ+3260 | ๅจๅ+3264 | ๆฌฃ้จ+3265 | ๅฐๆ็ง+3268 | ๆตทๅพทๅจ+3272 | ไธ็ก+3276 | ๅฎ็ฏ+3285 | ๅพฎ็ซฏ+3287 | ๅนฟๅฏฐ็ง+3288 | ็นๆถ+3289 | ๅฎ็น+3290 | ไธๆตฆ+3294 | ่ฑๆต+3296 | ่ๅพท+3297 | ๆญ็น+3299 | ๅธๆฑ+3303 | ๅฒฑๆฃฑ+3305 | ๅ่ดธ+3306 | ้ผๅคฉ+3308 | ่ๅพท+3310 | ไฝณ้ข+3311 | ้ณๆ+3312 | ๅผๅฟ่ก+3313 | ๆๆ+3317 | ๅฐผๅ ๆฃฎ+3321 | ๅๆณฐ+3322 | ๅปบ่็ต+3323 | ๅ ็พ่ฃ+3324 | ๅ้ธฟ+3325 | ๆญๅ+3332 | ๅนธๅบท+3338 | ๆณฐ็ก+3339 | ๆณฐ่ฐท+3349 | ๅฎๅพท+3354 | ๅพ่+3356 | ๅฅๅถ+3357 | ๅฐๅบ็ง+3360 | ๅฐ็ซ+3362 | ๅ ่ฟๅ +3363 | ไธ่ฏ+3372 | ๅ ธ่+3373 | ็ญๆ+3374 | ็ฒพๆ+3376 | ๆฐๆฅๅ ด+3377 | ๅฅๆ ผ+3380 | ๆๆณฐ+3383 | ๆฐไธ็บช+3388 | ๅด่ถ็ต+3390 | ๆญ่ฝฏ+3391 | ไฝณๅพ+3402 | ๆฑ็ง+3406 | ็ๆถๅ +3413 | ไบฌ้ผ+3416 | ่็จ็ต+3419 | ๅ่ฃ+3428 | ๅ ็ฟ็ง+3429 | ๅฝฆ้ณ+3431 | ้ฟๅคฉ+3432 | ๅฐ็ซฏ+3434 | ๅฒๅบ+3437 | ่ฃๅ+3438 | ็ฑปๆฏ็ง+3441 | ่ไธๅ +3443 | ๅๆ+3444 | ๅฉๆบ+3450 | ่้ง+3452 | ็้+3454 | ๆถ็ฟ+3455 | ็ฑ็ฐ+3465 | ็ฅฅไธ+3466 | ่ดๆฏ+3479 | ๅฎๅค+3481 | ็พคๅ+3483 | ๅ่ด+3484 | ๅดง่ พ+3485 | ๅไธฐ+3490 | ๅไบ+3491 | ๅ่พพ็ง+3492 | ้ฟ็+3494 | ่ฏ็ +3498 | ้ณ็จ+3499 | ็ฏๅคฉ็ง+3501 | ็ปด็น+3504 | ๆฌๆๅ +3508 | ไฝ้+3511 | ็ฝ็+3512 | ็้พ+3514 | ๆฑๆถ+3515 | ๅๆ+3516 | ไบๅธๆฌง+3518 | ๆ่ พ+3519 | ็ปฟ่ฝ+3520 | ๆฏ็ปด+3521 | ้ธฟ็ฟ+3522 | ๅพก้กถ+3523 | ่ฟ่พ+3526 | ๅก็ฒ+3527 | ่็งฏ+3528 | ๅฎ้ฉฐ+3529 | ๅๆบ+3530 | ๆถ็ธๅ +3531 | ๅ ็+3532 | ๅฐ่็ง+3533 | ๅๆณฝ+3535 | ๆถๅฝฉ็ง+3536 | ่ฏๅ+3537 | ๅ ก่พพ+3540 | ๆ่ถ+3541 | ่ฅฟๆ+3543 | ๅทๅทง+3545 | ๆฆๆณฐ+3548 | ๅ ๅฉ+3550 | ่้ข+3551 | ไธ็ฆพ+3552 | ๅ่ด+3555 | ้้น+3556 | ็ฆพ็ไบ+3557 | ๅๅจ+3558 | ็ฅๅ+3561 | ๅ้ณๅ ็ต+3562 | ้กถๆถ็ง+3563 | ็งๅพท+3564 | ๅ ถ้ณ+3566 | ๅคช้ณๅ +3567 | ้ธๆ+3570 | ๅคงๅข+3576 | ๆฐๆฅๅ +3577 | ๆณๆ ผ+3579 | ๅฐๅฟ+3580 | ๅๅจ็ง+3581 | ๅ็ฃ+3583 | ่พ่+3585 | ่่ด+3587 | ้ณๅบท+3588 | ้ๅ+3591 | ่พ็ฌๆฃฎ+3592 | ็้ผ+3593 | ๅ้ญ+3594 | ็ฃไปช+3595 | ๅฑฑๅคชๅฃซ+3596 | ๆบๆ+3597 | ๆ ๅ ด+3601 | ๅๆบ+3603 | ๅปบ็ฅฅๅฝ้+3605 | ๅฎ่ด+3607 | ่ฐทๅดง+3609 | ไธๆ+3611 | ้ผ็ฟฐ+3615 | ๅฎๅฏ+3617 | ็กๅคฉ+3622 | ๆดๅ+3623 | ๅฏๆถ้+3624 | ๅ ้ข+3625 | ่ฅฟ่+3627 | ๅไฟก็ง+3628 | ็ๆญฃ+3629 | ๅฐๅฟๅผๅ+3630 | ๆฐ้็ง+3631 | ๆๆฅ+3632 | ็ ๅค+3633 | ไบๅ +3642 | ้ช็ ็ต+3644 | ๅๅ็ง+3645 | ่พพ่ฟ+3646 | ่พๆฉ็น+3652 | ็ฒพ่+3653 | ๅฅ็ญ+3659 | ็พ่พฐ+3661 | ไธ่ฏ-KY+3663 | ้ซ็ง+3664 | ๅฎ็-KY+3665 | ่ดธ่-KY+3666 | ๅ ่+3669 | ๅๅฑ+3672 | ๅบท่่ฎฏ+3673 | TPK-KY+3674 | ๅบท่ฎฏ+3675 | ๅพทๅพฎ+3678 | ่ไบซ+3679 | ๆฐ่ณๅ+3680 | ๅฎถ็ป+3682 | ไบๅคช็ต+3684 | ่ฃๆ+3685 | ๅ ๅ็ฒพๅฏ+3686 | ่พพ่ฝ+3688 | ๅ็ซๆท+3689 | ๆถๅพท+3691 | ็ก็ฆพ+3693 | ่ฅ้ฆ+3694 | ๆตทๅ+3697 | F-ๆจๆ+3698 | ้่พพ+3701 | ๅคงไผๆง+3702 | ๅคง่ๅคง+3704 | ๅๅคๆง+3706 | ็ฅ่พพ+3707 | ๆฑ็ฃ+3709 | ้ซ่ๅคงๆๆง+3710 | ่ฟๅฑๆๆง+3711 | ๆฅๆๅ ๆๆง+3712 | ๆฐธๅดดๆๆง+4537 | ๆญไธ+4542 | ็งๅณค+4545 | ้ญ้ฐ+4554 | ๆฉ็+4729 | ่ง่+4760 | ๅคๅฏ+4903 | ่ๅ ้+4904 | ่ฟไผ+4905 | ๅฐ่็ต+4906 | ๆญฃๆ+4908 | ๅ้ผ+4909 | ๆฐๅคๅ ด+4912 | ่ๅพทๆง่ก-KY+4915 | ่ดไผธ+4916 | ไบๆฌฃ็ง+4919 | ๆฐๅ+4921 | ๅฎ้ณ+4923 | ๅๅฃซ+4924 | ๆฌฃๅ-KY+4925 | ๆบๅพฎ+4927 | ๆณฐ้ผ-KY+4931 | ๆฐ็ๅ+4933 | ๅ่พ+4934 | ๅคชๆ+4935 | ่ๆ-KY+4938 | ๅ็ก+4939 | ไบ็ต+4942 | ๅๅฝฐ+4943 | ๅบทๆง-KY+4944 | ๅ ่ฟ+4947 | ๆๅฎ-KY+4949 | ๆๆ+4951 | ็ฒพๆ็ง+4952 | ๅ้+4953 | ็บฌ่ฝฏ+4956 | ๅ ้+4958 | ่ป้ผ-KY+4960 | ่ฏ็พๆ+4961 | ๅคฉ้ฐ+4966 | ่ฐฑ็-KY+4967 | ๅ้จ+4968 | ็ซ็งฏ+4971 | IET-KY+4972 | ๆฑค็ณ็ งๆ+4973 | ๅนฟ้ข+4974 | ไบๆณฐ+4976 | ไฝณๅ+4977 | ไผ่พพ-KY+4979 | ๅๆๅ +4980 | ไฝ่ป+4984 | ็ง็บณ-KY+4987 | ็ง่ฏ+4989 | ่ฃ็ง+4991 | ็ฏๅฎ-KY+4994 | ไผ ๅฅ+4995 | ๆถ่พพ+4999 | ้ซ็ฆพ+5201 | ๅฏๅซ+5202 | ๅๆฐ+5203 | ่ฎฏ่ฟ+5205 | ไธญ่+5209 | ๆฐ้ผ+5210 | ๅฎ็ก+5211 | ่ๆฌ+5212 | ๅ็ฝ+5215 | ็งๅ-KY+5216 | ไผ็ฏ+5220 | ไธ่พพๅ ็ต+5222 | ๅ จ่ฎฏ+5223 | ๅฎๅ-KY+5225 | ไธ็ง-KY+5227 | ็ซๅฏ-KY+5228 | ้ฐ้+5230 | ้ท็ฌๅ ๅ ๅญฆ+5233 | ๆ้+5234 | ่พพๅ ดๆๆ+5240 | ๅปบ่ พ+5243 | ไน็-KY+5244 | ๅผๅฏ+5245 | ๆบๆถ+5248 | ๆฏไผ+5251 | ๅคฉ้บ็ต+5255 | ็พๆก+5256 | ้ๆท+5258 | ่นๅ ก+5259 | ๆธ ๆ+5262 | ็ซ่พพ+5264 | ้ ่-KY+5267 | ้พ็ฟฉ+5269 | ็ฅฅ็ก+5271 | ็ด้+5272 | ็ฌ็ง+5274 | ไฟก้ช+5277 | ่ณๅคฉ+5281 | ๅคงๅณก่ฐท-KY+5283 | ็ฆพ่็ก+5285 | ็้+5289 | ๅฎ้ผ+5291 | ้ๅ+5294 | ๆท้ณ็น+5297 | ๅนฟๅ+5299 | ๆฐๅ+5302 | ๅคชๆฌฃ+5304 | ้ผๅ่พพ+5305 | ๆฆๅ+5309 | ็ณป็ป็ต+5310 | ๅคฉๅ+5314 | ไธ็บช+5315 | ๅ ่+5317 | ๅฏ็พ+5321 | ๅ้จ+5328 | ๅๅฎน+5340 | ๅปบ่ฃ+5344 | ็ซๅซ+5345 | ๅคฉๆฌ+5347 | ไธ็+5348 | ็ณป้+5349 | ๅ ไธฐ+5351 | ้ฐๅ+5353 | ๅฐๆ+5355 | ไฝณๆป+5356 | ๅ็+5371 | ไธญๅ ็ต+5381 | ๅๆญฃ+5383 | ้ๅฉ+5386 | ้ไบ+5388 | ไธญ็ฃ+5392 | ๅบๅ+5398 | ๆ ๅบท็ๅป+5403 | ไธญ่ฒ+5410 | ๅฝไผ+5425 | ๅฐๅ+5426 | ๆฏๅ+5432 | ่พพๅจ+5434 | ๅด่ถ+5438 | ไธๅ+5439 | ้ซๆ+5443 | ๅ่ฑช+5450 | ๅฎ่้+5452 | ไฝถไผ+5457 | ๅฎฃๅพท+5460 | ๅๅ+5464 | ้ๅฎ+5465 | ๅฏ้ช+5468 | ๅฏ้ฐ+5469 | ็ๅฎๅ+5471 | ๆพ็ฟฐ+5474 | ่ชๆณฐ+5475 | ๅพทๅฎ+5480 | ็ป็+5481 | ๆฐๅ+5483 | ไธญ็พๆถ+5484 | ๆ งๅ+5487 | ้ๆณฐ+5488 | ๆพๆฎ+5489 | ๅฝฉๅฏ+5490 | ๅไบจ+5493 | ไธ่+5498 | ๅฏๅดด+5536 | ๅฃๆ+6103 | ๅ้ฆ+6104 | ๅๆ+6108 | ็ซๅฝ+6109 | ไบๅ +6112 | ่็ก+6113 | ไบ็ฝ+6114 | ไน ๅจ+6115 | ้่+6116 | ๅฝฉๆถ+6117 | ่ฟๅนฟ+6118 | ๅปบ่พพ+6120 | ่พพ่ฟ+6121 | ๆฐๆฎ+6123 | ไธๅฅ+6124 | ไธๅผบ+6125 | ๅนฟ่ฟ+6126 | ไฟก้ณ+6127 | ไน่ฑช+6128 | ไธ็ฆ+6129 | ๆฎ่ฏ+6131 | ๆ ๅ +6133 | ้ๆกฅ+6134 | ไธๆญ+6136 | ๅฏๅฐ็น+6138 | ่่พพ+6139 | ไบ็ฟ+6140 | ่ฎฏ่พพ+6141 | ๆๆฟ+6142 | ๅๅฒ+6143 | ๆฏๆ+6145 | ๅฒๆฐธ+6146 | ่ๅ ด+6147 | ้ข้ฆ+6148 | ้ช ๅฎ่ต+6150 | ๆผ่ฎฏ+6151 | ๆไผฆ+6152 | ็พไธ+6153 | ๅ่็+6154 | ้กบๅ+6155 | ้งๅฎ+6156 | ๆพไธ+6158 | ็ฆพๆ+6160 | ๆฌฃๆ+6161 | ๆทๆณข+6163 | ๅ็ต็ฝ+6164 | ๅๅ ด+6165 | ๆทๆณฐ+6166 | ๅๅ+6167 | ไน ๆญฃ+6168 | ๅฎ้ฝ+6170 | ็ปๆฏ+6172 | ไบไบฟ+6173 | ไฟกๆ็ต+6174 | ๅฎๆฃ+6175 | ็ซๆฆ+6176 | ็ไปช+6182 | ๅๆถ+6183 | ๅ ณ่ดธ+6185 | ๅธ็ฟ+6187 | ไธๆถฆ+6188 | ๅนฟๆ+6189 | ไธฐ่บ+6190 | ไธๆณฐ็ง+6191 | ็ฒพๆ็ง+6192 | ๅทจ่ทฏ+6194 | ่ฒๅฏ+6196 | ๅธๅฎฃ+6197 | ไฝณๅฟ ็ช+6198 | ๅๆณฐ+6201 | ไบๅผ็ต+6202 | ็็พค+6203 | ๆตท้ต็ต+6204 | ่พๅ+6205 | ่ฏ ๆฌฃ+6206 | ้ฃๆท+6207 | ้ท็ง+6208 | ๆฅๆฌ+6209 | ไปๅฝๅ +6210 | ๅบ็+6213 | ่่+6214 | ็ฒพ่ฏ+6215 | ๅๆคฟ+6216 | ๅฑ ๆ+6217 | ไธญๆข้+6218 | ่ฑชๅ+6220 | ๅฒณไธฐ+6221 | ๆๆณฐ+6222 | ไธๆฌ+6223 | ๆบ็ฝ+6224 | ่้ผ+6225 | ๅคฉ็+6226 | ๅ ้ผ+6227 | ่็บถ+6228 | ๅ จ่ฐฑ+6229 | ็ ้+6230 | ่ถ ไผ+6231 | ็ณปๅพฎ+6233 | ๆบ็+6234 | ้ซไพจ+6235 | ๅๅญ+6237 | ้ช ่ฎฏ+6238 | ่ไธฝ+6239 | ๅๆ+6240 | ๆพๅฒ+6241 | ๆ้ๅฑ+6243 | ่ฟ ๆฐ+6244 | ่่ฟช+6245 | ็ซ็ซฏ+6246 | ๅฐ้พ+6247 | ๆท่ช็ต+6251 | ๅฎ้ข+6257 | ็ฝๆ ผ+6259 | ็พๅพฝ+6261 | ไน ๅ +6263 | ๆฎ่ฑๅพท+6265 | ๆนๅๆถ+6266 | ๆณฐๅ+6269 | ๅฐ้ก+6270 | ๅๅพฎ+6271 | ๅๆฌฃ็ต+6272 | ้ช ๅ+6274 | ๅฐ็ฟ+6275 | ๅ ๅฑฑ+6276 | ๅฎ้ๅ +6277 | ๅฎๆญฃ+6278 | ๅฐ่กจ็ง+6279 | ่ก่ฟ+6281 | ๅ จๅฝ็ต+6282 | ๅบท่+6283 | ๆทณๅฎ+6284 | ไฝณ้ฆ+6285 | ๅฏๆฃ+6287 | ๅ ้+6288 | ่ๅ+6289 | ๅไธ+6290 | ่ฏ็ปด+6291 | ๆฒไบจ+6292 | ่ฟ ๅพท+6298 | ๅดดๅผบ+6403 | ็พค็ป+6404 | ้่ฎฏ-KY+6405 | ๆฆๅ+6407 | ็ธไบ+6409 | ๆญ้ผ+6411 | ๆถ็ฑ+6412 | ็พค็ต+6414 | ๆกฆๆฑ+6415 | ็ฝๅ-KY+6416 | ็็ฅบ็ต้+6417 | ้ฆไพจ+6418 | ๅๅ+6419 | ไบฌๆจ็ง+6422 | ๅ่-KY+6423 | ไบฟ่ๅพ+6425 | ๆๅ+6426 | ็ปๆฐ+6431 | ๅ ไธฝ-KY+6432 | ไปๅฑ็ง+6434 | ่พพ่พๅ ็ต+6435 | ๅคงไธญ+6438 | ่ฟ ๅพ+6441 | ๅนฟ้ญ+6442 | ๅ ๅฃ+6443 | ๅ ๆถ+6449 | ้ฐ้ฆ+6451 | ่ฎฏ่ฏ-KY+6456 | GIS-KY+6457 | ็ดๅบท+6462 | ็ฅ็พ+6465 | ๅจๆถฆ+6470 | ๅฎๆบ+6474 | ๅ่ฑซๅฎ+6475 | ๅฒฑ็+6477 | ๅฎ้+6485 | ็นๅบ+6486 | ไบๅจ+6488 | ็ฏ็ๆถ+6489 | ๅพทๆถ+6490 | ๅๅ็ง+6494 | ไน้ฝ+6498 | ไน ็ฆพๅ +6510 | ็ฒพๆต+6511 | ็ปฟๆ+6512 | ๅฏๅ็ต+6514 | ่ฎ็น-KY+6516 | ๅคๅดด+6525 | ๆทๆ-KY+6529 | ็ ้ผ+6530 | ๅๅจ+6531 | ็ฑๆฎ+6532 | ็่+6533 | ๆถๅฟ็ง+6536 | ็กไธฐ+6538 | ไปๅ+6545 | ๆๅ+6548 | ้ฟๅ็ง+6552 | ๆๅ็ต+6555 | ่ฃ็ญ+6556 | ่ๅ+6558 | ๅ ด่ฝ้ซ+6559 | ็ ๆถ+6560 | ๆฌฃๆฎ็ฝ+6561 | ๆฏๆน+6565 | ็ฉ่+6568 | ๅฎ่ง+6570 | ็ปด็ฐ+6573 | ่นๆฌ-KY+6577 | ๅฒไธฐ+6579 | ็ ๆฌ+6584 | ๅไฟๅฝ้+6588 | ไธๅ ธๅ ็ต+6590 | ๆฎ้ธฟ+6591 | ๅจๅ-KY+6593 | ๅฐๆนพ้ญๆฟ+6594 | ๅฑๆฑ็ง+6597 | ็ซ่ฏ+6599 | ๆฎ่พพ+6613 | ๆไบฟ+6638 | ๆฒ ๅฃ+6640 | ๅๅ+6642 | ๅฏ่ด+6643 | M31+6648 | ๆฏๅ ถๅคง+6651 | ๅ จๅฎๆ+6653 | ๅ่ดธ+6654 | ๅคฉๆญฃๅฝ้+6664 | ็พค็ฟ+6667 | ไฟก็ด+6668 | ไธญๆฌๅ +6669 | ็บฌ้ข+6672 | ่ พ่พ็ตๅญ-KY+6673 | ๅ่ฏ+6674 | ้ๅฏถ็งๆ+6679 | ้ฐๅคช็งๆ+6680 | ้ซๅ็ตๅญ+6681 | ๅฎๆๆๆฏ+6682 | ็ก้ปๆๆ+6683 | ้ๆบ็งๆ+6684 | ๅฎๆ ผ+6689 | ไผไบ่ฐท+6690 | ๅฎๆฃ่ต่ฎฏ+6691 | ๆดๅบๅทฅ็จ+7402 | ้้ก+7419 | ่พพ่+7423 | ๅฅๅคๆฏ+7428 | ๆด็ปด+7449 | ๅ ็+7455 | ๆกฆ็บฌ+7492 | ไธ็ญไธ+7493 | ่่พพ+7495 | ๅไบ+7497 | ๅก่ฎฏ+7501 | ็้ญ+7503 | ่ช็ฑ็ณป็ป+7504 | ๆถๅฐ็พไบบ+7505 | ็ซ่พพ็ง+7506 | ๅจๅฟๅป็ต+7510 | ๆฃ่+7511 | ๅฎๆฏๆบๆ็งๆ+7514 | ้กถ็จๅฝ้+7517 | ้ฝไปฅ็น+7522 | ไบๅคชๅผ+7523 | ไบ็งๅฝ้+7531 | ๆฑๅฎถ็งๆ+7533 | ้ซ่ฑช+7541 | ๅฝฌ่ พ+7545 | ๅฐ้ฆไผไธ+7556 | ๆๅพทๅฃซ+7557 | ็ง้ณ่ฝๆง+8011 | ๅฐ้+8016 | ็ฝๅ+8021 | ๅฐ็น+8024 | ไฝๅ+8028 | ๅ้ณๅๅฏผไฝ+8032 | ๅ ่ฑ+8034 | ่ฃ็พค+8038 | ้ฟๅญ็ง+8039 | ๅฐ่น+8040 | ไนๆ+8042 | ้ๅฑฑ็ต+8043 | ่ๆๅฎ+8045 | ่พพ่ฟๅ ็ต+8046 | ๅ็ต+8047 | ๆไบ+8048 | ๅพท่+8049 | ๆถ้+8050 | ๅนฟ็งฏ+8054 | ๅฎๅฝ+8059 | ๅฏ็ก+8064 | ไธๆท+8067 | ๅฟๆญ+8068 | ๅ จ่พพ+8069 | ๅ ๅคช+8070 | ้ฟๅ+8071 | ่ฝ็็ฝ้+8072 | ๅๆณฐ+8074 | ้ๆฉก+8076 | ไผไธฐ+8080 | ๅฅฅๆฏ็น+8081 | ่ดๆฐ+8084 | ๅทจ่น+8085 | ็ฆๅ+8086 | ๅฎๆท็ง+8087 | ๅ้้ซ+8088 | ๅๅฎ+8089 | ๅบทๅ จ็ต่ฎฏ+8091 | ็ฟๅ+8092 | ๅปบ่+8093 | ไฟ้+8096 | ๆไบ+8097 | ๅธธ็ต+8099 | ๅคงไธ็ง+8101 | ๅๅ+8103 | ็่+8104 | ้ผๅฎ+8105 | ๅๅทจ+8109 | ๅๅคง+8110 | ๅไธ+8111 | ็ซๆฃ+8112 | ่ณไธ+8114 | ๆฏๆกฆ็ต+8115 | ๅธ้ป+8119 | ๅ ฌไฟก+8121 | ่ถๅณฐ+8122 | ็ฅ้+8127 | ๅฉๆณ+8131 | ็ฆๆ็ง+8147 | ๆญฃๅ+8150 | ๅ่+8155 | ๅๆบ+8163 | ่พพๆน+8171 | ๅคฉๅฎ+8176 | ๆบๆท+8179 | ๆญๅพท+8182 | ๅ ้ซ+8183 | ็ฒพๆ+8201 | ๆ ๆ+8210 | ๅค่ฏ+8213 | ๅฟ่ถ+8215 | ๆๅบๆ+8234 | ๆฐๆฑ+8240 | ๅๅฎ+8249 | ่ฑๅ +8261 | ๅฏ้ผ+8271 | ๅฎ็ป+8277 | ๅไธ+8281 | ๆฌงๆฎ็ฝ+8284 | ไธ็ซน+8287 | ่ฑๆ ผๅฐ+8289 | ๆณฐ่บ+8291 | ๅฐ่+8298 | ๅจ็ฟ+8299 | ็พค่+8358 | ้ๅฑ+8383 | ๅ้+8410 | ๆฃฎ็ฐ+8416 | ๅฎๅจ+8431 | ๆฑ้ป็ง+8455 | ๅคงๆ-KY+9912 | ไผ่\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\241\214\344\270\232\347\273\217\346\265\216/TMT\350\241\214\344\270\232/\345\275\261\351\231\242\346\227\245\345\272\246\347\245\250\346\210\277.md" "b/agent/src/skills/tushare/references/\350\241\214\344\270\232\347\273\217\346\265\216/TMT\350\241\214\344\270\232/\345\275\261\351\231\242\346\227\245\345\272\246\347\245\250\346\210\277.md"new file mode 100644index 000000000..1d6dc1ebc--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\241\214\344\270\232\347\273\217\346\265\216/TMT\350\241\214\344\270\232/\345\275\261\351\231\242\346\227\245\345\272\246\347\245\250\346\210\277.md"@@ -0,0 +1,62 @@+## ๅฝฑ้ขๆฏๆฅ็ฅจๆฟ+----++ๆฅๅฃ๏ผbo_cinema+ๆ่ฟฐ๏ผ่ทๅๆฏๆฅๅๅฝฑ้ข็็ฅจๆฟๆฐๆฎ+ๆฐๆฎๅๅฒ๏ผ ๆฐๆฎไป2018ๅนด9ๆๅผๅง๏ผๆดๅคๅๅฒๆฐๆฎๆญฃๅจ่กฅๅ+ๆฐๆฎๆ้๏ผ็จๆท้่ฆ่ณๅฐ500็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+date | str | Y | ๆฅๆ(ๆ ผๅผ:YYYYMMDD)+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+date | str | Y | ๆฅๆ+c_name | str | Y | ๅฝฑ้ขๅ็งฐ+aud_count | int | Y | ่งไผไบบๆฐ+att_ratio | float | Y | ไธๅบง็+day_amount | float | Y | ๅฝๆฅ็ฅจๆฟ+day_showcount | float | Y | ๅฝๆฅๅบๆฌก+avg_price | float | Y | ๅบๅ็ฅจไปท๏ผๅ ๏ผ+p_pc | float | Y | ๅบๅไบบๆฌก+rank | int | Y | ๆๅ+++**ๆฅๅฃไฝฟ็จ**++```python+pro = ts.pro_api()+#ๆ่+#pro = ts.pro_api('your token')++df = pro.bo_cinema(date='20181014')+```++**ๆฐๆฎ็คบไพ**++ date c_name aud_count att_ratio day_amount \+ 0 20181014 Jackie Chanๅไบฌ่่ฑ 4973 20.70 215721.00+ 1 20181014 ้้ธๅไบฌๅคงๆฆๅIMAXๅบ 3160 29.65 197890.50+ 2 20181014 ๅนฟๅท้ฃๆฌๅฝฑๅ๏ผๆญฃไฝณๅๅบ๏ผ 3279 23.30 173564.30+ 3 20181014 ้ฆ้ฝ็ตๅฝฑ้ข่ฅฟๅๅบ 3412 30.01 167779.68+ 4 20181014 ๅไบฌๅฏฐๆ ๅ็ๆฑๅบ 2554 30.69 161035.50+ 5 20181014 ้้ธๅไบฌ่่IMAXๅบ 2710 18.34 150530.10+ 6 20181014 ๅไบฌๆฐ่กๅฃๅฝ้ ๅฝฑๅ 3685 23.58 144884.50+ 7 20181014 ๆญฆๅๆฉๅฐๅฝ้ ็ตๅฝฑๅ 4232 23.22 144577.00+ 8 20181014 ๅนฟๅท้ฃๆฌๅฝฑๅ 2775 22.38 144180.00+ 9 20181014 ไธญๅฝฑๅฝ้ ๅฝฑๅๆญฆๆฑๅ ่ฐทๅคฉๆฒณๅบ 4078 37.00 137562.00+ 10 20181014 ไธญๅฝฑๅฝ้ ๅฝฑๅ็ ๆตทๅๅ2ๅบ 3228 34.78 136909.00+ 11 20181014 ๅข็ฑณๅๅไบฌ้ฟๆฅนๅคฉ่กIMAXๅฝฑๅ 2197 18.04 132217.00+ 12 20181014 ไธญๅฝฑๅฝ้ ๅฝฑๅๅไบฌๆๅนณๆฐธๆบๅบ 3002 35.76 130213.40+ 13 20181014 CGVๅฝฑๅ ๆทฑๅณๅฃนๆนๅๅบ 2423 19.03 130132.00+ 14 20181014 ๅไบฌๅธ้ๆณๆธฏๅฝ้ ๅฝฑๅ 2538 16.75 129530.00+ 15 20181014 ๅไบฌUMEๅฝ้ ๅฝฑๅๅไบๅบ 2052 17.98 129479.59+ 16 20181014 ๆทฑๅณๅธ็พ่ๆฑ็ตๅฝฑไธญๅฟๅฝฑๅ 2515 19.71 128600.00+ 17 20181014 ๅนฟๅทๅธ็พไธฝๅฎซ็ๅพทๅฝฑ้ข 2007 24.84 125094.00+ 18 20181014 ้ๅทๅฅฅๆฏๅก็ๅฐๆธฏๅฝ้ ๅฝฑๅ 3286 27.60 124663.00\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\241\214\344\270\232\347\273\217\346\265\216/TMT\350\241\214\344\270\232/\347\224\265\345\275\261\345\221\250\345\272\246\347\245\250\346\210\277.md" "b/agent/src/skills/tushare/references/\350\241\214\344\270\232\347\273\217\346\265\216/TMT\350\241\214\344\270\232/\347\224\265\345\275\261\345\221\250\345\272\246\347\245\250\346\210\277.md"new file mode 100644index 000000000..7e58b28ed--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\241\214\344\270\232\347\273\217\346\265\216/TMT\350\241\214\344\270\232/\347\224\265\345\275\261\345\221\250\345\272\246\347\245\250\346\210\277.md"@@ -0,0 +1,54 @@+## ็ตๅฝฑๅจๅบฆ็ฅจๆฟ+----++ๆฅๅฃ๏ผbo_weekly+ๆ่ฟฐ๏ผ่ทๅๅจๅบฆ็ฅจๆฟๆฐๆฎ+ๆฐๆฎๆดๆฐ๏ผๆฌๅจๆดๆฐไธไธๅจๆฐๆฎ+ๆฐๆฎๅๅฒ๏ผ ๆฐๆฎไป2008ๅนด็ฌฌไธๅจๅผๅง๏ผ่ถ ่ฟ10ๅนดๅๅฒๆฐๆฎใ+ๆฐๆฎๆ้๏ผ็จๆท้่ฆ่ณๅฐ500็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+date | str | Y | ๆฅๆ๏ผๆฏๅจไธๆฅๆ๏ผๆ ผๅผYYYYMMDD๏ผ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+date | str | Y | ๆฅๆ+name | str | Y | ๅฝฑ็ๅ็งฐ+avg_price | float | Y | ๅนณๅ็ฅจไปท+week_amount | float | Y | ๅฝๅจ็ฅจๆฟ๏ผไธ๏ผ+total | float | Y | ็ดฏ่ฎก็ฅจๆฟ๏ผไธ๏ผ+list_day | int | Y | ไธๆ ๅคฉๆฐ+p_pc | int | Y | ๅบๅไบบๆฌก+wom_index | float | Y | ๅฃ็ขๆๆฐ+up_ratio | float | Y | ็ฏๆฏๅๅ ๏ผ%๏ผ+rank | int | Y | ๆๅ+++**ๆฅๅฃไฝฟ็จ**++```python+pro = ts.pro_api()+#ๆ่+#pro = ts.pro_api('your token')++df = pro.bo_weekly(date='20181008')+```++**ๆฐๆฎ็คบไพ**++ date name avg_price week_amount total list_day p_pc \+ 0 20181008 ๆ ๅ 36.0 25640.0 93705.0 15 12+ 1 20181008 ๅฝฑ 36.0 10277.0 55406.0 15 8+ 2 20181008 ๆพๅฐไฝ 32.0 9318.0 15234.0 10 11+ 3 20181008 ๆ่ถ็ๅงๅฆ 35.0 5823.0 57263.0 15 6+ 4 20181008 ่ๅญ่กๅจ้ 34.0 3875.0 23683.0 15 7+ 5 20181008 ๅๅ่ๅธ 30.0 2917.0 2941.0 3 10+ 6 20181008 ๆฒไผค้ๆตๆๆฒณ 34.0 2475.0 33532.0 24 7+ 7 20181008 ่ถ ่ฝๆณฐๅฆ 30.0 1202.0 1202.0 3 4+ 8 20181008 ้ฟๅกๆไนๅฅ็ผๅ้ฉ 34.0 675.0 7251.0 14 5\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\241\214\344\270\232\347\273\217\346\265\216/TMT\350\241\214\344\270\232/\347\224\265\345\275\261\346\227\245\345\272\246\347\245\250\346\210\277.md" "b/agent/src/skills/tushare/references/\350\241\214\344\270\232\347\273\217\346\265\216/TMT\350\241\214\344\270\232/\347\224\265\345\275\261\346\227\245\345\272\246\347\245\250\346\210\277.md"new file mode 100644index 000000000..b104fb627--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\241\214\344\270\232\347\273\217\346\265\216/TMT\350\241\214\344\270\232/\347\224\265\345\275\261\346\227\245\345\272\246\347\245\250\346\210\277.md"@@ -0,0 +1,55 @@+## ็ตๅฝฑๆฅๅบฆ็ฅจๆฟ+----++ๆฅๅฃ๏ผbo_daily+ๆ่ฟฐ๏ผ่ทๅ็ตๅฝฑๆฅๅบฆ็ฅจๆฟ+ๆฐๆฎๆดๆฐ๏ผๅฝๆฅๆดๆฐไธไธๆฅๆฐๆฎ+ๆฐๆฎๅๅฒ๏ผ ๆฐๆฎไป2018ๅนด9ๆๅผๅง๏ผๆดๅคๅๅฒๆฐๆฎๆญฃๅจ่กฅๅ+ๆฐๆฎๆ้๏ผ็จๆท้่ฆ่ณๅฐ500็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+date | str | Y | ๆฅๆ ๏ผๆ ผๅผYYYYMMDD๏ผ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+date | str | Y | ๆฅๆ+name | str | Y | ๅฝฑ็ๅ็งฐ+avg_price | float | Y | ๅนณๅ็ฅจไปท+day_amount | float | Y | ๅฝๆฅ็ฅจๆฟ๏ผไธ๏ผ+total | float | Y | ็ดฏ่ฎก็ฅจๆฟ๏ผไธ๏ผ+list_day | int | Y | ไธๆ ๅคฉๆฐ+p_pc | int | Y | ๅบๅไบบๆฌก+wom_index | float | Y | ๅฃ็ขๆๆฐ+up_ratio | float | Y | ็ฏๆฏๅๅ ๏ผ%๏ผ+rank | int | Y | ๆๅ+++**ๆฅๅฃไฝฟ็จ**++```python+pro = ts.pro_api()+#ๆ่+#pro = ts.pro_api('your token')++df = pro.bo_daily(date='20181014')+```++**ๆฐๆฎ็คบไพ**++ date name avg_price day_amount total list_day p_pc \+ 0 20181014 ๆ ๅ 37.0 4720.0 93611.0 15 16+ 1 20181014 ๆพๅฐไฝ 32.0 1893.0 15196.0 10 14+ 2 20181014 ๅฝฑ 36.0 1763.0 55370.0 15 11+ 3 20181014 ๅๅ่ๅธ 30.0 1173.0 2912.0 3 13+ 4 20181014 ๆ่ถ็ๅงๅฆ 35.0 864.0 57241.0 15 9+ 5 20181014 ่ๅญ่กๅจ้ 34.0 597.0 23671.0 15 10+ 6 20181014 ๆฒไผค้ๆตๆๆฒณ 33.0 426.0 33522.0 24 9+ 7 20181014 ้ฟๅกๆไนๅฅ็ผๅ้ฉ 34.0 280.0 7245.0 14 10+ 8 20181014 ็้ ่่ๅ้ฉ่ฎฐ 31.0 277.0 579.0 3 8+ 9 20181014 ่ถ ่ฝๆณฐๅฆ 31.0 189.0 1197.0 3 2\ No newline at end of filediff --git "a/agent/src/skills/tushare/references/\350\241\214\344\270\232\347\273\217\346\265\216/TMT\350\241\214\344\270\232/\347\224\265\345\275\261\346\234\210\345\272\246\347\245\250\346\210\277.md" "b/agent/src/skills/tushare/references/\350\241\214\344\270\232\347\273\217\346\265\216/TMT\350\241\214\344\270\232/\347\224\265\345\275\261\346\234\210\345\272\246\347\245\250\346\210\277.md"new file mode 100644index 000000000..8d44eeff4--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\241\214\344\270\232\347\273\217\346\265\216/TMT\350\241\214\344\270\232/\347\224\265\345\275\261\346\234\210\345\272\246\347\245\250\346\210\277.md"@@ -0,0 +1,55 @@+## ็ตๅฝฑๆๅบฆ็ฅจๆฟ+----++ๆฅๅฃ๏ผbo_monthly+ๆ่ฟฐ๏ผ่ทๅ็ตๅฝฑๆๅบฆ็ฅจๆฟๆฐๆฎ+ๆฐๆฎๆดๆฐ๏ผๆฌๆๆดๆฐไธไธๆๆฐๆฎ+ๆฐๆฎๅๅฒ๏ผ ๆฐๆฎไป2008ๅนด1ๆ1ๆฅๅผๅง๏ผ่ถ ่ฟ10ๅนดๅๅฒๆฐๆฎใ+ๆฐๆฎๆ้๏ผ็จๆท้่ฆ่ณๅฐ500็งฏๅๆๅฏไปฅ่ฐๅ๏ผๅ ทไฝ่ฏทๅ้ [็งฏๅ่ทๅๅๆณ](https://tushare.pro/document/1?doc_id=13)++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+date | str | Y | ๆฅๆ๏ผๆฏๆ1ๅท๏ผๆ ผๅผYYYYMMDD๏ผ+++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+date | str | Y | ๆฅๆ+name | str | Y | ๅฝฑ็ๅ็งฐ+list_date | str | Y | ไธๆ ๆฅๆ+avg_price | float | Y | ๅนณๅ็ฅจไปท+month_amount | float | Y | ๅฝๆ็ฅจๆฟ๏ผไธ๏ผ+list_day | int | Y | ๆๅ ๅคฉๆฐ+p_pc | int | Y | ๅบๅไบบๆฌก+wom_index | float | Y | ๅฃ็ขๆๆฐ+m_ratio | float | Y | ๆๅบฆๅ ๆฏ๏ผ%๏ผ+rank | int | Y | ๆๅ+++**ๆฅๅฃไฝฟ็จ**++```python+pro = ts.pro_api()+#ๆ่+#pro = ts.pro_api('your token')++df = pro.bo_monthly(date='20180901')+```++**ๆฐๆฎ็คบไพ**++ date name list_date avg_price month_amount list_day p_pc \+ 0 20180901 ็ขไธญ่ฐ6๏ผๅ จ้ข็ฆ่งฃ 2018-08-31 37.0 104316.0 30 14+ 1 20180901 ๅ่ดช้ฃๆด3 2018-09-14 36.0 40473.0 17 11+ 2 20180901 ้ป้ๅ ๅผ 2018-09-21 35.0 23242.0 10 14+ 3 20180901 ่ไบบ2๏ผ้ป่ๅฅณ็ฐ่บซ 2018-08-24 35.0 14641.0 30 8+ 4 20180901 ๆฒไผค้ๆตๆๆฒณ 2018-09-21 34.0 14054.0 10 14+ 5 20180901 ้ฟๅฐๆณ๏ผ็ผไผดๅฝ้ 2018-09-07 34.0 11298.0 24 7+ 6 20180901 ๆฑๆนๅฟๅฅณ 2018-09-21 34.0 5373.0 10 8+ 7 20180901 ๅฟซๆๆๅฅๅธฆ่ตฐ 2018-08-17 32.0 5365.0 30 7+ 8 20180901 ้ฐไป็ฉ่ฏญ 2018-09-14 32.0 4509.0 17 6+ 9 20180901 ๅคง้น่ฅฟๆธธ 2018-09-22 34.0 3419.0 9 10diff --git "a/agent/src/skills/tushare/references/\350\264\242\345\257\214\347\256\241\347\220\206/\345\237\272\351\207\221\351\224\200\345\224\256\350\241\214\344\270\232\346\225\260\346\215\256/\345\220\204\346\270\240\351\201\223\345\205\254\345\213\237\345\237\272\351\207\221\351\224\200\345\224\256\344\277\235\346\234\211\350\247\204\346\250\241\345\215\240\346\257\224.md" "b/agent/src/skills/tushare/references/\350\264\242\345\257\214\347\256\241\347\220\206/\345\237\272\351\207\221\351\224\200\345\224\256\350\241\214\344\270\232\346\225\260\346\215\256/\345\220\204\346\270\240\351\201\223\345\205\254\345\213\237\345\237\272\351\207\221\351\224\200\345\224\256\344\277\235\346\234\211\350\247\204\346\250\241\345\215\240\346\257\224.md"new file mode 100644index 000000000..a96136012--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\264\242\345\257\214\347\256\241\347\220\206/\345\237\272\351\207\221\351\224\200\345\224\256\350\241\214\344\270\232\346\225\260\346\215\256/\345\220\204\346\270\240\351\201\223\345\205\254\345\213\237\345\237\272\351\207\221\351\224\200\345\224\256\344\277\235\346\234\211\350\247\204\346\250\241\345\215\240\346\257\224.md"@@ -0,0 +1,57 @@+## ๅๆธ ้ๅ ฌๅๅบ้้ๅฎไฟๆ่งๆจกๅ ๆฏ+----++ๆฅๅฃ๏ผfund_sales_ratio+ๆ่ฟฐ๏ผ่ทๅๅๆธ ้ๅ ฌๅๅบ้้ๅฎไฟๆ่งๆจกๅ ๆฏๆฐๆฎ๏ผๅนดๅบฆๆดๆฐ+้้๏ผๅๆฌกๆๅคง100่กๆฐๆฎ๏ผๆฐๆฎไป2015ๅนดๅผๅงๅ ฌๅธ๏ผๅฝๅๆฐๆฎ้ๅพๅฐ++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+ๅนดไปฝ | str | N | ๅนดๅบฆ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+year | int | Y | ๅนดๅบฆ+bank | float | Y | ๅไธ้ถ่ก๏ผ%๏ผ+sec_comp | float | Y | ่ฏๅธๅ ฌๅธ๏ผ%๏ผ+fund_comp | float | Y | ๅบ้ๅ ฌๅธ็ด้๏ผ%๏ผ+indep_comp | float | Y | ็ฌ็ซๅบ้้ๅฎๆบๆ๏ผ%๏ผ+rests | float | Y | ๅ ถไป๏ผ%๏ผ++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++df = pro.fund_sales_ratio()+++```++<br>+<br>++**ๆฐๆฎ็คบไพ**++ year bank sec_comp fund_comp indep_comp rests+ 0 2015 25.22 10.01 61.90 2.14 0.73+ 1 2016 23.43 8.23 65.62 2.24 0.48+ 2 2017 24.41 6.05 65.38 3.84 0.32+ 3 2018 24.14 6.41 61.26 7.76 0.42+ 4 2019 23.59 7.59 57.29 11.03 0.49++diff --git "a/agent/src/skills/tushare/references/\350\264\242\345\257\214\347\256\241\347\220\206/\345\237\272\351\207\221\351\224\200\345\224\256\350\241\214\344\270\232\346\225\260\346\215\256/\351\224\200\345\224\256\346\234\272\346\236\204\345\205\254\345\213\237\345\237\272\351\207\221\351\224\200\345\224\256\344\277\235\346\234\211\350\247\204\346\250\241.md" "b/agent/src/skills/tushare/references/\350\264\242\345\257\214\347\256\241\347\220\206/\345\237\272\351\207\221\351\224\200\345\224\256\350\241\214\344\270\232\346\225\260\346\215\256/\351\224\200\345\224\256\346\234\272\346\236\204\345\205\254\345\213\237\345\237\272\351\207\221\351\224\200\345\224\256\344\277\235\346\234\211\350\247\204\346\250\241.md"new file mode 100644index 000000000..e5595deb8--- /dev/null+++ "b/agent/src/skills/tushare/references/\350\264\242\345\257\214\347\256\241\347\220\206/\345\237\272\351\207\221\351\224\200\345\224\256\350\241\214\344\270\232\346\225\260\346\215\256/\351\224\200\345\224\256\346\234\272\346\236\204\345\205\254\345\213\237\345\237\272\351\207\221\351\224\200\345\224\256\344\277\235\346\234\211\350\247\204\346\250\241.md"@@ -0,0 +1,80 @@+## ้ๅฎๆบๆๅ ฌๅๅบ้้ๅฎไฟๆ่งๆจก+----++ๆฅๅฃ๏ผfund_sales_vol+ๆ่ฟฐ๏ผ่ทๅ้ๅฎๆบๆๅ ฌๅๅบ้้ๅฎไฟๆ่งๆจกๆฐๆฎ๏ผๆฌๆฐๆฎไป2021ๅนดQ1ๅผๅงๅ ฌๅธ๏ผๅญฃๅบฆๆดๆฐ+้้๏ผๅๆฌกๆๅคง500่กๆฐๆฎ๏ผ็ฎๅๆป้ๅชๆ100่ก๏ผๆชๆฅ้็ๆฐๆฎ้ๅขๅ ไผๆ้ซไธ้++<br>+<br>++**่พๅ ฅๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ๅฟ ้ | ๆ่ฟฐ+---- | ----- | ---- | ----+year | str | N | ๅนดๅบฆ+quarter | str | N | ๅญฃๅบฆ+name | str | N | ๆบๆๅ็งฐ++<br>+<br>++**่พๅบๅๆฐ**++ๅ็งฐ | ็ฑปๅ | ้ป่ฎคๆพ็คบ | ๆ่ฟฐ+--- | ---- | ---- | ----+year | int | Y | ๅนดๅบฆ+quarter | str | Y | ๅญฃๅบฆ+inst_name | str | Y | ้ๅฎๆบๆ+fund_scale | float | Y | ่ก็ฅจ+ๆททๅๅ ฌๅๅบ้ไฟๆ่งๆจก๏ผไบฟๅ ๏ผ+scale | float | Y | ้่ดงๅธๅธๅบๅ ฌๅๅบ้ไฟๆ่งๆจก๏ผไบฟๅ ๏ผ+rank | int | Y | ๆๅ++++<br>+<br>++**ๆฅๅฃ็คบไพ**++```python++pro = ts.pro_api()++df = pro.fund_sales_vol()+++```++<br>+<br>++**ๆฐๆฎ็คบไพ**+++ year quarter inst_name fund_scale scale rank+ 0 2021 Q1 ๆๅ้ถ่ก่กไปฝๆ้ๅ ฌๅธ 6711.00 7079.00 1+ 1 2021 Q1 ่่๏ผๆญๅท๏ผๅบ้้ๅฎๆ้ๅ ฌๅธ 5719.00 8901.00 2+ 2 2021 Q1 ไธญๅฝๅทฅๅ้ถ่ก่กไปฝๆ้ๅ ฌๅธ 4992.00 5366.00 3+ 3 2021 Q1 ไธญๅฝๅปบ่ฎพ้ถ่ก่กไปฝๆ้ๅ ฌๅธ 3794.00 4101.00 4+ 4 2021 Q1 ไธๆตทๅคฉๅคฉๅบ้้ๅฎๆ้ๅ ฌๅธ 3750.00 4324.00 5+ .. ... ... ... ... ... ...+ 95 2021 Q1 ไธ่่ฏๅธ่กไปฝๆ้ๅ ฌๅธ 22.00 23.00 96+ 96 2021 Q1 ๅไบฌๅบฆๅฐๆปกๅบ้้ๅฎๆ้ๅ ฌๅธ 22.00 29.00 97+ 97 2021 Q1 ๅคงๅ่ฏๅธๆ้่ดฃไปปๅ ฌๅธ 22.00 25.00 98+ 98 2021 Q1 ๅฎไฟกๆฎๆณฝ๏ผๅไบฌ๏ผๅบ้้ๅฎๆ้ๅ ฌๅธ 21.00 36.00 99+ 99 2021 Q1 ๆ็้ถ่ก๏ผไธญๅฝ๏ผๆ้ๅ ฌๅธ 20.00 22.00 100++ [100 rows x 6 columns]++++<br>+<br>+++ๆณจ๏ผ++1ใ่ก็ฅจ+ๆททๅๅ ฌๅๅบ้ไฟๆ่งๆจก็ฒพ็กฎ่ณ0.01ไบฟๅ ่ฟ่กๆๅบใ++2ใ่กจไธญๆ่ฟฐโไฟๆ่งๆจกโๅ ๆฌๅ็ฑปๆ่ต่ ้่ฟๅบ้ไปฃ้ๆบๆ่ฎค็ณ่ดญๅ ฌๅๅบ้๏ผๅซไบคๆๆๅบๅ ๅบ้๏ผๅๅทฒๅๅ ฌ่ง่็ๅธๅๅคง้ๅไบงๅๅฝขๆ็ไฟๆ่งๆจกใ\ No newline at end of filediff --git a/agent/src/skills/tushare/scripts/fund_data_example.py b/agent/src/skills/tushare/scripts/fund_data_example.pynew file mode 100644index 000000000..bc25e82b3--- /dev/null+++ b/agent/src/skills/tushare/scripts/fund_data_example.py@@ -0,0 +1,87 @@+#!/usr/bin/env python3+# -*- coding: utf-8 -*-+"""+ๅบ้ๆฐๆฎ่ทๅ็คบไพ่ๆฌ+"""++import tushare as ts+import pandas as pd+import os++# ่ฏปๅ็ฏๅขๅ้ไธญ็token, ๆ่ ่ฏปๅๆฌๅฐ่ฎฐๅฝ็token+token = os.getenv('TUSHARE_TOKEN') or ts.get_token()++# ๅๅงๅproๆฅๅฃ+pro = ts.pro_api(token)+++def get_fund_list():+ """+ ่ทๅๅบ้ๅ่กจ+ """+ try:+ data = pro.fund_basic(market='E', status='L', fields='ts_code,fund_name,fund_type,found_date,issue_date,delist_date')+ print("ๅบ้ๅ่กจ่ทๅๆๅ๏ผ")+ print(data.head())+ return data+ except Exception as e:+ print(f"่ทๅๅบ้ๅ่กจๅคฑ่ดฅ๏ผ{e}")+ return None+++def get_fund_nav(ts_code, start_date, end_date):+ """+ ่ทๅๅบ้ๅๅผๆฐๆฎ+ """+ try:+ data = pro.fund_nav(ts_code=ts_code, start_date=start_date, end_date=end_date)+ print(f"{ts_code}ๅบ้ๅๅผๆฐๆฎ่ทๅๆๅ๏ผ")+ print(data.head())+ return data+ except Exception as e:+ print(f"่ทๅๅบ้ๅๅผๆฐๆฎๅคฑ่ดฅ๏ผ{e}")+ return None+++def get_fund_manager():+ """+ ่ทๅๅบ้็ป็ๆฐๆฎ+ """+ try:+ data = pro.fund_manager(limit=10, fields='ts_code,fund_name,manager_name,begin_date,end_date')+ print("ๅบ้็ป็ๆฐๆฎ่ทๅๆๅ๏ผ")+ print(data.head())+ return data+ except Exception as e:+ print(f"่ทๅๅบ้็ป็ๆฐๆฎๅคฑ่ดฅ๏ผ{e}")+ return None+++def main():+ """+ ไธปๅฝๆฐ+ """+ print("===== tushare ๅบ้ๆฐๆฎ่ทๅ็คบไพ =====")++ # ่ทๅๅบ้ๅ่กจ+ fund_list = get_fund_list()++ if fund_list is not None:+ # ่ทๅ็ฌฌไธๅชๅบ้็ไปฃ็ + ts_code = fund_list['ts_code'].iloc[0]+ print(f"\nไฝฟ็จๅบ้ไปฃ็ ๏ผ{ts_code}")++ # ่ทๅๅบ้ๅๅผๆฐๆฎ๏ผๆ่ฟ30ๅคฉ๏ผ+ import datetime+ end_date = datetime.datetime.now().strftime('%Y%m%d')+ start_date = (datetime.datetime.now() - datetime.timedelta(days=30)).strftime('%Y%m%d')+ print(f"\n่ทๅๅบ้ๅๅผๆฐๆฎ๏ผ{start_date} ่ณ {end_date}")+ get_fund_nav(ts_code, start_date, end_date)++ # ่ทๅๅบ้็ป็ๆฐๆฎ+ print("\n่ทๅๅบ้็ป็ๆฐๆฎ๏ผ")+ get_fund_manager()+++if __name__ == "__main__":+ main()diff --git a/agent/src/skills/tushare/scripts/stock_data_example.py b/agent/src/skills/tushare/scripts/stock_data_example.pynew file mode 100644index 000000000..e537b347b--- /dev/null+++ b/agent/src/skills/tushare/scripts/stock_data_example.py@@ -0,0 +1,88 @@+#!/usr/bin/env python3+# -*- coding: utf-8 -*-+"""+่ก็ฅจๆฐๆฎ่ทๅ็คบไพ่ๆฌ+"""++import tushare as ts+import pandas as pd+import os++# ่ฏปๅ็ฏๅขๅ้ไธญ็token, ๆ่ ่ฏปๅๆฌๅฐ่ฎฐๅฝ็token+token = os.getenv('TUSHARE_TOKEN') or ts.get_token()++# ๅๅงๅproๆฅๅฃ+pro = ts.pro_api(token)+++def get_stock_list():+ """+ ่ทๅ่ก็ฅจๅ่กจ+ """+ try:+ data = pro.stock_basic(exchange='', list_status='L', fields='ts_code,symbol,name,area,industry,list_date')+ print("่ก็ฅจๅ่กจ่ทๅๆๅ๏ผ")+ print(data.head())+ return data+ except Exception as e:+ print(f"่ทๅ่ก็ฅจๅ่กจๅคฑ่ดฅ๏ผ{e}")+ return None+++def get_daily_data(ts_code, start_date, end_date):+ """+ ่ทๅ่ก็ฅจๆฅ็บฟๆฐๆฎ+ """+ try:+ data = pro.daily(ts_code=ts_code, start_date=start_date, end_date=end_date)+ print(f"{ts_code}ๆฅ็บฟๆฐๆฎ่ทๅๆๅ๏ผ")+ print(data.head())+ return data+ except Exception as e:+ print(f"่ทๅๆฅ็บฟๆฐๆฎๅคฑ่ดฅ๏ผ{e}")+ return None+++def get_financial_data(ts_code, year, quarter):+ """+ ่ทๅ่ดขๅกๆๆ ๆฐๆฎ+ """+ try:+ data = pro.fina_indicator(ts_code=ts_code, year=year, quarter=quarter)+ print(f"{ts_code}่ดขๅกๆๆ ๆฐๆฎ่ทๅๆๅ๏ผ")+ print(data.head())+ return data+ except Exception as e:+ print(f"่ทๅ่ดขๅกๆๆ ๆฐๆฎๅคฑ่ดฅ๏ผ{e}")+ return None+++def main():+ """+ ไธปๅฝๆฐ+ """+ print("===== tushare ่ก็ฅจๆฐๆฎ่ทๅ็คบไพ =====")++ # ่ทๅ่ก็ฅจๅ่กจ+ stock_list = get_stock_list()++ if stock_list is not None:+ # ่ทๅ็ฌฌไธๅช่ก็ฅจ็ไปฃ็ + ts_code = stock_list['ts_code'].iloc[0]+ print(f"\nไฝฟ็จ่ก็ฅจไปฃ็ ๏ผ{ts_code}")++ # ่ทๅๆฅ็บฟๆฐๆฎ๏ผๆ่ฟ30ๅคฉ๏ผ+ import datetime+ end_date = datetime.datetime.now().strftime('%Y%m%d')+ start_date = (datetime.datetime.now() - datetime.timedelta(days=30)).strftime('%Y%m%d')+ print(f"\n่ทๅๆฅ็บฟๆฐๆฎ๏ผ{start_date} ่ณ {end_date}")+ get_daily_data(ts_code, start_date, end_date)++ # ่ทๅ่ดขๅกๆฐๆฎ๏ผๆ่ฟไธๅนด๏ผ+ current_year = datetime.datetime.now().year+ print(f"\n่ทๅ่ดขๅกๆฐๆฎ๏ผ{current_year-1}ๅนด ็ฌฌ4ๅญฃๅบฆ")+ get_financial_data(ts_code, current_year-1, 4)+++if __name__ == "__main__":+ main()diff --git a/agent/src/skills/us-etf-flow/SKILL.md b/agent/src/skills/us-etf-flow/SKILL.mdnew file mode 100644index 000000000..6b525c8c0--- /dev/null+++ b/agent/src/skills/us-etf-flow/SKILL.md@@ -0,0 +1,271 @@+---+name: us-etf-flow+description: US ETF fund flow analysis, sector rotation breadth, and style factor flows โ track institutional capital movement via ETF creation/redemption, sector breadth signals, and thematic momentum.+---+# US ETF Flow & Sector Breadth Analysis++## Overview++Track capital flows through US ETFs to identify institutional positioning, sector rotation trends, and risk appetite shifts. ETF flows are a real-time proxy for institutional capital allocation โ unlike 13F filings (45-day lag), ETF creation/redemption data is available daily.++## Core Concepts++### 1. ETF Flow Mechanics++**Creation / Redemption process:**+- **Inflows (creation)**: Authorized Participants (APs) deliver baskets of underlying securities to the ETF issuer โ receive new ETF shares โ sell on exchange. This happens when ETF trades at a premium to NAV.+- **Outflows (redemption)**: APs buy ETF shares on exchange โ redeem with issuer for underlying securities โ sell securities. This happens when ETF trades at a discount to NAV.+- **Signal interpretation**: sustained large inflows = institutional demand; sustained large outflows = institutional liquidation.++**Key distinction:**+- ETF price movement โ ETF flow. Price can rise on low volume (momentum). Flows require actual capital commitment.+- Flows are a **quantity** signal (how much money is moving), not a **price** signal.++### 2. Major ETF Flow Categories++#### Broad Market ETFs++| ETF | Tracking Index | AUM | Flow Signal |+|-----|---------------|-----|-------------|+| SPY | S&P 500 | ~$500B | Broadest equity risk appetite |+| IVV | S&P 500 | ~$400B | Long-term institutional allocation |+| VOO | S&P 500 | ~$400B | Retail + advisor allocation |+| QQQ | Nasdaq 100 | ~$250B | Tech / growth appetite |+| IWM | Russell 2000 | ~$60B | Small-cap risk appetite |+| DIA | Dow Jones 30 | ~$30B | Value / blue-chip sentiment |++**Interpretation rules:**+```python+# Broad market flow signals+if spy_flow > 0 and iwm_flow > 0:+ signal = "risk_on" # Both large and small cap getting inflows+elif spy_flow > 0 and iwm_flow < 0:+ signal = "quality_flight" # Money rotating to large-cap safety+elif spy_flow < 0 and iwm_flow < 0:+ signal = "risk_off" # Broad equity outflows+elif spy_flow < 0 and iwm_flow > 0:+ signal = "risk_seeking" # Rotation from large to small (rare, usually early cycle)+```++#### Sector ETFs (SPDR Select Sector)++| ETF | Sector | Economic Sensitivity | Cycle Phase |+|-----|--------|---------------------|-------------|+| XLK | Technology | Growth / late cycle | Expansion |+| XLF | Financials | Rate sensitive | Early recovery |+| XLE | Energy | Commodity linked | Late cycle / inflation |+| XLV | Healthcare | Defensive | Recession |+| XLY | Consumer Discretionary | Cyclical | Recovery |+| XLP | Consumer Staples | Defensive | Recession |+| XLI | Industrials | Cyclical | Early expansion |+| XLU | Utilities | Defensive / rate sensitive | Late cycle / recession |+| XLB | Materials | Commodity linked | Early cycle |+| XLRE | Real Estate | Rate sensitive | Rate-cut cycle |+| XLC | Communication Services | Growth (META, GOOGL) | Expansion |++#### Style & Factor ETFs++| ETF | Factor | Signal |+|-----|--------|--------|+| IVW / SPYG | S&P 500 Growth | Growth appetite |+| IVE / SPYV | S&P 500 Value | Value rotation |+| MTUM | MSCI USA Momentum | Trend following |+| QUAL | MSCI USA Quality | Quality flight |+| USMV / SPLV | Min Volatility | Defensive positioning |+| SIZE | MSCI USA Size | Small-cap factor |++#### Fixed Income ETFs++| ETF | Segment | Signal |+|-----|---------|--------|+| TLT | 20+ Year Treasury | Duration / rate expectations |+| IEF | 7-10 Year Treasury | Intermediate rate view |+| SHY | 1-3 Year Treasury | Cash proxy / safe haven |+| LQD | Investment Grade Corp | Credit appetite |+| HYG / JNK | High Yield Corp | Risk appetite / credit cycle |+| TIP | TIPS | Inflation expectations |+| EMB | EM Sovereign Debt | EM risk appetite |++### 3. Sector Rotation Signals++**Sector breadth analysis:**+```python+# Sector breadth = number of sectors with positive flows / total sectors+sector_flows = {+ "XLK": +500, # $500M inflow+ "XLF": +200,+ "XLE": -100,+ "XLV": +50,+ "XLY": -300,+ "XLP": +100,+ "XLI": +150,+ "XLU": -50,+ "XLB": +80,+ "XLRE": -200,+ "XLC": +300,+}++positive_sectors = sum(1 for v in sector_flows.values() if v > 0)+breadth = positive_sectors / len(sector_flows)++# Interpretation+# breadth > 0.7: broad-based inflows โ healthy bull market+# breadth 0.4-0.7: selective rotation โ stock/sector picker's market+# breadth < 0.4: broad outflows โ risk-off environment+```++**Cyclical vs Defensive ratio:**+```python+cyclical = ["XLK", "XLY", "XLI", "XLF", "XLB"]+defensive = ["XLV", "XLP", "XLU", "XLRE"]++cyclical_flow = sum(sector_flows[s] for s in cyclical)+defensive_flow = sum(sector_flows[s] for s in defensive)++ratio = cyclical_flow / (cyclical_flow + defensive_flow + 1e-10)++# ratio > 0.65: strong risk-on, cyclical leadership+# ratio 0.4-0.65: balanced+# ratio < 0.4: defensive rotation, risk-off+```++### 4. Thematic ETF Flows++**Growth / innovation themes:**++| Theme | Key ETFs | What It Tracks |+|-------|----------|---------------|+| AI / Semiconductors | SMH, SOXX, BOTZ | AI capex cycle |+| Clean Energy | ICLN, TAN, QCLN | Energy transition spend |+| Biotech | XBI, IBB | Pharma pipeline / M&A cycle |+| Cybersecurity | CIBR, HACK | Security spending cycle |+| China Internet | KWEB, FXI | China tech sentiment |+| India | INDA, SMIN | India growth allocation |+| Emerging Markets | EEM, VWO | EM risk appetite |+| Gold Miners | GDX, GDXJ | Gold price leverage play |+| Bitcoin | IBIT, FBTC | Crypto institutional adoption |++**Thematic flow interpretation:**+- Sustained 4-week+ inflows into a theme = institutional conviction, not just hot money+- Sudden large outflows from a theme that was trending = crowded trade unwind risk+- Divergence between thematic ETF flow and underlying asset price = potential inflection++### 5. Flow-Based Trading Signals++**Signal construction:**++```python+def etf_flow_signal(ticker, lookback_days=20):+ """+ Generate trading signal from ETF flow data.+ """+ # Cumulative flow over lookback period+ cum_flow = sum(daily_flows[ticker][-lookback_days:])++ # Flow as % of AUM (normalized)+ flow_pct = cum_flow / aum[ticker]++ # Flow momentum: recent 5-day vs prior 15-day+ recent = sum(daily_flows[ticker][-5:])+ prior = sum(daily_flows[ticker][-20:-5])+ momentum = recent - prior++ # Signal+ if flow_pct > 0.02 and momentum > 0:+ return "strong_inflow" # Sustained and accelerating+ elif flow_pct > 0.01:+ return "mild_inflow" # Positive but not accelerating+ elif flow_pct < -0.02 and momentum < 0:+ return "strong_outflow" # Sustained and accelerating outflows+ elif flow_pct < -0.01:+ return "mild_outflow"+ else:+ return "neutral"+```++**Contrarian vs momentum flow signals:**+- **Momentum** (follow the flow): works best for broad market ETFs (SPY, QQQ) during trending markets+- **Contrarian** (fade extreme flows): works best for sector/thematic ETFs at extreme levels+- **Rule of thumb**: 3-standard-deviation flow events in sector ETFs tend to mean-revert within 2-4 weeks++## Data Access++### Via yfinance++```python+import yfinance as yf++# ETF price and volume data+etf = yf.download("SPY", start="2025-01-01", end="2026-03-30", progress=False)++# ETF info (AUM, expense ratio, holdings)+spy = yf.Ticker("SPY")+info = spy.info+print(f"AUM: {info.get('totalAssets')}")+print(f"Expense ratio: {info.get('annualReportExpenseRatio')}")++# Sector weights (for sector ETFs)+# Not directly available via yfinance; use web scraping or manual input+```++### Flow Data Sources++| Source | Access | Coverage | Latency |+|--------|--------|----------|---------|+| ETF.com | Free (web) | US ETFs | T+1 |+| Bloomberg Terminal | Paid | Global ETFs | Real-time |+| ICI (Investment Company Institute) | Free (weekly) | US mutual fund + ETF aggregate | T+7 |+| ETF Database (etfdb.com) | Free (web) | US ETFs | T+1 |+| VettaFi | Free (web) | US ETFs | T+1 |++## Output Format++```+## ETF Flow Analysis โ [Date Range]++### Broad Market Flows+- **SPY**: [+/- $X.XB over N days] โ [risk-on / risk-off signal]+- **QQQ**: [+/- $X.XB] โ [tech appetite]+- **IWM**: [+/- $X.XB] โ [small-cap sentiment]+- **Overall**: [risk-on / selective / risk-off]++### Sector Rotation+- **Inflow leaders**: [sector1 +$XM, sector2 +$XM]+- **Outflow leaders**: [sector1 -$XM, sector2 -$XM]+- **Breadth**: X/11 sectors with positive flows+- **Cyclical/Defensive ratio**: X.XX [risk-on / balanced / defensive]++### Style Factor Flows+- **Growth vs Value**: [growth leading / value leading / balanced]+- **Momentum**: [inflow / outflow]+- **Quality/MinVol**: [inflow = defensive, outflow = risk-on]++### Fixed Income Flows+- **Duration signal**: TLT [inflow/outflow] โ [rate cut expectations / rate concern]+- **Credit signal**: HYG [inflow/outflow] โ [credit cycle expansion / contraction]+- **Inflation signal**: TIP [inflow/outflow] โ [rising / falling inflation expectations]++### Thematic Highlights+- [Theme1 ETF]: [flow trend and implication]+- [Theme2 ETF]: [flow trend and implication]++### Composite Signal+| Dimension | Signal | Basis |+|-----------|--------|-------|+| Risk appetite | [on/off] | SPY+QQQ flows, C/D ratio |+| Sector rotation | [early/mid/late cycle] | Sector flow pattern |+| Rate expectations | [cuts/hold/hikes] | TLT + TIP flows |++### Investment Implication+- **Positioning**: [overweight equities / neutral / underweight]+- **Sector tilts**: [overweight X, underweight Y]+- **Risk level**: [high / moderate / low]+```++## Notes++- ETF flows are a proxy for institutional behavior, not a standalone signal; combine with price action and fundamentals+- Large single-day flows can be rebalancing-driven (quarter-end, index reconstitution) rather than directional+- Options-related ETF activity (hedging via SPY puts) can distort flow signals+- International ETF flows (EEM, FXI, INDA) are useful for global macro positioning+- This framework is for research purposes only and does not constitute investment advicediff --git a/agent/src/skills/valuation-model/SKILL.md b/agent/src/skills/valuation-model/SKILL.mdnew file mode 100644index 000000000..72cf904db--- /dev/null+++ b/agent/src/skills/valuation-model/SKILL.md@@ -0,0 +1,259 @@+---+name: valuation-model+description: Valuation methodology โ absolute valuation with DCF / DDM / SOTP, relative valuation with PE-Band / PB-ROE / EV-EBITDA, sensitivity analysis, and valuation-trap detection.+---++# Valuation Methodology++## Overview++Systematic corporate valuation framework covering absolute valuation (`DCF / DDM / SOTP`) and relative valuation (`PE / PB / EV-EBITDA`), including sensitivity-analysis methods and a checklist for identifying valuation traps.++## Absolute Valuation Methods++### 1. DCF (Discounted Cash Flow)++**Core formulas**:++```+Enterprise value = ฮฃ FCF_t / (1+WACC)^t + TV / (1+WACC)^n+Equity value = enterprise value - net debt+Per-share value = equity value / total shares outstanding+```++**Detailed steps**:++#### Step 1: Forecast free cash flow (usually 5 years)++```+FCFF = EBIT ร (1-tax rate) + depreciation & amortization - capex - increase in working capital++Simplified version:+FCFF โ operating cash flow - capex+```++| Year | Revenue (100m RMB) | EBIT (100m RMB) | FCFF (100m RMB) | Growth |+|------|---------|---------|---------|------|+| 2026E | 120 | 24 | 18 | +15% |+| 2027E | 138 | 28 | 21 | +15% |+| 2028E | 155 | 31 | 24 | +12% |+| 2029E | 170 | 34 | 26 | +10% |+| 2030E | 182 | 36 | 28 | +7% |++#### Step 2: Calculate WACC++```+WACC = E/(D+E) ร Ke + D/(D+E) ร Kd ร (1-T)++Ke (cost of equity) = Rf + ฮฒ ร (Rm - Rf)+ - Rf: 10-year government bond yield (about 2.5% for China A-shares)+ - ฮฒ: industry average or company beta (1.0-1.5)+ - Rm-Rf: equity risk premium (about 5-7% for China A-shares)++Kd: cost of debt (loan rate, about 4-5%)+T: income tax rate (25%)+```++**Reference WACC ranges for China A-shares**:++| Industry | WACC Range | Reference ฮฒ |+|------|---------|------|+| Consumer | 8-10% | 0.8-1.0 |+| Technology | 10-13% | 1.2-1.5 |+| Financials | 7-9% | 1.0-1.2 |+| Cyclicals | 9-12% | 1.0-1.4 |+| Utilities | 6-8% | 0.5-0.8 |++#### Step 3: Terminal Value++```+Perpetual-growth method: TV = FCF_n ร (1+g) / (WACC - g)+ - g: perpetual growth rate (usually 2-3%, should not exceed GDP growth)++Exit-multiple method: TV = EBITDA_n ร EV/EBITDA multiple+ - Reference the industry average or historical median+```++#### Step 4: Sensitivity Analysis++```markdown+### DCF Sensitivity Analysis (per-share value, RMB)++| WACC \ g | 2.0% | 2.5% | 3.0% |+|----------|------|------|------|+| 9.0% | 32.5 | 35.8 | 40.2 |+| 9.5% | 28.3 | 30.8 | 34.0 |+| 10.0% | 24.8 | 26.7 | 29.1 |+| 10.5% | 22.0 | 23.5 | 25.3 |+| 11.0% | 19.6 | 20.8 | 22.2 |+```++### 2. DDM (Dividend Discount Model)++**Applicable to**: high-dividend stocks (banks, utilities, mature consumer companies).++```+Two-stage DDM:+P = ฮฃ D_t / (1+Ke)^t + D_n ร (1+g) / [(Ke-g) ร (1+Ke)^n]++Gordon model (single stage):+P = D_1 / (Ke - g)+```++**Applicability checklist**:+- [x] Has paid dividends continuously for more than 3 years+- [x] Stable payout ratio (>30%)+- [x] Strong earnings predictability+- [ ] Usually not suitable for high-growth stocks (no dividends / low payout)++### 3. SOTP (Sum of the Parts)++**Applicable to**: diversified conglomerates.++```+Group value = ฮฃ valuation of each business segment + net cash - holding-company discount++Example (a group company):+| Segment | Revenue (100m RMB) | Valuation Method | Valuation (100m RMB) |+|------|---------|---------|---------|+| Baijiu | 80 | 30x PE | 600 |+| Real estate | 50 | 0.6x PB | 120 |+| Financials | 30 | 1.0x PB | 200 |+| Total | | | 920 |+| Holding-company discount | | -15% | -138 |+| Group valuation | | | 782 |+```++## Relative Valuation Methods++### 1. PE Band++```+Historical PE percentile analysis:+- Take the past 5 years of PE_TTM time series+- Compute the 10% / 25% / 50% / 75% / 90% percentiles+- Judge overvaluation / undervaluation from the current PE percentile++| Percentile | PE | Implied Price | Interpretation |+|------|-----|---------|------|+| 90% | 35x | 52.5 | Severely overvalued |+| 75% | 28x | 42.0 | Rich |+| 50% | 22x | 33.0 | Fair |+| 25% | 16x | 24.0 | Cheap |+| 10% | 12x | 18.0 | Severely undervalued |+| Current | 18x | 27.0 | Cheap (30th percentile) |+```++### 2. PB-ROE Matrix++```+Theoretical relationship: PB = (ROE - g) / (Ke - g)+Practical use: plot companies in the industry on a PB vs ROE scatter chart++| Quadrant | PB | ROE | Interpretation |+|------|-----|-----|------|+| Lower right | Low PB | High ROE | Undervalued (best buy zone) |+| Upper right | High PB | High ROE | Fair (quality premium) |+| Lower left | Low PB | Low ROE | Value trap or distressed turnaround |+| Upper left | High PB | Low ROE | Overvalued (avoid) |+```++### 3. EV/EBITDA++```+EV = market cap + net debt (interest-bearing debt - cash)+EBITDA = operating profit + depreciation + amortization++Advantages:+- Removes capital-structure differences (vs PE)+- Removes depreciation-policy differences+- Suitable for asset-heavy industries (telecom / energy / infrastructure)++Reference EV/EBITDA ranges by China A-share industry:+| Industry | Median | Undervalued | Overvalued |+|------|--------|------|------|+| Consumer | 15-20x | <12x | >25x |+| Technology | 12-18x | <10x | >22x |+| Energy | 6-10x | <5x | >12x |+| Utilities | 8-12x | <6x | >15x |+```++## Valuation-Trap Detection++### Top 10 Valuation Traps++| # | Trap | Detection Method | Typical Example |+|---|------|---------|---------|+| 1 | Low-PE cyclical at the peak | PE is lowest when earnings are highest and about to fall | Coal at 5x PE in 2021 was the top |+| 2 | High-PE growth can be justified | `PEG < 1` means the growth rate supports the valuation | 30x PE + 40% growth = PEG 0.75 |+| 3 | Low-PB value destruction | Sustained `ROE < Ke` means shareholder value is being destroyed | Long-term loss-making asset-heavy company |+| 4 | Goodwill bomb | Goodwill / net assets >30% implies impairment risk | Underperforming acquisition after paying a high premium |+| 5 | Accounts-receivable trap | Rising receivables / revenue ratio = poor revenue quality | Government receivables + high customer concentration |+| 6 | Capitalization trap | Capitalizing R&D / interest flatters profit | PE doubles after true expensing |+| 7 | One-off gains | Large gap between recurring net profit and reported net profit | Asset sales / government subsidies boost earnings |+| 8 | Share dilution | Stock options / convertible bonds reduce EPS | PE should be based on diluted EPS |+| 9 | Related-party transactions | Buy cheap from related parties / sell high to them | Profit shifted outside the listed entity |+| 10 | FX swings | High overseas-revenue share means large currency sensitivity | RMB appreciation erodes exporter profits |++## Analysis Framework++### Valuation-Method Selection Decision Tree++```+What type of company is it?+โโโ Mature and stable (consumer / utilities / banks)+โ โโโ High dividend -> DDM+โ โโโ Low dividend -> DCF + PE Band+โโโ High growth (tech / pharma / new energy)+โ โโโ DCF (high-growth phase) + PEG + PS+โโโ Cyclical (coal / steel / nonferrous)+โ โโโ PB + EV/EBITDA (avoid PE)+โโโ Diversified conglomerate+โ โโโ SOTP+โโโ Loss-making company+ โโโ PS (price-to-sales) + EV/Sales+```++### Cross-Validation++```+Use at least 2 valuation methods and take the middle value:+1. DCF -> intrinsic value+2. Comparable PE -> market pricing+3. If the difference >30% -> check whether assumptions are reasonable+```++## Output Format++```markdown+## Valuation Analysis: [Company Name / Code]++### Valuation Summary+| Method | Per-Share Value | Weight | Notes |+|------|---------|------|------|+| DCF | ยฅ32.5 | 50% | WACC=10%, g=2.5% |+| Comparable PE | ยฅ28.0 | 30% | Industry average 22x, EPS=1.27 |+| PB-ROE | ยฅ30.0 | 20% | Fair PB=2.5x |+| **Composite Target Price** | **ยฅ30.8** | | Current price 25.0, upside +23% |++### Sensitivity Analysis+[WACC vs growth-rate matrix]++### Valuation-Trap Check+- [x] Is PE a falsely low cyclical peak? -> No+- [x] Goodwill / net asset ratio -> 12%, safe+- [x] Receivables / revenue trend -> Stable, not deteriorating+- [ ] Gap in recurring net profit -> 15% difference, subsidy dependence worth attention++### Investment Rating: Buy+Target price ยฅ30.8, current price ยฅ25.0, upside 23%+```++## Notes++1. **DCF is highly sensitive to assumptions**: a 1% change in WACC can move valuation by 20%+, so sensitivity analysis is mandatory+2. **Comparable companies must truly be comparable**: same industry + same scale + same stage; do not apply leader PE multiples to small companies+3. **China A-share valuation system is unique**: shell value / liquidity premium / policy premium mean US-equity standards cannot be copied directly+4. **Valuation is not a target price**: markets can remain irrational for a long time, and valuation is an anchor, not a trading signal+5. **Special handling for cyclicals**: use normalized earnings (mid-cycle earnings), not current earnings+6. **Not suitable for cryptocurrencies**: traditional valuation frameworks do not apply to BTC / ETH; use on-chain metrics instead (see `onchain-analysis`)diff --git a/agent/src/skills/volatility/SKILL.md b/agent/src/skills/volatility/SKILL.mdnew file mode 100644index 000000000..3ae01da2c--- /dev/null+++ b/agent/src/skills/volatility/SKILL.md@@ -0,0 +1,50 @@+---+name: volatility+description: Volatility strategy. Trades mean reversion based on percentile ranking of historical volatility (HV). Suitable for any OHLCV data.+---+# Volatility Strategy++## Purpose++Uses percentile ranking of historical volatility (HV) to capture volatility mean reversion: build positions in low-volatility regimes while waiting for volatility expansion, and exit or short in high-volatility regimes to capture contraction.++## Signal Logic++1. **Compute HV**: annualized standard deviation of returns over the past `hv_window` days+2. **Percentile ranking**: percentile position of HV within the past `lookback` days (0-100)+3. **Signal generation**:+ - Percentile < `low_pct` โ go long (volatility is low, waiting for expansion)+ - Percentile > `high_pct` โ exit / go short (volatility is high, waiting for contraction)+ - Middle region โ keep the current position++## Key Implementation Details++- HV = `returns.rolling(hv_window).std() * sqrt(252)` (annualized)+- Percentile = `hv.rolling(lookback).rank(pct=True) * 100`+- For cryptocurrencies, use 365 instead of 252 as the annualization factor++## Parameters++| Parameter | Default | Description |+|------|--------|------|+| hv_window | 20 | Historical volatility calculation window |+| lookback | 120 | Lookback period for percentile ranking |+| low_pct | 20.0 | Low-volatility threshold (percentile) |+| high_pct | 80.0 | High-volatility threshold (percentile) |+| annualize | 252 | Annualization factor (252 for China A-shares, 365 for crypto) |++## Common Pitfalls++- Before the lookback window is filled, there is not enough data to compute percentiles, so the signal should be 0 (`fillna`)+- Volatility is not direction. Going long in low-volatility regimes does not guarantee price appreciation; it only means volatility expansion is statistically more likely+- Cryptocurrencies trade 7x24, so `annualize` should be set to 365++## Dependencies++```bash+pip install pandas numpy+```++## Signal Convention++- `1` = long (low-volatility regime), `-1` = short (high-volatility regime), `0` = stand asidediff --git a/agent/src/skills/volatility/example_signal_engine.py b/agent/src/skills/volatility/example_signal_engine.pynew file mode 100644index 000000000..98a840917--- /dev/null+++ b/agent/src/skills/volatility/example_signal_engine.py@@ -0,0 +1,162 @@+"""ๆณขๅจ็็ญ็ฅไฟกๅทๅผๆใ++ๅบไบๅๅฒๆณขๅจ็๏ผHV๏ผ็พๅไฝๆๅ่ฟ่กๅๅผๅๅฝไบคๆ๏ผ+ไฝๆณขๅบ้ดๅๅค็ญๅพ ๆฉๅผ ๏ผ้ซๆณขๅบ้ดๅ็ฉบ็ญๅพ ๆถ็ผฉใ็บฏ pandas ๅฎ็ฐใ+"""++from typing import Dict++import numpy as np+import pandas as pd+++def compute_hv(close: pd.Series, window: int = 20, annualize: int = 252) -> pd.Series:+ """่ฎก็ฎๅนดๅๅๅฒๆณขๅจ็ใ++ Args:+ close: ๆถ็ไปทๅบๅใ+ window: ๆณขๅจ็่ฎก็ฎ็ชๅฃใ+ annualize: ๅนดๅ็ณปๆฐ๏ผA่ก252๏ผๅ ๅฏ365๏ผใ++ Returns:+ ๅนดๅๅๅฒๆณขๅจ็ๅบๅใ+ """+ returns = close.pct_change()+ return returns.rolling(window).std() * np.sqrt(annualize)+++def compute_hv_percentile(hv: pd.Series, lookback: int = 120) -> pd.Series:+ """่ฎก็ฎ HV ็ๆปๅจ็พๅไฝๆๅใ++ Args:+ hv: ๅๅฒๆณขๅจ็ๅบๅใ+ lookback: ็พๅไฝๆๅๅ็ๆใ++ Returns:+ ็พๅไฝๅผ๏ผ0-100๏ผใ+ """+ return hv.rolling(lookback).rank(pct=True) * 100+++class SignalEngine:+ """ๆณขๅจ็ๅๅผๅๅฝไฟกๅทๅผๆใ++ ่ฎก็ฎๅๅฒๆณขๅจ็็็พๅไฝๆๅ๏ผไฝๆณขๅๅคใ้ซๆณขๅ็ฉบใ++ Attributes:+ hv_window: HV ่ฎก็ฎ็ชๅฃใ+ lookback: ็พๅไฝๆๅๅ็ๆใ+ low_pct: ไฝๆณข้ๅผ๏ผ็พๅไฝ๏ผใ+ high_pct: ้ซๆณข้ๅผ๏ผ็พๅไฝ๏ผใ+ annualize: ๅนดๅ็ณปๆฐใ++ Example:+ >>> engine = SignalEngine(hv_window=20, lookback=120)+ >>> signals = engine.generate({"BTC-USDT": df})+ >>> signals["BTC-USDT"].value_counts()+ """++ def __init__(+ self,+ hv_window: int = 20,+ lookback: int = 120,+ low_pct: float = 20.0,+ high_pct: float = 80.0,+ annualize: int = 252,+ ):+ """ๅๅงๅๆณขๅจ็ๅผๆใ++ Args:+ hv_window: HV ่ฎก็ฎ็ชๅฃใ+ lookback: ็พๅไฝๆๅๅ็ๆใ+ low_pct: ไฝๆณข้ๅผ๏ผ็พๅไฝ๏ผใ+ high_pct: ้ซๆณข้ๅผ๏ผ็พๅไฝ๏ผใ+ annualize: ๅนดๅ็ณปๆฐ๏ผA่ก252๏ผๅ ๅฏ365๏ผใ+ """+ self.hv_window = hv_window+ self.lookback = lookback+ self.low_pct = low_pct+ self.high_pct = high_pct+ self.annualize = annualize++ def generate(self, data_map: Dict[str, pd.DataFrame]) -> Dict[str, pd.Series]:+ """ๆ นๆฎๆณขๅจ็็พๅไฝ็ๆไบคๆไฟกๅทใ++ Args:+ data_map: ๆ ็ไปฃ็ ๅฐ OHLCV DataFrame ็ๆ ๅฐใ++ Returns:+ ๆ ็ไปฃ็ ๅฐไฟกๅท Series ็ๆ ๅฐ๏ผ1=ๅๅค, -1=ๅ็ฉบ, 0=่งๆ๏ผใ+ """+ result = {}+ for code, df in data_map.items():+ result[code] = self._generate_one(df)+ return result++ def _generate_one(self, df: pd.DataFrame) -> pd.Series:+ """ๅฏนๅไธชๆ ็็ๆๆณขๅจ็ไฟกๅทใ++ Args:+ df: OHLCV DataFrameใ++ Returns:+ ไฟกๅท Seriesใ+ """+ close = df["close"]+ hv = compute_hv(close, self.hv_window, self.annualize)+ pct = compute_hv_percentile(hv, self.lookback)++ signal = pd.Series(0, index=df.index)+ signal[pct < self.low_pct] = 1 # ไฝๆณขๅๅค+ signal[pct > self.high_pct] = -1 # ้ซๆณขๅ็ฉบ+ return signal.fillna(0).astype(int)+++if __name__ == "__main__":+ import requests++ def _fetch_okx(inst_id: str, bar: str = "1D", limit: int = 300) -> pd.DataFrame:+ """ไป OKX API ่ทๅ K ็บฟๆฐๆฎใ++ Args:+ inst_id: ไบคๆๅฏนๆ ่ฏ๏ผๅฆ "BTC-USDT"ใ+ bar: K ็บฟๅจๆใ+ limit: ่ทๅๆ นๆฐใ++ Returns:+ OHLCV DataFrameใ+ """+ resp = requests.get(+ "https://www.okx.com/api/v5/market/candles",+ params={"instId": inst_id, "bar": bar, "limit": str(limit)},+ )+ candles = resp.json()["data"]+ columns = ["ts", "open", "high", "low", "close", "vol", "volCcy", "volCcyQuote", "confirm"]+ df = pd.DataFrame(reversed(candles), columns=columns)+ df["ts"] = pd.to_datetime(df["ts"].astype("int64"), unit="ms")+ df = df.set_index("ts")+ for col in ["open", "high", "low", "close"]:+ df[col] = df[col].astype(float)+ df["volume"] = df["vol"].astype(float)+ return df++ symbols = ["BTC-USDT", "ETH-USDT", "SOL-USDT"]+ data_map = {}+ for sym in symbols:+ print(f"Fetching {sym} ...")+ data_map[sym] = _fetch_okx(sym, bar="1D", limit=300)++ # ๅ ๅฏ่ดงๅธ็จ 365 ๅนดๅ+ engine = SignalEngine(hv_window=20, lookback=120, annualize=365)+ signals = engine.generate(data_map)++ for sym in symbols:+ sig = signals[sym]+ hv = compute_hv(data_map[sym]["close"], 20, 365)+ pct = compute_hv_percentile(hv, 120)+ print(f"\n{sym} ({len(sig)} bars)")+ print(f" Current HV(20): {hv.iloc[-1]:.1%}")+ print(f" HV Percentile: {pct.iloc[-1]:.0f}%")+ print(f" Buy signals: {(sig == 1).sum()}")+ print(f" Sell signals: {(sig == -1).sum()}")+ print(f" Neutral: {(sig == 0).sum()}")diff --git a/agent/src/skills/web-reader/SKILL.md b/agent/src/skills/web-reader/SKILL.mdnew file mode 100644index 000000000..f621a59aa--- /dev/null+++ b/agent/src/skills/web-reader/SKILL.md@@ -0,0 +1,56 @@+---+name: web-reader+description: Read web pages, articles, and document links by converting URLs into Markdown text. Use the `read_url` tool directly, without bash.+---+# Web Reading++## Purpose++Converts any URL into clean Markdown text, removing ads, navigation, styling, and other distractions. Suitable for:+- Reading API documentation (`tushare`, `OKX`, `yfinance`, and similar)+- Reading technical articles and blogs+- Retrieving research reports and announcements+- Reading GitHub README / Wiki pages++## Usage++**Call the `read_url` tool directly (do not use bash + requests, call the tool directly):**++```+read_url(url="https://tushare.pro/document/2?doc_id=27")+```++Returns JSON:+```json+{+ "status": "ok",+ "title": "Page title",+ "url": "Original URL",+ "content": "Page content in Markdown format",+ "length": 12345+}+```++## Notes++- Content longer than 8000 characters will be truncated, with the total length noted at the end+- Some websites may block Jina Reader (returning HTTP 451). In that case, fall back to bash + requests+- Dynamically rendered SPA pages may return only skeleton HTML+- Chinese content is supported normally++## Common Usage++### Read API Documentation+```+read_url(url="https://tushare.pro/document/2?doc_id=27")+```++### Read Technical Articles+```+read_url(url="https://blog.example.com/quantitative-trading-guide")+```++### Retrieve GitHub Project Information+```+read_url(url="https://github.com/PaddlePaddle/PaddleOCR")+```diff --git a/agent/src/skills/yfinance/SKILL.md b/agent/src/skills/yfinance/SKILL.mdnew file mode 100644index 000000000..ff99fb148--- /dev/null+++ b/agent/src/skills/yfinance/SKILL.md@@ -0,0 +1,254 @@+---+name: yfinance+description: yfinance global market data interface โ retrieve OHLCV, financials, insider transactions, and institutional holdings for US stocks, HK stocks, ETFs, and indices via Yahoo Finance. Free, no API key required.+---+# yfinance++## Overview++yfinance is an open-source Python wrapper for Yahoo Finance, providing global market data (US stocks, HK stocks, ETFs, indices) including historical and real-time quotes. **Completely free, no registration or API key required.**++The project has a built-in yfinance DataLoader (`backtest/loaders/yfinance_loader.py`). When backtesting, set `source: "yfinance"` or `source: "auto"` to invoke it automatically.++## Quick Start++```bash+pip install yfinance pandas+```++```python+import yfinance as yf++# Apple daily bars for the past year+df = yf.download("AAPL", start="2025-01-01", end="2026-01-01", progress=False)+print(df.head())++# Tencent (HK-listed)+df = yf.download("0700.HK", start="2025-01-01", end="2026-01-01", progress=False)+print(df.head())+```++## Ticker Format Conversion++The project uses a unified ticker format. The DataLoader automatically converts to yfinance format:++| Project Format | yfinance Format | Market |+|---------------|----------------|--------|+| `AAPL.US` | `AAPL` | US stock |+| `MSFT.US` | `MSFT` | US stock |+| `700.HK` | `0700.HK` | HK stock |+| `9988.HK` | `9988.HK` | HK stock |+| `SPY.US` | `SPY` | US ETF |++**Rules:**+- US stocks: strip the `.US` suffix โ use the raw ticker+- HK stocks: keep `.HK`, pad the number to 4 digits (`700` โ `0700`)++## Supported Data Types++### 1. Historical OHLCV++```python+import yfinance as yf+import pandas as pd++# Single stock+df = yf.download("AAPL", start="2025-01-01", end="2026-01-01", progress=False)++# Batch download+df = yf.download(["AAPL", "MSFT", "GOOGL"], start="2025-01-01", end="2026-01-01", progress=False)++# Specific interval+df = yf.download("AAPL", start="2026-03-01", end="2026-03-30",+ interval="1h", progress=False) # 1m/5m/15m/30m/1h/1d/1wk/1mo+```++**Supported intervals:**+- Minute-level: `1m`, `2m`, `5m`, `15m`, `30m`, `60m`, `90m`+- Hourly: `1h`+- Daily and above: `1d`, `5d`, `1wk`, `1mo`, `3mo`++**Minute data limits:**+- `1m`: up to 7 days of history+- `2m/5m/15m/30m/60m/90m`: up to 60 days+- `1h`: up to 730 days+- `1d` and above: unlimited++### 2. Company Info++```python+ticker = yf.Ticker("AAPL")++info = ticker.info+print(f"Company: {info.get('longName')}")+print(f"Industry: {info.get('industry')}")+print(f"Market cap: {info.get('marketCap')}")+print(f"PE: {info.get('trailingPE')}")+print(f"EPS: {info.get('trailingEps')}")+print(f"Dividend yield: {info.get('dividendYield')}")+```++### 3. Financial Statements++```python+ticker = yf.Ticker("AAPL")++# Income statement (annual)+income = ticker.financials+# Income statement (quarterly)+income_q = ticker.quarterly_financials++# Balance sheet+balance = ticker.balance_sheet++# Cash flow statement+cashflow = ticker.cashflow++# Earnings data+earnings = ticker.earnings+```++### 4. Dividends and Splits++```python+ticker = yf.Ticker("AAPL")++# Dividend history+dividends = ticker.dividends++# Stock split history+splits = ticker.splits++# All corporate actions+actions = ticker.actions+```++### 5. Institutional Holdings++```python+ticker = yf.Ticker("AAPL")++# Institutional holders+holders = ticker.institutional_holders++# Major holders summary+major = ticker.major_holders++# Insider transactions+insider = ticker.insider_transactions+```++### 6. Indices and ETFs++```python+# Major indices+sp500 = yf.download("^GSPC", start="2025-01-01", end="2026-01-01", progress=False) # S&P 500+nasdaq = yf.download("^IXIC", start="2025-01-01", end="2026-01-01", progress=False) # NASDAQ+hsi = yf.download("^HSI", start="2025-01-01", end="2026-01-01", progress=False) # Hang Seng Index++# ETFs+spy = yf.download("SPY", start="2025-01-01", end="2026-01-01", progress=False)+qqq = yf.download("QQQ", start="2025-01-01", end="2026-01-01", progress=False)+```++### 7. FX Rates++```python+# Currency pairs+usdcny = yf.download("CNY=X", start="2025-01-01", end="2026-01-01", progress=False)+usdhkd = yf.download("HKD=X", start="2025-01-01", end="2026-01-01", progress=False)+eurusd = yf.download("EURUSD=X", start="2025-01-01", end="2026-01-01", progress=False)+```++## Popular Ticker Reference++### US Stocks++| Ticker | Company |+|--------|---------|+| AAPL | Apple |+| MSFT | Microsoft |+| GOOGL | Alphabet (Google) |+| AMZN | Amazon |+| NVDA | NVIDIA |+| META | Meta Platforms |+| TSLA | Tesla |+| BRK-B | Berkshire Hathaway |++### HK Stocks++| Project Format | yfinance Format | Company |+|---------------|----------------|---------|+| 700.HK | 0700.HK | Tencent |+| 9988.HK | 9988.HK | Alibaba |+| 9618.HK | 9618.HK | JD.com |+| 3690.HK | 3690.HK | Meituan |+| 1810.HK | 1810.HK | Xiaomi |+| 2318.HK | 2318.HK | Ping An |++### Major Indices++| Ticker | Index |+|--------|-------|+| ^GSPC | S&P 500 |+| ^DJI | Dow Jones Industrial Average |+| ^IXIC | NASDAQ Composite |+| ^HSI | Hang Seng Index |+| ^N225 | Nikkei 225 |+| ^FTSE | FTSE 100 |++### Sector ETFs++| Ticker | Sector |+|--------|--------|+| XLK | Technology |+| XLF | Financials |+| XLE | Energy |+| XLV | Healthcare |+| XLY | Consumer Discretionary |+| XLP | Consumer Staples |+| XLI | Industrials |+| XLU | Utilities |++## Backtest Usage++### config.json Example++```json+{+ "source": "yfinance",+ "codes": ["AAPL.US", "MSFT.US"],+ "start_date": "2020-01-01",+ "end_date": "2026-03-30",+ "initial_cash": 1000000,+ "commission": 0.001,+ "extra_fields": null+}+```++### Cross-Market Auto Mode++```json+{+ "source": "auto",+ "codes": ["000001.SZ", "AAPL.US", "700.HK", "BTC-USDT"],+ "start_date": "2024-01-01",+ "end_date": "2026-03-30",+ "initial_cash": 1000000,+ "commission": 0.001,+ "extra_fields": null+}+```++`source: "auto"` routes automatically by ticker format: A-shares โ tushare, HK/US stocks โ yfinance, crypto โ OKX.++## Notes++- **Free, no API key**: yfinance scrapes Yahoo Finance public data โ no registration needed+- **Rate limits**: high-frequency requests may trigger temporary Yahoo bans โ prefer batch downloads over per-ticker loops+- **Minute data range**: limited by Yahoo Finance (see table above)+- **HK tickers**: Yahoo Finance uses 4-digit numbers + `.HK`; pad with leading zeros where needed+- **Adjustment**: `auto_adjust=True` (default) returns forward-adjusted prices; the project loader uses `auto_adjust=False`+- **Timezone**: returned data includes timezone info; the DataLoader strips it automatically+- **extra_fields not supported**: yfinance via the backtest loader returns OHLCV only; PE/PB and other fundamentals require separate `yf.Ticker().info` calls+- **Comparison with Tushare**: Tushare covers deep A-share data (financials, fund flows, block trades, etc.); yfinance covers global markets but with less depthdiff --git a/agent/src/swarm/__init__.py b/agent/src/swarm/__init__.pynew file mode 100644index 000000000..8edea8671--- /dev/null+++ b/agent/src/swarm/__init__.py@@ -0,0 +1,35 @@+"""Swarm multi-agent system โ package entry point."""++from __future__ import annotations++from src.swarm.models import (+ RunStatus,+ SwarmAgentSpec,+ SwarmEvent,+ SwarmMessage,+ SwarmRun,+ SwarmTask,+ TaskStatus,+ WorkerResult,+)+from src.swarm.presets import build_run_from_preset, list_presets, load_preset+from src.swarm.runtime import SwarmRuntime+from src.swarm.store import SwarmStore+from src.swarm.worker import run_worker++__all__ = [+ "RunStatus",+ "SwarmAgentSpec",+ "SwarmEvent",+ "SwarmMessage",+ "SwarmRun",+ "SwarmRuntime",+ "SwarmStore",+ "SwarmTask",+ "TaskStatus",+ "WorkerResult",+ "build_run_from_preset",+ "list_presets",+ "load_preset",+ "run_worker",+]diff --git a/agent/src/swarm/api_models.py b/agent/src/swarm/api_models.pynew file mode 100644index 000000000..186c95b35--- /dev/null+++ b/agent/src/swarm/api_models.py@@ -0,0 +1,84 @@+"""Swarm API โ FastAPI request/response models.++Separate from core models (models.py), designed for HTTP API serialization.+"""++from __future__ import annotations++from pydantic import BaseModel, Field+++class CreateSwarmRunRequest(BaseModel):+ """Request body for creating a Swarm Run.++ Attributes:+ preset_name: YAML preset name.+ user_vars: User variables for template rendering.+ """++ preset_name: str+ user_vars: dict[str, str] = Field(default_factory=dict)+++class SwarmRunSummary(BaseModel):+ """Summary entry for a Swarm Run list item.++ Attributes:+ id: Run unique ID.+ preset_name: Preset name used.+ status: Current status.+ created_at: ISO-format creation time.+ task_count: Total task count.+ completed_count: Completed task count.+ """++ id: str+ preset_name: str+ status: str+ created_at: str+ task_count: int+ completed_count: int+++class SwarmRunResponse(BaseModel):+ """Swarm Run detail response.++ Attributes:+ id: Run unique ID.+ preset_name: Preset name used.+ status: Current status.+ user_vars: User-provided variables.+ agents: List of agent definitions.+ tasks: List of task statuses.+ created_at: ISO-format creation time.+ completed_at: ISO-format completion time.+ final_report: Final aggregated report.+ """++ id: str+ preset_name: str+ status: str+ user_vars: dict[str, str]+ agents: list[dict]+ tasks: list[dict]+ created_at: str+ completed_at: str | None = None+ final_report: str | None = None+++class SwarmPresetInfo(BaseModel):+ """Swarm preset summary info.++ Attributes:+ name: Preset name.+ title: Preset title.+ description: Preset description.+ agent_count: Number of agents.+ variables: Variable definition list.+ """++ name: str+ title: str+ description: str+ agent_count: int+ variables: list[dict]diff --git a/agent/src/swarm/mailbox.py b/agent/src/swarm/mailbox.pynew file mode 100644index 000000000..fbce4f85f--- /dev/null+++ b/agent/src/swarm/mailbox.py@@ -0,0 +1,90 @@+"""Swarm multi-agent system โ file-based Mailbox.++File-system-based message passing between agents. Each agent has an independent+inbox directory. Messages are sorted by timestamp and carry only summaries and+artifact paths, not full content.++Directory structure:+ inboxes/{agent_id}/msg-{timestamp}-{uuid_short}.json+"""++from __future__ import annotations++import uuid+from pathlib import Path++from src.swarm.models import SwarmMessage+++class Mailbox:+ """File-based agent message inbox.++ Each agent has an independent directory under run_dir/inboxes/{agent_id}/.+ Messages are stored as JSON files with timestamps in the filename for ordering.++ Attributes:+ run_dir: Root directory of the current run.+ """++ def __init__(self, run_dir: Path) -> None:+ """Initialize Mailbox.++ Args:+ run_dir: Path to .swarm/runs/{run_id}/ directory.+ """+ self.run_dir = run_dir+ self._inboxes_dir = run_dir / "inboxes"+ self._inboxes_dir.mkdir(parents=True, exist_ok=True)++ def send(self, msg: SwarmMessage) -> None:+ """Send a message to the target agent's inbox.++ Args:+ msg: SwarmMessage to send.+ """+ inbox_dir = self._inboxes_dir / msg.to+ inbox_dir.mkdir(parents=True, exist_ok=True)++ ts_safe = msg.timestamp.replace(":", "-").replace(".", "-")+ uid = uuid.uuid4().hex[:8]+ filename = f"msg-{ts_safe}-{uid}.json"++ msg_path = inbox_dir / filename+ tmp_path = msg_path.with_suffix(".tmp")+ tmp_path.write_text(msg.model_dump_json(indent=2), encoding="utf-8")+ tmp_path.replace(msg_path)++ def read_inbox(self, agent_id: str) -> list[SwarmMessage]:+ """Read all messages for the given agent, sorted by timestamp.++ Args:+ agent_id: Agent ID.++ Returns:+ List of SwarmMessage sorted by timestamp ascending.+ """+ inbox_dir = self._inboxes_dir / agent_id+ if not inbox_dir.exists():+ return []++ messages: list[SwarmMessage] = []+ for path in sorted(inbox_dir.glob("msg-*.json")):+ messages.append(+ SwarmMessage.model_validate_json(path.read_text(encoding="utf-8"))+ )++ messages.sort(key=lambda m: m.timestamp)+ return messages++ def read_from(self, agent_id: str, from_agent: str) -> list[SwarmMessage]:+ """Read messages in an agent's inbox from a specific sender.++ Args:+ agent_id: Receiving agent ID.+ from_agent: Sending agent ID.++ Returns:+ List of SwarmMessage from from_agent, sorted by timestamp ascending.+ """+ all_messages = self.read_inbox(agent_id)+ return [m for m in all_messages if m.from_agent == from_agent]diff --git a/agent/src/swarm/models.py b/agent/src/swarm/models.pynew file mode 100644index 000000000..cce9fe1df--- /dev/null+++ b/agent/src/swarm/models.py@@ -0,0 +1,203 @@+"""Swarm multi-agent system โ data models.++All Pydantic models defined here, shared by store / task_store / mailbox / worker / runtime.+Enums use str+Enum to ensure JSON-serialization compatibility.+"""++from __future__ import annotations++from enum import Enum++from pydantic import BaseModel, Field+++class TaskStatus(str, Enum):+ """SwarmTask lifecycle status.++ Transitions:+ pending -> blocked -> in_progress -> completed | failed | cancelled+ """++ pending = "pending"+ blocked = "blocked"+ in_progress = "in_progress"+ completed = "completed"+ failed = "failed"+ cancelled = "cancelled"+++class RunStatus(str, Enum):+ """SwarmRun lifecycle status.++ Transitions:+ pending -> running -> completed | failed | cancelled+ """++ pending = "pending"+ running = "running"+ completed = "completed"+ failed = "failed"+ cancelled = "cancelled"+++class SwarmAgentSpec(BaseModel):+ """Role definition for a single agent in a Swarm.++ Parsed from YAML presets, describes the agent's identity, available tools, and constraints.++ Attributes:+ id: Unique identifier, e.g. "macro_analyst".+ role: Role description.+ system_prompt: System prompt injected into the LLM.+ tools: Whitelist of allowed tool names.+ skills: List of allowed skill names.+ max_iterations: Maximum ReAct loop iterations.+ timeout_seconds: Worker timeout in seconds.+ model_name: Override default model; None uses global config.+ max_retries: Maximum retry attempts on failure.+ """++ id: str+ role: str+ system_prompt: str+ tools: list[str] = Field(default_factory=list)+ skills: list[str] = Field(default_factory=list)+ max_iterations: int = 25+ timeout_seconds: int = 300+ model_name: str | None = None+ max_retries: int = 2+++class SwarmTask(BaseModel):+ """A task node in the Swarm DAG.++ Each task is bound to an agent. Dependencies are declared via depends_on,+ and blocked_by tracks remaining incomplete upstream tasks at runtime.++ Attributes:+ id: Unique identifier, e.g. "analyze_macro".+ agent_id: ID of the agent executing this task.+ prompt_template: User prompt template supporting {var} placeholders.+ depends_on: DAG-declared upstream task IDs (immutable).+ blocked_by: Remaining incomplete upstream task IDs (shrinks at runtime).+ input_from: Mapping to pull summaries from upstream tasks, e.g. {"macro": "analyze_macro"}.+ status: Current task status.+ summary: Summary text after completion.+ artifacts: List of output file paths.+ error: Error message on failure.+ started_at: ISO-format start time.+ completed_at: ISO-format completion time.+ worker_iterations: Actual ReAct iterations executed by the worker.+ """++ id: str+ agent_id: str+ prompt_template: str+ depends_on: list[str] = Field(default_factory=list)+ blocked_by: list[str] = Field(default_factory=list)+ input_from: dict[str, str] = Field(default_factory=dict)+ status: TaskStatus = TaskStatus.pending+ summary: str | None = None+ artifacts: list[str] = Field(default_factory=list)+ error: str | None = None+ started_at: str | None = None+ completed_at: str | None = None+ worker_iterations: int = 0+++class SwarmMessage(BaseModel):+ """Message passed between agents via the Mailbox file inbox.++ Carries only summaries and artifact paths to avoid context bloat.++ Attributes:+ id: Unique message ID.+ type: Message type, e.g. "task_result", "request", "broadcast".+ from_agent: Sending agent ID.+ to: Receiving agent ID.+ content: Message body (summary level).+ artifact_paths: Associated artifact file paths.+ timestamp: ISO-format timestamp.+ """++ id: str+ type: str+ from_agent: str+ to: str+ content: str+ artifact_paths: list[str] = Field(default_factory=list)+ timestamp: str+++class SwarmEvent(BaseModel):+ """Swarm event log entry.++ Appended to events.jsonl; supports SSE streaming and post-run audit.++ Attributes:+ type: Event type, e.g. "run_started", "task_completed", "task_failed".+ agent_id: Associated agent ID (optional).+ task_id: Associated task ID (optional).+ data: Arbitrary additional data.+ timestamp: ISO-format timestamp.+ """++ type: str+ agent_id: str | None = None+ task_id: str | None = None+ data: dict = Field(default_factory=dict)+ timestamp: str+++class SwarmRun(BaseModel):+ """Complete state of a single Swarm preset execution.++ Persisted as .swarm/runs/{id}/run.json; the top-level aggregate root.++ Attributes:+ id: Unique run ID (UUID).+ preset_name: Preset name used, e.g. "research_team".+ status: Run status.+ user_vars: User-provided variables for template rendering.+ agents: List of participating agent definitions.+ tasks: All task entries.+ created_at: ISO-format creation time.+ completed_at: ISO-format completion time.+ final_report: Final aggregated report text.+ total_input_tokens: Cumulative input tokens across all workers.+ total_output_tokens: Cumulative output tokens across all workers.+ """++ id: str+ preset_name: str+ status: RunStatus = RunStatus.pending+ user_vars: dict[str, str] = Field(default_factory=dict)+ agents: list[SwarmAgentSpec] = Field(default_factory=list)+ tasks: list[SwarmTask] = Field(default_factory=list)+ created_at: str+ completed_at: str | None = None+ final_report: str | None = None+ total_input_tokens: int = 0+ total_output_tokens: int = 0+++class WorkerResult(BaseModel):+ """Return value after worker execution completes.++ Attributes:+ status: "completed" or "failed".+ summary: Execution summary.+ artifact_paths: List of generated artifact file paths.+ iterations: Actual ReAct iterations executed.+ error: Error message on failure.+ input_tokens: Cumulative input tokens (exact or estimated).+ output_tokens: Cumulative output tokens (exact or estimated).+ """++ status: str+ summary: str+ artifact_paths: list[str] = Field(default_factory=list)+ iterations: int = 0+ error: str | None = None+ input_tokens: int = 0+ output_tokens: int = 0diff --git a/agent/src/swarm/presets.py b/agent/src/swarm/presets.pynew file mode 100644index 000000000..f523ed446--- /dev/null+++ b/agent/src/swarm/presets.py@@ -0,0 +1,135 @@+"""Swarm YAML preset loader.++Reads YAML preset files from agent/config/swarm/ and parses them into+SwarmRun / SwarmAgentSpec / SwarmTask data models.+"""++from __future__ import annotations++import uuid+from datetime import datetime, timezone+from pathlib import Path++import yaml++from src.swarm.models import RunStatus, SwarmAgentSpec, SwarmRun, SwarmTask, TaskStatus++PRESETS_DIR = Path(__file__).resolve().parents[2] / "config" / "swarm"+++def load_preset(name: str) -> dict:+ """Load a YAML preset by name.++ Args:+ name: Preset name (without .yaml extension).++ Returns:+ Parsed YAML dict.++ Raises:+ FileNotFoundError: If the preset file does not exist.+ """+ path = PRESETS_DIR / f"{name}.yaml"+ if not path.exists():+ available = [p.stem for p in PRESETS_DIR.glob("*.yaml")] if PRESETS_DIR.exists() else []+ raise FileNotFoundError(+ f"Preset '{name}' not found at {path}. Available: {available}"+ )+ return yaml.safe_load(path.read_text(encoding="utf-8"))+++def list_presets() -> list[dict]:+ """Return summary info for all available presets.++ Returns:+ List of dicts with keys: name, title, description, agent_count, variables.+ """+ if not PRESETS_DIR.exists():+ return []++ results: list[dict] = []+ for path in sorted(PRESETS_DIR.glob("*.yaml")):+ try:+ data = yaml.safe_load(path.read_text(encoding="utf-8"))+ except Exception:+ continue++ results.append({+ "name": data.get("name", path.stem),+ "title": data.get("title", ""),+ "description": data.get("description", ""),+ "agent_count": len(data.get("agents", [])),+ "variables": data.get("variables", []),+ })++ return results+++def build_run_from_preset(preset_name: str, user_vars: dict[str, str]) -> SwarmRun:+ """Create a SwarmRun from a preset with user variables applied.++ Steps:+ 1. Load preset YAML+ 2. Create SwarmAgentSpec list from agents section+ 3. Create SwarmTask list from tasks section+ 4. Generate run_id: f"swarm-{datetime}-{uuid[:8]}"+ 5. Return SwarmRun with all fields populated++ Args:+ preset_name: Name of the preset to load.+ user_vars: User-provided variables for prompt template rendering.++ Returns:+ Fully constructed SwarmRun instance (status=pending).++ Raises:+ FileNotFoundError: If preset does not exist.+ ValueError: If preset YAML is malformed.+ """+ data = load_preset(preset_name)++ # Parse agents+ agents: list[SwarmAgentSpec] = []+ for agent_data in data.get("agents", []):+ agents.append(SwarmAgentSpec(+ id=agent_data["id"],+ role=agent_data.get("role", ""),+ system_prompt=agent_data.get("system_prompt", ""),+ tools=agent_data.get("tools", []),+ skills=agent_data.get("skills", []),+ max_iterations=agent_data.get("max_iterations", 25),+ timeout_seconds=agent_data.get("timeout_seconds", 300),+ model_name=agent_data.get("model_name"),+ max_retries=agent_data.get("max_retries", 2),+ ))++ # Parse tasks, initialize blocked_by from depends_on+ tasks: list[SwarmTask] = []+ for task_data in data.get("tasks", []):+ depends_on = task_data.get("depends_on", [])+ status = TaskStatus.blocked if depends_on else TaskStatus.pending+ tasks.append(SwarmTask(+ id=task_data["id"],+ agent_id=task_data["agent_id"],+ prompt_template=task_data.get("prompt_template", ""),+ depends_on=depends_on,+ blocked_by=list(depends_on),+ input_from=task_data.get("input_from", {}),+ status=status,+ ))++ # Generate run ID+ now = datetime.now(timezone.utc)+ ts = now.strftime("%Y%m%d-%H%M%S")+ short_uuid = uuid.uuid4().hex[:8]+ run_id = f"swarm-{ts}-{short_uuid}"++ return SwarmRun(+ id=run_id,+ preset_name=preset_name,+ status=RunStatus.pending,+ user_vars=user_vars,+ agents=agents,+ tasks=tasks,+ created_at=now.isoformat(),+ )diff --git a/agent/src/swarm/runtime.py b/agent/src/swarm/runtime.pynew file mode 100644index 000000000..aa06f08a4--- /dev/null+++ b/agent/src/swarm/runtime.py@@ -0,0 +1,492 @@+"""Swarm DAG orchestration runtime.++Core orchestrator: schedules workers by topological layer, parallel within each+layer and serial between layers. Execution runs in a background daemon thread+with cancellation and event callback support.+"""++from __future__ import annotations++import logging+import threading+from concurrent.futures import Future, ThreadPoolExecutor, as_completed+from datetime import datetime, timezone+from pathlib import Path+from typing import Callable++from src.swarm.mailbox import Mailbox+from src.swarm.models import (+ RunStatus,+ SwarmAgentSpec,+ SwarmEvent,+ SwarmRun,+ SwarmTask,+ TaskStatus,+ WorkerResult,+)+from src.swarm.presets import build_run_from_preset+from src.swarm.store import SwarmStore+from src.swarm.task_store import (+ TaskStore,+ resolve_dependencies,+ topological_layers,+ validate_dag,+)+from src.swarm.worker import run_worker++logger = logging.getLogger(__name__)+++class SwarmRuntime:+ """Swarm DAG orchestration engine.++ Manages the full lifecycle of a swarm run: creation, scheduling, execution,+ and cancellation. Each run executes in an independent background daemon thread;+ tasks within a layer run in parallel via ThreadPoolExecutor.++ Attributes:+ _store: SwarmStore persistence layer.+ _max_workers: Maximum concurrent workers in ThreadPoolExecutor.+ """++ def __init__(self, store: SwarmStore, max_workers: int = 4) -> None:+ """Initialize SwarmRuntime.++ Args:+ store: SwarmStore instance for run persistence.+ max_workers: Maximum concurrent worker threads.+ """+ self._store = store+ self._max_workers = max_workers+ self._cancel_events: dict[str, threading.Event] = {}+ self._live_callbacks: dict[str, Callable] = {}+ self._lock = threading.Lock()++ def start_run(+ self,+ preset_name: str,+ user_vars: dict[str, str],+ live_callback: Callable | None = None,+ ) -> SwarmRun:+ """Start a swarm run. Returns immediately, execution happens in background.++ Args:+ preset_name: YAML preset name to execute.+ user_vars: User-provided variables for prompt templates.+ live_callback: Optional callback invoked for each event in real-time.++ Returns:+ The created SwarmRun instance (status=pending initially).++ Raises:+ FileNotFoundError: If preset does not exist.+ ValueError: If DAG validation fails.+ """+ run = build_run_from_preset(preset_name, user_vars)+ validate_dag(run.tasks)+ self._store.create_run(run)++ cancel_event = threading.Event()+ with self._lock:+ self._cancel_events[run.id] = cancel_event+ if live_callback is not None:+ self._live_callbacks[run.id] = live_callback++ thread = threading.Thread(+ target=self._execute_run,+ args=(run, cancel_event),+ name=f"swarm-{run.id}",+ daemon=True,+ )+ thread.start()++ return run++ def cancel_run(self, run_id: str) -> bool:+ """Signal cancellation for a running swarm.++ Args:+ run_id: ID of the run to cancel.++ Returns:+ True if cancellation was signalled, False if run not found.+ """+ with self._lock:+ cancel_event = self._cancel_events.get(run_id)+ if cancel_event is None:+ return False+ cancel_event.set()+ return True++ def _emit_event(self, run_id: str, event: SwarmEvent) -> None:+ """Persist an event and forward to live callback if registered.++ Args:+ run_id: Run identifier.+ event: Event to persist.+ """+ try:+ self._store.append_event(run_id, event)+ except Exception:+ logger.warning("Failed to persist event for run %s", run_id, exc_info=True)+ with self._lock:+ cb = self._live_callbacks.get(run_id)+ if cb is not None:+ try:+ cb(event)+ except Exception:+ logger.warning("Live callback failed for run %s", run_id, exc_info=True)++ def _make_event(+ self,+ event_type: str,+ agent_id: str | None = None,+ task_id: str | None = None,+ data: dict | None = None,+ ) -> SwarmEvent:+ """Create a SwarmEvent with current timestamp.++ Args:+ event_type: Event type string.+ agent_id: Optional agent identifier.+ task_id: Optional task identifier.+ data: Optional additional data.++ Returns:+ SwarmEvent instance.+ """+ return SwarmEvent(+ type=event_type,+ agent_id=agent_id,+ task_id=task_id,+ data=data or {},+ timestamp=datetime.now(timezone.utc).isoformat(),+ )++ def _execute_run(self, run: SwarmRun, cancel_event: threading.Event) -> None:+ """Core orchestration loop (runs in background thread).++ Steps:+ 1. Update run status to running+ 2. Initialize TaskStore, save all tasks+ 3. Compute topological layers+ 4. For each layer:+ a. Check cancellation+ b. Submit all tasks to ThreadPoolExecutor+ c. Collect results, resolve dependencies, update store+ 5. Update run status to completed/failed++ Args:+ run: SwarmRun to execute.+ cancel_event: Threading event for cancellation signalling.+ """+ run_id = run.id+ run_dir = self._store.run_dir(run_id)++ # Mark as running+ run.status = RunStatus.running+ self._store.update_run(run)+ self._emit_event(run_id, self._make_event("run_started"))++ # Initialize task store+ task_store = TaskStore(run_dir)+ for task in run.tasks:+ task_store.save_task(task)++ # Build agent lookup+ agent_map: dict[str, SwarmAgentSpec] = {a.id: a for a in run.agents}++ # Compute execution layers+ layers = topological_layers(run.tasks)+ task_summaries: dict[str, str] = {}+ all_succeeded = True++ try:+ for layer_idx, layer_task_ids in enumerate(layers):+ # Check cancellation between layers+ if cancel_event.is_set():+ logger.info("Run %s cancelled at layer %d", run_id, layer_idx)+ self._cancel_remaining_tasks(task_store, layer_task_ids, run.tasks)+ all_succeeded = False+ break++ self._emit_event(+ run_id,+ self._make_event(+ "layer_started",+ data={"layer": layer_idx, "tasks": layer_task_ids},+ ),+ )++ # Execute all tasks in this layer in parallel+ layer_results = self._execute_layer(+ run=run,+ task_store=task_store,+ agent_map=agent_map,+ layer_task_ids=layer_task_ids,+ task_summaries=task_summaries,+ run_dir=run_dir,+ cancel_event=cancel_event,+ )++ # Process results+ for tid, result in layer_results.items():+ # Accumulate token counts to run totals+ run.total_input_tokens += result.input_tokens+ run.total_output_tokens += result.output_tokens++ if result.status in ("completed", "timeout", "token_limit"):+ task_summaries[tid] = result.summary+ now_iso = datetime.now(timezone.utc).isoformat()+ task_store.update_status(+ tid, TaskStatus.completed,+ summary=result.summary,+ completed_at=now_iso,+ artifacts=result.artifact_paths,+ worker_iterations=result.iterations,+ )+ resolve_dependencies(run_dir / "tasks", tid)+ self._emit_event(+ run_id,+ self._make_event("task_completed", task_id=tid,+ data={"status": result.status,+ "iterations": result.iterations,+ "input_tokens": result.input_tokens,+ "output_tokens": result.output_tokens}),+ )+ else:+ all_succeeded = False+ task_store.update_status(+ tid, TaskStatus.failed,+ error=result.error or "Unknown error",+ completed_at=datetime.now(timezone.utc).isoformat(),+ worker_iterations=result.iterations,+ )+ self._emit_event(+ run_id,+ self._make_event("task_failed", task_id=tid,+ data={"error": result.error,+ "input_tokens": result.input_tokens,+ "output_tokens": result.output_tokens}),+ )++ except Exception as exc:+ logger.error("Run %s failed with exception", run_id, exc_info=True)+ all_succeeded = False+ self._emit_event(+ run_id,+ self._make_event("run_error", data={"error": str(exc)}),+ )++ # Finalize run+ final_status = (+ RunStatus.cancelled if cancel_event.is_set()+ else RunStatus.completed if all_succeeded+ else RunStatus.failed+ )+ run.status = final_status+ run.completed_at = datetime.now(timezone.utc).isoformat()++ # Sync tasks back to run model+ run.tasks = task_store.load_all()++ # Set final report from aggregation task (last task) if available+ if task_summaries:+ last_layer = layers[-1] if layers else []+ for tid in last_layer:+ if tid in task_summaries:+ run.final_report = task_summaries[tid]+ break++ self._store.update_run(run)+ self._emit_event(run_id, self._make_event("run_completed", data={"status": final_status.value}))++ # Cleanup cancel event and live callback+ with self._lock:+ self._cancel_events.pop(run_id, None)+ self._live_callbacks.pop(run_id, None)++ def _execute_layer(+ self,+ run: SwarmRun,+ task_store: TaskStore,+ agent_map: dict[str, SwarmAgentSpec],+ layer_task_ids: list[str],+ task_summaries: dict[str, str],+ run_dir: Path,+ cancel_event: threading.Event,+ ) -> dict[str, WorkerResult]:+ """Execute all tasks in a single layer in parallel, with retry on failure.++ Each task is retried up to agent_spec.max_retries times if the worker+ returns status="failed". A "task_retry" event is emitted before each retry.++ Args:+ run: The SwarmRun being executed.+ task_store: TaskStore for task persistence.+ agent_map: Agent specs keyed by agent_id.+ layer_task_ids: Task IDs in this layer.+ task_summaries: Accumulated task summaries from previous layers.+ run_dir: Run directory path.+ cancel_event: Cancellation event.++ Returns:+ Mapping of task_id -> WorkerResult for all tasks in this layer.+ """+ results: dict[str, WorkerResult] = {}++ def _event_callback(event: SwarmEvent) -> None:+ self._emit_event(run.id, event)++ with ThreadPoolExecutor(max_workers=self._max_workers) as executor:+ futures: dict[Future[WorkerResult], str] = {}++ for tid in layer_task_ids:+ task = task_store.load_task(tid)+ agent_spec = agent_map.get(task.agent_id)+ if agent_spec is None:+ results[tid] = WorkerResult(+ status="failed", summary="",+ error=f"Agent '{task.agent_id}' not found in preset",+ )+ continue++ # Mark task as in_progress+ task_store.update_status(+ tid, TaskStatus.in_progress,+ started_at=datetime.now(timezone.utc).isoformat(),+ )+ self._emit_event(+ run.id,+ self._make_event("task_started", agent_id=agent_spec.id, task_id=tid),+ )++ # Build upstream summaries from input_from mapping+ upstream: dict[str, str] = {}+ for context_key, source_task_id in task.input_from.items():+ if source_task_id in task_summaries:+ upstream[context_key] = task_summaries[source_task_id]++ future = executor.submit(+ self._run_worker_with_retries,+ agent_spec=agent_spec,+ task=task,+ upstream_summaries=upstream,+ user_vars=run.user_vars,+ run_dir=run_dir,+ event_callback=_event_callback,+ run_id=run.id,+ )+ futures[future] = tid++ # Collect results+ for future in as_completed(futures):+ tid = futures[future]+ try:+ results[tid] = future.result()+ except Exception as exc:+ logger.error("Worker for task %s raised exception", tid, exc_info=True)+ results[tid] = WorkerResult(+ status="failed", summary="",+ error=str(exc),+ )++ return results++ def _run_worker_with_retries(+ self,+ agent_spec: SwarmAgentSpec,+ task: SwarmTask,+ upstream_summaries: dict[str, str],+ user_vars: dict[str, str],+ run_dir: Path,+ event_callback: Callable[[SwarmEvent], None] | None,+ run_id: str,+ ) -> WorkerResult:+ """Run a worker with automatic retry on failure.++ Retries up to agent_spec.max_retries times. Emits a "task_retry" event+ before each retry attempt. Token counts are accumulated across all+ attempts.++ Args:+ agent_spec: Agent role specification.+ task: The task to execute.+ upstream_summaries: Summaries from upstream tasks.+ user_vars: User-provided template variables.+ run_dir: Run directory path.+ event_callback: Optional event callback.+ run_id: Run identifier for event emission.++ Returns:+ WorkerResult from the last attempt.+ """+ max_retries = agent_spec.max_retries+ cumulative_input_tokens = 0+ cumulative_output_tokens = 0+ result: WorkerResult | None = None++ for attempt in range(max_retries + 1):+ if attempt > 0:+ self._emit_event(+ run_id,+ self._make_event(+ "task_retry",+ agent_id=agent_spec.id,+ task_id=task.id,+ data={"attempt": attempt + 1, "max_retries": max_retries,+ "previous_error": result.error if result else None},+ ),+ )+ logger.info(+ "Retrying task %s (attempt %d/%d)",+ task.id, attempt + 1, max_retries + 1,+ )++ result = run_worker(+ agent_spec=agent_spec,+ task=task,+ upstream_summaries=upstream_summaries,+ user_vars=user_vars,+ run_dir=run_dir,+ event_callback=event_callback,+ )++ cumulative_input_tokens += result.input_tokens+ cumulative_output_tokens += result.output_tokens++ if result.status != "failed":+ # Success (or timeout/token_limit/completed) โ no more retries+ result = result.model_copy(update={+ "input_tokens": cumulative_input_tokens,+ "output_tokens": cumulative_output_tokens,+ })+ return result++ # All retries exhausted, return the last failed result with cumulative tokens+ if result is not None:+ result = result.model_copy(update={+ "input_tokens": cumulative_input_tokens,+ "output_tokens": cumulative_output_tokens,+ })+ return result # type: ignore[return-value]++ def _cancel_remaining_tasks(+ self,+ task_store: TaskStore,+ current_layer_ids: list[str],+ all_tasks: list[SwarmTask],+ ) -> None:+ """Mark all non-completed tasks as cancelled.++ Args:+ task_store: TaskStore for persistence.+ current_layer_ids: Task IDs in the current (interrupted) layer.+ all_tasks: All tasks in the run.+ """+ for task in all_tasks:+ if task.status not in (TaskStatus.completed, TaskStatus.failed):+ try:+ task_store.update_status(task.id, TaskStatus.cancelled)+ except Exception:+ logger.warning("Failed to cancel task %s", task.id, exc_info=True)diff --git a/agent/src/swarm/store.py b/agent/src/swarm/store.pynew file mode 100644index 000000000..303781d04--- /dev/null+++ b/agent/src/swarm/store.py@@ -0,0 +1,181 @@+"""Swarm multi-agent system โ run state persistence.++File-system-based persistence for SwarmRun. Directory structure:+ .swarm/runs/{run_id}/+ โโโ run.json # SwarmRun state (atomic write)+ โโโ events.jsonl # append-only event log+ โโโ tasks/ # task state files+ โโโ inboxes/ # agent message inboxes+ โโโ artifacts/ # agent outputs+"""++from __future__ import annotations++import json+import threading+from pathlib import Path++from src.swarm.models import SwarmEvent, SwarmRun+++class SwarmStore:+ """File-based persistence store for SwarmRun.++ Each run is stored under base_dir/{run_id}/. run.json uses atomic writes+ (write to .tmp then rename) to prevent corruption. events.jsonl is append-only+ and supports offset-based reads for SSE streaming.++ Attributes:+ base_dir: Storage root directory, typically agent/.swarm/runs.+ """++ def __init__(self, base_dir: Path) -> None:+ """Initialize SwarmStore.++ Args:+ base_dir: Storage root directory path.+ """+ self.base_dir = base_dir+ self._write_lock = threading.Lock()++ def run_dir(self, run_id: str) -> Path:+ """Return the directory path for a given run.++ Args:+ run_id: Run identifier.++ Returns:+ Path to the run directory.+ """+ return self.base_dir / run_id++ def create_run(self, run: SwarmRun) -> Path:+ """Create the directory structure for a new run and write initial state.++ Args:+ run: SwarmRun instance.++ Returns:+ Path to the created run directory.++ Raises:+ FileExistsError: If the run directory already exists.+ """+ rd = self.run_dir(run.id)+ rd.mkdir(parents=True, exist_ok=False)+ (rd / "tasks").mkdir()+ (rd / "inboxes").mkdir()+ (rd / "artifacts").mkdir()+ self._atomic_write(rd / "run.json", run.model_dump_json(indent=2))+ return rd++ def load_run(self, run_id: str) -> SwarmRun | None:+ """Load the state for a given run.++ Args:+ run_id: Run identifier.++ Returns:+ SwarmRun instance, or None if not found.+ """+ run_file = self.run_dir(run_id) / "run.json"+ if not run_file.exists():+ return None+ return SwarmRun.model_validate_json(run_file.read_text(encoding="utf-8"))++ def update_run(self, run: SwarmRun) -> None:+ """Atomically update run state.++ Args:+ run: Updated SwarmRun instance.++ Raises:+ FileNotFoundError: If the run directory does not exist.+ """+ rd = self.run_dir(run.id)+ if not rd.exists():+ raise FileNotFoundError(f"Run directory not found: {rd}")+ self._atomic_write(rd / "run.json", run.model_dump_json(indent=2))++ def list_runs(self, limit: int = 50) -> list[SwarmRun]:+ """List all runs sorted by created_at descending.++ Args:+ limit: Maximum number of runs to return.++ Returns:+ List of SwarmRun instances.+ """+ if not self.base_dir.exists():+ return []++ runs: list[SwarmRun] = []+ for entry in self.base_dir.iterdir():+ if not entry.is_dir():+ continue+ run_file = entry / "run.json"+ if run_file.exists():+ try:+ run = SwarmRun.model_validate_json(+ run_file.read_text(encoding="utf-8")+ )+ runs.append(run)+ except (json.JSONDecodeError, ValueError):+ continue++ runs.sort(key=lambda r: r.created_at, reverse=True)+ return runs[:limit]++ def append_event(self, run_id: str, event: SwarmEvent) -> None:+ """Append an event to events.jsonl.++ Args:+ run_id: Run identifier.+ event: Event to append.++ Raises:+ FileNotFoundError: If the run directory does not exist.+ """+ rd = self.run_dir(run_id)+ if not rd.exists():+ raise FileNotFoundError(f"Run directory not found: {rd}")+ events_file = rd / "events.jsonl"+ with self._write_lock:+ with events_file.open("a", encoding="utf-8") as f:+ f.write(event.model_dump_json() + "\n")++ def read_events(+ self, run_id: str, after_index: int = 0+ ) -> list[SwarmEvent]:+ """Read the event log with optional offset for SSE incremental streaming.++ Args:+ run_id: Run identifier.+ after_index: Skip the first N events and return from event N+1 onward.++ Returns:+ List of SwarmEvent instances.+ """+ events_file = self.run_dir(run_id) / "events.jsonl"+ if not events_file.exists():+ return []++ events: list[SwarmEvent] = []+ lines = events_file.read_text(encoding="utf-8").strip().splitlines()+ for line in lines[after_index:]:+ stripped = line.strip()+ if stripped:+ events.append(SwarmEvent.model_validate_json(stripped))+ return events++ def _atomic_write(self, path: Path, content: str) -> None:+ """Atomically write a file: write to .tmp then rename.++ Args:+ path: Target file path.+ content: File content.+ """+ tmp_path = path.with_suffix(".tmp")+ with self._write_lock:+ tmp_path.write_text(content, encoding="utf-8")+ tmp_path.replace(path)diff --git a/agent/src/swarm/task_store.py b/agent/src/swarm/task_store.pynew file mode 100644index 000000000..17c2ec004--- /dev/null+++ b/agent/src/swarm/task_store.py@@ -0,0 +1,248 @@+"""Swarm multi-agent system โ Task persistence and DAG algorithms.++Each task is stored independently as tasks/task-{id}.json with full CRUD support.+Provides DAG algorithms: dependency resolution, cycle detection, and topological layering.+"""++from __future__ import annotations++import threading+from collections import defaultdict, deque+from pathlib import Path++from src.swarm.models import SwarmTask, TaskStatus+++class TaskStore:+ """File-based persistence layer for tasks.++ Each task is stored at run_dir/tasks/task-{id}.json.++ Attributes:+ run_dir: Root directory of the current run.+ """++ def __init__(self, run_dir: Path) -> None:+ """Initialize TaskStore.++ Args:+ run_dir: Path to .swarm/runs/{run_id}/ directory.+ """+ self.run_dir = run_dir+ self._tasks_dir = run_dir / "tasks"+ self._tasks_dir.mkdir(parents=True, exist_ok=True)+ self._lock = threading.Lock()++ def _task_path(self, task_id: str) -> Path:+ """Return the file path for a task.++ Args:+ task_id: Task ID.++ Returns:+ Path to the task JSON file.+ """+ return self._tasks_dir / f"task-{task_id}.json"++ def save_task(self, task: SwarmTask) -> None:+ """Save or overwrite task state.++ Args:+ task: SwarmTask instance.+ """+ path = self._task_path(task.id)+ tmp_path = path.with_suffix(".tmp")+ with self._lock:+ tmp_path.write_text(task.model_dump_json(indent=2), encoding="utf-8")+ tmp_path.replace(path)++ def load_task(self, task_id: str) -> SwarmTask:+ """Load a task by ID.++ Args:+ task_id: Task ID.++ Returns:+ SwarmTask instance.++ Raises:+ FileNotFoundError: If the task file does not exist.+ """+ path = self._task_path(task_id)+ if not path.exists():+ raise FileNotFoundError(f"Task not found: {path}")+ return SwarmTask.model_validate_json(path.read_text(encoding="utf-8"))++ def load_all(self) -> list[SwarmTask]:+ """Load all tasks for the current run.++ Returns:+ List of SwarmTask sorted by ID.+ """+ tasks: list[SwarmTask] = []+ for path in sorted(self._tasks_dir.glob("task-*.json")):+ tasks.append(+ SwarmTask.model_validate_json(path.read_text(encoding="utf-8"))+ )+ return tasks++ def update_status(+ self, task_id: str, status: TaskStatus, **kwargs: str | int | list[str] | None+ ) -> SwarmTask:+ """Update task status and additional fields.++ Args:+ task_id: Task ID.+ status: New status.+ **kwargs: Optional fields such as summary, error, completed_at, artifacts, etc.++ Returns:+ Updated SwarmTask instance.+ """+ task = self.load_task(task_id)+ updated_data = task.model_dump()+ updated_data["status"] = status+ for key, value in kwargs.items():+ if key in updated_data:+ updated_data[key] = value+ updated_task = SwarmTask.model_validate(updated_data)+ self.save_task(updated_task)+ return updated_task+++def resolve_dependencies(tasks_dir: Path, completed_task_id: str) -> list[str]:+ """Remove a completed task ID from blocked_by in all downstream tasks.++ Scans all task files under tasks_dir and removes completed_task_id from each+ task's blocked_by list. If a task's blocked_by becomes empty and its status+ is blocked, it is marked as newly unblocked (pending).++ Args:+ tasks_dir: Path to the tasks/ directory.+ completed_task_id: ID of the just-completed task.++ Returns:+ List of newly unblocked task IDs (blocked_by went from non-empty to empty).+ """+ newly_unblocked: list[str] = []++ for path in tasks_dir.glob("task-*.json"):+ task = SwarmTask.model_validate_json(path.read_text(encoding="utf-8"))+ if completed_task_id not in task.blocked_by:+ continue++ new_blocked_by = [tid for tid in task.blocked_by if tid != completed_task_id]+ updated_data = task.model_dump()+ updated_data["blocked_by"] = new_blocked_by++ if not new_blocked_by and task.status == TaskStatus.blocked:+ updated_data["status"] = TaskStatus.pending+ newly_unblocked.append(task.id)++ updated_task = SwarmTask.model_validate(updated_data)+ tmp_path = path.with_suffix(".tmp")+ tmp_path.write_text(updated_task.model_dump_json(indent=2), encoding="utf-8")+ tmp_path.replace(path)++ return newly_unblocked+++def validate_dag(tasks: list[SwarmTask]) -> None:+ """DFS cycle detection to ensure the task DAG is acyclic.++ Args:+ tasks: List of SwarmTask.++ Raises:+ ValueError: If a cycle is detected; message includes the cycle path.+ """+ graph: dict[str, list[str]] = {t.id: list(t.depends_on) for t in tasks}+ all_ids = {t.id for t in tasks}++ for task in tasks:+ for dep in task.depends_on:+ if dep not in all_ids:+ raise ValueError(+ f"Task '{task.id}' depends on unknown task '{dep}'"+ )++ WHITE, GRAY, BLACK = 0, 1, 2+ color: dict[str, int] = {tid: WHITE for tid in all_ids}+ path: list[str] = []++ def dfs(node: str) -> None:+ """DFS traversal to detect back edges.++ Args:+ node: Current node ID.++ Raises:+ ValueError: If a cycle is detected.+ """+ color[node] = GRAY+ path.append(node)++ for neighbor in graph.get(node, []):+ if color[neighbor] == GRAY:+ cycle_start = path.index(neighbor)+ cycle = path[cycle_start:] + [neighbor]+ raise ValueError(+ f"Cycle detected in task DAG: {' -> '.join(cycle)}"+ )+ if color[neighbor] == WHITE:+ dfs(neighbor)++ path.pop()+ color[node] = BLACK++ for tid in all_ids:+ if color[tid] == WHITE:+ dfs(tid)+++def topological_layers(tasks: list[SwarmTask]) -> list[list[str]]:+ """Kahn's algorithm topological layering; tasks in the same layer can run in parallel.++ Args:+ tasks: List of SwarmTask (must be a valid acyclic DAG).++ Returns:+ List of layers in execution order; each layer contains task IDs that can+ run in parallel.++ Raises:+ ValueError: If the DAG contains a cycle (topological sort cannot complete).+ """+ in_degree: dict[str, int] = {t.id: 0 for t in tasks}+ dependents: dict[str, list[str]] = defaultdict(list)++ for task in tasks:+ in_degree[task.id] = len(task.depends_on)+ for dep in task.depends_on:+ dependents[dep].append(task.id)++ queue: deque[str] = deque(+ tid for tid, deg in in_degree.items() if deg == 0+ )++ layers: list[list[str]] = []+ processed = 0++ while queue:+ layer: list[str] = list(queue)+ queue.clear()+ layers.append(layer)+ processed += len(layer)++ for tid in layer:+ for downstream in dependents[tid]:+ in_degree[downstream] -= 1+ if in_degree[downstream] == 0:+ queue.append(downstream)++ if processed != len(tasks):+ raise ValueError(+ f"DAG contains a cycle: processed {processed}/{len(tasks)} tasks"+ )++ return layersdiff --git a/agent/src/swarm/worker.py b/agent/src/swarm/worker.pynew file mode 100644index 000000000..3eaa905e9--- /dev/null+++ b/agent/src/swarm/worker.py@@ -0,0 +1,422 @@+"""Swarm Worker: standalone worker execution engine based on the SubagentTool ReAct pattern.++Reuses the SubagentTool ReAct loop (ChatLLM.chat + manual for-loop) without+instantiating AgentLoop, keeping the agent core unchanged.+"""++from __future__ import annotations++import json+import logging+import time+from datetime import datetime, timezone+from pathlib import Path+from typing import Callable++from src.agent.context import ContextBuilder+from src.agent.skills import SkillsLoader+from src.providers.chat import ChatLLM+from src.swarm.models import (+ SwarmAgentSpec,+ SwarmEvent,+ SwarmTask,+ WorkerResult,+)+from src.tools import build_filtered_registry++logger = logging.getLogger(__name__)++_DEFAULT_MAX_ITERATIONS = 50+_DEFAULT_TIMEOUT_SECONDS = 300+_MAX_TOKEN_ESTIMATE = 60_000+++def _emit(+ callback: Callable[[SwarmEvent], None] | None,+ event_type: str,+ agent_id: str,+ task_id: str,+ data: dict | None = None,+) -> None:+ """Emit a swarm event via callback if provided.++ Args:+ callback: Optional event callback function.+ event_type: Event type string.+ agent_id: Agent identifier.+ task_id: Task identifier.+ data: Additional event data.+ """+ if callback is None:+ return+ event = SwarmEvent(+ type=event_type,+ agent_id=agent_id,+ task_id=task_id,+ data=data or {},+ timestamp=datetime.now(timezone.utc).isoformat(),+ )+ try:+ callback(event)+ except Exception:+ logger.warning("Event callback failed for %s", event_type, exc_info=True)+++def _filter_skill_descriptions(loader: SkillsLoader, skill_names: list[str]) -> str:+ """Return skill descriptions filtered to the given whitelist.++ Args:+ loader: SkillsLoader instance with all skills loaded.+ skill_names: Skill names to include. Empty list means include all.++ Returns:+ Formatted skill descriptions string.+ """+ if not skill_names:+ return loader.get_descriptions()+ lines: list[str] = []+ for skill in loader.skills:+ if skill.name in skill_names:+ lines.append(f" - {skill.name}: {skill.description}")+ return "\n".join(lines) if lines else "(no matching skills)"+++def _estimate_tokens(+ messages: list[dict],+ response: object,+) -> tuple[int, int]:+ """Estimate token usage for a single LLM call.++ Tries to read actual token counts from the LLM response metadata+ (LangChain's usage_metadata). Falls back to character-length estimation+ (len // 4) if metadata is unavailable.++ Args:+ messages: Messages sent to the LLM for this call.+ response: LLMResponse from ChatLLM.chat().++ Returns:+ Tuple of (input_tokens, output_tokens).+ """+ from src.providers.chat import LLMResponse++ input_tokens = 0+ output_tokens = 0++ # response is an LLMResponse; it doesn't carry raw metadata.+ # Estimate: input = serialized messages length // 4, output = content length // 4+ try:+ input_tokens = len(json.dumps(messages, ensure_ascii=False)) // 4+ except Exception:+ input_tokens = 0++ if isinstance(response, LLMResponse):+ output_tokens = len(response.content or "") // 4+ else:+ output_tokens = 0++ return input_tokens, output_tokens+++def build_worker_prompt(+ agent_spec: SwarmAgentSpec,+ upstream_summaries: dict[str, str],+ skill_descriptions: str,+) -> str:+ """Build the worker's system prompt with role, upstream context, and skills.++ Args:+ agent_spec: The agent's role specification.+ upstream_summaries: Mapping of context_key -> upstream task summary.+ skill_descriptions: Pre-filtered skill description text.++ Returns:+ Complete system prompt string for the worker LLM.+ """+ upstream_block = ""+ if upstream_summaries:+ sections = []+ for key, summary in upstream_summaries.items():+ sections.append(f"### {key}\n{summary}")+ upstream_block = (+ "## Upstream Context (from previous agents)\n\n"+ + "\n\n".join(sections)+ )++ prompt_parts = [+ f"## Role\n\n{agent_spec.role}",+ agent_spec.system_prompt.replace("{upstream_context}", upstream_block),+ ]++ if skill_descriptions and skill_descriptions != "(no matching skills)":+ prompt_parts.append(+ f"## Available Skills (use load_skill to access full documentation)\n\n{skill_descriptions}"+ )++ prompt_parts.append(+ "## Execution Rules\n\n"+ "You have a HARD LIMIT of 20 tool calls. After that you will be cut off. Work efficiently.\n\n"+ "**Phase 1 โ Plan (0 tool calls):** Before calling any tool, state your plan in 3-5 bullet points.\n\n"+ "**Phase 2 โ Execute (โค15 tool calls):**\n"+ "- `load_skill` first to get data access methods and analysis patterns.\n"+ "- Write ONE focused Python script via `write_file`, then run it with `bash python script.py`.\n"+ "- Do NOT write long Python code inside bash. Use write_file + bash.\n"+ "- Do NOT fetch data with curl/requests. Use the patterns from load_skill (yfinance, OKX API via Python).\n"+ "- If a script fails, read the error, fix with `edit_file`, re-run. Max 2 retries per script.\n\n"+ "**Phase 3 โ Summarize (0 tool calls):**\n"+ "- Write your final findings as a concise markdown summary directly in your response.\n"+ "- Include specific numbers, dates, and actionable conclusions.\n"+ "- Respond in the same language as the task prompt."+ )++ return "\n\n".join(prompt_parts)+++def run_worker(+ agent_spec: SwarmAgentSpec,+ task: SwarmTask,+ upstream_summaries: dict[str, str],+ user_vars: dict[str, str],+ run_dir: Path,+ event_callback: Callable[[SwarmEvent], None] | None = None,+) -> WorkerResult:+ """Execute a single worker task using the SubagentTool ReAct pattern.++ Follows the exact same ReAct loop as SubagentTool:+ 1. Build filtered ToolRegistry from agent_spec.tools+ 2. Create ChatLLM with agent_spec.model_name+ 3. Build system prompt with role + upstream summaries + filtered skills+ 4. Resolve task.prompt_template with user_vars+ 5. Run ReAct loop (for iteration in range(max_iterations))+ 6. Write summary to artifacts/{agent_id}/summary.md+ 7. Return WorkerResult++ Args:+ agent_spec: Agent role specification with tools/skills/model config.+ task: The task to execute, including prompt template.+ upstream_summaries: Summaries from upstream tasks keyed by input_from keys.+ user_vars: User-provided variables for template rendering.+ run_dir: Path to .swarm/runs/{run_id}/ directory.+ event_callback: Optional callback for swarm events.++ Returns:+ WorkerResult with status, summary, artifacts, and iteration count.+ """+ agent_id = agent_spec.id+ task_id = task.id+ max_iterations = agent_spec.max_iterations or _DEFAULT_MAX_ITERATIONS+ timeout = agent_spec.timeout_seconds or _DEFAULT_TIMEOUT_SECONDS++ _emit(event_callback, "worker_started", agent_id, task_id)++ # 1. Build filtered tool registry+ registry = build_filtered_registry(agent_spec.tools)++ # 2. Create LLM+ llm = ChatLLM(model_name=agent_spec.model_name)++ # 3. Build system prompt with filtered skills+ skills_loader = SkillsLoader()+ skill_desc = _filter_skill_descriptions(skills_loader, agent_spec.skills)+ system_prompt = build_worker_prompt(agent_spec, upstream_summaries, skill_desc)++ # 4. Resolve prompt template with user vars+ try:+ user_prompt = task.prompt_template.format(**user_vars)+ except KeyError as exc:+ error_msg = f"Missing variable in prompt template: {exc}"+ _emit(event_callback, "worker_failed", agent_id, task_id, {"error": error_msg})+ return WorkerResult(+ status="failed", summary="", iterations=0, error=error_msg,+ input_tokens=0, output_tokens=0,+ )++ # 5. Build initial messages+ messages: list[dict] = [+ {"role": "system", "content": system_prompt},+ {"role": "user", "content": user_prompt},+ ]++ # 6. ReAct loop (EXACTLY like SubagentTool)+ artifact_dir = run_dir / "artifacts" / agent_id+ artifact_dir.mkdir(parents=True, exist_ok=True)++ t0 = time.monotonic()+ iteration = 0+ summary = ""+ total_input_tokens = 0+ total_output_tokens = 0++ # Threshold for injecting a "wrap up" nudge (80% of budget)+ wrap_up_at = max(1, int(max_iterations * 0.8))+ last_assistant_content = ""++ _KEEP_RECENT_TOOLS = 3++ for iteration in range(max_iterations):+ # Microcompact: clear old tool results to prevent token bloat+ tool_msgs = [m for m in messages if m.get("role") == "tool"]+ if len(tool_msgs) > _KEEP_RECENT_TOOLS:+ for msg in tool_msgs[:-_KEEP_RECENT_TOOLS]:+ content = msg.get("content", "")+ if isinstance(content, str) and len(content) > 100:+ msg["content"] = "[cleared]"++ # Check timeout+ elapsed = time.monotonic() - t0+ if elapsed > timeout:+ summary = last_assistant_content or f"Worker timed out after {elapsed:.0f}s ({iteration} iterations)"+ _emit(event_callback, "worker_timeout", agent_id, task_id, {"elapsed": elapsed})+ _write_summary(artifact_dir, summary)+ return WorkerResult(+ status="timeout",+ summary=summary,+ artifact_paths=_collect_artifacts(artifact_dir),+ iterations=iteration,+ input_tokens=total_input_tokens,+ output_tokens=total_output_tokens,+ )++ # Check token estimate+ token_estimate = len(json.dumps(messages, ensure_ascii=False)) // 4+ if token_estimate > _MAX_TOKEN_ESTIMATE:+ summary = last_assistant_content or f"Worker context too large (~{token_estimate} tokens, {iteration} iterations)"+ _emit(event_callback, "worker_token_limit", agent_id, task_id, {"tokens": token_estimate})+ _write_summary(artifact_dir, summary)+ return WorkerResult(+ status="token_limit",+ summary=summary,+ artifact_paths=_collect_artifacts(artifact_dir),+ iterations=iteration,+ input_tokens=total_input_tokens,+ output_tokens=total_output_tokens,+ )++ # Inject wrap-up nudge when approaching iteration limit+ if iteration == wrap_up_at:+ remaining = max_iterations - iteration+ messages.append({+ "role": "user",+ "content": (+ f"[SYSTEM] You have {remaining} iterations remaining. "+ "Stop calling tools and immediately output your final analysis summary as plain text. "+ "Do not call any more tools."+ ),+ })++ # On last iteration, call LLM without tool definitions to force text output+ is_last_iteration = iteration == max_iterations - 1+ tool_defs = None if is_last_iteration else registry.get_definitions()++ # Call LLM with remaining timeout+ try:+ remaining_timeout = max(10, int(timeout - elapsed))+ response = llm.chat(messages, tools=tool_defs, timeout=remaining_timeout)+ except Exception as exc:+ error_msg = f"LLM call failed at iteration {iteration}: {exc}"+ logger.warning(error_msg)+ _emit(event_callback, "worker_failed", agent_id, task_id, {"error": error_msg})+ return WorkerResult(+ status="failed",+ summary=last_assistant_content or "",+ artifact_paths=_collect_artifacts(artifact_dir),+ iterations=iteration,+ error=error_msg,+ input_tokens=total_input_tokens,+ output_tokens=total_output_tokens,+ )++ # Accumulate token counts+ iter_in, iter_out = _estimate_tokens(messages, response)+ total_input_tokens += iter_in+ total_output_tokens += iter_out++ # Emit agent thinking text for live streaming+ if response.content and response.content.strip():+ _emit(event_callback, "worker_text", agent_id, task_id,+ {"content": response.content, "iteration": iteration})++ # Track last meaningful assistant content+ if response.content and len(response.content.strip()) > 20:+ last_assistant_content = response.content++ # If no tool calls, this is the final response+ if not response.has_tool_calls:+ summary = response.content or last_assistant_content or "(no summary)"+ _emit(event_callback, "worker_completed", agent_id, task_id, {"iterations": iteration + 1})+ _write_summary(artifact_dir, summary)+ return WorkerResult(+ status="completed",+ summary=summary,+ artifact_paths=_collect_artifacts(artifact_dir),+ iterations=iteration + 1,+ input_tokens=total_input_tokens,+ output_tokens=total_output_tokens,+ )++ # Append assistant message with tool calls+ messages.append(+ ContextBuilder.format_assistant_tool_calls(+ response.tool_calls, content=response.content+ )+ )++ # Execute each tool call โ inject run_dir so tools write inside artifact_dir+ for tc in response.tool_calls:+ _emit(+ event_callback, "tool_call", agent_id, task_id,+ {"tool": tc.name, "iteration": iteration},+ )+ tc_start = time.monotonic()+ args = {**tc.arguments, "run_dir": str(artifact_dir)}+ result = registry.execute(tc.name, args)+ tc_elapsed = time.monotonic() - tc_start+ _emit(+ event_callback, "tool_result", agent_id, task_id,+ {"tool": tc.name, "elapsed_ms": int(tc_elapsed * 1000),+ "status": "ok", "iteration": iteration},+ )+ messages.append(+ ContextBuilder.format_tool_result(tc.id, tc.name, result[:10_000])+ )++ # Hit iteration limit โ use last meaningful content as summary+ summary = last_assistant_content or f"Worker hit iteration limit ({max_iterations} iterations)"+ _emit(event_callback, "worker_iteration_limit", agent_id, task_id)+ _write_summary(artifact_dir, summary)+ return WorkerResult(+ status="completed",+ summary=summary,+ artifact_paths=_collect_artifacts(artifact_dir),+ iterations=max_iterations,+ input_tokens=total_input_tokens,+ output_tokens=total_output_tokens,+ )+++def _write_summary(artifact_dir: Path, summary: str) -> None:+ """Write worker summary to artifacts directory.++ Args:+ artifact_dir: Path to artifacts/{agent_id}/ directory.+ summary: Summary text to write.+ """+ try:+ summary_path = artifact_dir / "summary.md"+ summary_path.write_text(summary, encoding="utf-8")+ except Exception:+ logger.warning("Failed to write summary to %s", artifact_dir, exc_info=True)+++def _collect_artifacts(artifact_dir: Path) -> list[str]:+ """Collect all artifact file paths from agent's artifact directory.++ Args:+ artifact_dir: Path to artifacts/{agent_id}/ directory.++ Returns:+ List of artifact file path strings.+ """+ if not artifact_dir.exists():+ return []+ return [str(p) for p in artifact_dir.iterdir() if p.is_file()]diff --git a/agent/src/tools/__init__.py b/agent/src/tools/__init__.pynew file mode 100644index 000000000..580d77abf--- /dev/null+++ b/agent/src/tools/__init__.py@@ -0,0 +1,61 @@+"""Tool registry: v7 atomic tools + domain tools."""++from src.agent.tools import ToolRegistry+++def build_registry() -> ToolRegistry:+ """Build the v7 tool registry (atomic tools + domain tools).++ Returns:+ ToolRegistry containing all v7 tools.+ """+ from src.tools.bash_tool import BashTool+ from src.tools.read_file_tool import ReadFileTool+ from src.tools.write_file_tool import WriteFileTool+ from src.tools.edit_file_tool import EditFileTool+ from src.tools.load_skill_tool import LoadSkillTool+ from src.tools.backtest_tool import BacktestTool+ from src.tools.pattern_tool import PatternTool+ from src.tools.compact_tool import CompactTool+ from src.tools.subagent_tool import SubagentTool+ from src.tools.task_tools import TaskCreateTool, TaskUpdateTool, TaskListTool, TaskGetTool+ from src.tools.background_tools import BackgroundRunTool, CheckBackgroundTool+ from src.tools.web_reader_tool import WebReaderTool+ from src.tools.doc_reader_tool import DocReaderTool+ from src.tools.factor_analysis_tool import FactorAnalysisTool+ from src.tools.options_pricing_tool import OptionsPricingTool+ from src.tools.swarm_tool import SwarmTool+ registry = ToolRegistry()+ for tool in [BashTool(), ReadFileTool(), WriteFileTool(),+ EditFileTool(), LoadSkillTool(), BacktestTool(),+ PatternTool(), CompactTool(), SubagentTool(),+ TaskCreateTool(), TaskUpdateTool(), TaskListTool(), TaskGetTool(),+ BackgroundRunTool(), CheckBackgroundTool(),+ WebReaderTool(), DocReaderTool(),+ FactorAnalysisTool(), OptionsPricingTool(), SwarmTool()]:+ registry.register(tool)+ return registry+++def build_filtered_registry(tool_names: list[str]) -> ToolRegistry:+ """Build a ToolRegistry with only specified tools.++ Creates the full registry, then filters to include only tools+ whose names appear in the provided list. Unknown names are silently skipped.++ Args:+ tool_names: Tool names to include in the filtered registry.++ Returns:+ ToolRegistry containing only the requested tools.+ """+ full = build_registry()+ filtered = ToolRegistry()+ for name in tool_names:+ tool = full.get(name)+ if tool:+ filtered.register(tool)+ return filtered+++__all__ = ["build_registry", "build_filtered_registry"]diff --git a/agent/src/tools/background_tools.py b/agent/src/tools/background_tools.pynew file mode 100644index 000000000..bdd87c0e3--- /dev/null+++ b/agent/src/tools/background_tools.py@@ -0,0 +1,103 @@+"""Background tasks: thread execution + notification queue."""++from __future__ import annotations++import json+import subprocess+import threading+import uuid+from pathlib import Path+from typing import Any, Dict, List, Optional++from src.agent.tools import BaseTool++WORKDIR = Path(__file__).resolve().parents[2]+++class BackgroundManager:+ """Background thread execution + notification queue."""++ def __init__(self) -> None:+ self.tasks: Dict[str, dict] = {}+ self._notifications: List[dict] = []+ self._lock = threading.Lock()++ def run(self, command: str) -> str:+ """Start a background task and return its task_id.++ Args:+ command: Shell command to execute.++ Returns:+ JSON string containing status and task_id.+ """+ task_id = uuid.uuid4().hex[:8]+ self.tasks[task_id] = {"status": "running", "result": None, "command": command}+ threading.Thread(target=self._execute, args=(task_id, command), daemon=True).start()+ return json.dumps({"status": "ok", "task_id": task_id, "message": f"Started: {command[:80]}"})++ def _execute(self, task_id: str, command: str) -> None:+ try:+ r = subprocess.run(command, shell=True, cwd=WORKDIR,+ capture_output=True, text=True, timeout=300,+ encoding="utf-8", errors="replace")+ output = (r.stdout + r.stderr).strip()[:50000]+ status = "completed"+ except subprocess.TimeoutExpired:+ output, status = "Timeout (300s)", "timeout"+ except Exception as e:+ output, status = str(e), "error"+ self.tasks[task_id]["status"] = status+ self.tasks[task_id]["result"] = output or "(no output)"+ with self._lock:+ self._notifications.append({+ "task_id": task_id, "status": status,+ "command": command[:80], "result": (output or "")[:500],+ })++ def check(self, task_id: Optional[str] = None) -> str:+ if task_id:+ t = self.tasks.get(task_id)+ if not t:+ return json.dumps({"status": "error", "error": f"Unknown task {task_id}"})+ return json.dumps({"status": t["status"], "command": t["command"][:60],+ "result": t.get("result") or "(running)"}, ensure_ascii=False)+ lines = [f"{tid}: [{t['status']}] {t['command'][:60]}" for tid, t in self.tasks.items()]+ return "\n".join(lines) if lines else "No background tasks."++ def drain_notifications(self) -> List[dict]:+ with self._lock:+ notifs = list(self._notifications)+ self._notifications.clear()+ return notifs+++_BG = BackgroundManager()+++def get_background_manager() -> BackgroundManager:+ """Return the global BackgroundManager singleton."""+ return _BG+++class BackgroundRunTool(BaseTool):+ name = "background_run"+ description = "Run command in background thread. Returns task_id immediately. Use for long-running operations (ML training, large data processing)."+ parameters = {"type": "object", "properties": {+ "command": {"type": "string", "description": "Shell command to run in background"},+ }, "required": ["command"]}++ def execute(self, **kw: Any) -> str:+ return _BG.run(kw["command"])+++class CheckBackgroundTool(BaseTool):+ name = "check_background"+ description = "Check background task status. Omit task_id to list all."+ parameters = {"type": "object", "properties": {+ "task_id": {"type": "string"},+ }, "required": []}+ repeatable = True++ def execute(self, **kw: Any) -> str:+ return _BG.check(kw.get("task_id"))diff --git a/agent/src/tools/backtest_tool.py b/agent/src/tools/backtest_tool.pynew file mode 100644index 000000000..a0d864711--- /dev/null+++ b/agent/src/tools/backtest_tool.py@@ -0,0 +1,81 @@+"""Backtest execution tool: validates config.json + signal_engine.py and runs the built-in engine."""++from __future__ import annotations++import json+from pathlib import Path++from src.agent.tools import BaseTool+from src.core.runner import Runner+++def run_backtest(run_dir: str) -> str:+ """Run backtest: validate config.json + signal_engine.py, invoke built-in engine.++ Args:+ run_dir: Path to the run directory.++ Returns:+ JSON-formatted execution result.+ """+ run_path = Path(run_dir)++ config_path = run_path / "config.json"+ if not config_path.exists():+ return json.dumps({"status": "error", "error": "config.json not found"}, ensure_ascii=False)++ try:+ config = json.loads(config_path.read_text(encoding="utf-8"))+ except json.JSONDecodeError as e:+ return json.dumps({"status": "error", "error": f"config.json parse error: {e}"}, ensure_ascii=False)++ if "source" not in config:+ return json.dumps({"status": "error", "error": "config.json missing 'source' field (tushare/okx/yfinance)"}, ensure_ascii=False)++ valid_sources = {"tushare", "okx", "yfinance", "auto"}+ if config["source"] not in valid_sources:+ return json.dumps({"status": "error", "error": f"source must be one of {valid_sources}, got: {config['source']}"}, ensure_ascii=False)++ signal_path = run_path / "code" / "signal_engine.py"+ if not signal_path.exists():+ return json.dumps({"status": "error", "error": "code/signal_engine.py not found"}, ensure_ascii=False)++ agent_root = Path(__file__).resolve().parents[2]+ entry_script = agent_root / "backtest" / "runner.py"++ runner = Runner(timeout=300)+ result = runner.execute(+ entry_script,+ run_path,+ cwd=agent_root,+ cli_args=[str(run_path)],+ )++ artifacts_found = {name: str(path) for name, path in result.artifacts.items()}+ return json.dumps({+ "status": "ok" if result.success else "error",+ "exit_code": result.exit_code,+ "stdout": result.stdout[-2000:] if len(result.stdout) > 2000 else result.stdout,+ "stderr": result.stderr[-2000:] if len(result.stderr) > 2000 else result.stderr,+ "artifacts": artifacts_found,+ "run_dir": run_dir,+ }, ensure_ascii=False)+++class BacktestTool(BaseTool):+ """Backtest execution tool."""++ name = "backtest"+ description = "Run backtest: validate config.json + signal_engine.py, invoke built-in engine."+ parameters = {+ "type": "object",+ "properties": {+ "run_dir": {"type": "string", "description": "Path to the run directory"},+ },+ "required": ["run_dir"],+ }+ repeatable = True++ def execute(self, **kwargs) -> str:+ """Execute backtest."""+ return run_backtest(kwargs["run_dir"])diff --git a/agent/src/tools/bash_tool.py b/agent/src/tools/bash_tool.pynew file mode 100644index 000000000..09664d631--- /dev/null+++ b/agent/src/tools/bash_tool.py@@ -0,0 +1,71 @@+"""Bash tool: execute shell commands under run_dir."""++from __future__ import annotations++import json+import os+import subprocess+from typing import Any++from src.agent.tools import BaseTool++_OUTPUT_LIMIT = 50_000+_DEFAULT_TIMEOUT = 120+++class BashTool(BaseTool):+ """Execute shell commands in the working directory."""++ name = "bash"+ description = "Execute a shell command in the working directory. Use for installing packages, running scripts, or inspecting files."+ parameters = {+ "type": "object",+ "properties": {+ "command": {"type": "string", "description": "Shell command to execute"},+ },+ "required": ["command"],+ }+ repeatable = True++ def execute(self, **kwargs: Any) -> str:+ """Execute a shell command.++ Args:+ **kwargs: Must include command. Optional run_dir used as cwd.++ Returns:+ JSON string with stdout, stderr, and exit_code.+ """+ command = kwargs["command"]+ cwd = kwargs.get("run_dir")++ try:+ result = subprocess.run(+ command,+ shell=True,+ cwd=cwd,+ stdout=subprocess.PIPE,+ stderr=subprocess.PIPE,+ text=True,+ timeout=_DEFAULT_TIMEOUT,+ encoding="utf-8",+ errors="replace",+ )+ stdout = result.stdout[:_OUTPUT_LIMIT] if len(result.stdout) > _OUTPUT_LIMIT else result.stdout+ stderr = result.stderr[:_OUTPUT_LIMIT] if len(result.stderr) > _OUTPUT_LIMIT else result.stderr+ return json.dumps({+ "status": "ok" if result.returncode == 0 else "error",+ "exit_code": result.returncode,+ "stdout": stdout,+ "stderr": stderr,+ }, ensure_ascii=False)+ except subprocess.TimeoutExpired:+ return json.dumps({+ "status": "error",+ "error": f"Command timed out after {_DEFAULT_TIMEOUT}s",+ }, ensure_ascii=False)+ except Exception as exc:+ return json.dumps({+ "status": "error",+ "error": str(exc),+ }, ensure_ascii=False)diff --git a/agent/src/tools/compact_tool.py b/agent/src/tools/compact_tool.pynew file mode 100644index 000000000..5a8f93441--- /dev/null+++ b/agent/src/tools/compact_tool.py@@ -0,0 +1,19 @@+"""Compact tool: model-initiated context compression."""++from __future__ import annotations++import json+from typing import Any++from src.agent.tools import BaseTool+++class CompactTool(BaseTool):+ """Compress conversation history to free context space."""++ name = "compact"+ description = "Compress conversation history to free context space. Call when the conversation feels long or you're losing track of earlier context."+ parameters = {"type": "object", "properties": {}, "required": []}++ def execute(self, **kwargs: Any) -> str:+ return json.dumps({"status": "ok", "message": "Compression triggered"})diff --git a/agent/src/tools/doc_reader_tool.py b/agent/src/tools/doc_reader_tool.pynew file mode 100644index 000000000..a7cfdbd5e--- /dev/null+++ b/agent/src/tools/doc_reader_tool.py@@ -0,0 +1,156 @@+"""Document reader tool: full PDF text extraction with OCR fallback for image/scanned pages."""++from __future__ import annotations++import json+from pathlib import Path+from typing import List, Optional, Tuple++from src.agent.tools import BaseTool++_MAX_CHARS = 15000 # truncation threshold+_MIN_TEXT_PER_PAGE = 50 # pages with fewer chars are treated as image pages and fall back to OCR+_ocr_engine = None+++def _get_ocr():+ """Lazily load the RapidOCR engine (first call takes ~1-2s)."""+ global _ocr_engine+ if _ocr_engine is None:+ from rapidocr_onnxruntime import RapidOCR+ _ocr_engine = RapidOCR()+ return _ocr_engine+++def _ocr_page(doc, page_idx: int) -> str:+ """Render a PDF page to an image and run OCR on it.++ Args:+ doc: pypdfium2 PdfDocument object.+ page_idx: Zero-based page index.++ Returns:+ OCR-extracted text for the page.+ """+ import numpy as np++ page = doc[page_idx]+ bitmap = page.render(scale=300 / 72)+ img = bitmap.to_numpy()++ ocr = _get_ocr()+ result, _ = ocr(img)+ if not result:+ return ""+ # result is list of [bbox, text, confidence]+ lines = [item[1] for item in result]+ return "\n".join(lines)+++def read_document(file_path: str, pages: str = "") -> str:+ """Extract text from a PDF document, falling back to OCR for image pages.++ Args:+ file_path: Absolute path to the PDF file.+ pages: Page range (e.g. "1-10", "5", "1,3,5-8"); empty means all pages.++ Returns:+ JSON-formatted result.+ """+ path = Path(file_path)+ if not path.exists():+ return json.dumps({"status": "error", "error": f"File not found: {file_path}"}, ensure_ascii=False)+ if path.suffix.lower() != ".pdf":+ return json.dumps({"status": "error", "error": f"Only PDF supported, got: {path.suffix}"}, ensure_ascii=False)++ try:+ import pypdfium2 as pdfium++ doc = pdfium.PdfDocument(str(path))+ total_pages = len(doc)+ target_pages = _parse_pages(pages, total_pages) if pages.strip() else list(range(total_pages))++ texts = []+ ocr_pages = 0+ for i in target_pages:+ if 0 <= i < total_pages:+ page = doc[i]+ text = page.get_textpage().get_text_range().strip()++ if len(text) >= _MIN_TEXT_PER_PAGE:+ texts.append(f"--- Page {i + 1} ---\n{text}")+ else:+ # Too little text โ fall back to OCR+ ocr_text = _ocr_page(doc, i)+ if ocr_text.strip():+ texts.append(f"--- Page {i + 1} [OCR] ---\n{ocr_text}")+ ocr_pages += 1+ elif text:+ # OCR also found nothing; use whatever text exists+ texts.append(f"--- Page {i + 1} ---\n{text}")++ doc.close()+ full_text = "\n\n".join(texts)+ char_count = len(full_text)++ truncated = False+ if char_count > _MAX_CHARS:+ full_text = full_text[:_MAX_CHARS] + f"\n\n... (truncated, total {char_count} chars, {total_pages} pages)"+ truncated = True++ return json.dumps({+ "status": "ok",+ "file": path.name,+ "total_pages": total_pages,+ "pages_read": len(target_pages),+ "ocr_pages": ocr_pages,+ "char_count": char_count,+ "truncated": truncated,+ "text": full_text,+ }, ensure_ascii=False)++ except Exception as exc:+ return json.dumps({"status": "error", "error": str(exc)}, ensure_ascii=False)+++def _parse_pages(pages_str: str, total: int) -> list:+ """Parse a page-range string into a list of zero-based page indices.++ Args:+ pages_str: e.g. "1-10", "5", "1,3,5-8".+ total: Total number of pages in the document.++ Returns:+ Sorted list of zero-based page indices.+ """+ result = []+ for part in pages_str.split(","):+ part = part.strip()+ if "-" in part:+ start, end = part.split("-", 1)+ s = max(int(start.strip()) - 1, 0)+ e = min(int(end.strip()), total)+ result.extend(range(s, e))+ elif part.isdigit():+ result.append(int(part) - 1)+ return sorted(set(result))+++class DocReaderTool(BaseTool):+ """PDF document reader tool."""++ name = "read_document"+ description = "Read a PDF document: extract text pages + OCR for image/scanned pages. Supports research papers, financial reports, etc. Accepts optional page ranges."+ parameters = {+ "type": "object",+ "properties": {+ "file_path": {"type": "string", "description": "Absolute path to the PDF file"},+ "pages": {"type": "string", "description": "Page range (e.g. '1-10', '5', '1,3,5-8'); leave empty for all pages", "default": ""},+ },+ "required": ["file_path"],+ }+ repeatable = True++ def execute(self, **kwargs) -> str:+ """Read PDF document."""+ return read_document(kwargs["file_path"], kwargs.get("pages", ""))diff --git a/agent/src/tools/edit_file_tool.py b/agent/src/tools/edit_file_tool.pynew file mode 100644index 000000000..479f604d5--- /dev/null+++ b/agent/src/tools/edit_file_tool.py@@ -0,0 +1,81 @@+"""Edit file tool: find-and-replace in workspace files."""++from __future__ import annotations++import json+from pathlib import Path+from typing import Any++from src.agent.tools import BaseTool+from src.tools.path_utils import safe_path as _safe_path+++class EditFileTool(BaseTool):+ """Find and replace the first occurrence of a string in a workspace file."""++ name = "edit_file"+ description = "Find and replace the first occurrence of old_text with new_text in a file."+ parameters = {+ "type": "object",+ "properties": {+ "path": {"type": "string", "description": "File path relative to run_dir"},+ "old_text": {"type": "string", "description": "Text to find"},+ "new_text": {"type": "string", "description": "Text to replace with"},+ },+ "required": ["path", "old_text", "new_text"],+ }+ repeatable = True++ def execute(self, **kwargs: Any) -> str:+ """Perform find-and-replace.++ Args:+ **kwargs: Must include path, old_text, new_text. Optional run_dir.++ Returns:+ JSON string with the operation result or an error.+ """+ file_path = kwargs["path"]+ old_text = kwargs["old_text"]+ new_text = kwargs["new_text"]+ run_dir = kwargs.get("run_dir")++ if not run_dir:+ return json.dumps({+ "status": "error",+ "error": "run_dir is required for edit_file",+ }, ensure_ascii=False)++ try:+ resolved = _safe_path(file_path, Path(run_dir))+ except ValueError as exc:+ return json.dumps({+ "status": "error",+ "error": str(exc),+ }, ensure_ascii=False)++ if not resolved.exists():+ return json.dumps({+ "status": "error",+ "error": f"File not found: {file_path}",+ }, ensure_ascii=False)++ try:+ content = resolved.read_text(encoding="utf-8")+ if old_text not in content:+ return json.dumps({+ "status": "error",+ "error": f"old_text not found in {file_path}",+ }, ensure_ascii=False)+ new_content = content.replace(old_text, new_text, 1)+ resolved.write_text(new_content, encoding="utf-8")+ return json.dumps({+ "status": "ok",+ "path": str(resolved),+ "message": "Edit applied successfully",+ }, ensure_ascii=False)+ except Exception as exc:+ return json.dumps({+ "status": "error",+ "error": str(exc),+ }, ensure_ascii=False)diff --git a/agent/src/tools/factor_analysis_tool.py b/agent/src/tools/factor_analysis_tool.pynew file mode 100644index 000000000..fbabf2bd9--- /dev/null+++ b/agent/src/tools/factor_analysis_tool.py@@ -0,0 +1,222 @@+"""Factor analysis tool: compute IC/IR, layered backtest, and output analysis report."""++from __future__ import annotations++import json+from pathlib import Path+from typing import Any++import numpy as np+import pandas as pd+from scipy.stats import spearmanr++from src.agent.tools import BaseTool+++def _compute_ic_series(factor_df: pd.DataFrame, return_df: pd.DataFrame) -> pd.Series:+ """Compute daily Spearman rank correlation (IC) between factor values and returns.++ Args:+ factor_df: Factor values; index=date, columns=codes.+ return_df: Returns; index=date, columns=codes.++ Returns:+ IC series indexed by date.+ """+ common_dates = factor_df.index.intersection(return_df.index)+ common_codes = factor_df.columns.intersection(return_df.columns)+ if len(common_dates) == 0 or len(common_codes) == 0:+ return pd.Series(dtype=float)++ factor_df = factor_df.loc[common_dates, common_codes]+ return_df = return_df.loc[common_dates, common_codes]++ ic_values = {}+ for date in common_dates:+ f = factor_df.loc[date].dropna()+ r = return_df.loc[date].dropna()+ shared = f.index.intersection(r.index)+ if len(shared) < 5:+ continue+ corr, _ = spearmanr(f[shared], r[shared])+ if not np.isnan(corr):+ ic_values[date] = corr++ return pd.Series(ic_values, dtype=float)+++def _compute_group_equity(+ factor_df: pd.DataFrame, return_df: pd.DataFrame, n_groups: int+) -> pd.DataFrame:+ """Layered backtest: rank by factor value daily, hold equal-weight, compute cumulative NAV.++ Args:+ factor_df: Factor values; index=date, columns=codes.+ return_df: Returns; index=date, columns=codes.+ n_groups: Number of quantile groups.++ Returns:+ DataFrame with index=date and columns Group_1 ... Group_N holding cumulative NAV.+ """+ common_dates = sorted(factor_df.index.intersection(return_df.index))+ common_codes = factor_df.columns.intersection(return_df.columns)+ if len(common_dates) == 0 or len(common_codes) == 0:+ return pd.DataFrame()++ factor_df = factor_df.loc[common_dates, common_codes]+ return_df = return_df.loc[common_dates, common_codes]++ group_returns: dict[str, list[float]] = {f"Group_{i+1}": [] for i in range(n_groups)}+ valid_dates = []++ for date in common_dates:+ f = factor_df.loc[date].dropna()+ r = return_df.loc[date].dropna()+ shared = f.index.intersection(r.index)+ if len(shared) < n_groups:+ continue+ valid_dates.append(date)+ ranked = f[shared].rank(method="first")+ bins = pd.qcut(ranked, n_groups, labels=False, duplicates="drop")+ if bins.nunique() < n_groups:+ # Not enough distinct values; fall back to equal-width cut+ bins = pd.cut(ranked, n_groups, labels=False)+ for g in range(n_groups):+ members = bins[bins == g].index+ if len(members) > 0:+ group_returns[f"Group_{g+1}"].append(r[members].mean())+ else:+ group_returns[f"Group_{g+1}"].append(0.0)++ if not valid_dates:+ return pd.DataFrame()++ ret_df = pd.DataFrame(group_returns, index=valid_dates)+ equity_df = (1 + ret_df).cumprod()+ return equity_df+++def run_factor_analysis(+ factor_csv: str, return_csv: str, output_dir: str, n_groups: int = 5+) -> str:+ """Run the full factor analysis pipeline: IC/IR + layered backtest.++ Args:+ factor_csv: Path to factor values CSV (index=date, columns=codes).+ return_csv: Path to returns CSV (same structure).+ output_dir: Directory for output files.+ n_groups: Number of quantile groups; default 5.++ Returns:+ JSON-formatted analysis summary.+ """+ out_path = Path(output_dir)+ out_path.mkdir(parents=True, exist_ok=True)++ try:+ factor_df = pd.read_csv(factor_csv, index_col=0, parse_dates=True)+ return_df = pd.read_csv(return_csv, index_col=0, parse_dates=True)+ except Exception as e:+ return json.dumps({"status": "error", "error": f"Failed to read CSV: {e}"}, ensure_ascii=False)++ if factor_df.empty or return_df.empty:+ return json.dumps({"status": "error", "error": "Factor or return data is empty"}, ensure_ascii=False)++ ic_series = _compute_ic_series(factor_df, return_df)+ if ic_series.empty:+ return json.dumps(+ {"status": "error", "error": "IC computation failed: insufficient shared dates/assets (need at least 5 per day)"},+ ensure_ascii=False,+ )++ ic_series.to_csv(out_path / "ic_series.csv", header=["IC"])++ ic_mean = float(ic_series.mean())+ ic_std = float(ic_series.std())+ ir = ic_mean / ic_std if ic_std > 0 else 0.0+ ic_positive_ratio = float((ic_series > 0).mean())++ summary = {+ "ic_mean": round(ic_mean, 6),+ "ic_std": round(ic_std, 6),+ "ir": round(ir, 4),+ "ic_positive_ratio": round(ic_positive_ratio, 4),+ "ic_count": len(ic_series),+ }+ (out_path / "ic_summary.json").write_text(+ json.dumps(summary, ensure_ascii=False, indent=2), encoding="utf-8"+ )++ equity_df = _compute_group_equity(factor_df, return_df, n_groups)+ if equity_df.empty:+ return json.dumps(+ {"status": "error", "error": "Layered backtest failed: insufficient valid cross-section dates"},+ ensure_ascii=False,+ )+ equity_df.to_csv(out_path / "group_equity.csv")++ # Long-short spread: last group vs. first group+ long_short_ret = float(equity_df.iloc[-1, -1] - equity_df.iloc[-1, 0])++ result = {+ "status": "ok",+ "ic_mean": summary["ic_mean"],+ "ic_std": summary["ic_std"],+ "ir": summary["ir"],+ "ic_positive_ratio": summary["ic_positive_ratio"],+ "ic_count": summary["ic_count"],+ "n_groups": n_groups,+ "long_short_spread": round(long_short_ret, 4),+ "group_final_equity": {+ col: round(float(equity_df[col].iloc[-1]), 4) for col in equity_df.columns+ },+ "output_dir": str(out_path),+ "files": ["ic_series.csv", "ic_summary.json", "group_equity.csv"],+ }+ return json.dumps(result, ensure_ascii=False, indent=2)+++class FactorAnalysisTool(BaseTool):+ """Factor analysis tool: compute IC/IR and layered NAV."""++ name = "factor_analysis"+ description = "Factor analysis: compute IC/IR/layered NAV. Input factor CSV and return CSV, output analysis report."+ parameters = {+ "type": "object",+ "properties": {+ "factor_csv": {+ "type": "string",+ "description": "Factor values CSV path (index=date, columns=codes)",+ },+ "return_csv": {+ "type": "string",+ "description": "Returns CSV path (same structure)",+ },+ "n_groups": {+ "type": "integer",+ "description": "Number of quantile groups",+ "default": 5,+ },+ "output_dir": {+ "type": "string",+ "description": "Output directory for results",+ },+ },+ "required": ["factor_csv", "return_csv", "output_dir"],+ }++ def execute(self, **kwargs: Any) -> str:+ """Run factor analysis.++ Args:+ **kwargs: Must include factor_csv, return_csv, output_dir. Optional n_groups.++ Returns:+ JSON-formatted analysis summary.+ """+ return run_factor_analysis(+ factor_csv=kwargs["factor_csv"],+ return_csv=kwargs["return_csv"],+ output_dir=kwargs["output_dir"],+ n_groups=kwargs.get("n_groups", 5),+ )diff --git a/agent/src/tools/load_skill_tool.py b/agent/src/tools/load_skill_tool.pynew file mode 100644index 000000000..7bff4b526--- /dev/null+++ b/agent/src/tools/load_skill_tool.py@@ -0,0 +1,48 @@+"""Load skill tool: load full skill documentation by name."""++from __future__ import annotations++import json+from typing import Any++from src.agent.skills import SkillsLoader+from src.agent.tools import BaseTool+++class LoadSkillTool(BaseTool):+ """Load the full documentation for a named skill."""++ name = "load_skill"+ description = "Load full documentation for a named skill. Use this to learn about unfamiliar strategy patterns or workflows before starting."+ parameters = {+ "type": "object",+ "properties": {+ "name": {"type": "string", "description": "Skill name (e.g. 'strategy-generate', 'momentum')"},+ },+ "required": ["name"],+ }+ repeatable = True++ def __init__(self, skills_loader: SkillsLoader | None = None) -> None:+ """Initialize LoadSkillTool.++ Args:+ skills_loader: SkillsLoader instance; creates one automatically if omitted.+ """+ self._loader = skills_loader or SkillsLoader()++ def execute(self, **kwargs: Any) -> str:+ """Load skill documentation.++ Args:+ **kwargs: Must include name.++ Returns:+ Full skill documentation or an error message.+ """+ name = kwargs["name"]+ content = self._loader.get_content(name)+ return json.dumps({+ "status": "ok" if not content.startswith("Error:") else "error",+ "content": content,+ }, ensure_ascii=False)diff --git a/agent/src/tools/options_pricing_tool.py b/agent/src/tools/options_pricing_tool.pynew file mode 100644index 000000000..51aa74ed3--- /dev/null+++ b/agent/src/tools/options_pricing_tool.py@@ -0,0 +1,125 @@+"""Options pricing tool: Black-Scholes theoretical price and Greeks."""++from __future__ import annotations++import json+from typing import Any++import numpy as np+from scipy.stats import norm++from src.agent.tools import BaseTool+++def _bs_price_and_greeks(+ spot: float,+ strike: float,+ T: float,+ r: float,+ sigma: float,+ option_type: str,+) -> dict:+ """Compute Black-Scholes price and Greeks.++ Args:+ spot: Current underlying price.+ strike: Strike price.+ T: Time to expiry in years.+ r: Risk-free rate.+ sigma: Annualised volatility.+ option_type: "call" or "put".++ Returns:+ Dict containing price, delta, gamma, theta, vega.+ """+ if T <= 0 or sigma <= 0:+ if option_type == "call":+ price = max(spot - strike, 0.0)+ delta = 1.0 if spot > strike else 0.0+ else:+ price = max(strike - spot, 0.0)+ delta = -1.0 if spot < strike else 0.0+ return {"price": price, "delta": delta, "gamma": 0.0, "theta": 0.0, "vega": 0.0}++ sqrt_T = np.sqrt(T)+ d1 = (np.log(spot / strike) + (r + sigma ** 2 / 2) * T) / (sigma * sqrt_T)+ d2 = d1 - sigma * sqrt_T+ nd1_pdf = float(norm.pdf(d1))++ if option_type == "call":+ price = float(spot * norm.cdf(d1) - strike * np.exp(-r * T) * norm.cdf(d2))+ delta = float(norm.cdf(d1))+ else:+ price = float(strike * np.exp(-r * T) * norm.cdf(-d2) - spot * norm.cdf(-d1))+ delta = float(norm.cdf(d1) - 1.0)++ gamma = float(nd1_pdf / (spot * sigma * sqrt_T))++ theta_common = -(spot * nd1_pdf * sigma) / (2 * sqrt_T)+ if option_type == "call":+ theta = theta_common - r * strike * np.exp(-r * T) * norm.cdf(d2)+ else:+ theta = theta_common + r * strike * np.exp(-r * T) * norm.cdf(-d2)+ theta = float(theta / 365.0)++ vega = float(spot * nd1_pdf * sqrt_T / 100.0)++ return {+ "price": round(price, 6),+ "delta": round(delta, 6),+ "gamma": round(gamma, 6),+ "theta": round(theta, 6),+ "vega": round(vega, 6),+ }+++class OptionsPricingTool(BaseTool):+ """Options pricing tool: Black-Scholes theoretical price and Greeks."""++ name = "options_pricing"+ description = "Options pricing: compute theoretical price and Greeks using the Black-Scholes model."+ parameters = {+ "type": "object",+ "properties": {+ "spot": {"type": "number", "description": "Current underlying price"},+ "strike": {"type": "number", "description": "Strike price"},+ "expiry_days": {"type": "number", "description": "Days to expiry"},+ "risk_free_rate": {"type": "number", "description": "Risk-free rate", "default": 0.05},+ "volatility": {"type": "number", "description": "Annualised volatility"},+ "option_type": {"type": "string", "enum": ["call", "put"], "description": "Option type"},+ },+ "required": ["spot", "strike", "expiry_days", "volatility", "option_type"],+ }++ def execute(self, **kwargs: Any) -> str:+ """Run options pricing calculation.++ Args:+ **kwargs: Must include spot, strike, expiry_days, volatility, option_type.+ Optional risk_free_rate.++ Returns:+ JSON string containing price, delta, gamma, theta, vega.+ """+ spot = float(kwargs["spot"])+ strike = float(kwargs["strike"])+ expiry_days = float(kwargs["expiry_days"])+ r = float(kwargs.get("risk_free_rate", 0.05))+ sigma = float(kwargs["volatility"])+ option_type = kwargs["option_type"]++ T = expiry_days / 365.0++ result = _bs_price_and_greeks(spot, strike, T, r, sigma, option_type)+ result["inputs"] = {+ "spot": spot,+ "strike": strike,+ "expiry_days": expiry_days,+ "risk_free_rate": r,+ "volatility": sigma,+ "option_type": option_type,+ "T_years": round(T, 6),+ }+ result["status"] = "ok"++ return json.dumps(result, ensure_ascii=False)diff --git a/agent/src/tools/path_utils.py b/agent/src/tools/path_utils.pynew file mode 100644index 000000000..a73c1ff22--- /dev/null+++ b/agent/src/tools/path_utils.py@@ -0,0 +1,18 @@+"""Shared path utilities for tools."""++from __future__ import annotations++from pathlib import Path+++def safe_path(p: str, workdir: Path) -> Path:+ """Resolve a path relative to the workspace root.++ Args:+ p: Relative or absolute path.+ workdir: Workspace root directory.++ Returns:+ Resolved absolute path.+ """+ return (workdir / p).resolve()diff --git a/agent/src/tools/pattern_tool.py b/agent/src/tools/pattern_tool.pynew file mode 100644index 000000000..bddf241de--- /dev/null+++ b/agent/src/tools/pattern_tool.py@@ -0,0 +1,365 @@+"""Chart pattern recognition tool: detect technical patterns in price series.++Reads OHLCV data from run_dir/artifacts/ohlcv_*.csv.+Can be called before coding (to inform strategy design) or after backtest (to analyse results).+"""++from __future__ import annotations++import json+from pathlib import Path+from typing import Any, Dict++import numpy as np+import pandas as pd++from src.agent.tools import BaseTool+++# ---------------------------------------------------------------------------+# Pattern detection functions+# ---------------------------------------------------------------------------++def find_peaks_valleys(close: pd.Series, window: int = 5) -> dict:+ """Detect peaks and valleys in a price series.++ Args:+ close: Closing price series.+ window: Half-window size; effective window is 2*window+1.++ Returns:+ Dict with keys "peaks" and "valleys", each a list of integer indices.+ """+ n = len(close)+ if n < 2 * window + 1:+ return {"peaks": [], "valleys": []}++ values = close.values.astype(float)+ peaks, valleys = [], []++ for i in range(window, n - window):+ seg = values[i - window : i + window + 1]+ if np.isnan(values[i]):+ continue+ seg = seg[~np.isnan(seg)]+ if len(seg) == 0:+ continue+ if values[i] == np.max(seg):+ peaks.append(i)+ if values[i] == np.min(seg):+ valleys.append(i)++ return {"peaks": peaks, "valleys": valleys}+++def candlestick_patterns(open_: pd.Series, high: pd.Series, low: pd.Series, close: pd.Series) -> pd.Series:+ """Detect candlestick patterns: doji, hammer, and engulfing.++ Args:+ open_: Open price series.+ high: High price series.+ low: Low price series.+ close: Close price series.++ Returns:+ Series with values -1 (bearish), 0 (neutral), 1 (bullish).+ """+ body = (close - open_).abs()+ total_range = high - low+ upper_shadow = high - pd.concat([open_, close], axis=1).max(axis=1)+ lower_shadow = pd.concat([open_, close], axis=1).min(axis=1) - low++ result = pd.Series(0, index=close.index, dtype=int)++ safe_range = total_range.replace(0, np.nan)+ is_doji = body / safe_range < 0.10++ is_hammer = (lower_shadow > 2 * body) & (upper_shadow < body) & ~is_doji+ result = result.where(~is_hammer, 1)++ prev_bearish = close.shift(1) < open_.shift(1)+ curr_bullish = close > open_+ engulf_bull = prev_bearish & curr_bullish & (open_ <= close.shift(1)) & (close >= open_.shift(1)) & (body > body.shift(1))+ result = result.where(~engulf_bull, 1)++ prev_bullish = close.shift(1) > open_.shift(1)+ curr_bearish = close < open_+ engulf_bear = prev_bullish & curr_bearish & (open_ >= close.shift(1)) & (close <= open_.shift(1)) & (body > body.shift(1))+ result = result.where(~engulf_bear, -1)++ return result+++def support_resistance(close: pd.Series, window: int = 20, num_levels: int = 3) -> dict:+ """Compute support and resistance levels via peak/valley clustering.++ Args:+ close: Closing price series.+ window: Peak/valley detection window.+ num_levels: Maximum number of levels to return.++ Returns:+ Dict with keys "support" and "resistance", each a list of price levels.+ """+ pv = find_peaks_valleys(close, window=window)+ values = close.values.astype(float)++ peak_prices = [float(values[i]) for i in pv["peaks"] if not np.isnan(values[i])]+ valley_prices = [float(values[i]) for i in pv["valleys"] if not np.isnan(values[i])]++ def cluster(prices: list, n: int) -> list:+ if not prices:+ return []+ sp = sorted(prices)+ if len(sp) <= n:+ return sp+ clusters: list[list[float]] = [[sp[0]]]+ rng = sp[-1] - sp[0]+ thr = rng * 0.05 if rng > 0 else 1.0+ for p in sp[1:]:+ if abs(p - np.mean(clusters[-1])) <= thr:+ clusters[-1].append(p)+ else:+ clusters.append([p])+ centers = [(len(c), float(np.mean(c))) for c in clusters]+ centers.sort(reverse=True)+ return [c for _, c in centers[:n]]++ return {"support": cluster(valley_prices, num_levels), "resistance": cluster(peak_prices, num_levels)}+++def trend_line_slope(close: pd.Series, window: int = 20) -> pd.Series:+ """Compute rolling linear-fit slope.++ Args:+ close: Closing price series.+ window: Fitting window size.++ Returns:+ Series of slope values; first window-1 entries are NaN.+ """+ n = len(close)+ slopes = np.full(n, np.nan)+ values = close.values.astype(float)+ x = np.arange(window, dtype=float)++ for i in range(window - 1, n):+ seg = values[i - window + 1 : i + 1]+ if np.any(np.isnan(seg)):+ continue+ slopes[i] = np.polyfit(x, seg, 1)[0]++ return pd.Series(slopes, index=close.index)+++def head_and_shoulders(close: pd.Series, window: int = 10) -> pd.Series:+ """Detect head-and-shoulders top pattern.++ Args:+ close: Closing price series.+ window: Peak/valley detection window.++ Returns:+ Series with 1 where pattern is detected, 0 otherwise.+ """+ result = pd.Series(0, index=close.index, dtype=int)+ pv = find_peaks_valleys(close, window=window)+ peaks = pv["peaks"]+ values = close.values.astype(float)++ if len(peaks) < 3:+ return result++ for i in range(len(peaks) - 2):+ lv, hv, rv = values[peaks[i]], values[peaks[i + 1]], values[peaks[i + 2]]+ if any(np.isnan(x) for x in (lv, hv, rv)):+ continue+ if hv <= lv or hv <= rv:+ continue+ avg = (lv + rv) / 2+ if avg == 0 or abs(lv - rv) / avg > 0.05:+ continue+ result.iloc[peaks[i + 1]] = 1++ return result+++def double_top_bottom(close: pd.Series, window: int = 10) -> pd.Series:+ """Detect double-top and double-bottom patterns.++ Args:+ close: Closing price series.+ window: Peak/valley detection window.++ Returns:+ Series with 1 (double top), -1 (double bottom), or 0 (none).+ """+ result = pd.Series(0, index=close.index, dtype=int)+ pv = find_peaks_valleys(close, window=window)+ values = close.values.astype(float)++ for i in range(len(pv["peaks"]) - 1):+ v1, v2 = values[pv["peaks"][i]], values[pv["peaks"][i + 1]]+ if np.isnan(v1) or np.isnan(v2):+ continue+ avg = (v1 + v2) / 2+ if avg != 0 and abs(v1 - v2) / avg < 0.03:+ result.iloc[pv["peaks"][i + 1]] = 1++ for i in range(len(pv["valleys"]) - 1):+ v1, v2 = values[pv["valleys"][i]], values[pv["valleys"][i + 1]]+ if np.isnan(v1) or np.isnan(v2):+ continue+ avg = (v1 + v2) / 2+ if avg != 0 and abs(v1 - v2) / abs(avg) < 0.03:+ if result.iloc[pv["valleys"][i + 1]] == 0:+ result.iloc[pv["valleys"][i + 1]] = -1++ return result+++def triangle(close: pd.Series, window: int = 20) -> pd.Series:+ """Detect triangle patterns.++ Args:+ close: Closing price series.+ window: Detection window size.++ Returns:+ Series with 1 (ascending triangle), -1 (descending triangle), or 0 (none).+ """+ n = len(close)+ result = pd.Series(0, index=close.index, dtype=int)+ values = close.values.astype(float)++ for i in range(window, n):+ seg = pd.Series(values[i - window : i + 1])+ pv = find_peaks_valleys(seg, window=max(2, window // 5))+ if len(pv["peaks"]) < 2 or len(pv["valleys"]) < 2:+ continue+ pvals = [float(seg.iloc[p]) for p in pv["peaks"]]+ vvals = [float(seg.iloc[v]) for v in pv["valleys"]]+ ps = np.polyfit(np.arange(len(pvals), dtype=float), pvals, 1)[0] if len(pvals) >= 2 else 0.0+ vs = np.polyfit(np.arange(len(vvals), dtype=float), vvals, 1)[0] if len(vvals) >= 2 else 0.0+ rng = max(pvals) - min(vvals)+ if rng == 0:+ continue+ flat = rng * 0.02+ if vs > flat and abs(ps) < flat:+ result.iloc[i] = 1+ elif ps < -flat and abs(vs) < flat:+ result.iloc[i] = -1++ return result+++def broadening(close: pd.Series, window: int = 20) -> pd.Series:+ """Detect broadening (megaphone) patterns.++ Args:+ close: Closing price series.+ window: Detection window size.++ Returns:+ Series with 1 where broadening pattern is detected, 0 otherwise.+ """+ n = len(close)+ result = pd.Series(0, index=close.index, dtype=int)+ values = close.values.astype(float)++ for i in range(window, n):+ seg = pd.Series(values[i - window : i + 1])+ pv = find_peaks_valleys(seg, window=max(2, window // 5))+ if len(pv["peaks"]) < 2 or len(pv["valleys"]) < 2:+ continue+ pvals = [float(seg.iloc[p]) for p in pv["peaks"]]+ vvals = [float(seg.iloc[v]) for v in pv["valleys"]]+ peaks_rising = all(pvals[j + 1] > pvals[j] for j in range(len(pvals) - 1))+ valleys_falling = all(vvals[j + 1] < vvals[j] for j in range(len(vvals) - 1))+ if peaks_rising and valleys_falling:+ result.iloc[i] = 1++ return result+++# ---------------------------------------------------------------------------+# Available pattern registry+# ---------------------------------------------------------------------------++_PATTERN_FUNCS = {+ "peaks_valleys": lambda df, w: find_peaks_valleys(df["close"], window=w),+ "candlestick": lambda df, w: candlestick_patterns(df["open"], df["high"], df["low"], df["close"]).value_counts().to_dict(),+ "support_resistance": lambda df, w: support_resistance(df["close"], window=w),+ "trend_slope": lambda df, w: {"mean_slope": float(trend_line_slope(df["close"], window=w).dropna().mean())} if len(df) > w else {"mean_slope": 0},+ "head_and_shoulders": lambda df, w: {"count": int(head_and_shoulders(df["close"], window=w).sum())},+ "double_top_bottom": lambda df, w: {"double_top": int((double_top_bottom(df["close"], window=w) == 1).sum()), "double_bottom": int((double_top_bottom(df["close"], window=w) == -1).sum())},+ "triangle": lambda df, w: {"ascending": int((triangle(df["close"], window=w) == 1).sum()), "descending": int((triangle(df["close"], window=w) == -1).sum())},+ "broadening": lambda df, w: {"count": int(broadening(df["close"], window=w).sum())},+}+++# ---------------------------------------------------------------------------+# Tool implementation+# ---------------------------------------------------------------------------++def run_pattern(run_dir: str, patterns: str = "all", window: int = 10) -> str:+ """Run chart pattern detection on OHLCV data in run_dir.++ Args:+ run_dir: Path to the run directory.+ patterns: Comma-separated pattern names or "all".+ window: Detection window size.++ Returns:+ JSON-formatted detection results.+ """+ arts = Path(run_dir) / "artifacts"+ ohlcv_files = list(arts.glob("ohlcv_*.csv"))+ if not ohlcv_files:+ return json.dumps({"status": "error", "error": "No OHLCV data found; run backtest first"}, ensure_ascii=False)++ if patterns == "all":+ selected = list(_PATTERN_FUNCS.keys())+ else:+ selected = [p.strip() for p in patterns.split(",") if p.strip() in _PATTERN_FUNCS]+ if not selected:+ return json.dumps({"status": "error", "error": f"Invalid pattern name(s). Available: {', '.join(_PATTERN_FUNCS.keys())}"}, ensure_ascii=False)++ results: Dict[str, Any] = {}+ for f in ohlcv_files:+ code = f.stem.replace("ohlcv_", "")+ df = pd.read_csv(f, index_col=0, parse_dates=True)+ if df.empty:+ continue+ code_results: Dict[str, Any] = {}+ for pattern_name in selected:+ func = _PATTERN_FUNCS[pattern_name]+ code_results[pattern_name] = func(df, window)+ results[code] = code_results++ return json.dumps({"status": "ok", "results": results, "patterns": selected, "window": window}, ensure_ascii=False, default=str)+++class PatternTool(BaseTool):+ """Chart pattern recognition tool."""++ name = "pattern"+ description = "Run chart pattern detection on backtest data (head-and-shoulders, double top/bottom, candlestick, support/resistance, etc.). Call after backtest."+ parameters = {+ "type": "object",+ "properties": {+ "run_dir": {"type": "string", "description": "Path to the run directory"},+ "patterns": {"type": "string", "description": "Comma-separated pattern names or 'all'. Options: peaks_valleys, candlestick, support_resistance, trend_slope, head_and_shoulders, double_top_bottom, triangle, broadening"},+ "window": {"type": "integer", "description": "Detection window size (default 10)"},+ },+ "required": ["run_dir"],+ }+ repeatable = True++ def execute(self, **kwargs) -> str:+ """Run pattern detection."""+ return run_pattern(+ run_dir=kwargs["run_dir"],+ patterns=kwargs.get("patterns", "all"),+ window=kwargs.get("window", 10),+ )diff --git a/agent/src/tools/read_file_tool.py b/agent/src/tools/read_file_tool.pynew file mode 100644index 000000000..cdb341b4f--- /dev/null+++ b/agent/src/tools/read_file_tool.py@@ -0,0 +1,91 @@+"""Read file tool: read file contents from the workspace."""++from __future__ import annotations++import json+from pathlib import Path+from typing import Any++from src.agent.tools import BaseTool+from src.tools.path_utils import safe_path as _safe_path++_OUTPUT_LIMIT = 50_000+++class ReadFileTool(BaseTool):+ """Read file contents with optional line limit."""++ name = "read_file"+ description = "Read a file from the workspace. Returns file contents with optional line limit."+ parameters = {+ "type": "object",+ "properties": {+ "path": {"type": "string", "description": "File path relative to run_dir or skills/"},+ "limit": {"type": "integer", "description": "Max number of lines to return (default: all)"},+ },+ "required": ["path"],+ }+ repeatable = True++ def execute(self, **kwargs: Any) -> str:+ """Read a file.++ Args:+ **kwargs: Must include path. Optional limit and run_dir.++ Returns:+ JSON string containing content or an error.+ """+ file_path = kwargs["path"]+ limit = kwargs.get("limit")+ run_dir = kwargs.get("run_dir")++ allowed_roots = []+ if run_dir:+ allowed_roots.append(Path(run_dir).resolve())+ # Read-only access to skills/+ skills_dir = Path(__file__).resolve().parents[1] / "skills"+ if skills_dir.exists():+ allowed_roots.append(skills_dir.resolve())++ # Strip redundant "skills/" prefix that LLMs sometimes add+ paths_to_try = [file_path]+ if file_path.startswith("skills/"):+ paths_to_try.append(file_path[len("skills/"):])++ resolved = None+ for root in allowed_roots:+ for p in paths_to_try:+ try:+ candidate = _safe_path(p, root)+ if candidate.exists():+ resolved = candidate+ break+ except ValueError:+ continue+ if resolved:+ break++ if resolved is None:+ return json.dumps({+ "status": "error",+ "error": f"File not found or path escapes workspace: {file_path}",+ }, ensure_ascii=False)++ try:+ text = resolved.read_text(encoding="utf-8")+ if limit and limit > 0:+ lines = text.splitlines(keepends=True)+ text = "".join(lines[:limit])+ if len(text) > _OUTPUT_LIMIT:+ text = text[:_OUTPUT_LIMIT] + "\n... (truncated)"+ return json.dumps({+ "status": "ok",+ "path": str(resolved),+ "content": text,+ }, ensure_ascii=False)+ except Exception as exc:+ return json.dumps({+ "status": "error",+ "error": str(exc),+ }, ensure_ascii=False)diff --git a/agent/src/tools/subagent_tool.py b/agent/src/tools/subagent_tool.pynew file mode 100644index 000000000..edb988cfd--- /dev/null+++ b/agent/src/tools/subagent_tool.py@@ -0,0 +1,100 @@+"""Subagent tool: isolated-context child agent that shares the filesystem and returns only a summary."""++from __future__ import annotations++import json+import time+from typing import Any++from src.agent.tools import BaseTool, ToolRegistry+from src.agent.context import ContextBuilder++_MAX_SUBAGENT_ITERATIONS = 25+_MAX_SUBAGENT_TIMEOUT_SEC = 300+_MAX_SUBAGENT_TOKEN_ESTIMATE = 30000+++class SubagentTool(BaseTool):+ """Spawn a child agent to execute an independent task with isolated context."""++ name = "subagent"+ description = (+ "Spawn a subagent with fresh context. It shares the filesystem but not "+ "conversation history. Use for parallel research, isolated exploration, "+ "or tasks that would pollute the main context. Returns only a summary."+ )+ parameters = {+ "type": "object",+ "properties": {+ "prompt": {"type": "string", "description": "Task for the subagent"},+ "description": {"type": "string", "description": "Short label for display"},+ },+ "required": ["prompt"],+ }++ def execute(self, **kwargs: Any) -> str:+ """Start a child agent and return its summary.++ Three guards against infinite loops:+ - Iteration cap: _MAX_SUBAGENT_ITERATIONS rounds+ - Time cap: _MAX_SUBAGENT_TIMEOUT_SEC seconds+ - Token estimate cap: _MAX_SUBAGENT_TOKEN_ESTIMATE tokens++ Args:+ **kwargs: Must include prompt (str). Optional run_dir (str) and description (str).++ Returns:+ JSON string with status and summary fields.+ """+ prompt = kwargs["prompt"]+ run_dir = kwargs.get("run_dir")++ from src.providers.chat import ChatLLM+ from src.tools.bash_tool import BashTool+ from src.tools.read_file_tool import ReadFileTool+ from src.tools.write_file_tool import WriteFileTool+ from src.tools.edit_file_tool import EditFileTool+ from src.tools.load_skill_tool import LoadSkillTool+ from src.tools.backtest_tool import BacktestTool++ llm = ChatLLM()+ child = ToolRegistry()+ for t in [BashTool(), ReadFileTool(), WriteFileTool(),+ EditFileTool(), LoadSkillTool(), BacktestTool()]:+ child.register(t)++ messages = [+ {"role": "system", "content": "You are a quantitative research subagent. Complete the task using tools, then summarize findings."},+ {"role": "user", "content": prompt},+ ]++ t0 = time.monotonic()+ for iteration in range(_MAX_SUBAGENT_ITERATIONS):+ elapsed = time.monotonic() - t0+ if elapsed > _MAX_SUBAGENT_TIMEOUT_SEC:+ return json.dumps(+ {"status": "timeout", "summary": f"Subagent timed out after {elapsed:.0f}s ({iteration} iterations)"},+ ensure_ascii=False,+ )++ token_estimate = len(json.dumps(messages)) // 4+ if token_estimate > _MAX_SUBAGENT_TOKEN_ESTIMATE:+ return json.dumps(+ {"status": "token_limit", "summary": f"Subagent context too large (~{token_estimate} tokens, {iteration} iterations)"},+ ensure_ascii=False,+ )++ response = llm.chat(messages, tools=child.get_definitions())+ if not response.has_tool_calls:+ return json.dumps({"status": "ok", "summary": response.content or "(no summary)"}, ensure_ascii=False)+ messages.append(ContextBuilder.format_assistant_tool_calls(response.tool_calls, content=response.content))+ for tc in response.tool_calls:+ if run_dir and "run_dir" not in tc.arguments:+ tc.arguments["run_dir"] = run_dir+ result = child.execute(tc.name, tc.arguments)+ messages.append(ContextBuilder.format_tool_result(tc.id, tc.name, result[:10000]))++ return json.dumps(+ {"status": "iteration_limit", "summary": f"Subagent hit iteration limit ({_MAX_SUBAGENT_ITERATIONS} iterations)"},+ ensure_ascii=False,+ )diff --git a/agent/src/tools/swarm_tool.py b/agent/src/tools/swarm_tool.pynew file mode 100644index 000000000..db4295507--- /dev/null+++ b/agent/src/tools/swarm_tool.py@@ -0,0 +1,709 @@+"""SwarmTool: tool for the main agent to invoke a swarm multi-agent team.++The user provides a natural-language prompt; the tool auto-selects the best preset and extracts variables.+Blocks synchronously until the run completes and returns a JSON summary.+"""++from __future__ import annotations++import json+import logging+import re+import time+from pathlib import Path+from typing import Any++from src.agent.tools import BaseTool++logger = logging.getLogger(__name__)++_POLL_INTERVAL_SECONDS = 5+_MAX_WAIT_SECONDS = 1800 # 30 minutes++# Preset matching: (preset_name, keyword_patterns, weight_boost). Patterns match user intent (EN + ZH).+_PRESET_KEYWORDS: list[tuple[str, list[str], float]] = [+ (+ "global_allocation_committee",+ [+ r"cross[- ]?market",+ r"global\s+alloc",+ "multi[- ]asset",+ "ไธๅธๅบ",+ "ๅ จ็้ ็ฝฎ",+ "่ตไบง้ ็ฝฎ",+ "ๆธฏ็พ.*A่ก",+ "A่ก.*ๅ ๅฏ",+ "ๅ ๅฏ.*A่ก",+ "ๅคๅธๅบ",+ ],+ 1.0,+ ),+ (+ "risk_committee",+ [+ r"risk\s+audit",+ "drawdown",+ r"tail\s+risk",+ r"stress\s+test",+ r"\bVaR\b",+ "้ฃๆง",+ "้ฃ้ฉๅฎก่ฎก",+ "ๅๆค",+ "ๅฐพ้จ้ฃ้ฉ",+ "ๅๅๆต่ฏ",+ "้ฃ้ฉ่ฏไผฐ",+ ],+ 1.0,+ ),+ (+ "quant_strategy_desk",+ [+ r"\bquant\b",+ "alpha",+ "factor",+ "backtest",+ "ๅคๅ ๅญ",+ "้ๅ็ญ็ฅ",+ "ๅ ๅญ",+ "้่ก",+ "็ญ็ฅ.*ๅๆต",+ ],+ 1.0,+ ),+ (+ "equity_research_team",+ [+ "equity research",+ "stock research",+ "็ ๆฅ",+ "็ ็ฉถๆฅๅ",+ "่กไธๅๆ",+ "ไธช่กๅๆ",+ "ๆ่ตๅๆ",+ "macro.*sector",+ "ๆ่ตๆบไผ",+ ],+ 0.85,+ ),+ (+ "factor_research_committee",+ [+ r"factor\s+research",+ r"\bIC\b",+ "ICIR",+ "ๅ ๅญๅงๅไผ",+ "ๅ ๅญ็ ็ฉถ",+ ],+ 0.9,+ ),+ (+ "event_driven_task_force",+ [+ r"M&A",+ "merger",+ "insider",+ r"earnings\s+surprise",+ "ไบไปถ้ฉฑๅจ",+ "ๅนถ่ดญ",+ "่ดขๆฅ",+ ],+ 0.9,+ ),+ (+ "etf_allocation_desk",+ [+ r"\bETF\b",+ r"index\s+fund",+ "ๆๆฐๅบ้",+ "ETF้ ็ฝฎ",+ ],+ 0.9,+ ),+ (+ "derivatives_strategy_desk",+ [+ r"\boption\b",+ "call",+ "put",+ "Greeks",+ r"implied\s+vol",+ "IV",+ "ๆๆ",+ "่ก็ๅ",+ ],+ 0.9,+ ),+ (+ "crypto_research_lab",+ [+ r"\bBTC\b",+ r"\bETH\b",+ r"\bSOL\b",+ "crypto",+ "bitcoin",+ "ๅ ๅฏ",+ "ๆฐๅญ่ดงๅธ",+ ],+ 0.95,+ ),+ (+ "credit_research_team",+ [+ r"credit\s+bond",+ "LGFV",+ r"\bYTM\b",+ "ๅฉๅทฎ",+ "ไฟก็จๅบ",+ "ๅๆ",+ ],+ 0.9,+ ),+ (+ "convertible_bond_team",+ [+ "convertible",+ "ๅฏ่ฝฌๅบ",+ r"\bCB\b",+ ],+ 0.9,+ ),+ (+ "fundamental_research_team",+ [+ "fundamental",+ r"deep\s+dive",+ "่ดขๅก",+ "ๅบๆฌ้ข",+ ],+ 0.85,+ ),+ (+ "commodity_research_team",+ [+ "commodity",+ "crude",+ "gold",+ "copper",+ r"iron\s+ore",+ "ๅๅ",+ "ๅๆฒน",+ "้ป้",+ ],+ 0.9,+ ),+ (+ "fund_selection_panel",+ [+ r"\bFOF\b",+ r"mutual\s+fund",+ "ๅบ้็ญ้",+ "้ๅบ",+ ],+ 0.85,+ ),+ (+ "social_alpha_team",+ [+ r"social\s+media",+ "twitter",+ "reddit",+ "็คพๅช",+ "่ๆ ",+ ],+ 0.85,+ ),+ (+ "geopolitical_war_room",+ [+ "geopolitical",+ r"war\s+risk",+ "sanction",+ "ๅฐ็ผ",+ "ๅฑๆบๅบๆฏ",+ ],+ 0.9,+ ),+ (+ "pairs_research_lab",+ [+ r"pairs\s+trading",+ "cointegration",+ "้ ๅฏน",+ "็ป่ฎกๅฅๅฉ",+ ],+ 0.9,+ ),+ (+ "investment_committee",+ [+ r"investment\s+committee",+ "ๆๅงไผ",+ "ๆ่ตๅณ็ญ",+ ],+ 0.85,+ ),+ (+ "macro_strategy_forum",+ [+ r"\bFed\b",+ r"\bCPI\b",+ r"\bPMI\b",+ "macro",+ "่ดงๅธๆฟ็ญ",+ "ๅฎ่ง",+ ],+ 0.9,+ ),+ (+ "statistical_arbitrage_desk",+ [+ r"statistical\s+arbitrage",+ r"stat\s+arb",+ "็ป่ฎกๅฅๅฉ",+ ],+ 0.9,+ ),+ (+ "sentiment_intelligence_team",+ [+ "sentiment",+ r"fear\s+and\s+greed",+ "ๆ ็ปช",+ "ๆๆ ",+ ],+ 0.85,+ ),+ (+ "technical_analysis_panel",+ [+ r"technical\s+analysis",+ r"\bRSI\b",+ r"\bMACD\b",+ "ๆๆฏๅๆ",+ "K็บฟ",+ ],+ 0.85,+ ),+ (+ "sector_rotation_team",+ [+ r"sector\s+rotation",+ "ๆฟๅ่ฝฎๅจ",+ "่กไธ่ฝฎๅจ",+ ],+ 0.85,+ ),+ (+ "portfolio_review_board",+ [+ r"portfolio\s+review",+ "็ปๅๅค็",+ "ไธ็ปฉๅฝๅ ",+ ],+ 0.85,+ ),+ (+ "ml_quant_lab",+ [+ r"\bML\b",+ r"machine\s+learning",+ "LSTM",+ "XGBoost",+ "ๆบๅจๅญฆไน ",+ "ๆทฑๅบฆๅญฆไน ",+ ],+ 0.9,+ ),+]++# Market labels used in YAML templates (English, compatible with {market} placeholders).+_MARKET_PATTERNS: list[tuple[str, list[str]]] = [+ ("A-shares", [r"A่ก", r"a่ก", "ๆฒชๆทฑ", "ไธ่ฏ", "ๆทฑ่ฏ", "ๅไธๆฟ", "็งๅๆฟ", "ไธญ่ฏ", r"\bCSI\b"]),+ ("crypto", ["ๅ ๅฏ", r"\bcrypto\b", r"\bBTC\b", r"\bETH\b", "ๅธ", "USDT", "ๆฐๅญ่ดงๅธ"]),+ ("Hong Kong", ["ๆธฏ่ก", "ๆ็", r"H่ก", "ๆธฏไบคๆ", r"\.HK\b"]),+ ("US", ["็พ่ก", "็บณๆฏ่พพๅ ", "ๆ ๆฎ", "้็ผๆฏ", r"S&P", r"\.US\b"]),+]++# Risk tolerance for global_allocation_committee (English).+_RISK_PATTERNS: list[tuple[str, list[str]]] = [+ ("conservative", ["ไฟๅฎ", r"ไฝ้ฃ้ฉ", "็จณๅฅๅไฟๅฎ", r"conservative"]),+ ("moderate", ["็จณๅฅ", "ไธญ็ญ้ฃ้ฉ", r"moderate", r"balanced"]),+ ("aggressive", ["ๆฟ่ฟ", "้ซ้ฃ้ฉ", "่ฟๅ", r"aggressive"]),+]+++_STRATEGY_TYPE_PATTERNS: list[tuple[str, list[str]]] = [+ ("low-price", [r"\blow[- ]price\b", r"\bcheap\b", r"\bdiscount\b", r"\blow premium\b"]),+ ("dual-low", [r"\bdual[- ]low\b", r"\bdouble[- ]low\b"]),+ ("high-convexity", [r"\bhigh[- ]convexity\b", r"\bconvexity\b"]),+ ("rotation", [r"\brotation\b", r"\brotate\b", r"\brebalance\b"]),+]++_TARGET_VARIABLE_PATTERNS: list[tuple[str, list[str]]] = [+ ("volatility", [r"\bvolatility\b", r"\bvol\b", r"\bvariance\b", r"\brisk\b"]),+ ("direction", [r"\bdirection(?:al)?\b", r"\bup[- ]down\b", r"\bclassification\b"]),+ ("return", [r"\breturns?\b", r"\balpha\b", r"\bpredict\b", r"\bforecast\b"]),+]++_REVIEW_PERIOD_PATTERNS: list[tuple[str, list[str]]] = [+ ("monthly", [r"\bmonthly\b", r"\bmonth(?:ly)?\b"]),+ ("quarterly", [r"\bquarter(?:ly)?\b", r"\bq[1-4]\b"]),+]++_SECTOR_PATTERNS: list[tuple[str, list[str]]] = [+ ("banks", [r"\bbank(?:s|ing)?\b", r"\bfinancials?\b"]),+ ("consumer", [r"\bconsumer\b", r"\bretail\b", r"\bstaples\b", r"\bdiscretionary\b"]),+ ("semiconductors", [r"\bsemi(?:s|conductors?)?\b", r"\bchip(?:s)?\b"]),+ ("technology", [r"\btech(?:nology)?\b", r"\bsoftware\b", r"\binternet\b"]),+ ("energy", [r"\benergy\b", r"\boil\b", r"\bgas\b", r"\bpower\b"]),+ ("healthcare", [r"\bhealth ?care\b", r"\bbiotech\b", r"\bpharma\b"]),+ ("industrials", [r"\bindustrial(?:s)?\b", r"\bmanufacturing\b"]),+ ("real estate", [r"\breal estate\b", r"\bproperty\b", r"\breit(?:s)?\b"]),+ ("utilities", [r"\butilit(?:y|ies)\b"]),+ ("materials", [r"\bmaterials?\b", r"\bmetals?\b", r"\bmining\b"]),+]+++def _match_preset(prompt: str) -> str:+ """Match user prompt to best preset using keyword scoring.++ Args:+ prompt: User's natural language prompt.++ Returns:+ Best matching preset name.+ """+ scores: dict[str, float] = {}+ for preset_name, keywords, boost in _PRESET_KEYWORDS:+ score = 0.0+ for kw in keywords:+ if re.search(kw, prompt, re.IGNORECASE):+ score += boost+ scores[preset_name] = score++ best = max(scores, key=scores.get) # type: ignore[arg-type]+ if scores[best] > 0:+ return best++ return "equity_research_team"+++def _extract_market(prompt: str) -> str:+ """Extract target market label from prompt.++ Args:+ prompt: User's natural language prompt.++ Returns:+ Market label for template variables, default A-shares.+ """+ for market, patterns in _MARKET_PATTERNS:+ for pat in patterns:+ if re.search(pat, prompt, re.IGNORECASE):+ return market+ return "A-shares"+++def _extract_risk_tolerance(prompt: str) -> str:+ """Extract risk tolerance from prompt (English labels).++ Args:+ prompt: User's natural language prompt.++ Returns:+ conservative | moderate | aggressive.+ """+ for level, patterns in _RISK_PATTERNS:+ for pat in patterns:+ if re.search(pat, prompt, re.IGNORECASE):+ return level+ return "moderate"+++def _risk_to_etf_profile(risk: str) -> str:+ """Map tolerance to etf_allocation_desk risk_profile values."""+ return {"conservative": "conservative", "moderate": "balanced", "aggressive": "aggressive"}.get(risk, "balanced")+++def _extract_strategy_type(prompt: str) -> str:+ """Extract convertible bond strategy type from prompt.++ Args:+ prompt: User's natural language prompt.++ Returns:+ Strategy type label used by the convertible bond preset.+ """+ for strategy_type, patterns in _STRATEGY_TYPE_PATTERNS:+ for pat in patterns:+ if re.search(pat, prompt, re.IGNORECASE):+ return strategy_type+ return "rotation"+++def _extract_target_variable(prompt: str) -> str:+ """Extract ML prediction target from prompt.++ Args:+ prompt: User's natural language prompt.++ Returns:+ Prediction target label for ml_quant_lab.+ """+ for target_variable, patterns in _TARGET_VARIABLE_PATTERNS:+ for pat in patterns:+ if re.search(pat, prompt, re.IGNORECASE):+ return target_variable+ return "return"+++def _extract_review_period(prompt: str) -> str:+ """Extract portfolio review cadence from prompt.++ Args:+ prompt: User's natural language prompt.++ Returns:+ Review cadence label for portfolio_review_board.+ """+ for review_period, patterns in _REVIEW_PERIOD_PATTERNS:+ for pat in patterns:+ if re.search(pat, prompt, re.IGNORECASE):+ return review_period+ return "quarterly"+++def _extract_sector(prompt: str) -> str:+ """Extract sector constraint from prompt.++ Args:+ prompt: User's natural language prompt.++ Returns:+ Sector filter value, or empty string for full-market scans.+ """+ broad_market_patterns = [+ r"\bfull market\b",+ r"\bbroad market\b",+ r"\ball sectors\b",+ r"\bacross sectors\b",+ ]+ for pat in broad_market_patterns:+ if re.search(pat, prompt, re.IGNORECASE):+ return ""++ for sector, patterns in _SECTOR_PATTERNS:+ for pat in patterns:+ if re.search(pat, prompt, re.IGNORECASE):+ return sector+ return ""+++def _snippet(prompt: str, max_len: int = 240) -> str:+ """Trim prompt for auxiliary fields."""+ s = prompt.strip()+ return s if len(s) <= max_len else s[: max_len - 3] + "..."+++def _build_variables(preset_name: str, prompt: str) -> dict[str, str]:+ """Build template variables from prompt for the matched preset.++ Args:+ preset_name: Matched preset name.+ prompt: User's original prompt.++ Returns:+ Dict of template variables required by the YAML preset.+ """+ market = _extract_market(prompt)+ risk = _extract_risk_tolerance(prompt)+ goal = prompt.strip()+ g = _snippet(goal, 2000)++ # Preset-specific variable sets (see agent/config/swarm/*.yaml).+ builders: dict[str, dict[str, str]] = {+ "global_allocation_committee": {"goal": g, "risk_tolerance": risk},+ "equity_research_team": {"market": market, "goal": g},+ "quant_strategy_desk": {"market": market, "goal": g},+ "risk_committee": {"goal": g},+ "factor_research_committee": {"market": market, "factor_type": "value"},+ "event_driven_task_force": {"market": market, "event_type": "all types"},+ "etf_allocation_desk": {"risk_profile": _risk_to_etf_profile(risk), "market": market},+ "derivatives_strategy_desk": {"target": g, "view": "neutral"},+ "crypto_research_lab": {"target": "BTC, ETH, SOL", "timeframe": "medium-term 1-3 months"},+ "credit_research_team": {"target": g, "market": "China credit bonds"},+ "convertible_bond_team": {+ "market": "A-share convertible bonds",+ "goal": g,+ "strategy_type": _extract_strategy_type(prompt),+ },+ "fundamental_research_team": {"target": g, "market": market},+ "commodity_research_team": {"commodity": "gold", "horizon": "3 months"},+ "fund_selection_panel": {"fund_type": "equity", "goal": g},+ "social_alpha_team": {"target": g, "timeframe": "daily"},+ "geopolitical_war_room": {"crisis": g, "market": market},+ "pairs_research_lab": {"market": market, "sector": _extract_sector(prompt)},+ "investment_committee": {"target": g, "market": market},+ "macro_strategy_forum": {"market": market, "horizon": "quarterly"},+ "statistical_arbitrage_desk": {"market": market, "goal": g, "sector": _extract_sector(prompt)},+ "sentiment_intelligence_team": {"market": market, "timeframe": "daily"},+ "technical_analysis_panel": {"target": g, "timeframe": "daily"},+ "sector_rotation_team": {"market": market, "goal": g},+ "portfolio_review_board": {"portfolio": g, "review_period": _extract_review_period(prompt), "goal": g},+ "ml_quant_lab": {"market": market, "target_variable": _extract_target_variable(prompt), "goal": g},+ }++ return builders.get(preset_name, {"market": market, "goal": g})+++class SwarmTool(BaseTool):+ """Launch a swarm multi-agent team to execute complex tasks.++ Accepts a natural-language prompt, auto-selects the best preset,+ and blocks synchronously until the swarm run completes or times out.+ """++ name = "run_swarm"+ description = (+ "Run a multi-agent swarm team for complex analysis tasks. "+ "Provide a natural language prompt; the tool picks a preset from agent/config/swarm "+ "(e.g. equity_research_team, quant_strategy_desk, global_allocation_committee, risk_committee) "+ "and fills template variables. "+ "Example: run_swarm(prompt='Analyze A-share new energy opportunities for Q2 2026')"+ )+ parameters = {+ "type": "object",+ "properties": {+ "prompt": {+ "type": "string",+ "description": "Natural language description of the analysis task.",+ },+ },+ "required": ["prompt"],+ }++ def execute(self, **kwargs: Any) -> str:+ """Start a swarm run: auto-match preset, extract variables, wait for completion.++ Args:+ **kwargs: Must include prompt (str).++ Returns:+ JSON string with status, preset, variables, final_report, tasks, token_usage.+ """+ prompt = kwargs.get("prompt", "")++ if not prompt:+ return json.dumps(+ {"status": "error", "error": "Missing 'prompt' parameter"},+ ensure_ascii=False,+ )++ preset = _match_preset(prompt)+ variables = _build_variables(preset, prompt)++ logger.info(+ "SwarmTool: matched preset=%s, variables=%s from prompt: %s",+ preset,+ variables,+ prompt[:100],+ )++ from src.swarm.runtime import SwarmRuntime+ from src.swarm.store import SwarmStore++ swarm_base_dir = Path(__file__).resolve().parents[2] / ".swarm" / "runs"+ swarm_base_dir.mkdir(parents=True, exist_ok=True)+ store = SwarmStore(base_dir=swarm_base_dir)+ runtime = SwarmRuntime(store=store)++ try:+ run = runtime.start_run(preset, variables)+ except FileNotFoundError as exc:+ return json.dumps(+ {"status": "error", "error": f"Preset not found: {exc}"},+ ensure_ascii=False,+ )+ except ValueError as exc:+ return json.dumps(+ {"status": "error", "error": f"Invalid DAG: {exc}"},+ ensure_ascii=False,+ )+ except Exception as exc:+ return json.dumps(+ {"status": "error", "error": f"Failed to start swarm: {exc}"},+ ensure_ascii=False,+ )++ run_id = run.id+ logger.info("SwarmTool: started run %s (preset=%s)", run_id, preset)++ t0 = time.monotonic()+ while time.monotonic() - t0 < _MAX_WAIT_SECONDS:+ time.sleep(_POLL_INTERVAL_SECONDS)++ loaded = store.load_run(run_id)+ if loaded is None:+ return json.dumps(+ {"status": "error", "error": f"Run {run_id} disappeared"},+ ensure_ascii=False,+ )++ if loaded.status.value in ("completed", "failed", "cancelled"):+ return _format_result(loaded, preset, variables)++ runtime.cancel_run(run_id)+ loaded = store.load_run(run_id)+ if loaded is not None:+ return _format_result(loaded, preset, variables, timed_out=True)++ return json.dumps(+ {"status": "timeout", "error": f"Swarm run {run_id} timed out after {_MAX_WAIT_SECONDS}s"},+ ensure_ascii=False,+ )+++def _format_result(+ run: Any,+ preset: str,+ variables: dict[str, str],+ timed_out: bool = False,+) -> str:+ """Format a SwarmRun into a JSON result string.++ Args:+ run: SwarmRun instance.+ preset: Matched preset name.+ variables: Extracted variables.+ timed_out: Whether the run was terminated due to timeout.++ Returns:+ JSON string with run status, report, task summaries, and token usage.+ """+ task_summaries = []+ for task in run.tasks:+ task_summaries.append(+ {+ "id": task.id,+ "agent_id": task.agent_id,+ "status": task.status.value if hasattr(task.status, "value") else str(task.status),+ "summary": task.summary or "",+ "iterations": task.worker_iterations,+ }+ )++ status = "timeout" if timed_out else run.status.value++ result = {+ "status": status,+ "run_id": run.id,+ "preset": preset,+ "auto_variables": variables,+ "final_report": run.final_report or "",+ "tasks": task_summaries,+ "token_usage": {+ "total_input_tokens": run.total_input_tokens,+ "total_output_tokens": run.total_output_tokens,+ },+ }+ return json.dumps(result, ensure_ascii=False, indent=2)diff --git a/agent/src/tools/task_tools.py b/agent/src/tools/task_tools.pynew file mode 100644index 000000000..dcfe29301--- /dev/null+++ b/agent/src/tools/task_tools.py@@ -0,0 +1,135 @@+"""Task system: persistent tasks + dependency graph stored as JSON files."""++from __future__ import annotations++import json+from pathlib import Path+from typing import Any++from src.agent.tools import BaseTool++TASKS_DIR = Path(__file__).resolve().parents[2] / ".tasks"+++class TaskManager:+ """Task CRUD + dependency graph; one JSON file per task."""++ def __init__(self) -> None:+ self.dir = TASKS_DIR+ self.dir.mkdir(exist_ok=True)+ self._next_id = self._max_id() + 1++ def _max_id(self) -> int:+ ids = [int(f.stem.split("_")[1]) for f in self.dir.glob("task_*.json")]+ return max(ids) if ids else 0++ def _load(self, task_id: int) -> dict:+ path = self.dir / f"task_{task_id}.json"+ if not path.exists():+ raise ValueError(f"Task {task_id} not found")+ return json.loads(path.read_text(encoding="utf-8"))++ def _save(self, task: dict) -> None:+ path = self.dir / f"task_{task['id']}.json"+ path.write_text(json.dumps(task, indent=2, ensure_ascii=False), encoding="utf-8")++ def create(self, subject: str, description: str = "") -> str:+ task = {"id": self._next_id, "subject": subject, "description": description,+ "status": "pending", "blockedBy": [], "blocks": []}+ self._save(task)+ self._next_id += 1+ return json.dumps(task, indent=2, ensure_ascii=False)++ def get(self, task_id: int) -> str:+ return json.dumps(self._load(task_id), indent=2, ensure_ascii=False)++ def update(self, task_id: int, status: str = None,+ addBlockedBy: list = None, addBlocks: list = None) -> str:+ task = self._load(task_id)+ if status:+ task["status"] = status+ if status == "completed":+ self._clear_dep(task_id)+ if addBlockedBy:+ task["blockedBy"] = list(set(task["blockedBy"] + addBlockedBy))+ if addBlocks:+ task["blocks"] = list(set(task["blocks"] + addBlocks))+ for bid in addBlocks:+ try:+ blocked = self._load(bid)+ if task_id not in blocked["blockedBy"]:+ blocked["blockedBy"].append(task_id)+ self._save(blocked)+ except ValueError:+ pass+ self._save(task)+ return json.dumps(task, indent=2, ensure_ascii=False)++ def _clear_dep(self, completed_id: int) -> None:+ for f in self.dir.glob("task_*.json"):+ task = json.loads(f.read_text(encoding="utf-8"))+ if completed_id in task.get("blockedBy", []):+ task["blockedBy"].remove(completed_id)+ self._save(task)++ def list_all(self) -> str:+ tasks = [json.loads(f.read_text(encoding="utf-8")) for f in sorted(self.dir.glob("task_*.json"))]+ if not tasks:+ return "No tasks."+ lines = []+ for t in tasks:+ m = {"pending": "[ ]", "in_progress": "[>]", "completed": "[x]"}.get(t["status"], "[?]")+ b = f" (blocked by: {t['blockedBy']})" if t.get("blockedBy") else ""+ lines.append(f"{m} #{t['id']}: {t['subject']}{b}")+ return "\n".join(lines)+++TASKS = TaskManager()+++class TaskCreateTool(BaseTool):+ name = "task_create"+ description = "Create a new task."+ parameters = {"type": "object", "properties": {+ "subject": {"type": "string"}, "description": {"type": "string"}+ }, "required": ["subject"]}++ def execute(self, **kw: Any) -> str:+ return TASKS.create(kw["subject"], kw.get("description", ""))+++class TaskUpdateTool(BaseTool):+ name = "task_update"+ description = "Update a task's status or dependencies."+ parameters = {"type": "object", "properties": {+ "task_id": {"type": "integer"},+ "status": {"type": "string", "enum": ["pending", "in_progress", "completed"]},+ "addBlockedBy": {"type": "array", "items": {"type": "integer"}},+ "addBlocks": {"type": "array", "items": {"type": "integer"}},+ }, "required": ["task_id"]}+ repeatable = True++ def execute(self, **kw: Any) -> str:+ return TASKS.update(kw["task_id"], kw.get("status"), kw.get("addBlockedBy"), kw.get("addBlocks"))+++class TaskListTool(BaseTool):+ name = "task_list"+ description = "List all tasks with status summary."+ parameters = {"type": "object", "properties": {}, "required": []}+ repeatable = True++ def execute(self, **kw: Any) -> str:+ return TASKS.list_all()+++class TaskGetTool(BaseTool):+ name = "task_get"+ description = "Get full details of a task by ID."+ parameters = {"type": "object", "properties": {+ "task_id": {"type": "integer"},+ }, "required": ["task_id"]}+ repeatable = True++ def execute(self, **kw: Any) -> str:+ return TASKS.get(kw["task_id"])diff --git a/agent/src/tools/web_reader_tool.py b/agent/src/tools/web_reader_tool.pynew file mode 100644index 000000000..fa3eb3a9e--- /dev/null+++ b/agent/src/tools/web_reader_tool.py@@ -0,0 +1,77 @@+"""Web reader tool: fetch a URL as Markdown text via the Jina Reader API."""++from __future__ import annotations++import json++import requests++from src.agent.tools import BaseTool++_JINA_PREFIX = "https://r.jina.ai/"+_TIMEOUT = 30+_MAX_LENGTH = 8000+++def read_url(url: str) -> str:+ """Fetch web page content via the Jina Reader API.++ Args:+ url: Target URL.++ Returns:+ JSON-formatted result containing title, content, and url.+ """+ try:+ resp = requests.get(+ f"{_JINA_PREFIX}{url}",+ headers={"Accept": "text/markdown"},+ timeout=_TIMEOUT,+ )+ if resp.status_code != 200:+ return json.dumps({+ "status": "error",+ "error": f"Jina Reader returned {resp.status_code}: {resp.text[:500]}",+ }, ensure_ascii=False)++ text = resp.text+ title = ""+ for line in text.split("\n"):+ if line.startswith("Title:"):+ title = line[6:].strip()+ break++ if len(text) > _MAX_LENGTH:+ text = text[:_MAX_LENGTH] + f"\n\n... (truncated, total {len(resp.text)} chars)"++ return json.dumps({+ "status": "ok",+ "title": title,+ "url": url,+ "content": text,+ "length": len(resp.text),+ }, ensure_ascii=False)++ except requests.Timeout:+ return json.dumps({"status": "error", "error": f"Request timed out ({_TIMEOUT}s)"}, ensure_ascii=False)+ except Exception as exc:+ return json.dumps({"status": "error", "error": str(exc)}, ensure_ascii=False)+++class WebReaderTool(BaseTool):+ """Web reader tool."""++ name = "read_url"+ description = "Fetch web page content: provide a URL and receive the page as Markdown text. Useful for reading docs, articles, API references, etc."+ parameters = {+ "type": "object",+ "properties": {+ "url": {"type": "string", "description": "URL of the web page to read"},+ },+ "required": ["url"],+ }+ repeatable = True++ def execute(self, **kwargs) -> str:+ """Fetch web page."""+ return read_url(kwargs["url"])diff --git a/agent/src/tools/write_file_tool.py b/agent/src/tools/write_file_tool.pynew file mode 100644index 000000000..fccb91093--- /dev/null+++ b/agent/src/tools/write_file_tool.py@@ -0,0 +1,67 @@+"""Write file tool: create or overwrite files in the workspace."""++from __future__ import annotations++import json+from pathlib import Path+from typing import Any++from src.agent.tools import BaseTool+from src.tools.path_utils import safe_path as _safe_path+++class WriteFileTool(BaseTool):+ """Create or overwrite a workspace file, creating parent directories as needed."""++ name = "write_file"+ description = "Write content to a file in the workspace. Creates parent directories automatically."+ parameters = {+ "type": "object",+ "properties": {+ "path": {"type": "string", "description": "File path relative to run_dir"},+ "content": {"type": "string", "description": "Content to write"},+ },+ "required": ["path", "content"],+ }+ repeatable = True++ def execute(self, **kwargs: Any) -> str:+ """Write content to a file.++ Args:+ **kwargs: Must include path and content. Optional run_dir.++ Returns:+ JSON string with bytes_written or an error.+ """+ file_path = kwargs["path"]+ content = kwargs["content"]+ run_dir = kwargs.get("run_dir")++ if not run_dir:+ return json.dumps({+ "status": "error",+ "error": "run_dir is required for write_file",+ }, ensure_ascii=False)++ try:+ resolved = _safe_path(file_path, Path(run_dir))+ except ValueError as exc:+ return json.dumps({+ "status": "error",+ "error": str(exc),+ }, ensure_ascii=False)++ try:+ resolved.parent.mkdir(parents=True, exist_ok=True)+ resolved.write_text(content, encoding="utf-8")+ return json.dumps({+ "status": "ok",+ "path": str(resolved),+ "bytes_written": len(content.encode("utf-8")),+ }, ensure_ascii=False)+ except Exception as exc:+ return json.dumps({+ "status": "error",+ "error": str(exc),+ }, ensure_ascii=False)diff --git a/agent/src/ui_services.py b/agent/src/ui_services.pynew file mode 100644index 000000000..5221a5211--- /dev/null+++ b/agent/src/ui_services.py@@ -0,0 +1,570 @@+"""UI-oriented services for run analysis and local process management.++This module centralizes the data shaping needed by the frontend workbench:++- parse run metadata into frontend-friendly context+- reconstruct market data for historical runs when artifacts are incomplete+- compute indicator overlays and trade markers+- read runner logs for the detail page+- (LocalApiManager removed โ dead code)+"""++from __future__ import annotations++import csv+import json+from datetime import datetime, timedelta+from pathlib import Path+from typing import Any, Dict, List, Optional++DEFAULT_ANALYSIS_PERIODS = [5, 20]+++def format_run_date(date_str: Optional[str]) -> Optional[str]:+ """Normalize supported date strings into ``YYYY-MM-DD``.++ Args:+ date_str: Raw date string from request or planner artifacts.++ Returns:+ The normalized date string, or ``None`` when the input is empty.+ """+ if not date_str:+ return None++ value = str(date_str).strip()+ if not value:+ return None+ if "-" in value and len(value) == 10:+ return value+ if len(value) == 8 and value.isdigit():+ return f"{value[:4]}-{value[4:6]}-{value[6:8]}"+ # Handle datetime strings like "2022-04-13 16:00:00" โ extract date part+ if "-" in value and len(value) > 10 and value[4] == "-" and value[7] == "-":+ return value[:10]+ return value+++def load_json_file(path: Path) -> Optional[Dict[str, Any]]:+ """Load a JSON file if it exists.++ Args:+ path: JSON file path.++ Returns:+ The decoded object when the file exists and is valid JSON.+ """+ try:+ if path.exists():+ return json.loads(path.read_text(encoding="utf-8"))+ except Exception:+ return None+ return None+++def load_csv_records(path: Path) -> List[Dict[str, Any]]:+ """Load CSV rows as dictionaries.++ Args:+ path: CSV file path.++ Returns:+ Parsed CSV rows. Missing or unreadable files return an empty list.+ """+ if not path.exists():+ return []++ try:+ with path.open("r", encoding="utf-8", newline="") as handle:+ return [dict(row) for row in csv.DictReader(handle)]+ except Exception:+ return []+++def normalize_codes(raw_codes: Any) -> List[str]:+ """Normalize a run's code selection into a list of symbols.++ Args:+ raw_codes: Input from ``req.json``.++ Returns:+ A list of non-empty symbol strings.+ """+ if isinstance(raw_codes, list):+ return [str(code).strip() for code in raw_codes if str(code).strip()]+ if isinstance(raw_codes, str):+ return [code.strip() for code in raw_codes.split(",") if code.strip()]+ return []+++def load_run_context(run_dir: Path) -> Dict[str, Any]:+ """Load normalized request context for a run detail page.++ Falls back to planner_output.json when req.json context is empty+ (common in session mode where the LLM extracts codes/dates).++ Args:+ run_dir: The run directory under ``runs/``.++ Returns:+ A dictionary containing prompt, codes, dates, and the raw context.+ """+ request_data = load_json_file(run_dir / "req.json") or {}+ context = dict(request_data.get("context") or {})+ prompt = str(request_data.get("prompt") or "").strip()+ codes = normalize_codes(context.get("codes"))+ start_date = format_run_date(context.get("start_date"))+ end_date = format_run_date(context.get("end_date"))++ # Fallback: extract from planner_output.json (session mode stores codes there)+ if not codes or not start_date or not end_date:+ planner = load_json_file(run_dir / "planner_output.json") or {}+ contract = planner.get("coding_contract") or {}+ req_ctx = (planner.get("requirements") or {}).get("context") or {}++ if not codes:+ raw = contract.get("target_scope") or req_ctx.get("codes") or contract.get("codes")+ codes = normalize_codes(raw) or codes+ if not codes:+ for req in contract.get("data_requirements") or []:+ scope = req.get("symbol_scope", "")+ if isinstance(scope, str) and scope.strip():+ codes.extend(c.strip() for c in scope.split(",") if c.strip())+ codes = list(dict.fromkeys(codes))++ if not start_date:+ start_date = format_run_date(contract.get("start_date") or req_ctx.get("start_date"))+ if not end_date:+ end_date = format_run_date(contract.get("end_date") or req_ctx.get("end_date"))++ return {+ "prompt": prompt,+ "codes": codes,+ "start_date": start_date,+ "end_date": end_date,+ "raw_context": context,+ }+++def infer_indicator_periods(run_dir: Path) -> List[int]:+ """Infer moving-average periods from planner or design artifacts.++ Args:+ run_dir: The run directory under ``runs/``.++ Returns:+ Sorted indicator periods. Defaults to ``[5, 20]`` when unspecified.+ """+ periods: set[int] = set()++ planner = load_json_file(run_dir / "planner_output.json") or {}+ contract = planner.get("coding_contract") or {}+ input_logic = contract.get("input_logic") or {}+ parameters = input_logic.get("parameters") or {}+ signal_params = parameters.get("signal_params") or {}++ for key, value in signal_params.items():+ if "ma" in str(key).lower():+ try:+ periods.add(int(value))+ except (TypeError, ValueError):+ continue++ design = load_json_file(run_dir / "design_spec.json") or {}+ defaults = design.get("defaults_and_tunables") or {}+ assumptions = defaults.get("parameter_assumptions") or {}+ for key, value in assumptions.items():+ if "ma" in str(key).lower():+ try:+ periods.add(int(value))+ except (TypeError, ValueError):+ continue++ if not periods:+ return list(DEFAULT_ANALYSIS_PERIODS)+ return sorted(periods)+++def infer_run_stage(run_dir: Path) -> str:+ """Infer a human-friendly run stage from persisted artifacts.++ Args:+ run_dir: The run directory under ``runs/``.++ Returns:+ A stage token suitable for UI badges.+ """+ state_data = load_json_file(run_dir / "state.json") or {}+ state_status = str(state_data.get("status") or "").lower()+ if state_status == "success":+ return "done"+ if state_status == "failed":+ return "failed"+ if (run_dir / "artifacts" / "metrics.csv").exists():+ return "backtest"+ if (run_dir / "review_report.json").exists():+ return "review"+ if (run_dir / "code" / "signal_engine.py").exists():+ return "coding"+ if (run_dir / "design_spec.json").exists():+ return "design"+ if (run_dir / "planner_output.json").exists():+ return "planning"+ if (run_dir / "req.json").exists():+ return "queued"+ return "unknown"+++def collect_run_logs(run_dir: Path, line_limit: int = 200) -> List[Dict[str, Any]]:+ """Read stdout/stderr files into a flat log entry list.++ Args:+ run_dir: The run directory under ``runs/``.+ line_limit: Maximum number of lines to keep per file.++ Returns:+ Tagged log entries ordered by file, then line number.+ """+ entries: List[Dict[str, Any]] = []+ log_files = [+ ("stdout", run_dir / "logs" / "runner_stdout.txt"),+ ("stderr", run_dir / "logs" / "runner_stderr.txt"),+ ("compile", run_dir / "logs" / "compile_error.txt"),+ ]++ for source, path in log_files:+ if not path.exists():+ continue+ lines = path.read_text(encoding="utf-8", errors="replace").splitlines()+ if line_limit > 0:+ lines = lines[-line_limit:]+ for index, line in enumerate(lines, start=1):+ entries.append(+ {+ "source": source,+ "line_number": index,+ "message": line,+ }+ )++ return entries+++def build_trade_markers(trades: List[Dict[str, Any]]) -> List[Dict[str, Any]]:+ """Normalize trade rows into frontend marker objects.++ Args:+ trades: Trade rows loaded from ``trades.csv``.++ Returns:+ Marker dictionaries consumed by the detail chart.+ """+ markers: List[Dict[str, Any]] = []+ for row in trades:+ side = str(row.get("side") or "").upper()+ timestamp = str(row.get("timestamp") or "")+ markers.append(+ {+ "time": timestamp[:10],+ "timestamp": timestamp,+ "code": row.get("code"),+ "side": side,+ "price": _safe_float(row.get("price")),+ "qty": _safe_float(row.get("qty")),+ "reason": row.get("reason"),+ "text": f"{side} {row.get('code') or ''}".strip(),+ }+ )+ return markers+++def group_price_rows(price_rows: List[Dict[str, Any]]) -> Dict[str, List[Dict[str, Any]]]:+ """Group normalized price rows by symbol.++ Args:+ price_rows: Flat list of normalized price rows.++ Returns:+ A dictionary keyed by symbol.+ """+ grouped: Dict[str, List[Dict[str, Any]]] = {}+ for row in price_rows:+ code = str(row.get("code") or "UNKNOWN")+ grouped.setdefault(code, []).append(row)+ return grouped+++def build_indicator_series(+ price_rows: List[Dict[str, Any]],+ periods: Optional[List[int]] = None,+) -> Dict[str, Dict[str, List[Dict[str, Any]]]]:+ """Compute moving-average overlays from normalized price rows.++ Args:+ price_rows: Flat list of normalized OHLC rows.+ periods: Moving-average windows to compute.++ Returns:+ Nested dictionaries grouped by symbol and indicator label.+ """+ grouped = group_price_rows(price_rows)+ indicator_periods = sorted(set(periods or DEFAULT_ANALYSIS_PERIODS))+ output: Dict[str, Dict[str, List[Dict[str, Any]]]] = {}++ for code, rows in grouped.items():+ ordered_rows = sorted(+ (+ {+ **row,+ "time": str(row.get("time") or format_run_date(row.get("timestamp")) or ""),+ }+ for row in rows+ ),+ key=lambda item: item["time"],+ )+ closes = [float(row["close"]) for row in ordered_rows]+ code_series: Dict[str, List[Dict[str, Any]]] = {}+ for period in indicator_periods:+ label = f"ma{period}"+ values: List[Dict[str, Any]] = []+ for index, row in enumerate(ordered_rows):+ if index + 1 < period:+ current = None+ else:+ window = closes[index - period + 1 : index + 1]+ current = round(sum(window) / period, 6)+ values.append({"time": row["time"], "value": current})+ code_series[label] = values+ output[code] = code_series++ return output+++def _load_ohlcv_artifacts(run_dir: Path) -> List[Dict[str, Any]]:+ """Read individual ohlcv_*.csv files saved by the backtest engine.++ The engine writes ``ohlcv_{code}.csv`` per symbol with columns+ ``trade_date,open,high,low,close,volume``. This function reads+ them all and returns a flat list of normalized rows.++ Args:+ run_dir: The run directory under ``runs/``.++ Returns:+ Normalized OHLC rows, empty list if no files found.+ """+ artifacts = run_dir / "artifacts"+ if not artifacts.is_dir():+ return []+ ohlcv_files = sorted(artifacts.glob("ohlcv_*.csv"))+ if not ohlcv_files:+ return []+ rows: List[Dict[str, Any]] = []+ for f in ohlcv_files:+ code = f.stem.removeprefix("ohlcv_")+ for r in load_csv_records(f):+ ts = r.get("trade_date") or r.get("timestamp") or r.get("time") or r.get("")+ if not ts:+ continue+ rows.append({+ "time": ts, "timestamp": ts, "code": code,+ "open": r.get("open", 0), "high": r.get("high", 0),+ "low": r.get("low", 0), "close": r.get("close", 0),+ "volume": r.get("volume", 0),+ })+ return _normalize_price_rows(rows)+++def load_price_series(run_dir: Path) -> List[Dict[str, Any]]:+ """Load chart-ready price rows: price_series.csv > ohlcv_*.csv > API reconstruct.++ Args:+ run_dir: The run directory under ``runs/``.++ Returns:+ Normalized OHLC rows sorted by (code, date).+ """+ artifact_path = run_dir / "artifacts" / "price_series.csv"+ if artifact_path.exists():+ return _normalize_price_rows(load_csv_records(artifact_path))+ rows = _load_ohlcv_artifacts(run_dir)+ if rows:+ return rows+ return reconstruct_price_series(run_dir)+++def reconstruct_price_series(run_dir: Path) -> List[Dict[str, Any]]:+ """Rebuild OHLC rows for a historical run using its generated loader.++ Args:+ run_dir: The run directory under ``runs/``.++ Returns:+ Normalized OHLC rows clipped to the run's visible backtest range.+ """+ context = load_run_context(run_dir)+ codes = context.get("codes") or []+ start_date = context.get("start_date")+ end_date = context.get("end_date")+ if not codes or not start_date or not end_date:+ return []++ signal_path = run_dir / "code" / "signal_engine.py"+ if not signal_path.exists():+ return []++ agent_root = Path(__file__).resolve().parents[1]+ try:+ from src.providers.llm import _ensure_dotenv++ _ensure_dotenv()+ except Exception:+ pass+ fetch_start_date = _compute_fetch_start_date(run_dir, start_date)++ try:+ source = context.get("source", "tushare")+ if source == "okx":+ from backtest.loaders.okx import DataLoader+ elif source == "yfinance":+ from backtest.loaders.yfinance_loader import DataLoader+ else:+ from backtest.loaders.tushare import DataLoader+ loader = DataLoader()+ data_map = loader.fetch(codes, fetch_start_date, end_date)+ except Exception as exc:+ print(f"[WARN] reconstruct_price_series: DataLoader failed ({exc})")+ return []++ if not data_map:+ print(f"[WARN] reconstruct_price_series: DataLoader returned empty")+ return []++ return _flatten_data_map(data_map, start_date=start_date)+++def build_run_analysis(run_dir: Path) -> Dict[str, Any]:+ """Build the analysis payload consumed by the run detail page.++ Args:+ run_dir: The run directory under ``runs/``.++ Returns:+ A serializable dictionary of chart, trade, and log data.+ """+ price_rows = load_price_series(run_dir)+ periods = infer_indicator_periods(run_dir)+ trades = load_csv_records(run_dir / "artifacts" / "trades.csv")++ return {+ "run_stage": infer_run_stage(run_dir),+ "run_context": load_run_context(run_dir),+ "price_series": group_price_rows(price_rows),+ "indicator_series": build_indicator_series(price_rows, periods) if price_rows else {},+ "trade_markers": build_trade_markers(trades),+ "run_logs": collect_run_logs(run_dir),+ }+++def _safe_float(value: Any) -> Optional[float]:+ """Convert values to floats without raising.++ Args:+ value: Value to convert.++ Returns:+ A float or ``None`` when conversion fails.+ """+ try:+ if value is None or value == "":+ return None+ return float(value)+ except (TypeError, ValueError):+ return None+++def _compute_fetch_start_date(run_dir: Path, start_date: str) -> str:+ """Compute the lookback-aware fetch start date for a run.++ Args:+ run_dir: The run directory under ``runs/``.+ start_date: Visible backtest start date.++ Returns:+ The fetch start date used to rebuild market data.+ """+ planner = load_json_file(run_dir / "planner_output.json") or {}+ lookback = int(((planner.get("coding_contract") or {}).get("data_lookback_days")) or 0)+ if lookback <= 0:+ return start_date++ start_dt = datetime.strptime(start_date, "%Y-%m-%d")+ buffer_days = int(lookback * 1.5) + 10+ return (start_dt - timedelta(days=buffer_days)).strftime("%Y-%m-%d")+++def _normalize_price_rows(rows: List[Dict[str, Any]]) -> List[Dict[str, Any]]:+ """Normalize stored price rows for charting.++ Args:+ rows: Raw rows loaded from CSV or generated data frames.++ Returns:+ Normalized price rows.+ """+ normalized: List[Dict[str, Any]] = []+ for row in rows:+ timestamp = format_run_date(row.get("timestamp") or row.get("time"))+ if not timestamp:+ continue+ normalized.append(+ {+ "time": timestamp,+ "timestamp": timestamp,+ "code": str(row.get("code") or "UNKNOWN"),+ "open": float(row.get("open") or 0.0),+ "high": float(row.get("high") or 0.0),+ "low": float(row.get("low") or 0.0),+ "close": float(row.get("close") or 0.0),+ "volume": float(row.get("volume") or 0.0),+ }+ )+ return sorted(normalized, key=lambda item: (item["code"], item["time"]))+++def _flatten_data_map(data_map: Dict[str, Any], start_date: str) -> List[Dict[str, Any]]:+ """Convert a fetched ``data_map`` into normalized price rows.++ Args:+ data_map: Symbol-keyed frame dictionary returned by ``DataLoader``.+ start_date: Visible backtest start date.++ Returns:+ Normalized price rows clipped to ``start_date``.+ """+ import pandas as pd++ clip_dt = pd.Timestamp(start_date)+ rows: List[Dict[str, Any]] = []++ for code, frame in data_map.items():+ current = frame.copy()+ if not isinstance(current.index, pd.DatetimeIndex):+ current.index = pd.to_datetime(current.index)+ current = current[current.index >= clip_dt]+ current = current.sort_index()+ for timestamp, row in current.iterrows():+ rows.append(+ {+ "time": pd.Timestamp(timestamp).strftime("%Y-%m-%d"),+ "timestamp": pd.Timestamp(timestamp).strftime("%Y-%m-%d"),+ "code": code,+ "open": round(float(row.get("open") or 0.0), 6),+ "high": round(float(row.get("high") or 0.0), 6),+ "low": round(float(row.get("low") or 0.0), 6),+ "close": round(float(row.get("close") or 0.0), 6),+ "volume": round(float(row.get("volume") or 0.0), 6),+ }+ )++ return rowsdiff --git a/assets/Frontend.mp4 b/assets/Frontend.mp4new file mode 100644index 000000000..702889e47Binary files /dev/null and b/assets/Frontend.mp4 differdiff --git a/assets/cli.mp4 b/assets/cli.mp4new file mode 100644index 000000000..bc3146a0fBinary files /dev/null and b/assets/cli.mp4 differdiff --git a/assets/icon.png b/assets/icon.pngnew file mode 100644index 000000000..7b1edcd6fBinary files /dev/null and b/assets/icon.png differdiff --git a/assets/pip-install.svg b/assets/pip-install.svgnew file mode 100644index 000000000..0dfd16175--- /dev/null+++ b/assets/pip-install.svg@@ -0,0 +1,58 @@+<svg xmlns="http://www.w3.org/2000/svg" width="340" height="50" viewBox="0 0 340 50">+ <defs>+ <linearGradient id="bg" x1="0" y1="0" x2="1" y2="1">+ <stop offset="0%" stop-color="#1a1a2e"/>+ <stop offset="100%" stop-color="#16213e"/>+ </linearGradient>+ </defs>+ <style>+ @keyframes reveal {+ 0% { width: 0 }+ 56% { width: 268px }+ 100% { width: 268px }+ }+ @keyframes blink {+ 0%,100% { opacity: 1 }+ 50% { opacity: 0 }+ }+ @keyframes cursor-move {+ 0% { x: 30px }+ 56% { x: 298px }+ 100% { x: 298px }+ }+ .terminal-text {+ font-family: 'SF Mono','Fira Code','Cascadia Code',Consolas,monospace;+ font-size: 15px;+ }+ .clip-box {+ animation: reveal 5s steps(27,end) infinite;+ }+ .cursor {+ animation: blink 1s step-end infinite, cursor-move 5s steps(27,end) infinite;+ }+ </style>++ <!-- Background -->+ <rect width="340" height="50" rx="10" fill="url(#bg)"/>+ <rect x="1" y="1" width="338" height="48" rx="9" fill="none" stroke="#3a3a5c" stroke-width="1" opacity="0.5"/>++ <!-- Window dots -->+ <circle cx="16" cy="15" r="4" fill="#ff5f56"/>+ <circle cx="28" cy="15" r="4" fill="#ffbd2e"/>+ <circle cx="40" cy="15" r="4" fill="#27c93f"/>++ <!-- Static prompt $ -->+ <text x="16" y="39" class="terminal-text" fill="#6c6c8a">$</text>++ <!-- Typing text clipped by animated rect -->+ <clipPath id="typed">+ <rect x="30" y="20" height="25" class="clip-box"/>+ </clipPath>+ <g clip-path="url(#typed)">+ <text x="32" y="39" class="terminal-text" fill="#27c93f">pip install</text>+ <text x="152" y="39" class="terminal-text" fill="#e2e2ff" font-weight="bold"> vibe-trading-ai</text>+ </g>++ <!-- Blinking cursor -->+ <rect y="27" width="9" height="16" rx="1" fill="#27c93f" opacity="0.9" class="cursor"/>+</svg>diff --git a/assets/scene-backtest.png b/assets/scene-backtest.pngnew file mode 100644index 000000000..f86d63680Binary files /dev/null and b/assets/scene-backtest.png differdiff --git a/assets/scene-quant.png b/assets/scene-quant.pngnew file mode 100644index 000000000..6e0295e42Binary files /dev/null and b/assets/scene-quant.png differdiff --git a/assets/scene-research.png b/assets/scene-research.pngnew file mode 100644index 000000000..cf1233edaBinary files /dev/null and b/assets/scene-research.png differdiff --git a/assets/scene-swarm.png b/assets/scene-swarm.pngnew file mode 100644index 000000000..0d13f5b9aBinary files /dev/null and b/assets/scene-swarm.png differdiff --git a/docker-compose.yml b/docker-compose.ymlnew file mode 100644index 000000000..4a55bb8df--- /dev/null+++ b/docker-compose.yml@@ -0,0 +1,17 @@+services:+ vibe-trading:+ build: .+ ports:+ - "8899:8899"+ env_file:+ - agent/.env+ volumes:+ - fin-data:/app/data+ - fin-runs:/app/agent/runs+ - fin-sessions:/app/agent/sessions+ restart: unless-stopped++volumes:+ fin-data:+ fin-runs:+ fin-sessions:diff --git a/frontend/.gitignore b/frontend/.gitignorenew file mode 100644index 000000000..f06235c46--- /dev/null+++ b/frontend/.gitignore@@ -0,0 +1,2 @@+node_modules+distdiff --git a/frontend/index.html b/frontend/index.htmlnew file mode 100644index 000000000..dee684751--- /dev/null+++ b/frontend/index.html@@ -0,0 +1,19 @@+๏ปฟ<!doctype html>+<html lang="en">+ <head>+ <meta charset="UTF-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />+ <title>Vibe-Trading โ vibe trading with your professional financial agent team</title>+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />+ <link rel="preconnect" href="https://fonts.googleapis.com">+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap" rel="stylesheet">+ <meta name="description" content="Vibe-Trading โ vibe trading with your professional financial agent team. Natural-language finance research, backtesting, swarm workflows, document reading, and multi-market analysis." />+ </head>+ <body class="min-h-screen bg-background text-foreground antialiased">+ <div id="root"></div>+ <script type="module" src="/src/main.tsx"></script>+ </body>+</html>++diff --git a/frontend/package-lock.json b/frontend/package-lock.jsonnew file mode 100644index 000000000..2dc29b4d7--- /dev/null+++ b/frontend/package-lock.json@@ -0,0 +1,4526 @@+{+ "name": "vibe-trading-frontend",+ "version": "0.1.0",+ "lockfileVersion": 3,+ "requires": true,+ "packages": {+ "": {+ "name": "vibe-trading-frontend",+ "version": "0.1.0",+ "dependencies": {+ "clsx": "^2.1.0",+ "echarts": "^6.0.0",+ "lucide-react": "^0.460.0",+ "react": "^19.0.0",+ "react-dom": "^19.0.0",+ "react-markdown": "^9.0.0",+ "react-router-dom": "^7.1.0",+ "rehype-highlight": "^7.0.0",+ "remark-gfm": "^4.0.1",+ "sonner": "^2.0.7",+ "tailwind-merge": "^2.6.0",+ "zustand": "^5.0.0"+ },+ "devDependencies": {+ "@tailwindcss/typography": "^0.5.0",+ "@types/react": "^19.0.0",+ "@types/react-dom": "^19.0.0",+ "@vitejs/plugin-react": "^4.3.0",+ "autoprefixer": "^10.4.0",+ "postcss": "^8.4.0",+ "tailwindcss": "^3.4.0",+ "typescript": "^5.7.0",+ "vite": "^6.0.0"+ }+ },+ "node_modules/@alloc/quick-lru": {+ "version": "5.2.0",+ "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz",+ "integrity": "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/@babel/code-frame": {+ "version": "7.29.0",+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.0.tgz",+ "integrity": "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/helper-validator-identifier": "^7.28.5",+ "js-tokens": "^4.0.0",+ "picocolors": "^1.1.1"+ },+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/compat-data": {+ "version": "7.29.0",+ "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.0.tgz",+ "integrity": "sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/core": {+ "version": "7.29.0",+ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.0.tgz",+ "integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/code-frame": "^7.29.0",+ "@babel/generator": "^7.29.0",+ "@babel/helper-compilation-targets": "^7.28.6",+ "@babel/helper-module-transforms": "^7.28.6",+ "@babel/helpers": "^7.28.6",+ "@babel/parser": "^7.29.0",+ "@babel/template": "^7.28.6",+ "@babel/traverse": "^7.29.0",+ "@babel/types": "^7.29.0",+ "@jridgewell/remapping": "^2.3.5",+ "convert-source-map": "^2.0.0",+ "debug": "^4.1.0",+ "gensync": "^1.0.0-beta.2",+ "json5": "^2.2.3",+ "semver": "^6.3.1"+ },+ "engines": {+ "node": ">=6.9.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/babel"+ }+ },+ "node_modules/@babel/generator": {+ "version": "7.29.1",+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.1.tgz",+ "integrity": "sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/parser": "^7.29.0",+ "@babel/types": "^7.29.0",+ "@jridgewell/gen-mapping": "^0.3.12",+ "@jridgewell/trace-mapping": "^0.3.28",+ "jsesc": "^3.0.2"+ },+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/helper-compilation-targets": {+ "version": "7.28.6",+ "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.28.6.tgz",+ "integrity": "sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/compat-data": "^7.28.6",+ "@babel/helper-validator-option": "^7.27.1",+ "browserslist": "^4.24.0",+ "lru-cache": "^5.1.1",+ "semver": "^6.3.1"+ },+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/helper-globals": {+ "version": "7.28.0",+ "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz",+ "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/helper-module-imports": {+ "version": "7.28.6",+ "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.28.6.tgz",+ "integrity": "sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/traverse": "^7.28.6",+ "@babel/types": "^7.28.6"+ },+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/helper-module-transforms": {+ "version": "7.28.6",+ "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.6.tgz",+ "integrity": "sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/helper-module-imports": "^7.28.6",+ "@babel/helper-validator-identifier": "^7.28.5",+ "@babel/traverse": "^7.28.6"+ },+ "engines": {+ "node": ">=6.9.0"+ },+ "peerDependencies": {+ "@babel/core": "^7.0.0"+ }+ },+ "node_modules/@babel/helper-plugin-utils": {+ "version": "7.28.6",+ "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.28.6.tgz",+ "integrity": "sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/helper-string-parser": {+ "version": "7.27.1",+ "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz",+ "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/helper-validator-identifier": {+ "version": "7.28.5",+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz",+ "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/helper-validator-option": {+ "version": "7.27.1",+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz",+ "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/helpers": {+ "version": "7.29.2",+ "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.2.tgz",+ "integrity": "sha512-HoGuUs4sCZNezVEKdVcwqmZN8GoHirLUcLaYVNBK2J0DadGtdcqgr3BCbvH8+XUo4NGjNl3VOtSjEKNzqfFgKw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/template": "^7.28.6",+ "@babel/types": "^7.29.0"+ },+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/parser": {+ "version": "7.29.2",+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.2.tgz",+ "integrity": "sha512-4GgRzy/+fsBa72/RZVJmGKPmZu9Byn8o4MoLpmNe1m8ZfYnz5emHLQz3U4gLud6Zwl0RZIcgiLD7Uq7ySFuDLA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/types": "^7.29.0"+ },+ "bin": {+ "parser": "bin/babel-parser.js"+ },+ "engines": {+ "node": ">=6.0.0"+ }+ },+ "node_modules/@babel/plugin-transform-react-jsx-self": {+ "version": "7.27.1",+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.27.1.tgz",+ "integrity": "sha512-6UzkCs+ejGdZ5mFFC/OCUrv028ab2fp1znZmCZjAOBKiBK2jXD1O+BPSfX8X2qjJ75fZBMSnQn3Rq2mrBJK2mw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/helper-plugin-utils": "^7.27.1"+ },+ "engines": {+ "node": ">=6.9.0"+ },+ "peerDependencies": {+ "@babel/core": "^7.0.0-0"+ }+ },+ "node_modules/@babel/plugin-transform-react-jsx-source": {+ "version": "7.27.1",+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.27.1.tgz",+ "integrity": "sha512-zbwoTsBruTeKB9hSq73ha66iFeJHuaFkUbwvqElnygoNbj/jHRsSeokowZFN3CZ64IvEqcmmkVe89OPXc7ldAw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/helper-plugin-utils": "^7.27.1"+ },+ "engines": {+ "node": ">=6.9.0"+ },+ "peerDependencies": {+ "@babel/core": "^7.0.0-0"+ }+ },+ "node_modules/@babel/template": {+ "version": "7.28.6",+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.28.6.tgz",+ "integrity": "sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/code-frame": "^7.28.6",+ "@babel/parser": "^7.28.6",+ "@babel/types": "^7.28.6"+ },+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/traverse": {+ "version": "7.29.0",+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.0.tgz",+ "integrity": "sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/code-frame": "^7.29.0",+ "@babel/generator": "^7.29.0",+ "@babel/helper-globals": "^7.28.0",+ "@babel/parser": "^7.29.0",+ "@babel/template": "^7.28.6",+ "@babel/types": "^7.29.0",+ "debug": "^4.3.1"+ },+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/types": {+ "version": "7.29.0",+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz",+ "integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/helper-string-parser": "^7.27.1",+ "@babel/helper-validator-identifier": "^7.28.5"+ },+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@esbuild/aix-ppc64": {+ "version": "0.25.12",+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz",+ "integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "aix"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/android-arm": {+ "version": "0.25.12",+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz",+ "integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/android-arm64": {+ "version": "0.25.12",+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz",+ "integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/android-x64": {+ "version": "0.25.12",+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz",+ "integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/darwin-arm64": {+ "version": "0.25.12",+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz",+ "integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/darwin-x64": {+ "version": "0.25.12",+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz",+ "integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/freebsd-arm64": {+ "version": "0.25.12",+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz",+ "integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/freebsd-x64": {+ "version": "0.25.12",+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz",+ "integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-arm": {+ "version": "0.25.12",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz",+ "integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-arm64": {+ "version": "0.25.12",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz",+ "integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-ia32": {+ "version": "0.25.12",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz",+ "integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==",+ "cpu": [+ "ia32"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-loong64": {+ "version": "0.25.12",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz",+ "integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==",+ "cpu": [+ "loong64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-mips64el": {+ "version": "0.25.12",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz",+ "integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==",+ "cpu": [+ "mips64el"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-ppc64": {+ "version": "0.25.12",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz",+ "integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-riscv64": {+ "version": "0.25.12",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz",+ "integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==",+ "cpu": [+ "riscv64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-s390x": {+ "version": "0.25.12",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz",+ "integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==",+ "cpu": [+ "s390x"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-x64": {+ "version": "0.25.12",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz",+ "integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/netbsd-arm64": {+ "version": "0.25.12",+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz",+ "integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "netbsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/netbsd-x64": {+ "version": "0.25.12",+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz",+ "integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "netbsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/openbsd-arm64": {+ "version": "0.25.12",+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz",+ "integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openbsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/openbsd-x64": {+ "version": "0.25.12",+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz",+ "integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openbsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/openharmony-arm64": {+ "version": "0.25.12",+ "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz",+ "integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openharmony"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/sunos-x64": {+ "version": "0.25.12",+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz",+ "integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "sunos"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/win32-arm64": {+ "version": "0.25.12",+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz",+ "integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/win32-ia32": {+ "version": "0.25.12",+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz",+ "integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==",+ "cpu": [+ "ia32"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/win32-x64": {+ "version": "0.25.12",+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz",+ "integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@jridgewell/gen-mapping": {+ "version": "0.3.13",+ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",+ "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/sourcemap-codec": "^1.5.0",+ "@jridgewell/trace-mapping": "^0.3.24"+ }+ },+ "node_modules/@jridgewell/remapping": {+ "version": "2.3.5",+ "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz",+ "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/gen-mapping": "^0.3.5",+ "@jridgewell/trace-mapping": "^0.3.24"+ }+ },+ "node_modules/@jridgewell/resolve-uri": {+ "version": "3.1.2",+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",+ "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6.0.0"+ }+ },+ "node_modules/@jridgewell/sourcemap-codec": {+ "version": "1.5.5",+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz",+ "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@jridgewell/trace-mapping": {+ "version": "0.3.31",+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz",+ "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/resolve-uri": "^3.1.0",+ "@jridgewell/sourcemap-codec": "^1.4.14"+ }+ },+ "node_modules/@nodelib/fs.scandir": {+ "version": "2.1.5",+ "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",+ "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@nodelib/fs.stat": "2.0.5",+ "run-parallel": "^1.1.9"+ },+ "engines": {+ "node": ">= 8"+ }+ },+ "node_modules/@nodelib/fs.stat": {+ "version": "2.0.5",+ "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz",+ "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 8"+ }+ },+ "node_modules/@nodelib/fs.walk": {+ "version": "1.2.8",+ "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz",+ "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@nodelib/fs.scandir": "2.1.5",+ "fastq": "^1.6.0"+ },+ "engines": {+ "node": ">= 8"+ }+ },+ "node_modules/@rolldown/pluginutils": {+ "version": "1.0.0-beta.27",+ "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.27.tgz",+ "integrity": "sha512-+d0F4MKMCbeVUJwG96uQ4SgAznZNSq93I3V+9NHA4OpvqG8mRCpGdKmK8l/dl02h2CCDHwW2FqilnTyDcAnqjA==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@rollup/rollup-android-arm-eabi": {+ "version": "4.59.0",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.59.0.tgz",+ "integrity": "sha512-upnNBkA6ZH2VKGcBj9Fyl9IGNPULcjXRlg0LLeaioQWueH30p6IXtJEbKAgvyv+mJaMxSm1l6xwDXYjpEMiLMg==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ]+ },+ "node_modules/@rollup/rollup-android-arm64": {+ "version": "4.59.0",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.59.0.tgz",+ "integrity": "sha512-hZ+Zxj3SySm4A/DylsDKZAeVg0mvi++0PYVceVyX7hemkw7OreKdCvW2oQ3T1FMZvCaQXqOTHb8qmBShoqk69Q==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ]+ },+ "node_modules/@rollup/rollup-darwin-arm64": {+ "version": "4.59.0",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.59.0.tgz",+ "integrity": "sha512-W2Psnbh1J8ZJw0xKAd8zdNgF9HRLkdWwwdWqubSVk0pUuQkoHnv7rx4GiF9rT4t5DIZGAsConRE3AxCdJ4m8rg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ]+ },+ "node_modules/@rollup/rollup-darwin-x64": {+ "version": "4.59.0",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.59.0.tgz",+ "integrity": "sha512-ZW2KkwlS4lwTv7ZVsYDiARfFCnSGhzYPdiOU4IM2fDbL+QGlyAbjgSFuqNRbSthybLbIJ915UtZBtmuLrQAT/w==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ]+ },+ "node_modules/@rollup/rollup-freebsd-arm64": {+ "version": "4.59.0",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.59.0.tgz",+ "integrity": "sha512-EsKaJ5ytAu9jI3lonzn3BgG8iRBjV4LxZexygcQbpiU0wU0ATxhNVEpXKfUa0pS05gTcSDMKpn3Sx+QB9RlTTA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ]+ },+ "node_modules/@rollup/rollup-freebsd-x64": {+ "version": "4.59.0",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.59.0.tgz",+ "integrity": "sha512-d3DuZi2KzTMjImrxoHIAODUZYoUUMsuUiY4SRRcJy6NJoZ6iIqWnJu9IScV9jXysyGMVuW+KNzZvBLOcpdl3Vg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ]+ },+ "node_modules/@rollup/rollup-linux-arm-gnueabihf": {+ "version": "4.59.0",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.59.0.tgz",+ "integrity": "sha512-t4ONHboXi/3E0rT6OZl1pKbl2Vgxf9vJfWgmUoCEVQVxhW6Cw/c8I6hbbu7DAvgp82RKiH7TpLwxnJeKv2pbsw==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "libc": [+ "glibc"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-arm-musleabihf": {+ "version": "4.59.0",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.59.0.tgz",+ "integrity": "sha512-CikFT7aYPA2ufMD086cVORBYGHffBo4K8MQ4uPS/ZnY54GKj36i196u8U+aDVT2LX4eSMbyHtyOh7D7Zvk2VvA==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "libc": [+ "musl"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-arm64-gnu": {+ "version": "4.59.0",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.59.0.tgz",+ "integrity": "sha512-jYgUGk5aLd1nUb1CtQ8E+t5JhLc9x5WdBKew9ZgAXg7DBk0ZHErLHdXM24rfX+bKrFe+Xp5YuJo54I5HFjGDAA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "libc": [+ "glibc"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-arm64-musl": {+ "version": "4.59.0",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.59.0.tgz",+ "integrity": "sha512-peZRVEdnFWZ5Bh2KeumKG9ty7aCXzzEsHShOZEFiCQlDEepP1dpUl/SrUNXNg13UmZl+gzVDPsiCwnV1uI0RUA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "libc": [+ "musl"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-loong64-gnu": {+ "version": "4.59.0",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.59.0.tgz",+ "integrity": "sha512-gbUSW/97f7+r4gHy3Jlup8zDG190AuodsWnNiXErp9mT90iCy9NKKU0Xwx5k8VlRAIV2uU9CsMnEFg/xXaOfXg==",+ "cpu": [+ "loong64"+ ],+ "dev": true,+ "libc": [+ "glibc"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-loong64-musl": {+ "version": "4.59.0",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.59.0.tgz",+ "integrity": "sha512-yTRONe79E+o0FWFijasoTjtzG9EBedFXJMl888NBEDCDV9I2wGbFFfJQQe63OijbFCUZqxpHz1GzpbtSFikJ4Q==",+ "cpu": [+ "loong64"+ ],+ "dev": true,+ "libc": [+ "musl"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-ppc64-gnu": {+ "version": "4.59.0",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.59.0.tgz",+ "integrity": "sha512-sw1o3tfyk12k3OEpRddF68a1unZ5VCN7zoTNtSn2KndUE+ea3m3ROOKRCZxEpmT9nsGnogpFP9x6mnLTCaoLkA==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "libc": [+ "glibc"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-ppc64-musl": {+ "version": "4.59.0",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.59.0.tgz",+ "integrity": "sha512-+2kLtQ4xT3AiIxkzFVFXfsmlZiG5FXYW7ZyIIvGA7Bdeuh9Z0aN4hVyXS/G1E9bTP/vqszNIN/pUKCk/BTHsKA==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "libc": [+ "musl"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-riscv64-gnu": {+ "version": "4.59.0",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.59.0.tgz",+ "integrity": "sha512-NDYMpsXYJJaj+I7UdwIuHHNxXZ/b/N2hR15NyH3m2qAtb/hHPA4g4SuuvrdxetTdndfj9b1WOmy73kcPRoERUg==",+ "cpu": [+ "riscv64"+ ],+ "dev": true,+ "libc": [+ "glibc"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-riscv64-musl": {+ "version": "4.59.0",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.59.0.tgz",+ "integrity": "sha512-nLckB8WOqHIf1bhymk+oHxvM9D3tyPndZH8i8+35p/1YiVoVswPid2yLzgX7ZJP0KQvnkhM4H6QZ5m0LzbyIAg==",+ "cpu": [+ "riscv64"+ ],+ "dev": true,+ "libc": [+ "musl"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-s390x-gnu": {+ "version": "4.59.0",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.59.0.tgz",+ "integrity": "sha512-oF87Ie3uAIvORFBpwnCvUzdeYUqi2wY6jRFWJAy1qus/udHFYIkplYRW+wo+GRUP4sKzYdmE1Y3+rY5Gc4ZO+w==",+ "cpu": [+ "s390x"+ ],+ "dev": true,+ "libc": [+ "glibc"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-x64-gnu": {+ "version": "4.59.0",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.59.0.tgz",+ "integrity": "sha512-3AHmtQq/ppNuUspKAlvA8HtLybkDflkMuLK4DPo77DfthRb71V84/c4MlWJXixZz4uruIH4uaa07IqoAkG64fg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "libc": [+ "glibc"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-x64-musl": {+ "version": "4.59.0",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.59.0.tgz",+ "integrity": "sha512-2UdiwS/9cTAx7qIUZB/fWtToJwvt0Vbo0zmnYt7ED35KPg13Q0ym1g442THLC7VyI6JfYTP4PiSOWyoMdV2/xg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "libc": [+ "musl"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-openbsd-x64": {+ "version": "4.59.0",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.59.0.tgz",+ "integrity": "sha512-M3bLRAVk6GOwFlPTIxVBSYKUaqfLrn8l0psKinkCFxl4lQvOSz8ZrKDz2gxcBwHFpci0B6rttydI4IpS4IS/jQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openbsd"+ ]+ },+ "node_modules/@rollup/rollup-openharmony-arm64": {+ "version": "4.59.0",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.59.0.tgz",+ "integrity": "sha512-tt9KBJqaqp5i5HUZzoafHZX8b5Q2Fe7UjYERADll83O4fGqJ49O1FsL6LpdzVFQcpwvnyd0i+K/VSwu/o/nWlA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openharmony"+ ]+ },+ "node_modules/@rollup/rollup-win32-arm64-msvc": {+ "version": "4.59.0",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.59.0.tgz",+ "integrity": "sha512-V5B6mG7OrGTwnxaNUzZTDTjDS7F75PO1ae6MJYdiMu60sq0CqN5CVeVsbhPxalupvTX8gXVSU9gq+Rx1/hvu6A==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ]+ },+ "node_modules/@rollup/rollup-win32-ia32-msvc": {+ "version": "4.59.0",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.59.0.tgz",+ "integrity": "sha512-UKFMHPuM9R0iBegwzKF4y0C4J9u8C6MEJgFuXTBerMk7EJ92GFVFYBfOZaSGLu6COf7FxpQNqhNS4c4icUPqxA==",+ "cpu": [+ "ia32"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ]+ },+ "node_modules/@rollup/rollup-win32-x64-gnu": {+ "version": "4.59.0",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.59.0.tgz",+ "integrity": "sha512-laBkYlSS1n2L8fSo1thDNGrCTQMmxjYY5G0WFWjFFYZkKPjsMBsgJfGf4TLxXrF6RyhI60L8TMOjBMvXiTcxeA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ]+ },+ "node_modules/@rollup/rollup-win32-x64-msvc": {+ "version": "4.59.0",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.59.0.tgz",+ "integrity": "sha512-2HRCml6OztYXyJXAvdDXPKcawukWY2GpR5/nxKp4iBgiO3wcoEGkAaqctIbZcNB6KlUQBIqt8VYkNSj2397EfA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ]+ },+ "node_modules/@tailwindcss/typography": {+ "version": "0.5.19",+ "resolved": "https://registry.npmjs.org/@tailwindcss/typography/-/typography-0.5.19.tgz",+ "integrity": "sha512-w31dd8HOx3k9vPtcQh5QHP9GwKcgbMp87j58qi6xgiBnFFtKEAgCWnDw4qUT8aHwkCp8bKvb/KGKWWHedP0AAg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "postcss-selector-parser": "6.0.10"+ },+ "peerDependencies": {+ "tailwindcss": ">=3.0.0 || insiders || >=4.0.0-alpha.20 || >=4.0.0-beta.1"+ }+ },+ "node_modules/@types/babel__core": {+ "version": "7.20.5",+ "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz",+ "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/parser": "^7.20.7",+ "@babel/types": "^7.20.7",+ "@types/babel__generator": "*",+ "@types/babel__template": "*",+ "@types/babel__traverse": "*"+ }+ },+ "node_modules/@types/babel__generator": {+ "version": "7.27.0",+ "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz",+ "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/types": "^7.0.0"+ }+ },+ "node_modules/@types/babel__template": {+ "version": "7.4.4",+ "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz",+ "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/parser": "^7.1.0",+ "@babel/types": "^7.0.0"+ }+ },+ "node_modules/@types/babel__traverse": {+ "version": "7.28.0",+ "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz",+ "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/types": "^7.28.2"+ }+ },+ "node_modules/@types/debug": {+ "version": "4.1.12",+ "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz",+ "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==",+ "license": "MIT",+ "dependencies": {+ "@types/ms": "*"+ }+ },+ "node_modules/@types/estree": {+ "version": "1.0.8",+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz",+ "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==",+ "license": "MIT"+ },+ "node_modules/@types/estree-jsx": {+ "version": "1.0.5",+ "resolved": "https://registry.npmjs.org/@types/estree-jsx/-/estree-jsx-1.0.5.tgz",+ "integrity": "sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==",+ "license": "MIT",+ "dependencies": {+ "@types/estree": "*"+ }+ },+ "node_modules/@types/hast": {+ "version": "3.0.4",+ "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz",+ "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==",+ "license": "MIT",+ "dependencies": {+ "@types/unist": "*"+ }+ },+ "node_modules/@types/mdast": {+ "version": "4.0.4",+ "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz",+ "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==",+ "license": "MIT",+ "dependencies": {+ "@types/unist": "*"+ }+ },+ "node_modules/@types/ms": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz",+ "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==",+ "license": "MIT"+ },+ "node_modules/@types/react": {+ "version": "19.2.14",+ "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.14.tgz",+ "integrity": "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==",+ "license": "MIT",+ "dependencies": {+ "csstype": "^3.2.2"+ }+ },+ "node_modules/@types/react-dom": {+ "version": "19.2.3",+ "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.2.3.tgz",+ "integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==",+ "dev": true,+ "license": "MIT",+ "peerDependencies": {+ "@types/react": "^19.2.0"+ }+ },+ "node_modules/@types/unist": {+ "version": "3.0.3",+ "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz",+ "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==",+ "license": "MIT"+ },+ "node_modules/@ungap/structured-clone": {+ "version": "1.3.0",+ "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz",+ "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==",+ "license": "ISC"+ },+ "node_modules/@vitejs/plugin-react": {+ "version": "4.7.0",+ "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.7.0.tgz",+ "integrity": "sha512-gUu9hwfWvvEDBBmgtAowQCojwZmJ5mcLn3aufeCsitijs3+f2NsrPtlAWIR6OPiqljl96GVCUbLe0HyqIpVaoA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/core": "^7.28.0",+ "@babel/plugin-transform-react-jsx-self": "^7.27.1",+ "@babel/plugin-transform-react-jsx-source": "^7.27.1",+ "@rolldown/pluginutils": "1.0.0-beta.27",+ "@types/babel__core": "^7.20.5",+ "react-refresh": "^0.17.0"+ },+ "engines": {+ "node": "^14.18.0 || >=16.0.0"+ },+ "peerDependencies": {+ "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0"+ }+ },+ "node_modules/any-promise": {+ "version": "1.3.0",+ "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz",+ "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/anymatch": {+ "version": "3.1.3",+ "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",+ "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "normalize-path": "^3.0.0",+ "picomatch": "^2.0.4"+ },+ "engines": {+ "node": ">= 8"+ }+ },+ "node_modules/arg": {+ "version": "5.0.2",+ "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz",+ "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/autoprefixer": {+ "version": "10.4.27",+ "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.27.tgz",+ "integrity": "sha512-NP9APE+tO+LuJGn7/9+cohklunJsXWiaWEfV3si4Gi/XHDwVNgkwr1J3RQYFIvPy76GmJ9/bW8vyoU1LcxwKHA==",+ "dev": true,+ "funding": [+ {+ "type": "opencollective",+ "url": "https://opencollective.com/postcss/"+ },+ {+ "type": "tidelift",+ "url": "https://tidelift.com/funding/github/npm/autoprefixer"+ },+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "browserslist": "^4.28.1",+ "caniuse-lite": "^1.0.30001774",+ "fraction.js": "^5.3.4",+ "picocolors": "^1.1.1",+ "postcss-value-parser": "^4.2.0"+ },+ "bin": {+ "autoprefixer": "bin/autoprefixer"+ },+ "engines": {+ "node": "^10 || ^12 || >=14"+ },+ "peerDependencies": {+ "postcss": "^8.1.0"+ }+ },+ "node_modules/bail": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz",+ "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==",+ "license": "MIT",+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/wooorm"+ }+ },+ "node_modules/baseline-browser-mapping": {+ "version": "2.10.8",+ "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.8.tgz",+ "integrity": "sha512-PCLz/LXGBsNTErbtB6i5u4eLpHeMfi93aUv5duMmj6caNu6IphS4q6UevDnL36sZQv9lrP11dbPKGMaXPwMKfQ==",+ "dev": true,+ "license": "Apache-2.0",+ "bin": {+ "baseline-browser-mapping": "dist/cli.cjs"+ },+ "engines": {+ "node": ">=6.0.0"+ }+ },+ "node_modules/binary-extensions": {+ "version": "2.3.0",+ "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz",+ "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/braces": {+ "version": "3.0.3",+ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",+ "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "fill-range": "^7.1.1"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/browserslist": {+ "version": "4.28.1",+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.1.tgz",+ "integrity": "sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==",+ "dev": true,+ "funding": [+ {+ "type": "opencollective",+ "url": "https://opencollective.com/browserslist"+ },+ {+ "type": "tidelift",+ "url": "https://tidelift.com/funding/github/npm/browserslist"+ },+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "baseline-browser-mapping": "^2.9.0",+ "caniuse-lite": "^1.0.30001759",+ "electron-to-chromium": "^1.5.263",+ "node-releases": "^2.0.27",+ "update-browserslist-db": "^1.2.0"+ },+ "bin": {+ "browserslist": "cli.js"+ },+ "engines": {+ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"+ }+ },+ "node_modules/camelcase-css": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz",+ "integrity": "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 6"+ }+ },+ "node_modules/caniuse-lite": {+ "version": "1.0.30001780",+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001780.tgz",+ "integrity": "sha512-llngX0E7nQci5BPJDqoZSbuZ5Bcs9F5db7EtgfwBerX9XGtkkiO4NwfDDIRzHTTwcYC8vC7bmeUEPGrKlR/TkQ==",+ "dev": true,+ "funding": [+ {+ "type": "opencollective",+ "url": "https://opencollective.com/browserslist"+ },+ {+ "type": "tidelift",+ "url": "https://tidelift.com/funding/github/npm/caniuse-lite"+ },+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "license": "CC-BY-4.0"+ },+ "node_modules/ccount": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz",+ "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==",+ "license": "MIT",+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/wooorm"+ }+ },+ "node_modules/character-entities": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-2.0.2.tgz",+ "integrity": "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==",+ "license": "MIT",+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/wooorm"+ }+ },+ "node_modules/character-entities-html4": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz",+ "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==",+ "license": "MIT",+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/wooorm"+ }+ },+ "node_modules/character-entities-legacy": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz",+ "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==",+ "license": "MIT",+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/wooorm"+ }+ },+ "node_modules/character-reference-invalid": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-2.0.1.tgz",+ "integrity": "sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==",+ "license": "MIT",+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/wooorm"+ }+ },+ "node_modules/chokidar": {+ "version": "3.6.0",+ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",+ "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "anymatch": "~3.1.2",+ "braces": "~3.0.2",+ "glob-parent": "~5.1.2",+ "is-binary-path": "~2.1.0",+ "is-glob": "~4.0.1",+ "normalize-path": "~3.0.0",+ "readdirp": "~3.6.0"+ },+ "engines": {+ "node": ">= 8.10.0"+ },+ "funding": {+ "url": "https://paulmillr.com/funding/"+ },+ "optionalDependencies": {+ "fsevents": "~2.3.2"+ }+ },+ "node_modules/chokidar/node_modules/glob-parent": {+ "version": "5.1.2",+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",+ "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "is-glob": "^4.0.1"+ },+ "engines": {+ "node": ">= 6"+ }+ },+ "node_modules/clsx": {+ "version": "2.1.1",+ "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz",+ "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==",+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/comma-separated-tokens": {+ "version": "2.0.3",+ "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz",+ "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==",+ "license": "MIT",+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/wooorm"+ }+ },+ "node_modules/commander": {+ "version": "4.1.1",+ "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz",+ "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 6"+ }+ },+ "node_modules/convert-source-map": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz",+ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/cookie": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz",+ "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==",+ "license": "MIT",+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/express"+ }+ },+ "node_modules/cssesc": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz",+ "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==",+ "dev": true,+ "license": "MIT",+ "bin": {+ "cssesc": "bin/cssesc"+ },+ "engines": {+ "node": ">=4"+ }+ },+ "node_modules/csstype": {+ "version": "3.2.3",+ "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz",+ "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==",+ "license": "MIT"+ },+ "node_modules/debug": {+ "version": "4.4.3",+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",+ "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",+ "license": "MIT",+ "dependencies": {+ "ms": "^2.1.3"+ },+ "engines": {+ "node": ">=6.0"+ },+ "peerDependenciesMeta": {+ "supports-color": {+ "optional": true+ }+ }+ },+ "node_modules/decode-named-character-reference": {+ "version": "1.3.0",+ "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.3.0.tgz",+ "integrity": "sha512-GtpQYB283KrPp6nRw50q3U9/VfOutZOe103qlN7BPP6Ad27xYnOIWv4lPzo8HCAL+mMZofJ9KEy30fq6MfaK6Q==",+ "license": "MIT",+ "dependencies": {+ "character-entities": "^2.0.0"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/wooorm"+ }+ },+ "node_modules/dequal": {+ "version": "2.0.3",+ "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz",+ "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==",+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/devlop": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz",+ "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==",+ "license": "MIT",+ "dependencies": {+ "dequal": "^2.0.0"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/wooorm"+ }+ },+ "node_modules/didyoumean": {+ "version": "1.2.2",+ "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz",+ "integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==",+ "dev": true,+ "license": "Apache-2.0"+ },+ "node_modules/dlv": {+ "version": "1.1.3",+ "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz",+ "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/echarts": {+ "version": "6.0.0",+ "resolved": "https://registry.npmjs.org/echarts/-/echarts-6.0.0.tgz",+ "integrity": "sha512-Tte/grDQRiETQP4xz3iZWSvoHrkCQtwqd6hs+mifXcjrCuo2iKWbajFObuLJVBlDIJlOzgQPd1hsaKt/3+OMkQ==",+ "license": "Apache-2.0",+ "dependencies": {+ "tslib": "2.3.0",+ "zrender": "6.0.0"+ }+ },+ "node_modules/electron-to-chromium": {+ "version": "1.5.321",+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.321.tgz",+ "integrity": "sha512-L2C7Q279W2D/J4PLZLk7sebOILDSWos7bMsMNN06rK482umHUrh/3lM8G7IlHFOYip2oAg5nha1rCMxr/rs6ZQ==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/esbuild": {+ "version": "0.25.12",+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz",+ "integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==",+ "dev": true,+ "hasInstallScript": true,+ "license": "MIT",+ "bin": {+ "esbuild": "bin/esbuild"+ },+ "engines": {+ "node": ">=18"+ },+ "optionalDependencies": {+ "@esbuild/aix-ppc64": "0.25.12",+ "@esbuild/android-arm": "0.25.12",+ "@esbuild/android-arm64": "0.25.12",+ "@esbuild/android-x64": "0.25.12",+ "@esbuild/darwin-arm64": "0.25.12",+ "@esbuild/darwin-x64": "0.25.12",+ "@esbuild/freebsd-arm64": "0.25.12",+ "@esbuild/freebsd-x64": "0.25.12",+ "@esbuild/linux-arm": "0.25.12",+ "@esbuild/linux-arm64": "0.25.12",+ "@esbuild/linux-ia32": "0.25.12",+ "@esbuild/linux-loong64": "0.25.12",+ "@esbuild/linux-mips64el": "0.25.12",+ "@esbuild/linux-ppc64": "0.25.12",+ "@esbuild/linux-riscv64": "0.25.12",+ "@esbuild/linux-s390x": "0.25.12",+ "@esbuild/linux-x64": "0.25.12",+ "@esbuild/netbsd-arm64": "0.25.12",+ "@esbuild/netbsd-x64": "0.25.12",+ "@esbuild/openbsd-arm64": "0.25.12",+ "@esbuild/openbsd-x64": "0.25.12",+ "@esbuild/openharmony-arm64": "0.25.12",+ "@esbuild/sunos-x64": "0.25.12",+ "@esbuild/win32-arm64": "0.25.12",+ "@esbuild/win32-ia32": "0.25.12",+ "@esbuild/win32-x64": "0.25.12"+ }+ },+ "node_modules/escalade": {+ "version": "3.2.0",+ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",+ "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/escape-string-regexp": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz",+ "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==",+ "license": "MIT",+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/estree-util-is-identifier-name": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/estree-util-is-identifier-name/-/estree-util-is-identifier-name-3.0.0.tgz",+ "integrity": "sha512-hFtqIDZTIUZ9BXLb8y4pYGyk6+wekIivNVTcmvk8NoOh+VeRn5y6cEHzbURrWbfp1fIqdVipilzj+lfaadNZmg==",+ "license": "MIT",+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/extend": {+ "version": "3.0.2",+ "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",+ "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==",+ "license": "MIT"+ },+ "node_modules/fast-glob": {+ "version": "3.3.3",+ "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz",+ "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@nodelib/fs.stat": "^2.0.2",+ "@nodelib/fs.walk": "^1.2.3",+ "glob-parent": "^5.1.2",+ "merge2": "^1.3.0",+ "micromatch": "^4.0.8"+ },+ "engines": {+ "node": ">=8.6.0"+ }+ },+ "node_modules/fast-glob/node_modules/glob-parent": {+ "version": "5.1.2",+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",+ "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "is-glob": "^4.0.1"+ },+ "engines": {+ "node": ">= 6"+ }+ },+ "node_modules/fastq": {+ "version": "1.20.1",+ "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.1.tgz",+ "integrity": "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "reusify": "^1.0.4"+ }+ },+ "node_modules/fill-range": {+ "version": "7.1.1",+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",+ "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "to-regex-range": "^5.0.1"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/fraction.js": {+ "version": "5.3.4",+ "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-5.3.4.tgz",+ "integrity": "sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": "*"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/rawify"+ }+ },+ "node_modules/fsevents": {+ "version": "2.3.3",+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",+ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",+ "dev": true,+ "hasInstallScript": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"+ }+ },+ "node_modules/function-bind": {+ "version": "1.1.2",+ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",+ "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",+ "dev": true,+ "license": "MIT",+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/gensync": {+ "version": "1.0.0-beta.2",+ "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",+ "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/glob-parent": {+ "version": "6.0.2",+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz",+ "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "is-glob": "^4.0.3"+ },+ "engines": {+ "node": ">=10.13.0"+ }+ },+ "node_modules/hasown": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",+ "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "function-bind": "^1.1.2"+ },+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/hast-util-is-element": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/hast-util-is-element/-/hast-util-is-element-3.0.0.tgz",+ "integrity": "sha512-Val9mnv2IWpLbNPqc/pUem+a7Ipj2aHacCwgNfTiK0vJKl0LF+4Ba4+v1oPHFpf3bLYmreq0/l3Gud9S5OH42g==",+ "license": "MIT",+ "dependencies": {+ "@types/hast": "^3.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/hast-util-to-jsx-runtime": {+ "version": "2.3.6",+ "resolved": "https://registry.npmjs.org/hast-util-to-jsx-runtime/-/hast-util-to-jsx-runtime-2.3.6.tgz",+ "integrity": "sha512-zl6s8LwNyo1P9uw+XJGvZtdFF1GdAkOg8ujOw+4Pyb76874fLps4ueHXDhXWdk6YHQ6OgUtinliG7RsYvCbbBg==",+ "license": "MIT",+ "dependencies": {+ "@types/estree": "^1.0.0",+ "@types/hast": "^3.0.0",+ "@types/unist": "^3.0.0",+ "comma-separated-tokens": "^2.0.0",+ "devlop": "^1.0.0",+ "estree-util-is-identifier-name": "^3.0.0",+ "hast-util-whitespace": "^3.0.0",+ "mdast-util-mdx-expression": "^2.0.0",+ "mdast-util-mdx-jsx": "^3.0.0",+ "mdast-util-mdxjs-esm": "^2.0.0",+ "property-information": "^7.0.0",+ "space-separated-tokens": "^2.0.0",+ "style-to-js": "^1.0.0",+ "unist-util-position": "^5.0.0",+ "vfile-message": "^4.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/hast-util-to-text": {+ "version": "4.0.2",+ "resolved": "https://registry.npmjs.org/hast-util-to-text/-/hast-util-to-text-4.0.2.tgz",+ "integrity": "sha512-KK6y/BN8lbaq654j7JgBydev7wuNMcID54lkRav1P0CaE1e47P72AWWPiGKXTJU271ooYzcvTAn/Zt0REnvc7A==",+ "license": "MIT",+ "dependencies": {+ "@types/hast": "^3.0.0",+ "@types/unist": "^3.0.0",+ "hast-util-is-element": "^3.0.0",+ "unist-util-find-after": "^5.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/hast-util-whitespace": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz",+ "integrity": "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==",+ "license": "MIT",+ "dependencies": {+ "@types/hast": "^3.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/highlight.js": {+ "version": "11.11.1",+ "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.11.1.tgz",+ "integrity": "sha512-Xwwo44whKBVCYoliBQwaPvtd/2tYFkRQtXDWj1nackaV2JPXx3L0+Jvd8/qCJ2p+ML0/XVkJ2q+Mr+UVdpJK5w==",+ "license": "BSD-3-Clause",+ "engines": {+ "node": ">=12.0.0"+ }+ },+ "node_modules/html-url-attributes": {+ "version": "3.0.1",+ "resolved": "https://registry.npmjs.org/html-url-attributes/-/html-url-attributes-3.0.1.tgz",+ "integrity": "sha512-ol6UPyBWqsrO6EJySPz2O7ZSr856WDrEzM5zMqp+FJJLGMW35cLYmmZnl0vztAZxRUoNZJFTCohfjuIJ8I4QBQ==",+ "license": "MIT",+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/inline-style-parser": {+ "version": "0.2.7",+ "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.7.tgz",+ "integrity": "sha512-Nb2ctOyNR8DqQoR0OwRG95uNWIC0C1lCgf5Naz5H6Ji72KZ8OcFZLz2P5sNgwlyoJ8Yif11oMuYs5pBQa86csA==",+ "license": "MIT"+ },+ "node_modules/is-alphabetical": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-2.0.1.tgz",+ "integrity": "sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==",+ "license": "MIT",+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/wooorm"+ }+ },+ "node_modules/is-alphanumerical": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-2.0.1.tgz",+ "integrity": "sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==",+ "license": "MIT",+ "dependencies": {+ "is-alphabetical": "^2.0.0",+ "is-decimal": "^2.0.0"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/wooorm"+ }+ },+ "node_modules/is-binary-path": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",+ "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "binary-extensions": "^2.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/is-core-module": {+ "version": "2.16.1",+ "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz",+ "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "hasown": "^2.0.2"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/is-decimal": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-2.0.1.tgz",+ "integrity": "sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==",+ "license": "MIT",+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/wooorm"+ }+ },+ "node_modules/is-extglob": {+ "version": "2.1.1",+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",+ "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/is-glob": {+ "version": "4.0.3",+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",+ "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "is-extglob": "^2.1.1"+ },+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/is-hexadecimal": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-2.0.1.tgz",+ "integrity": "sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==",+ "license": "MIT",+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/wooorm"+ }+ },+ "node_modules/is-number": {+ "version": "7.0.0",+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",+ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=0.12.0"+ }+ },+ "node_modules/is-plain-obj": {+ "version": "4.1.0",+ "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz",+ "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==",+ "license": "MIT",+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/jiti": {+ "version": "1.21.7",+ "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.7.tgz",+ "integrity": "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==",+ "dev": true,+ "license": "MIT",+ "bin": {+ "jiti": "bin/jiti.js"+ }+ },+ "node_modules/js-tokens": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",+ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/jsesc": {+ "version": "3.1.0",+ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz",+ "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==",+ "dev": true,+ "license": "MIT",+ "bin": {+ "jsesc": "bin/jsesc"+ },+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/json5": {+ "version": "2.2.3",+ "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",+ "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",+ "dev": true,+ "license": "MIT",+ "bin": {+ "json5": "lib/cli.js"+ },+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/lilconfig": {+ "version": "3.1.3",+ "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz",+ "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=14"+ },+ "funding": {+ "url": "https://github.com/sponsors/antonk52"+ }+ },+ "node_modules/lines-and-columns": {+ "version": "1.2.4",+ "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz",+ "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/longest-streak": {+ "version": "3.1.0",+ "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz",+ "integrity": "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==",+ "license": "MIT",+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/wooorm"+ }+ },+ "node_modules/lowlight": {+ "version": "3.3.0",+ "resolved": "https://registry.npmjs.org/lowlight/-/lowlight-3.3.0.tgz",+ "integrity": "sha512-0JNhgFoPvP6U6lE/UdVsSq99tn6DhjjpAj5MxG49ewd2mOBVtwWYIT8ClyABhq198aXXODMU6Ox8DrGy/CpTZQ==",+ "license": "MIT",+ "dependencies": {+ "@types/hast": "^3.0.0",+ "devlop": "^1.0.0",+ "highlight.js": "~11.11.0"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/wooorm"+ }+ },+ "node_modules/lru-cache": {+ "version": "5.1.1",+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",+ "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "yallist": "^3.0.2"+ }+ },+ "node_modules/lucide-react": {+ "version": "0.460.0",+ "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.460.0.tgz",+ "integrity": "sha512-BVtq/DykVeIvRTJvRAgCsOwaGL8Un3Bxh8MbDxMhEWlZay3T4IpEKDEpwt5KZ0KJMHzgm6jrltxlT5eXOWXDHg==",+ "license": "ISC",+ "peerDependencies": {+ "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0-rc"+ }+ },+ "node_modules/markdown-table": {+ "version": "3.0.4",+ "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.4.tgz",+ "integrity": "sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw==",+ "license": "MIT",+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/wooorm"+ }+ },+ "node_modules/mdast-util-find-and-replace": {+ "version": "3.0.2",+ "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.2.tgz",+ "integrity": "sha512-Tmd1Vg/m3Xz43afeNxDIhWRtFZgM2VLyaf4vSTYwudTyeuTneoL3qtWMA5jeLyz/O1vDJmmV4QuScFCA2tBPwg==",+ "license": "MIT",+ "dependencies": {+ "@types/mdast": "^4.0.0",+ "escape-string-regexp": "^5.0.0",+ "unist-util-is": "^6.0.0",+ "unist-util-visit-parents": "^6.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/mdast-util-from-markdown": {+ "version": "2.0.3",+ "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.3.tgz",+ "integrity": "sha512-W4mAWTvSlKvf8L6J+VN9yLSqQ9AOAAvHuoDAmPkz4dHf553m5gVj2ejadHJhoJmcmxEnOv6Pa8XJhpxE93kb8Q==",+ "license": "MIT",+ "dependencies": {+ "@types/mdast": "^4.0.0",+ "@types/unist": "^3.0.0",+ "decode-named-character-reference": "^1.0.0",+ "devlop": "^1.0.0",+ "mdast-util-to-string": "^4.0.0",+ "micromark": "^4.0.0",+ "micromark-util-decode-numeric-character-reference": "^2.0.0",+ "micromark-util-decode-string": "^2.0.0",+ "micromark-util-normalize-identifier": "^2.0.0",+ "micromark-util-symbol": "^2.0.0",+ "micromark-util-types": "^2.0.0",+ "unist-util-stringify-position": "^4.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/mdast-util-gfm": {+ "version": "3.1.0",+ "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-3.1.0.tgz",+ "integrity": "sha512-0ulfdQOM3ysHhCJ1p06l0b0VKlhU0wuQs3thxZQagjcjPrlFRqY215uZGHHJan9GEAXd9MbfPjFJz+qMkVR6zQ==",+ "license": "MIT",+ "dependencies": {+ "mdast-util-from-markdown": "^2.0.0",+ "mdast-util-gfm-autolink-literal": "^2.0.0",+ "mdast-util-gfm-footnote": "^2.0.0",+ "mdast-util-gfm-strikethrough": "^2.0.0",+ "mdast-util-gfm-table": "^2.0.0",+ "mdast-util-gfm-task-list-item": "^2.0.0",+ "mdast-util-to-markdown": "^2.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/mdast-util-gfm-autolink-literal": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-2.0.1.tgz",+ "integrity": "sha512-5HVP2MKaP6L+G6YaxPNjuL0BPrq9orG3TsrZ9YXbA3vDw/ACI4MEsnoDpn6ZNm7GnZgtAcONJyPhOP8tNJQavQ==",+ "license": "MIT",+ "dependencies": {+ "@types/mdast": "^4.0.0",+ "ccount": "^2.0.0",+ "devlop": "^1.0.0",+ "mdast-util-find-and-replace": "^3.0.0",+ "micromark-util-character": "^2.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/mdast-util-gfm-footnote": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-2.1.0.tgz",+ "integrity": "sha512-sqpDWlsHn7Ac9GNZQMeUzPQSMzR6Wv0WKRNvQRg0KqHh02fpTz69Qc1QSseNX29bhz1ROIyNyxExfawVKTm1GQ==",+ "license": "MIT",+ "dependencies": {+ "@types/mdast": "^4.0.0",+ "devlop": "^1.1.0",+ "mdast-util-from-markdown": "^2.0.0",+ "mdast-util-to-markdown": "^2.0.0",+ "micromark-util-normalize-identifier": "^2.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/mdast-util-gfm-strikethrough": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-2.0.0.tgz",+ "integrity": "sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg==",+ "license": "MIT",+ "dependencies": {+ "@types/mdast": "^4.0.0",+ "mdast-util-from-markdown": "^2.0.0",+ "mdast-util-to-markdown": "^2.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/mdast-util-gfm-table": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-2.0.0.tgz",+ "integrity": "sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg==",+ "license": "MIT",+ "dependencies": {+ "@types/mdast": "^4.0.0",+ "devlop": "^1.0.0",+ "markdown-table": "^3.0.0",+ "mdast-util-from-markdown": "^2.0.0",+ "mdast-util-to-markdown": "^2.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/mdast-util-gfm-task-list-item": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-2.0.0.tgz",+ "integrity": "sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ==",+ "license": "MIT",+ "dependencies": {+ "@types/mdast": "^4.0.0",+ "devlop": "^1.0.0",+ "mdast-util-from-markdown": "^2.0.0",+ "mdast-util-to-markdown": "^2.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/mdast-util-mdx-expression": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/mdast-util-mdx-expression/-/mdast-util-mdx-expression-2.0.1.tgz",+ "integrity": "sha512-J6f+9hUp+ldTZqKRSg7Vw5V6MqjATc+3E4gf3CFNcuZNWD8XdyI6zQ8GqH7f8169MM6P7hMBRDVGnn7oHB9kXQ==",+ "license": "MIT",+ "dependencies": {+ "@types/estree-jsx": "^1.0.0",+ "@types/hast": "^3.0.0",+ "@types/mdast": "^4.0.0",+ "devlop": "^1.0.0",+ "mdast-util-from-markdown": "^2.0.0",+ "mdast-util-to-markdown": "^2.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/mdast-util-mdx-jsx": {+ "version": "3.2.0",+ "resolved": "https://registry.npmjs.org/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-3.2.0.tgz",+ "integrity": "sha512-lj/z8v0r6ZtsN/cGNNtemmmfoLAFZnjMbNyLzBafjzikOM+glrjNHPlf6lQDOTccj9n5b0PPihEBbhneMyGs1Q==",+ "license": "MIT",+ "dependencies": {+ "@types/estree-jsx": "^1.0.0",+ "@types/hast": "^3.0.0",+ "@types/mdast": "^4.0.0",+ "@types/unist": "^3.0.0",+ "ccount": "^2.0.0",+ "devlop": "^1.1.0",+ "mdast-util-from-markdown": "^2.0.0",+ "mdast-util-to-markdown": "^2.0.0",+ "parse-entities": "^4.0.0",+ "stringify-entities": "^4.0.0",+ "unist-util-stringify-position": "^4.0.0",+ "vfile-message": "^4.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/mdast-util-mdxjs-esm": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/mdast-util-mdxjs-esm/-/mdast-util-mdxjs-esm-2.0.1.tgz",+ "integrity": "sha512-EcmOpxsZ96CvlP03NghtH1EsLtr0n9Tm4lPUJUBccV9RwUOneqSycg19n5HGzCf+10LozMRSObtVr3ee1WoHtg==",+ "license": "MIT",+ "dependencies": {+ "@types/estree-jsx": "^1.0.0",+ "@types/hast": "^3.0.0",+ "@types/mdast": "^4.0.0",+ "devlop": "^1.0.0",+ "mdast-util-from-markdown": "^2.0.0",+ "mdast-util-to-markdown": "^2.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/mdast-util-phrasing": {+ "version": "4.1.0",+ "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz",+ "integrity": "sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==",+ "license": "MIT",+ "dependencies": {+ "@types/mdast": "^4.0.0",+ "unist-util-is": "^6.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/mdast-util-to-hast": {+ "version": "13.2.1",+ "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.2.1.tgz",+ "integrity": "sha512-cctsq2wp5vTsLIcaymblUriiTcZd0CwWtCbLvrOzYCDZoWyMNV8sZ7krj09FSnsiJi3WVsHLM4k6Dq/yaPyCXA==",+ "license": "MIT",+ "dependencies": {+ "@types/hast": "^3.0.0",+ "@types/mdast": "^4.0.0",+ "@ungap/structured-clone": "^1.0.0",+ "devlop": "^1.0.0",+ "micromark-util-sanitize-uri": "^2.0.0",+ "trim-lines": "^3.0.0",+ "unist-util-position": "^5.0.0",+ "unist-util-visit": "^5.0.0",+ "vfile": "^6.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/mdast-util-to-markdown": {+ "version": "2.1.2",+ "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.2.tgz",+ "integrity": "sha512-xj68wMTvGXVOKonmog6LwyJKrYXZPvlwabaryTjLh9LuvovB/KAH+kvi8Gjj+7rJjsFi23nkUxRQv1KqSroMqA==",+ "license": "MIT",+ "dependencies": {+ "@types/mdast": "^4.0.0",+ "@types/unist": "^3.0.0",+ "longest-streak": "^3.0.0",+ "mdast-util-phrasing": "^4.0.0",+ "mdast-util-to-string": "^4.0.0",+ "micromark-util-classify-character": "^2.0.0",+ "micromark-util-decode-string": "^2.0.0",+ "unist-util-visit": "^5.0.0",+ "zwitch": "^2.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/mdast-util-to-string": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz",+ "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==",+ "license": "MIT",+ "dependencies": {+ "@types/mdast": "^4.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/merge2": {+ "version": "1.4.1",+ "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",+ "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 8"+ }+ },+ "node_modules/micromark": {+ "version": "4.0.2",+ "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.2.tgz",+ "integrity": "sha512-zpe98Q6kvavpCr1NPVSCMebCKfD7CA2NqZ+rykeNhONIJBpc1tFKt9hucLGwha3jNTNI8lHpctWJWoimVF4PfA==",+ "funding": [+ {+ "type": "GitHub Sponsors",+ "url": "https://github.com/sponsors/unifiedjs"+ },+ {+ "type": "OpenCollective",+ "url": "https://opencollective.com/unified"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "@types/debug": "^4.0.0",+ "debug": "^4.0.0",+ "decode-named-character-reference": "^1.0.0",+ "devlop": "^1.0.0",+ "micromark-core-commonmark": "^2.0.0",+ "micromark-factory-space": "^2.0.0",+ "micromark-util-character": "^2.0.0",+ "micromark-util-chunked": "^2.0.0",+ "micromark-util-combine-extensions": "^2.0.0",+ "micromark-util-decode-numeric-character-reference": "^2.0.0",+ "micromark-util-encode": "^2.0.0",+ "micromark-util-normalize-identifier": "^2.0.0",+ "micromark-util-resolve-all": "^2.0.0",+ "micromark-util-sanitize-uri": "^2.0.0",+ "micromark-util-subtokenize": "^2.0.0",+ "micromark-util-symbol": "^2.0.0",+ "micromark-util-types": "^2.0.0"+ }+ },+ "node_modules/micromark-core-commonmark": {+ "version": "2.0.3",+ "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.3.tgz",+ "integrity": "sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg==",+ "funding": [+ {+ "type": "GitHub Sponsors",+ "url": "https://github.com/sponsors/unifiedjs"+ },+ {+ "type": "OpenCollective",+ "url": "https://opencollective.com/unified"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "decode-named-character-reference": "^1.0.0",+ "devlop": "^1.0.0",+ "micromark-factory-destination": "^2.0.0",+ "micromark-factory-label": "^2.0.0",+ "micromark-factory-space": "^2.0.0",+ "micromark-factory-title": "^2.0.0",+ "micromark-factory-whitespace": "^2.0.0",+ "micromark-util-character": "^2.0.0",+ "micromark-util-chunked": "^2.0.0",+ "micromark-util-classify-character": "^2.0.0",+ "micromark-util-html-tag-name": "^2.0.0",+ "micromark-util-normalize-identifier": "^2.0.0",+ "micromark-util-resolve-all": "^2.0.0",+ "micromark-util-subtokenize": "^2.0.0",+ "micromark-util-symbol": "^2.0.0",+ "micromark-util-types": "^2.0.0"+ }+ },+ "node_modules/micromark-extension-gfm": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-3.0.0.tgz",+ "integrity": "sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w==",+ "license": "MIT",+ "dependencies": {+ "micromark-extension-gfm-autolink-literal": "^2.0.0",+ "micromark-extension-gfm-footnote": "^2.0.0",+ "micromark-extension-gfm-strikethrough": "^2.0.0",+ "micromark-extension-gfm-table": "^2.0.0",+ "micromark-extension-gfm-tagfilter": "^2.0.0",+ "micromark-extension-gfm-task-list-item": "^2.0.0",+ "micromark-util-combine-extensions": "^2.0.0",+ "micromark-util-types": "^2.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/micromark-extension-gfm-autolink-literal": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-2.1.0.tgz",+ "integrity": "sha512-oOg7knzhicgQ3t4QCjCWgTmfNhvQbDDnJeVu9v81r7NltNCVmhPy1fJRX27pISafdjL+SVc4d3l48Gb6pbRypw==",+ "license": "MIT",+ "dependencies": {+ "micromark-util-character": "^2.0.0",+ "micromark-util-sanitize-uri": "^2.0.0",+ "micromark-util-symbol": "^2.0.0",+ "micromark-util-types": "^2.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/micromark-extension-gfm-footnote": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-2.1.0.tgz",+ "integrity": "sha512-/yPhxI1ntnDNsiHtzLKYnE3vf9JZ6cAisqVDauhp4CEHxlb4uoOTxOCJ+9s51bIB8U1N1FJ1RXOKTIlD5B/gqw==",+ "license": "MIT",+ "dependencies": {+ "devlop": "^1.0.0",+ "micromark-core-commonmark": "^2.0.0",+ "micromark-factory-space": "^2.0.0",+ "micromark-util-character": "^2.0.0",+ "micromark-util-normalize-identifier": "^2.0.0",+ "micromark-util-sanitize-uri": "^2.0.0",+ "micromark-util-symbol": "^2.0.0",+ "micromark-util-types": "^2.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/micromark-extension-gfm-strikethrough": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-2.1.0.tgz",+ "integrity": "sha512-ADVjpOOkjz1hhkZLlBiYA9cR2Anf8F4HqZUO6e5eDcPQd0Txw5fxLzzxnEkSkfnD0wziSGiv7sYhk/ktvbf1uw==",+ "license": "MIT",+ "dependencies": {+ "devlop": "^1.0.0",+ "micromark-util-chunked": "^2.0.0",+ "micromark-util-classify-character": "^2.0.0",+ "micromark-util-resolve-all": "^2.0.0",+ "micromark-util-symbol": "^2.0.0",+ "micromark-util-types": "^2.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/micromark-extension-gfm-table": {+ "version": "2.1.1",+ "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.1.1.tgz",+ "integrity": "sha512-t2OU/dXXioARrC6yWfJ4hqB7rct14e8f7m0cbI5hUmDyyIlwv5vEtooptH8INkbLzOatzKuVbQmAYcbWoyz6Dg==",+ "license": "MIT",+ "dependencies": {+ "devlop": "^1.0.0",+ "micromark-factory-space": "^2.0.0",+ "micromark-util-character": "^2.0.0",+ "micromark-util-symbol": "^2.0.0",+ "micromark-util-types": "^2.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/micromark-extension-gfm-tagfilter": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-2.0.0.tgz",+ "integrity": "sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg==",+ "license": "MIT",+ "dependencies": {+ "micromark-util-types": "^2.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/micromark-extension-gfm-task-list-item": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-2.1.0.tgz",+ "integrity": "sha512-qIBZhqxqI6fjLDYFTBIa4eivDMnP+OZqsNwmQ3xNLE4Cxwc+zfQEfbs6tzAo2Hjq+bh6q5F+Z8/cksrLFYWQQw==",+ "license": "MIT",+ "dependencies": {+ "devlop": "^1.0.0",+ "micromark-factory-space": "^2.0.0",+ "micromark-util-character": "^2.0.0",+ "micromark-util-symbol": "^2.0.0",+ "micromark-util-types": "^2.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/micromark-factory-destination": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.1.tgz",+ "integrity": "sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA==",+ "funding": [+ {+ "type": "GitHub Sponsors",+ "url": "https://github.com/sponsors/unifiedjs"+ },+ {+ "type": "OpenCollective",+ "url": "https://opencollective.com/unified"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "micromark-util-character": "^2.0.0",+ "micromark-util-symbol": "^2.0.0",+ "micromark-util-types": "^2.0.0"+ }+ },+ "node_modules/micromark-factory-label": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-2.0.1.tgz",+ "integrity": "sha512-VFMekyQExqIW7xIChcXn4ok29YE3rnuyveW3wZQWWqF4Nv9Wk5rgJ99KzPvHjkmPXF93FXIbBp6YdW3t71/7Vg==",+ "funding": [+ {+ "type": "GitHub Sponsors",+ "url": "https://github.com/sponsors/unifiedjs"+ },+ {+ "type": "OpenCollective",+ "url": "https://opencollective.com/unified"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "devlop": "^1.0.0",+ "micromark-util-character": "^2.0.0",+ "micromark-util-symbol": "^2.0.0",+ "micromark-util-types": "^2.0.0"+ }+ },+ "node_modules/micromark-factory-space": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.1.tgz",+ "integrity": "sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg==",+ "funding": [+ {+ "type": "GitHub Sponsors",+ "url": "https://github.com/sponsors/unifiedjs"+ },+ {+ "type": "OpenCollective",+ "url": "https://opencollective.com/unified"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "micromark-util-character": "^2.0.0",+ "micromark-util-types": "^2.0.0"+ }+ },+ "node_modules/micromark-factory-title": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-2.0.1.tgz",+ "integrity": "sha512-5bZ+3CjhAd9eChYTHsjy6TGxpOFSKgKKJPJxr293jTbfry2KDoWkhBb6TcPVB4NmzaPhMs1Frm9AZH7OD4Cjzw==",+ "funding": [+ {+ "type": "GitHub Sponsors",+ "url": "https://github.com/sponsors/unifiedjs"+ },+ {+ "type": "OpenCollective",+ "url": "https://opencollective.com/unified"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "micromark-factory-space": "^2.0.0",+ "micromark-util-character": "^2.0.0",+ "micromark-util-symbol": "^2.0.0",+ "micromark-util-types": "^2.0.0"+ }+ },+ "node_modules/micromark-factory-whitespace": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.1.tgz",+ "integrity": "sha512-Ob0nuZ3PKt/n0hORHyvoD9uZhr+Za8sFoP+OnMcnWK5lngSzALgQYKMr9RJVOWLqQYuyn6ulqGWSXdwf6F80lQ==",+ "funding": [+ {+ "type": "GitHub Sponsors",+ "url": "https://github.com/sponsors/unifiedjs"+ },+ {+ "type": "OpenCollective",+ "url": "https://opencollective.com/unified"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "micromark-factory-space": "^2.0.0",+ "micromark-util-character": "^2.0.0",+ "micromark-util-symbol": "^2.0.0",+ "micromark-util-types": "^2.0.0"+ }+ },+ "node_modules/micromark-util-character": {+ "version": "2.1.1",+ "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz",+ "integrity": "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==",+ "funding": [+ {+ "type": "GitHub Sponsors",+ "url": "https://github.com/sponsors/unifiedjs"+ },+ {+ "type": "OpenCollective",+ "url": "https://opencollective.com/unified"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "micromark-util-symbol": "^2.0.0",+ "micromark-util-types": "^2.0.0"+ }+ },+ "node_modules/micromark-util-chunked": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.1.tgz",+ "integrity": "sha512-QUNFEOPELfmvv+4xiNg2sRYeS/P84pTW0TCgP5zc9FpXetHY0ab7SxKyAQCNCc1eK0459uoLI1y5oO5Vc1dbhA==",+ "funding": [+ {+ "type": "GitHub Sponsors",+ "url": "https://github.com/sponsors/unifiedjs"+ },+ {+ "type": "OpenCollective",+ "url": "https://opencollective.com/unified"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "micromark-util-symbol": "^2.0.0"+ }+ },+ "node_modules/micromark-util-classify-character": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-2.0.1.tgz",+ "integrity": "sha512-K0kHzM6afW/MbeWYWLjoHQv1sgg2Q9EccHEDzSkxiP/EaagNzCm7T/WMKZ3rjMbvIpvBiZgwR3dKMygtA4mG1Q==",+ "funding": [+ {+ "type": "GitHub Sponsors",+ "url": "https://github.com/sponsors/unifiedjs"+ },+ {+ "type": "OpenCollective",+ "url": "https://opencollective.com/unified"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "micromark-util-character": "^2.0.0",+ "micromark-util-symbol": "^2.0.0",+ "micromark-util-types": "^2.0.0"+ }+ },+ "node_modules/micromark-util-combine-extensions": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.1.tgz",+ "integrity": "sha512-OnAnH8Ujmy59JcyZw8JSbK9cGpdVY44NKgSM7E9Eh7DiLS2E9RNQf0dONaGDzEG9yjEl5hcqeIsj4hfRkLH/Bg==",+ "funding": [+ {+ "type": "GitHub Sponsors",+ "url": "https://github.com/sponsors/unifiedjs"+ },+ {+ "type": "OpenCollective",+ "url": "https://opencollective.com/unified"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "micromark-util-chunked": "^2.0.0",+ "micromark-util-types": "^2.0.0"+ }+ },+ "node_modules/micromark-util-decode-numeric-character-reference": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.2.tgz",+ "integrity": "sha512-ccUbYk6CwVdkmCQMyr64dXz42EfHGkPQlBj5p7YVGzq8I7CtjXZJrubAYezf7Rp+bjPseiROqe7G6foFd+lEuw==",+ "funding": [+ {+ "type": "GitHub Sponsors",+ "url": "https://github.com/sponsors/unifiedjs"+ },+ {+ "type": "OpenCollective",+ "url": "https://opencollective.com/unified"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "micromark-util-symbol": "^2.0.0"+ }+ },+ "node_modules/micromark-util-decode-string": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.1.tgz",+ "integrity": "sha512-nDV/77Fj6eH1ynwscYTOsbK7rR//Uj0bZXBwJZRfaLEJ1iGBR6kIfNmlNqaqJf649EP0F3NWNdeJi03elllNUQ==",+ "funding": [+ {+ "type": "GitHub Sponsors",+ "url": "https://github.com/sponsors/unifiedjs"+ },+ {+ "type": "OpenCollective",+ "url": "https://opencollective.com/unified"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "decode-named-character-reference": "^1.0.0",+ "micromark-util-character": "^2.0.0",+ "micromark-util-decode-numeric-character-reference": "^2.0.0",+ "micromark-util-symbol": "^2.0.0"+ }+ },+ "node_modules/micromark-util-encode": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz",+ "integrity": "sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==",+ "funding": [+ {+ "type": "GitHub Sponsors",+ "url": "https://github.com/sponsors/unifiedjs"+ },+ {+ "type": "OpenCollective",+ "url": "https://opencollective.com/unified"+ }+ ],+ "license": "MIT"+ },+ "node_modules/micromark-util-html-tag-name": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.1.tgz",+ "integrity": "sha512-2cNEiYDhCWKI+Gs9T0Tiysk136SnR13hhO8yW6BGNyhOC4qYFnwF1nKfD3HFAIXA5c45RrIG1ub11GiXeYd1xA==",+ "funding": [+ {+ "type": "GitHub Sponsors",+ "url": "https://github.com/sponsors/unifiedjs"+ },+ {+ "type": "OpenCollective",+ "url": "https://opencollective.com/unified"+ }+ ],+ "license": "MIT"+ },+ "node_modules/micromark-util-normalize-identifier": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.1.tgz",+ "integrity": "sha512-sxPqmo70LyARJs0w2UclACPUUEqltCkJ6PhKdMIDuJ3gSf/Q+/GIe3WKl0Ijb/GyH9lOpUkRAO2wp0GVkLvS9Q==",+ "funding": [+ {+ "type": "GitHub Sponsors",+ "url": "https://github.com/sponsors/unifiedjs"+ },+ {+ "type": "OpenCollective",+ "url": "https://opencollective.com/unified"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "micromark-util-symbol": "^2.0.0"+ }+ },+ "node_modules/micromark-util-resolve-all": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.1.tgz",+ "integrity": "sha512-VdQyxFWFT2/FGJgwQnJYbe1jjQoNTS4RjglmSjTUlpUMa95Htx9NHeYW4rGDJzbjvCsl9eLjMQwGeElsqmzcHg==",+ "funding": [+ {+ "type": "GitHub Sponsors",+ "url": "https://github.com/sponsors/unifiedjs"+ },+ {+ "type": "OpenCollective",+ "url": "https://opencollective.com/unified"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "micromark-util-types": "^2.0.0"+ }+ },+ "node_modules/micromark-util-sanitize-uri": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.1.tgz",+ "integrity": "sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==",+ "funding": [+ {+ "type": "GitHub Sponsors",+ "url": "https://github.com/sponsors/unifiedjs"+ },+ {+ "type": "OpenCollective",+ "url": "https://opencollective.com/unified"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "micromark-util-character": "^2.0.0",+ "micromark-util-encode": "^2.0.0",+ "micromark-util-symbol": "^2.0.0"+ }+ },+ "node_modules/micromark-util-subtokenize": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.1.0.tgz",+ "integrity": "sha512-XQLu552iSctvnEcgXw6+Sx75GflAPNED1qx7eBJ+wydBb2KCbRZe+NwvIEEMM83uml1+2WSXpBAcp9IUCgCYWA==",+ "funding": [+ {+ "type": "GitHub Sponsors",+ "url": "https://github.com/sponsors/unifiedjs"+ },+ {+ "type": "OpenCollective",+ "url": "https://opencollective.com/unified"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "devlop": "^1.0.0",+ "micromark-util-chunked": "^2.0.0",+ "micromark-util-symbol": "^2.0.0",+ "micromark-util-types": "^2.0.0"+ }+ },+ "node_modules/micromark-util-symbol": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz",+ "integrity": "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==",+ "funding": [+ {+ "type": "GitHub Sponsors",+ "url": "https://github.com/sponsors/unifiedjs"+ },+ {+ "type": "OpenCollective",+ "url": "https://opencollective.com/unified"+ }+ ],+ "license": "MIT"+ },+ "node_modules/micromark-util-types": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.2.tgz",+ "integrity": "sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA==",+ "funding": [+ {+ "type": "GitHub Sponsors",+ "url": "https://github.com/sponsors/unifiedjs"+ },+ {+ "type": "OpenCollective",+ "url": "https://opencollective.com/unified"+ }+ ],+ "license": "MIT"+ },+ "node_modules/micromatch": {+ "version": "4.0.8",+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",+ "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "braces": "^3.0.3",+ "picomatch": "^2.3.1"+ },+ "engines": {+ "node": ">=8.6"+ }+ },+ "node_modules/ms": {+ "version": "2.1.3",+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",+ "license": "MIT"+ },+ "node_modules/mz": {+ "version": "2.7.0",+ "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz",+ "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "any-promise": "^1.0.0",+ "object-assign": "^4.0.1",+ "thenify-all": "^1.0.0"+ }+ },+ "node_modules/nanoid": {+ "version": "3.3.11",+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz",+ "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==",+ "dev": true,+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "license": "MIT",+ "bin": {+ "nanoid": "bin/nanoid.cjs"+ },+ "engines": {+ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"+ }+ },+ "node_modules/node-releases": {+ "version": "2.0.36",+ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.36.tgz",+ "integrity": "sha512-TdC8FSgHz8Mwtw9g5L4gR/Sh9XhSP/0DEkQxfEFXOpiul5IiHgHan2VhYYb6agDSfp4KuvltmGApc8HMgUrIkA==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/normalize-path": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",+ "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/object-assign": {+ "version": "4.1.1",+ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",+ "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/object-hash": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz",+ "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 6"+ }+ },+ "node_modules/parse-entities": {+ "version": "4.0.2",+ "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-4.0.2.tgz",+ "integrity": "sha512-GG2AQYWoLgL877gQIKeRPGO1xF9+eG1ujIb5soS5gPvLQ1y2o8FL90w2QWNdf9I361Mpp7726c+lj3U0qK1uGw==",+ "license": "MIT",+ "dependencies": {+ "@types/unist": "^2.0.0",+ "character-entities-legacy": "^3.0.0",+ "character-reference-invalid": "^2.0.0",+ "decode-named-character-reference": "^1.0.0",+ "is-alphanumerical": "^2.0.0",+ "is-decimal": "^2.0.0",+ "is-hexadecimal": "^2.0.0"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/wooorm"+ }+ },+ "node_modules/parse-entities/node_modules/@types/unist": {+ "version": "2.0.11",+ "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz",+ "integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==",+ "license": "MIT"+ },+ "node_modules/path-parse": {+ "version": "1.0.7",+ "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",+ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/picocolors": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",+ "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/picomatch": {+ "version": "2.3.1",+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",+ "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8.6"+ },+ "funding": {+ "url": "https://github.com/sponsors/jonschlinkert"+ }+ },+ "node_modules/pify": {+ "version": "2.3.0",+ "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",+ "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/pirates": {+ "version": "4.0.7",+ "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz",+ "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 6"+ }+ },+ "node_modules/postcss": {+ "version": "8.5.8",+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.8.tgz",+ "integrity": "sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg==",+ "dev": true,+ "funding": [+ {+ "type": "opencollective",+ "url": "https://opencollective.com/postcss/"+ },+ {+ "type": "tidelift",+ "url": "https://tidelift.com/funding/github/npm/postcss"+ },+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "nanoid": "^3.3.11",+ "picocolors": "^1.1.1",+ "source-map-js": "^1.2.1"+ },+ "engines": {+ "node": "^10 || ^12 || >=14"+ }+ },+ "node_modules/postcss-import": {+ "version": "15.1.0",+ "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-15.1.0.tgz",+ "integrity": "sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "postcss-value-parser": "^4.0.0",+ "read-cache": "^1.0.0",+ "resolve": "^1.1.7"+ },+ "engines": {+ "node": ">=14.0.0"+ },+ "peerDependencies": {+ "postcss": "^8.0.0"+ }+ },+ "node_modules/postcss-js": {+ "version": "4.1.0",+ "resolved": "https://registry.npmjs.org/postcss-js/-/postcss-js-4.1.0.tgz",+ "integrity": "sha512-oIAOTqgIo7q2EOwbhb8UalYePMvYoIeRY2YKntdpFQXNosSu3vLrniGgmH9OKs/qAkfoj5oB3le/7mINW1LCfw==",+ "dev": true,+ "funding": [+ {+ "type": "opencollective",+ "url": "https://opencollective.com/postcss/"+ },+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "camelcase-css": "^2.0.1"+ },+ "engines": {+ "node": "^12 || ^14 || >= 16"+ },+ "peerDependencies": {+ "postcss": "^8.4.21"+ }+ },+ "node_modules/postcss-load-config": {+ "version": "6.0.1",+ "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-6.0.1.tgz",+ "integrity": "sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==",+ "dev": true,+ "funding": [+ {+ "type": "opencollective",+ "url": "https://opencollective.com/postcss/"+ },+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "lilconfig": "^3.1.1"+ },+ "engines": {+ "node": ">= 18"+ },+ "peerDependencies": {+ "jiti": ">=1.21.0",+ "postcss": ">=8.0.9",+ "tsx": "^4.8.1",+ "yaml": "^2.4.2"+ },+ "peerDependenciesMeta": {+ "jiti": {+ "optional": true+ },+ "postcss": {+ "optional": true+ },+ "tsx": {+ "optional": true+ },+ "yaml": {+ "optional": true+ }+ }+ },+ "node_modules/postcss-nested": {+ "version": "6.2.0",+ "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.2.0.tgz",+ "integrity": "sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ==",+ "dev": true,+ "funding": [+ {+ "type": "opencollective",+ "url": "https://opencollective.com/postcss/"+ },+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "postcss-selector-parser": "^6.1.1"+ },+ "engines": {+ "node": ">=12.0"+ },+ "peerDependencies": {+ "postcss": "^8.2.14"+ }+ },+ "node_modules/postcss-nested/node_modules/postcss-selector-parser": {+ "version": "6.1.2",+ "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz",+ "integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "cssesc": "^3.0.0",+ "util-deprecate": "^1.0.2"+ },+ "engines": {+ "node": ">=4"+ }+ },+ "node_modules/postcss-selector-parser": {+ "version": "6.0.10",+ "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz",+ "integrity": "sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "cssesc": "^3.0.0",+ "util-deprecate": "^1.0.2"+ },+ "engines": {+ "node": ">=4"+ }+ },+ "node_modules/postcss-value-parser": {+ "version": "4.2.0",+ "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz",+ "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/property-information": {+ "version": "7.1.0",+ "resolved": "https://registry.npmjs.org/property-information/-/property-information-7.1.0.tgz",+ "integrity": "sha512-TwEZ+X+yCJmYfL7TPUOcvBZ4QfoT5YenQiJuX//0th53DE6w0xxLEtfK3iyryQFddXuvkIk51EEgrJQ0WJkOmQ==",+ "license": "MIT",+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/wooorm"+ }+ },+ "node_modules/queue-microtask": {+ "version": "1.2.3",+ "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",+ "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",+ "dev": true,+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/feross"+ },+ {+ "type": "patreon",+ "url": "https://www.patreon.com/feross"+ },+ {+ "type": "consulting",+ "url": "https://feross.org/support"+ }+ ],+ "license": "MIT"+ },+ "node_modules/react": {+ "version": "19.2.4",+ "resolved": "https://registry.npmjs.org/react/-/react-19.2.4.tgz",+ "integrity": "sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ==",+ "license": "MIT",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/react-dom": {+ "version": "19.2.4",+ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.4.tgz",+ "integrity": "sha512-AXJdLo8kgMbimY95O2aKQqsz2iWi9jMgKJhRBAxECE4IFxfcazB2LmzloIoibJI3C12IlY20+KFaLv+71bUJeQ==",+ "license": "MIT",+ "dependencies": {+ "scheduler": "^0.27.0"+ },+ "peerDependencies": {+ "react": "^19.2.4"+ }+ },+ "node_modules/react-markdown": {+ "version": "9.1.0",+ "resolved": "https://registry.npmjs.org/react-markdown/-/react-markdown-9.1.0.tgz",+ "integrity": "sha512-xaijuJB0kzGiUdG7nc2MOMDUDBWPyGAjZtUrow9XxUeua8IqeP+VlIfAZ3bphpcLTnSZXz6z9jcVC/TCwbfgdw==",+ "license": "MIT",+ "dependencies": {+ "@types/hast": "^3.0.0",+ "@types/mdast": "^4.0.0",+ "devlop": "^1.0.0",+ "hast-util-to-jsx-runtime": "^2.0.0",+ "html-url-attributes": "^3.0.0",+ "mdast-util-to-hast": "^13.0.0",+ "remark-parse": "^11.0.0",+ "remark-rehype": "^11.0.0",+ "unified": "^11.0.0",+ "unist-util-visit": "^5.0.0",+ "vfile": "^6.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ },+ "peerDependencies": {+ "@types/react": ">=18",+ "react": ">=18"+ }+ },+ "node_modules/react-refresh": {+ "version": "0.17.0",+ "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.17.0.tgz",+ "integrity": "sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/react-router": {+ "version": "7.13.1",+ "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.13.1.tgz",+ "integrity": "sha512-td+xP4X2/6BJvZoX6xw++A2DdEi++YypA69bJUV5oVvqf6/9/9nNlD70YO1e9d3MyamJEBQFEzk6mbfDYbqrSA==",+ "license": "MIT",+ "dependencies": {+ "cookie": "^1.0.1",+ "set-cookie-parser": "^2.6.0"+ },+ "engines": {+ "node": ">=20.0.0"+ },+ "peerDependencies": {+ "react": ">=18",+ "react-dom": ">=18"+ },+ "peerDependenciesMeta": {+ "react-dom": {+ "optional": true+ }+ }+ },+ "node_modules/react-router-dom": {+ "version": "7.13.1",+ "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.13.1.tgz",+ "integrity": "sha512-UJnV3Rxc5TgUPJt2KJpo1Jpy0OKQr0AjgbZzBFjaPJcFOb2Y8jA5H3LT8HUJAiRLlWrEXWHbF1Z4SCZaQjWDHw==",+ "license": "MIT",+ "dependencies": {+ "react-router": "7.13.1"+ },+ "engines": {+ "node": ">=20.0.0"+ },+ "peerDependencies": {+ "react": ">=18",+ "react-dom": ">=18"+ }+ },+ "node_modules/read-cache": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz",+ "integrity": "sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "pify": "^2.3.0"+ }+ },+ "node_modules/readdirp": {+ "version": "3.6.0",+ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",+ "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "picomatch": "^2.2.1"+ },+ "engines": {+ "node": ">=8.10.0"+ }+ },+ "node_modules/rehype-highlight": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/rehype-highlight/-/rehype-highlight-7.0.2.tgz",+ "integrity": "sha512-k158pK7wdC2qL3M5NcZROZ2tR/l7zOzjxXd5VGdcfIyoijjQqpHd3JKtYSBDpDZ38UI2WJWuFAtkMDxmx5kstA==",+ "license": "MIT",+ "dependencies": {+ "@types/hast": "^3.0.0",+ "hast-util-to-text": "^4.0.0",+ "lowlight": "^3.0.0",+ "unist-util-visit": "^5.0.0",+ "vfile": "^6.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/remark-gfm": {+ "version": "4.0.1",+ "resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-4.0.1.tgz",+ "integrity": "sha512-1quofZ2RQ9EWdeN34S79+KExV1764+wCUGop5CPL1WGdD0ocPpu91lzPGbwWMECpEpd42kJGQwzRfyov9j4yNg==",+ "license": "MIT",+ "dependencies": {+ "@types/mdast": "^4.0.0",+ "mdast-util-gfm": "^3.0.0",+ "micromark-extension-gfm": "^3.0.0",+ "remark-parse": "^11.0.0",+ "remark-stringify": "^11.0.0",+ "unified": "^11.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/remark-parse": {+ "version": "11.0.0",+ "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz",+ "integrity": "sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==",+ "license": "MIT",+ "dependencies": {+ "@types/mdast": "^4.0.0",+ "mdast-util-from-markdown": "^2.0.0",+ "micromark-util-types": "^2.0.0",+ "unified": "^11.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/remark-rehype": {+ "version": "11.1.2",+ "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-11.1.2.tgz",+ "integrity": "sha512-Dh7l57ianaEoIpzbp0PC9UKAdCSVklD8E5Rpw7ETfbTl3FqcOOgq5q2LVDhgGCkaBv7p24JXikPdvhhmHvKMsw==",+ "license": "MIT",+ "dependencies": {+ "@types/hast": "^3.0.0",+ "@types/mdast": "^4.0.0",+ "mdast-util-to-hast": "^13.0.0",+ "unified": "^11.0.0",+ "vfile": "^6.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/remark-stringify": {+ "version": "11.0.0",+ "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-11.0.0.tgz",+ "integrity": "sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw==",+ "license": "MIT",+ "dependencies": {+ "@types/mdast": "^4.0.0",+ "mdast-util-to-markdown": "^2.0.0",+ "unified": "^11.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/resolve": {+ "version": "1.22.11",+ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz",+ "integrity": "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "is-core-module": "^2.16.1",+ "path-parse": "^1.0.7",+ "supports-preserve-symlinks-flag": "^1.0.0"+ },+ "bin": {+ "resolve": "bin/resolve"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/reusify": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz",+ "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "iojs": ">=1.0.0",+ "node": ">=0.10.0"+ }+ },+ "node_modules/rollup": {+ "version": "4.59.0",+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.59.0.tgz",+ "integrity": "sha512-2oMpl67a3zCH9H79LeMcbDhXW/UmWG/y2zuqnF2jQq5uq9TbM9TVyXvA4+t+ne2IIkBdrLpAaRQAvo7YI/Yyeg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/estree": "1.0.8"+ },+ "bin": {+ "rollup": "dist/bin/rollup"+ },+ "engines": {+ "node": ">=18.0.0",+ "npm": ">=8.0.0"+ },+ "optionalDependencies": {+ "@rollup/rollup-android-arm-eabi": "4.59.0",+ "@rollup/rollup-android-arm64": "4.59.0",+ "@rollup/rollup-darwin-arm64": "4.59.0",+ "@rollup/rollup-darwin-x64": "4.59.0",+ "@rollup/rollup-freebsd-arm64": "4.59.0",+ "@rollup/rollup-freebsd-x64": "4.59.0",+ "@rollup/rollup-linux-arm-gnueabihf": "4.59.0",+ "@rollup/rollup-linux-arm-musleabihf": "4.59.0",+ "@rollup/rollup-linux-arm64-gnu": "4.59.0",+ "@rollup/rollup-linux-arm64-musl": "4.59.0",+ "@rollup/rollup-linux-loong64-gnu": "4.59.0",+ "@rollup/rollup-linux-loong64-musl": "4.59.0",+ "@rollup/rollup-linux-ppc64-gnu": "4.59.0",+ "@rollup/rollup-linux-ppc64-musl": "4.59.0",+ "@rollup/rollup-linux-riscv64-gnu": "4.59.0",+ "@rollup/rollup-linux-riscv64-musl": "4.59.0",+ "@rollup/rollup-linux-s390x-gnu": "4.59.0",+ "@rollup/rollup-linux-x64-gnu": "4.59.0",+ "@rollup/rollup-linux-x64-musl": "4.59.0",+ "@rollup/rollup-openbsd-x64": "4.59.0",+ "@rollup/rollup-openharmony-arm64": "4.59.0",+ "@rollup/rollup-win32-arm64-msvc": "4.59.0",+ "@rollup/rollup-win32-ia32-msvc": "4.59.0",+ "@rollup/rollup-win32-x64-gnu": "4.59.0",+ "@rollup/rollup-win32-x64-msvc": "4.59.0",+ "fsevents": "~2.3.2"+ }+ },+ "node_modules/run-parallel": {+ "version": "1.2.0",+ "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",+ "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==",+ "dev": true,+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/feross"+ },+ {+ "type": "patreon",+ "url": "https://www.patreon.com/feross"+ },+ {+ "type": "consulting",+ "url": "https://feross.org/support"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "queue-microtask": "^1.2.2"+ }+ },+ "node_modules/scheduler": {+ "version": "0.27.0",+ "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz",+ "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==",+ "license": "MIT"+ },+ "node_modules/semver": {+ "version": "6.3.1",+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",+ "dev": true,+ "license": "ISC",+ "bin": {+ "semver": "bin/semver.js"+ }+ },+ "node_modules/set-cookie-parser": {+ "version": "2.7.2",+ "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.2.tgz",+ "integrity": "sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw==",+ "license": "MIT"+ },+ "node_modules/sonner": {+ "version": "2.0.7",+ "resolved": "https://registry.npmjs.org/sonner/-/sonner-2.0.7.tgz",+ "integrity": "sha512-W6ZN4p58k8aDKA4XPcx2hpIQXBRAgyiWVkYhT7CvK6D3iAu7xjvVyhQHg2/iaKJZ1XVJ4r7XuwGL+WGEK37i9w==",+ "license": "MIT",+ "peerDependencies": {+ "react": "^18.0.0 || ^19.0.0 || ^19.0.0-rc",+ "react-dom": "^18.0.0 || ^19.0.0 || ^19.0.0-rc"+ }+ },+ "node_modules/source-map-js": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",+ "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",+ "dev": true,+ "license": "BSD-3-Clause",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/space-separated-tokens": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz",+ "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==",+ "license": "MIT",+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/wooorm"+ }+ },+ "node_modules/stringify-entities": {+ "version": "4.0.4",+ "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.4.tgz",+ "integrity": "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==",+ "license": "MIT",+ "dependencies": {+ "character-entities-html4": "^2.0.0",+ "character-entities-legacy": "^3.0.0"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/wooorm"+ }+ },+ "node_modules/style-to-js": {+ "version": "1.1.21",+ "resolved": "https://registry.npmjs.org/style-to-js/-/style-to-js-1.1.21.tgz",+ "integrity": "sha512-RjQetxJrrUJLQPHbLku6U/ocGtzyjbJMP9lCNK7Ag0CNh690nSH8woqWH9u16nMjYBAok+i7JO1NP2pOy8IsPQ==",+ "license": "MIT",+ "dependencies": {+ "style-to-object": "1.0.14"+ }+ },+ "node_modules/style-to-object": {+ "version": "1.0.14",+ "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-1.0.14.tgz",+ "integrity": "sha512-LIN7rULI0jBscWQYaSswptyderlarFkjQ+t79nzty8tcIAceVomEVlLzH5VP4Cmsv6MtKhs7qaAiwlcp+Mgaxw==",+ "license": "MIT",+ "dependencies": {+ "inline-style-parser": "0.2.7"+ }+ },+ "node_modules/sucrase": {+ "version": "3.35.1",+ "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.1.tgz",+ "integrity": "sha512-DhuTmvZWux4H1UOnWMB3sk0sbaCVOoQZjv8u1rDoTV0HTdGem9hkAZtl4JZy8P2z4Bg0nT+YMeOFyVr4zcG5Tw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/gen-mapping": "^0.3.2",+ "commander": "^4.0.0",+ "lines-and-columns": "^1.1.6",+ "mz": "^2.7.0",+ "pirates": "^4.0.1",+ "tinyglobby": "^0.2.11",+ "ts-interface-checker": "^0.1.9"+ },+ "bin": {+ "sucrase": "bin/sucrase",+ "sucrase-node": "bin/sucrase-node"+ },+ "engines": {+ "node": ">=16 || 14 >=14.17"+ }+ },+ "node_modules/supports-preserve-symlinks-flag": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",+ "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/tailwind-merge": {+ "version": "2.6.1",+ "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-2.6.1.tgz",+ "integrity": "sha512-Oo6tHdpZsGpkKG88HJ8RR1rg/RdnEkQEfMoEk2x1XRI3F1AxeU+ijRXpiVUF4UbLfcxxRGw6TbUINKYdWVsQTQ==",+ "license": "MIT",+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/dcastil"+ }+ },+ "node_modules/tailwindcss": {+ "version": "3.4.19",+ "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.19.tgz",+ "integrity": "sha512-3ofp+LL8E+pK/JuPLPggVAIaEuhvIz4qNcf3nA1Xn2o/7fb7s/TYpHhwGDv1ZU3PkBluUVaF8PyCHcm48cKLWQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@alloc/quick-lru": "^5.2.0",+ "arg": "^5.0.2",+ "chokidar": "^3.6.0",+ "didyoumean": "^1.2.2",+ "dlv": "^1.1.3",+ "fast-glob": "^3.3.2",+ "glob-parent": "^6.0.2",+ "is-glob": "^4.0.3",+ "jiti": "^1.21.7",+ "lilconfig": "^3.1.3",+ "micromatch": "^4.0.8",+ "normalize-path": "^3.0.0",+ "object-hash": "^3.0.0",+ "picocolors": "^1.1.1",+ "postcss": "^8.4.47",+ "postcss-import": "^15.1.0",+ "postcss-js": "^4.0.1",+ "postcss-load-config": "^4.0.2 || ^5.0 || ^6.0",+ "postcss-nested": "^6.2.0",+ "postcss-selector-parser": "^6.1.2",+ "resolve": "^1.22.8",+ "sucrase": "^3.35.0"+ },+ "bin": {+ "tailwind": "lib/cli.js",+ "tailwindcss": "lib/cli.js"+ },+ "engines": {+ "node": ">=14.0.0"+ }+ },+ "node_modules/tailwindcss/node_modules/postcss-selector-parser": {+ "version": "6.1.2",+ "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz",+ "integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "cssesc": "^3.0.0",+ "util-deprecate": "^1.0.2"+ },+ "engines": {+ "node": ">=4"+ }+ },+ "node_modules/thenify": {+ "version": "3.3.1",+ "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz",+ "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "any-promise": "^1.0.0"+ }+ },+ "node_modules/thenify-all": {+ "version": "1.6.0",+ "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz",+ "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "thenify": ">= 3.1.0 < 4"+ },+ "engines": {+ "node": ">=0.8"+ }+ },+ "node_modules/tinyglobby": {+ "version": "0.2.15",+ "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz",+ "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "fdir": "^6.5.0",+ "picomatch": "^4.0.3"+ },+ "engines": {+ "node": ">=12.0.0"+ },+ "funding": {+ "url": "https://github.com/sponsors/SuperchupuDev"+ }+ },+ "node_modules/tinyglobby/node_modules/fdir": {+ "version": "6.5.0",+ "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",+ "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=12.0.0"+ },+ "peerDependencies": {+ "picomatch": "^3 || ^4"+ },+ "peerDependenciesMeta": {+ "picomatch": {+ "optional": true+ }+ }+ },+ "node_modules/tinyglobby/node_modules/picomatch": {+ "version": "4.0.3",+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz",+ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/sponsors/jonschlinkert"+ }+ },+ "node_modules/to-regex-range": {+ "version": "5.0.1",+ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",+ "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "is-number": "^7.0.0"+ },+ "engines": {+ "node": ">=8.0"+ }+ },+ "node_modules/trim-lines": {+ "version": "3.0.1",+ "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz",+ "integrity": "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==",+ "license": "MIT",+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/wooorm"+ }+ },+ "node_modules/trough": {+ "version": "2.2.0",+ "resolved": "https://registry.npmjs.org/trough/-/trough-2.2.0.tgz",+ "integrity": "sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==",+ "license": "MIT",+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/wooorm"+ }+ },+ "node_modules/ts-interface-checker": {+ "version": "0.1.13",+ "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz",+ "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==",+ "dev": true,+ "license": "Apache-2.0"+ },+ "node_modules/tslib": {+ "version": "2.3.0",+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz",+ "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==",+ "license": "0BSD"+ },+ "node_modules/typescript": {+ "version": "5.9.3",+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",+ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",+ "dev": true,+ "license": "Apache-2.0",+ "bin": {+ "tsc": "bin/tsc",+ "tsserver": "bin/tsserver"+ },+ "engines": {+ "node": ">=14.17"+ }+ },+ "node_modules/unified": {+ "version": "11.0.5",+ "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.5.tgz",+ "integrity": "sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==",+ "license": "MIT",+ "dependencies": {+ "@types/unist": "^3.0.0",+ "bail": "^2.0.0",+ "devlop": "^1.0.0",+ "extend": "^3.0.0",+ "is-plain-obj": "^4.0.0",+ "trough": "^2.0.0",+ "vfile": "^6.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/unist-util-find-after": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/unist-util-find-after/-/unist-util-find-after-5.0.0.tgz",+ "integrity": "sha512-amQa0Ep2m6hE2g72AugUItjbuM8X8cGQnFoHk0pGfrFeT9GZhzN5SW8nRsiGKK7Aif4CrACPENkA6P/Lw6fHGQ==",+ "license": "MIT",+ "dependencies": {+ "@types/unist": "^3.0.0",+ "unist-util-is": "^6.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/unist-util-is": {+ "version": "6.0.1",+ "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.1.tgz",+ "integrity": "sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g==",+ "license": "MIT",+ "dependencies": {+ "@types/unist": "^3.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/unist-util-position": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz",+ "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==",+ "license": "MIT",+ "dependencies": {+ "@types/unist": "^3.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/unist-util-stringify-position": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz",+ "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==",+ "license": "MIT",+ "dependencies": {+ "@types/unist": "^3.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/unist-util-visit": {+ "version": "5.1.0",+ "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.1.0.tgz",+ "integrity": "sha512-m+vIdyeCOpdr/QeQCu2EzxX/ohgS8KbnPDgFni4dQsfSCtpz8UqDyY5GjRru8PDKuYn7Fq19j1CQ+nJSsGKOzg==",+ "license": "MIT",+ "dependencies": {+ "@types/unist": "^3.0.0",+ "unist-util-is": "^6.0.0",+ "unist-util-visit-parents": "^6.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/unist-util-visit-parents": {+ "version": "6.0.2",+ "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.2.tgz",+ "integrity": "sha512-goh1s1TBrqSqukSc8wrjwWhL0hiJxgA8m4kFxGlQ+8FYQ3C/m11FcTs4YYem7V664AhHVvgoQLk890Ssdsr2IQ==",+ "license": "MIT",+ "dependencies": {+ "@types/unist": "^3.0.0",+ "unist-util-is": "^6.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/update-browserslist-db": {+ "version": "1.2.3",+ "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz",+ "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==",+ "dev": true,+ "funding": [+ {+ "type": "opencollective",+ "url": "https://opencollective.com/browserslist"+ },+ {+ "type": "tidelift",+ "url": "https://tidelift.com/funding/github/npm/browserslist"+ },+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "escalade": "^3.2.0",+ "picocolors": "^1.1.1"+ },+ "bin": {+ "update-browserslist-db": "cli.js"+ },+ "peerDependencies": {+ "browserslist": ">= 4.21.0"+ }+ },+ "node_modules/util-deprecate": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",+ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/vfile": {+ "version": "6.0.3",+ "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz",+ "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==",+ "license": "MIT",+ "dependencies": {+ "@types/unist": "^3.0.0",+ "vfile-message": "^4.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/vfile-message": {+ "version": "4.0.3",+ "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.3.tgz",+ "integrity": "sha512-QTHzsGd1EhbZs4AsQ20JX1rC3cOlt/IWJruk893DfLRr57lcnOeMaWG4K0JrRta4mIJZKth2Au3mM3u03/JWKw==",+ "license": "MIT",+ "dependencies": {+ "@types/unist": "^3.0.0",+ "unist-util-stringify-position": "^4.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/unified"+ }+ },+ "node_modules/vite": {+ "version": "6.4.1",+ "resolved": "https://registry.npmjs.org/vite/-/vite-6.4.1.tgz",+ "integrity": "sha512-+Oxm7q9hDoLMyJOYfUYBuHQo+dkAloi33apOPP56pzj+vsdJDzr+j1NISE5pyaAuKL4A3UD34qd0lx5+kfKp2g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "esbuild": "^0.25.0",+ "fdir": "^6.4.4",+ "picomatch": "^4.0.2",+ "postcss": "^8.5.3",+ "rollup": "^4.34.9",+ "tinyglobby": "^0.2.13"+ },+ "bin": {+ "vite": "bin/vite.js"+ },+ "engines": {+ "node": "^18.0.0 || ^20.0.0 || >=22.0.0"+ },+ "funding": {+ "url": "https://github.com/vitejs/vite?sponsor=1"+ },+ "optionalDependencies": {+ "fsevents": "~2.3.3"+ },+ "peerDependencies": {+ "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0",+ "jiti": ">=1.21.0",+ "less": "*",+ "lightningcss": "^1.21.0",+ "sass": "*",+ "sass-embedded": "*",+ "stylus": "*",+ "sugarss": "*",+ "terser": "^5.16.0",+ "tsx": "^4.8.1",+ "yaml": "^2.4.2"+ },+ "peerDependenciesMeta": {+ "@types/node": {+ "optional": true+ },+ "jiti": {+ "optional": true+ },+ "less": {+ "optional": true+ },+ "lightningcss": {+ "optional": true+ },+ "sass": {+ "optional": true+ },+ "sass-embedded": {+ "optional": true+ },+ "stylus": {+ "optional": true+ },+ "sugarss": {+ "optional": true+ },+ "terser": {+ "optional": true+ },+ "tsx": {+ "optional": true+ },+ "yaml": {+ "optional": true+ }+ }+ },+ "node_modules/vite/node_modules/fdir": {+ "version": "6.5.0",+ "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",+ "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=12.0.0"+ },+ "peerDependencies": {+ "picomatch": "^3 || ^4"+ },+ "peerDependenciesMeta": {+ "picomatch": {+ "optional": true+ }+ }+ },+ "node_modules/vite/node_modules/picomatch": {+ "version": "4.0.3",+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz",+ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/sponsors/jonschlinkert"+ }+ },+ "node_modules/yallist": {+ "version": "3.1.1",+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",+ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/zrender": {+ "version": "6.0.0",+ "resolved": "https://registry.npmjs.org/zrender/-/zrender-6.0.0.tgz",+ "integrity": "sha512-41dFXEEXuJpNecuUQq6JlbybmnHaqqpGlbH1yxnA5V9MMP4SbohSVZsJIwz+zdjQXSSlR1Vc34EgH1zxyTDvhg==",+ "license": "BSD-3-Clause",+ "dependencies": {+ "tslib": "2.3.0"+ }+ },+ "node_modules/zustand": {+ "version": "5.0.12",+ "resolved": "https://registry.npmjs.org/zustand/-/zustand-5.0.12.tgz",+ "integrity": "sha512-i77ae3aZq4dhMlRhJVCYgMLKuSiZAaUPAct2AksxQ+gOtimhGMdXljRT21P5BNpeT4kXlLIckvkPM029OljD7g==",+ "license": "MIT",+ "engines": {+ "node": ">=12.20.0"+ },+ "peerDependencies": {+ "@types/react": ">=18.0.0",+ "immer": ">=9.0.6",+ "react": ">=18.0.0",+ "use-sync-external-store": ">=1.2.0"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ },+ "immer": {+ "optional": true+ },+ "react": {+ "optional": true+ },+ "use-sync-external-store": {+ "optional": true+ }+ }+ },+ "node_modules/zwitch": {+ "version": "2.0.4",+ "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz",+ "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==",+ "license": "MIT",+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/wooorm"+ }+ }+ }+}diff --git a/frontend/package.json b/frontend/package.jsonnew file mode 100644index 000000000..9239d3e59--- /dev/null+++ b/frontend/package.json@@ -0,0 +1,36 @@+{+ "name": "vibe-trading-frontend",+ "private": true,+ "version": "0.1.0",+ "type": "module",+ "scripts": {+ "dev": "vite",+ "build": "tsc -b && vite build",+ "preview": "vite preview"+ },+ "dependencies": {+ "clsx": "^2.1.0",+ "echarts": "^6.0.0",+ "lucide-react": "^0.460.0",+ "react": "^19.0.0",+ "react-dom": "^19.0.0",+ "react-markdown": "^9.0.0",+ "react-router-dom": "^7.1.0",+ "rehype-highlight": "^7.0.0",+ "remark-gfm": "^4.0.1",+ "sonner": "^2.0.7",+ "tailwind-merge": "^2.6.0",+ "zustand": "^5.0.0"+ },+ "devDependencies": {+ "@tailwindcss/typography": "^0.5.0",+ "@types/react": "^19.0.0",+ "@types/react-dom": "^19.0.0",+ "@vitejs/plugin-react": "^4.3.0",+ "autoprefixer": "^10.4.0",+ "postcss": "^8.4.0",+ "tailwindcss": "^3.4.0",+ "typescript": "^5.7.0",+ "vite": "^6.0.0"+ }+}diff --git a/frontend/postcss.config.js b/frontend/postcss.config.jsnew file mode 100644index 000000000..2aa7205d4--- /dev/null+++ b/frontend/postcss.config.js@@ -0,0 +1,6 @@+export default {+ plugins: {+ tailwindcss: {},+ autoprefixer: {},+ },+};diff --git a/frontend/public/favicon.svg b/frontend/public/favicon.svgnew file mode 100644index 000000000..1c3b507ff--- /dev/null+++ b/frontend/public/favicon.svg@@ -0,0 +1,8 @@+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="none">+ <rect width="32" height="32" rx="6" fill="#1a365d"/>+ <!-- V -->+ <path d="M6 8 L11 24 L16 8" stroke="#22d3ee" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" fill="none"/>+ <!-- T -->+ <line x1="18" y1="8" x2="28" y2="8" stroke="#f1f5f9" stroke-width="3" stroke-linecap="round"/>+ <line x1="23" y1="8" x2="23" y2="24" stroke="#f1f5f9" stroke-width="3" stroke-linecap="round"/>+</svg>diff --git a/frontend/public/logo.svg b/frontend/public/logo.svgnew file mode 100644index 000000000..e68582e8b--- /dev/null+++ b/frontend/public/logo.svg@@ -0,0 +1,25 @@+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 360 48" fill="none">+ <!-- P mark: stylized from grid/network nodes -->+ <g>+ <!-- Vertical stem of P -->+ <rect x="4" y="4" width="6" height="40" rx="3" fill="#1a365d"/>+ <!-- P bowl: arc of connected nodes -->+ <circle cx="14" cy="10" r="2.5" fill="#0891b2"/>+ <circle cx="24" cy="6" r="2.5" fill="#0891b2"/>+ <circle cx="34" cy="8" r="2.5" fill="#0891b2"/>+ <circle cx="38" cy="16" r="2.5" fill="#0891b2"/>+ <circle cx="34" cy="24" r="2.5" fill="#0891b2"/>+ <circle cx="24" cy="26" r="2.5" fill="#0891b2"/>+ <circle cx="14" cy="24" r="2.5" fill="#0891b2"/>+ <!-- Node connections forming the P bowl -->+ <path d="M14 10 L24 6 L34 8 L38 16 L34 24 L24 26 L14 24" stroke="#0891b2" stroke-width="1.5" fill="none" stroke-linejoin="round"/>+ <!-- Internal data grid lines -->+ <line x1="24" y1="6" x2="24" y2="26" stroke="#22d3ee" stroke-width="0.8" opacity="0.5"/>+ <line x1="14" y1="16" x2="38" y2="16" stroke="#22d3ee" stroke-width="0.8" opacity="0.5"/>+ <!-- Corner accent node -->+ <circle cx="24" cy="16" r="1.8" fill="#22d3ee"/>+ </g>+ <!-- Wordmark -->+ <text x="52" y="34" font-family="Inter, system-ui, sans-serif" font-weight="700" font-size="22" fill="#1a365d" letter-spacing="-0.4">FIN-</text>+ <text x="103" y="34" font-family="Inter, system-ui, sans-serif" font-weight="700" font-size="22" fill="#0891b2" letter-spacing="-0.4">ANYTHING</text>+</svg>diff --git a/frontend/src/components/charts/CandlestickChart.tsx b/frontend/src/components/charts/CandlestickChart.tsxnew file mode 100644index 000000000..2a67a58e0--- /dev/null+++ b/frontend/src/components/charts/CandlestickChart.tsx@@ -0,0 +1,315 @@+import { useEffect, useRef, useState, useMemo, useCallback } from "react";+import { cn } from "@/lib/utils";+import { ChevronDown } from "lucide-react";+import type { PriceBar, TradeMarker, IndicatorPoint } from "@/lib/api";+import { calcMA, calcBOLL, calcMACD, calcRSI, calcKDJ, calcEMA } from "@/lib/indicators";+import { getChartTheme } from "@/lib/chart-theme";+import { abbreviateNum } from "@/lib/formatters";+import { echarts, CHART_GROUP, connectCharts } from "@/lib/echarts";+import { useDarkMode } from "@/hooks/useDarkMode";++type Sub = "vol" | "macd" | "rsi" | "kdj";+type Range = "1M" | "3M" | "6M" | "1Y" | "ALL";+type Overlay = "ma5" | "ma10" | "ma20" | "ma60" | "ema12" | "ema26" | "boll";++const OVERLAY_OPTIONS: { id: Overlay; label: string; group: string }[] = [+ { id: "ma5", label: "MA5", group: "MA" },+ { id: "ma10", label: "MA10", group: "MA" },+ { id: "ma20", label: "MA20", group: "MA" },+ { id: "ma60", label: "MA60", group: "MA" },+ { id: "ema12", label: "EMA12", group: "MA" },+ { id: "ema26", label: "EMA26", group: "MA" },+ { id: "boll", label: "BOLL", group: "Channel" },+];++const RANGE_BARS: Record<Range, number> = { "1M": 22, "3M": 63, "6M": 126, "1Y": 252, ALL: Infinity };+const OVERLAY_COLORS = ["#f59e0b", "#8b5cf6", "#3b82f6", "#ec4899", "#10b981", "#f97316", "#6366f1"];++interface Props {+ data: PriceBar[];+ markers?: TradeMarker[];+ indicators?: Record<string, IndicatorPoint[]>;+ height?: number;+}++export function CandlestickChart({ data, markers, indicators, height = 500 }: Props) {+ const containerRef = useRef<HTMLDivElement>(null);+ const chartRef = useRef<ReturnType<typeof echarts.init> | null>(null);+ const [sub, setSub] = useState<Sub>("vol");+ const [range, setRange] = useState<Range>("ALL");+ const [overlays, setOverlays] = useState<Set<Overlay>>(new Set(["ma5", "ma20"]));+ const [showMenu, setShowMenu] = useState(false);+ const { dark } = useDarkMode();++ const toggleOverlay = useCallback((id: Overlay) => {+ setOverlays(prev => {+ const next = new Set(prev);+ if (next.has(id)) next.delete(id); else next.add(id);+ return next;+ });+ }, []);++ // Memoize base data arrays โ only recompute when raw data changes+ const baseData = useMemo(() => {+ const dates = data.map(d => d.time);+ const closes = data.map(d => d.close);+ const highs = data.map(d => d.high);+ const lows = data.map(d => d.low);+ const opens = data.map(d => d.open);+ const candle = data.map(d => [d.open, d.close, d.low, d.high]);+ return { dates, closes, highs, lows, opens, candle };+ }, [data]);++ // Memoize indicator calculations โ only recompute when data changes (not on overlay toggle)+ const indicatorCache = useMemo(() => ({+ ma5: calcMA(baseData.closes, 5),+ ma10: calcMA(baseData.closes, 10),+ ma20: calcMA(baseData.closes, 20),+ ma60: calcMA(baseData.closes, 60),+ ema12: calcEMA(baseData.closes, 12),+ ema26: calcEMA(baseData.closes, 26),+ boll: calcBOLL(baseData.closes, 20, 2),+ macd: calcMACD(baseData.closes),+ rsi: calcRSI(baseData.closes),+ kdj: calcKDJ(baseData.highs, baseData.lows, baseData.closes),+ }), [baseData]);++ // Memoize backend indicator series with Map lookup (O(1) instead of O(n) find)+ const extraIndicators = useMemo(() => {+ if (!indicators) return [];+ return Object.entries(indicators).map(([name, points]) => {+ const lookup = new Map(points.map(p => [p.time, p.value]));+ return { name: name.toUpperCase(), values: baseData.dates.map(d => lookup.get(d) ?? null) };+ });+ }, [indicators, baseData.dates]);++ // Init chart instance โ only on mount/unmount and dark mode change+ useEffect(() => {+ if (!containerRef.current || data.length === 0) return;+ const chart = echarts.init(containerRef.current);+ chart.group = CHART_GROUP;+ connectCharts();+ chartRef.current = chart;++ const ro = new ResizeObserver(() => chart.resize());+ ro.observe(containerRef.current);+ return () => { ro.disconnect(); chart.dispose(); chartRef.current = null; };+ }, [data.length === 0, dark]); // only re-init when going emptyโnon-empty or theme changes++ // Update chart options โ setOption on existing instance, no dispose+ useEffect(() => {+ const chart = chartRef.current;+ if (!chart || data.length === 0) return;++ const t = getChartTheme();+ const { dates, closes, opens, candle } = baseData;++ // Overlay series+ // eslint-disable-next-line @typescript-eslint/no-explicit-any+ const overlaySeries: any[] = [];+ const legendNames: string[] = ["K"];+ let colorIdx = 0;++ const overlayMap: Record<string, { name: string; data: (number | null)[] }> = {+ ma5: { name: "MA5", data: indicatorCache.ma5 },+ ma10: { name: "MA10", data: indicatorCache.ma10 },+ ma20: { name: "MA20", data: indicatorCache.ma20 },+ ma60: { name: "MA60", data: indicatorCache.ma60 },+ ema12: { name: "EMA12", data: indicatorCache.ema12 },+ ema26: { name: "EMA26", data: indicatorCache.ema26 },+ };++ for (const [key, { name, data: lineData }] of Object.entries(overlayMap)) {+ if (overlays.has(key as Overlay)) {+ overlaySeries.push({ name, type: "line", data: lineData, xAxisIndex: 0, yAxisIndex: 0, symbol: "none", lineStyle: { color: OVERLAY_COLORS[colorIdx], width: 1 } });+ legendNames.push(name);+ colorIdx++;+ }+ }++ if (overlays.has("boll")) {+ const boll = indicatorCache.boll;+ overlaySeries.push(+ { name: "BOLL+", type: "line", data: boll.upper, xAxisIndex: 0, yAxisIndex: 0, symbol: "none", lineStyle: { color: t.bollColor, width: 0.8, type: "dashed" } },+ { name: "BOLL", type: "line", data: boll.mid, xAxisIndex: 0, yAxisIndex: 0, symbol: "none", lineStyle: { color: t.bollColor, width: 1 } },+ { name: "BOLL-", type: "line", data: boll.lower, xAxisIndex: 0, yAxisIndex: 0, symbol: "none", lineStyle: { color: t.bollColor, width: 0.8, type: "dashed" } },+ );+ legendNames.push("BOLL");+ }++ // Trade markers+ const marks = (markers || []).map(m => ({+ coord: [m.time, m.price],+ value: m.side === "BUY" ? "B" : "S",+ name: [`${m.side} @ ${m.price}`, m.qty ? `Qty: ${m.qty}` : "", m.reason || ""].filter(Boolean).join("\n"),+ itemStyle: { color: m.side === "BUY" ? t.upColor : t.downColor },+ label: { color: "#fff", fontSize: 10, fontWeight: "bold" as const },+ }));++ // Volume+ const vol = data.map((d, i) => ({+ value: d.volume,+ itemStyle: { color: closes[i] >= opens[i] ? t.volumeUp : t.volumeDown },+ }));++ // Sub-chart+ // eslint-disable-next-line @typescript-eslint/no-explicit-any+ let subSeries: any[] = [];+ // eslint-disable-next-line @typescript-eslint/no-explicit-any+ let subYAxis: any = { scale: true, gridIndex: 1, splitLine: { lineStyle: { color: t.gridColor } }, axisLabel: { color: t.textColor, fontSize: 10 } };++ if (sub === "vol") {+ subSeries = [{ name: "Vol", type: "bar", data: vol, xAxisIndex: 1, yAxisIndex: 1 }];+ subYAxis = { ...subYAxis, axisLabel: { ...subYAxis.axisLabel, formatter: (v: number) => abbreviateNum(v) } };+ legendNames.push("Vol");+ } else if (sub === "macd") {+ const m = indicatorCache.macd;+ subSeries = [+ { name: "DIF", type: "line", data: m.dif, xAxisIndex: 1, yAxisIndex: 1, symbol: "none", lineStyle: { width: 1, color: t.infoColor } },+ { name: "DEA", type: "line", data: m.signal, xAxisIndex: 1, yAxisIndex: 1, symbol: "none", lineStyle: { width: 1, color: t.warningColor } },+ { name: "MACD", type: "bar", data: m.histogram.map(v => ({ value: v ?? 0, itemStyle: { color: (v ?? 0) >= 0 ? t.upColor : t.downColor } })), xAxisIndex: 1, yAxisIndex: 1 },+ ];+ legendNames.push("DIF", "DEA", "MACD");+ } else if (sub === "rsi") {+ subSeries = [{ name: "RSI", type: "line", data: indicatorCache.rsi, xAxisIndex: 1, yAxisIndex: 1, symbol: "none", lineStyle: { width: 1.5, color: t.infoColor } }];+ subYAxis = { ...subYAxis, min: 0, max: 100 };+ legendNames.push("RSI");+ } else {+ const kdj = indicatorCache.kdj;+ subSeries = [+ { name: "%K", type: "line", data: kdj.k, xAxisIndex: 1, yAxisIndex: 1, symbol: "none", lineStyle: { width: 1, color: t.infoColor } },+ { name: "%D", type: "line", data: kdj.d, xAxisIndex: 1, yAxisIndex: 1, symbol: "none", lineStyle: { width: 1, color: t.warningColor } },+ { name: "%J", type: "line", data: kdj.j, xAxisIndex: 1, yAxisIndex: 1, symbol: "none", lineStyle: { width: 1, color: "#a855f7" } },+ ];+ legendNames.push("%K", "%D", "%J");+ }++ // Backend custom indicators (Map-based O(1) lookup)+ const extraSeries = extraIndicators.map((ind, i) => {+ legendNames.push(ind.name);+ return { name: ind.name, type: "line" as const, data: ind.values, xAxisIndex: 0, yAxisIndex: 0, symbol: "none", lineStyle: { width: 1, color: OVERLAY_COLORS[(colorIdx + i) % OVERLAY_COLORS.length], type: "dashed" as const } };+ });++ const maxBars = RANGE_BARS[range];+ const defaultStart = maxBars >= data.length ? 0 : Math.max(0, 100 - (maxBars / data.length) * 100);++ chart.setOption({+ backgroundColor: "transparent",+ tooltip: {+ trigger: "axis", axisPointer: { type: "cross" },+ backgroundColor: t.tooltipBg, borderColor: t.tooltipBorder,+ textStyle: { color: t.tooltipText, fontSize: 11 },+ // eslint-disable-next-line @typescript-eslint/no-explicit-any+ formatter: (params: any) => {+ if (!Array.isArray(params) || !params.length) return "";+ let html = `<b>${params[0].axisValue}</b>`;+ for (const p of params) {+ if (p.seriesName === "K" && Array.isArray(p.value)) {+ const [open, close, low, high] = p.value;+ const chg = close - open;+ const pct = open ? ((chg / open) * 100).toFixed(2) : "0.00";+ const clr = chg >= 0 ? t.upColor : t.downColor;+ html += `<br/>O: ${open.toFixed(2)} H: ${high.toFixed(2)}`;+ html += `<br/>L: ${low.toFixed(2)} C: <span style="color:${clr}"><b>${close.toFixed(2)}</b> ${chg >= 0 ? "+" : ""}${chg.toFixed(2)} (${chg >= 0 ? "+" : ""}${pct}%)</span>`;+ } else if (p.seriesName === "Vol") {+ html += `<br/>Vol: ${abbreviateNum(Number(p.value))}`;+ } else if (p.value != null) {+ html += `<br/>${p.marker} ${p.seriesName}: ${Number(p.value).toFixed(2)}`;+ }+ }+ return html;+ },+ },+ toolbox: {+ feature: { saveAsImage: { title: "Save" }, dataZoom: { title: { zoom: "Zoom", back: "Reset" } }, restore: { title: "Reset" } },+ right: 8, top: 0, iconStyle: { borderColor: t.textColor },+ },+ legend: { data: legendNames, textStyle: { color: t.textColor, fontSize: 10 }, right: 80, top: 2, type: "scroll", itemWidth: 12, itemHeight: 8, itemGap: 8 },+ grid: [+ { left: 8, right: 8, top: 36, height: "55%", containLabel: true },+ { left: 8, right: 8, top: "66%", height: "22%", containLabel: true },+ ],+ xAxis: [+ { type: "category", data: dates, gridIndex: 0, axisLine: { lineStyle: { color: t.axisColor } }, axisLabel: { color: t.textColor, fontSize: 10 }, boundaryGap: true },+ { type: "category", data: dates, gridIndex: 1, axisLine: { lineStyle: { color: t.axisColor } }, axisLabel: { show: false }, boundaryGap: true },+ ],+ yAxis: [+ { scale: true, gridIndex: 0, splitLine: { lineStyle: { color: t.gridColor } }, axisLabel: { color: t.textColor, fontSize: 10 } },+ subYAxis,+ ],+ dataZoom: [+ { type: "inside", xAxisIndex: [0, 1], start: defaultStart, end: 100 },+ { type: "slider", xAxisIndex: [0, 1], bottom: 4, height: 20, labelFormatter: (val: string) => val },+ ],+ series: [+ {+ name: "K", type: "candlestick", data: candle, xAxisIndex: 0, yAxisIndex: 0,+ itemStyle: { color: t.upColor, color0: t.downColor, borderColor: t.upColor, borderColor0: t.downColor },+ markPoint: marks.length > 0 ? { data: marks, symbolSize: 28, tooltip: { formatter: (p: { name?: string; value?: string }) => p.name || p.value || "" } } : undefined,+ },+ ...overlaySeries,+ ...extraSeries,+ ...subSeries,+ ],+ }, true);+ }, [data, markers, baseData, indicatorCache, extraIndicators, sub, range, overlays, dark]);++ if (data.length === 0) {+ return <div className="text-muted-foreground text-sm p-4">No price data</div>;+ }++ return (+ <div>+ <div className="flex items-center gap-2 mb-1 flex-wrap">+ {/* Time range */}+ <div className="flex gap-0.5">+ {(["1M", "3M", "6M", "1Y", "ALL"] as const).map((r) => (+ <button key={r} onClick={() => setRange(r)} className={cn("px-1.5 py-0.5 rounded text-[10px] font-mono transition-colors", range === r ? "bg-primary/15 text-primary font-medium" : "text-muted-foreground/50 hover:text-muted-foreground")}>{r}</button>+ ))}+ </div>++ <div className="w-px h-3 bg-border/40" />++ {/* Indicator dropdown */}+ <div className="relative">+ <button+ onClick={() => setShowMenu(!showMenu)}+ className="flex items-center gap-1 px-2 py-0.5 rounded text-[10px] text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors"+ >+ Indicators ({overlays.size}) <ChevronDown className="h-3 w-3" />+ </button>+ {showMenu && (+ <div className="absolute top-full left-0 mt-1 z-50 bg-card border rounded-lg shadow-lg p-2 min-w-[160px]" onMouseLeave={() => setShowMenu(false)}>+ {["MA", "Channel"].map(group => (+ <div key={group}>+ <p className="text-[9px] text-muted-foreground/50 uppercase tracking-wider px-1 pt-1">{group}</p>+ {OVERLAY_OPTIONS.filter(o => o.group === group).map(o => (+ <label key={o.id} className="flex items-center gap-2 px-1 py-0.5 rounded hover:bg-muted/30 cursor-pointer">+ <input type="checkbox" checked={overlays.has(o.id)} onChange={() => toggleOverlay(o.id)} className="h-3 w-3 rounded accent-primary" />+ <span className="text-xs">{o.label}</span>+ </label>+ ))}+ </div>+ ))}+ <div className="border-t mt-1 pt-1">+ <button onClick={() => { setOverlays(new Set()); setShowMenu(false); }} className="text-[10px] text-muted-foreground hover:text-foreground px-1 py-0.5 w-full text-left rounded hover:bg-muted/30">+ Bare K (clear all)+ </button>+ </div>+ </div>+ )}+ </div>++ <div className="w-px h-3 bg-border/40" />++ {/* Sub-chart selector */}+ <div className="flex gap-0.5">+ {(["vol", "macd", "rsi", "kdj"] as const).map((id) => (+ <button key={id} onClick={() => setSub(id)} className={cn("px-1.5 py-0.5 rounded text-[10px] font-mono uppercase transition-colors", sub === id ? "bg-primary/15 text-primary font-medium" : "text-muted-foreground/50 hover:text-muted-foreground")}>{id}</button>+ ))}+ </div>+ </div>+ <div ref={containerRef} style={{ height }} />+ </div>+ );+}diff --git a/frontend/src/components/charts/EquityChart.tsx b/frontend/src/components/charts/EquityChart.tsxnew file mode 100644index 000000000..6d05ae606--- /dev/null+++ b/frontend/src/components/charts/EquityChart.tsx@@ -0,0 +1,112 @@+import { useEffect, useRef } from "react";+import type { EquityPoint } from "@/lib/api";+import { getChartTheme } from "@/lib/chart-theme";+import { abbreviateNum } from "@/lib/formatters";+import { echarts, CHART_GROUP, connectCharts } from "@/lib/echarts";+import { useDarkMode } from "@/hooks/useDarkMode";++interface Props {+ data: EquityPoint[];+ height?: number;+}++export function EquityChart({ data, height = 300 }: Props) {+ const ref = useRef<HTMLDivElement>(null);+ const { dark } = useDarkMode();++ useEffect(() => {+ if (!ref.current || data.length === 0) return;+ const t = getChartTheme();+ const chart = echarts.init(ref.current);+ chart.group = CHART_GROUP;+ connectCharts();++ const dates = data.map((d) => d.time);+ const equity = data.map((d) => Number(d.equity));+ const drawdown = data.map((d) => (Number(d.drawdown) * 100).toFixed(2));+ const minDD = Math.min(...drawdown.map(Number));++ chart.setOption({+ backgroundColor: "transparent",+ tooltip: {+ trigger: "axis",+ axisPointer: { type: "cross" },+ backgroundColor: t.tooltipBg,+ borderColor: t.tooltipBorder,+ textStyle: { color: t.tooltipText, fontSize: 11 },+ // eslint-disable-next-line @typescript-eslint/no-explicit-any+ formatter: (params: any) => {+ if (!Array.isArray(params) || !params.length) return "";+ let html = `<b>${params[0].axisValue}</b>`;+ for (const p of params) {+ const val = p.seriesName === "Drawdown%"+ ? `${p.value}%`+ : Number(p.value).toLocaleString();+ html += `<br/>${p.marker} ${p.seriesName}: <b>${val}</b>`;+ }+ return html;+ },+ },+ toolbox: {+ feature: {+ saveAsImage: { title: "Save" },+ restore: { title: "Reset" },+ },+ right: 8, top: 0,+ iconStyle: { borderColor: t.textColor },+ },+ legend: { data: ["Equity", "Drawdown%"], textStyle: { color: t.textColor, fontSize: 11 }, right: 60, top: 4 },+ grid: [+ { left: 8, right: 8, top: 36, height: "56%", containLabel: true },+ { left: 8, right: 8, top: "68%", height: "20%", containLabel: true },+ ],+ xAxis: [+ { type: "category", data: dates, gridIndex: 0, axisLine: { lineStyle: { color: t.axisColor } }, axisLabel: { color: t.textColor, fontSize: 10 } },+ { type: "category", data: dates, gridIndex: 1, axisLine: { lineStyle: { color: t.axisColor } }, axisLabel: { show: false } },+ ],+ yAxis: [+ {+ type: "value", gridIndex: 0,+ splitLine: { lineStyle: { color: t.gridColor } },+ axisLabel: { color: t.textColor, fontSize: 10, formatter: (v: number) => abbreviateNum(v) },+ },+ {+ type: "value", gridIndex: 1,+ splitLine: { lineStyle: { color: t.gridColor } },+ axisLabel: { color: t.textColor, fontSize: 10, formatter: "{value}%" },+ },+ ],+ dataZoom: [{ type: "inside", xAxisIndex: [0, 1] }],+ series: [+ {+ name: "Equity", type: "line", xAxisIndex: 0, yAxisIndex: 0,+ data: equity, smooth: false, symbol: "none",+ lineStyle: { color: t.infoColor, width: 2 },+ areaStyle: {+ color: { type: "linear", x: 0, y: 0, x2: 0, y2: 1, colorStops: [{ offset: 0, color: t.infoColor + "40" }, { offset: 1, color: t.infoColor + "00" }] },+ },+ },+ {+ name: "Drawdown%", type: "line", xAxisIndex: 1, yAxisIndex: 1,+ data: drawdown, smooth: false, symbol: "none",+ lineStyle: { color: t.downColor, width: 1 },+ areaStyle: { color: t.downColor + "25" },+ markLine: {+ silent: true, symbol: "none",+ data: [{ yAxis: minDD, label: { formatter: `Max DD: ${minDD}%`, position: "insideEndTop", fontSize: 10, color: t.downColor } }],+ lineStyle: { color: t.downColor, type: "dashed", width: 1 },+ },+ },+ ],+ });++ const ro = new ResizeObserver(() => chart.resize());+ ro.observe(ref.current!);+ return () => { ro.disconnect(); chart.dispose(); };+ }, [data, dark]);++ if (data.length === 0) {+ return <div className="text-muted-foreground text-sm p-4">No equity data</div>;+ }+ return <div ref={ref} style={{ height }} />;+}diff --git a/frontend/src/components/charts/MiniEquityChart.tsx b/frontend/src/components/charts/MiniEquityChart.tsxnew file mode 100644index 000000000..3a20fb9b8--- /dev/null+++ b/frontend/src/components/charts/MiniEquityChart.tsx@@ -0,0 +1,47 @@+import { useEffect, useRef } from "react";+import { echarts } from "@/lib/echarts";+import { getChartTheme } from "@/lib/chart-theme";+import { useDarkMode } from "@/hooks/useDarkMode";++interface Props {+ data: Array<{ time: string; equity: number | string }>;+ height?: number;+}++export function MiniEquityChart({ data, height = 80 }: Props) {+ const ref = useRef<HTMLDivElement>(null);+ const { dark } = useDarkMode();++ useEffect(() => {+ if (!ref.current || data.length < 2) return;+ const t = getChartTheme();+ const chart = echarts.init(ref.current);++ const values = data.map(d => Number(d.equity));+ const positive = values[values.length - 1] >= values[0];+ const color = positive ? t.upColor : t.downColor;++ chart.setOption({+ backgroundColor: "transparent",+ grid: { left: 0, right: 0, top: 0, bottom: 0 },+ xAxis: { type: "category", data: data.map(d => d.time), show: false },+ yAxis: { type: "value", show: false, scale: true },+ series: [{+ type: "line", data: values, symbol: "none", smooth: true,+ lineStyle: { color, width: 1.5 },+ areaStyle: {+ color: { type: "linear", x: 0, y: 0, x2: 0, y2: 1,+ colorStops: [{ offset: 0, color: color + "30" }, { offset: 1, color: color + "05" }],+ },+ },+ }],+ });++ const ro = new ResizeObserver(() => chart.resize());+ ro.observe(ref.current);+ return () => { ro.disconnect(); chart.dispose(); };+ }, [data, dark]);++ if (data.length < 2) return null;+ return <div ref={ref} style={{ height }} className="rounded-lg overflow-hidden" />;+}diff --git a/frontend/src/components/chat/AgentAvatar.tsx b/frontend/src/components/chat/AgentAvatar.tsxnew file mode 100644index 000000000..fb07e8139--- /dev/null+++ b/frontend/src/components/chat/AgentAvatar.tsx@@ -0,0 +1,7 @@+export function AgentAvatar() {+ return (+ <div className="h-8 w-8 rounded-lg bg-gradient-to-br from-[#1a365d] to-[#0891b2] flex items-center justify-center text-white text-xs font-bold shrink-0 mt-0.5 select-none">+ P+ </div>+ );+}diff --git a/frontend/src/components/chat/ConversationTimeline.tsx b/frontend/src/components/chat/ConversationTimeline.tsxnew file mode 100644index 000000000..076d26457--- /dev/null+++ b/frontend/src/components/chat/ConversationTimeline.tsx@@ -0,0 +1,67 @@+import { memo, useEffect, useState, useCallback } from "react";+import { cn } from "@/lib/utils";+import type { AgentMessage } from "@/types/agent";++interface Props {+ messages: AgentMessage[];+ containerRef: React.RefObject<HTMLDivElement | null>;+}++export const ConversationTimeline = memo(function ConversationTimeline({ messages, containerRef }: Props) {+ const [activeIdx, setActiveIdx] = useState(-1);++ const userIndices = messages+ .map((m, i) => m.type === "user" ? i : -1)+ .filter(i => i >= 0);++ useEffect(() => {+ const container = containerRef.current;+ if (!container || userIndices.length === 0) return;++ const onScroll = () => {+ const rect = container.getBoundingClientRect();+ const mid = rect.top + rect.height / 2;+ let closest = userIndices[0];+ let minDist = Infinity;+ for (const idx of userIndices) {+ const el = container.querySelector(`[data-msg-idx="${idx}"]`);+ if (!el) continue;+ const elRect = el.getBoundingClientRect();+ const dist = Math.abs(elRect.top - mid);+ if (dist < minDist) { minDist = dist; closest = idx; }+ }+ setActiveIdx(closest);+ };++ container.addEventListener("scroll", onScroll, { passive: true });+ onScroll();+ return () => container.removeEventListener("scroll", onScroll);+ }, [containerRef, userIndices]);++ const scrollTo = useCallback((idx: number) => {+ const container = containerRef.current;+ if (!container) return;+ const el = container.querySelector(`[data-msg-idx="${idx}"]`);+ if (el) el.scrollIntoView({ behavior: "smooth", block: "center" });+ }, [containerRef]);++ if (userIndices.length < 2) return null;++ return (+ <div className="fixed right-3 top-1/2 -translate-y-1/2 h-2/3 flex flex-col justify-between items-center z-20 py-4">+ {userIndices.map((idx) => (+ <button+ key={idx}+ onClick={() => scrollTo(idx)}+ className={cn(+ "rounded-full transition-all shrink-0",+ idx === activeIdx+ ? "w-3 h-3 bg-primary shadow-sm shadow-primary/30"+ : "w-2 h-2 bg-muted-foreground/25 hover:bg-muted-foreground/50"+ )}+ title={messages[idx].content.slice(0, 40)}+ />+ ))}+ </div>+ );+});diff --git a/frontend/src/components/chat/MessageBubble.tsx b/frontend/src/components/chat/MessageBubble.tsxnew file mode 100644index 000000000..467b07e8f--- /dev/null+++ b/frontend/src/components/chat/MessageBubble.tsx@@ -0,0 +1,121 @@+import { memo, useState, useCallback } from "react";+import { User, XCircle, RefreshCw, Copy, Check } from "lucide-react";+import ReactMarkdown from "react-markdown";+import remarkGfm from "remark-gfm";+import rehypeHighlight from "rehype-highlight";+import { formatTimestamp } from "@/lib/formatters";+import type { AgentMessage } from "@/types/agent";+import { AgentAvatar } from "./AgentAvatar";+import { RunCompleteCard } from "./RunCompleteCard";++const remarkPlugins = [remarkGfm];+const rehypePlugins = [rehypeHighlight];++function CopyButton({ text }: { text: string }) {+ const [copied, setCopied] = useState(false);+ const handleCopy = useCallback(() => {+ navigator.clipboard.writeText(text).then(() => {+ setCopied(true);+ setTimeout(() => setCopied(false), 1500);+ });+ }, [text]);+ return (+ <button+ onClick={handleCopy}+ className="absolute top-2 right-2 p-1.5 rounded-md bg-muted/80 hover:bg-muted text-muted-foreground hover:text-foreground opacity-0 group-hover:opacity-100 transition-opacity"+ title={copied ? "Copied" : "Copy"}+ >+ {copied ? <Check className="h-3.5 w-3.5 text-success" /> : <Copy className="h-3.5 w-3.5" />}+ </button>+ );+}++function getRetryHint(content: string): string {+ const lower = content.toLowerCase();+ if (lower.includes("timeout") || lower.includes("timed out")) {+ return "Execution timed out. Try simplifying the strategy or reducing the number of assets.";+ }+ if (lower.includes("api") || lower.includes("rate limit") || lower.includes("429") || lower.includes("500") || lower.includes("502") || lower.includes("503")) {+ return "API call failed. Please retry later.";+ }+ return "Execution failed. Click to retry.";+}++interface Props {+ msg: AgentMessage;+ onRetry?: (msg: AgentMessage) => void;+}++export const MessageBubble = memo(function MessageBubble({ msg, onRetry }: Props) {+ const ts = msg.timestamp ? formatTimestamp(msg.timestamp) : null;++ if (msg.type === "user") {+ return (+ <div className="flex justify-end gap-3 group">+ <div className="max-w-[72%] rounded-2xl rounded-tr-sm bg-primary text-primary-foreground px-4 py-2.5 text-sm leading-relaxed whitespace-pre-wrap">+ {msg.content}+ {ts && <span className="block text-[9px] opacity-50 text-right mt-1">{ts}</span>}+ </div>+ <div className="h-8 w-8 rounded-full bg-muted flex items-center justify-center shrink-0 mt-0.5">+ <User className="h-4 w-4 text-muted-foreground" />+ </div>+ </div>+ );+ }++ if (msg.type === "answer") {+ return (+ <div className="flex gap-3 group">+ <AgentAvatar />+ <div className="flex-1 min-w-0 relative">+ <CopyButton text={msg.content} />+ <div className="prose prose-sm dark:prose-invert max-w-none leading-relaxed prose-table:border prose-table:border-border/50 prose-th:bg-muted/30 prose-th:px-3 prose-th:py-1.5 prose-td:px-3 prose-td:py-1.5 prose-th:text-left prose-th:text-xs prose-th:font-medium prose-td:text-xs">+ <ReactMarkdown remarkPlugins={remarkPlugins} rehypePlugins={rehypePlugins}>{msg.content}</ReactMarkdown>+ </div>+ {ts && <span className="text-[9px] text-muted-foreground/30 mt-1 opacity-0 group-hover:opacity-100 transition-opacity">{ts}</span>}+ </div>+ </div>+ );+ }++ if (msg.type === "run_complete" && msg.runId) {+ return <RunCompleteCard msg={msg} />;+ }++ if (msg.type === "error") {+ const hint = getRetryHint(msg.content);+ return (+ <div className="flex gap-3">+ <AgentAvatar />+ <div className="space-y-2">+ <div className="flex items-start gap-2 rounded-xl border border-danger/30 bg-danger/5 px-4 py-3">+ <XCircle className="h-4 w-4 text-danger shrink-0 mt-0.5" />+ <p className="text-sm text-danger leading-relaxed">{msg.content}</p>+ </div>+ {onRetry && (+ <button+ onClick={() => onRetry(msg)}+ className="flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs text-muted-foreground hover:text-foreground hover:bg-muted/80 border border-transparent hover:border-border transition-all"+ title={hint}+ >+ <RefreshCw className="h-3 w-3" />+ <span>{hint}</span>+ </button>+ )}+ </div>+ </div>+ );+ }++ // Fallback: show content for any unhandled message type+ if (msg.content) {+ return (+ <div className="flex gap-3">+ <AgentAvatar />+ <p className="text-sm text-muted-foreground leading-relaxed">{msg.content}</p>+ </div>+ );+ }++ return null;+});diff --git a/frontend/src/components/chat/MetricsCard.tsx b/frontend/src/components/chat/MetricsCard.tsxnew file mode 100644index 000000000..573ff15ee--- /dev/null+++ b/frontend/src/components/chat/MetricsCard.tsx@@ -0,0 +1,47 @@+import { memo } from "react";+import { cn } from "@/lib/utils";+import { useI18n } from "@/lib/i18n";+import { getMetricLabel, DISPLAY_ORDER, formatMetricVal, metricSentiment } from "@/lib/formatters";++const SENTIMENT = {+ positive: "text-success",+ neutral: "text-foreground",+ negative: "text-danger",+} as const;++interface Props {+ metrics: Record<string, number>;+ compact?: boolean;+}++export const MetricsCard = memo(function MetricsCard({ metrics, compact = false }: Props) {+ const { t } = useI18n();+ const entries = DISPLAY_ORDER+ .filter((k) => metrics[k] != null)+ .map((k) => ({ k, v: metrics[k] }));++ if (entries.length === 0) return null;++ const shown = compact ? entries.slice(0, 6) : entries;++ return (+ <div className={cn(+ "grid gap-1.5 rounded-xl border border-border/60 bg-muted/20 p-3",+ compact ? "grid-cols-3" : "grid-cols-[repeat(auto-fit,minmax(120px,1fr))]"+ )}>+ {shown.map(({ k, v }) => (+ <div key={k} className="text-center py-1">+ <p className="text-[10px] text-muted-foreground uppercase tracking-wide font-medium">+ {getMetricLabel(k, t as unknown as Record<string, string>)}+ </p>+ <p className={cn(+ "text-sm font-bold font-mono tabular-nums mt-0.5",+ SENTIMENT[metricSentiment(k, v)]+ )}>+ {formatMetricVal(k, v)}+ </p>+ </div>+ ))}+ </div>+ );+});diff --git a/frontend/src/components/chat/RunCompleteCard.tsx b/frontend/src/components/chat/RunCompleteCard.tsxnew file mode 100644index 000000000..f62454067--- /dev/null+++ b/frontend/src/components/chat/RunCompleteCard.tsx@@ -0,0 +1,47 @@+import { memo, useEffect, useState } from "react";+import { Link } from "react-router-dom";+import { BarChart3 } from "lucide-react";+import { useI18n } from "@/lib/i18n";+import { api } from "@/lib/api";+import { AgentAvatar } from "./AgentAvatar";+import { MetricsCard } from "./MetricsCard";+import { MiniEquityChart } from "@/components/charts/MiniEquityChart";+import type { AgentMessage } from "@/types/agent";++interface Props {+ msg: AgentMessage;+}++export const RunCompleteCard = memo(function RunCompleteCard({ msg }: Props) {+ const { t } = useI18n();+ const [curve, setCurve] = useState(msg.equityCurve);++ useEffect(() => {+ if (!curve && msg.runId) {+ api.getRun(msg.runId).then(r => {+ if (r.equity_curve) setCurve(r.equity_curve.map(e => ({ time: e.time, equity: e.equity })));+ }).catch(() => {});+ }+ }, [msg.runId, curve]);++ return (+ <div className="flex gap-3">+ <AgentAvatar />+ <div className="flex-1 min-w-0 space-y-2">+ {msg.metrics && Object.keys(msg.metrics).length > 0 && (+ <MetricsCard metrics={msg.metrics} compact />+ )}+ {curve && curve.length > 1 && (+ <MiniEquityChart data={curve} height={80} />+ )}+ <Link+ to={`/runs/${msg.runId}`}+ className="text-sm text-primary hover:underline inline-flex items-center gap-1.5 font-medium"+ >+ <BarChart3 className="h-3.5 w-3.5" />+ {t.fullReport}+ </Link>+ </div>+ </div>+ );+});diff --git a/frontend/src/components/chat/SwarmDashboard.tsx b/frontend/src/components/chat/SwarmDashboard.tsxnew file mode 100644index 000000000..754a866ca--- /dev/null+++ b/frontend/src/components/chat/SwarmDashboard.tsx@@ -0,0 +1,211 @@+import { useEffect, useState, useRef } from "react";+import { CheckCircle2, XCircle, Loader2, Clock, Timer } from "lucide-react";+import ReactMarkdown from "react-markdown";+import remarkGfm from "remark-gfm";++export interface SwarmAgent {+ id: string;+ status: "waiting" | "running" | "done" | "failed" | "retry";+ tool: string;+ iters: number;+ startedAt: number;+ elapsed: number;+ lastText: string;+ summary: string;+}++export interface SwarmDashboardProps {+ preset: string;+ agents: Record<string, SwarmAgent>;+ agentOrder: string[];+ currentLayer: number;+ finished: boolean;+ finalStatus: string;+ startTime: number;+ completedSummaries: Array<{ agentId: string; summary: string }>;+ finalReport: string;+}++const AGENT_COLORS = [+ "text-cyan-400", "text-violet-400", "text-emerald-400",+ "text-amber-400", "text-blue-400", "text-rose-400",+ "text-teal-400", "text-pink-400",+];+const AGENT_BG = [+ "bg-cyan-500/10", "bg-violet-500/10", "bg-emerald-500/10",+ "bg-amber-500/10", "bg-blue-500/10", "bg-rose-500/10",+ "bg-teal-500/10", "bg-pink-500/10",+];++function agentColor(idx: number) { return AGENT_COLORS[idx % AGENT_COLORS.length]; }+function agentBg(idx: number) { return AGENT_BG[idx % AGENT_BG.length]; }++function formatTime(seconds: number) {+ if (seconds <= 0) return "\u2014";+ if (seconds < 60) return `${seconds.toFixed(1)}s`;+ const m = Math.floor(seconds / 60);+ const s = Math.floor(seconds % 60);+ return `${m}:${s.toString().padStart(2, "0")}`;+}++function StatusIcon({ status }: { status: SwarmAgent["status"] }) {+ switch (status) {+ case "running": return <Loader2 className="h-3.5 w-3.5 animate-spin text-primary" />;+ case "done": return <CheckCircle2 className="h-3.5 w-3.5 text-emerald-500" />;+ case "failed": return <XCircle className="h-3.5 w-3.5 text-red-500" />;+ case "retry": return <Loader2 className="h-3.5 w-3.5 animate-spin text-amber-500" />;+ default: return <Clock className="h-3.5 w-3.5 text-muted-foreground/40" />;+ }+}++function StatusLabel({ status }: { status: SwarmAgent["status"] }) {+ switch (status) {+ case "running": return <span className="text-primary font-medium">running</span>;+ case "done": return <span className="text-emerald-500 font-medium">done</span>;+ case "failed": return <span className="text-red-500 font-medium">failed</span>;+ case "retry": return <span className="text-amber-500 font-medium">retry</span>;+ default: return <span className="text-muted-foreground/50">waiting</span>;+ }+}++export function SwarmDashboard(props: SwarmDashboardProps) {+ const { preset, agents, agentOrder, finished, finalStatus, startTime, completedSummaries, finalReport } = props;+ const [now, setNow] = useState(Date.now());+ const timerRef = useRef<ReturnType<typeof setInterval>>(undefined);++ useEffect(() => {+ timerRef.current = setInterval(() => setNow(Date.now()), 250);+ return () => clearInterval(timerRef.current);+ }, []);++ const elapsedTotal = (now - startTime) / 1000;+ const doneCount = Object.values(agents).filter(a => a.status === "done" || a.status === "failed").length;+ const totalCount = Math.max(agentOrder.length, 1);+ const pct = Math.round((doneCount / totalCount) * 100);++ const borderColor = finished+ ? (finalStatus === "completed" ? "border-emerald-500/50" : "border-red-500/50")+ : "border-primary/30";+ const headerBg = finished+ ? (finalStatus === "completed" ? "bg-emerald-500/5" : "bg-red-500/5")+ : "bg-primary/5";++ return (+ <div className="space-y-3 w-full">+ {/* Dashboard panel */}+ <div className={`rounded-xl border ${borderColor} overflow-hidden`}>+ {/* Header */}+ <div className={`px-4 py-2.5 ${headerBg} flex items-center justify-between`}>+ <div className="flex items-center gap-2">+ <span className="font-semibold text-sm">{preset}</span>+ {finished ? (+ <span className={`text-xs px-2 py-0.5 rounded-full font-medium ${+ finalStatus === "completed"+ ? "bg-emerald-500/20 text-emerald-500"+ : "bg-red-500/20 text-red-500"+ }`}>+ {finalStatus.toUpperCase()}+ </span>+ ) : (+ <span className="text-xs px-2 py-0.5 rounded-full bg-primary/20 text-primary font-medium">+ RUNNING+ </span>+ )}+ </div>+ <div className="flex items-center gap-1.5 text-xs text-muted-foreground">+ <Timer className="h-3 w-3" />+ {formatTime(elapsedTotal)}+ </div>+ </div>++ {/* Agent rows */}+ <div className="divide-y divide-border/50">+ {agentOrder.map((agentId, idx) => {+ const agent = agents[agentId];+ if (!agent) return null;+ const elapsed = agent.status === "running" && agent.startedAt+ ? (now - agent.startedAt) / 1000+ : agent.elapsed / 1000;++ return (+ <div key={agentId} className="px-4 py-2 flex items-center gap-3 text-sm">+ {/* Agent name */}+ <div className={`w-40 shrink-0 font-mono text-xs truncate ${agentColor(idx)}`}>+ {agent.id}+ </div>+ {/* Status */}+ <div className="w-20 shrink-0 flex items-center gap-1.5">+ <StatusIcon status={agent.status} />+ <StatusLabel status={agent.status} />+ </div>+ {/* Tool */}+ <div className="w-28 shrink-0 text-xs text-muted-foreground font-mono truncate">+ {agent.tool || "\u2014"}+ </div>+ {/* Time */}+ <div className="w-16 shrink-0 text-xs text-muted-foreground text-right tabular-nums">+ {formatTime(elapsed)}+ </div>+ {/* Iters */}+ <div className="w-10 shrink-0 text-xs text-muted-foreground text-right tabular-nums">+ {agent.iters > 0 ? agent.iters : "\u2014"}+ </div>+ {/* Last output */}+ <div className="flex-1 min-w-0 text-xs text-muted-foreground/60 truncate">+ {agent.lastText}+ </div>+ </div>+ );+ })}+ </div>++ {/* Progress bar */}+ <div className="px-4 py-2 border-t border-border/50 flex items-center gap-3">+ <div className="flex-1 h-1.5 rounded-full bg-muted overflow-hidden">+ <div+ className={`h-full rounded-full transition-all duration-500 ${+ finished+ ? (finalStatus === "completed" ? "bg-emerald-500" : "bg-red-500")+ : "bg-primary"+ }`}+ style={{ width: `${pct}%` }}+ />+ </div>+ <span className="text-xs text-muted-foreground tabular-nums w-10 text-right">{pct}%</span>+ </div>+ </div>++ {/* Completed agent summaries */}+ {completedSummaries.length > 0 && (+ <div className="space-y-2">+ {completedSummaries.map(({ agentId, summary }, idx) => {+ const agentIdx = agentOrder.indexOf(agentId);+ const colorIdx = agentIdx >= 0 ? agentIdx : idx;+ const lines = summary.split("\n");+ const preview = lines.slice(0, 8).join("\n") + (lines.length > 8 ? "\n..." : "");+ return (+ <div key={agentId + idx} className={`rounded-lg ${agentBg(colorIdx)} px-4 py-3`}>+ <div className={`text-xs font-semibold mb-1.5 ${agentColor(colorIdx)}`}>+ {agentId}+ </div>+ <div className="text-xs text-muted-foreground leading-relaxed whitespace-pre-wrap">+ {preview}+ </div>+ </div>+ );+ })}+ </div>+ )}++ {/* Final report */}+ {finalReport && (+ <div className="rounded-xl border border-emerald-500/30 bg-emerald-500/5 px-5 py-4">+ <div className="text-xs font-semibold text-emerald-500 mb-3">Final Report</div>+ <div className="prose prose-sm dark:prose-invert max-w-none">+ <ReactMarkdown remarkPlugins={[remarkGfm]}>{finalReport}</ReactMarkdown>+ </div>+ </div>+ )}+ </div>+ );+}diff --git a/frontend/src/components/chat/ThinkingTimeline.tsx b/frontend/src/components/chat/ThinkingTimeline.tsxnew file mode 100644index 000000000..ddbae03b9--- /dev/null+++ b/frontend/src/components/chat/ThinkingTimeline.tsx@@ -0,0 +1,159 @@+import { useState, useEffect, useMemo, memo } from "react";+import { ChevronDown, ChevronRight, CheckCircle2, XCircle, Circle, Loader2 } from "lucide-react";+import { cn } from "@/lib/utils";+import { useI18n } from "@/lib/i18n";+import type { AgentMessage } from "@/types/agent";++/* ---------- Tool display name keys (mapped to i18n) ---------- */+const TOOL_I18N_KEY: Record<string, string> = {+ load_skill: "toolLoadSkill",+ write_file: "toolWriteFile",+ edit_file: "toolEditFile",+ read_file: "toolReadFile",+ run_backtest: "toolRunBacktest",+ bash: "toolBash",+ read_url: "toolReadUrl",+ read_document: "toolReadDocument",+ compact: "toolCompact",+ create_task: "toolCreateTask",+ update_task: "toolUpdateTask",+ spawn_subagent: "toolSpawnSubagent",+};++interface Props {+ messages: AgentMessage[];+ isLatest?: boolean;+}++export const ThinkingTimeline = memo(function ThinkingTimeline({ messages, isLatest = false }: Props) {+ const { t } = useI18n();+ const [expanded, setExpanded] = useState(isLatest);++ const toolLabel = (tool?: string): string => {+ if (!tool) return t.toolProcessing;+ const key = TOOL_I18N_KEY[tool];+ return key ? (t as Record<string, string>)[key] || tool : tool;+ };++ useEffect(() => {+ if (!isLatest) setExpanded(false);+ }, [isLatest]);++ const { steps, hasError, isRunning, totalMs, latestTool, latestThinking } = useMemo(() => {+ let totalMs = 0;+ let latestTool = "";+ let latestThinking = "";+ // Merge tool_call + tool_result pairs into "steps"+ const steps: Array<{ tool: string; label: string; status: "running" | "ok" | "error"; elapsed_ms?: number }> = [];++ for (const m of messages) {+ if (m.type === "thinking" && m.content) latestThinking = m.content;+ if (m.type === "tool_call") {+ steps.push({ tool: m.tool || "", label: toolLabel(m.tool), status: m.status === "running" ? "running" : "ok", elapsed_ms: undefined });+ if (m.status === "running") latestTool = m.tool || "";+ }+ if (m.type === "tool_result") {+ const existing = [...steps].reverse().find(s => s.tool === m.tool);+ if (existing) {+ existing.status = m.status === "ok" ? "ok" : "error";+ existing.elapsed_ms = m.elapsed_ms;+ }+ if (m.elapsed_ms) totalMs += m.elapsed_ms;+ }+ }++ return {+ steps,+ hasError: steps.some(s => s.status === "error"),+ isRunning: steps.some(s => s.status === "running"),+ totalMs,+ latestTool,+ latestThinking,+ };+ }, [messages]);++ const stepCount = steps.length;+ const summaryText = isRunning+ ? t.thinkingRunning.replace("{tool}", toolLabel(latestTool))+ : t.thinkingDone.replace("{count}", String(stepCount)) + (totalMs > 0 ? ` ยท ${(totalMs / 1000).toFixed(1)}s` : "");++ return (+ <div className="rounded-lg border border-border/40 bg-muted/5 overflow-hidden">+ {/* Summary bar */}+ <button+ onClick={() => setExpanded(!expanded)}+ className="w-full flex items-center gap-2 px-3 py-2 text-xs hover:bg-muted/10 transition-colors"+ >+ {expanded+ ? <ChevronDown className="h-3 w-3 text-muted-foreground shrink-0" />+ : <ChevronRight className="h-3 w-3 text-muted-foreground shrink-0" />}+ {isRunning ? (+ <Loader2 className="h-3 w-3 text-primary animate-spin shrink-0" />+ ) : hasError ? (+ <XCircle className="h-3 w-3 text-danger shrink-0" />+ ) : (+ <CheckCircle2 className="h-3 w-3 text-success/70 shrink-0" />+ )}+ <span className={cn("text-muted-foreground", isRunning && "text-foreground")}>+ {summaryText}+ </span>+ </button>++ {/* Thinking preview when running but collapsed */}+ {!expanded && isRunning && latestThinking && (+ <div className="px-3 pb-2 -mt-1">+ <p className="text-[11px] text-muted-foreground/40 line-clamp-1 pl-5 italic">+ {latestThinking.slice(-100)}+ </p>+ </div>+ )}++ {/* Expanded step list */}+ {expanded && steps.length > 0 && (+ <div className="border-t border-border/30 px-3 py-1.5 space-y-0.5">+ {steps.map((step, i) => (+ <div key={`${step.tool}-${i}`} className="flex items-center gap-2 py-1 text-xs">+ {/* Tree connector */}+ <span className="text-border/60 shrink-0 w-3 text-center">+ {i < steps.length - 1 ? "โ" : "โ"}+ </span>++ {/* Status icon */}+ {step.status === "running" ? (+ <Loader2 className="h-3 w-3 text-primary animate-spin shrink-0" />+ ) : step.status === "error" ? (+ <XCircle className="h-3 w-3 text-danger shrink-0" />+ ) : (+ <Circle className="h-3 w-3 text-success/50 shrink-0" fill="currentColor" />+ )}++ {/* Label */}+ <span className={cn(+ "flex-1",+ step.status === "running" ? "text-foreground" : "text-muted-foreground/60"+ )}>+ {step.label}+ </span>++ {/* Duration or status */}+ {step.status === "running" ? (+ <span className="text-[10px] text-primary/60">{t.toolRunning}</span>+ ) : step.elapsed_ms != null ? (+ <span className="text-[10px] text-muted-foreground/40 tabular-nums">{(step.elapsed_ms / 1000).toFixed(1)}s</span>+ ) : null}+ </div>+ ))}+ </div>+ )}++ {/* Expanded: show thinking content if any (for Q&A without tools) */}+ {expanded && steps.length === 0 && latestThinking && (+ <div className="border-t border-border/30 px-3 py-2">+ <p className="text-xs text-muted-foreground/50 leading-relaxed line-clamp-4">+ {latestThinking}+ </p>+ </div>+ )}+ </div>+ );+});diff --git a/frontend/src/components/chat/WelcomeScreen.tsx b/frontend/src/components/chat/WelcomeScreen.tsxnew file mode 100644index 000000000..fce5911f1--- /dev/null+++ b/frontend/src/components/chat/WelcomeScreen.tsx@@ -0,0 +1,177 @@+๏ปฟimport { Bot, TrendingUp, Bitcoin, Globe, Sparkles, Users } from "lucide-react";+import { useI18n } from "@/lib/i18n";++interface Example {+ title: string;+ desc: string;+ prompt: string;+}++interface Category {+ label: string;+ icon: React.ReactNode;+ color: string;+ examples: Example[];+}++const CATEGORIES: Category[] = [+ {+ label: "Multi-Market Backtest",+ icon: <TrendingUp className="h-4 w-4" />,+ color: "text-red-400 border-red-500/30 hover:border-red-500/60 hover:bg-red-500/5",+ examples: [+ {+ title: "Cross-Market Portfolio",+ desc: "A-shares + crypto + US equities with risk-parity optimizer",+ prompt: "Backtest a risk-parity portfolio of 000001.SZ, BTC-USDT, and AAPL for full-year 2024, compare against equal-weight baseline",+ },+ {+ title: "BTC 5-Min MACD Strategy",+ desc: "Minute-level crypto backtest with real-time OKX data",+ prompt: "Backtest BTC-USDT 5-minute MACD strategy, fast=12 slow=26 signal=9, last 30 days",+ },+ {+ title: "US Tech Max Diversification",+ desc: "Portfolio optimizer across FAANG+ via yfinance",+ prompt: "Backtest AAPL, MSFT, GOOGL, AMZN, NVDA with max_diversification portfolio optimizer, full-year 2024",+ },+ ],+ },+ {+ label: "Research & Analysis",+ icon: <Sparkles className="h-4 w-4" />,+ color: "text-amber-400 border-amber-500/30 hover:border-amber-500/60 hover:bg-amber-500/5",+ examples: [+ {+ title: "Multi-Factor Alpha Model",+ desc: "IC-weighted factor synthesis across 300 stocks",+ prompt: "Build a multi-factor alpha model using momentum, reversal, volatility, and turnover on CSI 300 constituents with IC-weighted factor synthesis, backtest 2023-2024",+ },+ {+ title: "Options Greeks Analysis",+ desc: "Black-Scholes pricing with Delta/Gamma/Theta/Vega",+ prompt: "Calculate option Greeks using Black-Scholes: spot=100, strike=105, risk-free rate=3%, vol=25%, expiry=90 days, analyze Delta/Gamma/Theta/Vega",+ },+ ],+ },+ {+ label: "Swarm Teams",+ icon: <Users className="h-4 w-4" />,+ color: "text-violet-400 border-violet-500/30 hover:border-violet-500/60 hover:bg-violet-500/5",+ examples: [+ {+ title: "Investment Committee Review",+ desc: "Multi-agent debate: long vs short, risk review, PM decision",+ prompt: "[Swarm Team Mode] Use the investment_committee preset to evaluate whether to go long or short on NVDA given current market conditions",+ },+ {+ title: "Quant Strategy Desk",+ desc: "Screening โ factor research โ backtest โ risk audit pipeline",+ prompt: "[Swarm Team Mode] Use the quant_strategy_desk preset to find and backtest the best momentum strategy on CSI 300 constituents",+ },+ ],+ },+ {+ label: "Document & Web Research",+ icon: <Globe className="h-4 w-4" />,+ color: "text-blue-400 border-blue-500/30 hover:border-blue-500/60 hover:bg-blue-500/5",+ examples: [+ {+ title: "Analyze an Earnings Report PDF",+ desc: "Upload a PDF and ask questions about the financials",+ prompt: "Summarize the key financial metrics, risks, and outlook from the uploaded earnings report",+ },+ {+ title: "Web Research: Macro Outlook",+ desc: "Read live web sources for macro analysis",+ prompt: "Read the latest Fed meeting minutes and summarize the key takeaways for equity and crypto markets",+ },+ ],+ },+];++const CAPABILITY_CHIPS = [+ "56 Finance Skills",+ "25 Swarm Presets",+ "19 Agent Tools",+ "3 Markets: A-Share ยท Crypto ยท HK/US",+ "Minute to Daily Timeframes",+ "4 Portfolio Optimizers",+ "15+ Risk Metrics",+ "Options & Derivatives",+ "PDF & Web Research",+ "Factor Analysis & ML",+];++interface Props {+ onExample: (s: string) => void;+}++export function WelcomeScreen({ onExample }: Props) {+ const { t } = useI18n();++ return (+ <div className="flex flex-col items-center justify-center min-h-[60vh] space-y-8 text-center">+ {/* Header */}+ <div className="space-y-3">+ <div className="h-16 w-16 mx-auto rounded-2xl bg-gradient-to-br from-primary/80 to-info/80 flex items-center justify-center shadow-lg">+ <Bot className="h-8 w-8 text-white" />+ </div>+ <div>+ <h2 className="text-2xl font-bold tracking-tight">Vibe-Trading</h2>+ <p className="text-xs text-muted-foreground mt-1 max-w-sm mx-auto leading-relaxed">+ vibe trading with your professional financial agent team+ </p>+ <p className="text-sm text-muted-foreground mt-2 max-w-md leading-relaxed mx-auto">+ {t.describeStrategy}+ </p>+ </div>+ </div>++ {/* Capability chips */}+ <div className="flex flex-wrap justify-center gap-2 max-w-lg">+ {CAPABILITY_CHIPS.map((chip) => (+ <span+ key={chip}+ className="px-2.5 py-1 text-xs rounded-full border border-border/60 text-muted-foreground bg-muted/30"+ >+ {chip}+ </span>+ ))}+ </div>++ {/* Example categories grid */}+ <div className="w-full max-w-2xl text-left space-y-4">+ <p className="text-xs text-muted-foreground px-1">{t.examples}</p>+ <div className="grid grid-cols-1 sm:grid-cols-2 gap-3">+ {CATEGORIES.map((cat) => (+ <div key={cat.label} className="space-y-2">+ <div className={`flex items-center gap-1.5 text-xs font-medium px-1 ${cat.color.split(" ").filter(c => c.startsWith("text-")).join(" ")}`}>+ {cat.icon}+ <span>{cat.label}</span>+ </div>+ <div className="space-y-1.5">+ {cat.examples.map((ex) => (+ <button+ key={ex.title}+ onClick={() => onExample(ex.prompt)}+ className={`block w-full text-left px-3 py-2.5 rounded-xl border transition-colors ${cat.color}`}+ >+ <span className="text-sm font-medium text-foreground leading-snug">+ {ex.title}+ </span>+ <span className="block text-xs text-muted-foreground mt-0.5 leading-snug">+ {ex.desc}+ </span>+ </button>+ ))}+ </div>+ </div>+ ))}+ </div>+ </div>+ </div>+ );+}++diff --git a/frontend/src/components/common/ErrorBoundary.tsx b/frontend/src/components/common/ErrorBoundary.tsxnew file mode 100644index 000000000..2a14935e3--- /dev/null+++ b/frontend/src/components/common/ErrorBoundary.tsx@@ -0,0 +1,25 @@+import { Component, type ReactNode } from "react";+import { AlertTriangle } from "lucide-react";++interface Props { children: ReactNode; fallback?: ReactNode; }+interface State { hasError: boolean; error?: Error; }++export class ErrorBoundary extends Component<Props, State> {+ state: State = { hasError: false };++ static getDerivedStateFromError(error: Error): State {+ return { hasError: true, error };+ }++ render() {+ if (this.state.hasError) {+ return this.props.fallback ?? (+ <div className="flex items-center gap-2 p-4 rounded-lg border border-destructive/30 bg-destructive/5 text-sm text-destructive">+ <AlertTriangle className="h-4 w-4 shrink-0" />+ <span>{this.state.error?.message || "Something went wrong"}</span>+ </div>+ );+ }+ return this.props.children;+ }+}diff --git a/frontend/src/components/common/Skeleton.tsx b/frontend/src/components/common/Skeleton.tsxnew file mode 100644index 000000000..861b41825--- /dev/null+++ b/frontend/src/components/common/Skeleton.tsx@@ -0,0 +1,22 @@+import { cn } from "@/lib/utils";++export function Skeleton({ className, style }: { className?: string; style?: React.CSSProperties }) {+ return <div className={cn("animate-pulse rounded-md bg-muted/50", className)} style={style} />;+}++export function SkeletonMetrics() {+ return (+ <div className="grid grid-cols-3 gap-1.5 p-3">+ {Array.from({ length: 6 }).map((_, i) => (+ <div key={i} className="flex flex-col items-center gap-1.5 py-2">+ <Skeleton className="h-2 w-10" />+ <Skeleton className="h-4 w-14" />+ </div>+ ))}+ </div>+ );+}++export function SkeletonChart({ height = 300 }: { height?: number }) {+ return <Skeleton className="w-full" style={{ height }} />;+}diff --git a/frontend/src/components/layout/ConnectionBanner.tsx b/frontend/src/components/layout/ConnectionBanner.tsxnew file mode 100644index 000000000..c15ff7577--- /dev/null+++ b/frontend/src/components/layout/ConnectionBanner.tsx@@ -0,0 +1,29 @@+import { WifiOff, RefreshCw } from "lucide-react";+import { useI18n } from "@/lib/i18n";+import type { SSEStatus } from "@/hooks/useSSE";++interface Props {+ status: SSEStatus;+ retryAttempt?: number;+}++export function ConnectionBanner({ status, retryAttempt }: Props) {+ const { t } = useI18n();+ if (status === "connected" || status === "disconnected") return null;++ return (+ <div className="flex items-center gap-2 px-4 py-2 text-xs bg-warning/15 text-warning border-b border-warning/30">+ {status === "reconnecting" ? (+ <>+ <RefreshCw className="h-3.5 w-3.5 animate-spin" />+ <span>{t.reconnectingN.replace("{n}", String(retryAttempt || 1))}</span>+ </>+ ) : (+ <>+ <WifiOff className="h-3.5 w-3.5" />+ <span>{t.disconnected}</span>+ </>+ )}+ </div>+ );+}diff --git a/frontend/src/components/layout/Layout.tsx b/frontend/src/components/layout/Layout.tsxnew file mode 100644index 000000000..6790107fa--- /dev/null+++ b/frontend/src/components/layout/Layout.tsx@@ -0,0 +1,244 @@+๏ปฟimport { useEffect, useState } from "react";+import { Link, Outlet, useLocation, useSearchParams } from "react-router-dom";+import { BarChart3, Bot, Moon, Sun, Plus, Trash2, Pencil, MessageSquare, ChevronsLeft, ChevronsRight } from "lucide-react";+import { cn } from "@/lib/utils";+import { useI18n } from "@/lib/i18n";+import { useDarkMode } from "@/hooks/useDarkMode";+import { api, type SessionItem } from "@/lib/api";+import { useAgentStore } from "@/stores/agent";+import { ConnectionBanner } from "@/components/layout/ConnectionBanner";++const NAV = [+ { to: "/", icon: BarChart3, key: "home" as const },+ { to: "/agent", icon: Bot, key: "agent" as const },+];++export function Layout() {+ const { pathname } = useLocation();+ const [searchParams] = useSearchParams();+ const { t } = useI18n();+ const { dark, toggle } = useDarkMode();+ const [sessions, setSessions] = useState<SessionItem[]>([]);+ const [sessionsLoading, setSessionsLoading] = useState(true);+ const sseStatus = useAgentStore(s => s.sseStatus);+ const sseRetryAttempt = useAgentStore(s => s.sseRetryAttempt);+ const [collapsed, setCollapsed] = useState(() => localStorage.getItem("qa-sidebar") === "collapsed");++ const activeSessionId = searchParams.get("session");++ useEffect(() => {+ localStorage.setItem("qa-sidebar", collapsed ? "collapsed" : "expanded");+ }, [collapsed]);++ const loadSessions = () => {+ api.listSessions()+ .then((list) => setSessions(Array.isArray(list) ? list : []))+ .catch(() => {})+ .finally(() => setSessionsLoading(false));+ };++ // Load sessions on mount. Also refresh when navigating TO /agent or when+ // the active session changes (covers new session creation from Agent).+ const isAgentPage = pathname.startsWith("/agent");+ useEffect(() => { loadSessions(); }, [isAgentPage, activeSessionId]);++ const [deleteTarget, setDeleteTarget] = useState<string | null>(null);+ const [renameTarget, setRenameTarget] = useState<string | null>(null);+ const [renameValue, setRenameValue] = useState("");++ const deleteSession = async (sid: string) => {+ try {+ await api.deleteSession(sid);+ setSessions((prev) => prev.filter((s) => s.session_id !== sid));+ } catch { /* ignore */ }+ setDeleteTarget(null);+ };++ const renameSession = async (sid: string) => {+ if (!renameValue.trim()) { setRenameTarget(null); return; }+ try {+ await api.renameSession(sid, renameValue.trim());+ setSessions((prev) => prev.map((s) => s.session_id === sid ? { ...s, title: renameValue.trim() } : s));+ } catch { /* ignore */ }+ setRenameTarget(null);+ };++ return (+ <div className="flex h-screen bg-background">+ {/* Sidebar */}+ <aside className={cn(+ "border-r bg-card flex flex-col shrink-0 transition-all duration-200",+ collapsed ? "w-12" : "w-64"+ )}>+ {/* Brand */}+ <div className={cn("border-b", collapsed ? "p-2 flex justify-center" : "p-4")}>+ <Link to="/" className={cn("flex items-center font-bold text-base tracking-tight", collapsed ? "justify-center" : "gap-2")}>+ <BarChart3 className="h-5 w-5 text-primary shrink-0" />+ {!collapsed && "Vibe-Trading"}+ </Link>+ </div>++ {/* Nav */}+ <nav className={cn("space-y-0.5", collapsed ? "p-1" : "p-2")}>+ {NAV.map(({ to, icon: Icon, key }) => (+ <Link+ key={to}+ to={to}+ className={cn(+ "flex items-center rounded-md text-sm transition-colors",+ collapsed ? "justify-center p-2" : "gap-3 px-3 py-2",+ (to === "/" ? pathname === "/" : pathname.startsWith(to))+ ? "bg-primary/10 text-primary font-medium"+ : "text-muted-foreground hover:bg-muted hover:text-foreground"+ )}+ title={collapsed ? t[key] : undefined}+ >+ <Icon className="h-4 w-4 shrink-0" />+ {!collapsed && t[key]}+ </Link>+ ))}+ </nav>++ {/* Sessions โ hidden when collapsed */}+ {!collapsed && (+ <div className="flex-1 overflow-auto border-t mt-2 flex flex-col">+ <div className="flex items-center justify-between px-4 py-2">+ <span className="flex items-center gap-1.5 text-xs font-medium text-muted-foreground">+ <MessageSquare className="h-3.5 w-3.5" />+ {t.sessions}+ </span>+ <Link+ to="/agent"+ className="flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors"+ title={t.newChat}+ >+ <Plus className="h-3.5 w-3.5" />+ </Link>+ </div>++ <div className="px-2 pb-2 space-y-0.5 overflow-auto flex-1">+ {sessionsLoading ? (+ <div className="space-y-1.5 px-2 py-1">+ {[1, 2, 3].map((i) => (+ <div key={i} className="h-7 rounded-md bg-muted/50 animate-pulse" />+ ))}+ </div>+ ) : sessions.length === 0 ? (+ <p className="px-3 py-2 text-xs text-muted-foreground/60">{t.noSessions}</p>+ ) : null}+ {sessions.map((s) => {+ const isActive = s.session_id === activeSessionId;+ const isDeleting = deleteTarget === s.session_id;+ const isRenaming = renameTarget === s.session_id;+ return (+ <div key={s.session_id} className="group relative flex items-center">+ {isRenaming ? (+ <input+ autoFocus+ value={renameValue}+ onChange={(e) => setRenameValue(e.target.value)}+ onKeyDown={(e) => { if (e.key === "Enter") renameSession(s.session_id); if (e.key === "Escape") setRenameTarget(null); }}+ onBlur={() => renameSession(s.session_id)}+ className="flex-1 min-w-0 pl-3 pr-2 py-1 rounded-md text-xs border border-primary bg-background outline-none"+ />+ ) : (+ <Link+ to={`/agent?session=${s.session_id}`}+ className={cn(+ "flex-1 min-w-0 pl-3 pr-14 py-1.5 rounded-md text-xs transition-colors truncate block border-l-2",+ isActive+ ? "border-l-primary bg-primary/10 text-primary font-medium"+ : "border-l-transparent text-muted-foreground hover:bg-muted hover:text-foreground"+ )}+ title={s.title || s.session_id}+ >+ <span className="flex items-center gap-1.5">+ <span className={cn(+ "h-1.5 w-1.5 rounded-full shrink-0",+ s.status === "failed" ? "bg-danger" : isActive ? "bg-warning" : "bg-success/60"+ )} />+ {s.title || s.session_id.slice(0, 16)}+ </span>+ </Link>+ )}+ {!isRenaming && isDeleting ? (+ <div className="absolute right-0.5 flex items-center gap-0.5">+ <button onClick={() => deleteSession(s.session_id)} className="p-1 text-danger hover:bg-danger/10 rounded text-[10px] font-medium">{t.confirmDelete}</button>+ <button onClick={() => setDeleteTarget(null)} className="p-1 text-muted-foreground hover:bg-muted rounded text-[10px]">{t.cancelDelete}</button>+ </div>+ ) : !isRenaming ? (+ <div className="absolute right-1 opacity-0 group-hover:opacity-100 flex items-center gap-0.5 transition-opacity">+ <button+ onClick={(e) => { e.preventDefault(); e.stopPropagation(); setRenameTarget(s.session_id); setRenameValue(s.title || ""); }}+ className="p-1 text-muted-foreground hover:text-foreground rounded"+ title="Rename"+ >+ <Pencil className="h-3 w-3" />+ </button>+ <button+ onClick={(e) => { e.preventDefault(); e.stopPropagation(); setDeleteTarget(s.session_id); }}+ className="p-1 text-muted-foreground hover:text-danger rounded"+ title={t.deleteConfirm}+ >+ <Trash2 className="h-3 w-3" />+ </button>+ </div>+ ) : null}+ </div>+ );+ })}+ </div>+ </div>+ )}++ {/* Spacer when collapsed */}+ {collapsed && <div className="flex-1" />}++ {/* Footer */}+ <div className={cn("border-t", collapsed ? "p-1 flex flex-col items-center gap-1" : "p-3 space-y-2")}>+ {collapsed ? (+ <>+ <button onClick={toggle} className="p-1.5 text-muted-foreground hover:text-foreground rounded transition-colors" title={dark ? t.lightMode : t.darkMode}>+ {dark ? <Sun className="h-3.5 w-3.5" /> : <Moon className="h-3.5 w-3.5" />}+ </button>+ <button onClick={() => setCollapsed(false)} className="p-1.5 text-muted-foreground hover:text-foreground rounded transition-colors" title="Expand">+ <ChevronsRight className="h-3.5 w-3.5" />+ </button>+ </>+ ) : (+ <>+ <div className="flex items-center justify-between">+ <button+ onClick={toggle}+ className="flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors"+ >+ {dark ? <Sun className="h-3.5 w-3.5" /> : <Moon className="h-3.5 w-3.5" />}+ {dark ? t.lightMode : t.darkMode}+ </button>+ <div className="flex items-center gap-1">+ <button+ onClick={() => setCollapsed(true)}+ className="p-1 text-muted-foreground hover:text-foreground rounded transition-colors"+ title="Collapse"+ >+ <ChevronsLeft className="h-3.5 w-3.5" />+ </button>+ </div>+ </div>+ <p className="text-xs text-muted-foreground/60">v0.1.0</p>+ </>+ )}+ </div>+ </aside>++ {/* Main */}+ <div className="flex-1 flex flex-col overflow-hidden">+ <ConnectionBanner status={sseStatus} retryAttempt={sseRetryAttempt} />+ <main className="flex-1 overflow-auto">+ <Outlet />+ </main>+ </div>+ </div>+ );+}+diff --git a/frontend/src/hooks/useDarkMode.ts b/frontend/src/hooks/useDarkMode.tsnew file mode 100644index 000000000..24515158a--- /dev/null+++ b/frontend/src/hooks/useDarkMode.ts@@ -0,0 +1,16 @@+import { useEffect, useState } from "react";++export function useDarkMode() {+ const [dark, setDark] = useState(() => {+ const saved = localStorage.getItem("qa-theme");+ if (saved) return saved === "dark";+ return window.matchMedia("(prefers-color-scheme: dark)").matches;+ });++ useEffect(() => {+ document.documentElement.classList.toggle("dark", dark);+ localStorage.setItem("qa-theme", dark ? "dark" : "light");+ }, [dark]);++ return { dark, toggle: () => setDark((d) => !d) };+}diff --git a/frontend/src/hooks/useSSE.ts b/frontend/src/hooks/useSSE.tsnew file mode 100644index 000000000..1063508e9--- /dev/null+++ b/frontend/src/hooks/useSSE.ts@@ -0,0 +1,170 @@+/**+ * SSE Hook โ auto-reconnect + exponential backoff + LRU dedup + Last-Event-ID resume.+ */++import { useCallback, useRef } from "react";++type EventHandler = (data: Record<string, unknown>) => void;+type Handlers = Record<string, EventHandler>;++export type SSEStatus = "disconnected" | "connected" | "reconnecting";++interface SSEConfig {+ initialRetryMs?: number;+ maxRetryMs?: number;+ backoffFactor?: number;+ dedupeCapacity?: number;+}++const DEFAULTS: Required<SSEConfig> = {+ initialRetryMs: 1000,+ maxRetryMs: 30000,+ backoffFactor: 2,+ dedupeCapacity: 500,+};++export function useSSE(config?: SSEConfig) {+ const opts = { ...DEFAULTS, ...config };+ const sourceRef = useRef<EventSource | null>(null);+ const handlersRef = useRef<Handlers>({});+ const urlRef = useRef<string>("");+ const closedRef = useRef(true);+ const retryCountRef = useRef(0);+ const retryTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);+ const lastEventIdRef = useRef<string | null>(null);+ const statusRef = useRef<SSEStatus>("disconnected");+ const onStatusChangeRef = useRef<((s: SSEStatus) => void) | null>(null);++ // LRU dedup set+ const seenIdsRef = useRef<Set<string>>(new Set());+ const seenOrderRef = useRef<string[]>([]);++ const trackEventId = useCallback((eventId: string): boolean => {+ if (!eventId) return false;+ const seen = seenIdsRef.current;+ const order = seenOrderRef.current;+ if (seen.has(eventId)) return true; // duplicate+ seen.add(eventId);+ order.push(eventId);+ if (order.length > opts.dedupeCapacity) {+ const oldest = order.shift()!;+ seen.delete(oldest);+ }+ return false;+ }, [opts.dedupeCapacity]);++ const setStatus = useCallback((s: SSEStatus) => {+ statusRef.current = s;+ onStatusChangeRef.current?.(s);+ }, []);++ const buildUrl = useCallback((baseUrl: string) => {+ const sep = baseUrl.includes("?") ? "&" : "?";+ if (lastEventIdRef.current) {+ return `${baseUrl}${sep}Last-Event-ID=${encodeURIComponent(lastEventIdRef.current)}`;+ }+ return baseUrl;+ }, []);++ const doConnect = useCallback(() => {+ if (closedRef.current) return;++ const url = buildUrl(urlRef.current);+ const source = new EventSource(url);+ sourceRef.current = source;++ source.onopen = () => {+ retryCountRef.current = 0;+ setStatus("connected");+ };++ // Only subscribe to event types the backend actually emits+ const knownTypes = [+ "text_delta", "thinking_done", "tool_call", "tool_result", "compact",+ "attempt.completed", "attempt.failed",+ "heartbeat", "done",+ ];++ const handleRaw = (eventType: string, raw: MessageEvent) => {+ if (raw.lastEventId) {+ lastEventIdRef.current = raw.lastEventId;+ }+ if (raw.lastEventId && trackEventId(raw.lastEventId)) return;++ let parsed: Record<string, unknown>;+ try {+ parsed = JSON.parse(raw.data);+ } catch {+ parsed = { raw: raw.data };+ }++ const handler = handlersRef.current[eventType] ?? handlersRef.current["message"];+ handler?.(parsed);+ };++ for (const eventType of knownTypes) {+ source.addEventListener(eventType, (e) => handleRaw(eventType, e as MessageEvent));+ }++ source.onerror = () => {+ if (closedRef.current) return;+ source.close();+ sourceRef.current = null;+ scheduleReconnect();+ };+ }, [buildUrl, trackEventId, setStatus]);++ const scheduleReconnect = useCallback(() => {+ if (closedRef.current) return;+ retryCountRef.current += 1;+ const delay = Math.min(+ opts.initialRetryMs * Math.pow(opts.backoffFactor, retryCountRef.current - 1),+ opts.maxRetryMs,+ );+ setStatus("reconnecting");+ handlersRef.current["reconnect"]?.({ attempt: retryCountRef.current, delayMs: delay });++ retryTimerRef.current = setTimeout(() => {+ retryTimerRef.current = null;+ doConnect();+ }, delay);+ }, [opts.initialRetryMs, opts.backoffFactor, opts.maxRetryMs, setStatus, doConnect]);++ const connect = useCallback((url: string, handlers: Handlers) => {+ closedRef.current = true;+ sourceRef.current?.close();+ if (retryTimerRef.current) {+ clearTimeout(retryTimerRef.current);+ retryTimerRef.current = null;+ }++ urlRef.current = url;+ handlersRef.current = handlers;+ closedRef.current = false;+ retryCountRef.current = 0;+ lastEventIdRef.current = null;+ seenIdsRef.current.clear();+ seenOrderRef.current.length = 0;++ doConnect();+ }, [doConnect]);++ const disconnect = useCallback(() => {+ closedRef.current = true;+ if (retryTimerRef.current) {+ clearTimeout(retryTimerRef.current);+ retryTimerRef.current = null;+ }+ sourceRef.current?.close();+ sourceRef.current = null;+ setStatus("disconnected");+ }, [setStatus]);++ const getStatus = useCallback(() => statusRef.current, []);++ const onStatusChange = useCallback((cb: (s: SSEStatus) => void) => {+ onStatusChangeRef.current = cb;+ }, []);++ return { connect, disconnect, getStatus, onStatusChange };+}diff --git a/frontend/src/index.css b/frontend/src/index.cssnew file mode 100644index 000000000..31f7121f7--- /dev/null+++ b/frontend/src/index.css@@ -0,0 +1,81 @@+@tailwind base;+@tailwind components;+@tailwind utilities;++@layer base {+ :root {+ /* Light mode surfaces */+ --background: 220 20% 98%;+ --foreground: 220 20% 10%;+ --card: 0 0% 100%;+ --card-foreground: 220 20% 10%;++ /* Brand accent */+ --primary: 27 90% 52%;+ --primary-foreground: 0 0% 100%;++ --muted: 220 14% 92%;+ --muted-foreground: 220 14% 46%;+ --destructive: 0 84% 60%;+ --destructive-foreground: 0 0% 100%;+ --border: 220 14% 87%;+ --radius: 0.5rem;++ /* Semantic colors */+ --success: 142 71% 45%;+ --danger: 0 84% 60%;+ --warning: 38 92% 50%;+ --info: 217 91% 60%;++ /* Chart tokens */+ --chart-grid: 220 14% 90%;+ --chart-text: 220 14% 46%;+ --chart-axis: 220 14% 80%;+ --chart-compare-a: #3b82f6;+ --chart-compare-b: #f59e0b;+ }++ .dark {+ /* Dark mode: 4-level surface system */+ --background: 220 20% 5%; /* bg-base */+ --foreground: 220 10% 92%;+ --card: 220 20% 8%; /* surface-1 */+ --card-foreground: 220 10% 92%;++ --primary: 27 90% 52%;+ --primary-foreground: 0 0% 100%;++ --muted: 220 20% 13%; /* surface-2 */+ --muted-foreground: 220 10% 55%;+ --destructive: 0 62% 50%;+ --destructive-foreground: 0 0% 100%;+ --border: 220 20% 18%; /* surface-3 */++ /* Semantic colors */+ --success: 142 71% 45%;+ --danger: 0 62% 50%;+ --warning: 38 92% 50%;+ --info: 217 91% 60%;++ /* Chart tokens */+ --chart-grid: 220 20% 12%;+ --chart-text: 220 10% 42%;+ --chart-axis: 220 20% 22%;+ --chart-compare-a: #60a5fa;+ --chart-compare-b: #fbbf24;+ }++ * { @apply border-border; }+ body { @apply bg-background text-foreground; }++ /* Prose table enhancements */+ .prose table { border-collapse: collapse; width: 100%; }+ .prose th, .prose td { border: 1px solid hsl(var(--border)); }+ .prose tbody tr:nth-child(even) { background: hsl(var(--muted) / 0.3); }++ /* Smooth scrollbar for webkit */+ ::-webkit-scrollbar { width: 6px; height: 6px; }+ ::-webkit-scrollbar-track { background: transparent; }+ ::-webkit-scrollbar-thumb { background: hsl(var(--border)); border-radius: 3px; }+ ::-webkit-scrollbar-thumb:hover { background: hsl(var(--muted-foreground)); }+}diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.tsnew file mode 100644index 000000000..c671b7c6c--- /dev/null+++ b/frontend/src/lib/api.ts@@ -0,0 +1,191 @@+const BASE = "";++async function request<T>(path: string, options?: RequestInit): Promise<T> {+ const res = await fetch(`${BASE}${path}`, {+ headers: { "Content-Type": "application/json", ...options?.headers },+ ...options,+ });+ if (!res.ok) {+ let detail = `HTTP ${res.status}`;+ try {+ const body = await res.json();+ detail = body.detail || body.message || detail;+ } catch { /* ignore */ }+ throw new Error(detail);+ }+ const text = await res.text();+ return text ? JSON.parse(text) : ({} as T);+}++export interface UploadResult {+ status: string;+ file_path: string;+ filename: string;+}++async function uploadFile(file: File): Promise<UploadResult> {+ const form = new FormData();+ form.append("file", file);+ const res = await fetch(`${BASE}/upload`, { method: "POST", body: form });+ if (!res.ok) {+ let detail = `HTTP ${res.status}`;+ try {+ const body = await res.json();+ detail = body.detail || body.message || detail;+ } catch { /* ignore */ }+ throw new Error(detail);+ }+ return res.json();+}++export const api = {+ uploadFile,+ listRuns: () => request<RunListItem[]>("/runs"),+ getRun: (id: string) => request<RunData>(`/runs/${id}`),+ getRunCode: (id: string) => request<Record<string, string>>(`/runs/${id}/code`),+ listSessions: () => request<SessionItem[]>("/sessions"),+ createSession: (title?: string) => request<SessionItem>("/sessions", { method: "POST", body: JSON.stringify({ title: title || "" }) }),+ deleteSession: (sid: string) => request<{ status: string }>(`/sessions/${sid}`, { method: "DELETE" }),+ renameSession: (sid: string, title: string) => request<{ status: string }>(`/sessions/${sid}`, { method: "PATCH", body: JSON.stringify({ title }) }),+ sendMessage: (sid: string, content: string) => request<{ message_id: string; attempt_id: string }>(`/sessions/${sid}/messages`, { method: "POST", body: JSON.stringify({ content }) }),+ cancelSession: (sid: string) => request<{ status: string }>(`/sessions/${sid}/cancel`, { method: "POST" }),+ getSessionMessages: (sid: string) => request<MessageItem[]>(`/sessions/${sid}/messages`),+ sseUrl: (sid: string) => `${BASE}/sessions/${sid}/events`,++ // Swarm API+ listSwarmPresets: () => request<SwarmPreset[]>("/swarm/presets"),+ createSwarmRun: (preset_name: string, user_vars: Record<string, string>) =>+ request<{ id: string; status: string }>("/swarm/runs", {+ method: "POST",+ body: JSON.stringify({ preset_name, user_vars }),+ }),+ listSwarmRuns: () => request<SwarmRunSummary[]>("/swarm/runs"),+ getSwarmRun: (id: string) => request<Record<string, unknown>>(`/swarm/runs/${id}`),+ cancelSwarmRun: (id: string) =>+ request<{ status: string }>(`/swarm/runs/${id}/cancel`, { method: "POST" }),+};++// --- Swarm types ---++export interface SwarmPreset {+ name: string;+ title: string;+ description: string;+ agent_count: number;+ variables: { name: string; description: string; required: boolean }[];+}++export interface SwarmRunSummary {+ id: string;+ preset_name: string;+ status: string;+ created_at: string;+ task_count: number;+ completed_count: number;+}++// --- Types matching backend API contracts ---++export interface RunListItem {+ run_id: string;+ status: string;+ created_at: string;+ prompt?: string;+ total_return?: number;+ sharpe?: number;+ codes?: string[];+ start_date?: string;+ end_date?: string;+}++export interface PriceBar {+ time: string;+ timestamp?: string;+ code?: string;+ open: number;+ high: number;+ low: number;+ close: number;+ volume: number;+}++export interface TradeMarker {+ time: string;+ timestamp?: string;+ code?: string;+ side: "BUY" | "SELL";+ price: number;+ qty?: number;+ reason?: string;+ text?: string;+}++export interface EquityPoint {+ time: string;+ equity: string | number;+ drawdown: string | number;+}++export interface RunData {+ status: string;+ run_id: string;+ prompt?: string;+ elapsed_seconds?: number;+ run_directory?: string;+ run_stage?: string;+ run_context?: Record<string, unknown>;++ metrics?: BacktestMetrics;+ artifacts?: ArtifactInfo[];++ price_series?: Record<string, PriceBar[]>;+ indicator_series?: Record<string, Record<string, IndicatorPoint[]>>;+ trade_markers?: TradeMarker[];+ equity_curve?: EquityPoint[];+ trade_log?: Array<Record<string, string>>;+ run_logs?: Array<{ source?: string; line_number?: number; message?: string }>;+}++export interface BacktestMetrics {+ final_value: number;+ total_return: number;+ annual_return: number;+ max_drawdown: number;+ sharpe: number;+ win_rate: number;+ trade_count: number;+ [key: string]: number;+}+++export interface IndicatorPoint {+ time: string;+ value: number;+}++export interface ArtifactInfo {+ name: string;+ path: string;+ type: string;+ size: number;+ exists: boolean;+}++export interface SessionItem {+ session_id: string;+ title?: string;+ status?: string;+ created_at?: string;+ updated_at?: string;+ last_attempt_id?: string;+}++export interface MessageItem {+ message_id: string;+ session_id: string;+ role: string;+ content: string;+ created_at: string;+ linked_attempt_id?: string;+ metadata?: Record<string, unknown>;+}diff --git a/frontend/src/lib/chart-theme.ts b/frontend/src/lib/chart-theme.tsnew file mode 100644index 000000000..a4fea7067--- /dev/null+++ b/frontend/src/lib/chart-theme.ts@@ -0,0 +1,65 @@+function css(name: string): string {+ return getComputedStyle(document.documentElement).getPropertyValue(name).trim();+}++function hslToHex(hsl: string): string {+ if (!hsl) return "";+ const [h, s, l] = hsl.split(/\s+/).map(parseFloat);+ if (isNaN(h)) return "";+ const a = (s / 100) * Math.min(l / 100, 1 - l / 100);+ const f = (n: number) => {+ const k = (n + h / 30) % 12;+ const color = l / 100 - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);+ return Math.round(255 * color).toString(16).padStart(2, "0");+ };+ return `#${f(0)}${f(8)}${f(4)}`;+}++function isChinese(): boolean {+ return (document.documentElement.lang || navigator.language || "").startsWith("zh");+}++let _cache: ReturnType<typeof buildTheme> | null = null;+let _cacheKey = "";++function buildTheme() {+ const cn = isChinese();+ const isDark = document.documentElement.classList.contains("dark");++ const successHex = hslToHex(css("--success")) || "#22c55e";+ const dangerHex = hslToHex(css("--danger")) || "#ef4444";+ const infoHex = hslToHex(css("--info")) || "#3b82f6";+ const warningHex = hslToHex(css("--warning")) || "#f59e0b";+ const gridHex = hslToHex(css("--chart-grid")) || (isDark ? "#1e2433" : "#e5e7eb");+ const textHex = hslToHex(css("--chart-text")) || "#6b7280";+ const axisHex = hslToHex(css("--chart-axis")) || "#374151";++ // Locale-aware candlestick colors: China = red up / green down+ const upHex = cn ? dangerHex : successHex;+ const downHex = cn ? successHex : dangerHex;++ return {+ gridColor: gridHex,+ textColor: textHex,+ axisColor: axisHex,+ upColor: upHex,+ downColor: downHex,+ maColors: [warningHex, "#8b5cf6", infoHex],+ bollColor: "rgba(99,102,241,0.5)",+ volumeUp: upHex + "66",+ volumeDown: downHex + "66",+ infoColor: infoHex,+ warningColor: warningHex,+ tooltipBg: isDark ? "rgba(10,14,22,0.92)" : "rgba(255,255,255,0.96)",+ tooltipBorder: isDark ? "#1e2433" : "#e5e7eb",+ tooltipText: isDark ? "#d1d5db" : "#374151",+ };+}++export function getChartTheme() {+ const key = `${document.documentElement.className}|${document.documentElement.lang || navigator.language}`;+ if (_cache && _cacheKey === key) return _cache;+ _cache = buildTheme();+ _cacheKey = key;+ return _cache;+}diff --git a/frontend/src/lib/echarts.ts b/frontend/src/lib/echarts.tsnew file mode 100644index 000000000..e4a79cf80--- /dev/null+++ b/frontend/src/lib/echarts.ts@@ -0,0 +1,34 @@+import * as echarts from "echarts/core";+import { CandlestickChart, LineChart, BarChart } from "echarts/charts";+import {+ GridComponent,+ TooltipComponent,+ LegendComponent,+ DataZoomComponent,+ MarkPointComponent,+ ToolboxComponent,+ MarkLineComponent,+ MarkAreaComponent,+} from "echarts/components";+import { CanvasRenderer } from "echarts/renderers";++echarts.use([+ CandlestickChart, LineChart, BarChart,+ GridComponent, TooltipComponent, LegendComponent,+ DataZoomComponent, MarkPointComponent,+ ToolboxComponent, MarkLineComponent, MarkAreaComponent,+ CanvasRenderer,+]);++export const CHART_GROUP = "quant-charts";++let _connected = false;++export function connectCharts() {+ if (!_connected) {+ echarts.connect(CHART_GROUP);+ _connected = true;+ }+}++export { echarts };diff --git a/frontend/src/lib/formatters.ts b/frontend/src/lib/formatters.tsnew file mode 100644index 000000000..36f856f67--- /dev/null+++ b/frontend/src/lib/formatters.ts@@ -0,0 +1,73 @@+/** Maps metric keys to i18n translation keys */+export const METRIC_I18N_KEYS: Record<string, string> = {+ total_return: "metricTotalReturn",+ annual_return: "metricAnnualReturn",+ sharpe: "metricSharpe",+ max_drawdown: "metricMaxDrawdown",+ win_rate: "metricWinRate",+ trade_count: "metricTradeCount",+ final_value: "metricFinalValue",+ calmar: "metricCalmar",+ sortino: "metricSortino",+ profit_loss_ratio: "metricProfitLossRatio",+ max_consecutive_loss: "metricMaxConsecutiveLoss",+ avg_holding_days: "metricAvgHoldingDays",+ benchmark_return: "metricBenchmarkReturn",+ excess_return: "metricExcessReturn",+ information_ratio: "metricIR",+};++/** Resolve metric label using i18n translations object */+export function getMetricLabel(k: string, t: Record<string, string>): string {+ const i18nKey = METRIC_I18N_KEYS[k];+ return i18nKey ? (t[i18nKey] || k) : k;+}++const PCT_KEYS = ["total_return", "annual_return", "win_rate", "max_drawdown", "benchmark_return", "excess_return"];+const RATIO_KEYS = ["sharpe", "calmar", "sortino", "profit_loss_ratio", "information_ratio"];+const INT_KEYS = ["trade_count", "max_consecutive_loss"];+const NEUTRAL_KEYS = new Set(["trade_count", "avg_holding_days", "final_value"]);++export function formatMetricVal(k: string, v: number): string {+ if (PCT_KEYS.includes(k)) {+ const sign = v > 0 ? "+" : "";+ return `${sign}${(v * 100).toFixed(2)}%`;+ }+ if (RATIO_KEYS.includes(k)) {+ const sign = v > 0 ? "+" : "";+ return `${sign}${v.toFixed(2)}`;+ }+ if (INT_KEYS.includes(k)) return String(Math.round(v));+ if (k === "final_value") return v.toLocaleString(undefined, { maximumFractionDigits: 0 });+ if (k === "avg_holding_days") return v.toFixed(1);+ return v.toFixed(4);+}++export function metricSentiment(k: string, v: number): "positive" | "neutral" | "negative" {+ if (NEUTRAL_KEYS.has(k)) return "neutral";+ if (k === "max_drawdown") return v > -0.05 ? "positive" : v > -0.2 ? "neutral" : "negative";+ if (k === "max_consecutive_loss") return v <= 3 ? "positive" : v <= 6 ? "neutral" : "negative";+ if (k === "win_rate") return v >= 0.5 ? "positive" : v >= 0.35 ? "neutral" : "negative";+ if (k === "sharpe" || k === "calmar" || k === "sortino") return v >= 1.0 ? "positive" : v >= 0.3 ? "neutral" : "negative";+ if (k === "information_ratio") return v >= 0.5 ? "positive" : v >= 0 ? "neutral" : "negative";+ return v > 0 ? "positive" : v === 0 ? "neutral" : "negative";+}++export const DISPLAY_ORDER = [+ "total_return", "annual_return", "sharpe", "max_drawdown", "win_rate", "trade_count",+ "calmar", "sortino", "profit_loss_ratio", "max_consecutive_loss",+ "benchmark_return", "excess_return", "information_ratio", "final_value", "avg_holding_days",+];++export function formatTimestamp(ts: number): string {+ const d = new Date(ts);+ return `${d.getHours().toString().padStart(2, "0")}:${d.getMinutes().toString().padStart(2, "0")}`;+}++export function abbreviateNum(v: number): string {+ const abs = Math.abs(v);+ if (abs >= 1e9) return (v / 1e9).toFixed(1) + "B";+ if (abs >= 1e6) return (v / 1e6).toFixed(1) + "M";+ if (abs >= 1e4) return (v / 1e3).toFixed(0) + "K";+ return v.toLocaleString();+}diff --git a/frontend/src/lib/i18n.tsx b/frontend/src/lib/i18n.tsxnew file mode 100644index 000000000..d1d243742--- /dev/null+++ b/frontend/src/lib/i18n.tsx@@ -0,0 +1,120 @@+import { createContext, useContext, type ReactNode } from "react";++const messages = {+ home: "Home", agent: "Agent", runs: "Runs", settings: "Settings",+ startResearch: "Start Research", describeStrategy: "Describe a trading strategy to get started.",+ prompt: "e.g. Create a dual MA crossover strategy for 000001.SZ, backtest 2024",+ send: "Send", loading: "Loading...", noRuns: "No runs yet. Go to Agent to create one.",+ runHistory: "Run History", status: "Status", elapsed: "Elapsed",+ chart: "Chart", trades: "Trades", code: "Code", trace: "Trace",+ noData: "No data available", noTrades: "No trades recorded.", noCode: "No code files.",+ noTrace: "No trace data.", priceAndTrades: "Price & Trades", equityAndDrawdown: "Equity & Drawdown",+ examples: "Try an example:", bye: "Goodbye",+ heroTitle: "AI-Powered Quant Strategy Research",+ heroDesc: "Describe a trading strategy in natural language. The agent generates code, runs backtests, and optimizes โ all in real time.",+ feat1: "AI Agent", feat1d: "Natural language strategy generation with ReAct reasoning",+ feat2: "Built-in Backtest", feat2d: "3 data sources: A-shares, US/HK, Crypto",+ feat3: "Real-time Streaming", feat3d: "Watch the agent think, call tools, and iterate",+ score: "Score", passed: "Passed", failed: "Failed", findings: "Findings", recommendations: "Recommendations",+ darkMode: "Dark", lightMode: "Light", language: "Language",+ sessions: "Sessions", newChat: "New Chat", deleteConfirm: "Delete?",+ noSessions: "No sessions yet",+ viewDetails: "View Details",+ fullReport: "Full Report โ",+ strategyComparison: "Strategy Comparison",+ baseline: "Baseline", compareTo: "Compare", delta: "Delta", metric: "Metric",+ selectRun: "-- Select --",+ selectTwoRuns: "Select two runs to compare their metrics.",+ online: "Online", offline: "Offline",+ checking: "Checkingโฆ", checkConnection: "Check Connection",+ appearance: "Appearance",+ connection: "Connection",+ endpoints: "Endpoints",+ review: "Review",+ noReview: "No review data available.",+ colTime: "Time", colCode: "Code", colSide: "Side",+ colPrice: "Price", colQty: "Qty", colReason: "Reason",+ equityDrawdown: "Equity & Drawdown",+ noPriceData: "No price data", noEquityData: "No equity data",+ filterLogs: "Filter logs...",+ confirmDelete: "Confirm", cancelDelete: "Cancel",+ reconnectingN: "Connection lost, reconnecting (attempt {n})โฆ",+ disconnected: "Connection lost",+ sessionCreated: "Session started",+ sendFailed: "Failed to send message, please retry.",+ reconnecting: "Connection lost, reconnectingโฆ",+ connected: "Connection restored",+ toolLoadSkill: "Load strategy knowledge",+ toolWriteFile: "Generate code",+ toolEditFile: "Edit code",+ toolReadFile: "Read file",+ toolRunBacktest: "Run backtest",+ toolBash: "Run command",+ toolReadUrl: "Read webpage",+ toolReadDocument: "Read document",+ toolCompact: "Compact context",+ toolCreateTask: "Create task",+ toolUpdateTask: "Update task",+ toolSpawnSubagent: "Spawn sub-agent",+ toolProcessing: "Processing",+ toolRunning: "Running",+ thinkingRunning: "Running {tool}...",+ thinkingDone: "Done ยท {count} steps",+ metricTotalReturn: "Total Return",+ metricAnnualReturn: "Annual",+ metricSharpe: "Sharpe",+ metricMaxDrawdown: "Max DD",+ metricWinRate: "Win Rate",+ metricTradeCount: "Trades",+ metricFinalValue: "Final Value",+ metricCalmar: "Calmar",+ metricSortino: "Sortino",+ metricProfitLossRatio: "P/L Ratio",+ metricMaxConsecutiveLoss: "Max Consec. Loss",+ metricAvgHoldingDays: "Avg Hold Days",+ metricBenchmarkReturn: "Benchmark",+ metricExcessReturn: "Excess Return",+ metricIR: "IR",+ overlayMA: "Moving Avg",+ overlayChannel: "Channel",+ overlayIndicators: "Indicators",+ overlayClearAll: "Bare K (clear all)",+ rename: "Rename",+ goBack: "Go back",+ noChartData: "No chart data available",+ noChartDataHint: "The backtest engine may not have generated price data. Check the artifacts/ directory.",+ executionFailed: "Execution failed",+ executionTimeout: "Execution timed out, automatically stopped",+ cancelSent: "Cancel request sent",+ cancelFailed: "Cancel failed",+ exportChat: "Export chat",+ stopGeneration: "Stop generation",+ newMessages: "New messages",+ stepN: "Step {n}",+ exportTitle: "# Chat Export",+ exportTime: "Export time",+ exportUser: "## User",+ exportAssistant: "## Assistant",+ exportError: "## Error",+ exportToolCall: "> Tool call",+ exportRunComplete: "> Backtest complete",+ downloadTradesCsv: "Download Trades CSV",+ downloadMetricsCsv: "Download Metrics CSV",+ example1: "Dual MA crossover on 000001.SZ (5/20 day), backtest 2024",+ example2: "Build a dual MA crossover strategy for 000001.SZ, backtest 2024",+ example3: "Bollinger band mean-reversion on 600519.SH, backtest last 3 years",+} as const;++type Messages = typeof messages;++const I18nCtx = createContext<{ t: Messages }>({ t: messages });++export function I18nProvider({ children }: { children: ReactNode }) {+ return (+ <I18nCtx.Provider value={{ t: messages }}>+ {children}+ </I18nCtx.Provider>+ );+}++export function useI18n() { return useContext(I18nCtx); }diff --git a/frontend/src/lib/indicators.ts b/frontend/src/lib/indicators.tsnew file mode 100644index 000000000..f8eb2c852--- /dev/null+++ b/frontend/src/lib/indicators.ts@@ -0,0 +1,113 @@+type N = number | null;++export function calcMA(data: number[], period: number): N[] {+ return data.map((_, i) => {+ if (i < period - 1) return null;+ let s = 0;+ for (let j = i - period + 1; j <= i; j++) s += data[j];+ return s / period;+ });+}++export function calcEMA(data: number[], period: number): N[] {+ const k = 2 / (period + 1);+ const out: N[] = [];+ let ema: number | null = null;+ for (let i = 0; i < data.length; i++) {+ if (i < period - 1) {+ out.push(null);+ } else if (ema === null) {+ let s = 0;+ for (let j = 0; j < period; j++) s += data[j];+ ema = s / period;+ out.push(ema);+ } else {+ ema = data[i] * k + ema * (1 - k);+ out.push(ema);+ }+ }+ return out;+}++export function calcBOLL(data: number[], period = 20, mult = 2) {+ const mid = calcMA(data, period);+ const upper: N[] = [];+ const lower: N[] = [];+ for (let i = 0; i < data.length; i++) {+ if (mid[i] === null) { upper.push(null); lower.push(null); continue; }+ let sq = 0;+ for (let j = i - period + 1; j <= i; j++) sq += (data[j] - mid[i]!) ** 2;+ const std = Math.sqrt(sq / period);+ upper.push(mid[i]! + mult * std);+ lower.push(mid[i]! - mult * std);+ }+ return { upper, mid, lower };+}++export function calcMACD(data: number[], fast = 12, slow = 26, sig = 9) {+ const ef = calcEMA(data, fast);+ const es = calcEMA(data, slow);+ const dif: N[] = data.map((_, i) =>+ ef[i] !== null && es[i] !== null ? ef[i]! - es[i]! : null+ );++ // Signal = EMA of non-null DIF values+ const valid: number[] = [];+ const idx: number[] = [];+ dif.forEach((v, i) => { if (v !== null) { valid.push(v); idx.push(i); } });+ const sigEma = calcEMA(valid, sig);++ const signal: N[] = new Array(data.length).fill(null);+ const hist: N[] = new Array(data.length).fill(null);+ idx.forEach((ii, j) => {+ if (sigEma[j] !== null) {+ signal[ii] = sigEma[j];+ hist[ii] = dif[ii]! - sigEma[j]!;+ }+ });+ return { dif, signal, histogram: hist };+}++export function calcRSI(data: number[], period = 14): N[] {+ if (data.length < period + 1) return data.map(() => null);+ const out: N[] = new Array(data.length).fill(null);+ let avgG = 0, avgL = 0;+ for (let i = 1; i <= period; i++) {+ const c = data[i] - data[i - 1];+ if (c > 0) avgG += c; else avgL -= c;+ }+ avgG /= period;+ avgL /= period;+ out[period] = avgL === 0 ? 100 : 100 - 100 / (1 + avgG / avgL);+ for (let i = period + 1; i < data.length; i++) {+ const c = data[i] - data[i - 1];+ avgG = (avgG * (period - 1) + (c > 0 ? c : 0)) / period;+ avgL = (avgL * (period - 1) + (c < 0 ? -c : 0)) / period;+ out[i] = avgL === 0 ? 100 : 100 - 100 / (1 + avgG / avgL);+ }+ return out;+}++export function calcKDJ(highs: number[], lows: number[], closes: number[], period = 9) {+ const n = closes.length;+ const k: N[] = new Array(n).fill(null);+ const d: N[] = new Array(n).fill(null);+ const j: N[] = new Array(n).fill(null);+ if (n < period) return { k, d, j };++ let pk = 50, pd = 50;+ for (let i = period - 1; i < n; i++) {+ let hi = -Infinity, lo = Infinity;+ for (let p = i - period + 1; p <= i; p++) {+ if (highs[p] > hi) hi = highs[p];+ if (lows[p] < lo) lo = lows[p];+ }+ const rsv = hi === lo ? 50 : ((closes[i] - lo) / (hi - lo)) * 100;+ pk = (pk * 2 + rsv) / 3;+ pd = (pd * 2 + pk) / 3;+ k[i] = pk;+ d[i] = pd;+ j[i] = 3 * pk - 2 * pd;+ }+ return { k, d, j };+}diff --git a/frontend/src/lib/utils.ts b/frontend/src/lib/utils.tsnew file mode 100644index 000000000..a5ef19350--- /dev/null+++ b/frontend/src/lib/utils.ts@@ -0,0 +1,6 @@+import { clsx, type ClassValue } from "clsx";+import { twMerge } from "tailwind-merge";++export function cn(...inputs: ClassValue[]) {+ return twMerge(clsx(inputs));+}diff --git a/frontend/src/main.tsx b/frontend/src/main.tsxnew file mode 100644index 000000000..1c7e7c226--- /dev/null+++ b/frontend/src/main.tsx@@ -0,0 +1,20 @@+import { StrictMode } from "react";+import { createRoot } from "react-dom/client";+import { RouterProvider } from "react-router-dom";+import { Toaster } from "sonner";+import { I18nProvider } from "./lib/i18n";+import { ErrorBoundary } from "./components/common/ErrorBoundary";+import { router } from "./router";+import "highlight.js/styles/github-dark-dimmed.min.css";+import "./index.css";++createRoot(document.getElementById("root")!).render(+ <StrictMode>+ <ErrorBoundary>+ <I18nProvider>+ <RouterProvider router={router} />+ <Toaster position="bottom-right" richColors closeButton duration={3500} />+ </I18nProvider>+ </ErrorBoundary>+ </StrictMode>+);diff --git a/frontend/src/pages/Agent.tsx b/frontend/src/pages/Agent.tsxnew file mode 100644index 000000000..b59254807--- /dev/null+++ b/frontend/src/pages/Agent.tsx@@ -0,0 +1,845 @@+import { useEffect, useRef, useState, useMemo, useCallback, type FormEvent } from "react";+import { useSearchParams } from "react-router-dom";+import { Send, Loader2, ArrowDown, CheckCircle2, Square, Download, Plus, Paperclip, X, Users } from "lucide-react";+import { toast } from "sonner";+import { useAgentStore } from "@/stores/agent";+import { useSSE } from "@/hooks/useSSE";+import { useI18n } from "@/lib/i18n";+import { api } from "@/lib/api";+import type { AgentMessage, ToolCallEntry } from "@/types/agent";+import { AgentAvatar } from "@/components/chat/AgentAvatar";+import { WelcomeScreen } from "@/components/chat/WelcomeScreen";+import { MessageBubble } from "@/components/chat/MessageBubble";+import { ThinkingTimeline } from "@/components/chat/ThinkingTimeline";+import { ConversationTimeline } from "@/components/chat/ConversationTimeline";+import { SwarmDashboard, type SwarmAgent, type SwarmDashboardProps } from "@/components/chat/SwarmDashboard";++/* ---------- Message grouping ---------- */+type MsgGroup =+ | { kind: "single"; msg: AgentMessage }+ | { kind: "timeline"; msgs: AgentMessage[] };++function groupMessages(msgs: AgentMessage[]): MsgGroup[] {+ const out: MsgGroup[] = [];+ let buf: AgentMessage[] = [];+ const flush = () => { if (buf.length) { out.push({ kind: "timeline", msgs: [...buf] }); buf = []; } };+ for (const m of msgs) {+ if (["thinking", "tool_call", "tool_result", "compact"].includes(m.type)) {+ buf.push(m);+ } else {+ flush();+ out.push({ kind: "single", msg: m });+ }+ }+ flush();+ return out;+}++const act = () => useAgentStore.getState();++/* ---------- Component ---------- */+export function Agent() {+ const [input, setInput] = useState("");+ const [searchParams, setSearchParams] = useSearchParams();+ const listRef = useRef<HTMLDivElement>(null);+ const inputRef = useRef<HTMLTextAreaElement>(null);+ const sseSessionRef = useRef<string | null>(null);+ const prevSseStatusRef = useRef<string>("disconnected");+ const genRef = useRef(0);+ const [showScrollBtn, setShowScrollBtn] = useState(false);+ const lastEventRef = useRef(0);++ const [attachment, setAttachment] = useState<{ filename: string; filePath: string } | null>(null);+ const [uploading, setUploading] = useState(false);+ const [showUploadMenu, setShowUploadMenu] = useState(false);+ const uploadMenuRef = useRef<HTMLDivElement>(null);+ const fileInputRef = useRef<HTMLInputElement>(null);+ const [swarmPreset, setSwarmPreset] = useState<{ name: string; title: string } | null>(null);+ const swarmCancelRef = useRef(false);+ const [swarmDash, setSwarmDash] = useState<SwarmDashboardProps | null>(null);+ const swarmDashRef = useRef<SwarmDashboardProps | null>(null);++ const messages = useAgentStore(s => s.messages);+ const streamingText = useAgentStore(s => s.streamingText);+ const status = useAgentStore(s => s.status);+ const sessionId = useAgentStore(s => s.sessionId);+ const toolCalls = useAgentStore(s => s.toolCalls);+ const sessionLoading = useAgentStore(s => s.sessionLoading);++ const { connect, disconnect, onStatusChange } = useSSE();+ const { t } = useI18n();++ const urlSessionId = searchParams.get("session");++ /* Smart scroll โ only auto-scroll when near bottom */+ const isNearBottom = useCallback(() => {+ const el = listRef.current;+ if (!el) return true;+ return el.scrollHeight - el.scrollTop - el.clientHeight < 100;+ }, []);++ const rafRef = useRef(0);+ const scrollToBottom = useCallback(() => {+ if (!isNearBottom()) {+ setShowScrollBtn(true);+ return;+ }+ cancelAnimationFrame(rafRef.current);+ rafRef.current = requestAnimationFrame(() => {+ if (listRef.current) listRef.current.scrollTop = listRef.current.scrollHeight;+ });+ }, [isNearBottom]);++ const forceScrollToBottom = useCallback(() => {+ setShowScrollBtn(false);+ requestAnimationFrame(() => {+ if (listRef.current) listRef.current.scrollTop = listRef.current.scrollHeight;+ });+ }, []);++ /* Track scroll position to show/hide scroll button */+ useEffect(() => {+ const el = listRef.current;+ if (!el) return;+ const onScroll = () => {+ if (isNearBottom()) setShowScrollBtn(false);+ };+ el.addEventListener("scroll", onScroll, { passive: true });+ return () => el.removeEventListener("scroll", onScroll);+ }, [isNearBottom]);++ useEffect(() => {+ onStatusChange((s) => {+ act().setSseStatus(s);+ if (s === "reconnecting" && prevSseStatusRef.current === "connected") toast.warning(t.reconnecting);+ else if (s === "connected" && prevSseStatusRef.current === "reconnecting") toast.success(t.connected);+ prevSseStatusRef.current = s;+ });+ }, [onStatusChange, t]);++ const doDisconnect = useCallback(() => {+ disconnect();+ sseSessionRef.current = null;+ }, [disconnect]);++ const loadSessionMessages = useCallback(async (sid: string, gen: number) => {+ try {+ const msgs = await api.getSessionMessages(sid);+ if (genRef.current !== gen) return;+ const agentMsgs: AgentMessage[] = [];+ for (const m of msgs) {+ const meta = m.metadata as Record<string, unknown> | undefined;+ const runId = meta?.run_id as string | undefined;+ const metrics = meta?.metrics as Record<string, number> | undefined;+ const ts = new Date(m.created_at).getTime();+ if (m.role === "user") {+ agentMsgs.push({ id: m.message_id, type: "user", content: m.content, timestamp: ts });+ } else if (runId) {+ // Show text answer first (if non-empty), then chart card+ if (m.content && m.content !== "Strategy execution completed.") {+ agentMsgs.push({ id: m.message_id + "_ans", type: "answer", content: m.content, timestamp: ts });+ }+ agentMsgs.push({ id: m.message_id, type: "run_complete", content: "", runId, metrics, timestamp: ts + 1 });+ } else {+ agentMsgs.push({ id: m.message_id, type: "answer", content: m.content, timestamp: ts });+ }+ }+ if (genRef.current !== gen) return;+ act().loadHistory(agentMsgs);+ act().setSessionLoading(false);+ act().cacheSession(sid, agentMsgs);+ setTimeout(() => forceScrollToBottom(), 50);+ } catch {+ act().setSessionLoading(false);+ }+ }, [forceScrollToBottom]);++ const setupSSE = useCallback((sid: string) => {+ if (sseSessionRef.current === sid) return;+ disconnect();+ sseSessionRef.current = sid;++ const touch = () => { lastEventRef.current = Date.now(); };++ connect(api.sseUrl(sid), {+ text_delta: (d) => { touch(); act().appendDelta(String(d.delta || "")); scrollToBottom(); },+ thinking_done: () => { touch(); /* don't flush โ keep streaming text visible */ },++ tool_call: (d) => {+ touch();+ const toolName = String(d.tool || "");+ // Only update toolCalls tracker (no message creation during streaming)+ act().addToolCall({+ id: toolName, tool: toolName,+ arguments: (d.arguments as Record<string, string>) ?? {},+ status: "running", timestamp: Date.now(),+ });+ scrollToBottom();+ },++ tool_result: (d) => {+ touch();+ // Only update tracker (no message creation during streaming)+ act().updateToolCall(String(d.tool || ""), {+ status: d.status === "ok" ? "ok" : "error",+ preview: String(d.preview || ""),+ elapsed_ms: Number(d.elapsed_ms || 0),+ });+ },++ compact: () => { touch(); },++ "attempt.completed": async (d) => {+ touch();+ const s = act();+ // Build ThinkingTimeline summary from accumulated toolCalls+ const completedTools = s.toolCalls;+ if (completedTools.length > 0) {+ const totalMs = completedTools.reduce((a, tc) => a + (tc.elapsed_ms || 0), 0);+ for (const tc of completedTools) {+ s.addMessage({ id: tc.id + "_call", type: "tool_call", content: "", tool: tc.tool, args: tc.arguments, status: tc.status || "ok", timestamp: tc.timestamp });+ if (tc.elapsed_ms != null) {+ s.addMessage({ id: "", type: "tool_result", content: tc.preview || "", tool: tc.tool, status: tc.status || "ok", elapsed_ms: tc.elapsed_ms, timestamp: tc.timestamp + 1 });+ }+ }+ }++ // Clear streaming text (don't create thinking message)+ s.clearStreaming();++ // Add final answer+ const runDir = String(d.run_dir || "");+ const runId = runDir ? runDir.split(/[/\\]/).pop() : undefined;+ const summary = String(d.summary || "");+ if (summary) s.addMessage({ id: "", type: "answer", content: summary, timestamp: Date.now() });++ // Only show RunCompleteCard if backtest produced metrics+ if (runId) {+ try {+ const runData = await api.getRun(runId);+ const hasMetrics = runData.metrics && Object.keys(runData.metrics).length > 0;+ if (hasMetrics) {+ s.addMessage({+ id: "", type: "run_complete", content: "", runId,+ metrics: runData.metrics,+ equityCurve: runData.equity_curve?.map(e => ({ time: e.time, equity: e.equity })),+ timestamp: Date.now(),+ });+ }+ } catch { /* ignore */ }+ }++ // Reset+ s.setStatus("idle");+ useAgentStore.setState({ toolCalls: [] });+ scrollToBottom();+ },++ "attempt.failed": (d) => {+ touch();+ act().clearStreaming();+ act().addMessage({ id: "", type: "error", content: String(d.error || "Execution failed"), timestamp: Date.now() });+ act().setStatus("idle");+ scrollToBottom();+ },++ heartbeat: () => {},+ reconnect: (d) => { act().setSseStatus("reconnecting", Number(d.attempt ?? 0)); },+ });+ }, [connect, disconnect, scrollToBottom]);++ useEffect(() => {+ const gen = ++genRef.current;+ const { sessionId: curSid, messages: curMsgs, cacheSession, reset, getCachedSession, switchSession } = act();++ if (urlSessionId && urlSessionId !== curSid) {+ doDisconnect();+ if (curSid && curMsgs.length > 0) cacheSession(curSid, curMsgs);++ // Atomic switch: cache hit = instant, cache miss = show loading skeleton+ const cached = getCachedSession(urlSessionId);+ switchSession(urlSessionId, cached);+ if (cached) {+ setTimeout(() => forceScrollToBottom(), 50);+ } else {+ loadSessionMessages(urlSessionId, gen);+ }+ setupSSE(urlSessionId);+ } else if (!urlSessionId && curSid) {+ doDisconnect();+ if (curMsgs.length > 0) cacheSession(curSid, curMsgs);+ reset();+ }+ }, [urlSessionId, doDisconnect, loadSessionMessages, setupSSE, forceScrollToBottom]);++ useEffect(() => () => doDisconnect(), [doDisconnect]);++ /* Safety timeout: if streaming but no SSE event for 90s, reset to idle */+ useEffect(() => {+ if (status !== "streaming") return;+ const timer = setInterval(() => {+ if (lastEventRef.current && Date.now() - lastEventRef.current > 90_000 && act().status === "streaming") {+ act().setStatus("idle");+ toast.warning("Execution timed out, automatically stopped");+ }+ }, 10_000);+ return () => clearInterval(timer);+ }, [status]);++ const runSwarm = async (presetName: string, presetTitle: string, prompt: string) => {+ let sid = act().sessionId;+ if (!sid) {+ try {+ const session = await api.createSession(`[Swarm] ${presetTitle}: ${prompt.slice(0, 30)}`);+ sid = session.session_id;+ act().setSessionId(sid);+ setSearchParams({ session: sid }, { replace: true });+ } catch { /* continue without session */ }+ }++ act().addMessage({ id: "", type: "user", content: `[${presetTitle}] ${prompt}`, timestamp: Date.now() });+ act().setStatus("streaming");+ // Add a placeholder swarm-progress message (rendered as SwarmDashboard)+ act().addMessage({ id: "swarm-progress", type: "answer", content: "", timestamp: Date.now() });+ forceScrollToBottom();+ swarmCancelRef.current = false;++ // Initialize dashboard state+ const dash: SwarmDashboardProps = {+ preset: presetTitle,+ agents: {},+ agentOrder: [],+ currentLayer: 0,+ finished: false,+ finalStatus: "",+ startTime: Date.now(),+ completedSummaries: [],+ finalReport: "",+ };+ swarmDashRef.current = dash;+ setSwarmDash({ ...dash });++ const ensureAgent = (agentId: string): SwarmAgent => {+ if (!dash.agents[agentId]) {+ dash.agents[agentId] = {+ id: agentId, status: "waiting", tool: "", iters: 0,+ startedAt: 0, elapsed: 0, lastText: "", summary: "",+ };+ dash.agentOrder.push(agentId);+ }+ return dash.agents[agentId];+ };++ const flush = () => { swarmDashRef.current = dash; setSwarmDash({ ...dash }); scrollToBottom(); };++ try {+ const result = await api.createSwarmRun(presetName, { goal: prompt });+ const runId = result.id;+ const sseUrl = `/swarm/runs/${runId}/events`;+ const evtSource = new EventSource(sseUrl);+ let sseFinished = false;++ evtSource.addEventListener("layer_started", (e) => {+ try {+ const d = JSON.parse(e.data);+ dash.currentLayer = d.data?.layer ?? 0;+ flush();+ } catch {}+ });++ evtSource.addEventListener("task_started", (e) => {+ try {+ const d = JSON.parse(e.data);+ const agentId = d.agent_id || "";+ if (agentId) {+ const a = ensureAgent(agentId);+ a.status = "running";+ a.startedAt = Date.now();+ flush();+ }+ } catch {}+ });++ evtSource.addEventListener("worker_text", (e) => {+ try {+ const d = JSON.parse(e.data);+ const agentId = d.agent_id || "";+ const content = (d.data?.content || "").trim();+ if (agentId && content) {+ const a = ensureAgent(agentId);+ const lastLine = content.split("\n").pop()?.trim() || "";+ if (lastLine) a.lastText = lastLine.slice(0, 60);+ flush();+ }+ } catch {}+ });++ evtSource.addEventListener("tool_call", (e) => {+ try {+ const d = JSON.parse(e.data);+ const agentId = d.agent_id || "";+ const tool = d.data?.tool || "";+ if (agentId && tool) {+ const a = ensureAgent(agentId);+ a.tool = tool;+ a.iters++;+ flush();+ }+ } catch {}+ });++ evtSource.addEventListener("tool_result", (e) => {+ try {+ const d = JSON.parse(e.data);+ const agentId = d.agent_id || "";+ if (agentId) {+ const a = ensureAgent(agentId);+ const ok = (d.data?.status || "ok") === "ok";+ a.tool = `${a.tool} ${ok ? "\u2713" : "\u2717"}`;+ a.elapsed = a.startedAt ? Date.now() - a.startedAt : 0;+ flush();+ }+ } catch {}+ });++ evtSource.addEventListener("task_completed", (e) => {+ try {+ const d = JSON.parse(e.data);+ const agentId = d.agent_id || "";+ if (agentId) {+ const a = ensureAgent(agentId);+ a.status = "done";+ a.elapsed = a.startedAt ? Date.now() - a.startedAt : 0;+ a.iters = d.data?.iterations ?? a.iters;+ const summary = d.data?.summary || "";+ if (summary) {+ a.summary = summary;+ dash.completedSummaries.push({ agentId, summary });+ }+ flush();+ }+ } catch {}+ });++ evtSource.addEventListener("task_failed", (e) => {+ try {+ const d = JSON.parse(e.data);+ const agentId = d.agent_id || "";+ if (agentId) {+ const a = ensureAgent(agentId);+ a.status = "failed";+ a.elapsed = a.startedAt ? Date.now() - a.startedAt : 0;+ const error = (d.data?.error || "").slice(0, 80);+ dash.completedSummaries.push({ agentId, summary: `FAILED: ${error}` });+ flush();+ }+ } catch {}+ });++ evtSource.addEventListener("task_retry", (e) => {+ try {+ const d = JSON.parse(e.data);+ const agentId = d.agent_id || "";+ if (agentId) { ensureAgent(agentId).status = "retry"; flush(); }+ } catch {}+ });++ evtSource.addEventListener("done", () => { sseFinished = true; evtSource.close(); });+ evtSource.onerror = () => { if (!sseFinished) evtSource.close(); };++ // Poll for completion+ for (let i = 0; i < 720; i++) {+ await new Promise(r => setTimeout(r, 2500));+ if (swarmCancelRef.current) { evtSource.close(); break; }+ try {+ const run = await api.getSwarmRun(runId);+ const rs = String(run.status || "");+ if (["completed", "failed", "cancelled"].includes(rs)) {+ evtSource.close();+ dash.finished = true;+ dash.finalStatus = rs;+ const report = String(run.final_report || "");+ if (!report) {+ const tasks = (run.tasks || []) as Array<{ agent_id: string; summary?: string }>;+ dash.finalReport = tasks+ .filter(t => t.summary && !t.summary.startsWith("Worker hit iteration limit"))+ .map(t => `### ${t.agent_id}\n${t.summary}`)+ .join("\n\n") || "Swarm completed.";+ } else {+ dash.finalReport = report;+ }+ flush();+ act().setStatus("idle");+ return;+ }+ } catch {}+ }+ evtSource.close();+ act().addMessage({ id: "", type: "error", content: "Swarm timed out", timestamp: Date.now() });+ act().setStatus("idle");+ } catch (err) {+ act().setStatus("error");+ act().addMessage({ id: "", type: "error", content: `Swarm failed: ${err instanceof Error ? err.message : "Unknown"}`, timestamp: Date.now() });+ }+ };++ const runPrompt = async (prompt: string) => {+ if (!prompt.trim() || status === "streaming") return;++ let finalPrompt = prompt;++ // Swarm mode: let agent auto-select the right preset+ if (swarmPreset) {+ setSwarmPreset(null);+ finalPrompt = `[Swarm Team Mode] Use the swarm tool to assemble the best specialist team for this task. Auto-select the most appropriate preset.\n\n${prompt}`;+ }++ if (attachment) {+ finalPrompt = `[Uploaded file: ${attachment.filename}, path: ${attachment.filePath}]\n\n${finalPrompt}`;+ setAttachment(null);+ }+ setInput("");+ act().addMessage({ id: "", type: "user", content: finalPrompt, timestamp: Date.now() });+ act().setStatus("streaming");+ forceScrollToBottom();+ inputRef.current?.focus();++ try {+ let sid = act().sessionId;+ if (!sid) {+ const session = await api.createSession(prompt.slice(0, 50));+ sid = session.session_id;+ act().setSessionId(sid);+ setSearchParams({ session: sid }, { replace: true });+ }+ setupSSE(sid);+ await api.sendMessage(sid, finalPrompt);+ } catch {+ act().setStatus("error");+ toast.error(t.sendFailed);+ act().addMessage({ id: "", type: "error", content: t.sendFailed, timestamp: Date.now() });+ }+ };++ const handleSubmit = (e: FormEvent) => { e.preventDefault(); runPrompt(input.trim()); };++ const handleCancel = async () => {+ swarmCancelRef.current = true;+ if (!sessionId) {+ act().setStatus("idle");+ return;+ }+ try {+ await api.cancelSession(sessionId);+ act().setStatus("idle");+ act().clearStreaming();+ useAgentStore.setState({ toolCalls: [] });+ toast.info("Cancel request sent");+ } catch {+ toast.error("Cancel failed");+ }+ };++ const handleRetry = useCallback((errorMsg: AgentMessage) => {+ if (status === "streaming") return;+ const msgs = act().messages;+ const errorIdx = msgs.findIndex(m => m.id === errorMsg.id);+ if (errorIdx === -1) return;+ // Find the most recent user message before this error+ let userContent: string | null = null;+ for (let i = errorIdx - 1; i >= 0; i--) {+ if (msgs[i].type === "user") {+ userContent = msgs[i].content;+ break;+ }+ }+ if (!userContent) return;+ runPrompt(userContent);+ }, [status]);++ const handleExport = () => {+ if (messages.length === 0) return;+ const lines: string[] = [`# Chat Export`, ``, `Export time: ${new Date().toLocaleString()}`, ``];+ for (const msg of messages) {+ const time = new Date(msg.timestamp).toLocaleString();+ if (msg.type === "user") {+ lines.push(`## User (${time})`, ``, msg.content, ``);+ } else if (msg.type === "answer") {+ lines.push(`## Assistant (${time})`, ``, msg.content, ``);+ } else if (msg.type === "error") {+ lines.push(`## Error (${time})`, ``, msg.content, ``);+ } else if (msg.type === "tool_call") {+ lines.push(`> Tool call: ${msg.tool || "unknown"}`, ``);+ } else if (msg.type === "run_complete") {+ lines.push(`> Backtest complete: ${msg.runId || ""}`, ``);+ }+ }+ const blob = new Blob([lines.join("\n")], { type: "text/markdown;charset=utf-8" });+ const url = URL.createObjectURL(blob);+ const a = document.createElement("a");+ a.href = url;+ a.download = `chat_${new Date().toISOString().slice(0, 10)}.md`;+ a.click();+ URL.revokeObjectURL(url);+ };++ const handleFileSelect = useCallback(async (e: React.ChangeEvent<HTMLInputElement>) => {+ const file = e.target.files?.[0];+ if (!file) return;+ e.target.value = "";+ if (!file.name.toLowerCase().endsWith(".pdf")) {+ toast.error("Only PDF files are supported");+ return;+ }+ if (file.size > 50 * 1024 * 1024) {+ toast.error("File size exceeds 50 MB limit");+ return;+ }+ setUploading(true);+ setShowUploadMenu(false);+ try {+ const result = await api.uploadFile(file);+ setAttachment({ filename: result.filename, filePath: result.file_path });+ toast.success(`Uploaded: ${result.filename}`);+ } catch (err) {+ toast.error(`Upload failed: ${err instanceof Error ? err.message : "Unknown error"}`);+ } finally {+ setUploading(false);+ }+ }, []);++ useEffect(() => {+ const handleClickOutside = (e: MouseEvent) => {+ if (uploadMenuRef.current && !uploadMenuRef.current.contains(e.target as Node)) {+ setShowUploadMenu(false);+ }+ };+ if (showUploadMenu) {+ document.addEventListener("mousedown", handleClickOutside);+ return () => document.removeEventListener("mousedown", handleClickOutside);+ }+ }, [showUploadMenu]);++ const groups = useMemo(() => groupMessages(messages), [messages]);++ return (+ <div className="flex flex-col flex-1 min-w-0 overflow-hidden h-full">+ <div ref={listRef} className="flex-1 overflow-auto p-6 scroll-smooth relative">+ <div className="max-w-3xl mx-auto space-y-4">+ {sessionLoading && (+ <div className="space-y-4 py-4">+ {[1, 2, 3].map(i => (+ <div key={i} className="flex gap-3 animate-pulse">+ <div className="h-8 w-8 rounded-full bg-muted shrink-0" />+ <div className="flex-1 space-y-2">+ <div className="h-4 bg-muted rounded w-3/4" />+ <div className="h-3 bg-muted/60 rounded w-1/2" />+ </div>+ </div>+ ))}+ </div>+ )}+ {!sessionLoading && messages.length === 0 && <WelcomeScreen onExample={runPrompt} />}++ {groups.map((g, i) => {+ if (g.kind === "timeline") {+ return (+ <ThinkingTimeline+ key={g.msgs[0].id || g.msgs[0].timestamp}+ messages={g.msgs}+ isLatest={i === groups.length - 1 && status === "streaming"}+ />+ );+ }+ const msgIdx = messages.indexOf(g.msg);+ // Render swarm-progress as SwarmDashboard+ if (g.msg.id === "swarm-progress" && swarmDash) {+ return (+ <div key="swarm-dash" className="flex gap-3">+ <AgentAvatar />+ <div className="flex-1 min-w-0">+ <SwarmDashboard {...swarmDash} />+ </div>+ </div>+ );+ }+ return (+ <div key={g.msg.id || g.msg.timestamp} data-msg-idx={msgIdx}>+ <MessageBubble msg={g.msg} onRetry={g.msg.type === "error" ? handleRetry : undefined} />+ </div>+ );+ })}++ {/* Live streaming area: text + tool status */}+ {(streamingText || (status === "streaming" && toolCalls.length > 0)) && (+ <div className="flex gap-3">+ <AgentAvatar />+ <div className="flex-1 min-w-0 space-y-1.5">+ {streamingText && (+ <div className="prose prose-sm dark:prose-invert max-w-none leading-relaxed">+ {streamingText}+ <span className="inline-block w-0.5 h-4 bg-primary ml-0.5 animate-pulse align-middle" />+ </div>+ )}+ {status === "streaming" && toolCalls.length > 0 && (() => {+ const latest = toolCalls[toolCalls.length - 1];+ const running = latest.status === "running";+ return (+ <div className="flex items-center gap-2 text-xs text-muted-foreground">+ {running+ ? <Loader2 className="h-3 w-3 animate-spin text-primary shrink-0" />+ : <CheckCircle2 className="h-3 w-3 text-success/60 shrink-0" />}+ <span>Step {toolCalls.length} ยท {latest.tool}</span>+ </div>+ );+ })()}+ </div>+ </div>+ )}++ </div>++ {/* Scroll to bottom button */}+ {showScrollBtn && (+ <button+ onClick={forceScrollToBottom}+ className="sticky bottom-4 left-1/2 -translate-x-1/2 flex items-center gap-1 px-3 py-1.5 rounded-full bg-primary text-primary-foreground text-xs font-medium shadow-lg hover:opacity-90 transition-opacity z-10"+ >+ <ArrowDown className="h-3 w-3" /> New messages+ </button>+ )}+ <ConversationTimeline messages={messages} containerRef={listRef} />+ </div>++ <form onSubmit={handleSubmit} className="border-t p-4 bg-background/80 backdrop-blur-sm">+ <div className="max-w-3xl mx-auto space-y-2">+ {/* Swarm preset badge */}+ {swarmPreset && (+ <div className="flex items-center gap-1">+ <span className="inline-flex items-center gap-1.5 px-2.5 py-1 rounded-lg bg-violet-500/10 text-violet-600 dark:text-violet-400 text-xs font-medium">+ <Users className="h-3 w-3" />+ {swarmPreset.title}+ <button type="button" onClick={() => setSwarmPreset(null)} className="hover:text-destructive transition-colors">+ <X className="h-3 w-3" />+ </button>+ </span>+ </div>+ )}+ {/* Attachment badge */}+ {attachment && (+ <div className="flex items-center gap-1">+ <span className="inline-flex items-center gap-1.5 px-2.5 py-1 rounded-lg bg-primary/10 text-primary text-xs font-medium">+ <Paperclip className="h-3 w-3" />+ {attachment.filename}+ <button type="button" onClick={() => setAttachment(null)} className="hover:text-destructive transition-colors">+ <X className="h-3 w-3" />+ </button>+ </span>+ </div>+ )}+ {/* Uploading indicator */}+ {uploading && (+ <div className="flex items-center gap-1.5 text-xs text-muted-foreground">+ <Loader2 className="h-3 w-3 animate-spin" />+ Uploading...+ </div>+ )}+ <div className="flex gap-2 items-end">+ {/* "+" menu: PDF upload + Swarm presets */}+ <div className="relative" ref={uploadMenuRef}>+ <button+ type="button"+ onClick={() => setShowUploadMenu(prev => !prev)}+ disabled={status === "streaming" || uploading}+ className="w-9 h-9 rounded-full border flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-muted transition-colors disabled:opacity-40 shrink-0"+ title="More options"+ >+ <Plus className="h-4 w-4" />+ </button>+ {showUploadMenu && (+ <div className="absolute bottom-full left-0 mb-2 w-52 rounded-xl border bg-background/95 backdrop-blur-sm shadow-lg py-1 z-50">+ <button+ type="button"+ onClick={() => { fileInputRef.current?.click(); setShowUploadMenu(false); }}+ className="w-full px-3 py-2 text-left text-sm hover:bg-muted transition-colors flex items-center gap-2"+ >+ <Paperclip className="h-4 w-4" />+ Upload PDF document+ </button>+ <div className="border-t my-1" />+ <button+ type="button"+ onClick={() => {+ setShowUploadMenu(false);+ setSwarmPreset({ name: "auto", title: "Agent Swarm" });+ inputRef.current?.focus();+ }}+ className="w-full px-3 py-2 text-left text-sm hover:bg-muted transition-colors flex items-center gap-2"+ >+ <Users className="h-4 w-4" />+ Agent Swarm+ </button>+ </div>+ )}+ </div>+ <input+ ref={fileInputRef}+ type="file"+ accept=".pdf"+ onChange={handleFileSelect}+ className="hidden"+ />+ <textarea+ ref={inputRef}+ value={input}+ rows={1}+ onChange={(e) => setInput(e.target.value)}+ onInput={(e) => {+ const el = e.target as HTMLTextAreaElement;+ el.style.height = "auto";+ el.style.height = el.scrollHeight + "px";+ }}+ onKeyDown={(e) => {+ if (e.key === "Enter" && !e.shiftKey) {+ e.preventDefault();+ runPrompt(input.trim());+ }+ }}+ placeholder={t.prompt}+ className="flex-1 px-4 py-2.5 rounded-xl border bg-background text-sm focus:outline-none focus:ring-2 focus:ring-primary/40 transition-shadow resize-none max-h-32 overflow-y-auto"+ disabled={status === "streaming"}+ />+ {messages.length > 0 && (+ <button+ type="button"+ onClick={handleExport}+ className="px-3 py-2.5 rounded-xl border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors"+ title="Export chat"+ >+ <Download className="h-4 w-4" />+ </button>+ )}+ {status === "streaming" ? (+ <button+ type="button"+ onClick={handleCancel}+ className="px-4 py-2.5 rounded-xl bg-destructive text-destructive-foreground text-sm font-medium hover:opacity-90 transition-opacity"+ title="Stop generation"+ >+ <Square className="h-4 w-4" />+ </button>+ ) : (+ <button+ type="submit"+ disabled={!input.trim() && !attachment}+ className="px-4 py-2.5 rounded-xl bg-primary text-primary-foreground text-sm font-medium disabled:opacity-40 hover:opacity-90 transition-opacity"+ >+ <Send className="h-4 w-4" />+ </button>+ )}+ </div>+ </div>+ </form>+ </div>+ );+}diff --git a/frontend/src/pages/Compare.tsx b/frontend/src/pages/Compare.tsxnew file mode 100644index 000000000..0aa2036c5--- /dev/null+++ b/frontend/src/pages/Compare.tsx@@ -0,0 +1,320 @@+import { useEffect, useRef, useState } from "react";+import { GitCompare, ArrowRight } from "lucide-react";+import { cn } from "@/lib/utils";+import { api, type RunListItem, type RunData, type EquityPoint } from "@/lib/api";+import { useI18n } from "@/lib/i18n";+import { echarts, CHART_GROUP, connectCharts } from "@/lib/echarts";+import { getChartTheme } from "@/lib/chart-theme";+import { useDarkMode } from "@/hooks/useDarkMode";++interface MetricDef {+ key: string;+ label: string;+ type: "pct" | "num" | "int" | "days";+ higherIsBetter: boolean;+}++function fmt(v: unknown, type: "pct" | "num" | "int" | "days" = "num"): string {+ const n = Number(v);+ if (!Number.isFinite(n)) return "\u2014";+ if (type === "pct") return (n * 100).toFixed(2) + "%";+ if (type === "int") return n.toFixed(0);+ if (type === "days") return n.toFixed(1);+ return n.toFixed(3);+}++function diffClass(a: unknown, b: unknown, higherIsBetter: boolean): string {+ const na = Number(a), nb = Number(b);+ if (!Number.isFinite(na) || !Number.isFinite(nb)) return "";+ const better = higherIsBetter ? nb > na : nb < na;+ const worse = higherIsBetter ? nb < na : nb > na;+ return better ? "text-green-600 dark:text-green-400" : worse ? "text-red-600 dark:text-red-400" : "";+}++function diffStr(a: unknown, b: unknown, type: "pct" | "num" | "int" | "days"): string {+ const na = Number(a), nb = Number(b);+ if (!Number.isFinite(na) || !Number.isFinite(nb)) return "\u2014";+ const d = nb - na;+ return (d > 0 ? "+" : "") + fmt(d, type);+}++function truncatePrompt(prompt: string | undefined, maxLen = 40): string {+ if (!prompt) return "";+ const trimmed = prompt.replace(/\n/g, " ").trim();+ return trimmed.length > maxLen ? trimmed.slice(0, maxLen) + "\u2026" : trimmed;+}++function runLabel(r: RunListItem): string {+ const summary = truncatePrompt(r.prompt);+ if (summary) return summary;+ return r.run_id;+}++const METRICS: MetricDef[] = [+ { key: "total_return", label: "Total Return", type: "pct", higherIsBetter: true },+ { key: "annualized_return", label: "Annualized Return", type: "pct", higherIsBetter: true },+ { key: "sharpe", label: "Sharpe Ratio", type: "num", higherIsBetter: true },+ { key: "calmar_ratio", label: "Calmar Ratio", type: "num", higherIsBetter: true },+ { key: "sortino_ratio", label: "Sortino Ratio", type: "num", higherIsBetter: true },+ { key: "max_drawdown", label: "Max Drawdown", type: "pct", higherIsBetter: false },+ { key: "volatility", label: "Volatility", type: "pct", higherIsBetter: false },+ { key: "win_rate", label: "Win Rate", type: "pct", higherIsBetter: true },+ { key: "profit_factor", label: "Profit Factor", type: "num", higherIsBetter: true },+ { key: "avg_win", label: "Avg Win", type: "pct", higherIsBetter: true },+ { key: "avg_loss", label: "Avg Loss", type: "pct", higherIsBetter: false },+ { key: "trade_count", label: "Trades", type: "int", higherIsBetter: true },+ { key: "max_consecutive_losses", label: "Max Consec. Losses", type: "int", higherIsBetter: false },+ { key: "exposure_time", label: "Exposure Time", type: "pct", higherIsBetter: true },+ { key: "avg_holding_period", label: "Avg Holding Period", type: "days", higherIsBetter: false },+];++// Also accept backend aliases+const METRIC_ALIASES: Record<string, string> = {+ annual_return: "annualized_return",+ calmar: "calmar_ratio",+ sortino: "sortino_ratio",+ profit_loss_ratio: "profit_factor",+ max_consec_loss: "max_consecutive_losses",+ max_consecutive_loss: "max_consecutive_losses",+ avg_hold_days: "avg_holding_period",+ avg_holding_days: "avg_holding_period",+};++function resolveMetric(metrics: Record<string, number> | null, key: string): number | undefined {+ if (!metrics) return undefined;+ if (metrics[key] !== undefined) return metrics[key];+ // Check if any alias maps to this key+ for (const [alias, canonical] of Object.entries(METRIC_ALIASES)) {+ if (canonical === key && metrics[alias] !== undefined) return metrics[alias];+ }+ return undefined;+}++interface EquityChartOverlayProps {+ leftCurve: EquityPoint[];+ rightCurve: EquityPoint[];+ leftLabel: string;+ rightLabel: string;+}++function EquityChartOverlay({ leftCurve, rightCurve, leftLabel, rightLabel }: EquityChartOverlayProps) {+ const ref = useRef<HTMLDivElement>(null);+ const { dark } = useDarkMode();++ useEffect(() => {+ if (!ref.current) return;+ if (leftCurve.length === 0 && rightCurve.length === 0) return;++ const t = getChartTheme();+ const chart = echarts.init(ref.current);+ chart.group = CHART_GROUP;+ connectCharts();++ // Merge dates from both curves and sort+ const dateSet = new Set<string>();+ for (const p of leftCurve) dateSet.add(p.time);+ for (const p of rightCurve) dateSet.add(p.time);+ const dates = Array.from(dateSet).sort();++ // Build lookup maps+ const leftMap = new Map(leftCurve.map((p) => [p.time, Number(p.equity)]));+ const rightMap = new Map(rightCurve.map((p) => [p.time, Number(p.equity)]));++ const leftData = dates.map((d) => leftMap.get(d) ?? null);+ const rightData = dates.map((d) => rightMap.get(d) ?? null);++ const PRIMARY_COLOR = getComputedStyle(document.documentElement).getPropertyValue("--chart-compare-a").trim() || "#3b82f6";+ const SECONDARY_COLOR = getComputedStyle(document.documentElement).getPropertyValue("--chart-compare-b").trim() || "#f59e0b";++ chart.setOption({+ backgroundColor: "transparent",+ tooltip: {+ trigger: "axis",+ axisPointer: { type: "cross" },+ backgroundColor: t.tooltipBg,+ borderColor: t.tooltipBorder,+ textStyle: { color: t.tooltipText, fontSize: 11 },+ // eslint-disable-next-line @typescript-eslint/no-explicit-any+ formatter: (params: any) => {+ if (!Array.isArray(params) || !params.length) return "";+ let html = `<b>${params[0].axisValue}</b>`;+ for (const p of params) {+ if (p.value == null) continue;+ html += `<br/>${p.marker} ${p.seriesName}: <b>${Number(p.value).toLocaleString()}</b>`;+ }+ return html;+ },+ },+ legend: {+ data: [leftLabel, rightLabel],+ textStyle: { color: t.textColor, fontSize: 11 },+ right: 8,+ top: 4,+ },+ grid: { left: 8, right: 8, top: 36, bottom: 40, containLabel: true },+ xAxis: {+ type: "category",+ data: dates,+ axisLine: { lineStyle: { color: t.axisColor } },+ axisLabel: { color: t.textColor, fontSize: 10 },+ },+ yAxis: {+ type: "value",+ splitLine: { lineStyle: { color: t.gridColor } },+ axisLabel: { color: t.textColor, fontSize: 10 },+ },+ dataZoom: [{ type: "inside" }, { type: "slider", height: 20, bottom: 4 }],+ series: [+ {+ name: leftLabel,+ type: "line",+ data: leftData,+ smooth: false,+ symbol: "none",+ lineStyle: { color: PRIMARY_COLOR, width: 2 },+ connectNulls: true,+ },+ {+ name: rightLabel,+ type: "line",+ data: rightData,+ smooth: false,+ symbol: "none",+ lineStyle: { color: SECONDARY_COLOR, width: 2 },+ connectNulls: true,+ },+ ],+ });++ const ro = new ResizeObserver(() => chart.resize());+ ro.observe(ref.current!);+ return () => { ro.disconnect(); chart.dispose(); };+ }, [leftCurve, rightCurve, leftLabel, rightLabel, dark]);++ if (leftCurve.length === 0 && rightCurve.length === 0) return null;++ return <div ref={ref} style={{ height: 320 }} />;+}++export function Compare() {+ const { t } = useI18n();+ const [runs, setRuns] = useState<RunListItem[]>([]);+ const [leftId, setLeftId] = useState("");+ const [rightId, setRightId] = useState("");+ const [leftData, setLeftData] = useState<Record<string, number> | null>(null);+ const [rightData, setRightData] = useState<Record<string, number> | null>(null);+ const [leftCurve, setLeftCurve] = useState<EquityPoint[]>([]);+ const [rightCurve, setRightCurve] = useState<EquityPoint[]>([]);++ useEffect(() => {+ api.listRuns().then((items) => {+ setRuns(Array.isArray(items) ? items : []);+ if (items.length >= 2) { setLeftId(items[1].run_id); setRightId(items[0].run_id); }+ else if (items.length === 1) { setLeftId(items[0].run_id); }+ }).catch(() => {});+ }, []);++ useEffect(() => {+ if (leftId) {+ api.getRun(leftId).then((d: RunData) => {+ setLeftData(d.metrics || null);+ setLeftCurve(d.equity_curve || []);+ }).catch(() => { setLeftData(null); setLeftCurve([]); });+ } else {+ setLeftData(null);+ setLeftCurve([]);+ }+ }, [leftId]);++ useEffect(() => {+ if (rightId) {+ api.getRun(rightId).then((d: RunData) => {+ setRightData(d.metrics || null);+ setRightCurve(d.equity_curve || []);+ }).catch(() => { setRightData(null); setRightCurve([]); });+ } else {+ setRightData(null);+ setRightCurve([]);+ }+ }, [rightId]);++ const leftRun = runs.find((r) => r.run_id === leftId);+ const rightRun = runs.find((r) => r.run_id === rightId);++ return (+ <div className="p-8 max-w-4xl space-y-6">+ <h1 className="text-xl font-bold flex items-center gap-2">+ <GitCompare className="h-5 w-5" /> {t.strategyComparison}+ </h1>++ {/* Selectors */}+ <div className="flex gap-4 items-end">+ <div className="flex-1">+ <label className="text-xs text-muted-foreground block mb-1">{t.baseline}</label>+ <select value={leftId} onChange={(e) => setLeftId(e.target.value)} className="w-full px-3 py-2 rounded-lg border bg-background text-sm focus:outline-none focus:ring-2 focus:ring-primary/30" title={leftRun?.prompt || leftId}>+ <option value="">{t.selectRun}</option>+ {runs.map((r) => <option key={r.run_id} value={r.run_id}>{runLabel(r)} ({r.status})</option>)}+ </select>+ </div>+ <ArrowRight className="h-5 w-5 text-muted-foreground mb-2 shrink-0" />+ <div className="flex-1">+ <label className="text-xs text-muted-foreground block mb-1">{t.compareTo}</label>+ <select value={rightId} onChange={(e) => setRightId(e.target.value)} className="w-full px-3 py-2 rounded-lg border bg-background text-sm focus:outline-none focus:ring-2 focus:ring-primary/30" title={rightRun?.prompt || rightId}>+ <option value="">{t.selectRun}</option>+ {runs.map((r) => <option key={r.run_id} value={r.run_id}>{runLabel(r)} ({r.status})</option>)}+ </select>+ </div>+ </div>++ {/* Equity curve overlay */}+ {(leftCurve.length > 0 || rightCurve.length > 0) && (+ <div className="border rounded-xl p-4">+ <h2 className="text-sm font-medium text-muted-foreground mb-2">{t.equityDrawdown}</h2>+ <EquityChartOverlay+ leftCurve={leftCurve}+ rightCurve={rightCurve}+ leftLabel={leftRun ? truncatePrompt(leftRun.prompt, 20) || t.baseline : t.baseline}+ rightLabel={rightRun ? truncatePrompt(rightRun.prompt, 20) || t.compareTo : t.compareTo}+ />+ </div>+ )}++ {/* Metrics table */}+ {(leftData || rightData) && (+ <div className="border rounded-xl overflow-hidden">+ <table className="w-full text-sm">+ <thead>+ <tr className="border-b bg-muted/40">+ <th className="text-left px-4 py-2.5 text-muted-foreground font-medium">{t.metric}</th>+ <th className="text-right px-4 py-2.5 text-muted-foreground font-medium">{t.baseline}</th>+ <th className="text-right px-4 py-2.5 text-muted-foreground font-medium">{t.compareTo}</th>+ <th className="text-right px-4 py-2.5 text-muted-foreground font-medium">{t.delta}</th>+ </tr>+ </thead>+ <tbody>+ {METRICS.map(({ key, label, type, higherIsBetter }) => {+ const lv = resolveMetric(leftData, key);+ const rv = resolveMetric(rightData, key);+ return (+ <tr key={key} className="border-b last:border-0 hover:bg-muted/20">+ <td className="px-4 py-2.5 font-medium">{label}</td>+ <td className="px-4 py-2.5 text-right font-mono tabular-nums">{fmt(lv, type)}</td>+ <td className="px-4 py-2.5 text-right font-mono tabular-nums">{fmt(rv, type)}</td>+ <td className={cn("px-4 py-2.5 text-right font-mono tabular-nums font-semibold", diffClass(lv, rv, higherIsBetter))}>{diffStr(lv, rv, type)}</td>+ </tr>+ );+ })}+ </tbody>+ </table>+ </div>+ )}++ {!leftData && !rightData && (+ <div className="text-center py-16 text-muted-foreground">+ <GitCompare className="h-12 w-12 mx-auto mb-3 opacity-20" />+ <p className="text-sm">{t.selectTwoRuns}</p>+ </div>+ )}+ </div>+ );+}diff --git a/frontend/src/pages/Home.tsx b/frontend/src/pages/Home.tsxnew file mode 100644index 000000000..b40cdcd3f--- /dev/null+++ b/frontend/src/pages/Home.tsx@@ -0,0 +1,38 @@+import { Link } from "react-router-dom";+import { ArrowRight, Bot, BarChart3, Zap } from "lucide-react";+import { useI18n } from "@/lib/i18n";++export function Home() {+ const { t } = useI18n();++ const FEATURES = [+ { icon: Bot, title: t.feat1, desc: t.feat1d },+ { icon: BarChart3, title: t.feat2, desc: t.feat2d },+ { icon: Zap, title: t.feat3, desc: t.feat3d },+ ];++ return (+ <div className="flex flex-col items-center justify-center min-h-screen p-8">+ <div className="max-w-2xl text-center space-y-6">+ <h1 className="text-4xl font-bold tracking-tight">{t.heroTitle}</h1>+ <p className="text-lg text-muted-foreground">{t.heroDesc}</p>+ <Link+ to="/agent"+ className="inline-flex items-center gap-2 px-6 py-3 rounded-lg bg-primary text-primary-foreground font-medium hover:opacity-90 transition"+ >+ {t.startResearch} <ArrowRight className="h-4 w-4" />+ </Link>+ </div>++ <div className="grid grid-cols-1 md:grid-cols-3 gap-6 mt-16 max-w-4xl w-full">+ {FEATURES.map(({ icon: Icon, title, desc }) => (+ <div key={title} className="border rounded-lg p-6 space-y-3">+ <Icon className="h-8 w-8 text-primary" />+ <h3 className="font-semibold">{title}</h3>+ <p className="text-sm text-muted-foreground">{desc}</p>+ </div>+ ))}+ </div>+ </div>+ );+}diff --git a/frontend/src/pages/RunDetail.tsx b/frontend/src/pages/RunDetail.tsxnew file mode 100644index 000000000..dca6d0d2e--- /dev/null+++ b/frontend/src/pages/RunDetail.tsx@@ -0,0 +1,237 @@+import { useEffect, useState } from "react";+import { useParams, Link, useNavigate } from "react-router-dom";+import { CheckCircle2, XCircle, BarChart3, List, Code2, ArrowLeft, Download } from "lucide-react";+import { cn } from "@/lib/utils";+import { useI18n } from "@/lib/i18n";+import { api, type RunData, type BacktestMetrics } from "@/lib/api";+import ReactMarkdown from "react-markdown";+import rehypeHighlight from "rehype-highlight";+import { CandlestickChart } from "@/components/charts/CandlestickChart";+import { EquityChart } from "@/components/charts/EquityChart";+import { MetricsCard } from "@/components/chat/MetricsCard";+import { Skeleton, SkeletonMetrics, SkeletonChart } from "@/components/common/Skeleton";+import { ErrorBoundary } from "@/components/common/ErrorBoundary";++const rehypePlugins = [rehypeHighlight];++type Tab = "chart" | "trades" | "code";++function downloadCsv(filename: string, csvContent: string) {+ const blob = new Blob(["\uFEFF" + csvContent], { type: "text/csv;charset=utf-8;" });+ const url = URL.createObjectURL(blob);+ const a = document.createElement("a");+ a.href = url;+ a.download = filename;+ a.click();+ URL.revokeObjectURL(url);+}++function escapeCsvField(value: unknown): string {+ const str = String(value ?? "");+ if (str.includes(",") || str.includes('"') || str.includes("\n")) {+ return `"${str.replace(/"/g, '""')}"`;+ }+ return str;+}++function buildTradesCsv(trades: Array<Record<string, string>>): string {+ if (trades.length === 0) return "";+ const keys = [...new Set(trades.flatMap(Object.keys))];+ const header = keys.map(escapeCsvField).join(",");+ const rows = trades.map(tr => keys.map(k => escapeCsvField(tr[k])).join(","));+ return [header, ...rows].join("\n");+}++function buildMetricsCsv(metrics: BacktestMetrics): string {+ const header = "metric,value";+ const rows = Object.entries(metrics).map(([k, v]) => `${escapeCsvField(k)},${escapeCsvField(v)}`);+ return [header, ...rows].join("\n");+}++export function RunDetail() {+ const { runId } = useParams<{ runId: string }>();+ const { t } = useI18n();+ const navigate = useNavigate();+ const [run, setRun] = useState<RunData | null>(null);+ const [code, setCode] = useState<Record<string, string>>({});+ const [tab, setTab] = useState<Tab>("chart");+ const [loading, setLoading] = useState(true);++ const TABS: { id: Tab; label: string; icon: typeof BarChart3 }[] = [+ { id: "chart", label: t.chart, icon: BarChart3 },+ { id: "trades", label: t.trades, icon: List },+ { id: "code", label: t.code, icon: Code2 },+ ];++ useEffect(() => {+ if (!runId) return;+ Promise.all([+ api.getRun(runId).catch(() => null),+ api.getRunCode(runId).catch(() => ({})),+ ]).then(([r, c]) => { setRun(r); setCode(c || {}); }).finally(() => setLoading(false));+ }, [runId]);++ if (loading) {+ return (+ <div className="p-8 space-y-4">+ <Skeleton className="h-6 w-48" />+ <SkeletonMetrics />+ <SkeletonChart height={400} />+ </div>+ );+ }+ if (!run) return <div className="p-8 text-red-500">Run not found</div>;++ const ok = run.status === "success";++ return (+ <div className="flex flex-col h-full">+ {/* Header */}+ <div className="border-b p-4 space-y-3">+ <div className="flex items-center gap-3">+ <button+ onClick={() => navigate(-1)}+ className="p-1 rounded-md hover:bg-muted transition-colors text-muted-foreground hover:text-foreground"+ title="Go back"+ >+ <ArrowLeft className="h-4 w-4" />+ </button>+ {ok ? <CheckCircle2 className="h-5 w-5 text-success" /> : <XCircle className="h-5 w-5 text-danger" />}+ <h1 className="font-mono text-sm font-medium">{runId}</h1>+ {run.elapsed_seconds && <span className="text-xs text-muted-foreground">{run.elapsed_seconds.toFixed(1)}s</span>}+ </div>+ {run.prompt && <p className="text-sm text-muted-foreground">{run.prompt}</p>}+ {run.metrics && <MetricsCard metrics={run.metrics as Record<string, number>} />}++ <div className="flex items-center gap-1">+ {TABS.map(({ id, label, icon: Icon }) => (+ <button+ key={id}+ onClick={() => setTab(id)}+ className={cn(+ "flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm transition-colors",+ tab === id ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:bg-muted"+ )}+ >+ <Icon className="h-3.5 w-3.5" /> {label}+ </button>+ ))}++ <div className="ml-auto flex gap-1">+ {run.trade_log && run.trade_log.length > 0 && (+ <button+ onClick={() => downloadCsv(`trades_${runId}.csv`, buildTradesCsv(run.trade_log!))}+ className="flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs text-muted-foreground hover:bg-muted transition-colors"+ title={t.downloadTradesCsv}+ >+ <Download className="h-3.5 w-3.5" /> {t.downloadTradesCsv}+ </button>+ )}+ {run.metrics && (+ <button+ onClick={() => downloadCsv(`metrics_${runId}.csv`, buildMetricsCsv(run.metrics!))}+ className="flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs text-muted-foreground hover:bg-muted transition-colors"+ title={t.downloadMetricsCsv}+ >+ <Download className="h-3.5 w-3.5" /> {t.downloadMetricsCsv}+ </button>+ )}+ </div>+ </div>+ </div>++ <div className="flex-1 overflow-auto">+ <ErrorBoundary>+ {tab === "chart" && <ChartTab run={run} />}+ {tab === "trades" && <TradesTab run={run} />}+ {tab === "code" && <CodeTab code={code} />}+ </ErrorBoundary>+ </div>+ </div>+ );+}++function ChartTab({ run }: { run: RunData }) {+ const entries = run.price_series ? Object.entries(run.price_series) : [];+ const hasEquity = run.equity_curve && run.equity_curve.length > 0;++ if (entries.length === 0 && !hasEquity) {+ return (+ <div className="p-8 text-center text-muted-foreground space-y-2">+ <p className="text-sm">No chart data available</p>+ <p className="text-xs">The backtest engine may not have generated price data. Check the artifacts/ directory.</p>+ </div>+ );+ }++ return (+ <div className="p-4 space-y-4">+ {entries.map(([sym, bars]) => (+ <div key={sym}>+ <h3 className="text-sm font-medium mb-1">{sym}</h3>+ <CandlestickChart data={bars} markers={run.trade_markers?.filter(m => m.code === sym)} indicators={run.indicator_series?.[sym]} height={500} />+ </div>+ ))}+ {hasEquity && (+ <div>+ <h3 className="text-sm font-medium mb-1">Equity & Drawdown</h3>+ <EquityChart data={run.equity_curve!} height={280} />+ </div>+ )}+ </div>+ );+}++function TradesTab({ run }: { run: RunData }) {+ const trades = run.trade_log || [];+ if (trades.length === 0) return <div className="p-8 text-muted-foreground text-sm">No trades recorded.</div>;+ return (+ <div className="p-4">+ <table className="w-full text-sm">+ <thead>+ <tr className="border-b text-left text-muted-foreground">+ <th className="py-2 pr-4">Time</th>+ <th className="py-2 pr-4">Code</th>+ <th className="py-2 pr-4">Side</th>+ <th className="py-2 pr-4">Price</th>+ <th className="py-2 pr-4">Qty</th>+ <th className="py-2">Reason</th>+ </tr>+ </thead>+ <tbody>+ {trades.map((tr, i) => (+ <tr key={i} className="border-b last:border-0 hover:bg-muted/20">+ <td className="py-2 pr-4 font-mono text-xs">{tr.time || tr.timestamp}</td>+ <td className="py-2 pr-4">{tr.code}</td>+ <td className={cn("py-2 pr-4 font-medium", tr.side === "BUY" ? "text-success" : "text-danger")}>{tr.side}</td>+ <td className="py-2 pr-4 tabular-nums">{tr.price}</td>+ <td className="py-2 pr-4 tabular-nums">{tr.qty}</td>+ <td className="py-2 text-muted-foreground">{tr.reason}</td>+ </tr>+ ))}+ </tbody>+ </table>+ </div>+ );+}++function CodeTab({ code }: { code: Record<string, string> }) {+ const files = Object.entries(code);+ const [active, setActive] = useState(files[0]?.[0] || "");+ if (files.length === 0) return <div className="p-8 text-muted-foreground text-sm">No code files.</div>;+ return (+ <div className="flex flex-col h-full">+ <div className="flex gap-1 p-2 border-b">+ {files.map(([name]) => (+ <button key={name} onClick={() => setActive(name)} className={cn("px-3 py-1 rounded text-xs font-mono", active === name ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:bg-muted")}>{name}</button>+ ))}+ </div>+ <div className="flex-1 overflow-auto p-3 text-[11px] leading-relaxed bg-muted/20 [&_pre]:m-0 [&_pre]:bg-transparent [&_code]:text-[11px]">+ <ReactMarkdown rehypePlugins={rehypePlugins}>+ {`\`\`\`python\n${code[active] || ""}\n\`\`\``}+ </ReactMarkdown>+ </div>+ </div>+ );+}+diff --git a/frontend/src/router.tsx b/frontend/src/router.tsxnew file mode 100644index 000000000..6d01966e3--- /dev/null+++ b/frontend/src/router.tsx@@ -0,0 +1,18 @@+import { createBrowserRouter } from "react-router-dom";+import { Layout } from "@/components/layout/Layout";+import { Home } from "@/pages/Home";+import { Agent } from "@/pages/Agent";+import { RunDetail } from "@/pages/RunDetail";+import { Compare } from "@/pages/Compare";++export const router = createBrowserRouter([+ {+ element: <Layout />,+ children: [+ { path: "/", element: <Home /> },+ { path: "/agent", element: <Agent /> },+ { path: "/runs/:runId", element: <RunDetail /> },+ { path: "/compare", element: <Compare /> },+ ],+ },+]);diff --git a/frontend/src/stores/agent.ts b/frontend/src/stores/agent.tsnew file mode 100644index 000000000..bb2c3c227--- /dev/null+++ b/frontend/src/stores/agent.ts@@ -0,0 +1,107 @@+import { create } from "zustand";+import type { AgentMessage, ToolCallEntry } from "@/types/agent";++const SESSION_CACHE_MAX = 5;+const _sessionCache = new Map<string, AgentMessage[]>();++interface AgentState {+ messages: AgentMessage[];+ sessionId: string | null;+ status: "idle" | "streaming" | "error";+ streamingText: string;++ toolCalls: ToolCallEntry[];++ sseStatus: "disconnected" | "connected" | "reconnecting";+ sseRetryAttempt: number;++ addMessage: (msg: Omit<AgentMessage, "id"> & { id?: string }) => void;+ appendDelta: (delta: string) => void;+ setStatus: (s: AgentState["status"]) => void;+ setSessionId: (id: string | null) => void;+ loadHistory: (msgs: AgentMessage[]) => void;++ addToolCall: (entry: ToolCallEntry) => void;+ updateToolCall: (id: string, update: Partial<ToolCallEntry>) => void;++ cacheSession: (sid: string, msgs: AgentMessage[]) => void;+ getCachedSession: (sid: string) => AgentMessage[] | undefined;++ clearStreaming: () => void;++ setSseStatus: (s: AgentState["sseStatus"], retryAttempt?: number) => void;++ switchSession: (sid: string, msgs?: AgentMessage[]) => void;+ sessionLoading: boolean;+ setSessionLoading: (v: boolean) => void;++ reset: () => void;+}++let _id = 0;+const nextId = () => String(++_id);++export const useAgentStore = create<AgentState>((set) => ({+ messages: [],+ sessionId: null,+ status: "idle",+ streamingText: "",+ toolCalls: [],+ sseStatus: "disconnected",+ sseRetryAttempt: 0,+ sessionLoading: false,++ addMessage: (msg) =>+ set((s) => ({ messages: [...s.messages, { ...msg, id: msg.id || nextId() } as AgentMessage] })),++ appendDelta: (delta) =>+ set((s) => ({ streamingText: s.streamingText + delta })),++ setStatus: (status) => set({ status }),+ setSessionId: (sessionId) => set({ sessionId }),+ loadHistory: (msgs) => set({ messages: msgs }),++ addToolCall: (entry) =>+ set((s) => ({ toolCalls: [...s.toolCalls, entry] })),+ updateToolCall: (id, update) =>+ set((s) => ({+ toolCalls: s.toolCalls.map((tc) => tc.id === id ? { ...tc, ...update } : tc),+ })),++ cacheSession: (sid, msgs) => {+ _sessionCache.delete(sid);+ _sessionCache.set(sid, msgs);+ if (_sessionCache.size > SESSION_CACHE_MAX) {+ const oldest = _sessionCache.keys().next().value;+ if (oldest) _sessionCache.delete(oldest);+ }+ },+ getCachedSession: (sid) => _sessionCache.get(sid),++ clearStreaming: () => set({ streamingText: "" }),++ setSseStatus: (sseStatus, retryAttempt) =>+ set({ sseStatus, sseRetryAttempt: retryAttempt ?? 0 }),++ switchSession: (sid, msgs) => {+ _id = 0;+ set({+ sessionId: sid,+ messages: msgs || [],+ status: "idle",+ streamingText: "",+ toolCalls: [],+ sessionLoading: !msgs,+ });+ },++ setSessionLoading: (sessionLoading) => set({ sessionLoading }),++ reset: () => {+ _id = 0;+ set({+ messages: [], status: "idle", streamingText: "",+ sessionId: null, toolCalls: [], sessionLoading: false,+ });+ },+}));diff --git a/frontend/src/types/agent.ts b/frontend/src/types/agent.tsnew file mode 100644index 000000000..465180f95--- /dev/null+++ b/frontend/src/types/agent.ts@@ -0,0 +1,31 @@+/** Chat message types */+export type AgentMessageType =+ | "user" | "thinking" | "tool_call" | "tool_result"+ | "answer" | "error" | "run_complete" | "compact";++export interface AgentMessage {+ id: string;+ type: AgentMessageType;+ content: string;+ tool?: string;+ args?: Record<string, string>;+ status?: "running" | "ok" | "error";+ elapsed_ms?: number;+ timestamp: number;+ runId?: string;+ metrics?: Record<string, number>;+ equityCurve?: Array<{ time: string; equity: number | string }>;+ /** Phase label for thinking entries */+ stage?: string;+}++/** Tool call tracking entry */+export interface ToolCallEntry {+ id: string;+ tool: string;+ arguments: Record<string, string>;+ status: "running" | "ok" | "error";+ preview?: string;+ elapsed_ms?: number;+ timestamp: number;+}diff --git a/frontend/tailwind.config.ts b/frontend/tailwind.config.tsnew file mode 100644index 000000000..67a474dc1--- /dev/null+++ b/frontend/tailwind.config.ts@@ -0,0 +1,29 @@+import type { Config } from "tailwindcss";++export default {+ darkMode: "class",+ content: ["./index.html", "./src/**/*.{ts,tsx}"],+ theme: {+ extend: {+ colors: {+ border: "hsl(var(--border))",+ background: "hsl(var(--background))",+ foreground: "hsl(var(--foreground))",+ muted: { DEFAULT: "hsl(var(--muted))", foreground: "hsl(var(--muted-foreground))" },+ primary: { DEFAULT: "hsl(var(--primary))", foreground: "hsl(var(--primary-foreground))" },+ destructive: { DEFAULT: "hsl(var(--destructive))", foreground: "hsl(var(--destructive-foreground))" },+ card: { DEFAULT: "hsl(var(--card))", foreground: "hsl(var(--card-foreground))" },+ success: "hsl(var(--success))",+ danger: "hsl(var(--danger))",+ warning: "hsl(var(--warning))",+ info: "hsl(var(--info))",+ },+ fontFamily: {+ sans: ["Inter", "system-ui", "sans-serif"],+ mono: ["JetBrains Mono", "ui-monospace", "monospace"],+ },+ borderRadius: { lg: "var(--radius)", md: "calc(var(--radius) - 2px)", sm: "calc(var(--radius) - 4px)" },+ },+ },+ plugins: [require("@tailwindcss/typography")],+} satisfies Config;diff --git a/frontend/tsconfig.json b/frontend/tsconfig.jsonnew file mode 100644index 000000000..3f4424f9d--- /dev/null+++ b/frontend/tsconfig.json@@ -0,0 +1,22 @@+{+ "compilerOptions": {+ "target": "ES2020",+ "useDefineForClassFields": true,+ "lib": ["ES2020", "DOM", "DOM.Iterable"],+ "module": "ESNext",+ "skipLibCheck": true,+ "moduleResolution": "bundler",+ "allowImportingTsExtensions": true,+ "isolatedModules": true,+ "moduleDetection": "force",+ "noEmit": true,+ "jsx": "react-jsx",+ "strict": true,+ "noUnusedLocals": false,+ "noUnusedParameters": false,+ "noFallthroughCasesInSwitch": true,+ "baseUrl": ".",+ "paths": { "@/*": ["./src/*"] }+ },+ "include": ["src"]+}diff --git a/frontend/vite.config.ts b/frontend/vite.config.tsnew file mode 100644index 000000000..1a19726b4--- /dev/null+++ b/frontend/vite.config.ts@@ -0,0 +1,35 @@+import { defineConfig } from "vite";+import react from "@vitejs/plugin-react";+import path from "path";++export default defineConfig({+ plugins: [react()],+ resolve: {+ alias: { "@": path.resolve(__dirname, "./src") },+ },+ server: {+ port: 5899,+ proxy: {+ "/run": { target: "http://localhost:8899", changeOrigin: true },+ "/runs": { target: "http://localhost:8899", changeOrigin: true },+ "/health": { target: "http://localhost:8899", changeOrigin: true },+ "/sessions": { target: "http://localhost:8899", changeOrigin: true },+ "/skills": { target: "http://localhost:8899", changeOrigin: true },+ "/swarm/presets": { target: "http://localhost:8899", changeOrigin: true },+ "/swarm/runs": { target: "http://localhost:8899", changeOrigin: true },+ "/upload": { target: "http://localhost:8899", changeOrigin: true },+ "/api": { target: "http://localhost:8899", changeOrigin: true },+ "/system": { target: "http://localhost:8899", changeOrigin: true },+ },+ },+ build: {+ rollupOptions: {+ output: {+ manualChunks: {+ "vendor-react": ["react", "react-dom", "react-router-dom"],+ "vendor-charts": ["echarts"],+ },+ },+ },+ },+});diff --git a/pyproject.toml b/pyproject.tomlnew file mode 100644index 000000000..c66075730--- /dev/null+++ b/pyproject.toml@@ -0,0 +1,82 @@+[project]+name = "vibe-trading-ai"+version = "0.1.3"+description = "Natural-language finance research AI agent with backtesting"+requires-python = ">=3.11"+license = "MIT"+readme = "README.md"+authors = [+ {name = "HKUDS", email = "[email protected]"},+]+keywords = ["finance", "trading", "backtesting", "agent", "swarm", "quantitative"]+classifiers = [+ "Development Status :: 4 - Beta",+ "Intended Audience :: Financial and Insurance Industry",+ "Programming Language :: Python :: 3.11",+ "Programming Language :: Python :: 3.12",+ "Topic :: Office/Business :: Financial :: Investment",+]+dependencies = [+ "rich>=13.0.0",+ "pyyaml>=6.0.0",+ "langchain>=0.1.0",+ "langchain-core>=0.1.0",+ "langchain-openai>=0.0.5",+ "langgraph>=0.2.50,<0.3",+ "langgraph-checkpoint>=2.0.0",+ "python-dotenv>=1.0.0",+ "pandas>=2.0.0",+ "numpy>=1.24.0",+ "scipy>=1.10.0",+ "duckdb>=1.2.0",+ "scikit-learn>=1.3.0",+ "joblib>=1.3.0",+ "smartmoneyconcepts>=0.0.1",+ "pyharmonics>=1.5.0",+ "tushare>=1.2.89",+ "requests>=2.31.0",+ "yfinance>=0.2.30",+ "fastapi>=0.104.0",+ "uvicorn[standard]>=0.24.0",+ "pydantic>=2.0.0",+ "python-multipart>=0.0.6",+ "sse-starlette>=1.6.0",+ "fastmcp>=2.0.0",+]++[project.urls]+Homepage = "https://github.com/HKUDS/Vibe-Trading"+Repository = "https://github.com/HKUDS/Vibe-Trading"+Issues = "https://github.com/HKUDS/Vibe-Trading/issues"++[project.scripts]+vibe-trading = "cli:main"+vibe-trading-mcp = "mcp_server:main"++[tool.setuptools]+package-dir = {"" = "agent"}+py-modules = ["cli", "run_agent", "api_server", "mcp_server"]++[tool.setuptools.packages.find]+where = ["agent"]+include = ["src*", "backtest*"]++[tool.setuptools.package-data]+"src" = [+ "skills/**/*.md",+ "skills/**/*.yaml",+ "skills/**/*.json",+]+"backtest" = ["*.py"]++[tool.setuptools.data-files]+"config/swarm" = ["agent/config/swarm/*.yaml"]++[tool.ruff]+target-version = "py311"+line-length = 120+src = ["agent"]++[tool.ruff.lint]+select = ["E", "F", "W"]+ignore = ["E501"]