Analysis of test results and optimisation in the MetaTrader 5 strategy tester - page 23

Michael Charles Schefe #:

Your broker may not have a history for the full period.

Show the full log, not an image, and someone may make a different suggestion. Also post the mt5 version number and the operating system of your computer.

Build 5836 dated 28 April, Windows 10

If you disable optimisation, starts testing from the date shown. If you turn it on, it starts on the 1st of January.

NP      0       08:34:40.067    Tester  "Advisors\3LineBreakMA_EA.ex5" AVX2
NP      0       08:34:40.560    Tester  Experts\Advisors\3L ineBreakMA_EA.ex5 on EURUSDrfd,H2 from 2025.05.19 00:00 to 2026.05.21 00:00
PL      0       08:34:40.561    Tester  EURRUBrfd: history data begins from 2022.11.07 00:00
RS      0       08:34:40.561    Tester  USDRUBrfd: history data begins from 2022.11.29 00:00
MG      0       08:34:40.561    Tester  complete optimization started
QS      0       08:34:40.561    Core 1  connecting to 127.0.0.1:3001
KD      0       08:34:40.568    Core 1  connected
GH      0       08:34:40.573    Core 2  agent process started on 127.0.0.1:3002
CL      0       08:34:40.573    Core 1  authorized (agent build 5836)
HI      0       08:34:40.576    Core 3  agent process started on 127.0.0.1:3003
CQ      0       08:34:40.580    Core 4  agent process started on 127.0.0.1:3004
QF      0       08:34:40.589    Core 1  common synchronization completed
PN      0       08:34:41.228    Core 4  connecting to 127.0.0.1:3004
MG      0       08:34:41.234    Core 4  connected
RF      0       08:34:41.240    Core 4  authorized (agent build 5836)
PL      0       08:34:41.240    Core 2  connecting to 127.0.0.1:3002
PI      0       08:34:41.248    Core 2  connected
IS      0       08:34:41.254    Core 2  authorized (agent build 5836)
FK      0       08:34:41.254    Core 4  common synchronization completed
QR      0       08:34:41.259    Core 2  common synchronization completed
HM      0       08:34:41.484    Core 3  connecting to 127.0.0.1:3003
PJ      0       08:34:41.490    Core 3  connected
ER      0       08:34:41.501    Core 3  authorized (agent build 5836)
GH      0       08:34:41.515    Core 3  common synchronization completed
RP      3       08:37:50.995    Tester  1 passes not processed and returned to task queue
KF      0       08:37:51.752    Tester  optimization finished, total passes 840
JR      0       08:37:51.763    Statistics      optimization done in 3 minutes 11 seconds
IE      0       08:37:51.763    Statistics      shortest pass 0:00:00.625, longest pass 0:00:01.314, average pass 0:00:00.901
ND      0       08:37:51.763    Statistics      local 840 tasks (100%), remote 0 tasks (0%), cloud 0 tasks (0%)
HM      0       08:37:51.766    Tester  840 new records saved to cache file 'tester\cache\3LineBreakMA_EA.EURUSDrfd.H2.20250519.20260521.10.2B2C0BAF3CCC23344C901DBFC6B2C58F.opt'
IK      0       08:37:51.766    Core 1  connection closed
PF      0       08:37:51.766    Core 2  connection closed
HL      0       08:37:51.767    Core 3  connection closed
MK      0       08:37:51.767    Core 4  connection closed
Nilog #:

I am testing an Expert Advisor (with TP and SL optimisation), I specify my period (for example, 12 last months), but the tester gives me results only from the beginning of this year.

What are "results"?

Hello everyone! 👋

I’ve developed a trading expert advisor for gold (XAUUSD) that opens trades based on price levels. The settings are configured with a Stop Loss of 100 pips and a Take Profit of 300 pips, meaning the risk-to-reward ratio is 1:3.

The results look very good in the strategy tester. However, after launching the expert advisor on a live RoboForex cent account, I encountered a problem: the trading results differ significantly from the test results.

The EA opens trades, but slippage is observed on the live account. At the same time, the Stop Loss and Take Profit are set to the specified values — 100 and 300 pips respectively.

Could you please advise what might be causing this discrepancy between the back-tester and live trading?

Could the reason lie in slippage, the spread, order execution, the specifics of a cent account, or something else?

I’d be grateful for your advice and insights! 🙏

Files:
Screenshot_2.jpg  287 kb
Alisher Batiraliev #:
Could the reason lie in slippage, the spread, order execution, the specifics of a cent account, or something else?
Yes, yes, yes, the cent account could suffer from low liquidity, and you could have a slow connection to the live trade server.
Alisher Batiraliev #:
Stop Loss — 100 points, Take Profit — 300 points

Backtesting using all real ticks?

Vitaly Muzichenko #:

Test mode for all real ticks?

What’s the bloody difference when trading XAUUSD? You’ll never catch the TP+SL levels on the minute charts. The minimum minute candle is ~70 pips, and during the day those 400 pips fly by faster than a ping.

Unrealistic TP and SL levels have been set without even looking at the instrument, and the tester with the optimiser is, of course, running amok.

curve fit” your test results - meaning that you have fitted the results to that exact time frame or asset and it renders your EA inept in the real world - look up curve fitting - it’s a real trap 
Alisher Batiraliev the test results.

The EA opens trades, but slippage is observed on the live account. At the same time, the Stop Loss and Take Profit are set to the specified values — 100 and 300 pips respectively.

Could you please advise what might be causing this discrepancy between the back-tester and live trading?

Could the reason lie in slippage, the spread, order execution, the specifics of a cent account, or something else?

I’d be grateful for your advice and insights! 🙏

Alisher, you’re right about liquidity and spreads; I’ll add how to measure this rather than just guessing. Calculate the break-even slippage: run a test with 0 / 5 / 10 bps per leg and see at which value the PF falls below 1. If it breaks at 5 bps, the strategy only works with ideal fills, and real-world conditions will always be worse than the simulator.
For gold, an SL of 100 points and a TP of 300 points is too small relative to the spread plus slippage (especially at the open or during news events): costs eat into a significant portion of the TP, so a 1:3 ratio on paper ≠ 1:3 in real trading. Compare the average real-market fill price (avgPrice) with the signal price – this is the implementation shortfall, which is your ‘difference between backtesting and live trading’.
And a TP/SL optimiser on such an instrument amounts to curve fitting. Look at the lower bound of the PF confidence interval, rather than the neat point-based PF.