Cargando…

Deep reinforcement learning stock market trading, utilizing a CNN with candlestick images

Billions of dollars are traded automatically in the stock market every day, including algorithms that use neural networks, but there are still questions regarding how neural networks trade. The black box nature of a neural network gives pause to entrusting it with valuable trading funds. A more rece...

Descripción completa

Detalles Bibliográficos
Autores principales: Brim, Andrew, Flann, Nicholas S.
Formato: Online Artículo Texto
Lenguaje:English
Publicado: Public Library of Science 2022
Materias:
Acceso en línea:https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8856521/
https://www.ncbi.nlm.nih.gov/pubmed/35180250
http://dx.doi.org/10.1371/journal.pone.0263181
_version_ 1784653865423994880
author Brim, Andrew
Flann, Nicholas S.
author_facet Brim, Andrew
Flann, Nicholas S.
author_sort Brim, Andrew
collection PubMed
description Billions of dollars are traded automatically in the stock market every day, including algorithms that use neural networks, but there are still questions regarding how neural networks trade. The black box nature of a neural network gives pause to entrusting it with valuable trading funds. A more recent technique for the study of neural networks, feature map visualizations, yields insight into how a neural network generates an output. Utilizing a Convolutional Neural Network (CNN) with candlestick images as input and feature map visualizations gives a unique opportunity to determine what in the input images is causing the neural network to output a certain action. In this study, a CNN is utilized within a Double Deep Q-Network (DDQN) to outperform the S&P 500 Index returns, and also analyze how the system trades. The DDQN is trained and tested on the 30 largest stocks in the S&P 500. Following training the CNN is used to generate feature map visualizations to determine where the neural network is placing its attention on the candlestick images. Results show that the DDQN is able to yield higher returns than the S&P 500 Index between January 2, 2020 and June 30, 2020. Results also show that the CNN is able to switch its attention from all the candles in a candlestick image to the more recent candles in the image, based on an event such as the coronavirus stock market crash of 2020.
format Online
Article
Text
id pubmed-8856521
institution National Center for Biotechnology Information
language English
publishDate 2022
publisher Public Library of Science
record_format MEDLINE/PubMed
spelling pubmed-88565212022-02-19 Deep reinforcement learning stock market trading, utilizing a CNN with candlestick images Brim, Andrew Flann, Nicholas S. PLoS One Research Article Billions of dollars are traded automatically in the stock market every day, including algorithms that use neural networks, but there are still questions regarding how neural networks trade. The black box nature of a neural network gives pause to entrusting it with valuable trading funds. A more recent technique for the study of neural networks, feature map visualizations, yields insight into how a neural network generates an output. Utilizing a Convolutional Neural Network (CNN) with candlestick images as input and feature map visualizations gives a unique opportunity to determine what in the input images is causing the neural network to output a certain action. In this study, a CNN is utilized within a Double Deep Q-Network (DDQN) to outperform the S&P 500 Index returns, and also analyze how the system trades. The DDQN is trained and tested on the 30 largest stocks in the S&P 500. Following training the CNN is used to generate feature map visualizations to determine where the neural network is placing its attention on the candlestick images. Results show that the DDQN is able to yield higher returns than the S&P 500 Index between January 2, 2020 and June 30, 2020. Results also show that the CNN is able to switch its attention from all the candles in a candlestick image to the more recent candles in the image, based on an event such as the coronavirus stock market crash of 2020. Public Library of Science 2022-02-18 /pmc/articles/PMC8856521/ /pubmed/35180250 http://dx.doi.org/10.1371/journal.pone.0263181 Text en © 2022 Brim, Flann https://creativecommons.org/licenses/by/4.0/This is an open access article distributed under the terms of the Creative Commons Attribution License (https://creativecommons.org/licenses/by/4.0/) , which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.
spellingShingle Research Article
Brim, Andrew
Flann, Nicholas S.
Deep reinforcement learning stock market trading, utilizing a CNN with candlestick images
title Deep reinforcement learning stock market trading, utilizing a CNN with candlestick images
title_full Deep reinforcement learning stock market trading, utilizing a CNN with candlestick images
title_fullStr Deep reinforcement learning stock market trading, utilizing a CNN with candlestick images
title_full_unstemmed Deep reinforcement learning stock market trading, utilizing a CNN with candlestick images
title_short Deep reinforcement learning stock market trading, utilizing a CNN with candlestick images
title_sort deep reinforcement learning stock market trading, utilizing a cnn with candlestick images
topic Research Article
url https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8856521/
https://www.ncbi.nlm.nih.gov/pubmed/35180250
http://dx.doi.org/10.1371/journal.pone.0263181
work_keys_str_mv AT brimandrew deepreinforcementlearningstockmarkettradingutilizingacnnwithcandlestickimages
AT flannnicholass deepreinforcementlearningstockmarkettradingutilizingacnnwithcandlestickimages