Naoufal Andichi

crypto-trader

专业领域v1.0.0
作者:Naoufal Andichi更新于 2026-05-11
#Cryptocurrency#Crypto Trading#Portfolio Management#Discord#Email

据 AlphaMoat 统计,截至 2026-09,crypto-trader 累计下载 3,135 次、获 10 个星标,在全部 5,078 个 AI 技能中排名第 3,635 位,在「专业领域」分类(465 个)中排名第 300 位。

累计安装
106
累计下载
3,135
星标
10
全站排名
#3,635
全站前 72% · 「专业领域」前 65%
平台累计安装累计下载星标评论
ClawHub ↗1063,13510-

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

主文介绍余额与策略状态查询、策略启动和停止、历史记录、情绪分析、监控及告警;默认操作使用 testnet 纸面交易,并要求启动策略前展示参数并取得用户确认。支持交易所 API 密钥与通知凭据。配套风险说明指出真实资金保护措施未可靠地由代码强制执行,因此应保持纸面或测试网络模式;在安全机制修复并具备真实授权闸门前,不要使用真实资金。交易所密钥应限制为交易权限、禁用提现权限,并妥善保护通知 webhook。

资料发布于 2026-10-29

可以用来做什么

  • 查看账户余额或策略状态
  • 在纸面交易环境中运行策略回测
  • 检查风险状态和紧急停止流程

什么时候用

  • 只希望进行账户状态查询、回测或纸面交易时
  • 用户能在每次启动策略前审阅参数并明确批准时
  • 真实交易功能尚未通过独立安全审查时

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

仅查询模拟账户状态,不要启动策略
使用纸面模式回测指定策略,并说明结果不保证未来表现
列出启用实时交易前需要修复和核实的安全闸门

月度数据趋势

累计下载3,135
1,9522,5883,2232026-03 · 累计下载 2,0402026-05 · 累计下载 2,6842026-07 · 累计下载 2,9352026-08 · 累计下载 3,0422026-09 · 累计下载 3,13526-0326-09
星标10
79102026-03 · 星标 72026-05 · 星标 102026-07 · 星标 102026-08 · 星标 102026-09 · 星标 1026-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-093,135—10
2026-083,042+3.6%10
2026-072,935—10
2026-052,684—10
2026-032,040—7

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

9.5 KB · ClawHub v1.0.0
---
name: crypto-trader
description: |
  Automated cryptocurrency trading skill for OpenClaw. Supports 8 trading strategies
  (Grid Trading, DCA, Trend Following, Scalping, Arbitrage, Swing Trading, Copy Trading,
  Portfolio Rebalancing), multi-exchange connectivity (Binance, Bybit, Kraken, Coinbase),
  AI-driven sentiment analysis, comprehensive risk management, backtesting, paper trading,
  and real-time monitoring with Telegram/Discord/Email alerts.
  Use when the user asks about crypto trading, portfolio management, market analysis,
  starting/stopping strategies, checking balances, or running backtests.
展开全部(共 252 行)
metadata:
  openclaw:
    requires:
      bins: ["python3"]
      env: ["BINANCE_API_KEY", "BINANCE_API_SECRET"]
    primaryEnv: "BINANCE_API_KEY"
---

# Crypto Trader Skill

Automated cryptocurrency trading with 8 strategies, multi-exchange support, AI sentiment analysis, and comprehensive risk management.

**Important**: By default all operations run against **testnet** (paper trading). Set `CRYPTO_DEMO=false` only when you are absolutely certain the user wants to trade with real money.

## Prerequisites

Install dependencies once from the skill directory:

```bash
pip install -r {baseDir}/requirements.txt
```

Required environment variables (set in `.env` or via OpenClaw settings):

- `BINANCE_API_KEY` and `BINANCE_API_SECRET` (required for Binance)
- `CRYPTO_DEMO=true` (default: paper trading mode)

Optional:
- `BYBIT_API_KEY`, `BYBIT_API_SECRET` (for Bybit)
- `KRAKEN_API_KEY`, `KRAKEN_API_SECRET` (for Kraken)
- `COINBASE_API_KEY`, `COINBASE_API_SECRET` (for Coinbase)
- `TELEGRAM_BOT_TOKEN`, `TELEGRAM_CHAT_ID` (for Telegram alerts)
- `DISCORD_WEBHOOK_URL` (for Discord alerts)
- `CRYPTOPANIC_API_KEY` (for sentiment analysis)

