Abstract
Although cryptocurrency trading can be highly profitable, it carries significant risks due to extreme price fluctuations and high degree of market noise. To increase profits and minimize risks, traders typically use various forecasting methods, such as technical analysis and Machine Learning (ML), but develo** effective trading strategies in noisy markets still remains a challenging task. Recently, Deep Reinforcement Learning (DRL) agents have achieved high performance on challenging tasks, including algorithmic trading, however it requires significant amount of time and high-quality data to train effectively. Additionally, DRL agents lack explainability, making them a less popular option for traders. The purpose of this paper is to address these challenges by proposing a reliable trading framework. Our framework, named UNSURE, generates high-quality features from candlestick data using technical analysis along with a novel parameterization method, and then exploits high price fluctuations by combining three ML components: A) Unsupervised component, which further improves feature quality by clustering market data; B) DRL component, which is responsible for training agents that open Buy or Short positions; C) Supervised component, which estimates price fluctuations in order to open and close positions efficiently, while reducing trading uncertainty. We demonstrate the effectiveness of this approach on nine cryptocurrency markets using several risk-adjusted performance metrics.
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1007%2Fs10489-024-05407-z/MediaObjects/10489_2024_5407_Fig1_HTML.png)
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1007%2Fs10489-024-05407-z/MediaObjects/10489_2024_5407_Fig2_HTML.png)
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1007%2Fs10489-024-05407-z/MediaObjects/10489_2024_5407_Figd_HTML.png)
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1007%2Fs10489-024-05407-z/MediaObjects/10489_2024_5407_Fige_HTML.png)
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1007%2Fs10489-024-05407-z/MediaObjects/10489_2024_5407_Fig3_HTML.png)
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1007%2Fs10489-024-05407-z/MediaObjects/10489_2024_5407_Fig4_HTML.png)
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1007%2Fs10489-024-05407-z/MediaObjects/10489_2024_5407_Fig5_HTML.png)
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1007%2Fs10489-024-05407-z/MediaObjects/10489_2024_5407_Fig6_HTML.png)
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1007%2Fs10489-024-05407-z/MediaObjects/10489_2024_5407_Fig7_HTML.png)
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1007%2Fs10489-024-05407-z/MediaObjects/10489_2024_5407_Fig8_HTML.png)
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1007%2Fs10489-024-05407-z/MediaObjects/10489_2024_5407_Fig9_HTML.png)
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1007%2Fs10489-024-05407-z/MediaObjects/10489_2024_5407_Fig10_HTML.png)
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1007%2Fs10489-024-05407-z/MediaObjects/10489_2024_5407_Fig11_HTML.png)
Similar content being viewed by others
Availability of data and material
All data and materials required for this research are provided alongside with the code.
Code Availibility
Custom code.
Notes
Candlestick data describe the price movements using Open, High, Low and Close price and Volume.
Shorting a position involves borrowing an amount of shares and selling it, with the expectation that its price will decrease.
Buy-Low-Sell-High is the most common strategy, where trader buy an asset when its price is low and sell it when the price is high
References
Bai S, Kolter JZ, Koltun V (2018) An empirical evaluation of generic convolutional and recurrent networks for sequence modeling. ar**v preprint ar**v: Preprint on webpage at https://arxiv.org/pdf/1803.01271.pdf, ar**v:1803.01271
Betancourt C, Chen WH (2021) Deep reinforcement learning for portfolio management of markets with a dynamic number of assets. Expert Syst Appl 164:114002
Boukas I, Ernst D, Théate T et al (2021) A deep reinforcement learning framework for continuous intraday market bidding. Machine Learn 110:2335–2387
Bu SJ, Cho SB (2018) Learning optimal q-function using deep boltzmann machine for reliable trading of cryptocurrency. In: Intelligent data engineering and automated learning–IDEAL 2018: 19th International Conference, Madrid, Spain, November 21–23, 2018, Proceedings, Part I 19, Springer, pp 468–480
Chandar SK (2022) Convolutional neural network for stock trading using technical indicators. Automated Softw Eng 29:1–14
Fang F, Ventre C, Basios M et al (2022) Cryptocurrency trading: a comprehensive survey. Financial Innovation 8(1):1–59
Guarino A, Grilli L, Santoro D et al (2022) To learn or not to learn? evaluating autonomous, adaptive, automated traders in cryptocurrencies financial bubbles. Neural Comput Appl 34(23):20715–20756
Heuillet A, Couthouis F, Díaz-Rodríguez N (2021) Explainability in deep reinforcement learning. Knowledge-Based Syst 214:106685
Hirchoua B, Ouhbi B, Frikh B (2021) Deep reinforcement learning based trading agents: Risk curiosity driven learning for financial rules-based policy. Expert Syst Appl 170:114553
Huang JZ, Huang W, Ni J (2019) Predicting bitcoin returns using high-dimensional technical indicators. J Finance Data Sci 5(3):140–155
Jiang Z, Liang J (2017) Cryptocurrency portfolio management with deep reinforcement learning. In: 2017 Intelligent systems conference (IntelliSys), IEEE, pp 905–913
Kochliaridis V, Kouloumpris E, Vlahavas I (2023) Combining deep reinforcement learning with technical analysis and trend monitoring on cryptocurrency markets. Neural Comput Appl pp 1–18
Lazaridis A, Fachantidis A, Vlahavas I (2020) Deep reinforcement learning: A state-of-the-art walkthrough. J Artif Intell Res 69:1421–1471
Lin TC (2012) The new investor. UCLA L Rev 60:678
Mamoghli C, Daboussi S (2009) Performance measurement of hedge funds portfolios in a downside risk framework. J Wealth Manag 12(2):101
Müller M (2007) Dynamic time war**. Information retrieval for music and motion pp 69–84
Naik N, Mohan BR (2019) Optimal feature selection of technical indicator and stock prediction using machine learning technique. In: Emerging technologies in computer engineering: microservices in big data analytics: second international conference, ICETCE 2019, Jaipur, India, February 1–2, 2019, Revised Selected Papers 2, Springer, pp 261–268
Nazareth N, Reddy YYR (2023) Financial applications of machine learning: a literature review. Expert Syst Appl pp 119640
Pendharkar PC, Cusatis P (2018) Trading financial indices with reinforcement learning agents. Expert Syst Appl 103:1–13
Peng Y, Albuquerque PHM, Kimura H et al (2021) Feature selection and deep neural networks for stock price direction forecasting using technical analysis indicators. Machine Learn Appl 5:100060
Pierros I, Vlahavas I (2022) Architecture-agnostic time-step boosting: A case study in short-term load forecasting. In: Artificial neural networks and machine learning–ICANN 2022: 31st International Conference on Artificial Neural Networks, Bristol, UK, September 6–9, 2022, Proceedings, Part III, Springer, pp 556–568
Schnaubelt M (2022) Deep reinforcement learning for the optimal placement of cryptocurrency limit orders. European J Operational Res 296(3):993–1006
Somers M, Whittaker J (2007) Quantile regression for modelling distributions of profit and loss. European J Operational Res 183(3):1477–1487
Son Y, Vohra S, Vakkalagadda R et al (2022) Using transformers and deep learning with stance detection to forecast cryptocurrency price movement. In: 2022 13th International conference on information and communication technology convergence (ICTC), IEEE, pp 1–6
Zhang CX, Li J, Huang XF et al (2022) Forecasting stock volatility and value-at-risk based on temporal convolutional networks. Expert Syst Appl 207:117951
Funding
The authors did not receive support from any organization for the submitted work.
Author information
Authors and Affiliations
Contributions
Not applicable.
Corresponding author
Ethics declarations
Conflicts of interest
The authors declare they have no conflict of interests.
Financial Interest
The authors have no relevant financial or non-financial interests to disclose.
Ethics Approval
Not Applicable.
Consent to participate
Not applicable.
Consent for publication
Not applicable.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Appendices
Appendix A technical analysis
1.1 A.1 Exponential moving average - EMA
EMA is a moving average type of indicator, which is given by (A1). EMA is used to smooth price signals, in order to remove market noise.
where k is the smoothing constant and is defined as \(k=\frac{2}{N + 1}\). N parameter defines the "Look-Back" sliding window and is used in many technical indicators.
1.2 A.2 Double-exponential moving average - DEMA
DEMA is an extension of EMA, given by (A2), which attempts to remove price lag that is caused by EMA. The default value of N parameter is 14.
1.3 A.3 Moving average convergence/divergence - MACD
MACD is also a trend type of indicator, which shows the relationship between two moving averages (usually EMAs), one with a short period and one with a longer period. The mathematical formula of MACD is provided by (A3).
with \(N_{2}>> N_{1}\). The default values are \(N_{1} = 12\) and \(N_{2} = 26\)
1.4 A.4 Aroon UP/DOWN
Aroon, which is described by (A4) and (A5), identifies trend changes and estimate the strength of an upcoming trend.
with \(N_{H}\) and \(N_{L}\) being the timesteps between a new High price or Low price respectively.
1.5 A.5 Commodity channel index - CCI
CCI is also trend indicator, which estimates price trends, as well as the direction and strength of a trend. CCI is presented by (A6).
where, TP the typical price defined as \(TP(n) = \frac{High(n) + Low(n) + Close(n)}{3}\) and MD(TP) the Mean Deviation of Typical Price. Typically, \(N=20\).
1.6 A.6 Average directional index - ADX
ADX is a well know trend type of indicator that measures the strength of a trend and is given by (A7)
where MA is a Moving Average and PDI, NDI are Positive Directional Indicator and Negative Directional Indicator respectively.
1.7 A.7 Stochastic oscillator - STOCH
STOCH is a momentum indicator, given by (A8), which is usually used in large trading ranges or to capture slow moving trends.
where \(L_{N}\) and \(H_{N}\) are the minimum past value Low value and maximum past High value respectively, within a window of N prices. The default value of N is 14.
1.8 A.8 Relative strength index - RSI
RSI is a well-studied momentum indicator, which attempts to identify over-bought or over-sold securities. The mathematical formula of RSI is described by (A9)
where RS is the ratio of Average Price Increases to Average Price Drops within a window of N timesteps. The default period is 14.
1.9 A.9 On-balance volume - OBV
OBV is a volume type of indicator that measures the volume flow. Its formula is provided by (A10).
1.10 A.10 Bolliger bands - BBANDS
BBANDS is a volatility indicator, which is provided by (A11) and (A12) and measures the standard deviation of the simple moving average.
where Mean(TP) is the average typical price and Std(TP) is the standard deviation of typical price within a look back window N. The default window of Bollinger-Bands is \(N=20\).
1.11 A.11 Volume-weighted average price - VWAP
VWAP is a volume-weighted moving average, which is given by (A13) and defined as the average price of an asset weighted by the total trading volume over a period of N timesteps. The default period is usually \(N=14\).
1.12 A.12 Accumulation/distribution line - ADL
ADL is another volume-based indicator, which attempts to measure the underlying supply and demand (bids and asks). The mathematical formula of ADL indicator is described by (A14).
Appendix B Sensitivity analysis
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
Kochliaridis, V., Papadopoulou, A. & Vlahavas, I. UNSURE - A machine learning approach to cryptocurrency trading. Appl Intell 54, 5688–5710 (2024). https://doi.org/10.1007/s10489-024-05407-z
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10489-024-05407-z