4 – M1L6 06 Trading Strategy V2

Here’s how you might approach the problem of formulating the complete trading strategy. Our goal is to construct a stock portfolio of long and short positions, and the selection process for stocks to go into the portfolio is based on the stock’s returns performance relative to other stocks. For this example, we shall assume we are periodically re-evaluating and re-balancing stock holdings every month-end. Let’s use the S&P stocks universe. The top 500 stocks trading in the US tracked by the S&P 500 index. A stock universe, is a general term in finance that refers to a group of stocks that share certain common features, belong to the same market or simply a set of stocks that are used in verifying or simulating trading strategies. First, we fetch the daily closing prices of each toxins mid-2013. Please note that it is important that we use adjusted closing prices for analysis purposes. Also note that the composition of stock universes changes over time. For example, around 10 to 40 companies leave or enter the S&P 500 every year. When you test your strategy, it is important that your dataset for 2013 for example, contained the companies that were part of the universe in 2013. In fact, your dataset for any point in time, should contain the companies that were in the universe at that time. If you use the current composition for example, the current S&P 500 index in 2017, then you will effectively be testing your strategy on the subset of stocks that survive to 2017. These stocks probably performed better than the ones that left the universe. So the performance of your strategy will look better than it should. This is a subtle error that analysts often make, and is known as survivorship bias. Now, since we are only interested in month-end prices, we can re-sample the daily closing prices into monthly prices, then we can form a log returns time-series from the monthly prices. For each month-end observation period, we rank the stocks by their month-end returns from the highest to the lowest. Select the top performing end stocks into our long portfolio and the bottom performing end stocks into our short portfolio. You could also choose a fraction of stock say, the top and bottom 10 percent. To simplify this example, we’ll assume every stock gets an equal dollar amount of investment. This makes it easier to compute the portfolios monthly returns performance as the simple arithmetic average of the stock returns. Lastly, the combined portfolios monthly returns is the difference between the long portfolio’s return and that of the short portfolio. Now, continue doing this for each month and period and you have a momentum based trading strategy.

%d 블로거가 이것을 좋아합니다: