Errors, bugs, questions - page 2106

 
Andrey Khatimlianskii:

A timeout indicates that the response from the server was not received within a reasonable time. But not the result of the order.


Hello.

Thank you.

Purely technically I understood the peculiarity. in this case: when time out - you have to wait for a new ticket to appear in the trades history, if a new ticket appears - then the trade or order is open.

By the way, this only happens on MQL5 VPS

It's not a problem on a home server.

I will think about it...


I will think about it.

Пользовательский интерфейс - Начало работы - MetaTrader 5
Пользовательский интерфейс - Начало работы - MetaTrader 5
  • www.metatrader5.com
Интерфейс платформы предоставляет доступ ко всем инструментам, необходимым для торговли на финансовых рынках. Он включает в себя различные меню, панели инструментов и служебные окна. Главное меню В главном меню собраны практически все команды и функции, которые можно выполнять в торговой платформе. Оно позволяет работать с графиками...
 
Vladislav Andruschenko:

Purely technically I understand the peculiarity. in this case: when you time out - you have to wait for a new ticket to appear in the trade history, if a new ticket appears - then the trade or order is open.

If a trade order was sent via synchronous OrderSend, then there is no way to exit OrderSend execution. Everything looks like a VPS Terminal bug.
 
fxsaber:
If a trade order was sent via a synchronous OrderSend, then there is no way to exit the OrderSend execution. Everything looks like a VPS Terminal bug.


through it.

The problem can in principle be solved, after receiving a timeout error to run the function of searching for new tickets in the history.

Otherwise the EA just sends a new request and again gets a timeout error, without getting a ticket.

Thank you.

 
Vladislav Andruschenko:

The problem can in principle be solved, after receiving a timeout error, run the function of retrieving new tickets in the history.

You have to write it in SD. Otherwise, after each OrderSend you will wait three minutes for a timeout, getting the corresponding trade risks.

 
fxsaber:

You need to write to the CD. Otherwise, after each OrderSend you will wait three minutes for a timeout and get the corresponding trade risks.


And so I did.

This error happens 1 out of 1000, and so far it happened only on VPS from MQL...
 
Vladislav Andruschenko:

The Expert Advisor gets error 10012 and tries to place the order again.

I would deprive the EA of Seller status for a year for such a code in the Market
 
A100:
I would deprive you of Seller status for a year for such a code in the Marketplace.

This is the first time I've encountered such an error.

I have no such error in my code. no ticket means a trade has not opened. it means the EA is trying to open a trade again.
 
Vladislav Andruschenko:

The problem can in principle be solved, after receiving a timeout error, run the function to try new tickets in the history.

History has nothing to do with it. OrderSend sends the order, and it appears in the Terminal with ORDER_STATE_STARTED status.

But this does not mean that OrderSend has finished executing. OrderSend will continue to execute until the order status changes.

Therefore if you see a timeout, it is 99% certain that the order status is ORDER_STATE_STARTED(I see it, but it is not clear when I took the screenshot).

Moreover, the same timeout can happen without your OrderSend - when the MT5 server makes the OrderSend itself (TP/SL/MC/Expiration). But you will not see it in the Terminal.

 
Vladislav Andruschenko:
I do not have such an error in my code. no ticket - it means that the trade has not opened. it means that the Expert Advisor is trying to open the trade again.

This is incorrect logic. After OrderSend fails and OrderSend succeeds, the current trading environment must be re-read completely. This rule should always be in effect.

About return codes. I do not analyze them in my EAs. I think the trading logic should not depend on them.

 
fxsaber:

This is incorrect logic. After OrderSend fails and OrderSend succeeds, the current trading environment must be re-read completely. This rule should always be in effect.


I agree. it must be changed.

Reason: