Skip to main content

Advertisement

Log in

A machine learning approach for trading in financial markets using dynamic threshold breakout labeling

  • Published:
The Journal of Supercomputing Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13

Similar content being viewed by others

Data availability

No datasets were generated or analyzed during the current study.

References

  1. 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

    Article  Google Scholar 

  2. 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

    Article  Google Scholar 

  3. 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

    Article  Google Scholar 

  4. 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

    Article  Google Scholar 

  5. 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

    Article  Google Scholar 

  6. 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

    Article  Google Scholar 

  7. 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

    Article  Google Scholar 

  8. 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

    Article  Google Scholar 

  9. 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

    Article  Google Scholar 

  10. 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

  11. .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.

  12. 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.

  13. 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

    Article  Google Scholar 

  14. 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

    Article  MathSciNet  Google Scholar 

  15. 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

    Article  Google Scholar 

  16. Baldacci B, Manziuk I (2022) Adaptive trading strategies across liquidity pools. Mark Microstruct Liqu. https://doi.org/10.1142/s2382626620500082

    Article  Google Scholar 

  17. 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

    Article  Google Scholar 

  18. 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

    Article  Google Scholar 

  19. 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

    Article  Google Scholar 

  20. 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

    Article  Google Scholar 

  21. 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

    Article  Google Scholar 

  22. 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

    Article  MathSciNet  Google Scholar 

  23. 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

    Article  Google Scholar 

  24. 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

    Article  Google Scholar 

  25. 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

    Article  Google Scholar 

  26. 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

    Article  Google Scholar 

  27. 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

    Article  Google Scholar 

  28. 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

  29. 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

    Article  Google Scholar 

  30. 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

    Article  Google Scholar 

  31. 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

  32. 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

    Article  Google Scholar 

  33. 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

    Article  Google Scholar 

  34. 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

    Article  Google Scholar 

  35. 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

    Article  Google Scholar 

  36. 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

    Article  MathSciNet  Google Scholar 

  37. 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

    Article  Google Scholar 

  38. 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

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

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

Correspondence to Jamshid Pirgazi.

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.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

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

Download citation

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11227-024-06403-3

Keywords