A sophisticated cryptocurrency trading bot leveraging artificial intelligence to predict optimal buy and sell opportunities. This system integrates machine learning, market analysis, and automation to deliver actionable trading signals directly to your Telegram account.
- Multi-Timeframe Analysis: Evaluates 15m, 30m, 1h, and 4h charts for comprehensive market insight.
- AI-Powered Predictions: Employs advanced machine learning models to identify high-probability trading setups.
- Risk Management: Implements position sizing, stop-loss, and take-profit mechanisms to manage exposure effectively.
- Telegram Integration: Sends real-time trading signals to your Telegram account.
- Backtesting: Simulates past trading performance to evaluate strategy viability.
- Live Monitoring: Continuously scans markets for opportunities while you are away.
To use the bot, ensure the following are installed or available:
- Python 3.10 or later
- Telegram Bot Token (generated via @BotFather)
- Basic understanding of trading principles
-
Clone and Set Up the Environment:
git clone <repository-url> cd signal_bot python -m venv venv source venv/bin/activate # For Windows: venv\Scripts\activate pip install -r requirements.txt
-
Configure the Bot:
cp config.example.yaml config.yaml nano config.yaml
Edit config.yaml to define:
- Trading Parameters: Cryptocurrency pairs, timeframes, etc.
- Model Parameters: AI configuration and performance settings.
- Risk Controls: Stop-loss and take-profit rules.
- Telegram Settings: Token and chat ID.
- Logging Options: Output and log file preferences.
Important: Never commit
config.yamlcontaining real API keys or sensitive credentials.
python cli.py train --config config.yaml --interval 1hpython cli.py backtest --config config.yaml --interval 1h --export backtest_results.csvpython cli.py monitor --config config.yamlpython bot.py --config config.yamlfor interval in 15m 30m 1h 4h; do
python cli.py train --config config.yaml --interval $interval
donepython cli.py backtest \
--config config.yaml \
--interval 1h \
--start 2023-01-01 \
--end 2024-01-01 \
--export my_trades.csvpython cli.py monitor --config config.yaml --threshold 0.7To run all tests:
python -m pytest tests/To run a specific test:
python -m pytest tests/test_signals.py::test_compute_stop_take_pricessignal_bot/
├── bot.py # Main trading logic
├── cli.py # Command line interface
├── monitor.py # Market monitoring functions
├── signal_cli.py # Signal handling
├── signals.py # Technical calculations
├── train.py # AI model training
├── backtest.py # Backtesting engine
├── utils.py # Utility functions
├── config.yaml # User configuration file
├── requirements.txt # Dependencies
├── models/ # Trained AI models
├── state/ # Persistent bot state
├── logs/ # Log files
└── tests/ # Test suite
- LightGBM (default): High performance and efficiency.
- Random Forest: Ensemble model for robust predictions.
- Logistic Regression: Lightweight and interpretable option.
- Dynamic stop-loss and take-profit levels.
- Position sizing based on AI confidence scores.
- Trade cooldowns to prevent overtrading.
- RSI, MACD, Bollinger Bands, Moving Averages, and more.
Comprehensive logging includes:
- Signal accuracy and performance metrics.
- Trade history and profitability reports.
- Real-time profit/loss monitoring.
- Fork the repository.
- Implement and test your improvements.
- Submit a pull request for review.
This software is provided for educational and research purposes only. Cryptocurrency trading carries significant financial risk. Use the bot at your own discretion and never invest more than you can afford to lose. The developers assume no responsibility for financial losses or damages incurred through the use of this tool.