Discussing the article: "Evolutionary Selection of LLM Agents in MetaTrader 5"

Check out the new article: Evolutionary Selection of LLM Agents in MetaTrader 5.

The article describes the architecture of a trading system consisting of 20 Grok (xAI)-based LLM agents, each of which embodies a unique trading philosophy — from pure momentum to a statistical z-score. The system applies a genetic algorithm directly during trading: every 20 trades, it automatically eliminates weak agents, clones strong ones with a prompt mutation, and publishes a leaderboard on the MetaTrader 5 chart — without interrupting trading and without using any SDK.

Imagine that you have hired 20 traders with fundamentally different trading styles. One trades momentum only, the second looks for pullbacks toward the mean, the third hunts for breakouts, and the fourth trades exclusively based on z-score statistics. You pay them all the same amount — regardless of the outcome. A month later, you discover that five of them have generated all the profits, while the remaining fifteen are either breaking even or in the red. What will you do?

Any sensible manager would fire the underperformers and hire more people similar to the top performers—but with slight differences in their approach — to find even better combinations. It is precisely this logic that forms the basis of this article. Only instead of traders, there are LLM agents with different system prompts; instead of a salary, there are computational resources; and instead of a manager, there is a genetic algorithm that automatically eliminates the weak, clones the strong with mutations, and continuously improves the population directly during trading.

Most articles about LLM-powered Expert Advisors describe a single agent with a single fixed prompt. This prompt is written once and never changes. But the market is not constant: in a trending market, the best agent is the one who follows momentum; in a sideways market, it is the one who trades off key levels; and during periods of high volatility, it is the one who knows how to wait. A fixed prompt is a strategy frozen in time: it is either good right now or it is not. It does not adapt, learn, or evolve.

By the end of this article, you'll have an architecture consisting of 20 LLM agents based on xAI's Grok. It performs evolutionary selection every 20 trades: it removes the bottom 25% by fitness, clones the top 25% with a prompt mutation, and publishes the leaderboard on the MetaTrader 5 chart.

Author: Yevgeniy Koshtenko