Document Type : Research Article

Authors

1 Financial engineering Ph.D. Candidate, Department of Financial Management, Qazvin Branch, Islamic Azad University, Qazvin, Iran

2 Assistant Professor, Department of Financial Management, Qazvin Branch, Islamic Azad University, Qazvin, Iran

3 Associate Professor, Department of management, faculty of social sciences and economics, ALzahra University,Tehran, Iran

Abstract

The purpose of the present research is to use machine learning models to predict the price of Bitcoin, representing the cryptocurrency market. The price prediction model can be considered as the most important component in algorithmic trading. The performance of machine learning and its models, due to the nature of price behavior in financial markets, have been reported to be well in studies. In this respect, measuring and comparing the accuracy and precision of random forest (RF), long-short-term memory (LSTM), and recurrent neural network (RNN) models in predicting the top and bottom of Bitcoin prices are the main objectives of the present study. The approach to predicting top and bottom prices using machine learning models can be considered as the innovative aspect of this research, while many studies seek to predict prices as time series, simple, or logarithmic price returns. Pricing top and bottom data as target variables and technical analysis indicators as feature variables in the 1-hour time frame from 1/1/2018 to 6/31/2022 served as input to the mentioned models for learning. Validation and testing are presented and used. 70% of the data are considered learning data, 20% as validation data, and the remaining 10% as test data. The result of this research shows over 80% accuracy in predicting the top and bottom Bitcoin price, and the random forest model’s prediction is more accurate than the LSTM and RNN models.

Keywords

[1] Aghakhani, K. & Karimi (2013). Investigating stock price prediction methods in the stock market and introducing the optimal method. Paper presented at The National Electronic Conference on New Achievements in Engineering and Basic Sciences, Ardabil, Iran.
[2] Bashiri & Paryab (2019). Bitcoin price prediction using machine learning algorithms, Applied Economics Quarterly, 10(34,35), 1-13.
[3] Tehrani & Esmaili, (2013). Investigating the impact of using important indicators of technical analysis on the short-term returns of investors in the Tehran Stock Exchange, Financial Knowledge of Securities Analysis (Financial Studies), 5(13), 21-33.
[4] Shirzor Aliabadi, Z. & Ramzanzadeh, H. (2019). Bitcoin and prediction of its future. Paper presented at the 6th International Conference on Industrial and Systems Engineering, Mashhad, Iran.
[5] Abdi, N., Delara, Ch. & Daneshjoo, P. (2018). Bitcoin price prediction using LSTM neural network. Paper presented at 9th National Conference on Computer Science and Engineering and Information Technology, Babol, Iran.
[6] Moshari M., Didekhani H., Khalili Damghani, K. & Abbasi, E. (2018). Designing a hybrid intelligent model to predict the golden points of stock prices, Investment Science Quarterly, 8(29), 45-65.
[7] Mohammadi Alamouti M., Haddadi M. & Nademi Y. (2017). Modeling and evaluation of prediction of different models of short-term memory, long-term memory, Markov switching, and hyperbolic Garch in predicting OPEC crude oil price  uctuations, Financial Engineering and Securities Management Quarterly, 9 (34), 249-272.
[8] Mousavi, S. O. (2018). Algorithmic trading technology: New solutions in Iran's stock market, Challenge Publications.
[9] Abbasi Ebrahim, Samavi Mohammad Ebrahim, Koosha Emad,(2020), Performance Evaluation Of The Technical Analysis Indicators In Comparison With The Buy And Hold Strategy In Tehran Stock Exchange Indices, ADVANCES IN MATHEMATICAL FINANCE AND APPLICATIONS , vol 5, no 3, pp 285 to 301.
[10] Basak, Suryoday & Kar, Saibal & Saha, Snehanshu & Khaidem, Luckyson & Dey, Sudeepa. (2018). Predicting the direction of stock market prices using tree-based classi ers. The North American Journal of Economics and Finance. 47.10.1016/j.najef.2018.06.013.
[11] Asquith, p., Mikhail, M.B., Au, A. S. (2005). Information content of equity analyst reports. Journal of Financial Economics, 75, 245-282.
[12] Avramov, D., Chordia, T., Goyal, A. (2006). Liquidity and autocorrelations in individual stock returns. Journal of Finance, 61(5), 2365-2394.
[13] Basuki, K. (2019). No Title No Title. ISSN 2502-3632 (Online) ISSN 2356-0304 (Paper) Jurnal Online Internasional & Nasional Vol. 7 No.1, Januari -Juni 2019 Universitas 17 Agustus 1945 Jakarta, 53(9), 1689-1699. www.journal.uta45jakarta.ac.id
[14] Booth, A., Gerding, E., & McGroarty, F. (2014). Automated trading with performance weighted random forests and seasonality. Expert Systems with Applications, 41(8), 3651-3661. https://doi.org/10.1016/j.eswa.2013.12.009
[15] Borges, T. A., & Neves, R. F. (2020). Ensemble of machine learning algorithms for cryptocurrency investment with different data resampling methods. Applied Soft Computing Journal,90, 106187. https://doi.org/10.1016/j.asoc.2020.106187
[16] Chopra, N., Lakonishok, J., Ritter, J. R. (1992). Measuring abnormal performance: do stocks overreact? Journal of Financial Economics, 31(2), 235-268.
[17] Ciner, C. (2019). Do industry returns predict the stock market? A reprise using the random forest. Quarterly Review of Economics and Finance, 72, 152-158. https://doi.org/10.1016/j.qref.2018.11.001
[18] Cooper, M. (1999). Filter rules based on price and volume in individual security overreaction. Review of Financial Studies, 12(4), 901-935.
[19] Da, Z., Liu, Q., Schamburg, E. (2013). A closer look at the short-term return reversal. Management Science, 60(3), 658-674.
[20] Fama, E. . (1991). Efficien capital markets. Journal of Finance, 46(5), 1575-1617.
[21] Fischer, T., & Krauss, C. (2018). Deep learning with long short-term memory networks for nancial market predictions. European Journal of Operational Research, 270(2), 654-669. https://doi.org/10.1016/j.ejor.2017.11.054
[22] Creamer, German. (2004). Predicting Performance and Quantifying Corporate Governance Risk for Latin American Adrs and Banks. Proceedings of the Second IASTED International Conference on Financial Engineering and Applications.
[23] Ghosh, P., Neufeld, A., & Sahoo, J. K. (2021). Forecasting directional movements of stock  prices for intraday trading using LSTM and random forests. Finance Research Letters, June 2020, 102280. https://doi.org/10.1016/j.frl.2021.102280.
[24] Hu, G., Ye, Y., Zhang, Y., & Hossain, M. S. (2019). Improved recurrent neural networks (RNN) based intelligent fund transaction model. 2019 IEEE Globecom Workshops, GC Wkshps 2019 - Proceedings. https://doi.org/10.1109/GCWkshps45667.2019.9024476
[25] Lariviere, Bart & Van den Poel, Dirk. (2005). Predicting Customer Retention and Profitability by Using Random Forests and Regression Forests Techniques. Expert Systems with Applications. 29. 472-484. 10.1016/j.eswa.2005.04.043.
[26] Jiang, G.J., Oomen, R. C. (2008). Testing for jumps when asset prices are observed with noise a awap variance approach. Journal of Econometrics, 144(2), 352-370.
[27] Jiang, G. J., & Zhu, K. X. (2017). Information Shocks and Short-Term Market Underreaction. Journal of Financial Economics, 124(1), 43-64.
[28] Khare, Kaustubh & Gupta, Prafull & Attar, Vahida. (2017). Short term stock price prediction using deep learning. 482-486. 10.1109/RTEICT.2017.8256643.
[29] Kim, M. (2021). Adaptive trading system integrating machine learning and back-testing: Korean bond market case. Expert Systems with Applications, 176(December 2020), 114767.
[30] Krauss, C., Do, X. A., & Huck, N. (2017). Deep neural networks, gradient-boosted trees, random forests: Statistical arbitrage on the S&P 500. European Journal of Operational Research, 259(2), 689-702. 
[31] Riemann Ruiz-Cruz, (2018), Portfolio modeling for an algorithmic trading based on control theory, IFAC PapersOnline, 390-395.
[32] Robert Kissell, (2014), The science of Algorithmic Trading and Portfolio Management
[33] Lohrmann, C., & Luukka, P. (2019). Classi cation of intraday S&P500 returns with a Random Forest. International Journal of Forecasting, 35(1), 390-407. https://doi.org/10.1016/j.ijforecast.2018.08.004
[34] Ma, C., Zhang, J., Liu, J., Ji, L., & Gao, F. (2021). A parallel multi-module deep reinforcement learning algorithm for stock trading. Neurocomputing, 449, 290-302. https://doi.org/10.1016/j.neucom.2021.04.005
[35] Ma, Y., Han, R., & Wang, W. (2021). Portfolio optimization with return prediction using deep learning and machine learning. Expert Systems with Applications, 165(June 2020),113973https://doi.org/10.1016/j.eswa.2020.113973
[36] Maragoudakis, Manolis & Serpanos, Dimitrios. (2010). Towards Stock Market Data Mining Using Enriched Random Forests from Textual Resources and Technical Indicators. IFIP Advances in Information and Communication Technology. 339. 278-286. 10.1007/978-3-642-16239-8 37.
[37] Moritz, Benjamin & Zimmermann, Tom. (2016). Tree-Based Conditional Portfolio Sorts: The Relation between Past and Future Stock Returns. SSRN Electronic Journal.10.2139/ssrn.2740751.
[38] M, Hiransha & Gopalakrishnan, E. A & Menon, Vijay & Kp, Soman. (2018). NSE Stock Market Prediction Using Deep-Learning Models. Procedia Computer Science. 132. 1351-1362.10.1016/j.procs.2018.05.050.
[39] M.S. Islam, E. Hossain,(2021) ,Foreign exchange currency rate prediction using a GRU-LSTM hybrid network, Soft Computing Letters, Volume 3,100009,ISSN 2666-2221.
[40] Nti, I. K., Adekoya, A. F., &Weyori, B. A. (2019). Random Forest Based Feature Selection of Macroeconomic Variables for Stock Market Prediction. American Journal of Applied Sciences,16(7),200212.https://doi.org/10.3844/ajassp.2019.200.212
[41] Paiva, F. D., Cardoso, R. T. N., Hanaoka, G. P., & Duarte, W. M. (2019). Decision-making for  nancial trading: A fusion approach of machine learning and portfolio selection. Expert Systems with Applications, 115, 635-655. https://doi.org/10.1016/j.eswa.2018.08.003
[42] Perry Sadorsky, 2021, A Random Forests Approach to Predicting Clean Energy Stock Prices, JRFM, 2021, vol. 14, issue 2, 1-20.
[43] Sang, C., & Di Pierro, M. (2019). Improving trading technical analysis with TensorFlow Long Short-Term Memory (LSTM) Neural Network. Journal of Finance and Data Science,5(1), 1-11. https://doi.org/10.1016/j.jfds.2018.10.003
[44] Saud, A. S., & Shakya, S. (2020). Analysis of look back period for stock price prediction with RNN variants: A case study on banking sector of NEPSE. Procedia Computer Science, 167(2019), 788-798. https://doi.org/10.1016/j.procs.2020.03.419
[45] Selvin, S., Vinayakumar, R., Gopalakrishnan, E. A., Menon, V. K., & Soman, K. P. (2017). Stock price prediction using LSTM, RNN and CNN-sliding window model. 2017 International Conference on Advances in Computing, Communications and Informatics, ICACCI 2017, 2017-Janua, 1643-1647. https://doi.org/10.1109/ICACCI.2017.8126078
[46] Sima Siami-Namini, Akbar Siami Namin, (2018), Forecasting Economics and Financial Time Series: ARIMA vs. LSTM, Cornel University,.
[47] Speiser, J. L., Miller, M. E., Tooze, J., & Ip, E. (2019). A comparison of random forest variable selection methods for classi cation prediction modeling. Expert Systems with Applications, 134, 93-101. https://doi.org/10.1016/j.eswa.2019.05.028
[48] Tan, Z., Yan, Z., & Zhu, G. (2019). Stock selection with random forest: An exploitation of excess return in the Chinese stock market. Heliyon, 5(8), e02310. https://doi.org/10.1016/j.heliyon.2019.e02310
[49] Thakur, M., & Kumar, D. (2018). A hybrid  nancial trading support system using multicategory classi ers and random forest. Applied Soft Computing Journal, 67, 337-349. https://doi.org/10.1016/j.asoc.2018.03.006
[50] Wang, W., Li, W., Zhang, N., & Liu, K. (2020). Portfolio formation with preselection using deep learning from long-term  nancial data. Expert Systems with Applications, 143, 113042.
[51] Yun, H., Lee, M., Kang, Y. S., & Seok, J. (2020). Portfolio management via two-stage deep learning with a joint cost. Expert Systems with Applications, 143, 113041. https://doi.org/10.1016/j.eswa.2019.113041