2019年3月29日金曜日

EPS update 2019/3/29



2018-07-01 130.39000
2018-10-01 138.87000
2019-01-01 140.74000
2019-04-01 144.92000
2019-07-01 148.75000
2019-10-01 154.37000


eps_year_xts["2018-07-01"] <- 130.39
eps_year_xts["2018-10-01"] <- 132.37
eps_year_xts["2019-01-01"] <- 133.63
eps_year_xts["2019-04-01"] <- 137.89
eps_year_xts["2019-07-01"] <- 142.28
eps_year_xts["2019-10-01"] <- 155.33

eps_year_xts <- append(eps_year_xts,as.xts(c(166.08,166.08,170.83,175.56),seq(as.Date("2020-01-01"),as.Date("2020-10-01"),by='quarters')))

2019/4/4

eps_year_xts["2018-07-01"] <- 130.39
eps_year_xts["2018-10-01"] <- 132.39
eps_year_xts["2019-01-01"] <- 133.32
eps_year_xts["2019-04-01"] <- 137.04
eps_year_xts["2019-07-01"] <- 140.95
eps_year_xts["2019-10-01"] <- 153.59
eps_year_xts["2020-01-01"] <- 158.91
eps_year_xts["2020-04-01"] <- 163.88
eps_year_xts["2020-07-01"] <- 168.59
eps_year_xts["2020-10-01"] <- 173.18

2019年3月26日火曜日

New model CLI 6 month delta, EPS, PA, UC and CS


# New model CLI 6 month delta, EPS, PA, UC and CS
# when k2k is like
k2k
# [1] "2000-01-01::2018-12-31"
# calculate cli 6 month delta
diff(cli_xts,lag=6)[k2k]
summary(lm(apply.quarterly(SP5[,4][k2k],mean) ~ eps_year_xts[k2k]+apply.quarterly(PA[k2k],mean)+apply.quarterly(CS[k2k],mean)+apply.quarterly(UC[k2k],mean)+apply.quarterly(diff(cli_xts$oecd,lag=6)[k2k],mean)))

# Call:
# lm(formula = apply.quarterly(SP5[, 4][k2k], mean) ~ eps_year_xts[k2k] +
#     apply.quarterly(PA[k2k], mean) + apply.quarterly(CS[k2k],
#     mean) + apply.quarterly(UC[k2k], mean) + apply.quarterly(diff(cli_xts$oecd,
#     lag = 6)[k2k], mean))
#
# Residuals:
#      Min       1Q   Median       3Q      Max
# -154.102  -50.869   -2.623   56.146  165.534
#
# Coefficients:
#                                                           Estimate Std. Error t value Pr(>|t|)
# (Intercept)                                             -9.881e+03  3.509e+02 -28.158  < 2e-16 ***
# eps_year_xts[k2k]                                        5.913e+00  5.475e-01  10.800  < 2e-16 ***
# apply.quarterly(PA[k2k], mean)                           8.689e-02  2.975e-03  29.204  < 2e-16 ***
# apply.quarterly(CS[k2k], mean)                          -5.506e+00  4.333e-01 -12.708  < 2e-16 ***
# apply.quarterly(UC[k2k], mean)                           1.126e-01  3.999e-02   2.816  0.00632 **
# apply.quarterly(diff(cli_xts$oecd, lag = 6)[k2k], mean)  7.684e+01  9.961e+00   7.715 6.12e-11 ***
# ---
# Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#
# Residual standard error: 74.13 on 70 degrees of freedom
# Multiple R-squared:  0.9806, Adjusted R-squared:  0.9792
# F-statistic: 706.6 on 5 and 70 DF,  p-value: < 2.2e-16

result.eps <- lm(apply.quarterly(SP5[,4][k2k],mean) ~ eps_year_xts[k2k]+apply.quarterly(PA[k2k],mean)+apply.quarterly(CS[k2k],mean)+apply.quarterly(UC[k2k],mean)+apply.quarterly(diff(cli_xts$oecd,lag=6)[k2k],mean))

result.gpuc <- lm(apply.quarterly(SP5[k2k],mean)[,1] ~ PAq[k2k] * UCq[k2k] * G[k2k]*CSq[k2k] - UCq[k2k] -G[k2k] - PAq[k2k]*G[k2k] - UCq[k2k]*G[k2k]*CSq[k2k])

SP5.result <- merge(residuals(result.gpuc),predict(result.gpuc),residuals(result.eps),predict(result.eps))
GSPC.predict <- merge(to.monthly(GSPC)[substr(k2k,11,23)],last(spline(seq(1,length(SP5.result[,1]),1),as.vector(SP5.result[,2]),n=length(SP5.result[,1])*3+1)$y,n=length(to.monthly(GSPC)[,1][substr(k2k,11,23)])),last(spline(seq(1,length(SP5.result[,1]),1),as.vector(SP5.result[,4]),n=length(SP5.result[,1])*3+1)$y,n=length(to.monthly(GSPC)[,1][substr(k2k,11,23)])),suffixes=c('','spline','eps'))


plot(merge(GSPC.predict[,4],GSPC.predict[,7],GSPC.predict[,8],GSPC.predict[,4]-GSPC.predict[,7],GSPC.predict[,4]-GSPC.predict[,8]),main="GSPC.predict[,4] vs. GSPC.predict[,7]",grid.ticks.on='months')
tmp.legend <- "Black: actual \nRed: spline\nGreen: eps"
addLegend(legend.loc = "topleft", legend.names = tmp.legend,col=3)
tmp.addTA <- as.xts(rep(2800,length(index(GSPC.predict))),index(GSPC.predict))
addSeries(tmp.addTA,on=1,col=6,lwd=1)





result.eps$coefficients[1]+result.eps$coefficients[2]*eps_year_xts["2019-01"]+result.eps$coefficients[3]*as.vector((last(PA)))+result.eps$coefficients[4]*as.vector((last(CS)))+result.eps$coefficients[5]*as.vector((last(UC)))+result.eps$coefficients[6]*as.vector(last(diff(cli_xts$oecd, lag = 6)))

2019年3月17日日曜日

VIX, CLI 6 month delta and S&P500


> last(cli_xts)
               oecd      usa
2019-01-01 99.12973 99.04795

Then synchronized data as SP5[,4]["2000::2019-01"],

#
# VIX histgram when CLI 6 month delta is positve as red and negative as blue, overlaid by S&P500.
#
mnt <- index(cli_xts$oecd["2000::2019"][cli_xts$oecd["2000::2019"]/as.vector(cli_xts$oecd["1999-07-01::2018-07-01"]) < 1])
plot.zoo(merge(VIX["2000::2019-01"][,4],VIX[mnt][,4]),type='h',col = c("red", "blue"), plot.type = "single")
abline(v=seq(as.Date("2001-01-01"),as.Date("2019-01-01"),by='years'), col=rgb(0,1,0,alpha=0.9),lty=2)
par(new=T)
plot.default(SP5[,4]["2000::2019-01"],axes=F,type='l')




#
# draw CLI 6 month delta vs. its reading graph.
#
#
plot.default(na.trim(diff(cli_xts$oecd["2010-07-01::"],lag=6)),cli_xts$oecd["2011::"],type='b')
tmp <- par('usr')
plot.default(na.trim(diff(cli_xts$oecd["2010-07-01::"],lag=6)),cli_xts$oecd["2011::"],type='b',xlim=c( tmp[1],tmp[2]), ylim=c(tmp[3], tmp[4]))
par(new=T)
plot.default(na.trim(diff(cli_xts$oecd["2018-07-01::2019"],lag=6)),cli_xts$oecd["2019"],xlim=c( tmp[1],tmp[2]), ylim=c(tmp[3], tmp[4]),col=9,lwd=2)
par(new=T)
plot.default(na.trim(diff(cli_xts$oecd["2017-07-01::2018"],lag=6)),cli_xts$oecd["2018"],xlim=c( tmp[1],tmp[2]), ylim=c(tmp[3], tmp[4]),col=2,lwd=2)
par(new=T)
plot.default(na.trim(diff(cli_xts$oecd["2016-07-01::2017"],lag=6)),cli_xts$oecd["2017"],xlim=c( tmp[1],tmp[2]), ylim=c(tmp[3], tmp[4]),col=3,lwd=2)
par(new=T)
plot.default(na.trim(diff(cli_xts$oecd["2015-07-01::2016"],lag=6)),cli_xts$oecd["2016"],xlim=c( tmp[1],tmp[2]), ylim=c(tmp[3], tmp[4]),col=4,lwd=2)
par(new=T)
plot.default(na.trim(diff(cli_xts$oecd["2014-07-01::2015"],lag=6)),cli_xts$oecd["2015"],xlim=c( tmp[1],tmp[2]), ylim=c(tmp[3], tmp[4]),col=5,lwd=2)
par(new=T)
plot.default(na.trim(diff(cli_xts$oecd["2013-07-01::2014"],lag=6)),cli_xts$oecd["2014"],xlim=c( tmp[1],tmp[2]), ylim=c(tmp[3], tmp[4]),col=6,lwd=2)
par(new=T)
plot.default(na.trim(diff(cli_xts$oecd["2012-07-01::2013"],lag=6)),cli_xts$oecd["2013"],xlim=c( tmp[1],tmp[2]), ylim=c(tmp[3], tmp[4]),col=7,lwd=2)
par(new=T)
plot.default(na.trim(diff(cli_xts$oecd["2011-07-01::2012"],lag=6)),cli_xts$oecd["2012"],xlim=c( tmp[1],tmp[2]), ylim=c(tmp[3], tmp[4]),col=8,lwd=2)
par(new=T)
plot.default(na.trim(diff(cli_xts$oecd["2010-07-01::2011"],lag=6)),cli_xts$oecd["2011"],xlim=c( tmp[1],tmp[2]), ylim=c(tmp[3], tmp[4]),col=9,lwd=2,bg='grey')
abline(v=0)
abline(h=100)



