Skip to content

MujtabaMuhammad/moving-averages

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Moving Averages on S&P 500

This project analyzes S&P 500 stock data from 1927 to 2020 to evaluate the effectiveness of two widely used technical indicators: the Simple Moving Average (SMA) and the Exponential Moving Average (EMA). The analysis focuses on generating buy/sell signals, comparing SMA vs. EMA performance, and identifying which may serve better for long- vs. short-term investment strategies.

Objectives

  • Analyze daily returns of the S&P 500 index
  • Calculate and visualize 20-day SMA and EMA
  • Generate and evaluate buy/sell signals based on trend crossovers
  • Explore indicator strengths and limitations in predicting market behavior

Technologies Used

  • Python 3.9
  • Pandas (for data manipulation)
  • Matplotlib (for plotting)
  • Jupyter Notebook
  • Excel (for initial data handling)

Dataset

S&P 500 historical data sourced from Nasdaq:
https://www.nasdaq.com/market-activity/index/spx/historical

Full Report

See the detailed analysis and insights in the Final Report (PDF)

Files in this Repo

  • jupyter_notebook_analysis.ipynb: Python code and visualizations
  • report.pdf: Full project report and conclusions
  • .gitignore: Tracks excluded files (e.g., .ipynb_checkpoints/)

Summary of Findings

  • SMA performs better for long-term investment strategies
  • EMA is more responsive and suitable for short-term trading
  • Both indicators are lagging and work best when used with other tools (e.g., RSI, MACD)
  • Seasonal trends and trend reversals can provide added context when interpreting moving averages

Contact

For questions or feedback, feel free to reach out via GitHub or email.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published