I thought I would never have such a mistake. But, as it turned out, it happened. On several DC, including Alpari, I have been working on everything for several years. Today, I decided to throw an owl on Roboforex for some reasons. It turned out that there the owl refuses to trade from the first signal. The reason is quite strange and, at the moment, remains a mystery to me.
Here’s what I see in the terminal:
2018.08.15 14:20:39.810 2016.01.06 19:25:03 __LastError = 4756
2018.08.15 14:20:39.810 2016.01.06 19:25:03 m_request.price = 173.398
2018.08.15 14:20:39.810 2016.01.06 19:25:03 failed buy stop 0.10 GBPJPY.m at 173.398 tp: 173.528 [Invalid price]
2018.08.15 14:20:39.810 2016.01.06 19:25:03 _LastError = 4756
2018.08.15 14:20:39.810 2016.01.06 19:25:03 OrdersHandling::put { order wasn't sent! m_result.retcode = '10015' | orderType = 'ORDER_TYPE_BUY_STOP' | price = '173.398' | SL = '0.000' | TP = '173.528' | ask = '173.364' | bid = '173.344' | spread = '0.020' }
2018.08.15 14:20:39.810 2016.01.06 19:25:03 OrdersHandling::put { _LastError = '4756' }
In other words, the server tells us that the reason is allegedly incorrect price, but the price is correct. I explain. Here is the section of code where the trading order is set:
if (!sent) {
Print("__LastError = ", _LastError);
Print("m_request.price = ", dToS(m_request.price));
sent = OrderSend(m_request, m_result);
Print("_LastError = ", _LastError);
Sleep(250); cnt++; continue;
}
At the time of installation, we have the following data:
Opening price of a pending order of the BUY_STOP type = 173.398
Ask = 173,364
spread = 0,020
It turns out that from the price of setting a stop long order to Ask there is a margin = 173.398-173.364 = 0.034
The StopLevel and frizzlevel checks have been completed up to this point. What is stopping him then at all?
By the way, all my prices are normalized both by tick and by the number of decimal places of the symbol price. Accordingly, I showed the incoming price from the journal.
hoz
In General, I have this question decided on the same day when I came across it. There was a kasyak in the class that is responsible for implementing trade orders, checks, and so on related to this. Not correct was realizovan unit test for StopLevel. On Alpari, stopLevel= 0, so I didn’t come across it. And on the Rob on GBPJPY, it seems to be 8. As a result, I corrected this block and everything is clear now. There was an idea to check one thing on a swap-free account. But with such a StopLevel, this is not an option. I scored. I switched to other thoughts.
simakovva
And what type of performance does Roboforex have? It seems, as I remember, at the dawn of communication with MT5, I also ran into this, although I don’t remember anymore.
In General, try not to specify price in MqlTradeRequest at all, let 0 be. And, for the future, do an execution type check and, only if it is at streaming prices or on demand, specify price.
fxsaber
Probably ran into [No prices]
Forum on trading, automated trading systems and testing of trading strategies
Libraries: MT4Orders
fxsaber, 2018.07.24 09:46
2018.07.24 10:24:19.177 Trades '35247942': market buy 0.01 USDHKD
2018.07.24 10:24:19.246 Trades '35247942': failed market buy 0.01 USDHKD [No prices]
2018.07.24 10:24:19.246 Trades '35247942': buy limit 0.01 USDHKD at 7.83618
2018.07.24 10:24:19.315 Trades '35247942': failed buy limit 0.01 USDHKD at 7.83618 [No prices]
2018.07.24 10:24:19.316 Trades '35247942': buy stop 0.01 USDHKD at 7.85618
2018.07.24 10:24:19.384 Trades '35247942': failed buy stop 0.01 USDHKD at 7.85618 [No prices]
What are the entries in the log of the Terminal itself?
And you need to understand whether it is the server or the Terminal (OrderCheck). This can be done by comparing the time of sending the order and the response. If it matches up to MS-OrderCheck. Well, if OrderCheck, then the problem becomes local and it will be easier to understand.
dimeon
Perhaps at the time of processing the order by the server, the price has already changed and the StopLevel or frizzlevel has been violated. Try to increase the distance and then move the order to the right place. And in Print output not only the error number but also the current price + StopLevel *_Point.