Backtesting/demo testing different behavior
-
Hello all,
I have been working on a complicated EA that works on Gold.
Once it became flawless (by revising all the log files in backtesting, the numbers, different scenarios), I launched it on a Demo account.
To my surprise, it is making mistakes when it comes to Demo testing.
For example, it skips opening some trades, and it opens trades that is not indicated in the right Fxdreema project pathway.
I would like to stress again that the EA never behaves like this in backtesting log files.
Is it normal to see this, because if it is, this renders the Fxdreema code useless.
Thank you!
-
I would like also to add that, it does not do the same thing each time.
For example, the EA is supposed to open two different trades once initiated.
One time it does so, and another time it only opens one of the two trades.
-
Many reasons.
MT4 or MT5?
Backtest mode in ticks or any timeframe ?
PC has any speed problem or connection problem. ?
Is your broker reliable ?
Using any repainting inidicator ?
How often you open and close trades ? -
MT5
Backtesting on "ticks based on real ticks" / strategy depends on price
PC is working fine (I use it along with my VPS for years without these issues)
I use the same broker for years
Strategy depends on price
Trades are opened/closed every few hours -
My issue is that the code does not simply follow the pathway designed in the Fxdreema project
It goes through wrong pathways and execute their actions.
And this never happens while testing.
And it keeps happening again and again, not just a one-time thing. -
@Rafik If your demo account is using the same data as the one for backtesting (ie you didn't backtest Dukascopy data to run the bot on IC MArkets, for example), then the problem is the conditions the broker is using on demo/real markets. They can be different from those on backtest. Yes, that can happen and is not unusual, sadly.
-
@l-andorrà Thanks so much for your response. Yes, I am using the same data.
Moreover, I do not believe that the issue is with the broker but in the bot.
I have made alerts for each action that it takes, and it gives me actions/alerts as if it has gone through a different pathway.
It is like the code itself is faulty, or not viable when it comes to demo/live testing.Do you have more insights regarding this for I have put so much effort in it, and it contains over 1100 blocks with so much calculations and scenarios, and it is frustrating to see so much work going in vain?
Thanks in advance!
-
Do you use terminal variables in the EA?
-
@Lacone
Yes, I use constants and variables in the MT5 Fxdreema project. -
I mean the terminal variables (global variables).
If handled incorrectly, these can read in incorrect values, in Live Trading.
The Bucket of Positions blocks also didn't work properly for me on MT5, in my opinion. -
@Rafik Man, if your project is having more than 1100 blocks the problem is definitely on the bot!! I regret to inform you that more than probably there are a few blocks with corrupt code. Probably you copied and pasted many blocks during the construction of the bot. Sadly, from time to time that copy-paste process corrupts code in fxDreema, and the bigger the project the higher the chances for that to happen, I'm afraid

My only recommendation here is rebuidling the project from scratch and copy-pasting only when strictly necessary. If you do it, DO NOT copy blocks from the current bot. Just begin a new one.
I know, that is frustrating, but you will save a lot of time doing that than trying to find the corrput block. Sorry for the bad news.
-
@l-andorrà thanks, my dear for the advice.
I will redo the expert without copy-pasting any block, and watch for the results.
I will try that and tell you, hopefully, the good news.Have a nice day!
-
@Lacone Yes, dear. I use terminal values.
I might try to embed them in the code instead and see the results.
Thank you!
-
@Rafik You're welcome.