Position Size Calculator - where does leverage fit in?

Hi there

I’m looking at the position size calculator in the tools section of babypips (sorry, can’t post link - not enough posts) to work out how much I can risk on a trade.

I can understand the figures I’m given when inputting the data, but what I’m not sure about is how the amount of leverage I am using fits in to the equation? The calculator doesn’t ask for this info, and I’m a bit confused as to how I factor this in? Or am I missing something?

I’m sure I must be looking at this the wrong way somehow, can anyone please explain where I’m going wrong here?

Thanks for your help.

J

Suppose you have a MICRO ACCOUNT denominated in USD, and you are planning to take a position in the EUR/USD.

Let’s say:

your account balance is $1,865

you intend to risk no more than 2% of your balance on this trade

your stop-loss will be 45 pips from your entry price

1 pip, in this case, is worth $0.10 per micro-lot of position size

Using the method taught in the Babypips School, you would calculate POSITION SIZE to be 8 micro-lots.

Although you did not enter a leverage figure into your calculation, leverage is implied in the math.

You can easily determine the amount of leverage actually used in this trade, as follows:

Let’s say that the current price of the EUR/USD is 1.3762

Actual leverage used = (Notional Value of the Trade, in USD) / (Account Balance, in USD)

= (8 micro-lots) x (1,000 units of currency) x (EUR/USD exchange rate) / $1,865

= (8) x (1,000) x (1.3762) / 1,865

= 5.90

which means 5.90:1 actual leverage, or [B]6:1 actual leverage (in round numbers)[/B]

Here’s a POSITION SIZE formula which I developed several years ago, which you might find handy:

Number of Lots = [(Account Balance, in dollars) x (Risk %)] / [(Stop Loss, in pips) x (Pip Value, in dollars)]

I used this formula to determine the answer (8 micro-lots) in my previous post, as follows:

Number of Lots = [($1,865) x (0.02)] / [(45) x ($0.10)]

           = 8.29 micro-lots, which you would round down to 8 micro-lots

Hi Clint

Thanks for the reply and the formula, which will be really useful, however!, I am bit confused by answer 6:1 leverage. Isn’t the leverage always going to be a fixed amount at whatever I have chosen for my account?

Thanks

No. Leverage is different for every position size you enter. The leverage you have chosen for your account is only the [B]maximum [/B]leverage.

Dear All,

Since few day I am searching the correct way to calculate lot size however I just cannot find it.

The problem is that no one calculate LotSize regarding the Leverage used on the account.

Most of the time I see the following formula:

extern double FixedLots = 0.0;   // if > 0.0 fixed lots used
extern double Risk = 0.03;       // per cent of free margin of a single offer
extern int StopLoss = 10;

double CalculateLotSize()
{
    if(FixedLots > 0.0)
        return (FixedLots);

    double pipValue = MarketInfo(Symbol(), MODE_TICKVALUE);
    double lots = AccountFreeMargin() * Risk / (StopLoss * pipValue);
    
    double lotStep = MarketInfo(Symbol(), MODE_LOTSTEP);
    int digits = 0;
    if(lotStep <= 0.01)
        digits = 2;
    else if(lotStep <= 0.1)
        digits = 1;
    lots = NormalizeDouble(lots, digits);
      
      double minLots = MarketInfo(Symbol(), MODE_MINLOT);
      if(lots < minLots)
          lots = minLots;
      
      double maxLots = MarketInfo(Symbol(), MODE_MAXLOT);
      if(lots > maxLots)
          lots = maxLots;
      
      return (lots);
}

However, Imagine that your account have 500 Dollar, and you want to risk 3% of this, with an StopLoss of 10 Pips.

The calculated Lot Size given by this function would be around 1.89 which is to high for an account with 500Dollar and Leverage of 1:400

So my question is, do anyone know how to correctly get the correct lot size by also considering account leverage?

Please go back and carefully read this entire thread. Your question is answered, more than once, in this thread.

Account leverage (also called maximum allowable leverage, or broker leverage) is a maximum (a limit) imposed on your use of leverage. It is not the amount of leverage you are using, or would ever use. You would be a fool to use 400:1 actual leverage in any trade.

[B]Account leverage does not figure into position-size calculations.[/B]

Again, re-read this entire thread.

I don’t know where you got the code that you posted. I would suggest that you use a proven position-size calculator, such as the one available here on this website —

Position Size Calculator: Free Online Forex Position Sizing Calculator

If you lose that link, you can always get to the Position Size Calculator by clicking on [B]Tools[/B] (at the top of this page), then [B]Forex Calculators[/B] (on the left), and then on [B]Position Size Calculator[/B] (on the left).

In your example above, you did not specify which currency pair you are trading. The currency pair determines the pip-value (the dollar-value of 1 pip), and it’s not the same for all pairs.

Assuming that you are trading a pair of the form XXX/USD, such as EUR/USD for example, then the pip-value will be $10 per standard lot, $1 per mini-lot, $0.10 per micro-lot, and $0.01 per nano-lot.

However, the Position Size Calculator will figure all that out for you, if you just enter the [B]pair[/B] you are trading, along with the other required information.

If you input the numbers from your example above into the Position Size Calculator — and enter EUR/USD as the pair you are trading — you will get the following answer: the amount at risk is $15, and your position size can be up to 15,000 units of currency, which is 15 micro-lots. The Calculator also tells you that you may trade ZERO standard lots, or 1 mini-lot.

I use this to remind myself: risk/stop=lots
hope it helps…

Hello

Thanks to everyone for the thread. I’ve made an position sizing tool based on the thread. You could check it and tell me you think. I hope that this worksheet may be useful.

regards,
rju

POSITION_SIZE_CALCULATOR_R01.zip (8.08 KB)

1 Like

Hi

To answer the opening question you have to understand that there are 2 types of leverage. The first is the leverage offered by your boker which relates to your initial margin. The higher the broker leverage the less money is needed to open a position. The second is your real leverage. This is the amount of risk you are taking whilst trading.

Say you $10,000 have opened 5 standard lots with a cost of $10 a pips per lot. You are able to open this position size because your broker leverage is high ,say 500:1. So now you are trading at 5 lots at $10 dollars per pip or you will win or lose $50 for each pip the market moves.

You only need a drop of 100 pips and you have lost $5,000 from your account. A movement of less than 200 pips and you are busted.

So remember you can use high broker leverage a long as you keep your real leverage low. You will then be avoid over trading your account.

1 Like

This is actually a really good answer. Thanks for posting. :slight_smile:

Thank you so much for your clear, concise explanations, Clint! I’ve wondered about how leverage figures into position sizing - I never realized it was implied in the calculation.

One thing I’d like to ask your opinion on is this: the margin required by my broker is based on the account leverage they give (ie, the maximum allowable leverage). The higher the account leverage, the lower the margin requirement. And of course they make it ridiculously easy to change the leverage on your account. If the actual leverage you use to trade is in the position-sizing equation, is it beneficial to request the maximum leverage possible on the account (1:500) so as to use as little margin as possible (ie, your own money), BUT to only actually use a fraction of the account leverage in trading? Would you reduce the likelihood of a margin call?

Yes.

I have often said that I would like to have [B]10,000:1 account leverage.[/B] However, I would continue to use 5:1 (or, at most, 10:1) [I]actual leverage.[/I] This is just a dramatic way of saying that I’d like to be able to do my 5:1 thing, without ever having to consider margin.

[I]Generally,[/I] we say that account leverage is inversely related to required margin — and [I]generally[/I] we are correct. However, I recently discovered a broker who offers fairly high account leverage, but requires [B]zero margin[/B] on all trades. When I first saw that, I had to go back and re-read it; I thought, How is that possible? Well, obviously it [I]is[/I] possible (at least, in the country where that broker is domiciled). I’m not aware of any other broker offering such an arrangement.

So, from now on, whenever I answer a question about leverage and/or margin, I will continue to point out that account leverage and required margin are inversely related (leverage = 1 ÷ margin, and margin = 1 ÷ leverage) — but, I will have to add the word [I]generally[/I] to that statement.

Yes. And reducing the possibility of getting kicked out of a trade that you want to stay in seems like a good thing, at first glance. But, here’s another consideration. Margin not only provides certain protections to your broker; margin also protects you from a total account wipe-out. If your broker requires 1% margin, then in a margin-call situation, after all your open positions are forcibly closed, you will still have 1% of the total notional value of those positions. 1% of something is better than zero.

But, run some typical numbers on paper, [I]and see whether any of this is even worth worrying about,[/I] given the terms and conditions of [I]your[/I] account, and the way [I]you[/I] trade.

