An AI-powered cryptocurrency trading system that combines multi-agent strategy generation with live trading capabilities. Built on CrewAI, this system uses collaborative AI agents to research markets, generate trading strategies, backtest them, and execute live trades on testnet.
- Trending Coin Finder – Identifies promising cryptocurrencies from news, market reports, and social sentiment
- Coin Picker – Selects the best investment opportunity with detailed analysis
- Strategy Generator & Backtester – Creates and validates trading strategies using technical indicators (EMA, SMA, RSI, MACD, Bollinger Bands, ATR, VWAP)
- Real-time Data Management – Maintains rolling window of historical data with automatic updates
- Automated Strategy Execution – Executes trades based on generated strategies with position tracking
- Risk Management – Built-in stop-loss, take-profit, and allocation controls
- Testnet Integration – Safe testing environment with Binance testnet
- Professional Dashboard – Real-time monitoring interface with live charts and analytics
- Interactive Charts – Live price charts with technical indicators and trading signals
- Portfolio Monitoring – Real-time holdings, transactions, and P&L tracking
- Activity Logs – Comprehensive trading activity and system logs
- Responsive Design – Modern UI with Merriweather Sans typography
- Auto-refresh – Updates every 30 seconds for real-time data
- Generic Strategy Support – Works with any strategy without code changes
- Dynamic Signal Evaluation – Uses
eval()for flexible rule evaluation - Automated Pipeline – Complete workflow from strategy generation to execution
- Comprehensive Logging – Detailed trading logs and performance metrics
- Win Rate – Percentage of profitable trades
- Profit Factor – Ratio of gross profit to gross loss
- Sharpe Ratio – Risk-adjusted return measure
- Max Drawdown – Maximum peak-to-trough decline
- Total Return – Overall portfolio performance
- Trade Count – Number of trades executed
- Python >= 3.10 < 3.14
- UV package manager
- NTP Time Synchronization – System clock must be synchronized for accurate API timestamps
# Install UV
pip install uv
# Clone and navigate to project
git clone https://github.com/pushkqr/crypto-bot
cd crypto
# Install dependencies
uv sync
source .venv/bin/activate # Linux/WSL
# or
.venv\Scripts\Activate.ps1 # Windows PowerShell
# Enable NTP time synchronization
sudo timedatectl set-ntp true # Linux/WSL
# For Windows: Settings → Time & Language → Date & Time → Set time automaticallyCreate a .env file with your API keys:
# CrewAI & Research
GEMINI_API_KEY=your_gemini_key
SERPER_API_KEY=your_serper_key
# Binance API (Mainnet for data)
BINANCE_API_KEY=your_mainnet_key
BINANCE_API_SECRET=your_mainnet_secret
# Binance Testnet (for trading)
TESTNET_API_KEY=your_testnet_key
TESTNET_SECRET=your_testnet_secret
# Push Notifications (ntfy)
NTFY_SERVER=https://ntfy.sh
NTFY_TOPIC=crypto-bot-alerts-your-unique-id- Choose a unique topic name (e.g.,
crypto-bot-alerts-your-unique-id-12345) - Install ntfy app on your phone from App Store/Play Store
- Subscribe to your topic in the ntfy app
- Test notifications:
curl -d "Test message!" https://ntfy.sh/your-topic-name
uv run app.pyThis will:
- Check for existing strategies
- Ask if you want to execute them
- Generate new strategies if needed
- Launch the professional trading dashboard
This opens a real-time web interface with:
- Live price charts with technical indicators
- Portfolio monitoring and P&L tracking
- Current holdings and recent transactions
- Trading activity logs
- Real-time updates every 30 seconds
crypto/
├── src/crypto/ # Core CrewAI system
│ ├── main.py # Entry points
│ ├── crew.py # Agent definitions
│ ├── config/ # Agent and task configs
│ └── tools/ # Custom tools
├── app.py # Main pipeline script
├── gui.py # Gradio web interface
├── trader.py # Complete trading system
├── util.py # UI utilities and styling
├── output/ # Generated strategies & results
└── data/ # Historical data cache
- Define agent roles, goals, and capabilities
- Customize agent behavior and tools
- Define workflow tasks and dependencies
- Set output formats and validation rules
- Symbol and timeframe settings
- Risk management parameters
- Data buffer size configuration
- Binance (Testnet for safe testing)
- Mainnet data fetching for accurate indicators
- Position sizing based on portfolio allocation
- Stop-loss and take-profit levels
- Maximum position limits
output/backtest_results.json– Strategy performance and rulesoutput/investment_decision.md– Detailed strategy analysisdata/– Cached historical data for faster access
If you encounter "Timestamp for this request is outside of the recvWindow" errors:
Linux/WSL:
# Check time sync status
timedatectl
# Enable NTP sync
sudo timedatectl set-ntp true
# Force immediate sync
sudo ntpdate -s time.google.comWindows:
- Open Settings → Time & Language → Date & Time
- Enable "Set time automatically"
- Click "Sync now"
Verify sync:
# Check time drift with Binance servers
python test.py # If you have the time drift test scriptContributions are welcome!
- CrewAI – Multi-agent framework for strategy generation
- python-binance – Binance API integration for live trading
- ta – Technical analysis indicators (EMA, SMA, RSI, MACD, etc.)
- pandas – Data manipulation and analysis
- numpy – Numerical computing
- pydantic – Data validation and serialization
- gradio – Web interface framework for dashboard
- plotly – Interactive charts and visualizations
- python-dotenv – Environment variable management
- requests – HTTP requests for API calls