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.