_Digits reports a 3 but is not accepting 3 digit prices when attempting to order (XAUSD on mql demo server)
- When MetaTrader 5 Web Terminal is indispensable
- Built-in analytics in MetaTrader 5
- Subscribe to a trade signal straight from MetaTrader 5
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.
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);
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 ?
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.
You didn't answer my question.
it seems to be a bug in mt5 newest build, I shall report it.
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
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.
I suppose something like:
SymTicSize=SymbolInfoDouble(_Symbol,SYMBOL_TRADE_TICK_SIZE); priceinticks=NormalizeDouble(notnormalprice/SymTicSize,0); normalprice=priceinticks*SymTicSize;

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use