Skip to content

Davedfirst/bitbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

Trading Telegram Bot

A sophisticated trading bot that integrates with Telegram, uses cryptocurrency exchange APIs, and employs machine learning to achieve an 87% win rate.

Project Structure

trading_telegram_bot/
├── data/                  # Directory for storing market data
├── docs/                  # Documentation
│   └── README.md          # Comprehensive user guide
├── models/                # Directory for storing trained models
├── src/                   # Source code
│   ├── bot.py             # Main Telegram bot implementation
│   ├── bot_interface.py   # Interface connecting Telegram with trading strategy
│   ├── config.py          # Configuration settings
│   ├── data_processor.py  # Data collection and preprocessing
│   ├── data_storage.py    # Database for storing market data and trades
│   ├── feature_engineering.py # Advanced feature generation
│   ├── model.py           # LSTM neural network model
│   └── trading_strategy.py # Trading strategy implementation
├── tests/                 # Test modules
│   ├── test_bot.py        # Unit and integration tests
│   └── validate_performance.py # Performance validation
├── deploy.sh              # Deployment script
├── run.sh                 # Quick start script
├── requirements.txt       # Python dependencies
└── todo.md                # Development checklist

Features

  • AI-Powered Analysis: LSTM neural networks predict price movements with high accuracy
  • Technical Indicators: RSI, MACD, Bollinger Bands, and 50+ other indicators
  • Risk Management: Configurable risk percentage, stop-loss, and take-profit levels
  • Backtesting: Test strategies on historical data before trading with real funds
  • Performance Tracking: Monitor win rate, profit/loss, and other metrics
  • Telegram Interface: User-friendly commands for market analysis and trading
  • Multi-Exchange Support: Compatible with multiple cryptocurrency exchanges

Quick Start

  1. Set up a Telegram Bot:

    • Message @BotFather on Telegram
    • Use the /newbot command to create a new bot
    • Copy the API token provided
  2. Configure the Bot:

    • Create a .env file in the project root with your Telegram token and exchange API keys
    • Example:
      TELEGRAM_API_TOKEN=your_telegram_bot_token
      ADMIN_USER_IDS=your_telegram_user_id
      EXCHANGE_NAME=binance
      API_KEY=your_exchange_api_key
      API_SECRET=your_exchange_api_secret
      DEFAULT_SYMBOL=BTC/USDT
      TIMEFRAME=1h
      
  3. Run the Bot:

    • Execute the run script: ./run.sh
    • Or deploy as a service: ./deploy.sh
  4. Interact with the Bot:

    • Start a conversation with your bot on Telegram
    • Use /help to see available commands
    • Try /analyze BTC/USDT to get market analysis

Available Commands

  • /start - Start the bot
  • /help - Show available commands
  • /status - Check bot status and connected exchanges
  • /settings - View and change bot settings
  • /connect - Connect to exchange with API keys
  • /analyze <symbol> - Analyze a trading pair
  • /trade <symbol> - Execute a trade based on AI analysis
  • /performance - View bot trading performance
  • /backtest <symbol> - Backtest strategy on historical data
  • /optimize <symbol> - Optimize strategy parameters (admin only)

Machine Learning Model

The bot uses an LSTM (Long Short-Term Memory) neural network model to predict price movements. The model is trained on historical market data with various technical indicators as features. The target win rate of 87% is achieved through:

  1. Comprehensive feature engineering
  2. Advanced model architecture with multiple LSTM layers
  3. Rigorous validation and backtesting
  4. Optimized trading strategy parameters

Deployment Options

Run Locally

./run.sh

Deploy as a Service

./deploy.sh

This will create a systemd service file that you can install to run the bot continuously.

Detailed Documentation

For complete documentation, please refer to the User Guide.

Disclaimer

This bot is provided for educational and research purposes only. Trading cryptocurrencies involves significant risk. Always do your own research before trading with real funds.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published