Comparing two CNNs on five-day stock price direction
I tested whether a CNN could predict five-day stock price direction from a 20-day price and volume chart. The input is a 64×60 grayscale image. The experiment follows the image-based approach in Jiang, Kelly & Xiu (2023), "(Re-)Imag(in)ing Price Trends."
I trained on 2000–2015, used 2016–2017 for validation, and tested on 137,118 images from 2018–2019.
The baseline uses three convolutional layers. A second model adds a fourth layer, batch normalization and LeakyReLU. Both predict whether the return over the next five trading days is positive.
Pixel values are scaled to [0, 1]. Training uses Adam, binary cross-entropy and early stopping based on validation loss.
Test accuracy was 51.91% for the baseline and 51.68% for the deeper model. The extra layers did not improve accuracy in this experiment.
The baseline's F1 score was higher (0.61 versus 0.53), but it predicted “up” much more often. The deeper model produced more balanced predictions. This is why I compared confusion matrices and prediction distributions as well as the headline accuracy.
Changing learning rate and dropout produced similar results, around 51.5–51.9%. These experiments do not establish a profitable trading strategy or a general limit on what chart images can predict.