CNN Stock Price Prediction

Predicting 5-day binary price movements from stock chart images using convolutional neural networks

FA 690 · Mini Project 1 Stevens Institute of Technology Spring 2026

Overview

This project implements the methodology from Jiang, Kelly & Xiu (2023) — "(Re-)Imag(in)ing Price Trends" — to predict whether a stock's price will rise or fall over the next 5 trading days using only its recent price chart as a 64×60 grayscale image.

A CNN classifier is trained on stock chart images spanning 1993–2019, using time-series splits to prevent look-ahead bias. The model learns visual patterns in price and volume bars that correlate with short-term price direction.

Approach

Images are encoded as memmap arrays (uint8, 64×60 pixels per sample) with associated labels including 5-day, 20-day, and 60-day forward returns. The prediction target is binary: whether the 5-day return is positive.

The baseline StockNet architecture (3 conv + 2 fc layers) is extended with deeper layers, batch normalization, and dropout. Training uses a chronological split: early years for training, middle for validation, and the final years for out-of-sample testing.

Stack

PyTorch CNN NumPy Matplotlib Google Colab