Skip to content

yash-0211/Stock-Data-Analysis-Cleverbharat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Stock-Data-Analysis-Cleverbharat

Colab file link: https://colab.research.google.com/drive/1NMn6RoW30tW5aYenjjz5bq_FwPbS-Bcr?usp=sharing

Task 1: Stock Data Analysis

  1. Using Python, fetch historical stock data for any 5 stocks from the Nifty 50 index using the yfinance library. Use a time range of the last 6 months.
  2. Perform the following analyses on the data: a. Calculate the daily percentage change for each stock. b. Plot the closing prices and daily percentage changes for the 5 stocks. c. Calculate the moving average (20-day) for each stock and plot it against the stock's closing price.

Task 2: Strategy Development

  1. Develop a simple moving average crossover strategy for one of the 5 stocks. The strategy should involve a short-term moving average (e.g., 50-day) and a long-term moving average (e.g., 200-day).
  2. Backtest this strategy on the historical data to identify buy and sell signals.
  3. Calculate the returns generated by the strategy compared to a simple buy-and-hold approach.

Task 3: Risk Management

  1. Calculate the maximum drawdown for each stock over the 6-month period.
  2. For the stock you selected in Task 2, implement a stop-loss mechanism. Assume a stop loss of 5%. Re-run the strategy with the stop-loss and compare the performance to the original strategy.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published