This Streamlit app is designed to help you explore the Capital Asset Pricing Model (CAPM) by visualizing stock prices, calculating beta values, and estimating returns.
The app allows you to:
- Select up to 4 stocks of your choice.
- Choose the number of years for historical data.
- View a dataframe displaying the selected stock prices and S&P 500 data.
- Visualize stock prices over time and after normalization.
- Calculate and display the beta values for each selected stock.
- Estimate returns using the CAPM formula.
-
Stock Selection:
- Use the multiselect dropdown to choose up to 4 stocks from options like TSLA, AAPL, AMZN, and more.
-
Data Range:
- Input the number of years you want to consider for historical data.
-
Data Visualization:
- Explore the dataframes showing stock prices, normalized prices, beta values, and estimated returns.
- Visualize stock prices using interactive charts.
-
Understanding Results:
- The app calculates beta values, representing the stocks' sensitivity to market movements.
- Estimated returns are computed using the CAPM formula.
-
Clone this repository to your local machine.
git clone https://github.com/ArupSankarRoy/CAPITAL-ASSET-PRICING-MODEL-STREAMLIT.git cd CAPM_WEBAPPLICATION -
Run the Streamlit app.
streamlit run index.py
-
Open your web browser and go to
http://localhost:8501to view and interact with the app.
- Ensure that you have Python installed on your machine.
- The app uses Streamlit, pandas, yfinance, and other libraries. Install any additional dependencies as needed.
