Research Article
BibTex RIS Cite

Makine Öğrenmesi Algoritmalarıyla Hisse Senedi Kapanış Fiyat Tahmini: BIST’te Yer Alan PETKM Hisse Senedi Örneği

Year 2023, , 958 - 976, 30.04.2023
https://doi.org/10.29130/dubited.1096767

Abstract

Bu çalışmada Borsa İstanbul’da (BİST) yer alan Petkim Petrokimya Holding A.Ş.’nin (PETKM) hisse senedi fiyatından, Dolar (USD/TRY) fiyatından ve BİST Kimyasal, Petrol & Plastik (XKMYA) indeks fiyatından yararlanılarak, PETKM hisse senedi fiyatının tahmin edildiği üç girdili ve bir çıktılı bir zaman serisi veri seti oluşturulmuştur. Zaman serisi modelleri için Random Forest Regression (RFR), Long-Short Term Memory (LSTM) ve Convolutional Neural Network (CNN) algoritmalarının ayrı ayrı çalışmalarda başarılı sonuçlar elde ettikleri görüldüğünden hisse senedi fiyatının tahmini için bu üç algoritma kullanılmıştır. Literatürde belirtilen kapsamda bu üç yöntemin karşılaştırıldığı bir çalışmaya rastlanmamıştır. Algoritmaların başarısı, genellikle bu tür çalışmalarda kullanılan MSE, RMSE ve MAE olmak üzere üç hata metrik değerleriyle ve R2 değeriyle karşılaştırılmıştır. Hesaplanan hata metriklerine göre LSTM ve RFR algoritmalarında MSE değeri 0.02’den küçük olup CNN’den daha başarılı sonuçlar vermesine rağmen R2 değerlerinin %95’te büyük olmasıyla her üç algoritmadan oluşturulan en başarılı modellerin bu veri setinin tahmininde kullanılabileceği görülmüştür.

