home / skills / openclaw / skills / clap-trader

clap-trader skill

/skills/dymx101/clap-trader

This skill analyzes technical indicators and sentiment to guide ETH trading decisions on Binance, and logs findings for continuous improvement.

npx playbooks add skill openclaw/skills --skill clap-trader

Review the files below or copy the command above to add this skill to your agents.

Files (7)
SKILL.md
2.5 KB
---
name: Crypto Trader & Analyst
description: A skill for OpenClaw to research crypto market trends (technical & sentiment) and trade ETH on Binance.
---

# Crypto Trader & Analyst Skill

This skill allows OpenClaw to analyze the crypto market using technical indicators and news sentiment, record its findings, and execute trades on Binance.

## Dependencies

Ensure the following Python packages are installed:
```bash
pip install ccxt pandas pandas-ta requests TextBlob
```
*Note: `TextBlob` is suggested for basic sentiment analysis if needed, though simple keyword matching might suffice.*

## Environment Variables

You must set the following environment variables for trading:
- `BINANCE_API_KEY`: Your Binance API Key.
- `BINANCE_API_SECRET`: Your Binance API Secret.

**WARNING**: Never share these keys or commit them to version control.

## Workflow

### 1. Market Analysis

**Technical Analysis**
Run the market data script to get current indicators for a symbol (default ETH/USDT).
```bash
python skills/crypto_trader/scripts/market_data.py --symbol ETH/USDT
```
*Output: JSON containing RSI, MACD, close price, etc.*

**Sentiment Analysis**
Run the sentiment script to fetch latest news headers and forum buzz.
```bash
python skills/crypto_trader/scripts/sentiment_data.py
```
*Output: Text/JSON summary of positive/negative news.*

### 2. Decision Making & Logging

**Analyze & Record**
Based on the outputs from step 1, form a hypothesis. Is the market Bullish, Bearish, or Neutral?
Before trading, you **MUST** save your analysis.
```bash
python skills/crypto_trader/scripts/logger.py "Your detailed analysis here. E.g., RSI is 30 (oversold) and news is positive. Planning to BUY."
```

### 3. Execution

**Trade**
If the analysis supports a trade, execute it.
```bash
# Buy 0.01 ETH at Market Price
python skills/crypto_trader/scripts/trade.py --symbol ETH/USDT --side buy --amount 0.01 --type market

# Dry Run (Test without real money)
python skills/crypto_trader/scripts/trade.py --symbol ETH/USDT --side buy --amount 0.01 --dry-run
```
*The trade script will automatically append the transaction to `skills/crypto_trader/logs/trade_history.csv`.*

## Files structure
- `scripts/market_data.py`: Fetches OHLCV and calculates indicators.
- `scripts/sentiment_data.py`: Fetches news/forum data.
- `scripts/logger.py`: Appends analysis to `logs/analysis_journal.md`.
- `scripts/trade.py`: Executes trades and logs to `logs/trade_history.csv`.
- `logs/`: Directory storing your analysis history and trade logs.

Overview

This skill lets OpenClaw research crypto market trends and trade ETH on Binance using technical indicators and news sentiment. It combines OHLCV-driven indicators (RSI, MACD, etc.) with sentiment summaries, records analyses, and can place live or dry-run orders. Built for programmatic analysis, logging, and repeatable execution workflows.

How this skill works

The skill fetches market OHLCV data and computes indicators via pandas and pandas-ta, then pulls headlines and forum signals for a sentiment summary. You save a written analysis to the local journal before any trade. The trade script can place market orders on Binance (with API keys) or perform a dry-run and logs every execution to a CSV.

When to use it

  • When you need a repeatable technical + sentiment check before trading ETH/USDT.
  • Before placing live trades to ensure an analysis record exists.
  • During market monitoring to detect oversold/overbought conditions or momentum shifts.
  • When validating a trading hypothesis with historical indicator signals and news context.
  • For automated trade simulations using dry-run mode.

Best practices

  • Always set BINANCE_API_KEY and BINANCE_API_SECRET via environment variables; never hard-code or commit them.
  • Run market_data and sentiment_data together to combine technical context with news-driven risks.
  • Always run the logger script to save your analysis prior to executing a trade for auditability.
  • Use dry-run mode when testing new parameter sets or before enabling live execution in a new environment.
  • Limit trade sizes and test on small amounts first to confirm expected behavior and logging.

Example use cases

  • Perform a morning scan: compute RSI and MACD for ETH/USDT, review sentiment, log the analysis, then decide to wait or trade.
  • Respond to a sudden news item: run sentiment_data, check indicators for trend confirmation, log the decision, and execute a protective trade if warranted.
  • Backtest a simple rule: reproduce indicator signals historically, run the logger for each hypothesis, and use dry-run trades to validate execution logic.
  • Automate a monitoring loop that runs market and sentiment checks hourly and notifies you before any manual trade.
  • Maintain a trade journal: every analysis and executed order is appended to local logs for compliance and review.

FAQ

Do I need paid APIs to use the sentiment module?

No. The skill can use simple headline scraping or basic keyword matching; TextBlob is suggested for local sentiment analysis, but you can integrate paid NLP APIs if desired.

Can I run trades without exposing my API keys in code?

Yes. Provide BINANCE_API_KEY and BINANCE_API_SECRET as environment variables. Never store keys in source files or version control.