1 Introduction

Algorithmic trading, a subset of quantitative trading, has attracted significant attention in financial markets for its potential to leverage computational techniques in making trading decisions. Machine learning (ML) techniques have emerged as powerful tools in this domain, offering the capability to analyze large data sets and extract meaningful patterns for informed trading decisions. While numerous studies have focused on improving predictive accuracy and efficiency through various ML techniques, significant gaps persist in the existing literature. Additionally, current research has shown the effectiveness of ML techniques in improving forecast accuracy and trading performance across diverse financial markets. For example, studies such as (Chou & Lin, 2019) have demonstrated improved precision in forecasting indices like the Baltic Dry Index by combining fuzzy neural networks with technical indicators. Hybrid models that integrate investor sentiment with technical indicators, explored in (Srivinay et al., 2022), have exhibited improved prediction accuracy in stock price movements. Furthermore, the utilization of metaheuristics and support vector machines in forecasting models, as demonstrated in (Sedighi et al., 2019), has contributed to more accurate stock price predictions and provided valuable trading signals to investors. Furthermore, deep learning models, particularly recurrent neural networks (RNNs) and convolutional neural networks (CNNs), have shown promising results in capturing complex patterns inherent in financial time series data (Khalid et al., 2024). However, the existing literature presents notable gaps that warrant further investigation. Firstly, many studies lack comprehensive discussions on the interpretability of the proposed models (Bhanja & Das, 2022; Das et al., 2022; Yang & Mustafa, 2022), which hinders their practical application in real-world trading scenarios. Interpretability is crucial for traders to understand the rationale behind trading decisions made by algorithmic models, especially in situations where human intervention may be necessary. Without clear interpretability, traders may lack confidence in relying solely on automated systems, limiting the adoption of algorithmic trading strategies. Second, there is a gap in addressing the computational complexity and scalability of the models (Chen et al., 2022; Shahvaroughi Farahani & Razavi Hajiagha, 2021; Srivastava et al., 2021), crucial to implementing algorithmic trading systems in high-frequency trading environments. High-frequency trading requires algorithms to execute trades in microseconds, necessitating efficient and scalable models that can process large volumes of data in real time (Singh et al., 2023). Failure to address computational complexity and scalability issues can lead to latency in trade execution, resulting in missed opportunities or suboptimal performance. Additionally, limited exploration of the impact of external factors, such as economic events or geopolitical changes, on forecast accuracy poses a challenge in developing robust trading strategies (Khandelwal et al., 2023; MABROUK et al., 2022; Zhang & Cai, 2021). Financial markets are influenced by a multitude of factors beyond historical price and volume data, including macroeconomic indicators, geopolitical events, and market sentiment (Ameen Suhail et al., 2022; Phuong & Nhung, 2021). Incorporating these external factors into predictive models can improve their accuracy and robustness, allowing traders to better anticipate market movements and adjust their strategies accordingly. Furthermore, the need for validation on various data sets (Bebarta et al., 2021; Gyamerah, 2021; Khandelwal et al., 2023) and the exploration of alternative trading strategies beyond the proposed hybrid models (Chourmouziadis & Chatzoglou, 2019; Yang et al., 2020) underscore the gaps in the existing literature. Validating algorithmic trading models on diverse datasets helps to ensure their generalizability and reliability under different market conditions. Furthermore, exploring alternative trading strategies beyond conventional approaches can uncover new opportunities to generate alpha and mitigating risk in financial markets. Considering these gaps, this paper proposes research on comprehensive multi-indicator trend analysis for algorithmic trading to offer significant benefits to both individual and institutional investors. By integrating a diverse range of technical, fundamental, and macroeconomic indicators, the research aims to address the limitations observed in current algorithmic trading models. Multi-indicator analysis allows traders to gain a holistic view of market dynamics, incorporating information from various sources to make more informed trading decisions. From the introduction that has already been explained, the researcher poses the following research questions.

RQ: How can a multi-indicator approach enhance the interpretability and predictive accuracy of algorithmic trading models?

For individual investors, this research presents an opportunity to improve their trading strategies and decision-making processes, potentially leading to increased profits and reduced risks. By leveraging multi-indicator analysis, individual investors can identify market trends more accurately and adapt their strategies, accordingly, improving their overall performance in financial markets. Similarly, institutional investors will benefit from more robust and adaptive trading systems that allow them to develop resilient portfolios that can better withstand market volatility and uncertainty. Institutional investors manage large portfolios with diverse assets, which require sophisticated trading strategies to optimize risk-adjusted returns. Multi-indicator trend analysis provides institutional investors with valuable insights into market dynamics, helping them allocate capital more efficiently and manage risk effectively.

Overall, this research aims to contribute to the advancement of algorithmic trading methodologies, which benefits both individual and institutional investors by improving predictive accuracy, interpretability, and scalability of trading models, and facilitating more effective decision making in financial markets. By addressing the identified gaps in the existing literature and leveraging multi-indicator analysis, this research has the potential to drive innovation in algorithmic trading and enhance the competitiveness of market participants in an increasingly complex and dynamic financial landscape.

2 Research Framework

