日本時間と時間外の特徴
# パッケージの呼び出し
library(quantmod)
# 開始日
startDate = as.Date("2001-01-04")
# 終了日
endDate = as.Date("2013-12-06")
# 始値
op <- dataJPY$USDJPY.Open
# 終値
cl <- dataJPY$USDJPY.Close
# 全体の値動き
all <- window(log(cl / lag(cl)) * 100, start = startDate, end = endDate)
# オーバーナイトの値動き
overNight <- window(log(op / lag(cl)) * 100, start = startDate, end = endDate)
# 日本時間の値動き
jpyTime <- window(log(cl / op) * 100, start = startDate, end = endDate)
# グラフの枠組み
par(mfcol = c(3, 1))
# 全体の値動きのグラフ
all2 <- cumsum(all)
matplot(all2, type = "l")
# オーバーナイトの値動きのグラフ
overNight2 <- cumsum(overNight)
matplot(overNight2, type = "l")
# 日本時間の値動きのグラフ
jpyTime2 <- cumsum(jpyTime)
matplot(jpyTime2, type = "l")
上から順にUSDJPYの全体、日本時間外、日本時間の値動き。