Forum

Bug in MT5 build 3104: OnTradeTransaction is not invoked after an async trade is placed, in case broker returns Trade disabled error

Steps to reproduce: 1. Take an MT5 account for which broker have disabled the trading 2. Place an async trade via EA Actual results: 1. Terminal prints Trade disabled error in the logs, as expected 2. OnTradeTransaction never invoked on this error, so that EA hangs/times out waiting for a trade

Problem reading data from socket via SocketRead

I'm consistently receiving error 5273 when invoking SocketRead MQL5 API. I connect to the server from an MT terminal and would like to check periodically if some data have arrived from the server. Here is my code: if (client== INVALID_HANDLE ) return false ; uchar rbuf[ 512 ]; uint rlen=

Can I assume that new history orders are been added only to the very end of the history pool?

Hello, I'm coding an EA and in my EA I need to detect the changes in the history pool. Is it safe to assume in MQL4 that the pool is being changed only by adding new orders to the very end of the history pool? If not, how one can detect all changes which happened in history pool since last time