Download MetaTrader 5

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

To add comments, please log in or register
Have you made a screenshot in MetaTrader? Share it with friends!
zifu wang
636
zifu wang 2013.11.17 07:26 

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

Alain Verleyen
Moderator
30722
Alain Verleyen 2013.11.17 11:11  
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