Hi Raghu,

My tradesys package has two functions--splice and splooth--that were
written with this very task in mind. Download the package from 

https://r-forge.r-project.org/projects/tradesys/

and read the documentation. Whilst the package is still in alpha stage,
these functions ship with unit tests. I use them extensively myself for
constructing smoothed generic futures series' from a postgresql database
consisting of thousands of tables of individual contract expiries (eg,
TYM0, TYU0, ...). They work, and can be verified against bloomberg's
generics. 

As for expiry dates, the package timeDate contains most of the logic you
need. For example, 

> library(timeDate)
> timeNthNdayInMonth(timeFirstDayInMonth(Sys.Date()), nday = 3, nth = 3)
GMT
[1] [2010-08-18]
>

calculates the third Wednesday of the current month. 

Robert

-----Original Message-----
From: r-sig-finance-bounces@stat.math.ethz.ch
[mailto:r-sig-finance-bounces@stat.math.ethz.ch] On Behalf Of Raghu
Sent: 04 August 2010 21:46
To: R-Finance
Subject: [R-SIG-Finance] Futures Roll?

guRus

Is there any function to get a continuous stream of futures time series
when
the inputs are a series of contracts? specifically if the contracts are
x1,
x2, x3 etc, then the output X should be defined as x1 which gets rolled
over
to x2 at a predetermined date (say n days before the expiry of x1) and
then
x2 to x3 etc.
x= x1 (upto date1) then x=x2(upto date2).......

Bloomberg's GFUT does something similar.

Also Is there a function to check an expiry date given a logic, say
every
third wednesday of the month prior to the futures month (options expiry)
etc?

Thx
-- 
'Raghu'

	[[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.
-- Also note that this is not the r-help list where general R questions
should go.
---------------------------------------------------------------------------------------
This email message has been delivered safely and archived online by Mimecast.
A true SaaS solution, Mimecast provides the security, continuity and archiving for millions of emails, across thousands of customers every day.
For more information please visit http://www.mimecast.co.uk 
---------------------------------------------------------------------------------------
	[[alternative HTML version deleted]]

