Optimizing Investment: Combining Deep Learning for Price Prediction and Moving Average for Return-Risk Analysis

Widi Hastomo(1), Adhitio Satyo Bayangkari Karno(2), Masriyanda Masriyanda(3), Ellya Sestri(4), Aqwam Rosadi Kardian(5), Nur Azis(6), Ignatius Joko Dewanto(7), Ahmad Rasyiddin(8), Aries Sundoro(9), Nada Kamilia(10),


(1) Ahmad Dahlan Institute of Technology and Business
(2) Gunadarma University
(3) Ahmad Dahlan Institute of Technology and Business
(4) Ahmad Dahlan Institute of Technology and Business
(5) STMIK Jakarta STI&K
(6) Tangerang Raya University
(7) Tangerang Raya University
(8) Tangerang Raya University
(9) Tangerang Raya University
(10) STMIK Jakarta STI&K

Abstract

The ability to analyze predictions marks something going up or down, as well as the level of possible risk taken into account by much-needed stock investors. In a study, this analysis of risk and correlation between shares was calculated using the method of moving averages (MA). Besides that, a dataset of 4 stocks (Apple, Google, Microsoft, and Amazon) also performed prediction mark stock in period time next (future) with the use of the neural network method (deep learning) Long Short-Term Memory (LSTM) model. The result of programming in the Python language is several visualizations for easy graph-reading information. This article presents new research that aims to fill the gap in understanding investment analysis for beginners by visualizing risk and return analysis on shares. The results reveal that changes in stock sales volume did not occur significantly, although the short and long-term MA charts for the four stocks tended to fluctuate, offering new insights into investment analysis and providing a basis for future development. The best accuracy results were on MSFT shares, with an achievement of 0.9532 and a loss value of 0.0014. Thus, MSFT shares can be used as a priority for investment. Therefore, this research adds a new dimension to the literature and paves the way for further investigations in risk and return analysis and stock prediction using deep learning.

Keywords

correlation; LSTM; return; risk; prediction

Full Text:

PDF

References

F. A. F. de S. Cunha, E. M. de Oliveira, R. J. Orsato, M. C. Klotzle, F. L. Cyrino Oliveira, and R. G. G. Caiado, “Can sustainable investments outperform traditional benchmarks? Evidence from global stock markets,” Bus. Strateg. Environ., vol. 29, no. 2, pp. 682–697, Feb. 2020, doi: https://doi.org/10.1002/bse.2397.

K. N. Badhani, A. Kumar, X. V. Vo, and M. Tayde, “Do institutional investors perform better in emerging markets?,” Int. Rev. Econ. Financ., vol. 86, pp. 1041–1056, 2023, doi: https://doi.org/10.1016/j.iref.2022.01.003.

M. Ahmad, “Does underconfidence matter in short-term and long-term investment decisions? Evidence from an emerging market,” Manag. Decis., vol. 59, no. 3, pp. 692–709, Jan. 2021, doi: 10.1108/MD-07-2019-0972.

A. Simpson and A. Tamayo, “Real effects of financial reporting and disclosure on innovation,” Account. Bus. Res., vol. 50, no. 5, pp. 401–421, Jul. 2020, doi: 10.1080/00014788.2020.1770926.

J. Bae, X. Yang, and M.-I. Kim, “ESG and Stock Price Crash Risk: Role of Financial Constraints*,” Asia-Pacific J. Financ. Stud., vol. 50, no. 5, pp. 556–581, Oct. 2021, doi: https://doi.org/10.1111/ajfs.12351.

W. Khan, M. A. Ghazanfar, M. A. Azam, A. Karami, K. H. Alyoubi, and A. S. Alfakeeh, “Stock market prediction using machine learning classifiers and social media, news,” J. Ambient Intell. Humaniz. Comput., vol. 13, no. 7, pp. 3433–3456, 2022, doi: 10.1007/s12652-020-01839-w.

Z. Zhou, M. Gao, Q. Liu, and H. Xiao, “Forecasting stock price movements with multiple data sources: Evidence from stock market in China,” Phys. A Stat. Mech. its Appl., vol. 542, p. 123389, 2020, doi: https://doi.org/10.1016/j.physa.2019.123389.

J. Long, Z. Chen, W. He, T. Wu, and J. Ren, “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., vol. 91, p. 106205, 2020, doi: https://doi.org/10.1016/j.asoc.2020.106205.

T. N. T. Phan, P. Bertrand, H. H. Phan, and X. V. Vo, “The role of investor behavior in emerging stock markets: Evidence from Vietnam,” Q. Rev. Econ. Financ., vol. 87, pp. 367–376, 2023, doi: https://doi.org/10.1016/j.qref.2021.07.001.

