Erros, bugs, perguntas - página 1806

 

O que fazer em caso de tal erro ao carregar o programa de MQL num gráfico?

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

Balcão de serviço: #1673705

 
Slawa:
Note-se que todos os indicadores para o mesmo símbolo são lidos consecutivamente no mesmo fio. Se um indicador abranda, então todo o fio de processamento do símbolo também abranda
Slawa, de um símbolo ou num gráfico? Se existem vários gráficos com o mesmo símbolo e diferentes indicadores estão ligados a eles, são todos calculados no mesmo fluxo? Ou será que cada gráfico está no seu próprio fio?
 

Em Metaquotes-Demo limitadores podem ter derrapagens negativas - não correctas.

Definir manualmente o BuyLimit acima de Ask...

 
fxsaber:
Erro [Sem preços] no local
2017.02.14 23:18:41.442 '5122740': failed instant buy 1.00 EURPLN at 4.30632 (deviation: 100) [No prices]

Como é que não há preço, há mesmo um preço no tronco?!

Consulta

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
Tive o mesmo erro no servidor do Metacvots. após 5 tentativas a encomenda foi colocada
 
Vladislav Andruschenko:
Acabo de encontrar o mesmo erro no servidor Metacvots. Após 5 tentativas, a encomenda foi colocada.
Por favor, enviem-me os registos. Vou copiar os registos para a aplicação SD.
 
fxsaber:

Em Metaquotes-Demo limitadores podem ter derrapagens negativas - não correctas.

Definir manualmente o BuyLimit acima de 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");
}

EncomendarEnviar dados recebidos/recebidos como este

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

Registo

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)

Explicação

No início, tentámos estabelecer o BuyLimit ao preço mais baixo possível 29528. Este preço é muito mais elevado do que o preço Ask (29038). Em 99,99% dos casos, BuyLimit não é fixado acima de AskLimit. No entanto, não é proibido, pelo que a realização de uma encomenda foi bem sucedida. E depois (em roxo) demorou quase meio minuto antes de BuyLimit se tornar uma posição. Embora devesse ter acontecido instantaneamente. Mas o pior é que BuyLimit é executado ao seu preço e não a AskLimit. Ou seja, a ordem de limite recebeu um deslize negativo quando foi executada, o que é apenas um erro!


A segunda OrderSend foi uma tentativa de definir BuyLimit como normal - não superior à Ask. E, claro, não funcionou (em vermelho). Porque SYMBOL_SESSION_PRICE_LIMIT_LIMIT_MIN não deve ser superior a Ask.

 
fxsaber:
Por favor, enviem-me os registos. Vou copiá-lo para a aplicação SD.

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


e isto só me aconteceu agora, o código de abertura de comércios não mudou.

 

coisa fixe

Em Market Watch - Carrego em Show All Symbols (Mostrar todos os símbolos).

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


Demonstração de MetaCotações

 
Vladislav Andruschenko:

e isto só me aconteceu agora, o código de abertura de comércios não mudou.

Preciso do registo do separador "Log", não do separador "Expert".
 
fxsaber:
Precisa do registo do separador Registo, não do Perito.

espera um minuto tive uma mensagem apressada 2017.02.15 15:13:32.414 Símbolos não podem ser seleccionados mais de 1000 símbolos

à procura de

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