Errors, bugs, questions - page 1806

 

What to do in case of such error when loading MQL-program on a chart?

2017.02.15 15:13:28.351 MQL5    'TestLibrary.ex5' has newer unsupported version, please update your client terminal

Service Desk: #1673705

 
Slawa:
Note that all indicators for the same symbol are read consecutively in the same thread. If one indicator slows down, then the whole symbol processing thread slows down as well
Slawa, of one symbol or on one chart? If there are several charts of the same symbol and different indicators are attached to them, are they all calculated in the same flow? Or is each chart in its own thread?
 

On Metaquotes-Demo limiters can have negative slippage - not correct.

Manually set BuyLimit above Ask...

 
fxsaber:
Error [No prices] on the spot
2017.02.14 23:18:41.442 '5122740': failed instant buy 1.00 EURPLN at 4.30632 (deviation: 100) [No prices]

How is it that there is no price, there is even a price in the log?!

Query

2017.02.14 23:18:41.442 Request.action = TRADE_ACTION_DEAL (1)
2017.02.14 23:18:41.442 Request.magic = 0
2017.02.14 23:18:41.442 Request.order = 0
2017.02.14 23:18:41.442 Request.symbol = EURPLN
2017.02.14 23:18:41.442 Request.volume = 1.0
2017.02.14 23:18:41.442 Request.price = 4.30632
2017.02.14 23:18:41.442 Request.stoplimit = 0.0
2017.02.14 23:18:41.442 Request.sl = 0.0
2017.02.14 23:18:41.442 Request.tp = 0.0
2017.02.14 23:18:41.442 Request.deviation = 100
2017.02.14 23:18:41.442 Request.type = ORDER_TYPE_BUY (0)
2017.02.14 23:18:41.442 Request.type_filling = ORDER_FILLING_RETURN (2)
2017.02.14 23:18:41.442 Request.type_time = ORDER_TIME_GTC (0)
2017.02.14 23:18:41.442 Request.expiration = 1970.01.01 00:00:00
2017.02.14 23:18:41.442 Request.comment = My Position
2017.02.14 23:18:41.442 Request.position = 0
2017.02.14 23:18:41.442 Request.position_by = 0
2017.02.14 23:18:41.442 Result.retcode = 10021
2017.02.14 23:18:41.442 Result.deal = 0
2017.02.14 23:18:41.442 Result.order = 0
2017.02.14 23:18:41.442 Result.volume = 0.0
2017.02.14 23:18:41.442 Result.price = 0.0
2017.02.14 23:18:41.442 Result.bid = 0.0
2017.02.14 23:18:41.442 Result.ask = 0.0
2017.02.14 23:18:41.442 Result.comment = No prices 0.028 + 0.000 ms
2017.02.14 23:18:41.442 Result.request_id = 0
2017.02.14 23:18:41.442 Result.retcode_external = 0
2017.02.14 23:18:41.442
2017.02.14 23:18:41.442 SymbolInfoDouble(Symb,::SYMBOL_BID) = 4.30151
2017.02.14 23:18:41.442 SymbolInfoDouble(Symb,::SYMBOL_ASK) = 4.30632
I just had the same error on the Metacvots server. after 5 tries the order was placed
 
Vladislav Andruschenko:
I just encountered the same error on the Metacvots server. After 5 tries the order was placed.
Please send me the logs. I'll copy the logs to the SD application.
 
fxsaber:

On Metaquotes-Demo limiters can have negative slippage - not correct.

Manually set BuyLimit above Ask...

#define TOSTRING(A)  #A + " = " + (string)(A) + "\n"
#define TOSTRING2(A) #A + " = " + EnumToString(A) + " (" + (string)(A) + ")\n"

string ToString( const MqlTradeRequest &Request )
{
  return(TOSTRING2(Request.action) + TOSTRING(Request.magic) + TOSTRING(Request.order) +
         TOSTRING(Request.symbol) + TOSTRING(Request.volume) + TOSTRING(Request.price) +
         TOSTRING(Request.stoplimit) + TOSTRING(Request.sl) +  TOSTRING(Request.tp) +
         TOSTRING(Request.deviation) + TOSTRING2(Request.type) + TOSTRING2(Request.type_filling) +
         TOSTRING2(Request.type_time) + TOSTRING(Request.expiration) + TOSTRING(Request.comment) +
         TOSTRING(Request.position) + TOSTRING(Request.position_by));
}

string ToString( const MqlTradeResult &Result )
{
  return(TOSTRING(Result.retcode) + TOSTRING(Result.deal) + TOSTRING(Result.order) +
         TOSTRING(Result.volume) + TOSTRING(Result.price) + TOSTRING(Result.bid) +
         TOSTRING(Result.ask) + TOSTRING(Result.comment) + TOSTRING(Result.request_id) +
         TOSTRING(Result.retcode_external));
}

#define Bid (::SymbolInfoDouble(Symb, ::SYMBOL_BID))
#define Ask (::SymbolInfoDouble(Symb, ::SYMBOL_ASK))

#include <MT4Orders.mqh>

#define PRINT(A) A;                                                                                \
  Print(#A + "\n" + ToString(MT4ORDERS::LastTradeRequest) + ToString(MT4ORDERS::LastTradeResult)); \
  Print(TOSTRING(Bid));                                           \
  Print(TOSTRING(Ask));                                           \
  Print(TOSTRING(SymbolInfoDouble(Symb, SYMBOL_SESSION_PRICE_LIMIT_MIN)));

void OpenBuyLimits( const string Symb )
{
  PRINT(OrderSend(Symb, OP_BUYLIMIT, 1, SymbolInfoDouble(Symb, SYMBOL_SESSION_PRICE_LIMIT_MIN), 100, 0, 0))
  PRINT(OrderSend(Symb, OP_BUYLIMIT, 1, Ask, 100, 0, 0))
}

void OnStart()
{
  OpenBuyLimits("DIG-20170330");
}

OrderSend received/received data like this

2017.02.15 14:47:19.295 OrderSend(Symb,OP_BUYLIMIT,1,SymbolInfoDouble(Symb,SYMBOL_SESSION_PRICE_LIMIT_MIN),100,0,0)
2017.02.15 14:47:19.295 Request.action = TRADE_ACTION_PENDING (5)
2017.02.15 14:47:19.295 Request.magic = 0
2017.02.15 14:47:19.295 Request.order = 0
2017.02.15 14:47:19.295 Request.symbol = DIG-20170330
2017.02.15 14:47:19.295 Request.volume = 1.0
2017.02.15 14:47:19.295 Request.price = 29528.0
2017.02.15 14:47:19.295 Request.stoplimit = 0.0
2017.02.15 14:47:19.295 Request.sl = 0.0
2017.02.15 14:47:19.295 Request.tp = 0.0
2017.02.15 14:47:19.295 Request.deviation = 100
2017.02.15 14:47:19.295 Request.type = ORDER_TYPE_BUY_LIMIT (2)
2017.02.15 14:47:19.295 Request.type_filling = ORDER_FILLING_RETURN (2)
2017.02.15 14:47:19.295 Request.type_time = ORDER_TIME_GTC (0)
2017.02.15 14:47:19.295 Request.expiration = 1970.01.01 00:00:00
2017.02.15 14:47:19.295 Request.comment =
2017.02.15 14:47:19.295 Request.position = 0
2017.02.15 14:47:19.295 Request.position_by = 0
2017.02.15 14:47:19.295 Result.retcode = 10009
2017.02.15 14:47:19.295 Result.deal = 0
2017.02.15 14:47:19.295 Result.order = 134117077
2017.02.15 14:47:19.295 Result.volume = 1.0
2017.02.15 14:47:19.295 Result.price = 0.0
2017.02.15 14:47:19.295 Result.bid = 0.0
2017.02.15 14:47:19.295 Result.ask = 0.0
2017.02.15 14:47:19.295 Result.comment = Request executed 61.066 + 0.004 ms
2017.02.15 14:47:19.295 Result.request_id = 9
2017.02.15 14:47:19.295 Result.retcode_external = 0
2017.02.15 14:47:19.295
2017.02.15 14:47:19.295 Bid = 29031.0
2017.02.15 14:47:19.295
2017.02.15 14:47:19.295 Ask = 29038.0
2017.02.15 14:47:19.295
2017.02.15 14:47:19.295 SymbolInfoDouble(Symb,SYMBOL_SESSION_PRICE_LIMIT_MIN) = 29528.0
2017.02.15 14:47:19.295
2017.02.15 14:47:19.295 OrderSend(Symb,OP_BUYLIMIT,1,Ask,100,0,0)
2017.02.15 14:47:19.295 Request.action = TRADE_ACTION_PENDING (5)
2017.02.15 14:47:19.295 Request.magic = 0
2017.02.15 14:47:19.295 Request.order = 0
2017.02.15 14:47:19.295 Request.symbol = DIG-20170330
2017.02.15 14:47:19.295 Request.volume = 1.0
2017.02.15 14:47:19.295 Request.price = 29038.0
2017.02.15 14:47:19.295 Request.stoplimit = 0.0
2017.02.15 14:47:19.295 Request.sl = 0.0
2017.02.15 14:47:19.295 Request.tp = 0.0
2017.02.15 14:47:19.295 Request.deviation = 100
2017.02.15 14:47:19.295 Request.type = ORDER_TYPE_BUY_LIMIT (2)
2017.02.15 14:47:19.295 Request.type_filling = ORDER_FILLING_RETURN (2)
2017.02.15 14:47:19.295 Request.type_time = ORDER_TIME_GTC (0)
2017.02.15 14:47:19.295 Request.expiration = 1970.01.01 00:00:00
2017.02.15 14:47:19.295 Request.comment =
2017.02.15 14:47:19.295 Request.position = 0
2017.02.15 14:47:19.295 Request.position_by = 0
2017.02.15 14:47:19.297 Result.retcode = 10015
2017.02.15 14:47:19.297 Result.deal = 0
2017.02.15 14:47:19.297 Result.order = 0
2017.02.15 14:47:19.297 Result.volume = 0.0
2017.02.15 14:47:19.297 Result.price = 0.0
2017.02.15 14:47:19.297 Result.bid = 0.0
2017.02.15 14:47:19.297 Result.ask = 0.0
2017.02.15 14:47:19.297 Result.comment = Invalid price 0.015 + 0.000 ms
2017.02.15 14:47:19.297 Result.request_id = 0
2017.02.15 14:47:19.297 Result.retcode_external = 0
2017.02.15 14:47:19.297
2017.02.15 14:47:19.297 Bid = 29031.0
2017.02.15 14:47:19.297
2017.02.15 14:47:19.297 Ask = 29038.0
2017.02.15 14:47:19.297
2017.02.15 14:47:19.297 SymbolInfoDouble(Symb,SYMBOL_SESSION_PRICE_LIMIT_MIN) = 29528.0

Log

2017.02.15 14:47:19.185 script Test2 (AUDUSD,H1) loaded successfully
2017.02.15 14:47:19.235 '5122740': buy limit 1.00 DIG-20170330 at 29528
2017.02.15 14:47:19.295 '5122740': accepted buy limit 1.00 DIG-20170330 at 29528
2017.02.15 14:47:19.295 '5122740': order #134117077 buy limit 1.00 / 1.00 DIG-20170330 at market done in 60.996 ms (0.341 ms on server)
2017.02.15 14:47:19.295 '5122740': failed buy limit 1.00 DIG-20170330 at 29038 [Invalid price]
2017.02.15 14:47:19.297 script Test2 (AUDUSD,H1) removed
2017.02.15 14:47:46.586 '5122740': deal #117726626 buy 1.00 DIG-20170330 at 29528 done (based on order #134117077)

Explanation

At first we tried to set BuyLimit at the lowest possible price 29528. This price is much higher than the Ask price (29038). In 99.99% of cases, BuyLimit is not set higher than Ask. However, it is not forbidden, so placing an order succeeded. And then (in purple) it took almost half a minute before BuyLimit became a position. Although it should have happened instantly. But to make matters worse, BuyLimit is executed at its price and not at Ask price. I.e., the limit order received negative slippage when it was executed, which is just a mistake!


The second OrderSend was an attempt to set BuyLimit as normal - not higher than Ask. And, of course, it didn't work out (in red). Because SYMBOL_SESSION_PRICE_LIMIT_MIN must not be higher than Ask.

 
fxsaber:
Please send me the logs. I will copy it to the SD application.

2017.02.15 15:12:09.979 Exp - v7  (EURCHF,M1)   OPEN DEAL sy=EURUSD op=0 ll=1.0 sl=0 tp=0 coomment=134120593 mn=9998745 SYMBOL_FILLING_MODE=1 SYMBOL_TRADE_EXEMODE=1 SYMBOL_EXPIRATION_MODE=15 SYMBOL_TRADE_MODE=4 SYMBOL_TRADE_STOPS_LEVEL=0 SYMBOL_TRADE_FREEZE_LEVEL=0 SYMBOL_ORDER_MODE=63 SYMBOL_START_TIME=0 SYMBOL_EXPIRATION_TIME=0 SYMBOL_SPREAD=8 SYMBOL_SESSION_DEALS=0
2017.02.15 15:12:09.979 Exp -  v7  (EURCHF,M1)  Result ERROR= 10021 symbol EURUSD volume 1.0 action 1 tp 0.0 sl 0.0 type 0 price 1.05523   There are no quotes to process the request


2017.02.15 15:12:10.980 Exp - v7  (EURCHF,M1)   OPEN DEAL sy=EURUSD op=0 ll=1.0 sl=0 tp=0 coomment=134120593 mn=9998745 SYMBOL_FILLING_MODE=1 SYMBOL_TRADE_EXEMODE=1 SYMBOL_EXPIRATION_MODE=15 SYMBOL_TRADE_MODE=4 SYMBOL_TRADE_STOPS_LEVEL=0 SYMBOL_TRADE_FREEZE_LEVEL=0 SYMBOL_ORDER_MODE=63 SYMBOL_START_TIME=0 SYMBOL_EXPIRATION_TIME=0 SYMBOL_SPREAD=10 SYMBOL_SESSION_DEALS=0
2017.02.15 15:12:11.102 Exp - v7  (EURCHF,M1)   Result = 10009 symbol EURUSD volume 1.0 action 1 tp 0.0 sl 0.0 type 0 price 1.05526   Request completed


and this has only happened to me now, the code for opening trades has not changed.

 

cool thing

In Market Watch - I press Show All Symbols.

2017.02.15 15:13:32.414 Symbols no more than 1000 symbols can be selected


MetaQuotes Demo

 
Vladislav Andruschenko:

and this has only happened to me now, the code for opening trades has not changed.

I need the log of the "Log" tab, not the "Expert" tab.
 
fxsaber:
Need the log of the Log tab, not the Expert.

wait a minute I was getting a message on 2017.02.15 15:13:32.414 Symbols no more than 1000 symbols can be selected

looking for

2017.02.15 15:15:25.517 Trades  '5246495': instant buy 1.00 EURUSD at 1.05575
2017.02.15 15:15:25.610 Trades  '5246495': accepted instant buy 1.00 EURUSD at 1.05575
2017.02.15 15:15:25.610 Trades  '5246495': deal #117730392 buy 1.00 EURUSD at 1.05575 done (based on order #134121023)
2017.02.15 15:15:25.611 Trades  '5246495': order #134121023 buy 1.00 / 1.00 EURUSD at 1.05575 done in 94.543 ms
2017.02.15 15:15:25.674 Trades  '5246495': failed instant buy 1.00 EURUSD at 1.05574 (deviation: 14) [No prices]
2017.02.15 15:15:26.687 Trades  '5246495': failed instant buy 1.00 EURUSD at 1.05574 (deviation: 14) [No prices]
2017.02.15 15:15:27.701 Trades  '5246495': failed instant buy 1.00 EURUSD at 1.05574 (deviation: 14) [No prices]
2017.02.15 15:15:28.713 Trades  '5246495': failed instant buy 1.00 EURUSD at 1.05578 (deviation: 16) [No prices]
2017.02.15 15:15:29.728 Trades  '5246495': instant buy 1.00 EURUSD at 1.05577 (deviation: 16)
2017.02.15 15:15:29.808 Trades  '5246495': accepted instant buy 1.00 EURUSD at 1.05577 (deviation: 16)
2017.02.15 15:15:29.808 Trades  '5246495': deal #117730398 buy 1.00 EURUSD at 1.05577 done (based on order #134121030)
2017.02.15 15:15:29.808 Trades  '5246495': order #134121030 buy 1.00 / 1.00 EURUSD at 1.05577 done in 80.447 ms


Reason: