Designing an Automated Trading System Using Convolutional Neural Network

Document Type : Original Article

Authors

1 MA Candidate in Industrial Engineering, Tarbiat Modares University, Tehran, Iran.

2 Assistant Prof, Department of Industrial & Systems Engineering, Tarbiat Modares University, Tehran, Iran.

Abstract

In recent years, many articles and researches have been published on the use of machine learning methods and algorithmic trading in financial markets in order to earn returns. The aim of this study is to create an automated trading system using image processing by convolutional neural network. For this purpose, initially, after receiving the data required for the selected stocks, 28 technical analysis indicators were selected and the values of each were calculated separately for each stock. Then the time series of these indicators were converted to 2D images, and as a result, for each data on the time series of the stock price, a 2D image with dimensions of 28 x 28 was created. After labeling each image with one of the buy, sell, or hold labels, these images entered the convolutional neural network. Also, to evaluate the return and risk of the proposed system, a method for buying and selling based on the results of the model in the past has been introduced. The results show that in 80% of cases, this method is more effective than the buy and hold strategy. It also always performs better in terms of standard deviation risk and maximum drawdown. Also, the results show the high impact of trading commission on the Tehran Stock Exchange on the return of the model. In such a way that the model loses many times the profit earned for the payment of the commission.

Keywords


1. Ahmed, N. K., Atiya, A. F., Gayar, N. E., & El-Shishiny, H. (2010). An empirical comparison of machine learning models for time series forecasting. Econometric Reviews29(5-6), 594-621.
2. Bajlan, S., Fllah Poor, S., & Dana, N. (2017). Predicting stock price trends using a modified support vector machine with hybrid feature selection, Journal of Financial Management Perspective, 17(1), 69-86. (In Persian)
3. Canziani, A., Paszke, A., & Culurciello, E. (2016). An analysis of deep neural network models for practical applications. arXiv preprint arXiv:1605.07678.
4. Cartea, A., & Jaimungal, S. (2013). Modelling asset prices for algorithmic and high-frequency trading. Applied Mathematical Finance, 20(6), 512-547.
5. Das, G., Lin, K. I., Mannila, H., Renganathan, G., & Smyth, P. (1998, August). Rule Discovery from Time Series. In KDD (Vol. 98, No. 1, pp. 16-22).
6. Deng, Y., Bao, F., Kong, Y., Ren, Z., & Dai, Q. (2016). Deep direct reinforcement learning for financial signal representation and trading. IEEE transactions on neural networks and learning systems28(3), 653-664.
7. Esmaeili, Z., Abbasi, E., Fallahshams, M. (2018). Prediction of initial public offering short-term performance using nearest neighbor and support vector machine models. ـJournal of Financial Management Perspective, 8(21), 9-27. (In Persian)
8. Ganz, F., Puschmann, D., Barnaghi, P., & Carrez, F. (2015). A practical evaluation of information processing and abstraction techniques for the internet of things. IEEE Internet of Things journal, 2(4), 340-354.
9. Gudelek, M. U., Boluk, S. A., & Ozbayoglu, A. M. (2017, November). A deep learning based stock trading model with 2-D CNN trend detection. In 2017 IEEE Symposium Series on Computational Intelligence (SSCI) (pp. 1-8). IEEE.
10. Kalchbrenner, N., Grefenstette, E., & Blunsom, P. (2014). A convolutional neural network for modelling sentences. arXiv preprint arXiv:1404.2188.
11. Karpathy, A., Toderici, G., Shetty, S., Leung, T., Sukthankar, R., & Fei-Fei, L. (2014). Large-scale video classification with convolutional neural networks. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition (pp. 1725-1732).
12. Kalaitzakis, K., Stavrakakis, G. S., & Anagnostakis, E. M. (2002). Short-term load forecasting based on artificial neural networks parallel implementation. Electric Power Systems Research63(3), 185-196.
13. Kim, T., & Kim, H. Y. (2019). Forecasting stock prices with a feature fusion LSTM-CNN model using different representations of the same data. PloS one14(2), e0212320.
14. Kim, Y. (2014). Convolutional neural networks for sentence classification. arXiv preprint arXiv:1408.5882.
15. Krizhevsky, A., Sutskever, I., & Hinton, G. E. (2012). Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems (pp. 1097-1105).
16. Kuo, S. C., Li, S. T., Cheng, Y. C., & Ho, M. H. (2004, December). Knowledge discovery with SOM networks in financial investment strategy. In Fourth International Conference on Hybrid Intelligent Systems (HIS'04) (pp. 98-103). IEEE.
17. Pakbaz, M., Davari, M., & Balgourian, M. (2018). Investigating the predictive power of information content of accounting profit announcement by technical analysis signals. Journal of  Financial Management Perspective, 20(4), 115-131. (In Persian)
18. Ramoni, M., Sebastiani, P., & Cohen, P. (2002). Bayesian clustering by dynamics. Machine learning, 47(1), 91-121.
19. Ratner, M., & Leal, R. P. (1999). Tests of technical trading strategies in the emerging equity markets of Latin America and Asia. Journal of Banking & Finance, 23(12), 1887-1905.
20. Sezer, O. B., & Ozbayoglu, A. M. (2018). Algorithmic financial trading with deep convolutional neural networks: Time series to image conversion approach. Applied Soft Computing70, 525-538.
21. Sezer, O. B., & Ozbayoglu, A. M. (2019). Financial trading model with stock bar chart image time series with deep convolutional neural networks. arXiv preprint arXiv:1903.04610.
22. Shen, F., Chao, J., & Zhao, J. (2015). Forecasting exchange rate using deep belief networks and conjugate gradient method. Neurocomputing167, 243-253.
23. Sweeney, R. J. (1988). Some new filter rule tests: Methods and results. Journal of Financial and Quantitative Analysis, 285-300.
24. Wen, Y., & Yuan, B. (2018, March). Use CNN-LSTM network to analyze secondary market data. In Proceedings of the 2nd International Conference on Innovation in Artificial Intelligence ,pp. 54-58.