Home
Softono
y

yeahrb

Professional software vendor delivering innovative solutions on the Softono platform. Specialized in both open-source and proprietary software development.

Total Products
1

Software by yeahrb

CEX-Option-Futures-Crypto-Quant-Algorithm-Trading-Bot
Open Source

CEX-Option-Futures-Crypto-Quant-Algorithm-Trading-Bot

# πŸš€ CEX Option Futures Stock Quant Algorithm Trading Bot <div align="center"> ![Python](https://img.shields.io/badge/Python-3.7+-blue.svg) ![License](https://img.shields.io/badge/License-MIT-green.svg) ![Platform](https://img.shields.io/badge/Platform-Windows%20%7C%20Linux%20%7C%20macOS-lightgrey.svg) ![Docker](https://img.shields.io/badge/Docker-Supported-blue.svg) **Advanced Algorithmic Trading Bot for Centralized Exchanges** [![Discord](https://img.shields.io/badge/Discord-Join%20Community-7289DA?logo=discord)](https://discord.gg/Cxn9kCEpZD) [![Telegram](https://img.shields.io/badge/Telegram-Join%20Channel-26A5E4?logo=telegram)](https://t.me/yeahrbb) [![Email](https://img.shields.io/badge/Email-Contact%20Support-red.svg)](mailto:[email protected]) </div> --- ## πŸ“‹ Table of Contents - [🌟 Features](#-features) - [🏒 Supported Exchanges](#-supported-exchanges) - [⚑ Trading Algorithms](#-trading-algorithms) - [πŸš€ Quick Start](#-quick-start) - [πŸ“– Installation](#-installation) - [βš™οΈ Configuration](#️-configuration) - [πŸ’‘ Usage Examples](#-usage-examples) - [πŸ“Š Advanced Features](#-advanced-features) - [🐳 Docker Support](#-docker-support) - [πŸ“ˆ Performance Monitoring](#-performance-monitoring) - [πŸ”§ API Documentation](#-api-documentation) - [🀝 Contributing](#-contributing) - [πŸ“ž Support & Contact](#-support--contact) - [⚠️ Disclaimer](#️-disclaimer) - [πŸ“„ License](#-license) --- ## 🌟 Features ### 🎯 **Core Trading Capabilities** - **Multi-Exchange Support**: Trade on Binance, Bitget, Bybit, and more - **Advanced Order Management**: Limit orders, market orders, stop-loss, take-profit - **Real-time Market Data**: Live price feeds, order book analysis, volume tracking - **Risk Management**: Built-in stop-loss, position sizing, portfolio protection - **Backtesting Engine**: Test strategies with historical data before live trading ### 🧠 **Trading Algorithms** - **Profit Hunter Mode**: Automated profit-taking based on predefined percentages - **Range Trading**: Buy low, sell high within specified price ranges - **Arbitrage Detection**: Cross-exchange price difference exploitation - **Grid Trading**: Systematic buy/sell orders at predetermined intervals - **DCA (Dollar Cost Averaging)**: Automated periodic investments - **Momentum Trading**: Trend-following strategies with technical indicators ### πŸ”§ **Technical Features** - **Multi-threading**: Concurrent order processing and market analysis - **Database Integration**: SQLite for trade history and performance tracking - **Logging System**: Comprehensive logging for debugging and analysis - **API Rate Limiting**: Intelligent request throttling to prevent bans - **Error Handling**: Robust error recovery and fail-safe mechanisms - **Configuration Management**: Flexible parameter adjustment without code changes ### πŸ“Š **Analytics & Monitoring** - **Real-time P&L Tracking**: Live profit/loss monitoring - **Performance Metrics**: Win rate, Sharpe ratio, maximum drawdown - **Trade History**: Complete transaction logging and analysis - **Balance Monitoring**: Multi-asset portfolio tracking - **Market Scanner**: Automated opportunity detection across pairs --- ## 🏒 Supported Exchanges | Exchange | Status | Features | |----------|--------|----------| | **Binance** | βœ… Fully Supported | Spot, Futures, Options | | **Bitget** | βœ… Fully Supported | Spot, Futures, Copy Trading | | **Bybit** | βœ… Fully Supported | Spot, Derivatives, Options | | **OKX** | πŸ”„ In Development | Spot, Futures, Options | | **KuCoin** | πŸ”„ In Development | Spot, Futures | | **Gate.io** | πŸ“‹ Planned | Spot, Futures | ### πŸ“ˆ **Supported Trading Pairs** - **Cryptocurrency**: BTC, ETH, BNB, ADA, SOL, MATIC, and 1000+ altcoins - **Fiat Pairs**: USDT, USDC, BUSD, EUR, GBP, JPY - **Cross Pairs**: BTC/ETH, ETH/BNB, and custom combinations - **Futures**: Perpetual contracts with leverage up to 125x - **Options**: Call/Put options with various strike prices --- ## ⚑ Trading Algorithms ### 🎯 **1. Profit Hunter Algorithm** ```python # Automated profit-taking strategy python trader.py --symbol BTCUSDT --profit 2.5 --quantity 0.01 ``` - **Description**: Monitors market spreads and executes trades when profit targets are met - **Best For**: High-frequency trading, scalping strategies - **Risk Level**: Medium - **Expected Returns**: 1-5% per trade ### πŸ“Š **2. Range Trading Algorithm** ```python # Buy low, sell high within ranges python trader.py --symbol ETHUSDT --mode range --buyprice 1800 --sellprice 1850 ``` - **Description**: Identifies support/resistance levels and trades within ranges - **Best For**: Sideways markets, consolidation periods - **Risk Level**: Low-Medium - **Expected Returns**: 0.5-3% per cycle ### πŸ”„ **3. Grid Trading Algorithm** ```python # Systematic grid orders python trader.py --symbol ADAUSDT --mode grid --grid_size 0.01 --levels 10 ``` - **Description**: Places buy/sell orders at predetermined price intervals - **Best For**: Volatile markets with clear ranges - **Risk Level**: Medium - **Expected Returns**: 2-8% per grid cycle ### πŸ“ˆ **4. Momentum Trading Algorithm** ```python # Trend-following with technical indicators python trader.py --symbol SOLUSDT --mode momentum --indicator RSI --threshold 70 ``` - **Description**: Uses technical indicators to identify trend continuations - **Best For**: Trending markets, breakout strategies - **Risk Level**: High - **Expected Returns**: 5-15% per trend ### πŸ’° **5. DCA (Dollar Cost Averaging)** ```python # Automated periodic investments python trader.py --symbol BTCUSDT --mode dca --amount 100 --interval daily ``` - **Description**: Regular investments regardless of market conditions - **Best For**: Long-term investors, reducing volatility impact - **Risk Level**: Low - **Expected Returns**: Market average over time --- ## πŸš€ Quick Start ### Prerequisites - Python 3.7 or higher - API keys from supported exchanges - Minimum 0.001 BTC or equivalent for testing ### 1. Clone the Repository ```bash git clone https://github.com/yeahrb/CEX-Option-Futures-Stock-Quant-Algorithm-Trading-Bot.git cd CEX-Option-Futures-Stock-Quant-Algorithm-Trading-Bot ``` ### 2. Install Dependencies ```bash pip install -r requirements.txt ``` ### 3. Configure API Keys ```bash cp app/config.sample.py app/config.py # Edit config.py with your API credentials ``` ### 4. Run Your First Trade ```bash python trader.py --symbol BTCUSDT --profit 1.5 --quantity 0.001 ``` --- ## πŸ“– Installation ### Method 1: Direct Installation ```bash # Clone repository git clone https://github.com/yeahrb/CEX-Option-Futures-Stock-Quant-Algorithm-Trading-Bot.git cd CEX-Option-Futures-Stock-Quant-Algorithm-Trading-Bot # Install Python dependencies pip install requests sqlite3 threading argparse logging # Set up configuration cp app/config.sample.py app/config.py cp db/orders.sample.db db/orders.db # Edit configuration file nano app/config.py ``` ### Method 2: Docker Installation ```bash # Build Docker image docker build -t cex-trading-bot . # Run container docker run -d --name trading-bot cex-trading-bot # View logs docker logs -f trading-bot ``` ### Method 3: Virtual Environment (Recommended) ```bash # Create virtual environment python -m venv trading_env source trading_env/bin/activate # On Windows: trading_env\Scripts\activate # Install dependencies pip install -r requirements.txt # Run the bot python trader.py --symbol BTCUSDT --profit 2.0 ``` --- ## βš™οΈ Configuration ### API Configuration (`app/config.py`) ```python # Exchange API Credentials api_key = 'your_api_key_here' api_secret = 'your_secret_key_here' # Optional: Advanced Settings recv_window = 5000 # Request timeout window test_mode = False # Enable test mode (paper trading) debug_mode = True # Enable debug logging ``` ### Trading Parameters ```python # Default trading settings DEFAULT_PROFIT = 1.3 # Default profit percentage DEFAULT_QUANTITY = 0 # Auto-calculate if 0 DEFAULT_WAIT_TIME = 0.7 # Seconds between checks DEFAULT_STOP_LOSS = 0 # Stop-loss percentage (0 = disabled) MAX_TRADE_SIZE = 7 # Maximum concurrent trades ``` --- ## πŸ’‘ Usage Examples ### Basic Trading Examples #### 1. Simple Profit Taking ```bash # Trade BTC with 2% profit target python trader.py --symbol BTCUSDT --profit 2.0 --quantity 0.01 ``` #### 2. Range Trading ```bash # Buy at $1800, sell at $1850 python trader.py --symbol ETHUSDT --mode range --buyprice 1800 --sellprice 1850 --quantity 0.1 ``` #### 3. Stop-Loss Protection ```bash # Trade with 5% stop-loss python trader.py --symbol ADAUSDT --profit 3.0 --stop_loss 5.0 --quantity 100 ``` #### 4. Amount-Based Trading ```bash # Trade with $100 worth of BTC python trader.py --symbol BTCUSDT --amount 100 --profit 1.5 ``` ### Advanced Examples #### 5. Multi-Symbol Trading ```bash # Run multiple bots simultaneously python trader.py --symbol BTCUSDT --profit 1.5 --quantity 0.01 & python trader.py --symbol ETHUSDT --profit 2.0 --quantity 0.1 & python trader.py --symbol ADAUSDT --profit 3.0 --quantity 100 & ``` #### 6. Debug Mode ```bash # Enable detailed logging python trader.py --symbol BTCUSDT --profit 2.0 --debug --prints True ``` #### 7. Limited Loop Trading ```bash # Run for 100 cycles only python trader.py --symbol BTCUSDT --profit 1.5 --loop 100 ``` ### Balance Management ```bash # Check account balances python balance.py # View specific balance python balance.py --asset BTC # Monitor open orders python balance.py --orders BTCUSDT ``` --- ## πŸ“Š Advanced Features ### πŸ” **Market Analysis Tools** - **Order Book Analysis**: Real-time bid/ask spread monitoring - **Volume Analysis**: Trading volume pattern recognition - **Price Action**: Support/resistance level detection - **Technical Indicators**: RSI, MACD, Moving Averages integration ### πŸ“ˆ **Performance Tracking** - **P&L Dashboard**: Real-time profit/loss monitoring - **Trade Statistics**: Win rate, average profit, drawdown analysis - **Risk Metrics**: Sharpe ratio, maximum drawdown, volatility - **Portfolio Analytics**: Asset allocation, correlation analysis ### πŸ›‘οΈ **Risk Management** - **Position Sizing**: Automatic position size calculation - **Stop-Loss Orders**: Dynamic stop-loss adjustment - **Portfolio Limits**: Maximum exposure per asset/strategy - **Emergency Stop**: Manual/automatic trading halt ### πŸ”§ **Customization Options** - **Strategy Parameters**: Adjustable profit targets, stop-losses - **Time Frames**: Configurable trading intervals - **Asset Selection**: Custom trading pair selection - **Notification System**: Email/SMS alerts for important events --- ## 🐳 Docker Support ### Docker Compose Setup ```yaml version: '3.8' services: trading-bot: build: . container_name: cex-trading-bot environment: - API_KEY=${API_KEY} - API_SECRET=${API_SECRET} volumes: - ./logs:/app/logs - ./db:/app/db restart: unless-stopped ``` ### Docker Commands ```bash # Build and run docker-compose up -d # View logs docker-compose logs -f # Stop bot docker-compose down # Update bot docker-compose pull && docker-compose up -d ``` --- ## πŸ“ˆ Performance Monitoring ### Real-time Monitoring ```bash # Monitor active trades python monitor.py --live # View performance metrics python analytics.py --period 30d # Generate reports python report.py --format pdf --period 7d ``` ### Key Metrics Tracked - **Win Rate**: Percentage of profitable trades - **Average Profit**: Mean profit per successful trade - **Maximum Drawdown**: Largest peak-to-trough decline - **Sharpe Ratio**: Risk-adjusted return measure - **Total Return**: Overall portfolio performance --- ## πŸ”§ API Documentation ### Core Classes #### `Trading` Class ```python class Trading: def __init__(self, options): # Initialize trading parameters def buy(self, symbol, quantity, price): # Execute buy order def sell(self, symbol, quantity, price): # Execute sell order def run(self): # Main trading loop ``` #### `BinanceAPI` Class ```python class BinanceAPI: def get_ticker(self, symbol): # Get current price def get_order_book(self, symbol): # Get order book data def place_order(self, symbol, side, quantity, price): # Place trading order ``` ### Available Methods - `get_account()`: Retrieve account information - `get_balances()`: Get asset balances - `get_open_orders()`: List active orders - `get_trade_history()`: Retrieve trade history - `cancel_order()`: Cancel specific order --- ## 🀝 Contributing We welcome contributions from the community! Here's how you can help: ### How to Contribute 1. **Fork** the repository 2. **Create** a feature branch (`git checkout -b feature/amazing-feature`) 3. **Commit** your changes (`git commit -m 'Add amazing feature'`) 4. **Push** to the branch (`git push origin feature/amazing-feature`) 5. **Open** a Pull Request ### Contribution Guidelines - Follow PEP 8 Python style guidelines - Add tests for new features - Update documentation for API changes - Ensure backward compatibility - Include clear commit messages ### Areas for Contribution - **New Exchange Integrations**: Add support for additional exchanges - **Trading Algorithms**: Implement new trading strategies - **UI/UX Improvements**: Enhance user interface - **Documentation**: Improve guides and examples - **Bug Fixes**: Report and fix issues - **Performance Optimization**: Improve bot efficiency --- ## πŸ“ž Support & Contact ### πŸ†˜ **Getting Help** #### Discord Community - **Server**: [Join our Discord](https://discord.gg/Cxn9kCEpZD) - **Channels**: - `#general` - General discussions - `#trading-strategies` - Strategy sharing - `#technical-support` - Bug reports and help - `#announcements` - Bot updates and news #### Telegram Channel - **Channel**: [@yeahrbb](https://t.me/yeahrbb) - **Group**: [@yeahrbb](https://t.me/yeahrbb) - **Updates**: Real-time notifications and market insights #### Email Support - **General Support**: [[email protected]](mailto:[email protected]) - **Technical Issues**: [[email protected]](mailto:[email protected]) - **Business Inquiries**: [[email protected]](mailto:[email protected]) ### πŸ“‹ **Support Response Times** - **Critical Issues**: Within 2 hours - **General Support**: Within 24 hours - **Feature Requests**: Within 1 week - **Bug Reports**: Within 48 hours ### πŸ”§ **Troubleshooting** #### Common Issues 1. **API Connection Errors** ```bash # Check API credentials python test_connection.py ``` 2. **Order Execution Failures** ```bash # Enable debug mode python trader.py --symbol BTCUSDT --debug ``` 3. **Balance Insufficient** ```bash # Check account balance python balance.py ``` #### Error Codes - `-1001`: Invalid symbol - `-1003`: Too many requests - `-1013`: Invalid quantity - `-2010`: Account has insufficient balance --- ## ⚠️ Disclaimer ### 🚨 **Important Legal Notice** **This software is for educational and research purposes only. Trading cryptocurrencies involves substantial risk of loss and is not suitable for all investors. The high degree of leverage can work against you as well as for you.** ### Risk Warnings - **Market Risk**: Cryptocurrency markets are highly volatile - **Technical Risk**: Software bugs may cause unexpected losses - **Regulatory Risk**: Trading regulations may change - **Liquidity Risk**: Some assets may have limited liquidity ### No Financial Advice - This bot does not provide financial advice - All trading decisions are your responsibility - Past performance does not guarantee future results - Always do your own research before trading ### Use at Your Own Risk - **No warranties** or guarantees are provided - **No liability** for any losses incurred - **Test thoroughly** before using real funds - **Start small** and scale gradually --- ## πŸ“„ License This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. ### MIT License Summary - βœ… **Commercial use** allowed - βœ… **Modification** allowed - βœ… **Distribution** allowed - βœ… **Private use** allowed - ❌ **No liability** or warranty provided <div align="center"> ### πŸš€ **Ready to Start Trading?** [![Get Started](https://img.shields.io/badge/Get%20Started-Now-brightgreen.svg)](https://github.com/yeahrb/CEX-Option-Futures-Stock-Quant-Algorithm-Trading-Bot#quick-start) [![Join Discord](https://img.shields.io/badge/Join%20Discord-Community-7289DA.svg)](https://discord.gg/Cxn9kCEpZD) [![Follow Updates](https://img.shields.io/badge/Follow%20Updates-Telegram-26A5E4.svg)](https://t.me/yeahrbb) **Made with ❀️ by the Trading Bot Community** </div>

Developer Tools Crypto & Blockchain
482 Github Stars