Blog Archives

Shiny with PerformanceAnalytics Example

March 4, 2013
By
Shiny with PerformanceAnalytics Example

The folks at Rstudio have done some amazing work with the shiny package. From the shiny homepage, “Shiny makes it super simple for R users like you to turn analyses into interactive web applications that anyone can use.” Developing web applications has always appealed to me, but hosting, learning javascript, html, etc. made me put … Continue reading...

Read more »

Momentum in R: Part 4 with Quantstrat

February 19, 2013
By
Momentum in R: Part 4 with Quantstrat

The past few posts on momentum with R focused on a relatively simple way to backtest momentum strategies. In part 4, I use the quantstrat framework to backtest a momentum strategy. Using quantstrat opens the door to several features and options as well as an order book to check the trades at the completion of … Continue reading...

Read more »

Momentum in R: Part 3

November 18, 2012
By
Momentum in R: Part 3

In the previous post, I demonstrated simple backtests for trading a number of assets ranked based on their 3, 6, 9, or 12 (i.e lookback periods) month simple returns. While it was not an exhaustive backtest, the results showed that when trading the top 8 ranked assets, the ranking based 3, 6, 9, and 12 … Continue reading...

Read more »

Momentum in R: Part 2

October 20, 2012
By
Momentum in R: Part 2

Many of the sites I linked to in the previous post have articles or papers on momentum investing that investigate the typical ranking factors; 3, 6, 9, and 12 month returns. Most (not all) of the articles seek to find which is the “best” look-back period to rank the assets. Say that the outcome of … Continue reading...

Read more »

Momentum with R: Part 1

August 23, 2012
By
Momentum with R: Part 1

Time really flies… it is hard to believe that it has been over a month since my last post. Work and life in general have consumed much of my time lately and left little time for research and blog posts. Anyway, on to the post! This post will be the first in a series of … Continue reading...

Read more »

“Computing for Data Analysis” with R on coursera

July 17, 2012
By
“Computing for Data Analysis” with R on coursera

Just stumbled on across a course on coursera titled “Computing for Data Analysis” taught by Roger D. Peng the Johns Hopkins Bloomberg School of Public Health. Here is the description of the course. In this course you will learn how to program in R and how to use R for effective data analysis. You will learn … Continue reading...

Read more »

Alternative to Monte Carlo Testing

July 4, 2012
By
Alternative to Monte Carlo Testing

When we backtest a strategy on a portfolio, it is a simple analysis of a single period in time. There are ways to “stress test” a strategy such as monte carlo, random portfolios, or shuffling the returns in a random order. I could never really wrap my head around monte carlo and shuffling the returns … Continue reading...

Read more »

Fun with the googleVis Package for R

June 30, 2012
By
Fun with the googleVis Package for R

Using packages such as ggplot and lattice can produce some great charts and visualization, but googleVis is tough to beat for interactive charts to share on the web. Click on the image below to open up the html page. This was all done in R! I will warn you that it is too easy to … Continue reading...

Read more »

Strategy Diversification in R – follow up

June 25, 2012
By
Strategy Diversification in R – follow up

The strategies used in Strategy Diversification in R were labeled as Strategy1 and Strategy2. Strategy1 Indicator: 52 week Simple Moving Average Entry Rule: Buy 1000 shares when price crosses and closes above 52 week Simple Moving Average Exit Rule: Exit all positions when prices crosses and closes below 52 week Simple Moving Average Classification: Long … Continue reading...

Read more »

Quick View on Correlations of Different Instruments

May 24, 2012
By
Quick View on Correlations of Different Instruments

In this post, I will demonstrate how to quickly visualize correlations using the PerformanceAnalytics package. Thanks to the package creators, it is really easy correlation and many other performance metrics. The first chart looks at the rolling 252 day correlation of nine sector ETFs using SPY as the benchmark. As expected the correlation is rather … Continue reading...

Read more »