Thank you so much for your time JeffM1

This is great and does solve that problem, but there seems to be a variable missing.

For example, if I have

[email protected] and

[email protected] using this calculation does not work out:

2p = 10088 - 6225 = p = 1931.5

That is because, in your second case, the difference in shares long and shares short is 3, not 2. That is why I worked out your first example: understanding the logic behind a formula is far more important than memorizing a formula. Formulas that are not understood are dangerous because they frequently are misused.

$8(p - 1261) = \text { realized gain (or loss) on } 8 \text { shares long.}$

$5(1251 - p) = \text { realized gain (or loss) on } 5 \text { shares short.}$

$\therefore 8(p - 1261) + 5(1251 - p) = 0 \implies 8p - 10088 + 6255 - 5p = 0 \implies$

$8p - 5p = 10088 - 6255 \implies 3p = 3833 \implies p =1277 \text { and } \dfrac{2}{3}.$

Does that work out?

$8 \left ( 1277 + \dfrac{2}{3} - 1261 \right ) = 8 * \left ( 16 + \dfrac{2}{3} \right ) = 128 + \dfrac{16}{3} = 133 + \dfrac{1}{3}.$

$5 \left ( 1251 - \left \{ 1277 + \dfrac{2}{3} \right \} \right ) = -\ 5 * \left ( 26 + \dfrac{2}{3} \right ) = -\ \left ( 130 + \dfrac{10}{3} \right ) = -\ \left ( 133 + \dfrac{1}{3} \right ).$

Yes, that works exactly. In practice, of course, it may not be possible to achieve the exact breakeven price due to fractions.

The general formula is as follows:

$q = \text { purchase price on long transaction;}$

$r = \text { sales price on short transaction;}$

$m = \text { number of shares long;}$

$n = \text { number of shares short; and}$

$p = \text { breakeven price.}$

$m = n \text { and } q \ne r \implies p \text { does not exist.}$

$m = n \text { and } q = r \implies p \text { is anything.}$

$m \ne n \implies p = \dfrac{mq - nr}{m - n}.$

To derive the last:

$m(p - q) + n(r - p) = 0 \implies mp - mq + nr - np = 0 \implies mp - np = mq - nr \implies$

$p =\dfrac{mq - nr}{m - n}.$