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

 
bendex77:

I suppose something like:

Exactly something like that.
 
angevoyageur:
Exactly something like that.

//.................................
               double priceinticks=NormalizeDouble(tick.ask/SymTicSize,0);
               request.price  = priceinticks*SymTicSize;
//................................

This worked for normalizing tp and sl and entries but when I try and instant buy or instant sell to force close a position I get this:

2015.02.25 18:46:05 Core 1 2012.04.23 15:20:31   take profit triggered sell 0.51 XAUUSD 1639.150 sl: 1631.480 tp: 1625.630 [#46 buy 0.51 XAUUSD at 1625.630]

2015.02.25 18:46:05 Core 1 2012.04.23 15:20:31   [Sell] ERROR closing #4756

2015.02.25 18:46:05 Core 1 2012.04.23 15:20:31   price corrected from 1625.650 to 1625.654, deviation: 99 (instant buy 0.51 XAUUSD at 1625.650)(1624.854 / 1625.654 / 1624.854)

2015.02.25 18:46:05 Core 1 2012.04.23 15:20:30   [Sell] ERROR closing #4756

2015.02.25 18:46:05 Core 1 2012.04.23 15:20:30   price corrected from 1625.650 to 1625.652, deviation: 99 (instant buy 0.51 XAUUSD at 1625.650)(1624.852 / 1625.652 / 1624.852)

2015.02.25 18:46:05 Core 1 2012.04.23 15:20:30   [Sell] ERROR closing #4756

2015.02.25 18:46:05 Core 1 2012.04.23 15:20:30   price corrected from 1625.650 to 1625.653, deviation: 99 (instant buy 0.51 XAUUSD at 1625.650)(1624.853 / 1625.653 / 1624.853)

2015.02.25 18:46:05 Core 1 2012.04.23 15:20:29   [Sell] ERROR closing #4756

2015.02.25 18:46:05 Core 1 2012.04.23 15:20:29   price corrected from 1625.650 to 1625.652, deviation: 99 (instant buy 0.51 XAUUSD at 1625.650)(1624.852 / 1625.652 / 1624.852)

2015.02.25 18:46:05 Core 1 2012.04.23 15:20:28   [Sell] ERROR closing #4756

2015.02.25 18:46:05 Core 1 2012.04.23 15:20:28   price corrected from 1625.650 to 1625.653, deviation: 99 (instant buy 0.51 XAUUSD at 1625.650)(1624.853 / 1625.653 / 1624.853)

2015.02.25 18:46:05 Core 1 2012.04.23 15:20:28   [Sell] ERROR closing #4756

2015.02.25 18:46:05 Core 1 2012.04.23 15:20:28   price corrected from 1625.650 to 1625.652, deviation: 99 (instant buy 0.51 XAUUSD at 1625.650)(1624.852 / 1625.652 / 1624.852)

2015.02.25 18:46:05 Core 1 2012.04.23 15:20:27   [Sell] ERROR closing #4756

2015.02.25 18:46:05 Core 1 2012.04.23 15:20:27   price corrected from 1625.650 to 1625.653, deviation: 99 (instant buy 0.51 XAUUSD at 1625.650)(1624.853 / 1625.653 / 1624.853)

2015.02.25 18:46:05 Core 1 2012.04.23 15:20:26   [Sell] ERROR closing #4756

2015.02.25 18:46:05 Core 1 2012.04.23 15:20:26   price corrected from 1625.650 to 1625.652, deviation: 99 (instant buy 0.51 XAUUSD at 1625.650)(1624.852 / 1625.652 / 1624.852)

2015.02.25 18:46:05 Core 1 2012.04.23 15:20:26   [Sell] ERROR closing #4756

2015.02.25 18:46:05 Core 1 2012.04.23 15:20:26   price corrected from 1625.650 to 1625.653, deviation: 99 (instant buy 0.51 XAUUSD at 1625.650)(1624.853 / 1625.653 / 1624.853)

2015.02.25 18:46:05 Core 1 2012.04.23 15:20:25   [Sell] ERROR closing #4756

2015.02.25 18:46:05 Core 1 2012.04.23 15:20:25   price corrected from 1625.720 to 1625.719, deviation: 99 (instant buy 0.51 XAUUSD at 1625.720)(1624.919 / 1625.719 / 1624.919)

2015.02.25 18:46:05 Core 1 2012.04.23 15:20:24   [Sell] ERROR closing #4756

2015.02.25 18:46:05 Core 1 2012.04.23 15:20:24   price corrected from 1625.790 to 1625.785, deviation: 99 (instant buy 0.51 XAUUSD at 1625.790)(1624.985 / 1625.785 / 1624.985)

2015.02.25 18:46:05 Core 1 2012.04.23 15:20:24   [Sell] ERROR closing #4756

2015.02.25 18:46:05 Core 1 2012.04.23 15:20:24   price corrected from 1625.850 to 1625.851, deviation: 99 (instant buy 0.51 XAUUSD at 1625.850)(1625.051 / 1625.851 / 1625.051)

2015.02.25 18:46:05 Core 1 2012.04.23 15:20:23   [Sell] ERROR closing #4756

2015.02.25 18:46:05 Core 1 2012.04.23 15:20:23   price corrected from 1625.920 to 1625.917, deviation: 99 (instant buy 0.51 XAUUSD at 1625.920)(1625.117 / 1625.917 / 1625.117)

2015.02.25 18:46:05 Core 1 2012.04.23 15:20:22   [Sell] ERROR closing #4756

2015.02.25 18:46:05 Core 1 2012.04.23 15:20:22   price corrected from 1625.980 to 1625.983, deviation: 99 (instant buy 0.51 XAUUSD at 1625.980)(1625.183 / 1625.983 / 1625.183)

2015.02.25 18:46:05 Core 1 2012.04.23 15:20:22   [Sell] ERROR closing #4756

2015.02.25 18:46:05 Core 1 2012.04.23 15:20:22   price corrected from 1626.050 to 1626.049, deviation: 99 (instant buy 0.51 XAUUSD at 1626.050)(1625.249 / 1626.049 / 1625.249)


 

And if I try this instead:

//...............
               request.price= tick.ask
//...............

 

 I get this;:

 

2015.02.25 18:57:50 Core 1 2012.04.23 15:20:31   take profit triggered sell 0.51 XAUUSD 1639.150 sl: 1631.480 tp: 1625.630 [#46 buy 0.51 XAUUSD at 1625.630]

2015.02.25 18:57:50 Core 1 2012.04.23 15:20:31   [Sell] ERROR closing #4756

2015.02.25 18:57:50 Core 1 2012.04.23 15:20:31   failed instant buy 0.51 XAUUSD at 1625.654 [Invalid price]

2015.02.25 18:57:50 Core 1 2012.04.23 15:20:30   [Sell] ERROR closing #4756

2015.02.25 18:57:50 Core 1 2012.04.23 15:20:30   failed instant buy 0.51 XAUUSD at 1625.652 [Invalid price]

2015.02.25 18:57:50 Core 1 2012.04.23 15:20:30   [Sell] ERROR closing #4756

2015.02.25 18:57:50 Core 1 2012.04.23 15:20:30   failed instant buy 0.51 XAUUSD at 1625.653 [Invalid price]

2015.02.25 18:57:50 Core 1 2012.04.23 15:20:29   [Sell] ERROR closing #4756

2015.02.25 18:57:50 Core 1 2012.04.23 15:20:29   failed instant buy 0.51 XAUUSD at 1625.652 [Invalid price]

2015.02.25 18:57:50 Core 1 2012.04.23 15:20:28   [Sell] ERROR closing #4756

2015.02.25 18:57:50 Core 1 2012.04.23 15:20:28   failed instant buy 0.51 XAUUSD at 1625.653 [Invalid price]

2015.02.25 18:57:50 Core 1 2012.04.23 15:20:28   [Sell] ERROR closing #4756

2015.02.25 18:57:50 Core 1 2012.04.23 15:20:28   failed instant buy 0.51 XAUUSD at 1625.652 [Invalid price]

2015.02.25 18:57:50 Core 1 2012.04.23 15:20:27   [Sell] ERROR closing #4756

2015.02.25 18:57:50 Core 1 2012.04.23 15:20:27   failed instant buy 0.51 XAUUSD at 1625.653 [Invalid price]

2015.02.25 18:57:50 Core 1 2012.04.23 15:20:26   [Sell] ERROR closing #4756

2015.02.25 18:57:50 Core 1 2012.04.23 15:20:26   failed instant buy 0.51 XAUUSD at 1625.652 [Invalid price]

2015.02.25 18:57:50 Core 1 2012.04.23 15:20:26   [Sell] ERROR closing #4756

2015.02.25 18:57:50 Core 1 2012.04.23 15:20:26   failed instant buy 0.51 XAUUSD at 1625.653 [Invalid price]

2015.02.25 18:57:50 Core 1 2012.04.23 15:20:25   [Sell] ERROR closing #4756

2015.02.25 18:57:50 Core 1 2012.04.23 15:20:25   failed instant buy 0.51 XAUUSD at 1625.719 [Invalid price]

2015.02.25 18:57:50 Core 1 2012.04.23 15:20:24   [Sell] ERROR closing #4756

2015.02.25 18:57:50 Core 1 2012.04.23 15:20:24   failed instant buy 0.51 XAUUSD at 1625.785 [Invalid price]

2015.02.25 18:57:50 Core 1 2012.04.23 15:20:24   [Sell] ERROR closing #4756

2015.02.25 18:57:50 Core 1 2012.04.23 15:20:24   failed instant buy 0.51 XAUUSD at 1625.851 [Invalid price]

2015.02.25 18:57:50 Core 1 2012.04.23 15:20:23   [Sell] ERROR closing #4756

2015.02.25 18:57:50 Core 1 2012.04.23 15:20:23   failed instant buy 0.51 XAUUSD at 1625.917 [Invalid price]

2015.02.25 18:57:50 Core 1 2012.04.23 15:20:22   [Sell] ERROR closing #4756

2015.02.25 18:57:50 Core 1 2012.04.23 15:20:22   failed instant buy 0.51 XAUUSD at 1625.983 [Invalid price]

2015.02.25 18:57:50 Core 1 2012.04.23 15:20:22   [Sell] ERROR closing #4756

2015.02.25 18:57:50 Core 1 2012.04.23 15:20:22   failed instant buy 0.51 XAUUSD at 1626.049 [Invalid price]


 

What is the value of ticksize ?

What is the return code from the trade server ? (result.retcode).

 
angevoyageur:

What is the value of ticksize ?

What is the return code from the trade server ? (result.retcode).

ticsize=0.01

retcode=10015

it is interesting that it is not an actual error in the journal (there is no red marker and if I search for "errors only" in the viewer it doesn't show up) when I normalize by ticsize even though it says ERROR and the order does not complete....

 
bendex77:

ticsize=0.01

retcode=10015

it is interesting that it is not an actual error in the journal (there is no red marker and if I search for "errors only" in the viewer it doesn't show up) when I normalize by ticsize even though it says ERROR and the order does not complete....

MT5 bug ? or maybe wrong data from Metaquotes server.
 
I also get the same error when trying to use instant sell/buy for XAUUSD. Do you have any updates on how to fix the problem?
 
Alex:
I also get the same error when trying to use instant sell/buy for XAUUSD. Do you have any updates on how to fix the problem?
This is pretty annoying. I am also facing the same issue. Anyone found a solution?