A Stock Holding Monitor

v1.0.0

A股持仓监控脚本。监控持仓股票的止损/支撑破位/目标价/异常波动,触发条件时提醒。适合配合cron定时运行。

0· 94·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for jdvrommel/a-stock-holding-monitor.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "A Stock Holding Monitor" (jdvrommel/a-stock-holding-monitor) from ClawHub.
Skill page: https://clawhub.ai/jdvrommel/a-stock-holding-monitor
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install a-stock-holding-monitor

ClawHub CLI

Package manager switcher

npx clawhub@latest install a-stock-holding-monitor
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description (A股持仓监控) match the code and SKILL.md. The script only needs network access to Sina finance endpoints to fetch quotes and compute stop-loss/support/target signals—these requirements are proportional to the stated purpose.
Instruction Scope
SKILL.md instructs the user to edit the HOLDINGS list, make the script executable, and run it (manually or via cron). The runtime instructions do not request unrelated files, environment variables, or external endpoints beyond the Sina finance APIs the script uses. The script writes a state file to /tmp/holding_check.json (expected for local monitoring).
Install Mechanism
No install spec; this is instruction-only with an included Python script. No remote downloads, package installs, or archive extraction are performed by the skill itself, so installation risk is low.
Credentials
The skill declares no required environment variables and the code does not access any credentials or secret-bearing env vars. This is appropriate for a local monitor that only fetches public market data.
Persistence & Privilege
The skill is not always-enabled and does not request elevated privileges or modify other skills or system-wide configurations. It only writes a local /tmp JSON status file and exits with meaningful return codes (0/2).
Assessment
This script appears to do what it says: fetch public quotes from Sina, compute signals, print output, and save a /tmp status file. Before installing/running: 1) Review and edit the HOLDINGS list in the script (do not paste secrets into it). 2) Prefer running with a controlled python environment (venv) and check the shebang — it points to a Homebrew python; you may want /usr/bin/env python3 instead. 3) Run it as a non-privileged user and confirm the /tmp/holding_check.json contents and permissions meet your privacy needs. 4) If you add notification integrations (飞书/微信), keep credentials out of the script and store them securely (env or protected config). 5) If running from cron, ensure the cron PATH/python match your environment so the script uses the intended interpreter.

Like a lobster shell, security has layers — review code before you run it.

latestvk9794kvjfsyn0440ay94ap2nsh850qc5
94downloads
0stars
1versions
Updated 1w ago
v1.0.0
MIT-0

A股持仓监控脚本

监控A股持仓的止损、支撑、目标价和异常波动。

功能

  • 实时获取持仓股票现价
  • 检测是否触及止损/支撑/目标位
  • 计算浮盈/浮亏
  • 乖离率超5%警告
  • 当日跌幅超5%异动告警

触发条件

条件标记操作建议
触及止损价🔴建议止损
跌破支撑位🟠关注是否企稳
当日跌幅>5%🔴异动告警
乖离率>+5%⚠️短线过热

文件

  • holding_monitor.py - 主程序

安装

  1. 下载脚本
  2. 修改脚本顶部的 HOLDINGS 列表,填入你的持仓
  3. 设置执行权限:chmod +x holding_monitor.py

配置

编辑 HOLDINGS 列表:

HOLDINGS = [
    {
        "name": "贵州茅台",
        "code": "sh600519",  # sh=上证 sz=深证
        "cost": 1800.0,
        "qty": 10,
        "stop_loss": 1700.0,
        "support": 1750.0,
        "target": "2000-2100",
        "optimistic": 2200,
    },
]

运行方式

手动运行:

python3 holding_monitor.py

定时检查(每天9:30-15:00每30分钟一次):

# 添加到crontab
crontab -e

# 写入:
*/30 9-15 * * 1-5 /path/to/holding_monitor.py >> /path/to/holding_monitor.log 2>&1

输出示例

[2026-04-17 14:00:00] 持仓检查...
贵州茅台: 现价1850.0 +2.78% 浮盈+500元(+2.78%)
洛阳钼业: 现价20.16 -0.64% 浮盈+3元(+0.07%)
  → 持有

📊 A股持仓监控
---
【贵州茅台 sh600519】
现价: 1850.000  +2.78%
成本: 1800.000  浮盈: +500元(+2.78%)
MA5: 1820.00  乖离率: +1.65%
支撑: 1750.0  止损: 1700.0  目标: 2000-2100
→ 操作建议: 持有

注意事项

  • 需要网络连接获取实时行情
  • 数据源:新浪财经API
  • 止损和支撑位需要根据个人风险承受能力设置
  • 建议配合飞书/微信机器人实现推送通知

Comments

Loading comments...