References

  • J. C. Jackson, J. Prassanna, Md. Abdul Quadir and V. Sivakumar, “Stock Market Analysis and Prediction using time series analysis,” Materials Today: Proceedings, 2021.
  • W. Chen, H. Zhang, M. K. Mehlawat and L. Jia, “Mean-Variance Portfolio Optmization Using Machine Learning-Based Stock Price Prediction,” Applies Soft Computing Journal, vol 100, 2021.
  • S. Carta, A. Ferreira, A. S. Poddo, D. R. Recupero and A. Sanna, “Multi-DQN: An Ensemble of Deep Q-Learning Agents for Stock Market Forcasting,” Expert Systems with Applications, vol 164, 2021.
  • S. Arslankaya and Ş. Toprak, “Makine Öğrenmesi ve Derin Öğrenme Algoritmalarını Kullanarak Hisse Senedi Fiyat Tahmini,” Uluslararası Mühendislik Araştırma ve Geliştirme Dergisi vol. 13, no. 1, pp. 178-192, 2021.
  • D. Wei, "Prediction of Stock Price Based on LSTM Neural Network," 2019 International Conference on Artificial Intelligence and Advanced Manufacturing (AIAM), 2019, pp. 544-547, doi: 10.1109/AIAM48774.2019.00113.
  • Ş. Sakarya and Ü. Yılmaz, “Derin Öğrenme Mimarisi Kullanarak BİST30 İndeksinin Tahmini,” Europan Journal of Educational & Scocial Sciences, vol. 4, no. 2, pp. 106-121, 2019.
  • A. Ghosh, S. Bose, G. Maji, N. C. Debnath and S. Sen, “Stock Price Prediction Using LSTM on Indian Share Market,” Proceedings of 32nd ONternational Conference on Computer Applications in Industry and Engineering. EPiC Series in Computing, 2019, pp. 101-110, doi:10.29007/qgcz
  • Z. D. Akşehir and E. Kılıç, “Makine Öğrenmesi Teknikleri ile Banka Hisse Senetlerinin Fiyat Tahmini,” Türkiye Bilişim Vakfı Bilgisayar Bilimleri ve Mühendisliği Dergisi, vol. 12, no.2, pp. 30-39, 2019.
  • M. Hiransha, E. A. Gopalakrishnan, V. K. Menon and K. P. Soman, “NSE Stock Market Prediction Using Deep-Learning Models,” Procedia Computer Science, vol. 132, pp. 1351-1362, 2018.
  • W. K. Liu, and M. K. P. So, “A GARCH Model with Artificial Neural Networks,” Information, vol. 11, no. 10, 2020.
  • M. Vijh, D. Chandola, V. A. Tikkiwal and A. Kumar, “Stock Closing Price Prediction using Machine Learning Techniques,” Procedia Computer Science, vol. 167, pp. 599-606, 2020.
  • Z. Tan, Z. Yan and G. Zhu, “Stock Selection with Forest: An Exploitation of Excess Return in the Chinese Stock Market,” Heliyon, vol. 5 no. 8, 2019.
  • K. Kaczmarczyk and M. Hernes, “Financial Decision Support Using the Supervised Learning Method Based on Random Forests,” Procedia Computer Science, vol. 176, pp. 2802-2811, 2020.
  • C. Ciner, “Do industry returns predict the stock market? A reprise using the random forest,” The Quarterly Review of Economics and Finance, vol. 72, 2018.
  • G. Şişmanoğlu , F. Koçer , M. A. Önde and O. K. Sahingoz , "Derin Öğrenme Yöntemleri ile Borsada Fiyat Tahmini", Bitlis Eren Üniversitesi Fen Bilimleri Dergisi, c. 9, sayı. 1, ss. 434-445, Mar. 2020, doi:10.17798/bitlisfen.571386
  • M. A. Ozbayoglu, M. U. Gudelek and O. B. Sezer, “Deep Learning for Financial Applications: A Survey.” Applied Soft Computing Journal, vol. 93, 2020.
  • A. Subasi, “Chapter 3 - Machine learning techniques,” in Practical Machine Learning for Data Analysis Using Python, 2020. 91-202.
  • S. Jain and M. Kain, “Prediction for Stock Marketing Using Machine Learning,” International Journal on Recent and Innovation Trends in Computing and Communication, vol. 6, no. 4, pp. 131-135, 2018.
  • P. Wang, T. Jiang, G. Fan and C. Dan, “Prediction of Torpedo Initial Velocity Based on Random Forests Regression,” 2015 7th Intenational Conference on Intelligent Human-Machine Systems and Cybernetics, 2015, vol. 1, pp 337-339.
  • G. Li, M. Xiao and Y. Guo, “Application of Deep Learning in Stock Market Valuation Index Forecasting,” 2019 IEEE 10th International Conference on Software Engineering and Service Science (ICSESS), 2019, pp. 551-554.
  • A. İ. Taş , P. Gülüm and G. Tulum , "Finansal Piyasalarda Hisse Fiyatlarının Derin Öğrenme ve Yapay Sinir Ağı Yöntemleri ile Tahmin Edilmesi; S&P 500 Endeksi Örneği", Düzce Üniversitesi Bilim ve Teknoloji Dergisi, c. 9, sayı. 3, ss. 446-460, May. 2021, doi:10.29130/dubited.820620
  • Ö. Çetin and A. H. Isık , "Monthly Electricity Generatıon Forecast in Solar Power Plants with LSTM", Düzce Üniversitesi Bilim ve Teknoloji Dergisi, c. 9, sayı. 6, ss. 55-64, Ara. 2021, doi:10.29130/dubited.1015251
  • P. Ahire, H. Lad, S. Parekh and S. Kabrawala, “LSTM Based Stock Price Prediction,” International Journal of Creative Research Thoughts, vol. 9 no. 2, pp. 5118-5122, 2021.
  • S. Kumar and D. Ningombam, "Short-Term Forecasting of Stock Prices Using Long Short Term Memory," 2018 International Conference on Information Technology (ICIT), 2018, pp. 182-186, doi: 10.1109/ICIT.2018.00046.
  • D. Reddy, H. Babu, K. Reddy and Y. Saileela, “Stock Market Analysis using LSTM in Deep Learning,” International Journal of Engineering and Technical Research, vol. V9, 2020.
  • U. Demirel, H. Çam and R. Ünlü, “Predicting Stock Prices Using Machine Learning Methods and Deep Learning Algorithms: The Sample of the Istanbul Stock Exchange,” Gazi University Journal of Science, vol. 34, pp. 63-82, 2021.
  • S. Mehtab, J. Sen and S. Dasgupta, "Robust Analysis of Stock Price Time Series Using CNN and LSTM-Based Deep Learning Models," 2020 4th International Conference on Electronics, Communication and Aerospace Technology (ICECA), 2020, pp. 1481-1486, doi: 10.1109/ICECA49313.2020.9297652.
  • A. Gilik, A. S. Ogrenci and A. Ozmen, “Air Quality Prediction Using A Hybrid Deep Learning Architecture,” Environmental Science and Pollution Research, vol. 29, pp. 11920-11938, 2022.
  • S. Mehtab and J, Sen, “Stock Price Prediction Using Convolutional Neural Network on a Multivariate Timeseries,” Proceedings of the 3rd National Conference on Machine Learning and Artificial Intelligence, New Delhi, INDIA, 2020.
  • O. B. Sezer, M. U. Gudelek and A. M. Ozbayoglu, “Financial time series forecasting with deep learning: A systematic literature review: 2005-2019,” Applied Soft Computing Journal, vol. 90, 2020.

Stock Closing Price Prediction with Machine Learning Algorithms: PETKM Stock Example In BIST

Year 2023, , 958 - 976, 30.04.2023
https://doi.org/10.29130/dubited.1096767

Abstract

This study predicts the stock price of Petkim Petrokimya Holding Corp. (PETKM), which is listed in Borsa Istanbul (BIST), using PETKM stock price, US dollar (USD/TRY) price and BIST Chemical, Petroleum & Plastic (XKMYA) index price. A time series data set with three inputs and one output is created using these data. Random Forest Regression (RFR), Long-Short Term Memory (LSTM), and Convolutional Neural Network (CNN) algorithms are used in the prediction model. The success of these methods is compared using performance metrics such as MSE, RMSE, MAE, and R2. According to the calculated error metrics, LSTM and RFR algorithms gave better results than CNN with an MSE value less than 0.02. However, the fact that the R2 values of the most successful models created with all three algorithms were greater than 95% revealed that all the algorithms mentioned could be used to estimate this data set.

References

  • J. C. Jackson, J. Prassanna, Md. Abdul Quadir and V. Sivakumar, “Stock Market Analysis and Prediction using time series analysis,” Materials Today: Proceedings, 2021.
  • W. Chen, H. Zhang, M. K. Mehlawat and L. Jia, “Mean-Variance Portfolio Optmization Using Machine Learning-Based Stock Price Prediction,” Applies Soft Computing Journal, vol 100, 2021.
  • S. Carta, A. Ferreira, A. S. Poddo, D. R. Recupero and A. Sanna, “Multi-DQN: An Ensemble of Deep Q-Learning Agents for Stock Market Forcasting,” Expert Systems with Applications, vol 164, 2021.
  • S. Arslankaya and Ş. Toprak, “Makine Öğrenmesi ve Derin Öğrenme Algoritmalarını Kullanarak Hisse Senedi Fiyat Tahmini,” Uluslararası Mühendislik Araştırma ve Geliştirme Dergisi vol. 13, no. 1, pp. 178-192, 2021.
  • D. Wei, "Prediction of Stock Price Based on LSTM Neural Network," 2019 International Conference on Artificial Intelligence and Advanced Manufacturing (AIAM), 2019, pp. 544-547, doi: 10.1109/AIAM48774.2019.00113.
  • Ş. Sakarya and Ü. Yılmaz, “Derin Öğrenme Mimarisi Kullanarak BİST30 İndeksinin Tahmini,” Europan Journal of Educational & Scocial Sciences, vol. 4, no. 2, pp. 106-121, 2019.
  • A. Ghosh, S. Bose, G. Maji, N. C. Debnath and S. Sen, “Stock Price Prediction Using LSTM on Indian Share Market,” Proceedings of 32nd ONternational Conference on Computer Applications in Industry and Engineering. EPiC Series in Computing, 2019, pp. 101-110, doi:10.29007/qgcz
  • Z. D. Akşehir and E. Kılıç, “Makine Öğrenmesi Teknikleri ile Banka Hisse Senetlerinin Fiyat Tahmini,” Türkiye Bilişim Vakfı Bilgisayar Bilimleri ve Mühendisliği Dergisi, vol. 12, no.2, pp. 30-39, 2019.
  • M. Hiransha, E. A. Gopalakrishnan, V. K. Menon and K. P. Soman, “NSE Stock Market Prediction Using Deep-Learning Models,” Procedia Computer Science, vol. 132, pp. 1351-1362, 2018.
  • W. K. Liu, and M. K. P. So, “A GARCH Model with Artificial Neural Networks,” Information, vol. 11, no. 10, 2020.
  • M. Vijh, D. Chandola, V. A. Tikkiwal and A. Kumar, “Stock Closing Price Prediction using Machine Learning Techniques,” Procedia Computer Science, vol. 167, pp. 599-606, 2020.
  • Z. Tan, Z. Yan and G. Zhu, “Stock Selection with Forest: An Exploitation of Excess Return in the Chinese Stock Market,” Heliyon, vol. 5 no. 8, 2019.
  • K. Kaczmarczyk and M. Hernes, “Financial Decision Support Using the Supervised Learning Method Based on Random Forests,” Procedia Computer Science, vol. 176, pp. 2802-2811, 2020.
  • C. Ciner, “Do industry returns predict the stock market? A reprise using the random forest,” The Quarterly Review of Economics and Finance, vol. 72, 2018.
  • G. Şişmanoğlu , F. Koçer , M. A. Önde and O. K. Sahingoz , "Derin Öğrenme Yöntemleri ile Borsada Fiyat Tahmini", Bitlis Eren Üniversitesi Fen Bilimleri Dergisi, c. 9, sayı. 1, ss. 434-445, Mar. 2020, doi:10.17798/bitlisfen.571386
  • M. A. Ozbayoglu, M. U. Gudelek and O. B. Sezer, “Deep Learning for Financial Applications: A Survey.” Applied Soft Computing Journal, vol. 93, 2020.
  • A. Subasi, “Chapter 3 - Machine learning techniques,” in Practical Machine Learning for Data Analysis Using Python, 2020. 91-202.
  • S. Jain and M. Kain, “Prediction for Stock Marketing Using Machine Learning,” International Journal on Recent and Innovation Trends in Computing and Communication, vol. 6, no. 4, pp. 131-135, 2018.
  • P. Wang, T. Jiang, G. Fan and C. Dan, “Prediction of Torpedo Initial Velocity Based on Random Forests Regression,” 2015 7th Intenational Conference on Intelligent Human-Machine Systems and Cybernetics, 2015, vol. 1, pp 337-339.
  • G. Li, M. Xiao and Y. Guo, “Application of Deep Learning in Stock Market Valuation Index Forecasting,” 2019 IEEE 10th International Conference on Software Engineering and Service Science (ICSESS), 2019, pp. 551-554.
  • A. İ. Taş , P. Gülüm and G. Tulum , "Finansal Piyasalarda Hisse Fiyatlarının Derin Öğrenme ve Yapay Sinir Ağı Yöntemleri ile Tahmin Edilmesi; S&P 500 Endeksi Örneği", Düzce Üniversitesi Bilim ve Teknoloji Dergisi, c. 9, sayı. 3, ss. 446-460, May. 2021, doi:10.29130/dubited.820620
  • Ö. Çetin and A. H. Isık , "Monthly Electricity Generatıon Forecast in Solar Power Plants with LSTM", Düzce Üniversitesi Bilim ve Teknoloji Dergisi, c. 9, sayı. 6, ss. 55-64, Ara. 2021, doi:10.29130/dubited.1015251
  • P. Ahire, H. Lad, S. Parekh and S. Kabrawala, “LSTM Based Stock Price Prediction,” International Journal of Creative Research Thoughts, vol. 9 no. 2, pp. 5118-5122, 2021.
  • S. Kumar and D. Ningombam, "Short-Term Forecasting of Stock Prices Using Long Short Term Memory," 2018 International Conference on Information Technology (ICIT), 2018, pp. 182-186, doi: 10.1109/ICIT.2018.00046.
  • D. Reddy, H. Babu, K. Reddy and Y. Saileela, “Stock Market Analysis using LSTM in Deep Learning,” International Journal of Engineering and Technical Research, vol. V9, 2020.
  • U. Demirel, H. Çam and R. Ünlü, “Predicting Stock Prices Using Machine Learning Methods and Deep Learning Algorithms: The Sample of the Istanbul Stock Exchange,” Gazi University Journal of Science, vol. 34, pp. 63-82, 2021.
  • S. Mehtab, J. Sen and S. Dasgupta, "Robust Analysis of Stock Price Time Series Using CNN and LSTM-Based Deep Learning Models," 2020 4th International Conference on Electronics, Communication and Aerospace Technology (ICECA), 2020, pp. 1481-1486, doi: 10.1109/ICECA49313.2020.9297652.
  • A. Gilik, A. S. Ogrenci and A. Ozmen, “Air Quality Prediction Using A Hybrid Deep Learning Architecture,” Environmental Science and Pollution Research, vol. 29, pp. 11920-11938, 2022.
  • S. Mehtab and J, Sen, “Stock Price Prediction Using Convolutional Neural Network on a Multivariate Timeseries,” Proceedings of the 3rd National Conference on Machine Learning and Artificial Intelligence, New Delhi, INDIA, 2020.
  • O. B. Sezer, M. U. Gudelek and A. M. Ozbayoglu, “Financial time series forecasting with deep learning: A systematic literature review: 2005-2019,” Applied Soft Computing Journal, vol. 90, 2020.
