Next Article in Journal
RD-DETR: A Robust Vehicle Detector via Reaction–Diffusion Mechanisms
Next Article in Special Issue
An Adaptive Audiovisual Fusion Method Based on Prediction Confidence for Fine Granularity Bird Species Recognition
Previous Article in Journal
Experimental Investigation on the Applicability of Four Identification Methods for Stress Thresholds of Four Types of Hard Rock Under Uniaxial Compression Test
Previous Article in Special Issue
Wavelet-Enhanced Transformer for Adaptive Multi-Period Time Series Forecasting
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Predicting Borsa Istanbul Bank Indices Using Deep Neural Networks and Text Mining

1
Department of Econometrics, Faculty of Political Sciences, Aydin Adnan Menderes University, 09-010 Efeler, Aydin, Türkiye
2
Department of Statistics and Econometry, Faculty of Management and Economics, Gdansk University of Technology, 80-233 Gdańsk, Poland
*
Author to whom correspondence should be addressed.
Appl. Sci. 2026, 16(9), 4377; https://doi.org/10.3390/app16094377
Submission received: 30 March 2026 / Revised: 25 April 2026 / Accepted: 27 April 2026 / Published: 30 April 2026
(This article belongs to the Special Issue AI-Based Supervised Prediction Models)

Abstract

This study investigates the forecasting of the XBANK banking index traded on Borsa Istanbul by integrating financial and textual data within a deep learning framework. Unlike the majority of existing studies that focus on stable market environments, this paper explicitly examines a period of heightened political uncertainty, namely the cancellation and re-run of the 2019 Istanbul local elections. This setting provides a unique opportunity to analyze how political events and news-driven information flows influence financial market dynamics. The empirical analysis is based on a comprehensive dataset that includes daily price indicators (opening, closing, high, and low values), technical indicators, selected macroeconomic variables, and Turkish-language news headlines. Textual data are processed using topic modeling techniques to extract latent information embedded in financial news, allowing for the incorporation of qualitative signals into the forecasting framework. From a methodological perspective, this study employs a feedforward deep neural network model designed to capture nonlinear relationships across heterogeneous and contemporaneous features. Feature selection is conducted using the Boruta algorithm, while hyperparameters are optimized via grid search. The model structure reflects a deliberate design choice aimed at capturing short-term, news-driven shocks and cross-feature interactions, which are particularly relevant during periods of political uncertainty. The results indicate that incorporating textual information significantly improves forecasting performance and that news topics related to political decisions, central bank policies, and geopolitical developments have a measurable impact on the XBANK index. Furthermore, the findings suggest that the political uncertainty surrounding the 2019 local elections led to increased market sensitivity and volatility, highlighting the role of information shocks in emerging financial markets. Overall, this study contributes to the literature by combining financial and textual data in an emerging market context, utilizing Turkish-language news sources, and providing empirical evidence on the impact of political uncertainty on the BIST bank index.

1. Introduction

Forecasting stock prices and market trends has long been a central topic in the fields of financial economics and financial engineering. While traditional approaches largely rely on linear time series models, the increasing complexity and nonlinear nature of financial data have led to the widespread adoption of machine learning and, more recently, deep learning techniques. Early machine learning-based studies aimed to improve predictive performance by utilizing technical indicators and price-based variables. For instance, Türkmen and Cemgil [1] demonstrated the effectiveness of deep learning methods in predicting indicator signals in financial markets, while Gündüz et al. [2] showed that deep neural networks yield promising results in stock market direction prediction. These studies highlight the ability of deep learning approaches to capture nonlinear relationships inherent in financial data. A significant advancement in the literature has been the integration of textual data into financial prediction models. Early studies such as Fung et al. [3] incorporated real-time news into stock prediction frameworks, while Mahajan et al. [4] examined the impact of major financial news events on market behavior. Subsequent research combined these approaches with deep learning techniques. For example, Akita et al. [5] integrated numerical and textual data to improve prediction performance, whereas Oncharoen and Vateekul [6] employed event embeddings alongside technical indicators to enhance forecasting accuracy. This line of research demonstrates that financial markets are influenced not only by numerical indicators but also by information flows embedded in textual data. In this context, Tetlock [7] provided evidence that media content significantly affects market behavior, while Bollen et al. [8] showed that social media sentiment can be used to predict stock market movements. Furthermore, Ding et al. [9] proposed an event-driven framework, confirming that incorporating news information improves predictive performance. Another key methodological issue in the literature concerns the choice of model architecture. Financial time series are inherently sequential, exhibiting temporal dependence, volatility clustering, and regime shifts. Therefore, models capable of capturing temporal dynamics are generally considered more appropriate. In this regard, the Long Short-Term Memory (LSTM) model introduced by Hochreiter and Schmidhuber [10] has become a widely used architecture due to its ability to learn long-term dependencies. Empirical studies such as Fischer and Krauss [11] and Nelson et al. [12] show that LSTM models often outperform traditional feedforward neural networks in financial forecasting tasks. On the other hand, recent studies emphasize that financial time series exhibit not only temporal dependencies but also cross-sectional relationships across assets. For instance, Pellicani et al. [13] propose a clustering-based framework that groups correlated time series and employs LSTM models to improve predictive performance. Although this approach is primarily developed in the context of anomaly detection, it highlights the dual complexity of financial data, encompassing both temporal and cross-sectional dimensions. Moreover, comprehensive surveys such as Sezer et al. [14] indicate that the relative performance of different deep learning architectures depends critically on the structure of the dataset and the nature of the prediction problem. Motivated by these considerations, this study aims to forecast the XBANK banking index traded on Borsa Istanbul. While the majority of existing studies focus on developed markets, research on emerging markets—particularly during periods of political uncertainty—remains limited. In this regard, the cancellation and re-run of the 2019 Istanbul local elections provide a unique context characterized by heightened uncertainty, when in Istanbul, the candidate for the opposition Nation Alliance, Ekrem İmamoğlu (CHP), faced off against the ruling AK Party (AKP) candidate, former Prime Minister Binali Yıldırım. After a tense night of counting (and a brief blackout of results by the state news agency), İmamoğlu emerged victorious by a razor-thin margin of about 13,000 votes (out of over 8 million cast). The AKP refused to accept the result, claiming “organized crime” and widespread irregularities. After weeks of recounts in various districts, the Supreme Electoral Council (YSK) eventually annulled the results on 6 May 2019. The YSK ruled that the election was invalid because some balloting committee chairs and members were not public officials, as required by law [15]. Opposition and international observers pointed out a glaring inconsistency. The YSK only canceled the mayoral portion of the ballot. The re-run was scheduled for 23 June 2019. The re-run did not go as the ruling party expected. Instead of a narrow margin, İmamoğlu won by 800,000 votes, securing 54.2% of the total [16].
Accordingly, this study contributes to the literature by explicitly examining the interaction between political uncertainty for a very specific time frame and financial market dynamics in an emerging market setting. From a methodological perspective, a feedforward deep neural network is employed as the primary forecasting model. Although sequence-aware models such as LSTM are widely recognized as suitable for financial time series [10,12], the specific structure of the dataset and the design of this study suggest that feedforward architectures offer certain advantages. In particular, the dataset used in this study includes not only temporal dependencies but also heterogeneous and contemporaneous features derived from multiple sources, such as technical indicators, macroeconomic variables, and textual topics. In high-dimensional feature spaces characterized by heterogeneous inputs, feedforward neural networks are known to possess strong generalization capabilities and can effectively model complex nonlinear relationships across different data types [17,18]. Furthermore, the primary objective of this study is not solely to capture long-term temporal dependencies, but also to model short-term, news-driven shocks arising during periods of political uncertainty. The short-run impact of financial news has been widely documented in the literature within event-based frameworks [7,9]. When combined with appropriate feature engineering and textual representations, such effects can be effectively captured without requiring explicitly sequential architectures. Therefore, the model choice in this study reflects a deliberate design decision aimed at capturing the simultaneous effects of multiple data sources rather than ignoring temporal dependencies altogether. This approach is particularly relevant in periods of political uncertainty, where abrupt and information-driven shocks dominate market dynamics. In summary, this study contributes to the literature in three main ways. First, it integrates financial and textual data to forecast the XBANK index. Second, it utilizes Turkish-language textual data, addressing the challenges associated with morphologically rich languages. Third, it provides an empirical analysis of the impact of political uncertainty on Turkiye’s bank index XBANK, thereby filling an important gap in the existing literature.

2. Methodology

2.1. Financial Markets/Technical Indicators

A stock market is a structured market where instruments related to capital markets are bought and sold with a certain return expectation [19]. The legal framework for the capital market in Turkiye was put into execution with the Capital Markets Law in 1981 and the founding of the Capital Markets Board [19], and the principles of the markets have been determined for the first time and a transparent, competitive and reliable environment has been created for the investors.
The most important instruments of a capital market are stocks. A stock is a paper of value that companies grant to their partners in order to certify their shares. These papers entitle the shareholder the right to vote on the board of directors and provide more opportunities in terms of return when compared to treasury notes [20]. Currently, the most commonly used method for predicting the prices of stocks are fundamental and technical analyses.

2.1.1. Basic Analysis

The basic analyses are the studies and evaluations conducted on all financial statements, taking into account the risk structure of a country due to its economic, social, and political status, its macroeconomic data, and the state of sectors within this macroeconomic structure [21]. Looking at the basic financial indicators of a company, detailed information can be obtained [22]. Basic analysis has three main stages, economic, sector, and company analyses, and is usually performed from more general to more particular [23].

2.1.2. Technical Analysis

A technical analysis tracks the past movements of a stock through graphs and makes predictions about its future [24]. This analysis only benefits from the price movements in order to determine the character of a stock [25]. Technical analysis can be summarized under three assumptions:
  • History repeats itself; that is, past movements produce similar ones in the future.
  • The price reflects all information on the market.
  • Price movements follow trends for a specific and significant period of time [26].
There are two main indicators for technical analysis: indicators and oscillators. Indicators are the mathematical expressions in determining the continuity of trends [27]. Oscillators are the indicators that fluctuate between the levels set at or above a centerline as the price changes over time [28].
IndicatorsFormula
Williams %R Indicator % R = H n C t H n L n × 100
Moving Average M A = C t + C ( t 1 ) + C ( t 2 ) + + C ( t n ) n
Relative Strength Index R S I = 100 100 1 + R S
Stochastic Oscillator % K = C t ( L L ) ( t n ) ( H H ) ( t n ) ( L L ) ( t n ) × 100
% D = i = 0 n 1 % K ( t i ) n
Moving Average Convergence–Divergence M A C D = ( ( E M A ) 26 ( E M A ) 12 )
Momentum Indicator M O M = C t C ( t n )
Description
H n Highest price in n days
C t Closing price
C ( t n ) Closing price n days ago
L n Lowest price in n days
( L L ) ( t n ) Lowest price within the specified period
( H H ) ( t n ) Highest price within the specified period
( E M A ) 26 26-day exponential moving average
( E M A ) 12 12-day exponential moving average

