Examples

LSPM Examples

I have received several requests for additional LSPM documentation over the past couple days and a couple months ago I promised an introduction to LSPM. In this long-overdue post, I will show how to optimize a Leverage Space Portfolio with the LSPM package. Please use the comments to let me know what you would like to see next. Some copious notes before we get to the code: These examples are based on revision 26 31 from r-forge and will not work under earlier revisions (and may not work with later revisions).

RSI(2) Evaluation

This post continues the series of investigating the RSI(2) strategy. The first post replicated this simple RSI(2) strategy from the MarketSci Blog using R. The second post showed how to replicate the strategy that scales in/out of RSI(2). If you like the RSI(2), be sure to check out David Varadi’s RSI(2) alternative! This post will use the PerformanceAnalytics package to evaluate the rules that scale in/out of positions. I’ve also provided a simple function that provides some summary statistics.

Packages featured with Inference for R

quantmod, TTR, and xts were (not so) recently featured on the Inference for R Blog. Inference for R is a Integrated Development Environment (IDE) designed specifically for R. The post gives an example of how to easily perform advanced financial stock analysis using Inference in Excel. I appreciate how they’re making R more accessible to a general audience, even though I like a command line interface and my preferred development environment is vim.

RSI(2) with Position Sizing

Though it’s more than two weeks later, here’s the second post in the series that will demonstrate how to build, test, and implement a trading strategy with R. You can find the first post here. The first post replicated this simple RSI(2) strategy from the MarketSci Blog. This second post will demonstrate how to replicate this strategy that scales in/out of RSI(2). A couple notes before moving to the code:

Testing RSI(2) with R, First Steps

This is the first of a series of posts that will demonstrate how to build, test, and implement a trading strategy using my favorite FOSS, R. I chose the RSI(2) strategy because it has gotten considerable attention on trading blogs over the past 6 months. In particular, I will be replicating and extending some of the results from Michael Stokes’ excellent MarketSci Blog. This post will focus on replicating this simple RSI(2) strategy.