← Back to Skills Marketplace
harrierdb

CMC Kline Data Collector

by HarrierDB · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
262
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install cmc-kline-data-collector
Description
从 CoinMarketCap 获取加密货币 K 线历史数据,自动计算 EMA7、EMA30、RSI14 等技术指标,支持 JSON/CSV 格式输出
README (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

注意事项

  1. 数据需求:需要至少 35 天历史数据来计算指标(30 天 EMA + 7 天输出)
  2. API 限制:CMC 公开 API 无速率限制,但建议不要高频调用
  3. 时区:CMC 返回 UTC 时间,日期格式为 MMDD(如 0309=3 月 9 日)
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install cmc-kline-data-collector
  3. After installation, invoke the skill by name or use /cmc-kline-data-collector
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
首发版本 - 从 CoinMarketCap 获取 ETH/SOL/BNB 等加密货币 K 线数据,自动计算 EMA7/EMA30/RSI14 技术指标,支持 JSON/CSV 格式输出
Metadata
Slug cmc-kline-data-collector
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is CMC Kline Data Collector?

从 CoinMarketCap 获取加密货币 K 线历史数据,自动计算 EMA7、EMA30、RSI14 等技术指标,支持 JSON/CSV 格式输出. It is an AI Agent Skill for Claude Code / OpenClaw, with 262 downloads so far.

How do I install CMC Kline Data Collector?

Run "/install cmc-kline-data-collector" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is CMC Kline Data Collector free?

Yes, CMC Kline Data Collector is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does CMC Kline Data Collector support?

CMC Kline Data Collector is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created CMC Kline Data Collector?

It is built and maintained by HarrierDB (@harrierdb); the current version is v1.0.0.

💬 Comments