The Claude Quant PlaybookDownload ebookDownload ebook

Simple and log returns

beginnerTime series1 of 8

Two ways to measure the same price move. Simple returns add up across assets in a portfolio; log returns add up across time.

Build a trading system with Claude.Download ebook

01The formula

the price at the end of period t
the simple return: the percentage change in price
the log return: the natural log of the price ratio
the log return over the whole stretch from period 1 to T

02See it move

03Where it is used

04Why traders use it

Mixing them up gives wrong answers in both directions: adding simple returns over time overstates growth, and averaging log returns across assets understates a portfolio. Knowing which one adds where avoids both.

05Worked example

A day of 20.0% is a log return of 18.23%. Follow it with a day of −20.0%: the simple returns add to 0.00%, but the two-day return is really −4.00%. Adding the log returns and converting back gives −4.00%, the right answer.

06How it is built

  1. Over two days the price ratio multiplies: .
  2. Take logs: . Log returns add over time.
  3. For small moves , so the two are close for daily returns and drift apart for big moves.
  4. Convert back with .

07The common mistake

Averaging simple returns over time to get a growth rate. Gains of +20% and −20% average to zero, yet you are down; the average log return tells the truth.

08In Python and LaTeX

import numpy as np
r1, r2 = 0.2, -0.2
print(round(np.log(1 + r1), 4), round((1 + r1) * (1 + r2) - 1, 4))  # 0.1823 -0.04
R_t = \frac{P_t}{P_{t-1}} - 1, \qquad r_t = \ln\frac{P_t}{P_{t-1}} = \ln(1 + R_t), \qquad r_{1 \to T} = \sum_{t=1}^{T} r_t

09Where it fits

Rather not code the maths yourself? Describe your trading idea and let AI build the bot.

Build a bot with AgenKit

The worked example and the model run the same code, so every number matches. Models simplify markets on purpose. This is education, not financial advice.