BUG in MODE_TICKSIZE and MODE_POINT

 

When useing the MarketInfo(Symbol(),MODE_TICKSIZE); or MarketInfo(Symbol(),MODE_POINT); They both return 0 when used on a 5 digit broker.

So if you use a broker with 5 digits after the decimal like on the euro 1.12345, it will return 0 instead of the correct return of 0.00001

You can work around it because you only ever get a 0 on 5 digits.

I though everyone should know, because you can waste an hour debugging like I just have, without suspecting MetaTrader as the problem.

 

you have only found a bug in your approach to MQL4 builtin interface documentation.

is not BUG at all...

Suggest you re-read Print()

2009.01.24 09:11:30 quickies EURCHF,H1: MarketInfo(EURCHFMODE_TICKSIZE)=0.00001000, MarketInfo(EURCHFMODE_POINT)=0.00001000
2009.01.24 09:11:30 quickies EURCHF,H1: MarketInfo(EURCHFMODE_TICKSIZE)=0, MarketInfo(EURCHFMODE_POINT)=0
2009.01.24 09:11:30 quickies EURCHF,H1: MarketInfo(AUDJPYMODE_TICKSIZE)=0.001, MarketInfo(AUDJPYMODE_POINT)=0.001

 

Well that might be what you get but please read what I get. Exactly what I said in post one. So is this a Broker specific problem then? What broker was your log from? Mine from FXPro.com. I see the second line of your log also returns a 0 how did the first line not?

See:

USDJPY works just fine (Digits = 3)

2009.01.25 00:12:53 testing USDJPY,H1: MarketInfo(Symbol(), MODE_TICKSIZE) 0.001

As I said on EURUSD with 5 digits it fails and returns a 0

2009.01.25 00:14:55 testing EURUSD,H1: MarketInfo(Symbol(), MODE_TICKSIZE) 0

Same with GBPUSD which is also 5 digits, returns a 0:

2009.01.25 00:15:49 testing GBPUSD,H1: MarketInfo(Symbol(), MODE_TICKSIZE) 0

See USDSGD which is 4 digits works just fine:

2009.01.25 00:16:47 testing USDSGD,H1: MarketInfo(Symbol(), MODE_TICKSIZE) 0.0001

So as I said, when it gets above 4 digits it falls over and returns a 0.

 

Not bug.

Is issue of appreciating what Print() is doing - until Print() interface totally understood and it's relationship with type double then your o/p will continue to give you ZERO.

DoubleToStr()

 
quantem:

Well that might be what you get but please read what I get. Exactly what I said in post one. So is this a Broker specific problem then? What broker was your log from? Mine from FXPro.com. I see the second line of your log also returns a 0 how did the first line not?

See:

USDJPY works just fine (Digits = 3)

2009.01.25 00:12:53 testing USDJPY,H1: MarketInfo(Symbol(), MODE_TICKSIZE) 0.001

As I said on EURUSD with 5 digits it fails and returns a 0

2009.01.25 00:14:55 testing EURUSD,H1: MarketInfo(Symbol(), MODE_TICKSIZE) 0

Same with GBPUSD which is also 5 digits, returns a 0:

2009.01.25 00:15:49 testing GBPUSD,H1: MarketInfo(Symbol(), MODE_TICKSIZE) 0

See USDSGD which is 4 digits works just fine:

2009.01.25 00:16:47 testing USDSGD,H1: MarketInfo(Symbol(), MODE_TICKSIZE) 0.0001

So as I said, when it gets above 4 digits it falls over and returns a 0.

quantem, the info fbj gave you was correct. The simple answer is (and why fbj said to look at the Print docs) is that Print only prints to 4 decimals. It doesn't mean the value is lost, it just is rounded in the Print display, and 0.00001 rounded to 4 digits is 0. The value is still there, though, which is also why fbj linked you to the DoubleToStr function, use that with precision of 5 and you'll be able to see it Print(DoubleToStr(MarketInfo(Symbol(),MODE_POINT),5))

Reason: