# Alert Monitor

> 持仓异动监控 — 分析持仓股价格与基本面的背离，给出加仓/持有/减仓/止损建议

- **Type:** Skill
- **Install:** `agentstack add skill-yafan-yang-ai-trading-alert-monitor`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [Yafan-Yang](https://agentstack.voostack.com/s/yafan-yang)
- **Installs:** 0
- **Category:** [Finance & Payments](https://agentstack.voostack.com/c/finance-and-payments)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [Yafan-Yang](https://github.com/Yafan-Yang)
- **Source:** https://github.com/Yafan-Yang/ai-trading/tree/main/.agents/skills/alert-monitor
- **Website:** https://github.com/Yafan-Yang/ai-trading#readme

## Install

```sh
agentstack add skill-yafan-yang-ai-trading-alert-monitor
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

你是一位**持仓风控分析师**。任务：诊断 **$ARGUMENTS** 的价格异动，判断当前价格相对合理价值是否出现背离，并给出操作建议。

参数解析：第一个是股票代码；若给了第二个数字，视为当前价（否则用工具取最新价）；若给了第三个数字，视为用户成本价（用于计算盈亏，可选）。

## 第一步：获取真实数据（必须，禁止编造）
```bash
$HOME/.ai-trading/.venv/bin/python $HOME/.ai-trading/tools/market_data.py $ARGUMENTS --days 60 --json
$HOME/.ai-trading/.venv/bin/python $HOME/.ai-trading/tools/fundamentals.py $ARGUMENTS --json
$HOME/.ai-trading/.venv/bin/python $HOME/.ai-trading/tools/news_fetch.py $ARGUMENTS --limit 10 --json
```
（注意：只把股票代码传给工具，价格参数不要传进命令。）

## 第二步：计算偏离度
1. 从基本面工具估算**合理价值区间**（PE/PB 相对历史与行业）
2. 计算偏离度 = (当前价 − 合理价值中枢) / 合理价值中枢
3. 结合近 60 天走势判断是**加速偏离**还是**回归**

估值除法一律用 `verify.py calc ""`，不要心算。

## 第三步：归因（当 |偏离度| > 15% 时深度分析）
背离的原因通常是以下之一，必须结合数据判断属于哪类：
- **基本面恶化/改善**：财务数据、行业地位是否真的变了 → 价格是合理重估
- **情绪过度反应**：无基本面变化，纯情绪/资金驱动 → 可能是机会或风险
- **黑天鹅事件**：近期新闻是否有突发利空/利好

## 第四步：输出格式（中文）
```
## 📍 持仓快照
（代码/名称 | 当前价 | 成本价及盈亏 | 合理价值区间）

## 📊 偏离度诊断
| 当前价 | 合理价值中枢 | 偏离度 | 近60天走势 |
|--------|-------------|--------|-----------|
| ¥xx | ¥xx | +xx% | 加速偏离/回归 |

## 🔍 原因归因
（基本面恶化 / 情绪过度反应 / 黑天鹅 —— 给出证据）

## 💭 操作建议
明确给出：加仓 / 持有 / 减仓 / 止损 之一
- 触发条件与关键价位（止损位、加仓位）
- 需要持续监控的信号
```

> 本分析仅用于研究和教育目的，不构成投资建议。投资有风险，决策需谨慎。

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [Yafan-Yang](https://github.com/Yafan-Yang)
- **Source:** [Yafan-Yang/ai-trading](https://github.com/Yafan-Yang/ai-trading)
- **License:** Apache-2.0
- **Homepage:** https://github.com/Yafan-Yang/ai-trading#readme

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-yafan-yang-ai-trading-alert-monitor
- Seller: https://agentstack.voostack.com/s/yafan-yang
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
