A Machine Learning Trading System for the Stock Market based on N-Period Min-Max Labeling using XGBoost


Many researchers attempt to accurately predict stock price trends using technologies such as machine learning and deep learning to achieve high returns in the stock market. However, it is difficult to predict the exact trend since stock prices are nonlinear and often appear random. To improve accuracy, the focus of modelers usually lies in improving the performance of the prediction model. However, examining the data used in training the model is imperative. Most studies of stock price trend prediction use an up-down labeling that labels data at all time points. The drawback of this labeling method is that it is sensitive to small price changes, causing inefficient model training. Therefore, this study proposes an N-Period Min-Max (NPMM) labeling that labels data only at definite time points to help overcome small price change sensitivity. The proposed model also develops a trading system using XGBoost to automate trading and verify the proposed labeling method. The proposed trading system is evaluated through an empirical analysis of 92 companies listed on the NASDAQ. Moreover, the trading performance of the proposed labeling method is compared against other prominent labeling methods. In this study, NPMM labeling was found to be an efficient labeling method for stock price trend prediction, in addition to generating trading outperformance compared to other labeling methods.


Engineering Management and Systems Engineering


Ministry of Science, ICT and Future Planning, Grant 20180402

Keywords and Phrases

Data Labeling; Machine Learning; N-Period Min-Max Labeling; Trading System; XGBoost

International Standard Serial Number (ISSN)


Document Type

Article - Journal

Document Version


File Type





© 2023 Elsevier, All rights reserved.

Publication Date

01 Jan 2023