Articles by The Average Investor

Were markets exceptionally volatile in 2011?

January 2, 2012 | The Average Investor

2011 was a volatile year, no doubt about that, but was it exceptionally so from a historic point of view? To quantify the volatility, I used the Dow Jones Industrial average, which goes back to 1928 on Yahoo Finance: A volatile year no doubt, but once again confirming the fact that, in ... [Read more...]

More orthodox ARMA/GARCH trading

December 14, 2011 | The Average Investor

The system described in the earlier series for ARMA trading was in fact an “extreme” version of the more common, orthodox approach prevailing in the literature. Recently I tried using R to reproduce the results of a particular paper, and that lead to a lot of new developments … How is ... [Read more...]

Pre-computing a trading plan in parallel

November 11, 2011 | The Average Investor

R version 2.14 introduced a new package, called parallel. This new package combines the functionality from two previous packages: snow and multicore. Since I was using multicore to parallelise my computations, I had to migrate to the new package and decided to publish some code. Often trading strategies are tested using ... [Read more...]

Covered Call ETF Performance

October 31, 2011 | The Average Investor

Covered call ETFs have become quite popular lately. Living in Canada, I have been holding a couple Canadian members of this family for the last few months. When I purchased them, I liked the benefits and since I wasn’t expecting any bull markets on the horizon, I bought some. ... [Read more...]

R. I. P. EMA

October 19, 2011 | The Average Investor

That’s right, I am moving away from exponential moving averages. Originally, I decided to use them somewhat arbitrary, probably because they tend to swing faster. Last night, after spending two and half hours debugging an issue which yet again turned out to be a particular property of these averages, ... [Read more...]

Summarizing Returns with R

August 2, 2011 | The Average Investor

Often I like to see the performance of a trading strategy summarized annually, quarterly or by month. In R, we start off with the summary function: Given a series xx, usually a chunk of the original, this function returns the accumulative returns for the period. The leverage is useful to ... [Read more...]

Yet another reason to avoid loops in R

July 12, 2011 | The Average Investor

In some previous posts I have mentioned my struggles with the performance of the computations needed to implement the ARMA strategies in practice. Finally I have found a worthy solution, and as usual, there is a programming pattern to learn from it – avoid loops in R. My first approach was ... [Read more...]

ARMA Models for Trading, Part VI

July 5, 2011 | The Average Investor

All posts in this series were combined into a single, extended tutorial and posted on my new blog. In the fourth posting in this series, we saw the performance comparison between the ARMA strategy and buy-and-hold over the last approximately 10 years. Over the last few weeks (it does take time, ... [Read more...]

ARMA Models for Trading, Part IV

May 31, 2011 | The Average Investor

All posts in this series were combined into a single, extended tutorial and posted on my new blog. The last post promised to show some back testing results for the ARMA techniques. I decided to use the S&P 500 index for this purpose. What really impresses me in the above ... [Read more...]

ARMA Models for Trading, Part III

May 2, 2011 | The Average Investor

In the last post I showed how to pick the parameters for the ARMA model. The next step is to determine the position at the close. One way to do that is by a one day ahead prediction, if the prediction comes negative (remember the series we are operating on ... [Read more...]

ARMA Models for Trading, Part II

April 20, 2011 | The Average Investor

We left the last post at the point of determining the best ARMA model. Before continuing the discussion, however, I would like to make a few points that might seem a bit questionable or unclear: We model the daily returns instead of the prices. There are multiples reasons: this way ... [Read more...]

ARMA Models for Trading, Part I

April 14, 2011 | The Average Investor

Lately I have been testing trading models based on methods from various fields: statistics, machine learning, wavelet analysis and others. And I have been doing all that in R! In this series, I will try to share some of these efforts starting with the well-known from statistics Autoregressive Moving Average ... [Read more...]

Investing with the Odds

March 2, 2011 | The Average Investor

In this previous post, I showed that a look at the correlations in the daily returns of S&P 500 should have lead to a very profitable investing strategy. I also promised to show the results of this strategy in the 80s, but I am not going to do that, because ... [Read more...]

RSI(2) and the pre 80s Market

February 17, 2011 | The Average Investor

In his detailed research on RSI(2) indicator, MarketSci emphasized several times that the contrarian strategies based on the RSI(2) indicator didn’t start working until the 80s. I remembered this observation recently when I observed another interesting anomaly … In statistics, an important initial step in studying time series data is ... [Read more...]


March 17, 2010 | The Average Investor

All the tools I am using at the moment are free of charge. The one that comes to mind first is R. It’s a language for statistical computing which comes with a decent GUI. R comes with some time series support out of the box, but there are plenty ... [Read more...]

Connecting to a DB2 database from R

January 16, 2010 | The Average Investor

Unlike RMySQL and RSQLite there is no RDB2. However, I found it pretty straightforward connecting to a DB2 database using the JDBC driver and the RJDBC package. For all this to work, DB2 should be setup to use TCPIP, which is not used by default. You need to set the ... [Read more...]

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)