void OnTradeTransaction(const MqlTradeTransaction& trans,
const MqlTradeRequest& request,
const MqlTradeResult& result)
double closeprice = OrderGetDouble(ORDER_PRICE_CURRENT);
Hello everyone, I'm developing a PHP platform for signals that communicates with trader's MT5 client. Every transaction should make a httprequest via EA and send data to my MySQL database. I tested it on my computer and it worked. I was experiencing some issues when tried to open many transactions at the same time, because the EA wasn't called on all of them. The main issue is that I moved the code to my trader's client and most of the time the EA isn't called when a transaction occured. IMO, the code works properly when called, but why isn't it called on each trade?
1° You are calling Webrequest(), it's a synchronous function, it takes time to return, meanwhile you can (you will) miss event(s).
Transactions queue length comprises 1024 elements.
If OnTradeTransaction handles a new transaction for too long, the old
ones in the queue may be superseded by the newer ones.
2° There is no guarantee to receive a OnTradeTransaction event for each server events.
One trade request manually sent from the terminal or via OrderSend()/OrderSendAsync()
functions can generate several consecutive transactions on the trade
server. Priority of these transactions' arrival at the terminal is not
guaranteed. Thus, you should not expect that one group of transactions
will arrive after another one when developing your trading algorithm.
Besides, transactions can be lost during delivery from the server to the