Install
openclaw skills install crypto-scope提供加密货币实时价格查询、技术指标分析(MA/RSI/MACD)和交易信号生成,支持多币种批量监控。
openclaw skills install crypto-scope# 比特币价格
python3 scripts/crypto_analyzer.py price bitcoin
# 以太坊价格
python3 scripts/crypto_analyzer.py price ethereum
# 自定义币种
python3 scripts/crypto_analyzer.py price solana
# 完整技术分析
python3 scripts/crypto_analyzer.py analyze bitcoin
# 指定指标
python3 scripts/crypto_analyzer.py analyze ethereum --indicators ma,rsi,macd
# 生成交易信号
python3 scripts/crypto_analyzer.py signal bitcoin
# 多币种信号
python3 scripts/crypto_analyzer.py signal bitcoin,ethereum,solana
{
"symbol": "bitcoin",
"name": "Bitcoin",
"price": 42350.67,
"change_24h": 2.35,
"volume_24h": 28500000000,
"market_cap": 830000000000,
"indicators": {
"ma_20": 42100.50,
"rsi": 58.3,
"macd": "bullish"
},
"signal": "BUY",
"confidence": 0.75,
"timestamp": 1709798400
}
python3 scripts/crypto_analyzer.py analyze bitcoin --format markdown
支持币种:
数据来源:
示例:
python3 scripts/crypto_analyzer.py price bitcoin
# 输出
{
"symbol": "bitcoin",
"name": "Bitcoin",
"price": 42350.67,
"change_24h": 2.35,
"volume_24h": 28500000000
}
支持指标:
| 指标 | 说明 | 周期 |
|---|---|---|
| MA | 移动平均线 | 20/50/200 |
| RSI | 相对强弱指数 | 14 |
| MACD | 异同移动平均线 | 12/26/9 |
| Bollinger | 布林带 | 20,2 |
| EMA | 指数移动平均 | 12/26 |
示例:
# 完整分析
python3 scripts/crypto_analyzer.py analyze ethereum
# 输出
{
"symbol": "ethereum",
"price": 2250.45,
"indicators": {
"ma_20": 2200.30,
"ma_50": 2150.80,
"rsi": 62.5,
"macd": {
"value": 15.3,
"signal": 12.1,
"trend": "bullish"
}
}
}
信号类型:
信号逻辑:
# 多指标综合判断
- MA交叉
- RSI超买超卖
- MACD金叉死叉
- 趋势强度
# 置信度计算
confidence = (
ma_signal * 0.3 +
rsi_signal * 0.3 +
macd_signal * 0.4
)
示例:
python3 scripts/crypto_analyzer.py signal bitcoin
# 输出
{
"symbol": "bitcoin",
"signal": "BUY",
"confidence": 0.75,
"reasons": [
"MA20上穿MA50",
"RSI=58(健康区间)",
"MACD金叉确认"
],
"risk_level": "medium"
}
多币种监控:
# 监控多个币种
python3 scripts/crypto_analyzer.py monitor bitcoin,ethereum,solana
# 输出
[
{
"symbol": "bitcoin",
"price": 42350.67,
"signal": "BUY",
"confidence": 0.75
},
{
"symbol": "ethereum",
"price": 2250.45,
"signal": "HOLD",
"confidence": 0.60
},
{
"symbol": "solana",
"price": 105.30,
"signal": "SELL",
"confidence": 0.70
}
]
# 指定MA周期
python3 scripts/crypto_analyzer.py analyze bitcoin --ma-periods 10,30,60
# 指定RSI周期
python3 scripts/crypto_analyzer.py analyze ethereum --rsi-period 21
# 获取历史价格
python3 scripts/crypto_analyzer.py history bitcoin --days 30
# 导出CSV
python3 scripts/crypto_analyzer.py history ethereum --days 90 --output csv
# 设置价格预警
python3 scripts/crypto_analyzer.py alert bitcoin --above 45000
# RSI预警
python3 scripts/crypto_analyzer.py alert ethereum --rsi-below 30
CoinGecko API:
降级策略:
移动平均线(MA):
def calculate_ma(prices, period):
return sum(prices[-period:]) / period
相对强弱指数(RSI):
def calculate_rsi(prices, period=14):
gains = [max(prices[i] - prices[i-1], 0) for i in range(1, len(prices))]
losses = [max(prices[i-1] - prices[i], 0) for i in range(1, len(prices))]
avg_gain = sum(gains[-period:]) / period
avg_loss = sum(losses[-period:]) / period
if avg_loss == 0:
return 100
rs = avg_gain / avg_loss
return 100 - (100 / (1 + rs))
MACD:
def calculate_macd(prices):
ema_12 = calculate_ema(prices, 12)
ema_26 = calculate_ema(prices, 26)
macd = ema_12 - ema_26
signal = calculate_ema([macd], 9)
return {
"macd": macd,
"signal": signal,
"histogram": macd - signal
}
买入信号:
卖出信号:
持有信号:
| 错误 | 原因 | 解决方案 |
|---|---|---|
APIError | CoinGecko API限制 | 等待1分钟后重试 |
InvalidSymbol | 币种不支持 | 检查币种名称 |
InsufficientData | 数据不足 | 至少需要30天数据 |
# 调试模式
python3 scripts/crypto_analyzer.py analyze bitcoin --log-level debug
# 启用缓存(默认5分钟)
python3 scripts/crypto_analyzer.py price bitcoin --cache 300
# 批量查询(减少API调用)
python3 scripts/crypto_analyzer.py monitor bitcoin,ethereum,solana
⚠️ 免责声明:
# 分析白皮书 → 技术分析
python3 doc-genius/scripts/doc_processor.py summarize whitepaper.pdf
python3 crypto-scope/scripts/crypto_analyzer.py analyze bitcoin
# 抓取新闻 → 情绪分析
python3 scrapling-fetch/scripts/fetch.py "https://cryptonews.com"
python3 crypto-scope/scripts/crypto_analyzer.py sentiment bitcoin
CryptoScope - 让加密货币分析更智能 📈💰
npx clawhub install crypto-scope
# 实时价格($0.05/次)
python3 scripts/crypto_analyzer_paid.py price bitcoin --user-id user123
# 技术分析($0.05/次)
python3 scripts/crypto_analyzer_paid.py analyze ethereum --user-id user123
# 交易信号($0.05/次)
python3 scripts/crypto_analyzer_paid.py signal solana --user-id user123
扣费流程:
余额不足时: 自动返回充值链接
步骤:
SKILL_ID# 在 crypto_analyzer_paid.py 中修改
SKILL_ID = 'your-skill-id-here' # 替换为真实Skill ID
预期收益:
目标用户: