mqh function not defined

 

Hello

I'm missing something which I cannot see easily on google.  Maybe I'm missing the point of header use.

I'm getting

'RefreshRates' - function not defined


when I compile a .mqh file.

The same applies for loads of other functions I'm trying to use in a header file.

How can I fix this?

 

I had a similar problem in the past when compiling .mqh files.

The compiler seemed to apply the rules for MQL5 not MQL4. In your case, RefreshRates() is not available in MQL5 (AFAIK SymbolInfoTick() negates the need for it).

I never actually solved the problem in the end. Hopefully someone else will be along shortly with an explanation/solution. Failing that, Service Desk. 

 
honest_knave:

I had a similar problem in the past when compiling .mqh files.

The compiler seemed to apply the rules for MQL5 not MQL4. In your case, RefreshRates() is not available in MQL5 (AFAIK SymbolInfoTick() negates the need for it).

I never actually solved the problem in the end. Hopefully someone else will be along shortly with an explanation/solution. Failing that, Service Desk. 

Thanks. Hoping someone can tell me I'm wrong in thinking this is a deliberate attempt to force devs to move to mql5.  Been there, went back to 4. 


 
strontiumDog: 'RefreshRates' - function not defined when I compile a .mqh file.
Don't compile mqh files. Compile the mq4 file that includes the mqh.
 
Thanks WHRoeder, that was it.
Reason: