Backtesting difference depending on a live or demo account, same broker

 

Hi,

I have an odd problem. I am developing an EA and doing a lot of backtesting. I have two accounts by Tadawulfx. One demo account and one live account. I did som backtesting on my demo account using a history file I created from DukasCopy. The problem is that when I transfer the best result from my demo backtesting and run the backtest on my live account I get two different results, even though the history file is the same. I have located the difference to the ArrayCopyRates function.

I guess my question is, when backtesting does ArrayCopyRates use data from the history file (it seems not to) or does it fetch data from the server (that could explain the difference when testing on either live or demo). If the latter is the answer then whatfore do we need the history file.

Best regards,

Canman888

 
Canman888:

I have an odd problem. I am developing an EA and doing a lot of backtesting. I have two accounts by Tadawulfx. One demo account and one live account. I did som backtesting on my demo account using a history file I created from DukasCopy. The problem is that when I transfer the best result from my demo backtesting and run the backtest on my live account I get two different results, even though the history file is the same. I have located the difference to the ArrayCopyRates function.

The difference is likely to be with the market properties the Tester is using (spread, swap, etc.). It takes these properties from the currently connected to account.
 
gordon:
The difference is likely to be with the market properties the Tester is using (spread, swap, etc.). It takes these properties from the currently connected to account.

Nope, because as I said, the history file is the same so there are no difference on the data being tested. It is very easy to test this problem. You have to have a demo account and a live account. The just compare ArrayCopyRates in the backtester and you will see that there's a difference.
 
Well gordon have alot of experience with mt4; therefore I'm putting my money on his answer. I've seen enough of these post and had the same problem with the same data/time/broker/demo account/fixed spread. You on the other hand have Live vs Demo/DukasCopy vs Broker data/Variable Spreads vs Historical Spreads. Anyone who spent a week on this forum would have seen that coming :)
 
Canman888:

Nope, because as I said, the history file is the same so there are no difference on the data being tested. It is very easy to test this problem. You have to have a demo account and a live account. The just compare ArrayCopyRates in the backtester and you will see that there's a difference.

Market info such as spread and swap rates are not stored in the hst files. This info is stored in a seperate file. (symbols.raw)
 
Canman888:

Nope, because as I said, the history file is the same [...]
In '\mt4\history\' folder each account/server has it's own folder where it's *.hst files are stored... Did u copy identical files to both folders belonging to the Demo and Live accounts?
Reason: