Abstract
Researchers often use machine learning and deep learning to predict price trends in the financial markets, aiming to achieve high returns. However, accurately predicting market prices is challenging due to their nonlinear and seemingly random nature. Improving the accuracy of the prediction model is the common focus of researchers, yet it is crucial to also consider the data used in training. Traditional labeling methods used in most price trend prediction studies are not robust as they are sensitive to small price changes, leading to inefficient model training. To address this issue, this study introduces a Dynamic Threshold Breakout (DTB) labeling system that labels data based on the price percentage change during a specific period. This proposed labeling system was then integrated into an automated trading system using LightGBM and evaluated using three different markets. The results showed that the DTB labeling method is effective for trading in financial markets in terms of winning ratio, payoff ratio, profit factor, accuracy and ROI in trading performance.













Similar content being viewed by others
Data availability
No datasets were generated or analyzed during the current study.
References
Paltrinieri N, Comfort L, Reniers G (2019) Learning about risk: machine learning for risk assessment. Saf Sci 118:475–486. https://doi.org/10.1016/j.ssci.2019.06.001
Hegde J, Rokseth B (2020) Applications of machine learning methods for engineering risk assessment—a review. Safety Sci [online] 122:104492. https://doi.org/10.1016/j.ssci.2019.09.015
Chen W, Zhang H, Mehlawat MK, Jia L (2021) Mean–variance portfolio optimization using machine learning-based stock price prediction. Appl Soft Comput 100:106943. https://doi.org/10.1016/j.asoc.2020.106943
Ma Y, Han R, Wang W (2021) Portfolio optimization with return prediction using deep learning and machine learning. Expert Syst Appl 165:113973. https://doi.org/10.1016/j.eswa.2020.113973
Min L, Dong J, Liu J, Gong X (2021) Robust mean-risk portfolio optimization using machine learning-based trade-off parameter. Appl Soft Comput 113:107948. https://doi.org/10.1016/j.asoc.2021.107948
Sadgali I, Sael N, Benabbou F (2019) Performance of machine learning techniques in the detection of financial frauds. Procedia Computer Science 148:45–54. https://doi.org/10.1016/j.procs.2019.01.007
Ali A, Abd Razak S, Othman SH, Eisa TAE, Al-Dhaqm A, Nasser M, Elhassan T, Elshafie H, Saif A (2022) Financial fraud detection based on machine learning: a systematic literature review. Appl Sci [online] 12(19):9637. https://doi.org/10.3390/app12199637
Jing N, Wu Z, Wang H (2021) A hybrid model integrating deep learning with investor sentiment analysis for stock price prediction. Expert Syst Appl 178:115019. https://doi.org/10.1016/j.eswa.2021.115019
Costola M, Hinz O, Nofer M, Pelizzon L (2023) Machine learning sentiment analysis, COVID-19 news and stock market reactions. Res Int Bus Financ [online] 64:101881. https://doi.org/10.1016/j.ribaf.2023.101881
Norvill R, Beltran, State R, Awan I, Cullen A 2017 Automated labeling of unknown contracts in Ethereum, In: 6th International Conference on Computer Communication and Networks (ICCCN), IEEE, 2017 Jul 31 1–6. https://doi.org/10.1109/icccn.2017.8038513
.Zhao Z, Rao R, Tu S, Shi J. Time-weighted LSTM model with redefined labeling for stock trend prediction. In: 2017 IEEE 29th International Conference on Tools with Artificial Intelligence, (ICTAI) 2017 Nov 6 (pp. 1210–1217). IEEE https://doi.org/10.1109/ICTAI.2017.00184.
Bounid S, Oughanem M, Bourkadi S. Advanced financial data processing and labeling methods for machine learning. In: 2022 International Conference on Intelligent Systems and Computer Vision (ISCV) 2022 May 18 (pp. 1-6). IEEE. https://doi.org/10.1109/iscv54655.2022.9806060.
Rundo F, Trenta F, Di Stallo AL, Battiato S (2019) Advanced markov-based machine learning framework for making adaptive trading system. Computation 7(1):4. https://doi.org/10.3390/computation7010004
Lahmiri S, Bekiros S (2020) Intelligent forecasting with machine learning trading systems in chaotic intraday Bitcoin market. Chaos, Solitons Fractals 133:109641. https://doi.org/10.1016/j.chaos.2020.109641
Borch C (2022) Machine learning, knowledge risk, and principal-agent problems in automated trading. Technol Soc [online] 68:101852. https://doi.org/10.1016/j.techsoc.2021.101852
Baldacci B, Manziuk I (2022) Adaptive trading strategies across liquidity pools. Mark Microstruct Liqu. https://doi.org/10.1142/s2382626620500082
Picasso A, Merello S, Ma Y, Oneto L, Cambria E (2019) Technical analysis and sentiment embeddings for market trend prediction. Expert Syst Appl [online] 135:60–70. https://doi.org/10.1016/j.eswa.2019.06.014
Wen M, Li P, Zhang L, Chen Y (2019) Stock market trend prediction using high-order information of time series. IEEE Access 7:28299–28308. https://doi.org/10.1109/access.2019.2901842
Zhou F, Zhou H, Yang Z, Yang L (2019) EMD2FNN: a strategy combining empirical mode decomposition and factorization machine based neural network for stock market trend prediction. Expert Syst Appl 115:136–151. https://doi.org/10.1016/j.eswa.2018.07.065
Han Y, Kim J, Enke D (2023) A machine learning trading system for the stock market based on N-period min-max labeling using XGBoost. Expert Syst Appl 211:118581. https://doi.org/10.1016/j.eswa.2022.118581
Sezer OB, Ozbayoglu AM (2018) Algorithmic financial trading with deep convolutional neural networks: Time series to image conversion approach. Appl Soft Comput [online] 70:525–538. https://doi.org/10.1016/j.asoc.2018.04.024
Wu D, Wang X, Su J, Tang B, Wu S (2020) A labeling method for financial time series prediction based on trends. Entropy 22(10):1162. https://doi.org/10.3390/e22101162
Liang M, Wu S, Wang X, Chen Q (2022) A stock time series forecasting approach incorporating candlestick patterns and sequence similarity. Expert Syst Appl 205:117595. https://doi.org/10.1016/j.eswa.2022.117595
Chou J-S, Nguyen N-M, Chang C-P (2022) Intelligent candlestick forecast system for financial time-series analysis using metaheuristics-optimized multi-output machine learning. Appl Soft Comput 130:109642–109642. https://doi.org/10.1016/j.asoc.2022.109642
Fengqian D, Chao L (2020) An adaptive financial trading system using deep reinforcement learning with candlestick decomposing features. IEEE Access 8:63666–63678. https://doi.org/10.1109/access.2020.2982662
Day M-Y, Cheng Y, Huang P, Ni Y (2022) The profitability of bollinger bands trading bitcoin futures. Appl Econ Lett 30(11):1437–1443. https://doi.org/10.1080/13504851.2022.2060494
Chen C-H, Lai W-H, Hung S-T, Hong T-P (2022) An advanced optimization approach for long-short pairs trading strategy based on correlation coefficients and bollinger bands. Appl Sci 12(3):1052. https://doi.org/10.3390/app12031052
Kothapalli CD, Navya G, Jaladhi U, Sulthana SR, Kumar DL, Praveen SP (2023) Predicting buy and sell signals for stocks using bollinger bands and MACD with the Help of machine learning. In: 2023 International Conference on Sustainable Computing and Smart Systems (ICSCSS), IEEE, 333–340. 2023 Jun 14. https://doi.org/10.1109/icscss57650.2023.10169500
Cohen G (2021) Optimizing candlesticks patterns for Bitcoin’s trading systems. Rev Quant Financ Acc 57(3):1155–1167. https://doi.org/10.1007/s11156-021-00973-6
Cagliero L, Fior J, Garza P (2023) Shortlisting machine learning-based stock trading recommendations using candlestick pattern recognition. Expert Syst Appl [online] 216:119493. https://doi.org/10.1016/j.eswa.2022.119493
Ke G, Meng Q et al (2017) LightGBM: a highly efficient gradient boosting decision tree. Adv Neural Info Process Syst [online] 30. Available at: https://proceedings.neurips.cc/paper/2017/hash/6449f44a102fde848669bdd9eb6b76fa-Abstract.html
Han Y, Kim J (2021) Developing a XGBoost trading system based on N-period volatility labeling in the stock market. J Korean Data Info Sci Soc 32(5):1049–1070. https://doi.org/10.7465/jkdi.2021.32.5.1049
Alonso-Monsalve S, Suárez-Cetrulo AL, Cervantes A, Quintana D (2020) Convolution on neural networks for high-frequency trend prediction of cryptocurrency exchange rates using technical indicators. Expert Syst Appl 149:113250. https://doi.org/10.1016/j.eswa.2020.113250
Ozer F, Okan Sakar C (2022) An automated cryptocurrency trading system based on the detection of unusual price movements with a time-series clustering-based approach. Expert Syst Appl 200:117017. https://doi.org/10.1016/j.eswa.2022.117017
Jaquart P, Dann D, Weinhardt C (2021) Short-term bitcoin market prediction via machine learning. J Financ Data Sci 7:45–66. https://doi.org/10.1016/j.jfds.2021.03.001
Akyildirim E, Goncu A, Sensoy A (2020) Prediction of cryptocurrency returns using machine learning. Ann Oper Res 297:3–36. https://doi.org/10.1007/s10479-020-03575-y
Cavalli S, Amoretti M (2020) CNN-based multivariate data analysis for bitcoin trend prediction. Appl Soft Comput 101:107065. https://doi.org/10.1016/j.asoc.2020.107065
Parente M, Rizzuti L, Trerotola M (2024) A profitable trading algorithm for cryptocurrencies using a neural network model. Expert Syst Appl 238:121806–121806. https://doi.org/10.1016/j.eswa.2023.121806
Author information
Authors and Affiliations
Contributions
E. Saberi conceptualized and designed the study, collected and analyzed the data, and wrote the manuscript. J. Pirgazi assisted with data analysis and interpretation and provided critical revisions to the manuscript. A. Ghanbari contributed to the study design. All authors read and approved the final version of the manuscript.
Corresponding author
Ethics declarations
Conflict of interest
The authors declare no competing interests.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.
About this article
Cite this article
Saberi, E., Pirgazi, J. & Ghanbari sorkhi, A. A machine learning approach for trading in financial markets using dynamic threshold breakout labeling. J Supercomput 80, 25188–25221 (2024). https://doi.org/10.1007/s11227-024-06403-3
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11227-024-06403-3