Download MetaTrader 5

The function OnTrade() is called three times when the Trade event occurs,why?

To add comments, please log in or register
zifu wang
637
zifu wang  

Why is function OnTrade() called three times when the Trade event occurs? It should be once. Right?

Alain Verleyen
Moderator
33623
Alain Verleyen  
kwang1:

Why is function OnTrade() called three times when the Trade event occurs? It should be once. Right?

Wrong but your are not the first. OnTrade() is called for each trade event. When you send an order, there are several trade events. Unfortunately the documentation for OnTrade isn't detailed. However, the more recent OnTradeTransaction() event handler is more easy to use and more documented.

To add comments, please log in or register