Skip to content

Original Research

Frontiers in Applied Mathematics and Statistics ·

Volume 12 - 2026 | https://doi.org/10.3389/fams.2026.1888767

Intraday trading strategy selection under transaction costs with machine learning

  • Alan Gaona1
  • Jennifer Rangel-Madariaga1
  • Lourdes Uribe1*corresponding author
  1. Facultad de Ciencias Actuariales, Universidad Anáhuac México, Huixquilucan, Mexico
Article metrics0 viewsView details

Abstract

Machine learning has shown promising results for financial forecasting; however, many studies focus primarily on predictive accuracy while overlooking the economic implications of trading decisions under realistic market conditions. This study systematically evaluates the predictive and economic performance of Decision Tree, Random Forest, and XGBoost models for intraday price direction forecasting across 40 financial assets, including stocks, foreign exchange pairs, and cryptocurrencies. Forecasting horizons of 1, 3, 5, 10, 15, and 30 min were analyzed using a walk-forward validation framework with Bayesian hyperparameter optimization. Unlike many previous studies, the evaluation explicitly incorporates transaction costs, benchmark comparisons, risk-adjusted performance metrics, and execution robustness. The results show that the forecasting horizon is one of the most influential factors affecting both predictive and economic performance. Across most assets, the 30-min horizon emerged as the best-performing option within the evaluated candidate set, indicating a tendency toward improved performance at longer forecasting horizons. After incorporating realistic transaction costs, only a limited subset of assets remained profitable, highlighting the importance of evaluating trading strategies beyond predictive metrics alone. Benchmark comparisons and risk-adjusted performance measures further illustrated the economic performance of the profitable machine learning strategies relative to passive, persistence-based, and random trading approaches. Overall, the proposed framework provides a comprehensive approach for jointly assessing the predictive and economic performance of machine learning-based intraday trading strategies under the transaction-cost and execution assumptions considered in this study.

Keywords

1 Introduction

Predicting the behavior of a financial asset's price is a key challenge in trading and investment. As Kumbure et al. [1] point out, if investors were able to forecast market behavior accurately, they would consistently earn returns above the rest of the market, since even a small improvement in forecasting ability can generate high profits and be very meaningful for investors [2, 3]. However, the existence of an investor capable of consistently earning higher returns than the market would directly contradict the Efficient Market Hypothesis (EMH) [1]. The EMH defined by Fama [4], states that a market can be considered efficient if prices fully reflect the information available at a given time. This hypothesis assumes that prices follow a random walk, which implies that future changes in prices cannot be predicted using past behavior or existing information [5, 6]. According to this hypothesis, there are three forms of market efficiency: weak, semi-strong, and strong. The weak form holds that any information contained in historical prices is immediately reflected in the current price and therefore does not help predict future movements [4, 5]. The semi-strong form states that all publicly available information was reflected in stock prices at the moment it became known [4, 5]. Finally, the strong form asserts that all information, including insider information, is reflected in stock prices, and therefore it is not possible to earn returns above the market [1, 4]. Despite the widespread acceptance of the EMH in academic finance, its intellectual dominance began to decline in the early twenty-first century, with a growing number of economists arguing that stock prices were at least partially predictable [7], which has led to questioning the validity of the EMH. Recall that in its semi-strong form, the Efficient Market Hypothesis (EMH) states that all publicly available information is rapidly incorporated into asset prices, leaving little room for technical analysis or predictive models to consistently generate alpha. Nevertheless, high-frequency and intraday markets are characterized by market microstructure frictions, latency effects, and institutional order flows that create transient nonlinear patterns. The Adaptive Markets Hypothesis (AMH), proposed in Lo [8], argues that market efficiency is not a fixed condition but rather a dynamic and evolving property of financial systems. Within this framework, machine learning algorithms can be valuable tools for identifying and exploiting localized, short-lived informational inefficiencies before competitive market forces restore equilibrium.

In response to this search for predictability, two main approaches have emerged for price analysis aimed at forecasting future movements: technical analysis and fundamental analysis [5, 6]. Fundamental analysis rests on the premise that the prices of financial assets are intrinsically linked to economic principles and that underlying economic information, such as a firm's earnings, growth prospects, interest rates, and cost trends, can be used to predict its future value [5]. By contrast, technical analysis focuses on market price dynamics and trading volume behavior to predict a stock's future performance, under the assumption that historical price patterns tend to repeat and can therefore be used to forecast future movements, thus framing the task as a pattern recognition problem [5, 6]. Its main tools are technical indicators computed from historical data, such as open, high, low, close, and volume, with common examples including the Relative Strength Index (RSI), the Stochastic Oscillator, and MACD [1].

Beyond these two traditional methods, a common forecasting approach has been time series analysis, where the price is modeled as a regression on its own history [9]. However, the intrinsically dynamic, nonlinear, nonparametric, and noisy nature of stock price series [10] limits the performance of traditional statistical time series models [3]. In this setting, machine learning techniques have emerged as alternatives capable of extracting information and detecting complex patterns more effectively [3, 9]. In particular, reframing the task as a classification problem for the direction of movement, rather than estimating the exact price, has shown superior results by providing a probabilistic estimate of the trend direction [9, 10]. Nevertheless, for any model to be effective in trading strategies, it is important to account for transaction costs, since, as Malkiel [7] warns, any trading strategy designed to exploit such market inefficiencies must demonstrate net profitability after incurring these costs, which may be a percentage of the traded value or a fixed amount. Likewise, predictive ability can vary substantially across different time horizons, because models may deliver stronger performance for medium or long horizons compared with intraday settings.

Thus, this study systematically investigates how the choice of forecasting horizon influences both the predictive and economic performance of machine learning-based intraday trading strategies across different financial asset classes. Forecasting horizons of 1, 3, 5, 10, 15, and 30 min are compared to examine whether the preferred prediction interval within the evaluated candidate set depends on the characteristics of the underlying asset and the learning algorithm employed. While previous studies have primarily focused on daily or lower-frequency data [1], the present work evaluates intraday market behavior using one-minute data, conventional technical indicators, and supervised learning techniques.

To achieve this objective, Decision Tree, Random Forest, and XGBoost models were trained within a walk-forward rolling-window framework using two years of historical one-minute data. Target variables were defined according to whether future price movements exceeded transaction costs within each forecasting horizon, class imbalance was addressed through class weighting, and Bayesian optimization was employed for hyperparameter tuning. The resulting trading strategies were subsequently evaluated using predictive metrics, cumulative profitability, benchmark comparisons, risk-adjusted performance measures, and execution robustness under realistic transaction-cost assumptions. This comprehensive evaluation framework enables the joint assessment of predictive accuracy and practical trading viability across multiple financial assets and forecasting horizons.

The remainder of this work is organized as follows. Section 2 reviews the previous literature and introduces the concepts employed in this study, including technical indicators, machine learning models, and hyperparameters, among others. Section 3 details the methodology, including data preparation, rolling-window training, hyperparameter optimization, and model evaluation. Section 4 then presents the obtained results, including performance metrics by asset, average returns, and comparisons across time horizons, among other analyses. Finally, Section 5 provides the conclusions of this proposal, together with the main contributions and limitations of the study, as well as potential avenues for future research.

2 Theoretical framework

2.1 Previous literature

Price prediction in financial markets has been approached with multiple strategies throughout the literature. In recent years, machine learning models have gained prominence and have shown that price behavior is, at least in part, predictable. Among the most widely explored models are Artificial Neural Networks (ANN), Deep Learning techniques, Support Vector Machines (SVM), and ensemble models such as Random Forest and Extreme Gradient Boosting (XGBoost), among others. This section summarizes the most relevant literature together with the models used in this context.

In Kara et al. [11], the direction of the Istanbul Stock Exchange National 100 Index (ISE) was modeled with a three-layer ANN using ten technical indicators and contrasted with an SVM, finding higher average performance for the ANN (75.74%) relative to the SVM (71.52%). In another study, Jiang et al. [3] compared several three-layer Deep Learning architectures: Recurrent Neural Network (RNN), Bidirectional RNN (BRNN), Long Short-Term Memory (LSTM), and Gated Recurrent Unit (GRU), with the following tree ensembles: Random Forest, Extremely Randomized Trees, XGBoost, and LightGBM. In the configurations evaluated, tree-based methods showed better performance, with Extremely Randomized Trees performing particularly well. In a comprehensive evaluation, Ballings et al. [2] analyzed classifiers for predicting the direction of European stock prices and ranked Random Forest as the leading algorithm in terms of area under the curve, with SVM remaining as a strong competitor. In another case, Patel et al. [12] introduced a deterministic preprocessing layer that discretizes ten technical indicators for Indian stocks and indices, observing broad improvements and placing Random Forest as the top average performer relative to SVM, ANN, and Naive Bayes. Separately, Basak et al. [10] evaluated forecasts over intervals from 3 to 90 days for the direction of various stocks and reported classification accuracies of 65% to 95% for Random Forest and 55% to 80% for XGBoost, increasing with the trading window. In a different direction, Yun et al. [13] studied a hybrid approach that combines XGBoost with a genetic algorithm for the direction of the KOSPI 200, which, with default settings, exceeded the accuracy of six Deep Learning variants at lower computational cost, achieving more than 93% accuracy on the dataset considered.

In a final approach, Lohrmann and Luukka [6] classified the S&P 500's direction into four classes (strong positive, positive, negative, and strong negative), separating extreme movements from mild ones, and explicitly incorporated both fixed and proportional transaction costs in the evaluation against a buy-and-hold benchmark. They found that predicting the two extreme classes contributed significantly to trading strategies compared with the mild-movement classes. Building on the reviewed literature, this study sought to develop and compare several machine learning models that predict the direction of various financial assets at intraday intervals using technical indicators, evaluating both predictive accuracy and the net profitability of day-trading strategies when transaction costs are incorporated.

2.2 Day trading, commissions, and technical indicators

Day trading consists of buying and selling assets within the same session [14], with the objective of profiting from relatively small but frequent price movements. Individuals who engage in this practice are known as traders, agents who analyze the market to identify optimal moments to invest and obtain returns. To operate, they depend on the intermediation of a broker, a licensed financial entity that executes orders in the stock market and earns income by charging commissions. Broker commissions can take different forms, one of the most common being the asset's spread, understood as the difference between the bid and ask prices of a given security. Due to these costs and differences among providers, selecting an appropriate broker becomes a key factor for the profitability of any day-trading strategy [14, 15].

In addition to operational considerations, it is necessary to rely on solid trading strategies, which commonly draw on technical analysis and fundamental analysis [15]. Fundamental analysis studies the macroeconomic, financial, and corporate factors that affect an asset's value [5], whereas technical analysis is based on the premise that future price behavior can be inferred from historical patterns [6]. Under this second approach, technical indicators are among the most widely used tools, since they provide quantitative information on trends, volatility, and market momentum, and they form the basis for constructing predictive trading models.

Technical indicators are essential components of technical analysis. These are derived from calculations based on historical price and traded volume series, transforming the data into signals useful for analyzing trends and forecasting future price variations [16]. As Kara et al. [11] describe, the most widely used technical indicators in the literature are shown in Table 1. These indicators can be grouped by the type of information they summarize, including trend, momentum, and volatility, and this makes them useful both for interpretation and for systematic modeling. For instance, indicators such as MACD, RSI, and STOCH are especially useful for summarizing short-term market dynamics in a compact and interpretable way. In practical use cases, RSI is commonly employed to detect potential overbought or oversold regimes, for instance when it rises above 70 or falls below 30 [17]. Similarly, STOCH compares the current close with the recent trading range to identify extreme zones, often above 80 or below 20, which may precede short-term reversals [18]. Finally, MACD evaluates changes in momentum through the interaction between the MACD line and its signal line, and crossovers between them are often interpreted as shifts in bullish or bearish pressure [19]. When applied correctly, technical indicators are versatile tools that can be adapted to different time horizons, which is essential in day-trading contexts. Moreover, their usefulness goes beyond generating buy or sell signals, since by condensing trend, volatility, and momentum information, they can also be incorporated as variables in machine learning models, providing a solid foundation for the development of modern predictive strategies.

Table 1. Selected technical indicators and their formulas [11].

Technical indicatorFormula
SMASMA(n)t=1n∑i=0nCt-i
EMAEMA(n)*t* = EMA(n)*t*−1 + K(C*t* − EMA(n)*t*−1)
VWAPVWAPt=∑(Vt×Pt)∑Vt
MACDMACD*t* = EMA(12)*t* − EMA(26)*t*
MACD signalSignal*t* = EMA*MACD*(9)t
STOCH Fast %KFast%K=100×Ct-LL14HH14-LL14
STOCH Fast %DFast%D = SMA*Fast%K*(3)
MOMMOM*t* = C*t* − C*t*−*n*
ROCROCt=CtCt-n-1
BBANDS MidBandMidBand = SMA(20)
BBANDS UpperBandUpperBand = MidBand+2σ(C*t*)
BBANDS LowerBandLowerBand = MidBand − 2σ(C*t*)
RSIRSI=100-1001+RS

C*t* is the closing price, n is the number of periods used, K:2/(n + 1) is the smoothing factor, P*t*:(H*t* + L*t* + C*t*)/3 is the typical price, H*t* is the cumulative maximum price, L*t* is the cumulative minimum price, V*t* is the cumulative traded volume, LL14 is the lowest low over the last 14 periods, HH14 is the highest high over the last 14 periods, σ(C*t*) is the 20-period standard deviation of the closing price, RS is the ratio of average gains to average losses, Up*t* is the upward price change, and Down*t* is the downward price change.

2.3 Machine learning models

In accordance with the objectives of this study, three machine learning models were selected. The first model considered was a decision tree. Decision trees are among the most fundamental methods in artificial intelligence. One of their earliest implementations in the field (ID3) was introduced by Quinlan [20]. As Barber et al. [10] explains, a decision tree is a popular machine learning tool used to solve a wide range of classification problems. Its fundamental training principle is the recursive partitioning of the feature space using a tree structure. The splitting process at each node continues until pure nodes are reached, that is, nodes containing a single class. When a decision tree is used to classify a sample, the sample is traced to a pure leaf node and assigned the class label of the training samples in that node. To choose the best split at a node a criterion is used that seeks to maximize the purity of the child nodes relative to their parent. A common measure for evaluating split quality is Gini impurity, although Shannon entropy can also be used to measure disorder in the information content [9]. The Gini impurity at a node N is given by:

G(N)=1-∑i=1C(pi)2.(1)

While Shannon entropy is given by:

H(N)=-∑i=1Cpilog2pi,(2)

where C is the total number of classes and p*i* is the proportion of the population in class i.

Given these measures (Equations 1 and 2), the best split is the one that maximizes information gain or, equivalently, minimizes impurity [10], which is defined by Equation 3:

ΔI(N)=I(N)-PL·I(NL)-PR·I(NR),(3)

where I(N) is the impurity measure at node N, P*L* is the proportion of the population routed to the left child N*L*, and P*R* is the proportion of the population routed to the right child N*R*. The main drawback of decision trees is that deep trees tend to overfit the training set if hyperparameters are not properly tuned [6]. This occurs because decision trees have very low bias and high variance, so slight noise in the data can cause the tree to grow in a completely different way [9].

The second chosen model was Random Forest. Random Forest model overcomes the limitations of a single decision tree by training an ensemble of decision trees on different subsets of the dataset [6]. It was developed by Breiman [21] and is considered an improved version of tree bagging, and one of the tree-based models with the strongest results for predicting financial time series [3]. Random Forest combines bagging, or bootstrap aggregating, which draws bootstrap samples from the training set, with the use of random feature subspaces. Each tree is trained on a sample of the data with replacement and, at each split, the best partition is evaluated on a random subset of variables, typically of size M, where M is the number of variables [2, 12], following the decision-tree procedure described above. This double randomness reduces correlation among trees, improves the ensemble's stability and accuracy, and enables implicit selection of relevant features. The final prediction is obtained by majority voting over the outputs of the individual trees [21]. Given its ease of implementation and lack of prior distributional assumptions, it is a highly suitable model for classification problems in finance [3].

Finally, Extreme Gradient Boosting (XGBoost) was selected. XGBoost is a technique that belongs to the class of Gradient Boosted Decision Trees [10]. It was proposed by Chen and Guestrin [22] and has become one of the most powerful ensemble learning techniques, being widely used across countless applications. The model is distinguished by its training speed and exceptional accuracy, and it is particularly effective for shallow-learning problems in which structured datasets are available [13]. As described by Basak et al. [10], XGBoost operates within the gradient boosting framework [23], which seeks to sequentially build weak classifiers such that the misclassification rate decreases progressively. Each tree i attempts to better fit the residuals or the misclassified observations in iteration i + 1. To this end, XGBoost defines an objective function to be minimized (Equation 4), composed of two main parts: the model's training loss function, which can be logistic or least squares, and a regularization term that represents the sum of the complexity of each tree [3, 22], modeled as follows:

Obj(θ)=∑i=1nL(yi,yi^)+∑k=1KΩ(fk),(4)

with Ω defined as follows:

Ω(f)=γT+12λ‖w‖2,(5)

where L(yi,yi^) is the loss function, Ω(f) is the model complexity term for regularization (Equation 5), γ is the complexity parameter, T is the number of leaves, λ is the L2 regularization coefficient, and ||w||2 is the squared L2 norm of the leaf weights.

The regularization function is used to shrink the contribution of each decision tree, which is fundamental for preventing overfitting [22]. Additionally, to optimize the objective function, XGBoost applies a second-order Taylor expansion, a mechanism that significantly accelerates the convergence process during training [3]. Among its most prominent features are scalability and computational efficiency, which stem from its handling of sparse data and the use of a weighted quantile sketch procedure for approximate tree learning in parallel and distributed computing environments, requiring lower computational cost compared with other models, which makes it suitable for price prediction in finance [13].

3 Methodology

The intraday assets analyzed in this study were selected according to three liquidity-related criteria: high global trading volume, tight bid-ask spreads, and high trading activity at the 1-min frequency. Furthermore, the dataset was segmented across different market classes to examine the behavior of the proposed methodology under distinct market conditions and characteristics. Stocks were included due to their relative stability, foreign exchange (FX) assets because of their high liquidity, and cryptocurrencies because of their high volatility. This segmentation was intended to assess whether the proposed methodology can be generalized across different financial environments and to evaluate the relevance of distinguishing between asset classes. A detailed description of the selected assets and their classification is provided in Table 2. The analysis period spanned 01-01-2022 to 31-12-2023, with one-minute frequency series obtained from the [24] API. For each asset, open, high, low, close, and volume were downloaded, together with a fixed set of technical indicators. Regarding the feature space, the predictive variables were intentionally restricted to technical and market microstructure indicators derived from high-frequency price and volume data. Fundamental variables, such as earnings reports, valuation ratios, or macroeconomic indicators, were deliberately excluded. Because the proposed trading strategies operate over intraday horizons ranging from 1 to 30 min, these variables are updated at substantially lower frequencies and are therefore unlikely to provide informative signals for sub-hourly price movements. Previous studies have shown that short-term market dynamics are largely influenced by endogenous market mechanisms and localized statistical patterns rather than by long-term economic fundamentals [25, 26]. Rather than applying a data-driven feature selection algorithm, the predictors were selected a priori based on their widespread use in quantitative finance, their relevance for high-frequency trading applications, and their ability to capture complementary aspects of intraday market behavior. Specifically, the selected indicators were grouped into three operational dimensions: (i) trend-following indicators (e.g., EMA and MACD), which characterize directional persistence; (ii) momentum oscillators (e.g., RSI and Stochastic Oscillator), which identify potential overbought and oversold conditions; and (iii) volume and volatility indicators (e.g., Bollinger Bands and VWAP), which capture changes in market activity, liquidity, and price variability. This taxonomy provides a diverse and complementary representation of the intraday market state while reducing redundancy among the selected predictors. The final indicators included 10-period simple and exponential moving averages, VWAP, MACD with parameters 12, 26, and 9, the Stochastic Oscillator with parameters 14 and 3, 1-period Momentum and ROC, 20-period Bollinger Bands, and 14-period RSI. Their formulas are shown in Table 1.

Table 2. Classification of the selected assets.

ClassificationTickerAsset
Communication servicesDISThe Walt Disney Company
GOOGLAlphabet
METAMeta platforms
TAT&T
Consumer discretionaryAMZNAmazon
DPZDomino's Pizza
FFord Motor
MCDMcDonald's
NKENike
SBUXStarbucks
TSLATesla
UAAUnder Armor
Consumer staplesCLColgate-Palmolive
COSTCostco Wholesale
KOCoca-Cola
PEPPepsiCo
PGProcter & Gamble
TGTTarget
Information technologyAAPLApple
AMDAdvanced micro devices
INTCIntel
MSFTMicrosoft
NVDANVIDIA
FinancialsPYPLPayPal
Major pairAUD/USDAustralian dollar/U.S. dollar
CAD/USDCanadian dollar/U.S. dollar
CHF/USDSwiss franc/U.S. dollar
EUR/USDEuro/U.S. dollar
GBP/USDPound sterling/U.S. dollar
NZD/USDNew Zealand dollar/U.S. dollar
Exotic pairCAD/MXNCanadian dollar/Mexican peso
EUR/MXNEuro/Mexican peso
GBP/MXNPound sterling/Mexican peso
USD/MXNU.S. dollar/Mexican peso
Major CryptoBTC/USDBitcoin/U.S. dollar
ETH/USDEthereum/U.S. dollar
AltcoinADA/USDCardano/U.S. dollar
BNB/USDBNB/U.S. dollar
SOL/USDSolana/U.S. dollar
XRP/USDXRP/U.S. dollar

The predictive objective was to anticipate, for intraday horizons h = 1, 3, 5, 10, 15, 30 min, whether the future price movement would exceed the asset's transaction cost. To ensure a uniform assumption regarding transaction costs within each asset class, the broker-reported values in Table 3 were used as references: (i) for equities, a fee of 200 pips (400 pips round-trip) was assumed; (ii) for foreign exchange (FX), a symmetric fixed cost of approximately 1 pip (2 pips round-trip) was applied; and (iii) for cryptocurrencies, a more conservative cost of approximately 100 pips (200 pips round-trip) was considered. In the remainder of this study, these standardized values are treated as fixed one-way transaction-cost assumptions and should not be interpreted as the exact bid–ask spreads observed at each execution.

Table 3. Comparison of broker-reported spreads (in pips) and the standardized values adopted in the experiments.

AssetIGActivtradesCMC marketsOANDAInteractive brokersUsed value
EUR/USD0.850.80.70.60.21
GBP/USD1.410.90.80.41
BTC/USD–91.74–––100
ETH/USD–8.25–––100
Stocks–200–0–200

To this end, two target variables were constructed for each time horizon: an “up” variable when the forward return is greater than or equal to the transaction cost, and a “down” variable when the forward return is less than or equal to the transaction cost in negative value, allowing for both long and short positions. In both cases, trades were executed only on the label “1.” That is

TargetUp(t,h)={1,if Ct+h≥Ct+2c,0,if Ct+h<Ct+2c.(6)

TargetDown(t,h)={1,if Ct+h≤Ct-2c,0,if Ct+h>Ct-2c.(7)

Where C*t* is the closing price at time t, h is the time horizon, and c denotes the fixed one-way transaction-cost assumption corresponding to the asset class under analysis, using the standardized values described above. The factor 2 accounts for the two sides of a complete transaction—entry and exit—so that 2c represents the assumed round-trip cost.

Accordingly, TargetUp(*t, h*) = 1 indicates that the subsequent upward price movement is sufficiently large to cover the assumed round-trip transaction cost, while TargetDown(*t, h*) = 1 represents the analogous condition for a downward movement.

Transaction costs are incorporated again at the economic-evaluation stage, where the profitability of the trades generated from these predictions is calculated using the adjusted execution price defined in Equation 15. This second application serves a different purpose: Equations 6, 7 use transaction costs to define economically relevant prediction targets, whereas Equation 15 incorporates them into the realized profit-and-loss calculation. The same asset-specific cost assumptions are maintained throughout all rolling iterations and across both stages of the analysis.

For model training and validation, a walk-forward rolling-window scheme was adopted (Figure 1). The complete experimental procedure consisted of three sequential stages, as detailed in Algorithms 1–4. First, during the preliminary configuration-selection stage, candidate training-window sizes, learning models, prediction directions, and forecasting horizons were evaluated to select the configuration with the highest Fβ − Score. Second, Bayesian hyperparameter optimization was performed for the selected configuration using the rolling validation procedure described in Algorithm 3. At each validation iteration, the model was trained on s* consecutive observations and evaluated on the immediately subsequent validation window of 2,000 observations. Class imbalance was addressed through class weighting, which was optimized jointly with the remaining model hyperparameters. Finally, once the optimal hyperparameters had been selected, they were fixed for the final rolling-window evaluation described in Algorithm 4. No observation used for final performance reporting had previously influenced model, prediction-horizon, direction, training-window-size, or hyperparameter selection. At each final rolling iteration, the selected model was trained using the current training window and subsequently evaluated on the immediately following test window of 2,000 observations. The training and test windows were then advanced sequentially until no complete training–test window remained available. This procedure preserves the temporal ordering of the data and ensures that all reported test predictions are strictly out of sample. To prevent look-ahead bias, all predictive features associated with time t were based exclusively on information available up to that time.

Rolling window training diagram.
Figure 1. Rolling window training diagram.

Algorithm 1 Machine learning training, optimization, and prediction framework. Algorithmic pseudocode block detailing a workflow for financial asset prediction. It specifies requirements, data retrieval from the TwelveData API, a three-stage process including preliminary configuration, Bayesian hyperparameter optimization, and final rolling-window training and prediction, concluding with reporting performance results.

Algorithm 2 Preliminary configuration and training-window selection. Algorithm pseudocode for a preliminary training procedure is shown. It requires asset dataset, training sizes, models, directions, prediction horizons, test-window size, and beta. Steps include looping through all directions, horizons, training sizes, and models, computing target variables, defining training and configuration-selection intervals, training and evaluating models using F-beta Score, storing results, comparing configurations, and selecting the best configuration to return.

Algorithm 3 Bayesian hyperparameter optimization. Algorithm pseudo-code titled “BayesianOptimization” is shown for hyperparameter tuning using TPE, Hyperband pruning, and rolling window validation. It details data requirements, initialization, iterative sampling, model training, evaluation using F-beta score, pruning, and selection of optimal hyperparameters.

Algorithm 4 Final rolling-window training and prediction. Text-based flowchart shows a procedure for final training prediction with an asset dataset, specifying required inputs and a step-by-step algorithm for rolling window prediction, test generation, and combining out-of-sample results.

The three models mentioned in Section 2.3 were considered for classification: Decision Tree, Random Forest, and XGBoost. Default hyperparameters were used as a starting point. Since directional predictive performance does not necessarily translate into economic profitability, particularly due to payoff asymmetries where a small number of adverse trades can offset a larger number of profitable ones, this consideration was explicitly incorporated into the hyperparameter optimization process. Rather than optimizing standard accuracy metrics, Bayesian optimization was conducted using the Fβ-Score with β = 0.10 as the objective function. This metric prioritizes precision over recall and is particularly appropriate when the cost of false-positive trading signals is high. Table 4 summarizes the hyperparameters considered for each model.

Table 4. Hyperparameter map per model.

HyperparameterDecision treeRandom forestXGBoost
max_depthXXX
min_samples_splitXX
min_samples_leafXX
splitterX
criterionXX
n_estimatorsXX
max_featuresX
learning_rateX
subsampleX
colsample_bytreeX
reg_alphaX
reg_lambdaX
min_child_weightX
gammaX

Different window sizes (N = 50, 000, 25, 000, 10, 000, 5, 000), horizons, and price directions were compared. Since small price movements are more common than extreme movements in intraday data, this setting may induce class imbalance in the up and down labels. Therefore, class weights were employed to mitigate potential bias. Optimizing class weights during training assigns a higher weight to the minority class, increasing the number of minority-class predictions. A study by Abdelhamid and Desai [27] compared applying class-imbalance control strategies against a baseline model with no intervention and found that applying these strategies improves the predictive power of the models.

Model performance was evaluated using precision, recall, F1-Score, and Fβ-Score. Precision (Equation 8) measures the proportion of positive predictions that are correct, which is equivalent to the fraction of true positives over the total number of positive predictions. Mathematically, it is defined as:

Precision=TPTP+FP,(8)

where TP is the number of true positives and FP is the number of false positives. Recall refers (Equation 9) to the proportion of actual positives that the model correctly identifies. It is computed as:

Recall=TPTP+FN,(9)

where TP is the number of true positives and FN is the number of false negatives.

F1-Score (Equation 10) is the most commonly used case of the Fβ-Score (Equation 11). Recall that, Fβ-Score refers to the relative weight of precision and recall. For β > 1, recall is emphasized, whereas for β < 1, precision is emphasized. When β = 1, it represents the harmonic mean of precision and recall, thus combining both into a single measure and proving useful when balancing false positives and false negatives is desired, especially under class imbalance. The F1-Score is defined as follows:

F1-Score=2×Precision×RecallPrecision+Recall(10)

while the general formula for the Fβ-Score is defined as:

Fβ-Score=(1+β2)×Precision×Recallβ2×Precision+Recall(11)

Based on preliminary results, the best-performing model was identified as the one that achieved the highest Fβ-Score, using precision and recall as supporting criteria. Bayesian optimization was then applied to tune the model hyperparameters for the selected candidate specification. This selection was conducted for a specific combination of training window size, time horizon, and price direction for each asset.

With the optimal hyperparameters, the selected model was trained at each rolling iteration using only the observations contained in the corresponding training window and subsequently evaluated on the immediately following out-of-sample test observations. Its performance was reported using precision, recall, F1-Score, and Fβ-Score with β = 0.10, in addition to confusion matrices. Furthermore, its practical incorporation into day-trading strategies was considered by evaluating the model's economic performance. Profits and losses P*n*L*Total* (Equation 12), as well as the average return per trade r̄ (Equation 13), were computed over the set of positive predictions throughout the period T+={t∈T:Predictiont=1}, as follows:

PnLTotal=∑t∈T+PnL(t,h),(12)

and

r̄=1N∑t∈T+PnL(t,h)Pt.(13)

Where

PnL(t,h)={Ct+h-Pt,if direction = Up,Pt-Ct+h,if direction = Down,(14)

with

Pt={Ct+2c,if direction = Up,Ct-2c,if direction = Down.(15)

Here P*n*L(*t, h*) (Equation 14) refers to the profit or loss at time t over a horizon h, P*t* is the entry price at time t, C*t* is the closing price at time t, h is the time horizon, c is the fixed one-way transaction-cost assumption corresponding to the asset class under analysis, and N is the total number of trades. Through this, the model's profitability was assessed, with the results presented in Section 4.

To provide a comprehensive financial evaluation of the proposed trading strategies, three complementary performance metrics were considered: the Sharpe Ratio, Sortino Ratio, and Calmar Ratio. The Sharpe Ratio [28] measures the average excess return earned per unit of total risk. Because this metric penalizes both positive and negative return volatility equally, the Sortino Ratio [29] was also included. By replacing the standard deviation with the downside semi-deviation, the Sortino Ratio focuses exclusively on downside volatility and therefore provides an additional assessment of downside risk. To evaluate performance under adverse market conditions, the Calmar Ratio [30] was also analyzed. The Calmar Ratio relates the annualized return to the maximum drawdown observed during the out-of-sample backtesting period, thereby measuring the return achieved per unit of realized downside risk.

Prior to the final experimental procedure, the Deflated Sharpe Ratio (DSR) [31] was used as a preliminary robustness analysis to assess the performance observed across the candidate configurations while accounting for multiple testing. This analysis was performed only as a diagnostic step and was not used as a model-selection criterion. Thus, the DSR provided a complementary assessment of whether the observed performance could be attributed to data-snooping rather than to a robust predictive pattern.

To further evaluate the robustness of the proposed trading strategies under realistic execution conditions, we introduce the Maximum Tolerable Slippage (MTS). This metric is motivated by the return-on-execution-cost framework presented in De Prado [26], which emphasizes the impact of execution costs on the economic viability of quantitative trading strategies. The MTS (Equation 16) quantifies the maximum average adverse price movement, expressed in price units per execution, that each execution can tolerate while preserving positive net profitability after transaction costs. It is defined as

MTSi=max{0,PnLNet,i2Ni},(16)

where P*n*L*Net,i* denotes the cumulative net profit obtained for asset i after transaction costs, and 2N*i* is the total number of executions associated with the completed round-trip trades. The denominator accounts for the two executions associated with each completed trade (entry and exit). Consequently, for profitable strategies, the MTS represents the average adverse slippage per execution that would reduce the net profit of the trading strategy to zero, providing an intuitive measure of its robustness to execution costs. For strategies with non-positive net profitability, the MTS is set to zero, since no additional adverse execution slippage can be tolerated while preserving profitability.

3.1 Implementation and reproducibility details

All machine-learning experiments were implemented in Python 3.12.4 using NumPy 2.2.6, Pandas 2.3.3, SciPy 1.15.3, Scikit-learn 1.7.0, XGBoost 3.0.2, and Optuna 4.3.0. Market data and technical indicators were obtained through Twelve Data (version 1.2.25). No missing observations were present in the datasets used in the experiments; therefore, no imputation or missing-data treatment was required. No additional trading-session filters or timezone transformations were applied.

Bayesian hyperparameter optimization was implemented using Optuna with a Tree-structured Parzen Estimator (TPE) sampler and a Hyperband pruner. The optimization used 100 trials, including 25 startup trials, with 32 expected-improvement candidates. The Hyperband pruner was configured with a minimum resource of 5, the maximum available resource as the upper bound, and a reduction factor of 2. The optimization objective was the Fβ-Score with β = 0.10, computed from the validation predictions accumulated across the rolling-window iterations. Each rolling validation window contained 2,000 observations, as detailed in Algorithm 3. The hyperparameter search spaces and corresponding distributions are reported in Table 5.

Table 5. Hyperparameter search spaces used for Bayesian Optimization.

ModelHyperparameterSearch space
XGBoostmax_depth[3, 15]
n_estimators[10, 400]
learning_rate[0.001, 0.3] (log scale)
subsample[0.4, 1.0]
colsample_bytree[0.5, 1.0]
reg_alpha[10−6, 10] (log scale)
reg_lambda[10−3, 5] (log scale)
min_child_weight[1, 20]
gamma[0, 5]
Random Forest Classifiermax_depth[3, 15]
n_estimators[50, 500]
min_samples_split[2, 10]
min_samples_leaf[1, 10]
max_features{sqrt, log2, None}
criterion{gini, entropy}
Decision Tree Classifiermax_depth[3, 15]
min_samples_split[2, 10]
min_samples_leaf[1, 10]
splitter{best, random}
criterion{gini, entropy}

A random seed of 77 was used for the preliminary experiment and Bayesian optimization. To quantify algorithmic variability after model selection and hyperparameter optimization, the final configuration was independently evaluated using 30 predefined random seeds. The complete list of seeds was fixed before the repeated experiments to ensure reproducibility.1

The technical indicators obtained from Twelve Data were based on information available up to time t, such that each feature vector depended only on current and historical observations. At each rolling iteration, the machine-learning model used only the observations contained in the corresponding training window for model fitting, as described in Algorithms 3, 4.

4 Results

Following the established methodology, the machine learning models were trained using the historical information and the defined technical indicators. Preliminary results for a representative asset are reported using the format shown in Table 6. Based on this evaluation, the best-performing configuration was selected, whose row is highlighted in color. Hyperparameters were subsequently optimized for the selected configuration. The aggregated results are presented in Table 7, together with supplementary tables that provide a more detailed breakdown of model performance across different evaluation dimensions. To quantify the algorithmic variability associated with the stochastic training process, each model was independently retrained 30 times using the optimal hyperparameters obtained during the optimization stage. For each performance metric, the corresponding mean and standard deviation were computed. These standard deviations quantify algorithmic variability across repeated model runs and should not be interpreted as statistical uncertainty associated with temporal dependence, changing market regimes, or strategy profitability.

Table 6. Preliminary results and best-performing model for a specific asset.

InstancesModelTargetPrecisionRecallF1-scoreFβ-scoreSharpe ratioDeflated Sharpe ratioSupport
50,000XGBoostTarget_30_down0.5959150.6116680.6036890.5960672.08050.98731097
50,000Random Forest ClassifierTarget_30_down0.5814930.5041020.5400390.5806111.73150.85321097
50,000Decision Tree ClassifierTarget_30_down0.5589430.5013670.5285920.5583081.98300.56371097
50,000XGBoostTarget_15_down0.5557940.4952200.5237610.5551221.23290.00041046
50,000XGBoostTarget_10_down0.5512300.5213180.5358570.5509171.27490.00041032
50,000Decision Tree ClassifierTarget_15_down0.5453610.5057360.5248020.5449381.61250.00191046
10,000Decision Tree ClassifierTarget_10_up0.5157170.5062680.5109490.515622-0.13712.44 × 10−81037
5,000Random Forest ClassifierTarget_10_down0.5070320.7069140.5905170.5084550.06021.61 × 10−7969
50,000XGBoostTarget_30_up0.5016570.5224400.5118380.5018550.22474.84 × 10−7869
5,000XGBoostTarget_10_down0.4961570.7327140.5916670.497748–0.20452.05 × 10−8969
5,000Decision Tree ClassifierTarget_10_down0.4952380.6976260.5792630.496665–0.53921.24 × 10−9969
50,000Decision Tree ClassifierTarget_10_up0.4945260.5975740.5411880.495371–0.55511.48 × 10−9907
10,000Decision Tree ClassifierTarget_5_down0.4941390.5762360.5320390.494837–1.16612.68 × 10−12951
10,000Decision Tree ClassifierTarget_3_down0.4933880.6277600.5525220.494436–1.43903.63 × 10−14951
5,000XGBoostTarget_3_down0.4907340.6817710.5706900.492099–1.21742.40 × 10−12971
50,000XGBoostTarget_15_up0.4907980.6167400.5466080.491792–1.01333.01 × 10−11908
5,000Decision Tree ClassifierTarget_15_down0.4898910.6638570.5637580.491166–0.21891.81 × 10−8949
5,000Decision Tree ClassifierTarget_30_down0.4890990.7331150.5867480.4907160.96086.12 × 10−5918
5,000XGBoostTarget_15_down0.4872570.8461540.6184060.489312–0.07475.73 × 10−8949
50,000XGBoostTarget_10_up0.4870880.6030870.5389160.488018–1.23416.34 × 10−12907

Results are presented in descending order based on Fβ-Score.

Table 7. Average return per asset.

AssetAsset typeModelIntervalDirectionTrain sizeAvg. PrecisionAvg. RecallAvg. F1-scoreAvg. Fβ-scoreAvg. P&LAvg. PriceAvg. Return per trade
TSLAStockRandom Forest30down25,00050.19%12.49%20.01%48.73%1,463.08240.470.0153%
std.-----0.15%0.10%0.14%0.14%118.94-0.0030%
AAPLStockDecision Tree30up50,00051.70%16.75%25.30%50.65%145.39163.620.0045%
std.-----0.08%0.06%0.07%0.08%18.43-0.0005%
MSFTStockDecision Tree30down25,00048.93%29.49%36.80%48.61%463.40291.230.0020%
std.-----0.04%0.05%0.03%0.04%63.37-0.0004%
PEPStockXGBoost30down50,00047.36%9.77%16.20%45.62%–71.11174.43–0.0027%
std.-----0.23%0.14%0.19%0.22%40.87-0.0017%
DISStockDecision Tree30down25,00047.94%27.68%35.10%47.60%–27.72103.37–0.0039%
std.-----0.11%0.20%0.17%0.11%61.29-0.0014%
PGStockXGBoost30down5,00047.43%39.42%43.05%47.33%–450.54147.88–0.0051%
std.-----0.11%0.32%0.19%0.11%86.95-0.0008%
GOOGLStockDecision Tree30down50,00048.85%26.14%34.06%48.43%–260.16116.63–0.0065%
std.-----0.05%0.08%0.07%0.05%17.65-0.0005%
MCDStockRandom Forest30down50,00047.58%9.55%15.90%45.78%-291.68266.33–0.0081%
std.-----0.18%0.06%0.08%0.17%46.27-0.0013%
DPZStockXGBoost30down50,00048.64%34.40%40.29%48.44%–962.63366.22–0.0104%
std.-----0.37%1.30%0.94%0.37%645.46-0.0056%
TGTStockXGBoost30down10,00048.48%75.59%59.08%48.65%–2,024.46160.66–0.0125%
std.-----0.06%0.28%0.11%0.06%260.22-0.0009%
AMZNStockXGBoost30down25,00048.02%32.47%38.74%47.79%–612.54123.68–0.0126%
std.-----0.17%0.37%0.28%0.17%139.87-0.0023%
NKEStockXGBoost30down5,00047.75%99.39%64.51%48.00%–2,320.66114.61–0.0136%
std.-----0.01%0.14%0.03%0.01%26.80-0.0001%
COSTStockRandom Forest30down10,00047.52%37.57%41.97%47.40%–5,564.12522.42–0.0151%
std.-----0.05%0.16%0.11%0.05%130.14-0.0004%
SBUXStockXGBoost30down5,00047.31%87.12%61.32%47.53%–2,913.0894.25–0.0205%
std.-----0.04%0.26%0.10%0.04%30.63-0.0002%
PYPLStockRandom Forest30up50,00045.03%10.51%17.04%43.61%–149.7682.00–0.0212%
std.-----0.18%0.08%0.12%0.17%32.67-0.0030%
CLStockDecision Tree10down5,00042.71%11.41%18.01%41.58%-387.5176.55–0.0239%
std.-----0.13%0.14%0.18%0.14%8.97-0.0006%
KOStockXGBoost30down10,00043.04%34.72%38.43%42.94%–983.6060.76-0.0263%
std.-----0.21%0.88%0.55%0.20%65.36-0.0014%
AMDStockDecision Tree15down25,00047.63%26.05%33.65%47.24%–1,174.5296.92–0.0294%
std.-----0.36%1.74%1.47%0.36%248.44-0.0056%
METAStockRandom Forest30down25,00048.67%25.13%33.15%48.22%–2,234.48220.77-0.0356%
std.-----0.14%0.26%0.22%0.13%181.15-0.0021%
INTCStockXGBoost30up50,00044.64%63.30%52.36%44.78%–1,874.9136.18-0.0631%
std.-----0.11%0.39%0.17%0.11%65.59-0.0021%
NVDAStockDecision Tree30down5,00042.01%48.33%44.92%42.06%–2,154.5927.52–0.1060%
std.-----0.25%2.32%1.04%0.25%165.20-0.0047%
TStockXGBoost30up25,00031.22%0.84%1.64%22.95%–40.9817.63–0.1463%
std.-----1.44%0.13%0.24%1.39%8.50-0.0152%
UAAStockDecision Tree30down5,00036.33%10.31%16.03%35.43%-319.9410.12-0.1838%
std.-----0.89%1.20%1.43%0.84%46.37-0.0111%
FStockRandom Forest30up10,00036.19%0.54%1.06%21.81%–20.6013.60–0.2170%
std.-----1.22%0.03%0.05%0.52%3.60-0.0217%
CHF/USDFXDecision Tree30up50,00046.77%16.50%24.40%45.93%–5.571.08–0.0048%
std.-----0.01%0.01%0.01%0.01%0.01-0.0000%
EUR/USDFXDecision Tree30up10,00045.17%7.50%12.86%43.03%–4.701.07–0.0082%
std.-----0.02%0.03%0.04%0.03%0.01-0.0000%
CAD/USDFXXGBoost30down50,00040.83%1.40%2.71%31.93%–0.780.76-0.0111%
std.-----0.32%0.04%0.07%0.30%0.04-0.0004%
GBP/USDFXXGBoost30up5,00041.36%5.00%8.92%38.58%–5.551.24-0.0118%
std.-----0.29%0.22%0.36%0.34%0.27-0.0005%
NZD/USDFXDecision Tree30up50,00045.09%44.25%44.66%45.08%–28.630.63–0.0155%
std.-----0.01%0.08%0.04%0.01%0.12-0.0000%
AUD/USDFXDecision Tree30up50,00044.88%10.54%17.06%43.48%–7.800.68–0.0159%
std.-----0.31%0.33%0.44%0.30%0.49-0.0009%
GBP/MXNFXXGBoost30down50,00019.69%5.77%8.93%19.23%–412.7423.49–0.1432%
std.-----0.24%0.08%0.11%0.23%5.22-0.0012%
EUR/MXNFXXGBoost30up50,00010.72%5.96%7.66%10.63%–511.2820.20–0.1717%
std.-----0.10%0.09%0.09%0.10%7.74-0.0005%
USD/MXNFXXGBoost30down50,00013.04%16.08%14.39%13.06%-974.8418.94–0.1802%
std.-----0.35%0.95%0.41%0.34%68.21-0.0008%
CAD/MXNFXXGBoost30down50,0006.67%18.86%9.86%6.72%–870.3914.32–0.2427%
std.-----0.04%0.10%0.06%0.04%3.98-0.0004%
BNB/USDCryptoDecision Tree15up50,00048.69%42.94%45.63%48.62%1,592.87295.690.0238%
std.-----0.01%0.04%0.02%0.01%34.63-0.0002%
BTC/USDCryptoRandom Forest30up50,00052.64%17.48%26.25%51.61%2,24,442.1428,537.060.0031%
std.-----0.07%0.07%0.08%0.07%39958.86-0.0007%
ETH/USDCryptoXGBoost15down5,00051.16%48.82%49.96%51.14%11,769.251,892.41–0.0003%
std.-----0.03%0.10%0.05%0.03%1826.72-0.0043%
SOL/USDCryptoRandom Forest30down10,00046.50%49.22%47.82%46.53%–6,214.1343.80–0.0565%
std.-----0.08%0.20%0.11%0.08%279.16-0.0015%
XRP/USDCryptoRandom Forest30down10,00042.74%16.01%23.30%42.05%–52.820.51–0.0756%
std.-----0.05%0.04%0.04%0.04%0.49-0.0006%
ADA/USDCryptoXGBoost30down25,00039.44%14.56%21.27%38.79%–60.180.55–0.1265%
std.-----0.07%0.05%0.06%0.06%0.71-0.0009%

The results are presented in descending order according to the average return per transaction, grouped by asset type.

The experimental results are analyzed from two distinct perspectives. Predictive performance evaluates the ability of the machine learning models to correctly identify future price movements, whereas economic performance assesses whether the resulting trading signals generate profitable strategies after incorporating transaction costs. These dimensions are analyzed separately because superior predictive performance does not necessarily translate into economic profitability. Four main findings emerged from the experiments. Regarding model selection, XGBoost was the most frequently selected learning algorithm, while longer forecasting horizons—particularly the upper boundary of 30 min—were preferred across most assets. Regarding predictive performance, stocks and cryptocurrencies generally exhibited stronger results than FX pairs. However, this predictive advantage did not systematically translate into economic profitability: after transaction costs, only a limited subset of the analyzed strategies generated positive net returns.

4.1 Model selection and experimental configuration

As shown in Table 7, XGBoost was selected for 18 of the 40 analyzed assets, followed by Decision Tree for 13 assets and Random Forest for 9. Across the 24 stocks, XGBoost was selected in 10 cases, Decision Tree in 8, and Random Forest in 6. For the 10 FX pairs, XGBoost was selected in 6 cases and Decision Tree in the remaining 4. In contrast, Random Forest was the most frequently selected model for cryptocurrencies, accounting for 3 of the 6 assets, followed by XGBoost in 2 cases and Decision Tree in 1. Overall, these results indicate that XGBoost provided the most competitive performance across the evaluated assets, although the preferred model varied across asset classes. This behavior suggests that no single learning algorithm is universally preferable for all financial instruments, reinforcing the importance of evaluating multiple model families when developing intraday forecasting strategies.

Regarding the training window size, 50,000 observations was the most frequently selected configuration, being chosen for 17 of the 40 analyzed assets. The remaining assets were distributed across the other window sizes, with 25,000 and 5,000 observations each selected for 8 assets, and 10,000 observations selected for the remaining 7 assets. The preferred training window varied across asset classes. Among the 10 FX pairs, 8 selected a window of 50,000 observations, indicating a clear preference for longer historical contexts. In contrast, cryptocurrencies exhibited a more balanced distribution across the evaluated window sizes, with no single configuration clearly dominating. Similarly, the stock market displayed substantial variability: while Consumer Staples generally favored larger training windows, Information Technology more frequently selected shorter ones. These results suggest that the amount of historical information that provides the best predictive performance depends on the characteristics of each asset rather than on a universal training-window length.

With respect to the target direction, 27 assets (67.5%) selected the downward formulation and 13 (32.5%) selected the upward formulation. Both TargetUp and TargetDown were evaluated as alternative prediction tasks, allowing the framework to assess both market directions during model selection. When disaggregated by asset class, the downward formulation was selected for 19 of the 24 stocks, whereas the upward formulation predominated among FX pairs, being selected for 6 of the 10 assets. Cryptocurrencies exhibited a more balanced distribution, with 4 assets favoring the downward formulation and 2 the upward formulation. For each asset, both prediction directions were evaluated jointly with the remaining candidate configurations, and the configuration achieving the highest Fβ-Score was retained. No minimum Fβ-Score threshold was imposed; therefore, the reported values represent the best relative predictive performance within the evaluated candidate pool rather than performance above a predefined threshold. These results indicate that the preferred prediction direction depends on the characteristics of the underlying asset and support evaluating both directional formulations rather than imposing a common forecasting direction across all instruments.

The forecasting horizon exhibited the clearest pattern among the selected configurations. Among the 24 stocks, 22 selected the 30-min forecasting horizon, while the remaining two selected horizons of 15 and 10 min, respectively. All 10 FX pairs selected the 30-min horizon, whereas 4 of the 6 cryptocurrencies also favored this configuration, with the remaining two selecting the 15-min horizon. At the sector level, only Information Technology, Consumer Staples, and the cryptocurrency categories (major cryptocurrencies and altcoins) selected horizons shorter than 30 minutes. Importantly, the 30-min horizon represents the upper boundary of the candidate set considered in this study, 1, 3, 5, 10, 15, 30 min. Therefore, these results should not be interpreted as establishing 30 min as a globally optimal forecasting horizon. Rather, they indicate that, within the range of horizons examined, predictive performance frequently improved toward the upper boundary of the candidate set. This pattern suggests that immediate price fluctuations at the one-minute scale may contain substantial short-term noise and that longer forecasting horizons can provide more informative directional targets. Whether this tendency persists beyond 30 min requires evaluation over a broader range of forecasting horizons.

4.2 Predictive performance

Predictive performance was evaluated independently of the profitability generated by the corresponding trading strategies. This analysis therefore focuses exclusively on the ability of the selected models to identify future directional movements using the Fβ-Score, precision, recall, and F1 − Score. The results reported in Table 8 indicate that stocks exhibited the strongest overall predictive performance among the analyzed asset classes, with an average Fβ-Score of 43.88%, an average precision of 45.35%, and an average recall of 33.35%. The highest-performing assets were primarily concentrated in the Information Technology sector, whereas the Financials sector exhibited the lowest values across the evaluated metrics. A common characteristic across nearly all equity sectors was the combination of relatively high precision and comparatively low recall. This behavior is consistent with the design of the proposed framework, in which the Fβ-Score assigns greater importance to precision than to recall. Consequently, the selected models tend to favor higher precision at the expense of identifying a smaller proportion of all positive observations. The results for FX pairs (Table 9) were generally more modest. Major currency pairs outperformed exotic pairs, whereas the latter exhibited lower Fβ-Score and precision values. This result indicates that the selected models encountered greater difficulty in identifying reliable directional patterns for exotic currency pairs. Cryptocurrencies, in contrast, achieved competitive predictive performance, particularly among major cryptocurrencies, which exhibited precision values exceeding 50% together with relatively high Fβ-Scores. Altcoins displayed comparable overall behavior, although greater heterogeneity was observed across individual assets. Overall, cryptocurrencies achieved predictive performance comparable to that observed for equities and generally stronger than that obtained for FX pairs.

Table 8. Average evaluation metrics per asset.

AssetClassificationModelIntervalDirectionAvg. PrecisionAvg. RecallAvg. F1-ScoreAvg. Fβ-score
AAPLInformation technologyDecision Tree30up51.70%16.75%25.30%50.65%
std.----0.08%0.06%0.07%0.08%
TSLAConsumer discretionaryRandom Forest30down50.19%12.49%20.01%48.73%
std.----0.15%0.10%0.14%0.14%
TGTConsumer staplesXGBoost30down48.48%75.59%59.08%48.65%
std.----0.06%0.28%0.11%0.06%
MSFTInformation technologyDecision Tree30down48.93%29.49%36.80%48.61%
std.----0.04%0.05%0.03%0.04%
DPZConsumer discretionaryXGBoost30down48.64%34.40%40.29%48.44%
std.----0.37%1.30%0.94%0.37%
GOOGLCommunication servicesDecision Tree30down48.85%26.14%34.06%48.43%
std.----0.05%0.08%0.07%0.05%
METACommunication servicesRandom Forest30down48.67%25.13%33.15%48.22%
std.----0.14%0.26%0.22%0.13%
NKEConsumer discretionaryXGBoost30down47.75%99.39%64.51%48.00%
std.----0.01%0.14%0.03%0.01%
AMZNConsumer discretionaryXGBoost30down48.02%32.47%38.74%47.79%
std.----0.17%0.37%0.28%0.17%
DISCommunication servicesDecision Tree30down47.94%27.68%35.10%47.60%
std.----0.11%0.20%0.17%0.11%
SBUXConsumer discretionaryXGBoost30down47.31%87.12%61.32%47.53%
std.----0.04%0.26%0.10%0.04%
COSTConsumer staplesRandom Forest30down47.52%37.57%41.97%47.40%
std.----0.05%0.16%0.11%0.05%
PGConsumer staplesXGBoost30down47.43%39.42%43.05%47.33%
std.----0.11%0.32%0.19%0.11%
AMDInformation technologyDecision Tree15down47.63%26.05%33.65%47.24%
std.----0.36%1.74%1.47%0.36%
MCDConsumer discretionaryRandom Forest30down47.58%9.55%15.90%45.78%
std.----0.18%0.06%0.08%0.17%
PEPConsumer staplesXGBoost30down47.36%9.77%16.20%45.62%
std.----0.23%0.14%0.19%0.22%
INTCInformation technologyXGBoost30up44.64%63.30%52.36%44.78%
std.----0.11%0.39%0.17%0.11%
PYPLFinancialsRandom Forest30up45.03%10.51%17.04%43.61%
std.----0.18%0.08%0.12%0.17%
KOConsumer staplesXGBoost30down43.04%34.72%38.43%42.94%
std.----0.21%0.88%0.55%0.20%
NVDAInformation technologyDecision Tree30down42.01%48.33%44.92%42.06%
std.----0.25%2.32%1.04%0.25%
CLConsumer staplesDecision Tree10down42.71%11.41%18.01%41.58%
std.----0.13%0.14%0.18%0.14%
UAAConsumer discretionaryDecision Tree30down36.33%10.31%16.03%35.43%
std.----0.89%1.20%1.43%0.84%
TCommunication servicesXGBoost30up31.22%0.84%1.64%22.95%
std.----1.44%0.13%0.24%1.39%
FConsumer discretionaryRandom Forest30up36.19%0.54%1.06%21.81%
std.----1.22%0.03%0.05%0.52%

Results are presented in descending order according to the Fβ score, grouped by asset type. Part I.

Table 9. Average evaluation metrics per asset.

AssetClassificationModelIntervalDirectionAvg. PrecisionAvg. RecallAvg. F1-ScoreAvg. Fβ-Score
CHF/USDMajor pairDecision Tree30up46.77%16.50%24.40%45.93%
std.----0.01%0.01%0.01%0.01%
NZD/USDMajor pairDecision Tree30up45.09%44.25%44.66%45.08%
std.----0.01%0.08%0.04%0.01%
AUD/USDMajor pairDecision Tree30up44.88%10.54%17.06%43.48%
std.----0.31%0.33%0.44%0.30%
EUR/USDMajor pairDecision Tree30up45.17%7.50%12.86%43.03%
std.----0.02%0.03%0.04%0.03%
GBP/USDMajor pairXGBoost30up41.36%5.00%8.92%38.58%
std.----0.29%0.22%0.36%0.34%
CAD/USDMajor pairXGBoost30down40.83%1.40%2.71%31.93%
std.----0.32%0.04%0.07%0.30%
GBP/MXNExotic pairXGBoost30down19.69%5.77%8.93%19.23%
std.----0.24%0.08%0.11%0.23%
USD/MXNExotic pairXGBoost30down13.04%16.08%14.39%13.06%
std.----0.35%0.95%0.41%0.34%
EUR/MXNExotic pairXGBoost30up10.72%5.96%7.66%10.63%
std.----0.10%0.09%0.09%0.10%
CAD/MXNExotic pairXGBoost30down6.67%18.86%9.86%6.72%
std.----0.04%0.10%0.06%0.04%
BTC/USDMajor cryptoRandom Forest30up52.64%17.48%26.25%51.61%
std.----0.07%0.07%0.08%0.07%
ETH/USDMajor cryptoXGBoost15down51.16%48.82%49.96%51.14%
std.----0.03%0.10%0.05%0.03%
BNB/USDAltcoinDecision Tree15up48.69%42.94%45.63%48.62%
std.----0.01%0.04%0.02%0.01%
SOL/USDAltcoinRandom Forest30down46.50%49.22%47.82%46.53%
std.----0.08%0.20%0.11%0.08%
XRP/USDAltcoinRandom Forest30down42.74%16.01%23.30%42.05%
std.----0.05%0.04%0.04%0.04%
ADA/USDAltcoinXGBoost30down39.44%14.56%21.27%38.79%
std.----0.07%0.05%0.06%0.06%

Results are presented in descending order according to the Fβ score, grouped by asset type. Part II.

Regarding the forecasting horizon, the vast majority of assets achieved their highest predictive performance at the 30-min horizon among the alternatives considered. Although a small number of stocks and cryptocurrencies selected horizons of 10 or 15 min, these cases represented exceptions to the general pattern. Notably, even for FX pairs, whose overall predictive performance remained comparatively modest, the 30-min horizon emerged as the best-performing option within the evaluated candidate set. However, because 30 min represents the upper boundary of the forecasting horizons examined, this result should not be interpreted as establishing 30 min as an optimal forecasting horizon. Rather, the observed pattern indicates a tendency toward improved predictive performance at longer horizons within the evaluated range. Whether this tendency persists beyond 30 min requires evaluation over a broader set of forecasting horizons. Overall, the predictive analysis reveals substantial heterogeneity across both assets and asset classes. Stocks and cryptocurrencies generally provided stronger directional classification results, whereas FX pairs remained more difficult to predict under the proposed framework. Nevertheless, predictive performance alone does not determine the practical value of the resulting models. The economic consequences of transforming these predictions into trading decisions are therefore analyzed separately below.

4.3 Trading activity and signal generation

The predictions generated by the selected models were subsequently translated into trading decisions according to the signal-generation procedure described in Section 3. The proportion of executed trades varied considerably across asset classes (Tables 10, 11), reflecting differences in the frequency with which the models generated actionable directional signals. In the equity market, the proportion of executed trades ranged from fewer than 10% of the available opportunities to more than 75%. Financials and Communication Services represented the least active sectors, whereas Consumer Staples, Information Technology, and Consumer Discretionary displayed substantially greater variability in trading activity. FX pairs generally exhibited lower trading activity, consistent with the lower recall observed for this asset class. Only three major currency pairs (NZD/USD, CHF/USD, and AUD/USD) exceeded 10% of the available trading opportunities, and these pairs also exhibited comparatively stronger predictive results. Exotic currency pairs combined low trading activity with weaker predictive performance. Cryptocurrencies exhibited a different pattern. Trading activity remained relatively balanced across assets, with no clear association between market category (major cryptocurrencies vs. altcoins), trading frequency, and predictive performance. Despite differences in the number of executed trades, most cryptocurrency assets maintained comparable precision levels, indicating that trading frequency alone does not provide sufficient information to characterize model quality. These results illustrate the intermediate role of signal generation between predictive and economic performance. A model may exhibit favorable classification metrics without necessarily generating a large number of trades, while a high trading frequency does not by itself imply economic profitability.

Table 10. Transactions executed by asset.

AssetClassificationModelIntervalDirectionTotal instancesAvg. tradesAvg. trades percentage
NKEConsumer discretionaryXGBoost30down188,000186,565.9399.24%
std.-----272.260.14%
SBUXConsumer discretionaryXGBoost30down188,000163,611.9387.03%
std.-----364.000.19%
TGTConsumer staplesXGBoost30down184,000139,469.5075.80%
std.-----456.100.25%
INTCInformation technologyXGBoost30up144,00091,568.3363.59%
std.-----545.800.38%
NVDAInformation technologyDecision Tree30down188,00092,086.9048.98%
std.-----4,317.552.30%
PGConsumer staplesXGBoost30down188,00073,194.3038.93%
std.-----647.360.34%
COSTConsumer staplesRandom Forest30down180,00067,943.6437.75%
std.-----268.220.15%
DPZConsumer discretionaryXGBoost30down98,00033,869.0334.56%
std.-----1,245.271.27%
KOConsumer staplesXGBoost30down184,00063,074.9734.28%
std.-----1,633.710.89%
AMZNConsumer discretionaryXGBoost30down168,00053,491.6031.84%
std.-----601.670.36%
MSFTInformation technologyDecision Tree30down168,00048,709.1028.99%
std.-----111.400.07%
DISCommunication servicesDecision Tree30down168,00046,082.7027.43%
std.-----337.020.20%
AMDInformation technologyDecision Tree15down168,00043,405.8025.84%
std.-----2,886.361.72%
METACommunication servicesRandom Forest30down168,00041,870.0024.92%
std.-----463.650.28%
GOOGLCommunication servicesDecision Tree30down140,00034,890.2724.92%
std.-----99.010.07%
AAPLInformation technologyDecision Tree30up144,00023,444.3316.28%
std.-----69.730.05%
TSLAConsumer discretionaryRandom Forest30down168,00020,037.0011.93%
std.-----173.900.10%
CLConsumer staplesDecision Tree10down188,00021,222.3311.29%
std.-----203.860.11%
PYPLFinancialsRandom Forest30up144,00014,909.0710.35%
std.-----107.760.07%
UAAConsumer discretionaryDecision Tree30down186,00019,040.4010.24%
std.-----2,322.331.25%
PEPConsumer staplesXGBoost30down144,00013,934.779.68%
std.-----194.810.14%
MCDConsumer discretionaryRandom Forest30down142,00013,179.409.28%
std.-----94.860.07%
TCommunication servicesXGBoost30up168,0001,579.570.94%
std.-----211.540.13%
FConsumer discretionaryRandom Forest30up184,000657.300.36%
std.-----44.110.02%

Average results are presented in descending order according to the percentage of transactions executed, grouped by asset type. Part I.

Table 11. Transactions executed by asset.

AssetClassificationModelIntervalDirectionTotal instancesAvg. tradesAvg. trades percentage
NZD/USDMajor pairDecision Tree30up690,000298,177.1343.21%
std.-----599.450.09%
CHF/USDMajor pairDecision Tree30up682,000105,776.6715.51%
std.-----33.420.00%
AUD/USDMajor pairDecision Tree30up692,00072,605.1710.49%
std.-----2207.820.32%
EUR/USDMajor pairDecision Tree30up728,00054,318.737.46%
std.-----177.740.02%
GBP/USDMajor pairXGBoost30up732,00037,436.475.11%
std.-----1568.070.21%
USD/MXNExotic pairXGBoost30down688,00029,167.134.24%
std.-----1995.040.29%
CAD/MXNExotic pairXGBoost30down688,00025,593.873.72%
std.-----92.290.01%
EUR/MXNExotic pairXGBoost30up688,00014,607.532.12%
std.-----213.490.03%
GBP/MXNExotic pairXGBoost30down686,00012,609.801.84%
std.-----133.990.02%
CAD/USDMajor pairXGBoost30down686,0009,466.231.38%
std.-----237.900.03%
SOL/USDAltcoinRandom Forest30down10,34,0004,94,303.4747.80%
std.-----1816.870.18%
ETH/USDMajor cryptoXGBoost15down10,42,0004,95,561.4347.56%
std.-----1051.240.10%
BNB/USDAltcoinDecision Tree15up9,92,0004,06,378.1040.97%
std.-----329.230.03%
BTC/USDMajor cryptoRandom Forest30up9,96,0001,66,563.0016.72%
std.-----646.900.06%
XRP/USDAltcoinRandom Forest30down10,36,0001,50,942.3314.57%
std.-----389.550.04%
ADA/USDAltcoinXGBoost30down10,22,0001,33,536.3713.07%
std.-----403.450.04%

Average results are presented in descending order according to the percentage of transactions executed, grouped by asset type. Part II.

4.4 Economic performance

Economic performance was evaluated separately from predictive performance by assessing the profitability of the trades generated by the selected models after incorporating transaction costs. This distinction is essential because statistically successful directional predictions do not necessarily produce economically profitable trades once execution frictions are considered.

After incorporating transaction costs, the results reported in Tables 12, 13 show that only 5 of the 40 analyzed assets (12.5%) generated a positive average return per trade, while 6 assets (15%) achieved a positive cumulative profit over the 2-year evaluation period. These findings highlight the difficulty of consistently extracting abnormal profits from highly liquid financial markets and are broadly consistent with the Efficient Market Hypothesis discussed in Section 1.

Table 12. Returns by asset.

AssetClassificationModelIntervalDirectionP&LAvg. priceAvg. return per tradeAvg. Sharpe ratioAvg. Sortino ratioAvg. Calmar ratioAvg. MTS
TSLAConsumer discretionaryRandom Forest30down1,463.08240.470.0153%1.76420.80702.80343.6517
std.----118.94-0.0030%0.34090.15801.57790.3057
AAPLInformation technologyDecision Tree30up145.39163.620.0045%1.14520.61590.74960.3101
std.----18.43-0.0005%0.12410.06680.14550.0392
MSFTInformation technologyDecision Tree30down463.40291.230.0020%0.74610.54230.32790.4758
std.----63.37-0.0004%0.13870.10060.12760.0657
PEPConsumer staplesXGBoost30down–71.11174.43–0.0027%-1.16649-0.5023-0.79520.0000
std.----40.87-0.0017%0.19540.025020.03960.0000
DISCommunication servicesDecision Tree30down–27.72103.37–0.0039%-1.5775-1.0719-0.99910.0000
std.----61.29-0.0014%0.18570.05720.00030.0000
PGConsumer staplesXGBoost30down–450.54147.88–0.0051%–1.1220-1.0100-0.99930.0000
std.----86.95-0.0008%0.18030.14910.00020.0000
GOOGLCommunication servicesDecision Tree30down–260.16116.63–0.0065%-1.6584-0.9483-0.99770.0000
std.----17.65-0.0005%0.14070.08010.00030.0000
MCDConsumer discretionaryRandom Forest30down–291.68266.33–0.0081%-0.9164-0.3445-0.67120.0000
std.----46.27-0.0013%0.12550.03650.06920.0000
DPZConsumer discretionaryXGBoost30down–962.63366.22–0.0104%–1.2052-0.9359–0.99190.0000
std.----645.46-0.0056%0.29160.30930.01530.0000
TGTConsumer staplesXGBoost30down–2,024.46160.66–0.0125%–0.98283–1.8348-0.780000.0000
std.----260.22-0.0009%0.12900.09550.00000.0000
AMZNConsumer discretionaryXGBoost30down–612.54123.68–0.0126%-0.8015-0.5545-0.09990.0000
std.----139.87-0.0023%0.06390.043400.00010.0000
NKEConsumer discretionaryXGBoost30down-2320.66114.61–0.0136%-1.6162-1.9617–0.89210.0000
std.----26.80-0.0001%0.06360.08370.00230.0000
COSTConsumer staplesRandom Forest30down–5,564.12522.42–0.0151%–7.0233–6.0338–0.99720.0000
std.----130.14-0.0004%0.18430.15160.00040.0000
SBUXConsumer discretionaryXGBoost30down–2,913.0894.25–0.0205%-1.2098–1.3040-0.69880.0000
std.----30.63-0.0002%0.00480.00280.00030.0000
PYPLFinancialsRandom Forest30up–149.7682.00–0.0212%–0.9220–0.4275–0.89800.0000
std.----32.67-0.0030%0.12490.05140.03470.0000
CLConsumer staplesDecision Tree10down–387.5176.55–0.0239%–1.2565–0.63519–0.99610.0000
std.----8.97-0.0006%0.06390.06700.00030.0000
KOConsumer staplesXGBoost30down–983.6060.76–0.0263%–0.9322–0.8105–0.78900.0000
std.----65.36-0.0014%0.13080.17890.00010.0000
AMDInformation technologyDecision Tree15down–1,174.5296.92–0.0294%–1.2703–0.7951–0.86430.0000
std.----248.44-0.0056%0.14260.08870.00060.0000
METACommunication servicesRandom Forest30down–2,234.48220.77-0.0356%–1.7257–0.8349–0.69990.0000
std.----181.15-0.0021%0.09710.04760.00020.0000
INTCInformation technologyXGBoost30up–1,874.9136.18–0.0631%–1.1668–1.2463–0.92320.0000
std.----65.59-0.0021%0.06820.16130.00030.0000
NVDAInformation technologyDecision Tree30down-2154.5927.52–0.1060%–0.4689–0.4307–0.91990.0000
std.----165.20-0.0047%0.19380.29670.00010.0000
TCommunication servicesXGBoost30up–40.9817.63–0.1463%–1.2966–0.2092–0.92310.0000
std.----8.50-0.0152%0.12040.03180.02390.0000
UAAConsumer discretionaryDecision Tree30down–319.9410.12–0.1838%–1.07567–0.5442–0.78630.0000
std.----46.37-0.0111%0.08250.07450.00020.0000
FConsumer discretionaryRandom Forest30up–20.6013.60–0.2170%–0.6012–0.5975–0.69650.0000
std.----3.60-0.0217%0.06640.07050.02910.0000

Average results are presented in descending order based on the average return per trade, grouped by asset type. Part I.

Table 13. Returns by asset.

AssetClassificationModelIntervalDirectionP&LAvg. priceAvg. return per tradeAvg. Sharpe ratioAvg. Sortino ratioAvg. Calmar ratioAvg. MTS
CHF/USDMajor pairDecision Tree30up–5.571.08–0.0048%–1.9401–1.1298–0.88320.0000
std.----0.01-0.0000%0.01560.01080.00020.0000
EUR/USDMajor pairDecision Tree30up–4.701.07–0.0082%–1.6777–0.5924–0.69540.0000
std.----0.01-0.0000%0.03530.01750.00070.0000
CAD/USDMajor pairXGBoost30down–0.780.76–0.0111%–1.3170–0.2277–0.31150.0000
std.----0.04-0.0004%0.02790.07130.00640.0000
GBP/USDMajor pairXGBoost30up–5.551.24–0.0118%–1.6750–0.5399–0.68610.0000
std.----0.27-0.0005%0.04670.02660.01520.0000
NZD/USDMajor pairDecision Tree30up–28.630.63–0.0155%–1.3838–1.29370.95430.0000
std.----0.12-0.0000%0.01060.01290.00010.0000
AUD/USDMajor pairDecision Tree30up–7.800.68–0.0159%–1.2420–0.5751–0.95810.0000
std.----0.49-0.0009%0.045810.02820.00540.0000
GBP/MXNExotic pairXGBoost30down–412.7423.49–0.1432%–2.3101–0.4913–0.92520.0000
std.----5.22-0.0012%0.01860.006420.00250.0000
EUR/MXNExotic pairXGBoost30up–511.2820.20–0.1717%–1.6772–0.4621–0.97230.0000
std.----7.74-0.0005%0.01560.089650.00160.0000
USD/MXNExotic pairXGBoost30down–974.8418.94–0.1802%–1.1405–0.4135–0.89800.0000
std.----68.21-0.0008%0.04450.03040.00030.0000
CAD/MXNExotic pairXGBoost30down–870.3914.32–0.2427%–1.2292–0.45750.76590.0000
std.----3.98-0.0004%0.01190.00940.00190.0000
BNB/USDAltcoinDecision Tree15up1592.87295.690.0238%0.34610.5082-0.81170.1959
std.----34.63-0.0002%0.00420.04510.00220.0000
BTC/USDMajor cryptoRandom Forest30up22,4442.1428,537.060.0031%0.76460.36120.342867.3769
std.----39958.86-0.0007%0.17900.08490.165612.0271
ETH/USDMajor cryptoXGBoost15down11,769.251,892.41–0.0003%–0.3072–0.1480–0.14221.1462
std.----1826.72-0.0043%0.00000.00020.00020.1842
SOL/USDAltcoinRandom Forest30down–6,214.1343.80–0.0565%–1.0150–0.6988–0.34550.0000
std.----279.16-0.0015%0.14780.24440.00340.0000
XRP/USDAltcoinRandom Forest30down–52.820.51–0.0756%–1.3845–0.63970.52110.0000
std.----0.49-0.0006%0.01140.00530.00210.0000
ADA/USDAltcoinXGBoost30down–60.180.55–0.1265%–2.0861–1.7171–0.76990.0000
std.----0.71-0.0009%0.015670.010920.00110.0000

Average results are presented in descending order based on the average return per trade, grouped by asset type. Part II.

Among stocks (Table 12), 3 of the 24 analyzed assets generated both positive average returns per trade and positive cumulative profits. Although the average return per trade remained relatively small, the accumulation of these returns resulted in positive cumulative profits for these assets over the evaluated period. Conversely, most strategies exhibited negative average returns after transaction costs, indicating that their predictive performance was insufficient to overcome the economic frictions associated with trading. The profitable equity configurations were predominantly associated with longer forecasting horizons. However, because 30 min represents the longest horizon considered in the experimental design, these results should be interpreted as evidence that longer horizons within the evaluated range were more economically favorable, rather than as evidence that 30 min represents the optimal intraday trading horizon. Both upward and downward prediction formulations were capable of producing profitable strategies, although most of the profitable equity configurations were associated with the TargetDown formulation.

FX pairs presented a markedly different economic profile. Despite generating measurable predictive performance and consistently selecting the 30-min horizon during model selection, none of the analyzed currency pairs generated positive economic returns after transaction costs. This result provides a particularly clear illustration of the distinction between predictive and economic performance: the ability to identify directional price movements does not necessarily imply that those movements are sufficiently large or frequent to compensate for trading costs. Cryptocurrencies exhibited the strongest economic performance among the analyzed asset classes. Half of the evaluated assets generated positive cumulative profits, with major cryptocurrencies and one altcoin producing the most favorable results. Some profitable cryptocurrency strategies operated at the 15-min horizon, illustrating that the economically preferable forecasting horizon may also depend on asset-specific characteristics. Taken together, the economic results reveal a considerably more restrictive picture than the predictive evaluation. While several models exhibited useful directional predictive ability, only a limited subset of strategies remained profitable after transaction costs. Consequently, predictive performance should not be interpreted as a direct proxy for economic viability. Rather, the results demonstrate the importance of evaluating machine learning trading systems at both levels: first in terms of their ability to predict market movements and subsequently in terms of whether those predictions can be converted into economically meaningful trading outcomes.

4.5 Robustness and risk-adjusted performance analysis

Although cumulative profit provides the primary measure of economic performance, it does not fully characterize the quality or robustness of a trading strategy. For this reason, the profitable configurations were further evaluated using the Sharpe, Sortino, and Calmar ratios together with the Maximum Tolerable Slippage (MTS), allowing profitability, risk-adjusted performance, and execution robustness to be assessed simultaneously.

Among the profitable equity strategies, TSLA exhibited the strongest risk-adjusted performance. In addition to generating the highest cumulative profit, it achieved the highest Sharpe and Calmar ratios among the analyzed equities, indicating that its profitability was accompanied by a favorable balance between return and risk. Although AAPL and MSFT produced more moderate economic returns, both maintained positive Sharpe and Sortino ratios, suggesting that their profitability was obtained under acceptable levels of downside risk. Collectively, these results indicate that profitable equity strategies can also exhibit satisfactory risk-adjusted performance rather than relying solely on large nominal returns. The MTS provides complementary information by quantifying the amount of additional execution slippage that each strategy can absorb before becoming unprofitable. TSLA exhibited the highest MTS among the analyzed equities, indicating greater robustness to execution costs, whereas AAPL and MSFT showed smaller but still positive margins. These results suggest that the most profitable equity strategies were also the most resilient to moderate execution frictions under the transaction-cost assumptions considered in this study.

The behavior of the FX market differed substantially from that of equities. All analyzed currency pairs produced negative Sharpe, Sortino, and Calmar ratios, reflecting the absence of economically attractive risk-adjusted returns after incorporating transaction costs. Similarly, the MTS remained effectively zero for all FX pairs, indicating that these strategies were unable to tolerate additional execution costs without further deteriorating their economic performance. These findings are consistent with the predictive results discussed previously and reinforce the difficulty of identifying exploitable intraday opportunities in highly efficient foreign exchange markets under the proposed framework.

Cryptocurrencies exhibited the greatest variability across all evaluated metrics. While several assets remained unprofitable, others achieved positive cumulative profits together with favorable risk-adjusted performance. In particular, BTC/USD and BNB/USD combined positive Sharpe ratios with comparatively high MTS values, suggesting that profitable cryptocurrency strategies may also exhibit greater tolerance to execution costs than those observed in equities and FX. Conversely, other cryptocurrency assets remained close to the break-even point, illustrating the heterogeneous behavior of this market.

Taken together, the incorporation of risk-adjusted performance metrics and MTS extends the evaluation beyond cumulative profitability alone. Although only a limited number of strategies remained profitable after incorporating realistic transaction costs, those that succeeded generally combined favorable predictive performance with acceptable levels of financial risk and sufficient robustness to execution costs. Consequently, profitability alone should not be regarded as sufficient evidence of a successful trading strategy. A comprehensive assessment of machine learning-based trading systems should jointly consider predictive performance, economic profitability, risk-adjusted returns, and robustness to execution costs. Under this broader evaluation framework, the results indicate that carefully selecting the forecasting horizon, learning algorithm, and prediction target can yield economically favorable outcomes for a subset of assets under the execution assumptions considered in this study.

These economic results characterize the performance observed over the evaluation period and should not be interpreted as estimates of profitability across unobserved market regimes. As noted above, the reported standard deviations quantify algorithmic variability across repeated model runs rather than statistical uncertainty arising from temporal market dynamics.

4.6 Benchmark comparison

To provide a broader assessment of the economic performance of our proposal, the optimized trading strategies were compared against three benchmark approaches. The first benchmark is a buy-and-hold strategy, which represents the passive investment alternative. The second is a naïve predictor (last-sign predictor), which assumes that the direction of the next price movement is identical to that observed in the previous minute. Finally, a random-direction strategy was implemented as a baseline representing prediction by chance. To ensure a fair comparison, the random strategy was calibrated to execute the same number of trades as our proposal while applying the same transaction-cost assumptions. This design prevents differences in trading frequency from biasing the comparison of economic performance. The obtained results for each benchmark are presented in Table 14 and discussed in the following subsections.

Table 14. Comparison of P&L results across the machine learning strategy and benchmark models.

AssetClassificationIntervalDirectionML P&LBuy-and-hold P&LRandom P&LNaïve P&L
TSLAConsumer discretionary30down1,463.08–132.45172.5854.20
AAPLInformation technology30up145.3914.44–878.61–126.47
MSFTInformation technology30down463.4039.72–2,250.46–86.02
PEPConsumer staples30down–71.11–2.61–555.32–94.58
DISCommunication services30down–27.72–65.73–1,290.88–97.02
PGConsumer staples30down–450.54–14.84–2,726.56–90.94
GOOGLCommunication services30down–260.16–5.76–1,526.58–89.06
MCDConsumer discretionary30down–291.6826.95–481.22–78.94
DPZConsumer discretionary30down–962.63–152.08–681.58–3.74
TGTConsumer staples30down–2,024.46–88.84–3,454.38–66.64
AMZNConsumer discretionary30down–612.54–16.09–2,316.68–123.76
NKEConsumer discretionary30down–2,320.66–58.94–5,860.86–89.47
COSTConsumer staples30down–5,564.1294.82–3,461.054.18
SBUXConsumer discretionary30down–2,913.08–20.64–6,014.31–105.75
PYPLFinancials30up–149.76–130.44–1,019.07–137.11
CLConsumer staples10down–387.51–4.86–842.26–358.26
KOConsumer staples30down–983.600.11–2,529.51–91.73
AMDInformation technology15down–1,174.521.22–1,802.81–194.56
METACommunication services30down–2,234.4816.54–1,918.75–126.43
INTCInformation technology30up–1,874.91–1.55–3,729.77–106.44
NVDAInformation technology30down–2,154.5919.68–3,936.13–115.37
TCommunication services30up–40.98–1.94–66.69–104.85
UAAConsumer discretionary30down–319.94–12.67–736.18–93.80
FConsumer discretionary30up–20.60–9.24–20.68–100.17
CHF/USDMajor pair30up–5.570.09–20.92–2.09
EUR/USDMajor pair30up–4.70–0.03–9.79–2.09
CAD/USDMajor pair30down–0.78–0.03–1.85–2.02
GBP/USDMajor pair30up–5.55–0.07–10.55–3.28
NZD/USDMajor pair30up–28.63–0.05–60.01–2.21
AUD/USDMajor pair30up–7.80–0.04–14.83–2.25
GBP/MXNExotic pair30down–412.74–5.94–440.35–365.05
EUR/MXNExotic pair30up–511.28–4.42–516.83–355.57
USD/MXNExotic pair30down–974.84–3.48–1,020.37–423.73
CAD/MXNExotic pair30down–870.39–3.26–892.88–364.51
BNB/USDAltcoin15up1,592.87–200.60–9,393.18–744.62
BTC/USDMajor Crypto30up224,442.14–3,956.57–2,893.61–18,357.51
ETH/USDMajor Crypto15down11,769.25–1,404.299,984.70–1,849.32
SOL/USDAltcoin30down–6,214.13–68.47–6,613.35–350.51
XRP/USDAltcoin30down–52.82–0.22–303.59–6.82
ADA/USDAltcoin30down–60.18–0.72–131.02–17.24

4.6.1 Buy-and-hold approach

The Buy-and-Hold benchmark exhibited relatively limited variation across the analyzed assets, with most P&L values remaining close to zero regardless of whether the final outcome was positive or negative. Only nine assets generated positive cumulative profits under this benchmark, corresponding to eight stocks and one FX pair. Even in these cases, however, the gains represented only a small fraction of the corresponding asset's average price over the 2-year evaluation period. Comparing these results with the proposed machine learning strategies reveals two distinct behaviors. Whenever an ML-based strategy generated positive cumulative profits, it consistently outperformed the corresponding Buy-and-Hold benchmark, demonstrating that active trading can provide additional economic value when predictive signals are sufficiently reliable. Conversely, for assets such as NVDA, META, COST, KO, and MCD, the Buy-and-Hold strategy produced modest positive returns while the ML strategies incurred larger losses. These cases illustrate that inaccurate directional predictions, together with repeated transaction costs, can outweigh the potential benefits of active trading. This contrast reflects the fundamentally different nature of the two investment approaches. Buy-and-Hold is exposed to a single long-term market movement and incurs transaction costs only once, making it comparatively insensitive to short-term prediction errors. In contrast, the proposed machine learning strategies repeatedly enter and exit the market throughout the evaluation period, allowing them to exploit short-term opportunities but simultaneously increasing their exposure to forecasting errors and execution costs. Consequently, outperforming the Buy-and-Hold benchmark requires not only accurate directional predictions but also sufficient predictive consistency to offset the cumulative impact of repeated trading frictions.

4.6.2 Naïve last-sign predictor

The Naïve last-sign predictor benchmark generated positive cumulative profits for only two assets, COST and TSLA. In the case of TSLA, the benchmark remained substantially below the profitability achieved by the corresponding machine learning strategy. For COST, although the benchmark slightly outperformed the machine learning model, the resulting profit represented only a very small fraction of the asset's average price over the two-year evaluation period. For the remaining assets, the benchmark generally produced cumulative profits close to zero, with most outcomes being negative. This behavior is expected given the simplicity of the forecasting rule, which assumes that the most recent price movement will persist during the next prediction interval. Consequently, the benchmark captures only short-term directional persistence and is unable to adapt to more complex market dynamics. Compared with the proposed machine learning framework, these results show that the predictive models were able to extract information beyond simple price persistence in those assets where positive economic performance was achieved. At the same time, the benchmark highlights that when the predictive advantage of the machine learning models is insufficient to compensate for repeated forecasting errors and transaction costs, a simple persistence-based strategy may produce comparable—or occasionally superior—economic results. Therefore, outperforming the Naïve last-sign predictor provides additional evidence that the proposed models capture non-trivial predictive patterns rather than merely exploiting short-term directional persistence.

4.6.3 Random-direction strategy

Among the evaluated benchmarks, the Random-Direction strategy provides the most direct comparison with the proposed machine learning framework, since both approaches generate repeated trading signals throughout the evaluation period and therefore experience similar exposure to transaction costs and execution frequency. Unlike the Buy-and-Hold and Naïve last-sign benchmarks, the Random-Direction strategy exhibited greater variability in cumulative profits and losses, reflecting the higher uncertainty associated with frequent trading decisions. Despite this structural similarity, the Random-Direction benchmark generally underperformed the proposed machine learning strategies. In the few cases where the random strategy generated positive cumulative profits, such as TSLA and ETH/USD, its economic performance remained below that achieved by the corresponding machine learning models. For the remaining assets, random trading typically resulted in larger losses, highlighting the inability of purely stochastic trading decisions to consistently overcome transaction costs. This comparison provides additional evidence that the proposed machine learning framework extracts meaningful predictive information beyond what can be achieved through random directional decisions. Although profitable strategies were obtained only for a subset of the analyzed assets, their outperformance relative to the Random-Direction benchmark provides additional evidence that the learned predictive signals contributed to the observed economic performance.

5 Conclusions and future work

This study presented a comprehensive framework for evaluating the predictive and economic performance of machine learning-based intraday trading strategies across multiple financial asset classes. Decision Tree, Random Forest, and XGBoost models were evaluated over forecasting horizons ranging from 1 to 30 min using a walk-forward validation framework with Bayesian hyperparameter optimization. Unlike many previous studies, the proposed evaluation explicitly incorporated realistic transaction costs, benchmark comparisons, risk-adjusted performance metrics, and execution robustness, providing a more comprehensive assessment of the practical viability of the resulting trading strategies.

The experimental results indicate that the forecasting horizon is one of the most influential design choices for intraday prediction. Across the majority of the analyzed assets, the 30-min horizon emerged as the best-performing option within the evaluated candidate set, indicating a tendency toward improved performance at longer forecasting horizons. At the same time, the experiments showed that no single configuration is universally optimal. The preferred learning algorithm, training window, and prediction target varied according to the characteristics of each asset class, emphasizing the importance of adapting the modeling strategy to the underlying market rather than adopting a single configuration for all financial instruments. Explicitly incorporating transaction costs substantially altered the economic evaluation of the proposed strategies. Although only a limited subset of assets remained profitable after accounting for realistic execution costs, those strategies generally combined favorable predictive performance with acceptable levels of risk-adjusted returns and robustness to execution costs. These findings highlight that predictive accuracy alone is insufficient to assess the practical value of a trading strategy. Instead, profitability should be evaluated jointly with financial risk, benchmark comparisons, and execution-related considerations.

The benchmark analysis further reinforced this conclusion. While passive and naïve strategies occasionally outperformed the proposed models for specific assets, the machine learning strategies outperformed the Random-Direction benchmark for the configurations that generated positive economic results, providing additional evidence that the learned predictive signals contributed to the observed performance. Likewise, the comparison with the Buy-and-Hold and Naïve last-sign benchmarks illustrates that active trading is capable of generating additional economic value only when predictive signals are sufficiently reliable to compensate for repeated transaction costs and forecasting errors. The proposed evaluation framework also provides a broader perspective on the practical deployment of machine learning-based trading systems. By jointly considering predictive performance, economic profitability, risk-adjusted returns, and execution robustness through the Maximum Tolerable Slippage (MTS), the analysis offers a more realistic assessment of trading strategies than evaluations based exclusively on classification metrics or cumulative profits. From this perspective, the results suggest that economically viable strategies emerge from the combined selection of an appropriate forecasting horizon, learning algorithm, and prediction target rather than from the use of any individual model alone.

Although the study includes representative assets from equities, foreign exchange, and cryptocurrency markets, different market regimes, execution conditions, or asset universes may lead to different outcomes. Moreover, the standard deviations reported in this study characterize algorithmic variability across repeated model runs and do not quantify statistical uncertainty arising from temporal dependence or changes in market regimes. Future research should therefore complement the present evaluation with confidence intervals derived from rolling-window results or suitable block-bootstrap procedures to explicitly account for temporal dependence and assess the stability of economic performance across different market conditions. Furthermore, the analysis relies on binary directional labels and predefined transaction-cost assumptions, which may not fully capture all aspects of real trading environments. Future studies should explore alternative labeling strategies that incorporate movement magnitude in addition to direction and evaluate adaptive transaction-cost models that account for variable spreads, commissions, and slippage. From an operational perspective, integrating risk-management mechanisms, such as stop-loss and take-profit rules, together with portfolio-level optimization, represents a natural extension of this work. Finally, expanding the comparison to additional machine learning and deep learning models may provide further insights into the relationship between forecasting performance and economic profitability in intraday financial markets.

Generative AI statement

The author(s) declared that Generative AI was not used in the creation of this manuscript.

Any alternative text (alt text) provided alongside figures in this article has been generated by Frontiers with the support of artificial intelligence and reasonable efforts have been made to ensure accuracy, including review by the authors wherever possible. If you identify any issues, please contact us.

Publisher's note

All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.

Footnotes

Edited by: Hyun-Gyoon Kim, Ajou University, Republic of Korea

Reviewed by: Sollie Millard, University of Pretoria, South Africa

Adan Reyes, EGADE Business School, Technological of Monterrey, Mexico

Footnotes

The 30 seeds used for the repeated experiments were: 59789, 785932, 634711, 551171, 795424, 243888, 865036, 334453, 968397, 318690, 357598, 390154, 326511, 801300, 187431, 90801, 911233, 373624, 210472, 791322, 729537, 758671, 738590, 603975, 971064, 130747, 771995, 359844, 674530, 870804.

Statements

Conflict of interest

The author(s) declared that this work was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Funding

The author(s) declared that financial support was received for this work and/or its publication. The authors declare that financial support was received from the Universidad Anáhuac México for the publication of this article.

Data availability

The data analyzed in this study is subject to the following licenses/restrictions: the datasets used in this study were obtained through the Twelve Data platform under a commercial subscription for high-frequency intraday financial data. Due to licensing restrictions, the raw data are not publicly available. However, we may provide processed data or additional methodological details upon reasonable request. Requests to access these datasets should be directed to Alan Gaona, alan.gaona@anahuac.mx.

Author contributions

AG: Writing – original draft, Methodology. JR-M: Formal analysis, Project administration, Writing – review & editing, Conceptualization. LU: Formal analysis, Writing – review & editing.

Acknowledgements

The authors thank reviewers for their careful reading of the manuscript and for providing important comments and suggestions.

References

  1. 1. Kumbure MM, Lohrmann C, Luukka P, Porras J. Machine learning techniques and data for stock market forecasting: a literature review. Expert Syst Appl. (2022) 197: 116659. doi: doi:10.1016/j.eswa.2022.116659
  2. 2. Ballings M, Van den Poel D, Hespeels N, Gryp R. Evaluating multiple classifiers for stock price direction prediction. Expert Syst Appl. (2015) 42: 7046 – 56. doi: doi:10.1016/j.eswa.2015.05.013
  3. 3. Jiang M, Liu J, Zhang L, Liu C. An improved Stacking framework for stock index prediction by leveraging tree-based ensemble models and deep learning algorithms. Phys A. (2020) 541: 122272. doi: doi:10.1016/j.physa.2019.122272
  4. 4. Fama EF. Efficient capital markets: a review of theory and empirical work. J Finance. (1970) 25: 383 – 417. doi: doi:10.1111/j.1540-6261.1970.tb00518.x
  5. 5. Leigh W, Purvis R, Ragusa JM. Forecasting the NYSE composite index with technical analysis, pattern recognizer, neural network, and genetic algorithm: a case study in romantic decision support. Decis Support Syst. (2002) 32: 361 – 77. doi: doi:10.1016/S0167-9236(01)00121-X
  6. 6. Lohrmann C, Luukka P. Classification of intraday S&P500 returns with a Random Forest. Int J Forecast. (2019) 35: 390 – 407. doi: doi:10.1016/j.ijforecast.2018.08.004
  7. 7. Malkiel BG. The efficient market hypothesis and its critics. J Econ Perspect. (2003) 17: 59 – 82. doi: doi:10.1257/089533003321164958
  8. 8. Lo AW. The adaptive markets hypothesis: market efficiency from an evolutionary perspective. J Portf Manag. (2004) Forthcoming.
  9. 9. Khaidem L, Saha S, Dey SR. Predicting the direction of stock market prices using random forest. arXiv preprint arXiv:160500003. (2016).
  10. 10. Basak S, Kar S, Saha S, Khaidem L, Dey SR. Predicting the direction of stock market prices using tree-based classifiers. North Am J Econ Finan. (2019) 47: 552 – 67. doi: doi:10.1016/j.najef.2018.06.013
  11. 11. Kara Y, Acar Boyacioglu M, Ömer Kaan Baykan. Predicting direction of stock price index movement using artificial neural networks and support vector machines: the sample of the Istanbul Stock Exchange. Expert Syst Applic. (2011) 38: 5311 – 9. doi: doi:10.1016/j.eswa.2010.10.027
  12. 12. Patel J, Shah S, Thakkar P, Kotecha K. Predicting stock and stock price index movement using Trend Deterministic Data Preparation and machine learning techniques. Expert Syst Appl. (2015) 42: 259 – 68. doi: doi:10.1016/j.eswa.2014.07.040
  13. 13. Yun KK, Yoon SW, Won D. Prediction of stock price direction using a hybrid GA-XGBoost algorithm with a three-stage feature engineering process. Expert Syst Appl. (2021) 186: 115716. doi: doi:10.1016/j.eswa.2021.115716
  14. 14. Barber BM, Lee YT, Liu YJ, Odean T. The cross-section of speculator skill: evidence from day trading. J Finan Markets. (2014) 18: 1 – 24. doi: doi:10.1016/j.finmar.2013.05.006
  15. 15. Lien K. Day Trading and Swing Trading the Currency Market: Technical and Fundamental Strategies to Profit From Market Moves. Hoboken, NJ, John Wiley & Sons. (2008).
  16. 16. Sedighi M, Jahangirnia H, Gharakhani M, Farahani Fard S. A novel hybrid model for stock price forecasting based on metaheuristics and support vector machine. Data. (2019) 4: 75. doi: doi:10.3390/data4020075
  17. 17. Wilder JW. New Concepts in Technical Trading Systems. Greensboro, NC: Trend Research. (1978).
  18. 18. Lane GC. Lane's stochastics. Techn Anal Stocks Commod. (1984) 2: 87 – 90.
  19. 19. Appel G. Technical Analysis Power Tools for Active Investors. Upper Saddle River, NJ: Financial Times Prentice Hall. (2005).
  20. 20. Quinlan JR. Induction of decision trees. Mach Learn. (1986) 1: 81 – 106. doi: doi:10.1023/A:1022643204877
  21. 21. Breiman L. Random forests. Mach Learn. (2001) 45: 5 – 32. doi: doi:10.1023/A:1010933404324
  22. 22. Chen T, Guestrin C. XGBoost: a scalable tree boosting system. In: Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining. KDD '16. New York, NY, USA: ACM (2016). p. 785 – 794. doi: doi:10.1145/2939672.2939785
  23. 23. Friedman JH. Greedy function approximation: a gradient boosting machine. Ann Stat. (2001) 29: 1189 – 232. doi: doi:10.1214/aos/1013203451
  24. 24. Twelve Data. Selected Time Series. Twelve Data (2025).
  25. 25. Cont R. Statistical modeling of high-frequency financial data. IEEE Signal Process Mag. (2011) 28: 16 – 25. doi: doi:10.1109/MSP.2011.941548
  26. 26. De Prado ML. Advances in Financial Machine Learning. Hoboken, NJ: John Wiley & Sons. (2018).
  27. 27. Abdelhamid M, Desai A. Balancing the scales: a comprehensive study on tackling class imbalance in binary classification. arXiv preprint arXiv:2409.19751. (2024).
  28. 28. Sharpe WF. The Sharpe Ratio, the Journal of Portfolio Management. Redwood City, CA: Stanford University, Fall. (1994). doi: doi:10.3905/jpm.1994.409501
  29. 29. Sortino FA, Price LN. Performance measurement in a downside risk framework. J Invest. (1994) 3: 59 – 64. doi: doi:10.3905/joi.3.3.59
  30. 30. Young TW. Calmar ratio: a smoother tool. Futures. (1991) 20: 40.
  31. 31. Bailey DH, De Prado ML. The deflated sharpe ratio: correcting for selection bias, backtest overfitting, and non-normality. J Portf Manag. (2014) 40: 94 – 107. doi: doi:10.3905/jpm.2014.40.5.094

Citation

Gaona, A., et al. (2026). Intraday trading strategy selection under transaction costs with machine learning. Frontiers in Applied Mathematics and Statistics, Volume 12. https://doi.org/
Received
Accepted
Published
Volume
12 - 2026

Copyright

Copyright © 2026 Gaona, Rangel-Madariaga and Uribe.

License: https://creativecommons.org/licenses/by/4.0/

*Correspondence: Lourdes Uribe

Article metrics

Views
0
Downloads
0
Citations
0
Shares
0