If you have a higher leverage you need less margin, if you have lower leverage you need more margin.
http://www.investopedia.com/articles/forex/07/forex_leverage.asp#axzz241GNVVbx
Thanks for your reply RaptorUK! I'm starting to understand the concept of margin better now.
I was always under the impression that a "margin call" meant that all the money in your account has been wiped out.
But I see now it only refers to the amount of free-margin remaining after opening an order, which may be FAR LESS than the amount of money in your account, depending on the broker leverage and lot size of the opened order.
Yeah, thanks WHRoeder! I already figured as much!
Just that up until now I was sure the *free margin* you had to work with after opening a position was the account equity. Now that I know how the free margin is actually calculated I have adapted my code accordingly.
Thanks for the help and the code sample!

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I am a bit confused. I ran a test on my EA (set deposit $10,000 on EUR/USD, every tick) and at one point the test was terminated due to a "Stop Out" error.
I checked the account balance thinking that the resulting losses wiped out the account, but there was still a $9,300 balance in the account at the moment of stop.
Apparently the combined losses of 2 open BUY position right before the "Stop Out" wiped out the Free Margin available even though equity was still at $9,300!
I don't get it... I thought margin calls only happen once you actually run out of money in your account! How come it wouldn't let me hold the positions if the resulting losses from them were way below the remaining Equity?
Thanks!