I Built an AI That Trades Crypto Using Evolutionary Algorithms — Here's What I Learned
The Problem
Most crypto trading bots use fixed rules. They work for a while, then market conditions change and they start losing money. What if the bot could evolve its own strategy?
The Solution: Evolutionary Trading
I built a system that uses genetic algorithms to evolve trading strategies:
- Start with a population of random strategies (each uses different indicators + rules)
- Backtest each strategy on historical data
- Score them by fitness (win rate × Sharpe ratio × profit)
- Crossover the best strategies + mutate random genes
- Repeat for 30+ generations
Results After 30 Generations
| Coin | Win Rate | Sharpe | Fitness |
|---|---|---|---|
| ADA | 89.3% | 3.13 | 0.53 |
| SOL | 87.6% | 5.27 | 0.29 |
| ETH | 59.2% | 2.03 | 0.18 |
| BTC | 61.9% | 1.82 | 0.17 |
ADA and SOL strategies are particularly strong — 89% and 87% win rates!
How It Works
Each strategy is a "genome" with:
- Indicators: RSI, MACD, Bollinger Bands, ADX, ATR, CCI, Stochastic, VWAP, Williams %R, OBV, MFI
- Entry rules: Combinations of indicator conditions
- Exit rules: Stop-loss, take-profit, timeout
- Sizing: Volatility-scaled position sizing
- Risk management: Forced 3% stop-loss on all positions
The system runs on Hyperliquid (DEX) with real money. Current live PnL: +$1.78 on a $9.73 account (18% return).
Live API
I've made the trading signals available via a free API:
curl http://169.58.38.67:8790/api/signals/latest
Returns: {"coin": "KAITO", "confidence": 82, "direction": "long"}
Want Full Signals?
- Free: 10 queries/day, signal previews
- Pro ($49/mo): 1,000 queries/day, full signals for 22+ coins → Subscribe on Gumroad
- Single Report ($5): Custom intelligence report → Buy on Gumroad
Tech Stack
- Python + Flask API
- Hyperliquid SDK for execution
- Evolutionary algorithms for strategy optimization
- HackerNews + CoinGecko for OSINT data
- 15+ technical indicators per strategy
What's Next
- Multi-family evolution (evolve strategies across coin families simultaneously)
- Funding rate farming (delta-neutral positions)
- WebSocket for real-time signals
- More coins (currently 4, targeting 22+)
The API is live at http://169.58.38.67:8790 — try it free, no signup needed.
Top comments (0)