Malaysian Daily Stock Prediction Analysis Using Supervised Learning Algorithms

Total Views: 170 | Total Downloads: 104


  • Hazirah Halul Faculty of Science and Technology, Universiti Sains Islam Malaysia, Bandar Baru Nilai, 71800, Malaysia.
  • Karmila Hanim Kamil Faculty of Science and Technology, Universiti Sains Islam Malaysia, Bandar Baru Nilai, 71800, Malaysia.



Machine Learning, Supervised Learning Classifier, Walk-Forward Analysis, time series forecasting


Nowadays, Machine Learning (ML) plays a significant role in the economy, especially in the stock trading strategy. However, there is an inadequate extensive data analysis using various ML methods. Previous findings usually focus on the forecasting stock index or selecting a limited number of stocks with restricted features. Therefore, the contribution of this paper focused on evaluating different supervised learning algorithms, namely Logistic Regression (LR), Support Vector Machine (SVM), and Extreme Gradient Boosting (XGB), on a big dataset from 28 stocks in Bursa Malaysia. By setting their parameter along and using Walk-Forward Analysis (WFA) method, the trading signal was evaluated based on Accuracy Rate, Precision Rate, Recall Rate, and F1 Score. For stock trading strategies in Malaysia in particular, the findings of this study show that SVM has a better performance compared to LR and XGB in time series forecasting. The ML algorithms have values ranging from 53% to 66% for Accuracy Rate (AR), Recall Rate (RR), and F1 Score (F1). In addition, SVM has the highest Precision Rate (PR) of 73% among the ML algorithms.


Download data is not yet available.


BBC News. (2020, April 9). Coronavirus: Worst economic crisis since 1930s depression, IMF says. Retrieved from BBC News Website:

Fitzgerald, M. (2021, 8 April). A large chunk of the retail investing crowd started during the pandemic, Schwab survey shows. Retrieved from CNBC Web site:

Tan, V. (2020 , July 16 ). COVID-19 lockdown stimulates Malaysia's retail investor boom. Retrieved from CNA News Asia Web site:

Lee, Y. N. (2020, August 26 ). Retail investors with ‘money to play with’ help Malaysian stocks recoup nearly all losses this year. Retrieved from CNBC Website:

Bursa Malaysia. (2020). Bursa Malaysia announces RM151.0 million profit-after-tax-and-minority-interest for the first half of 2020 highest first half financial performance since listing in 2005. Retrieved from Bursa Malaysia website:

The Star. (2020). Bursa to consolidate to 1,500-1,530 next week on prolonged bargain-hunting. Retrieved from The Star Website:

Wei, N. S. (2020). Bursa: Retail investors need to analyse, assess companies' fundamentals before investing in market. Retrieved from The Edge Markets Web site:

Scott, G., Carr, M., & Cremonie, M. (2016). Literature Review: Technical Analysis-Modern Perspectives. CFA Institute Research Foundation 2016L-1. ISBN 978-1-944960-11-7.

Murphy, J. J. (1999). Study Guide to Technical Analysis of the Financial Markets: A Comprehensive Guide to Trading Methods and Applications. Penguin.

Dash, R., & Dash, P. K. (2016). A hybrid stock trading framework integrating technical analysis with machine learning techniques. The Journal of Finance and Data Science, 2(1), 42-57.

Sagir, A. M., & Sathasivam, S. (2017). The use of artificial neural network and multiple linear regressions for stock market forecasting. Matematika, 33.

Abd Samad, P. H. D., Mutalib, S., & Abdul-Rahman, S. (2019). Analytics of stock market prices based on machine learning algorithms. Indonesian Journal of Electrical Engineering and Computer Science, 16(2), 1050-1058.

Zaini, B. J., Mansor, R., Yusof, N., & Sang, B. H. Classify Stock Market Movement Based on Technical Analysis Indicators Using Logistic Regression.

Shalev-Shwartz, S., & Ben-David, S. (2014). Understanding machine learning: From theory to algorithms. Cambridge university press.

Lantz, B. (2015). Discover how to build machine learning algorithms, prepare data, and dig deep into data prediction techniques with R. Birmingham: Packt Publishing Ltd.

Jatain, A., & Ranjan, A. (2017). A review study on big data analysis using R studio. International Journal of Computer Science and Mobile Computing, 6(6), 8-13.

Nishida, K. (2017, March 9). Introduction to Extreme Gradient Boosting in Exploratory. Retrieved from Medium Website:

Lv, D., Yuan, S., Li, M., & Xiang, Y. (2019). An empirical study of machine learning algorithms for stock daily trading strategy. Mathematical problems in engineering, 2019.

Nadh, V. L., & Prasad, G. S. (2018). Support vector machine in the anticipation of currency markets. Int. J. Eng. Technol, 7(2-7), 66.

Butt, S., Ramakrishnan, S., Chohan, M. A., & Punshi, S. K. Prediction of Malaysian Exchange Rate using microstructure fundamental and commodities prices: A machine learning method. International Journal of Recent Technology and Engineering (IJRTE), 8(2).

Liu, C., Wang, J., Xiao, D., & Liang, Q. (2016). Forecasting s&p 500 stock index using statistical learning models. Open journal of statistics, 6(6), 1067-1075.

Basak, S., Kar, S., Saha, S., Khaidem, L., & Dey, S. R. (2019). Predicting the direction of stock market prices using tree-based classifiers. The North American Journal of Economics and Finance, 47, 552-567.

Dey, S., Kumar, Y., Saha, S., & Basak, S. (2016). Forecasting to Classification: Predicting the direction of stock market price using Xtreme Gradient Boosting.

Nabipour, M., Nayyeri, P., Jabani, H., Mosavi, A., & Salwana, E. (2020). Deep learning for stock market prediction. Entropy, 22(8), 840.

R Core Team. (2020). R: A Language and Environment for Statistical Computing. Retrieved from R Foundation for Statistical Computing:


DOI: 10.33102/2022229
Published: 2022-06-02

How to Cite

Halul, H., & Kamil, K. H. (2022). Malaysian Daily Stock Prediction Analysis Using Supervised Learning Algorithms. Malaysian Journal of Science Health & Technology, 8(2), 31–37.



Financial Mathematics