Am I correct and fail safe this way?

 

Hi,

In the MQL4-Reference I just read in the capital of SymbolInfoDouble():

Note

It is recommended to use SymbolInfoTick() if the function is used for getting information about the last tick.
It may well be that not a single quote has appeared yet since the terminal is connected to a trading account.
In such a case, the requested value will be indefinite.

In most cases, it is enough to use SymbolInfoTick() function allowing a user to receive the values of
Ask, Bid, Last, Volume and the time of the last tick's arrival during a single call.

The following example does NOT realize this hint.

So to be save do I have to use SymbolInfoTick() before using SymbolInfoDouble(), like:

SymbolInfoTick(sym,tick);
SymbolInfoDouble(sym,SYMBOL_TRADE_TICK_VALUE);

I definitely won't like the idea of getting indefinite once and a while and accidentally!

Gooly

 

No, you have to check the return value of the function to see it you got the information or not.

 

How shall I check? It says indefinite not infinite. So I have nothing to check against it and the ticks-value varies and can be pretty high.

Beside that I assume that I might the values for another symbol? in this case it would even help to use the version of the function that returns a boolean value - it could be true but..?

Reason: