Next Article in Journal
PURA-SCIS Protocol: A Novel Solution for Cloud-Based Information Sharing Protection for Sectoral Organizations
Previous Article in Journal
Matching BiHom-Rota-Baxter Algebras and Related Structures
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Testing an Algorithm with Asymmetric Markov-Switching GARCH Models in US Stock Trading

by
Oscar V. De la Torre-Torres
1,
Dora Aguilasocho-Montoya
1,* and
José Álvarez-García
2
1
Facultad de Contaduría y Ciencias Administrativas, Universidad Michoacana de San Nicolás de Hidalgo (UMSNH), Morelia 58000, Mexico
2
Departamento de Economía Financiera y Contabilidad, Instituto Universitario de Investigación para el Desarrollo Territorial Sostenible (INTERRA), Facultad de Empresa Finanzas y Turismo, Universidad de Extremadura, Avd. de la Universidad, nº 47, 10071 Cáceres, Spain
*
Author to whom correspondence should be addressed.
Symmetry 2021, 13(12), 2346; https://doi.org/10.3390/sym13122346
Submission received: 19 September 2021 / Revised: 20 November 2021 / Accepted: 1 December 2021 / Published: 6 December 2021

Abstract

:
In the present paper, we extend the current literature in algorithmic trading with Markov-switching models with generalized autoregressive conditional heteroskedastic (MS-GARCH) models. We performed this by using asymmetric log-likelihood functions (LLF) and variance models. From 2 January 2004 to 19 March 2021, we simulated 36 institutional investor’s portfolios. These used homogenous (either symmetric or asymmetric) Gaussian, Student’s t-distribution, or generalized error distribution (GED) and (symmetric or asymmetric) GARCH variance models. By including the impact of stock trading fees and taxes, we found that an institutional investor could outperform the S&P 500 stock index (SP500) if they used the suggested trading algorithm with symmetric homogeneous GED LLF and an asymmetric E-GARCH variance model. The trading algorithm had a simple rule, that is, to invest in the SP500 if the forecast probability of being in a calm or normal regime at t + 1 is higher than 50%. With this configuration in the MS-GARCH model, the simulated portfolios achieved a 324.43% accumulated return, of which the algorithm generated 168.48%. Our results contribute to the discussion on using MS-GARCH models in algorithmic trading with a combination of either symmetric or asymmetric pdfs and variance models.

1. Introduction

Given the current computer and financial econometrics advances in the last 15 years, the modeling of the non-rational behavior among investors and the need for quantitative models to determine trading signs have evolved. This development has led to other ones in algorithmic trading.
Although classical financial economics theories and assumptions do not hold entirely in real life, these have been a good starting point to explain some financial phenomena. Despite this, these theories lack a proper explanation of asset price bubbles or financial market crashes. In some approaches, such as the efficient-market hypothesis [1], these episodes should not exist or are part of atypical situations that should fade in the mid- and long-term. Given this, a potential explanation of these phenomena was proposed by Black [2], who suggested the existence of two types of financial market agents, i.e., (1) the informed traders, who act with a broad and complete information set, and (2) the noisy ones, who lack a proper set and decide according to their sentiment. This explanation led to developing asset pricing models, such as the ones of Fama and French [3,4] or Carhart [5], that extend the original CAPM of Sharpe [6] and Lintner [7]. Fama–French and Carhart models use other factors (along with the market one or stock market benchmark), such as firm size, dividend growth, or even momentum. These two models explain some anomalies that the original capital asset pricing model (CAPM) and the efficient market hypothesis could not [8].
We prefer to use the behavioral asset pricing scope even if the CAPM’s validity and extensions are under discussion. We prefer such perspective, given the lack of explanation of the presence of regimes in financial markets with the classical financial economics ones. Several results show that financial markets have different states of nature not measured in a linear factor model context [9,10,11,12,13]. In addition, the change in such regimes or states of nature results from the sentiment among investors. Given this, Markov-switching models are valuable tools to infer these states of nature and to forecast the probability of being in each regime at t + n .
With the developments of behavioral finance as an answer to this need, other asset pricing models extend the classical ones by including market factors such as volatility levels or indexes (the VIX or the VSTOXX indexes) [14,15], the sentiment measured from financial markets, economic or policy news [16,17,18,19], the trends in Google searches, or the news sentiment of financial data news vendors, such as Refinitiv or Bloomberg [20,21]. These sentiment factors allow us to control non-market or non-rational issues and anticipate negative returns proper of distress or market crashes episodes.
The Markov-switching (MS) models are an econometric tool useful to anticipate bubble bursts and market crashes [22,23,24]. These models allow the analyst to estimate location ( μ ^ s ) and scale ( σ ^ s ) parameters of an s number of regimes or states of nature, e.g., a mean μ ^ s = 1 and standard deviation σ ^ s = 1 for low-volatility or “normal” periods regime ( s = 1 ) and another ( μ ^ s = 2 and σ ^ s = 2 ) for a high-volatility ( s = 2 ) “distress” or “crisis” one.
Furthermore, as additional outputs of these models, the analyst can estimate the probability ξ s , t of being in each regime s at t , along with a regime transition probability matrix from t 1 to t ( Π ). This use has several applications, such as the forecast of recession episodes [22,25,26] or the level of volatility spill-over between financial markets in distress periods [27,28,29,30,31,32].
Among the uses of MS models, we are interested in their application in algorithmic stock trading, that is, quantitative or computer models in which the use of MS models leads to a simple trading sign, i.e., to buy the security or portfolio of interest if the probability of being in a low-volatility or “normal” regime ( s = 1 ) is high or buying a risk-free asset (or good-performing security in high-volatility periods) otherwise.
This trading rule was primarily suggested by Brooks and Persand [33] and later developed for trading sign and crisis period forecast models [34,35]. These authors mainly tested the benefits of MS models for trading UK stocks in low-volatility or “normal” periods and UK gilts in high-volatility or crisis ones.
Additionally, there are tests of MS models in trading decisions in commodities [36,37], European and US stock markets and volatility futures by using generalized autoregressive conditional heteroskedasticity (GARCH) variances in the estimated MS models (MS-GARCH) [38,39].
These previous works and related ones tested the benefit of MS-GARCH models for trading signs with the following assumptions:
  • The marginal probability density function (pdf or pdfs in plural) was homogeneous; this means that the necessary regime-specific pdf to filter ξ s , t was the same in all the assumed regimes.
  • The used pdfs were the Gaussian, Student’s t, or generalized error density (GED) with symmetric shape.
  • The variance model in the MS-GARCH model was symmetric and ignored the potential benefits of including the impact of leverage of negative returns. That is, these tests estimate a regime-specific variance with the same dispersion magnitude, either with positive or negative price returns. Other asymmetric GARCH models, such as the TGARCH [40], the GJRGARCH [41] or the EGARCH [42], have not been tested in an MS-GARCH trading algorithm.
  • The variance model in the estimated MS-GARCH models was also homogeneous. That is, the authors assumed that the variance models were the same in each regime.
Other authors suggested the benefit of using asymmetric MS-GARCH models in securities and investment [10,43,44,45,46] to estimate risks. One limitation of relaxing the four previous assumptions is the high computing capabilities needed to backtest each trading period—periods in which the computer estimates the MS or MS-GARCH model and determines and executes a trading sign. This process is fast in a single-date estimation, but to backtest 10 or even 20 years of weekly or daily periods becomes hard computational work.
This considerable effort is due to the potential combinations of heterogeneous symmetric and asymmetric pdfs and high GARCH variances. As a first step, we relaxed assumptions 1 and 3 and simulated the benefits of MS-GARCH with either symmetric or asymmetric pdfs and symmetric or asymmetric GARCH variances. These led us to 36 simulated portfolios with weekly periods from 4 January 2004 to 26 March 2021 (a total of 898 weeks in each MS-GARCH model, totaling 32,329 simulated weeks and 2130.97 h—88.7 days—of simulations). We performed our backtests with a two-core, 1.4 GHz processor, 8 GB (3200 GHz processing) RAM computer.
With these tests, we simulated the performance that an investor would have had, had they used a trading algorithm that estimated the previous trading sign, given the forecast MS or MS-GARCH probability ( ξ s , t + 1 ) of being in a high-volatility or distress regime at t + 1 . Our theoretical position is that the assumption of symmetric marginal pdfs and symmetric GARCH variances set aside the potential of more precise trading signs, leading to a more unsatisfactory performance against a trading algorithm that used asymmetric pdfs or asymmetric GARCH variances.
The use of these kinds of asymmetric MS-GARCH trading algorithms could lead to important theoretical and practical implications, such as a trading tool that could weigh the influence of noisy traders and informed ones in a stock-trading strategy.
Our primary rationale was the following: the higher the influence of informed traders in a stock market, the higher the probability of being in a low-volatility regime ( s = 1 ) at t + 1 and the better to invest in stocks; further, the higher the presence of noisy traders, the higher the likelihood of being in a distress regime ( s = 2 ) at t + 1 and the better to invest in TBILLs.
Additionally, this type of trading algorithm could help make more suitable trading decisions for individual and institutional investors by knowing when to increase or hold their US stock positions or rebalance them to TBILLs.
We ran our trading algorithm and tested its benefit in US stocks (the S&P 500 stocks) and TBILLs from weekly trading decisions from 2004 to 2021.
Our simulation included several distress periods, such as the 2007–2008 financial crisis, the 2013 European debt issues, the 2016–2019 US commercial tensions with China and other countries and the current COVID-19 distress periods (from 2020 to the moment of writing this paper).
Given the above presentation of our theoretical and practical motivations, we offer a brief literature review in the next section.

2. Literature Review

