Download MetaTrader 5
To add comments, please log in or register
Format text in the messages editor. It is convenient!
zifu wang
626
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
29601
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