Certain Currency pairs display values to 5 decimal places (EURUSD), others 4 and so on. I wrote the code below to return the integer value of the decimal places minus one. This function just takes into consideration a few pairs. I would like to expand it to cater for all pairs. How can I find the number of decimal places for each Symbol() price?
int decimalPlacesForPairs() {
if ((_Symbol == "XAUUSD") || (_Symbol == "USOIL")) {
return 1;
}
else if (_Symbol == "CADJPY") {
return 2;
}
else return 3;
}