-1
$\begingroup$

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.

$\endgroup$

1 Answer 1

2
$\begingroup$

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.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.