![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Hello.
I have a question regarding the AccountFreeMargin() function. Genrally you can open new positions unless the Margin level is >100%, i.e. free margin >0. But many brokers still have a delay between time when the order was sent and time when the order was opened. While the AccountFreeMargin() function returns its value according only to already opened orders, there appears to be a gap in time when you can open whatever you want volume regardless the leverage but the broker will immediately close the trades after open because Free Margin Level < Account Stop Out level. So is there a way to control margin fo already sent ORDERS (not trades) that are not yet executed but the margin will be used for them within some short time for sure (because it is a Market Execution)?
Let's take into account the condition that there're several instruments and several expert advisors. Also they are scalping ones so slow solutions like manual calculation of Free Margin and placing it as a GlobalVariable is not appropriate. Big thanks for further answers.