Dự Đoán Giá Cổ Phiếu Bằng Thuật Toán Học Máy Tại Việt Nam

Tài liệu nghiên cứu Applying machine learning algorithms for stock price forecasting, tổng hợp lý thuyết và thực hành, cung cấp kiến thức chuyên sâu về .

Chuyên ngành

Business Data Analytics

Người đăng

Ẩn danh

Thể loại

Graduation Project

2024

68
2
0

Phí lưu trữ

30 Point

Mục lục chi tiết

ACKNOWLEDGMEMTS

DECLARATION

SUMMARIZATION

LIST OF TABLES

LIST OF FIGURES

LIST OF ABBREVIATIONS

TABLE OF CONTENTS

1. OBJECTIVES OF THE STUDY

2. SUBJECT AND SCOPE OF RESEARCH

3. SCIENTIFIC AND PRACTICAL SIGNIFICANCE

4. THESIS LAYOUT

5. CHAPTER 1: AN OVERVIEW OF THE RESEARCH FIELD OF STOCK PRICE PREDICTION PROBLEM

1.1. STATEMENT OF PREDICTION PROBLEM AND OBJECTIVES, OBJECTS, SCOPE OF RESEARCH AS WELL AS METHODS TO ACHIEVE THE MOST OPTIMAL RESULTS

1.2. BACKGROUND KNOWLEDGE OF MACHINE LEARNING (ARTIFICIAL NEURAL NETWORKS, BACK PROPAGATION TECHNIQUES), AND TRAINED DEEP LEARNING MODELS (LSTM, TRANSFORMER)

1.3. OVERVIEW OF STOCK MARKET PREDICTIONS, AS WELL AS RESEARCH APPROACHES AND PROPOSALS

1.4. PROPOSED MODEL AND DESCRIPTION OF THE CHARACTERISTICS OF THE TRANSFORMER MODEL TO PREDICT STOCK PRICES

1.5. METHODS TO ASSESS HOW WELL THE SUGGESTED MODEL WORKS

1.6. PRESENTING EXPERIMENTS, DATA PREPROCESSING STEPS, MODEL TRAINING, MODEL EVALUATION METHODS AND COMPARING THE TESTED RESULTS OF EACH MODEL

1.7. COMMENTS ON THE INSTALLED MODELS AND SELECTION OF THE OPTIMAL MODEL TO VISUALIZE THE RESULTS

1.8. SUMMARY OF THE MAIN IDEAS OF THE THESIS, ANALYSIS OF THE PROS AND CONS OF THE TRAINED MODELS, AND PROPOSAL OF AN APPROPRIATE MODEL FOR THE PROBLEM OF PREDICTING STOCK PRICES AND POSSIBLE SOLUTIONS FOR FUTURE WORK

2. CHAPTER 2: THEORETICAL BACKGROUND

2.1. BASIC ISSUES ABOUT STOCKS

2.2. STOCK CONCEPT

2.3. SECURITIES CLASSIFICATION

2.3.1. Shares

2.3.1.1. Common stock
2.3.1.2. Preference shares

2.3.2. Bonds

2.3.2.1. Bearer bonds
2.3.2.2. Registered bonds
2.3.2.3. Government bonds
2.3.2.4. Construction bonds
2.3.2.5. Corporate bonds

2.3.3. Investment fund certificates

2.3.3.1. Mutual investment fund
2.3.3.2. Private investment fund
2.3.3.3. Open-ended investment fund
2.3.3.4. Stock investment fund
2.3.3.5. Bond investment fund
2.3.3.6. Mixed investment fund

2.3.4. Other types of securities (derivatives)

2.4. OVERVIEW OF THE STOCK MARKET

2.5. MACHINE LEARNING AND THE STOCK MARKET

2.6. DEEP LEARNING AND THE STOCK MARKET

2.6.1. Recurrent neural network (RNN)

2.6.2. Long-short term memory neural network (LSTM)

2.7. STOCK PRICE PREDICTION

3. CHAPTER 3: PROPOSED METHODS

3.1. OVERVIEW OF THE PROPOSED METHODS

3.2. CHARACTERISTICS OF THE PROPOSED MODEL

3.3. BUILD AN APPLICATION THAT VISUALIZES RESULTS

Tóm tắt

I. Tổng Quan Về Dự Đoán Giá Cổ Phiếu Bằng Thuật Toán Học Máy

Dự đoán giá cổ phiếu là một lĩnh vực nghiên cứu quan trọng trong tài chính, đặc biệt tại Việt Nam. Sự phát triển của công nghệ và dữ liệu lớn đã mở ra cơ hội mới cho việc áp dụng thuật toán học máy trong việc dự đoán giá cổ phiếu. Nghiên cứu này sẽ tập trung vào việc sử dụng các mô hình học sâu để cải thiện độ chính xác trong dự đoán giá cổ phiếu, từ đó giúp các nhà đầu tư đưa ra quyết định thông minh hơn.

1.1. Khái Niệm Dự Đoán Giá Cổ Phiếu

Dự đoán giá cổ phiếu là quá trình ước lượng giá trị tương lai của cổ phiếu dựa trên dữ liệu lịch sử và các yếu tố thị trường. Việc này không chỉ giúp nhà đầu tư tối ưu hóa lợi nhuận mà còn giảm thiểu rủi ro trong đầu tư.

1.2. Vai Trò Của Thuật Toán Học Máy Trong Tài Chính

Thuật toán học máy đã trở thành công cụ quan trọng trong việc phân tích dữ liệu tài chính. Chúng giúp phát hiện các mẫu và xu hướng trong dữ liệu, từ đó cải thiện khả năng dự đoán giá cổ phiếu.

II. Thách Thức Trong Dự Đoán Giá Cổ Phiếu Tại Việt Nam

Mặc dù có nhiều tiềm năng, việc dự đoán giá cổ phiếu tại Việt Nam vẫn gặp phải nhiều thách thức. Các yếu tố như biến động kinh tế, chính sách tài chính và tâm lý thị trường đều ảnh hưởng đến độ chính xác của các mô hình dự đoán. Việc thiếu dữ liệu chất lượng cao cũng là một rào cản lớn.

2.1. Biến Động Kinh Tế Ảnh Hưởng Đến Dự Đoán

Sự biến động của nền kinh tế Việt Nam có thể gây ra những thay đổi đột ngột trong giá cổ phiếu. Các nhà đầu tư cần phải theo dõi sát sao các chỉ số kinh tế vĩ mô để điều chỉnh dự đoán của mình.

2.2. Thiếu Dữ Liệu Chất Lượng Cao

Việc thiếu dữ liệu lịch sử và dữ liệu chính xác về các cổ phiếu có thể làm giảm độ tin cậy của các mô hình dự đoán. Cần có các nguồn dữ liệu đáng tin cậy để cải thiện kết quả dự đoán.

III. Phương Pháp Dự Đoán Giá Cổ Phiếu Bằng Học Máy

Nghiên cứu này áp dụng các phương pháp học máy hiện đại, bao gồm mô hình học sâu như LSTM và Transformer, để dự đoán giá cổ phiếu. Các mô hình này cho phép xử lý và phân tích dữ liệu lớn một cách hiệu quả, từ đó cải thiện độ chính xác trong dự đoán.

3.1. Mô Hình LSTM Trong Dự Đoán Giá Cổ Phiếu

Mô hình LSTM (Long Short-Term Memory) là một trong những phương pháp phổ biến trong dự đoán chuỗi thời gian. Nó có khả năng ghi nhớ thông tin lâu dài, giúp cải thiện độ chính xác trong dự đoán giá cổ phiếu.

3.2. Mô Hình Transformer Và Ứng Dụng Của Nó

Mô hình Transformer đã chứng minh được hiệu quả vượt trội trong nhiều lĩnh vực, bao gồm cả tài chính. Với khả năng xử lý dữ liệu song song, mô hình này giúp tăng tốc độ và độ chính xác trong dự đoán giá cổ phiếu.

IV. Kết Quả Nghiên Cứu Về Dự Đoán Giá Cổ Phiếu

Kết quả nghiên cứu cho thấy mô hình Transformer có khả năng dự đoán giá cổ phiếu tốt hơn so với các mô hình truyền thống như ANN và SVR. Các chỉ số đánh giá như RMSE và MAPE cho thấy mô hình này đạt được độ chính xác cao trong việc dự đoán giá cổ phiếu của các ngân hàng lớn tại Việt Nam.

4.1. Đánh Giá Hiệu Suất Mô Hình

Mô hình Transformer đã cho kết quả tốt hơn so với các mô hình khác trong việc dự đoán giá cổ phiếu. Các chỉ số như R-square cho thấy mô hình này có khả năng giải thích biến động giá cổ phiếu một cách hiệu quả.

4.2. Ứng Dụng Thực Tiễn Của Mô Hình

Mô hình dự đoán giá cổ phiếu không chỉ giúp các nhà đầu tư đưa ra quyết định chính xác mà còn có thể được áp dụng trong việc phát triển các ứng dụng tài chính thông minh.

V. Kết Luận Và Tương Lai Của Dự Đoán Giá Cổ Phiếu

Dự đoán giá cổ phiếu bằng thuật toán học máy đang trở thành xu hướng quan trọng trong ngành tài chính. Nghiên cứu này mở ra hướng đi mới cho việc áp dụng công nghệ trong dự đoán giá cổ phiếu tại Việt Nam. Tương lai của lĩnh vực này hứa hẹn sẽ có nhiều cải tiến và ứng dụng thực tiễn hơn.

5.1. Xu Hướng Phát Triển Trong Tương Lai

Với sự phát triển không ngừng của công nghệ, việc áp dụng các mô hình học máy trong dự đoán giá cổ phiếu sẽ ngày càng trở nên phổ biến. Các nhà nghiên cứu cần tiếp tục cải tiến mô hình để đạt được độ chính xác cao hơn.

5.2. Tầm Quan Trọng Của Dữ Liệu Trong Dự Đoán

Dữ liệu chất lượng cao sẽ là yếu tố quyết định trong việc cải thiện độ chính xác của các mô hình dự đoán. Cần có các nguồn dữ liệu đáng tin cậy và phong phú để hỗ trợ nghiên cứu trong tương lai.

09/07/2025
Applying machine learning algorithms for stock price forecasting

Trích đoạn nội dung tài liệu

VIETNAM NATIONAL UNIVERSITY, HANOI INTERNATIONAL SCHOOL GRADUATION PROJECT APPLYING MACHINE LEARNING ALGORITHMS FOR STOCK PRICE FORECASTING Student’s name NGUYEN THU HUYEN Hanoi - 2024. VIETNAM NATIONAL UNIVERSITY, HANOI INTERNATIONAL SCHOOL GRADUATION PROJECT APPLYING MACHINE LEARNING ALGORITHMS FOR STOCK PRICE FORECASTING SUPERVISOR: DR. NGUYEN DOAN DONG (Academic title, academic degree, full name) STUDENT: NGUYEN THU HUYEN STUDENT ID: 20070937 COHORT: QH2020 SUBJECT CODE: INS401101 MAJOR: BUSINESS DATA ANALYTICS Hanoi - 2024. ACKNOWLEDGMEMTS Through my time studying and practicing at the International School - Hanoi National University, the enthusiastic guidance and teaching of the teachers has imparted valuable knowledge to me throughout my time studying at the University.

With my own efforts, I completed my graduation project. From these achieved results, I would like to sincerely thank the teachers of the International School, in general, and the teachers in the Faculty of Applied Sciences in particular, for teaching me knowledge about general subjects as well as like specialized subjects, help you gain a solid theoretical basis and create conditions to help you throughout the learning process. In particular, Dr. Nguyen Doan Dong wholeheartedly guided and helped me complete this thesis report.

Finally, I want to express my gratitude to my friends and family for always creating conditions, caring for me, helping and encouraging me throughout the study process and completing my graduation thesis. Due to limited knowledge and experience, shortcomings in expression and presentation are inevitable. I look forward to receiving your comments so that the thesis report achieves the best results. I would like to wish all teachers and friends lots of health, joy, and success in work and life.

I would like to sincerely thank you. 1 DECLARATION I hereby declare that the thesis “APPLYING MACHINE LEARNING ALGORITHMS FOR STOCK PRICE FORECASTING” is my research project under the guidance of Dr. Nguyen Doan Dong, stemming from his own practical needs and desire to learn. Except for the reference results from other works clearly stated in the thesis, the contents presented in this thesis are the results of research conducted by myself and the results of the thesis have never been published before under any form.

2 SUMMARIZATION The evolution of contemporary civilization is significantly influenced by the stock market. They make it possible to allocate financial resources. Variations in stock prices are a reflection of market movements. Deep learning is frequently employed in the financial industry for tasks including stock market prediction, optimum investing, and financial information processing due to its strong data processing capabilities in many domains.

Put financial trading concepts into practice. For this reason, one of the most significant and well-liked professions in the financial industry is stock market prediction. In this research, I suggest using the Transformer - supervised deep learning method for predicting stock price. The supervised deep learning model for stock price prediction problems uses a structure consisting of many encoder layers to create a powerful and flexible system for stock price prediction.

In this report, I will report on an experiment on CTG stock (Vietinbank) and some stocks of other banks in the top 4 large banks in Vietnam, which are stocks with a wide range of trading days and use them to try to predict the daily closing price. Experimental results show that my proposed Transformer for time series method can outperform a lot of other prediction algorithms in terms of stock price prediction. In addition, in this thesis, I also propose to build a web application to visualize research results and support users in predicting market stock prices from stock transactions at the top 4 banks in Vietnam that are operating in the market today. Experimental results show that the proposed model achieves good results on the data sets used for training and evaluation on all measures: The R-square index measures the model's level of explanation.

for the dependent variable and measures include Root Mean Square Error (RMSE), Mean Absolute Error (MAE), Mean Absolute Percentage Error (MAPE). 3 LIST OF TABLES Table 4.1: Vietinbank stock dataset .2: BIDV stock dataset .3: Vietcombank stock data .4: Techcombank stock data .5: Evaluation results using the ANN model .6: Evaluation results using the SVR model.7: Evaluation results using the Random Forest model .8: Evaluation results using the LSTM model .9: Evaluation results using the Transformer model .10: Measurement results of the methods. 56 4 LIST OF FIGURES Figure 2.1: Stock market classification model .2: Model of different types of stock markets .3: Brief history of deep learning Deep learning.4: Simple regression network model .5: Model of an LSTM cell .7: Structure of two Attention mechanisms .1: Structure of two Attention mechanisms .2: My proposed Transformer structure .3: Details of my proposed Transformer structure .1: Stock price chart using ANN method .2: Stock price chart using SVR method .3: Stock price chart using Random Forest method .4: Stock price chart using LSTM method .5: Stock price chart using the Transformer method – 3 encoder layers.8: "Model training" function .9: "Model Evaluation" function .10: "Model Evaluation" function - Vietinbank example .11: "Prediction" function - Vietinbank example. 60 5 LIST OF ABBREVIATIONS Abbreviations Full words DL Deep learning ML Machine learning MLP Multilayer Perceptron ReLu Rectified Linear Unit API Application Programming Interface RNN Recurrent Neural Network CNN Convolutional Neural Network GAN Generative Adversarial Network ANN Artificial Neural Networks SVM Support Vector Machines SVR Support Vector Regression LSTM Long Short Term Memory BiLSTM Bidirectional Long Short Term Memory FFN Feed Forward Network R! R-square index MAE Mean Absolute Error RMSE Root Mean Square Error MAPE Mean Absolute Percentage Error 6 TABLE OF CONTENTS ACKNOWLEDGMEMTS.

3 LIST OF TABLES. 4 LIST OF FIGURES. 5 LIST OF ABBREVIATIONS. 6 TABLE OF CONTENTS.

OBJECTIVES OF THE STUDY. SUBJECT AND SCOPE OF RESEARCH. SCIENTIFIC AND PRACTICAL SIGNIFICANCE. CHAPTER 2: THEORETICAL BACKGROUND.

BASIC ISSUES ABOUT STOCKS. OVERVIEW OF THE STOCK MARKET. Stock market concept. The role of the stock market.

Classification of stock markets. MACHINE LEARNING AND THE STOCK MARKET. DEEP LEARNING AND THE STOCK MARKET. Recurrent neural network (RNN).

Long-short term memory neural network (LSTM). STOCK PRICE PREDICTION. CHAPTER 3: PROPOSED METHODS. OVERVIEW OF THE PROPOSED METHODS.

CHARACTERISTICS OF THE PROPOSED MODEL. BUILD AN APPLICATION THAT VISUALIZES RESULTS. Motivation Today, all developed countries and most developing countries have stock markets, an indispensable market for any economy that wants to develop strongly. In Vietnam, even though over 24 years of formation and development since the Ho Chi Minh City Stock Exchange Center (later renamed Ho Chi Minh City Stock Exchange - HOSE) had its first trading session on December 28.

Since July 2000, up to now the Securities industry has achieved certain achievements along with the growing transformation of the country's economy. As of April 2024, Vietnam's stock market (stock market) has continued to maintain an important role in mobilizing capital for the economy. In 2023, the stock market mobilized a total of VND 418,271 billion, an increase of 33.5% compared to the previous year [23]. Since its establishment, Vietnam's stock market has mobilized a total of about 2.7 million billion VND.

From 2011 to April 2024, the scale of capital mobilization through the stock market reached about 1.8 million billion VND, contributing an average of 20.5% of total social investment capital [24][25]. Market share: By the end of March 2024, stock market capitalization is estimated to reach nearly 6.7 million billion VND, an increase of 12.2% compared to the end of 2023 [24]. In 2023, stock market capitalization will reach nearly 6 million billion VND, an increase from the start of the year of 14% [26]. Bond market: By the end of February 2024, the bond market will have a listed value of more than 2,040 trillion VND, an increase of 17.1% compared to the end of 2023 [24].

As of 2019, the bond market capitalization reached over 30.3% of GDP, of which the corporate bond market reached nearly 10. As of April 2024, Vietnam's stock market capitalization will reach about 92% of GDP, continuing to contribute to shaping a modern financial system, harmonizing the stock market and the currency-credit market [24][27]. Regarding typical trading indices: VN-Index: By the end of March 2024,VN-Index reached 1,286.11 points, an increase of 13.8% compared to the end of 2023 [24]. 9 Average transaction value: In the first quarter of 2024, the average transaction value reached 22,529 billion VND/session, an increase of 28.2% compared to the average in 2023 [24].

The above results show the strong and stable development of Vietnam's stock market, although there are still many challenges and fluctuations from the macroeconomic and international environment. The development of Vietnam's stock market has made an important contribution to the process of restructuring the economy on all three main pillars. First, the stock market has promoted state-owned enterprise reform through equitization and divestment of state capital, with transparent and modern auction mechanisms, while also linking equitization with transaction registration and listing. listed on the stock market.

Second, the stock market has become an important capital mobilization channel for the state budget, contributing to the restructuring of public investment. Third, the stock market supports the restructuring process of credit institutions, especially commercial banks participating in listing on the market, helping to increase transparency and efficiency in the operations of these banks. Transparency and complete information about stock prices on the stock market help business managers, investors and individuals make decisions to participate in the market in a profitable and sustainable way. Thereby, improving trust and reliability in the stock market, bringing maximum satisfaction to investors, while making the stock market more efficient and better.

That is why predicting the stock market is an urgent need and has practical significance. This topic has been of interest to many domestic and foreign researchers and many solutions have been proposed. Each solution has different advantages and disadvantages, but using machine learning is currently the solution that brings good results. For the above reasons I have chosen the topic "Applying Machine learning algorithms for Stock Price Forecasting” as the topic of my graduation thesis.

Objectives of the study This thesis focuses on researching and solving the problem of predicting stock prices in the banking stock market in Vietnam with the top 4 large banks such as BIDV, 10 Vietinbank, Vietcombank, Techcombank,. On the basis of data collected from the website specializing in providing, evaluating, and analyzing financial stocks around the world Yahoo Finance, I preprocess, extract features, apply machine learning methods and Supervised deep learning Transformer for time series for stock price prediction problem thereby proposing the most optimal model. Subject and scope of research Research object of the thesis: Stock data from the website specializing in providing, evaluating and analyzing the characteristics of financial stocks in the world Yahoo Finance, which is related to stocks of corporations. Large corporations and companies in the world.

Scope of research: Deep learning and machine learning techniques are used to the problem of stock price prediction in stocks with a wide range of trading days. Research Methods - Theoretical research methods: Synthesize and research documents on securities stocks; Research methods and algorithms used for stock price prediction; Research deep learning methods into the stock market. Learn related knowledge such as stock market, machine learning, and computer programming techniques. - Experimental research methods: After studying the theory, stating the problem, and proposing a model; Build and develop applications based on the proposed model; Install a test program and evaluate the results achieved - Comparison and evaluation methods: Analyze and evaluate the proposed model with previous research models using different metrics.

Scientific and practical significance Scientific significance of the thesis: The thesis suggests an approach to feature extraction as a solution to the stock price prediction problem. The thesis tests approaches to different models, thereby introducing Create the most optimal model 11 for price prediction.

Nội dung được bảo vệ bản quyền — Tải xuống đầy đủ

Tài liệu "Dự Đoán Giá Cổ Phiếu Bằng Thuật Toán Học Máy: Nghiên Cứu Tại Việt Nam" cung cấp cái nhìn sâu sắc về việc ứng dụng các thuật toán học máy trong việc dự đoán giá cổ phiếu tại thị trường Việt Nam. Tài liệu này không chỉ phân tích các phương pháp và kỹ thuật mà còn chỉ ra những lợi ích mà các nhà đầu tư có thể thu được từ việc áp dụng công nghệ hiện đại vào quyết định đầu tư của mình. Đặc biệt, nó giúp người đọc hiểu rõ hơn về cách mà dữ liệu có thể được khai thác để đưa ra những dự đoán chính xác hơn, từ đó tối ưu hóa lợi nhuận.

Để mở rộng thêm kiến thức về các yếu tố ảnh hưởng đến giá cổ phiếu và hiệu quả kinh doanh, bạn có thể tham khảo tài liệu Luận văn thạc sĩ các nhân tố ảnh hưởng đến giá chứng khoán ở thị trường chứng khoán Việt Nam, nơi phân tích các yếu tố tác động đến giá cổ phiếu. Ngoài ra, tài liệu Luận văn thạc sĩ tác động của các yếu tố tài chính đến hiệu quả hoạt động kinh doanh của các công ty niêm yết trên thị trường chứng khoán Việt Nam sẽ giúp bạn hiểu rõ hơn về mối liên hệ giữa các yếu tố tài chính và hiệu quả kinh doanh. Cuối cùng, tài liệu Luận văn ứng dụng mô hình ba nhân tố cung cấp cái nhìn sâu sắc về các mô hình phân tích thị trường chứng khoán, giúp bạn có thêm công cụ để đánh giá và dự đoán giá cổ phiếu.

Những tài liệu này sẽ là cơ hội tuyệt vời để bạn mở rộng kiến thức và nâng cao khả năng phân tích trong lĩnh vực đầu tư chứng khoán.