This paper introduces a fresh, window-driven approach to building stock portfolios, emphasizing flexibility and precision in navigating complex financial markets. At its core is a hierarchical meta-ensemble model that powers stock price forecasting by combining multiple predictive models, like LSTM and XGBoost, to capture market trends effectively. Paired with a dynamic time window mechanism, the model adapts to real-time market shifts, enhancing prediction accuracy for prices, directions, and volatility. The portfolio optimization framework builds on these forecasts, using smart strategies like semi-decision learning and Langevin multiplicative weight updates to balance risk and return. Through rigorous testing on Chinese share data from 2021 to 2025, the system proves its edge over traditional methods, delivering strong performance in both prediction accuracy and portfolio returns.
