363 search results for "quantmod"

Longer-history back-tests

July 11, 2013
By
Longer-history back-tests

One of the important steps of evaluating new trading idea or strategy is to see how it behaved historically (i.e. create back-test and examine the equity curve in different economic and market conditions) However, creating a long back-test is usually problematic because most ETFs do not have a long price history. One way to alleviate

Read more »

Update: Extending Commodity time series

July 3, 2013
By
Update: Extending Commodity time series

I showed an example of Extending Commodity time series back in 2012. Since then, the web site that I used to get the Thomson Reuters/Jefferies CRB Index data is no longer working. But there are a few alternatives: Thomson Reuters / Jefferies CRB Index. To get data, first select “TRJ/CRB Index-Total Return”, next click “See

Read more »

Monitoring an ETF Portfolio in R

July 1, 2013
By
Monitoring an ETF Portfolio in R

Adam Duncan Also avilable on R-bloggers.com Some time ago, I read an interesting article about an interview with David Swensen, the renownd money manager from Yale University’s investment office. He’s quite famous and is considered by many to be the architect of the modern “endowment portfolio.” The point of the article was to suggest a way for ordinary...

Read more »

Looking out for volatility

June 26, 2013
By
Looking out for volatility

Let’s do an easy experiment. Lets caluclate the 25-day rolling volatility of the S&P 500 from 2007 onwards. 1-Get the data: getSymbols(‘SPY’,from=’2007/01/01′) 2-Run the volatility function from the package TTR (comes along with quantmod): vol=volatility(SPY,n=25,N=252,calc=’close’) #n=25 means we want 25 … Continue reading →

Read more »

Computerworld’s Beginners Guide to R

June 17, 2013
By

Sharon Machlis is not only the online managing editor at Computerworld, she's also a budding data scientist who recently started learning the R language. To the benefit of all other new R users, she's shared her learnings in an excellent 6-part beginners guide to R, published by Computerworld. It's jam-packed with useful information for anyone getting started with R,...

Read more »

Scenario analysis and trading options using R

June 16, 2013
By
Scenario analysis and trading options using R

I present you with my restructured project on options trading and scenario analysis. You are more than welcome to try it out. Firstly, I will give a small presentation that will reveal what you can do with it and whether you need to continue reading. T...

Read more »

Top 100 R packages for 2013 (Jan-May)!

June 13, 2013
By
Top 100 R packages for 2013 (Jan-May)!

(This article was first published on R-statistics blog » RR-statistics blog, and kindly contributed to R-bloggers) What are the top 100 (most downloaded) R packages in 2013? Thanks to the recent release of RStudio of their “0-cloud” CRAN log files (but without including downloads from the primary CRAN mirror or any of the 88 other CRAN mirrors), we can now answer this question...

Read more »

Loading Historical Stock Data

June 1, 2013
By
Loading Historical Stock Data

Historical Stock Data is critical for testing your investment strategies. I illustrated all my back-test examples with getSymbols function from quantmod package. For example, following is a back-test comparison for a few portfolio allocation methods: The getSymbols function, from quantmod package, downloads historical stock prices from Yahoo Fiance. I often get questions about alternative ways

Read more »

If…then in Japan

May 30, 2013
By
If…then in Japan

If Japan starts to spiral out of control, then what do they do? A spiral would be a sudden move higher in JGB rates with a simultaneous crash in the Japanese Yen. Their response would be to try to slow the positive feedback loop through external interv...

Read more »

Intended or Unintended Consequences

May 28, 2013
By
Intended or Unintended Consequences

(This article was first published on Timely Portfolio, and kindly contributed to R-bloggers) A quick glimpse at the US 10y Treasury Bond rate since 2000 seems benign with low volatility and a general downward trend.require(latticeExtra)require(quantmod)US10y <- getSymbols("^TNX", from = "2000-01-01", auto.assign = FALSE)asTheEconomist(xyplot(US10y, scales = list(y = list(rot = 1)), main = "US 10y Yield Since 2000"))From TimelyPortfolioHowever,...

Read more »