Interest Rates’ Influence on 1987

February 21, 2011
By

(This article was first published on Timely Portfolio, and kindly contributed to R-bloggers)

One aspect of 1987 that does not deserve enough attention is interest rates.  Higher interest rates constrain economic activity and compete with other investments.  As seen in the chart below, the US 10year Treasury rate climbed 40% from 7% to 10% as the S&P made its 40% price run.  Particularly interesting is the last move higher in rates as stocks flattened August-October 1987.

From TimelyPortfolio

Just for fun on February 23 2010, as I was getting a little bearish, I put together this chart which turned out to be 2 months early.  I’ll show the original to avoid any hindsight bias.

image 

US 10y rates through 4% this cycle will become burdensome to this nonstop up move in stocks.  So far, 10y rates have just recovered to a low normal due to Fed manipulation.  Remove the manipulation, and the rate would easily be through 4%, and stocks would struggle.

From TimelyPortfolio

 

r code (please offer suggestions):

require(quantmod)
#as reader MILK commented, I just add this require TTR for clarity
#both quantmod and ttr are from the very generous and gifted Josh Ulrich
require(TTR)
require(PerformanceAnalytics)

tckr<-"^GSPC"

start<-"1986-12-31"
end<- format(Sys.Date(),"%Y-%m-%d") # yyyy-mm-dd

# Pull tckr index data from Yahoo! Finance
getSymbols(tckr, from=start, to=end)
US10yRate<-getSymbols("DGS10",src="FRED",auto.assign=FALSE)

#only way I know to remove the NAs from FRED 10 year rates
US10yRate<-to.daily(US10yRate)[,1]

SP500divbyUS10yRate<-GSPC[,4]/US10yRate

#running 25 day correlation
correlationSPand10y<-runCor(stocksandrates[,1],stocksandrates[,2],n=25)

#need to add labels to TA added to the quantmod chart but do not see in docs
#named the xts series was the only way to get a decent label
#please let me know if there is a way to override the TA label
chartSeries(GSPC["1987-01::1987-10-19",],log=FALSE,theme='white',name="S&P 500 with US 10 year Rates",TA="addTA(US10yRate);addTA(SP500divbyUS10yRate);addTA(correlationSPand10y)")

chartSeries(last(GSPC,"100 days"),log=FALSE,theme='white',name="S&P 500 with US 10 year Rates",TA="addTA(US10yRate);addTA(SP500divbyUS10yRate);addTA(correlationSPand10y)")

To leave a comment for the author, please follow the link and comment on his blog: Timely Portfolio.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Tags:

Comments are closed.