Volume of S&P 500 trade 1982 to end of 2024- The first graph generated by the python script. Here we can see that the volume of trade has been increasing with a peak in 2008, perhaps due to the GFC and panicked selling during this time (global financial crisis of 2008). Major trading began around the turn of the millennium. The sharp increase between 2000 and 2008 may be accredited to numerous factors including but not inclusive of; advances in algorithmic and automated trading, increased interconnectedness leading to foreign investment and trade of stock and indices and increased access to trading through online platforms. The 2008 GFC may have lead to the sharp decline in volume Volume of trade has since recovered back to or above pre-GFC levels as confidence in the indices recovers.
Daily Closing Price 1982 to end of 2024- The closing price can be seen to be increasing over time with major recessions including the 2020 Covid-19 Pandemic, 2008 GFC, 2001 9-11 Attacks and the dotcom bubble burst, Iraqi invasion of Kuwait causing oil prices to increase. The drop between 2021 and 2022 was caused primarily by concerns surrounding the continuation of high interest rates of the COVID and post- COVID era, with the Russian invasion of Ukraine also exacerbating supply.
Maximum Close Values of each year 1982 to end of 2024- The trend can be seen increasing over time, and even when the maximum decreases, the index recovers soon and exceeds the previous maximum. This suggests consistent growth in history and could be interpreted as having continued growth in the future. Decreases can be observed following recessions such as the 2001 dotcom bubble burst and the 2008 GFC, however as mentioned previously the index does eventually recover and beat these previous highs.
Table- Showing the highest trading day of the year 2000 onward- Can be seen that the highest trading day of the calendar year is always the last trading day of the year (in the last 25 years) which suggests this is the best time in the year to exit a position in the S&P 500 index. This may be caused by positive market sentiment in light of the last trading day of a given year. The last trading day of the year often sees high trading volumes due to year-end portfolio adjustments, tax-loss harvesting, and the "Santa Claus Rally." Buying on this day can provide tax benefits by deferring capital gains taxes to the following year, supporting tax-loss harvesting strategies, and avoiding the wash sale rule. It also allows investors to capture qualified dividends at a lower tax rate and maximize tax-deferred growth in accounts like Roth IRAs. Overall, it’s a strategic time to manage tax liabilities and position for the upcoming year.
Daily Candlesticks Interactive Graph 1982 to end of 2024- The first interactive graph generated by the python script. By hovering over the graph with your mouse cursor and then using the 'Zoom' tool you can zoom by selecting the area you want to see, and then 'Pan' can be used to navigate the timescale (x and y axis). Hovering over the candles reveals the opening, closing, high and low price along with its respective date. To return to default view both 'Auto-scale' and 'Reset axis' effectively resets the view of the graph to show the full y and x axis. Double-clicking on any part of the graph also returns you to the default view. Any of the interactive graphs can be downloaded as a non interactive .PNG file.
Some major recessions that caused resulting drop in S&P 500 stock price to drop are-
19 October 1987- Caused by automated trading, overvaluation in the market and panic selling which caused a ~20% drop in a single day
2000-2002- Dotcom bubble burst- overvaluation and investment in tech stocks causing a ~49% drop from peak (March 2000) to trough (Oct 2002)
2008 Global Financial Crisis- Subprime mortgage crisis, collapse of Lehman Brothers, and a severe credit crunch causing a ~57% drop from peak (October 2007_ to trough (March 2009)
2011 Debt crisis in Greece, Portugal, Ireland, and concerns over European banking stability causes a ~20% drop from April to October 2011
2020 Covid-19 Pandemic leading to panic and economic shutdowns, reducing consumer activity, uncertainty which caused a ~34% drop from February to March 2020- An unprecedented recovery followed due to immense stimulus
2022 Bear Market- Inflation and Federal Reserve rate hikes, geopolitical tensions between Russia and Ukraine causing shortages in many commodities that are produced by Ukraine/Russia. Growth slowed
It is notable that over this timescale it can be seen that after each major recession a recovery is made and in fact the overall trend remains hugely positive, with growth appearing to accelerate
Simple Moving Average and Exponential Moving Average Superimposed Over the Daily Closing Values 1982 to end of 2024 (15 day averages)- This graph is also interactive in the ways shown above. Simple moving average (SMA) does not place weight on older values and rather average them assuming equal importance, so here, for a point plotted on the 14th of December 2024, the days 1st Dec through to 15th Dec are weighted equally. Exponential moving average
(EMA) on the other hand weighs more current data with more importance than older data so the point plotted 14th Dec would place greater weight on the data from 14th and 15th closing, and less weight on 1st and 2nd Dec values. This creates a more complex calculation to run, however is more responsive in showing market trends, such as if there is a sudden and continued upturn (bullish trend) in the market, the EMA would show this upturn faster than the SMA would. For example this graph above shows the rapid drop due to the 2020 Covid-19 Pandemic, where it can be seen that the red line (EMA) shows the rapid decrease at a similar if not equal time to the SMA however represents the market recovery faster and is closer and faster to the actual closing values while still 'smoothening' out the daily variations.
Relative Strength Index from 1982 to end of 2024- This graph is interactive in the same way as the previous 2 graphs. This is a calculation that has the simple formula of 100-[100/1+(average gain/average loss)] which measures the speed and magnitude of price movements to assess if an asset is overbought or oversold. It ranges from 0 to 100, with readings above 70 indicating overbought conditions and below 30 suggesting oversold levels, aiding in identifying potential trend reversals. These values are indicated by the red and green lines respectively. This generally works better within normal trading environments rather than strong trends, since in a strong bull or bear market RSI values can exceed 80 and be fall below 20 respectively. This indicator is more useful in short term day trading rather than long term investing. It can be seen that the S&P 500 generally stays within these bounds and historically during the bull markets remains on the higher side of the RSI and during bear market trends or recessions trends closer to bottom. However it must be considered that this indicator can be incorrect and must be used in combination with other trading indicators so that an informed decision can be made.
Moving Average Convergence Divergence (MACD) Graph 1982 to end of 2024- It utilizes two exponential moving averages (EMA), with one being a 12-day EMA and one being a 26-day EMA. The MACD line consists of the 12-day EMA minus the 26 day EMA. The signal line is a 9-day EMA of the MACD line which acts as a trigger to buy or sell. When the MACD line (in blue) crosses over the signal line (in red) it suggests upward momentum and a potential buy signal. When the MACD line crosses below the signal line it suggests downward bearish signal. When the MACD line crosses above the zero line it indicates bullish momentum while when it crosses below the zero line it indicates bearish momentum. The MACD line can be compared to the price and if the price makes lower lows while the MACD makes higher lows it indicates a potential reversal and upward bullish momentum while if the price has higher highs but the MACD has lower highs it indicates potential downward and bearish reversal. However it must not be used as a sole trading indicator as it can have false positives in either direction during uncertain and sideways markets.
Bollinger Bands 1982 to end of 2024
Middle Band- A simple moving average of the daily closing stock price, 20 days in this case
Upper Band- The middle band plus 2 times the standard deviation of the price over the past 20 days
Lower Band- The middle band minus 2 times the standard deviation of the price over the past 20 days
What can be analyzed based on this-
These in combination can be used to analyze the volatility of the market, since, as bands narrow, low volatility can be indicated and the vice versa.
The trend can also be identified as SMA-20 being closer to upper band may signal overbought conditions and SMA-20 being closer to lower band may indicate oversold conditions
A reversal can also be signaled by SMA-20 breaking above or below the upper and lower band respectively
It is important to note however, as mentioned for any other technical indicator, this cannot be taken as a sole source of information and can produce false signals such as in sideways markets. The Bollinger bands do not accurately predict the direction of movement, rather reflect roughly its volatility.