← 返回 Skills 市场
nandichi

crypto-trader

作者 Naoufal Andichi · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
2169
总下载
8
收藏
16
当前安装
1
版本数
在 OpenClaw 中安装
/install crypto-trader
功能描述
Automated cryptocurrency trading skill for OpenClaw. Supports 8 trading strategies (Grid Trading, DCA, Trend Following, Scalping, Arbitrage, Swing Trading, C...
使用说明 (SKILL.md)

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:

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

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

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

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

python3 {baseDir}/scripts/main.py --mode stop_strategy --strategy-id \x3Cid>

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

5. list_strategies -- List all strategies

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

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

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

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

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

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

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.

安全使用建议
This package appears to be a genuine automated trading tool, but take precautions before enabling it: - Start in paper/testnet mode (CRYPTO_DEMO=true) — do not set CRYPTO_DEMO=false until you've fully tested behavior. - Use API keys with minimal permissions: create sandbox/testnet API keys and disable withdrawals on any real exchange keys. Prefer keys limited to trading and reading balances. - The skill references additional tokens (Telegram, Discord, CryptoPanic, Twitter, other exchanges) but only Binance creds are declared as required; review and decide which optional tokens you will provide. - The SKILL.md asks you to pip install many packages (including torch/transformers). Install in an isolated virtualenv or container to avoid polluting your system Python. - The monitor daemon persists state and writes PID files under your home directory (~/.openclaw). Inspect those files and the code (monitor_daemon.py, notifier, exchange_manager) before running to confirm where data is stored and where notifications are sent. - Review source files (especially exchange_manager, notifier, and scripts/main.py) to verify there are no unexpected network endpoints or hardcoded URLs. If you cannot audit, run the skill in an isolated sandbox VM or container with limited network access first. - Consider running unit tests and backtests (these are included) and exercising the code with mock exchange objects before attaching real API keys. - If you allow autonomous/crontab invocation, be explicit about what triggers live trading (e.g., ensure confirmations are enforced and that the agent will not start live strategies without explicit user approval). If you want, I can: list exact lines where optional env vars are read, summarize notifier/exchange_manager behavior, or point out files to review first (exchange_manager.py, notifier.py, scripts/main.py, monitor_daemon.py).
功能分析
Type: OpenClaw Skill Name: crypto-trader Version: 1.0.0 The OpenClaw Crypto Trader skill is designed for automated cryptocurrency trading, portfolio management, and market analysis. It exhibits strong safety features, including explicit instructions in `SKILL.md` for the AI agent to default to paper trading, require user confirmation for live trades, and enforce strict risk limits. While it utilizes high-risk capabilities such as real-money trading, background persistence (via `monitor_daemon.py` in `~/.openclaw/`), and extensive network access to exchanges and notification services, these are all clearly aligned with its stated purpose and are handled with robust error management and configuration. There is no evidence of intentional harmful behavior, data exfiltration to unauthorized endpoints, or stealthy persistence. The potential for prompt injection via the `--params` argument is a vulnerability in the agent's input construction, not a malicious instruction within the skill itself, and is mitigated by the skill's explicit safety rules for the agent.
能力标签
cryptocan-make-purchases
能力评估
Purpose & Capability
Name, description, and included code (strategy modules, exchange manager, backtester, monitor daemon, notifier) are consistent with an automated crypto trading skill. Required binary (python3) and the declared primary credential (BINANCE_API_KEY / BINANCE_API_SECRET) are appropriate for Binance connectivity. Multi-exchange support and sentiment analysis in the code align with the description.
Instruction Scope
SKILL.md instructs the agent to run many Python scripts that can check balances, start/stop strategies, and place orders. It also references many optional environment variables (Bybit/Kraken/Coinbase keys, TELEGRAM_BOT_TOKEN, DISCORD_WEBHOOK_URL, Twitter bearer token, CryptoPanic key, CRYPTO_DEMO) that are not listed as required in the registry metadata. The skill will send data to external endpoints (Telegram/Discord/Email) and persist state to files under the user's home (~/ .openclaw). Those actions are coherent with a trading tool, but the mismatch between declared vs referenced env vars means the agent may access credentials beyond what was advertised.
Install Mechanism
There is no formal install spec in the registry; SKILL.md tells the user to run `pip install -r {baseDir}/requirements.txt`. Requirements include heavy ML and networking packages (torch, transformers, tweepy, praw, python-telegram-bot, discord.py, aiohttp, websockets). Installing via pip from PyPI is common but can be large, may require system-specific build steps, and can alter the environment; the recipe is traceable but non-trivial.
Credentials
Registry metadata requires only BINANCE_API_KEY and BINANCE_API_SECRET (primaryEnv set). SKILL.md, config files, and code reference many additional environment variables (other exchanges' API keys, CRYPTO_DEMO, TELEGRAM_BOT_TOKEN, TELEGRAM_CHAT_ID, DISCORD_WEBHOOK_URL, CRYPTOPANIC_API_KEY, Twitter bearer token, email SMTP settings, etc.). Those optional credentials are plausible for the stated features, but they are not declared up front — the mismatch should be noted because the skill may use or request sensitive tokens beyond the two required vars.
Persistence & Privilege
always:false (good). The skill includes a monitor daemon that writes PID/state files under the user's home (~/.openclaw/.crypto-trader-monitor.json and .pid). The daemon can start/stop processes via os.kill (to manage its own PID file) and is designed to be run in background or via cron. Autonomous invocation is possible (default) and the SKILL.md even recommends cron entries; this increases blast radius if misconfigured but is consistent with a trading agent.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install crypto-trader
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /crypto-trader 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of crypto-trader skill – a comprehensive automated trading suite for cryptocurrencies. - Supports 8 trading strategies (Grid, DCA, Trend Following, Scalping, Arbitrage, Swing, Copy Trading, Rebalancing) - Connects to multiple exchanges: Binance, Bybit, Kraken, and Coinbase - Includes AI-driven sentiment analysis and comprehensive risk management - Features backtesting, paper trading (testnet by default), and real-time monitoring with alerts via Telegram, Discord, and Email - Offers easy-to-use commands for strategy management, portfolio tracking, backtesting, and emergency stop - Extensive configuration options for exchanges, strategies, risk limits, and notifications
元数据
Slug crypto-trader
版本 1.0.0
许可证
累计安装 16
当前安装数 16
历史版本数 1
常见问题

crypto-trader 是什么?

Automated cryptocurrency trading skill for OpenClaw. Supports 8 trading strategies (Grid Trading, DCA, Trend Following, Scalping, Arbitrage, Swing Trading, C... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 2169 次。

如何安装 crypto-trader?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install crypto-trader」即可一键安装,无需额外配置。

crypto-trader 是免费的吗?

是的,crypto-trader 完全免费(开源免费),可自由下载、安装和使用。

crypto-trader 支持哪些平台?

crypto-trader 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 crypto-trader?

由 Naoufal Andichi(@nandichi)开发并维护,当前版本 v1.0.0。

💬 留言讨论