This repository contains my solutions to the ACM Quant Team Induction tasks. These tasks involved analyzing stock market data using Python and common data science libraries. Each task is designed to demonstrate understanding of basic financial concepts, data analysis, and Python programming skills.
- Used
yfinanceto download 6 months of historical stock data (AAPL). - Computed 5-day and 20-day Simple Moving Averages (SMA).
- Implemented logic to generate Buy and Sell signals based on SMA crossover.
- Plotted the Close price, SMA lines, and clearly marked Buy/Sell signals using matplotlib.
โก๏ธ See Code ยป
- Defined a portfolio with a dictionary containing stock tickers and share quantities.
- Fetched adjusted closing prices for the past 30 days using
yfinance. - Calculated daily total portfolio value.
- Plotted the portfolio value over time.
- Displayed the latest portfolio value.
- Handled edge cases like missing data.
โก๏ธ See Code ยป
- Selected 20 Nifty 50 stocks and fetched their last 1-month data.
- Calculated the percentage change for each stock.
- Identified the top 5 gainers and top 5 losers.
- Visualized results in a bar chart.
- Bonus: Exported the results to a
CSVfile.
โก๏ธ See Code ยป
pandasโ for data manipulationmatplotlibโ for plottingyfinanceโ to fetch stock market data
- Clone this repository:
git clone https://github.com/yourusername/acm-quant-inductions.git cd acm-quant-inductions
Install required libraries: pip install pandas numpy matplotlib yfinance
Tested on Python 3.12.