Skip to content

StratEvo Documentation

Genetic algorithms evolve trading strategies so you don't have to write them.

PyPI CI License Python


What is StratEvo?

StratEvo breeds trading strategies using genetic algorithms. Instead of writing rules by hand, you define a search space of 484+ factors โ€” the GA evolves, mutates, and walk-forward tests strategies on unseen data. You get strategies that survived out-of-sample, not just curve-fitted backtests.

Key Highlights

  • ๐Ÿงฌ 484+ Factors โ€” 284 general + 200 crypto-native factors, all evolvable
  • ๐Ÿ”ฌ Pure NumPy TA โ€” SMA, EMA, RSI, MACD, Bollinger, Ichimoku, and more โ€” no TA-Lib dependency
  • ๐Ÿ“ˆ Genetic Evolution โ€” Population-based search with crossover, mutation, and elite selection
  • ๐Ÿงช Walk-Forward Validation โ€” Multi-window OOS + Monte Carlo + Arena mode anti-overfitting
  • ๐Ÿ”Œ MCP Server โ€” Plug StratEvo into Claude Desktop, Cursor, VS Code, or any MCP client
  • ๐Ÿ“ฆ Plugin Architecture โ€” Extend with custom factors, fitness functions, data sources, and exchanges
  • ๐Ÿ’น Multi-Market โ€” Crypto (100+ exchanges via ccxt), US stocks, China A-shares
  • ๐Ÿ“Š 8,200+ Tests โ€” Comprehensive test suite covering factors, evolution, backtesting, and risk

Quick Start

pip install stratevo
stratevo evolve --quick            # See results in ~2 minutes (built-in data, no API keys)
stratevo evolve --market crypto    # Full evolution (deeper search)

No API keys. No exchange accounts. No config files.


Quick Navigation

Section Description
Getting Started Install and run your first evolution in minutes
Evolution Engine How genetic evolution works
Exchanges Setup guides for supported exchanges
Strategies Built-in strategies and evolved DNA
Backtesting Walk-forward analysis, Monte Carlo, overfitting detection
Live Trading Paper trading โ†’ live trading guide
MCP Server Connect StratEvo to AI assistants
REST API HTTP API reference
Plugins Write custom factors, fitness functions, data sources
CLI Reference Full command-line reference
API Reference Python API documentation
FAQ Common questions and troubleshooting

Architecture

stratevo/
โ”œโ”€โ”€ factors/              # 308 general factors (momentum, volatility, mean reversion, ...)
โ”œโ”€โ”€ factors/crypto/       # 200 crypto-native factors (funding rate, whale detection, ...)
โ”œโ”€โ”€ factor_registry/      # BaseFactor registry + auto-discovery
โ”œโ”€โ”€ fitness_plugins/      # BaseFitness โ†’ customize "what's a good strategy"
โ”œโ”€โ”€ datasource_plugins/   # BaseDataSource โ†’ add data providers
โ”œโ”€โ”€ evolution/            # Genetic algorithm engine (GA, NSGA-III, Arena mode)
โ”œโ”€โ”€ backtesting/          # Walk-forward, Monte Carlo, realistic fills
โ”œโ”€โ”€ ta/                   # Technical indicators (pure NumPy)
โ”œโ”€โ”€ strategies/           # Strategy classes and combiners
โ”œโ”€โ”€ risk/                 # Kelly, VaR, position sizing, stop-loss
โ”œโ”€โ”€ exchanges/            # Exchange adapters (ccxt-based)
โ”œโ”€โ”€ mcp/                  # MCP server for AI agents
โ”œโ”€โ”€ cli/                  # CLI entry point and commands
โ”œโ”€โ”€ api/                  # REST server + webhooks
โ”œโ”€โ”€ plugins/              # Plugin system
โ””โ”€โ”€ ...

License

AGPL-3.0 โ€” Free for personal and open-source use.