It's all about Money Management. You probably have heard this dozens of times, some of you may even have implemented some kind of Lot management in their EA or trading strategies and believe that it will do, alone as it is.
Money Management is a complex question and it does not get covered with some linear/quadratic/fancy relation between volume traded and current balance or free margin.
In order to perform a correct Money Management one MUST understand what the concept behind the two words is. Eventually you'll figure out yourself that the number of Lots you are going to trade in your next trade should not be chosen by a function, the only variable of which is how much money you currently have on your account.
many EAs in the codebase I often recognize pieces of code coming from the article "Fallacies, Part 1: Money Management is Secondary and Not Very Important"
and I understand that many think that the article gives the final solution to Money
Well, as far as I've loved that piece of paper when I was first approaching the Money Management issue, it is my current opinion that it just raises the question and shows a first rudimental approach increasing the amount of money traded as the balance goes up, but it doesn’t touch at all the core of the problem of Money Management.
The main point of this article is to show a practical way to implement an effective MM. This can be achieved only by using a certain kind of strategies that we need to identify and describe first. In the following we’ll cover the basic concepts of how to build such strategy and we’ll point out the common mistakes which always end up in draining a Trader’s account.
Writing this paper I assume you've read the article "Fallacies, Part 1: Money Management is Secondary and Not Very Important". If you haven’t, I strongly recommend you to go there now (http://articles.mql4.com/en/articles/1526) before continuing with this one.
of Money Management
A concept in just two words: MANAGEMENT and MONEY.
"To manage? comes from the Italian "maneggiare" which literally means to handle. Managing something requires skills and knowledge and the intimate meaning of the word management can probably be expressed as "handling with knowledge".
When talking about Money Management we obviously talk about money. What we want is to have a direct control (handling) over the way we invest our capital.
Now, when we place an order we have control on its volume (Lots), no figure in "money" terms is directly involved. If we want to handle our money with knowledge, we must be able to translate that volume to our deposit currency in order to estimate the potential loss associated with the order.
We’ve been told that statistically speaking Successful Traders never risk more than 2% of their capital on a single trade.
It is a simple rule indeed… why not to give it a try?
What you have to do is just to quantify how much is 2% of your capital and avoid to risk more than that sum next time you open a position… sounds stupidly easy… so why didn’t you do it so far? :)
Again, you open positions in Lots and you need a way to convert “2% of your Capital" into Lots. That’s what we are going to learn in the following.
If You Want
to Win You Must Be Able to Lose
When trading, your main goal is to increase your Capital. Profitable trades increase your balance while losing ones decreases it.
At first glance one can say: winning=good, loosing=bad.
Following this reasoning one is driven to think that avoiding losses is a good starting point on the long way to become a Successful Trader.
As a matter of fact there are plenty of strategies and EAs which "solve" the problem of losses by simply not dealing with it. Those strategies make no use of StopLoss and let the loss grow until the Market comes eventually back in their favour and the position becomes profitable.
EAs developed on those strategies usually show very good profits and no losses at all (win ratio is usually more than 95%). This behaviour is anyway stable for a relative short period and when the loss comes it comes unexpected and huge… sometimes one single series of losses is enough to drain the account empty. It's the typical mistake of the newbie that attempts to code his first Grail. Been there.
Systems like this work fine until the Market has a strong trend in one direction but becomes absolutely dangerous when the trend disappears or changes direction.
Ignoring losses is definitely not the way to go if we want to see our Capital grow on long/medium term period.
We want our strategies to be able to survive the toughest conditions we can find out there so we do want to avoid using a system that works only for short periods introducing the risk to lose most of our capital when things go bad.
Looking better at the dynamic of capital growth we can write down the following simple equation:
Profit = %Win * AVGwin – %Loss * AVGloss (1)
%Win = nr. profitable trades / nr. of total trades (percentage of profitable trades)
AVGwin = total profit / nr. profitable trades (average profit)
AVGloss = total loss / nr. losing trades (average loss)
(1) is valid in any circumstances, whichever trading system one uses.
Considering that %Loss is equal to [1-%Win] we can write the equation (1) in this form:
Profit = %Win * AVGwin – (1-%Win) * AVGloss (2)
As you can see the equation (2) is function of three variables, namely:
At this point the simple concept “winning=good, loosing=bad” doesn’t seem so obvious anymore… in fact it sounds kind of wrong.
pretty much look at the equation (2) as translation into formal math terms of
the say “it’s not about being right or wrong rather how much you make when
you are right and how much you lose when you are wrong”.
Both equation and statement complicates the game but they introduce interesting degrees of freedom which allow us to get into loosing trades as much as [ (1-win%) * AVGloss ] remains smaller than [ %Win* AVGwin ].
The equation (2) is also well described in the article "Be In-Phase" by Mikhail Korolyuk that you can find here (http://championship.mql4.com/2008/news/366). I warmly recommend you to study it cause it explains some key concept that will help to improve your understanding of the dynamic of strategies/trades.
Now we know that the success of your strategy is determined by a relation which is function of three variables… to be successful we have to "drive" them in our favour and maximize the profit.
But what do we know about each one of these variables?
%Win is a characteristic of the strategy used. Usually is not affected by the size of the positions opened. Is worth to point out that %Win is not known before running a few tests (on demo account or Strategy Tester). It can be increased by altering the strategy, by choosing better entry points and it may change as consequence of changes to TakeProfit and StopLoss.
Practically speaking %Win is a variable on which we don’t have much control as it really depends on the intimate structure of our strategy.
AVGwin is also tied to the strategy used. It can be changed directly by changing order’s Volume or TakeProfit levels or, more generally, the criteria for which the strategy closes profitable orders.
Although you can play with it, you will always come to face the fact that the more you increase TakeProfit levels (or force your exit points up) the smaller your %Win will be. As we are trying to maximize the product [ %Win* AVGwin ] we must be very careful in changing TakeProfit levels or we could end up in worsening the situation.
Furthermore we have to notice that at the moment a position is opened we have no clue on how much the price will move in our favour; therefore we cannot really rely on strong AVGwin to maximize the profit given by equation (2).
AVGloss depends of course on the strategy used but it can be "adjusted" by changing StopLoss levels and Volume of our orders (Lots).
Acting on StopLoss or Lots has different effect on how our strategy performs. Let’s see it…
- Reducing StopLoss levels results in smaller losses per single trade. A collateral effect could be that more orders are open as positions are closed more often for StopLoss and this leaves room for other positions to be opened. The effect on %Win is pretty much unpredictable;
- Increasing StopLoss levels results in bigger losses per single trade. A collateral effect could be that the StopLoss levels are so high that they never trigger and when they do the loss is too big for our account to stand it. More optimistically the number of orders can be considerably reduced as positions are kept longer. The effect on %Win is again unpredictable;
- Changing the volume of orders results in smaller losses per single trade. Usually it does not affect the %Win of a strategy.
clear that out of the three variables the only one that we can control directly
BEFORE placing an order is AVGloss. Here is where Money Management kicks in.
Let’s look again at equation (2):
Profit = %Win * AVGwin – (1-%Win) * AVGloss (2)
pretty obvious that minimizing AVGloss we can increase our profit. Managing
our losses is then the key to increase our profit.
Again: we cannot plan our gains as those depend on how much the Market moves in our favour but we can always decide how much we are willing to loose before giving up the position when things go wrong.
AVGloss = TotalLoss / nr. losing trades
If we look at the relation above we clearly see that in order to minimize AVGLoss we have to minimize TotalLoss, which is the sum of every single loss cumulated by our trading system. To keep down TotalLoss is sufficient to reduce to minimum the loss on every single losing order.
Cut the Loss and Let the Profit Grow
Experience shows that if you want to be successful in trading you must quickly get rid of loosing positions and treasure profitable ones.
We just learnt that we can play with Lots or SL levels to "adjust" AVGloss variable. We’ve seen also there is not much we can do with %Win and AVGwin.
We need now to find a criterion to choose SL levels and Lot size in order to optimize the result of equation (2).
This is the equation we are going to use to implement our Money Management strategy:
StopLoss * PipValue = Capital at risk (3)
where StopLoss is given in pips and PipValue is the
value of a single pip in the deposit currency.
PipValue is obviously tied to the volume of the order and this relation will be the key for handling our money with knowledge.
Let’s talk about StopLoss first.
There Is No Safe Trading without StopLoss
Before we come to describe how to implement Money Management in a practical way, it is worth to mention something that kills a large number of Traders.
Many beginners and experienced Traders trade without using any hard SL. Who codes an EA tends to think that it will take care of everything, following the market closely and babysitting open positions ready to close them when things go wrong. Nothing could be more far from the truth.
In fact when you don’t place a hard SL you don’t really know when the position will be closed in case the Market turns against you… you actually cannot be sure that it will be closed at all!!!
How can you pretend then to handle your money with knowledge?
A strategy which makes no use of hard StopLoss CANNOT implement a sound Money Management!
strategies handle closure of position by watching the Market for particular
events, events that may never occur driving the account to bankruptcy. Using
such strategies/systems/EAs is not possible in fact to quantify the losses at
the moment of position opening. Losses on those strategies can be quantified
only on a statistical base.
Of course there are exceptions: extremely complex EA characterized by a strong ripetibility… but they will not be taken into consideration in the scope of this article.
Many will have to smash their head on it but at some point it will become pretty clear that a strategy which makes use of hard SL is much more reliable than one that doesn’t.
So, next time you attempt to set up your strategy or code your EA keep in mind that you MUST use hard SL and you have to address the issue of how to choose SL in an effective way.
This will be your first big step to the success.
How to Choose the Proper StopLoss level
This matter alone would require pages of explanations, examples and talking. We will not cover it in detail but just give some hint and underline what is really important when talking about SL.
SL level shall always be chosen looking at the current condition of the Market, so called Price Action. Who uses fixed SL (say very common 20 or 50 pips) has probably a very limited understanding of the Market and trading in general. In fact SL shall be wide enough to avoid being wiped out in case the Market retraces back against you… but not too wide otherwise one would have a very limited return compared to the risk he is taking with the trade.
As a general rule:
you want to have as many support/resistance levels as possible between the current Price and your SL
ensure that if the Market turns against you it has a chance to slow down and go
back in the right direction before hitting your SL.
Of course you can practically include a minimum number of S/R levels between current Price and SL level to avoid having too wide SL.
Let’s see a
In the following H1 chart you can see the price rising after a double top in a clear and strong movement (last two bars).
Say we want to use round figures and buy at 1.2700.
If we use a dumb strategy we set our SL 50 pips below the entry (see the red line) at 1.2650.
Note how the SL falls just in the middle of the 1st bar… it is highly probable that it will be wiped out in case a retracement occurs. But our strategy just uses 50 pips SL and does not take into account price action... too bad.
SL example H1 chart: Open price and 50 pips SL
the same moment in M15 chart.
It appears very clear that a resistance level has been broken around 1.2575 and is also evident that there is no support next to the chosen SL level while the Market is stable way below.
SL example: setup on M15 chart
In fact with a little help of Fractals a Successful Trader can identify four major supports of interest:
- first is at 1.2566
- second at 1.2536
- third at 1.2529
- forth at 1.2525
Without entering into too much detail the Successful Trader would just state that the forth support level is the most reliable one, therefore he’ll set his SL right there (continuous blue line). Of course SL could be set lower but this would penalize the ROI of the trade. Remember that you want to keep SL as smaller as possible!
So… after a
careful analysis of the price action the Successful Trader ended up with a SL
of 175 pips. Surely not one of the smallest… but he wants to take this trade
and be reasonably sure that he doesn’t end up loosing… and according to him
there is not much of a choice here.
Remember that we instead placed our dumb 50 pips SL on the red line at 1.2650.
Let’s see now how the two trades moved on…
SL example: trade on M15 chart
go! M15 chart.
we opened the position a retracement started and in a few hours wiped out the
dumb SL leaving a hole into our account :(
We’ve just lost. Right after the order has been closed by SL the price starts climb again and in less then one hour we see that the position would have been profitable if only the SL was set a bit lower.
I bet you have seen this many many times.
happened to the Successful Trader?
He is probably laughing at us while he is gaining profit from a smooth trade.
As simple as that: place your SL correctly and you can go on the beach with no worries. The Successful Trader knows that.
EA/strategy which uses fixed SL has very limited probability of success
as it does not take into full account what’s happening in the Market.
If you are using such strategy you should change your approach immediately and every time you open a trade without studying where to place your SL you should slap yourself hard in the face! :)
REMEMBER: the first step when attempting any trading is to analyze the Market and understand where to place our hard SL. Period.
Should be clear by now that SL levels are pretty much tied to the Market and in most of the cases we are forced to "accept" SL levels where they come and not where we would like them to be.
Let’s see again the equation (3) introduced before:
SL * PipValue = Capital at risk (3)
If we want to trade like a Successful Trader risking not more than 2% of our Capital on a single trade, means that SL (in pips) of any order by the value of one single pip (in deposit currency) shall be smaller than 2% of our Capital.
SL * PipValue <= Capital * 0.02 (4)
Since SL is imposed by the Market the only degree of freedom we have left to adjust our Risk is to choose a proper PipValue.
Reversing the equation (4) we can extract PipValue:
PipValue <= (Capital * 0.02) / StopLoss (5)
Given a fixed Risk and a choosen StopLoss we can quantify PipValue.
Suppose we have a Capital of 10 000 EUR and we want to take a maximum risk of 2%. That means we are willing to risk 200 EUR on our next trade. If in the current Market we can set SL at 80 pips we are in the following situation:
PipValue = 200 / 80 = 2.5 EUR
words we know we may end up the trade losing 80 pips and to limit the loss to
200 EUR we have to open a position with a Volume for which each pip is worth
Ok, in our example we know that PipValue must be 2.5 EUR…
…but which is the relation between PipValue and Lot size? How do we get each pip to be worth 2.5 EUR?
define NominalPipValue as the value of a single pip in deposit currency when
NominalPipValue can be calculated knowing the current exchange rate of the chosen pair.
you are trading EURUSD on a standard account with leverage 1:100. If your
deposit currency is USD then NominalPipValue will always be 10$, no matter
which is the exchange rate.
If your deposit currency is EUR then you must consider the exchange rate, more precisely the inverse of the exchange rate.
NominalPipValue = (10 / exchange rate)
If the current exchange rate EURUSD is for example 1.3333 then you’ll have:
NominalPipValue = (10$ / 1.3333) = 7.519 EUR
As you can see it’s pretty easy. Things get more complicated when you trade a pair like USDCHF and your deposit currency is in EUR or GBPJPY and your deposit currency is either EUR or USD. In fact in these cases you have to take into account a double exchange rate.
Fortunately we don’t need to do that as MetaTrader has a specific function that easily tells us NominalPipValue:
NominalPipValue = MarketInfo(Symbol(),MODE_TICKVALUE) (6)
This will work whichever pair your are trading and whichever your deposit currency is… even too easy now :)
changes with exchange rates so its value at order’s opening is different from
the one at order’s closure. Actual profit/losses are calculated using exchange
rate at order’s closure.
Unfortunately we do not know this value at the moment in which we open the order… anyway for variations of exchange rate in the order of typical SL the difference in NominalPipValue at opening and closure of the position is small enough to be ignored for the purpose of our calculation (less than 1% on for SL <= 100pips).
At this point we know that when buying/selling 1.00 Lots PipValue equals NominalPipValue. More in general we can say:
1.00 / NominalPipValue = X / PipValue (7)
is the nr. of Lots to trade.
We extract X from the equation (7) turning it into:
X = PipValue / NominalPipValue (8)
Good, we reached our target. Now we know how to convert Risk Capital in Lots!!!
example will clarify the procedure.
Let’s say keep going with our trade: risk 200 EUR when SL is 80 pips and the current exchange rate of EURUSD is 1.3333.
Remember that what we want to get is “X”, the nr. of Lots to trade!
According the equations described earlier we have:
X = PipValue / NominalPipValue
which according equations (5) and (6) corresponds in general to:
X = ( Risk Capital / StopLoss ) / MarketInfo(Symbol(),MODE_TICKVALUE)
or, for a standard EUR account with leverage 1:100
X = ( Risk Capital / StopLoss ) / (10 / exchange rate)
Using the numbers of the example:
X = ( 200 / 80 ) / ( 10 / 1.3333 ) = 2.5 / 7.5 = 0.33
then a position with Volume 0.33!
This will ensure that each pip is worth exactly 2.5 EUR. DONE :)
We've just seen a practical method for implementation of a sound MM system.
This article shows that the size of the order is not the only variable to be controlled/considered while implementing MM but also the size of SL plays a very important role.
We went through some theory and identified a bunch of equations useful to calculate the proper size of a position as function of the available Capital (FreeMargin) and SL. Moreover we stressed the importance of trading using hard SL and pointed reader’s attention on the fact that SL should NEVER be set in a fixed size irrespective of price action (Market’s conditions).
In other words a Trader should never gamble. A Trader should never gain from his trades less than expected and never lose more than planned.
Right, a Trader MUST have a plan.
As recalled in the article the plan of many Successful Traders is to risk less than 2% of available Capital (FreeMargin) on each trade… personally I don’t quite agree on the 2% rule… but that will be subject of another article :)
thing that Successful Traders do for sure is to split the preparation of a
trade into two simple operations:
1) identify the proper SL
2) calculate the size of the position by spreading the potential loss equally on each pip of the SL
Once this is done the trade may win or lose… If it’s a winning one, then cheers… If it’s a losing one nobody gets hurt cause the possible loss was taken into account and handled with knowledge.