How to calculate Maximum Position Size by Stop-Out Level and Margin Leverage

Osoarrogant

Trader
Jun 28, 2023
4
0
6
23
Hi there,
Please read carefully.
I am well aware od the leverage calculators, but they dont allow me to calculate my stop loss point.
I want to be able to calculate the maximum LOT size I can use and not get stopped out of the trade up until it actually hits my SL

Example:
So lets say I want to enter EURUSD Buy/Long position and I have a 300 euro account with 500:1 leverage. My SL position is 50 pips further down from my entry point. What would be the maximum LOT size I can use in order to not get stopped out before the price would drop those 50 pips I set as stop loss?
 

Enivid

Administrator
Staff member
Nov 30, 2008
18,104
1,267
144
Odesa
www.earnforex.com
That's an interesting question. To answer it, it's crucial to understand what stop-out level is and how the formula for checking whether it was hit works. For the sake of simplicity let's consider that your account is in USD, not in EUR.

Stop-out level is the threshold value for the account's margin level when all trades will be closed. Margin level is calculated as Equity / Used Margin.

For example, if your account's stop-out level (set by the broker) is 30%, then your trades will get automatically closed when Equity / Used Margin = 0.3.

And what is Equity for the purpose of your task? It is the equity that will be in your account when your trade reaches the stop-loss, so it's Account Balance - Position Size * Stop-Loss * 10. Or for your example, Equity = 300 - PS * 50 * 10, where PS is the position size, which we are trying to calculate.

Used Margin is (PS * Contract Value) / Leverage. For a EUR/USD trade and USD account, the Contract Value depends on the current EUR/USD price, let's use 1.09. Then For your example, UM = (PS * 109,000) / 500.

Now, if we combine everything with the margin level formula, we get:

0.3 = ((300 - PS * 50 * 10) * 500) / (PS * 109,000)

0.3 * 109,000 * PS = (300 - PS * 50 * 10) * 500

32,700 * PS = 150,000 - 250,000 * PS

32,700 * PS + 250,000 PS = 150,000

282,700 * PS = 150,000

PS = 0,53 - this is in standard lots.

In general, the formula for quick calculation (which you can create in Excel for example) is the following:

PS = (Balance * Leverage) / (Contract Value * Stop-out Level + SL * Leverage * 10)

Important note #1: "10" is the value of 1 pip for 1 standard lot.

Important note #2: If your account is not in USD, two adjustments have to be done. First, the contract value becomes 100,000 (for EUR/USD). Second, that "10" becomes "10 divided by EUR/USD Bid rate".

Important note #3: If you are trading some other currency pair, all the necessary conversions have to be done accordingly. For example, if you are trading AUD/NZD, the contract value has to be adjusted (because it's 100,000 AUD) and the pip value should be adjusted (because it is 10 NZD).

I hope this makes sense.

EDIT: Important note #4: If you have other trades open in your account, this becomes quite complicated and somewhat unsolvable.
 
  • 👍
Reactions: Osoarrogant

Osoarrogant

Trader
Jun 28, 2023
4
0
6
23
That's an interesting question. To answer it, it's crucial to understand what stop-out level is and how the formula for checking whether it was hit works. For the sake of simplicity let's consider that your account is in USD, not in EUR.

Stop-out level is the threshold value for the account's margin level when all trades will be closed. Margin level is calculated as Equity / Used Margin.

For example, if your account's stop-out level (set by the broker) is 30%, then your trades will get automatically closed when Equity / Used Margin = 0.3.

And what is Equity for the purpose of your task? It is the equity that will be in your account when your trade reaches the stop-loss, so it's Account Balance - Position Size * Stop-Loss * 10. Or for your example, Equity = 300 - PS * 50 * 10, where PS is the position size, which we are trying to calculate.

Used Margin is (PS * Contract Value) / Leverage. For a EUR/USD trade and USD account, the Contract Value depends on the current EUR/USD price, let's use 1.09. Then For your example, UM = (PS * 109,000) / 500.

Now, if we combine everything with the margin level formula, we get:

0.3 = ((300 - PS * 50 * 10) * 500) / (PS * 109,000)

