If equity (drawdown) or margin are outside limits, I close the oldest trade.
I then read them again and repeat the process as many times as required, otherwise I wait until the next new bar.
But, I need to know I am using the updated equity, margin and balance values so how can I handle that?
I assume I am reading the account info functions from a database within in the MT5 terminal and the server is asynchronously updating the MT5 terminal database.
From the time the trade server closes the trade how long will it take to update the account info database in the MT5 terminal, obviously excluding the MT5 to server latency?
Is it updated on each trade event or tick or time based or how????
Otherwise, if my assumption is wrong could someone please advise how the account info updates are handled.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hi folks,
I need clarification on how MT5 handles updating account info functions.
At the open of a new bar I read the following:
AccountInfoDouble(ACCOUNT_EQUITY))
AccountInfoDouble(ACCOUNT_MARGIN))
AccountInfoDouble(ACCOUNT_BALANCE))
If equity (drawdown) or margin are outside limits, I close the oldest trade.
I then read them again and repeat the process as many times as required, otherwise I wait until the next new bar.
But, I need to know I am using the updated equity, margin and balance values so how can I handle that?
I assume I am reading the account info functions from a database within in the MT5 terminal and the server is asynchronously updating the MT5 terminal database.
From the time the trade server closes the trade how long will it take to update the account info database in the MT5 terminal, obviously excluding the MT5 to server latency?
Is it updated on each trade event or tick or time based or how????
Otherwise, if my assumption is wrong could someone please advise how the account info updates are handled.
Thanks in advance,
Allan W.