You are forgetting about the spread. The moment you open a buy, you are now down by the spread. Open a sell and they would match because you pay the spread when it closes.
0 15:47:56 2014.01.02 02:00 test2 AUDUSD,M1: AccountFreeMargin before:100.00000000 0 15:47:56 2014.01.02 02:00 test2 AUDUSD,M1: AccountFreeMarginCheck:98.00000000 2 15:47:56 2014.01.02 02:00 test2 AUDUSD,M1: open #1 buy 0.01 AUDUSD at 0.88851 ok 0 15:47:56 2014.01.02 02:00 test2 AUDUSD,M1: AccountFreeMargin immediately after:97.77000000 0 15:47:56 2014.01.02 02:00 test2 AUDUSD,M1: Spread:23.00000000
Thank you for clarification, you helped alot!
Does it mean that AccountFreeMargin() would be different across time whith floating spread broker?
zversky:
Yes
Thank you for clarification, you helped alot!
Does it mean that AccountFreeMargin() would be different across time whith floating spread broker?
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
output:
https://docs.mql4.com:
AccountFreeMarginCheck() - Returns free margin that remains after the specified order has been opened at the current price on the current account.
AccountFreeMargin() - Returns free margin value of the current account.
As I understand AccountFreeMarginCheck() call before opening an order should return the same value as AccountFreeMargin() straight after the order was opened
Why AccountFreeMarginCheck() does not match AccountFreeMargin()? What am I doing wrong?
Thanks!