The research framework as shown in Fig. 1 is outlined in this study provides a systematic process for investigating and evaluating stock market investment strategies. It begins with a clear definition of the research objective, followed by a comprehensive review of the literature to establish foundational knowledge in the field. Subsequently, data are collected from various stock exchanges such as the S&P 500 (Buansing et al., 2020; Dichtl, 2020; Grobys, 2022), and undergo rigorous preprocessing, cleaning, and transformation to ensure its quality and reliability. The subsequent stages of the framework involve the generation of investment signals based on the analyzed data, as well as the calculation of relevant indicators such as RSI, EMAs, and MACD, among others. These indicators play a crucial role in informing investment decisions and shaping the overall strategy. Furthermore, the framework emphasizes the importance of backtesting (Brownlees & Souza, 2021; Tolun Tayalı, 2020; Vezeris et al., 2020), which involves comparing the historical performance of the investment strategy with established benchmarks. This step serves as a critical validation process that allows researchers to assess the effectiveness of the proposed strategy in a simulated trading environment. Finally, the results obtained from the backtesting phase are thoroughly analyzed and evaluated to determine the efficacy and potential viability of the investment strategy under consideration. Through this systematic approach, researchers can gain valuable insights into the dynamics of stock market investments and make informed decisions based on empirical evidence and rigorous analysis (Gerlein et al., 2016; Raguseo, 2018; Rana & Akhter, 2015).

Fig. 1
figure 1

Research framework

3 Review of the Literature

3.1 Stock Trading Technical Indicators

Research in technical indicators for stock trading has undergone significant advances in recent years, showcasing the potential for improved forecasting accuracy and trading profitability. With the increasing availability of data and the development of sophisticated machine learning techniques, researchers have explored various methodologies to enhance the prediction of stock market trends and optimize trading strategies. This review of the literature synthesizes findings from multiple studies, each offering unique insights and contributions to the field. One notable approach involves the integration of fuzzy neural networks with traditional technical indicators to improve the accuracy of forecasting. For example, a study by (Chou & Lin, 2019) demonstrated the effectiveness of combining %R, RSI, MACD, CCI and MA indicators with a fuzzy neural network to predict the Baltic Dry Index values. The proposed approach outperformed conventional forecasting methods, highlighting the potential of hybrid models to capture complex market dynamics. Similarly, (Srivinay et al., 2022; Sukma & Namahoot Chakkrit, 2024) presented a hybrid model that combined investor sentiment with technical indicators, resulting in better prediction accuracy for stock price movements. These findings underscore the importance of incorporating diverse data sources and advanced modeling techniques to achieve better forecast performance. In addition to hybrid models, research has also focused on the use of metaheuristic algorithms and machine learning techniques for stock market prediction. For example, (Sedighi et al., 2019) proposed a model that utilized metaheuristics and support vector machines for accurate stock price forecasting. By optimizing feature selection through the Artificial Bee Colony and the Adaptive Neuro-Fuzzy Inference System, the model demonstrated promising results in generating trading signals for investors and financial analysts. Similarly, (Cheng et al., 2022) introduced an integrated indicator selection method that effectively identified key variables for stock price forecasting. By combining deep learning models such as LSTM and GRU with selected technical indicators, the proposed model achieved improved forecast accuracy and improved trading profitability.

Moreover, the combination of incremental learning and deep learning has shown promise in real-time stock price prediction. (Singh et al., 2023) demonstrated that incremental learning techniques, when combined with deep neural networks, can improve the accuracy of real-time stock price predictions by using technical indicators and past data. This approach addresses the challenges of high-frequency trading and underscores the importance of adaptability in predictive modeling for dynamic market environments. Furthermore, research has explored the development of dynamic trading systems that incorporate advanced machine learning algorithms and optimization techniques. For example, (Bebarta et al., 2021) proposed a dynamic trading system that utilized recurrent FLANN optimized with the Firefly algorithm. By integrating case-based reasoning to confirm buy / sell actions, the system offered a more accurate prediction mechanism for investors, thus improving decision making in trading. Similarly, (Lee et al., 2022) introduced an attention-based BiLSTM model combined with the design of the trading strategy, which effectively utilized technical indicators in the formulation of the stock trading strategy. These studies highlight the potential of advanced machine learning techniques to develop intelligent trading systems that can adapt to changing market conditions and improve trading performance. Furthermore, research has explored the impact of incorporating macroeconomic factors and sentiment analysis into stock market prediction models. (Omran et al., 2023) demonstrated that combining macroeconomics with technical indicators through machine learning methods can generate higher returns than using either approach alone. By incorporating sentiment analysis in daily market news, (Bhanja & Das, 2022) showed that market sentiments significantly influence stock trading decisions and can be leveraged to enhance decision-making in algorithmic trading. These findings underscore the importance of holistic approaches that consider both quantitative and qualitative factors in prediction and trading.

3.1.1 Analyze the Strengths and Weaknesses of Each Trading Strategy

The literature on algorithmic trading strategies encompasses a wide array of methods and indicators aimed at improving trading decisions and maximizing profits, as present on Table 1. Each trading strategy offers unique strengths and weaknesses that are essential for traders to understand for effective implementation. Moving Average Convergence Divergence (MACD), a popular momentum indicator, identifies trend changes and potential buy-or-sell signals by analyzing the relationship between two moving averages (Hoang Hung, 2016). Relative Strength Index (RSI) is another widely used momentum oscillator that measures the speed and change of price movements to determine overbought or oversold conditions (Bhargavi et al., 2017). Bollinger bands, developed by John Bollinger, consist of a middle band, typically a simple moving average, and upper and lower bands representing standard deviations from the middle band, helping to identify price volatility and potential trend reversals (3). The stochastic oscillator% K, a momentum indicator, compares the closing price of a security with its price range over a specific time period, helping traders identify potential overbought or oversold conditions (Ni et al., 2015). The volume weighted average price (VWAP) is a trading benchmark used by traders to measure the average price at which a security has traded throughout the day, with higher volume trades given more weight, which is useful for assessing the true average price paid per share (Singh et al., 2023). Exponential Moving Average (EMA) is a type of moving average that places more weight on recent data points, reacting more quickly to recent price changes compared to the Simple Moving Average (SMA), making it useful for trend identification (Xue et al., 2022). Kaufman's adaptive moving average (KAMA), a trend-following indicator, adjusts its sensitivity based on market conditions, with the aim of filtering out noise and effectively capture trend movements (Li et al., 2020). The Commodity Channel Index (CCI) is an oscillator used to identify overbought or oversold conditions, as well as trend strength, by measuring the relationship between the price of an asset and its moving average (Maitah et al., 2016). On balance volume (OBV) is a momentum indicator that uses volume flow to predict changes in the stock price, with rising OBV suggesting buying pressure and falling OBV indicating selling pressure (Gorgulho et al., 2011). Chande Momentum Oscillator (CMO) is a momentum oscillator that measures the difference between the sum of all recent gains and the sum of all recent losses over a specified period (Gokcek et al., 2022).

Table 1 Technical indicators

However, the Simple Moving Average (SMA) calculates the average of a selected range of prices by dividing the sum of those prices by the number of time periods in the selected range, providing insight into the overall direction of a security's price (Srivastava et al., 2021). The volume adjusted moving average (VAMA) adjusts a moving average based on trading volume, with the aim of providing a smoother representation of price trends by giving more weight to days with higher volumes (Chavarnakul & Enke, 2006). The triangular moving average (TRIMA) is a moving average that places more weight on the median prices of an asset over a specified period, smoothing out price fluctuations and reducing delay compared to traditional moving averages (Huang et al., 2019). Keltner channels (KC), similar to Bollinger bands, consist of an upper and lower channel based on an average true range, used to identify overbought or oversold conditions and potential trend reversals (Gil, 2022). The Coppock curve (COPP) is a momentum indicator designed to identify long-term buying opportunities in the stock market, based on the sum of two rates of change (Narayan et al., 2015). Furthermore, the Money Flow Index (MFI) is a momentum oscillator that measures the strength of money flowing in and out of a security, combining price and volume data to assess the buying and selling pressure (Sugumar et al., 2014). The UI Index (UI) measures downside volatility and risk by gauging the depth and duration of drawdowns from previous highs, helping traders assess the risk of potential investments (Nor & Zawawi, 2022). Ichimoku Kinko Hyo (Ichimoku) is a trend follower indicator that provides more data points compared to traditional moving averages, offering insight into support and resistance levels, as well as potential trend reversals (Deng et al., 2020). Kaufman's adaptive moving average (KAMA), mentioned previously, is also categorized as a trend-following indicator due to its adaptive nature based on market conditions (MABROUK et al., 2022). The percentage price oscillator (PPO) is a momentum oscillator that measures the difference between two moving averages as a percentage of the larger moving average, providing information on momentum and trend strength (Li & Chen, 2021). Although each trading strategy has its strengths and weaknesses, it is crucial that traders carefully analyze and understand the dynamics of each indicator to make informed trading decisions. However, despite the extensive literature on various trading strategies, there remains a need for further research to explore the effectiveness of these strategies in different market conditions and asset classes.

3.2 Evaluation of Performance Metrics and Backtesting

Evaluation of performance metrics and backtesting in algorithmic trading represents a critical aspect of financial analysis, providing information on the effectiveness and reliability of trading strategies (Bhanja & Das, 2022; Sedighi et al., 2019; Srivinay et al., 2022). Algorithmic trading, driven by the automation of trading processes using computer algorithms, has gained significant traction in financial markets due to its potential to improve efficiency and profitability. However, the success of algorithmic trading strategies depends on their ability to deliver consistent and robust performance in different market conditions. Studies have shown that the integration of various performance evaluation metrics, such as the Sharpe Ratio the Sortino Ratio, and Calmar Ratio, allows a comprehensive assessment of risk adjusted returns and helps traders make informed decisions(Bebarta et al., 2021; Cheng et al., 2022). These metrics provide valuable insights into the risk-return trade-offs associated with different trading strategies, enabling traders to gauge their performance relative to benchmarks and peers. For instance, the Sharpe ratio measures the excess return generated by a strategy per unit of risk taken, while the Sortino Ratio focuses on downside risk, providing a more nuanced view of strategy performance. In addition, backtesting methodologies play a crucial role in evaluating the performance by simulating their execution on historical market data, allowing traders to identify strengths and weaknesses and refine their strategies accordingly (Das et al., 2022; Dhafer et al., 2022; Khalid et al., 2024; Lee et al., 2022). By backtesting trading strategies on historical data, traders can assess their performance under various market conditions and identify potential pitfalls before deploying them in live trading environments. In addition, backtesting allows traders to optimize strategy parameters and assess their robustness to changes in market dynamics. Despite the significant progress in this field, there are still several challenges and opportunities for further research. One such area is the development of more comprehensive performance metrics that account for factors such as market impact and trading costs, which can provide traders with a more accurate assessment of strategy performance (Chourmouziadis & Chatzoglou, 2019). Traditional performance metrics often overlook the implicit costs associated with trading, such as bid-ask spreads and market impact, which can significantly impact strategy profitability, especially in high-frequency trading environments. Therefore, there is a need for performance metrics that incorporate these costs to provide a more realistic evaluation of strategy performance(MABROUK et al., 2022; Saifan et al., 2020).

Furthermore, the emergence of alternative data sources, such as sentiment on social networks and IoT sensor data, presents new opportunities to improve performance evaluation and backtesting techniques (Sim et al., 2019). Incorporating alternative data sources into backtesting frameworks can provide traders with additional insight into market sentiment and behavior, enabling them to develop more adaptive and responsive trading strategies. For example, sentiment analysis of social media data can help traders gauge market sentiment and identify potential market movements in real-time, allowing them to adjust their strategies accordingly(Jiang et al., 2023).

4 Materials and Methods

4.1 Multi-Indicator Trend Approach

These selected indicators were chosen based on their ability to address the limitations identified in the existing literature. The Moving Average Convergence Divergence (MACD) and Relative Strength Index (RSI) provide clear buy/sell signals and timely entry/exit points, addressing the need for improved accuracy and interpretability. Bollinger bands offer insights into extreme market conditions and potential reversals, mitigating the false signals often encountered in range-bound markets. On-balance volume (OBV) correlates volume with price movements, confirming price trends and providing additional confirmation for trading decisions. Lastly, the Ichimoku Kinko Hyo indicator (Ichimoku) captures multiple aspects of trend direction and support/resistance, addressing the need for a comprehensive approach to trend analysis. By integrating these indicators into a multi-indicator framework as presented in Table 2, this study aims to offer a novel approach to algorithmic trading that addresses existing gaps in predictive accuracy, interpretability, and scalability.

Table 2 Strength and weakness of selected trading strategy

Combining the MA20_MA50, RSI, MACD, Bollinger bands, OBV, and Ichimoku indicators offers a comprehensive signal combination approach in algorithmic trading. Each indicator contributes unique benefits to the overall strategy, improving predictive accuracy and decision-making. The MA20_MA50 indicator provides both short- and long-term trend direction, smoothing out price fluctuations. RSI helps identify overbought and oversold conditions, offering timely entry and exit points. MACD identifies trend direction and momentum strength, providing clear buy and sell signals. Bollinger bands measure price volatility and potential reversals, while OBV correlates volume with price movements, confirming price trends. The Ichimoku indicator identifies the direction of the trend and support/resistance levels, capturing multiple aspects of the trend. By combining these indicators, traders can gain a holistic view of market dynamics, leading to more informed trading decisions, as shown in Table 3.

Table 3 Details of the selected trading strategy

The benefit of this novel approach to algorithmic trading, as present in Algorithm 1 and Fig. 2 lies in its potential to improve predictive accuracy, interpretability, and scalability in financial markets. By integrating a diverse set of technical indicators such as Moving Average Convergence Divergence (MACD), Relative Strength Index (RSI), Bollinger Bands, On Balance Volume (OBV) and Ichimoku Kinko Hyo (Ichimoku), this approach offers a comprehensive framework for trend analysis and decision making. These indicators provide valuable information on trend direction, momentum strength, volatility, volume dynamics, and support/resistance levels, thereby enabling traders to make more informed trading decisions. Additionally, the multi-indicator framework reduces the reliance on individual indicators and helps to mitigate the limitations associated with using single indicators. In general, this novel approach has the potential to improve trading strategies, optimize risk management, and ultimately improve profitability for both individual and institutional investors in financial markets.

Algorithm 1
figure a

Multi-indicator trend analysis for algorithmic trading

Fig. 2
figure 2

Research and implementation

4.2 Data Collection

Research uses data sourced from the Yahoo Finance API [40], a platform that offers programmable access to historical financial data covering various instruments over multiple years. This data set provides a rich repository of market information, including stock prices, trading volumes, and other pertinent metrics essential for empirical analyses within financial markets. The choice of Yahoo Finance API is driven by its comprehensive coverage, reliability, and accessibility, making it suitable for conducting in-depth analyzes. In addition, in selecting technical indicators, the researchers employ a systematic approach based on both theoretical foundations and empirical evidence. Following data cleaning, researchers proceed with feature selection, identifying the most relevant variables for analysis. Key variables typically include open, high, low, closed prices and trading volumes, providing insight into market dynamics and investor sentiment as present in Table 4.

Table 4 Description of data

Additionally, derived metrics such as price volatility, moving averages, and trading indicators may be incorporated to capture additional nuances. Subsequently, data transformation processes may be undertaken, including aggregating data into different time intervals (e.g., daily, weekly, monthly) to capture various temporal trends and patterns. Technical indicators are chosen based on their relevance to research objectives, historical effectiveness in predicting market trends, and suitability for the investment strategies. Criteria such as robustness under different market conditions, simplicity of interpretation, and computational efficiency are considered in the selection process. Although commonly used technical indicators such as relative strength index (RSI), Exponential Moving Averages (EMAs), moving average convergence divergence (MACD), and Bollinger Bands may be included, along with domain-specific indicators tailored to the research context. The rationale behind the performance metrics revolves around evaluating the effectiveness and efficiency of the algorithmic trading models. In addition, performance metrics are selected to assess various aspects of the models, including predictive accuracy, risk adjusted returns, portfolio volatility, and drawdowns. Commonly used metrics such as the Sharpe ratio, the Sortino ratio, Maximum Drawdown (MDD), and the cumulative returns are employed to provide comprehensive insights into the models' performance across different evaluation criteria. Additionally, researchers may consider metrics related to trading costs, such as transaction costs and slippage, to account for real-world trading constraints and improve the practical applicability of the models. Throughout the research process, several limitations or challenges may be encountered, which are essential to address for transparency and robustness. Common challenges include data quality issues, such as missing values, outliers, and inconsistencies, which require rigorous data cleaning and preprocessing techniques. Furthermore, overfitting and data snooping biases pose significant risks in model development, requiring careful validation and robustness checks. Additionally, the choice of technical indicators and performance metrics may introduce inherent biases or limitations, highlighting the importance of sensitivity analysis and robustness testing.

This visual representation outlines the sequential steps involved, including data collection, pre-processing, feature selection, model development, validation, and performance evaluation. By presenting the research methodology in a structured and transparent manner, readers can gain a clear understanding of the analytical framework and the rationale behind each methodological decision, thus enhancing the credibility and reproducibility of the research findings shown on Algorithm 2.

Algorithm 2
figure b

Performance of algorithmic comprehensive trading

4.3 Data Processing

Algorithm 2 involves several steps for data preparation and processing. Initially, it establishes weight ranges for each indicator, represented mathematically as param_grid [\mathfrak{i}] = {0,1,2,3,4}, where 0 indicates no weight and 1 to 4 represent varying levels of weighting for the indicators. The algorithm considers a total of N = 6 indicators, including MA20_MA50_signal, RSI_signal, MACD_signal, Bollinger_signal, OBV_signal, and Ichimoku_signal, each assigned a weight from the set {0,1,2,3,4}. Subsequently, the algorithm generates all possible combinations of weights for these indicators, denoted by the Cartesian product of the weight sets, resulting in the set \mathcal{W} = {(\omega_1, \omega_2, …, \omega_n) | \omega_i \in {0,1,2,3,4}}. Next, it identifies the set of weights that maximize the TotalReturn, denoted as \mathcal{W}^\ast = \text{arg max TotalReturn}. The algorithm computes the combined signal, denoted as CombinedSignal, as the product of the weight vector and the signal vector, where the weight vector w represents the weights assigned to each indicator, and the signal vector S represents the signals generated by each indicator. The combined signal is calculated using the formula CombinedSignal = \sum_{i = 1}^{n}{\omega_i \cdot \text{Signal}_i}. Finally, the algorithm generates buy (\mathcal{B}) and sell (\mathcal{S}) signals based on the combined signal. A buy signal is triggered (\mathcal{B}_t = 1) if the CombinedSignal exceeds a certain threshold (0), indicating a bullish trend, while a sell signal is triggered (\mathcal{S}_t = − 1) if the CombinedSignal falls below the threshold, indicating a bearish trend. Otherwise, no action is taken.

4.4 Data Preparation and Processing

The algorithm begins by preparing the data and defining weight ranges for each indicator. We represent these weight ranges mathematically as param_grid [\mathfrak{i}] = {0,1,2,3,4}, where weights 0 to 4 correspond to no weight and varying levels of significance for the indicators. We consider a total of N = 6 indicators, namely MA20_MA50_signal, RSI_signal, MACD_signal, Bollinger_signal, OBV_signal, and Ichimoku_signal. Each indicator is assigned a weight from the set {0,1,2,3,4}.

4.5 Signal Combination and Optimization

Next, the algorithm generates all possible combinations of weights for the indicators, resulting in the set \mathcal{W} = {(\omega_1, \omega_2, …, \omega_n) | \omega_i \in {0,1,2,3,4}}. It then identifies the set of weights that maximize the TotalReturn, denoted as \mathcal{W}^\ast = \text{arg max TotalReturn}. The combined signal, denoted as CombinedSignal, is computed as the weighted sum of the signals generated by each indicator. Formally, CombinedSignal = \sum_{i = 1}^{n}{\omega_i \cdot \text{Signal}_i}.

4.6 Signal Generation

Finally, the algorithm generates buy (\mathcal{B}) and sell (\mathcal{S}) signals based on the combined signal. A buy signal (\mathcal{B}_t = 1) is triggered if the CombinedSignal exceeds a predefined threshold (0), indicating a bullish trend. Conversely, a sell signal (\mathcal{S}_t = − 1) is triggered if the CombinedSignal falls below the threshold, indicating a bearish trend. No action is taken if the CombinedSignal is within the threshold range.

4.7 Performance Evaluation

The "Performance of Algorithmic Comprehensive Trading" algorithm encompasses a series of steps to evaluate the effectiveness of algorithmic trading strategies using financial market data retrieved from the Yahoo Finance API. The algorithm begins by defining the dataset \mathcal{D}, consisting of various financial metrics such as closing price, volume, high, and low for a given period. It then proceeds to calculate several technical indicators commonly used in algorithmic trading:

  • Moving Averages: Both the simple moving average (SMA) and the exponential moving average (EMA) are computed to identify trends in the market.

  • Relative Strength Index (RSI): The RSI is calculated on the average gains and losses over a specified period to determine overbought or oversold conditions.

  • Moving Average Convergence Divergence (MACD) Oscillator: The MACD line, the signal line, and the MACD histogram are computed to identify potential trend reversals or momentum shifts.

  • Bollinger Bands: The middle band (SMA), the upper band and the lower band are calculated to identify volatility and potential price reversal points.

  • On-Balance Volume (OBV): The OBV is calculated to assess the buying and selling pressure based on volume changes.

  • Ichimoku Cloud: Various components such as Conversion Line, Base Line, Leading Span A, and Leading Span B are calculated to identify trend direction and potential support and resistance levels.

Once these indicators are calculated, the algorithm combines them using specified weights (\omega_i) to generate a CombinedSignal. The buy and sell signals are then generated based on the CombinedSignal exceeding or falling below a predefined threshold. The algorithm proceeds to perform a portfolio backtesting to evaluate the performance of the trading strategy. Portfolio performance is computed based on the returns generated by positions held over time. An equity curve is constructed to visualize the performance of the trading strategy during the backtesting period. Performance metrics including total return, maximum drawdown, and Sharpe Ratio are then calculated to assess the strategy's profitability, risk, and risk-adjusted return. So, algorithm 2 systematically calculates a variety of technical indicators, combines them into a comprehensive trading signal, generates buy and sell signals, conducts a portfolio backtesting, and evaluates performance using key metrics. This approach enables the rigorous assessment of algorithmic trading strategies and facilitates data-driven decision-making in financial markets.

5 Result and Discussion

5.1 The Extensive Comparative Analysis

This study case and experimental use stock data of Apple Inc or (AAPL) (O’Grady, 2008) for backtesting shown on Table 5 and Fig. 3 are the results of this investigation that serve as a solid foundation for understanding the intricate dynamics of algorithmic trading strategies, shedding light on both their potential and limitations. The comprehensive evaluation conducted against the multi-indicator benchmark not only unveils the performance of individual indicators, but also provides invaluable insights into the broader landscape of algorithmic trading. The primary focus of this study lies in evaluating the effectiveness of six key technical indicators: MA20_MA50, RSI, MACD, Bollinger, OBV, and Ichimoku. These indicators represent a diverse array of analytical tools commonly utilized by traders and investors to gauge market trends and make informed decisions. Through a meticulous analysis that covered a significant duration from January 2, 2013, to April 28, 2023, encompassing 2599 days of market activity, the research team meticulously tracked and evaluated the performance of each indicator. Table 5 is one of the pivotal findings of this study, which is the notable total returns generated by the indicators analyzed. The MA20_MA50, RSI, MACD, Bollinger, OBV, and Ichimoku indicators yielded returns of 236.993293%, 201.595529%, 333.931724%, 257.322791%, 330.760022%, and 279.783796%, respectively. These returns underscore the potential of these indicators to generate profitable trading signals, providing traders with opportunities to capitalize on market movements. However, amidst these promising returns, it is crucial to contextualize the performance of the indicators relative to the benchmark. The multi-indicator benchmark, boasting a return of 765.351621%, significantly outperformed all individual indicators. This stark contrast highlights the importance of benchmarking strategies against established benchmarks to accurately gauge their effectiveness. While the selected indicators exhibited positive returns, they fell short of matching the benchmark's performance, emphasizing the need for further refinement and optimization. Beyond total returns, the evaluation of risk management metrics, particularly maximum drawdown, offers valuable insights into the downside risk associated with each indicator. The MA20_MA50, RSI, MACD, Bollinger, OBV, and Ichimoku indicators experienced maximum drawdowns of 28.995953%, 28.766038%, 22.879581%, 22.879581%, 32.803662%, and 26.942914%, respectively. These figures highlight the potential losses incurred during the evaluation period, emphasizing the importance of risk mitigation strategies in algorithmic trading as shown on Figs. 4, 5, 6, 7, 8, 9, 10. Furthermore, the duration of maximum drawdown varied significantly across indicators, ranging from 241 to 566 days. This variability underscores the nuanced nature of risk exposure inherent in each strategy, necessitating careful consideration of risk adjusted measures in trading algorithms. In addition, analysis of other performance metrics, including total trades, win rates, and profit factors, provides a holistic view of each indicator's characteristics and performance. Despite the valuable insights gleaned from this study, it is essential to acknowledge its limitations and avenues for further research. Although the indicators analyzed demonstrate potential, their inability to outperform the benchmark raises questions regarding their efficacy in real-world trading scenarios. Future research efforts could explore alternative parameterizations of these indicators, incorporate machine learning techniques for enhanced predictive power, or dive into market-specific dynamics to optimize performance.

Table 5 Evaluation of performance metrics
Fig. 3
figure 3

Comparison of end value and total return

Fig. 4
figure 4

RSI ‘s performance metrics

Fig. 5
figure 5

MA20_MA50 ‘s performance metrics

Fig. 6
figure 6

MACD ‘s performance metrics

Fig. 7
figure 7

Bollinger ‘s performance metrics

Fig. 8
figure 8

OBV ‘s performance metrics

Fig. 9
figure 9

Ichimoku ‘s performance metrics

Fig. 10
figure 10

multi-indicator ‘s performance metrics

The findings of this study underscore the intricate interplay between technical indicators and market benchmarks in algorithmic trading. Although the analyzed indicators exhibit promising returns and trading signals, they fall short of matching the benchmark's performance, indicating the need for continued research and refinement. By addressing these gaps and challenges, researchers and practitioners can unlock the full potential of algorithmic trading strategies, paving the way for more informed and profitable investment decisions in financial markets.

5.2 Comparison with Previous Comparative Analysis

In contrast to the prior comparative analyses found in several related research articles, which focus on various aspects of financial markets, such as supply chain management, stock price prediction, stream data processing, and legal ontology, this study specifically examines the performance of technical indicators commonly used in algorithmic trading strategies. Additionally, compared to previous studies, particularly those that explore stock market prediction, such as Papers of (Dhafer et al., 2022; Khalid et al., 2024; Lee et al., 2022; Sedighi et al., 2019), the research in question takes a unique approach by assessing the effectiveness of technical indicators rather than machine learning or deep learning algorithms alone. While Papers (Sedighi et al., 2019)and (Khalid et al., 2024) investigate the performance of recurrent neural networks (RNNs) and long-short-term memory (LSTM) models for stock price prediction, the paper under review focuses on traditional technical indicators such as MA20_MA50, RSI, MACD, and others (Chou & Lin, 2019). This distinction highlights the diversity of methodologies employed in financial research and underscores the importance of evaluating both conventional and advanced techniques. Furthermore, compared to Papers (Bhanja & Das, 2022) and (Srivastava et al., 2021), which explore multi-criteria decision-making methods and machine learning algorithms for portfolio management and stock price movement prediction, respectively, the paper contributes by providing a comprehensive evaluation of technical indicators' performance across various metrics. Although (Bhanja & Das, 2022) and (Srivastava et al., 2021) propose novel methodologies, the research in question offers insights into the practical applicability of existing tools widely used by traders and investors. Furthermore, the paper's findings can be contextualized with the comparative analyses presented in Papers (Bebarta et al., 2021; Cheng et al., 2022; Chou & Lin, 2019; Das et al., 2022; Srivinay et al., 2022; Yang et al., 2020), which cover topics ranging from supply chain management to legal ontology and integer programming. Although these articles explore different domains, they share a common theme of comparative analysis, highlighting the importance of benchmarking and evaluating methodologies in diverse contexts. Similarly, research on algorithmic trading strategies emphasizes the importance of benchmarking against established benchmarks, as evidenced by the comparison with the multi-indicator benchmark (Chou & Lin, 2019).

Overall, this research paper offers valuable insights into the efficacy of technical indicators in algorithmic trading, contributing to the broader body of research aimed at understanding and optimizing financial market strategies. By contextualizing its findings within the landscape of prior comparative analyses, the study underscores the importance of adopting a diverse range of methodologies and approaches to effectively address the complexities of financial markets.

5.3 Finding and Contribution

The findings of this experiment on the evaluation of the performance of trending indicators in the forecasting of financial markets revealed significant insights, providing a fresh perspective on their effectiveness. In particular, the experiment highlighted substantial performance variations among different trend indicators. Indicators such as MA20_MA50, RSI, MACD, and Bollinger demonstrated strong total returns, while CCI and OBV showed comparatively lower returns. This underscores the critical importance of meticulously selecting indicators based on specific characteristics and performance metrics. Furthermore, the study emphasized the crucial role of effective risk management in trading strategies, with indicators like MA20_MA50 and Bollinger exhibiting lower percentages and durations, indicating their ability to mitigate risk during market downturns. The findings also shed light on the importance of balancing trading activity and win rates for optimal performance.

In terms of contributions, this research stands out for its use of a comprehensive set of evaluation metrics, including Total Return, Maximum Gross Exposure, Maximum Drawdown, Max Drawdown Duration, and Win Rate, providing a holistic assessment of indicator performance. Furthermore, the study's originality lies in its simultaneous evaluation of multiple trending indicators, offering a thorough examination of their performance, strengths, and weaknesses. These practical implications extend to traders, investors, and financial institutions, empowering them to make informed decisions when incorporating indicators into their trading strategies. Additionally, research findings hold significant relevance for market participants, providing information on indicator performance and guiding decision-making processes. However, it is crucial to exercise caution and adaptability, considering the dynamic nature of financial markets. Continuous monitoring and evaluation of chosen indicators, along with an understanding of their limitations, are essential to navigate market uncertainties effectively. By acknowledging these limitations and emphasizing the practical implications for traders and investors, this study provides actionable insights and facilitates a more informed approach to financial market forecasting. Visual representations, such as tables or charts illustrating the performance of each indicator, could further enhance the clarity of the findings and aid in their interpretation by stakeholders.

6 Discussion

First, analysis of the experimental results revealed notable variations in the performance of the selected indicators. Specifically, the MA20_MA50, RSI, MACD, Bollinger, OBV, and Ichimoku indicators demonstrated various levels of total returns. These findings are consistent with previous studies that have highlighted the distinct performance characteristics of indicators under different market conditions. By emphasizing these variations, the present research contributes to the existing literature by reinforcing the importance of careful selection based on specific characteristics and performance metrics. Furthermore, the experiment provided information on the importance of risk management in trading strategies. Indicators such as MA20_MA50 and Bollinger exhibited lower drawdown percentages and durations, indicating their ability to mitigate risk during market downturns. This finding aligns with previous research that underscores the importance of incorporating effective risk management techniques to ensure stable and consistent performance. By highlighting this relationship, the study improves understanding of how indicators can be used to effectively manage risk, which is crucial to maintaining sustainable trading strategies. Furthermore, the analysis revealed variations in trading activity and win rates between indicators, resulting in win rates ranging from 37.5% to 63.89%. This finding underscores the importance of striking a balance between trading activity and win rates when selecting indicators for optimal performance. It aligns with existing literature that emphasizes the trade-off between trading frequency and the ability to achieve consistent profits. The originality of this study lies in its use of comprehensive evaluation metrics and a multi-indicator analysis. Using a wide range of performance metrics such as total return, drawdown, win rate, and profit factor, the research provides a holistic assessment of the performance of the indicators. This approach contributes to the existing literature by providing a comprehensive framework for evaluating and comparing trend indicators. Additionally, the practical implications of the findings are substantial for traders, investors, and financial institutions. Research provides valuable information on the performance characteristics of trending indicators, allowing market participants to make informed decisions when incorporating them into their trading strategies. The utilization of comprehensive evaluation metrics and multi-indicator analysis empowers practitioners to select indicators that maximize returns and minimize risk, thereby enhancing their decision-making processes.

Second, the proposed combination of indicators effectively addresses both short- and long-term trading strategies as presented in Table 6. Demonstrating a robust and versatile approach to market analysis. Interestingly, for short-term strategies, this combination of indicators is used to capture intraday and swing trading opportunities. Specifically, the system generates buy/sell signals based on price movements relative to the 20-day moving average (MA20), overbought/oversold conditions indicated by the relative strength index (RSI), momentum changes identified by the moving average convergence divergence (MACD), volatility patterns from Bollinger bands and volume trends assessed through on-balance volume (OBV). This integration allows for precise entry and exit points, improving the system’s responsiveness to rapid market fluctuations. Taken together, what is particularly striking is for long-term strategies, this combination of indicators identifies and follows broader market trends. The system confirms long-term trends through price positions relative to the 50-day moving average (MA50), the comprehensive trend analysis provided by the Ichimoku Cloud, and the trend strength indicated by MACD. Additionally, crossovers between MA20 and MA50, supported by RSI readings, signal significant trend changes, guiding long-term investment decisions. This multi-indicator approach ensures that the DSS can adapt to various market conditions, providing reliable support for both short-term trading and long-term investment strategies. An interesting aspect that emerged from the analysis is that the proposed approach addresses scalability by employing a modular design that allows for the integration of additional indicators and data sources as needed. This flexibility ensures that the DSS can handle increasing data volumes and adapt to changing market conditions without compromising performance. Advanced data processing techniques and machine learning models are utilized to efficiently manage large datasets, ensuring that the system remains effective and scalable as trading environments become more complex.

Table 6 Example strategies

In terms of future research directions, this study opens avenues for exploring the effectiveness of other combinations of indicators and the development of advanced trading strategies. Furthermore, investigating the impact of external factors, such as economic events or geopolitical changes, on indicator performance could provide further insight into market dynamics. It is essential to acknowledge that this study has limitations, including the specific market conditions and period analyzed. Therefore, future research could focus on addressing these limitations and validating the findings in different market environments. Overall, this study contributes to advancing our understanding of trend indicators' performance in financial market forecasting and provides valuable guidance for practitioners in navigating dynamic market conditions.

7 Conclusion

This study has provided valuable information on the efficacy of technical indicators commonly used in algorithmic trading strategies. The significance of this research lies in its comprehensive examination of six key technical indicators: MA20_MA50, RSI, MACD, Bollinger, OBV and Ichimoku—across various metrics such as total returns, risk management metrics, and overall performance. By spanning a substantial duration of market activity from January 2, 2013, to April 28, 2023, encompassing 2599 days of trading data, the study offers a longitudinal perspective on the performance of these indicators, grounded in real-world market dynamics. This longitudinal approach adds robustness to the analysis, ensuring that the findings are not only reflective of short-term fluctuations but indicative of broader trends and patterns in the financial markets. One of the key findings of this research is the notable total returns generated by the indicators analyzed, highlighting their potential to produce profitable trading signals and provide traders with opportunities to capitalize on market movements. However, it is crucial to contextualize these returns relative to the multi-indicator benchmark, which significantly outperformed all individual indicators. This stark contrast underscores the importance of benchmarking strategies against established benchmarks to accurately assess their effectiveness in real-world trading scenarios. While the selected indicators exhibited positive returns, they fell short of matching the benchmark's performance, emphasizing the need for further refinement and optimization. Furthermore, the assessment of risk management metrics, particularly maximum drawdown, offers valuable insight into the downside risk associated with each indicator. The variability observed in the duration of maximum drawdown across indicators underscores the nuanced nature of risk exposure inherent in each trading strategy, necessitating careful consideration of risk-adjusted measures in algorithmic trading. In addition, analysis of other performance metrics, including total trades, win rates, and profit factors, provides a holistic view of the characteristics and performance. In response to the research question posed, the findings of this study demonstrate that a multi-indicator approach can significantly enhance the interpretability and predictive accuracy of algorithmic trading models. By leveraging multiple technical indicators, traders and investors can gain a more comprehensive understanding of market trends and dynamics, thereby improving their ability to make informed decisions and capitalize on profitable trading opportunities. Furthermore, the incorporation of multiple indicators allows for a more robust and resilient trading strategy, capable of adapting to changing market conditions and mitigating downside risks.

In conclusion, the research presented in this article not only contributes to the existing body of knowledge on algorithmic trading but also provides valuable insights for practitioners seeking to enhance the effectiveness of their trading strategies. By leveraging a multi-indicator approach, traders and investors can improve the interpretability and predictive accuracy of their algorithmic trading models, ultimately leading to more informed and profitable investment decisions in financial markets. Moving forward, continued research and refinement of algorithmic trading strategies will be essential to stay abreast of evolving market dynamics and capitalize on emerging opportunities.

7.1 Limitations and Further Research

This research on trend indicators in the forecasting of financial markets has some limitations. Reliance on historical financial market data, specifically the S&P 500 index, may limit the generalizability of the findings. Future research should explore data sets from different markets and instruments to enhance the robustness of the analysis. Furthermore, the focus on specific trending indicators could be expanded to include a broader range of indicators to assess their effectiveness under various market conditions. More research is also needed to incorporate real-time implementation, social media analysis, and machine learning techniques for a more comprehensive understanding of trend indicators in financial market forecasting. Addressing these limitations will advance the field and improve trading strategies.