## Available Modes

### 1. status -- Portfolio and strategy overview

```bash
python3 {baseDir}/scripts/main.py --mode status
```

Returns JSON with:
- Portfolio value per exchange
- Active strategies and their state
- Risk status (daily P&L, drawdown, kill switch)
- Environment (paper/live)

Use when the user asks: "How is my portfolio?", "What's running?", "Give me an overview."

### 2. balance -- Check exchange balances

```bash
python3 {baseDir}/scripts/main.py --mode balance
python3 {baseDir}/scripts/main.py --mode balance --exchange binance
```

Returns balances for the specified exchange (or all exchanges). Shows total, free, and used amounts per asset.

Use when the user asks: "How much BTC do I have?", "What's my balance?", "Show my funds."

### 3. start_strategy -- Start a trading strategy

```bash
python3 {baseDir}/scripts/main.py --mode start_strategy --strategy grid --params '{"symbol":"BTC/USDT","price_range":[90000,110000],"num_grids":10,"order_amount_usdt":10}'
python3 {baseDir}/scripts/main.py --mode start_strategy --strategy dca --params '{"symbol":"ETH/USDT","interval":"daily","amount_per_buy_usdt":5}'
python3 {baseDir}/scripts/main.py --mode start_strategy --strategy trend --params '{"symbol":"BTC/USDT","timeframe":"4h"}'
```

Supported strategies:

| Strategy | Name | Description |
|----------|------|-------------|
| Grid Trading | `grid_trading` | Buy/sell at evenly spaced price levels within a range |
| DCA | `dca` | Buy fixed amounts at regular intervals |
| Trend Following | `trend_following` | EMA crossover + RSI signals |
| Scalping | `scalping` | Fast small trades on spread/momentum |
| Arbitrage | `arbitrage` | Cross-exchange price difference exploitation |
| Swing Trading | `swing_trading` | Bollinger Bands + MACD, hold 2-14 days |
| Copy Trading | `copy_trading` | Replicate trades from tracked wallets/traders |
| Rebalancing | `rebalancing` | Maintain target portfolio allocation |

Each strategy uses defaults from `config/strategies.yaml` which can be overridden via `--params`.

**CRITICAL**: Always confirm with the user before starting a strategy. Show the parameters clearly and ask for approval.

Use when the user asks: "Start grid trading on BTC", "I want to DCA into ETH", "Follow the trend on SOL."

### 4. stop_strategy -- Stop a running strategy

```bash
python3 {baseDir}/scripts/main.py --mode stop_strategy --strategy-id <id>
```

Stops a specific strategy instance. The strategy ID is returned when starting and shown in the list.

### 5. list_strategies -- List all strategies

```bash
python3 {baseDir}/scripts/main.py --mode list_strategies
```

Returns all available and running strategies with their status, parameters, and performance stats.

### 6. backtest -- Test a strategy on historical data

```bash
python3 {baseDir}/scripts/main.py --mode backtest --strategy grid_trading --params '{"symbol":"BTC/USDT","price_range":[40000,50000],"num_grids":10}' --start 2025-01-01 --end 2025-12-31
python3 {baseDir}/scripts/main.py --mode backtest --strategy dca --params '{"symbol":"BTC/USDT","interval":"daily","amount_per_buy_usdt":10}' --start 2025-06-01 --end 2025-12-31
python3 {baseDir}/scripts/main.py --mode backtest --strategy trend_following --params '{"symbol":"BTC/USDT","timeframe":"4h"}' --start 2025-01-01 --end 2025-12-31
```

Returns performance metrics:
- Total return % vs buy-and-hold
- Win rate, trade count
- Max drawdown, Sharpe ratio
- Fee impact
- Individual order history

Results are saved to `data/backtests/`.

Use when the user asks: "Would grid trading have worked?", "Backtest DCA on ETH", "Test this strategy."

### 7. history -- Trade history

```bash
python3 {baseDir}/scripts/main.py --mode history --days 7
python3 {baseDir}/scripts/main.py --mode history --days 30
```

Returns completed orders from all exchanges for the last N days.

### 8. sentiment -- Market sentiment analysis

```bash
python3 {baseDir}/scripts/main.py --mode sentiment --symbol BTC
python3 {baseDir}/scripts/main.py --mode sentiment --symbol ETH
```

Analyzes sentiment from:
- Crypto news RSS feeds (CoinTelegraph, CoinDesk)
- CryptoPanic (requires API key)
- Reddit (r/cryptocurrency, r/bitcoin)
- Twitter (requires bearer token)

Returns aggregate score (-1.0 to 1.0) with labels: very_bearish, bearish, neutral, bullish, very_bullish.

Use when the user asks: "What's the market sentiment?", "Is BTC bullish right now?", "Any news about ETH?"

### 9. monitor -- Real-time monitoring daemon

```bash
python3 {baseDir}/scripts/main.py --mode monitor --action start
python3 {baseDir}/scripts/main.py --mode monitor --action status
python3 {baseDir}/scripts/main.py --mode monitor --action stop
```

The monitoring daemon runs in the background and:
- Checks open orders every 10 seconds
- Updates portfolio snapshot every 60 seconds
- Checks risk limits every 60 seconds
- Evaluates strategy signals every 5 minutes
- Runs sentiment analysis every 30 minutes
- Sends alerts via Telegram/Discord/Email

### 10. emergency_stop -- Kill switch

```bash
python3 {baseDir}/scripts/main.py --mode emergency_stop
```

Immediately:
1. Cancels ALL open orders on ALL exchanges
2. Stops ALL running strategies
3. Activates the kill switch (blocks all future trades)

The kill switch must be manually deactivated before trading can resume.

Use when the user says: "Stop everything!", "Emergency!", "Kill all trades."

## Configuration Files

### config/exchanges.yaml
Exchange connectivity settings, sandbox mode, rate limits.

### config/strategies.yaml
Default parameters for each strategy. Users can override via `--params`.

### config/risk_limits.yaml
Risk management rules:
- `max_position_size_pct`: Max portfolio % per position (default: 25%)
- `max_daily_loss_eur`: Emergency stop on daily loss (default: 50 EUR)
- `max_drawdown_pct`: Stop at drawdown from ATH (default: 15%)
- `max_order_size_eur`: Max per order (default: 100 EUR)
- `max_open_orders`: Max concurrent orders (default: 50)
- Stop-loss (fixed 5%, trailing 3%)
- Take-profit (10%, partial at 5%)

### config/notifications.yaml
Alert routing rules per event type and channel.

## Safety Rules

1. **NEVER** execute trades without explicit user confirmation in live mode.
2. Default mode is **paper trading** (`CRYPTO_DEMO=true`). Remind the user which mode is active.
3. API keys must have **TRADE** permissions only. **NEVER** withdrawal permissions.
4. Risk limits are enforced automatically. If a limit is hit, explain to the user what happened.
5. Emergency stop is always available and overrides everything.
6. Always show estimated cost and risk before confirming a trade.
7. If `CRYPTO_DEMO=false`, warn the user clearly that this uses **real money**.
8. Log all actions. The user can review history at any time.
9. When starting a strategy, show the full parameter set and ask for confirmation.
10. Never bypass risk limits, even if the user asks. Explain why the limit exists.

## Output Format

All modes return structured JSON to stdout. Parse it and present a human-readable summary to the user. Highlight important numbers (P&L, prices, risk metrics). Use clear formatting with tables where appropriate.

## Running Tests

```bash
cd {baseDir}
pip install pytest
python -m pytest tests/ -v
```

## Troubleshooting

### "Exchange not initialized"
Check that the API key and secret are set in environment variables for the target exchange.

### "Authentication failed"
Verify your API keys are correct and not expired. For testnet, make sure you're using testnet keys.

### "Rate limit reached"
The skill automatically retries with backoff. If persistent, reduce strategy evaluation frequency.

### "Kill switch is active"
The emergency stop was triggered. Review what happened, then deactivate:
The kill switch state is stored in `~/.openclaw/.crypto-trader-risk-state.json`. Set `"killed": false` to reset, or use a future CLI command to deactivate.

「专业领域」分类下的热门技能

数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。