SymbolInfoInteger doesn't work - page 2

 
I guess he was referring to this https://www.mql5.com/en/docs/series/timeseries_access section (???)
Documentation on MQL5: Timeseries and Indicators Access / Organizing Data Access
Documentation on MQL5: Timeseries and Indicators Access / Organizing Data Access
  • www.mql5.com
Before price data become available in the MetaTrader 5 terminal, they must be received and processed. To receive data, connection to the MetaTrader 5 trade server must be established. Data are received in the form of packed blocks of minute bars from the server upon the request of a terminal. The mechanism of server reference for data doesn't...
 
Chris70:
I guess he was referring to this https://www.mql5.com/en/docs/series/timeseries_access section (???)

Unless I miss something, it's not stated anywhere in this page that SymbolSelect() is not "updated immediately". We are talking here about symbol's properties, not about timeseries.

 
rbigdelis:

Thanks, when I run modified code as you recommended, I get different results at different times.

Sometimes for symbols with empty historySymbolInfoInteger returns true but returned time is zero that means no data is available.

And sometimes for symbols with non-empty history,  SymbolInfoInteger returns true and returned time is zero that means no data is available!!!.

I think SymbolSelect has a bug that doesn't updates MarketWatch immediately, so calling functions like SymbolInfoInteger or SymbolInfoTick after SymbolSelect doesn't return correct result(s).

In my first reply, I didn't look carefully what you were doing. There is no bug actually, only your expectation is wrong, symbol's values are not the same as history data.

You just select a symbol and you request "last quote" time, but there is not tick yet, it's not an historical data which could be available, it's a "live" data, so you need to wait a tick for this symbol's property to be set. (same reasoning for a tick with SymbolInfoTick).

If you request some "fixed" symbol's properties (like Digits) there is no problem and the value is immediately available.

There are plenty of functions to know if and what timeseries data are available. See documentation and provided links.

Reason: