Why is the spread shown in the "data window" completely nonsense?

 

I opened different demo accounts with different brokers, but it is always wrong.

While the "market watch" and the Expert advisor always show the correct spread, instead in the "data window" the spread is always or slightly off ( 2 - 3 points) or completely off ( like in the picture)

Why is that? it depends on the broker or what?

(ps.. the mouse cursor was on the very last candle)


Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Account Properties
Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Account Properties
  • www.mql5.com
Account Properties - Environment State - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
trevor88:

I opened different demo accounts with different brokers, but it is always wrong.

While the "market watch" and the Expert advisor always show the correct spread, instead in the "data window" the spread is always or slightly off ( 2 - 3 points) or completely off ( like in the picture)

Why is that? it depends on the broker or what?



The market watch displays the current real-time information, which changes quickly.

The data window reflects the information for the price candle where you mouse cursor points to - move your mouse and the values change.

In terms of spreads the data window most probably displays just an average or rounded value. Either way, it has nothing to do with the current market spread seen in the market watch.

 
Daniel Stein #:

The market watch displays the current real-time information, which changes quickly.

The data window reflects the information for the price candle where you mouse cursor points to - move your mouse and the values change.

In terms of spreads the data window most probably displays just an average or rounded value. Either way, it has nothing to do with the current market spread seen in the market watch.

Thanks for you answer...

of course the mouse cursor was on the very last candle when i took the picture...

I also tought of an "average" value, but it is not... I was just curious to know what it is

 
trevor88 #: Thanks for you answer... of course the mouse cursor was on the very last candle when i took the picture... I also tought of an "average" value, but it is not... I was just curious to know what it is

The "spread" displayed in the Data Window is a spread for the whole bar (not the current spread). MetaQuotes has never really explained how this is calculated.

For some time, traders speculated that it might be the "average" but some testing done by @Alain Verleyen seemed to indicate that it might in fact be the minimum spread instead.

Forum on trading, automated trading systems and testing trading strategies

Can broker deny access to server's historic time-series/spread info?

Alain Verleyen, 2018.07.04 09:44

Not at all. It's an MT5 feature, not available with MT4. The broker can't nothing about that. The only problem is it's not well documented, so people are trying to use it with MT4.

Under MT5, the spread value of MqlRates is the minimum spread of this bar. On Metaquotes world, the spread is always related to Ask-Bid, never to high-low or whatever.

Forum on trading, automated trading systems and testing trading strategies

Spread values of bars ?

Alain Verleyen, 2018.07.19 09:58

That's incorrect information.

Actually it was the maximum in the past, but changed to minimum, I don't remember when.
 
Fernando Carreiro #:

The "spread" displayed in the Data Window is a spread for the whole bar (not the current spread). MetaQuotes has never really explained how this is calculated.

For some time, traders speculated that it might be the "average" but some testing done by @Alain Verleyen seemed to indicate that it might in fact be the minimum spread instead.

Oh now I see.... Thanks for the clarification

 
The spread into the data window is not an average.
It's the lowest value had within the bar.