Download MetaTrader 5

AccountInfoDouble(ACCOUNT_BALANCE) Bug?

To add comments, please log in or register
Share your knowledge. Become a well-known developer!
Andrei Moraru
1157
Andrei Moraru 2010.09.24 15:18 

There's a problem with AccountInfoDouble(ACCOUNT_BALANCE) function. When I close a position inside OnTick() and then execute AccountInfoDouble(ACCOUNT_BALANCE), it returns the account balance before the position was closed.

It's easy to reproduce by calling the function immediately before and after closing a position inside OnTick().

If it's not a bug, how do I effectively get the current account balance after I've closed a position inside OnTick()?

Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Account Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Environment State / Account Properties - Documentation on MQL5
Alexey Da
Moderator
6604
Alexey Da 2010.09.24 16:19  

Sending order to close position doesn't mean closeing position. You should check that deal based on your order was appeared and executed.

To add comments, please log in or register