AI-powered trading framework for OpenClaw. Connect to exchanges, manage risk, execute strategies.
# 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
This skill includes multiple safety layers:
The agent never trades without explicit user approval for live mode.
status — Exchange Connectivity CheckTests API connections without trading:
paper — Paper Trading (Simulated)Runs strategy with fake money to test before going live:
--strategy, --pair, --duration, --capitaltrade — Live TradingExecutes strategy with real funds:
--live flag (double confirmation)--strategy, --pair, --amount, --liverisk — Risk DashboardReal-time risk overview:
kill — Emergency Kill SwitchImmediately closes all open positions:
--force flagbacktest — Strategy BacktestingTest a strategy against historical data:
--strategy, --pair, --start, --end| Strategy | Description | Risk Level |
|---|---|---|
| ---------- | ------------- | ------------ |
dca | Dollar-Cost Average — buy fixed amount at intervals | Low |
grid | Grid trading — buy low, sell high in a price range | Medium |
momentum | Trend following with moving average crossovers | Medium |
funding | Funding rate arbitrage (perpetual futures) | Medium |
mean-revert | Buy oversold, sell overbought (RSI-based) | High |
See references/strategies.md for detailed strategy documentation.
Create a strategy file at strategies/:
{
"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 }
}
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 个版本