Loading...
Loading...
Professional automated trading bot for Binance, Bybit, and OKX Futures with multi-strategy engine, Telegram/TradingView signal integration, and real-time P&L dashboard.
npx skill4agent add aradotso/trending-skills binance-futures-signal-botSkill by ara.so — Daily 2026 Skills collection.
git clone https://github.com/Whit1985/Binance-Futures-Signal-Bot.git
cd Binance-Futures-Signal-Bot
pip install -r requirements.txtpython main.py # choose option 1 → Install Dependencies| Package | Purpose |
|---|---|
| Terminal UI / dashboards |
| Binance REST & WebSocket |
| Unified multi-exchange interface |
| OHLCV data & indicators |
| Technical analysis (RSI, MACD, BB, EMA) |
| Real-time market streams |
| Secure key storage |
python main.py1 → Install Dependencies
2 → Settings (API keys, exchange, leverage)
3 → About
4 → Connect Signal Source (Telegram / TradingView / API)
5 → Start Auto Trading
6 → Strategy Configuration
7 → Position Manager (view & close positions)
8 → P&L Dashboard
0 → Exitrun.batchmod +x run.sh && ./run.sh{
"exchange": "binance",
"api_key": "",
"api_secret": "",
"testnet": false,
"leverage": 10,
"max_position_pct": 5.0,
"trailing_stop_pct": 1.5,
"signal_source": "telegram",
"telegram_bot_token": "",
"telegram_channel_id": "-100XXXXXXXXXX",
"tradingview_webhook_port": 8080,
"strategies": {
"ema_crossover": {"enabled": true, "fast": 9, "slow": 21},
"rsi_divergence": {"enabled": true, "period": 14, "overbought": 70, "oversold": 30},
"bollinger_breakout":{"enabled": false, "period": 20, "std_dev": 2.0},
"macd_momentum": {"enabled": true, "fast": 12, "slow": 26, "signal": 9}
},
"pairs": ["BTCUSDT", "ETHUSDT", "SOLUSDT"],
"risk_management": {
"max_open_positions": 5,
"max_daily_loss_pct": 3.0,
"stop_loss_pct": 2.0,
"take_profit_pct": 4.0
}
}export BINANCE_API_KEY="your_api_key_here"
export BINANCE_API_SECRET="your_api_secret_here"
export BYBIT_API_KEY="your_bybit_key"
export BYBIT_API_SECRET="your_bybit_secret"
export OKX_API_KEY="your_okx_key"
export OKX_API_SECRET="your_okx_secret"
export OKX_PASSPHRASE="your_okx_passphrase"
export TELEGRAM_BOT_TOKEN="your_telegram_bot_token"config.json.gitignore# config.py usage pattern
import os
import json
config = {
"exchange": "binance",
"api_key": os.environ.get("BINANCE_API_KEY"),
"api_secret": os.environ.get("BINANCE_API_SECRET"),
"testnet": True, # always test first
"leverage": 5,
"pairs": ["BTCUSDT", "ETHUSDT"]
}
with open("config.json", "w") as f:
json.dump(config, f, indent=2){
"exchange": "bybit",
"api_key": "",
"api_secret": "",
"leverage": 5,
"pairs": ["BTCUSDT", "ETHUSDT"]
}{
"exchange": "okx",
"api_key": "",
"api_secret": "",
"okx_passphrase": "",
"leverage": 5,
"pairs": ["BTC-USDT-SWAP", "ETH-USDT-SWAP"]
}# Setup steps:
# 1. Create bot at https://t.me/BotFather → get token
# 2. Add bot to signal channel as admin
# 3. Get channel ID (negative number starting with -100)
config_snippet = {
"signal_source": "telegram",
"telegram_bot_token": os.environ.get("TELEGRAM_BOT_TOKEN"),
"telegram_channel_id": "-1001234567890"
}{
"signal_source": "tradingview",
"tradingview_webhook_port": 8080
}{
"symbol": "BTCUSDT",
"side": "BUY",
"leverage": 10,
"price": "{{close}}",
"strategy": "ema_crossover"
}http://YOUR_SERVER_IP:8080/webhook{
"signal_source": "api",
"custom_api_url": "https://your-signal-provider.com/signals",
"custom_api_key": ""
}{
"ema_crossover": {
"enabled": true,
"fast": 9,
"slow": 21
}
}{
"rsi_divergence": {
"enabled": true,
"period": 14,
"overbought": 70,
"oversold": 30
}
}{
"bollinger_breakout": {
"enabled": true,
"period": 20,
"std_dev": 2.0
}
}{
"macd_momentum": {
"enabled": true,
"fast": 12,
"slow": 26,
"signal": 9
}
}{
"strategies": {
"ema_crossover": {"enabled": true, "fast": 9, "slow": 21},
"rsi_divergence": {"enabled": true, "period": 14},
"bollinger_breakout": {"enabled": false},
"macd_momentum": {"enabled": true}
}
}{
"leverage": 10,
"max_position_pct": 5.0,
"trailing_stop_pct": 1.5,
"risk_management": {
"max_open_positions": 5,
"max_daily_loss_pct": 3.0,
"stop_loss_pct": 2.0,
"take_profit_pct": 4.0
}
}| Parameter | Description |
|---|---|
| 1x–125x (start with 2–5x) |
| % of account balance per trade |
| Trailing SL activates after price moves this % in profit |
| Hard cap on concurrent open trades |
| Bot halts trading if daily loss exceeds this |
| Fixed stop-loss distance from entry |
| Fixed take-profit distance from entry |
trailing_stop_pct{
"testnet": true,
"exchange": "binance"
}Binance-Futures-Signal-Bot/
├── main.py # Entry point — interactive menu
├── bot_actions.py # Core trading action handlers
├── config.py # Configuration loader (JSON + env vars)
├── requirements.txt
├── run.bat / run.sh # Platform launchers
├── actions/
│ ├── about.py # Feature display
│ ├── install.py # Dependency installer
│ └── settings.py # Configuration UI
├── utils/
│ ├── __init__.py # Environment bootstrap
│ ├── compat.py # Platform compatibility
│ ├── ui.py # Rich terminal interface
│ ├── http.py # HTTP client
│ ├── integrity.py # Data integrity checks
│ └── bootstrap.py # Runtime initialization
└── release/
└── README.md # Pre-compiled binary infoimport json
import os
def load_config(path="config.json"):
with open(path) as f:
cfg = json.load(f)
# Override with env vars if set
cfg["api_key"] = os.environ.get("BINANCE_API_KEY", cfg.get("api_key", ""))
cfg["api_secret"] = os.environ.get("BINANCE_API_SECRET", cfg.get("api_secret", ""))
return cfg
config = load_config()import json
safe_config = {
"exchange": "binance",
"api_key": "", # set via env var BINANCE_API_KEY
"api_secret": "", # set via env var BINANCE_API_SECRET
"testnet": True,
"leverage": 2,
"max_position_pct": 1.0,
"signal_source": "telegram",
"telegram_bot_token": "", # set via env var TELEGRAM_BOT_TOKEN
"telegram_channel_id": "",
"strategies": {
"ema_crossover": {"enabled": True, "fast": 9, "slow": 21},
"rsi_divergence": {"enabled": False},
"bollinger_breakout": {"enabled": False},
"macd_momentum": {"enabled": False}
},
"pairs": ["BTCUSDT"],
"risk_management": {
"max_open_positions": 1,
"max_daily_loss_pct": 1.0,
"stop_loss_pct": 1.5,
"take_profit_pct": 3.0
}
}
with open("config.json", "w") as f:
json.dump(safe_config, f, indent=2)# Quick dependency check
required = ["rich", "binance", "ccxt", "pandas", "ta", "websockets", "cryptography"]
import importlib
for pkg in required:
try:
importlib.import_module(pkg)
print(f"✓ {pkg}")
except ImportError:
print(f"✗ {pkg} — run: pip install {pkg}")# Check API key permissions — must have:
# Binance: Enable Futures, Enable Reading, Enable Spot & Margin Trading
# Bybit: Unified Trading, Read/Write
# OKX: Trade, Read
# Test connectivity
python -c "
import ccxt, os
exchange = ccxt.binance({
'apiKey': os.environ['BINANCE_API_KEY'],
'secret': os.environ['BINANCE_API_SECRET'],
'options': {'defaultType': 'future'}
})
print(exchange.fetch_balance())
"telegram_channel_id-100https://api.telegram.org/bot<TOKEN>/getMe# Ensure port 8080 is open and accessible
# Check firewall rules
sudo ufw allow 8080/tcp
# Test webhook endpoint locally
curl -X POST http://localhost:8080/webhook \
-H "Content-Type: application/json" \
-d '{"symbol":"BTCUSDT","side":"BUY","leverage":5}'"leverage": 5pip install --upgrade -r requirements.txt
# or individually:
pip install rich>=13.0.0 python-binance>=1.0.19 ccxt>=4.2.0 pandas>=2.1.0 ta>=0.10.2 websockets>=12.0 cryptographystop_loss_pctrisk_managementtrailing_stop_pct"testnet": true"leverage": 23max_daily_loss_pctmax_open_positionsconfig.json