As I understand, the following happens:
All your current money are presented in equity. Equity is divided into two parts:
1. AccountMargin, which is taken from your depo as a guarantee to maintain your current positions opened. It stays the same untill you open or close positions.
2. AccountFreeMargin, which is used when you open/close new positions. It can increase decrease during the price movement in favor and vice versa.
When your positions are in loss your equity goes down with it (your free margin is melting). So, when equity reaches % of account margin MarginLevel < StopOut, broker thinks that you don't have enough money and closes some of your positions. When it happens your balance is decreased by positions loss but your Margin used to maintain this closed position comes back to your account and becomes free margin, so you are able to open trades again.
Sorry, if my explanation is not good enough, English is not my native.
thanks hasayama!
For what I understand, it would be (for me)
if ((Equity - Margins) > (Equity * AccountStopoutLevel()/100)) {
// Broker closes the orders.
}
if(AccountEquity()/AccountMargin()*100 < AccountStopoutLevel()) { BrokerClosesOrders(); }
Not every broker, though.
Ask your broker how he does it.
So, the formula for StopoutEquity is:
#property indicator_chart_window int start() { if(AccountStopoutMode()==0) double StopoutEquity=AccountStopoutLevel()*AccountMargin()/100; Comment("StopoutEquity = " + StopoutEquity + " " + AccountCurrency()); }
And there you have a simple indicator showing you your current StopoutEquity in the top left corner!
i have only traded with a couple of brokers, but my margin calls will usually kick in:
if(AccountEquity()<AccountMargin())...
i have only traded with a couple of brokers, but my margin calls will usually kick in:
if(AccountEquity()<AccountMargin())...
When
AccountEquity()==AccountMargin()
it means that Margin level = 100%, so when Margin level drops below 100%, we get Margin calls, i.e. the line in the Terminal turns red.
Because there is not enough Equity to cover for the Margin, in other words, the Free margin < 0 .
A Stopout is when
AccountEquity() / AccountMargin() * 100 // to get the percent value
drops below a certain AccountStopoutLevel(), specified by the broker. Usually, when Margin level < 30%.
Then some brokers will automatically close your most losing order, and if that is not enough, the next most losing order, and so on.
Other brokers will close all your orders.
Still other brokers will not close at all, and then, your account can get in serious debt. If you do not cover this debt, you may be sued.
To make sure what the AccountStopoutLevel() is for your broker, you can either call your broker and ask, or use:
AccountStopoutMode(); AccountStopoutLevel();
Esspecially when the trader is a newbie, it is good to know where you are standing, how far your losing position is from the Stopout level.
This will help make proper decisions wheather to close on loss or perhaps wait some more.
In other words, it may help avoid the frustration when you have closed the losing order because you were afraid of Stopout, because
you did not know how far or near AccountStopoutLevel() you actually were, and your reasonable mind was telling you that it must turn back
sooner or later, and then it actually did, but you had already closed, and... ARGHHHHHHHHHHH!
Additionally, what I am trying to say here is that there are two styles of trading:
Case1 with StopLoss,
Case2 without StopLoss.
Case1:
When testing an EA with StopLoss, my experience shows that there is no reasonable level of StopLoss.
No matter if the SL is close, or far in Pips, the EA always loses, and the final outcome is terrible.
Case2:
When testing an EA without SL (SL=0), I am able to find such conditions (Lot level management),
which will give me long runs of profit, until points of no return (extreme local values), and then
I get Stopouts.
Now, the point is that there is no way an EA can recognize these extremes, because even the trader
can not know if i.e. EURUSD 1.3000 is already extreme, or maybe it is 1.2000?
So, the only reasonable solution seems to be AccountStopoutLevel() control.
After all, if you have made 50 000 profit, you should be able to take 5 000 loss
when you see a swing after some extreme!
- There is none. The server sends the tick when the market changes on the server.
- Next time don't hijack someone's thread with unrelated questions, start your own.
- There is none. The server sends the tick when the market changes on the server.
- Next time don't hijack someone's thread with unrelated questions, start your own.
1. Maybe, I am not an expert at coding, but I have been around long enough to know, that there is always a way.
I once knew a professional programer, who worked for the army.
Unfortunately, I lost contact with him a long, long time ago.
Now, I do not know anybody I could ask, who would know.
2. Maybe I should have PMed. I had no intention to hijack anything or anybody! LOL
1. Maybe, I am not an expert at coding, but I have been around long enough to know, that there is always a way.
I once knew a professional programer, who worked for the army.
Unfortunately, I lost contact with him a long, long time ago.
Now, I do not know anybody I could ask, who would know.
2. Maybe I should have PMed. I had no intention to hijack anything or anybody! LOL
- Really? What signal do you send to the telephone or what button do you push to make someone call you on that phone? There is none.
- Rest is babble. We don't care.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Can anyone better describe AccountStopoutLevel() than the metatrader documentation?
0 - calculation of percentage ratio between margin and equity;
Is it the Margin used? The Free Margin?
Is it Margin / Equity or Equity / Margin?
How is it calculated?
Best regards