Modeling and Analyzing Stock Trends

A Major Qualifying Project

Submitted to the Faculty of

Worcester Polytechnic Institute

in partial fulllment of the requirements for the Degree in Bachelor of Science Mathematical Sciences By

Laura Cintron Garcia

Date: 5/6/2021

Advisor: Dr. Mayer Humi

This report represents work of WPI undergraduate students submitted to the faculty as evidence of a degree requirement. WPI routinely publishes these reports on its web site without editorial or peer review. For more information about the projects program at WPI, see http://www.wpi.edu/Academics/Projects 1 Abstract

Abstract

The goal of this project is to create and compare several dierent stock prediction models and nd a correlation between the predic- tions and for each stock. The models were created using the historical data, DJI index, and moving averages. The most accurate prediction model had an average of 5.3 days spent within a predic- tion band. A correlation of -0.0438 was found between that model an a measure of volatility, indicating that more prediction days means lower volatility.

2 2 Acknowledgments

Without the help of some people, it would have been signicantly more di- cult to complete this project without a group. I want to extend my gratitude to Worcester Polytechnic Institute and the WPI Math Department for their great eorts and success this year regarding school and projects during the pandemic. They did everything they could to ensure these projects was still a rich experience for the students despite everything.

I would also like to thank my MQP advisor, Professor Mayer Humi for his assistance and guidance on this project, for allowing me to work indepen- dently while always being willing to meet with me or answer any questions, and for continuously encouraging me to do what I thought was best for the project.

3 3 Executive Summary

The is a complicated system that nancial analysts have been tracking and attempting to predict for decades. While there are many Ma- chine Learning Models that have been created to predict future values of stocks and investments, many people still believe that the stock market can- not be predicted because its values are random. While I agree that it would be very dicult to take into account every factor that could have a part in the movement of stock prices, there are ways to approximate the data and predict several future values using historical data, the market indices, and taking into account the volatility of a stock. The goal for this project was to develop multiple nancial stock prediction models based on the stocks' historical data and incorporating the inuence of the Dow Jones Industrial (DJI) Index that can be used to predict the future values of stocks. Some of the models also incorporate the '' of each stock to approximate the future values. The model also contains various methods of measuring the volatility of each stock, including Bollinger Bands and a scale created from the number of values within 1 of the mean for each stock. The models were created using stocks in the Indus- trial Sector of the stock market and the DJI index but can, theoretically, be utilized for any stock and index, so long as the appropriate Index is applied for the that stock. The stocks selected are all from the Industrial sector of the stock market and, at the time of selection, were all priced between $20 - $150. This project was divided into 4 main models: (1) model using only the historical data of each stock, (2) model using historical data and DJI inuence, (3) model using moving average of historical data, (4) model using moving average of historical data and DJI inuence. An auto-correlation was taken for each for each stock to nd the time period that is relevant in nding future values (relevant period). For each stock, the model measured how many days their true closing values spent within a prediction band. Here are the 4 models running the stock Alamo Group Corp. (ALG). For each model, ALG spent 4, 5, 4 , and 4 days within the prediction bands respectively.

Figure 1: ALG Fourier Approximation

4 Figure 2: ALG DJI Inuence Approximation

Figure 3: Moving Average ALG Fourier Approximation

5 Figure 4: Moving Average ALG DJI Inuence Approximation

Then, volatility was measured using 2 dierent methods. The rst being a scale that uses the percentage of values 1 standard deviation away from the mean for each stock and DJI, to nd the volatility of each stock in relation to the DJI's volatility. This was done by nding the dierence between each stock's % of values within 1 standard deviation of their mean (%stock)

6 and the %DJI and nding the standard deviation of those dierences. The percentages that are within 1 sd away from the %DJI were deemed a 1 on the scale, those within 2 sd away from the %DJI are a 2 on the scale, within 3 sd away from the %DJI are a 3 on the scale, and 4 sd away from the %DJI are a 4 on the scale. The lower the number on the scale the less volatile the stock is. The next measure was by creating Bolinger Bands using the moving average of each stock, plotting bands 1 standard deviation above and below the mov- ing average of each stock and counting the number of times the closing prices touch/cross the bands. The lower the number of touches, the less volatile the stock is and vice- versa.

A correlation between each dierent model and each measure of volatility was taken to see if a pattern could be found between having a higher number of days and a lower volatility measure.

The days that all of the stocks spent within their prediction band for each model was counted and the average was taken.

Figure 5

According to the average number of days each stock spent within their prediction band, the best model was the one using the moving average and the DJI inuence, with an average of 5.3 out of 9 days. The DJI volatility

7 comparison scale (1-4) and the number of Bollinger touches for each stock is shown below.

Figure 6

In the volatility scale, there were no stocks within one standard deviation of the %DJI, but these values change if the 'relevant' period changes. The scale measures the volatility relative to the volatility of the DJI. A 1 on the scale indicates that the stock is roughly as volatile as the DJI, a 2 means its only slightly more volatile, a 3 is even more volatile, and a 4 indicates that is it is signicantly more volatile than the DJI. For the Bolinger Bands, most of the stocks had a minimal amount of touches, therefore they are not overly volatile. The correlations between the number of days each stock spent within the prediction bands for each model and the 2 measures of volatility were taken.

Figure 7

A stronger negative correlation would indicate that there is a pattern between low volatility and a higher number of days within their prediction band. The MA DJI Model+ Bollinger have a negative correlation, which may indicate

8 that it is the better prediction model and the Bollinger bands are the better measure of volatility.

9 Contents

1 Abstract 2

2 Acknowledgments 3

3 Executive Summary 4

4 Introduction 17 4.1 Motivation and Goals ...... 17 4.2 Financial Modeling and Model Trading Today ...... 18

5 Background 19 5.1 Stock Selection ...... 19 5.2 Auto-correlation ...... 23 5.3 Trend- Line ...... 31 5.4 Fourier Series ...... 47 5.5 Market Indices ...... 47 5.6 Moving Average ...... 49

6 Models and Predictions 50 6.1 Fourier Approximation ...... 50 6.2 DJI Inuence Approximation ...... 57 6.3 Moving Average: Fourier Approximation ...... 65 6.4 Moving Average: DJI Inuence Approximation ...... 71

7 Volatility 78 7.1 Scale A ...... 78 7.2 Bollinger Bands ...... 79 7.3 Volatility Correlations ...... 85

8 Conclusion 87

10 List of Figures

1 ALG Fourier Approximation ...... 4 2 ALG DJI Inuence Approximation ...... 5 3 Moving Average ALG Fourier Approximation ...... 5 4 Moving Average ALG DJI Inuence Approximation ...... 6 5 ...... 7 6 ...... 8 7 ...... 8 8 The auto-correlation determined that the data that is useful for prediction for ALG are the 87 days prior to the start of the prediction. The relevant period for ALG is 11/3/2020 - 3/11/2021, represented by 213:300...... 23 9 The auto-correlation determined that the data that is useful for prediction for AOS are the 109 days prior to the start of the prediction. The relevant period for AOS is 10/2/2020 - 3/11/2021, represented by 191:300...... 24 10 The auto-correlation determined that the data that is useful for prediction for AYI are the 58 days prior to the start of the prediction. The relevant period for AYI is 12/15/2020 - 3/11/2021, represented by 242:300...... 24 11 The auto-correlation determined that the data that is useful for prediction for BDC are the 52 days prior to the start of the prediction. The relevant period for BDC is 12/23/2020 - 3/11/2021, represented by 248:300...... 25 12 The auto-correlation determined that the data that is useful for prediction for CARR are the 87 days prior to the start of the prediction. The relevant period for CARR is 11/3/2020 - 3/11/2021, represented by 213:300...... 25 13 The auto-correlation determined that the data that is useful for prediction for CYRX are the 111 days prior to the start of the prediction. The relevant period for CYRX is 9/30/2020 - 3/11/2021, represented by 189:300...... 26 14 The auto-correlation determined that the data that is useful for prediction for DAL are the 45 days prior to the start of the prediction. The relevant period for DAL is 1/5/2021 - 3/11/2021, represented by 255:300...... 26

11 15 The auto-correlation determined that the data that is useful for prediction for ECHO are the 94 days prior to the start of the prediction. The relevant period for ALG is 10/23/2020 - 3/11/2021, represented by 206:300...... 27 16 TThe auto-correlation determined that the data that is useful for prediction for GGG are the 95 days prior to the start of the prediction. The relevant period for GGG is 10/22/2020 - 3/11/2021, represented by 205:300...... 27 17 The auto-correlation determined that the data that is useful for prediction for LSTR are the 110 days prior to the start of the prediction. The relevant period for LSTR is 10/1/2020 - 3/11/2021, represented by 190:300...... 28 18 The auto-correlation determined that the data that is useful for prediction for PRLB are the 109 days prior to the start of the prediction. The relevant period for PRLB is 10/2/2020 - 3/11/2021, represented by 191:300...... 28 19 The auto-correlation determined that the data that is useful for prediction for RTX are the 41 days prior to the start of the prediction. The relevant period for RTX is 1/11/2020 - 3/11/2021, represented by 159:300...... 29 20 The auto-correlation determined that the data that is useful for prediction for SXI are the 85 days prior to the start of the prediction. The relevant period for SXI is 11/5/2020 - 3/11/2021, represented by 215:300...... 29 21 The auto-correlation determined that the data that is useful for prediction for TNC are the 39 days prior to the start of the prediction. The relevant period for TNC is 1/5/2020 - 3/11/2021, represented by 261:300...... 30 22 The auto-correlation determined that the data that is useful for prediction for WM are the 45 days prior to the start of the prediction. The relevant period for ALG is 1/13/2020 - 3/11/2021, represented by 255:300...... 31

23 p1(1) = 0.3153, p1(2) = 62.8036...... 31 24 ...... 32

25 p2(1) = 0.0686, p2(2) = 39.9404...... 32 26 ...... 33

27 p3(1) = 0.22088, p3(2) = 62.2602...... 33 28 ...... 34

12 29 p4(1) = 0.0661, p4(2) = 27.3481...... 34 30 ...... 35

31 p5(1) = −0.0091, p5(2) = 40.0528...... 35 32 ...... 36

33 p6(1) = 0.1998, p6(2) = 5.2696...... 36 34 ...... 37

35 p7(1) = 0.2379, p7(2) = −22.9115...... 37 36 ...... 38

37 p8(1) = 0.0025, p8(2) = 27.7580...... 38 38 ...... 39

39 p9(1) = 0.0595, p9(2) = 54.4084...... 39 40 ...... 40

41 p10(1) = 0.3442, p10(2) = 55.8267...... 40 42 ...... 41

43 p11(1) = 0.4980, p11(2) = 34.9771...... 41 44 ...... 42

45 p12(1) = 0.2050, p12(2) = 14.5016...... 42 46 ...... 43

47 p13(1) = 0.3512, p13(2) = −6.1800...... 43 48 ...... 44

49 p14(1) = 0.2234, p14(2) = 12.2356...... 44 50 ...... 45

51 p15(1) = 0.0037, p15(2) = 113.4737...... 45 52 ...... 46 53 1 , Days in prediction interval = 4 51 2 × MaxDiffALG = 4.16665 54 1 , Days in prediction interval = 1 . 51 2 × MaxDiffAOS = 2.13735 55 1 , Days in prediction interval = 1 . 51 2 × MaxDiffAY I = 2.9673 56 1 , Days in prediction interval = 0 . 52 2 × MaxDiffBDC = 1.27465 57 1 , Days in prediction interval = 5 . 52 2 × MaxDiffCARR = 1.5348 58 1 , Days in prediction interval = 9 52 2 × MaxDiffCYRX = 7.1284 59 1 , Days in prediction interval = 4 53 2 × MaxDiffDAL = 0.99035 60 1 , Days in prediction interval = 6 53 2 × MaxDiffECHO = 1.81715 61 1 , Days in prediction interval = 7 . 54 2 × MaxDiffGGG = 2.3433 62 1 , Days in prediction interval = 1 54 2 × MaxDiffLST R = 3.57085 63 1 , Days in prediction interval = 0 54 2 × MaxDiffP RLB = 24.34295 64 1 , Days in prediction interval =6 . . 55 2 × MaxDiffRTX = 1.6282 65 1 , Days in prediction interval = 4 . 55 2 × MaxDiffSXI = 2.45825 66 1 , Days in prediction interval = 3 55 2 × MaxDiffTNC = 1.54565

13 67 1 , Days in prediction interval = 2 . 56 2 × MaxDiffWM = 1.3088 68 DJI Approximation Model ...... 57 69 1 Days in prediction interval =5 58 2 × DJIMaxDiffALG = 4.2266 70 1 , Days in prediction interval = 4 58 2 × DJIMaxDiffAOS = 2.7219 71 1 , Days in prediction interval 2 × DJIMaxDiffAY I = 4.06955 =2...... 59 72 1 , Days in prediction interval 2 × DJIMaxDiffBDC = 1.93005 =1...... 59 73 1 , Days in prediction interval 2 ×DJIMaxDiffCARR = 2.27335 =8...... 59 74 1 , Days in prediction interval 2 ×DJIMaxDiffCYRX = 9.24445 =9...... 60 75 1 Days in prediction interval 2 × DJIMaxDiffDAL = 1.39155 =4...... 60 76 1 , Days in prediction interval 2 × DJIMaxDiffECHO = 1.1741 =3...... 61 77 1 , Days in prediction interval 2 × DJIMaxDiffGGG = 2.9885 =9...... 61 78 1 , Days in prediction interval 2 × DJIMaxDiffLST R = 3.9685 =2...... 61 79 1 Days in prediction interval 2 × DJIMaxDiffP RLB = 40.4352 =9 ...... 62 80 1 Days in prediction interval = 7 62 2 × DJIMaxDiffRTX = 1.7885 81 1 , Days in prediction interval = 4 63 2 × DJIMaxDiffSXI = 4.0236 82 1 , Days in prediction interval 2 × DJIMaxDiffTNC = 1.52565 =5 ...... 63 83 1 , Days in prediction interval 2 × DJIMaxDiffWM = 1.37245 =6 ...... 63 84 1 , Days in prediction interval = 4 65 2 × MAMaxDiffALG = 4.0701 85 1 , Days in prediction interval 2 × MAMaxDiffAOS = 2.13775 =1...... 65 86 1 , Days in prediction interval = 2 × MAMaxDiffAY I = 2.9939 1...... 66 87 1 , Days in prediction interval 2 × MAMaxDiffBDC = 1.27925 =0...... 66 88 1 Days in prediction interval 2 × MAMaxDiffCARR = 1.08265 =5 ...... 67

14 89 1 , Days in prediction interval 2 × MAMaxDiffCYRX = 7.1497 =9...... 67 90 1 , Days in prediction interval 2 ×MAMaxDiffDAL = 0.99015 =4 ...... 67 91 1 , Days in prediction interval 2 ×MAMaxDiffECHO = 1.81715 =6...... 68 92 1 , Days in prediction interval 2 × MAMaxDiffGGG = 2.30795 =8 ...... 68 93 1 , Days in prediction interval 2 × MAMaxDiffLST R = 2.9668 =4 ...... 69 94 1 , Days in prediction interval 2 ×MAMaxDiffP RLB = 23.72305 =0...... 69 95 1 , Days in prediction interval = 5 69 2 × MAMaxDiffRTX = 1.6296 96 1 , Days in prediction interval 2 × MAMaxDiffSXI = 3.06115 =3...... 70 97 1 , Days in prediction interval 2 × MAMaxDiffTNC = 1.5438 =4 ...... 70 98 1 , Days in prediction interval = 2 70 2 × MAMaxDiffWM = 1.3086 99 1 , Days in prediction in- 2 × MADJIMaxDiffALG = 4.32525 terval = 4 ...... 71 100 1 , Days in prediction in- 2 × MADJIMaxDiffAOS = 2.72215 terval = 4 ...... 71 101 1 Days in prediction in- 2 × MADJIMaxDiffAY I = 4.02595 terval = 2 ...... 72 102 1 , Days in prediction in- 2 × MADJIMaxDiffBDC = 1.74775 terval = 1 ...... 72 103 1 , Days in prediction in- 2 × MADJIMaxDiffCARR = 1.6825 terval = 6 ...... 73 104 1 , Days in prediction in- 2 × MADJIMaxDiffCYRX = 9.2869 terval = 9 ...... 73 105 1 , Days in prediction in- 2 × MADJIMaxDiffDAL = 1.3915 terval = 4 ...... 73 106 1 , Days in prediction in- 2 × MADJIMaxDiffECHO = 1.5797 terval =5 ...... 74 107 1 , Days in prediction inter- 2 × MADJIMaxDiffGGG = 2.946 val=9...... 74 108 1 , Days in prediction in- 2 × MADJIMaxDiffLST R = 3.48065 terval = 8 ...... 75

15 109 1 , Days in prediction 2 × MADJIMaxDiffP RLB = 45.3307 interval = 9 ...... 75 110 1 , Days in prediction in- 2 × MADJIMaxDiffRTX = 1.7894 terval = 6 ...... 75 111 1 , Days in prediction inter- 2 × MADJIMaxDiffSXI = 4.1176 val=3...... 76 112 1 , Days in prediction in- 2 × MADJIMaxDiffTNC = 1.52065 terval = 5 ...... 76 113 1 , Days in prediction in- 2 × MADJIMaxDiffWM = 1.37495 terval = 5 ...... 77 114 ...... 78

115 SDALG = 8.7616, Bollinger Touches = 0 ...... 79

116 SDAOS = 2.8567, Bollinger Touches = 1, UNDERSOLD . . . 80

117 SDAY I = 4.8151, Bollinger Touches = 3, OVERSOLD . . . . . 80

118 SDBDC = 2.9385, Bollinger Touches = 2, OVERSOLD . . . . 80

119 SDCARR = 1.3256, Bollinger Touches = 10, OVERSOLD . . . 81

120 SDCYRX = 9.7112, Bollinger Touches = 1, OVERSOLD . . . 81

121 SDDAL = 3.6763, Bollinger Touches = 0 ...... 81

122 SDECHO = 1.2126, Bollinger Touches = 8, UNDERSOLD . . 82

123 SDGGG = 3.4836, Bollinger Touches = 1, UNDERSOLD . . . 82

124 SDLST R = 12.3428, Bollinger Touches = 0 ...... 82

125 SDP RLB = 31.5667, Bollinger Touches = 1, OVERSOLD . . . 83

126 SDRTX = 3.0918, Bollinger Touches = 1, OVERSOLD . . . . 83

127 SDSXI = 9.8647, Bollinger Touches = 0 ...... 83

128 SDTNC = 3.3078, Bollinger Touches = 0 ...... 84

129 SDWM = 2.8561, Bollinger Touches = 1, OVERSOLD . . . . 84 130 ...... 84 131 ...... 85 132 ...... 87 133 ...... 88

16 4 Introduction

4.1 Motivation and Goals

I) The stock market refers to any assortment of markets and exchanges where shares of publicly- held companies can be bought, sold, and is- sued. Three of the most notable stock exchanges in America are the New York Stock Exchange (NYSE), the NASDAQ and the Chicago Board Options Exchange (CBOE). With the rise in popularity of the internet at the turn of the century, several online stock exchanges arose. Since most people have access to the internet today, the stock exchange became a system that average people without a specic form of formal nancial education could be a part of. With the number of people involved in the stock market sky- rocketing very quickly, there were many more people with the resources to possibly model trends and predict long- term stock values. Because of the chaotic nature of the stock market, there are many in- vestments experts that believe that it is impossible to accurately and consistently predict future values of stocks. The number of dierent, considerable variables and factors that could aect the future value of an investment is far too large to possibly take them all into con- sideration for prediction. Je Stible of the Harvard Business Review compared it to playing chess; although, there are considerably less fac- tors and possible moves to be made when playing chess, and there are still 10120 possible moves that could be made. A chess game is a far simpler system than the stock market, so from this perspective, the likeliness of creating an accurate, comprehensive, long-term model for predicting future stock values are very low. However, there have obvi- ously been very many prediction models created for the certain stocks and sectors, because there are ways to include some of the more 'tan- gible' factors like historical data, market indices, moving averages, and volatility. These are all useful tools for approximating future data. The goal for this project, is to create several nancial models that can represent and predict future values of a specic set of stocks with dif- ferent combinations of internal and external factors that could aect future prices. [1]

17 4.2 Financial Modeling and Model Trading Today

Although there have been approximation and prediction models since the conception of the stock market, most notably certain market indices and moving averages, it wasn't until the internet was very widespread, that amateur investors and nancial math enthusiasts could discuss and share custom made models and predictors. Today, there are hun- dreds of models and predictors online being sold or traded or given away by other stock market enthusiasts. Some notable ones are the Universal Market Prediction Index (UMPI), Mean Reversion models, and Martingale models. There is no guarantee that the models will be perfectly accurate in the long term, but they can be used to reveal many dierent aspects and characteristics of that stock or sector. [9] [7]

18 5 Background

5.1 Stock Selection

