← 返回 Skills 市场
262
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install cmc-kline-data-collector
功能描述
从 CoinMarketCap 获取加密货币 K 线历史数据,自动计算 EMA7、EMA30、RSI14 等技术指标,支持 JSON/CSV 格式输出
使用说明 (SKILL.md)
CMC Kline Data Collector Skill
从 CoinMarketCap 获取 ETH/SOL/BNB 等加密货币的历史 K 线数据,自动计算 EMA7、EMA30、RSI14 等技术指标,输出标准化 JSON 格式。
使用方法
在对话中使用
获取 ETH 最近 7 天的 K 线数据
生成 ETH/SOL/BNB 的每日指标数据
输出 BTC 历史数据到 JSON 文件
编程调用
from skills.crypto_data_processor import CryptoDataProcessor
# 创建处理器
processor = CryptoDataProcessor()
# 获取单个币种数据
eth_data = processor.fetch_symbol("ETH", days=30)
# 获取多个币种数据
all_data = processor.fetch_all(["ETH", "SOL", "BNB"])
# 保存为 JSON
processor.save_json(all_data, "/path/to/output.json")
# 保存为 CSV
processor.save_csv(eth_data, "eth_kline.csv")
输出格式
{
"ETH": [
{"O":2027.41,"H":2040.79,"L":1930.4,"C":1982.77,"E7":1976.66,"E30":2115.05,"R14":43.71,"D":"0303"},
{"O":1982.71,"H":2198.66,"L":1946.04,"C":2126.51,"E7":2014.12,"E30":2115.79,"R14":52.1,"D":"0304"}
],
"SOL": [...],
"BNB": [...]
}
字段说明:
O- Open(开盘价)H- High(最高价)L- Low(最低价)C- Close(收盘价)E7- EMA 7(7 日指数移动平均)E30- EMA 30(30 日指数移动平均)R14- RSI 14(14 日相对强弱指数)D- Date(日期,MMDD 格式)
配置
编辑 config.py 修改币种和 API 设置:
# 币种 ID 映射(CoinMarketCap ID)
SYMBOL_TO_ID = {
"BTC": 1,
"ETH": 1027,
"BNB": 1839,
"SOL": 5426,
# 添加更多...
}
# 计价货币(2781=USD)
CONVERT_ID = 2781
# 输出目录
OUTPUT_DIR = "/home/admin/.openclaw/workspace/crypto-data-processor/output"
依赖
pip install requests
原项目位置
原始 crypto-data-processor 项目保留在:
/home/admin/.openclaw/workspace/crypto-data-processor/
本 Skill 名称:cmc-kline-data-collector
包括:
- 完整源代码
- crontab 定时任务配置
- 输出目录
- README 文档
与定时任务集成
原项目的 crontab 配置保持不变:
# 每天 9:00 自动执行
0 9 * * * cd /home/admin/.openclaw/workspace/crypto-data-processor && python scripts/daily_kline.py --output /home/admin/.openclaw/workspace/crypto-data-processor/output/daily_$(date +\%Y\%m\%d).json
注意事项
- 数据需求:需要至少 35 天历史数据来计算指标(30 天 EMA + 7 天输出)
- API 限制:CMC 公开 API 无速率限制,但建议不要高频调用
- 时区:CMC 返回 UTC 时间,日期格式为 MMDD(如 0309=3 月 9 日)
安全使用建议
This package appears to implement the described CMC data collector, but there are several red flags and bugs you should address before running it:
- Do not assume SKILL.md claims (absolute /home/admin paths, included crontab/scripts) are present — the manifest lacks those files. If you plan to add a cron job, create and review the script first.
- The code performs network requests to CoinMarketCap (no API key handling). Expect rate limits or API changes; review the endpoint and test in a controlled environment.
- There is a real type/logic bug: indicators.calc_indicators expects a List[Quote] but the top-level __init__.py passes a KlineData object and then continues to treat the return value as if it were KlineData — running the skill as-is will likely raise exceptions. Review and fix function calls before use.
- to_js_object produces unquoted strings (not valid/safe JS if values contain special characters); avoid using it with untrusted data.
- Run the skill in an isolated/sandbox environment first, inspect network traffic (to confirm endpoints), and back up any important local directories referenced by custom output paths. If you rely on automated scheduling, implement and audit the scheduling step yourself rather than trusting the SKILL.md claims.
If you want, I can: (a) point out exact lines to change to fix the calc_indicators call and the inconsistent output formatting, or (b) generate a safe wrapper that validates responses and writes outputs to a user-specified safe directory.
功能分析
Type: OpenClaw Skill
Name: cmc-kline-data-collector
Version: 1.0.0
The skill is a legitimate cryptocurrency data collector that fetches K-line data from CoinMarketCap's public API and calculates technical indicators (EMA, RSI). The code in `src/cmc_client.py` and `src/indicators.py` is well-structured and aligns with the stated purpose. While `SKILL.md` references specific local paths (e.g., `/home/admin/.openclaw/workspace/`), these appear to be environment-specific documentation rather than malicious instructions or backdoors.
能力评估
Purpose & Capability
Name/description align with the code: a client fetches CoinMarketCap historical data and modules compute EMA/RSI and save JSON/CSV. However SKILL.md claims an original project location (/home/admin/...), a crontab, and scripts are included; the file manifest does not contain the referenced scripts/crontab. Also SKILL.md's config snippet shows an absolute OUTPUT_DIR while config.py uses a relative "output" path — inconsistent documentation vs code.
Instruction Scope
Runtime instructions and SKILL.md are mostly limited to fetching data and saving outputs. Concerns: (1) SKILL.md claims a preserved crontab that would run a script at /home/admin/... but there is no scripts/daily_kline.py or crontab file in the manifest; this mismatch could mislead users into enabling a cron job that won't behave as expected. (2) The code has an actual API call to CoinMarketCap (network access) but does not handle API keys; SKILL.md incorrectly states "CMC 公开 API 无速率限制." (3) There is a functional inconsistency: src/indicators.calc_indicators expects a list of Quote but __init__.py passes a KlineData object to calc_indicators and then continues to treat kline as if it were KlineData, which would cause runtime errors. (4) to_js_object emits unquoted string values (could produce invalid/unsafe JS if used blindly).
Install Mechanism
No install spec. The only declared dependency in SKILL.md is requests (pip install requests), which is expected for HTTP calls. No downloads or executables are requested by the skill package itself.
Credentials
The skill requests no environment variables, credentials, or config paths. Its network calls go to CoinMarketCap and it writes files to a local output directory; this is proportionate to the stated purpose.
Persistence & Privilege
always is false and there is no install spec that modifies system or other skills. The SKILL.md mentions a crontab in the original project, but the package does not itself install or enable any persistent scheduled tasks.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install cmc-kline-data-collector - 安装完成后,直接呼叫该 Skill 的名称或使用
/cmc-kline-data-collector触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
首发版本 - 从 CoinMarketCap 获取 ETH/SOL/BNB 等加密货币 K 线数据,自动计算 EMA7/EMA30/RSI14 技术指标,支持 JSON/CSV 格式输出
元数据
常见问题
CMC Kline Data Collector 是什么?
从 CoinMarketCap 获取加密货币 K 线历史数据,自动计算 EMA7、EMA30、RSI14 等技术指标,支持 JSON/CSV 格式输出. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 262 次。
如何安装 CMC Kline Data Collector?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install cmc-kline-data-collector」即可一键安装,无需额外配置。
CMC Kline Data Collector 是免费的吗?
是的,CMC Kline Data Collector 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
CMC Kline Data Collector 支持哪些平台?
CMC Kline Data Collector 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 CMC Kline Data Collector?
由 HarrierDB(@harrierdb)开发并维护,当前版本 v1.0.0。
推荐 Skills