_Digits reports a 3 but is not accepting 3 digit prices when attempting to order (XAUSD on mql demo server)

 
Is this true for everyone else or did I mess up my mt5 by connecting to other brokers?
 
bendex77:
Is this true for everyone else or did I mess up my mt5 by connecting to other brokers?

Nothing to do with connecting to other brokers. What is 'mql demo server' ? Metaquotes demo server ?

Please show your code.

 
angevoyageur:

Nothing to do with connecting to other brokers. What is 'mql demo server' ? Metaquotes demo server ?

Please show your code.

it was working fine for a year then stopped working on gold. For instance, this works on all majors but not gold:

request.price=NormalizeDouble(CalcHigh-step+spread+cushion,_Digits);  

for gold only this works:

request.price=NormalizeDouble(CalcHigh-step+spread+cushion,2); 

in gold, _Digits is 3 but either of these gives invalid price:

request.price=NormalizeDouble(CalcHigh-step+spread+cushion,_Digits);  

request.price=NormalizeDouble(CalcHigh-step+spread+cushion,3);   

 
bendex77:

it was working fine for a year then stopped working on gold. For instance, this works on all majors but not gold:

request.price=NormalizeDouble(CalcHigh-step+spread+cushion,_Digits);  

for gold only this works:

request.price=NormalizeDouble(CalcHigh-step+spread+cushion,2); 

in gold, _Digits is 3 but either of these gives invalid price:

request.price=NormalizeDouble(CalcHigh-step+spread+cushion,_Digits);  

request.price=NormalizeDouble(CalcHigh-step+spread+cushion,3);   

You didn't answer my question.

What is 'mql demo server' ? Metaquotes demo server ?

 
bendex77:

it was working fine for a year then stopped working on gold. For instance, this works on all majors but not gold:

request.price=NormalizeDouble(CalcHigh-step+spread+cushion,_Digits);  

for gold only this works:

request.price=NormalizeDouble(CalcHigh-step+spread+cushion,2); 

in gold, _Digits is 3 but either of these gives invalid price:

request.price=NormalizeDouble(CalcHigh-step+spread+cushion,_Digits);  

request.price=NormalizeDouble(CalcHigh-step+spread+cushion,3);   

Anyway your price is not well normalized. It only works if a point (digits) is the same as ticksize.

You should use ticksize to normalize your price.

 
angevoyageur:

You didn't answer my question.

sry yes metaquotes demo server.
 
bendex77:
it seems to be a bug in mt5 newest build, I shall report it.
Is it worth to answer you ? There is no bug in MT5, it's a bug in your code.
 
angevoyageur:

Anyway your price is not well normalized. It only works if a point (digits) is the same as ticksize.

You should use ticksize to normalize your price.

oh no! I must have missed that memo.

Thank you ange

 
angevoyageur:
Is it worth to answer you ? There is no bug in MT5, it's a bug in your code.
You're help is much appreciated, I'm just a bit slow to refresh/read my page.
 
bendex77:
You're help is much appreciated, I'm just a bit slow to refresh/read my page.
No worries. It can happen.
 

I suppose something like:

SymTicSize=SymbolInfoDouble(_Symbol,SYMBOL_TRADE_TICK_SIZE);
priceinticks=NormalizeDouble(notnormalprice/SymTicSize,0);
normalprice=priceinticks*SymTicSize;

 
Reason: