Thursday, February 9, 2012

It's been awhile

Getting back into the blogging thing and going to keep it short and sweet from now on.  After meeting and seeing the lamborghini in the driveway of a wealth quantitative trader and getting to see his returns, I am going to be modifying my approach to move toward the automated trading side of things.

The benefits:

  • My background is in engineering so the math and coding shouldn't be too much of a problem
  • Most of my mistakes come not from strategies but with the fact that I can't stick with a trade
  • I had no risk management other than a stop loss, and it cost me a lot of money.  Automation will force me to trust the probability curve instead of the one-time massive gain I have been looking for

What I've done so far:

I'm going to focus on iteration while moving forward as fast as possible.  I think the sooner you get to working prototype the better off the project becomes.

The next post will be on how to get all the historical EOD survivorbiased data you could ever want

Tuesday, March 8, 2011

Qualities of Winning Stocks

Our goal in this section is to understand the differentiating factors between the "Winning" stocks and the rest of the market.  We will do this by analyzing groups of stocks and their respective qualities.  The groups of stocks will be the following:
  • Top 5 YoY 
  • Top 10 YoY 
  • Stocks with best 3yr historical performance
  • Stocks with best 5 yr historical performance
  • Stocks in 75th percentile or above
The qualities we will be looking into will be based off of theory.  The theory should start with Stock price and be able to work itself down to each of the important ratios that matter for a stock. I have broken down what I believe to be the levers on individual stock price into the tree format to focus on the ratios that "SHOULD" have the largest impact on performance

I know many might disagree that these are the ONLY factors that influence stock price/share, but mathematically they are the ONLY factors by their inherent definition.

  • Stock Price/Share = P/E Ratio * Earnings/Share

This is useful for the following reasons:

  1. Earnings/share encompasses all fundamental performance of a stock
    • It is not the ONLY useful value of measure for a stock, but if earnings are not good then you would expect poor price performance
    • Sales growth and profit margin are secondary indicators of fundamental performance
  2. Price/Earnings Ratio encompasses all technical performance of a stock
Based on the above we will look at the following at the beginning and end of the periods for those groups of stocks:
  • P/E Ratios
    • Starting P/E Ratio
    • Ending P/E Ratio
  • Earnings/Share
    • Initial Earnings/Share
    • Ending Earnings/Share
  • Market Capitalization (Stock Price*Outstanding Shares)
    • Initial Market Cap
    • Ending Market Cap
There are additional indicators I know have an effect on a stock, but they seem to all fit into the two categories of earnings/share or P/E ratio.  I expect the results will be in the next post which I will hopefully have time to put together for tomorrow March 9th.

Our Theoretical Returns

The goal of this blog was for me to identify how to live off stocks.  Before we get into the qualities of winning stocks it will be helpful to understand what our performance could be if we had invested in these winning stocks of the past. My assumptions will be the following:
  • As discussed before I will have 5 open positions per year
  • Assume I will catch 40% of the stocks move
  • Assume I will have a 2:1 losers to winners ratio per year
  • I will always cut my losses at 10%
  • Both losers always come before the losers
I want to use this as an example to see if it would have been possible to live off the money made in the stock market if you started at any particular year.  I have created two tables that highlight how you would have done had you averaged the performance of the 5 most winning stocks and 10 most winning stocks.
5 Most Winning Stocks

10 Most Winning Stocks

As you can see from these tables, if you had been comfortable living on 35k or less per year, there would have been only two years in which you would not have been able to pay for yourself.  Although I personally would much rather live on more than 35k per year, it is definitely possible. I have also presented one of the worse scenarios.  

Another method to see if it is possible is to assume we can increase our odds of being in the upper 80% of all stocks on a yearly basis.  The returns for that are outlined in the table below:

So, if we had been able to stay in the 80% for returns on a yearly basis we would have been able to live off the returns for 12 of the last 15 years. 

Before we can claim that it is possible to live off the returns, we need to understand the things that make these stocks different or stand out from the crowd. What godly qualities do they posses that allow them to outperform the other stocks in the marketplace.  That is the discussion for the next post!

Historical Stock Performance

In my last post I identified the top 10 stocks in the past 12 years on a YOY basis.  I would now like to understand the data set a little more in depth and determine the answers to a couple questions:

  • What is the distribution of returns across all years? Across the past 5 years? 10 years?
  • What are the most winning stocks in the past 3 year period? 5 year period? 3yr period looking back every year for the past five years?
  • What are the qualities that make these stocks stand out vs. the crowd? (Answer this in the next post)
The distribution of returns across all 12 years can be seen in the below chart:

The distribution of returns is above and as expected it is centered around 10% which is the historical return of the S&P500. An interesting point to note is the long tail to the right, showing that there are quite a few occurrences when yearly performance is above 100%. 

*Note: The distribution of returns is correct, but the average YoY return for this period is 16.2%, which seems quite high. (I arrived at this number by averaging the percentages as all the YoY returns are equally weighted..I think this is acceptable but could be wrong).  I believe the reason for the higher than expected number is the difference between negative and positive returns, let me illustrate with an example:
  • Stock goes from $100 to $110
    • % Change = (110-100)/100 = 10%
  • Stock goes back from $110 to $100
    • % Change = (100-110)/110 = -9.1%
  • Average Return
    • Actually = (100-100)/100 = 0%
    • Average of % = (10%+(-9.1%))/2 = 0.45%---this is WRONG!
From the above example it becomes clear that I cannot average the returns.

Identifying Stocks that can do this consistently:
The stocks that we have identified so far have been the best performing stocks as measured across one year.  It will be easier to make money if we have more time to get into a stock and spend less money on commisions and slippage.  I have filtered stocks that have performed the best in the past 3 years and five years respectively with the list reproduced below.  This will be our starting point to understand what differentiates these stocks when they began their run from the average stock.

Next time we will examine the qualities of these stocks compared to the rest of the market.

Identify Winning Stocks

I read a book once titled “If you don’t know where your going, you’ll probably end up somewhere else.” How does this pertain to my work? We want to focus on stocks that are in the 95th percentile or above in terms of performance, hopefully that is where we are going.  This post will explain how to identify stocks in past years from the 95th percentile, in addition we will highlight the performance you can expect from the market itself.

Understanding Yearly Performance of Stocks:

  • Use Microsoft Excel with the data sources mentioned in a previous post
  • Utilize January 1st as measuring day (if market is open)
  • Complete for past 10 years
Below are the top ten performing stocks from each year for the past 12 years:

That took a little while to put together, if anyone would like the actual table don't hesitate to ask instead of trying to copy and paste the picture. I'm all for conserving time/energy! In the same vein, if I am doing something on this site that you have already accomplished let me know!

A QUICK WARNING!! This is the "SURVIVOR" data set, meaning I used a current list of symbols to generate this list.  Stocks had to make it to present day to be included on this list which means you can expect the average returns that I provide here positively biases and I could also be missing a few stocks from the list.

In the next post I will take a more in depth look at the data set to understand expected returns over the period .

Friday, March 4, 2011

Stock Data Sources

Now the fun part, the actual analysis!!

To begin we need data and lots of it, I am going to expect that individuals will want to duplicate my results (if anyone actually reads this) so I will be posting the sources that I will be getting data from.  Or if you are looking for data I have gotten privately I can possibly provide via a link on email:

Data Required:
  • Symbol List - All tickers, current and historical
    • EOD Data is the best website I have found to get symbol lists from, the downside is that it includes mutual funds and some stocks that cannot be invested into....these can be rooted out using google finance and a little bit of excel programming
    • The list itself can be found here, after a quick and easy registration the list is yours. The downside is that it does not provide historical tickers later than about a month ago
    • If you have access to a financial station (Bloomberg/Reuters) you easily have access to this information. Many large universities have access to these, or some public libraries (before budgets were squeezed).  These financial stations are unrivaled in their breadth and quality of data, so make sure to use it if you have it.
  • Historical Stock Data
    • YLoader - Historical Quotes Downloader
      • The most helpful downloading program I have found.  I got mine for free but it looks like they upped it to a 15 day free trial or a lifetime subscription for $20 from the CNET Downloads link here.  Also includes a command line utility that downloads all the symbols and the exchange they are on.
    • Yahoo & Google
      • Free to download, just enter your ticker, click historical prices and download to spreadsheet
      • Slow if you are downloading multiple tickers, I wrote an excel program to do this for me...which was still slow
    • EOD Data
      • Cheapest access to intraday data you can find
      • 3 years of historical data for platinum members (29.95/mo) 
      • Data has been cleaned and formatted for you (not sure of quality)
    • Bloomberg/Reuters station
      • If this is an option for you, obviously take it...these dedicated stations have techs ensuring they have the most accurate data at all times
  • Historical Earnings / Financial Data
      • Thomas Reuters provides the best free earnings website I have found
      • All tickers with up to 3-4 years of their historical quarterly earnings
    • Bloomberg/Reuters station
      • Past 3-4 years that provides, I have only found that a station has the data required to do longer historical analyses
    • Would love to know of others that are more than 1 year old, below are the sources I know of that only have data for the past ~1.5yrs
      • MSN Money
      • Yahoo Finance
      • Google Finance
Thats it for right now on the data, hopefully it is clear that price is the determining factor in stock performance which is why we need it most important.  The reason I highlighted earnings data is the expected relationship to stock performance.  That relationship will need to be tested regardless of whether it is correlated to the winners or not.  There will be many additional levels of information required such as ROE, Quarterly Revenue (will give us profit margin), and other stock ratios, as well as macroeconomic ratios.  Access to this information will allow us to determine which of the individual ratios, or combination of ratios increase the probability of choosing a winning stock.

Feedback (because I definitely don't know everything, and would love to learn), Comments, and Questions are always welcome!


Limits for historical analysis

My Goal is to identify stocks that will provide the largest possible percentage return in the shortest amount of time. Once these "Winning" stocks have been identified I will search for commonalities among them. The limitations for identifying winning stocks will be the following:
  • I will only be trading in stocks
  • I will invest in up to 5 stocks at a time but do not need to be fully invested at all times
  • It's assumed I have $100,000 to invest, on margin $200,000 - up to $40,000/stock
  • Minimum Liquidity Requirements
    • Minimum Trading Flow/day - $800,000
      • Price * Volume = Trading Flow
    • Minimum Volume/day - 150,000
    • Minimum Price - $1.00
  • Price Entry/Exit
    • Use rule based system to get into and out of stocks
    • Assume 0.5% slippage on entry as stocks will likely be passing through buy/sell points at a high velocity
  • Commissions
    • Assume $5 per trade
For now that's it on limits! This should give me a sense of what the maximum possible returns are in a perfect world. Even this perfect world needs to be stemmed in reality which is why there are three important points I would like to make about the historical analysis I will be doing:
  1. Avoid bias
    • Focus on the entire world of stocks
    • Utilize all time frames data is available
    • Look for trend changes in "Winning" stocks qualities from older to newer periods in time
  2. Ensure entry would have been possible
    • I only have access to daily historical data which will limit entry/exit to open/closing prices
    • The limits on liquidity, slippage and entry/exit are to ensure it would have been possible to enter at the position the historical data says to enter
  3. Keep it realistic and find a pattern
    • I'm not going buy a stock for $.01 and sell it at it's top of $2 without valid reasons for doing so. If I cannot find a connection between any of the stocks data and performance I will pass until I find that connection. Sticking to the data and avoiding emotional decision is my advantage vs. other traders.
Next time we discuss how I will find and organize the data!! The fun never ends :)