← 返回
未分类 Key 中文

Agent Trading Bot

AI-powered trading bot framework for OpenClaw. Connects to crypto exchanges (Binance, Hyperliquid, Bluefin) and prediction markets (Polymarket, Kalshi) via A...
AI驱动的交易机器人框架OpenClaw,连接加密货币交易所(Binance、Hyperliquid、Bluefin)和预测市场(Polymarket、Kalshi),通过API实现对接。
stevojarvisai-star stevojarvisai-star 来源
未分类 clawhub v1.0.0 1 版本 99795.5 Key: 需要
★ 0
Stars
📥 488
下载
💾 0
安装
1
版本
#latest

概述

Agent Trading Bot

AI-powered trading framework for OpenClaw. Connect to exchanges, manage risk, execute strategies.

Quick Start

# Check exchange connectivity (no trades)
python3 scripts/agent-trading-bot.py status

# Paper trade (simulated) with a strategy
python3 scripts/agent-trading-bot.py paper --strategy dca --pair BTC/USDT

# Live trade (requires API keys configured)
python3 scripts/agent-trading-bot.py trade --strategy dca --pair BTC/USDT --amount 100

# Risk dashboard — current positions, exposure, P&L
python3 scripts/agent-trading-bot.py risk

# Kill switch — close all positions immediately
python3 scripts/agent-trading-bot.py kill

⚠️ Safety First

This skill includes multiple safety layers:

  1. Paper trading mode by default — no real money until explicitly enabled
  2. Maximum position size limits (configurable)
  3. Stop-loss on every position (default: 5%)
  4. Maximum drawdown circuit breaker (default: 10% of portfolio)
  5. Kill switch to close all positions instantly
  6. API keys never stored in skill files — environment variables only

The agent never trades without explicit user approval for live mode.

Commands

status — Exchange Connectivity Check

Tests API connections without trading:

  • Verifies API key validity
  • Checks account balances
  • Reports exchange status (maintenance, rate limits)
  • Shows available trading pairs

paper — Paper Trading (Simulated)

Runs strategy with fake money to test before going live:

  • Simulates order execution at market prices
  • Tracks P&L, win rate, Sharpe ratio
  • Logs every trade decision with reasoning
  • Options: --strategy, --pair, --duration, --capital

trade — Live Trading

Executes strategy with real funds:

  • Requires explicit --live flag (double confirmation)
  • All safety limits enforced
  • Every trade logged with timestamp, reasoning, and fills
  • Options: --strategy, --pair, --amount, --live

risk — Risk Dashboard

Real-time risk overview:

  • Open positions with unrealized P&L
  • Portfolio exposure by asset
  • Current drawdown vs maximum allowed
  • Margin utilization (for futures)
  • Daily/weekly/monthly P&L

kill — Emergency Kill Switch

Immediately closes all open positions:

  • Market sells all spot positions
  • Closes all futures positions
  • Cancels all pending orders
  • Logs everything
  • Requires confirmation unless --force flag

backtest — Strategy Backtesting

Test a strategy against historical data:

  • Options: --strategy, --pair, --start, --end
  • Reports: total return, max drawdown, Sharpe ratio, win rate

Strategies

Built-in Strategies

StrategyDescriptionRisk Level
-----------------------------------
dcaDollar-Cost Average — buy fixed amount at intervalsLow
gridGrid trading — buy low, sell high in a price rangeMedium
momentumTrend following with moving average crossoversMedium
fundingFunding rate arbitrage (perpetual futures)Medium
mean-revertBuy oversold, sell overbought (RSI-based)High

See references/strategies.md for detailed strategy documentation.

Custom Strategies

Create a strategy file at strategies/.json:

{
  "name": "my-strategy",
  "entry": { "indicator": "rsi", "condition": "below", "value": 30 },
  "exit": { "indicator": "rsi", "condition": "above", "value": 70 },
  "risk": { "stop_loss_pct": 3, "take_profit_pct": 9, "max_position_pct": 5 }
}

Configuration

Set exchange API keys via environment variables:

export BINANCE_API_KEY="your-key"
export BINANCE_API_SECRET="your-secret"
export HYPERLIQUID_API_KEY="your-key"
export HYPERLIQUID_API_SECRET="your-secret"

Risk limits in ~/.openclaw/trading-config.json:

{
  "max_position_pct": 10,
  "max_drawdown_pct": 10,
  "default_stop_loss_pct": 5,
  "max_daily_trades": 20,
  "allowed_pairs": ["BTC/USDT", "ETH/USDT", "SOL/USDT"]
}

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-03 08:38 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Self-Healing Agent

stevojarvisai-star
OpenClaw代理的自恢复与自动修复系统。监控代理健康,检测故障(崩溃的定时任务、损坏的技能、配置损坏、内存问题等)。
★ 0 📥 716

Phoenix Scraper

stevojarvisai-star
弹性的多层网页抓取工具,具备自动故障转移功能。适用于抓取可能由JavaScript渲染、受机器人防护或被防爬阻止的网页内容。
★ 0 📥 394

Memory Onboarding Wizard

stevojarvisai-star
一条命令启动新的OpenClaw代理记忆系统,通过3个快速问题设置MEMORY.md、日常记忆文件、HEARTBEAT.md和USER.md。
★ 0 📥 426