In the last blog post, I took a look at the three types of data that TradersStudio uses: split-adjusted, dividend-adjusted, and unadjusted data. We also took a look at how each data stream is used within the platform and showed a simple example of using this data with a simple trading strategy using Microsoft. As traders, however, we are often asked to consider the question of how our strategies compare to simply “buying and holding” the stock. That is to say, if we were to have bought one share of Microsoft when it first started, what would that be worth today? Fortunately, TradersStudio allows us to answer that question relatively easily.
Based on our calculations in the previous blog post, the profit on one share for Buy-and-Hold was $10,541.07! Looking at its net profit, it looks like our system approach only made about infinity value% of Buy-and-Hold. As we will see later, this is not the case and illustrates another problem associated with stock analysis. Over its history, Microsoft stock has split 288 – 1! So, buying a fixed number of shares throughout history does not represent true Buy-and-Hold. It is necessary to increase the number of shares to recreate the number of shares a single original share has become.
TradersStudio is the only product on the market that can produce a table of stock splits and dividends when CSI stock data or data from another vendor that allows the data to be output in the correct format. We will explain this in more detail in part three of this sequence of blog posts.
This analysis is shown in the Splits and Dividends Report.
This report shows the date of splits and dividends. The number of shares (288) was calculated by multiplying the stock split ratios (0.01 * 0.01 * 0.01 * 0.01 etc.). From this report we can also see the Microsoft did not pay dividends until September 21, 1987. This is a valuable report because it allows us to audit our testing results to see what has happened. This report is also created when this type of analysis is performed on a portfolio of stocks. If it were run on the S&P 500 or NASDAQ 100, you would have this Splits and Dividend Report included for all stocks included in the portfolio, ordered by date.
Now, let’s walk through the Buy-and-Hold calculation. Since the split factor for Microsoft is 288, our formula is (288 * Final Price) – Original Price. Since there are issues with maxbars back, we need to use the value of the first bar open, which is 31.9680 from May 27, 1986. Because Buy-and-Hold is calculated it in this way, it uses the close of the lastbar – 1. In our example, it is the close of November 25, 2009 which is 29.7900 this meaning Buy-and-Hold is:
(288 * 29.7900 [Final Price]) – 31.9680 [Original Price] = $8547.552
In our Buy-and-Hold calculation, we also need to adjust for dividends. Since Microsoft had split 288-1 by the time it paid any dividends and has not split during the dividend period, our calculation is easy. Simply add the dividends in the Splits and Dividend Report at $3.99 per share and multiple that value by 288. This gives a total of 1149.12. Add the two numbers together to get $8569.4172, which is what is reported as Buy-and-Hold.
A TradersStudio Stock Session has two different Trade-by-Trade Reports. There is the standard Trade-by-Trade Report that shows the entry and exit prices with the split-adjusted values. The P/L from the trade does not represent the P/L that would be calculated by only using split-adjusted data, but the real P/L on the trade. The standard Trade-by-Trade is used so the entry and exit prices match the prices you see on the chart, while the Trade-by-Trade Real Price gives you real world results. First, let’s look at the standard Trade-by-Trade Report. The split-adjusted price of Microsoft is less than $0.12 on June 5, 1986 while the real price is 34.00!
The other report is the Trade-by-Trade Real Price, which shows the real entry and exit prices. For example, on June 5, 1986, Microsoft was purchased at $34.25 and exited at $29.79, but the stock was split 2 – 1, so we exited two shares at $29.75 and $14.895 was made on the trade.
Now, that we have discussed Buy-and-Hold and how TradersStudio gives you actual entry and exit prices and a Splits and Dividend history, let me explain the problem with our analysis and why it looks like we only made infinity value% of Buy-and-Hold. The answer to the problem is that we should be buying the current number of shares that one original share has become and not just one share to be consistent in our Buy-and-Hold approach!
To do this, it is necessary to modify the QQQBreakoutLong system as follows; the new system is ‘QQQBreakOutStockTestLong ’.
' (C) 2004, 2005, 2010 TradersStudio(r) all rights reserved
'Simple ORB system to trade stocks, backtest adjusted for splits to create correct comparison to buy and hold
NumLots = splitfactor
BuyAndHoldSingle = true
If BarNumber < LastBar Then
Nxtopen = NextOpen(0)
Nxtopen = 0
If Close > Open Then
Sell("SellBrk",NumLots,Nxtopen – MULT * TrueRange,Stop,Day)
If Close < Open Then Buy("BuyBrk",NumLots,Nxtopen + MULT * TrueRange,Stop,Day) End If End Sub
A new function named ‘splitfactor’ is called. This number represents the number of shares that our original single share of stock has become after multiple splits. There is also a flag called ‘BuyAndHoldSingle = True.’ This bases Buy-and-Hold analysis on one original share and not the original number of shares that were purchased. For example, if analysis were started with 100 shares, Buy-and-Hold would be calculated based on 100 original shares if ‘BuyAndHoldSingle’ were set to ‘false.’
This means that the number of shares of Microsoft to buy and sell will change when there are signals on the following schedule. Before September 21, 1987, only one share would be purchased.
|Symbol||Date/Time||Dividend||Split||Shares to buy|
By making this significant change, the analysis is comparing apples to apples and we can see how the QQQBreakout system has done.
Now you can go to File -- Save Session as in the Session window and rename it MicrosoftStockTestBH. Then in the properties panel change the name of the system to QQQBreakoutStockTest. When you run it reset the Mult parameter to .50 and then run it. You will get the following results.
From the Session Summary Report page, you can see that the system makes $5068.42 instead of $0. This is still less than Buy-and-Hold by 208%, but not the infinity value % that we saw earlier. Also notice that Buy-and-Hold changed by 0.00. This is due to rounding effects in the algorithm. Since Microsoft split 288 times, an error of .03 represents .03/288 or a very small number that is within the error for a floating-point number. Microsoft stock has one of the largest split factors and most stocks will not have this much rounding error either.
This raises another question. When working with a stock database, the calculations should to be to 4 decimal places including the time before decimalization to increase accuracy. Some stock database vendors have maintained their database calculations at 2 decimal places even after decimalization occurred. This oversight serves to destroy the accuracy of the data. Using CSI data avoids this issue entirely as they have done a good job overall of maintaining their data accurately.
You might be thinking that this looks better but the system still did not beat Buy-and-Hold. The purpose of this example was not to give out a great system but to illustrate and explain the issues that are related to trading stock with the related stock splits and dividends. Let’s take a closer look at some of the other reports involved in stock trading.
This snapshot shows the Percent summary report that calculates percent return based on buying a fixed-dollar value of each stock. We can see from this report that performance is not quite as good as Buy-and-Hold using this simple system.
In our last and final blog post on this series, we'll take a look at using CSI data within TradersStudio!