0.3 * 109,000 * PS = (300 - PS * 50 * 10) * 500

32,700 * PS = 150,000 - 250,000 * PS

32,700 * PS + 250,000 PS = 150,000

282,700 * PS = 150,000

PS = 0,53 - this is in standard lots.

In general, the formula for quick calculation (which you can create in Excel for example) is the following:

PS = (Balance * Leverage) / (Contract Value * Stop-out Level + SL * Leverage * 10)

Important note #1: "10" is the value of 1 pip for 1 standard lot.

Important note #2: If your account is not in USD, two adjustments have to be done. First, the contract value becomes 100,000 (for EUR/USD). Second, that "10" becomes "10 divided by EUR/USD Bid rate".

Important note #3: If you are trading some other currency pair, all the necessary conversions have to be done accordingly. For example, if you are trading AUD/NZD, the contract value has to be adjusted (because it's 100,000 AUD) and the pip value should be adjusted (because it is 10 NZD).

I hope this makes sense.

EDIT: Important note #4: If you have other trades open in your account, this becomes quite complicated and somewhat unsolvable.
Thank you for the in depth explination.
I will try my best to learn this forumla.
I have stumbled upon this Oanda margin call calculator - https://www1.oanda.com/forex-trading/analysis/margin-call-calculator

It pretty much uses the same formula as you did, except the margin stop out is at 50 percent with the Oanda broker. The issue is that the calculator offers you obly up to 100:1 leverage.
I use 500:1, so I was wondering would there be a quicker way to calculate my margin call stopout this way, just to make sure it takes the 500:1 leverage into equation?
 

AlexOZ

Trader
Apr 22, 2023
59
7
14
71
Thank you for laying out the calculations. I wrote a similar thing with multiple currencies and leverage calcs for my EA. As time moves on though I forget the specifics ha ha. I guess my underlying question, unless I'm getting this wrong, why would one considering trading close to margin calls?
 

Enivid

Administrator
Staff member
Nov 30, 2008
18,104
1,267
144
Odesa
www.earnforex.com
Thank you for the in depth explination.
I will try my best to learn this forumla.
I have stumbled upon this Oanda margin call calculator - https://www1.oanda.com/forex-trading/analysis/margin-call-calculator

It pretty much uses the same formula as you did, except the margin stop out is at 50 percent with the Oanda broker. The issue is that the calculator offers you obly up to 100:1 leverage.
I use 500:1, so I was wondering would there be a quicker way to calculate my margin call stopout this way, just to make sure it takes the 500:1 leverage into equation?
Quicker than what? You have a one-line formula that works with any leverage and stop-out level and can be inserted into an Excel spreadsheet.
 
  • 👍
Reactions: Osoarrogant

Enivid

Administrator
Staff member
Nov 30, 2008
18,104
1,267
144
Odesa
www.earnforex.com
Thank you for laying out the calculations. I wrote a similar thing with multiple currencies and leverage calcs for my EA. As time moves on though I forget the specifics ha ha. I guess my underlying question, unless I'm getting this wrong, why would one considering trading close to margin calls?
If you don't want to keep all your trading money in the account, it makes sense to transfer just enough money for one trade. Then, making sure this trade closes at stop-out is quite sensible.
 
  • 👍
Reactions: Osoarrogant

Osoarrogant

Trader
Jun 28, 2023
4
0
6
23
If you don't want to keep all your trading money in the account, it makes sense to transfer just enough money for one trade. Then, making sure this trade closes at stop-out is quite sensible.
Sir, I am not going to lie, that forumla is too complex for my low Math brain.
Is there a way for me to use the oanda margin call calculator I linked you in order to make my calcuations in 500:1 leverage, as the calculator offers only up to 100:1
 

Enivid

Administrator
Staff member
Nov 30, 2008
18,104
1,267
144
Odesa
www.earnforex.com
Sir, I am not going to lie, that forumla is too complex for my low Math brain.
Is there a way for me to use the oanda margin call calculator I linked you in order to make my calcuations in 500:1 leverage, as the calculator offers only up to 100:1
No, I don't think so. But you could try asking them to amend their calculator.