Skip to content

murdok1982/BotBinanceIA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🤖 BotBinanceIA - AI-Powered Binance Trading Bot

License: MIT Python 3.8+ Binance API

Intelligent cryptocurrency trading bot that uses Binance API and specialized GPT models to make data-driven trading decisions in real-time.

✨ Features

  • 🤖 AI-Powered Trading: Integration with custom GPT specialized in trading strategies
  • 📊 Real-Time Analysis: Live market data processing and decision-making
  • 📈 Multiple Strategies: Support for various trading strategies (scalping, swing, day trading)
  • ⚡ Fast Execution: Automated order placement with minimal latency
  • 🔒 Secure: API key encryption and secure credential management
  • 📉 Risk Management: Built-in stop-loss, take-profit, and position sizing
  • 📊 Portfolio Tracking: Real-time portfolio performance monitoring
  • 💬 Notifications: Alert system for trades and important events

📋 Table of Contents

🚀 Installation

Prerequisites

  • Python 3.8 or higher
  • Binance account with API access
  • OpenAI API key (for GPT trading advisor)

Step 1: Clone the repository

git clone https://github.com/murdok1982/BotBinanceIA.git
cd BotBinanceIA

Step 2: Create virtual environment

python -m venv venv

# On Windows
venv\Scripts\activate

# On Linux/Mac
source venv/bin/activate

Step 3: Install dependencies

pip install -r requirements.txt

Step 4: Configure your credentials

cp .env.example .env
# Edit .env with your API keys

⚙️ Configuration

Create a .env file:

BINANCE_API_KEY=your_binance_api_key
BINANCE_SECRET_KEY=your_binance_secret_key
OPENAI_API_KEY=your_openai_api_key
TRADING_MODE=testnet  # or 'live'

💻 Usage

Basic Usage

python main.py

Advanced Usage

from trading.bot import TradingBot
from models.ai_advisor import GPTTradingAdvisor
from utils.binance_client import BinanceClient

# Initialize components
bot = TradingBot()
ai_advisor = GPTTradingAdvisor()

# Start trading
bot.start()

# Monitor performance
performance = bot.get_performance()
print(f"Total Profit: {performance['total_profit']}%")
print(f"Win Rate: {performance['win_rate']}%")

📊 Features in Detail

1. AI Trading Advisor

The bot uses a custom-trained GPT model that:

  • Analyzes market trends and patterns
  • Provides trading signals based on technical and fundamental analysis
  • Adapts to changing market conditions
  • Learns from historical performance

2. Multiple Trading Strategies

Momentum Strategy

strategy = MomentumStrategy(
    lookback_period=20,
    momentum_threshold=0.02
)

Mean Reversion

strategy = MeanReversionStrategy(
    bb_period=20,
    bb_std=2.0
)

Grid Trading

strategy = GridStrategy(
    grid_levels=10,
    grid_spacing=0.01
)

🎯 Trading Strategies

Available Strategies

Strategy Description Risk Level Best For
Scalping Quick trades, small profits High High volatility
Day Trading Intraday positions Medium Trending markets
Swing Multi-day positions Medium Volatile markets
Grid Buy low, sell high in range Low Sideways markets
Momentum Follow the trend Medium Trending markets
Mean Reversion Buy oversold, sell overbought Medium Range-bound markets

🔒 Security

Best Practices

  1. Never commit API keys to version control
  2. Use API key restrictions on Binance (IP whitelist, trading only)
  3. Start with testnet before going live
  4. Enable 2FA on your Binance account
  5. Use separate API keys for bot trading
  6. Monitor bot activity regularly
  7. Set conservative risk limits initially

API Key Permissions

Required Binance API permissions:

  • Enable Reading
  • Enable Spot & Margin Trading
  • ❌ Disable Withdrawals
  • ❌ Disable Internal Transfer

📊 Performance Metrics

# Example performance output
Performance Summary (Last 30 days):
=====================================
Total Trades: 156
Win Rate: 58.3%
Profit Factor: 1.85
Total Return: 12.4%
Sharpe Ratio: 1.92
Max Drawdown: -3.2%
Average Trade Duration: 2.3 hours
Best Trade: +4.8%
Worst Trade: -1.9%

⚠️ Disclaimer

IMPORTANT: Trading cryptocurrencies carries significant risk.

  • This bot is provided for educational purposes
  • Past performance does not guarantee future results
  • You can lose your entire investment
  • Always test with small amounts first
  • Use testnet before going live
  • Never invest more than you can afford to lose
  • The authors are not responsible for any financial losses

💰 Support This Project

₿ Bitcoin Donations Welcome!

Bitcoin
┌─────────────────────────────────────┐
│    ₿  BTC Donation Address  ₿      │
├─────────────────────────────────────┤
│                                     │
│  bc1qqphwht25vjzlptwzjyjt3sex     │
│  7e3p8twn390fkw                    │
│                                     │
│  Network: Bitcoin (BTC)             │
│  Scan QR ↓                          │
└─────────────────────────────────────┘
Bitcoin QR Code

Address: bc1qqphwht25vjzlptwzjyjt3sex7e3p8twn390fkw

Your donations help maintain and improve this trading bot! 🙏


🤝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/NewFeature)
  3. Commit changes (git commit -m 'Add NewFeature')
  4. Push to branch (git push origin feature/NewFeature)
  5. Open Pull Request

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

👤 Author

murdok1982

🙏 Acknowledgments

📊 Roadmap

  • Add support for Binance Futures
  • Implement more trading strategies
  • Add web dashboard for monitoring
  • Implement backtesting framework
  • Add support for multiple exchanges
  • Implement paper trading mode
  • Add Telegram bot integration
  • Machine learning model for price prediction

Star this repo if you find it useful! 🐛 Report bugs 💡 Request features

Happy Trading! 📈

About

Es un pythonbot que usa la api binance y un gpt especializado en traiding

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages