How to calculate if we are under 4 or 5 digit broker
- Remember it's 4/5 except on JPY pairs (2/3)
What is a TICK? - MQL4 and MetaTrader 4 - MQL4 programming forum - There is also the predefined _Digits
whroeder1:
- Remember it's 4/5 except on JPY pairs (2/3)
What is a TICK? - MQL4 and MetaTrader 4 - MQL4 programming forum - There is also the predefined _Digits
Thanks for the response. (I was asking/looking for some kind of BrokerInfo or AccountInfo function).
To avoid headaches in calculations I'm thinking about implementing some control like this in all my programs:
int onInit() { int digits = (int) MarketInfo("EURUSD", MODE_DIGITS); if (digits == 4) { Alert("Program not prepared for 2/4 digit brokers. Try to migrate to a 3/5 broker!"); return -1; } //... normal program execution }
Is there a better ‘formula’ in MQL4 to know if the EA is executing on a 4 digit broker or in a 5 digit broker?