2.2. Data Collection

Three different datasets were created for this study. These datasets were called “financial”, “textual” and “combined”. “Financial” data contains macroeconomic indicators and technical indicators, “textual” data contains news headlines, and “combined” data contains both news headlines and macroeconomic indicators along with technical indicators.
Data collection and modeling were performed using the R programming language. The language is based on the “S” programming language developed by John Chambers et al. for statistical analysis. Most of the codes written for language “S” can also run directly on the “R” language. A wide range of statistical calculations and graphs can be performed using the “R” language, while the “S” language is more preferred for statistical calculations. The R language is open source, it is easy to start coding in R version 4.3.2. There is a variety of R packages that are open source, especially for statistics, finance, and economy domains [29]. In this study, Boruta [30], Keras [31], and dplyr [32] packages were used.

2.3. Data Preparation

The financial data for the study was scraped from the website www.investing.com. The weekly closing, opening, highest and lowest prices of the XBANK index, the euro, dollar, Brent oil, and gold prices for the dates between 4 November 2015 and 4 November 2019 were included in this study. The technical indicators and oscillators for XBANK were calculated and included in the dataset. Selected technical indicators were RSI, MACD, Momentum, William, Moving Average, Stochastic K, and Stochastic D. Since financial indicators affect each other with a certain lag, the values of all these variables up to 10 lags were also included in the dataset. In addition, the closing, opening, highest and lowest prices of the index, which are not traded on public holidays, and the prices on the last traded day were also used. In order to express this situation in the dataset, a dummy variable was created and the value “0” was given to public holidays while “1” was given to trading days. The textual data was created by using the websites www.investing.com and www.dunya.com using a web scraping technique. Web scraping refers to taking the content of the relevant website and structuring this content as desired by parsing it. There is more than one web scraping technique. Examples are traditional copy–paste, HTTP programming, HTML parsing, or Document Object parsing [33]. The websites ‘www.investing.com’ and ‘www.dunya.com’ were chosen to collect textual data, as they contain the most suitable data for this study. The headlines on the websites between 4 November 2015 and 4 November 2019 were collected by using a web scraping method in R.
Tokenization refers to dividing a text into the smallest meaningful expressions. Headlines obtained by web scraping were tokenized. First, words that are called stop words and do not make any sense on their own (and, or, or, with, was, etc.) were removed. Following tokenization, lemmatization was applied. The morphological lemmatization technique was applied using the Zemberek framework [34]. Using this corpus, Latent Dirichlet Allocation (LDA) was applied for topic modeling. The method is defined as a three-stage Bayesian model and reveals the possible topics for a corpus [35]. This model makes it possible to obtain information about the corpus in general and to analyze it. LDA was used to observe whether the headlines had prominent topics, and the results are shown in Figure 1. The number of topics was decided to be 2 by using the Hierarchical Dirichlet Process (HDP), which helps automatically determine the optimal number of topics, as it serves as a robust automated alternative to manual tuning [36].
Thus, a dataset with a total of 166 variables was obtained. The abbreviations of the variables used are as follows. dummy, kapanis (daily closing value of bank index), acilis (daily opening value of bank index), yuksek (the highest value seen by the bank index during the day), dusuk (the lowest value seen by the bank index during the day), rsi (Relative Strength Index), macd (Moving Average Convergence–Divergence), k (Stochastic Oscillator K), d (Stochastic Oscillator K), momentum (Momentum), william (William), basithareketli (Moving Average for 10 Lags), dolar (Dollar), euro (Euro), brent (brent oil price), altin (gold price), erdogantitle (news about Turkiye’s president Erdogan), operasyontitle (news about operations against terrorists), sehittitle (news about martyr in it), yaralititle (news about injured citizens or soldiers during operations), teroristtitle (news about terrorist attacks), milyartitle (news with the word billion), tltitle (news with the word Turkish lira), dolartitle (news with the word dollar), faiztitle (news with the words interest rate), tcmbtitle (news with the words Central Bank of Republic of Turkiye (CBRT)). The number at the end of the variables indicates the lags. For example, kapanis1—1 day lag of closing value of bank index; acilis3—3 days lag of opening value of bank index.
In Figure 1, the graph titled ‘dunyagazetesi’ belongs to the headlines taken from the website ‘www.dunya.com’, and the graph titled ‘www.investing.com’ belongs to the headlines taken from the website ‘www.investing.com’. The beta coefficients in the graph show the distribution of the words according to the topics, and this is called the hyperparameter of the LDA model [37]. When both graphs are examined, it is seen that the first graph refers to words about politics while the second graph refers to the economy. Therefore, it has been concluded that the textual dataset to be used in predicting the closing price of the bank index has economic and political content. The five words with the highest beta value from each list were selected for the analysis. These words were ‘Erdoğan (Erdogan), şehit (martyr), terörist (terrorist), yaralı(injured), operasyon (operation)’, ‘milyar (billion), TL, faiz (interest), dolar (dollar), and TCMB (CBRT)’. Before moving into feature engineering, all numerical variables were normalized and outliers were removed using the IQR method.

2.4. Feature Selection

Feature engineering is a critical step in machine learning. In this step, most important features are decided and included in model training. The Boruta algorithm was used for each of the datasets created in this study as a feature selection method. The Boruta algorithm is an algorithm built around the Random Forest Algorithm. The Random Forest Algorithm is relatively fast and determines the significance of parameters in numerical values. The Boruta algoritm performs better than other feature selection algorithms. The algorithm assesses relationships between multiple variables. It uses an all-relevant variable selection approach, taking into account all characteristics that are important to the target variable. Other feature selection methods use a minimal optimum approach, which relies on a small group of characteristics to produce a classifier with the lowest possible error. It takes into account interactions between variables.
The algorithm consists of the following steps.
  • Shadow values are created.
  • Random Forest Algorithm is trained using all of the features and Z-scores are calculated.
  • Maximum Z-score is calculated.
  • Variables are checked for whether their presence in the model is significant or not.
  • Finally, the algorithm decides on the variables that should be kept in the model.
Consequently, the Boruta method introduces randomness into the model and generates findings from a set of random samples, reducing the false influence of correlation [30].
The Boruta algorithm was used for each of the datasets created in this study. In the graph obtained at the end of the Boruta algorithm, the blue box plots correspond to the minimum, average, and maximum Z-scores of a shadow value while red and green box plots represent Z-scores of rejected and approved variables, respectively [30].
As seen in Figure 2, when the Boruta algorithm is applied only to the financial dataset, the rejected parameters become as follows: dummy, yuksek, k, k4, k5, k7, k8, k9, k10, d2, d3, d5, d6, d8, momentum, momentum2, momentum10, william1, william5, william7, william8, william9, brent6, and brent9. English names of variables are given in the Section 2.3. Parameters other than these variables are marked as significant in predicting the closing price.
As can be seen in Figure 3, when the Boruta algorithm is applied only to the textual dataset, all the parameters are marked as significant in predicting the closing price. English names of variables are given in the Section 2.3. All parameters will be included in the dataset consisting of textual data only.
As can be seen in Figure 4, based on the Boruta algorithm, the following features were excluded from both textual and financial datasets: dummy, k1, k2, k3, k4, k5, k6, k7, k8, k10, d2, d5, momentum1, momentum2, momentum3, momentum4, momentum5, momentum6, momentum7, william, william1, william4, william7, william8, william9, erdogantitle, teroristtitle, sehittitle, operasyontitle, yaralititle, dolartitle, faiztitle, and tcmbtitle. English names of variables are given in the Section 2.3. All variables except these ones were marked as important and included in the model training.

3. Results

To understand the concept of hyperparameters, it is first necessary to know the difference between model parameters and hyperparameters. The parameters that perform learning with the data used in the model without requiring the researcher to make a decision in advance are called model parameters. Unlike model parameters, hyperparameters do not learn with the data and must be specified in advance. Optimization is a process of finding the optimal parameters to best predict a model, and the model has a large impact on the prediction accuracy [38].
The literature presents various options for hyperparameter optimization. Grid search, random search and evolutionary algorithms are the most often used techniques. The grid search approach was applied as hyperparameter optimization in the research since it is simple to apply among other techniques [39].
Some of the hyperparameters used in the model can take an infinite number of values. Therefore, certain ranges are specified for these parameters. The model is trained with the values in the specified ranges and the best combination group obtained from observing the results is determined as the hyperparameter of the model [38].
The primary drawback of this method is the extended duration required for computation. For efficiency, the computation may be executed on a subset of the dataset. Consequently, it is possible to formulate a prediction regarding the ranges of the hyperparameters [39].
An R package called keras was used to define and train the feedforward model of the deep neural network set up for the analysis.
The model consists of an input layer, an output layer, two dropout layers, and three hidden layers. Overfitting is a problem with deep learning models that have too many parameters. Overfitting is expressed as memorizing results down to the lowest breakdown. This results in the model not being able to adapt to the new data it receives.
The dropout layer fixes this problem and prevents overfitting. With the dropout layer, all connections entering and leaving the randomly selected nodes are temporarily closed after a certain rate. Although the dropout rate set here varies depending on the model, it is generally between 0.5 and 0.8 [40].
Epoch and batch size are hyperparameters utilized to optimize the deep learning model. The number of times the network sees the complete dataset during training is called the epoch. The higher the epoch, the better the results. The batch specifies how much data should be shown to the network during each epoch. This value is generally 32, 64, and 128 [41]. The dropout rates and epoch and batch sizes appropriate for the model were calculated using the grid search method and the results are presented in Table 1.
Root Mean Squared Error is used as a measure of predictive accuracy. The purpose of measuring predictive accuracy is to compare the actual and predicted values and observe the degree of degradation between them. The error is calculated by subtracting the predicted values from the predicted values, and squaring and dividing by the number of samples. It is expressed as e i = ( x i y i ) .
The value found is always positive and the value closer to zero is considered a more successful prediction [42].
The hyperparameter optimization results were decided based on the Mean Squared Error obtained as a result of the grid search. According to the results, the first dropout rate was 0.4, the second failure rate was 0.4, the batch size was 32, and the number of epochs was 50.
The data collected for the purpose of predicting the closing prices of the XBANK index were processed in three ways. These are the ‘text’, which consists of text data only, the ‘financial’, which consists of financial data only, and the ‘combined’, which contains both financial and textual data. The Boruta algorithm was applied to determine the importance of the features. In total, 70% of the data was set as the training dataset and 30% as the test dataset, since the dataset has a relatively low number of observations. The first 70% of data points chronologically were used for training, and the subsequent 30% for testing to simulate real-world forecasting [43].
A feedforward model of a deep neural network consisting of an input layer, an output layer, two dropout layers, and three hidden layers was created, as shown in Figure 5. The activation function used in the created model was the ReLU activation function, which is considered important in multilayer networks. The Mean Square Error (MSE) was used as a loss function and RMSprop was used as an optimization algorithm. Model training process for all models, loss function evolution over the epochs for both validation sets and training sets are shown in Figure 6.
For all datasets, separate models were trained. For each model, the Boruta algorithm was applied. As hyperparameters, the same hyperparameters were obtained using grid search and are shown in Table 1.
For datasets where textual and financial data are used together, the estimated values up to June 2019 and the actual values are close, but it is observed that thereafter the values diverge and move away from each other. In addition, it is observed that the difference between the estimated values for the textual dataset and the actual values is smaller than for the other datasets. It could also be seen that the difference between the estimated values and the actual values, especially for the combined dataset and the financial dataset, showed a significant divergence after a certain period of time. The relevant period when this divergence is evident is between June and December 2019. It is likely that during this period, there were political or economic news that affected the market. For this reason, the headlines between June and December 2019 were examined. It turned out that there was an intense news flow about the cross-border operations, the 2019 local elections, the objections to the elections, and the sanctions imposed by the US on Turkiye. The political tensions in Turkiye directly affect the stock market indices and cause volatility [44].
Ensemble learning is a modern deep learning method based on the principle of predicting a model using a combination of the results of multiple outputs, rather than estimating a single output result, in order to obtain a more accurate result. The results showed that the models built with different datasets alone were not sufficient to predict the XBANK closing value. For this reason, the estimated values were combined and averaged, and the obtained results were compared with the actual values.
Looking at Figure 7, it can be seen that the model based on textual data provides the most accurate results for the whole period covered in the dataset. It is also visible that the average of predictions obtained from the textual and financial datasets-based model performs better than others. To get a better understanding about the performance of different models and their combinations, Root Mean Square Error (RMSE), Mean Absolute Percentage Error (MAPE), and Mean Absolute Error (MAE) were calculated for different combinations of the forecast of the values, both including and excluding June–December 2019, and the results are presented in Table 2.
Root Mean Square Error (RMSE), as shown in the formula below, is a measure of error, so the analysis result was interpreted using this value. Relatively low values of the error measure indicate that the model performance is successful. The fact that the Root Mean Square Error is zero indicates that the model performance is excellent [45].
RMSE = 1 n i = 1 n ( y i y ^ i ) 2
Mean Absolute Percentage Error (MAPE), as shown in the formula below, is the mean absolute percentage of prediction errors. MAPE helps us understand the relative magnitude of errors and is expressed as a percentage. Because this metric assesses the magnitude of errors proportionally, it makes it easy to compare datasets of different scales [46].
MAPE = 1 n i = 1 n y i y ^ i y i × 100
Mean Absolute Error (MAE) represents the average of the absolute differences between the predicted and actual values. This metric allows us to understand the magnitude of prediction errors [46].
MAE = 1 n i = 1 n | y i y ^ i |
Examining Table 1, it can be seen that the Root Mean Square Error of the average of the prediction results of the textual and financial dataset calculated with the dataset excluding the June–December 2019 period was lower than the Root Mean Square Error calculated with the dataset including the June–December 2019 period. Moreover, when compared to all the values in the table, it can be observed that this period has the lowest Root Mean Square Error value. When the financial dataset is examined, the Root Mean Square Error calculated with the dataset excluding the June–December 2019 period is lower than that calculated with the dataset including the period of June–December 2019. The average values of the combined datasets (financial and textual) in which the financial and textual datasets are combined with the other two datasets separately (financial and textual + textual average, financial and textual + financial average) gave more successful results than the values calculated with the dataset excluding the June–December 2019 period. On the other hand, the situation in the textual dataset is different from other datasets. In the textual dataset, the Root Mean Squared Error squares in the dataset including the June–December 2019 period are lower than the Root Mean Squared Error squares in the dataset excluding this period.

4. Conclusions

The empirical results of this study demonstrate that periods of political tension exert a significant impact on the XBANK index, often precipitating abrupt market volatility. Such instability undermines the predictive accuracy of traditional models built solely on financial indicators. Notably, this research reveals a clear divergence in model performance based on the political climate. During stable periods, models integrating both financial and textual data yield robust predictive values. During political shocks, models leveraging textual data (e.g., news, digital media) significantly outperform those relying on financial indicators.
Consequently, these findings suggest that during phases of political uncertainty, investors should prioritize qualitative textual analysis over quantitative financial metrics to inform more prudent investment decisions.
While the existing deep learning literature often focuses on individual equities, cryptocurrencies, or model-to-model performance comparisons, this study shifts the focus toward the XBANK index. As one of Turkiye’s most heavily traded indices, the banking index serves as a primary barometer for broader market trends. By utilizing the closing values of a composite index rather than a single stock, this study provides a more holistic view of market behavior. The primary significance of this research lies in its novel predictive approach, specifically tailored for environments characterized by high political uncertainty, offering a valuable framework for researchers and practitioners alike.
Despite the novelty of this approach, certain limitations provide avenues for further refinement. The dataset is limited to the 2015–2019 period, utilizes only two primary sources for textual data, and relies on a specific set of national and international macroeconomic variables. The current study employs a single deep learning architecture. While a 70/30 split provides a baseline, there is a need explore nested cross-validation to further verify the model’s stability in volatile periods. Future research will aim to address these limitations by expanding the temporal scope of the dataset and incorporating a broader array of textual sources. Furthermore, we intend to explore the efficacy of alternative deep learning architectures, such as Gated Recurrent Units (GRUs) and Transformers, to enhance predictive precision under varying economic and political conditions, as well as try different train–test splits to have more robust predictions.

