you need a data set of 3 column (date, open, and close) ordered by date. the close data is a time-shifted value ( so an open date has a corresponding 5-days shifted close data); subset this data on all monday, then take difference in log you get the log return.

Is this simple enough?


--- On Wed, 7/1/09, John Kerpel <john.kerpel@gmail.com> wrote:

From: John Kerpel <john.kerpel@gmail.com>
Subject: [R-SIG-Finance] Calculating returns
To: r-sig-finance@stat.math.ethz.ch
Date: Wednesday, July 1, 2009, 11:27 AM

Hi folks!

I'm sure there's an easy way to do this, but what I need to do is calculate
weekly returns from daily OHLC data, but I want my weekly return equal
log(Friday Close) - log(Monday Open).  I'm using timeSeries from RMetrics
and I don't see a quick easy way to do this.  Any ideas?

Best,

John

    [[alternative HTML version deleted]]

_______________________________________________
R-SIG-Finance@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only.
-- If you want to post, subscribe first.



      
	[[alternative HTML version deleted]]

