Submitted:
16 August 2023
Posted:
17 August 2023
You are already at the latest version
Abstract
Keywords:
1. Introduction
2. Conceptual Background
2.1. Quant Investing
2.2. Previous Studies
2.3. Hybrid Model Approaches
2.4. Differences among the Hybrid Models
2.5. Technocal Analysis Methods
3. Research Context
3.1. Research Procedure
3.2. Experimental Environmental
3.3. Stock Data Collection
4. Methodology
4.1. Model Training
4.2. Window Sliding
4.3. Deep Learning Models Comparison
4.3. Hyperparameters Tuning
4.4. Back-Testing With Technical Analysis Methods
5. Results
5.1. Deep Learning Models Comparison
5.2. Results of Back-Testing With Technical Analysis Methods
6. Discussion
6.1. Discussion of Findings
6.2. Limitations and Future Research
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Pompian, M.M. H: Finance and Wealth Management, 2011.
- Bali, A.; Madan, A.; Upadhyay, A.; Sah, P.; Nehra, V. 2021.
- Chan, E.P. H: Trading, 2021.
- Parikh, V.; Shah, P. Stock Prediction and Automated Trading System. IJCS 2015, 6, 104–111. [Google Scholar]
- Huang, B.; Huan, Y.; Xu, L.D.; Zheng, L.; Zou, Z. Automated Trading Systems Statistical and Machine Learning Methods and Hardware Implementation: A Survey. Enterprise Information Systems 2019, 13, 132–144. [Google Scholar] [CrossRef]
- Ozbayoglu, A.M.; Gudelek, M.U.; Sezer, O.B. Deep Learning for Financial Applications: A Survey. Applied Soft Computing 2020, 93, 106384. [Google Scholar] [CrossRef]
- Jiang, W. Applications of Deep Learning in Stock Market Prediction: Recent Progress. Expert Systems with Applications 2021, 184, 115537. [Google Scholar] [CrossRef]
- Waisi, M. Advantages and Disadvantages of AI-Based Trading and Investing versus Traditional Methods. 2020.
- DeFusco, R.A.; McLeavey, D.W.; Pinto, J.E.; Runkle, D.E.; Anson, M.J. 2015.
- Alberg, J.; Lipton, Z.C. Improving Factor-Based Quantitative Investing by Forecasting Company Fundamentals. arXiv:1711.04837 2017.
- Nielsen, A. P: Time Series Analysis, 2019.
- Lu, W.; Li, J.; Li, Y.; Sun, A.; Wang, J. A CNN-LSTM-Based Model to Forecast Stock Prices. Complexity 2020, 2020, 1–10. [Google Scholar] [CrossRef]
- Qiu, J.; Wang, B.; Zhou, C. Forecasting Stock Prices with Long-Short Term Memory Neural Network Based on Attention Mechanism. PloS one 2020, 15, e0227222. [Google Scholar] [CrossRef] [PubMed]
- Zaheer, S.; Anjum, N.; Hussain, S.; Algarni, A.D.; Iqbal, J.; Bourouis, S.; Ullah, S.S. A Multi Parameter Forecasting for Stock Time Series Data Using LSTM and Deep Learning Model. Mathematics 2023, 11, 590. [Google Scholar] [CrossRef]
- Dai, H.; Wang, W.; Cao, J.; Wu, H. A Deep Neural Network for Stock Price Prediction. In Proceedings of the Journal of Physics: Conference Series; IOP Publishing, 2021; Vol. 1994; p. 012029. [Google Scholar]
- Aldhyani, T.H.; Alzahrani, A. Framework for Predicting and Modeling Stock Market Prices Based on Deep Learning Algorithms. Electronics 2022, 11, 3149. [Google Scholar] [CrossRef]
- Shi, Z.; Hu, Y.; Mo, G.; Wu, J. Attention-Based CNN-LSTM and XGBoost Hybrid Model for Stock Prediction. arXiv:2204.02623 2022.
- Wang, Z.; Yang, B. Attention-Based Bidirectional Long Short-Term Memory Networks for Relation Classification Using Knowledge Distillation from BERT. In Proceedings of the 2020 IEEE Intl Conf on Dependable, Autonomic and Secure Computing, Intl Conf on Pervasive Intelligence and Computing, Intl Conf on Cloud and Big Data Computing, 2020, Intl Conf on Cyber Science and Technology Congress (DASC/PiCom/CBDCom/CyberSciTech); IEEE; pp. 562–568. [CrossRef]
- Sood, E.; Tannert, S.; Müller, P.; Bulling, A. Improving Natural Language Processing Tasks with Human Gaze-Guided Neural Attention. Advances in Neural Information Processing Systems 2020, 33, 6327–6341. [Google Scholar]
- Kavianpour, P.; Kavianpour, M.; Jahani, E.; Ramezani, A. A Cnn-Bilstm Model with Attention Mechanism for Earthquake Prediction. The Journal of Supercomputing 2023, 1–33. [Google Scholar] [CrossRef]
- Wang, Y.; Huang, M.; Zhu, X.; Zhao, L. Attention-Based LSTM for Aspect-Level Sentiment Classification. In Proceedings of the Proceedings of the 2016 conference on empirical methods in natural language processing; pp. 2016606–615.
- Park, C.-H.; Irwin, S.H. What Do We Know about the Profitability of Technical Analysis? Journal of Economic surveys 2007, 21, 786–826. [Google Scholar] [CrossRef]
- Schwager, J.D. T: Complete Guide to the Futures Market, 2017.
- Ciaburro, G.; Joshi, P. O: Machine Learning Cookbook, 2019.
- Weights & Biases Weights & Biases – Developer Tools for ML. Available online: https://wandb.ai/site/ (accessed on 6 June 2023).
- Keras Team Keras Documentation: ReduceLROnPlateau. Available online: https://keras.io/api/callbacks/reduce_lr_on_plateau/ (accessed on 6 June 2023).
- Roy, S.K.; Paoletti, M.E.; Haut, J.M.; Dubey, S.R.; Kar, P.; Plaza, A.; Chaudhuri, B.B. Angulargrad: A New Optimization Technique for Angular Convergence of Convolutional Neural Networks. arXiv:2105.10190 2021.
- Vafaeipour, M.; Rahbari, O.; Rosen, M.A.; Fazelpour, F.; Ansarirad, P. Application of Sliding Window Technique for Prediction of Wind Velocity Time Series. International Journal of Energy and Environmental Engineering 2014, 5, 1–7. [Google Scholar] [CrossRef]
- Selvin, S.; Vinayakumar, R.; Gopalakrishnan, E.A.; Menon, V.K.; Soman, K.P. Stock Price Prediction Using LSTM, RNN and CNN-Sliding Window Model. In Proceedings of the 2017 international conference on advances in computing, 2017, communications and informatics (icacci); IEEE; pp. 1643–1647.
- Ferrell, B.J. Fine-Tuning Strategies for Classifying Community-Engaged Research Studies Using Transformer-Based Models: Algorithm Development and Improvement Study. JMIR Formative Research 2023, 7, e41137. [Google Scholar] [CrossRef] [PubMed]
- TensorFlow, Tf. Random_normal_initializer | TensorFlow v2.12. Available online: https://www.tensorflow.org/api_docs/python/tf/random_normal_initializer (accessed on 6 June 2023).
- Zeigenbein, S. A Fuzzy Logic Stock Trading System Based On Technical Analysis. 2011.
- Xu, X.; Lee, L. A Spatial Autoregressive Model with a Nonlinear Transformation of the Dependent Variable. Journal of Econometrics 2015, 186, 1–18. [Google Scholar] [CrossRef]
- Xu, Y.; Jiang, X. Short-Term Power Load Forecasting Based on BiGRU-Attention-SENet Model. Energy Sources, Part A: Recovery, Utilization, and Environmental Effects 2022, 44, 973–985.

| Samsung Electronics | ||||
|---|---|---|---|---|
| Model | MAE | RMSE | Val_MAE | Val_RMSE |
| CNN Attention BiLSTM | 0.01253 | 0.02630 | 0.00292 | 0.00520 |
| BiGRU CNN BiLSTM Attention |
0.01241 | 0.02713 | 0.00312 | 0.00586 |
| BiLSTM Attention CNN | 0.01269 | 0.02615 | 0.00313 | 0.00508 |
| Bi LSTM layers 4 | 0.01483 | 0.02929 | 0.00369 | 0.01756 |
| CNN BiLSTM Attention | 0.01297 | 0.02820 | 0.00424 | 0.00630 |
| CNN Attention | 0.01954 | 0.03987 | 0.00557 | 0.01909 |
| CNN | 0.02336 | 0.04687 | 0.01142 | 0.01506 |
| LSTM layers 4 | 0.02594 | 0.04627 | 0.01472 | 0.02630 |
| Celltrion Healthcare | ||||
| Model | MAE | RMSE | Val_MAE | Val_RMSE |
| CNN Attention BiLSTM | 0.04244 | 0.06151 | 0.01726 | 0.02695 |
| BiGRU CNN BiLSTM Attention |
0.03764 | 0.05414 | 0.01733 | 0.02362 |
| CNN BiLSTM Attention | 0.04524 | 0.06358 | 0.01788 | 0.02972 |
| Bi LSTM layers 4 | 0.03913 | 0.05646 | 0.02110 | 0.03493 |
| BiLSTM Attention CNN | 0.02944 | 0.04253 | 0.02204 | 0.03319 |
| LSTM layers4 | 0.05443 | 0.08092 | 0.02640 | 0.04006 |
| CNN | 0.04866 | 0.06590 | 0.02808 | 0.03818 |
| CNN Attention | 0.18247 | 0.27261 | 0.02991 | 0.04754 |
| Hyperparameters | BiLSTM Attention CNN | CNN BiLSTM Attention | CNN Attention BiLSTM | BiGRU CNN BiLSTM Attention | |
|---|---|---|---|---|---|
| Conv1D | Filters | 21 | 31 | 31 | 31 |
| Activation | elu | elu | selu | elu | |
| Kernel Size | 1 | 1 | 1 | 1 | |
| Strides | 40 | 30 | 30 | 40 | |
| BatchNormalization | Axis | 1 | 1 | 1 | 1 |
| Momentum | 0.9 | 0.9 | 0.9 | 0.9 | |
| MaxPooling1D | Pool Size | 1 | 1 | 1 | 1 |
| Strides | 2 | 2 | 2 | 2 | |
| Bidirectional LSTM | Units | 21 | 21 | 21 | 21 |
| Bidirectional GRU | Units | None | None | None | 16 |
| Dropout | Ratio | 0.2 | 0.3 | 0.2 | 0.2 |
| Output Dense layer | Units | 1 | 1 | 1 | 1 |
| Activation | linear | linear | linear | linear | |
| Batch Size | 32 | 32 | 32 | 32 | |
| Epochs | 100 | 100 | 100 | 100 | |
| Optimizer | AngularGrad("cos") | AngularGrad("cos") | AngularGrad("cos") | AngularGrad("cos") | |
| Learning Rate(AngularGrad) | 1e-4 | 1e-4 | 1e-4 | 1e-4 | |
| loss function | MAE | MAE | MAE | MAE | |
| Performance metrics | MAE, RMSE | MAE, RMSE | MAE, RMSE | MAE, RMSE | |
| CNN Attention BiLSTM | ||||||
|---|---|---|---|---|---|---|
| Code | Code name | Rate | Purchase price (KRW) |
Holding amount | Buy date (YYYYMMDD) |
Sell date (YYYYMMDD) |
| 041510 | SM | 7.34 | 62,800 | 31 | 20220110 | 20220117 |
| 037270 | YG PLUS | -3 | 7,330 | 272 | 20220110 | 20220111 |
| 037270 | YG PLUS | -3.73 | 6,930 | 288 | 20220113 | 20220117 |
| 002380 | KCC | 1.81 | 310,500 | 6 | 20220217 | 20220223 |
| 318010 | Pharmsville | -4.4 | 13,300 | 150 | 20220228 | 20220302 |
| 210120 | Victory Contents | 34.41 | 13,800 | 144 | 20220316 | 20220324 |
| 088290 | Ewon Comfortech | 1.64 | 8,320 | 240 | 20220415 | 20220420 |
| 336060 | Wavus | -3.65 | 2,660 | 751 | 20220419 | 20220420 |
| 085370 | Lutronic | -2.51 | 22,350 | 89 | 20220511 | 20220512 |
| 067830 | Savezone I&C | 0.32 | 3,325 | 601 | 20220511 | 20220525 |
| 002420 | Century Corporation | -0.28 | 9,910 | 201 | 20220516 | 20220519 |
| 001080 | Manho Rope & Wire | -1.87 | 25,100 | 79 | 20220516 | 20220519 |
| Profit: 511,708 KRW (Approximately 5% rate of return) | ||||||
| BiGRU CNN BiLSTM Attention | ||||||
| 041510 | SM | 7.34 | 62,800 | 31 | 20220110 | 20220117 |
| 037270 | YG PLUS | -3 | 7,330 | 272 | 20220110 | 20220111 |
| 037270 | YG PLUS | -3.73 | 6,930 | 288 | 20220113 | 20220117 |
| 247540 | EcoPro BM | 2 | 320,000 | 6 | 20220128 | 20220207 |
| 002380 | KCC | 1.81 | 310,500 | 6 | 20220217 | 20220223 |
| 318010 | pharmsville | -4.4 | 13,300 | 150 | 20220228 | 20220302 |
| 088290 | Ewon Comfortech | 1.64 | 8,320 | 240 | 20220415 | 20220420 |
| 085370 | Lutronic | -2.51 | 22,350 | 89 | 20220511 | 20220512 |
| 067830 | Savezone I&C | 0.32 | 3,325 | 601 | 20220511 | 20220525 |
| 000060 | Meritz Fire | 6.28 | 37,250 | 53 | 20220513 | 20220520 |
| 002420 | Century Corporation | 1.36 | 9,750 | 205 | 20220513 | 20220516 |
| 001080 | Manho Rope & Wire | -1.87 | 25,100 | 79 | 20220516 | 20220519 |
| Profit: 95,888 KRW (Approximately 1% rate of return) | ||||||
| BiLSTM Attention CNN | ||||||
| 200580 | Medyssey | -1.25 | 10,300 | 194 | 20220113 | 20220114 |
| 028050 | Samsung Engineering | 10.46 | 20,900 | 95 | 20220128 | 20220208 |
| 036620 | Gamsung Corporation | 4.71 | 2,000 | 1,000 | 20220204 | 20220208 |
| 036620 | Gamsung Corporation | -1.58 | 1,920 | 1,041 | 20220415 | 20220418 |
| 004890 | DONGIL INDUSTRIES | -2.93 | 169,500 | 11 | 20220512 | 20220513 |
| 002420 | Century Corporation | 1.36 | 9,750 | 205 | 20220513 | 20220516 |
| Profit: 217,791 KRW (Approximately 2% rate of return) | ||||||
| CNN BiLSTM Attention | ||||||
| 041510 | SM | 7.34 | 62,800 | 31 | 20220110 | 20220117 |
| 037270 | YG PLUS | -3 | 7,330 | 272 | 20220110 | 20220111 |
| 037270 | YG PLUS | -3.73 | 6,930 | 288 | 20220113 | 20220117 |
| 092200 | Dic | -2.77 | 5,000 | 400 | 20220216 | 20220218 |
| 002380 | KCC | 1.81 | 310,500 | 6 | 20220217 | 20220223 |
| 318010 | Pharmsville | -4.4 | 13,300 | 150 | 20220228 | 20220302 |
| 210120 | Victory Contents | 34.41 | 13,800 | 144 | 20220316 | 20220324 |
| 088290 | Ewon Comfortech | 1.64 | 8,320 | 240 | 20220415 | 20220420 |
| 336060 | Wavus | -3.65 | 2,660 | 751 | 20220419 | 20220420 |
| 085370 | Lutronic | -2.51 | 22,350 | 89 | 20220511 | 20220512 |
| 067830 | Savezone I&C | 0.32 | 3,325 | 601 | 20220511 | 20220525 |
| 002420 | Century Corporation | -0.28 | 9,910 | 201 | 20220516 | 20220519 |
| 001080 | Manho Rope & Wire | -1.87 | 25,100 | 79 | 20220516 | 20220519 |
| Profit: 456,241 KRW (Approximately 4.5% rate of return) | ||||||
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).