Abstract
At the beginning of 2020, the COVID-19 pandemic caused a sharp decline in equity market indices, which remained stagnant for a considerable period. This resulted in significant losses for many investors. Despite extensive research on stock market prediction and the development of various effective models, there has been no specific effort to create a stable model during a financial crisis. Several studies have been conducted to forecast stock market trends and prices using advanced techniques like machine learning, deep learning, generative adversarial networks, and reinforcement learning. However, none of the existing forecasting models address the issue of market crashes, leading to substantial losses. We propose a GAF-EWGAN, a stacking ensemble model that combines enhanced WGANs with Gramian Angular Fields. This model demonstrates a high level of resilience during stock market crashes, effectively preventing investors from experiencing losses and generating significant profits. The GAF-EWGAN model achieved an average annual return of 16.49% across 20 selected stocks. Financial indicators indicate its reliability for real-world transactions.
Similar content being viewed by others
Data availability
The source code is available at gitlab.com/Alireza. Ghasemieh/stock_advisor.
The Stock market data is collected from Nasdaq Stock Exchange and New York Stock Exchange through Alphavantage API for 20 stocks over the last 21 years.
Abbreviations
- ApT:
-
Annual Return
- ARIMA:
-
Autoregressive integrated moving average
- A-RNN:
-
Attention based RNN
- BA:
-
Batting Average
- BaH:
-
Buy and Hold
- BB:
-
Bollinger Bands
- CCI:
-
Commodity Channel Index
- CNN:
-
Convolutional Neural Network
- C-RNN:
-
Convolutional deep-Recurrent Neural Network
- DL:
-
Deep Learning
- DPS:
-
Dividend Per Share
- DWNN:
-
Deep and Wide Neural Networks
- EWGAN:
-
Ensamble WGAN
- FFNN:
-
Feedforward neural network
- GAF:
-
Gramian Angular Fields
- GAN:
-
Generative Adversarial Network
- GAN-HPA:
-
Generative Adversarial Network-based Hybrid Prediction Algorithm
- GARCH:
-
Generalized autoregressive conditional heteroskedasticity
- GEW:
-
Geneva Emotion Wheel
- GRU:
-
Gated recurrent units
- LDA:
-
Latent Dirichlet Allocation
- LSGAN:
-
Least-squares GAN
- LSTM:
-
Long Short-Term Memory
- MA:
-
Moving Average
- ML:
-
Machine Learning
- MRF:
-
Markov Random Fields
- NTN:
-
Neural tensor network
- PSR:
-
Phase-space reconstruction
- RF:
-
Random forests
- RNN:
-
Recurrent neural network
- SVM:
-
Support vector machines
- SVR:
-
Support vector regressions
- TI:
-
Technical Indicator
- VAE:
-
Variational Auto Encoder
- WGAN:
-
Wasserstein GAN
- WLR:
-
Win-Loss Ratio
- ATR :
-
Average True Range
References
Chen J (2021) Stock Market Definition. Investopedia. https://www.investopedia.com/terms/s/stockmarket.asp Accessed 22 Feb 2022
Arestis P, Demetriades PO, Luintel KB (2001) Financial Development and Economic Growth: The Role of Stock Markets. J Money Credit Bank 33(1):16. https://doi.org/10.2307/2673870
A. COURAGE (2021) How does the performance of the stock market affect individual businesses?, Investopedia. https://www.investopedia.com/ask/answers/042215/how-does-performance-stock-market-affect-individual-businesses.asp Accessed 22 Feb 2022
Hu Z, Zhao Y, Khushi M (2021) A survey of forex and stock price prediction using deep learning. Appl Syst Innov 4(1):1–30. https://doi.org/10.3390/ASI4010009
Strader TJ, Rozycki JJ, Root TH, Huang Y-HJ (2020) Machine Learning Stock Market Prediction Studies : Review and Research Directions. J Int Technol Inf Manag 28(4):63–83
Obthong M, Tantisantiwong N, Jeamwatthanachai W, Wills G (2020) A survey on machine learning for stock price prediction: Algorithms and techniques, FEMIB 2020 - Proceedings of the 2nd International Conference on Finance, Economics, Management and IT Business, no. Femib, pp. 63–71. https://doi.org/10.5220/0009340700630071
Yoo PD, Kim MH, Jan T (2005) Machine learning techniques and use of event information for stock market prediction: A survey and evaluation. Proceedings - International Conference on Computational Intelligence for Modelling, Control and Automation, CIMCA 2005 and International Conference on Intelligent Agents, Web Technologies and Internet, vol. 2, pp. 835–841. https://doi.org/10.1109/cimca.2005.1631572
Maqsood H et al (2020) A local and global event sentiment based efficient stock exchange forecasting using deep learning. Int J Inf Manage 50:432–451. https://doi.org/10.1016/J.IJINFOMGT.2019.07.011
Yu P, Yan X (2020) Stock price prediction based on deep neural networks. Neural Comput Appl 32(6):1609–1628. https://doi.org/10.1007/s00521-019-04212-x
Faraz M, Khaloozadeh H (2020) Multi-Step-Ahead Stock Market Prediction Based on Least Squares Generative Adversarial Network, in 2020 28th Iranian Conference on Electrical Engineering (ICEE), IEEE. pp. 1–6. https://doi.org/10.1109/ICEE50131.2020.9260858
Lin H, Chen C, Huang G, Jafari A (2021) Stock price prediction using Generative Adversarial Networks. J Comput Sci 17(3):188–196. https://doi.org/10.3844/jcssp.2021.188.196
Li Y, Ni P, Chang V (2019) An empirical research on the investment strategy of stock market based on deep reinforcement learning model, COMPLEXIS 2019 - Proceedings of the 4th International Conference on Complexity, Future Information Systems and Risk, pp. 52–58. https://doi.org/10.5220/0007722000520058
Pastore A, Esposito U, Vasilaki E (2015) Modelling stock-market investors as Reinforcement Learning agents, 2015 IEEE International Conference on Evolving and Adaptive Intelligent Systems, EAIS 2015. https://doi.org/10.1109/EAIS.2015.7368789
Patil P, Potika K, Wu C-S, Orang M (2020) Stock market prediction using ensemble of graph theory, machine learning and deep learning models, Proceedings of the 3rd International Conference on Software Engineering and Information Management. https://doi.org/10.1145/3378936
Sim HS, Kim HI, Ahn JJ (2019) Is deep learning for image recognition applicable to stock market prediction? Complexity 2019. https://doi.org/10.1155/2019/4324878
Hoseinzade E, Haratizadeh S (2019) CNNpred: CNN-based stock market prediction using a diverse set of variables. Expert Syst Appl 129:273–285. https://doi.org/10.1016/j.eswa.2019.03.029
Eapen J, Bein D, Verma A (2019) Novel deep learning model with CNN and bi-directional LSTM for improved stock market index prediction, 2019 IEEE 9th Annual Computing and Communication Workshop and Conference, CCWC 2019, pp. 264–270. https://doi.org/10.1109/CCWC.2019.8666592
Yang H, Zhu Y, Huang Q (2018) A Multi-indicator Feature Selection for CNN-Driven Stock Index Prediction. Lect Notes Comput Sci (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) 11305 LNCS:35–46. https://doi.org/10.1007/978-3-030-04221-9_4
Cai S, Feng X, Deng Z, Ming Z, Shan Z (2018) Financial News Quantization and Stock Market Forecast Research Based on CNN and LSTM. Lect Notes Comput Sci (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) 11344 LNCS:366–375. https://doi.org/10.1007/978-3-030-05755-8_36
Liu Y, Zeng Q, Yang H, Carrio A (2018) Stock Price Movement Prediction from Financial News with Deep Learning and Knowledge Graph Embedding. Lect Notes Comput Sci (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) 11016 LNAI:102–113. https://doi.org/10.1007/978-3-319-97289-3_8
Selvin S, Vinayakumar R, Gopalakrishnan EA, Menon VK, Soman KP (2017) Stock price prediction using LSTM, RNN and CNN-sliding window model. 2017 International Conference on Advances in Computing, Communications and Informatics, ICACCI 2017, vol. 2017-Janua, pp. 1643–1647. https://doi.org/10.1109/ICACCI.2017.8126078
Liu S, Zhang C, Ma J (2017) CNN-LSTM Neural Network Model for Quantitative Strategy Analysis in Stock Markets. Lect Notes Comput Sci (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) 10635 LNCS:198–206. https://doi.org/10.1007/978-3-319-70096-0_21
Ugur Gudelek M, Arda Boluk S, Murat Ozbayoglu A (2018) A deep learning based stock trading model with 2-D CNN trend detection. 2017 IEEE Symposium Series on Computational Intelligence, SSCI 2017 - Proceedings, vol. 2018-Janua, pp. 1–8. https://doi.org/10.1109/SSCI.2017.8285188
Ding X, Zhang Y, Liu T, Duan J (2015) Deep learning for event-driven stock prediction. IJCAI Int Jt Conf Artif Intelligence 2015-Janua:2327–2333
Zhao Y, Khushi M (2020) Wavelet Denoised-ResNet CNN and LightGBM method to predict forex rate of change. IEEE International Conference on Data Mining Workshops, ICDMW, vol. 2020-Novem, pp. 385–391. https://doi.org/10.1109/ICDMW51313.2020.00060
Chen JF, Chen WL, Huang CP, Huang SH, Chen AP (2017) Financial time-series data analysis using deep convolutional neural networks. Proceedings - 2016 7th International Conference on Cloud Computing and Big Data, CCBD 2016, pp. 87–92. https://doi.org/10.1109/CCBD.2016.027
Wen M, Li P, Zhang L, Chen Y (2019) Stock market trend prediction using high-order information of time series. IEEE Access 7:28299–28308. https://doi.org/10.1109/ACCESS.2019.2901842
Ni L, Li Y, Wang X, Zhang J, Yu J, Qi C (2019) Forecasting of Forex Time Series Data Based on Deep Learning. Procedia Comput Sci 147:647–652. https://doi.org/10.1016/j.procs.2019.01.189
Li C, Song D, Tao D (2019) Multi-task recurrent neural networks and higher-order Markov Random fields for stock price movement prediction. Proceedings of the ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 1141–1151. https://doi.org/10.1145/3292500.3330983
Chen W, Yeo CK, Lau CT, Lee BS (2018) Leveraging social media news to predict stock index movement using RNN-boost. Data Knowl Eng 118:14–24. https://doi.org/10.1016/j.datak.2018.08.003
Zhang R, Yuan Z, Shao X (2018) A New Combined CNN-RNN Model for Sector Stock Price Analysis. Proceedings - International Computer Software and Applications Conference, vol. 2, pp. 546–551. https://doi.org/10.1109/COMPSAC.2018.10292
Zeng Z, Khushi M (2020) Wavelet Denoising and Attention-based RNN- ARIMA Model to Predict Forex Price. Proceedings of the International Joint Conference on Neural Networks. https://doi.org/10.1109/IJCNN48605.2020.9206832
Nikou M, Mansourfar G, Bagherzadeh J (2019) Stock price prediction using DEEP learning algorithm and its comparison with machine learning algorithms. Intell Syst Account Financ Manag 26(4):164–174. https://doi.org/10.1002/isaf.1459
Fazeli A, Houghten S (2019) Deep Learning for the Prediction of Stock Market Trends. Proceedings - 2019 IEEE International Conference on Big Data, Big Data 2019, pp. 5513–5521. https://doi.org/10.1109/BigData47090.2019.9005523
Xu Y, Keselj V (2019) Stock prediction using deep learning and sentiment analysis. Proceedings - 2019 IEEE International Conference on Big Data, Big Data 2019, pp. 5573–5580. https://doi.org/10.1109/BigData47090.2019.9006342
Wu DD, Zheng L, Olson DL (2014) A Decision Support Approach for Online Stock Forum Sentiment Analysis. IEEE Trans Syst Man Cybern Syst 44(8):1077–1087. https://doi.org/10.1109/TSMC.2013.2295353
Lakshminarayanan SK, McCrae J (2019) A comparative study of SVM and LSTM deep learning algorithms for stock market prediction. CEUR Workshop Proc 2563:446–457
Rana M, Uddin MM, Hoque MM (2019) Effects of activation functions and optimizers on stock price prediction using LSTM recurrent networks. ACM International Conference Proceeding Series, pp. 354–358. https://doi.org/10.1145/3374587.3374622
Naik N, Mohan BR (2019) Study of stock return predictions using recurrent neural networks with LSTM. Commun Comput Inf Sci 1000:453–459. https://doi.org/10.1007/978-3-030-20257-6_39
Nguyen DHD, Tran LP, Nguyen V (2019) Predicting stock prices using dynamic LSTM models. Commun Comput Inf Sci 1051 CCIS:199–212. https://doi.org/10.1007/978-3-030-32475-9_15
Lai Y, Chen RC, Caraka R (2019) Prediction Stock Price Based on Different Index Factors Using LSTM. Proc Int Conf Mach Learn Cybern. 2019. https://doi.org/10.1109/ICMLC48188.2019.8949162
Hossain MA, Karim R, Thulasiram R, Bruce NDB, Wang Y (2018) Hybrid Deep Learning Model for Stock Price Prediction. Proceedings of the 2018 IEEE Symposium Series on Computational Intelligence, SSCI. pp 1837–1844, 2019. https://doi.org/10.1109/SSCI.2018.8628641
Baek Y, Kim HY (2018) ModAugNet: A new forecasting framework for stock market index value with an overfitting prevention LSTM module and a prediction LSTM module. Expert Syst Appl 113:457–480. https://doi.org/10.1016/j.eswa.2018.07.019
Kim HY, Won CH (2018) Forecasting the volatility of stock price index: A hybrid model integrating LSTM with multiple GARCH-type models. Expert Syst Appl 103:25–37. https://doi.org/10.1016/j.eswa.2018.03.002
Bollerslev T (1986) Generalized autoregressive conditional heteroskedasticity. J Econ. https://www.investopedia.com/terms/g/garch.asp (accessed Feb. 22, 2022)
Li H, Shen Y, Zhu Y (2018) Stock price prediction using attention-based multi-input LSTM. Proceedings of The 10th Asian Conference on Machine Learning, PMLR 95:454–469, 2018. https://www.proceedings.mlr.press/v95/li18c.html
Cheng LC, H. Huang Y, Wu ME (2019) Applied attention-based LSTM neural networks in stock prediction Proceedings - 2018 IEEE International Conference on Big Data, Big Data 2018, pp 4716–4718. https://doi.org/10.1109/BigData.2018.8622541
Shah D, Campbell W, Zulkernine FH (2019) A Comparative Study of LSTM and DNN for Stock Market Forecastin. Proceedings - 2018 IEEE International Conference on Big Data, Big Data 2018, pp 4148–4155. https://doi.org/10.1109/BigData.2018.8622462.
Lin BS, Chu WT, Wang CM (2018) Application of stock analysis using deep learning, in Proceedings - 2018 7th International Congress on Advanced Applied Informatics, IIAI-AAI 2018, IEEE, pp. 612–617. https://doi.org/10.1109/IIAI-AAI.2018.00128
Skehin T, Crane M, Bezbradica M (2018) Day ahead forecasting of FAANG stocks using ARIMA, LSTM networks and wavelets. CEUR Workshop Proc 2259:186–197
Zhang X, Tan Y (2018) Deep stock ranker: A LSTM neural network model for stock selection. Lect Notes Comput Sci (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) 10943 LNCS:614–623. https://doi.org/10.1007/978-3-319-93803-5_58
Feng F, He X, Wang X, Luo C, Liu Y, Chua TS (2019) Temporal relational ranking for stock prediction. ACM Trans Inf Syst 37(2). https://doi.org/10.1145/3309547
Li J, Bu H, Wu J (2017) Sentiment-aware stock market prediction: A deep learning method. 14th International Conference on Services Systems and Services Management, ICSSSM 2017 – Proceedings. https://doi.org/10.1109/ICSSSM.2017.7996306
Long J, Chen Z, He W, Wu T, Ren J (2020) An integrated framework of deep learning and knowledge graph for prediction of stock price trend: An application in Chinese stock exchange market. Appl Soft Comput J 91. https://doi.org/10.1016/j.asoc.2020.106205
Chung H, Shin KS (2018) Genetic algorithm-optimized long short-term memory network for stock market prediction. Sustainability (Switzerland) 10(10). https://doi.org/10.3390/su10103765
Song Y, Lee JW, Lee J (2019) A study on novel filtering and relationship between input-features and target-vectors in a deep learning model for stock price prediction. Appl Intell 49(3):897–911. https://doi.org/10.1007/s10489-018-1308-x
Naik N, Mohan BR (2019) Stock price movements classification using machine and deep learning techniques-the case study of indian stock market. Commu Comput Inf Sci 1000:445–452. https://doi.org/10.1007/978-3-030-20257-6_38
Abe M, Nakayama H (2018) Deep learning for forecasting stock returns in the cross-section. Lect Notes Comput Sci (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) 10937 LNAI:273–284. https://doi.org/10.1007/978-3-319-93034-3_22
Nakagawa K, Uchida T, Aoshima T (2019) Deep factor model: Explaining deep learning decisions for forecasting stock returns with layer-wise relevance propagation. Lect Notes Comput Sci (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) 11054 LNAI:37–50. https://doi.org/10.1007/978-3-030-13463-1_3
Chong E, Han C, Park FC (2017) Deep learning networks for stock market analysis and prediction: Methodology, data representations, and case studies. Expert Syst Appl 83:187–205. https://doi.org/10.1016/j.eswa.2017.04.030
Yong BX, Abdul Rahim MR, Abdullah AS (2017) A stock market trading system using deep neural network. Commun Comput Inf Sci 751:356–364. https://doi.org/10.1007/978-981-10-6463-0_31
Maji G, Mondal D, Dey N, Debnath NC, Sen S (2021) Stock prediction and mutual fund portfolio management using curve fitting techniques. J Ambient Intell Humaniz Comput 12(10):9521–9534. https://doi.org/10.1007/S12652-020-02693-6/TABLES/6
Ding S, Cui T, Xiong X, Bai R (2020) Forecasting stock market return with nonlinearity: a genetic programming approach. J Ambient Intell Humaniz Comput 11(11):4927–4939. https://doi.org/10.1007/S12652-020-01762-0/METRICS
Kumar MR, Venkatesh J, Rahman AMJMZ (2021) Data mining and machine learning in retail business: developing efficiencies for better customer retention. J Ambient Intell Humaniz Comput 1–13. https://doi.org/10.1007/S12652-020-02711-7/METRICS
Chauhan P, Sharma N, Sikka G (2020) The emergence of social media data and sentiment analysis in election prediction. J Ambient Intell Humanized Comput 12(2):2601–2627. https://doi.org/10.1007/S12652-020-02423-Y
Abbasimehr H, Paki R (2022) Improving time series forecasting using LSTM and attention models. J Ambient Intell Humaniz Comput 13(1):673–691. https://doi.org/10.1007/S12652-020-02761-X/METRICS
Murali P, Revathy R, Balamurali S, Tayade AS (2020) Integration of RNN with GARCH refined by whale optimization algorithm for yield forecasting: a hybrid machine learning approach. J Ambient Intell Humaniz Comput 1–13. https://doi.org/10.1007/S12652-020-01922-2/METRICS
Wang T, Guo J, Shan Y, Zhang Y, Peng B, Wu Z (2022) A Knowledge Graph-Gcn-Community Detection Integrated Model for Large-Scale Stock Price Prediction. SSRN Electron J. https://doi.org/10.2139/SSRN.4229420
Xu C et al (2022) HGNN: Hierarchical graph neural network for predicting the classification of price-limit-hitting stocks. Inf Sci (N Y) 607:783–798. https://doi.org/10.1016/J.INS.2022.06.010
Chen Y, Wei Z (2018) Incorporating corporation relationship via graph convolutional neural networks for stock price prediction. International Conference on Information and Knowledge Management, Proceedings, pp. 1655–1658. https://doi.org/10.1145/3269206.3269269
Qin Y, Song D, Cheng H, Cheng W, Jiang G, Cottrell GW (2017) A Dual-Stage Attention-Based Recurrent Neural Network for Time Series Prediction. IJCAI Int Jt Conf Artif Intell 0:2627–2633. https://doi.org/10.24963/ijcai.2017/366
Jin L, Tan F, Jiang S (2020) Generative adversarial network technologies and applications in computer vision. Comput Intell Neurosci 2020. https://doi.org/10.1155/2020/1459107
Arjovsky M, Chintala S, Bottou L (2017) Wasserstein generative adversarial networks.Proceedings of the 34th International Conference on Machine Learning, PMLR 70:214–223, 2017. https://www.proceedings.mlr.press/v70/arjovsky17a.html
Zhang K, Zhong G, Dong J, Wang S, Wang Y (2019) Stock market prediction based on generative adversarial network, in Procedia Computer Science, Elsevier B.V., pp. 400–406. https://doi.org/10.1016/j.procs.2019.01.256
Leangarun T, Tangamchit P, Thajchayapong S (2018) Stock Price Manipulation Detection using Generative Adversarial Networks. in 2018 IEEE Symposium Series on Computational Intelligence (SSCI), IEEE, pp. 2104–2111. https://doi.org/10.1109/SSCI.2018.8628777
Tovar W (2020) Deep learning based on generative adversarial and convolutional neural networks for financial time series predictions. ArXiv. https://www.abs/2008.08041
Polamuri SR, Srinivas DK, Krishna Mohan DA (2021) Multi-Model Generative Adversarial Network Hybrid Prediction Algorithm (MMGAN-HPA) for stock market prices prediction. Journal of King Saud University - Computer and Information Sciences. https://doi.org/10.1016/j.jksuci.2021.07.001
Kumar A et al (2021) Generative adversarial network (GAN) and enhanced root mean square error (ERMSE): deep learning for stock price movement prediction. Multimed Tools Appl 1–19. https://doi.org/10.1007/s11042-021-11670-w
Ferdaus MM, Chakrabortty RK, Ryan MJ (2021) Multiobjective automated type-2 parsimonious learning machine to forecast time-varying stock indices online. IEEE Trans Syst Man Cybern Syst 1–14. https://doi.org/10.1109/TSMC.2021.3061389
Nti IK, Adekoya AF, Weyori BA (2021) A novel multi-source information-fusion predictive framework based on deep neural networks for accuracy enhancement in stock market prediction. J Big Data 8(1):1–28. https://doi.org/10.1186/s40537-020-00400-y
Mehta P, Pandya S, Kotecha K (2021) Harvesting social media sentiment analysis to enhance stock market prediction using deep learning. PeerJ Comput Sci 7:1–21. https://doi.org/10.7717/PEERJ-CS.476/SUPP-2
Mane O, Kandasamy S (2022) Stock market prediction using natural language processing -- A survey. 33–48. https://doi.org/10.48550/arxiv.2208.13564
Funding
This research is funded by the Toronto Metropolitan University, Faculty of Engineering and Architectural Science.
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Conflicts of interests/Competing interests
Authors declare no conflict of interests or competing interests.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.
About this article
Cite this article
Ghasemieh, A., Kashef, R. An enhanced Wasserstein generative adversarial network with Gramian Angular Fields for efficient stock market prediction during market crash periods. Appl Intell 53, 28479–28500 (2023). https://doi.org/10.1007/s10489-023-05016-2
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10489-023-05016-2