VIETNAM NATIONAL UNIVERSITY HO CHI MINH CITY HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY ----------------- NGÔ MINH THIỆN A MACHINE LEARNING APPROACH FOR VIETNAM STOCK MARKET TRENDING PREDICTION Major: COMPUTER SCIENCE Major Code: 8480101 MASTER’S THESIS HO CHI MINH CITY, June 2024 Student: Ngo Minh Thien Instructors: Dr. Tran Tuan Anh & Dr. Nguyen Tien Thinh THIS THESIS IS COMPLETED AT HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY – VNU-HCM Supervisor 1: DR. TRẦN TUẤN ANH (Please fill in the supervisor‟ full name, academic rank and signature) Supervisor 2: DR.
NGUYỄN TIẾN THỊNH (Please fill in the supervisor‟ full name, academic rank and signature) Examiner 1: DR. TRỊNH TẤN ĐẠT Examiner 2: DR. TÔN LONG PHƯỚC This Master‟s Thesis is defended at HCM City University of Technology, VNU - HCM City on June 19, 2024………………………………………… Master‟s Thesis Committee: 1. Chair of Master‟s Thesis Committee: ASSOC.
Committee Secretary: DR. NGUYỄN ĐỨC DŨNG ……. TRỊNH TẤN ĐẠT ……………………………………. TÔN LONG PHƯỚC ………………………………….
Committee Member: DR. TRẦN TUẤN ANH …………………………. Approval of the Chair of Master‟s Thesis Committee and Dean of Faculty of Computer Science and Engineering after the thesis being corrected. CHAIR OF THESIS COMMITTEE DEAN OF FACULTY OF COMPUTER SCIENCE AND ENGINEERING -i- Student: Ngo Minh Thien Instructors: Dr.
Tran Tuan Anh & Dr. Nguyen Tien Thinh VIETNAM NATIONAL UNIVERSITY - HO CHI MINH CITY SOCIALIST REPUBLIC OF VIETNAM HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY Independence - Freedom - Happiness THE TASK SHEET OF MASTER’S THESIS Full name: NGÔ MINH THIỆN Student ID: 2170305 Date of birth: 11 January 1983 Place of birth: HCM City Major: Computer Science Major ID: 8480101 I. THESIS TITLE (In Vietnames): Dự đoán xu hướng giá cổ phiểu của thị trường chứng khoán Việt Nam dựa trên cách tiếp cận máy học. THESIS TITLE (In English): A Machine Learning Approach For Vietnam Stock Market Trending Prediction.
TASKS AND CONTENTS: The tasks of this Master's Thesis were to approach, analyze, and apply Machine Learning for the stock closing price trending prediction by analyzing the stock‟s historical data. Furthermore, I developed a web application that can predict the direction in which stock prices will move based on trading time series as inputs. This tool enables users to make better-informed choices and supports them to make better decisions. THESIS START DAY: 4 September 2023 V.
THESIS COMPLETION DAY: 12 May 2024 VI. TRẦN TUẤN ANH and DR. NGUYỄN TIẾN THỊNH. Ho Chi Minh City, 16 August 2024 SUPERVISOR 1 SUPERVISOR 2 CHAIR OF PROGRAM COMMITTEE (Full name and signature) (Full name and signature) DEAN OF FACULTY OF COMPUTER SCIENCE AND ENGINEERING (Full name and signature) -ii- Student: Ngo Minh Thien Instructors: Dr.
Tran Tuan Anh & Dr. Nguyen Tien Thinh ACKNOWLEDGEMENTS I would like to express my profound gratitude and deep appreciation to the esteemed university and my dedicated teachers. Your unwavering commitment to teaching and tireless efforts in guiding and mentoring me has been the foundation of my study journey. Throughout my studies, your insightful teachings and steadfast support have motivated me to push my boundaries and have inspired me to strive for well and persevere through challenges.
Your commitment to teaching and mentoring has truly been a cornerstone of my success. Today, as I proudly complete my Master's Thesis, I acknowledge that my results are a direct result of your hard work and belief in my potential. You have not only imparted knowledge but also instilled in me the values of perseverance, critical thinking, and a passion for learning. I am profoundly grateful for your mentorship, encouragement, and patience have played a pivotal role in shaping my studies and personal growth.
Thank you for being exemplary role models and for your unwavering support throughout this journey. Your unwavering support and dedication have been invaluable to me, and my results are a testament to your dedication and belief in me. In this profoundly emotional moment, I find myself at a loss for words to fully convey my heartfelt gratitude. From the depths of my heart, I extend my sincerest thanks to my esteemed teachers.
I wish you all abundant health, boundless joy, and continued success in all your endeavors. Your guidance has made a lasting impact on my life, and I am forever grateful! -iii- Student: Ngo Minh Thien Instructors: Dr. Tran Tuan Anh & Dr. Nguyen Tien Thinh ABSTRACT OF MASTER’S THESIS The purpose of this Master's Thesis was to approach, analyze, and apply Machine Learning for the stock closing price trending prediction by analyzing the stock‟s historical data.
Furthermore, I developed a web application that can predict the direction in which stock prices will move based on trading time series as inputs. The use of these Machine Learning techniques enables users to make better- informed choices and allows them to make better decisions. In this study, I am interested in stock closing price trending prediction. This means that I analyze the past movement of the time series to make a future prediction.
Several machine learning models have been proposed for stock price forecasting, I propose a framework based on the Long Short-Term Memory (LSTM) and AutoRegressive Integrated Moving Average (ARIMA) model to predict the stock closing prices. These predictions were made using data collected based on its stock closing prices and volume values of the past ten years. Moreover, the forecasting models are evaluated using metrics such as Root Mean Square Error (RMSE), and Mean Absolute Error (MAE) measures were used in the computation, to evaluate the performance of the ARIMA and LSTM models. RMSE and MAE performance indicators are used to analyze the prediction results of different models and different stocks.
The 20 listed company stocks are selected as the research object in the experiments. The comparison results display statistical metrics for different stocks across various sectors/industries. The table compares RMSE and MAE for both LSTM and ARIMA models, lower values in these metrics indicate better predictive performance. For most listed stocks, LSTM tends to have lower RMSE and MAE values (16 stocks) compared to ARIMA (4 stocks).
In some cases where LSTM has higher RMSE and MAE values than ARIMA. Overall, based on this dataset, LSTM appears more accurate in predicting stock performance, as indicated by generally lower RMSE and MAE values for most stocks. So I can conclude that LSTM has better performance in predicting stock prices. However, in some cases, the ARIMA model may outperform LSTM regarding RMSE and MAE.
Therefore, it can be concluded that the choice between using LSTM or ARIMA may depend on specific circumstances. -iv- Student: Ngo Minh Thien Instructors: Dr. Tran Tuan Anh & Dr. Nguyen Tien Thinh ABSTRACT OF MASTER’S THESIS (IN VIETNAMESE) Mục đích của Luận văn Thạc sĩ này là mong muốn tiếp cận, phân tích và áp dụng học máy (Machine Learning) để dự đoán xu hướng giá đóng cửa của cổ phiếu thông qua việc phân tích dữ liệu lịch sử của cổ phiếu.
Hơn thế nữa, tôi phát triển một ứng dụng Web với khả năng dự đoán hướng di chuyển của giá cổ phiếu dựa trên chuỗi thời gian giao dịch làm đầu vào. Việc sử dụng những kỹ thuật học máy giúp người dùng đưa ra các lựa chọn sáng suốt hơn và các quyết định tốt hơn. Trong nghiên cứu này, tôi quan tâm đến việc dự đoán xu hướng giá đóng cửa của cổ phiếu. Tôi phân tích sự biến động giá cổ phiếu trong quá khứ của chuỗi thời gian để đưa ra dự đoán xu hướng giá cho tương lai.
Một số mô hình học máy đã được đề xuất để dự đoán giá cổ phiếu, tôi đề xuất các mô hình Long Short-Term Memory (LSTM) và AutoRegressive Integrated Moving Average (ARIMA) để dự đoán giá đóng cửa cổ phiếu; được thực hiện bằng cách dùng dữ liệu thu thập dựa trên giá đóng cửa và khối lượng giao dịch của cổ phiếu trong khoảng 10 năm qua. Hơn nữa, các mô hình dự đoán được đánh giá bằng cách sử dụng các chỉ số đo lường như "Căn bậc hai của sai số bình phương trung bình" (RMSE) và "Sai số trung bình tuyệt đối" (MAE) để đánh giá hiệu suất của mô hình ARIMA và LSTM. Các chỉ số đo lường hiệu suất RMSE và MAE được sử dụng để phân tích kết quả dự đoán của các mô hình khác nhau và các cổ phiếu khác nhau. Tôi đã sử dụng 20 cổ phiếu của các công ty niêm yết được chọn làm đối tượng nghiên cứu.
Những kết quả so sánh cho thấy các chỉ số thống kê của các cổ phiếu khác nhau trên các lĩnh vực hay ngành công nghiệp khác nhau. Bảng so sánh RMSE và MAE nói lên rằng các giá trị thấp hơn trong các chỉ số này cho thấy hiệu suất dự đoán tốt hơn. Đối với hầu hết các cổ phiếu niêm yết, LSTM có xu hướng có giá trị RMSE và MAE thấp hơn (16 cổ phiếu) so với ARIMA (4 cổ phiếu). Trong một số trường hợp, LSTM có giá trị RMSE và MAE cao hơn so với ARIMA.
Nhìn chung, dựa trên bộ dữ liệu này, LSTM có vẻ chính xác hơn trong việc dự đoán hiệu suất của cổ phiếu, được chỉ ra bởi kết quả của các giá trị RMSE và MAE thấp hơn nói chung đối với hầu hết các cổ phiếu. Vì vậy, tôi có thể kết luận rằng LSTM có hiệu suất tốt hơn trong việc dự đoán giá cổ phiếu. Tuy nhiên, trong một số trường hợp, ARIMA có thể vượt trội hơn LSTM về mặt RMSE và MAE. Do đó, việc lựa chọn giữa LSTM hay ARIMA còn phụ thuộc vào từng hoàn cảnh cụ thể.
-v- Student: Ngo Minh Thien Instructors: Dr. Tran Tuan Anh & Dr. Nguyen Tien Thinh THE COMMITMENT OF THE THESIS’ AUTHOR I affirm that the content of this Master‟s Thesis is my work and does not violate any academic ethical standards, such as plagiarism or fraud. I hereby declare that: • This Master's Thesis is the result of my work, conducted under the guidance of my supervisors, and has not been copied from any sources without proper and accurate citation.
• The results and data presented in this thesis are truthful, and accurate to the best of my knowledge and belief, and have not been distorted or falsified. • I have adhered to the ethical standards of research, guidelines and have not violated any regulations regarding copyright and intellectual property. • Any assistance and collaboration received during my research have been acknowledged appropriately in this Master‟s Thesis. I fully understand the consequences of violating these principles, and I accept full responsibility for the content of this Master‟s Thesis.
Author: Ngô Minh Thiện -vi- Student: Ngo Minh Thien Instructors: Dr. Tran Tuan Anh & Dr. Nguyen Tien Thinh TABLE OF CONTENTS THIS THESIS IS COMPLETED AT .i THE TASK SHEET OF MASTER’S THESIS. iii ABSTRACT OF MASTER’S THESIS .iv ABSTRACT OF MASTER’S THESIS (IN VIETNAMESE) .v THE COMMITMENT OF THE THESIS’ AUTHOR .vi TABLE OF FIGURES .x TABLE OF TABLES.
Objectives of the Topic. Scope of the Study. THEORETICAL BASIC AND RELATED RESEARCH. Machine Learning Stock Market Prediction Studies: Review and Research Directions .2 Method For Identifying Relevant Studies .4 Conclusions And Future Research Directions.
Stock Market Prediction Using Machine Learning Techniques: A Decade (2011 - 2021) Survey on Methodologies, Recent Developments, and Future Directions .3 Generic Scheme for Stock Market Prediction (SMP). Stock Price Prediction Using LSTM (Related Research). Pipeline and Workflow for Building Machine Learning Model. Detail View of Machine Learning Modelling Process .18 -vii- Student: Ngo Minh Thien Instructors: Dr.
Tran Tuan Anh & Dr. Nguyen Tien Thinh 6. Training, Testing, and Validation Datasets. Long Short Term Memory (LSTM) Model.