How It Works
The genetic algorithm follows nature’s evolutionary principles:Initialize Population
Create a population of 100 random trading bots, each with unique genetic parameters.
Reproduction
Create the next generation by combining genes from successful parents (crossover) and introducing random mutations.
Key Features
Automated Strategy Discovery
No manual parameter tuning required. The algorithm explores the strategy space automatically, discovering profitable combinations of:- Market selection criteria (volume, time to expiry, categories)
- Entry signals (price levels, momentum, mean reversion, value, contrarian)
- Position sizing (bankroll fraction, max concurrent positions)
- Risk management (daily loss limits, price bounds)
Paper Trading Engine
All evolution happens using simulated trades against real Kalshi market data:- No real money at risk during evolution
- Fills are simulated using actual bid/ask prices
- Settlements use real market outcomes from the Kalshi API
- Multiple generations can run in parallel for faster evolution
Continuous Evolution
The system runs indefinitely, continuously improving:- Each generation trades for 24 hours
- Top performers pass their genes to the next generation
- Mutations introduce new variations to explore
- Immigration adds random diversity to prevent stagnation
Architecture Overview
Performance Metrics
Evolution progress is tracked using:- Fitness (ROI%): Primary metric - realized profit/loss percentage
- Win Rate: Percentage of settled trades that were profitable
- Trade Activity: Number of trades executed per generation
- Signal Distribution: Which trading strategies are most successful
Bots must execute at least 5 settled trades to receive positive fitness scores. This prevents inactive bots from surviving.
Data Persistence
The system automatically saves:- Generation State: All genomes, fitness scores, and statistics
- Hall of Fame: Top 20 performers across all generations
- Checkpoints: Mid-generation snapshots for crash recovery
- Evolution Logs: Detailed logs of every generation
data/evolution/ and can be analyzed offline.
Next Steps
Architecture
Deep dive into system components and data flow
Genome Structure
Understanding the 22 genes that define trading strategies
Quick Start
Run your first evolution in minutes
Monitoring
Track evolution progress in real-time