Skip to content

Splendor73/Stock-Portfolio-Analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

# DJIA Portfolio Analysis Tool

## Project Description
This project is a web-based tool built with Flask that allows users to analyze their stock portfolios. The tool scrapes Dow Jones Industrial Average (DJIA) stock symbols and their industries from Wikipedia and integrates with the Alpha Vantage API to fetch historical stock data. Users can input their stock portfolios and analyze performance metrics such as mean daily return, standard deviation of daily returns, and cumulative returns over a specified date range.

## Installation

To get started with this project, you need to have Python installed on your system. Then, you can follow these steps to install the necessary libraries:

```bash
pip install flask requests beautifulsoup4 pandas

Note: You'll need an API key from Alpha Vantage to fetch stock data. Obtain your key by signing up at Alpha Vantage.

Usage

To use this tool, follow these steps:

  1. Clone the repository to your local machine.
  2. Open the project in your preferred IDE or text editor.
  3. Replace the rapidapi_key variable value with your Alpha Vantage API key.
  4. Run the Flask application:
python app.py
  1. Open your web browser and go to http://127.0.0.1:5000/.
  2. Enter your stock portfolio using the format 'Symbol1 Quantity1, Symbol2 Quantity2,...' (e.g., 'AAPL 5, BA 5') and specify the start and end dates for the analysis.
  3. Click "Initiate Quantum Analysis" to see the portfolio performance metrics.

Project Structure

  • app.py: The main Flask application file.
  • scr.py: Contains functions for scraping DJIA stocks and fetching stock data from Alpha Vantage.
  • templates/index.html: The HTML template for the web interface.
  • static/script.js: JavaScript file for handling frontend logic and AJAX requests.
  • static/styles.css: CSS file for styling the web interface.

Example

python app.py

Navigate to http://127.0.0.1:5000/ in your web browser and input:

  • Portfolio: AAPL 5, GOOGL 3, TSLA 2
  • Start Date: 2024-01-01
  • End Date: 2024-12-31

Click "Initiate Quantum Analysis" to view the analysis results.

Contributing

Contributions to this project are welcome. To contribute:

  1. Fork the repository.
  2. Create a new branch for your feature (git checkout -b feature/AmazingFeature).
  3. Commit your changes (git commit -m 'Add some AmazingFeature').
  4. Push to the branch (git push origin feature/AmazingFeature).
  5. Open a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Yashu Patel


This updated README reflects the current state of your project, detailing how to install, run, and use the Flask application, as well as providing information on the project structure and contributing guidelines.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published