Bid and Ask in backtest

 

Seems to be the same. Is this generally the case ?

Also MqlRates spread == 0.

 

Is this normal ?

Thank you 

 
chinaski: Seems to be the same. Is this generally the case ?

Also MqlRates spread == 0.  Is this normal ?

No, that is not normal! Is it MT4 or MT5?

On MT4, the spread is fixed and set by the user in the options of the Strategy Tester, which assumes the current spread by default. There was one build of MT4 some time back that had a bug that caused the spread to be 0.0, so what build are you using?

On MT5, the spread is variable and set by the broker's data, so it can only be explained if the is data corrupted or the broker is not providing spread data for some reason.

There could also be something wrong in your code!
 
Fernando Carreiro:
No, that is not normal! Is it MT4 or MT5?

On MT4, the spread is fixed and set by the user in to options of the Strategy Tester, which assumes the current spread by default. There was one build of MT4 some time back that had a bug that caused the spread to be 0.0, so what build are you using.

On MT5, the spread is variable and set by the broker's data, so it can only be explained if the is data corrupted or the broker is not providing spread data for some reason.

There could also be something wrong in your code!
Hello, thank you for answer. It is MT4.
 
chinaski: Hello, thank you for answer. It is MT4.
And what build is it as I asked?
 
chinaski:
Hello, thank you for answer. It is MT4.
Sorry, forgot to say: The backtest spread is set to current. The symbol is EURUSD.
 
chinaski: Sorry, forgot to say: The backtest spread is set to current. The symbol is EURUSD.
Again, WHAT build of MT4 is it?
 
Fernando Carreiro:
Again, WHAT build of MT4 is it?
Build 1045
 
chinaski: Build 1045
Although that is the current version, the are some bugs and issues with that build. However, that particular problem has not yet been reported by anyone else so far. I myself, am still using build 1031 because of those reasons.

Can you try reverting back to 1031 or maybe downloading the most recent beta versions from the MetaQuotes demo servers to see if the problem persists?

Alternatively, can you show the part of the code that you are using to test this issue to see if it is not perhaps a coding problem instead?
 

How could MqlRates retrieving 0 be  a coding problem ?

How to revert t 1031. My broker (ActiveTrades) did the update.

The latest beta is something i could try.

 

Thank you  for answers. 

 

Okay, your question may makes sense. Another question: When the rates provide a close, open, time, but NOT a spread.

Could it still be a coding problem ? 

 
chinaski: Okay, your question may makes sense. Another question: When the rates provide a close, open, time, but NOT a spread. Could it still be a coding problem? 
In MT4 MqlRates ALWAYS has a spread of 0, only MqlTick has a valid spread. Only in MT5 can MqlRates have a valid spread (assuming the MqlRates data was properly collected).

Sorry, for not noticing that at the very beginning, because you did in fact mention MqlRates in your initial post, but since I was assuming that it was on MT5 I did not immediately remember that fact.
Reason: