Skip to content

Aaryan015/Stock-data-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

The 3 main components of this repository: 👜

1. Stock Data Analysis 📈

  • Using Python, fetched historical stock data for any 5 stocks from the Nifty 50 index using the yfinance library. Used a time range of the last 6 months.
  • Performs the following analyses on the data:
    • Calculates the daily percentage change for each stock.
    • Plots the closing prices and daily percentage changes for the 5 stocks.
    • Calculates the moving average (20-day) for each stock and plot it against the stock's closing price.

2. Strategy Development 🪖

  • Developed a simple moving average crossover strategy for one of the 5 stocks. The strategy involves a short-term moving average (e.g., 50-day) and a long-term moving average (e.g., 200-day).
  • Back-tested this strategy on the historical data to identify buy and sell signals.
  • Calculated the returns generated by the strategy compared to a simple buy-and-hold approach.

3. Risk Management 🚨

  • Calculated the maximum drawdown for each stock over the 6-month period.
  • For the stocks selected in module 2, implemented a stop-loss mechanism. Assumed a stop loss of 5%. Re-ran the strategy with the stop-loss and compared the performance to the original strategy.

The Jupyter Notebook contains all the necessary plots 📊 and explanations 👨‍🏫, and is well-documented with comments and explanations where necessary.✨