1

1990/01/10 に満期 9 年で EuroSTOXX 5O のアット ザ マネー ヨーロピアン コールを購入するとします。満期日がいつになるか知りたいです。何か案が?

quantmodパッケージから始めることができます:

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

使えないのが難点

dates[1] + maturity*365

また

dates[1] + maturity*252

稼働日数は年によって異なるため、満期日を見つける。

何か案が?

ありがとう。

4

1 に答える 1

1

lubridateこの問題のパッケージがとても気に入っています。

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
于 2013-10-26T17:37:38.990 に答える