banner ad

Adding ‘Margin Management’ to Risk Management – Part 1

One of the things to avoid when trading the Forex is a margin call/stop out, when your broker will close your trade on the spot without asking your permission. If you are using a computer program (or Bot), most brokers will shut down your EA at the same time, preventing any future trades until you manually turn the EA back on.

Many trades never run the risk of a margin call. However, it’s very simple to check to see whether every trade is safe, eliminating the possibility altogether, simply by calculating the lot size of the trade from the viewpoint of “margin management” as well as risk management. Let me explain…

When I trade the Forex, I like to risk the maximum number of lots I can to maximize my profits. Therefore, I approach every trade by first deciding how much money I’m willing to lose, and then finding out how many lots I can trade to stay within that risk if the trade goes bad.

For example, if I have an account balance of $10,000, I might decide I’m willing to risk 10% of it on one trade, or $1000. If that trade turns out to be a loser, I don’t want to sacrifice any more than $1000 to the Forex gods.

So the question is, how many standard lots can I trade and stay within that $1000 risk if the trade turns out to be a bummer?

The answer to that question depends on a number of factors. Let’s look at them….

Risk Management

We already know that our account balance is $10,000, and that our risk is going to be 10% – or $1000. From a strictly “risk management” viewpoint, in order to determine the maximum number of lots we can trade, we also have to know:

1. The stop loss we are going to set in numbers of pips
2. The pip value (which depends on the currency pair)

Now it’s a very simple equation to determine the maximum lot size for any trade:

(Account Balance * (Risk/100)) / (Stop Loss in Pips * Pip Value) = Max Risk Lot Size

In simple English, we take the account balance ($10,000) and multiply it by the risk/100 (.1 in this case – 10 percent risk divided by 100) to get $1000 ($10,000 times .1). Then we divide that $1000 in risk by the number of pips of stop loss we have already decided on, times the pip value of each of those pips.

I happen to follow the advice of a number of Forex “experts” who say the Take-Profit-to-Stop-Loss ratio should be somewhere between a 2:1 to 4:1 ratio. So whenever I go into a trade, I already know what to expect in terms of profit, and therefore where I want to put my initial stop loss for that trade.

In this case, let’s say that I am hoping for a 40-pip profit and therefore have decided on a 20-pip stop loss. If I were only trading 1 standard lot, it would mean those 20 pips would comprise the entire $1000 risk. Therefore, each pip would be worth $50. But since the actual pip value is a lot less than that, I am free to lose more than 20 pips before I reach or exceed my $1000 risk; and I do that by trading more than 1 lot.

How many pips can I lose? Easy. We find out the pip value of each pip for the currency pair we’re trading and divide that into the $1000 risk. If our Account (Home) Currency is the USD and we’re trading the EUR/USD pair, the value of 1 pip per standard lot is $10. Divide that into the $1000 risk and we find out we can lose 100 pips on this trade and stay within our $1000 total risk.

If we can lose 100 pips on the trade and the stop loss is 20 pips, the result is clear: We can trade 5 lots.

(Account Balance * (Risk/100)) / (Stop Loss in Pips * Pip Value) = Max Risk Lot Size
( $10,000 * 10/100 ) / ( 20 * 10 ) = 5

Notice that for any currency where the USD is the Quote currency (xxxUSD), the pip value will always be $10. (Notice also that Leverage and Margin do not come into play in this Risk calculation.)

Let’s take another example….

Currency pair: USD/CAD
 Account Balance: $3000
 Risk: 5%
 Stop Loss: 15 pips
 Pip Value: ?

If you don’t know the pip value, you can always look it up online, or calculate it by dividing the number 10 by the Current Price of the currency pair (i.e., 10 divided by 1.0110 = $.9.89).

So let’s figure out the maximum number of standard lots we can trade in this case…

(Account Balance * (Risk/100)) / (Stop Loss in Pips * Pip Value) = Max Risk Lot Size
( 3000 * .05 ) / ( 15 * 9.89 ) = 1.01

Notice that for any currency where the USD is the Base currency (USDxxx), you will have to look up online or compute the pip value for a standard lot.

Let’s look at one more example….

Currency pair: GBP/USD
 Account Balance: $1000
 Risk: 10%
 Stop Loss: 5 pips
 Pip Value: $10

The formula…

(Account Balance * (Risk/100)) / (Stop Loss in Pips * Pip Value) = Max Risk Lot Size
( 1000 * .1 ) / ( 5 * 10 ) = 2

… says we could trade 2 lots. However, your broker will refuse to place this trade.

Why? Because to purchase and maintain a position of 2 lots in the GBP requires having over $3000 of equity in your account (for reasons to be explained in a minute), and that clearly is 3 times as much as you started with. So even though the Risk Management equation says you can trade 2 lots, the maximum number of lots you can actually buy and maintain under “Margin Management” with these numbers is .6 (based on 100:1 leverage and a current price of $1.50 for the GBP). Even if your broker DID place the trade, it would be stopped out immediately by a margin call.

To understand this completely, let’s look at what a margin call is, and when and why it happens….

Tags: , , , , , ,

Category: MQL Programming

About the Author (Author Profile)

Steve Fleming has been a professional programmer and Internet professional for over 15 years. is a way to empower the non-programmers and offers a FREE 5 day E-course showing how to build an EA (expert advisor). Steve also offers his mql programming services at very competitive rates and has programmed many, many strategies both for himself and his ever growing list of satisfied clients.

Comments (0)

Trackback URL | Comments RSS Feed

There are no comments yet. Why not be the first to speak your mind.

Leave a Reply