Page 1 of 2

🧐 Is Metaquotes playing with us?

Posted: Wed Feb 12, 2025 2:03 am
by ionone
That's not the first time I encounter this : a backtest seems to mysteriously change from the previous backtest!
did it happen to you ?

I often noticed that two backtests of the SAME EA, but for instance one month apart or a few hours even sometimes would give different results. Sometimes even drastic changes (like one winning and then one losing)
I even log the profits and dd, and got different results than before !!

but I would always think that it had to be me that didn't store the settings in the file and the settings got reinitialized somehow.
or maybe I modified the EA

But I JUST had the weirdest thing happening to me right now:
and I got the logs to prove it.

My EA went from "opening one trade at a time and closing it" to opening several orders in the same direction, and closing it in a basket
In the code it's very clear , there is absolutely no way it can happen in any other way
my code absolutely prohibits opening another trade unless there are 0 trades opened
it goes something like this :

Code: Select all

if (nb == true && OrdersTotal() == 0)
   {
   	if (buyLogic)
   	{
   		open buy;
   		nb = false;
       }
   }
so because nb is only reset every bar, AND it can open a new order only if OrderTotal() == 0 there is absolutely no way it opens two buys in a row
RIGHT?


but that's exactly what happenned : The EA started to behave like an averaging EA, opening more than one order at a time
I could not understand how it was doing that. I was looking at the code again and again, trying to find why It would behave that way, because it was impossible according to the code, so I was smh (scraching my head) and smh (shaking my head) but could not find the "error"

and here is the log to prove it :
first part at the top is the normal behaviour of the EA
second half is the weird strange behaviour
and it happened almost instantly (7 seconds between the two backtests)

Code: Select all

2	15:24:31.267	2010.04.26 03:03:37  hedge 05 GBPUSD,H1: open #188 sell 1.00 GBPUSD at 1.54365 ok
2	15:24:31.270	2010.04.26 03:16:42  hedge 05 GBPUSD,H1: close #188 sell 1.00 GBPUSD at 1.54365 at price 1.54330
2	15:24:32.319	2010.04.27 05:11:48  hedge 05 GBPUSD,H1: open #189 sell 1.00 GBPUSD at 1.54580 ok
2	15:24:32.320	2010.04.27 05:18:55  hedge 05 GBPUSD,H1: close #189 sell 1.00 GBPUSD at 1.54580 at price 1.54540
2	15:24:33.341	2010.04.27 23:44:53  hedge 05 GBPUSD,H1: open #190 sell 1.00 GBPUSD at 1.52575 ok
2	15:24:33.343	2010.04.28 00:00:18  hedge 05 GBPUSD,H1: close #190 sell 1.00 GBPUSD at 1.52575 at price 1.52570
2	15:24:33.425	2010.04.28 03:20:27  hedge 05 GBPUSD,H1: open #191 sell 1.00 GBPUSD at 1.52715 ok
2	15:24:33.441	2010.04.28 03:40:50  hedge 05 GBPUSD,H1: close #191 sell 1.00 GBPUSD at 1.52715 at price 1.52675
2	15:24:34.654	2010.04.29 05:18:32  hedge 05 GBPUSD,H1: open #192 buy 1.00 GBPUSD at 1.51610 ok
2	15:24:34.673	2010.04.29 05:46:55  hedge 05 GBPUSD,H1: close #192 buy 1.00 GBPUSD at 1.51610 at price 1.51645
2	15:24:35.557	2010.04.29 21:02:13  hedge 05 GBPUSD,H1: open #193 buy 1.00 GBPUSD at 1.53145 ok
2	15:24:35.558	2010.04.29 21:02:42  hedge 05 GBPUSD,H1: close #193 buy 1.00 GBPUSD at 1.53145 at price 1.53190
2	15:24:36.573	2010.05.03 00:11:49  hedge 05 GBPUSD,H1: open #194 buy 1.00 GBPUSD at 1.52970 ok
3	15:24:45.259	2010.05.11 20:46:00  Tester: stop button pressed
2	15:24:45.262	2010.05.11 20:47:08  Tester: order #194 is closed
0	15:24:45.262	GBPUSD,H1: 6927836 tick events (2088 bars, 167232527 bar states) processed in 0:03:53.906 (total time 0:03:54.125)
0	15:24:46.958	Expert hedge 05 GBPUSD,H1: removed
0	15:24:46.974	Expert hedge 05 GBPUSD,H1: loaded successfully
3	15:24:53.218	TestGenerator: file "D:\MT\MetaTrader 4 02\tester\history\GBPUSD60_0.fxt" is read-only
3	15:24:53.218	TestGenerator: symbol GBPUSD period 60 model 0 from 2010.01.01 to 2017.05.12
3	15:24:53.218	TestGenerator: server "Tickstory-Demo" differs from "TickmillEU-Demo" terminal connected to
2	15:24:53.231	2010.01.10 00:00:00  hedge 05 inputs: invertCloses=0; SL=0; TP=0; useTs=0; Ts=20; TsInv=20; step=200; stepTP=1200; invert=0; Magic=1; ATRDistPeriod=200; ATRDistMul=0.5; ATRDistMul2=0.1; ATRDistMul3=1; bufferNumOrederTs=5; bb=50; add=0; mul=1; maxMul=100; minMul=-10; averaging=0; limitDDCloseAll=0; VolatilityType=7; MAType=0; 
2	15:24:57.329	2010.01.13 21:23:50  hedge 05 GBPUSD,H1: open #1 sell 1.00 GBPUSD at 1.62900 ok
2	15:24:57.330	2010.01.13 21:24:21  hedge 05 GBPUSD,H1: open #2 sell 1.00 GBPUSD at 1.62915 ok
2	15:24:57.330	2010.01.13 21:24:23  hedge 05 GBPUSD,H1: open #3 sell 1.00 GBPUSD at 1.62900 ok
2	15:24:57.330	2010.01.13 21:24:35  hedge 05 GBPUSD,H1: close #3 sell 1.00 GBPUSD at 1.62900 at price 1.62860
2	15:24:57.330	2010.01.13 21:24:35  hedge 05 GBPUSD,H1: close #2 sell 1.00 GBPUSD at 1.62915 at price 1.62860
2	15:24:57.330	2010.01.13 21:24:35  hedge 05 GBPUSD,H1: close #1 sell 1.00 GBPUSD at 1.62900 at price 1.62860
2	15:24:57.330	2010.01.13 21:30:14  hedge 05 GBPUSD,H1: open #4 sell 1.00 GBPUSD at 1.62900 ok
2	15:24:57.331	2010.01.13 21:31:40  hedge 05 GBPUSD,H1: open #5 sell 1.00 GBPUSD at 1.62900 ok
2	15:24:57.331	2010.01.13 21:31:56  hedge 05 GBPUSD,H1: open #6 sell 1.00 GBPUSD at 1.62900 ok
2	15:24:57.331	2010.01.13 21:33:48  hedge 05 GBPUSD,H1: close #6 sell 1.00 GBPUSD at 1.62900 at price 1.62860
2	15:24:57.332	2010.01.13 21:33:48  hedge 05 GBPUSD,H1: close #5 sell 1.00 GBPUSD at 1.62900 at price 1.62860
2	15:24:57.332	2010.01.13 21:33:48  hedge 05 GBPUSD,H1: close #4 sell 1.00 GBPUSD at 1.62900 at price 1.62860
2	15:24:57.336	2010.01.13 22:01:01  hedge 05 GBPUSD,H1: open #7 buy 1.00 GBPUSD at 1.62765 ok
2	15:24:57.339	2010.01.13 22:13:47  hedge 05 GBPUSD,H1: open #8 buy 1.00 GBPUSD at 1.62765 ok
2	15:24:57.339	2010.01.13 22:13:49  hedge 05 GBPUSD,H1: open #9 buy 1.00 GBPUSD at 1.62765 ok
2	15:24:57.339	2010.01.13 22:16:01  hedge 05 GBPUSD,H1: open #10 buy 1.00 GBPUSD at 1.62755 ok
2	15:24:57.339	2010.01.13 22:16:36  hedge 05 GBPUSD,H1: open #11 buy 1.00 GBPUSD at 1.62765 ok
2	15:24:57.339	2010.01.13 22:17:16  hedge 05 GBPUSD,H1: open #12 buy 1.00 GBPUSD at 1.62765 ok
2	15:24:57.344	2010.01.13 23:08:57  hedge 05 GBPUSD,H1: close #12 buy 1.00 GBPUSD at 1.62765 at pr

and yes I reverted every action I did on the EA and tested each step back and I never got back the "averaging" logic
it's totally impossible to have the EA open several sell orders in a row. totally impossible.

so my question is : is Metaquotes messing with the backtesting tool ("just move to MT5 you'll have less issues")? or is it a bug?

this is very strange
did it happen to you ?
WTF is Metaquotes doing or is it a Mandela Effect I just witnessed ?

Jeff

Re: 🧐 Is Metaquotes playing with us?

Posted: Wed Feb 12, 2025 3:00 am
by andrei-1
I don't work with advisors. But sometimes it is interesting to look at the behavior of the indicator.
The tester has not started for a very long time, it instantly and testing without results.
But sometimes it works. Despite the fact that I use simple settings (H1, opening, several months).

Re: 🧐 Is Metaquotes playing with us?