2019年3月14日木曜日

CLI - composite leading indicator - OECD 2019 version.


THIS ENTRY SUPERCEDS THIS PAGE

1. preparation

# download csv from oecd(https://data.oecd.org/leadind/composite-leading-indicator-cli.htm) to "~/Downloads"
# use file name "CLI3.csv".
# this file contains multiple regions data. you have to specify its name.
# extract USA only entries
# execute commands below at "~/Download".
#
sed -n '/USA/p' CLI3.csv |awk -F, '{print $6"-01,"$7}'  |sed 's/\"//g' |awk 'BEGIN{print "DATE,DATA"}{print $0}' > usa.csv
# extract OECD entries and exclude OECDE
sed -n '/OECD[^E]/p' CLI3.csv |awk -F, '{print $6"-01,"$7}'  |sed 's/\"//g' |awk 'BEGIN{print "DATE,DATA"}{print $0}' > oecd.csv

2.drawing graph

# read data from csv.
#
cli_xts <- merge(as.xts(read.zoo(read.csv("~/Downloads/oecd.csv"))),as.xts(read.zoo(read.csv("~/Downloads/usa.csv"))),suffixes = c("oecd","usa"
))
#
#  set start date and end date
#
start_date <- as.Date("2014-07-01")
end_date <- as.Date("2019-01-01")
#
#
cli_xts$oecd[paste(start_date,end_date,sep="::")]
period_base <- paste(start_date,end_date,sep="::")
diff_mon <- 6
period_compare <- paste(as.Date(as.yearmon(mondate(as.Date(start_date))-diff_mon )),as.Date(as.yearmon(mondate(as.Date(end_date))-diff_mon )),sep="::")
paste("2018-01",end_date,sep="::")
paste("2017-07",as.Date(as.yearmon(mondate(as.Date(end_date))-diff_mon )),sep="::")

plot.default((cli_xts$oecd[period_base]   / as.vector(cli_xts$oecd[period_compare])-1)*100,cli_xts$oecd[period_base])
tmp <- par('usr')
plot.default((cli_xts$oecd[period_base] / as.vector(cli_xts$oecd[period_compare])-1)*100,cli_xts$oecd[period_base] ,xlim=c( tmp[1],tmp[2]), ylim=c(tmp[3], tmp[4]),type='b')
par(new=T)
#
#  code for CY2019 and after.
#
#
if(as.Date("2018-12-31") < end_date){
  # add line to data beyond "2019-01-01" when time has come.
  plot.default((cli_xts$oecd[paste("2019-01",end_date,sep="::")] / as.vector(cli_xts$oecd[paste("2018-07",as.Date(as.yearmon(mondate(as.Date(end_date))-diff_mon )),sep="::")])-1)*100,cli_xts$oecd[paste("2019-01",end_date,sep="::")] ,xlim=c( tmp[1],tmp[2]), ylim=c(tmp[3], tmp[4]),col=2,lwd=2)

  par(new=T)
  plot.default((cli_xts$oecd["2018-01::2018-12"] / as.vector(cli_xts$oecd["2017-07::2018-06"])-1)*100,cli_xts$oecd["2018-01::2018-12"], xlim=c( tmp[1],tmp[2]), ylim=c(tmp[3], tmp[4]),col=6)

} else{
  plot.default((cli_xts$oecd[paste("2018-01",end_date,sep="::")] / as.vector(cli_xts$oecd[paste("2017-07",as.Date(as.yearmon(mondate(as.Date(end_date))-diff_mon )),sep="::")])-1)*100,cli_xts$oecd[paste("2018-01",end_date,sep="::")] ,xlim=c( tmp[1],tmp[2]), ylim=c(tmp[3], tmp[4]),col=2,lwd=2)
}

par(new=T)
plot.default((cli_xts$oecd["2017-01::2017-12"] / as.vector(cli_xts$oecd["2016-07::2017-06"])-1)*100,cli_xts$oecd["2017-01::2017-12"], xlim=c( tmp[1],tmp[2]), ylim=c(tmp[3], tmp[4]),col=3)
par(new=T)
plot.default((cli_xts$oecd["2016-01::2016-12"] / as.vector(cli_xts$oecd["2015-07::2016-06"])-1)*100,cli_xts$oecd["2016-01::2016-12"], xlim=c( tmp[1],tmp[2]), ylim=c(tmp[3], tmp[4]),col=4)
par(new=T)
plot.default((cli_xts$oecd["2015-01::2015-12"] / as.vector(cli_xts$oecd["2014-07::2015-06"])-1)*100,cli_xts$oecd["2015-01::2015-12"], xlim=c( tmp[1],tmp[2]), ylim=c(tmp[3], tmp[4]),col=5
)
abline(h=100)
abline(v=0)
legend("topleft", legend = "Light Blue: 2015\nBlue: 2016\nLime: 2017\nPurple: 2018\nRed: 2019",bty='n')


2019年3月12日火曜日

CLI 6 months delta ,VIX and S&P500. plot.zoo



mnt <- index(cli_xts$oecd["2000::2018"][cli_xts$oecd["2000::2018"]/as.vector(cli_xts$oecd["1999-07-01::2018-06-01"]) < 1])
plot.zoo(merge(VIX["2000::2018"][,4],VIX[mnt][,4]),type='h',col = c("red", "blue"), plot.type = "single")
abline(v=seq(as.Date("2001-01-01"),as.Date("2019-01-01"),by='years'), col='green')
par(new=T)
plot.default(SP5[,4]["2000::2018"],axes=F)





VIX vs. CLI 6 month delta. translucent histgram hist setdiff


# downloads ^VIX historical data from Yahoo Finance.
#
VIX <- as.xts(read.zoo(read.csv("~/VIX.csv")))

# select dates when CLI moves negative during 6 months.
mnt <- index(cli_xts$oecd["2000::2018"][cli_xts$oecd["2000::2018"]/as.vector(cli_xts$oecd["1999-07-01::2018-06-01"]) < 1])

  [1] "2000-06-01" "2000-07-01" "2000-08-01" "2000-09-01" "2000-10-01" "2000-11-01" "2000-12-01" "2001-01-01"
  [9] "2001-02-01" "2001-03-01" "2001-04-01" "2001-05-01" "2001-06-01" "2001-07-01" "2001-08-01" "2001-09-01"
<skip>
[105] "2018-05-01" "2018-06-01" "2018-07-01" "2018-08-01" "2018-09-01" "2018-10-01" "2018-11-01" "2018-12-01"

# select dates of positve movement.
> as.Date(setdiff(seq(as.Date("2000-01-01"),as.Date("2018-12-01"),by='months'),mnt))
  [1] "2000-01-01" "2000-02-01" "2000-03-01" "2000-04-01" "2000-05-01" "2001-12-01" "2002-01-01" "2002-02-01"
  [9] "2002-03-01" "2002-04-01" "2002-05-01" "2002-06-01" "2002-07-01" "2003-06-01" "2003-07-01" "2003-08-01"
<skip>
[105] "2017-03-01" "2017-04-01" "2017-05-01" "2017-06-01" "2017-07-01" "2017-08-01" "2017-09-01" "2017-10-01"
[113] "2017-11-01" "2017-12-01" "2018-01-01" "2018-02-01"


as.vector(VIX[,2][as.Date(setdiff(seq(as.Date("2000-01-01"),as.Date("2018-12-01"),by='months'),mnt))])
#   [1] 29.00 28.12 25.87 34.31 32.89 26.38 26.88 27.32 21.12 24.50 22.71 30.98 48.46 22.81 20.80 23.89 23.26 22.82 19.61
#  [20] 18.86 18.68 18.06 22.67 17.98 20.45 17.04 14.39 17.19 15.66 12.44 14.56 13.73 13.34 13.09 19.87 23.81 19.58 16.15
#  [39] 14.49 12.91 12.55 12.68 12.83 19.01 21.25 15.46 14.60 18.98 24.17 37.50 32.77 33.05 28.39 29.57 31.59 31.84 24.51
#  [58] 28.01 29.22 19.94 23.20 48.20 37.38 37.58 28.92 25.13 24.34 23.84 21.43 20.08 23.22 31.28 19.07 21.24 21.06 25.46
#  [77] 15.93 19.28 16.82 18.20 16.35 21.91 17.32 17.81 17.49 21.34 14.14 16.75 18.99 21.48 18.22 17.85 14.49 12.89 25.20
#  [96] 23.43 22.81 14.93 20.51 17.95 23.01 14.72 14.07 12.96 15.11 16.28 16.30 15.16 13.05 17.28 14.06 13.20 14.51 14.58
# [115] 15.42 50.30
# > as.vector(VIX[,2][mnt])
#   [1] 25.01 21.65 20.84 22.66 30.80 31.11 32.32 30.80 30.62 35.45 35.20 26.49 24.42 25.61 25.84 49.35 36.95 34.57 45.21
#  [20] 41.86 43.44 32.60 31.20 35.33 35.66 34.40 30.04 22.33 17.93 19.97 15.98 16.87 16.76 13.74 14.75 13.20 14.89 18.59
#  [39] 17.70 13.34 13.92 14.41 28.82 24.15 31.09 24.86 37.57 29.70 35.60 25.61 20.95 24.56 30.81 23.86 48.40 89.53 81.48
#  [58] 68.60 57.36 53.16 53.25 45.60 36.88 20.03 24.65 25.94 48.00 43.87 46.88 37.53 30.91 23.73 21.98 27.73 21.00 19.25
#  [77] 18.96 19.65 19.40 23.23 17.11 17.57 17.08 31.06 15.93 17.19 16.66 16.36 19.80 20.05 53.29 33.82 25.23 20.67 26.81
#  [96] 32.09 30.90 20.17 17.09 17.65 26.72 17.04 26.22 25.72 18.78 19.61 18.08 16.86 15.63 28.84 23.81 36.20

# compare monthly high between negative vs. positve
t.test(as.vector(VIX[,2][mnt]),as.vector(VIX[,2][as.Date(setdiff(seq(as.Date("2000-01-01"),as.Date("2018-12-01"),by='months'),mnt))]))

# Welch Two Sample t-test
#
# data:  as.vector(VIX[, 2][mnt]) and as.vector(VIX[, 2][as.Date(setdiff(seq(as.Date("2000-01-01"), as.vector(VIX[, 2][mnt]) and     as.Date("2018-12-01"), by = "months"), mnt))])
# t = 4.8495, df = 174.7, p-value = 2.725e-06
# alternative hypothesis: true difference in means is not equal to 0
# 95 percent confidence interval:
#  4.164086 9.879529
# sample estimates:
# mean of x mean of y
#  28.55741  21.53560

# compare monthly close.
t.test(as.vector(VIX[,4][mnt]),as.vector(VIX[,4][as.Date(setdiff(seq(as.Date("2000-01-01"),as.Date("2018-12-01"),by='months'),mnt))]))

# Welch Two Sample t-test
#
# data:  as.vector(VIX[, 4][mnt]) and as.vector(VIX[, 4][as.Date(setdiff(seq(as.Date("2000-01-01"), as.vector(VIX[, 4][mnt]) and     as.Date("2018-12-01"), by = "months"), mnt))])
# t = 4.7722, df = 178.21, p-value = 3.781e-06
# alternative hypothesis: true difference in means is not equal to 0
# 95 percent confidence interval:
#  2.860369 6.893837
# sample estimates:
# mean of x mean of y
#  22.19598  17.31888

par(mfrow=c(2,1))

hist(as.vector(VIX[,4][mnt]),ylim=c(0,40),xlim=c(10,60),breaks=20)
hist(as.vector(VIX[,4][as.Date(setdiff(seq(as.Date("2000-01-01"),as.Date("2018-12-01"),by='months'),mnt))]),ylim=c(0,40),xlim=c(10,60),breaks=10)

# 半透明色ヒストグラム

hist(as.vector(VIX[,4][as.Date(setdiff(seq(as.Date("2000-01-01"),as.Date("2018-12-01"),by='months'),mnt))]),ylim=c(0,40),xlim=c(10,60),breaks=10,col=2)
par(new=T)
hist(as.vector(VIX[,4][mnt]),ylim=c(0,40),xlim=c(10,60),breaks=20,col=rgb(0, 1, 0, alpha=0.1))

                              OR

hist(as.vector(VIX[,4][as.Date(setdiff(seq(as.Date("2000-01-01"),as.Date("2018-12-01"),by='months'),mnt))]),ylim=c(0,30),xlim=c(10,60),breaks=10,col=rgb(1, 0, 0, alpha=0.5))
par(new=T)
hist(as.vector(VIX[,4][mnt]),ylim=c(0,30),xlim=c(10,60),breaks=20,col=rgb(0, 0, 1, alpha=0.1))

Red for positive and Blue for negative.



change color scheme and transparency. 





2019年3月11日月曜日

CLI 6 month delta and S&P 500 monthly return. OR and VIX


> mnt <- index(cli_xts$oecd["2000::2018"][cli_xts$oecd["2000::2018"] < 100 & cli_xts$oecd["2000::2018"]/as.vector(cli_xts$oecd["1999-07-01::2018-06-01"]) < 1])
> mnt
 [1] "2000-12-01" "2001-01-01" "2001-02-01" "2001-03-01" "2001-04-01" "2001-05-01" "2001-06-01" "2001-07-01"
 [9] "2001-08-01" "2001-09-01" "2001-10-01" "2001-11-01" "2002-08-01" "2002-09-01" "2002-10-01" "2002-11-01"
[17] "2002-12-01" "2003-01-01" "2003-02-01" "2003-03-01" "2003-04-01" "2003-05-01" "2008-06-01" "2008-07-01"
[25] "2008-08-01" "2008-09-01" "2008-10-01" "2008-11-01" "2008-12-01" "2009-01-01" "2009-02-01" "2009-03-01"
[33] "2009-04-01" "2009-05-01" "2011-08-01" "2011-09-01" "2011-10-01" "2011-11-01" "2011-12-01" "2012-01-01"
[41] "2012-02-01" "2012-06-01" "2012-07-01" "2012-08-01" "2012-09-01" "2012-10-01" "2012-11-01" "2012-12-01"
[49] "2015-09-01" "2015-10-01" "2015-11-01" "2015-12-01" "2016-01-01" "2016-02-01" "2016-03-01" "2016-04-01"
[57] "2016-05-01" "2016-06-01" "2016-07-01" "2018-07-01" "2018-08-01" "2018-09-01" "2018-10-01" "2018-11-01"
[65] "2018-12-01"
> plot.zoo(merge(SP5["2000::"][,4]/SP5["2000::"][,1]-1,SP5[mnt][,4]/SP5[mnt][,1]-1),type='h',col = c("red", "blue"), plot.type = "single")



mnt <- index(cli_xts$oecd["2000::2018"][cli_xts$oecd["2000::2018"] < 100 & cli_xts$oecd["2000::2018"]/as.vector(cli_xts$oecd["1999-07-01::2018-06-01"]) < 1])
plot.zoo(merge(SP5["2000::2018"][,4]/SP5["2000::2018"][,1]-1,SP5[mnt][,4]/SP5[mnt][,1]-1),type='h',col = c("red", "blue"), plot.type = "single")




mnt <- index(cli_xts$oecd["2000::2018"][cli_xts$oecd["2000::2018"]/as.vector(cli_xts$oecd["1999-07-01::2018-06-01"]) < 1])
plot.zoo(merge(SP5["2000::2018"][,4]/SP5["2000::2018"][,1]-1,SP5[mnt][,4]/SP5[mnt][,1]-1),type='h',col = c("red", "blue"), plot.type = "single")








plot.zoo(merge(VIX["2000::2018"][,4],VIX[mnt][,4]),type='h',col = c("red", "blue"), plot.type = "single")
abline(v=seq(as.Date("2001-01-01"),as.Date("2019-01-01"),by='years'), col='green')