Skip to main content

MT5 EA research project · XAUUSD M15

Có Làm Mới Có Ăn

A quantitative trading research project on gold: turn trading ideas into testable rules, backtest them over many years of data, try hard to break them with statistical tests — and publish the failures too. The EA is free and open source.

Current status

First 5 strategies
Failed formal validation
Every Signal Max 3 (D_V1_CAP3, formerly FWD-01)
Public since 10 Oct 2026 (EA v1.1.0) · being forward-tested · positive results, but not independent evidence of an edge · See the Holdout page · Research candidate publication policy
Forward test
All 6 running on new data; not enough data to conclude
Real money
No strategy has enough evidence
  • Runs on XAUUSD M15 charts only. Every number on this page applies to that timeframe only.
  • I'm not a professional quant and have no formal background in finance or statistics — I'm learning as I go and following the quant process as best I can. There may be mistakes nobody has caught yet; if you spot one, please tell me.
  • Open source under the MIT license: free to view, modify, use and share, as long as the copyright notice is kept. The software is provided as is, without any warranty.

Not investment advice. The results on this site are in-sample backtests — past performance does not guarantee future results. Only trade with money you can afford to lose without affecting your life. Read the full disclaimer.

What the bot does, in one minute

The original strategy idea

The core idea is simple: when gold is rising, don't chase the price right after it jumps. Wait for it to pull back to the moving-average zone, and buy only when it bounces back up. The bot does exactly that, mechanically, in 4 steps.

XAUUSD · M15EMA34 / EMA89Pullback to EMABounce bar → entry
Illustration of the idea: price pulls back to the EMA zone, then bounces. Hand-drawn, not real data.
  1. 1. The bigger trend is up

    On H4 and H1, price closes above both the EMA34 and EMA89. If not, the bot stays out. It only BUYS.

  2. 2. The trend is strong enough

    ADX of 22 or more, EMA34 sloping up, and a wide enough “dragon band” (the gap between EMA34 of highs and EMA34 of lows). This filters out sideways markets.

  3. 3. Wait for a pullback

    The previous M15 candle must have dipped into the dragon band or the EMA89 — price has just pulled back.

  4. 4. Enter on the bounce

    The signal candle is green and closes above the dragon band and the EMA89. The bot buys at the open of the next M15 candle. The released version checks every hour of the trading week, with no session filter.

Exiting

The stop-loss sits below the EMA89. There is no fixed take-profit. At +2R the stop moves to break-even, then up another 1R for each further 1R of profit. A trade only closes when it hits its stop. After 2 losing trades in a day, the bot rests until the day ends.

Why not take profit early

In the backtests most losing trades are small and close quickly; the profit comes from a handful of trades that catch a long move. Taking profit early would cut exactly those trades.

A different variant: London Open 7AM

No waiting for a pullback. Each day the bot checks just one moment, fixed at 07:00 UTC (London's open during UK summer time; in winter London opens at 08:00 UTC). If H4 is rising and EMA34 slopes up strongly enough, it buys.

Origins

These strategies are inspired by the Break strategy by Trần Đình Hưng, Jesse, and Dino, and by the Sonic R system (Dragon EMA34 / EMA89). This is Panda's own re-coded version, researched and validated through the process described below — the results on this site do NOT represent the original authors' results.

The original authors are not involved in, did not review, and are not responsible for this EA; any mistakes are Panda's own.

The project owner is a member who came up through the Cần Cù Bù Siêng Năng trading community. Special thanks to Trần Đình Hưng — admin of the Cần Cù Bù Siêng Năng community — for the inspiration. This is a personal thank-you: he did not take part in building, did not review or endorse, and is not responsible for this EA or any result on this site. Questions or feedback about the EA go to Panda.

Origins: trading-research-lab/.ai/evidence/champion-rerun-2026-09-17/forward-demo/BRIEF-brain-forward-demo-C-D.md §2–§4(not published)

Same core idea, different signal filters

6 strategies

All six catch an uptrend on XAUUSD, M15 timeframe, when price has just pulled back toward a moving average and bounced back up — long only. They differ in signal filters, how the stop-loss trails, and how many trades can be open at once. None has clean out-of-sample evidence — see Validation.

A few terms you'll see

R
The amount of money you're risking on one trade (the distance from entry to stop-loss). '+2R profit' means twice the amount you risked.
SL (Stop-Loss)
The price at which, if hit, the trade closes automatically to stop further loss.
Drawdown
How far the account has fallen from its most recent peak — a measure of 'the worst it's gotten so far'.
EMA34 / EMA89
A moving average of price over the last 34 or 89 bars — used to read the trend.
ATR14
The average price movement over the last 14 bars — bigger when gold is more volatile.
ADX14
A measure of how strong a trend is — higher means a clearer trend (doesn't say up or down).

Classic Pullback

Code: C_V1

The original setup: enter when price pulls back to a moving average, then bounces back up strongly. The released version checks every hour of the trading week.

Entry conditions
  • Checks every hour of the trading week — the released version applies no session filter.
  • Trend is strong enough (ADX14 ≥ 22) and the moving average is clearly sloping up.
  • Recent price range is wide enough relative to typical daily movement (measured by ATR14).
  • Higher timeframes (H1, H4) also confirm the uptrend.
  • The prior bar touched or dipped into the EMA34/EMA89 zone — i.e. a pullback just happened.
  • The signal bar closes green, bouncing back above the EMA34/EMA89 zone.
  • Daily stop rule hasn't triggered, and there's room to open a new trade.
Initial stop-loss
Set just below the EMA89 at the signal bar, offset by a distance based on ATR14 (recent volatility).
How the stop-loss trails
  • At +2R profit ⇒ move the stop-loss to the entry price (break-even).
  • At +3R ⇒ move it up to lock in +1R.
  • At +4R ⇒ move it up to lock in +2R, and so on: each new whole-R level locks in one more R.
  • The stop only ever moves tighter, never looser.
Max open trades
Up to 3 trades open at the same time.
Daily stop rule
Count closed trades with pnl ≤ 0 by UTC day; once 2 losses are reached, no new trade opens for the rest of that day.
Known weaknesses
  • Statistically, a true edge of zero can't be ruled out yet.
  • Most of the profit comes from a handful of big-trend trades — drop the best 10 and the average falls to just +0.07R/trade (measured on the filtered version; not yet measured for 24/7).
  • Formal statistical validation of the 24/7 version (RL-13, 2026-09-20): FAILED — Holm-adjusted p-value 0.128, threshold p < 0.05.

Near-Touch Pullback

Code: C_V1_P1b

Identical to Classic Pullback, with one thing relaxed: price only needs to pull back CLOSE to the moving average (not touch it exactly) to count.

Entry conditions
  • Every Classic Pullback condition, except the pullback condition.
  • A pullback now counts if price touches the moving average as before, OR gets within a small distance of it (based on ATR14) — a 'near miss' also qualifies.
Initial stop-loss
Same as Classic Pullback.
How the stop-loss trails
  • Identical to Classic Pullback's ladder (lock break-even at +2R, then +1R per whole R level after).
Max open trades
Up to 3 trades open at the same time.
Daily stop rule
Count closed trades with pnl ≤ 0 by UTC day; once 2 losses are reached, no new trade opens for the rest of that day.
Known weaknesses
  • This relaxed condition was chosen AFTER trying about 140 different variants and seeing which numbers looked good — a risk of having picked the best-looking one by chance, despite passing a few robustness checks.
  • Preliminary checks looked promising, but the formal validation that followed still failed (see below).
  • Formal statistical validation of the 24/7 version (RL-13, 2026-09-20): FAILED — Holm-adjusted p-value 0.128, threshold p < 0.05.

3-Bar Pullback

Code: C_V1_P2

Also Classic Pullback, with the pullback condition relaxed a different way: it now counts if ANY of the last 3 bars (not just the one right before) touched the moving average.

Entry conditions
  • Every Classic Pullback condition, except the pullback condition.
  • A pullback now counts if at least 1 of the last 3 bars touched or dipped into its own moving-average zone.
Initial stop-loss
Same as Classic Pullback.
How the stop-loss trails
  • Identical to Classic Pullback.
Max open trades
Up to 3 trades open at the same time.
Daily stop rule
Count closed trades with pnl ≤ 0 by UTC day; once 2 losses are reached, no new trade opens for the rest of that day.
Known weaknesses
  • Also chosen after scanning a wide parameter grid — the same selection risk as Near-Touch Pullback.
  • Preliminary checks looked promising, but the formal validation that followed still failed (see below).
  • Formal statistical validation of the 24/7 version (RL-13, 2026-09-20): FAILED — Holm-adjusted p-value 0.128, threshold p < 0.05.

Every Signal

Code: D_V1

Same entry condition as Classic Pullback, but with NO cap on simultaneously open trades, and it locks in break-even sooner, at just +1R.

Entry conditions
  • Identical entry condition to Classic Pullback.
  • The only difference: every valid signal opens a trade — no cap on open trades the way Classic Pullback has (just a 20-trade technical safety ceiling).
Initial stop-loss
Same as Classic Pullback.
How the stop-loss trails
  • At +1R profit ⇒ move the stop-loss to break-even (one level earlier than Classic Pullback).
  • At +3R ⇒ move it up to lock in +1R.
  • At +4R ⇒ move it up to lock in +2R, and so on: each new whole-R level locks in one more R.
Max open trades
No design limit (backtests peaked at 13 simultaneous trades on Exness, 19 on Dukascopy); the EA enforces a technical cap of 20.
Daily stop rule
Count closed trades with pnl ≤ 0 by UTC day; once 2 losses are reached, no new trade opens for the rest of that day.
Known weaknesses
  • The most width-sensitive of the group: widening the dragon-band threshold by 1.25× cuts average profit by 43%.
  • No cap on open trades means many can lose together during a sharp move; backtest drawdown has exceeded the buffer of many prop-firm accounts.
  • Formal statistical validation of the 24/7 version (RL-13, 2026-09-20): FAILED — Holm-adjusted p-value 0.128, threshold p < 0.05.

London Open 7AM

Code: L07S

Completely different from the other four: it only looks at ONE moment per day — fixed at 07:00 UTC all year. That matches the London open during UK summer time (BST), but in winter London opens at 08:00 UTC.

Entry conditions
  • Only evaluates one moment per day: 7:00 UTC, Monday through Friday.
  • The higher timeframe (H4) confirms an uptrend.
  • The EMA34 moving average is sloping up strongly enough relative to recent volatility.
Initial stop-loss
Set just below the EMA89 at 7:00, entering at the open 15 minutes later.
How the stop-loss trails
  • Identical to Classic Pullback's ladder (lock break-even at +2R, then +1R per whole R level after).
Max open trades
Up to 3 trades open at the same time.
Daily stop rule
Count closed trades with pnl ≤ 0 by UTC day; once 2 losses are reached, no new trade opens for the rest of that day.
Known weaknesses
  • Formal statistical validation (RL-11): FAILED — Holm-adjusted p-value 0.064, threshold p < 0.05.
  • Sensitive to the stop distance: tightening it 25% cuts average profit by 38%. Drop the best 10 trades and it turns negative (Exness 2016–2023).
  • Very few trades per year (around 40) — many years of data would be needed to draw a firm conclusion.

Every Signal Max 3

Code: D_V1_CAP3

Exactly Every Signal, with one difference: at most 3 trades open at once instead of 20. Before 10 Oct 2026 this site called it research candidate FWD-01.

Entry conditions
  • Identical to Every Signal (i.e. Classic Pullback's entry conditions), with all the same thresholds.
  • The only difference: with 3 trades already open, new signals are skipped.
Initial stop-loss
Same as Classic Pullback.
How the stop-loss trails
  • Identical to Every Signal: at +1R the stop moves to break-even.
  • At +3R it locks in +1R, then each further R moves it up another 1R.
Max open trades
At most 3 trades open at once.
Daily stop rule
Count closed trades with pnl ≤ 0 by UTC day; once 2 losses are reached, no new trade opens for the rest of that day.
Known weaknesses
  • Formal test RL-14: declared alone it passed (Holm p 0.0338); declared with the other 4 it FAILED (Holm p 0.1605) — on the same 1,046 trades. It was picked AFTER reading RL-13's results, against about 130 exploratory configurations, so the “pass” is not evidence.
  • The 2024 → Aug 2026 holdout came out SURVIVES but is not clean: the period had been seen before the pick, and gold rose strongly through it — good conditions for a trend-following strategy.
  • The formal test on the frozen Dukascopy dataset once showed about half the edge (+0.143 to +0.160R vs +0.277R on Exness). The cause has been found: that dataset is missing 706 weekdays in 2016–2023; on continuous Dukascopy data the result matches Exness (+0.241R vs +0.251R).
  • MT5 2018 lost −$2,756 (55-trade losing streak); the continuous 2018 → Aug 2026 run drew down up to $3,123 at $50/trade — close to the $4,000 room of a 50K prop account.

Setup and a guide to every setting

How to use it

The CLMCA EA has very few settings: pick a strategy, set your risk, pick your broker. The EA handles the rest.

⚠ Attach the EA to an XAUUSD M15 chart only

Every strategy and every number on this page was tested only on gold (XAUUSD), 15-minute timeframe. Don't use it on other timeframes (M5, H1…) or other pairs. On the wrong chart the EA refuses to run and logs an error in the Experts tab. Broker variants of the gold symbol (e.g. XAUUSDm) are fine as long as the name starts with XAUUSD.

Suggested configuration by account type

Vantage / IC Markets / PepperstoneExnessProp-firm account
ChartXAUUSD M15XAUUSDm M15 (or your account's gold symbol)Whatever the firm's broker uses
Broker — live/demoAutoAutoAuto
Broker — backtestingVantage, IC Markets… (New York time)Exness (GMT+0)Prop/European-time broker, or ask the firm
Risk byFixed $Fixed $Percent of balance, 0.1–0.25

A warning specifically for prop-firm accounts

On MT5 at $50/trade, in the continuous run 2018 → Aug 2026, backtests drew down as much as $7,585 (Every Signal), $4,235 (Near-Touch), $4,186 (3-Bar Pullback), $4,082 (Classic Pullback), $3,123 (Every Signal Max 3) and $1,952 (London Open 7AM) — four of them exceed the $4,000 room of a 50K prop account, and Every Signal nearly doubles it. Read the firm's rules carefully (daily loss limit, static vs trailing max drawdown, daily reset time) before running. On a prop account, use percent-of-balance risk at a small setting, and run on demo first. Many prop firms ban widely-used EAs, or several accounts placing identical trades. This EA is public, so other people may be taking exactly the same trades as you. Read the firm's rules carefully — you carry the risk of a refused payout or a locked account.

Download and verify the files

The latest release (v1.1.0 — adds a 6th strategy, Every Signal Max 3; see the changelog below) contains: CLMCA.ex5 (ready to use), a single-file CLMCA.mq5 (compile it yourself), 6 .set files, one per strategy (CLMCA_C_V1, CLMCA_C_V1_P1b, CLMCA_C_V1_P2, CLMCA_D_V1, CLMCA_L07S, CLMCA_D_V1_CAP3), and SHA256SUMS.

Open the latest release on GitHub →Read the full guide (README) →
Filesha256
CLMCA.ex53145b18ef22e0a18ef4ce009f913e44b0a6fcd02afdfa83a72d5164a8e667d36
CLMCA.mq5e361df389ebddb5f196ce26ab25468870f5f4ff84991c0f6535616de838c429c

To check: on Windows run certutil -hashfile CLMCA.ex5 SHA256 · on macOS run shasum -a 256 CLMCA.ex5. The output must match the table above character for character.

Only download from the GitHub release above or from this site. A file from anywhere else, or one whose sha256 doesn't match, is NOT the original — don't run it.

Changelog

What each release changed, newest first. The Download EA button always fetches the latest one.

  1. v1.1.0Release
    • New 6th strategy: Every Signal Max 3 (D_V1_CAP3, InpMode = 8, magic 88180516). Exactly the Every Signal rules, but at most 3 open trades instead of 20. Ships with the preset CLMCA_D_V1_CAP3.set.
    • This is the research candidate this site previously called “FWD-01”. Still NOT validated; under prospective (forward) testing.
    • The 5 existing strategies are unchanged — regression backtests (Vantage XAUUSD M15, 2025) match v1.0.2 trade for trade. Self-test 80/80.
  2. v1.0.2Fix
    • Fixed lot sizing on CENT accounts (e.g. XAUUSDc) and accounts not denominated in USD: the EA now sizes lots from the broker-reported money value per lot (tick value). On cent accounts, the old version could open lots many times larger than the risk you set.
    • Regular USD accounts: nothing changes — regression-checked, every trade matches 100%.
    • Recommended: if you trade a cent account, update now, and set 'Risk by = %' (a $ amount is read in cents there).
  3. v1.0.1Improvement
    • The Common tab in MT5 now shows the description as bullet points, easier to read. Trading logic is unchanged from v1.0.0.
  4. v1.0.0Release
    • First release: 5 strategies on XAUUSD M15, long only. Every trade has a hard stop-loss; no fixed take-profit, no martingale, no grid.

Installing

  1. Download CLMCA.mq5, or CLMCA.ex5 if you'd rather not compile it yourself.
  2. In MT5 choose File → Open Data Folder and drop the file into MQL5/Experts.
  3. If you took the .mq5: open MetaEditor and compile; it must finish with 0 errors.
  4. Drag CLMCA onto an XAUUSD M15 chart, enable Allow Algo Trading, then pick a strategy. You can load a .set file: Inputs tab → Load.
  5. The Common tab shows a bilingual description, the warnings and a link back to this site.
  6. To verify it yourself: download the multi-file bundle on GitHub, compile CLMCA_SelfTest.mq5 and run it. It must print PASS pass=80 fail=0.

Fixed rules, with no setting to change them

  • If entry is more than 60 seconds after the bar opens, the trade is skipped — the price no longer matches the backtest.
  • After 2 losing trades in one UTC day, the EA rests until the day ends. Counted per strategy.
  • Every trade has a hard stop below the EMA89. No take-profit, no martingale or grid, long only.
  • Runs only on an XAUUSD M15 chart; on the wrong chart it refuses to start.
  • The EA loads 12,000 M15 bars to compute indicators.
  • On a non-demo account the EA warns that it will trade real money, but does not block.

When the EA runs, the Experts tab prints a line “[CLMCA] build <date time>”. When reporting a problem, include that exact line and the sha256 of the file you're using, so we know which build you're on. Report a problem on GitHub Issues →

What each EA input means

SettingWhat it meansWhat to useWhat changes if you change it
StrategyOne of 6: Classic Pullback · Near-Touch Pullback · 3-Bar Pullback · Every Signal · London Open 7AM · Every Signal Max 3 (D_V1_CAP3, InpMode = 8, since v1.1.0).Read the 6 strategies section first.Changes entry rules, max open trades (3; 20 for Every Signal) and how the stop trails. Each strategy has its own magic number, so several can share one account without mixing trades.
Risk bySize trades by a fixed dollar amount, or by a percent of balance at entry.Fixed $ for a personal account; percent of balance for a prop account. The EA computes lot size from the stop distance and rounds DOWN. If the result is below the minimum lot, it skips the trade rather than rounding up.
Max loss $What you lose if the trade hits its stop. Used with “Fixed $”.Leave it at 50 to compare directly with the figures on this site.Hard-capped at 2% of balance: set it higher and the EA lowers it. Several trades can be open at once, so a day's real loss can be a multiple of this.
Max loss %Percent of balance risked per trade. Used with “Percent of balance”.0.1–0.25 for a prop account.Only accepts 0.01 to 2; outside that the EA won't run.
BrokerTells the EA your broker's server time so it can convert to UTC. Options: Auto · New York-time brokers · Exness (GMT+0) · European-time brokers.Live or demo: Auto. Backtesting: pick the exact broker.This is the easiest one to get wrong. The Strategy Tester has no real clock, so on Auto the EA refuses to run. Live, if the conversion is off by more than 5 minutes it stops and asks you to pick again.
Slippage (points)Maximum slippage accepted when sending an order.Leave the default 50.Too low and orders get rejected in fast markets.
MagicThe id the EA uses to recognise its own trades.Leave it at 0; the EA picks per strategy.Only change it to run two copies of the same strategy on one account.
Trading hoursWhen the EA may open new trades: 24/7 (default) · by your computer's clock · by UTC. The From / To hour boxes (0–23, both inclusive) apply only when not on 24/7.Leave it on 24/7 — the figures on this site are for that setting.Restricting hours means fewer trades and results that differ from this site. London Open 7AM ignores this option; it always enters on the 07:00 UTC bar. In the Strategy Tester, if you restrict hours you must choose “UTC time” — the tester has no real computer clock.

Questions, feedback, or a coffee

Contact & Donate

Got a question about the EA, found a bug, or just want to say something — send a message or reach out directly below.

I work on this in my spare time, so replies may take a few days — thanks for your patience.

Have a strategy you want validated?

Send a description of your strategy through the form below. We offer free validation, following the same process described in the Validation journey.

Condition: we review it first. The strategy needs entry, stop-loss and exit rules clear enough for a computer to run. Not every submission is accepted, and the validation result may well be a fail.

Send a message

What you send is only used to handle and reply to your message, never for advertising.

Donate

This EA is completely free and will always stay free. If it's been useful to you, you're welcome to buy me a coffee — entirely optional, and not tied to any promise of upgrades or priority support.

Support via PayPal

Donate via PayPal

Thanks for reading this far — whether you donate or not.