多基金溢价监控报警系统
- ✅ 多基金同时监控(支持任意ETF/LOF基金)
- ✅ 多通道推送(Telegram + Webhook)
- ✅ 溢价率高/低双阈值预警
- ✅ 巨潮资讯公告实时监控
- ✅ 历史数据存储(SQLite)
- ✅ 交易时段/非交易时段自动切换频率
- ✅ 随机抖动防封
- ✅ Systemd守护进程
pip install -r requirements.txt编辑 config.json:
{
"funds": [
{"code": "161226", "name": "白银基金", "threshold_high": 15, "threshold_low": -5, "enabled": true},
{"code": "159934", "name": "黄金ETF", "threshold_high": 5, "threshold_low": -3, "enabled": true}
],
"notification": {
"telegram": {
"enabled": true,
"bot_token": "YOUR_BOT_TOKEN",
"chat_id": "YOUR_CHAT_ID"
},
"cooldown_seconds": 300
}
}python sentinel.py# 复制文件
sudo cp sentinel.service /etc/systemd/system/
sudo cp sentinel.py config.json /opt/sentinel/
sudo cp requirements.txt /opt/sentinel/
# 安装依赖
sudo pip install -r /opt/sentinel/requirements.txt
# 启动服务
sudo systemctl daemon-reload
sudo systemctl enable sentinel
sudo systemctl start sentinel
# 查看状态
sudo systemctl status sentinel
sudo journalctl -u sentinel -f| 代码 | 名称 | 类型 |
|---|---|---|
| 161226 | 银华日利 | 货币ETF |
| 159934 | 黄金ETF | 黄金 |
| 159867 | 证券ETF | 证券 |
| 512880 | 光伏ETF | 光伏 |
| 512690 | 消费ETF | 消费 |
| 参数 | 说明 | 默认值 |
|---|---|---|
| interval_trading | 交易时段检查间隔(秒) | 120 |
| interval_idle | 非交易时段间隔(秒) | 3600 |
| jitter_percent | 随机抖动百分比 | 10 |
| cooldown_seconds | 预警冷却时间(秒) | 300 |
# 本地运行
python sentinel.py
# 服务模式
journalctl -u sentinel -f
tail -f sentinel.log