If you have 100:1 leverage (1% margin), or even 50:1 leverage (2% margin), and if you trade with something like the 5:1 actual leverage that I typically use — or even the 10:1 actual leverage that I [I]occasionally[/I] use — you surely would have protective stops set to take you out of all your positions [I]long before a margin call became an imminent threat.[/I]

Here are some [I]hypothetical[/I] numbers:

$10,000 account, 50:1 account leverage, 2% required margin

10:1 actual leverage, position size 100,000 USD (10 times your account balance)

$2,000 “used margin” (2% of position size), $8,000 “available margin”

Position: 1 standard lot (100,000 USD) of USD/JPY

Pip-value: $13 per pip, per standard lot

Pip-loss required to consume all of your $8,000 “available margin”: [B]615 pips[/B] ($8,000 ÷ $13 per pip).

I’ll bet that your S/L would be a [B]lot[/B] closer than 615 pips from entry!

Ergo, margin call is no threat.

Would this hypothetical trade make sense from a risk-management perspective? Maybe not. This trade may have problems, but the threat of a margin call is not one of them.

Hi, Sir,

What is the formula to compute true leverage if I wish to trade USD/JPY and my account currency is USD?

Thanks!

You haven’t provided enough information.

In order to answer your question, I need to know how large a position in USD/JPY you are taking, and I need to know the actual balance in your account. I’ll assume some numbers, in place of the missing information, in order to give you an answer.

Here are 3 examples:

[B]1.[/B] Your account balance is $963, and your position size is 1 mini-lot of USD/JPY ( = 10,000 units of USD = $10,000)

Your actual leverage used in this trade is 10,000 ÷ 963 = [B]10.4 : 1[/B] (rounded up)

[B]2.[/B] Your account balance is $132, and your position size is 1 micro-lot of USD/JPY (= 1,000 units of USD = $1,000)

In this case, your actual leverage used is 1,000 ÷ 132 = [B]7.6 : 1[/B] (rounded up)

[B]3.[/B] Your account balance is $1,355, and your position size is 8 micro-lots of USD/JPY (= 8,000 units of USD = $8,000)

In this example, your actual leverage used is 8,000 ÷ 1,355 = [B]5.9 : 1[/B]

[B]Actual leverage used is a simple comparison of the size of your position compared to your account balance.[/B]

In the case of a USD/JPY trade (or a trade involving any pair of the form USD/XXX) and a USD-denominated account, the calculation is quite easy, because you don’t have to include an exchange rate in your calculation.

This sort of easy calculation applies, as well, to other situations where the base currency and the account currency are the same. For example, if your account is denominated in euro, then for every trade involving a EUR pair, position size in units of base currency = position size in euro — without having to apply an exchange rate. (Note that, in [B]every[/B] currency pair involving the EUR, the EUR is [B]always[/B] the base currency.)

If I have a $100 account and I want to trade 1 micro-lot, how would you calculate the pip value for a EUR/USD trade??
A micro lot would mean that I my leverage is 10:1, right?

Current rate is 1.2670.

(.0001/ 1.2670) x 1,000= $.00789266 and then multiply it by 1.2670?? Making the pip value (.00789266 x 1.2670)= .1??

did i do this correctly or should the .0001 be a different figure?

I can’t seem to completely wrap my head around the method for calculating this as well as profit/ loss… any example I find is done with a standard lot so I’m a tiny bit confused…

any help would be greatly appreciated!!

thanks :slight_smile:

A standard lot is $100,000. A Mini lot is $10,000. A micro lot is $1,000, and a nano lot is $100.

Your account has $100 in it. $100 is 1/10th of a micro, or $1,000, so yes, your actual leverage is 10/1.

And yes, your pip value of $0.10 is correct.

If I buy one lot would that mean that if price went from 1.2670 to 1.2690 (a change of +20 pips) and I closed out a long trade, my profit would be $2??

I know it’s probably a really simple and newbie question so thank you for taking the time to help!

Yes. pip_total * .10 = net gain, or loss after spread. So if it’s 20 pip gain, it’s $2.00 total.

Have you been through the BP school? It will fill in all the details, and many more. It will really save you a lot of time in the learning curve.

Start with the pre-school, and take your time through it. It explains everything you’ll ever need to know about forex:)

Plus, any time you get confused, you can always get an explanation here.

Haha! Thanks, Clint!

I was inputting the position size and pip value calculator in my excel file. That’s my way of internalizing the formulas and the computations. I had a difficult time figuring out the formula for USD/JPY when account currency is in USD. It’s funny that it turns out to be one of the simpler formulas.