MS models have proved useful for several applications, such as the ones mentioned in the previous section. The original proposal of Hamilton [22,23] allows users to estimate time-fixed parameters for each regime, i.e., a time-fixed parameter set θ = { μ ^ s , σ ^ s , ξ s , Π } with a regime-specific scale and location ( μ ^ s , σ ^ s ) parameters. This original proposal also led to extensions such as vector autoregressive models with MS effects (MS-VAR) [47,48,49,50,51]. These models were tested in several spill-over effects [28,31,52,53,54,55,56,57,58] among stock, currency, or commodity markets and between these types of markets. The results from these papers show that the use of MS-VAR models is helpful to estimate and forecast potential contagion effects among markets in high-volatility or crisis periods. These previous works motivate us to predict the probability of a regime change at t + 1 , given a “herd” behavior in distress periods. A behavior that could be proxied not with behavioral finance models and market sentiment proxies but with an econometrics model such as the MS-GARCH.
The original MS model infers, as mentioned, time-fixed location and scale parameters, given the smoothed probability ξ s , t filtered according to Hamilton’s [22] algorithm or with Markov chain Monte Carlo (MCMC) estimation with the Metropolis–Hasting algorithm [59]. These filtered probabilities are smoothed according to Kim’s [60] method. Departing from this rationale, the regime-specific location and scale parameters are estimated as follows:
μ ^ s = i = t T r t ξ s = i , t
σ ^ s 2 = t T ( r t μ ^ s = i ) 2 ξ s = i , t = t T ε t 2 ξ s = i , t
That is, the MS model can estimate the regime-specific location parameter and proxy the risk (standard deviation or scale parameter) in each regime. A drawback of the time-fixed parameters in Equations (1) and (2) is the lack of adaptation to short-term changes in financial markets and security price formation. Departing from this drawback, a natural extension for MS models could be the estimation of Equation (2) in a GARCH context (MS-GARCH models), such as the following:
σ ^ s , t 2 = σ 0 2 + p = 1 P β p ε t p 2 + q Q γ q σ ^ s , t q 2
where ε t are the residuals estimated from a time-fixed location parameter (mean), such as in Equation (1); σ 0 2 is a long-term time-fixed variance level to which σ ^ s , t 2 tends to revert; γ q estimates the rate of convergence of σ ^ s , t 2 to σ 0 2 ; and β p estimates the impact that previous exogenous shocks (proxied with jumps in ε t p 2 ) have in the actual short-term variance level. As noted from Equation (3), the location parameter can be estimated for each regime s of interest, leading to extend MS models with a GARCH version of these (MS-GARCH) [47,61,62,63].
The potential use of MS-GARCH models has been widely discussed and tested in several works. The natural use in finance is financial risk measurement, value at risk (VaR), or conditional value at risk (CVaR) estimation [10,29,43,44,64,65,66,67,68,69,70]. MS-GARCH models are suitable for these purposes and trading, as mentioned in the previous section. The original proposal by Brooks and Persand [33] assumed two regimes and a time-fixed location and scale parameter; we consider this, along with Gaussian regime-specific pdfs, a situation that we want to extend in this paper by testing a trading algorithm such as theirs in the US stock market with MS-GARCH models, asymmetric regime-specific pdfs and asymmetric GARCH variances. In their paper, Brooks and Persand (without incorporating stock trading fees) showed that their MS trading algorithm worked appropriately and enhanced an investor’s performance against a buy-and-hold UK stock or Gilt strategy.
Other works, such as De la Torre-Torres et al.’s [36,37,39,71], developed similar tests in the US stock markets, energy and agricultural commodities and even in volatility futures markets. Similar to Brooks and Persand, these authors tested an MS-GARCH trading algorithm. They performed this in a symmetric Gaussian, Student’s t and GED pdf context with symmetric GARCH variances. The simulated portfolios outperformed a buy-and-hold strategy in the simulated stock indexes or commodity futures. The authors incorporated the impact of stock and futures trading fees in these backtests, including roll-over costs. In the specific case of De la Torre-Torres, Galeana-Figueroa and Álvarez-García [39], the authors assumed an MS-GARCH three-regime context. They simulated the performance of a portfolio that invested in European stocks in calm periods ( s = 1 ), 3-month German Treasury Bills (Bundes) or the 1-month VSTOXX volatility index futures in high-volatility ones. By also including stock trading fees and futures’ roll-over costs, the authors found that using their MS-GARCH trading algorithm (in a two-regime context) is beneficial for outperformance purposes in the short-term. If a given investor wants to outperform a buy-and-hold strategy in European stocks, they must combine the simulated short-term trading strategy with a buy-and-hold one. They must do this by investing in a short-term strategy in calm periods ( s = 1 ). This last result complements the ones obtained by Alexander and Korovilas [72,73], who found only short-term benefits in a portfolio diversified with volatility futures (in a non-MS or MS-GARCH context).
Other works developed and tested warning systems for high-volatility or distress periods forecasting in the U.S., German, Swiss, or Japanese stock markets [34,35,74]. The authors used financial and economic variables such as the short-term and long-term Treasury yield rate, volatility indexes and corporate bond spreads in these works. Their purpose was to perform logit models that could help to forecast the regime-specific smoothed probabilities ξ ^ s , t + 1 by including the influence of external factors different from the time series of interest. In their results, the authors simulated a portfolio that used their sequential three-regime Gaussian MS smoothed probabilities ξ s , t to perform an active trading strategy in the markets of interest. With their results, the authors also found overperformance benefits with the use of MS models.
From these previous works, we want to extend the current literature in the following five ways:
  • We want to test if the use of asymmetric regime-specific pdfs adds to smoothed probability forecasts ( ξ s , t + 1 ).
  • Additionally, we want to test if the use of asymmetric GARCH variances also adds information to the estimated smoothed probabilities ξ s , t + 1 . For this case, we used the asymmetric Gaussian, Student’s t and GED pdfs by using Fernández and Steel [75] transformation to induce skewness in the next symmetric Gaussian, Student’s t (with ν degrees of freedom) and GED (with ν degrees of freedom and a shape parameter λ ) pdfs, respectively,
    ξ s , t = 1 2 π e 1 2 ( ε t σ s ) 2
    ξ s , t = Γ ( ν + 1 2 ) ( ν 2 ) π Γ ( ν 2 ) ( 1 + ( ε t σ s ) 2 ( ν 2 ) ) ν + 1 2 , ν = degrees   of   freedom
    ξ s , t = ν e 1 2 | ( ε t σ s ) λ | ν λ 2 ( 1 + 1 / ν ) Γ ( 1 / ν ) ,     λ = ( Γ ( 1 / ν ) 4 1 / ν Γ ( 3 / ν ) ) 1 / 2
  • We aim to simulate if these asymmetric GARCH variances and marginal pdfs probabilities ξ s , t + 1 lead to better performance against a buy-and-hold strategy in a Standard and Poors 500 (SP500) portfolio.
  • We aim to simulate if the asymmetric GARCH and pdf simulated portfolios outperform those simulated with symmetric pdfs and GARCH variances.
  • We simulated these portfolios in a homogeneous regime-specific context with the assumption of two volatility regimes. i.e., a low-volatility or “normal” regime ( s = 1 ) and a high-volatility ( s = 2 ) or “distress” one.
  • We tested if it is better to use more computationally efficient symmetric MS-GARCH models than their asymmetric versions. We conducted this type of testing to give guidelines to the finance industry about the pertinence of asymmetric MS-GARCH models for trading algorithms such as the one tested herein. This result could have an impact on the computational needs for portfolio management or even in high-frequency trading.
For our simulations, we used homogeneous Gaussian, Student’s t-distribution and generalized error distribution (GED) pdfs in the symmetric version of Equations (4)–(6) and the ones achieved with Fernández and Steel [75] transformation. For each two- or three-regime scenario of these six pdfs, we estimated the MS-GARCH models with time-fixed variances, as in Equation (2), or symmetric GARCH ones, as in Equation (3). In addition, we simulated the portfolios with two or three regimes as the previous six pdfs with asymmetric GARCH models, such as the EGARCH of Nelson [42], in Equation (7), the TGARCH of Zakoian [40], in Equation (8), and the GJRGARCH of Glosten, Jaganathan and Runkle [41], in Equation (9).
ln ( σ ^ s , t 2 ) = α 0 , s + β 1 , s ( | ε t 1 | E [ ε t 1 ] ) + β 2 , s ε t 1 + γ s ln ( σ ^ s , t 2 )
σ ^ s , t 2 = σ 0 , s 2 + p = 1 P ( [ I { ε t 1 0 } β p , s ] ε t p 2 [ I { ε t 1 < 0 } λ p , s ] ε t p 2 ) + q Q γ q , s σ ^ s , t q 2
σ ^ s , t 2 = σ 0 2 + p = 1 P [ β p , s + λ p , s I { ε t 1 < 0 } ] ε t p 2 + q Q γ q σ ^ s , t q 2
For our simulations, we simulated a theoretical investor that allocated their resources in the SP500 in s = 1 and in the 3-month TBILLS s = 2 . We decided to use this closed trading strategy by the fact that we simulated 36 possible scenarios with the combinations of the homogeneous pdfs in (4)–(6) and the variance models given in Equations (2) and (7)–(9).
As we mentioned above, our purpose is to test the benefits of using asymmetric pdfs and GARCH variances in the MS-GARCH model estimation process. More specifically, we aim to test the benefit of these asymmetric parameters to make more precise smoothed probabilities forecasts of the low ( s = 1 ) and high ( s = 2 ) regime’s smoothed probabilities in a Markov-switching trading algorithm.
The potential practical benefit of our tests is to determine if it is better to use symmetric, computationally more efficient pdfs and GARCH models or more precise but more complex pdfs and GARCH variances. For the case of a private or institutional investor who wants to develop an algorithmic trading system, to know if they can save time in the computer estimation of these models could be of use for latency or accuracy in the investment decision process.
In theoretical terms, we believe that our results will contribute to showing asymmetries in the behavior of financial time series—more specifically, in US stock index risk and algorithmic trading application. Several works have studied and favored the use of either asymmetric GARCH or MS-GARCH models, given their more accurate estimation of volatility levels and regime switching in downturn market periods and market crashes, along with the proper reverting effect estimation of more dynamic volatility and regime-switching models.
Given the above presentation of our work’s theoretical and practical motivations, we proceed to the next section. We detail how we gathered and processed the input data and how we performed our simulations.

3. Simulation Parameters and Observed Results

The present section explains how we gathered the input data and processed it before our simulations. To illustrate our backtests, we present the corresponding pseudocode and our main assumptions and parameters.

3.1. Data Gathering and Processing

To perform our simulations, we downloaded the weekly historical data of the SP500 stock index, along with the observed yield rate of the 3-month TBILL. We fetched the data from the databases of Refinitiv Eikon. For MS-GARCH estimation in the SP500 index, we used historical data from 6 January 1928 to 19 March 2021. We used this long time series to fit the MS and MS-GARCH by including all the high-volatility episodes of the centuries XX and XXI. That is, we analyzed the performance of this index from the Great Depression of 1929 to the last CODIV-19 episode and other important ones, such as the ones of the 1960s, 1970s, 1980s, the 1990s–2000 dot.com (accessed on 15 May 2021) bubble burst, the 2008 sub-prime and financial system crisis, the 2013 European issues or the 2016–2020 Donald Trump’s trade negotiations.
For our trading simulations, we estimated a base 100 1 January 2000, zero tracking error SP500 ETF ( S P 500 P , t ).
For the case of the TBILL, we fetched weekly historical yield values from 4 January 2004 to 19 March 2021. This period corresponded to our simulations. We used the historical yield values (yearly values) and transformed them into weekly yields. With these yields, we estimated a 4 January 2004 base 100 index ( T B I L L P , t ) that was a proxy of a theoretical mutual fund that paid (net of management expenses and with zero tracking error) the exact yield of the TBILL.
In Table 1, we summarize the downloaded historical data of these three series, the Refinitiv Identification Code (RIC) used to search these series in Refinitiv, the ticker or identification code used in this paper and the historical dates of each series fetched from Refinitiv.
With the historical data of the SP500 index, we estimated the value of a theoretical exchange-traded fund (ETF) with zero tracking error and a USD 100.00 (base 100) value on 2 January 2004.
Also, with the same SP500 price data, we estimated the MS and MS-GARCH models by using the continuous-time returns calculated as follows:
Δ % S P 500 = ln ( S P 500 t ) ln ( S P 500 t 1 )
We stored all the historical data in an SQLite database file and we used R to perform our simulations. In addition, in the same programming language, we programmed our entire simulation (backtest) algorithm.
To estimate the MS-GARCH model, we used the Ardia et al.’s [46,76] MSGARCH library in R. This package estimates these models with the Metropoli–Hastings [59] algorithm, a Markov chain Monte Carlo estimation method. One of the advantages of this estimation method is that it is more feasible to solve the MS-GARCH model than either the conventional E-M algorithm [77] or the quasi-maximum likelihood one [22,78].
The following subsection details the simulations and analysis parameters, along with the trading algorithm’s pseudocode.

3.2. Simulation Parameters and Pseudocode

As we mention in the literature review section, we simulated 36 portfolios that combine the three (homogeneous) pdfs given in Equations (7)–(9) and their corresponding three asymmetric versions with Fernandez and Steel [75] transformation (six pdf scenarios). We performed this in a two-regime context. In addition, these 36 combinations result by combining the previous six pdf scenarios, analyzed with the five types of variance equations. These are the time-fixed variance in Equation (2), the symmetric GARCH model of Equation (3) and the asymmetric ones of Equations (10)–(12).
We used 36 different tickers according to the MS-GARCH model and the pdf used (the MS-GARCH and pdf homogeneous). For example, MS-Gaussian is the ticker of the time-fixed variance MS model with a Gaussian pdf. We formed this ticker with the MS-GARCH model used in the simulated portfolios, followed by a hyphen (-) and the pdf. MSEGARCH-asymGED is the simulated portfolio that used an MS-EGARCH variance model with asymmetric GED pdf.
To estimate the MS and MS-GARCH models and to forecast ξ s , t + 1 , we used the MSGARCH [76] library of R with one lag in the ARCH and GARCH terms. We limited these lags because the MSGARCH library has such restriction and because the GARCH model is good enough to generalize the need for more lags in the ARCH term [79].
Following Haas, Mittnik and Paolella [63], we estimated the MSGARCH models with the return’s residuals ε t = Δ % S P 500 t Δ % S P 500 ¯ . The estimated MS models included only a scale parameter with the corresponding pdfs and variances of interest to obtain a better estimation method.
We used our simulation code in each of the 36 portfolios of interest. The following pseudocode (detailed in Algorithm 1) summarizes our simulation code steps.
Algorithm 1 The steps followed in the simulation of each of the 36 portfolios.
Loop 1 for all the 36 portfolios (combinations of two or three regimes with different homogeneous pdfs and variance models):
Loop 2 from 2 January 2004, to 19 March 2021 (t as date or week counter):
  • With the weekly SP500 close price ( P t ) values from January 6 of 1929 to the simulated week t , to estimate the continuous-time returns r i , t with (13).
  • To estimate the residuals ε t = Δ % S P 500 t Δ % S P 500 ¯ , for the entire continuous return’s time series at t .
  • To perform the two regime-specific probability ξ s = i , t + 1 forecasts by using the transition probability matrix and current week regime-specific smoothed probabilities:
    [ ξ s = 1 , t + 1 ξ s = 2 , t + 1 ] = Π [ ξ s = 1 , t ξ s = 2 , t ]
  • With ξ s = i , t + 1 to execute the following asset allocation trading rule:
    • To invest in the SP500 ETF if ξ s = 1 , t + 1 > 0.5 .
    • To invest in the TBILL mutual fund (risk-free asset) if ξ s = 2 , t + 1 > 0.5 .
  • To estimate the percentage return of the simulated portfolio at t . We conducted this as follows:
    Δ % W t = ω S P 500 Δ % S P 500 + ω T B I L L Δ % T B I L L w e e k l y
  • To mark-to-market the simulated portfolio values, given the percentage return of the simulated portfolio at t :
    W t = W t 1 ( 1 + Δ % W t )
  • If the current simulated week t is the first of a given month, to pay the previous monthly stock trading fee as follows:
    W t = W t [ m e a n ( { ( ω S P 500 , t 4 W t 1 ) , ( ω S P 500 , t W t ) } ) ( 0.89 % 1 + 10 % ) ]
End loop 2
End loop 1
End
To perform our simulations and for the sake of simplicity, we assumed that the simulated investor was an institutional one that paid a yearly 0.89% stock trading fee (0.0725% each month) plus a 10% of VAT—this in the weekly mean portfolio value ( W p ) at the end of each month. We conducted this by following [39], who found no significant difference between an individual investor’s performance and an institutional one if the impact of a stock trading fee scheme was assumed.
As mentioned for the previous algorithm, our simulations had two parts. The main one is the one depicted in Algorithm 1 and the second one is the one in step 3 of loop 2, with all the processes needed to estimate the MS-GARCH model. As noted from Algorithm 1, each step of loop 1 corresponds to one of the 36 simulated portfolios that differ either in the regime-specific pdf (the smoothed ones ξ s , t ), also used in the log-likelihood function (LLF) of the MS-GARCH model, or the corresponding variance model used.
To perform our analysis, we divided the study of these 36 simulated portfolios into six groups. Each group corresponded to the specific symmetric or asymmetric pdf. In each pdf group, we simulated the portfolios with time-fixed (MS), ARCH (MS-ARCH), GARCH (MS-GARCH), EGARCH (MS-EGARCH), GJR-GARCH (MS-GJRGARCH), or T-GARCH (MS-TGARCH) variance.
In each pdf portfolio group, we estimated the following portfolio performance metrics: the accumulated return, the mean weekly return, the weekly standard deviation; the max drawdown (estimated and the minimum observed weekly return), the Sharpe [80] ratio, the observed Jensen’s [81] alpha and the beta in a single index (SP500) factor model [82,83]. Along with these metrics, we estimated the tracking error ( T E ) as follows:
T E = σ ( Δ % W t Δ % S P 500 t )
Furthermore, we estimated the percentage of weeks ( % w e e k s u p ) in which the simulated portfolio had a higher value than the buy-and-hold SP500 one as follows:
% w e e k s u p = t = 1 T I t T ,   I t = { 1   i f   Δ % W t > Δ % S P 500 t 0   o t h e r w i s e
To have a broader performance picture, we estimated the mean surplus ( M e S u p ) value of the simulated portfolio against the buy-and-hold portfolio and the mean overperformance ( M O ) as follows:
M e S u p = t = 1 T I t ( Δ % W t Δ % S P 500 t ) T ,   I t = { 1   i f   Δ % W t > Δ % S P 500 t 0   o t h e r w i s e
M O = % w e e k s u p M e S u p
To determine which combination of pdf and MS-GARCH was the most appropriate for portfolio management purposes, we followed a two-stage process with the 36 simulated portfolios. First, we selected, in each of the six-portfolio pdf group, the one that showed the highest M O . This selection led us to a new group of six “best-performing” pdf-specific portfolios. From these six “best” group portfolios, we selected again the one with the best M O to determine the most suitable portfolio for algorithmic trading purposes. In fact, for exposition purposes, we present our result by following this two-stage analysis process.
We used the mean overperformance M O as a selection criterion because other performance measures give a general and final review of the portfolio’s value at T . These measures do not provide a broader picture of the overperformance of the simulated portfolio against the SP500. The M O summarized the mean weekly overperformance that the simulated portfolio had against the SP500 and set aside short-term results such as the one observed in the last weeks of our simulations, a period in which the SP500 had some “jumps” in its value and the simulated portfolio performed adequately but did not follow the general market performance. This result is because it was invested (in some cases) in TBILLs, as we comment next. This “jump” in the SP500 could be a short-term “improvement” for the market and not the simulated portfolios, an issue that was captured and set aside with the M O . Given this, the M O was our performance measure used to determine the best-performing portfolio.
Given the above detailed explanation of our simulation algorithms, assumptions and parameters, we review our main findings.

4. Results and Discussion

As mentioned in the previous section, we present the performance of the 36 simulated portfolios in 6 parts or groups given the homogeneous pdf used to estimate the MS-GARCH model. In each group, we determined the best-performing portfolio with the M O and, with these six best performers, we summarized their performance and discussed the best-performing portfolio (the best-performing combination of MS-GARCH and pdf).
Before we start this review, we want to summarize the performance of the SP500 and the TBILLS. In Figure 1, we present the historical performance of these two assets. The Figure illustrates the base 100 value on 4 January 2004 of both. The SP500 showed a final value of 267.4272 (a market accumulated return—or M A R —of 167.4272%) and the TBILL showed one of 124.8727 (a 24.8727% return). We summarize the weekly statistical returns (percentage variation of both assets) of these two indexes in Table 2.
The red line in Figure 1 represents the performance of a zero-tracking error ETF invested in the SP500. This asset is the “buy-and-hold” (BH) portfolio and defines that investment strategy in such an index. The blue line represents the performance of the TBILL theoretical mutual fund. In Table 2, we present the mean weekly return of both assets; we found that the SP500 paid a mean 0.14% return each week.
Next, we present our six-group analysis with these two indexes used as benchmarks of the simulated portfolios.

4.1. Simulation Results of the Six Portfolios That Used Homogeneous Symmetric Gaussian pdf

In Table 3, we summarize the performance of the six simulated portfolios that used a Gaussian pdf (4) as the regime-specific marginal (smoothed, ξ s , t ) pdf. From the accumulated return and overperformance from the SP500 rows, we show that only the two portfolios that used either asymmetric E-GARCH (Gaussian-EGARCH) or T-GARCH (Gaussian-TGARCH) variances generated an important overperformance at the end of the simulation period. The E-GARCH paid an accumulated return ( P A R ) of 204.08% that was 36.65% higher than the one produced by the SP500. Similarly, the T-GARCH portfolio paid 180.10% of accumulated return (12.67% above the SP500).
Despite this, it was essential to check if this overperformance from the SP500 was a short-term one. To check this, we examined the rows relative to the % of periods above SP500 ( % w e e k s u p ) and mean overperformance ( M O ), finding that the Gaussian E-GARCH portfolio had a value above the SP500 in 72.63% of the simulated weeks and the T-GARCH had it only in 15.23% of the simulated weeks. In addition, the E-GARCH portfolio had a mean value (surplus) of USD 25.86, leading to a weekly mean overperformance of USD 18.78. That is, on average, this simulated portfolio paid a mean overperformance of USD 18.78 each week. These two results suggest that these two simulated portfolios had a higher value than the SP500 in most weeks.
These results suggest that the use of asymmetric E-GARCH variances was the best to forecast the probability of being in calm ( s = 1 ) or crisis ( s = 2 ) regimes or periods, that is, to forecast ξ s = 1 , t + 1 and ξ s = 2 , t + 1 to make more precise trading decisions for active portfolio management purposes. We probed this last statement as true with Jensen’s [81] alpha.
This portfolio performance metric measures how much return is due to the portfolio’s manager (the trading algorithm) ability. It was estimated thanks to the portfolios’ beta ( β ) with the SP500 as follows:
J e n s e n s   a l p h a = P A R [ β M A R ]
As noted in these two best-performing portfolios, the MS-EGARCH portfolio paid 56.63% of its 204.08% accumulated return due to the algorithm’s proper trading sign timing. In plain terms, part of the 204.08% accumulated return was due to market (SP500) performance, given its β = 0.8807 relation with the market, and not by the algorithm’s ability to trade. From that 204.08%, 56.63% was due to the algorithm’s trading timing—timing that generated USD 25.86 mean surplus value from the SP500 during 72.63% of the weeks (a mean weekly overperformance of USD 18.78 from the SP500).
Given this analysis, the best-performing portfolio, from the six portfolios that used the symmetric Gaussian pdf, was the one that used the MS-EGARCH model to forecast the smoothed regime-specific probabilities ( ξ s , t + 1 ) at t + 1 .
In Figure 2, we present the historical performance for each simulated portfolio compared against the SP500 (grey area). We present this Figure to give a graphical idea of the performance results in Table 3. The weeks in which the simulated portfolios had a “flat” or horizontal performance were the ones in which the algorithm forecast a high probability ( ξ s = 2 , t + 1 > 0.5 ) of being in a distress or crisis regime ( s = 2 ) at t + 1 . Following our trading algorithm’s rule, most simulated portfolios invested in the TBILLs in those periods.
It is interesting to note the impact of the stock trading fees and VAT paid during our simulations. The best-performing portfolio had a 22.58% impact on its performance due to trading fees and 2.25% due to VAT payment.
This result led us to conclude that the impact of stock trading fees and taxes was marginal, related to the net overperformance generated against the SP500.

4.2. Simulation Results of the Six Portfolios That Used Homogeneous Symmetric Student’s t pdf

We follow the same exposition line as for the previous six portfolios. In Table 4, we summarize the performance of the six portfolios that used a homogeneous Student’s t pdf, as in (5), to filter and smooth the regime-specific probabilities ( ξ s , t ) at t .
The results of these six simulated portfolios are very similar to the symmetric Gaussian pdf ones. The only difference is the fact that only the one that used an MS-EGARCH variance model outperformed the SP500. In this pdf scenario, the T-GARCH portfolio (contrary to its symmetric Gaussian pdf counterpart) did not outperform the SP500.
The E-GARCH portfolio paid a slightly lower accumulated return of 200.95% (against the 204.08% of its symmetric Gaussian pdf counterpart). It had a similar beta of β = 0.8901 with the SP500 and 51.92% of that 200.95% accumulated return was due to the trading algorithm’s ability (Jensen’s alpha). In addition, this E-GARCH simulated portfolio had a higher value than the SP500 in 72.63% of the simulated weeks. This result led to having a weekly mean overperformance of 19.35% against the SP500.
The impact of stock trading fees and VAT was also similar to the one observed in the symmetric Gaussian pdf scenario. The simulated portfolio had an effect of 22.51% due to trading fees and one of 2.25% due to VAT payment.
In Figure 2, we present the historical performance of the six simulated portfolios with a symmetric Student’s t pdf. Similar to Figure 3, the periods in which the simulated portfolios invested in TBILLs show a “flat” performance. In those periods, the simulated portfolios reduced their risk by investing in the TBILL fund due to the forecast probability ( ξ s = 2 + t 1 > 0.5 ) of being in the crisis regime at t + 1 .
Given the fat tail features of the Student’s t pdf, the simulated E-GARCH portfolio and the time-fixed variance MS one had superior performance, against the SP500, most of the time. In Figure 3, the mean overperformance (USD 39.38) and the proportion of weeks above the SP500 (73.19%) suggest that this underperformance holds in the short-term. In the long term, this portfolio algorithm (MS model with time-fixed variance and Student’s t pdf) significantly outperformed the SP500 and was the most suitable for active portfolio management if the investor assumed a Student’s t pdf.
As noted in Table 4, the impact of stock trading fees and VAT was also marginal (21.46% and 2.14%, respectively), compared with the mean overperformance (39.38%) and the historical performance shown in Figure 2. The use of the Student’s t pdf led to a better performance in crisis episodes such as the October 2008 sub-prime crisis, the 2013 European debt issues, or even the 2020 COVID-19-related market distress.
Given these previous results, using a time-fixed MS variance model led to better performance results (against the SP500) with Student’s t pdf in the regime-specific probabilities ξ s , t .

4.3. Simulation Results of the Six Portfolios That Used Homogeneous Symmetric GED pdf

Now, we present the result of a fatter-tailed pdf, the generalized error distribution, or GED. Contrary to the Gaussian and, in some ν values, to the Student’s t pdf, the GED has a polynomial convergence in its tails. That is, the pdf tails are wider and reduce more slowly than the Gaussian and Student’s t pdfs.
In Table 5, we summarized the performance of the six portfolios that used this symmetric pdf and, in Figure 4, the historical performance of the simulated portfolios.
The conclusions, in this pdf scenario, are similar to the ones of the symmetric Student’s t pdf. The symmetric time-fixed variance MS and the asymmetric E-GARCH variance were the two best performers. Even if the former paid a negative overperformance return against the SP500, the result also held in the short-term.
For the E-GARCH model, it is noted, in Figure 4, an outstanding performance of the simulated portfolio. This result was due to two periods (signaled with black arrows in Figure 4), as mentioned previously, namely, the October 2008 sub-prime financial crisis and the 2013 European debt crisis. Contrary to the other five simulated portfolios, the E-GARCH one sold the SP500 faster and then bought back the SP500 to have another fall in value. Despite this, the proper sell timing in October 2008 and 2013 allowed this portfolio to have a better (higher) accumulated return than the SP500 and the other five simulated portfolios. In addition, as noted in 2013 (the second and third arrows), the simulated portfolio had proper timing to sell and buy back the SP500. This selling activity allowed the portfolio to be liquid less time than the other five and to follow the stock market recovery. This result is noted clearly by the third arrow. As noted, the E-GARCH portfolio spent less time invested in TBILLs because the E-GARCH model, being asymmetric, estimated the leverage effect and rate of converging of past negative and extreme returns.
Related to the week-by-week performance of the E-GARCH portfolio and given a beta of 0.9315 with the SP500, the portfolio active trading strategy (the algorithm) made 168.48% of the 324.43% accumulated return. The return left was due to market movements.
The impact of stock trading fees was 25.97% and the one of VAT was 2.59%. Similar to the previous scenarios, the trade-off between the active accumulated return (169.48%) and the stock trading cost favored the use of our algorithm with an MS-EGARCH model.
With the results summarized in Figure 4 and Table 5, we conclude that the best-performing portfolio in a GED pdf context was the one that used an asymmetric MS-EGARCH model.
Given the above presentation of our results with symmetric pdfs, we now show the ones of the three asymmetric (Fernández–Steel skewed) probability functions.

4.4. Simulation Results of the Six Portfolios That Used Homogeneous Asymmetric Gaussian pdf

In Table 6 and Figure 5, we summarize the performance of the six portfolios that used an asymmetric Gaussian pdf.
As noted, the results are similar to the ones of the symmetric Gaussian scenario, in which the time-fixed MS and the MS-EGARCH portfolios were the best performers. The MS-EGARCH portfolio had an overperformance of 7.28%, a result explained with a weekly mean overperformance of USD 5.25. This average overperformance was considerably lower than the one observed in the symmetric Gaussian pdf scenario. In addition, the accumulated return of 7.28% was lower than the 33.52% paid by the symmetric Gaussian MS-EGARCH portfolio.
Figure 5 and the beta value of this MS-EGARCH portfolio (Table 6) show that this portfolio had a performance close to the SP500. Given this, the use of an asymmetric Gaussian pdf did not add value to our trading strategy compared with the symmetric Gaussian case.
Departing from this result, the use of MS-EGARCH models with asymmetric Gaussian pdfs was the best option in this scenario, but still, using an asymmetric Gaussian pdf was not better than using a symmetric one.

4.5. Simulation Results of the Six Portfolios That Used Homogeneous Asymmetric Student’s t pdf

In Table 7 and Figure 6, we present the portfolios’ performances that used an asymmetric Student’s t pdf. As noted in Table 7, all the simulated portfolios showed underperformance—an underperformance that held in the short-term (in the last weeks only).
Despite this, two portfolios showed an important overperformance against the SP500. These are the portfolio that used a time-fixed variance MS mode and the asymmetric GJR-GARCH one. From these two, the latter is the one that showed a significantly better performance than the SP500 by having a higher value than this index in 73.30% of the simulated weeks and a weekly mean overperformance of USD 28.21 (the highest observed one in these portfolios). As noted with the 0.6855 SP500 beta value and the 48.15% Jensen’s alpha, this portfolio added 48.14% of active return given the use of the trading algorithm with asymmetric Student’s t pdf and an MS-GJRGARCH model. As in the previous scenarios, 48.14% of the 162.91% of accumulated return was due to the algorithm’s timing, given the forecast regime-specific probabilities ξ s , t + 1 .
As is the case of the four previous pdf scenarios, the impact of stock trading fees and taxes was marginal (21.22% and 2.12%, respectively).

4.6. Simulation Results of the Six Portfolios That Used Homogeneous Asymmetric GED pdf

Finally, we present the results of the six simulated portfolios that used an asymmetric GED pdf. In Table 8 and Figure 7, we summarize the results. Only the portfolios that used a time-fixed variance (MS) or a GJR-GARCH one led to an overperformance against the SP500. In the MS portfolio, we found a 26.51% extra return from the SP500 and, in the GJR-GARCH, an extra return of 71.07%. The former had a higher value than the SP500 in 74.30% of the weeks from these two simulated portfolios, while the latter, had a higher value of the SP500 in 73.30% of the weeks. The trading algorithm with these pdfs and variance models led to a mean overperformance, against the SP500, of USD 18.82 and USD 28.21, respectively.
By inspecting the historical performance of these two portfolios in Figure 7, the MS model had an important overperformance in most simulation periods. The benefits of the GJR-GARCH one could be seen only at the end of our simulations. Given this and despite the mean overperformance of the GJR-GARCH portfolio, we prefer to consider the time-fixed variance MS model as the best one in the asymmetric GED scenario.

4.7. Corollary of Results of the Six Simulated pdf Scenarios

In Table 9 and Figure 8, we summarize the six best-performing portfolios of each of the previous pdf-specific analyses. By following the last analysis, we found that the best-performing variance model and pdf for the LLF and regime-specific probabilities ( ξ s , t ) was the one with symmetric GED pdf and an E-GARCH variance, that is, to use a GED MS-EGARCH to forecast the regime-specific probabilities ( ξ s , t + 1 ).
These results could help an institutional investor, such as an ETF or a mutual fund, to perform an active portfolio strategy to buy the SP500 index in calm periods (s = 1) and sell it in crisis or distress ( s = 2 ).
Using the suggested algorithm with a GED MS-EGARCH, an investor could have a mean weekly USD 41.51 value above the SP500 because their fund would be above this index in 72.85% of the weeks. This result is due to proper timing in the trading signals given with the algorithm and is marked by the green line in Figure 8.
Another best-performing MS model was the time-fixed variance MS-GED model (pink line in Figure 8). Despite its good performance most of the time, the time-fixed variance led this simulated algorithm to invest in TBILLs more often than the GED MS-EGARCH one, which is an issue that did not happen with the GED MS-EGARCH portfolio. This last portfolio correctly identified the beginning of high-volatility periods with adverse return movements (given the leverage effect of the negative returns in the EGARCH variance model). It reinvested its proceeding in the SP500 when the variance was lower. These trading decisions led this portfolio to lose some of the SP500 price recoveries identified as “high-volatility” periods. Figure 8 highlights the weeks in which the symmetric GED-MSEGARCH model led to more precise trading signs than the asymmetric GED-MS one.
Given these results, the best combination of pdf and variance for active trading in the SP500 with the suggested algorithm was the one that used a symmetric fat-tailed GED pdf and an asymmetric variance model such as the E-GARCH.
Furthermore, as mentioned in Section 4.3, the impact of stock trading fees and taxes was marginal (21.46% and 2.14%, respectively) in the accumulated return.
In terms of alpha generation, we found that using the MS-EGARCH model led to 168.48% of the 324.43% of accumulated return. In total, 51.93% of that accumulated return was due to the trading signs of the suggested MS-EGARCH algorithm; the other 48.06% was due to market movements.

4.8. The Performance of the Simulated Portfolios in Extraordinary High-Volatility Periods

There is a particular feature that we mention in the above review that we want to briefly highlight in this subsection, i.e., the performance of the best-performing portfolios in each of the six pdf or log-likelihood function (LLF) scenarios. Reviewing Figure 3, Figure 4, Figure 5, Figure 6, Figure 7 and Figure 8, it can be noted that the simulated algorithm worked appropriately in almost all the high-volatility periods. In periods such as the 2007–2008 sub-prime crisis, it can be observed that the algorithm made an accurate forecast of the distress period. The best-performing portfolio (with an asymmetric GED MS-EGARCH model) sold the risky asset (the SP500 fund) and avoided this crisis episode correctly.
Despite this timing improvement, the algorithm, given its parameters, has two drawbacks. First, there are stock market downward movements with a volatility level (lower than previous regimes, such as the 2013 European debt crisis); given this, there is a possibility that the MS-GARCH scale-only estimation method cannot prevent downward trends. Second, we assumed a two-regime context for the algorithm; departing from this assumption, extreme volatility episodes (such as the 2020 COVID-19 crisis) can be forecast with lags. That is, the two-regime MS-GARCH model could trigger a sell signal once the high-volatility regime starts and not before that moment.
Despite these two drawbacks, the algorithm is still helpful for the active trading purposes tested herein. As a potential guideline for further research, we could suggest using a three-regime context or even using a sequential regime and market trend algorithm, such as the one by Hauptman et al. [34] or Engel et al. [35]. In addition, the use of other MS-GARCH estimation methods with neural networks (such as in Liao, Yamaka and Sriboonchitta [43]) could be a potential solution.

4.9. Feasibility in Terms of Algorithm Execution and Implementation

The previous results show how useful MS-GARCH models would be in forecasting changes in US stock market regimes. As mentioned previously, these regimes are a proxy of stock market agents’ behavior and their accurate forecast at t + 1 could give an advantage to investors to buy (sell) a stock market portfolio (such as the SP500) in forecast low- (or high-) volatility periods.
A final practical question remains, i.e., is it feasible for an institutional or private investor to implement our simulation algorithm? The answer is yes. We made our simulations on a Mac Pro with a six-core 3.5 GHz Intel Xeon E6 processor, 18 GB of RAM and an AMD Fire pro D500 3G graphic processor. In the macOS Catalina operative system, we used Ardia et al.’s [76] MSGARCH library in R.
The library and the R programming language are licensed under the creative commons license for almost all the operative systems. Such software can be installed in a server with Devian for public access on an intranet or a cloud service.
To store all the data of each model in each simulation, we used an SQLite file. In one data table, we stored the historical SP500 price data and, in another one, the results of our MS-GARCH model estimations. In a third table, we simulated the performance of the 36 portfolios of interest. We used the MariaDB file to have faster access to all the backtest.
The estimation of each of the 36 MS-GARCH models had a mean duration of 41.54 s each week. The two models that took longer in their estimate were the symmetric GED MS-GJRGARCH and MS-TGARCH models in the last week of our simulations (4863 weeks of historical data in the information set). We estimated the former in 76.43 s and the latter in 76.79 s. In Appendix A, we present, in detail, the estimation times of each of the 36 models during our simulations. It is essential to mention that these estimation times include other data analysis processes, such as estimating the continuous-time returns of the SP500.
If an analyst wanted to estimate the 36 models, she or he would need, at most, only 38.16 min at the end of each week. They would also need 3 min, at most, to determine the best fitting MS-GARCH model and to obtain a final trading decision.
It is essential to mention that the estimation times depend on the computer capabilities and the default settings used, such as the number of MCMC paths estimated (10,000) or the value of the starting seed for the estimation methods. Despite this warning, the model can be implemented on a PC or cloud service and even used for algorithmic trading purposes.
We show that it is feasible to implement our suggested trading algorithm in daily or even intraday periods from these simulation times. Despite these research recommendations, we suggest extending our tests to intraday periods as guidelines for further research. It is important to note that the use of MS-GARCH, the number of regimes and their behavior could change in smaller periods than daily or weekly.

5. Conclusions

The use of Markov-switching with generalized autoregressive conditional heteroskedasticity (MS-GARCH) models in stock trading algorithms could be a potential solution to enhance the performance of equity funds or ETFs by forecasting the probability ( ξ s = 2 , t + 1 ) of being in a distressing period. With this forecast, an investor could determine if it is appropriate to sell stocks, buy a risk-free asset in distress periods, or do the opposite in calm ones.
This proposal is not a novelty and started with Brooks and Persand [29], who tested the use of time-fixed variance Markov-switching (MS) models as a potential tool to reduce noise and uncertainty in investors’ decisions. Despite this, there has been little discussion about the benefits of such a strategy and similar algorithmic trading applications.
Departing from the behavioral finance rationale that noisy traders tend to create bubbles or crashes due to the use of sentiments in their decisions, a quantitative tool to forecast the market crisis or high-volatility periods is of interest to us.
The present paper extends the literature by testing the benefit of asymmetric probability density functions (pdf) and asymmetric GARCH variance models in a two-regime trading algorithm in the US S&P 500 stock index (SP500).
Our position is that asymmetric models could lead to better trading signs because there are well-documented asymmetries in the performance of stock returns.
With weekly data of the SP500 from 6 January 1928 to 19 March 2021, we simulated (from 2 January 2004 to 19 March 2021) the performance that an institutional investor would have had, had they used a trading algorithm with the following trading rules:
  • To invest in the SP500 if the probability of being in low-volatility, calm or “normal” ( s = 1 ) periods at t + 1 is higher than 50% ( ξ s = 1 , t + 1 > 0.5 ).
  • To invest in the US risk-free asset (TBILL) if the probability of being in high-volatility, distress, or “crisis” ( s = 2 ) periods at t + 1 is higher than 50% ( ξ s = 2 , t + 1 > 0.5 ).
Our position is that the use of either asymmetric pdf or asymmetric GARCH models (such as the EGARCH) could enhance the portfolio’s performance against the SP500 and the portfolios that used either a symmetric pdf or variance model.
We simulated the performance of 36 theoretical portfolios (6 portfolios with different MS-GARCH models for the symmetric or asymmetric Gaussian, Student’s t, or generalized error distribution—GED—pdf). Our results show that the portfolio that used a symmetric GED pdf and an asymmetric EGARCH variance (MS-EGARCH) model performed best.
From the 36 simulated portfolios, this was the one that outperformed the SP500 most of the time (72.85% of the time). This result led to a weekly mean overperformance of USD 41.52 (from a USD 100 base value) above this index. Given this, the simulated portfolio paid an accumulated return of 324.43% (157.01% more than the SP500). From this accumulated return, 168.48% was due to the proper timing in the trading decisions (buy or sell the SP500). In a trading costs–performance trade-off analysis, we found that using weekly rebalancing led to a 25.97% impact due to stock trading fees and a 2.59% impact due to taxes.
Our results, obtained by testing, contribute to the discussion about the benefits of using MS-GARCH models in trading algorithms by showing that the best combination of pdf and variance model for trading US stocks is to use a symmetric GED pdf and an E-GARCH variance model in the Markov-switching model. This last model with this configuration led to more precise forecasts of the regime-specific probabilities ( ξ s , t + 1 ). These forecasts allowed us to determine the probability of being in a high-volatility or distress regime at t + 1 . Given these forecasts, the simulated trading algorithm led to better trading signs and better performance than a buy-and-hold strategy in the SP500 index.
In a theoretical financial economics context, our results add to the discussion about the balance of informed and noisy traders in the markets. An issue in the current behavioral financial economics testing is that market crashes or bubble episodes are ascribed to the not-so-rational behavior of noisy traders. Similar to the one tested herein, an MS-GARCH trading algorithm could be helpful to sort the changes in volatility regimes, due to market sentiment change, in the financial market.
Institutional investors such as mutual funds or exchange-traded funds could use an algorithm such as the one tested herein by knowing that a symmetric, fat-tailed and polynomial GED log-likelihood function (LLF) with an asymmetric E-GARCH variance model is the best MS-GARCH model for investment decisions. The fat-tailed pdf could incorporate the odds of having extreme values in each regime. The E-GARCH, as noted in our results, could help enhance the timing of selling the SP500 in distress periods and repurchase it with a proper low-volatility regime forecast at t + 1 . The leverage effect (a higher weight of negative returns) of the E-GARCH variance in each regime enhanced the prediction power of the MS-EGARCH model.
Our results are part of several tests to enhance Markov-switching models and the trading algorithms with these. Despite this, we believe there is room to extend our results. First, we suggest repeating our tests of the 36 simulated portfolios and comparing their results with MS-GARCH models with heterogeneous pdf in the LLF and heterogeneous variance (time-fixed or GARCH) models, using different pdf and GARCH models in each regime and not homogeneous ones, as we show here. This guideline is hard in computational terms because of the number of combinations of symmetric or asymmetric pdf and GARCH variances. This guideline implies the extension of using either symmetric or asymmetric pdfs and variance models.
Another extension of our tests would be using other assets in the high-volatility regime, such as volatility futures, another type of negatively related security, or even the performance of short selling.
In addition, to test the use of MS-GARCH models with three or more regimes could be of interest in terms of financial econometrics, active portfolio trading, algorithmic trading and investment management.
The use of other periodicities in the test (such as daily or even intraday ones) or other estimation methods different from Markov chain Monte Carlo (MCMC) could be of interest. Some suggestions could be the use of neural networks [43] or other deep learning techniques.

Author Contributions

Conceptualization, data gathering, simulations, numerical tests, methodology, formal analysis, investigation, writing—original draft preparation, review and editing, O.V.D.l.T.-T., D.A.-M. and J.Á.-G. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the Coordinación de la Investigación Científica (Convocatoria-CIC: 23-2021) at Universidad Michoacana de San Nicolás de Hidalgo, Morelia, Michoacán, México and by the Consejo Nacional de Ciencia y Tecnología (CVU: 265225).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The simulation and test results presented in this study are available on request to the corresponding author. The input data used herein are not publicly available, given the financial database user agreement restrictions. The input data presented herein can be found on public financial websites.

Conflicts of Interest

The authors declare no conflict of interest in the tests and results presented herein. The funders had no role in the study’s design; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or in the decision to publish the results.

Appendix A

In this appendix, we summarize the estimation times of the 36 MS-GARCH models. This appendix supports the conclusions written in Section 4.7, “Feasibility in terms of algorithm execution and implementation”. As mentioned in that subsection, the average estimation time was 41.54 s per model. This average estimation time led to an estimation period of 38.16 min, at most, in the 36 MS-GARCH models.
The following six tables summarize the length (in weeks) of the information set used to estimate the MS-GARCH model. The second column presents the smallest size of the information set (number of weeks) used to estimate the MS or MS-GARCH model. For all the portfolios, we started with 3757 weeks and used a final length of 4863 weeks (sixth column). We show the lowest and highest length estimation time (in seconds) in the third and seventh columns. We offer how many seconds the computer used to estimate the entire simulation’s first and last week. In the fifth column, we estimate the mean estimation time of each portfolio’s simulated dates.
Each table corresponds to each of the symmetric or asymmetric pdfs used. Therefore, each shows the estimations in each simulated portfolio, according to the records in our SQLite database. These records are part of the outputs estimated with our simulation algorithm.
Table A1 shows the estimation times of the MS and MS-GARCH with symmetric homogeneous Gaussian pdf. In Table A2, we present the symmetric homogeneous Student’s t pdf results and the symmetric GED ones in Table A3.
Table A1. Estimation times of the simulated portfolios with symmetric homogeneous Gaussian log-likelihood function.
Table A1. Estimation times of the simulated portfolios with symmetric homogeneous Gaussian log-likelihood function.
Ticker of Simulates PortfolioSmallest Length (Weeks)Lowest Length Estimation Time (Seconds)Mean Estimation Time (Seconds)Highest Length (Weeks)Longest Length Estimation TimeProportion
Highest/Lowest
MS-Gaussian375743.7245.88486352.031.190
MSARCH-Gaussian375739.5845.68486351.931.312
MSGARCH-Gaussian375738.6243.78486347.031.218
MSEGARCH-Gaussian375743.8747.32486363.310.024
MSGJRGARCH-Gaussian375738.0743.63486365.320.029
MSTGARCH-Gaussian375736.6342.56486368.040.031
Table A2. Estimation times of the simulated portfolios with symmetric homogeneous Student’s t log-likelihood function.
Table A2. Estimation times of the simulated portfolios with symmetric homogeneous Student’s t log-likelihood function.
Ticker of Simulates PortfolioSmallest Length (Weeks)Lowest Length Estimation Time (Seconds)Mean Estimation Time (Seconds)Highest Length (Weeks)Longest Length Estimation TimeProportion
Highest/Lowest
MS-tStud375742.3848.60486355.131.301
MSARCH-tStud375741.9948.40486354.311.293
MSGARCH-tStud375741.7246.60486351.131.225
MSEGARCH-tStud375743.2833.73486373.540.028
MSGJRGARCH-tStud375741.7842.55486366.330.026
MSTGARCH-tStud375742.2240.41486372.770.029
Table A3. Estimation times of the simulated portfolios with symmetric homogeneous GED log-likelihood function.
Table A3. Estimation times of the simulated portfolios with symmetric homogeneous GED log-likelihood function.
Ticker of Simulated PortfolioSmallest Length (Weeks)Lowest Length Estimation Time (Seconds)Mean Estimation Time (Seconds)Highest Length (Weeks)Longest Length Estimation TimeProportion
Highest/Lowest
MS-GED375747.4450.86486362.480.022
MSARCH-GED37572.0146.43486361.710.510
MSGARCH-GED375757.5551.09486359.891.041
MSEGARCH-GED375749.4520.13486376.440.026
MSGJRGARCH-GED375746.1829.67486376.430.028
MSTGARCH-GED375746.6825.84486379.790.028
Table A1 shows that, on average, the estimation of the MS-EGARCH model was the one that took the longest time and MS-TGARCH the one that took the shortest time.
For the Student’s t log-likelihood function (LLF) case (Table A2), the time-fixed variance (MS-tStud) and the MS-GARCH models were the ones with the longest mean estimation period and MS-EGARCH the one with the lowest mean estimation time value.
In the case of the symmetric GED LLF (Table A3), the symmetric MS-GARCH model had the highest estimation period value, while MS-EGARCH was the opposite case.
The last column of these three tables shows that only the symmetric ARCH or GARCH variance models had a significant estimation time increase from the first simulation date to the last one. An interesting finding of the asymmetric GARCH models is that there was no considerable time increase in their estimation if the time series was longer. This result is in line with the conclusions by Ardia et al. [76]. These authors showed, in their results, that the mean estimation period of MS-GARCH models with the MCMC had a marginal increase if the information set (time series for estimation) became longer.
In Table A4, Table A5 and Table A6, we show the estimation times of the asymmetric LLFs. We offer the results for the asymmetric Gaussian, Student’s t and GED LLF, respectively. In the asymmetric Gaussian LLF set, we found that the MS-ARCH model had the longest mean estimation time and MS-EGARCH the shortest one. In the Student’s t set, the MS-GARCH model was the one with the longest estimation period and, again, the MS-EGARCH was the one with the shortest estimation period. Finally, in the GED set, the MS-EGARCH and the MS-ARCH had the longest and shortest estimation intervals, respectively.
Table A4. Estimation times of the simulated portfolios with homogeneous asymmetric Gaussian log-likelihood function.
Table A4. Estimation times of the simulated portfolios with homogeneous asymmetric Gaussian log-likelihood function.
Ticker of Simulated PortfolioSmallest Length (Weeks)Lowest Length Estimation Time (Seconds)Mean Estimation Time (Seconds)Highest Length (Weeks)Longest Length Estimation TimeProportion
Highest/Lowest
MS-AsymGauss375746.6052.86486360.100.021
MSARCH-AsymGauss375746.3852.93486358.451.260
MSGARCH-AsymGauss375742.4550.69486358.771.385
MSEGARCH-asimGauss375742.8347.41486361.390.024
MSGJRGARCH-asimGauss375738.2448.61486360.910.027
MSTGARCH-asimGauss375739.6749.11486357.371.446
Table A5. Estimation times of the simulated portfolios with homogeneous asymmetric Student’s t log-likelihood function.
Table A5. Estimation times of the simulated portfolios with homogeneous asymmetric Student’s t log-likelihood function.
Ticker of Simulated PortfolioSmallest Length (Weeks)Lowest Length Estimation Time (Seconds)Mean Estimation Time (Seconds)Highest Length (Weeks)Longest Length Estimation TimeProportion
Highest/Lowest
MS-AsimtStud375748.5447.93486361.220.021
MSARCH-AsimtStud375747.8349.57486361.280.021
MSGARCH-AsimtStud375745.5152.44486360.240.022
MSEGARCH-asimtStud375746.7042.96486365.590.023
MSGJRGARCH-asimtStud375742.4649.95486357.871.363
MSTGARCH-asimtStud375739.8847.47486361.950.026
Table A6. Estimation times of the simulated portfolios with homogeneous asymmetric GED log-likelihood function.
Table A6. Estimation times of the simulated portfolios with homogeneous asymmetric GED log-likelihood function.
Ticker of Simulated PortfolioSmallest Length (Weeks)Lowest Length Estimation Time (Seconds)Mean Estimation Time (Seconds)Highest Length (Weeks)Longest Length Estimation TimeProportion
Highest/Lowest
MS-asimGED375754.3319.601486369.4230.021
MSARCH-asimGED375754.6618.992486369.1590.021
MSGARCH-asimGED375752.8726.508486366.5350.021
MSEGARCH-asimGED375751.6622.470486374.8490.024
MSGJRGARCH-asimGED375747.4731.022486373.3920.026
MSTGARCH-asimGED375748.7431.933486373.9600.025
To strengthen our review, we summarize the shortest, mean and longest estimation times of the 36 simulated portfolios in Table A7. In the first column, we present the shortest estimation time observed on the first date of our simulations—a date in which the dataset had its shortest value (3757 weeks). As noted, the model with the shortest estimation time was the asymmetric Gaussian LLF model with MS-GJRGARCH variance (Table A4), with 38.24 s. In the second and third columns, we summarize the mean and standard deviation of the mean estimation values of the six previous tables. The fourth and fifth columns show the 2.5% and 97.5% quantiles (with 95% confidence level) of those mean estimation time values. Finally, the last column shows the highest estimation period observed in our simulation, more specifically, the MS-TGARCH with symmetric GED LLF (Table A3). On the last date of our simulations, this model took 4863 weeks, a 79.79 s estimation.
Table A7. Estimation times’ summary table.
Table A7. Estimation times’ summary table.
Lowest EstimationMean EstimationStd. Dev.Quantile 2.5%Quantile 9.75%Longest Estimation
38.2441.54810.57219.52552.87079.79
As noted in the last column, each of the 36 simulated MS-GARCH models required 76.79 s in the worst scenario, i.e., a total of 46.07 min (2764.4 s) at the end of each week. With this result, we believe that the algorithm of interest can be implemented practically with a private or institutional investor’s minimal investment in technology (hardware and software).

References

  1. Fama, E.F. The Behavior of Stock-Market Prices. J. Bus. 1965, 38, 34–105. [Google Scholar] [CrossRef]
  2. Black, F. Noise. J. Financ. 1986, 41, 529–543. [Google Scholar] [CrossRef]
  3. Fama, E.F.; French, K.R. Multifactor Explanations of Asset Pricing Anomalies. J. Financ. 1996, 51, 55–84. [Google Scholar] [CrossRef]
  4. Fama, E.F.; French, K.R. Common Risk Factors in the Returns on Stocks and Bonds. J. Financ. Econ. 1992, 33, 3–56. [Google Scholar] [CrossRef]
  5. Carhart, M.M. On Persistence in Mutual Fund Performance. J. Financ. 1997, 52, 57–82. [Google Scholar] [CrossRef]
  6. Sharpe, W.F. Capital Asset Prices: A Theory of Market Equilibrium under Conditions of Risk. J. Financ. 1964, 19, 425–442. [Google Scholar]
  7. Lintner, J. The Valuation of Risk Assets and the Selection of Risky Investments in Stock Portfolios and Capital Budgets. Rev. Econ. Stat. 1965, 47, 13–37. [Google Scholar] [CrossRef]
  8. Mehra, R.; Prescott, E.C. The Equity Premium: A Puzzle. J. Monet. Econ. 1985, 15, 145–161. [Google Scholar] [CrossRef]
  9. Klein, A.C. Time-Variations in Herding Behavior: Evidence from a Markov Switching SUR Model. J. Int. Financ. Mark. Inst. Money 2013, 26, 291–304. [Google Scholar] [CrossRef]
  10. Ardia, D.; Hoogerheide, L.F. GARCH Models for Daily Stock Returns: Impact of Estimation Frequency on Value-at-Risk and Expected Shortfall Forecasts. Econ. Lett. 2014, 123, 187–190. [Google Scholar] [CrossRef] [Green Version]
  11. Wu, J.-T. Markov Regimes Switching with Monetary Fundamental-Based Exchange Rate Model. Asia Pac. Manag. Rev. 2015, 20, 79–89. [Google Scholar] [CrossRef]
  12. Basher, S.A.; Haug, A.A.; Sadorsky, P. The Impact of Oil Shocks on Exchange Rates: A Markov-Switching Approach. Energy Econ. 2016, 54, 11–23. [Google Scholar] [CrossRef] [Green Version]
  13. Mejía-Reyes, P. Asymmetries and Common Cycles in Latin America: Evidence from Markov-Switching Models. Econ. Mexic. Nueva Época 2000, IX, 189–225. [Google Scholar]
  14. Wu, P.-C.; Liu, S.-Y.; Chen, C.-Y. Re-Examining Risk Premiums in the Fama–French Model: The Role of Investor Sentiment. N. Am. J. Econ. Financ. 2016, 36, 154–171. [Google Scholar] [CrossRef]
  15. Durand, R.B.; Lim, D.; Zumwalt, J.K. Fear and the Fama-French Factors. Financ. Manag. 2011, 40, 409–426. [Google Scholar] [CrossRef]
  16. Wolff, A.F. Investor Sentiment and Stock Prices in the Subprime Mortgage Crisis. Appl. Financ. Econ. 2013, 23, 1301–1309. [Google Scholar] [CrossRef]
  17. Zheng, Y. The Linkage between Aggregate Stock Market Investor Sentiment and Commodity Futures Returns. Appl. Financ. Econ. 2014, 24, 1491–1513. [Google Scholar] [CrossRef]
  18. Smales, L.A. Time-Varying Relationship of News Sentiment, Implied Volatility and Stock Returns. Appl. Econ. 2016, 48, 4942–4960. [Google Scholar] [CrossRef] [Green Version]
  19. Smales, L.A. The Role of Political Uncertainty in Australian Financial Markets. Account. Financ. 2016, 56, 545–575. [Google Scholar] [CrossRef]
  20. Uhl, M.W. Reuters Sentiment and Stock Returns. J. Behav. Financ. 2014, 15, 287–298. [Google Scholar] [CrossRef] [Green Version]
  21. Griffith, J.; Najand, M.; Shen, J. Emotions in the Stock Market. J. Behav. Financ. 2020, 21, 42–56. [Google Scholar] [CrossRef]
  22. Hamilton, J.D. A New Approach to the Economic Analysis of Nonstationary Time Series and the Business Cycle. Econometrica 1989, 57, 357–384. [Google Scholar] [CrossRef]
  23. Hamilton, J.D. Analysis of Time Series Subject to Changes in Regime. J. Econom. 1990, 45, 39–70. [Google Scholar] [CrossRef]
  24. Hamilton, J.D.; Lin, G. Stock Market Volatility and the Business Cycle. J. Appl. Econom. 1996, 11, 573–593. [Google Scholar] [CrossRef]
  25. Camacho, M.; Perez-Quiros, G. Commodity Prices and the Business Cycle in Latin America: Living and Dying by Commodities? Emerg. Mark. Financ. Trade 2014, 50, 110–137. [Google Scholar] [CrossRef]
  26. Humala, A. Interest Rate Pass-through and Financial Crises: Do Switching Regimes Matter? The Case of Argentina. Appl. Financ. Econ. 2005, 15, 77–94. [Google Scholar] [CrossRef]
  27. Dufrénot, G.; Keddad, B. Business Cycles Synchronization in East Asia: A Markov-Switching Approach. Econ. Model. 2014, 42, 186–197. [Google Scholar] [CrossRef] [Green Version]
  28. Walid, C.; Chaker, A.; Masood, O.; Fry, J. Stock Market Volatility and Exchange Rates in Emerging Countries: A Markov-State Switching Approach. Emerg. Mark. Rev. 2011, 12, 272–292. [Google Scholar] [CrossRef]
  29. Sosa, M.; Ortiz, E.; Cabello, A. Dynamic Linkages between Stock Market and Exchange Rate in Mila Countries: A Markov Regime Switching Approach (2003–2016). Análisis Económico 2018, 33, 57–74. [Google Scholar] [CrossRef] [Green Version]
  30. Cabrera, G.; Coronado, S.; Rojas, O.; Venegas-Martínez, F. Synchronization and Changes in Volatilities in the Latin American’s Stock Exchange Markets. Int. J. Pure Appl. Math. 2017, 114, 113–132. [Google Scholar] [CrossRef]
  31. Rotta, P.N.; Valls Pereira, P.L. Analysis of Contagion from the Dynamic Conditional Correlation Model with Markov Regime Switching. Appl. Econ. 2016, 48, 2367–2382. [Google Scholar] [CrossRef]
  32. Riedel, C.; Thuraisamy, K.S.; Wagner, N. Credit Cycle Dependent Spread Determinants in Emerging Sovereign Debt Markets. Emerg. Mark. Rev. 2013, 17, 209–223. [Google Scholar] [CrossRef]
  33. Brooks, C.; Persand, G. The Trading Profitability of Forecasts of the Gilt–Equity Yield Ratio. Int. J. Forecast. 2001, 17, 11–29. [Google Scholar] [CrossRef] [Green Version]
  34. Hauptmann, J.; Hoppenkamps, A.; Min, A.; Ramsauer, F.; Zagst, R. Forecasting Market Turbulence Using Regime-Switching Models. Financ. Mark. Portf. Manag. 2014, 28, 139–164. [Google Scholar] [CrossRef]
  35. Engel, J.; Wahl, M.; Zagst, R. Forecasting Turbulence in the Asian and European Stock Market Using Regime-Switching Models. Quant. Financ. Econ. 2018, 2, 388–406. [Google Scholar] [CrossRef]
  36. de la Torre-Torres, O.V.; Galeana-Figueroa, E.; Álvarez-García, J. A Test of Using Markov-Switching GARCH Models in Oil and Natural Gas Trading. Energies 2019, 13, 129. [Google Scholar] [CrossRef] [Green Version]
  37. de la Torre-Torres, O.V.; Aguilasocho-Montoya, D.; del Río-Rama, M.D.L.C. A Two-Regime Markov-Switching GARCH Active Trading Algorithm for Coffee, Cocoa, and Sugar Futures. Mathematics 2020, 8, 1001. [Google Scholar] [CrossRef]
  38. de la Torre-Torres, O.V.; Venegas-Martínez, F.; Martínez-Torre-Enciso, M.I. Enhancing Portfolio Performance and VIX Futures Trading Timing with Markov-Switching GARCH Models. Mathematics 2021, 9, 185. [Google Scholar] [CrossRef]
  39. de la Torre-Torres, O.V.; Galeana-Figueroa, E.; Álvarez-García, J. A Markov-Switching VSTOXX Trading Algorithm for Enhancing EUR Stock Portfolio Performance. Mathematics 2021, 9, 1030. [Google Scholar] [CrossRef]
  40. Zakoian, J.-M. Threshold Heteroskedastic Models. J. Econ. Dyn. Control 1994, 18, 931–955. [Google Scholar] [CrossRef]
  41. Glosten, L.R.; Jaganathan, R.; Runkle, D.E. On the Relation between the Expected Value and the Volatility of the Nominal Excess Return on Stocks. J. Financ. 1993, 48, 1779–1801. [Google Scholar] [CrossRef]
  42. Nelson, D.B. Conditional Heteroskedasticity in Asset Returns: A New Approach. Econometrica 1991, 59, 347. [Google Scholar] [CrossRef]
  43. Liao, R.; Yamaka, W.; Sriboonchitta, S. Exchange Rate Volatility Forecasting by Hybrid Neural Network Markov Switching Beta-t-EGARCH. IEEE Access 2020, 8, 207563–207574. [Google Scholar] [CrossRef]
  44. Ardia, D. Financial Risk Management with Bayesian Estimation of GARCH Models; Springer: Berlin/Heidelberg, Germany, 2008; Volume 612. [Google Scholar]
  45. Ardia, D.; Bluteau, K.; Rüede, M. Regime Changes in Bitcoin GARCH Volatility Dynamics. Financ. Res. Lett. 2018, 29, 266–271. [Google Scholar] [CrossRef]
  46. Ardia, D.; Bluteau, K.; Boudt, K.; Catania, L. Forecasting Risk with Markov-Switching GARCH Models:A Large-Scale Performance Study. Int. J. Forecast. 2018, 34, 733–747. [Google Scholar] [CrossRef]
  47. Kim, C.-J.; Nelson, C.R. Business Cycle Turning Points, a New Coincidetn Index, and Test of Duration Dependence Based on a Dynamic Fator Model with Regime Switching. Rev. Econ. Stat. 1998, 80, 188–201. [Google Scholar] [CrossRef]
  48. Kaufmann, S. Measuring Business Cycles with a Dynamic Markov Switching Factor Model: An Assessment Using Bayesian Simulation Methods. Econom. J. 2000, 3, 39–65. [Google Scholar] [CrossRef]
  49. Billio, M.; Casarin, R.; Ravazzolo, F.; Van Dijk, H.K. Interconnections Between Eurozone and Us Booms and Busts Using a Bayesian Panel Markov-Switching VAR Model. J. Appl. Econom. 2016, 31, 1352–1370. [Google Scholar] [CrossRef] [Green Version]
  50. Leonhardt, D.; Ware, A.; Zagst, R. A Cointegrated Regime-Switching Model Approach with Jumps Applied to Natural Gas Futures Prices. Risks 2017, 5, 48. [Google Scholar] [CrossRef] [Green Version]
  51. Droumaguet, M.; Warne, A.; Woźniak, T. Granger Causality and Regime Inference in Markov Switching VAR Models with Bayesian Methods. J. Appl. Econom. 2017, 32, 802–818. [Google Scholar] [CrossRef]
  52. Parikakis, G.S.; Merika, A. Evaluating Volatility Dynamics and the Forecasting Ability of Markov Switching Models. J. Forecast. 2009, 28, 736–744. [Google Scholar] [CrossRef]
  53. Kutty, G. The Relationship Between Exchange Rates and Stock Prices: The Case of Mexico. N. Am. J. Financ. Bank. Res. 2010, 4, 1–12. [Google Scholar]
  54. Chkili, W.; Nguyen, D.K. Exchange Rate Movements and Stock Market Returns in a Regime-Switching Environment: Evidence for BRICS Countries. Res. Int. Bus. Financ. 2014, 31, 46–56. [Google Scholar] [CrossRef]
  55. Mandilaras, A.; Bird, G. A Markov Switching Analysis of Contagion in the EMS. J. Int. Money Financ. 2010, 29, 1062–1075. [Google Scholar] [CrossRef] [Green Version]
  56. Balcilar, M.; Ozdemir, Z.A. The Causal Nexus between Oil Prices and Equity Market in the US: A Regime Switching Model. Energy Econ. 2013, 39, 271–282. [Google Scholar] [CrossRef]
  57. Balcilar, M.; Demirer, R.; Hammoudeh, S. Investor Herds and Regime-Switching: Evidence from Gulf Arab Stock Markets. J. Int. Financ. Mark. Inst. Money 2013, 23, 295–321. [Google Scholar] [CrossRef]
  58. Balcilar, M.; van Eyden, R.; Uwilingiye, J.; Gupta, R. The Impact of Oil Price on South African GDP Growth: A Bayesian Markov Switching-VAR Analysis. Afr. Dev. Rev. 2017, 29, 319–336. [Google Scholar] [CrossRef]
  59. Metropolis, N.; Rosenbluth, A.W.; Rosenbluth, M.N.; Teller, A.H.; Teller, E. Equation of State Calculations by Fast Computing Machines. J. Chem. Phys. 1953, 21, 1087–1092. [Google Scholar] [CrossRef] [Green Version]
  60. Kim, C.-J. Dynamic Linear Models with Markov-Switching. J. Econom. 1994, 60, 1–22. [Google Scholar] [CrossRef]
  61. Hamilton, J.D.; Susmel, R. Autorregresive Conditional Heteroskedasticity and Changes in Regime. J. Econom. 1994, 64, 307–333. [Google Scholar] [CrossRef]
  62. Haas, M.; Mittnik, S.; Paolella, M.S. Mixed Normal Conditional Heteroskedasticity. J. Financ. Econom. 2004, 2, 211–250. [Google Scholar] [CrossRef]
  63. Haas, M.; Mittnik, S.; Paolella, M.S. A New Approach to Markov-Switching GARCH Models. J. Financ. Econom. 2004, 2, 493–530. [Google Scholar] [CrossRef]
  64. Ardia, D.; Kolly, J.; Trottier, D.-A. The Impact of Parameter and Model Uncertainty on Market Risk Predictions from GARCH-Type Models. J. Forecast. 2017, 36, 808–823. [Google Scholar] [CrossRef]
  65. Badea, L.; Armeanu, D.Ş.; Panait, I.; Gherghina, Ş.C. A Markov Regime Switching Approach towards Assessing Resilience of Romanian Collective Investment Undertakings. Sustainability 2019, 11, 1325. [Google Scholar] [CrossRef] [Green Version]
  66. Mwamba, J.W.M.; Mwambi, S.M. Assessing Market Risk in BRICS and Oil Markets: An Application of Markov Switching and Vine Copula. Int. J. Financ. Stud. 2021, 9, 30. [Google Scholar] [CrossRef]
  67. Naik, N.; Mohan, B.R. Stock Price Volatility Estimation Using Regime Switching Technique-Empirical Study on the Indian Stock Market. Mathematics 2021, 9, 1595. [Google Scholar] [CrossRef]
  68. Benavides, D.R.; García, M.Á.M.; Reyes, L.F.H. Incertidumbre Del Precio Internacional Del Petróleo y Rendimientos Accionarios En México a Través de Un SVAR-MGARCH. Contaduría Y Adm. 2019, 64, 119. [Google Scholar] [CrossRef]
  69. Kristjanpoller, W.R.; Minutolo, M.C. A Hybrid Volatility Forecasting Framework Integrating GARCH, Artificial Neural Network, Technical Analysis and Principal Components Analysis. Expert Syst. Appl. 2018, 109, 1–11. [Google Scholar] [CrossRef]
  70. Kristjanpoller, W.R.; Michell, K.V. A Stock Market Risk Forecasting Model through Integration of Switching Regime, ANFIS and GARCH Techniques. Appl. Soft Comput. J. 2018, 67, 106–116. [Google Scholar] [CrossRef]
  71. de la Torre-Torres, O.V.; Galeana-Figueroa, E.; Álvarez-García, J. Markov-Switching Stochastic Processes in an Active Trading Algorithm in the Main Latin-American Stock Markets. Mathematics 2020, 8, 942. [Google Scholar] [CrossRef]
  72. Alexander, C.; Kapraun, J.; Korovilas, D. Trading and Investing in Volatility Products. Financ. Mark. Inst. Instrum. 2015, 24, 313–347. [Google Scholar] [CrossRef]
  73. Alexander, C.; Korovilas, D.; Kapraun, J. Diversification with Volatility Products. J. Int. Money Financ. 2016, 65, 213–235. [Google Scholar] [CrossRef]
  74. Kritzman, M.; Page, S.; Turkington, D. Regime Shifts: Implications for Dynamic Strategies. Financ. Anal. J. 2012, 68, 22–39. [Google Scholar] [CrossRef]
  75. Fernández, C.; Steel, M.F.J. On Bayesian Modeling of Fat Tails and Skewness. J. Am. Stat. Assoc. 1998, 93, 359–371. [Google Scholar] [CrossRef] [Green Version]
  76. Ardia, D.; Bluteau, K.; Boudt, K.; Catania, L.; Trottier, D.-A. Markov–Switching GARCH Models in R: The MSGARCH Package. J. Stat. Softw. 2019, 91, 1–39. [Google Scholar] [CrossRef] [Green Version]
  77. Dempster, A.P.; Laird, N.M.; Rubin, D.B. Maximum Likelihood from Incomplete Data via the EM Algorithm. J. R. Stat. Soc. Ser. B (Methodol.) 1977, 39, 1–38. [Google Scholar] [CrossRef]
  78. Hamilton, J.D. Time Series Analysis; Princeton University Press: Princeton, NJ, USA, 1994. [Google Scholar]
  79. Bollerslev, T. Generalized Autoregressive Conditional Heteroskedasticity. J. Econom. 1986, 31, 307–327. [Google Scholar] [CrossRef] [Green Version]
  80. Sharpe, W.F. Mutual Fund Performance. J. Bus. 1966, 39, 119–138. [Google Scholar] [CrossRef]
  81. Jensen, M.C. The Performance of Mutual Funds in the Period 1945–1964. J. Financ. 1968, 23, 389–416. [Google Scholar] [CrossRef]
  82. Sharpe, W.F. A Simplified Model for Portfolio Analysis. Manag. Sci. 1963, 9, 277–293. [Google Scholar] [CrossRef] [Green Version]
  83. Maggin, J.L.; Tuttle, D.L.; McLeavey, D.W.; Pinto, J.E. Managing Investment Portfolios: A Dynamic Process, 3rd ed.; John Wiley and Sons Inc.: Hoboken, NJ, USA, 2007. [Google Scholar]
Figure 1. The historical performance of the two assets of interest in the simulated portfolios.
Figure 1. The historical performance of the two assets of interest in the simulated portfolios.
Symmetry 13 02346 g001
Figure 2. The historical performance of the 6 simulated portfolios that used a symmetric Student’s t pdf in the MS-GARCH model of our trading algorithm.
Figure 2. The historical performance of the 6 simulated portfolios that used a symmetric Student’s t pdf in the MS-GARCH model of our trading algorithm.
Symmetry 13 02346 g002
Figure 3. The historical performance of six simulated portfolios that used a symmetric Gaussian pdf in the MS-GARCH model of our trading algorithm.
Figure 3. The historical performance of six simulated portfolios that used a symmetric Gaussian pdf in the MS-GARCH model of our trading algorithm.
Symmetry 13 02346 g003
Figure 4. The historical performance of the 6 simulated portfolios that used a symmetric GED pdf in the MS-GARCH model of our trading algorithm.
Figure 4. The historical performance of the 6 simulated portfolios that used a symmetric GED pdf in the MS-GARCH model of our trading algorithm.
Symmetry 13 02346 g004
Figure 5. The historical performance of the 6 simulated portfolios that used an asymmetric Gaussian pdf in the MS-GARCH model of our trading algorithm.
Figure 5. The historical performance of the 6 simulated portfolios that used an asymmetric Gaussian pdf in the MS-GARCH model of our trading algorithm.
Symmetry 13 02346 g005
Figure 6. The historical performance of the 6 simulated portfolios that used an asymmetric Student’s t pdf in the MS-GARCH model of our trading algorithm.
Figure 6. The historical performance of the 6 simulated portfolios that used an asymmetric Student’s t pdf in the MS-GARCH model of our trading algorithm.
Symmetry 13 02346 g006
Figure 7. The historical performance of the 6 simulated portfolios that used an asymmetric GED pdf in the MS-GARCH model of our trading algorithm.
Figure 7. The historical performance of the 6 simulated portfolios that used an asymmetric GED pdf in the MS-GARCH model of our trading algorithm.
Symmetry 13 02346 g007
Figure 8. The historical performance of the 6 best-performing portfolios in each pdf-specific analysis.
Figure 8. The historical performance of the 6 best-performing portfolios in each pdf-specific analysis.
Symmetry 13 02346 g008
Table 1. The RIC, series name, source, currency, ticker and historical datasets of the input data used.
Table 1. The RIC, series name, source, currency, ticker and historical datasets of the input data used.
RICValueSourceCurrencyIdentifier in
Paper
Dates
SPXU.S. S&P 500 stock indexRefinitiv
Eikon
USDSP5006 January 1928/19 March 2021
US3MT = RR3-month U.S. Treasury bill yearly rateRefinitiv
Eikon
USDTBILL1 January 2000/19 March 2021
Table 2. The RIC, series name, source, currency, ticker and historical datasets of the input data used.
Table 2. The RIC, series name, source, currency, ticker and historical datasets of the input data used.
StatisticNMeanSt. Dev.MinPctl (25)Pctl (75)Max
SP5008980.1402.461−20.084−0.8561.40111.424
TBILL8980.0250.0310.0000.0020.0400.103
Table 3. Performance of the six simulated portfolios that used homogeneous symmetric Gaussian marginal pdfs in the MS-GARCH model log-likelihood function.
Table 3. Performance of the six simulated portfolios that used homogeneous symmetric Gaussian marginal pdfs in the MS-GARCH model log-likelihood function.
Portfolio Performance MetricMS-GaussianMSARCH-GaussianMSGARCH-GaussianMSEGARCH-GaussianMSGJRGARCH-GaussianMSTGARCH-Gaussian
Accumulated return151.8748152.6977153.0187204.0816135.2070180.1055
Surplus return from SP500−15.5524−14.7295−14.408536.6544−32.220212.6783
Mean return2.28045.14345.16165.16876.19224.7622
Return’s std. dev.0.038312.327412.137916.408913.822917.3099
Max. drawdown0.0374−13.0180−13.0180−17.7070−13.0180−22.4191
Percentile 2.5%0.0377−3.8952−3.8139−4.9972−4.4029−5.1105
Percentile 97.5%0.05563.15753.13604.13443.62334.2425
Sharpe ratio184.63120.57670.58720.60740.44390.4988
Jensen’s alpha151.874869.323572.157456.633530.236717.3441
Beta with SP50000.49800.48300.88070.62700.9721
R 2 00.49400.47930.87200.62280.9548
Tracking error0.02460.01750.01780.00880.01510.0053
% of weeks above the SP50071.301470.411667.074572.636344.716415.2392
Mean surplus return from the SP50018.837724.210820.311625.86694.64085.0846
Mean overperformance13.431517.047213.623918.78882.07520.7748
Stock fees paid (total ammount)20.304620.722123.420622.583021.074820.1023
Taxes paid (total ammount)2.03052.07222.34212.25832.10752.0102
Table 4. Performance of the six simulated portfolios that used homogeneous symmetric Student’s t marginal pdfs in the MS-GARCH model log-likelihood function.
Table 4. Performance of the six simulated portfolios that used homogeneous symmetric Student’s t marginal pdfs in the MS-GARCH model log-likelihood function.
Portfolio Performance MetricMS-tStudMSARCH-tStudMSGARCH-tStudMSEGARCH-tStudMSGJRGARCH-tStudMSTGARCH-tStud
Accumulated return166.899074.530192.5874200.9519140.2742114.3798
Surplus return from SP500−0.5282−92.8971−74.839833.5247−27.1530−53.0474
Mean return2.28045.46603.10093.64916.13464.8809
Return’s std. dev.0.038311.901511.238316.582914.624815.4110
Max. drawdown0.0374−13.0180−13.0180−22.4191−13.0180−22.4191
Percentile 2.5%0.0377−3.7158−3.7158−4.9211−4.7248−4.4590
Percentile 97.5%0.05563.05272.95083.96753.86993.9527
Sharpe ratio206.47280.23210.33510.59060.43890.3230
Jensen’s alpha166.8990−3.099723.656851.927022.5165−14.6415
Beta with SP50000.46370.41170.89010.70330.7706
R 2 00.45950.40630.87220.70020.7569
Tracking error0.02460.01810.01900.00880.01350.0121
% of weeks above the SP50073.192442.0467072.636331.14575.4505
Mean surplus return from the SP50039.38657.1393026.64424.67801.4422
Mean overperformance28.82793.0018019.35331.45700.0786
Stock fees paid (total ammount)21.462015.785517.686222.511116.837715.7273
Taxes paid (total ammount)2.14621.57851.76862.25111.68381.5727
Table 5. Performance of the six simulated portfolios that used homogeneous symmetric GED marginal pdfs in the MS-GARCH model log-likelihood function.
Table 5. Performance of the six simulated portfolios that used homogeneous symmetric GED marginal pdfs in the MS-GARCH model log-likelihood function.
Portfolio Performance MetricMS-GEDMSARCH-GEDMSGARCH-GEDMSEGARCH-GEDMSGJRGARCH-GEDMSTGARCH-GED
Accumulated return143.7509−8.1618144.7833324.4385144.937360.3122
Surplus return from SP500−23.6763−175.5890−22.6440157.0113−22.4899−107.1150
Mean return2.28044.9609−0.47414.98448.04904.9879
Return’s std. dev.0.038312.160215.363616.902114.416416.7758
Max. drawdown0.0374−13.0180−22.4191−22.4191−13.0180−22.4191
Percentile 2.5%0.0377−3.8952−4.7420−5.1105−4.7248−4.9133
Percentile 97.5%0.05563.11173.24074.14433.95274.1344
Sharpe ratio172.8209−0.15110.43410.98570.46320.1175
Jensen’s alpha143.7509−89.198917.2799168.487430.2932−92.6573
Beta with SP50000.48400.76150.93150.68470.9136
R 2 00.47960.74380.91940.68290.8979
Tracking error0.02460.01780.01250.00700.01390.0079
% of weeks above the SP50070.07791.55731.668572.858712.013337.9310
Mean surplus return from the SP50012.40394.74312.710156.97651.53615.5100
Mean overperformance8.69240.07390.045241.51230.18452.0900
Stock fees paid (total ammount)19.356711.486418.729625.971218.883915.1649
Taxes paid (total ammount)1.93571.14861.87302.59711.88841.5165
Table 6. Performance of the six simulated portfolios that used homogeneous asymmetric Gaussian marginal pdfs in the MS-GARCH model log-likelihood function.
Table 6. Performance of the six simulated portfolios that used homogeneous asymmetric Gaussian marginal pdfs in the MS-GARCH model log-likelihood function.
Portfolio Performance MetricMS-AsymGaussMSARCH-AsymGaussMSGARCH-AsymGaussMSEGARCH-AsimGaussMSGJRGARCH-AsimGaussMSTGARCH-AsimGauss
Accumulated return165.8868138.2622131.9116174.7129143.138170.4097
Surplus return from SP500−1.5404−29.1650−35.51567.2857−24.2891−97.0175
Mean return2.28045.44494.83414.68375.62674.9469
Return’s std. dev.0.038312.253812.241416.588613.987417.4269
Max. drawdown0.0374−13.0180−13.0180−17.7070−13.0180−22.4191
Percentile 2.5%0.0377−3.8139−3.8952−5.1105−4.6889−4.9979
Percentile 97.5%0.05563.13603.15754.13443.64064.2425
Sharpe ratio205.00130.51460.48630.50240.47030.1453
Jensen’s alpha165.886855.908349.763223.834735.7985−94.8680
Beta with SP50000.49190.49070.90120.64110.9872
R 2 00.48780.48630.89340.63600.9714
Tracking error0.02460.01760.01760.00800.01480.0042
% of weeks above the SP50071.968970.300354.616275.08348.12010.3337
Mean surplus return from the SP50025.182916.32907.54546.99840.71450
Mean overperformance18.123911.47934.12105.25460.05800
Stock fees paid (total ammount)20.952019.762421.677721.011520.585616.9013
Taxes paid (total ammount)2.09521.97622.16782.10122.05861.6901
Table 7. Performance of the six simulated portfolios that used homogeneous asymmetric Student’s t marginal pdfs in the MS-GARCH model log-likelihood function.
Table 7. Performance of the six simulated portfolios that used homogeneous asymmetric Student’s t marginal pdfs in the MS-GARCH model log-likelihood function.
Portfolio Performance MetricMS-AsimtStudMSARCH-AsimtStudMSGARCH-AsimtStudMSEGARCH-AsimtStudMSGJRGARCH-AsimtStudMSTGARCH-AsimtStud
Accumulated return137.994197.264563.5761165.0751162.919370.2109
Surplus return from SP500−29.4331−70.1627−103.8511−2.3521−4.5079−97.2163
Mean return2.28044.82783.78272.74005.42795.3824
Return’s Std. dev.0.038311.795310.690516.246714.448715.1295
Max. drawdown0.0374−13.0180−13.0180−17.7070−13.0180−17.7070
Percentile 2.5%0.0377−3.8139−3.5697−5.1105−4.7248−4.8769
Percentile 97.5%0.05563.03142.98704.13183.83873.9527
Sharpe ratio164.45190.34130.20140.48000.53140.1667
Jensen’s alpha137.994121.10450.898120.768448.1425−55.2063
Beta with SP50000.45490.37440.86190.68550.7491
R 2 00.45020.37120.85200.68150.7421
Tracking error0.02460.01820.01950.00950.01390.0125
% of weeks above the SP50072.191345.050118.020049.721973.30376.7853
Mean surplus return from SP50026.074018.43186.29854.321738.48561.6287
Mean overperformance18.82328.30351.13502.148828.21140.1105
Stock fees paid (total ammount)20.007316.353518.368519.973321.222614.8509
Taxes paid (total ammount)2.00071.63531.83681.99732.12231.4851
Table 8. Performance of the six simulated portfolios that used homogeneous asymmetric GED marginal pdfs in the MS-GARCH model log-likelihood function.
Table 8. Performance of the six simulated portfolios that used homogeneous asymmetric GED marginal pdfs in the MS-GARCH model log-likelihood function.
Portfolio Performance MetricMS-AsimGEDMSARCH-AsimGEDMSGARCH-AsimGEDMSEGARCH-AsimGEDMSGJRGARCH-AsimGEDMSTGARCH-AsimGED
Accumulated return193.9386137.6817108.2635163.0244238.498046.0118
Surplus return from SP50026.5114−29.7455−59.1637−4.402871.0708−121.4154
Mean return2.28046.00334.82054.08485.38466.7892
Return’s std. dev.0.038311.850211.818117.093814.437714.1813
Max. drawdown0.0374−13.0180−13.0180−22.4191−13.0180−10.4738
Percentile 2.5%0.0377−3.7158−3.7158−4.9231−4.7248−4.4590
Percentile 97.5%0.05563.08793.05274.12843.68543.8783
Sharpe ratio245.78200.52950.39240.44950.82290.0829
Jensen’s alpha193.938660.548031.74204.3452123.9510−65.0741
Beta with SP50000.46070.45700.94780.68420.6635
R 2 00.45750.45280.93060.67980.6626
Tracking error0.02460.01810.01820.00650.01390.0143
% of weeks above the SP50074.304870.41161.001163.292577.864317.7976
Mean surplus return from the SP50050.167021.45930.04994.633715.40813.1757
Mean overperformance37.276515.10980.00052.932811.99740.5652
Stock fees paid (total ammount)22.940319.397918.075320.008920.813013.2900
Taxes paid (total ammount)2.29401.93981.80752.00092.08131.3290
Table 9. Performance of the best-performing portfolios in the six pdf-specific analyses made in the previous sub-sections.
Table 9. Performance of the best-performing portfolios in the six pdf-specific analyses made in the previous sub-sections.
Portfolio Performance MetricMSEGARCH-GaussianMS-tStudMSEGARCH-GEDMS-AsymGaussMSGJRGARCH-AsimtStudMS-AsimGED
Accumulated return204.082166.899324.438165.887162.919193.939
Surplus return from SP50036.654−0.528157.011−1.540−4.50826.511
Mean return5.1692.2804.9842.2805.4282.280
Return’s std. dev.16.4090.03816.9020.03814.4490.038
Max. drawdown−17.7070.037−22.4190.037−13.0180.037
Percentile 2.5%−4.9970.038−5.1110.038−4.7250.038
Percentile 97.5%4.1340.0564.1440.0563.8390.056
Sharpe ratio0.607206.4730.986205.0010.531245.782
Jensen’s alpha56.634166.899168.487165.88748.142193.939
Beta with SP5000.88100.93200.6860
R 2 0.87200.91900.6820
Tracking error0.0090.0250.0070.0250.0140.025
% of weeks above the SP50072.63673.19272.85971.96973.30474.305
Mean surplus return from the SP50025.86739.38656.97725.18338.48650.167
Mean overperformance18.78928.82841.51218.12428.21137.276
Stock fees paid (total ammount)22.58321.46225.97120.95221.22322.940
Taxes paid (total ammount)2.2582.1462.5972.0952.1222.294
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

De la Torre-Torres, O.V.; Aguilasocho-Montoya, D.; Álvarez-García, J. Testing an Algorithm with Asymmetric Markov-Switching GARCH Models in US Stock Trading. Symmetry 2021, 13, 2346. https://doi.org/10.3390/sym13122346

AMA Style

De la Torre-Torres OV, Aguilasocho-Montoya D, Álvarez-García J. Testing an Algorithm with Asymmetric Markov-Switching GARCH Models in US Stock Trading. Symmetry. 2021; 13(12):2346. https://doi.org/10.3390/sym13122346

Chicago/Turabian Style

De la Torre-Torres, Oscar V., Dora Aguilasocho-Montoya, and José Álvarez-García. 2021. "Testing an Algorithm with Asymmetric Markov-Switching GARCH Models in US Stock Trading" Symmetry 13, no. 12: 2346. https://doi.org/10.3390/sym13122346

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