Calculating Daily Log Returns from Intraday Price Data
Summary
The document explains how to calculate a daily log return when a business day contains multiple irregularly spaced price observations. The suggested procedure is to choose the latest timestamp’s price for each day as that day’s closing price, then calculate the log ratio between closing prices on consecutive business days. This produces one daily return per adjacent pair of daily closes.
The answer distinguishes this daily measure from averaging returns between individual intraday observations, which would answer a different question. The example is conceptual and provides no empirical comparison or discussion of data cleaning. Its result depends on treating the final timestamp as a suitable close and on having comparable, correctly ordered prices across days; it does not address missing observations, market close conventions, or adjustments for corporate actions.
Key ideas
- Use the final observed price of each business day as its close when that convention fits the data.
- Calculate a daily log return from the ratio of consecutive daily closing prices.
- Averaging intraday trade returns is a different calculation from measuring close-to-close daily performance.
- The method assumes timestamps and prices are suitable for defining comparable daily closes.
Tags
Full text
# How do I understand and calculate daily log returns? # How do I understand and calculate daily log returns? I'm relatively new to the Quantitative community. I was trying to work with a dataset where I want to calculate daily log returns. My dataset consists of multiple timestamps for each business day and I'm not sure how to compute this. My dataset looks something of this sorts, where I have several days and each day several timestamps (non uniform): ``` --------------------- | dt | time | price | | 01 | 0001 | 10.00 | | 01 | 0003 | 10.50 | .... | 01 | 0004 | 11.97 | |.... | 02 | 0002 | 11.50 | |.... | 02 | 0034 | 12.50 | |.... | 02 | 0048 | 13.34 | --------------------- ``` I would appreciate some guidance as to understanding what is meant by calculating daily log returns. The formulae I have seen online indicate doing `log(price(t)/price(t-1))` but I'm a little confused for how I work when I have multiple prices in a day. Do I calculate the daily log returns as `log(Price of last timestamp / Price of first timestamp)` for each day in the dataset? Or would I need to calculate the `log(Price of trade t / Price of trade t-1)` and then take their mean? Sorry if the question might be a bit confusing, but I'm just trying to understand the mathematics behind this. ## Answer by Sane (score 2, accepted) https://quant.stackexchange.com/a/79238 When you have multiple timestamps for each business day, you can still calculate the daily log returns by using the formula you mentioned: $log(Price(t) / Price(t-1))$. To do this, you would select the price with the highest timestamp on any day as the 'closing price' for that day and then apply the formula to closing prices of two consecutive days.
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.