There are 11 dierent sectors in the stock market: materials, indus- trial, Finance, energy, consumer discretionary, information technology, communication services, real estate, health care, consumer staples, and utilities. The industrial sector consists of automobile companies, steel production, aerospace manufacturing, electricity, gas, lighting, logis- tics, telecommunications and more. For consistency, the stocks to be modeled were all chosen from the Industrial sector. The task was to choose 15 stocks from the Industrial Sector with share prices between 20 and 150. The stocks I chose to track are Acuity Brands Inc. (AYI), A. O. Smith Corp,(AOS), Alamo Group Com- pany (ALG), Belden Inc. (BDC), Carrier Global Group (CARR), Cry- oport Inc. (CYRX), Standex International Corp. (SXI), Delta Airlines Inc. (DAL), Echo Global Logistics (ECHO), Proto Labs Inc. (PRLB), Graco Inc. (GGG), Landstar Syten Inc. (LSTR), Raytheon Technolo- gies Corp. (RTX), Tennant Co. (TNC), and Waste Management Inc. (WM). Among these, there is a Airline, a few logistics companies, a waste management company, and a prototype labs. When choosing them, I decided that these stocks were all dierent but they painted a com- prehensive picture of the industrial sector so I could analyze and make conclusions about it.

II) Alamo Group Inc. ALG Alamo Group Inc. focuses on the design and manufacturing of agri- cultural equipment as well as infrastructure maintenance equipment. They sell tractor-mounted mowing, vegetation maintenance equipment, street sweepers, excavators, vacuum trucks, snow removal equipment, pothole patches, etc. They have an Agricultural and Industrial seg- ments where they make most of their revenue from. As of 11/16/2020, the closing price of the stock was $135.42. There has been a steady rise in the share price since then. The share price as of 3/11/2021 is $160.69.

19 III) A. O. Smith Corp AOS A. O. Smith Corporation is a manufacturing company for lines of res- idential and commercial gas, gas tankless, and electric water heaters. They sell they're products primarily in North America where they use a wholesale distribution channel, and Asia where they opertate their sales oces for distribution expansion. The closing price as of 11/16/2020 of the stock was $56.40. There has been a steady rise in the share price since then. The share price as of 3/11/2021 is $64.98.

IV) Acuity Brands Inc. AYI Acuity Brands Inc. is a parent company of Acuity Brands Lighting and other companies that provide lighting products for commercial, indus- trial, and residential applications. AYI's products consist of integrated lighting systems, lighting controls and lighting components mainly in the United States. As of 11/16/2020, the closing price of AYI was $107.99. There has been a steady rise in the share price since then. The share price as of 3/11/2021 is $135.01.

V) Belden Inc. BDC Belden Inc. provides signal transmission products to distributors, users, installers, and original equipment manufacturers. Belden has segments Enterprise Solutions which provides network infrastructure solutions, cable and connectivity for commercial audio/ video and security; and Industrial Solutions provides high- performance networking compo- nents and machine connectivity products. As of 11/16/2020, the closing price of the BDC stock was $37.23. There has been a slow rise in the price since then. The share price as of 3/11/2021 is $45.62.

VI) Carrier Global Corp Ordinary Shares CARR Carrier Global Corp makes heating, air- conditioning, ventilation, re protection and security products. Carriers residential HVAC sales make up 40 percent of HVAC sales, and commecial market makes up 60 per- cent. They use Sensitech supply chain monitoring for the refrigiration

20 segment and transportation. As of 11/16/2020, the closing price of of the stock was $40.5. There has been a slow rise in the price since then. The share price as of 3/11/2021 is $39.23.

VII) Cryoport Inc. CYRX Cryoport Inc. provides temperature controlled solution to the life- sciences industry based in Tennessee. It has a Global Logistics Solu- tions segment that provides temperature- controlled logistics solutions with specialtized packaging and cold logistics expretise, and IT, and a Global Bio services segment provides a temperature controlled sample management to the life- science industry, like for specimen storage and sample processing. As of 11/16/2020, Cryoport had a closing price of $50.22. There has been no signicant rise or fall in the closing prices since then. The share price as of 3/11/2021 is $57.35.

VIII) Delta Airlines Inc. DAL Delta Airlines is one of the world's largest airlines that has a network of more than 300 destinations in more than 50 countries. Delta has key locations in Atlanta, New York, Salt Lake City, Detroit, Seattle, and Minneapolis where they gather and distribute passangers. As of 11/16/2020, the closing price of the stock was $38.00. There has been a slow rise in the prices since then. The share price as of 3/11/2021 is $48.32.

IX) Echo Global Logistics Inc. ECHO Echo Global Logistics is a third- party logistics provider for domestic truckload and less than truckload business. It also is involved in ait and ocean travel, though to a lesser degree. As of 11/16/2020, the closing price for the stock was $29.41. There has been no signicant rise or fall since then. The share price as of 3/11/2021 is $32.46.

X) Proto Labs Inc. PRLB

21 Proto Labs manufactures custom parts for prototyping and short- run production. They help developers and engineers reduce the time to market by providing production services using injection molding, com- puter numerical control machining, and 3-d printing. As of 11/16/2020, the closing price of the stock was $132.58. Since then, there has been a slow fall in the prices. The share price as of 3/11/2021 is $135.60.

XI) Graco Inc. GGG Graco manufactures equipment used for managing uids, coatings, ad- hesives, and other hard to manage materials. They have 3 segments: industrial, process and contractor. They serve industrial, automotive and construction markets. As of 11/16/2020, the closing price of the stock was $68.83. Since then, there has been a very slow rise in share prices. The share price as of 3/11/2021 is $67.54.

XII) Landstar System Inc. LSTR Landstar System is another third party logistics company that makes 93 percent of its revenue from truck transportation, with the rest made up of inter modal, global air, and ocean travel, and warehousing ser- vices. As of 11/16/2020, the closing price of the stock is $131.88. Since then, the stock has steadily risen. The share price as of 3/11/2021 is $163.54.

XIII) Raytheon Technologies Corp RTX Raytheon technologies is an aerospace and defense industrial company formed when United Technologies and Raytheon. They supply roughly equally to the commercial aerospace manufactures, and to the defense market. As of 11/16/2020, the closing price of the stock is $68.66. There has been no signicant rise or fall since then. The share price as of 3/11/2021 is $77.05.

XIV) Standex International Corp SXI

22 Standex International Corp is a manufacturing rm that has 5 seg- ments: Food Service Equipment, Engraving, Engineering Technologies, Electronics, and Hydraulics. As of November 16, the closing price of the stock was $77.08. Since then, there has been a very slow rise. The share price as of 3/11/2021 is 105.78.

XV) Tennant Co. TNC Tennant Co manufatures oor cleaning equipment, wood ooring, and wood products. The company makes mechanized cleaning equipment, sustainable cleaning technologies, equipment maintenance, etc. As of 11/16/2020, the closing price of the stock is $67.83. Since then, the stock has steadily risen. The share price as of 3/11/2021 is $80.85.

XVI) Waste Management Inc.WM Waste Management is the largest integrated provider of solid waste services in the US. They serve residential, commercial, and industrial markets while also being a leading recycling company. As of 11/16/2020, the closing price of the stock was $121.99. There as been no signicant rise or fall since then. The share price as of 3/11/2021 was $120.00.

5.2 Auto-correlation When creating trends for stocks the auto- correlation can help determine exactly which data is important for predictions. The auto- correlation mea- sures the relationship between a variable's current value and its past values. It is used by investors and technical analysts to measure the impact past values have on future values of a variable. For the purposes of this project, the last day before the prediction begin is 3/11/2021, which is represented by the number 300 in the MATLAB le.

Figure 8: The auto-correlation determined that the data that is useful for prediction for ALG are the 87 days prior to the start of the prediction. The relevant period for ALG is 11/3/2020 - 3/11/2021, represented by 213:300.

23 Figure 9: The auto-correlation determined that the data that is useful for prediction for AOS are the 109 days prior to the start of the prediction. The relevant period for AOS is 10/2/2020 - 3/11/2021, represented by 191:300.

Figure 10: The auto-correlation determined that the data that is useful for prediction for AYI are the 58 days prior to the start of the prediction. The relevant period for AYI is 12/15/2020 - 3/11/2021, represented by 242:300.

24 Figure 11: The auto-correlation determined that the data that is useful for prediction for BDC are the 52 days prior to the start of the prediction. The relevant period for BDC is 12/23/2020 - 3/11/2021, represented by 248:300.

Figure 12: The auto-correlation determined that the data that is useful for prediction for CARR are the 87 days prior to the start of the prediction. The relevant period for CARR is 11/3/2020 - 3/11/2021, represented by 213:300.

25 Figure 13: The auto-correlation determined that the data that is useful for prediction for CYRX are the 111 days prior to the start of the prediction. The relevant period for CYRX is 9/30/2020 - 3/11/2021, represented by 189:300.

26 Figure 14: The auto-correlation determined that the data that is useful for prediction for DAL are the 45 days prior to the start of the prediction. The relevant period for DAL is 1/5/2021 - 3/11/2021, represented by 255:300.

Figure 15: The auto-correlation determined that the data that is useful for prediction for ECHO are the 94 days prior to the start of the prediction. The relevant period for ALG is 10/23/2020 - 3/11/2021, represented by 206:300.

27 Figure 16: TThe auto-correlation determined that the data that is useful for prediction for GGG are the 95 days prior to the start of the prediction. The relevant period for GGG is 10/22/2020 - 3/11/2021, represented by 205:300.

Figure 17: The auto-correlation determined that the data that is useful for prediction for LSTR are the 110 days prior to the start of the prediction. The relevant period for LSTR is 10/1/2020 - 3/11/2021, represented by 190:300.

28 Figure 18: The auto-correlation determined that the data that is useful for prediction for PRLB are the 109 days prior to the start of the prediction. The relevant period for PRLB is 10/2/2020 - 3/11/2021, represented by 191:300.

Figure 19: The auto-correlation determined that the data that is useful for prediction for RTX are the 41 days prior to the start of the prediction. The relevant period for RTX is 1/11/2020 - 3/11/2021, represented by 159:300.

29 Figure 20: The auto-correlation determined that the data that is useful for prediction for SXI are the 85 days prior to the start of the prediction. The relevant period for SXI is 11/5/2020 - 3/11/2021, represented by 215:300.

Figure 21: The auto-correlation determined that the data that is useful for prediction for TNC are the 39 days prior to the start of the prediction. The relevant period for TNC is 1/5/2020 - 3/11/2021, represented by 261:300.

30 Figure 22: The auto-correlation determined that the data that is useful for prediction for WM are the 45 days prior to the start of the prediction. The relevant period for ALG is 1/13/2020 - 3/11/2021, represented by 255:300.

5.3 Trend- Line

After the relevant data was found, a trend line was created for the data and was plotted with the closing prices. To do this, the polyt function was used which returns the coecients for a polynomial of degree `n' over a certain interval. In this case, the degree of the trend line is 1, so the polyt function of each stock's data and returned 2 coecients, the slope of the line and the y- intercept. These coecients for each stock (n= 1 to 15) are represented as

pn(1) = slope of the line and pn(2) = y − intercept

. The trend-lines, the trend- line coecients, and the dierence between the trend-line and the closing prices are shown below for each stock.

Figure 23: p1(1) = 0.3153, p1(2) = 62.8036.

31 Figure 24

Figure 25: p2(1) = 0.0686, p2(2) = 39.9404.

32 Figure 26

Figure 27: p3(1) = 0.22088, p3(2) = 62.2602.

33 Figure 28

Figure 29: p4(1) = 0.0661, p4(2) = 27.3481.

34 Figure 30

Figure 31: p5(1) = −0.0091, p5(2) = 40.0528.

35 Figure 32

Figure 33: p6(1) = 0.1998, p6(2) = 5.2696.

36 Figure 34

Figure 35: p7(1) = 0.2379, p7(2) = −22.9115.

37 Figure 36

Figure 37: p8(1) = 0.0025, p8(2) = 27.7580.

38 Figure 38

Figure 39: p9(1) = 0.0595, p9(2) = 54.4084.

39 Figure 40

Figure 41: p10(1) = 0.3442, p10(2) = 55.8267.

40 Figure 42

Figure 43: p11(1) = 0.4980, p11(2) = 34.9771.

41 Figure 44

Figure 45: p12(1) = 0.2050, p12(2) = 14.5016.

42 Figure 46

Figure 47: p13(1) = 0.3512, p13(2) = −6.1800.

43 Figure 48

Figure 49: p14(1) = 0.2234, p14(2) = 12.2356.

44 Figure 50

Figure 51: p15(1) = 0.0037, p15(2) = 113.4737.

45 Figure 52

This dierence is used in creating the Fourier Trend for each stock.

46 5.4 Fourier Series A Fourier series is a periodic function created by a weighted summation of sinusoidal waves that forms new waves and can be used to approximate data. It represents any periodic fuction as a sum of sine and cosine functions. The series and its coecients follow the system of formulas below. [3]

f(x) = F ourier Series 1 L = × the period of the function, 2

a0, an bn = coefficients to be calculated ∞ ∞ X π X π f(x) = a + a cos(nx ) + b sin(nx ) 0 n L n L n=1 n=1 1 Z L a0 = f(x)dx 2L −L 1 Z L π an = f(x) cos(nx )dx L −L L 1 Z L π bn = f(x) sin(nx )dx L −L L In investing, Fourier Series are used to reconstruct observed data be- cause the approximation tends to minimize the eect of complicating factors and identies the eects of the periodic patterns that there are within the data. Fourier analysis is commonly found in algorithmic trading and techni- cal analysis as a measure for market- direction forecasts and trend analysis. Because a Fourier Series attempts to drown out the stock market's chaotic nature, it can feature its periodic patterns and trends. [4] [10]

5.5 Market Indices A market index is a 'hypothetical' collection of investment holdings that can be used to reect the state of a segment of the stock market. A person cannot directly invest in a market index so they are used generally as a measure of the general behavior of a set of big players in the stock market. However, because of the known and eects that social perception can have on the stock it is possible for the indices to directly aect a sector's stock's share prices.

47 Some of the most popular market indices are the DOW Jones Industrial Av- erage (DJIA), the S&P500 Index, the NASDAQ Composite Index, and the Bloomberg Barclays U.S. Aggregate Bond Index. The Dow Jones Industrial Index tracks the stock market movements of 30 of the biggest 'players' of the United States Economy. Some of the companies included in this index are American Express, Walmart, Apple, Exxon Mobil and more. The NASDAQ is another market index like the DOW, but it measures around 3,300 stocks, mainly electronic and nance focused, although it is not ex- clusive to those sectors. Some of the companies included in the NASDAQ are Apple, Facebook, Tesla, and Microsoft. The S&P500 measures the 500 biggest publicly traded stocks in the U. S. stock exchanges. 3M Co., Comcast and Colgate- Palmoville are part of the S &P 500 currently. The Bloomberg Aggregate Bond Index measure the performance of bonds, mutual funds and EFTs and includes, treasury securities, mortgage- backed and asset- backed securities. [12] I) Dow Jones Industrial Index How the DJI is Calculated When the DJIA was rst introduced in the 1890s, it was calculated like a basic average, taking the sum of all the share prices, and dividing by the number of companies (12 at the time). This worked for some time, but when companies were added or withdrawn, the weights of the companies would shift to the point where the index is inaccurate. Here is a basic example to represent how the DJI is calculated.

xi = share price of companyday1 n = number of companies x + x + x Index = 1 2 3 1 3 The basic average is taken everyday, and the change between the prices is measured. However, when new companies are added, the divisor 'n' did not accurately represent the performance of the stocks or the market, so the new divisor is found by following the steps. Divide the sum of the share prices of of new number of companies by the sum of the share prices of the old number of companies. x + x + x + x (1) 1 2 3 4 = new divisor x1 + x2 + x3 48 Now, you have the new divisor for the new index.

x1 + x2 + x3 + x4 (2) Indexnew = divisornew

This way, the weights of each company is taken into account and when a new company is added or taken away, there are no hugh drops or spikes that would make the index inaccurate. The current divisor of DIJA is approximately 0.14748071991788.

5.6 Moving Average

Stock analysts often use the stock indicator moving averages (MA) to to help smooth the curve and, theoretically, provide a better pre- diction. A moving average makes each data point the average of a specied window around it each value. By providing a data set that is a constantly updated average of the data, the moving average can minimize the eect that random and short- term outliers that may be in the original data.

49 6 Models and Predictions

6.1 Fourier Approximation After the trend line was created, the dierence between the approximation and the true closing prices was used to create a Fourier model. The t func- tion uses the dierence between the trend line and the closing prices of each stock over their respective relevant data to t that data into a Fourier series. The Fourier 'type' used varies depending on the size of the relevant period of each stock because shorter periods do not need as many coecients for an accurate approximation. If the relevant interval is over 150 days, the best `ttype' is fourier4, between the 90-150 days I use `fourier3', and if it is less than 90 days, I used `fourier2'. The Fourier function is a periodic approxi- mation on the real line by trigonometric polynomials. Similarly to the polyt function, the t function returned the coecients for a Fourier Approximation. For example, for the stock ALG, The `fourier2' model returned was General model Fourier2:

f1(x) = a0 + a1 ∗ cos(xw) + b1 ∗ sin(xw) + a2 ∗ cos(2xw) + b2 ∗ sin(2xw)

ALG Coefficients (with 95% confidence bounds):

a0 = 0.2345(−0.413, 0.882), a1 = −2.913(−3.834, −1.991)

b1 − 0.004265(−4.705, 4.697), a2 = 1.863(−2.136, 5.862),

b2 = 1.212(−4.863, 7.286), w = 0.1555(0.1492, 0.1619) After the Fourier series were found, 2 bands were plotted,

1 × (maximum difference between F ourier Series and Closing P rice) 2 above and below the Fourier Approximation to create an approximation/ prediction interval. This approximation with the bands is plotted against the true closing prices for each stock. The prediction period for all models and stocks is 3/12/2021 to 3/23/2021. The number of days each stock's true closing prices are within the prediction band were counted.

50 Figure 53: 1 , Days in prediction interval = 4 2 × MaxDiffALG = 4.16665

Figure 54: 1 , Days in prediction interval = 1 2 × MaxDiffAOS = 2.13735

Figure 55: 1 , Days in prediction interval = 1 2 × MaxDiffAY I = 2.9673

51 Figure 56: 1 , Days in prediction interval = 0 2 × MaxDiffBDC = 1.27465

Figure 57: 1 , Days in prediction interval = 5 2 × MaxDiffCARR = 1.5348

52 Figure 58: 1 , Days in prediction interval = 9 2 × MaxDiffCYRX = 7.1284

Figure 59: 1 , Days in prediction interval = 4 2 × MaxDiffDAL = 0.99035

Figure 60: 1 , Days in prediction interval = 6 2 × MaxDiffECHO = 1.81715

53 Figure 61: 1 , Days in prediction interval = 7 2 × MaxDiffGGG = 2.3433

Figure 62: 1 , Days in prediction interval = 1 2 × MaxDiffLST R = 3.57085

Figure 63: 1 , Days in prediction interval = 0 2 × MaxDiffP RLB = 24.34295

54 Figure 64: 1 , Days in prediction interval =6 2 × MaxDiffRTX = 1.6282

Figure 65: 1 , Days in prediction interval = 4 2 × MaxDiffSXI = 2.45825

55 Figure 66: 1 , Days in prediction interval = 3 2 × MaxDiffTNC = 1.54565

Figure 67: 1 , Days in prediction interval = 2 2 × MaxDiffWM = 1.3088

56 6.2 DJI Inuence Approximation The rst step in incorporating the possible inuence of the Dow Jones on each stock was to download DJI's historical data and nd the correlation coecient between it and the closing prices for each stock. I found the corre- lation by using the MATLAB command 'corrcoef'. The MATLAB function 'corrcoef(A, B)' returns the correlation coecient between 2 random vari- ables or data sets. In this case, the correlation coecient measures the how 'strong' the relationship between the closing prices of the Dow Jones Indus- trial Index and the closing prices of each stock during the stock's relevant period.

Figure 68: DJI Approximation Model

Because the value of the DJI tends to hover around $30,000 and the share prices of the stocks selected for the project are bewteen $50 and $150 dollars, the values of the DJI and each stock's Fourier Approximation had to be normalized to incorporate them into the new model. If the values were not normalized, the approximation and prediction would be inaccurate because the dierence between the values of each stock and the DJI is too large, and would skew the approximation. The values of both the DJI and the Fourier trend for each stock were normalized to 1 using their respective values on 3/11/2021. This means that all of the values of both the Dow Jones and each stock were divided by their respective closing prices on 3/11/2021 The DJI Inlfuence Model follows the system below, α represents the correlation coecient. If α > (1 − α): α ∗ (normalized fourier trend) + (1 − α) ∗ (normalized DJI price) If α < (1 − α): (1 − α) ∗ (normalized fourier trend) + α ∗ (normalized DJI price)

57 The larger value between α and 1 − α is always multiplied by the Fourier trend and the smaller values is multiplied by the DJI so that more weight is put on the Fourier trend value than the Dow Jones value for the prediction. After this, multiply the normalized approximation by the closing price of the stock on 3/11/2021 to change the values back from the normalized version to the actual values. After nding the dierence between the approximation and the true prices, similarly to the Fourier Approximation model, a prediction band was cre- ated by plotting bands that are half of the maximum dierence between the DJI Approximation and the each stock's true closing (taken over the stock's relevant period) above and below the DJI approximation.

Figure 69: 1 Days in prediction interval =5 2 × DJIMaxDiffALG = 4.2266

Figure 70: 1 , Days in prediction interval = 4 2 × DJIMaxDiffAOS = 2.7219

58 Figure 71: 1 , Days in prediction interval = 2 2 × DJIMaxDiffAY I = 4.06955

Figure 72: 1 , Days in prediction interval =1 2 ×DJIMaxDiffBDC = 1.93005

Figure 73: 1 , Days in prediction interval = 2 × DJIMaxDiffCARR = 2.27335 8

59 Figure 74: 1 , Days in prediction interval 2 × DJIMaxDiffCYRX = 9.24445 = 9

Figure 75: 1 Days in prediction interval =4 2 × DJIMaxDiffDAL = 1.39155

60 Figure 76: 1 , Days in prediction interval = 2 × DJIMaxDiffECHO = 1.1741 3

Figure 77: 1 , Days in prediction interval = 9 2 × DJIMaxDiffGGG = 2.9885

Figure 78: 1 , Days in prediction interval = 2 × DJIMaxDiffLST R = 3.9685 2

61 Figure 79: 1 Days in prediction interval = 2 × DJIMaxDiffP RLB = 40.4352 9

Figure 80: 1 Days in prediction interval = 7 2 × DJIMaxDiffRTX = 1.7885

62 Figure 81: 1 , Days in prediction interval = 4 2 × DJIMaxDiffSXI = 4.0236

Figure 82: 1 , Days in prediction interval = 2 × DJIMaxDiffTNC = 1.52565 5

Figure 83: 1 , Days in prediction interval = 2 × DJIMaxDiffWM = 1.37245 6

63 64 6.3 Moving Average: Fourier Approximation

The moving average of the closing prices for each stock was taken and the resulting data was used to create the rst trend-line. We use the dierence between the trend line and the closing price to create the Fourier Model using polyt. Therefore, I only needed to take the moving average of the data once for it to apply to the rest of the approximations. The moving average is meant to smooth the curves, and theoretically it should result in a closer approximation and a prediction built upon existing trends within the data. . The prediction period is the 9 days from 3/11/2021 - 3/23/2021. The plots shown are only the DJI approximations, but the num- ber of days for both models are in the table below.

Figure 84: 1 , Days in prediction interval = 4 2 × MAMaxDiffALG = 4.0701

Figure 85: 1 , Days in prediction interval = 2 × MAMaxDiffAOS = 2.13775 1

65 Figure 86: 1 , Days in prediction interval = 1 2 × MAMaxDiffAY I = 2.9939

Figure 87: 1 , Days in prediction interval = 2 × MAMaxDiffBDC = 1.27925 0

66 Figure 88: 1 Days in prediction interval = 2 × MAMaxDiffCARR = 1.08265 5

Figure 89: 1 , Days in prediction interval = 2 × MAMaxDiffCYRX = 7.1497 9

Figure 90: 1 , Days in prediction interval 2 × MAMaxDiffDAL = 0.99015 = 4

67 Figure 91: 1 , Days in prediction interval = 2 × MAMaxDiffECHO = 1.81715 6

Figure 92: 1 , Days in prediction interval = 8 2 × MAMaxDiffGGG = 2.30795

68 Figure 93: 1 , Days in prediction interval = 2 × MAMaxDiffLST R = 2.9668 4

Figure 94: 1 , Days in prediction interval 2 × MAMaxDiffP RLB = 23.72305 =0

Figure 95: 1 , Days in prediction interval = 5 2 × MAMaxDiffRTX = 1.6296

69 Figure 96: 1 , Days in prediction interval = 3 2 × MAMaxDiffSXI = 3.06115

Figure 97: 1 , Days in prediction interval = 4 2 × MAMaxDiffTNC = 1.5438

70 Figure 98: 1 , Days in prediction interval = 2 2 × MAMaxDiffWM = 1.3086

6.4 Moving Average: DJI Inuence Approximation

Another DJI inuence model was built, this time from the Fourier Series created using the moving average of the data. The model is plotted below.

Figure 99: 1 , Days in prediction interval 2 × MADJIMaxDiffALG = 4.32525 = 4

Figure 100: 1 , Days in prediction inter- 2 × MADJIMaxDiffAOS = 2.72215 val = 4

71 Figure 101: 1 Days in prediction interval 2 ×MADJIMaxDiffAY I = 4.02595 = 2

Figure 102: 1 , Days in prediction inter- 2 × MADJIMaxDiffBDC = 1.74775 val = 1

72 Figure 103: 1 , Days in prediction interval 2 ×MADJIMaxDiffCARR = 1.6825 = 6

Figure 104: 1 , Days in prediction in- 2 × MADJIMaxDiffCYRX = 9.2869 terval = 9

Figure 105: 1 , Days in prediction interval 2 ×MADJIMaxDiffDAL = 1.3915 = 4

73 Figure 106: 1 , Days in prediction in- 2 × MADJIMaxDiffECHO = 1.5797 terval =5

Figure 107: 1 , Days in prediction interval 2 × MADJIMaxDiffGGG = 2.946 = 9

74 Figure 108: 1 , Days in prediction inter- 2 × MADJIMaxDiffLST R = 3.48065 val = 8

Figure 109: 1 , Days in prediction in- 2 × MADJIMaxDiffP RLB = 45.3307 terval = 9

Figure 110: 1 , Days in prediction interval 2 ×MADJIMaxDiffRTX = 1.7894 = 6

75 Figure 111: 1 , Days in prediction interval 2 ×MADJIMaxDiffSXI = 4.1176 = 3

Figure 112: 1 , Days in prediction inter- 2 × MADJIMaxDiffTNC = 1.52065 val = 5

76 Figure 113: 1 , Days in prediction interval 2 ×MADJIMaxDiffWM = 1.37495 = 5

77 7 Volatility

The volatility of a stock measures how much the stock prices move around the mean stock price, and can be a good tool in risk analysis. Typically, the higher the volatility of a stock, the riskier it is for investors. The volatility of a security or stock can be an indicator of past pricing behavior and can be used to estimate future variation in the data. Volatility can be measured by using the statistical tools: mean and standard deviation. I attempted to determine the volatility of a stock 2 dierent ways. [5] [2]

7.1 Scale A

The rst being a scale that uses the percentage of values 1 standard devi- ation away from the mean for each stock and DJI, to nd the volatility of each stock in relation to the DJI's volatility. This was done by nding the dierence between each stock's % of values within 1 standard deviation of their mean (%stock) and the %DJI and nding the standard deviation of those dierences. The percentages that are within 1 sd away from the %DJI were deemed a 1 on the scale, those within 2 sd away from the %DJI are a 2 on the scale, within 3 sd away from the %DJI are a 3 on the scale, and 4 sd away from the %DJI are a 4 on the scale. The lower the number on the scale the less volatile the stock is.

Figure 114

78 7.2 Bollinger Bands

Bollinger Bands are created by plotting a set of bands a certain number of standard deviations away from the moving average.

BolBandUp = Approximation + m × σ

BolBandLOW = Approximation − m × σ The standard deviation of the data was found for each stocks relevant pe- riod. The bands were plotted 1 standard deviation away from the moving average of the closing prices. Everytime the closing prices touched or crossed the bands was counted. In theory, the lower the number of touches, the the less volatile the stock is, and vice versa. If a stock has more upper Bollinger touches than lower it is deemed as 'Oversold'. If a stock has more lower Bollinger touches than upper it is deemed as 'Undersold'. [6]

Figure 115: SDALG = 8.7616, Bollinger Touches = 0

79 Figure 116: SDAOS = 2.8567, Bollinger Touches = 1, UNDERSOLD

Figure 117: SDAY I = 4.8151, Bollinger Touches = 3, OVERSOLD

Figure 118: SDBDC = 2.9385, Bollinger Touches = 2, OVERSOLD

80 Figure 119: SDCARR = 1.3256, Bollinger Touches = 10, OVERSOLD

Figure 120: SDCYRX = 9.7112, Bollinger Touches = 1, OVERSOLD

Figure 121: SDDAL = 3.6763, Bollinger Touches = 0

81 Figure 122: SDECHO = 1.2126, Bollinger Touches = 8, UNDERSOLD

Figure 123: SDGGG = 3.4836, Bollinger Touches = 1, UNDERSOLD

Figure 124: SDLST R = 12.3428, Bollinger Touches = 0

82 Figure 125: SDP RLB = 31.5667, Bollinger Touches = 1, OVERSOLD

Figure 126: SDRTX = 3.0918, Bollinger Touches = 1, OVERSOLD

Figure 127: SDSXI = 9.8647, Bollinger Touches = 0

83 Figure 128: SDTNC = 3.3078, Bollinger Touches = 0

Figure 129: SDWM = 2.8561, Bollinger Touches = 1, OVERSOLD

Figure 130

84 For the most part, most of the stocks had a minimal amount of touches, therefore they are not overly volatile. The correlations between the number of days each stock spent within the prediction bands for each model and the 2 measures of volatility were taken.

7.3 Volatility Correlations To draw the link between the number of days each stock spent within the prediction band and the measures of volatility, I took 8 dierent correla- tions. The correlations were taken from the number of days each stock spent on each model against the 2 dierent measures of volatility; (1) Scale A, (2) Bollinger Touches. Because, in theory, the more days each approxi- mation spends within their prediction bands, the lower the scale/ amount of Bolinger touches should be; the best model would be the one with the strongest negative correlation.

Figure 131

A stronger negative correlation would indicate that there is a pattern between low volatility and a higher number of days within their prediction band. The

85 MA DJI Model+ Bollinger have a negative correlation, which may indicate that it is the better prediction model and the Bollinger bands are the better measure of volatility.

86 8 Conclusion

Although there seems to be some controversy about the long-term eec- tiveness of the Fourier series in representing the performance of stocks and predicting future values, 4 models capable of predicting future stock prices were built with a Fourier Series as a 'backbone'. It holds true that the more internal and external factors that are incorporated into a model, the better the prediction tends to be. When there are more market performance com- ponents built into a model, the more information it has on the patterns and trends that have an eect on future values and market preformance. The model that worked the best according to my observations, was created by factoring in the most outside inuences. The stocks spent the most days on average within their prediction band when using the Moving Average and the DJI Inuence Model with an average 5.33 days out of 9 within the prediction band.

Figure 132

In terms of volatility, a negative correlation was found between the number of days a stock spent within their prediction band and the number of touches it had with the Bollinger Bands only with that particular model as well. This tells me that there is a pattern between having a high number of prediction days and a low measure of volatility and vice- versa. Therefore, if I was

87 investing or advising someone with their investments, I would recommend they use the Moving Average and DJI Inuence Model to provide a prediction interval for approximately 4 to 5 days, along with the Bollinger Bands to inform on the volatility of each stock and the risk they are willing to take.

Figure 133

88 References

[1] Beck, C. (2020, November 9). Predicting the Stock Mar- ket is Hard: Creating a Machine-Learning Model (Proba- bly) Won't Help. Medium. https://towardsdatascience.com/ predicting-the-stock-market-is-hard-creating-a-machine-learning-model-probably-wont-help-e449039c9fe3. [2] Bollerslev, T.; Rossi, P. E. (1996). Introduction: Modelling Stock Market VolatilityBridging the to Continuous Time. Mod- elling Stock Market Volatility, xi-xviii. https://doi.org/10.1016/ b978-012598275-7.50001-6 [3] Dawkins, P. (n.d.). Dierential Equations - Fourier Series. https:// tutorial.math.lamar.edu/Classes/DE/FourierSeries.aspx. [4] DeCross, M. ; Khim, J. (n.d.). Fourier Series. Fourier Se- ries: Brilliant Math ; Science Wiki. https://brilliant.org/wiki/ fourier-series/. [5] Engle, R. F., Ghysels, E., Sohn, B. (2013, July 1). Stock Mar- ket Volatility and Macroeconomic Fundamentals. The Review of Eco- nomics and . https://direct.mit.edu/rest/article/95/3/ 776/58092/Stock-Market-Volatility-and-Macroeconomic. [6] Gradojevic, N. (2007). Investment information content in Bollinger Bands? Taylor ; Francis Online. https://www.tandfonline.com/doi/ abs/10.1080/17446540701206576. [7] Moghaddam, A. H., Moghaddam, M. H., Esfandyari, M. (2016, July 29). Stock market index prediction using articial neural network. Jour- nal of Economics, Finance and Administrative Science. https://www. sciencedirect.com/science/article/pii/S2077188616300245. [8] O'Shea, A. Davis, C. (2021, May 3). What Is the Stock Market and How Does It Work? NerdWallet. https://www.nerdwallet.com/article/ investing/what-is-the-stock-market. [9] Patel, J., Shah, S., Thakkar, P.; Kotecha, K. (2014, October 25). Pre- dicting stock market index using fusion of machine learning techniques. Expert Systems with Applications. https://www.sciencedirect.com/ science/article/abs/pii/S0957417414006551.

89 [10] Radoji£i¢, D., ; Kredatus, S. (2020, May 19). The impact of stock market price Fourier transform analysis on the Gated Recurrent Unit classier model. Expert Systems with Applications. https://www. sciencedirect.com/science/article/pii/S0957417420303894.

[11] Singh, A. (2020, October 18). Stock Price Prediction Us- ing Machine Learning: Deep Learning. Analytics Vid- hya. http://www.analyticsvidhya.com/blog/2018/10/ predicting-stock-price-machine-learningnd-deep-learning-techniques-python/ .

[12] Young, J. (2021, April 29). Market Index. Investopedia. https://www. investopedia.com/terms/m/marketindex.asp.

90