| Abstract [eng] |
This Master's thesis examines the application of machine learning algorithms for forecasting stock price directions and dynamic investment portfolio management. The research problem stems from the fact that traditional isolated models struggle to adapt to the non-stationarity of financial time series while ignoring asset interdependencies and the broader market context. The aim of this study is to apply the results of the rolling window methodology research and machine learning algorithms to forecast stock prices and optimize a dynamic investment portfolio. Historical stock price data of 15 companies from the S&P 500 index were used for the study. Support Vector Machines (SVM), Extreme Gradient Boosting (XGBoost), Long Short-Term Memory (LSTM), Gated Recurrent Unit (GRU), and Graph Neural Network (GNN) algorithms were employed to solve the forecasting tasks. The reliability of the models was evaluated using a rolling window validation strategy, the Diebold-Mariano statistical test, and advanced financial risk metrics such as the Sharpe, Sortino, Calmar, and Rachev ratios, as well as Maximum Drawdown (MDD). The conducted research revealed that short training windows and frequent updates (W=30, S=5) ensure the highest stability for the GNN model, allowing it to quickly capture changing correlations between stocks and adapt to shifting market conditions. At the micro-level, the GNN model managed risk most effectively, achieving the highest average Calmar and Rachev ratios, and statistically significantly outperformed the isolated LSTM model. At the macro-level, it was found that the dynamic GNN portfolio, employing a naive diversification (1/N) strategy, achieved a higher Sharpe ratio (1.15) than the S&P 500 index (0.70) and demonstrated more than three times lower volatility (6.68% versus 20.50%). Ultimately, the developed hybrid ensemble model (combining GNN, LSTM, and XGBoost algorithms) proved its practical utility by successfully filtering market noise and generating trading signals in real-time. |