/install bybit-futures
Bybit Futures Trading System
Complete trading infrastructure for Bybit USDT perpetual futures contracts.
Quick Start
- Install dependencies:
pip install ccxt websockets numpy requests - Copy
scripts/config_template.py→config.py, fill in API keys - Run paper trading:
python scripts/paper_trading_ws.py - When validated, switch to live:
python scripts/live_trading.py
Architecture
config.py ← API keys + risk parameters
risk_manager.py ← Position sizing, daily loss limits, max positions
paper_trading_ws.py ← WebSocket real-time paper trading
live_trading.py ← Live execution (same logic, real orders)
backtest.py ← Historical backtesting engine
Risk Management
All trades enforced by risk_manager.py:
- Max position: configurable % of capital per trade (default 20%)
- Max leverage: configurable (default 5x)
- Stop loss: automatic per-trade (default 3%)
- Take profit: automatic per-trade (default 6%, 2:1 R/R)
- Daily loss limit: halt trading after X% daily drawdown (default 10%)
- Max concurrent positions: configurable (default 3)
Included Strategies
EMA Crossover (ETH)
- EMA(12) crosses above EMA(26) → long
- EMA(12) crosses below EMA(26) → short
- Best on: ETH/USDT 1h timeframe
RSI Mean Reversion (SOL, HYPE, PEPE)
- RSI(14) crosses up from below 30 → long
- RSI(14) crosses down from above 70 → short
- Best on: SOL, HYPE (73% WR), 1000PEPE (53% WR) 1h timeframe
- Backtested: HYPE +$339, PEPE +$210 on 90-day 1h data
Custom Strategy Template
See references/custom_strategy.md for adding your own signals.
WebSocket Real-Time Engine
The paper/live trading engine uses Bybit's WebSocket v5 API:
- Ticker subscription: millisecond-level price updates for SL/TP
- Kline subscription: signal calculation on candle close only
- Auto-reconnect: 5s retry on disconnect
- State persistence: saves every 5 minutes to JSON
Deployment
Recommended: systemd service on a VPS.
# Create service file
sudo tee /etc/systemd/system/paper-trading.service \x3C\x3C 'EOF'
[Unit]
Description=Paper Trading Bot (WebSocket)
After=network.target
[Service]
Type=simple
WorkingDirectory=/root/trading
ExecStart=/usr/bin/python3 paper_trading_ws.py
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl enable --now paper-trading
Telegram Notifications
Built-in Telegram push for all events:
- Position opened/closed
- Stop loss / take profit hit
- 6-hourly summary reports
- Error alerts
Set TG_BOT_TOKEN and TG_CHAT_ID in config.
Files
scripts/config_template.py— Configuration templatescripts/risk_manager.py— Risk management enginescripts/paper_trading_ws.py— WebSocket paper trading botscripts/live_trading.py— Live trading botscripts/backtest.py— Backtesting enginereferences/custom_strategy.md— Guide for adding custom strategiesreferences/bybit_api_notes.md— Bybit API gotchas and tips
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install bybit-futures - After installation, invoke the skill by name or use
/bybit-futures - Provide required inputs per the skill's parameter spec and get structured output
What is Bybit Futures?
Complete Bybit USDT perpetual futures trading system with risk management, paper trading, and live execution. Use when building a crypto futures trading bot,... It is an AI Agent Skill for Claude Code / OpenClaw, with 1237 downloads so far.
How do I install Bybit Futures?
Run "/install bybit-futures" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Bybit Futures free?
Yes, Bybit Futures is completely free (open-source). You can download, install and use it at no cost.
Which platforms does Bybit Futures support?
Bybit Futures is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Bybit Futures?
It is built and maintained by SunnyZhou (@sunnyztj); the current version is v1.1.0.