Question

Suppose that I buy a at the money European Call on the EuroSTOXX 5O on the 1990/01/10 with maturity of 9 years. I would like to know what will be the maturity date. Any idea?

I can start with the quantmod package:

require(quantmod)
getSymbols("^STOXX50E", from = "1990-01-01")
maturity <- 9
dates <- index(STOXX50E)

The problem is that I cannot use

dates[1] + maturity*365

or

dates[1] + maturity*252

to find the maturity date because the number of working days varies across years.

Any idea?

Thanks.

Was it helpful?

Solution

I really like the lubridate package for this problem.

require(quantmod)
require(lubridate)
getSymbols("^STOXX50E", from = "1990-01-01")
maturity <- 9 # years

dates <- as.POSIXct(as.character(index(STOXX50E)), tz = "UTC") # needs to be in POSIXct format to work with lubridate, I believe.

maturity_dates <- dates + years(maturity) 

head(as.data.frame(list(dates = dates, 
                        maturity_dates = maturity_dates)))

  dates          maturity.dates
1 1990-01-01     1999-01-01
2 1990-01-02     1999-01-02
3 1990-01-03     1999-01-03
4 1990-01-04     1999-01-04
5 1990-01-05     1999-01-05
6 1990-01-08     1999-01-08
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top