Improving CNN-base Stock Trading By Considering Data Heterogeneity and Burst

Keer Yang, Guanqun Zhang, Chuan Bi, Qiang Guan, Hailu Xu, Shuai XuarXiv 2023 · DOI

Abstract

In recent years, there have been quite a few attempts to apply intelligent techniques to financial trading, i.e., constructing automatic and intelligent trading framework based on historical stock price. Due to the unpredictable, uncertainty and volatile nature of financial market, researchers have also resorted to deep learning to construct the intelligent trading framework. In this paper, we propose to use CNN as the core functionality of such framework, because it is able to learn the spatial dependency (i.e., between rows and columns) of the input data. However, different from existing deep learning-based trading frameworks, we develop a novel normalization process to prepare the stock data. In particular, we first empirically observe that the stock data is intrinsically heterogeneous and bursty, and then validate the heterogeneity and burst nature of stock data from a statistical perspective. Next, we design the data normalization method in a way such that the data heterogeneity is preserved and bursty events are suppressed. We verify our developed CNN-based trading framework plus our new normalization method on 29 stocks. Experimental results show that our approach can outperform other comparing approaches.

Introduction

Predicting the stock market is notoriously difficult due to its volatility and the "Efficient-Market Hypothesis," which suggests prices already reflect all known information. While deep learning models like CNNs and LSTMs have been applied to this problem, they often treat stock data like standard image data.

This research identifies two major flaws in this traditional approach:

  1. Data Heterogeneity: Unlike a photo where neighboring pixels are similar, stock data consists of various technical indicators (like RSI or Moving Averages) that represent completely different financial patterns. Standard normalization "flattens" these unique signals.
  2. Data Burstiness: Financial markets experience "bursty" events—rare, extreme price movements. Standard models often overfit to these outliers, leading to sub-optimal trading strategies.

Methodology

The proposed framework transforms 1D financial time series into 2D "images" to leverage the spatial feature-learning power of CNNs.

Image Construction

For every trading day, 15 different technical indicators are calculated across 15 different time windows. This results in a 15x15 matrix (image) where each row represents a specific financial indicator.

Novel Normalization

Instead of using standard min-max normalization across the whole image, the authors use row-by-row normalization combined with a logarithmic function ($g(x) = \log(|x|)$). The row-wise approach ensures that the unique "signature" of each indicator is preserved. The logarithmic scaling squashes extreme "bursty" values (outliers) while spreading out normal values, making it easier for the neural network to distinguish between typical market states.

Analysis of Data Characteristics

A key insight of this work is that stock data is fundamentally different from natural images like faces. Through entropy measurements, the authors proved that stock images have much higher entropy, meaning the data points are far less predictable based on their neighbors.

Facial images exhibit low entropy, indicating high spatial correlation.
Stock data images show much higher entropy, reflecting the inherent heterogeneity of financial indicators.

Preserving this entropy is key; the proposed log-normalization retains more of the complex, heterogeneous information required to make accurate trade decisions compared to standard methods.

Experimental Results

The model was tested against three main competitors: a standard CNN with min-max normalization, an LSTM network, and a Linear Regression model, using 29 common stocks over a 16-year period (2005–2021).

  • Predictive Accuracy: The proposed method achieved higher F1 scores for "Buy" and "Sell" signals compared to the baseline CNN.
  • Financial Returns: In a 5-year simulation, the framework consistently outperformed others. For example, in stocks like MSFT (+322%) and UNH (+165%), the model's returns were vastly superior to the LSTM and Regression baselines.
  • Robustness: The model showed a steady increase in total assets over time across most of the 29 stocks, suggesting the normalization technique makes the model more robust to different market conditions.

Conclusion

By rethinking data normalization to account for heterogeneity and burstiness, CNNs can be significantly more effective for stock trading. While the current CNN architecture is simple, combining this normalization technique with more complex models or attention mechanisms represents a promising direction for future research.

Summary updated

BibTeX
@misc{yang2023improving,
  author = {Keer Yang and Guanqun Zhang and Chuan Bi and Qiang Guan and Hailu Xu and Shuai Xu},
  title = {{Improving CNN-base Stock Trading By Considering Data Heterogeneity and Burst}},
  year = {2023},
  eprint = {2303.09407},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2303.09407},
}
Figure