The following is a guest post from Jacob with My Personal Finance Journey.

random number generator beat stock marketFor quite a while now, I have been a big fan, supporter, and practitioner of passive investing.

In my investing strategy, I set forth a target asset allocation, review my positions once per month, and rebalance if necessary (usually ends up being 1-2 times a year) in order to maintain the appropriate % levels by investing in index mutual funds with Vanguard.

For me, investing in individual stocks is simply too risky, and I don’t trust myself to do it. This is especially true when you consider that 70% or more of investing “professionals” fail to outperform the market.

If most people that devote 10 hours a day to this game can’t do it, what makes me think that I’m special enough to magically outperform the market?

A question that has become a topic of heated debate (especially in the camps of the critics of Mad Money’s Jim Cramer’s stock investing advice) is whether or not stocks picked by non-humans, such as a monkey throwing darts at a board to select stocks, would actually perform better than those chosen by the “pros.”

I think this question has arisen due to the inability (mentioned above) of many investment advisors to beat the market with their stock selections, along with the random-walk hypothesis developed by Burton Malkiel in his book, A Random Walk Down Wall Street.

Regardless of the specific cause of this speculation, it makes for an interesting thought exercise. One thing I recently was interested in particularly was the question below.

What kind of performance would I achieve by basing my buying and selling decisions on a random number generator in Excel?

And furthermore, how would this performance compare to the selections of investing professionals? So, I soldiered off to try to obtain some answers to these questions.

Baseline Market Comparison

In order to obtain a baseline to which to compare the results of my random number generator investment strategy, let’s take a look at how the S&P 500 performed in the ~ 2 months that I conducted this experiment (started on 28-Feb-2011). I chose this date range in 2011 because it coincided with a time when the market pretty much stayed the same. I figured that by choosing a neutral time for the market, the effect of using the random number generator would show through more greatly one way or another.

From 28-Feb-2011 to 22-April-2011, the S&P500 went up 1.33%. While this was not  particularly impressive time period for performance by any means, it gives us the baseline we need.

Study Set-Up

Having established our baseline, I then set up the analysis in the following way, assuming an initial value of the portfolio of $1,000:

  • In an Excel spreadsheet, I would predict the performance for each day that the stock market was open using the random
    number generator function, =RANDBETWEEN(-1,1). 
  • This function randomly generates one of three integers = 1, 0, or -1. I then correlated each of these integers to a direction of the market, as described below.
    • 1 = Market will go up more than or equal to 0.5% that day. Therefore, I would buy more (5% of total portfolio value)
      shares of an S&P 500 index fund at the open of the market.
    • 0 = Market will stay the same (change less than +/- 0.5%) that day. Therefore, I would hold all shares and experience whatever fluctuation was dealt by the market that day.
    • -1 = Market will go down that day more than or equal to 0.5%. Therefore, I would sell all shares at the open of the market in anticipation of the drop and temporarily hold the money in a safe cash account (assume no interest is obtained on the cash account).
  • After each day’s trading was over, I would record the actual performance of the market to determine whether or not the random number generator predicted correctly and adjust the overall portfolio value accordingly. 
    • Note: Source for all this data was Google Finance. Also, for simplicity, I decided to ignore commissions/trading fees. However, in reality, these would further decrease the returns observed.
  • You can view the spreadsheet I set up at the Google Docs link below.


The results of this exercise were quite interesting! I’ve summarized the details below:

  • The random number generator actually predicted the correct market movement a pretty impressive 45% of the time! Wow! It was incorrect 55% of the time.
    • I’m going to get on the soap-box here and propose that if we were to look at the performance of market-timing investment professionals, I’d suspect that they would be correct about the movements around this same 50% of the time.
    • Out of curiosity, I did some research to try to find some data on the % of times that portfolio managers/investment professionals correctly predict the market, and I was not able to find any specific stats. However, I did find that in order to make money with a market timing strategy, you have to be correct in your predictions 74% of the time. (Source –
  • The total return (excluding trading fees of course, as mentioned above) was interesting as well. The results showed that NO, you cannot use a random number generator to beat the performance of simply investing in an S&P500 index fund! The specifics of my findings are described below:
    • Using the buying, selling, and holding system described above in the study set-up, the following results were seen:
      • Total Amount Invested = $1,801.62
      • Ending Account Value = $1,136.64
      • Holdings Sold During Analysis = $675.24
      • Total Return = +0.57%
  • So, even though the total return realized with this random number generator market prediction strategy did not beat the market return of +1.33%, it was still in the same ballpark.
  • In fact, it’s fascinating to me to think that a positive return can be generated by choosing random numbers in the first place, especially during a time when the market didn’t go up very much.


So, overall, by basing my buying and selling decisions from the results of a random number generator available on any computer worldwide, I was able to achieve a total return slightly less (but still in the same positive percentage range) compared to the S&P 500 index during the same time period (0.57% vs. 1.33%) and correctly predict the market movements 45% of the time.

Because 70% of investing professionals fail to obtain returns on par with the market, this is quite an interesting find! Of course, more long-term analysis would be necessary before I would deploy this strategy with real money. However, it makes one question the effectiveness of active stock picking and market timing and in my mind, strengthens the case for a passive investing approach.

How about you all? Do you use a passive or active investing approach? Have you been satisfied with the success of your approach? What’s your take on the results of this random number generator analysis?

Share your experiences by commenting below!


Get the Money Dominating Toolkit

  • 6 Tools to Get Your Money Back on Track
  • The Ultimate Goal Achiever Workbook
  • 2 Free Chapters to my Best Selling Book
  • 21 Days to Destroy Your Bad Habits Worksheet

Comments | 2 Responses

Leave a Reply

Your email address will not be published. Required fields are marked *