Mt4 backtest results different from mt5 - same data

 
Hi all,

I created the exact same EA for both mt4 and mt5 and have different results, not very dramatic, but off by thousands on a long look back.  I'm using supposedly the exact same data from tickstory in which I matched both timezones and dst.  The EA uses open prices only and the settings are as such in mt4/mt5. 

Please assume the there's no problem with the code as I'm POSITIVE there isn't.  I'm curious if anyone might have an answer to this.

Thank you,
Jade 
 
jaderogwin: I created the exact same EA for both mt4 and mt5 and have different results, not very dramatic, but off by thousands on a long look back.  I'm using supposedly the exact same data from tickstory in which I matched both timezones and dst.  The EA uses open prices only and the settings are as such in mt4/mt5. Please assume the there's no problem with the code as I'm POSITIVE there isn't.  I'm curious if anyone might have an answer to this.

MT4 Strategy tester uses fixed spread, with zero delay. You will have to recreate the exact same conditions on MT5 Strategy Tester, including the contract specifications for swaps and commission too.

Apart from that it will not be very plausible to assume that your code is not the cause, because it usually is.

I say this from experience because I too code for both MQL4 and MQL5, and test on both with tick data from DukasCopy (which is the data that TickStory uses).

 
Fernando Carreiro #:

MT4 Strategy tester uses fixed spread, with zero delay. You will have to recreate the exact same conditions on MT5 Strategy Tester, including the contract specifications for swaps and commission too.

Apart from that it will not be very plausible to assume that your code is not the cause, because it usually is.

I say this from experience because I too code for both MQL4 and MQL5, and test on both with tick data from DukasCopy (which is the data that TickStory uses).

Thanks for the tip on contract specifications. il recheck this when I can and consider spreads as well, although I believe those should be the same
 
jaderogwin #: Thanks for the tip on contract specifications. il recheck this when I can and consider spreads as well, although I believe those should be the same

I can almost guarantee that Spreads are not the same, because MT5 uses floating spread, and setting a fixed spread in the tester's contract specification has no effect when using "real tick data".

You can only adjust to a fixed spread when using the virtual ticks generated by MT5 Tester, not when using real ticks.

To overcome this, you would have to generate the Custom Symbol with a fixed spread in the actual tick data used for the Custom Symbol.

 
Fernando Carreiro #:

I can almost guarantee that Spreads are not the same, because MT5 uses floating spread, and setting a fixed spread in the tester's contract specification has no effect when using "real tick data".

You can only adjust to a fixed spread when using the virtual ticks generated by MT5 Tester, not when using real ticks.

To overcome this, you would have to generate the Custom Symbol with a fixed spread in the actual tick data used for the Custom Symbol.

I understand what your saying, but wouldn't this not be applicable if I'm using "open prices only"?
 
jaderogwin #: I understand what your saying, but wouldn't this not be applicable if I'm using "open prices only"?

Yes, you are theoretically correct that only using open prices, then a fixed spread should work.

However, just a warning that you should be somewhat wary of — It has happened to be me on several occasions, that for some unknown reason, the spread sometimes floats a few bars and then returns to the fixed value. I've never been able to figure out why or when this happens. It just does, so it is probably a bug, but it's inconsistent and have yet to be able to properly replicated it every time so as to report it as a bug.

Maybe this "bug" will not happen to you as you seem to be testing against a Custom Symbol of data imported from TickStory. But to be on the safe side, include some code in your EA to monitor the spread and output a message to the log when it is not what it is supposed to be.

 
Fernando Carreiro #:

Yes, you are theoretically correct that only using open prices, then a fixed spread should work.

However, just a warning that you should be somewhat wary of — It has happened to be me on several occasions, that for some unknown reason, the spread sometimes floats a few bars and then returns to the fixed value. I've never been able to figure out why or when this happens. It just does, so it is probably a bug, but it's inconsistent and have yet to be able to properly replicated it every time so as to report it as a bug.

Maybe this "bug" will not happen to you as you seem to be testing against a Custom Symbol of data imported from TickStory. But to be on the safe side, include some code in your EA to monitor the spread and output a message to the log when it is not what it is supposed to be.

I just got home and started playing around. I realized that regardless of what the spread is set to in mt5 symbol properties, I still get the same results. It appears that when you make a custom symbol it must be set to "floating", but if there's no spread in the csv from dukascopy, where is it pulling the values from. I'm very confused
 
jaderogwin #: I just got home and started playing around. I realized that regardless of what the spread is set to in mt5 symbol properties, I still get the same results. It appears that when you make a custom symbol it must be set to "floating", but if there's no spread in the csv from dukascopy, where is it pulling the values from. I'm very confused

No, as I mentioned in a previous post here to you, if you want your Custom Symbol to have a fixed spread, you have to feed it tick data that has a fixed spread.

The CSV data generated by TickStory with Dukascopy tick data, has a floating spread. In other words it has both a Bid and a Ask price quote that float. You will have to edit the CSV so as to have a fixed spread instead. You will have to change the Ask prices so that the difference between Ask and Bid is always fixed.