Skip to content

Janis174756/Binance-Futures-Trading-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Binance-Futures-Trading-Bot

Binance Futures Trading Bot — Technical-analysis automated crypto trading bot for Binance Futures with multiple strategies (Triple EMA, Stochastic RSI, ATR, Golden Cross, Breakout, Heikin Ashi), configurable leverage, trailing stops, multi-symbol support, and Tkinter GUI

Binance Futures Trading Bot

Python Binance License

Technical-analysis–driven automated crypto trading bot for Binance Futures

FeaturesGetting StartedConfigurationUsageProject StructureFAQ


Official Links

Resource URL
Binance Exchange https://www.binance.com
Binance Futures https://www.binance.com/en/futures
API Management https://www.binance.com/en/my/settings/api-management
Binance API Docs https://developers.binance.com/docs/derivatives/usds-margined-futures/general-info
Binance Futures API https://binance-docs.github.io/apidocs/futures/en/
python-binance https://github.com/sammchardy/python-binance

Features

Feature Status
Multiple technical strategies
Triple EMA + Stochastic RSI + ATR
Golden Cross / EMA crossover
Breakout detection
Candle wick / rejection patterns
Heikin Ashi EMA variants
Stop-loss & take-profit (USDT, %, ATR)
Trailing stop support
Configurable leverage
Multi-symbol trading
Feature Status
Binance Futures API integration
Terminal menu interface
Tkinter GUI
Rich console output
Config validation
Symbol validation
Structured logging
Cross-platform (Win/Linux/macOS)
No withdrawal permissions required
Timeframe flexibility (1m–1d)

Getting Started

Prerequisites

  • OS: Windows 7/8/10/11, Linux, or macOS
  • Python: 3.7 or newer
  • Internet: Stable connection with accurate system time (critical for Binance API)

Installation

git clone <repository-url>
cd Binance-Futures-Trading-Bot
pip install -r requirements.txt

Dependencies

Package Version Purpose
python-binance ≥1.0.19 Binance Futures API client
pandas ≥1.5.0 OHLCV data handling
numpy ≥1.23.0 Numerical operations
ta ≥0.10.2 Technical indicators
rich ≥13.0.0 Console UI & formatting
colorlog ≥6.7.0 Colored logging

Configuration

  1. Create Binance API key at API Management with permissions: Read, Trade, Futures (no withdrawal needed).

  2. Edit config/live_trading_config.py:

@dataclass
class TradingConfig:
    # Binance API credentials
    api_key: str = "your_api_key_here"
    api_secret: str = "your_secret_key_here"

    # Trading parameters
    leverage: int = 10
    order_size: float = 20.0  # USDT per position
    max_number_of_positions: int = 1

    # Strategy (see list below)
    trading_strategy: str = "tripleEMAStochasticRSIATR"

    # Symbols
    trade_all_symbols: bool = False
    symbols_to_trade: List[str] = field(default_factory=lambda: ["BTCUSDT", "ETHUSDT"])

    # TP/SL: 'USDT', '%', 'x (ATR)', swing levels
    TP_SL_choice: str = "USDT"
    SL_mult: float = 1.0
    TP_mult: float = 2.0

    # Trailing stop
    use_trailing_stop: bool = True
    trailing_stop_callback: float = 0.5  # 0.5%

    # Timeframe: 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 1d
    interval: str = "15m"

Available strategies: tripleEMAStochasticRSIATR, tripleEMA, goldenCross, candle_wick, breakout, StochRSIMACD, stochBB, fibMACD, EMA_cross, heikin_ashi_ema2, heikin_ashi_ema.


Usage

Terminal Menu (default)

python main.py
┌─────────────────────────────────────────────────────────────┐
│  Binance Futures Trading Bot                                 │
│  Technical analysis · Binance Futures                        │
├─────────────────────────────────────────────────────────────┤
│  Key   Action                                                │
│  1     Install dependencies                                  │
│  2     Start bot                                             │
│  3     About                                                 │
│  4     Settings                                              │
│  0     Exit                                                  │
└─────────────────────────────────────────────────────────────┘

Select option (0-4): 2

GUI Window

python main.py --gui

Click Install dependencies first, then Start. The GUI provides terminal-style output, Settings, and About.

Direct Run (no menu)

python main.py --run

Runs one pass over configured symbols. For continuous trading, add a loop with time.sleep() in core/bot_class.py.


Project Structure

Binance-Futures-Trading-Bot/
├── main.py                      # Entry point, terminal menu, logo
├── requirements.txt
├── config/
│   └── live_trading_config.py   # API keys, leverage, symbols, strategy
├── gui/
│   └── main_window.py           # Tkinter window (Install, Start, Settings, About)
├── core/
│   ├── bot_class.py             # Bot logic, make_decision()
│   ├── processor.py             # Data → strategy → decision
│   └── validator.py             # Config and symbol validation
├── strategies/
│   ├── trading_strats.py        # All strategies
│   └── indicators.py            # EMA, RSI, ATR
└── utils/
    ├── logger.py                # Logging
    ├── file_handler.py           # File helpers
    └── binance_client.py        # Binance Futures API wrapper

FAQ

What permissions does the API key need?

Enable Read, Trade, and Futures. Do not enable Withdrawals. Restrict IP if possible.

Why is system time important?

Binance rejects requests with timestamp drift. Ensure NTP sync on Windows (Settings → Time & Language → Sync now) or timedatectl on Linux.

Why does the bot run only one cycle?

By design for safety. Add a while True loop with time.sleep(interval_seconds) in core/bot_class.py for continuous operation.

Can I use testnet?

Yes. Point python-binance to Binance Futures Testnet by setting the appropriate base URL in the client initialization.

Which strategy is best?

There is no universal best. tripleEMAStochasticRSIATR combines trend (EMA), momentum (RSI), and volatility (ATR). Backtest on historical data before live use.

Does the bot place real orders?

The bot generates signals (direction, SL, TP). Order execution logic can be extended in core/bot_class.py via BinanceClient. Start with paper trading.

How do I add a custom strategy?

Add a function in strategies/trading_strats.py that returns (direction, stop_loss, take_profit) and register it in _STRATEGIES.


Disclaimer

⚠️ Trading cryptocurrencies and futures involves substantial risk of loss. ⚠️

This software is provided for educational and research purposes. Past performance does not guarantee future results. Use stop losses, start with small position sizes, and never invest more than you can afford to lose. The authors are not responsible for any financial losses incurred through use of this bot.


Support this project

ETH: 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb1

If this bot helps you, consider giving it a ⭐

About

Binance Futures Trading Bot — Technical-analysis automated crypto trading bot for Binance Futures with multiple strategies (Triple EMA, Stochastic RSI, ATR, Golden Cross, Breakout, Heikin Ashi), configurable leverage, trailing stops, multi-symbol support, and Tkinter GUI

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors