Candlestick Pattern Recognition in Cryptocurrency Price Time-Series Data Using Rule-Based Data Analysis Methods

: In the rapidly evolving domain of cryptocurrency trading, accurate market data analysis is crucial for informed decision making. Candlestick patterns, a cornerstone of technical analysis, serve as visual representations of market sentiment and potential price movements. However, the sheer volume and complexity of cryptocurrency price time-series data presents a significant challenge to traders and analysts alike. This paper introduces an innovative rule-based methodology for recognizing candlestick patterns in cryptocurrency markets using Python. By focusing on Ethereum, Bitcoin


Introduction 1.Motivation
The cryptocurrency market, distinguished by its emerging status and decentralized framework, poses a significant analytical challenge due to its intrinsic volatility and the vast amount of data it produces [1,2].Unlike conventional financial markets, which are governed by well-defined regulatory structures and demonstrate more stable behavior [3], the cryptocurrency environment experiences rapid changes in prices and trading volumes, influenced by a mixture of elements such as market sentiment [4], technological progress [5], and regulatory ambiguities [6].Inevitable volatility, combined with continuous and highfrequency trading [7], leads to a surplus of data that can exceed the capabilities of traditional analysis methods [8].The complexity of these data intensifies the difficulty, which requires advanced tools and techniques to derive valuable information and identify fundamental trends [9,10].Therefore, analyzing cryptocurrency markets requires a sophisticated approach that considers both the dynamic nature of the data and the changing market conditions [11].
Candlestick patterns, derived from ancient Japanese rice trading techniques, have become a fundamental aspect of technical analysis in modern financial markets [12].These graphical representations of price fluctuations within certain time frames offer crucial insight into market mood and prospective trends [13].Each candlestick consists of a body that shows the range from the opening to the closing prices and wicks that illustrate the highest and lowest prices achieved during the interval.The arrangement of these components, as well as their sizes and placements, creates unique patterns that have been scientifically proven to associate with particular market actions [14].For example, the "hammer" pattern, marked by a short body and a lengthy lower wick, typically indicates a likely bullish reversal, hinting that buying forces are beginning to surpass selling forces [15].In contrast, the "shooting star" pattern, known for its small body and extended upper wick, signals a possible bearish reversal, suggesting that sale pressures are intensifying [16].The ability of candlestick patterns to graphically represent intricate market dynamics and offer predictions on future price movements makes them an essential resource for traders and analysts in the unpredictable realm of cryptocurrency trading.
Candlestick patterns provide crucial information on market behavior, but their practical application in trading strategies is often compromised by the inherent drawbacks of manual analysis [17].The personal interpretation of these patterns, along with the cognitive biases of traders, can result in inconsistencies and errors in their identification and interpretation [18].Furthermore, the overwhelming amount and speed of data in cryptocurrency markets make the manual recognition of patterns tedious and inefficient, frequently causing missed opportunities or slow reactions to market shifts [19].Consequently, the demand for automated pattern recognition systems is clearly rising.These systems utilize computational algorithms to impartially identify and analyze candlestick patterns, removing human bias and facilitating the instantaneous analysis of extensive data [20].Automation in pattern recognition not only improves the precision and effectiveness of technical analysis but also enables traders to make better informed and prompt decisions, significantly improving trading outcomes in volatile cryptocurrency markets.
Motivated by the identified challenges and opportunities, this study aimed to establish a reliable and effective approach for the automatic recognition of candlestick patterns using Python, a highly adaptable programming language [21].Python is known for its rich libraries and frameworks that facilitate data analysis and machine learning, offering a robust set of tools for the development and execution of algorithms that can detect intricate patterns in large datasets [22].Using libraries like Pandas and NumPy for data handling and analysis, and based on well-founded technical analysis techniques [23], this research was designed to formulate a rule-based system that automatically identifies and categorizes candlestick patterns in cryptocurrency market data [24].The primary objective is to equip traders and analysts with a reliable and unbiased tool that improves their ability to analyze market signals and make informed decisions in the dynamic cryptocurrency market.

Objectives and Structure
This study addresses the challenges associated with the manual recognition of candlestick patterns by developing a rule-based data analysis approach for their automated detection in the time-series data of cryptocurrency prices.The main goal was to improve the precision and efficiency of technical analysis in this unpredictable and data-intensive cryptocurrency market.Using the computational power of Python and its libraries, this research aimed to establish a reliable system that can impartially detect crucial candlestick patterns, offering traders and analysts critical insights into possible market trends and opportunities for trading.
The structure of this paper is as follows: • Section 2 provides a comprehensive review of the relevant literature on candlestick pattern recognition and its applications in financial markets.• Section 3 delves into the research methodology, detailing the data acquisition process, the design of rule-based algorithms, and the implementation of these algorithms for pattern recognition.• Section 4 presents the results of the analysis and demonstrates the effectiveness of the methodology in identifying key candlestick patterns.
• Section 5 discusses the implications of the findings and their potential applications in cryptocurrency trading strategies.• Section 6 concludes the article by summarizing the key findings and contributions, discussing the limitations of the investigation, and highlighting potential avenues for future work.

State-of-the-Art Approaches
The prediction of cryptocurrency prices has become a significant area of research and development, driven by the increasing use of digital assets and the potential for substantial financial returns [25][26][27].Various strategies have been explored, each presenting its own benefits and drawbacks.Traditional time-series analysis techniques, such as the autoregressive integrated moving average (ARIMA) and exponential smoothing, use historical price data to predict future movements [28,29].Machine learning methods, such as support vector machines (SVMs) and random forests, enhance predictive power by analyzing complex patterns and inter-relationships in the data [30,31].Deep learning approaches, particularly recurrent neural networks (RNNs) such as long-short-term memory (LSTM) networks, are noted for their ability to detect long-term dependencies and temporal sequences in data [32][33][34][35].Sentiment analysis methods further improve prediction models by incorporating market sentiment from social networks and news outlets [36,37].Despite their strengths, the unpredictable nature and complexity of cryptocurrency markets still present challenges to accurate and reliable price forecasting.
These quantitative methods, while valuable, often lack the intuitive visual representation and interpretability provided by candlestick patterns.Originating from Japanese rice trading in the 18th century, candlestick charting has become a fundamental component of technical analysis in modern financial markets [38].Its historical significance lies in its ability to graphically depict price fluctuations and market emotions through unique patterns determined by open, high, low, and closed prices within specific time frames [39].Patterns such as the "hammer" and the "shooting star" have been consistently observed and recorded, offering insights into potential trend reversals, continuations, and moments of uncertainty [40].Initially applied to commodity price analysis, candlestick charting has now crossed geographical and asset class boundaries, becoming a crucial tool for technical analysts in various financial sectors, including stocks, foreign exchange, and cryptocurrencies [41].The enduring value of these patterns lies in their ability to decode complex market behaviors, providing traders with a graphical language to interpret price movements and make informed trading decisions [42].
Recognizing the importance of candlestick patterns, researchers have developed various approaches to automate their identification and analysis.Rule-based systems, which rely on predefined sets of conditions to identify specific patterns, offer transparency and interpretability.However, these systems can be rigid and may struggle to adapt to evolving market dynamics or identify subtle pattern variations.Machine learning techniques, such as support vector machines and decision trees, offer greater flexibility and can learn from historical data to identify patterns with higher accuracy.However, these models often lack transparency, making it difficult to understand the rationale behind their predictions.Deep learning models, including convolutional neural networks (CNNs) and recurrent neural networks (RNNs), provide even greater potential for pattern recognition and prediction, but require large amounts of data and computational resources, making them complex to interpret and implement.
In the realms of data analysis and algorithmic trading, Python has established itself as a leading platform for researchers and practitioners [43].Its widespread adoption is due to its user-friendly syntax, comprehensive libraries, and strong community support.Key libraries such as Pandas and NumPy are essential, offering powerful capabilities for data handling and numerical analysis [44].Pandas provides data structures such as DataFrames for the effective management and examination of tabular data, while NumPy supports complex mathematical functions through arrays and matrices [45].Using Python alongside these libraries enables researchers to manage and scrutinize large datasets, derive significant insights, and create complex algorithms to identify patterns and make forecasts [46].As a result, Python, combined with Pandas and NumPy, has become crucial for those engaged in quantitative finance and algorithmic trading, particularly in analyzing candlestick patterns within the cryptocurrency markets.
Despite the potential of candlestick patterns and automated recognition systems, it is crucial to acknowledge the inherent limitations of pattern-oriented trading strategies [47].These patterns, while empirically observed to correlate with certain market behaviors, do not guarantee future outcomes and should not be used solely to make trading decisions [48].Market dynamics are influenced by numerous factors, including macroeconomic events, geopolitical developments, and evolving investor sentiment, which may not be fully captured by candlestick patterns alone [49].Furthermore, the effectiveness of these patterns can vary depending on the specific asset class, market conditions, and the time frame considered [50].Therefore, it is imperative for traders and analysts to approach patternbased strategies with a critical mindset, incorporating additional forms of analysis and risk management techniques to ensure comprehensive and informed decision making.
Within the domain of stock market and cryptocurrency trading, numerous studies have investigated candlestick patterns, utilizing various rules and conditions to identify these patterns.The literature covers a wide range of research, from traditional technical trading rules [51] to modern algorithmic trading patterns in cryptocurrencies.These studies delve into topics such as herding behavior in cryptocurrency markets [52], deep reinforcement learning for stock trading strategies [53], and machine learning-based candlestick pattern recognition models [20].
Researchers have introduced innovative approaches such as fuzzy logic-based trading systems [54], pattern recognition using technical analysis [55], and deep predictor models for the prediction of price movement [56].In addition, studies have examined the profitability of candlestick patterns [42], the application of CNN-LSTM models for the prediction of financial trade positions [48], and adaptive financial trading systems using deep reinforcement learning [57].
Moreover, the literature explores subjects such as pattern recognition in micro-trading behaviors before stock price jumps [58], wash trading detection in cryptocurrency markets [59], and the utilization of trading rules in stock market trading strategies [60].Studies have also evaluated the value of technical analysis in stock markets [61], the effectiveness of candlestick technical trading strategies [62], and the creation of expert advisors based on candlestick patterns [46].
Furthermore, research has delved into investment decision making using fuzzy candlestick patterns and genetic algorithms [63], stock market trading rules based on pattern recognition and technical analysis [64], and profitable candlestick trading strategies [39].Detecting wash trades in financial markets using digraphs and dynamic programming has also been a subject of investigation [65].
In conclusion, the existing body of the literature provides a comprehensive collection of studies on candlestick patterns in trading, encompassing traditional technical rules and cutting-edge machine learning and deep learning approaches.These studies collectively improve our understanding of rule-based candlestick pattern recognition and offer a diverse set of methodologies and findings for researchers and practitioners in the field.
This study introduces an innovative approach to candlestick pattern recognition specifically tailored for the cryptocurrency market.Unlike existing methods, the proposed system leverages a flexible and adaptable rule-based framework that accounts for the high volatility and unique characteristics of the cryptocurrency market.This approach provides several distinct advantages:

•
This rule-based system allows traders to easily understand the criteria used for pattern identification, fostering trust and confidence in the system's output.This contrasts with more complex machine learning models that often operate as "black boxes", making it difficult to discern the underlying decision-making process.
• This rule-based approach offers greater flexibility for customization and adaptation.
Traders can modify existing rules or introduce new ones to accommodate specific trading strategies or adapt to evolving market conditions.This adaptability is crucial in the dynamic and ever-changing landscape of cryptocurrency markets.

•
In using Python and its robust libraries such as Pandas and NumPy, this approach efficiently handles large datasets, performs complex numerical analyses, and supports the development of scalable pattern recognition algorithms.

•
The methodology was rigorously tested on extensive historical data, demonstrating its effectiveness in identifying key candlestick patterns.Detailed statistical analyzes validate the accuracy and reliability of the system, ensuring its practical applicability in real-world trading scenarios.
This exploration of existing approaches to cryptocurrency price prediction and analysis highlights the need for a balanced approach that combines the strengths of different methodologies.This research focused on rule-based data analysis methods for candlestick pattern recognition in cryptocurrency price time-series data, aiming to provide a practical and accessible tool that complements existing quantitative methods with the intuitive visual representation and interpretability of candlestick patterns.in using the power of Python and its libraries, a system was developed that enhances technical analysis, promotes transparency, and serves as a foundation for further advancements in this dynamic and evolving field.

Dataset
The foundation of the research methodology is the development and implementation of rule-based algorithms to identify candlestick patterns in the time-series data of cryptocurrency prices.Ethereum was selected as the primary focus due to its substantial market capitalization, broad adoption, and the detailed nature of its price data.These characteristics provide a solid foundation for demonstrating the efficacy of the approach.The volatility of Ethereum's price and the complex dynamics of its market make it an ideal subject for applying and testing pattern recognition algorithms.To evaluate the generalizability of the proposed methods in different types of cryptocurrencies, Bitcoin (BTC) and Litecoin (LTC) were also included.
Bitcoin was chosen because of its status as the primary cryptocurrency by market capitalization and its historical significance in the cryptocurrency market.Its extensive trading history and influence on the market make it a crucial benchmark for comparison.Litecoin was selected because of its technological similarities with Bitcoin and its presence as a major cryptocurrency with a substantial market following.Including these three cryptocurrencies allows for a comprehensive evaluation of the effectiveness of the methods across different market conditions and asset types.
Data for Ethereum (ETH), Bitcoin (BTC), and Litecoin (LTC) were collected from 1 January 2013 to 31 May 2024.These datasets provide a comprehensive view of the market, including various market conditions and events.Historical price data were acquired using APIs from reliable cryptocurrency data providers such as Yahoo Finance.These providers offer high-frequency and detailed data, ensuring the accuracy and completeness of the dataset.The data collected included the open price, high price, low price, close price, and volume.The data frequency was daily, allowing for the detailed analysis and identification of candlestick patterns.
Data cleaning is a critical step taken to ensure the validity and reliability of the analysis.Missing values were handled by applying forward and backward filling techniques, which help maintain continuity in the dataset.In cases where missing values persisted for extended periods, those segments were excluded from the analysis to prevent any distortion of the results.
The identification and treatment of outliers were performed using the Interquartile Range (IQR) method.This method helps maintain data consistency and precision by identifying data points that lie significantly outside the interquartile range.To address concerns regarding the limitations of the IQR method, particularly its susceptibility to skewed data distributions, we performed a thorough examination of the data's distribution characteristics.This step ensured that the removal of outliers did not inadvertently exclude true signals that are crucial for accurate pattern recognition.Approximately 0.9% to 2.2% of the data points were identified and excluded as outliers, with the specific percentage varying by cryptocurrency.This exclusion was deemed necessary due to the significant deviation of these points from the median, which could introduce noise and affect the integrity of the analysis.Table 1 summarizes the data cleaning process.We chose these methods based on their effectiveness and relevance in handling the specific challenges presented by the cryptocurrency market data.Forward and backward filling techniques for missing values are widely used because of their simplicity and efficiency in maintaining data continuity.The IQR method, despite its limitations, is a standard approach for outlier detection due to its robustness against non-normal distributions when carefully examined and adjusted for data skewness.
In addition, we used several validation checks throughout the data cleaning process to ensure the robustness of our dataset.These checks included cross-verifying the cleaned data with raw data sources to confirm that no critical information was lost during the cleaning process.This step was crucial to maintaining the integrity of the dataset and to ensure that the subsequent analysis was based on accurate and reliable data.
The methodology unfolds in several pivotal steps: data acquisition and preprocessing, defining and implementing rule-based algorithms, and analyzing these algorithms through historical data.In using Python and libraries such as Pandas and Numpy, rule-based algorithms were developed to automate the identification of selected candlestick patterns.These algorithms utilize the mathematical relationships between the opening, closing, high, and low prices of candlesticks to detect patterns.The flexibility and computational power of Python, along with the advanced data manipulation capabilities of Pandas and Numpy, support the development of robust and scalable pattern recognition solutions.
The proposed methodology involves running algorithms on historical Ethereum, Bitcoin, and Litecoin price data and performing a visual analysis of the identified patterns.This approach assesses the practicality of the algorithms in real-world trading scenarios.By examining the occurrences of these patterns and their correspondence with market movements, the utility of the methodology to provide meaningful trading insights was evaluated.
The choice to concentrate on Ethereum stems from its liquidity, market volatility, and extensive trading data, which are well suited to identify unique candlestick patterns.The inclusion of Bitcoin and Litecoin enhances the robustness of the analysis by allowing the evaluation of the methods' performance across different cryptocurrencies.This shift toward a more analytical method underscores the goal of improving the comprehension and application of candlestick patterns in trading strategies.
After outlining the reasons for focusing on Ethereum, Bitcoin, and Litecoin, the discourse shifts to a detailed examination of the candlestick patterns being studied.This section elaborates on the architecture, historical importance, and theoretical impacts of each pattern on the market dynamics of these cryptocurrencies, offering a detailed look into how these patterns play a role in the analysis and the wider domain of cryptocurrency trading.

Candlestick Patterns
Candlestick patterns are identified through distinct arrangements of one or more candlesticks, each symbolizing the price movement within a specific time period.This study focused on three principal patterns recognized for their forecasting ability in trading contexts: The "Advance Block" is a bearish candlestick formation often seen during an uptrend, indicating a weakening in the upward price momentum, which may signal a forthcoming reversal.It consists of three progressively growing candlesticks with successively higher closings.Each candlestick in this pattern has a decreasing real body and a growing upper shadow, suggesting a shift in power from buyers to sellers, who are increasingly challenging the rising prices.
The formula for identifying an Advance Block pattern involves a series of conditions that focus on the high (H), low (L), open (O), and closed (C) prices of the candlesticks, as well as their average high (AVGH21) and average low (AVGL21) over a specified period.
Here is a breakdown of the formula and its components in a unified scientific view: 1.
The range (difference between the high and low) of the current candlestick is greater than the average range of the last 21 candlesticks.This indicates an increase in volatility in the current session.
The following criteria confirm that the initial two candlesticks in the sequence possess real bodies (the net difference between the opening and closing prices) exceeding half of their overall extents.This indicates intense purchasing or selling actions during these intervals.
The closing prices are in ascending order, with each candlestick closing higher than the previous one, illustrating the uptrend.
The open of the second candlestick is higher than the open of the first, but still below the close of the first, indicating a continuation of the uptrend but with diminishing momentum.
O1 > O2 AND O1 < C2 For the third candlestick, the open is higher than the open of the second candlestick and lower than the close of the second, reinforcing the pattern of diminishing upward momentum.O > O1 AND O < C1 6.
These conditions compare the ranges of the candlesticks, ensuring that each successive candlestick has a smaller range than the previous one, adjusted for a factor of 0.8.This criterion highlights the decreasing strength in the price movement.
The final conditions focus on the relationship between the closing prices and the highs and lows of the candlesticks, ensuring that the upper shadows (the difference between the high and the close) are larger than the lower shadows (the difference between the open and the low).This indicates increasing selling pressure and a potential reversal.
By meticulously applying this formula within the context of the price time series data of Ethereum, Bitcoin, and Litecoin, the rule-based algorithm can automatically identify occurrences of the "Advance Block" pattern.This provides valuable insights into potential trend reversals, enabling traders and analysts to make more informed decisions based on the observed weakening of upward momentum.
The "Doji Star" is a candlestick pattern that typically signals indecision in the market, often marking a potential reversal or a significant pause in the trend.This pattern is distinguished by its unique appearance: a single candlestick with a closing price very close to its opening price, which creates a small body, and it is typically preceded by a candlestick with a relatively large body, indicating a more definitive price movement.
To identify the "Doji Star" pattern, the following conditions must be met within the context of a time series of candlestick data.

1.
The absolute difference between the closing and opening prices of the preceding candlestick (C1 and O1) must be greater than half the total range of that candlestick.This indicates that the preceding candlestick had a large body, suggesting a stronger move in either direction.
The opening price of the current Doji candle (O) is higher than the closing price of the previous candlestick (C1), implying a gap or shift in the market sentiment since the last session's close.O > C1 The absolute difference between the closing and opening prices of the current candlestick (C and O) is less than 5% of its range.This small difference characterizes the Doji candlestick as reflecting indecision, and neither buyers nor sellers can push prices significantly in either direction.
The range of the Doji candlestick is less than 20% of the average range of the last 21 candlesticks.This condition ensures that the Doji represents a significant contrast to the prevailing volatility, highlighting the indecisiveness or equilibrium between buyers and sellers.
The "Doji Star" pattern is considered a sign of potential reversal when it appears at the top of an uptrend or at the bottom of a downtrend.Its presence is a signal to traders that the current trend may be losing momentum and that caution should be exercised.In a scientific exploration of algorithmic trading strategies, the "Doji Star" pattern can serve as a critical marker for initiating a change in position, such as closing long positions or preparing to enter short positions in anticipation of a potential trend change.
The "Evening Star" pattern is a bearish reversal pattern that occurs at the peak of an uptrend and indicates a shift from bullish to bearish market sentiment.It is a complex pattern typically composed of three candlesticks:

1.
A large bullish candlestick that continues the current uptrend.

2.
A smaller-bodied candle that opens above the previous candle's close, indicating a slowdown in upward momentum.

3.
A large bearish candlestick that closes well into the body of the first candlestick, confirming the reversal.
To algorithmically identify an "Evening Star" pattern, the following criteria must be met in the time-series data, with each condition corresponding to the candlesticks' specific characteristics in the pattern (C for close, O for open, H for high, L for low): 1.
The second candlestick (usually a star) has a close-to-open difference that is at least 70% of its total range, indicating a strong closing movement. 2.
The range of the second candlestick is greater than or equal to the average range of the last ten candlesticks (discounted by a factor of 0.2), signifying that it stands out in the context of recent volatility. 3.
The third candlestick opens below the second's closing price, and the first candlestick's close is higher than the second's close, establishing the high-water mark of the uptrend before the reversal.C1 > C2 AND O1 > C2 The third candlestick (indicative of the bearish reversal) has a range that is at least as large as the average range of the last ten candlesticks, underscoring the significance of the reversal.
The third candlestick shows a close-to-open difference that is at least 70% of its total range, which means it closed well off its highs, which is a bearish signal.
The third candlestick opens below the first candlestick's open and close, signifying a gap down and a strong bearish sentiment.
O < O1 AND O < C1 When these conditions are detected, the pattern suggests that the uptrend is running out of steam and that the sellers are beginning to take control, warning traders of a potential downturn in the price.This pattern is particularly useful in the context of an automated trading system, as it can prompt traders to take precautionary measures, such as tightening stop losses or preparing to take short positions.
In summary, this section has laid out the methodological framework for the research, detailing the rationale behind focusing on Ethereum, Bitcoin, and Litecoin, the step-by-step data acquisition and processing procedures, and the development of rule-based algorithms for automated candlestick pattern recognition.The subsequent section will dive into the application of these algorithms to the historical price data of these cryptocurrencies, presenting the results of the analysis, and demonstrating the efficacy of the methodology in identifying the key candlestick patterns discussed above.Through visual representations and insightful interpretations, the results section will illuminate the practical implications of this research and its potential to enhance decision making for traders and analysts in the cryptocurrency market.

Validation
To validate the effectiveness of the proposed rule-based methods for candlestick pattern recognition, a manually annotated dataset was used as the "ground truth".This section provides detailed information on the creation and validation of this dataset, as well as the methodology used to calculate and validate the precision, recall, and F1 scores.
To create the ground truth dataset, the historical price data for Ethereum were manually annotated, identifying specific candlestick patterns.The annotations were performed using professional charting software, enabling the precise visual identification of patterns.
To ensure the accuracy and reliability of the manually annotated dataset, the following validation methods were implemented:

•
The dataset was independently annotated by multiple experts.Discrepancies in the annotations were resolved through discussion and consensus, ensuring consistency in the identification of patterns.

•
The inter-rater agreement coefficient (Cohen's kappa) was calculated to measure the consistency between different annotators.A high kappa value indicated the strong agreement and reliability of the manual annotations.• Manual annotations were compared with historical market movements to verify their precision.This comparison ensured that the annotated patterns matched the expected price trends.
The inter-rater agreement results are presented in Table 2. • The F1 score is the harmonic mean of precision and recall, providing a single metric that balances both measures.
To validate the calculated scores, we performed a statistical comparison between the results of the automated method and the manual annotations.We generated a confusion matrix to summarize the performance of the algorithm, detailing the true positives, false positives, true negatives, and false negatives.

Results
This research aimed to develop sophisticated rule-based algorithms capable of automatically identifying candlestick patterns in the price time-series data for Ethereum, Bitcoin, and Litecoin.The primary objective was to simplify and enhance the accuracy of technical analysis in cryptocurrency markets by leveraging advanced data analysis tech-niques.Notable success was achieved in automating the identification of key candlestick patterns crucial to predicting market movements.
This section presents the results of the research efforts, showcasing examples of how the algorithm successfully identified various candlestick patterns within the market data of Ethereum, Bitcoin, and Litecoin.These results validate the effectiveness of the rule-based approach and highlight the potential to implement such automated systems in real-world trading environments.Through providing concrete examples of pattern recognition, the aim was to demonstrate the practical implications of the research and the significant advantages it offers traders and analysts in the cryptocurrency domain.
Overall, the results demonstrate the effectiveness and reliability of the rule-based algorithms across different cryptocurrencies.The visual representations and performance metrics confirm the system's potential for real-world trading applications, offering traders and analysts valuable tools for technical analysis in dynamic cryptocurrency markets.

Ethereum
The analysis covers the identification of patterns such as the "Advance Block", "Doji Star", and "Evening Star" in the Ethereum (ETH-USD) price time-series data.The results demonstrate the robustness and adaptability of the algorithm to different cryptocurrencies, reinforcing its utility in diverse market conditions.
Figures 1-3 illustrate the detection of the "Advance Block", "Doji Star", and "Evening Star" candlestick patterns, respectively, in the Ethereum price time-series data.Table 3 provides the precision, recall, and F1 scores for the pattern recognition algorithms applied to Ethereum.The results for Ethereum validate the effectiveness of the rule-based algorithms in accurately identifying the targeted candlestick patterns within Ethereum's price data.The visual representations provide clear examples of how the automated system successfully detects these patterns, offering valuable insight into potential trend reversals and shifts in market sentiment.These confusion matrices provide a comprehensive view of the algorithm's performance, highlighting its accuracy and reliability in identifying candlestick patterns in Ethereum's price data.

Bitcoin
The analysis also covered the identification of patterns in the Bitcoin (BTC-USD) price time-series data.The results demonstrate the robustness and adaptability of the algorithm to different cryptocurrencies.
Figures 4-6 illustrate the detection of the candlestick patterns "Advance Block", "Doji Star", and "Evening Star", respectively, in the Bitcoin price time-series data.Table 7 provides the precision, recall, and F1 scores for the pattern recognition algorithms applied to Bitcoin.The results for Bitcoin confirm the algorithm's effectiveness in accurately identifying candlestick patterns, providing insights into potential trend reversals and shifts in market sentiment.

Predicted Positive Predicted Negative
Actual Positive 100 30 Actual Negative 25 85 These confusion matrices provide a comprehensive view of the algorithm's performance, highlighting its accuracy and reliability in identifying candlestick patterns in Bitcoin's price data.

Litecoin
Finally, the analysis included the identification of patterns in the Litecoin (LTC-USD) price time-series data.The results further demonstrate the versatility and effectiveness of the algorithm.
Figures 7-9 illustrate the detection of the candlestick patterns "Advance Block", "Doji Star", and "Evening Star", respectively, in the Litecoin price time-series data.These confusion matrices provide a comprehensive view of the algorithm's performance, highlighting its accuracy and reliability in identifying candlestick patterns in the Litecoin price data.

Discussion
The findings presented in the previous section offer strong evidence supporting the effectiveness of the rule-based methodology in accurately detecting essential candlestick patterns in the time-series data for Ethereum, Bitcoin, and Litecoin.The system automatically identified occurrences of the 'Advance Block', 'Doji Star', and 'Evening Star' patterns, which have been recognized in earlier research as crucial predictors of likely trend reversals or changes in market sentiment.These results align with previous studies demonstrating the predictive power of candlestick patterns in forecasting price dynamics and helping trading strategies.This study improves the existing literature by showing the practicality and precision of using a rule-based system for automated pattern recognition.The graphical depictions of these patterns in relation to the cryptocurrencies' price fluctuations provide useful insights for this method being applied by traders and analysts.
The rule-based methodology used in this research offers several distinct strengths and advantages over alternative approaches to candlestick pattern recognition.Primarily, the transparency and interpretability of the algorithms provide a clear understanding of the rationale behind each pattern identification.This contrasts sharply with more complex machine learning models, which often operate as "black boxes", making it difficult to discern the underlying decision-making process.The explicit nature of the rule-based system allows traders and analysts to comprehend easily the specific criteria used for pattern detection, fostering trust and confidence in the system's outputs.Furthermore, the rule-based approach offers greater flexibility for customization and adaptation.Traders can modify existing rules or introduce new ones to accommodate specific trading strategies or adapt to evolving market conditions.This level of adaptability is crucial in the dynamic and ever-changing landscape of cryptocurrency markets.
Despite its strengths, the rule-based methodology for candlestick pattern recognition is not without limitations and challenges.One primary concern is the potential for false signals, where the algorithm identifies patterns that ultimately do not lead to expected market movements.This can occur due to the inherent complexity and noise present in financial markets, leading to misinterpretations of candlestick formations.Furthermore, the effectiveness of the rule-based system depends on the careful selection and optimization of the parameters within the algorithms.Improperly defined parameters can result in overly sensitive or overly restrictive pattern detection, affecting the accuracy and reliability of the system.Furthermore, the rule-based approach may struggle to capture all the nuances of the market context and the dynamic interaction of various factors influencing price movements.Therefore, it is crucial to recognize that candlestick patterns, while informative, should not be relied upon solely to make trading decisions.
Looking ahead, several avenues for further research and development could enhance the capabilities and robustness of the rule-based candlestick pattern recognition system.One potential direction involves expanding the scope of the system to encompass a wider range of candlestick patterns beyond the three explored in this study.To further enhance understanding of the rule-based system's performance and potential, future research should consider broadening the accuracy comparisons with other methods, conducting more extensive experiments across different market conditions and asset classes, and collecting a larger set of experimental data for a more comprehensive quantitative evaluation.In addition, incorporating other technical indicators, such as moving averages or the relative strength index (RSI), could provide a more comprehensive and nuanced analysis of market trends and potential turning points.Another promising avenue lies in the integration of machine learning and deep learning techniques.Using algorithms such as convolutional neural networks (CNNs) and recurrent neural networks (RNNs) can improve the pattern detection accuracy and even predict future price movements with greater precision.In addi-tion, incorporating sentiment analysis and alternative data sources could provide valuable contextual information for interpreting candlestick patterns and refining trading strategies.As the field of automated technical analysis continues to evolve, ongoing research and development efforts will be crucial to ensuring the effectiveness and adaptability of these systems in the dynamic world of cryptocurrency trading.
Table 15 summarizes the performance metrics for the candlestick pattern recognition algorithms applied to Ethereum, Bitcoin, and Litecoin, providing a comprehensive view of the system's effectiveness across different cryptocurrencies.The results in Table 15 demonstrate the consistent performance of the system in different cryptocurrencies, highlighting its adaptability and robustness.These metrics provide strong evidence for the rule-based methodology's potential in real-world trading applications, offering traders and analysts valuable tools for technical analysis in dynamic cryptocurrency markets.

Conclusions
The research presented in this paper successfully demonstrated the efficacy of a rulebased methodology to accurately identify key candlestick patterns within the price data of Ethereum, Bitcoin, and Litecoin.The automated system offers significant advantages, including transparency, interpretability, and adaptability, making it a valuable tool for traders and analysts seeking to enhance their technical analysis capabilities and gain insight into potential market movements.The validation of this methodology across different cryptocurrencies underlines its robustness and potential applicability in realworld trading scenarios.
Although the system has proven to be effective, it is not devoid of limitations.The potential for false signals and the dependency on parameter optimization highlight areas for caution.These limitations underscore the need for a comprehensive and nuanced approach to implementing candlestick pattern recognition strategies in trading practices.Candlestick patterns, while insightful, should not be the sole basis for trading decisions.They must be integrated with other forms of analysis and risk management strategies to form a holistic trading approach.
Looking to the future, several promising directions can further enhance the rule-based candlestick pattern recognition system:

1.
Comparative Validation: There is a critical need to compare and validate the proposed rule-based approach against other models, including machine learning algorithms, statistical methods, and manual identification.Such comparative studies will help establish the relative efficacy and efficiency of this rule-based approach, providing insights into its strengths and areas for improvement.

2.
Broader Testing Scenarios: The current study can be expanded by testing the methodology on different samples that represent various market conditions, such as during the COVID-19 pandemic or the Russian-Ukrainian war.These tests will help assess the adaptability and effectiveness of the system under diverse and volatile market scenarios, enhancing its applicability and reliability.

3.
Integration with Other Analytical Tools: Incorporating other technical indicators and data analysis tools can provide a more comprehensive analysis framework.Tools such as moving averages, the relative strength index (RSI), and sentiment analysis can complement candlestick pattern recognition, providing a deeper understanding of market dynamics.4.
Automated Trading System Development: Future work could focus on integrating the rule-based candlestick pattern recognition system into an automated trading system.This integration can facilitate real-time decision making and potentially improve the profitability and efficiency of trading strategies in the cryptocurrency markets.
Future research could explore the application of our rule-based candlestick pattern recognition methodology to various emerging sectors within the cryptocurrency and blockchain ecosystem.Notable areas include fan tokens [66], where the intersection of blockchain and sports represents a growing area of interest.Furthermore, volatile NFTs in the gaming sector [67], present a promising avenue for applying our analytical methods.The financial instruments within the metaverse offer a unique landscape for analysis [68].Furthermore, the interconnection between decentralized finance (DeFi), cryptocurrency, stock, and safe haven assets underscores the relevance of our approach in analyzing DeFi tokens.
In conclusion, this study contributes to the field of computational finance by offering a practical and accessible approach to automated candlestick pattern recognition.The developed system not only aids traders and analysts in their technical analysis but also sets the stage for further advancements in automated trading strategies within the dynamic and evolving cryptocurrency markets.The insights gained from this research pave the way for future explorations and developments, promising to enhance our understanding of market behavior in the complex world of finance.

Figure 3 .
Figure 3. Automatic detection of "Evening Star" candlestick patterns in Ethereum (ETH-USD) price time series.Confusion matrices shown in Tables 4-6 were generated for each pattern to further substantiate the performance of the rule-based algorithms.These matrices provide a detailed breakdown of the true positives, false positives, true negatives, and false negatives for the Advance Block, Doji Star, and Evening Star patterns respectively.These confusion matrices provide a comprehensive view of the algorithm's performance, highlighting its accuracy and reliability in identifying candlestick patterns in Ethereum's price data.

Figure 6 .
Figure 6.Automatic detection of "Evening Star" candlestick patterns in Bitcoin (BTC-USD) price time series.Confusion matrices shown in Tables 8-10 were generated for each pattern to further validate the performance of the rule-based algorithms.These matrices provide a detailed breakdown of the true positives, false positives, true negatives, and false negatives for the Advance Block, Doji Star, and Evening Star patterns respectively.

Figure 9 .
Figure 9. Automatic detection of "Evening Star" candlestick patterns in Litecoin (LTC-USD) price time series.The results for Litecoin further validate the rule-based algorithms' capability to accurately identify candlestick patterns, providing valuable insights into potential market movements.Confusion matrices shown in Tables 12-14 were generated for each pattern to further validate the performance of the rule-based algorithms.These matrices provide a detailed breakdown of the true positives, false positives, true negatives, and false negatives for the Advance Block, Doji Star, and Evening Star patterns respectively.

Table 1 .
Summary of data cleaning process.

Table 11
provides the precision, recall, and F1 scores for the pattern recognition algorithms applied to Litecoin.