Skip to the tool

🧬 MT4 / MT5 Genetic Copy-Trade Lab

🧬 MT4 / MT5 Genetic Copy-Trade Lab

A local, walker-style evolutionary search for copy-signal filters, with a built-in primer on reading gold (XAU/USD) and pairs such as EUR/USD. Import a chronological trade CSV; candidate genomes compete on the training segment using selection, crossover and mutation, then the chosen filter is measured on the untouched holdout. Your data stays in this browser tab and is not uploaded or saved automatically.

No system can find the “right deal” every time. This is a historical research/backtest aid, not a profit predictor. Markets change and genetic search can overfit. It never connects to a broker, sends an order, copies a live signal, or guarantees a result. Start in a MetaTrader Strategy Tester/demo environment and get qualified financial advice where needed.

📖 Learn the market first: gold (XAU/USD) and pairs such as EUR/USD

The lab can only learn from the columns you give it, so it pays to know what those columns mean in the market. This is the short version: how a quote works, where “points” come from, what moves gold and EUR/USD, and how each of those becomes a column in your CSV. It is explanation, not trading advice.

1. A pair is the price of one money in another

  • EUR/USD 1.0850 — one euro costs 1.0850 US dollars. First currency = base (what is bought), second = quote (what you pay with). Up = base stronger, quote weaker.
  • XAU/USD 2,650.00 — one troy ounce of gold priced in US dollars. XAU is the market code for gold (XAG is silver). Gold has no country and pays no yield, so it behaves less like a currency and more like the market's standing position against the dollar.
  • USD/JPY 150.00 — one dollar buys 150 yen. Quote-JPY pairs move the other way and their point size differs.
  • Crosses such as EUR/GBP or GBP/JPY are two dollar legs combined: EUR/GBP = (EUR/USD) ÷ (GBP/USD).
  • In MT4 / MT5 the tickers are usually EURUSD and XAUUSD, but some brokers label gold GOLD, XAUUSD.m or similar. Market Watch → Specification tells you the real digits, point size and contract size for your broker.

“Gold stock” is three different things. On a stock exchange you may be watching the metal itself (spot XAU/USD), a gold ETF (a share that tracks the metal minus a fee), or gold-mining shares (an equity that adds company risk, costs and leverage to the metal). They are correlated but not the same trade: a miner can fall while the metal rises.

2. Points: where the number in your history comes from

  • A point is one unit in the last decimal place of the quote. How many decimals there are comes from the symbol's digits.
  • Five-digit EUR/USD → point = 0.00001. Three-digit USD/JPY → point = 0.001. Gold is usually two-digit → point = 0.01, but some brokers quote three digits (0.001).
  • The classic pip is the fourth decimal on EUR/USD (0.0001) — ten five-digit points. Gold traders usually just count dollars.
  • Money per point = point size × contract size × lots. A typical EUR/USD contract is 100,000 base units, so one 0.00001 point on 1.00 lot is about $1. A typical gold contract is 100 oz, so one 0.01 point on 1.00 lot is also about $1. Both vary by broker — read the Specification, never assume.
  • You only need the “broker point size” box below when your CSV has prices instead of points. Leave it empty and the lab guesses from the symbol (XAU/USD → 0.01, EUR/USD → 0.00001, USD/JPY → 0.001) and tells you it did — check it, because digits are a broker setting.
  • The “cash value of one point, per 1.00 lot” box is the money number above: point size × contract size × 1.00 lot, in your account currency. Fill it in and every result gains an account-currency row (then multiply by your own lot size). Leave it blank and everything stays in points, which is the honest default.
Worked examples: turning a price move into points
TradeMovePoints (point size)
Buy EUR/USD 1.08432 → close 1.08517+0.0008585 (0.00001)
Sell EUR/USD 1.08517 → close 1.08432−0.00085 for the pair, +85 for you85 (0.00001)
Buy XAU/USD 2648.35 → close 2651.20+2.85285 (0.01)
Sell XAU/USD 2651.20 → close 2649.50+1.70170 (0.01)

Shorts profit when the price falls, so a sell that catches a 170-point drop is a 170-point win. That is why the lab needs the side column when it has to derive points itself.

3. The trading day, in UTC

Window (UTC)SessionWhat it usually feels like
21:00–06:00Sydney / early AsiaThin, gaps, wide spreads
00:00–09:00TokyoRanges; EUR/USD often drifts
07:00–16:00LondonTrends form; most gold volume is fixed here
12:00–21:00New YorkUS data, afternoon reversals
12:00–16:00London + New York overlapDeepest liquidity, biggest moves
21:00–22:00RolloverSpreads widen, swaps are booked

Two fixed points worth memorising: the London gold reference price is set at 15:00 GMT, and the big US releases land at 13:30 UTC (08:30 New York). Gold and EUR/USD both jump on US data, which is exactly when copy-trading is most likely to be late and most expensive.

4. What moves gold

  • The dollar (usually inverse). A stronger dollar makes gold more expensive for every other currency holder, so XAU/USD tends to fall as the dollar index (DXY) rises.
  • Real yields and rate expectations. Gold pays nothing, so higher real yields raise the cost of holding it.
  • Central-bank buying and ETF flows. Slow, large, trend-setting.
  • Risk aversion and geopolitics. Fast, spiky, and unreliable.
  • Practical read: if gold and EUR/USD rise together, the shared driver is usually dollar weakness — that is one bet, not two independent confirmations.

5. What moves EUR/USD

  • The rate differential between the ECB and the Fed, plus inflation prints, PMIs and employment data.
  • Asia tends to range; the day's trend usually appears in the London afternoon.
  • Correlation with DXY is strongly negative; correlation with GBP/USD strongly positive.
The five-step routine for following the move
  1. Fix your clock in UTC and know which session you are in before you read any chart.
  2. Read the pair together with its driver. Gold with DXY and real yields; EUR/USD with DXY and the ECB/Fed rate path. If they tell one story you have a driver; if they disagree, the honest answer is “no trade”.
  3. Keep an economic calendar — US CPI, non-farm payrolls, FOMC, ECB decisions — and mark the 13:30 UTC releases on your own charts.
  4. Record spread and execution delay at the moment you copy. That gap is the difference between the signal's result and yours.
  5. Journal every copied trade with the features this lab can learn: time, side, signal score, spread, copy delay and — if your EA can log it — maximum favourable/adverse excursion. Then judge the copy system on the holdout, never on the trades you used to tune it.
How the market becomes your CSV
CSV columnWhat it captures in the marketWhere you get it
timeSession and news window; the lab derives an hour-of-day gene from itMT4/MT5 history “open time”, or your EA log
symbolWhich instrument the row belongs to, so a mixed file can be splitHistory export
sideBuy or sell — needed to turn prices into signed pointsHistory export
pnl_pointsResult in your broker's points, costs already includedHistory export, or entry/close prices × side ÷ point size
signal_scoreHow confident the copied signal was at the moment it fired (0–100)Your signal provider / EA
spread_pointsCost of copying: spreads widen at rollover and at newsMarketInfo(Symbol(),MODE_SPREAD) / SymbolInfoInteger
copy_delay_secondsLatency between the signal firing and your fillEA timestamp comparison
mfe_points / mae_pointsBest and worst excursion while the trade was open — the only honest basis for TP/SL researchEA logging on tick data

Only use values that were knowable at copy time. A column filled in after the trade closed (final price, final profit) is information from the future and will make the search look brilliant and be worthless.

At least 30 valid trades are needed. Include a parseable time / datetime / timestamp so rows are sorted oldest to newest — add a Z or an offset if you want the session-hour filter to be read as UTC. Without readable times, CSV order is treated as chronology, so put the oldest row first. Keep points on one basis per run (one symbol, or the same point size). The pnl_points column must be signed and should already include trading costs. If you instead provide entry/close prices and side, enter the broker point size below.

The two example buttons fill the box with invented, illustrative rows — deterministic synthetic data shaped so a session-and-spread filter helps, not real market history. They exist so you can watch the search work before you trust it with your own export.

CSV fields the lab understands

  • pnl_points (or profit_points / points), or side + entry_price + close_price.
  • Optional signal features: signal_score (0–100), spread_points, copy_delay_seconds, side, symbol and time.
  • Optional exit excursions: mfe_points and mae_points on every row to test take-profit / stop-loss thresholds. If both thresholds were touched, the lab assumes the stop was hit first because MFE / MAE does not reveal intrabar order.
  • Derived, never typed: symbol drives the instrument selector below, and time drives an optional session-hour gene (a UTC hour window the signal is allowed to be copied in).

MT4 / MT5 history reports vary by broker and may not contain signal score, copy delay or maximum favourable/adverse excursion. Signal scores must be 0–100; MFE / MAE are non-negative point magnitudes. Add those fields from your own EA/logging if you want the search to learn them, and use only values known at copy time—not information learned after the trade. A basic account-history export alone cannot reveal a future winning trade.

Example row format

time,symbol,side,pnl_points,signal_score,spread_points,copy_delay_seconds,mfe_points,mae_points
2026-01-02T09:00:00Z,EURUSD,buy,18,78,12,1,25,6

Use the same broker “point” definition throughout. If you only have entry and close prices, set point size explicitly (for example, 0.00001 for a five-digit EUR/USD quote, 0.01 for a two-digit gold quote; check your symbol specification).

Evolution settings

Optional. Fills in the typical value for the detected symbol (about 1.00 per point per lot on EUR/USD and on XAU/USD), then the results gain an account-currency row. Anything else needs your broker's Specification: contract size × point size, in the quote currency.

The stability check runs the identical search with the next four seeds and reports how far the thresholds and the holdout result move. A filter that only works on one seed is a coincidence, not a rule.

Fitness rewards net points and penalizes historical drawdown and losing streaks. Candidates must retain at least 15% of training trades (minimum four) so the search cannot “win” by selecting one lucky trade. Every candidate bound and feature is learned from the training segment only; holdout values never expand the search space.

Import or paste a normalized trade CSV, then run the offline evolutionary search.

Results will show the all-trades baseline beside the evolved filter for training and holdout periods.

MT4 / MT5 filter adapters

After a run, these produce MQL4 and MQL5 gate snippets for an existing EA. They only accept or reject a signal; they contain no order-sending code. Replace the example score, side and age arguments with variables from your own copier.

Integration boundary: these are not complete Expert Advisors and do not connect to a signal provider, read credentials, size positions, place orders, or manage exits. Your EA must supply score (0–100), side (+1 buy / −1 sell), and signal age in seconds. The session window uses the terminal's own Hour(), so set the terminal's time zone (or convert the hours) to match the clock in your CSV. A threshold learned on one account, broker or period may fail elsewhere.

More in Finance & Money

All 102 tools in Finance & Money →