tag:blogger.com,1999:blog-107568321062020427.post3360151711565606498..comments2023-09-19T00:48:06.643-07:00Comments on Intelligent Trading: Aug 4, 2011 "plunge" headlines are in the air tonightIntelligent Tradinghttp://www.blogger.com/profile/17765336450326139518noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-107568321062020427.post-89114953262720245112011-09-05T23:37:41.560-07:002011-09-05T23:37:41.560-07:00Looks much simpler,
thanks DD.Looks much simpler, <br />thanks DD.Intelligent Tradinghttps://www.blogger.com/profile/17765336450326139518noreply@blogger.comtag:blogger.com,1999:blog-107568321062020427.post-59626441553527187372011-09-04T09:33:27.786-07:002011-09-04T09:33:27.786-07:00If you are already using quantmod in R you could a...If you are already using quantmod in R you could also go to the St. Louis fed aka FRED if you know what your series ID is...<br /><br />Get the 1-Year Treasury Constant Maturity Rate like so...<br /><br />tcmr1y <- getSymbols('DGS1',src='FRED',auto.assign=FALSE)<br /><br />tcmr1y now holds your time series or rates...<br /><br />Cordially,<br /><br />-DD-Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-107568321062020427.post-9780021592540242772011-08-07T03:08:21.801-07:002011-08-07T03:08:21.801-07:00Stephen,
If you have a yahoo symbol you can just
u...Stephen,<br />If you have a yahoo symbol you can just<br />use with TNX 10yr as example:<br />library(quantmod)<br />getSymbols("^TNX") <br /><br />Alternatively, you can go to a historical site like http://www.federalreserve.gov/releases/h15/data.htm then download the file of interest locally to your drive as a .csv file.<br />You can then read and clean up into R as a time series object. <br /><br />ex:<br />twoyr<-read.csv("C:/Stuff/bonds.csv",skip=20,colClasses=c("character","numeric"),na.strings='ND',sep=",",col.names=c('Date','yield'))<br /><br />#clean up ND data & convert to zoo and data frame objects if desired<br />twoyr<-twoyr[!is.na(twoyr$yield),]<br />twoyrzoo <- zoo(twoyr[, 2], as.Date(twoyr$Date, format = "%m/%d/%Y"))<br />twoyrdf<-as.data.frame(twoyrzoo)<br />names(twoyrdf)<-'yield'<br /><br />Hope that helps,<br />ITIntelligent Tradinghttps://www.blogger.com/profile/17765336450326139518noreply@blogger.comtag:blogger.com,1999:blog-107568321062020427.post-75417919252704670342011-08-06T07:04:51.524-07:002011-08-06T07:04:51.524-07:00Hi,
I'm just getting started using R for res...Hi, <br /><br />I'm just getting started using R for research and teaching. I've been trying to bring in bond market data to R for a few hours with very little success. Is there a trick I'm missing? <br /><br />Thanks again for this blog, it's been a lifesaver trying to get up the R curve as an economist.<br /><br />Best, <br /><br />StephenStephen Kinsellahttps://www.blogger.com/profile/02467967365815026744noreply@blogger.com