Skip to content
All library documents

Interpreting Log Returns for Short Positions

Article Quant Q&A · Author: starriet 차주녕

Summary

The document examines whether a short position’s log return can be represented by negating the underlying asset’s log return. For prices at two times, that operation reverses the log price ratio, and summing such increments gives a cumulative change in the value of a liability that tracks the asset price inversely. The answer compares this log measure with arithmetic returns and uses a price decline to illustrate how the short seller’s changing repayment obligation differs from a percentage return on invested capital.

The central caveat is that a short’s log liability change is not the same as the short position’s portfolio return or profit as a percentage of initial capital. Those depend on proceeds, collateral, margin, financing, and the definition of wealth being tracked. Log returns also do not equal simple returns except approximately for small moves; converting a log change to an arithmetic return requires exponentiation with the sign and quantity defined consistently.

Key ideas

  • Negating the underlying asset’s log return gives the log change in an inverse price liability.
  • Summed log increments describe cumulative log change in that liability across periods.
  • A short seller’s portfolio return depends on the capital and cash flows included in the return definition.
  • Log returns and arithmetic returns are distinct, with the difference becoming material for large price moves.
  • The short position’s interpretation should distinguish liability value from account wealth and profit.

Tags

Full text
# Is it possible to calculate logarithmic return for short position?


# Is it possible to calculate logarithmic return for short position?












In the book "Python for Algorithmic Trading" by Yves Hilpisch,

it calculates the logarithmic return by summing up all the log values.

When calculates the profit for long position: log(current_price/past_price)

When calculates the profit for short position: -1*log(current_price/past_price)

And summing up all these log values.

Is the above logic correct for calculating the profit for short position?

In Python code, it's something like this: (`data` is Pandas `Dataframe`. So, `shift(1)` means just the last price.)

```
# (I shortened the code a bit, but the logic is the same.)
if long:
    data['returns'] = np.log(data['price']/data['price].shift(1))

elif short: 
    data['returns'] = np.log(data['price']/data['price].shift(1)) * (-1)

# final return 
data['returns'].sum()
# plotting
data['returns'].dropna().cumsum().apply(np.exp).plot()
```

the logic for the long position is okay, but... that of the short position is not correct, I think.

(I also read this answer which seems correct, and still don't know why the above logic is correct.)

P.S. Let's say I shorted a stock with \$10 when it's \$100 and now it's \$20. Then my asset would be \$18 (80% profit). But, the above equation says my asset becomes \$50 ->This is the point I don't understand.

## Answer by AKdemy (score 2)

https://quant.stackexchange.com/a/68104

Did you try the differences?

You can check out logarithmic properties in this answer. Specifically,

> Reason 2: The log difference is independent of the direction of change

If you code it, you see that the logarithmic return for $$ -1*log(p_1/p_0) = log(p_0/p_1)$$

```
p0 = 100
p1 = 101
retPos = p1/p0-1
retNeg = 1-p1/p0
retLogPos = log(p1/p0)
retLogNeg = log(p0/p1)
retNegSE = -1*retLogPos
println("Positive Return = $retPos")
println("Positive Log Return = $retLogPos")
println("Negative Return = $retNeg")
println("Negative Log Return = $retLogNeg")
println("Negative Log Return Alternative = $retNegSE")
```

Edit: Log return do NOT equal normal returns as this answer explains. The relationship between normal and log returns is $$(normal return) = exp(log return)-1$$

```
p0 = 100
p1 = 20
retPos = p1/p0-1
retNeg = 1-p1/p0
retLogPos = log(p1/p0)
retLogNeg = log(p0/p1)
retNegSE = -1*retLogPos
println("Positive Return = $retPos")
println("Positive Log Return = $retLogPos")
println("Negative Return = $retNeg")
println("Negative Log Return = $retLogNeg")
println("Negative Log Return Alternative = $retNegSE")
println("Order doesnt matter for log: $(retLogNeg == retNegSE)")
println("Normal return from Log = $(1- exp(-retLogNeg))")
```

If you get small differences, this is not a computational error but explained by floating point math: Python Docs Rounding in Python Is floating point math broken

In my initial example I made a silly mistake. I used $p0/p1-1$ instead of $1-p1/p0$ which equals $(p0-p1)/p0$. It does not affect the log return computation but the arithmetic return itself. Apologies for the confusion. I need to look more properly before answering - thanks for teaching me a lesson!

The reason I used -retLogNeg is that A = P e^rt = `$100 * e^-1.6094379124341003 = $20` (start value to get today's value). Technically, this assumes that the short sell is a liability that must be paid back at a future date. If it drops to zero, your liability vanishes and you get 100% return as you correctly stated.

The change in log is not a percentage per se, it approximates it for small changes (returns) as shown in my initial link.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.