S. Parveen, Z. W. Satti, Q. A. Subhan, N. Riaz, S. F. Baber, and T. Bashir, “Examining investors’ sentiments, behavioral biases and investment decisions during COVID-19 in the emerging stock market: a case of Pakistan stock market,” J. Econ. Adm. Sci., vol. 39, no. 3, pp. 549–570, Jan. 2023, doi: 10.1108/JEAS-08-2020-0153.

J. H. Block, A. Groh, L. Hornuf, T. Vanacker, and S. Vismara, “The entrepreneurial finance markets of the future: a comparison of crowdfunding and initial coin offerings,” Small Bus. Econ., vol. 57, no. 2, pp. 865–882, 2021, doi: 10.1007/s11187-020-00330-2.

M. Hasan and R. Hendrawan, “Metal and Mineral Mining Firm’s Equity Valuation in Indonesia Stock Exchange,” no. January 2019, pp. 662–673, 2020, doi: 10.5220/0008435106620673.

Q. Zhu, X. Zhou, and S. Liu, “High return and low risk: Shaping composite financial investment decision in the new energy stock market,” Energy Econ., vol. 122, p. 106683, 2023, doi: https://doi.org/10.1016/j.eneco.2023.106683.

A. K. Sandhu, “Big data with cloud computing: Discussions and challenges,” Big Data Min. Anal., vol. 5, no. 1, pp. 32–40, 2022, doi: 10.26599/BDMA.2021.9020016.

D. Yu, D. Huang, and L. Chen, “Stock return predictability and cyclical movements in valuation ratios,” J. Empir. Financ., vol. 72, pp. 36–53, 2023, doi: https://doi.org/10.1016/j.jempfin.2023.02.004.

S. K. Jauhar, S. M. Jani, S. S. Kamble, S. Pratap, A. Belhadi, and S. Gupta, “How to use no-code artificial intelligence to predict and minimize the inventory distortions for resilient supply chains,” Int. J. Prod. Res., vol. 61, no. 4, pp. 1–25, Jan. 2023, doi: 10.1080/00207543.2023.2166139.

T. Fischer and C. Krauss, “Deep learning with long short-term memory networks for financial market predictions,” Eur. J. Oper. Res., vol. 270, no. 2, pp. 654–669, 2018, doi: https://doi.org/10.1016/j.ejor.2017.11.054.

P. Yu and X. Yan, “Stock price prediction based on deep neural networks,” Neural Comput. Appl., vol. 32, no. 6, pp. 1609–1628, 2020, doi: 10.1007/s00521-019-04212-x.

Y. Zhang, B. Yan, and M. Aasma, “A novel deep learning framework: Prediction and analysis of financial time series using CEEMD and LSTM,” Expert Syst. Appl., vol. 159, p. 113609, 2020, doi: https://doi.org/10.1016/j.eswa.2020.113609.

M. Nabipour, P. Nayyeri, H. Jabani, S. S., and A. Mosavi, “Predicting Stock Market Trends Using Machine Learning and Deep Learning Algorithms Via Continuous and Binary Data; a Comparative Analysis,” IEEE Access, vol. 8, pp. 150199–150212, 2020, doi: 10.1109/ACCESS.2020.3015966.

L. Tian, L. Feng, L. Yang, and Y. Guo, “Stock price prediction based on LSTM and LightGBM hybrid model,” J. Supercomput., vol. 78, no. 9, pp. 11768–11793, 2022, doi: 10.1007/s11227-022-04326-5.

A. A. Oyedele, A. O. Ajayi, L. O. Oyedele, S. A. Bello, and K. O. Jimoh, “Performance evaluation of deep learning and boosted trees for cryptocurrency closing price prediction,” Expert Syst. Appl., vol. 213, p. 119233, 2023, doi: https://doi.org/10.1016/j.eswa.2022.119233.

C. Zhao et al., “Progress and prospects of data-driven stock price forecasting research,” Int. J. Cogn. Comput. Eng., vol. 4, pp. 100–108, 2023, doi: https://doi.org/10.1016/j.ijcce.2023.03.001.

S. Pan, S. Long, Y. Wang, and Y. Xie, “Nonlinear asset pricing in Chinese stock market: A deep learning approach,” Int. Rev. Financ. Anal., vol. 87, p. 102627, 2023, doi: https://doi.org/10.1016/j.irfa.2023.102627.

B. Gülmez, “Stock price prediction with optimized deep LSTM network with artificial rabbits optimization algorithm,” Expert Syst. Appl., vol. 227, p. 120346, 2023, doi: https://doi.org/10.1016/j.eswa.2023.120346.

N. Hajli, F. Shirazi, M. Tajvidi, and N. Huda, “Towards an Understanding of Privacy Management Architecture in Big Data: An Experimental Research,” Br. J. Manag., vol. 32, no. 2, pp. 548–565, Apr. 2021, doi: https://doi.org/10.1111/1467-8551.12427.

A. Gautier and J. Lamesch, “Mergers in the digital economy,” Inf. Econ. Policy, vol. 54, p. 100890, 2021, doi: https://doi.org/10.1016/j.infoecopol.2020.100890.

T. Mirrlees, “GAFAM and Hate Content Moderation: Deplatforming and Deleting the Alt-right,” in Media and Law: Between Free Speech and Censorship, vol. 26, M. Deflem and D. M. D. Silva, Eds. Emerald Publishing Limited, 2021, pp. 81–97. doi: 10.1108/S1521-613620210000026006.

A. K. Bitto et al., “CryptoAR: scrutinizing the trend and market of cryptocurrency using machine learning approach on time series data,” Indones. J. Electr. Eng. Comput. Sci., vol. 28, no. 3, pp. 1684–1696, 2022, doi: 10.11591/ijeecs.v28.i3.pp1684-1696.

J. Siswantoro, A. S. Prabuwono, A. Abdullah, and B. Idrus, “A linear model based on Kalman filter for improving neural network classification performance,” Expert Syst. Appl., vol. 49, pp. 112–122, 2016, doi: https://doi.org/10.1016/j.eswa.2015.12.012.

M. Xia, X. Zheng, M. Imran, and M. Shoaib, “Data-driven prognosis method using hybrid deep recurrent neural network,” Appl. Soft Comput., vol. 93, p. 106351, 2020, doi: https://doi.org/10.1016/j.asoc.2020.106351.

C. Dyer, M. Ballesteros, W. Ling, A. Matthews, and N. A. Smith, “Transition-based dependency parsing with stack long short-term memory,” ACL-IJCNLP 2015 - 53rd Annu. Meet. Assoc. Comput. Linguist. 7th Int. Jt. Conf. Nat. Lang. Process. Asian Fed. Nat. Lang. Process. Proc. Conf., vol. 1, pp. 334–343, 2015, doi: 10.3115/v1/p15-1033.

Y. Su and C.-C. J. Kuo, “On extended long short-term memory and dependent bidirectional recurrent neural network,” Neurocomputing, vol. 356, pp. 151–161, 2019, doi: https://doi.org/10.1016/j.neucom.2019.04.044.

W. Hastomo and A. Satyo, “Kemampuan Long Short Term Memory Machine,” vol. 4, no. September, pp. 229–236, 2020.

W. Hastomo, A. S. Bayangkari Karno, N. Kalbuana, A. Meiriki, and Sutarno, “Characteristic Parameters of Epoch Deep Learning to Predict Covid-19 Data in Indonesia,” J. Phys. Conf. Ser., vol. 1933, no. 1, 2021, doi: 10.1088/1742-6596/1933/1/012050.

J. Lee and J. Kang, “Effectively training neural networks for stock index prediction: Predicting the S&P 500 index without using its index data,” PLoS One, vol. 15, no. 4, p. e0230635, Apr. 2020, [Online]. Available: https://doi.org/10.1371/journal.pone.0230635

A. Fazeli and S. Houghten, “Deep Learning for the Prediction of Stock Market Trends,” Proc. - 2019 IEEE Int. Conf. Big Data, Big Data 2019, pp. 5513–5521, 2019, doi: 10.1109/BigData47090.2019.9005523.

R. Anusha*, B. Lakshmi, T. Mounika, and S. Kankanala, “Deep Stock Prediction,” Int. J. Recent Technol. Eng., vol. 8, no. 4, pp. 2555–2558, 2019, doi: 10.35940/ijrte.d7182.118419.

S. Mohapatra, R. Mukherjee, A. Roy, A. Sengupta, and A. Puniyani, “Can Ensemble Machine Learning Methods Predict Stock Returns for Indian Banks Using Technical Indicators?,” J. Risk Financ. Manag., vol. 15, no. 8, 2022, doi: 10.3390/jrfm15080350.

A. Sachdeva, G. Jethwani, C. Manjunath, M. Balamurugan, and A. V. N. Krishna, “An Effective Time Series Analysis for Equity Market Prediction Using Deep Learning Model,” 2019 Int. Conf. Data Sci. Commun. IconDSC 2019, no. March, pp. 1–5, 2019, doi: 10.1109/IconDSC.2019.8817035.

Refbacks

  • There are currently no refbacks.