DEV Community

Cover image for From a Strategy Miner search to a real-tick MT5 test, step by step
AIStrategyMiner
AIStrategyMiner

Posted on Originally published at aistrategyminer.com

From a Strategy Miner search to a real-tick MT5 test, step by step

This is the written version of our video on how to use the Strategy Miner to generate a forex strategy automatically and test it in MT5. The video shows every screen. Here we explain why each setting was chosen, so you can repeat the steps with the text beside you. We do not re-explain how the search works inside; that is covered in our first article.

Everything below describes what we did on screen. It is education, not advice, and none of it says how a strategy will behave later.

What we will do

The path has six moves, and none of them needs coding:

  1. Set up a search in the Strategy Miner.
  2. Read the checks table.
  3. Open one result in the Strategy Builder.
  4. Download the MQL5 source.
  5. Compile it in MetaEditor.
  6. Run it in the MT5 Strategy Tester on real ticks.

The generator and the source download are Pro features. The free page shows a ready-made sample, which is enough to look at the screens first.

What the Miner does

The Miner is a search, not a recommendation. Given a symbol, a timeframe and some years of price bars, it tries thousands of random combinations of Builder blocks: a moving average here, a Bollinger Band there, plus a stop loss and a take target. It runs in your browser on bars that are built in.

Most of what it tries is discarded. What remains must pass a series of checks. We read the result as a short list of ideas that did not fall apart when we pushed on them, and nothing more.

Set up the search

The Strategy Miner settings panel with the minimum trades field set to 450 and the entry families ticked

We kept every setting visible, and we list them in the video description too:

  • Symbol and timeframe: USDJPY, H1.
  • Period: 4 years. Direction: both.
  • Trial limit: 20,000.
  • Minimum trades: 450, set under Advanced.
  • Seed: 7.

The minimum trade count is the setting people skip. A rule that trades a few times a year can look excellent or terrible by chance alone, so we ask for well over a hundred trades per year. The seed is the random starting point: the same seed repeats the same search, which lets you compare runs later. We left all six entry families on and pressed Generate.

Run it and read the checks

The Strategy Miner result text listing how many candidates passed or dropped at each check

The page counts trials while it runs. The checks table then shows, row by row, how many ideas survived each stage: the search period, duplicate removal, a later period the idea was not tuned on, other symbols, robustness tests, and a final re-check. Many ideas drop at the later-period row, which is the first sign that a rule only fitted the past.

Then we ran the same settings on EURUSD on purpose. The checks removed every idea, and the Miner reported no candidate. That is a result, not an error. If it happens to you, change one setting, such as the market, the timeframe or the minimum trades, and run again. Do not loosen the checks to get something on screen.

Open it in the Strategy Builder

A candidate in the Strategy Builder drawn as blocks, with the Preflight panel describing what the EA does

Results are saved in your vault, a table you can sort and filter. We ticked the candidate and pressed Open in Builder.

The Builder draws the rule as blocks you read from left to right: start, indicators, a condition, then the order with its stop and take target. The Preflight panel lists in plain words what the EA does and any warnings, so read it before moving on. If a block makes no sense to you, that is a good reason to leave the candidate alone.

We also changed one number in the order block to show that the Builder is not read-only. Remember what that implies: after an edit, the Miner's checks no longer cover this exact design. From that point the MT5 test is what counts.

Download and compile

Choose MT5 as the target and press Download .mq5. The file is named Strategy_Builder.mq5. Copy it into the MQL5 Experts folder inside your MT5 data folder, open it in MetaEditor and press F7. We got zero errors and zero warnings, and an .ex5 file appeared beside the source.

A clean compile only means the file is valid MQL5. It says nothing about whether the rule is any good.

Test it in MT5 with real ticks

In the Strategy Tester we selected the EA, USDJPY, H1, and the model Every tick based on real ticks. The other models invent ticks, while real ticks are the ones your broker actually sent.

After the run, look at the history quality line. We used a date range where it read close to full. When we stretched the range back by a year or two, the quality dropped, because older ticks have to be downloaded and not all of them arrive. A test on thin data is weaker evidence.

We blurred the numbers in the video on purpose. One run on one period proves very little, so we looked at other things instead: how often the EA trades, the shape of the equity curve, and a few trades checked by hand against the chart. Do the entry, the stop and the target match what the Builder showed? The Miner used its own simple engine on past bars, while MT5 applies real ticks, spreads and swaps. Small differences are normal; large ones deserve a closer look.

Limits: what this does not tell you

We searched past data, chose from many tries, and tested on a period that overlaps with the search. That is optimistic by construction, and the video says so openly.

A fairer next step is data the search never saw. The Miner has a Pro option to leave out the last twelve months: search without them, then test only on them. After that, a forward test on a demo account with your own broker's spread comes before anything else.

None of this is evidence of what comes next. A replay of the past can expose mistakes, but it cannot promise a future.

Recap

  • The Miner filters a very large number of random rules into a short list, which can be empty.
  • The Builder lets you read a candidate as blocks before you trust it.
  • A clean compile is not a verdict on the strategy.
  • A real-tick test is a replay, and overlapping data makes it optimistic.

Watch the video above to see each step on the real screens, and try everything on a demo account first. The Miner and the Builder are at aistrategyminer.com. Trading involves risk, and past results say nothing certain about the future.

This article was drafted with AI assistance and reviewed by the AIStrategyMiner team.

Top comments (0)