← Back to Skills Marketplace
jisuapi

Stock Monitor - 股票监控

by 极速数据 · GitHub ↗ · v1.0.4 · MIT-0
cross-platform ✓ Security Clean
229
Downloads
5
Stars
1
Active Installs
5
Versions
Install in OpenClaw
/install jisu-stock-monitor
Description
对持仓做一次性检查:盈亏、涨跌、缺口、均线与 RSI 等(无常驻进程,可配阈值与状态文件)。当用户说:帮我检查一下持仓要不要告警?我的 ETF 今天触发止损了吗?或类似持仓体检问题时,使用本技能。
README (SKILL.md)

\r \r

极速数据持仓监控(jisu-stock-monitor)\r

\r 基于 股票查询 API股票历史行情 API,对本地 JSON 配置的持仓列表执行 check,输出 JSON 结果与触发说明。\r \r 免责声明:仅供技术学习与信息整理,不构成投资建议;行情与指标可能存在延迟或误差,请自行核实。\r \r \r

# Linux / macOS\r
export JISU_API_KEY="your_appkey_here"\r
# 可选:默认状态文件路径(当请求体未写 state_file 时)\r
export JISU_STOCK_MONITOR_STATE="/path/to/jisu-stock-monitor.state.json"\r
\r
# Windows PowerShell\r
$env:JISU_API_KEY="your_appkey_here"\r
# 可选:默认状态文件(当请求体未写 state_file 时)\r
$env:JISU_STOCK_MONITOR_STATE="C:\path	o\jisu-stock-monitor.state.json"\r
```\r
\r
依赖:`pip install requests`。Windows 下若无 `python3` 命令,可改用 `py -3` 或 `python`。\r
\r
## 脚本路径\r
\r
文档与示例统一写作 **`skills/jisu-stock-monitor/monitor.py`**。若你克隆的仓库目录实际是 **`skill/`**,请把命令里的 `skills/` 换成 **`skill/`**。\r
\r
## 使用方式\r
\r
### check(持仓检查)\r
\r
```bash\r
python3 skills/jisu-stock-monitor/monitor.py check @skills/jisu-stock-monitor/config.example.json\r
```\r
\r
也可传入内联 JSON,或从标准输入:\r
\r
```bash\r
python3 skills/jisu-stock-monitor/monitor.py check '{"holdings":[{"code":"300917","cost":10,"alerts":{}}]}'\r
echo '{"holdings":[...]}' | python3 skills/jisu-stock-monitor/monitor.py check -\r
```\r
\r
### 请求体字段(根级)\r
\r
| 字段 | 类型 | 说明 |\r
|------|------|------|\r
| holdings | array | **必填**,每项见下表 |\r
| history_days | int | 可选,拉取历史 K 线的日历跨度(30–365),默认 90 |\r
| state_file | string / null | 状态文件路径(跨日止盈峰值、告警冷却)。`null`/`false`/空字符串 表示禁用 |\r
| alert_cooldown_minutes | int | 可选,同一标的同一 `rule` 在多少分钟内只报一次(0 表示关闭)。>0 且未配置 `state_file` 且未设环境变量时,会默认使用当前目录下 `jisu-stock-monitor.state.json` |\r
\r
单只持仓 `holdings[]`:\r
\r
| 字段 | 类型 | 说明 |\r
|------|------|------|\r
| code | string | 股票代码,必填 |\r
| name | string | 可选,缺省用接口返回名称 |\r
| cost | number | 可选,成本价;用于成本盈亏% 与动态止盈 |\r
| type | string | 可选,影响**默认**日内涨跌幅阈值:`individual` 个股 ±4%(默认)、`etf` ±2%、`gold` / `au` / `commodity` ±2.5% |\r
| state_key | string | 可选,状态文件里跟踪峰值/冷却的主键,默认等于 `code`(同一账户多策略时可区分) |\r
| alerts | object | 可选,规则见下 |\r
\r
`alerts` 中可选规则(未配置则跳过对应检查;**日内涨跌幅**在未显式关闭时使用上表 `type` 对应默认阈值):\r
\r
| 键 | 说明 |\r
|----|------|\r
| cost_pct_above / cost_pct_below | 相对成本盈利/亏损达到阈值(%)时告警,如 +15 / -12 |\r
| change_pct_above / change_pct_below | 日内涨跌幅阈值(%);若设为 JSON `false` 可关闭该侧默认阈值 |\r
| ma_monitor | `true` 时根据日线收盘计算 MA5/MA10,检测上一交易日相对再前一日的金叉/死叉 |\r
| volume_surge | 放量:例如 `2` 表示最后一根日线成交量 ≥ 近 5 日均量 × 2 |\r
| volume_shrink | 缩量:例如 `0.5` 表示最后一根日线成交量 ≤ 近 5 日均量 × 0.5 |\r
| gap_monitor | `true` 时用 `stock/detail` 的今开、昨收计算**开盘跳空%** |\r
| gap_up_pct / gap_down_pct | 可选,向上/向下开盘跳空阈值(%),默认分别为 `1` 与 `-1` |\r
| gap_true_monitor | `true` 时用日线**昨日高/低**与**当日 detail 高/低**判断**真缺口**(今日低 > 昨日高 / 今日高 \x3C 昨日低) |\r
| gap_true_min_pct | 可选,缺口体幅度(占昨高或昨低的%)下限,过滤微小缺口;不设则只要满足真缺口形态即告警 |\r
| dynamic_trailing | 对象,见下表「动态止盈」 |\r
| rsi_monitor | `true` 时计算简化 RSI(14),并结合 rsi_overbought / rsi_oversold(默认 70 / 30) |\r
\r
**动态止盈** `dynamic_trailing`:\r
\r
| 子字段 | 默认 | 说明 |\r
|--------|------|------|\r
| enable | true | 设为 `false` 可关闭 |\r
| persist | true | 在配置了 `state_file`(或环境变量路径)时,将**跟踪高点**写入状态文件,实现**跨日**峰值;为 `false` 时仅用当前接口一次快照中的价高(跨 run 不记忆) |\r
| min_peak_profit_pct | 10 | 相对成本,跟踪高点达到的盈利% ≥ 此值才参与回撤判断 |\r
| drawdown_warn_pct | 5 | 自跟踪高点回撤 ≥ 此% 触发 `dynamic_trailing_warn` |\r
| drawdown_urgent_pct | 10 | 自跟踪高点回撤 ≥ 此% 触发 `dynamic_trailing_urgent`(与上一档互斥,优先更严) |\r
\r
**告警冷却**:`alert_cooldown_minutes` > 0 时,每条触发的 `rule` 在冷却期内重复满足条件不会出现在 `triggers` 中,而记入该标的的 `suppressed_by_cooldown`(便于排查「为何没响」)。\r
\r
需要历史 K 线时才会请求 `stockhistory/query`;**仅成本、日内、开盘跳空、动态止盈(且未开真缺口)**时可能只调 `stock/detail`。\r
\r
### 成功时 JSON 顶层(便于代理解析)\r
\r
- **`ok`**:整体是否成功执行脚本逻辑  \r
- **`checked_at`**:检查日期(ISO 日期字符串)  \r
- **`summary`**:`holdings`、`trigger_events`、`warning_level_events`、`suppressed_by_cooldown`、`state_file`、`alert_cooldown_minutes` 等汇总  \r
- **`results`**:数组,每项对应一只标的,含 **`triggers`**、**`suppressed_by_cooldown`**、**`indicators`**、**`ok`** / **`error`**\r
\r
### 常见错误返回(节选)\r
\r
| 情况 | 说明 |\r
|------|------|\r
| `missing_credential` | 未设置 `JISU_API_KEY` |\r
| `missing_param` | 未提供非空 `holdings` |\r
| `state_save_failed` | 状态文件目录不可写等 |\r
| 单条 `results[].ok: false` | 该代码 `stock/detail` 请求失败,见 `error` 字段 |\r
\r
非零退出码表示参数错误、凭据缺失或状态写入失败;成功时 stdout 为一整段 JSON。\r
\r
**提示**:含**成本**的 JSON、**状态文件**路径勿提交公开仓库,建议写入 **`.gitignore`**。\r
\r
`.gitignore` 示例(按你的实际目录调整):\r
\r
```gitignore\r
# jisu-stock-monitor 本地配置与状态\r
skill/jisu-stock-monitor/*.state.json\r
skill/jisu-stock-monitor/config*.local.json\r
```\r
\r
## 推荐用法\r
\r
1. 用户说「跑持仓监控」「有没有触发预警」「检查这几只票」等,且已有或愿意让你维护一份 **JSON 配置**(可参考 `config.example.json`)时。\r
2. 确认环境已设 **`JISU_API_KEY`**,再执行一次:`python3 skills/jisu-stock-monitor/monitor.py check @\x3C配置文件.json>`(或内联 JSON / 管道 `check -`);**不要**为本技能启动后台常驻进程。\r
3. 从打印的 JSON 中取 **`summary`**、每条 **`results[].triggers`**;若有 **`suppressed_by_cooldown`**,说明「规则仍满足,但在冷却期内未重复播报」。\r
4. 用自然语言归纳触发的标的、**`rule`** 与 **`message`**,并复述本技能**免责声明**;不得把输出杜撰为买卖建议或新闻结论。\r
5. 仅需现价/列表 → 用 **jisu-stock**;要更长周期 K 线 → **stockhistory**;要新闻/舆情 → **news-cn**(或其它新闻技能),再与本技能的告警结果分开呈现。\r
\r
### 用户侧提示词模板(可复制)\r
\r
把下面整段发给代理,按需改掉括号里的内容即可:\r
\r
```text\r
帮我用 jisu-stock-monitor 监控这几只股票:(股票名称或代码一)、(股票名称或代码二)……\r
持仓成本分别为(成本1)、(成本2)……(与上面顺序一一对应;没有成本的标的请说明「只监控不设成本」)。\r
\r
请根据极速数据可用的 6 位代码生成或更新 JSON 配置(可参考 skills/jisu-stock-monitor/config.example.json),需要的话加上 state_file 与 alert_cooldown_minutes;\r
然后执行:python3 skills/jisu-stock-monitor/monitor.py check @(配置文件路径)\r
\r
把输出里的 summary、各标的 triggers 用中文说明清楚;若有 suppressed_by_cooldown 也要解释;最后提醒非投资建议。\r
```\r
\r
**示例(填好后的样子):**\r
\r
```text\r
帮我监控一下宁德时代、比亚迪这两个票,持仓成本分别为 402、98。请生成配置并跑一遍 jisu-stock-monitor 的 check,把有没有触发规则用中文告诉我,并带免责声明。\r
```\r
\r
## 与单项技能的关系\r
\r
- 实时行情字段与 **jisu-stock**(`stock/detail`)一致。\r
- 均线、放量/缩量、RSI、真缺口依赖 **stockhistory** 同源日线数据。\r
\r
## 相关链接\r
\r
- ClawHub 本技能:\x3Chttps://clawhub.ai/jisuapi/jisu-stock-monitor>\r
- 股票 API:\x3Chttps://www.jisuapi.com/api/stock/>\r
- 历史行情 API:\x3Chttps://www.jisuapi.com/api/stockhistory/>\r
- 极速数据官网:\x3Chttps://www.jisuapi.com/>\r
\r
## 关于极速数据\r
\r
**极速数据(JisuAPI,[jisuapi.com](https://www.jisuapi.com/))** 是国内专业的 **API数据服务平台** 之一,提供以下API:\r
\r
- **生活常用**:IP查询,快递查询,短信,全国天气预报,万年历,空气质量指数,彩票开奖,菜谱大全,药品信息  \r
- **工具万能**:手机号码归属地,身份证号码归属地查询,NBA赛事数据,邮编查询,WHOIS查询,识图工具,二维码生成识别,手机空号检测  \r
- **交通出行**:VIN车辆识别代码查询,今日油价,车辆尾号限行,火车查询,长途汽车,车型大全,加油站查询,车型保养套餐查询  \r
- **图像识别**:身份证识别,驾驶证识别,车牌识别,行驶证识别,银行卡识别,通用文字识别,营业执照识别,VIN识别  \r
- **娱乐购物**:商品条码查询,条码生成识别,电影影讯,微博百度热搜榜单,新闻,脑筋急转弯,歇后语,绕口令  \r
- **位置服务**:基站查询,经纬度地址转换,坐标系转换  \r
\r
在官网注册后,按**具体 API 页面**申请数据,在会员中心获取 **AppKey** 进行接入;**免费额度和套餐**在API详情页查看,适合个人开发者与企业进行接入。在 **ClawHub** 上也可搜索 **`jisuapi`** 找到更多基于极速数据的 OpenClaw 技能。\r
\r
Usage Guidance
This skill appears to do what it claims: run a local Python script that queries Jisu APIs and optionally saves a local state file. Before installing/running: (1) ensure you only provide a JISU_API_KEY you trust for this purpose; (2) keep any JSON that contains holding costs or state_file paths out of public repos (the SKILL.md already recommends .gitignore); (3) note the registry metadata lists JISU_STOCK_MONITOR_STATE as required but the script and docs treat it as optional — you can run the tool without that env var by passing state_file in the request or omitting it; (4) inspect monitor.py yourself (it’s included) and install only the standard 'requests' dependency; (5) if you allow the agent to call skills autonomously, be aware this skill will make network requests to api.jisuapi.com when invoked.
Capability Analysis
Type: OpenClaw Skill Name: jisu-stock-monitor Version: 1.0.4 The skill is a stock monitoring utility that interfaces with the JisuAPI (api.jisuapi.com) to perform technical analysis and price alerts. The Python script (monitor.py) implements legitimate financial logic such as RSI calculation, moving average crossovers, and trailing stop-losses, with state persistence handled via a local JSON file. While the script allows specifying a state file path and reading configuration from local files (using the '@' prefix), these are standard CLI features aligned with its stated purpose and do not show signs of intentional malice or data exfiltration.
Capability Assessment
Purpose & Capability
The skill name/description (stock holding checks using Jisu APIs) matches the actual behavior: it calls jisuapi.com endpoints and computes indicators. However, the registry metadata lists JISU_STOCK_MONITOR_STATE as a required env var while SKILL.md and the code treat the state file path as optional; this mismatch is likely a packaging/metadata oversight rather than functional necessity.
Instruction Scope
SKILL.md explicitly instructs running the included monitor.py which only: reads a JSON holdings config, calls Jisu stock & history APIs, computes indicators, and optionally reads/writes a local state file. It does not instruct the agent to fetch unrelated system files or send data to arbitrary external endpoints beyond api.jisuapi.com.
Install Mechanism
There is no install spec; the skill is distributed with a Python script (monitor.py) and the docs recommend installing the standard 'requests' package. No remote downloads or unusual installers are used.
Credentials
Requesting JISU_API_KEY is appropriate (primary credential). The additional JISU_STOCK_MONITOR_STATE env var is used as a convenient default state-file path but is optional in practice; treating it as 'required' in registry metadata is disproportionate and may confuse users. No unrelated secrets or extra external credentials are requested.
Persistence & Privilege
Skill does not request always:true and does not require a resident process. It may create or update a local state file when configured, which is expected for cross-run trailing-peak tracking; it does not modify other skills or global agent settings.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install jisu-stock-monitor
  3. After installation, invoke the skill by name or use /jisu-stock-monitor
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.4
- 精简并优化了描述和使用场景,突出一次性检查、主要监控指标,以及用户可以直接用于持仓体检、止盈止损类场景。 - 标题 name/description 更加突出技能核心功能,便于用户检索和理解。 - 移除过多背景介绍,将说明聚焦于参数、使用方法及常见用法,便于快速上手。 - 保留主要监控维度、字段和参数表,保证兼容原有功能,说明方式更简练。 - 推荐用法与提示词等部分做了摘要和归纳,文档条理更清晰,适合直接复制使用。
v1.0.3
jisu-stock-monitor 1.0.3 - metadata 中 requires.env 增加了 JISU_STOCK_MONITOR_STATE 环境变量的声明 - 文档新增了 .gitignore 示例,提示本地状态文件与敏感信息配置勿提交公开仓库 - 其余内容无显著变更
v1.0.2
Version 1.0.2 of jisu-stock-monitor - No file changes detected in this release. - Documentation, usage instructions, and configuration details remain unchanged. - No new features, bug fixes, or modifications introduced in this version.
v1.0.1
No changes were detected for version 1.0.1 (documentation update only). - No code or functional changes—SKILL.md was updated. - Added links to ClawHub, JisuAPI official site, and more detailed info about 极速数据 API capabilities in documentation. - No user-facing or behavioral impact.
v1.0.0
jisu-stock-monitor v1.0.0 - Initial release. - Provides one-time portfolio checks using Jisu Stock & Stock History APIs: cost profit/loss, intraday dip/rise (default thresholds for ETF/gold), open jump %, true gap, cross-day dynamic trailing stop, alert cooldown, volume surge/shrink, moving average cross, RSI, and more—without persistent processes. - Supports local JSON holdings config, outputs triggers and explanations in JSON. - Alert rules and dynamic trailing stop are highly configurable. - Includes detailed environment setup instructions. - Designed for agents and CLI/batch use; not for continuous monitoring.
Metadata
Slug jisu-stock-monitor
Version 1.0.4
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 5
Frequently Asked Questions

What is Stock Monitor - 股票监控?

对持仓做一次性检查:盈亏、涨跌、缺口、均线与 RSI 等(无常驻进程,可配阈值与状态文件)。当用户说:帮我检查一下持仓要不要告警?我的 ETF 今天触发止损了吗?或类似持仓体检问题时,使用本技能。 It is an AI Agent Skill for Claude Code / OpenClaw, with 229 downloads so far.

How do I install Stock Monitor - 股票监控?

Run "/install jisu-stock-monitor" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Stock Monitor - 股票监控 free?

Yes, Stock Monitor - 股票监控 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Stock Monitor - 股票监控 support?

Stock Monitor - 股票监控 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Stock Monitor - 股票监控?

It is built and maintained by 极速数据 (@jisuapi); the current version is v1.0.4.

💬 Comments