feat: A股板块监控系统 - 东方财富API数据获取、异动检测、邮件通知
This commit is contained in:
76
README.md
Normal file
76
README.md
Normal file
@@ -0,0 +1,76 @@
|
||||
# A股板块监控系统
|
||||
|
||||
自动获取东方财富板块数据,监控异动并发送邮件通知。
|
||||
|
||||
## 功能特点
|
||||
|
||||
- 获取行业板块涨跌幅排行
|
||||
- 获取概念板块涨跌幅排行
|
||||
- 监控主力资金流入/流出
|
||||
- 检测板块异动(涨跌幅≥3%、资金流入≥10亿)
|
||||
- 自动发送HTML格式邮件通知
|
||||
|
||||
## 数据来源
|
||||
|
||||
东方财富HTTP API (http://push2.eastmoney.com)
|
||||
|
||||
## 使用方法
|
||||
|
||||
### 测试API连接
|
||||
|
||||
```bash
|
||||
python3 board_monitor.py test
|
||||
```
|
||||
|
||||
### 获取板块数据
|
||||
|
||||
```bash
|
||||
# 获取行业板块涨跌幅TOP20
|
||||
python3 board_monitor.py get industry --sort pct --limit 20
|
||||
|
||||
# 获取概念板块资金流入TOP20
|
||||
python3 board_monitor.py get concept --sort flow --limit 20
|
||||
```
|
||||
|
||||
### 执行监控检查
|
||||
|
||||
```bash
|
||||
# 监控并发送通知(发现异动时)
|
||||
python3 board_monitor.py monitor -v
|
||||
|
||||
# 监控但不发送通知
|
||||
python3 board_monitor.py monitor --no-notify
|
||||
```
|
||||
|
||||
## 定时任务配置
|
||||
|
||||
```bash
|
||||
# 添加到crontab
|
||||
crontab -e
|
||||
|
||||
# 盘中每小时检查(9:30-15:00)
|
||||
30-59 9 * * 1-5 /usr/bin/python3 /home/xian/.openclaw/workspace-coder/works/board-monitor/board_monitor.py monitor
|
||||
0-15 10-14 * * 1-5 /usr/bin/python3 /home/xian/.openclaw/workspace-coder/works/board-monitor/board_monitor.py monitor
|
||||
0-0 15 * * 1-5 /usr/bin/python3 /home/xian/.openclaw/workspace-coder/works/board-monitor/board_monitor.py monitor
|
||||
```
|
||||
|
||||
## 异动检测阈值
|
||||
|
||||
| 类型 | 阈值 |
|
||||
|------|------|
|
||||
| 涨幅异动 | ≥ 3% |
|
||||
| 跌幅异动 | ≤ -3% |
|
||||
| 资金流入 | ≥ 10亿 |
|
||||
| 资金流出 | ≤ -10亿 |
|
||||
|
||||
可在 `board_monitor.py` 中修改 `check_anomaly()` 函数的参数调整阈值。
|
||||
|
||||
## 通知邮箱
|
||||
|
||||
默认发送到: zuitoushang@tphai.com
|
||||
|
||||
可在 `send_notification()` 函数中修改。
|
||||
|
||||
## 版本历史
|
||||
|
||||
- v1.0.0 (2026-04-10) - 初始版本
|
||||
Reference in New Issue
Block a user