This project focuses on the analysis and optimization of financial portfolios using momentum strategies and portfolio evaluation. Based on historical Nasdaq data and various financial parameters, it explores different approaches to building optimized portfolios and evaluates their performance over time.
The project is divided into multiple notebooks, each covering a specific stage of the analysis:
-
0_DataAcquisition.ipynb: Data Acquisition
- Downloads historical data for the NASDAQ 100, including price history and index composition over the last ten years (2014-2023).
- Prepares the data by checking data quality and handling missing values.
- Computes logarithmic returns for stocks and the reference index.
-
1_Nasdaq_Compositions.ipynb: Nasdaq Index Composition Reconstruction
- Reconstructs the NASDAQ 100 composition over the years, tracking stocks that were added or removed.
- Organizes the data to represent the full history of the index.
-
2_logReturnsRegression.ipynb: Rolling Regression of Logarithmic Returns
- Imports the previously acquired data and calculates net returns using the Fama and French Three-Factor Model.
- Executes a rolling regression on the logarithmic returns for each stock to compute necessary parameters.
- Extracts p-values to analyze parameter significance.
-
3_Portfolios_Evaluation.ipynb: Portfolio Creation and Evaluation
- Builds portfolios using various metrics like Sharpe ratio, systematic and specific risks, and expected returns.
- Includes functions to visualize portfolio performance compared to the NASDAQ 100 benchmark.
- Conducts an alpha analysis to identify stocks with significant parameters and creates balanced portfolios.
-
4_Momentum_Strategy.ipynb: Momentum Strategy
- Calculates an HQM (High Quality Momentum) score for each stock, based on momentum indicators over various time windows (180, 90, 60, 30, and 7 days).
- Creates portfolios based on top momentum stocks and compares their performance against the benchmark.
- Includes evaluation metrics and visualizations to assess portfolio performance.
Ensure the following libraries are installed:
pandas
numpy
matplotlib
scipy
sklearn
Each notebook can be executed sequentially. It is recommended to start with 0_DataAcquisition.ipynb to ensure all necessary data is acquired and prepared for subsequent analyses.
The project provides a detailed evaluation of portfolio performance using metrics such as Sharpe ratio, specific and systematic risks, and expected returns. Graphs are included to compare portfolio performance against the NASDAQ 100 benchmark.
- Corsi01
- Alf_Ses
This project is licensed under the MIT License.