0

I am trying to generate a formula that uses the following variables:

  • a = account balance
  • e = position entry point
  • L = leverage used
  • p = percentage of loss (in % format, not decimal)
  • x = stop loss price

this formula is trying to solve for x

a couple attempts generated this formula: $$x = {ap\over 100}\times {e \over aL} + e$$

but it came to be that acccount balance (a) factored out, and was useless.

The goal is to generate a stoploss price that when hit, would be p% loss of total account size when using leverage(L). If we were to use real numbers, they would look like this

EXAMPLES

My account has 0.105(a) BTC and I want a stoploss of 9%(p). If I enter in a position of 9613(e) with 4.7x(L) leverage, I should have a stoploss price of around 9802(x) in a short (im betting the price is going down, but instead it went up)

My Account has 9.43 ETH and I want a stoploss of 9%. If I enter into a position of 170.90 with 1x leverage, I should have a stoploss price of around 173.9 (math above calculates it as 182.6 giving a percentage of 6.87% instead of 9)

if my account balance(a) is larger, the price, x, should be higher

2 Answers2

0

You are expressing the acceptable loss as a percentage of the account, so the stop loss price should be higher than the entry point by a fixed percentage. If you had one account with $1$ BTC or ten accounts with $0.1$ BTC each, you would be willing to take the same percentage loss, so the stop loss value should be the same.

If you are willing to accept a $p\%$ loss, you hit that when the price moves by $\frac pL\%$ when you use leverage. Your formula reflects that, so if you are willing to accept a $9\%$ loss with leverage $4.7$ the price needs to move $\frac 9{4.7}\% \approx 1.9\%$, which agrees with your calculation.

Ross Millikan
  • 374,822
  • I appreciate that, and with the numbers that I was starting to use, everything checked out, but if I change to another set of variables, it doesnt hold up. I added another set of variables and the expected value to my question – Keven Scharaswak Sep 02 '19 at 23:15
  • I can't make sense of your new calculation. If you start at $170.9$ with leverage $1$, the price needs to move $9%$ to give a $9%$ loss, so it would have to move to $186.281$. That does not depend on how much you invest. – Ross Millikan Sep 03 '19 at 06:06
  • I was able to figure this out. The issue with this answer is that I was trying to use 9% of my account balance, not 9% of my position. In your last comment, you said "That does not depend on how much you invest". and you are correct. Position size is not a factor. A position will not be 100% of the account balance. usually less than 10%, and that is where the disconnect was. I wanted to ensure, regardless of my position size, I want to use my entire account balance (with respect to leverage) as a factor for calculating how much I'm willing to lose. – Keven Scharaswak Sep 09 '19 at 13:51
0

I found that I only need to use the Account Balance (a) to determine the true Leverage(L) and this much simpler formula got me there

for a buy order: $$x = e-(p/L\times 0.01)\times e).$$

for a sell order $$x = e+(p/L\times 0.01)\times e).$$