Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2019 Oct 10;14(10):e0223593.
doi: 10.1371/journal.pone.0223593. eCollection 2019.

Deep architectures for long-term stock price prediction with a heuristic-based strategy for trading simulations

Affiliations

Deep architectures for long-term stock price prediction with a heuristic-based strategy for trading simulations

Catalin Stoean et al. PLoS One. .

Abstract

Stock price prediction is a popular yet challenging task and deep learning provides the means to conduct the mining for the different patterns that trigger its dynamic movement. In this paper, the task is to predict the close price for 25 companies enlisted at the Bucharest Stock Exchange, from a novel data set introduced herein. Towards this scope, two traditional deep learning architectures are designed in comparison: a long short-memory network and a temporal convolutional neural model. Based on their predictions, a trading strategy, whose decision to buy or sell depends on two different thresholds, is proposed. A hill climbing approach selects the optimal values for these parameters. The prediction of the two deep learning representatives used in the subsequent trading strategy leads to distinct facets of gain.

PubMed Disclaimer

Conflict of interest statement

I have read the journal’s policy and the authors of this manuscript have the following competing interests: Ruxandra Stoean is an Academic Editor of PLOS ONE. This does not alter our adherence to PLOS ONE policies on sharing data and materials.

Figures

Fig 1
Fig 1. The number of days available for each company in turn.
Fig 2
Fig 2. The close prices on the vertical axes along the recorded period on the horizontal ones for each company in turn.
The date format used is month/day/year.
Fig 3
Fig 3. The average validation MSE and training running time of the CNN when the number of days back is varied between 30 and 120 for the BRD symbol.
Fig 4
Fig 4. Average approximated validation MSE values from 10 repeated runs for the combination of various parameter values for a CNN with two layers.
Lighter color stands for lower MSE.
Fig 5
Fig 5. Average approximated validation MSE values from 10 repeated runs for the combination of the number of dense units as combined with various parameter values for a CNN with two layers.
Lighter nuances signify lower MSE.
Fig 6
Fig 6. Average approximated validation MSE values from 10 repeated runs for the combination of dropout rates values, as applied after each of the three layers.
Lighter coloring denotes a lower MSE.
Fig 7
Fig 7. The number of times MSE for CNN is larger than the one obtained by LSTM for each company in turn.
Fig 8
Fig 8. Scenarios for the test period using CNN with ϵ1 = 0.38 and ϵ2 = 2.31 for TEL and LSTM with ϵ1 = 3.3E-05 and ϵ2 = 4.4E-04 for RRC.
While for the top case the share is sold 4 times within the period, for the other case it is sold 58 times.
Fig 9
Fig 9. Gains in percents reached by each of the 4, HC-deep or traditional, tried scenarios for every company in turn.
Fig 10
Fig 10. Box plots with the gains in percents for every scenario in turn as computed over all companies.
Fig 11
Fig 11. Results obtained over all companies by each of the tried scenarios.
Mean and median of the percentage gains over all companies when having a share at the beginning of the test period and applying the corresponding scenarios are shown in the left plot. The middle plot shows the gains in terms of money for every scenario, while the right one illustrates the number of times out of 25 possible in which the trading led to a positive gain.

References

    1. Gehring J, Auli M, Grangier D, Yarats D, Dauphin YN. Convolutional Sequence to Sequence Learning. CoRR. 2017;abs/1705.03122.
    1. Kim T, Kim HY. Forecasting stock prices with a feature fusion LSTM-CNN model using different representations of the same data. PLOS ONE. 2019;14(2):1–23. 10.1371/journal.pone.0212320 - DOI - PMC - PubMed
    1. Arévalo A, Niño J, Hernández G, Sandoval J. High-Frequency Trading Strategy Based on Deep Neural Networks In: Huang DS, Han K, Hussain A, editors. Intelligent Computing Methodologies. Cham: Springer International Publishing; 2016. p. 424–436.
    1. Chong E, Han C, Park FC. Deep learning networks for stock market analysis and prediction: Methodology, data representations, and case studies. Expert Systems with Applications. 2017;83:187—205. 10.1016/j.eswa.2017.04.030 - DOI
    1. Nelson DMQ, Pereira ACM, de Oliveira RA. Stock market’s price movement prediction with LSTM neural networks. In: 2017 International Joint Conference on Neural Networks (IJCNN); 2017. p. 1419–1426.

Publication types