Isnt an explicit call to MarketInfo("EURUSD",MODE_DIGITS); pointless?

 

I was looking through the code for an EA and saw this line:

int digits=MarketInfo("EURUSD",MODE_DIGITS);

I researched this and found out there is a predefined variable 'Digits' that already has this. So isnt this line of code pointless?

 
princepawn:

I was looking through the code for an EA and saw this line:

I researched this and found out there is a predefined variable 'Digits' that already has this. So isnt this line of code pointless?

Not if your code is running on a USDJPY chart.
 
princepawn:

I was looking through the code for an EA and saw this line:

int digits=MarketInfo("EURUSD",MODE_DIGITS);

I researched this and found out there is a predefined variable 'Digits' that already has this. So isnt this line of code pointless?

The predefined variable called Digits holds the "number of digits after decimal point for the current symbol prices."  But what if your EA is running on a EURUSD chart and needs to know the number of digits after the decimal point for the EURJPY?  To achieve that, you can use MarketInfo() to get the number of digits for EURJPY.
Reason: