Designing an Algorithmic Trading System, Based on Deep Learning (Case Study: Tehran Stock Exchange)
Subject Areas : Artificial IntelligenceParia Soleimani 1 * , Behzad Soleimani 2 , Mina Bagheriyan 3 , Erfan Taati 4
1 - Department of Industrial Engineering, South Tehran Branch, Islamic Azad University, Tehran, Iran.
2 - Department of Industrial Engineering, South Tehran Branch, Islamic Azad University, Tehran, Iran.
3 - Department of Industrial Engineering, South Tehran Branch, Islamic Azad University, Tehran, Iran.
4 - Department of Industrial Engineering, South Tehran Branch, Islamic Azad University, Tehran, Iran.
Keywords: Deep Learning, LSTM-CNN method, Stock market, Tehran Stock Exchange, Trading System,
Abstract :
With the development of computer systems in recent years, transactions in financial markets have been made available for investors. Artificial intelligence (AI) -based models have also used in the financial markets due to the development of information systems and their ability to store and retrieve the large volumes of financial data. This research presents a new approach to modeling the buying and selling process in the stock market based on deep learning, LSTM, and CNN methods. In the proposed method, the forecast of the future value of stock indicators obtained using the LSTM algorithm is used as the input features of a CNN network. The CNN network as a classification model provides the buy/sell signal for the algorithmic trading system. In addition, the EC-FS model has been used to determine the most appropriate input indicators for the classification model. The proposed model has been evaluated on the Tehran Stock Exchange market and five selected stocks. The implementation results of this model have been compared with other models such as LSTM-MLP, RNN-CNN, and RNN-MLP. As a result, it can be concluded that the LSTM algorithm performs better in forecasting the indicators of selected stocks that will be used as the features of the classification model. It is a general statement that the collaborative LSTM-CNN method is more effective than other methods at training the buying and selling process. This study can aid the stock market of Iran participants for designing the most effective trading strategy.
[1] A. Bigiotti and A. Navarra, "Optimizing Automated Trading Systems," The 2018 International Conference on Digital Science, pp. 254-261, 2018.
[2] O. B. Sezer and A. M. Ozbayoglu, "Algorithmic financial trading with deep convolutional neural networks: Time series to image conversion approach," Applied Soft Computing, vol. 70, pp. 525-538, 2018. https://doi.org/10.1016/j.asoc.2018.04.024
[3] K. A. Althelaya, E.-S. M. El-Alfy, and S. Mohammed, "Evaluation of bidirectional lstm for short-and long-term stock market prediction," in 2018 9th international conference on information and communication systems (ICICS), pp. 151-156: IEEE, 2018. https://doi.org/10.1109/IACS.2018.8355458
[4] C. Martín, D. Quintana, and P. Isasi, "Grammatical Evolution-based ensembles for algorithmic trading," Applied Soft Computing, vol. 84, 2019. https://doi.org/10.1016/j.asoc.2019.105713
[5] M. R. Alimoradi and A. H. Kashan, "A league championship algorithm equipped with network structure and backward Q-learning for extracting stock trading rules," Applied Soft Computing, vol. 68, pp. 478-493, 2018. https://doi.org/10.1016/j.asoc.2018.03.051
[6] J. B. Chakole, M. S. Kolhe, G. D. Mahapurush, A. Yadav, and M. P. Kurhekar, "A Q-learning agent for automated trading in equity stock markets," Expert Systems with Applications, vol. 163, 2021. https://doi.org/10.1016/j.eswa.2020.113761
[7] Y. Li, W. Zheng, and Z. Zheng, "Deep robust reinforcement learning for practical algorithmic trading," IEEE Access, vol. 7, pp. 108014-108022, 2019. https://doi.org/10.1109/ACCESS.2019.2932789
[8] Y. Deng, F. Bao, Y. Kong, Z. Ren, and Q. Dai, "Deep direct reinforcement learning for financial signal representation and trading", IEEE transactions on neural networks and learning systems, vol. 28, no. 3, pp. 653-664, 2016. https://doi.org/10.1109/TNNLS.2016.2522401
[9] T. Shintate and L. Pichl, "Trend prediction classification for high frequency bitcoin time series with deep learning," Journal of Risk and Financial Management, vol. 12, no. 1, p. 17, 2019. https://doi.org/10.3390/jrfm12010017
[10] P. Arvidsson and T. Ånhed, "Sequence-to-sequence learning of financial time series in algorithmic trading", 2017.
[11] S. Sun, S. Wang, and Y. Wei, "A new ensemble deep learning approach for exchange rates forecasting and trading," Advanced Engineering Informatics, vol. 46, 2020. https://doi.org/10.1016/j.aei.2020.101160
[12] X. Wu, H. Chen, J. Wang, L. Troiano, V. Loia, and H. Fujita, "Adaptive Stock Trading Strategies with Deep Reinforcement Learning Methods," Information Sciences, 2020. https://doi.org/10.1016/j.ins.2020.05.066
[13] T. Théate and D. Ernst, "An application of deep reinforcement learning to algorithmic trading", In Expert Systems with Applications,2021. https://doi.org/10.1016/j.eswa.2021.114632
[14] L. Weng, X. Sun, M. Xia, J. Liu, and Y. Xu, "Portfolio Trading System of Digital Currencies: A Deep Reinforcement Learning with Multidimensional Attention Gating Mechanism," Neurocomputing, 2020. https://doi.org/10.1016/j.neucom.2020.04.004
[15] A. Nan, A. Perumal, and O. R. Zaiane, "Sentiment and Knowledge Based Algorithmic Trading with Deep Reinforcement Learning", Database and Expert Systems Applications, 33rd International Conference, DEXA 2022, Vienna, Austria, August 22–24, 2022. https://doi.org/10.48550/arXiv.2001.09403
[16] E. Ponomarev, I. V. Oseledets, and A. Cichocki, "Using Reinforcement Learning in the Algorithmic Trading Problem," Journal of Communications Technology and Electronics, vol. 64, no. 12, pp. 1450-1457, 2019. https://doi.org/10.1134/S1064226919120131
[17] C. Betancourt and W.-H. Chen, "Deep reinforcement learning for portfolio management of markets with a dynamic number of assets," Expert Systems with Applications , 2020. https://doi.org/10.1016/j.eswa.2020.114002
[18] K. Lei, B. Zhang, Y. Li, M. Yang, and Y. Shen, "Time-driven feature-aware jointly deep reinforcement learning for financial signal representation and algorithmic trading," Expert Systems with Applications, vol. 140, 2020. https://doi.org/10.1016/j.eswa.2019.112872
[19] R. Ruiz-Cruz, "Portfolio modeling for an algorithmic trading based on control theory," IFAC-PapersOnLine, vol. 51, no. 13, pp. 390-395, 2018. https://doi.org/10.1016/j.ifacol.2018.07.310
[20] J. Eapen, D. Bein, and A. Verma, "Novel deep learning model with CNN and bi-directional LSTM for improved stock market index prediction," in 2019 IEEE 9th annual computing and communication workshop and conference (CCWC), pp. 0264-0270: IEEE, 2019. https://doi.org/10.1109/CCWC.2019.8666592
[21] Y. Li, S. Wang, Y. Wei, and Q. Zhu, "A New Hybrid VMD-ICSS-BiGRU Approach for Gold Futures Price Forecasting and Algorithmic Trading," IEEE Transactions on Computational Social Systems, vol. 8, no. 6, pp. 1357-1368, 2021. https://doi.org/10.1109/TCSS.2021.3084847
[22] M. E. Aloud and N. Alkhamees, "Intelligent Algorithmic Trading Strategy Using Reinforcement Learning and Directional Change," IEEE Access, vol. 9, pp. 114659-114671, 2021. https://doi.org/10.1109/ACCESS.2021.3105259
[23] S. Hochreiter and J. Schmidhuber, "Long short-term memory," Neural computation, vol. 9, no. 8, pp. 1735-1780, 1997. https://doi.org/10.1162/neco.1997.9.8.1735
[24]F. Bodaghi, A.Owhadi, Ar.Khalili Nasr and M.Khadem Sameni," Stock Price Forecasting in Iran Stock Market: A Comparative Analysis of Deeplearning Approaches", International Journal of Web Research, Vol. 6, No. 2, 2023. https://doi.org/10.22133/ijwr.2024.407077.1170
[25] Y. Li, P. Ni and V.Chang, "Application of deep reinforcement learning in stock trading strategies and stock forecasting", Computing 102, pp.1305–1322 , 2020. https://doi.org/10.1007/s00607-019-00773-w
[26] S.M. Rida, E.Hamza and Z.Taher,"From Technical Indicators to Trading Decisions: A Deep Learning Model Combining CNN and LSTM", International Journal of Advanced Computer Science and Applications,Vol. 15, No. 6, 2024. https://doi.org/ 10.14569/IJACSA.2024.0150685
[27] A. Fernandez, R. B. H. Bunke, and J. Schmiduber, "A novel connectionist system for improved unconstrained handwriting recognition," IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 31, no. 5, 2009.
[28] I. Goodfellow, Y. Bengio, A. Courville, and Y. Bengio, Deep learning. MIT press Cambridge, 2016.
[29] D. Ruan, F. Zhang, J. Yan, "Transfer Learning Between Different Working Conditions on Bearing Fault Diagnosis Based on Data Augmentation", vol 54, Issue 1, pp. 1193-1199, 2021. https://doi.org/10.1016/j.ifacol.2021.08.141
[30] H. H. Aghdam and E. J. Heravi, "Guide to convolutional neural networks," Springer, New York, NY, vol. 10, no 51, pp. 978-973, 2017.