Author Contributions

Conceptualization, C.A. and O.A.; Methodology, E.H.; Validation, O.A.; Formal analysis, O.A.; Resources, E.H.; Data curation, C.A.; Writing—original draft, C.A., O.A. and E.H.; Writing—review & editing, C.A., O.A. and E.H.; Visualization, C.A.; Supervision, O.A. and E.H. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data that support the findings of this study are available in https://github.com/olgnaydn/xbank-prediction. These data were derived from the following resources available in the public domain: www.investing.com, www.dunya.com (accessed on 19 February 2021).

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Türkmen, A.C.; Cemgil, A.T. An application of deep learning for trade signal prediction in financial markets. In Proceedings of the 2015 23nd Signal Processing and Communications Applications Conference (SIU); IEEE: Piscataway, NJ, USA, 2015; pp. 2521–2524. [Google Scholar]
  2. Gunduz, H.; Cataltepe, Z.; Yaslan, Y. Stock market direction prediction using deep neural networks. In Proceedings of the 2017 25th Signal Processing and Communications Applications Conference (SIU); IEEE: Piscataway, NJ, USA, 2017; pp. 1–4. [Google Scholar]
  3. Fung, G.P.C.; Yu, J.X.; Lam, W. Stock prediction: Integrating text mining approach using real-time news. In Proceedings of the 2003 IEEE International Conference on Computational Intelligence for Financial Engineering, 2003; IEEE: Piscataway, NJ, USA, 2003; pp. 395–402. [Google Scholar]
  4. Mahajan, A.; Dey, L.; Haque, S.M. Mining financial news for major events and their impacts on the market. In Proceedings of the IEEE/WIC/ACM International Conference on Web Intelligence and Intelligent Agent Technology; IEEE Computer Society: Los Alamitos, CA, USA, 2008; Volume 1, pp. 423–426. [Google Scholar]
  5. Akita, R.; Yoshihara, A.; Matsubara, T.; Uehara, K. Deep learning for stock prediction using numerical and textual information. In Proceedings of the 2016 IEEE/ACIS 15th International Conference on Computer and Information Science (ICIS); IEEE: Piscataway, NJ, USA, 2016; pp. 1–6. [Google Scholar]
  6. Oncharoen, P.; Vateekul, P. Deep learning for stock market prediction using event embedding and technical indicators. In Proceedings of the 2018 5th International Conference on Advanced Informatics: Concept Theory and Applications (ICAICTA); IEEE: Piscataway, NJ, USA, 2018; pp. 19–24. [Google Scholar]
  7. Tetlock, P.C. Giving content to investor sentiment: The role of media in the stock market. J. Financ. 2007, 62, 1139–1168. [Google Scholar] [CrossRef]
  8. Bollen, J.; Mao, H.; Zeng, X. Twitter mood predicts the stock market. J. Comput. Sci. 2011, 2, 1–8. [Google Scholar] [CrossRef]
  9. Ding, X.; Zhang, Y.; Liu, T.; Duan, J. Deep learning for event-driven stock prediction. In Proceedings of the 24th International Joint Conference on Artificial Intelligence; AAAI Press: Washington, DC, USA, 2015; Volume 15, pp. 2327–2333. [Google Scholar]
  10. Hochreiter, S.; Schmidhuber, J. Long short-term memory. Neural Comput. 1997, 9, 1735–1780. [Google Scholar] [CrossRef] [PubMed]
  11. Fischer, T.; Krauss, C. Deep learning with long short-term memory networks for financial market predictions. Eur. J. Oper. Res. 2018, 270, 654–669. [Google Scholar] [CrossRef]
  12. Nelson, D.M.; Pereira, A.C.; De Oliveira, R.A. Stock market’s price movement prediction with LSTM neural networks. In Proceedings of the 2017 International Joint Conference on Neural Networks (IJCNN); IEEE: Piscataway, NJ, USA, 2017; pp. 1419–1426. [Google Scholar]
  13. Pellicani, A.; Pio, G.; Ceci, M. CARROT: Simultaneous prediction of anomalies from groups of correlated cryptocurrency trends. Expert Syst. Appl. 2025, 260, 125457. [Google Scholar] [CrossRef]
  14. Sezer, O.B.; Gudelek, M.U.; Ozbayoglu, A.M. Financial time series forecasting with deep learning: A systematic literature review: 2005–2019. Appl. Soft Comput. 2020, 90, 106181. [Google Scholar] [CrossRef]
  15. Wikipedia Contributors. March 2019 Istanbul Mayoral Election. 2024. Available online: https://en.wikipedia.org/wiki/March_2019_Istanbul_mayoral_election (accessed on 22 May 2024).
  16. McKernan, B. Erdogan Faces Scrutiny Once More as Istanbul Goes Back to the Polls. The Guardian. Available online: https://www.theguardian.com/world/2019/jun/23/erdogan-faces-scrutiny-once-more-as-istanbul-goes-back-to-the-polls (accessed on 22 May 2024).
  17. Hornik, K.; Stinchcombe, M.; White, H. Multilayer feedforward networks are universal approximators. Neural Netw. 1989, 2, 359–366. [Google Scholar] [CrossRef]
  18. Goodfellow, I. Deep Learning; MIT Press: Cambridge, MA, USA, 2016. [Google Scholar]
  19. Aytekin, G. Türkiye’de Sermaye Piyasaları ve Borsaların Gelişim Süreci. Int. J. Humanit. Educ. 2018, 4, 150–176. [Google Scholar]
  20. Kindik, N. Türkiye’de Hisse Senedi Piyasasının Ekonomik Büyümeye Katkısı. Master’s Thesis, Nevşehir Hacı Bektaş Veli University Institute of Social Sciences, Nevşehir, Turkey, 2019. [Google Scholar]
  21. Erdinç, Y. Yatırımcı ve Teknik Analiz Sorgulanıyor; Siyasal Kitabevi: Ankara, Turkey, 2004. [Google Scholar]
  22. Krantz, M. Fundamental Analysis for Dummies; Wiley Publishing: Hoboken, NJ, USA, 2010. [Google Scholar]
  23. Ergin, E. Hisse Senedi Piyasalarında Temel Analiz: 2008–2013 Yılları Arasında Bist’te işlem Gören Sigorta şirketleri üzerine Bir Uygulama. Master’s Thesis, Osmaniye Korkut Ata University Institute of Social Sciences, Osmaniye, Turkey, 2015. [Google Scholar]
  24. Kirkpatrick, C.D.; Dahlquist, J. Technical Analysis: The Complete Resource for Financial Market Technicians; FT Press: Upper Saddle River, NJ, USA, 2011. [Google Scholar]
  25. Cetinyokuş, T.; Gökçen, H. Borsada Göstergelerle Teknik Analiz için Bir Karar Destek Sistemi. J. Fac. Eng. Archit. Gazi Univ. 2002, 17, 43–58. [Google Scholar]
  26. Orçun, C. Finansal Piyasalarda Alım Satım Kararlarında Teknik Analiz ve İMKB Uygulaması. Master’s Thesis, Dokuz Eylül University Institute of Social Sciences, İzmir, Turkey, 2010. [Google Scholar]
  27. Oztürk, H. Teknik Analizde Alım-Satım Sistemi Oluşturma: Sistemin Geçmişe Yönelik Testleri. J. Financ. Res. Stud. 2016, 8, 469–493. [Google Scholar] [CrossRef]
  28. Blanco, P.F.; Sagi, D.B.; Soltero, F.; Hidalho, J.I. Technical Market Indicators Optimization using Evolutionary Algorithms. In GECCO’08: Proceedings of the 10th Annual Conference Companion on Genetic and Evolutionary Computation; Association for Computing Machinery: New York, NY, USA, 2008; pp. 1851–1858. [Google Scholar] [CrossRef]
  29. R Core Team. An Introduction to R; R Foundation for Statistical Computing: Vienna, Austria, 2024. [Google Scholar]
  30. Kursa, M.B.; Rudnicki, W.R. Feature selection with the Boruta package. J. Stat. Softw. 2010, 36, 1–13. [Google Scholar] [CrossRef]
  31. Chollet, F.; Kalinowski, T.; Allaire, J.J. Deep Learning with R; Simon and Schuster: New York, NY, USA, 2022. [Google Scholar]
  32. Wickham, H.; Francois, R.; Henry, L.; Müller, K.; Vaughan, D. dplyr: A Grammar of Data Manipulation, R Package Version 1.2.1. Available online: https://dplyr.tidyverse.org (accessed on 26 April 2026).
  33. Sirisuriya, D.S. A Comparative Study on Web Scraping. In Proceedings of the 8th International Research Conference, KDU, Ratmalana, Sri Lanka, 27–28 August 2015. [Google Scholar]
  34. Akın, A.A.; Akın, M.D. Zemberek, an open source NLP framework for Turkic languages. Structure 2007, 10, 1–5. [Google Scholar]
  35. Blei, D.M.; Ng, A.Y.; Jordan, M.I. Latent Dirichlet Allocation. J. Mach. Learn. Res. 2003, 3, 993–1022. [Google Scholar]
  36. Gan, J.; Qi, Y. Selection of the optimal number of topics for LDA topic model—Taking patent policy analysis as an example. Entropy 2021, 23, 1301. [Google Scholar] [CrossRef] [PubMed]
  37. Chen, Q.; Yao, L.; Yang, J. Short Text Classification Based On Lda Toic Model. In Proceedings of the International Conference on Audio, Language and Image Processing (ICALIP); IEEE: Piscataway, NJ, USA, 2016; pp. 749–753. [Google Scholar] [CrossRef]
  38. Zheng, A. Evaluating Machine Learning Models; O’reilly Media: Sebastopol, CA, USA, 2015. [Google Scholar]
  39. Tanyıldızı, E.; Demirtaş, F. Hiper Parametre Optimizasyonu. In Proceedings of the 1st International Informatics and Software Engineering Conference (UBMYK); IEEE: Piscataway, NJ, USA, 2019; pp. 1–5. [Google Scholar] [CrossRef]
  40. Srivastava, N.; Hinton, G.; Krizhevsky, A.; Sutskever, I.; Salakhutdinov, R. Dropout: A Simple Way to Prevent Neural Networks from Overfitting. J. Mach. Learn. Res. 2014, 15, 1929–1958. [Google Scholar]
  41. Nazir, S.; Patel, S.; Patel, D. Hyper Parameters Selection for Image Classification in Convolutional Neural Networks. In Proceedings of the 17th International Conference on Cognitive Informatics & Cognitive Computing (ICCI*CC’18); IEEE: Piscataway, NJ, USA, 2018; pp. 401–407. [Google Scholar] [CrossRef]
  42. Wang, Z.; Bovik, A.C. Mean squared error: Love it or leave it? A new look at Signal Fidelity Measures. IEEE Signal Process. Mag. 2009, 26, 98–117. [Google Scholar] [CrossRef]
  43. James, G.; Witten, D.; Hastie, T.; Tibshirani, R.; Taylor, J. An Introduction to Statistical Learning: With Applications in R; Springer: Cham, Switzerland, 2013; Volume 103. [Google Scholar]
  44. Dayı, F. Sistematik Riskin Hisse Senedi Getirisine Etkisi: Borsa Istanbul örneği. Optim. J. Econ. Manag. Sci. 2020, 7, 1–20. [Google Scholar]
  45. Cınaroğlu, S. Sağlık Harcamasının Tahmininde Makine öğrenmesi Regresyon Yöntemlerinin Karşılaştırılması. Uludağ Univ. J. Fac. Eng. 2017, 22, 179–200. [Google Scholar]
  46. Chicco, D.; Warrens, M.J.; Jurman, G. The coefficient of determination R-squared is more informative than SMAPE, MAE, MAPE, MSE and RMSE in regression analysis evaluation. PeerJ Comput. Sci. 2021, 7, e623. [Google Scholar] [CrossRef] [PubMed]
Figure 1. LDA results (source: own elaboration). Note: English translation of the Turkish words as follows. Erdoğan (Erdogan), sehit (martyr), terörist (terrorist), yaralı (injured), operasyon (operation), etkisiz (ineffective), edildi (was done), gözaltı (charge), terör (terror), görüştü (met), milyar (billion), TL (Turkish Liras), faiz (interest), dolar (dollar), TCMB (CBRT), milyon (million), Çin (China), piyasalarda (in the markets), gereken (required), olay (event).
Figure 1. LDA results (source: own elaboration). Note: English translation of the Turkish words as follows. Erdoğan (Erdogan), sehit (martyr), terörist (terrorist), yaralı (injured), operasyon (operation), etkisiz (ineffective), edildi (was done), gözaltı (charge), terör (terror), görüştü (met), milyar (billion), TL (Turkish Liras), faiz (interest), dolar (dollar), TCMB (CBRT), milyon (million), Çin (China), piyasalarda (in the markets), gereken (required), olay (event).
Applsci 16 04377 g001
Figure 2. Feature importance for financial dataset using Boruta algorithm (source: own elaboration).
Figure 2. Feature importance for financial dataset using Boruta algorithm (source: own elaboration).
Applsci 16 04377 g002
Figure 3. Feature importance for “textual” dataset using Boruta algorithm (source: own elaboration).
Figure 3. Feature importance for “textual” dataset using Boruta algorithm (source: own elaboration).
Applsci 16 04377 g003
Figure 4. Feature importance results for “combined” dataset using Boruta algorithm (source: own elaboration).
Figure 4. Feature importance results for “combined” dataset using Boruta algorithm (source: own elaboration).
Applsci 16 04377 g004
Figure 5. Deep neural network architecture used in this study (source: own elaboration).
Figure 5. Deep neural network architecture used in this study (source: own elaboration).
Applsci 16 04377 g005
Figure 6. Loss and accuracy of training set for models based on “finance”, “textual”, and “combined” datasets, respectively.
Figure 6. Loss and accuracy of training set for models based on “finance”, “textual”, and “combined” datasets, respectively.
Applsci 16 04377 g006aApplsci 16 04377 g006b
Figure 7. Prediction performance of models and results of ensemble learning.
Figure 7. Prediction performance of models and results of ensemble learning.
Applsci 16 04377 g007
Table 1. Grid search results (source: own elaboration).
Table 1. Grid search results (source: own elaboration).
Root Mean Squared ErrorDropoutDropout2BatchEpoch
8.176 × 10 9 0.40.43250
Table 2. Detailed comparison of RMSE, MAPE, and MAE for all financial and textual models.
Table 2. Detailed comparison of RMSE, MAPE, and MAE for all financial and textual models.
July–December 2019 (Excl.)July–December 2019 (Incl.)
Models RMSE MAPE MAE RMSE MAPE MAE
Combined46,308.9632.71%40,002.7489,226.1833.06%71,141.58
Average of Financial and Textual11,203.497.58%8984.4824,011.1211.58%17,923.36
Textual19,650.7313.67%15,840.1917,725.5211.47%13,890.07
Financial20,361.7314.47%17,068.0850,362.4422.28%37,001.72
Average of Combined and Textual23,633.4516.56%20,043.7343,349.1419.26%34,703.84
Average of Combined and Financial30,403.4121.11%25,563.6668,676.2726.57%51,963.89
Average of Combined, Financial and Textual198,686.1713.51%16,343.5744,567.7618.41%33,548.92
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Altunbas, C.; Aydin, O.; Hayat, E. Predicting Borsa Istanbul Bank Indices Using Deep Neural Networks and Text Mining. Appl. Sci. 2026, 16, 4377. https://doi.org/10.3390/app16094377

AMA Style

Altunbas C, Aydin O, Hayat E. Predicting Borsa Istanbul Bank Indices Using Deep Neural Networks and Text Mining. Applied Sciences. 2026; 16(9):4377. https://doi.org/10.3390/app16094377

Chicago/Turabian Style

Altunbas, Cansu, Olgun Aydin, and Elvan Hayat. 2026. "Predicting Borsa Istanbul Bank Indices Using Deep Neural Networks and Text Mining" Applied Sciences 16, no. 9: 4377. https://doi.org/10.3390/app16094377

APA Style

Altunbas, C., Aydin, O., & Hayat, E. (2026). Predicting Borsa Istanbul Bank Indices Using Deep Neural Networks and Text Mining. Applied Sciences, 16(9), 4377. https://doi.org/10.3390/app16094377

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop