SIMAI 2025

CNN-based Market Trend Prediction via Space-Filling Curve Representations

  • Bruni, Vittoria (Sapienza University of Rome)
  • Marconi, Silvia (Sapienza University of Rome)
  • Vantaggi, Barbara (Sapienza University of Rome)
  • Vitulano, Domenico (Sapienza University of Rome)

Please login to view abstract download link

Predicting index movements in financial markets is crucial for both risk management and investment strategies. However, financial time series are inherently noisy, non-stationary, and highly volatile, often displaying sudden discontinuities and nonlinear behaviors due to the influence of multiple factors, including economic policies, geopolitical events and investor behavior, making forecasting particularly challenging. Over time, various predictive approaches have been employed, ranging from traditional statistical models such as Auto-Regressive Integrated Moving Average, Generalized Autoregressive Conditional Heteroskedasticity and linear regression, to more recent machine learning techniques like Support Vector Machines and Random Forests, and deep learning methods such as Recurrent Neural Networks, especially Long Short-Term Memory, and Convolutional Neural Networks (CNN). Some recent approaches focused on the use of CNNs applied to two-dimensional representations of time series, such as candlestick charts, bar charts, images generated through technical indicators, or direct data transformations like Gramian Angular Fields, aiming to leverage the CNNs’ ability to automatically extract spatial features and classify visual patterns. In this context, we propose an innovative approach based on the transformation of historical time series segments into images through Hilbert space-filling curves. These segments are pre-processed using a smoothing procedure designed to reduce high-frequency noise while preserving local structure, preceded by a signal extension strategy to mitigate edge effects. Labels are defined by comparing the average value of the signal in a window of future days to that in the preceding window, resulting in a binary up/down classification. Experimental results obtained in a sliding window setup on three relevant assets — S&P 500, Crude Oil, and Gold — demonstrate the effectiveness of the proposed method, with good average accuracies and consistent performance across different time windows. The flexibility of the method makes it potentially extendable to various market contexts, offering a new perspective for predictive analysis of financial time series.