Download MetaTrader 5

mqh function not defined

To add comments, please log in or register
strontiumDog
294
strontiumDog  

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?

honest_knave
Moderator
2318
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. 

strontiumDog
294
strontiumDog  
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. 


whroeder1
16105
whroeder1  
strontiumDog: 'RefreshRates' - function not defined when I compile a .mqh file.
Don't compile mqh files. Compile the mq4 file that includes the mqh.
strontiumDog
294
strontiumDog  
Thanks WHRoeder, that was it.
To add comments, please log in or register