Should Bid always be preceded by RefreshRates() ?

 

Hi,

This simple routine gives me an output of the latest tick every 5 seconds.  But I've found that if I don't use RefreshRates() before Bid, the routine just repeats the first value received.  Is this the right way to ensure that I get a new value every time Bid is accessed?


for (n = 1; n <= 10; n++)

    {
      RefreshRates();
      Alert(Bid);
      Sleep(5000);     
    }  

    

Thanks,

Steve.

 

what about

MarketInfo(Symbol(), MODE_BID)

?

 
Yep, that works thanks.  Is that better than doing RefreshRates() then?
 

It amounts to the same thing

 
Ok thanks.
 
SteveDavies:  Is this the right way to ensure that I get a new value every time Bid is accessed?
You must RefreshRates before using any predefined variables after sleep and all server calls (OrderSend, modify, delete.)
 
Thanks for that WHRoeder.  That answers it.
 
WHRoeder:
SteveDavies:  Is this the right way to ensure that I get a new value every time Bid is accessed?
You must RefreshRates before using any predefined variables after sleep and all server calls (OrderSend, modify, delete.)

So refreshRates is still applicable even with mt4 build 600+
 
Now you got me curious. What makes you think it is not?
Reason: