Evolving Alpha: Why Genetic Algorithms Outperform Memorization in Stock Trading
Extraction of investment strategies based on moving averages: A genetic algorithm approach
This paper presents a Genetic Algorithm (GA) framework for discovering profitable stock investment strategies by encoding technical indicators as "chromosomes." By optimizing conditional inequalities of various Moving Averages (Simple, Exponential, and Adaptive), the researchers achieves superior risk-adjusted returns compared to traditional benchmarks on major NASDAQ technology stocks.
TL;DR
This research from the Hong Kong University of Science and Technology transforms the "art" of technical analysis into a combinatorial optimization problem. By using Genetic Algorithms (GAs) to evolve permutations of Moving Averages, the authors developed a system that doesn't just "remember" the past—it learns generalized rules for the future, significantly beating benchmarks like "Buy and Hold" and even "Exhaustive Search" on NASDAQ giants like Microsoft and Dell.
Problem & Motivation: The Overfitting Trap
In the world of finance, "backward-looking" is a death sentence. Many quantitative traders use Exhaustive Search to find the perfect rule for the past three years, only to see it fail miserably on the first day of live trading.
The problem is Non-stationarity. Market dynamics shift. A rule that worked during a bull market (e.g., "Buy when the 5-day average crosses the 50-day average") might be catastrophic during a sideways crawl. The authors realized that we need a method that seeks robustness rather than just historical perfection.
Methodology: Trading Strategies as Chromosomes
The core innovation lies in how the authors translated abstract trading ideas into a language a computer can "evolve."
1. The Moving Average Trio
The study utilizes three distinct flavors of Moving Averages to capture different market "physics":
- SMA (Simple): The foundational baseline.
- EMA (Exponential): Reacts faster by weighting recent prices more heavily.
- AMA (Adaptive): Adjusts its own smoothing factor based on market volatility—a "self-tuning" indicator.
2. Strategy Encoding
Imagine a strategy as a sequence of inequalities. If the 1-day price > 5-day average > 250-day average, then BUY. The authors mapped these durations to integers (1=M1, 2=M5, etc.) and represented a strategy as a permutation.

3. The Evolutionary Engine
The GA operates through a cycle of:
- Crossover (PMX): Swapping segments of successful strategies to create "offspring" that inherit the best traits of both parents.
- Mutation: Randomly swapping two averages in a rule to ensure the system explores new, "unconventional" logic.
- Fitness Evaluation: Calculating the total return rate.
Experiments: Superior Generalization
The researchers tested the GA on over a decade of data (1990-2002) for MSFT, INTC, ORCL, and DELL.
The "GA vs. Exhaustive Search" Paradox
The most startling result (shown in Table 2) is that while Exhaustive Search crushed the training data (memorizing every peak and valley), the Genetic Algorithm consistently won on the Test Set.

- Observation: On Dell (DELL), the GA achieved a staggering 96.2 return on the test set, whereas traditional Random Walk only managed 8.58.
- Why? The GA acts as a regularizer. Because it searches through evolutionary "fitness" rather than brute-force memorization, it tends to find rules that are more fundamentally sound across different time periods.
Convergence: Speed and Efficiency
One might argue that GAs are slow. However, the study shows that the fitness of the population reaches 90% of the exhaustive search's average fitness in just 20 generations.

Deep Insights & Conclusion
Takeaways
- Complexity isn't always better: All three moving averages (SMA, EMA, AMA) performed similarly, though EMA is recommended for its balance of simplicity and responsiveness.
- Intelligence over Memory: The fact that GA beats Exhaustive Search is a crucial lesson for modern AI practitioners—optimizing for "training accuracy" is a vanity metric in volatile environments.
Limitations & Future Directions
The current model only looks at price-based indicators. The authors suggest that future iterations should incorporate Volume (OBV) and Momentum (RSI) to provide a multi-dimensional view of market health. Additionally, treating each strategy as an "agent" in a multi-agent system could allow for cooperative trading strategies that mitigate risk during crashes.
By bridging the gap between Darwinian evolution and Financial Engineering, this paper provides a robust template for how we can let machines "discover" alpha that human traders might overlook.