There are 30 citations in total.

Details

Primary Language English
Subjects Engineering
Journal Section Articles
Authors

Şevval Toprak 0000-0002-1344-2938

Gültekin Çağıl 0000-0001-8609-6178

Abdullah Hulusi Kökçam 0000-0002-4757-1594

Publication Date April 30, 2023
Published in Issue Year 2023

Cite

APA Toprak, Ş., Çağıl, G., & Kökçam, A. H. (2023). Stock Closing Price Prediction with Machine Learning Algorithms: PETKM Stock Example In BIST. Duzce University Journal of Science and Technology, 11(2), 958-976. https://doi.org/10.29130/dubited.1096767
AMA Toprak Ş, Çağıl G, Kökçam AH. Stock Closing Price Prediction with Machine Learning Algorithms: PETKM Stock Example In BIST. DÜBİTED. April 2023;11(2):958-976. doi:10.29130/dubited.1096767
Chicago Toprak, Şevval, Gültekin Çağıl, and Abdullah Hulusi Kökçam. “Stock Closing Price Prediction With Machine Learning Algorithms: PETKM Stock Example In BIST”. Duzce University Journal of Science and Technology 11, no. 2 (April 2023): 958-76. https://doi.org/10.29130/dubited.1096767.
EndNote Toprak Ş, Çağıl G, Kökçam AH (April 1, 2023) Stock Closing Price Prediction with Machine Learning Algorithms: PETKM Stock Example In BIST. Duzce University Journal of Science and Technology 11 2 958–976.
IEEE Ş. Toprak, G. Çağıl, and A. H. Kökçam, “Stock Closing Price Prediction with Machine Learning Algorithms: PETKM Stock Example In BIST”, DÜBİTED, vol. 11, no. 2, pp. 958–976, 2023, doi: 10.29130/dubited.1096767.
ISNAD Toprak, Şevval et al. “Stock Closing Price Prediction With Machine Learning Algorithms: PETKM Stock Example In BIST”. Duzce University Journal of Science and Technology 11/2 (April 2023), 958-976. https://doi.org/10.29130/dubited.1096767.
JAMA Toprak Ş, Çağıl G, Kökçam AH. Stock Closing Price Prediction with Machine Learning Algorithms: PETKM Stock Example In BIST. DÜBİTED. 2023;11:958–976.
MLA Toprak, Şevval et al. “Stock Closing Price Prediction With Machine Learning Algorithms: PETKM Stock Example In BIST”. Duzce University Journal of Science and Technology, vol. 11, no. 2, 2023, pp. 958-76, doi:10.29130/dubited.1096767.
Vancouver Toprak Ş, Çağıl G, Kökçam AH. Stock Closing Price Prediction with Machine Learning Algorithms: PETKM Stock Example In BIST. DÜBİTED. 2023;11(2):958-76.