double MarketInfo(symbol,MODE_POINT) problem, returns value of 0

 

Hi

Would like help regarding the above.

I was writing an EA when I encountered error with ordermodification due to invalid stops. I noted i was using MarketInfo("EURUSD",MODE_POINT) for the code. As this is my first time using it, i tested with an EA:

int start()

{double point = MarketInfo("EURUSD",MODE_POINT);

Alert(point);

return(0);

}

It keeps alerting 0, although i would expect the value of "0.00001". I tested with just double point = POINT too and the result is the same. Can anyone tell me why?

 

try

double point = MarketInfo(Symbol(),MODE_POINT);

and if that works check that your broker doesn't add additional letters onto the symbol name.

V

 
If your broker has 5 digits prices, use DoubleToStr(point,5) to print proper number.
 
Roger:
If your broker has 5 digits prices, use DoubleToStr(point,5) to print proper number.

Thanks, that worked
 
DoubleToStr(point,Digits)

And then you don't have to care/worry about how many decimals your broker uses for the given currency pair.