Posted: Wed Feb 12, 2025 9:55 am
by wojtek
I'm not an expert, but free historical data
for backtests can't be taken too seriously because
it's (rather) full of holes, perhaps other peculiarities
and leaks over time...

Re: 🧐 Is Metaquotes playing with us?

Posted: Wed Feb 12, 2025 10:47 am
by boytoy
ionone wrote: Wed Feb 12, 2025 2:03 am That's not the first time I encounter this : a backtest seems to mysteriously change from the previous backtest!
did it happen to you ?
Right tests dont match and your code is clear as day but mrtools is the most experienced on this.. its happened to me before testing an EA I tried to make to upload and share here which simply trades crossovers using Hull ma... but suddenly my charts were full of buy orders and i couldnt shake it thus gave up on relying on backtesting as I would get weird inconsistencies I just thought it was my incompetence lol

Re: 🧐 Is Metaquotes playing with us?

Posted: Wed Feb 12, 2025 10:54 am
by moey_dw
ionone wrote: Wed Feb 12, 2025 2:03 am this is very strange
did it happen to you ?
WTF is Metaquotes doing or is it a Mandela Effect I just witnessed ?

Jeff
THATS A TICKMILL ISSUE CAN YOU TRY IT ON ANOTHER BROKER??

Re: 🧐 Is Metaquotes playing with us?

Posted: Wed Feb 12, 2025 11:32 pm
by ionone
moey_dw wrote: Wed Feb 12, 2025 10:54 am THATS A TICKMILL ISSUE CAN YOU TRY IT ON ANOTHER BROKER??
I don't see how changing Broker will make any change to my EA, and certainly not turning a single trade EA into an averaging one

and I'm almost sure that in the past I had a winning EA that turned into a losing one.( but THIs can be a broker change alright)

Re: 🧐 Is Metaquotes playing with us?

Posted: Sun Feb 16, 2025 11:04 pm
by moey_dw
ionone wrote: Wed Feb 12, 2025 11:32 pm I don't see how changing Broker will make any change to my EA, and certainly not turning a single trade EA into an averaging one

and I'm almost sure that in the past I had a winning EA that turned into a losing one.( but THIs can be a broker change alright)
Did you test on a different broker yet?? Or nah........

Re: 🧐 Is Metaquotes playing with us?

Posted: Tue Feb 18, 2025 3:48 am
by ionone
moey_dw wrote: Sun Feb 16, 2025 11:04 pm Did you test on a different broker yet?? Or nah........
I wasn't able to make the file go "Averaging YEAH!" again...lol
but i'm 200% sure it's not the broker, the code wouldn't change like that

Re: 🧐 Is Metaquotes playing with us?

Posted: Thu Feb 20, 2025 12:47 am
by boytoy
ionone wrote: Tue Feb 18, 2025 3:48 am I wasn't able to make the file go "Averaging YEAH!" again...lol
but i'm 200% sure it's not the broker, the code wouldn't change like that
If t's not the brokers data what's causing the EA to be so disobedient in backtesting? Worrying thought tbh...

Re: 🧐 Is Metaquotes playing with us?

Posted: Thu Feb 27, 2025 8:57 pm
by ionone
OK so it happened again just right now

So I got to bed yesterday and just before, I ran a quick backtest
I like to leave the equity curve on scrreen that way I know what I did the day before, right when I wake up

I went to sleep then woke up, the equity curve was still on the screen as a reminder
and I remembered right away the EA I had backtested

but then I wanted to test for a longer period, so I ran the backtest again

and the result was totally different, ONCE AGAIN


I tried everything, I analysed the logs
I reverted back the code step by step, etc

the settings in the logs and on my MT4 were the same of course. At least I could check that

and from the logs I noticed that the entries were *exactly* the same, so they're not playing with the entries,
but what differs is the trailing stop :

See, in my coding I have different trailing stops depending on the profit

so my code is something like that :
if (ProfitsBuys() + ProfitsSells() < -10000)
{
Ts = 150;
}
else
{
Ts = 2;
}

yes i know it's not scallable but it's just to try stuff, it's quic;ker.
and yes maybe it's a dumb idea, I just try stuff ok ? smooches

so I analysed the code and at the beginning i have exactly the same results as the logs.

but then later, the EA switches to "big Ts" when before it used "small Ts" (because the equity was way below the balance)

so it means the profit calculation changed somethow.

so : entries are the same, but it's the calculation of the equity curves that differs.

I don't know what to make of it
the thing is I touched nothing, I changed nothing I just went to bed, and woke up and ran the test again.

I think i'll record everything from now on, with screenshots or even videos if necessary.
I don't like to not be able to trust a backtesting tool. that's messed up.

EDIT : also guys i'm not going crazy ok ? lol :kisses:
EDIT2 : also it was from another MT4 than before (I have several folders with MT4 installed)
Jeff