Stock Trading Monitoring System: Querying A-Share Market Data and Price Alerts in Agent

Introduction

When monitoring the A-share market, common practices include keeping a trading software window open or using scripts to pull market data periodically and compare it against thresholds manually. The former occupies your attention, while the latter requires splitting queries, logging, and alerting into multiple small tools. If you are already extending Agent capabilities using Skills in environments like Cursor or Claude Code, you can consolidate “price checking, inspection, logging, and modifying monitoring lists” into a single conversation or scheduled task. Below is an introduction to the Stock Trading Monitoring System on SkillHub (Coordinate @user_62138798/stock-price-monitor, v1.0.0). It is designed for real-time A-share market data and price/percentage alerts. According to the official description, it does not consume tokens during use, making it suitable for low-cost, long-term monitoring.

What is this

The Stock Trading Monitoring System (Stock Monitor) is a community-sourced (community) Agent Skill categorized under data-analysis, published by user_62138798. The Skill fetches A-share market data via the Sina Finance interface (documented as hq.sinajs.cn) and performs queries, alert judgment, and daily price logging via local scripts. The tag requires_api_key=false indicates that no additional API Key is required.

When a user mentions intents such as “stocks,” “monitoring,” “stock price,” “alert,” “check stock price,” or “view market,” the Agent can select the corresponding command based on the Skill’s instructions.

Core Functions

Based on the official introduction and Skill documentation, the capabilities can be summarized into four categories:

  1. Real-time Query (query)
    Returns the real-time price and percentage change for all monitored targets in the configuration.

  2. Alert Check (check)
    Executes a round of market checks; returns alert text if the price hits a high/low or the percentage change reaches a threshold, otherwise returns an “indicators normal” type message (specific text depends on the script’s return value).

  3. Logging (log, log_history)
    log views the current day’s price log (open/close/high/low and alert records); log_history views a summary of the last 7 days. The log file is scripts/stock_daily_log.json, which is updated automatically during check / query.

  4. Configuration Management
    Maintains monitored targets, price upper/lower limits, percentage change thresholds, check intervals, and options like “remind only once per day” via scripts/stock_config.json.

The documentation also states: prices will be skipped if they are 0 or invalid previous close during pre-market or closed hours; alerts for the same condition on the same day can be configured to remind only once (only_once recommended as true).

Installation and Activation

Install SkillHub CLI (if not installed)

First, check if the CLI is already on your machine:

command -v skillhub && skillhub --version

If not installed, follow the SkillHub official installation documentation to perform a full installation (the example below is the recommended method):

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash

To install only the CLI:

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash -s -- --cli-only

Install this Skill

The installation prompt provided on the SkillHub page is: Refer to SkillHub Installation Instructions to install @user_62138798/stock-price-monitor.

When installing, you must use --dir to point to the current Agent’s skills directory; otherwise, it defaults to ./skills/ which may not be recognized. Common path examples:

  • Cursor: ~/.cursor/skills/
  • Claude Code: ~/.claude/skills/
  • Codex: ~/.codex/skills/ or .agents/skills/ under the project

Example command (replace the directory with the corresponding path for your current environment):

skillhub install @user_62138798/stock-price-monitor --dir ~/.cursor/skills/

After installation, refresh or restart the Agent according to your client’s requirements to load the new Skill.

Configuration File

Edit scripts/stock_config.json in the Skill directory. The meanings of the fields in the documentation are as follows:

{
    "stocks": [
        {
            "code": "688599",
            "name": "天合光能",
            "price_high": 17,
            "price_low": 15,
            "rise_pct": 99,
            "fall_pct": -99
        }
    ],
    "check_interval": 30,
    "only_once": true
}
  • code: Stock code (Shanghai Stock Exchange starts with 6, Shenzhen Stock Exchange does not start with 6)
  • name: Name (for easier reading of logs and output)
  • price_high / price_low: Price alert upper and lower limits
  • rise_pct / fall_pct: Percentage change alert thresholds (the documentation example uses ±99 to indicate that percentage alerts can be considered disabled)
  • check_interval: Configuration related to check intervals (used when配合 with scheduled tasks)
  • only_once: Whether to remind only once for the same condition alert on the same calendar day

Typical Usage

Let the Agent execute in conversation

Simply state your intent to the Agent, such as “Use the Stock Trading Monitoring System to check the market for the current monitoring list” or “Execute check to see if there are any alerts.” The Skill maps run() to the following commands (both Chinese and English are accepted):

Command Description
check / 检查 A round of checks; returns an alert if there is one
query / 查询 Real-time price and percentage change for all monitored targets
log / 日志 Current day’s price and alert log
log_history / 历史日志 Log summary for the last 7 days

Direct Command Line Invocation

Enter the Skill’s scripts directory and execute:

cd <skill-dir>/scripts/
python3 stock_monitor_skill.py check
python3 stock_monitor_skill.py query
python3 stock_monitor_skill.py log
python3 stock_monitor_skill.py log_history

Scheduled Inspection (OpenClaw / Clawdbot Example)

The documentation provides an example of using Cron to trigger check periodically (interval and payload can be adjusted as needed):

openclaw-cn cron add \
  --name "股票交易监控系统" \
  --every 120000 \
  --payload '{"kind":"systemEvent","text":"【股票交易监控系统 检查】运行 stock_monitor_skill 的 check 函数,触发真实告警才汇报,否则保持沉默。"}' \
  --session-target main

The recommended check frequency is once every 1–5 minutes during trading hours; during non-trading hours, the script will skip invalid market data according to the documentation logic.

Applicable Scenarios and Notes

Who it is for

  • Users already handling news or automation tasks within an Agent workflow who want to embed price/percentage threshold checks for a small number of self-selected stocks into conversations or scheduled tasks.
  • Users who need local daily archives of open, close, high, low, and alert times, rather than just asking for a price temporarily in a chat.

Limitations and Notes

  • Market data depends on the Sina Finance public interface, and the fields are in the simplified format described in the documentation (current price, change amount, change percentage, volume, turnover, etc.). It is not suitable as the sole basis for trading decisions.
  • Only covers the A-share code rules and market logic described in the Skill documentation; Hong Kong stocks, US stocks, etc., are not within the scope of verification for this article.
  • The scheduled task and Cron integration examples target the Clawdbot/OpenClaw ecosystem; other clients need to map “periodically executing check” to their respective scheduling methods.
  • The SkillHub page marks the version as v1.0.0; store statistics (as of the page display) show a rating of 100000, 5293 downloads, and 0 installs (subject to the SkillHub list).

Conclusion

The Stock Trading Monitoring System consolidates A-share price checking, threshold alerts, daily logs, and configuration maintenance into a single Skill: the Agent side can be driven using commands like query / check / log, local stock_config.json manages targets and thresholds, and it can be combined with scheduled tasks for silent inspection. Official entry points:

  • API Coordinate Page: https://api.skillhub.cn/user_62138798/stock-price-monitor
  • SkillHub Display Page: https://www.skillhub.cn/skills/user_62138798/stock-price-monitor
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye