A Guide to Using Equities Lab for Quantitative Investing
[Pages:62]A Guide to Using Equities Lab for Quantitative Investing
Sugata Ray1 With contributions from Henry Crutcher
1 I am grateful to Vikas Agarwal, Anthony Canalungo, Kaitlyn Harrow, Leila Sadri and students in my FIN 4414 class in Fall 2014 for help with this work. Any errors remain my own.
1
Contents
What is quantitative investing ............................................................................... 3 Equities Lab primer ................................................................................................ 6 How to create a screener.....................................................................................22
Value Screener ........................................................................................................................................ 26 Momentum screener .............................................................................................................................. 29 Dividend yield screener........................................................................................................................... 32 A real life screener ? value stocks that pay 3-5% dividend yield, diversified across industry, with reasonable market capitalizations, and tradable with up to $100,000 in capital .................................. 34 The "Restrictions" tab ............................................................................................................................. 36 Diversification ......................................................................................................................................... 39 Timing screens .....................................................................................................45 Rebalancing .......................................................................................................... 47 Why does quantitative investing work? ..............................................................55 Bibliography .........................................................................................................62
2
What is quantitative investing
Quantitative investing is generally defined as employing a rigorous set of rules based on easily observable criteria in deciding when and what to buy and sell. It encompasses a wide variety of strategies, from longer term equity strategies where equities are bought and held for periods up to or longer than a year, to very short term strategies trading in and out of securities multiple times during the course of a day. Of course, these shorter term strategies do not really "invest" in the securities. Regardless of the exact type of strategy employed, there are several common steps in all types of quantitative investing: (1) screens and horizons, and (2) backtests, and (3) implementation.
Screens
A screen is a formula for deciding what to buy and sell at any given time. A simple screen might be: buy all stocks that have positive returns over the last year.2 This is an example of a stock screen, which divides the universe of stocks into those the system will pick to buy and those it will not. A more complicated stock screen could have multiple criteria, such as "buy all stocks that have positive returns over the last year AND P/E ratios between 5 and 15." As opposed to stock screens, we can also implement timing screens. Timing screens are screens that use some measure of the overall economy to decide whether it is a good time to buy or sell. An example of a timing screen could be "Move all assets to stocks if unemployment has fallen 2 months in a row. Otherwise, keep all assets in cash." The screen basically keeps money in the broad equity markets if things are going smoothly in the economy, and in cash if unemployment is ticking up.
The difference between timing screens and stock screens can end up being subtle, and a number of screens will have flavors of both types of screens. "Buy all stocks if unemployment has fall 2 months in a row and buy only stocks with P/E between 5 and 15 if not" is a screen that combines timing and stock screen elements. In this guide, we will generally keep them separate, but it is important to remember that they could be used together, if desired. A screen will generally return a list of stocks and then a decision will have to be made. For example, "Buy all stocks if unemployment has fall 2 months in a row and buy only stocks with P/E between 5 and 15 if not" might return a list of 10,000 stocks if unemployment has fallen 2 months in a row, or 300 stocks if not. The next step is to decide what to do with these lists.
2 This is known in industry and academic circles as a "momentum" screen. The screen buys winners in the hope they continue to be winners (or the "momentum" continues). Narasimhan Jegadeesh and Sheridan Titman documented it in their 1993 paper, Returns to "Buying Winners and Selling Losers: Implications for Stock Market Efficiency" (Jegadeesh & Titman, 1993).
3
Generally, the easiest (and one of the most popular) thing to do among quantitative investors is to invest capital equally in all stocks that pass through a screen. So if 300 stocks get through our screen, we will divide the money we are investing equally into the 300 stocks and that will be our portfolio. 3 Another way to use this list would be to do deeper fundamental analysis on the names generated by the screen and pick individual securities to invest in, rather than simply dividing our capital equally among the companies that pass the screens.
In this guide, we will largely use quantitative screens without any further analysis. By default, we will hold an equal amount of all stocks returned by the screen (also called "equal-weighting"). You should feel free to use screens to support deeper analysis, but we will not cover techniques to do deep analysis into individual companies in this guide.4
Horizons (or rebalancing frequency)
A key part of any quantitative investing screen is the horizon of the strategy. If the screen provides information that determines what the trade is, the horizon provides the duration over which the trade is held. After the horizon is reached, the old positions are closed out, and if desired, the screen can be run again and new positions chosen. This process of closing out old positions and choosing new ones is known as "rebalancing." The horizon of your strategy is thus also known as the "rebalancing period."
A lot of the time, the measures used in the screen will dictate the horizon. So, for example, in the screen above based on unemployment, the strategy must have a horizon of at least one month, since unemployment numbers are released monthly. Put a different way, horizons cannot be shorter than the frequency at which information is released (if it did, the stocks in the screener would remain the same until new information came out). The screens based on P/E ratios above can have a much shorter horizon, since the price of a stock is constantly changing and thus, P/E ratios are constantly changing.
If the trading horizon is longer than the information frequency, you risk information used to generate the portfolio being stale. For example, you sort on P/E ratios today and buy all stocks with P/E between 0 and 10. Tomorrow, one of the stocks you bought spikes, its P/E is more than 10 and no longer fits in your screen. If your horizon is longer than a day, you will hold this stock despite the fact that the stock no longer fits your screen. Thus, the shorter the horizon, the less likely stocks that are not in your screen
3 There are other ways to weight the list: for example, we can weight by market capitalization or by dividends Indices generally weight by market capitalization. For example, the S&P 500 index weights the 500 components by their respective market components. The Dow Jones Industrial Average and the Nikkei 225 use a wacky weight: raw price level! They literally use the price of the stock to weight it. A $100 dollar stock has 10 times the weight of a $10 stock in these indices. 4 An excellent reference for this is Security Analysis (Graham & Dodd, Security Analysis, 1934). There are many revised versions of this text and other similar texts available. However, even Graham himself admitted such deep fundamental analysis is unlikely to yield the same payoffs in the modern markets that it did at the time the book was written (Graham, A conversation with Benjamin Graham, 1976).
4
are in your portfolio and the less likely that stocks that are not in your portfolio have evolved to be in your screen. The other main factor driving strategy time horizons is transaction costs. The shorter the horizon of your strategy, the more times you will have to trade out of old positions and into new ones. Trading generally incurs transactions costs, both in terms of commissions, price impact when trading and time and headache spent executing your trades. This is the main tension in choosing the ideal strategy horizon. Too long and you're holding stuff based on old information; too short and your returns are being eroded by transaction costs. In the financial industry, trading horizons can range from the extremely long (a year or even longer) to the very, very short (micro-, or even nano- seconds). High frequency trading, or HFT, is the form of quantitative "investing" that deals with these very short holding periods. It really is not investing, since rarely are positions held overnight and rarely is the intention of such trades to actually invest in companies. In the guide, for most strategies, we will run a quarterly rebalance. Equities Labs has a default rebalancing period of a week although that can (and should) easily be changed. Backtesting Once you've decided what it is you want your strategy to look like in terms of screens and horizons, you have to backtest it. To "backtest" a strategy is to see how it would have performed had it been implemented historically in the past. For example, if our strategy were to buy stocks with P/E between 0 and 10, rebalancing every quarter, we would need to go back to each quarter historically, and see what stocks would pass the screen, choosing them to hold in our portfolio, with whatever weight we chose. This is what results of our backtest would look like:
Figure 1: Backtest of results from a simple value screen
These are results from Equities Lab. We will discuss how to use Equities Lab to generate these types of backtests in a few pages. Before that, I want to point out a few things about the backtest results. Notice that the backtest goes from 2004 October to 2014 October. This is because in this particular case, I chose a 10 year time period over which to backtest. There are 40 quarters in this backtest. At the beginning of each quarter, Equities Labs chooses all stocks with a PE more than 0 and less than 10 and
5
creates a portfolio, holding an equal amount of each stock. It holds this portfolio until the end of the quarter and then sells all holdings, reinvesting the proceeds equally into the stocks chosen by the screen for the following quarter. In this backtest, we are looking at the returns to a trading strategy following the screen compared to the returns to the S&P 500 index. Over the 10 years, $100 invested in this simple quantitative trading strategy would have returned about $167 in profits, yielding a total sum of $267. The same $100 invested in the S&P 500 would have returns $69 in profits. And just like that, we have our first quantitative equity investing strategy. We will invest in stocks which have between 0 and 10 PE ratios, rebalancing our portfolio quarterly. Doing this historically would have outperformed the market by a healthy 100% over the last decade and if this pattern continues over the next 10 years, we'd be rich! Richer, anyway. Implementation This is the most important part of the whole process, but also the part a guide will be least able to help you. Implementation once you have a strategy is generally quite trivial. For example, if we chose a strategy such that we are investing in stocks with PE ratios between 0 and 10, all we'd have to do is open a brokerage account and divide our money equally between the stocks returns by the screen. In theory it sounds easy, but in practice, a myriad of complexities would pop up, most of which are specific to a given individual. For example, the screen might return 500 stocks, but we only have $5,000 to invest, making it cost inefficient to divide our capital evenly between the screened names.5 The best brokerage I've found for implementing quantitative strategies with 30 or fewer stocks is Motif Investing (). If you want to open an account and support give Dr. Ray a little referral bonus, you can use this link: Motif Investing Account Creation Link (with a referral bonus for Dr. Ray). They charge $10 to trade a basket of up to 30 shares. Also, they deal with fractional shares so dividing relatively small sums of money between many tickers is not too bad.
Equities Lab primer
The main problem with developing quantitative investing strategies (until now) has been that it requires a lot of data and the coding ability to parse and analyze the data. Most hedge funds hire Ph.D.s in
5 Oftentimes, tickers, or companies are also referred to as "names." If you use this terminology, not only will you have another synonym for ticker/company, but you'll also sound like you are in tune with the asset management industry.
6
disciplines ranging from computer science to statistics to physics to finance in order to obtain the requisite skills to launch quantitative investing strategies. Even the simple strategies outlined above (say, investing in stocks with PE between 0 and 10, rebalancing quarterly) would require a fair amount of data merging and coding. First we would have to obtain daily stock prices for the last 10 years. Then, using accounting statements for the last 10 years, we would have to obtain the number of shares outstanding quarterly as well as the quarterly earnings. Then, once we have computed the PE ratios for these companies over time (PE ratio = total market capitalization, or price per share X number of shares, divided by earnings over the last year), we would have to compute average returns of the screened stocks by quarter. It would take an experienced coder like me hours of mind-numbing work to merge and clean the data, and a bit longer to generate code to backtest the strategy. Most investors simply do not have the time or inclination to do this. The good news is legal copies of this guide come with a 3 month trial subscription to Equities Lab, which does all the data merging and provides an intuitive natural language based programming interface to generate and backtest screens.6 The bad news is that once you're hooked after the trial, you've got to buy a license to Equities Lab or start doing the hard work of merging data and coding screens yourself. Downloading Equities Lab and logging in
>
Creating Your First Screen Now that you've downloaded and installed Equities Lab, you are ready to create your first screen. If you are looking at the main home page you should see the image below. Note that as Equities Lab is constantly being updated, some minor details may be different in the version of Equities Lab that loads up compared to the screenshots, but hopefully the screenshots and videos should help you follow the basics.
6 You should have already received instructions on how to activate your trial to Equities Lab.
7
Figure 2: Equities Lab Home Page
Before you go on reading, you may want to watch the video embedded in the bottom panel of the home page. It will probably do more to get your familiar with Equities Lab than reading pages of text and screenshots. [ there are a lot of features in Equities Lab, don't feel overwhelmed by the intro video? videos in the following sections are much more surgical and deal with a single feature at a time ].
Equities Lab intro video
To create your first screener, click on "Create Stock Screener" in the middle of the left-hand column to start the stock screener interface.
8
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- best and worst dividend paying stocks stock market
- companies cut dividends in 09 at a level not seen since 1930s
- high quality dividend yield screen
- top 10 stock screening strategies that make money
- a guide to using equities lab for quantitative investing
- six monthly report
- how to screen for winning stocks amazon s3
- a fidelity investments webinar series basics of stock investing
- how to get the best of it
- edward jones stock tables
Related searches
- guide to choosing a major
- guide to being a man s man
- a girlfriends guide to divorce
- guide to getting a mortgage
- a man s guide to women
- guide to writing a textbook
- write a column to csv using pandas
- the water cycle a guide for students
- using a colon to introduce a list
- a beginner s guide to exercise
- php using a class to hold data
- the complete a guide to pc repair cheryl a schmidt