Login / Sign up
Discover Bonzai
Terms of Use
Legal notice
Privacy
Region
Language
Niokoz
Niokoz
41
Subscribers
Facebook
X
Whatsapp
Telegram
Feed Shop

Building an Autonomous Agent That Hunts for Trading Edges

Facebook
Twitter
Whatsapp
Telegram
6 hours ago

This morning, I decided to build something far more ambitious than another backtesting tool.

The objective is simple to explain:

Give the system an Expert Advisor, launch the process, and let an autonomous agent search for a profitable trading edge on its own.

Behind that simple concept, however, sits a much larger machine.

The agent must be capable of launching EA backtests across multiple instruments, distributing them between several MT5 workers running in parallel, analyzing every result, modifying the technical parameters of the EA, and restarting the entire process automatically.

Again.

Again.

Again.

The loop continues until the agent discovers a setup that is not merely profitable on paper, but also robust, repeatable, and worthy of deeper validation.

The Problem With Traditional EA Optimization

Optimizing an EA manually is often a painfully repetitive process.

You select an instrument.

You choose a historical period.

You define a set of parameters.

You launch a backtest.

You wait.

You analyze the results.

You modify the parameters.

Then you start again.

This process can quickly turn into hundreds or thousands of separate tests.

The difficulty is not only computational.

It is also intellectual.

Which parameters should be modified first?

Which results are genuinely promising?

Which configurations are simply overfitted?

Should the strategy be tested on another market?

Should the take profit be increased?

Should the stop loss be reduced?

Should the trading session be changed?

Should the system behave differently depending on volatility or market regime?

At some point, the human operator becomes the bottleneck.

The computer may be able to execute thousands of tests, but the trader still has to decide what to test, how to interpret the results, and what to do next.

That is precisely the bottleneck I want to remove.

From Backtesting Tool to Autonomous Research Agent

The system we are building is not designed to perform one optimization and return a colorful report.

It is designed to operate as an autonomous research loop.

The agent receives an EA and extracts the parameters that can be tested.

It generates an initial population of configurations.

It sends those configurations to a queue.

The queue distributes the backtests across multiple MT5 workers.

Each worker can test a different instrument, parameter combination, historical period, or market condition.

Once the tests are completed, the results are collected and normalized.

The agent then evaluates each configuration using several criteria:

  • Net profitability

  • Profit factor

  • Maximum drawdown

  • Win rate

  • Expectancy

  • Number of trades

  • Stability across time

  • Sensitivity to parameter changes

  • Performance across different instruments

  • Resistance to transaction costs

  • Walk-forward behavior

  • Robustness outside the original optimization sample

The best configurations are retained.

Weak configurations are eliminated.

Promising configurations are mutated, refined, combined, or tested under new conditions.

Then the agent starts another generation of backtests.

The process repeats automatically.

Multiple MT5 Workers Running in Parallel

One of the central components of the system is the MT5 worker pool.

Instead of running every backtest sequentially on a single MetaTrader 5 terminal, the agent can control several MT5 instances at the same time.

Each worker receives a specific job.

For example:

Worker 01 may test the EA on ES.

Worker 02 may test it on NQ.

Worker 03 may test it on Gold.

Worker 04 may test it on DAX.

Worker 05 may test a different parameter generation on the same instrument.

This transforms the research process from a single-file waiting line into a parallel execution engine.

The system can explore multiple markets and parameter combinations simultaneously.

The user does not need to manually open each MT5 instance, change the settings, launch the test, export the result, and repeat the process.

The agent orchestrates the entire infrastructure.

It decides which job goes to which worker.

It detects when a worker is available.

It launches the backtest.

It collects the output.

It handles errors.

It stores the results.

It assigns the next job.

The worker pool becomes a small computational laboratory dedicated to trading strategy research.

Parameters That Evolve Automatically

The core of the system is not simply the ability to run many backtests.

Running thousands of random tests is easy.

Running intelligent tests is much harder.

The agent must learn from previous results and use that information to decide what should be tested next.

Suppose the agent discovers that a specific range of stop-loss values consistently produces poor results.

It should stop wasting computational resources on that region.

Suppose a certain take-profit range performs well, but only during high-volatility sessions.

The agent should be able to isolate that relationship and explore it further.

Suppose a profitable configuration collapses when one parameter is changed slightly.

That configuration may be too fragile and should receive a lower robustness score.

The agent should not only search for the highest profit.

It should search for stable regions of performance.

A genuine edge should not exist at one magical coordinate surrounded by failure.

It should survive small parameter changes.

It should remain coherent across different periods.

It should not depend on a handful of exceptional trades.

It should not disappear immediately when realistic costs are introduced.

The objective is to discover a zone of robustness, not a beautiful accident.

Profitability Is Not Enough

A backtest can be profitable for many bad reasons.

It may be overfitted.

It may depend on a specific historical event.

It may exploit unrealistic execution assumptions.

It may generate only a tiny number of trades.

It may perform well on one instrument and fail everywhere else.

It may collapse during a different volatility regime.

It may produce an unacceptable drawdown.

For this reason, the autonomous loop cannot stop simply because it finds a profitable result.

The stopping condition must be more demanding.

The agent should only validate an edge when the configuration satisfies a complete set of criteria.

For example:

The strategy must be profitable after costs.

The drawdown must remain within acceptable limits.

The number of trades must be statistically meaningful.

Performance must remain stable across several historical periods.

The configuration must survive walk-forward testing.

Nearby parameter combinations should produce coherent results.

The setup should remain viable on unseen data.

Depending on the strategy, it may also need to demonstrate consistency across related instruments or market regimes.

Only then can the system classify the setup as a potentially validated edge.

The Feedback Loop

Every completed backtest adds information to the system.

The agent stores the configuration, the instrument, the historical period, the metrics, the market regime, the test quality, and the validation status.

Over time, this creates a growing research memory.

The agent begins to understand which regions of the parameter space are worth exploring.

It can compare new tests with earlier generations.

It can avoid repeating failed experiments.

It can identify parameter combinations that consistently produce instability.

It can rank promising families of configurations instead of looking only at isolated results.

This feedback loop is what transforms the engine from a backtest launcher into an evolving research system.

The agent tests.

It observes.

It scores.

It eliminates.

It mutates.

It validates.

Then it tests again.

The User Experience Must Remain Simple

The internal engine is intentionally complex.

The user experience should not be.

The final interaction should look something like this:

  1. Upload the EA.

  2. Select the instruments.

  3. Define the risk and validation constraints.

  4. Press START.

  5. Let the agent work.

That is the contrast at the heart of the project.

On the surface, the concept is almost trivial.

Upload an EA and launch the search.

Under the surface, several systems are operating simultaneously:

  • EA analysis

  • Parameter extraction

  • Job generation

  • Multi-worker orchestration

  • Parallel MT5 execution

  • Results collection

  • Statistical evaluation

  • Robustness filtering

  • Walk-forward validation

  • Cross-instrument testing

  • Risk analysis

  • Parameter mutation

  • Knowledge storage

  • Autonomous iteration

  • Final edge validation

One button on the front end.

A full autonomous research factory behind it.

What This Changes

Traditionally, traders build strategies.

They define rules, select parameters, optimize them, and manually interpret the results.

This project changes the role of the trader.

The trader no longer needs to personally supervise every individual backtest.

Instead, the trader defines the research objective, the constraints, and the standards of validation.

The autonomous agent handles the repetitive exploration.

This does not mean that the machine replaces strategic thinking.

It means that human thinking can move one level higher.

Instead of spending hours adjusting values and relaunching tests, the researcher can focus on better questions:

What behavior are we trying to capture?

What constitutes a genuine edge?

Which market regimes matter?

What risks are acceptable?

What evidence is required before a strategy is trusted?

The machine handles the search.

The human defines what deserves to be found.

The Real Objective

The objective is not to create a machine that produces attractive equity curves.

The objective is to create a machine that rejects weak ideas aggressively.

A useful autonomous research agent should be skeptical.

It should try to break every promising setup.

It should test the strategy outside its comfort zone.

It should increase costs.

It should change periods.

It should compare instruments.

It should perturb the parameters.

It should examine drawdowns.

It should challenge the statistical significance.

Only the configurations that survive this process should reach the final stage.

The value of the system will not come from the number of edges it claims to discover.

It will come from the number of false edges it successfully eliminates.

Where We Are Going

We are currently building the foundations of this autonomous laboratory.

The first stages involve reliable MT5 worker orchestration, backtest automation, parameter management, result parsing, scoring, and persistent storage.

The next stages will introduce deeper robustness analysis, intelligent parameter evolution, market regime classification, walk-forward testing, and increasingly autonomous decision-making.

Eventually, the system should be capable of receiving an EA and conducting an entire research campaign with minimal human intervention.

It should explore multiple instruments.

It should adapt the search based on previous results.

It should allocate computational resources intelligently.

It should document every experiment.

It should explain why a configuration was rejected.

It should produce a complete validation report when a credible setup emerges.

And when no edge exists, it should be able to say so clearly.

That last point matters.

An intelligent research agent should not be forced to find something.

Sometimes, the correct answer is that the strategy has no stable edge.

The machine must be allowed to reach that conclusion.

Final Thought

This morning, I did not decide to build another trading strategy.

I decided to build the machine that searches for them.

A machine that does not sleep.

A machine that does not become tired of repeating the same process.

A machine that can test several markets simultaneously.

A machine that learns from every failed configuration.

A machine that continues iterating until it finds something profitable, robust, and repeatable, or until it proves that the edge is not there.

The concept is simple.

Upload the EA.

Press START.

Let the agent hunt.

Behind that button, an entire autonomous trading research laboratory comes alive. 🧠⚙️

Follow Niokoz to comment
Niokoz

Niokoz

Trading, research, developpement, Futures, Crytpo, WEB3 ! Market Making, and HFT analysis. META_quant.
41
Visit this Bonzai
Follow Niokoz to get the latest updates.

Same 1% target. Different RISK architecture

1 day ago
11

🔥 FROM MARKET DATA TO REAL EXECUTION: THE AURELIEN R&D PROJECT IS PRODUCING RESULTS

2 days ago
16

ENOUGH THEORY. HERE'S THE MT5 TEST STATEMENT

4 days ago
17

I have found the edge on the #ES

6 days ago
22

PRIVATE R&D UPDATE

2 weeks ago
32

PRIVATE R&D UPDATE 🔬⚙️

2 weeks ago
37

WHAT’S NEW IN 3D_NEXUS_META 8.8A broader execution network. A faster orderflow engine

2 weeks ago
55

“TREND IS YOUR FRIEND” is retail folklore.

3 weeks ago
50

FDAX Absorption in Action — Reading a Two-Sided DAX Setup with the 2.5D NEXUS DOM Heatmap for MT5

3 weeks ago
394

I PUT AN LLM INSIDE MT5 | Live Futures Orderflow Meets Artificial Intelligence

2 weeks ago
545

MT5 Has Never Looked Like This: 2.5D NEXUS DOM Heatmap Nails the GOLD Reversal

3 weeks ago
451

⚡ TAPE-CHART IS LIVE.

4 weeks ago
450

Candles lie. Orderflow doesn't.

3 weeks ago
455

🚀 PRIVATE RELEASE FOR THE NEXUS COMMUNITY

3 weeks ago
468

MASS EXTRACT

4 weeks ago
79

🚀 BIG UPDATE FOR 3D_NEXUS_META!

1 month ago
149

📘 THE 3D_NEXUS_META V8.5 USER GUIDE HAS JUST BEEN UPDATED

1 month ago
92

🎙️ NEW PODCAST: PREDATORY HFT ATTACKS

1 month ago
77

🚨 HOW TO RECOGNIZE A PREDATORY HFT BID ATTAC

1 month ago
73

What’s New in 3D_NEXUS_META

1 month ago
81
© 2026 Bonzai Privacy Legal notice Terms of Use