Full text
142 2021, XXIV, 4 Finance 10.15240/tul/001/2021-4-009 STOCK PRICE PREDICTION USING MARKOV CHAINS ANALYSIS WITH VARYING STATE SPACE ON DATA FROM THE CZECH REPUBLIC Milan Svoboda1, Pavla Říhová2 1 University of West Bohemia in Pilsen, Faculty of Economics, Department of Economics and Quantitative Methods, Czech Republic, [email protected]; 2 University of West Bohemia in Pilsen, Faculty of Economics, Department of Economics and Quantitative Methods, Czech Republic, ORCID: 0000-0002-6632-445X, [email protected]. Abstract: The article describes empirical research that deals with short-term stock price prediction. The aim of this study is to use this prediction to create successful business models. A business model that outperforms the stock market, represented by the Buy and Hold strategy, is considered to be successful. A stochastic model based on Markov chains analysis with varying state space is used for short-term stock price prediction. The varying state spate is defined based on multiples of the moving standard deviation. A total of 80 state space models were calculated for the moving standard deviation with 5-step lengths from 10 to 30 in combination with the standard deviation multiples from 0.5 to 2.0 with the step of 0.1. The efficiency of the business models was verified for 3 long-term, liquid stocks of the Czech stock market, namely the stocks of KB, CEZ, and O2 within a 14-year period – from the beginning of 2006 to the end of 2019. Business models perform best when they use a state space defined on the length of a moving standard deviation between 15 and 30 in combination with multiples of the standard deviation between 1.1 and 1.2. Business models based on these parameters outperform the passive Buy and Hold strategy. In fact, they outperform the Buy and Hold strategy for both the entire period under review and the yielded five-year periods (including transaction fees). The only exception is the five-year periods covering 2015 for O2 stocks. After the end of the uncertainty period caused by unclear intentions of the new majority stockholder, the stock price rose sharply. These results are in conflict with the efficient markets theory and suggest that in the period under review, the Czech stock market was not effective in any form. Keywords: Stock market prediction, technical analysis, Markov chains, efficient market theory. JEL Classification: C02, C13, G14, G17. APA Style Citation: Svoboda, M., & Říhová, P. (2021). Stock Price Prediction Using Markov Chains Analysis with Varying State Space on Data from the Czech Republic. E&M Economics and Management, 24(4), 142–155. https://doi.org/10.15240/tul/001/2021-4-009 Introduction This empirical study deals with the short-term prediction of stock prices on the Czech stock market. Stock movements have been of interest to traders for a long time. Using a wide range of analytical methods, it tries to satisfactorily clarify past and present changes in stock prices. Based on these findings, it attempts to predict the future development of stock prices. Early forecasting allows traders to make capital gains. It is necessary to mention that according to Efficient Market Hypothesis (EMH), stock prices are unpredictable and markets are efficient. This means that the market responds immediately to any new information. This information cannot be predicted, it is randomly sent to the market and therefore the change in the exchange rate EM_4_2021.indd 142 3.12.2021 11:21:51
143 4, XXIV, 2021 Finance is random and the exchange rates perform a so-called ʻrandom walk’. In efficient markets the above-average profits cannot be achieved and according to this theory, other approaches are dysfunctional. The idea of a random walk was probably first published in the doctoral dissertation of the French mathematician L. Bachelier in 1900. According to Cootner (1964), after more than 60 years this Bachelier study was first published in English and had recovered ‘the rightful place’ in financial econometrics. Later another scientist, Fama (1965, 1970, 1991), returned to this idea and developed it substantially. He examined the correlation between daily returns and prior’s period daily returns for stocks composing the DJI index. The correlation coefficients were around zero. He thus concluded that the return on the stock had no relation to the return of the prior period. Fama’s conclusions were confirmed by Solnik (1973) who worked with the data from European stock markets. The efficient market hypothesis (EMH) was also confirmed by other studies and researches by investment economists. Roberts (1967) was the first to identify the particular forms of efficiency as a weak, semistrong and a strong form of efficiency. The weak form of efficiency means that the exchange rate includes all information from historical data and therefore, methods of technical analysis are not able to predict the market. The semistrong form of efficiency is a situation where the price includes both historical data and all public information and methods of fundamental analysis also fail here. The strong form EMH demonstrates the fact that even insider information is incorporated into the stock price. In a highly efficient market, therefore, the insider information is worthless and does not help investors to capture above-average returns. In the beginning, EMH was widely accepted by the academic community. Later, however, studies questioning the theory started to emerge. For example, Shiller (1981) draws attention to the higher volatility of stock prices than can be explained by the volatility of dividends. Haugen (1999) believes that markets overreact to new unexpected information and refers to various studies that confirm the occurrence of anomalies in an efficient market. The Czech stock market was also examined. In most cases, a weak form of efficiency is examined in the Czech stock market. The works of Filáček et al. (1998) or Hanousek and Němeček (2001) inclined to the opinion that the Czech stock market is behaving inefficiently. On the contrary, more recent works by Filer and Hanousek (1996) or Diviš and Teplý (2005), tend to demonstrate that the stock market behaves efficiently in a weak form. Therefore, the methods of technical analysis do not bring above-average returns. There is no consensus in academia assessing the question of whether or not markets are efficient. For example, research by Hájek (2007) pointed out that between 2000 and 2005, the Czech stock market was approaching a weak form of efficiency. Simultaneously, he claimed that the five-year period was too short. And that strategies that exploited of short-term dependences can be abnormally profitable. Research and discussions related to the efficiency of stock markets are likely to continue in the years to come. Current empirical research contributes to this discussion. This paper deals with a problem of predicting the direction of stock prices on the Czech stock market and builds on the work of Svoboda (2016). This work describes a stochastic model based on Markov chains analysis. The model is used to predict short-term future stock price movement. The main aim of this empirical research is to modify the stochastic model mentioned above and apply this model successfully to the Czech stock market. It is possible to expect the following benefits of the research: Contribution to the discussion of whether the Czech stock market can be considered to have a weak form efficiency. Verification of the conclusions of the work by Svoboda (2016) in the longer term. The paper is organized in the following way. The first part describes the theoretical background and the important theory on Markov chains. The second part of the work characterizes the data used to conduct research and describes the research methodology. The third most comprehensive part includes the obtained empirical results and their brief discussion. The final part contains the evaluation of the work performed and outline the direction of further research. 1. Theoretical Background The research is based on the assumption that the stock price is continuously created on the stock exchange by the mutual interaction EM_4_2021.indd 143 3.12.2021 11:21:51
144 2021, XXIV, 4 Finance between supply and demand. This supply and demand is generated by different types of traders (long-term investors, speculators). These traders have different time horizons, they use different methods to estimate the future income they will obtain by owning stocks, and they have different risk aversion, different amounts of capital. Every investor follows his intentions and has different reasons for buying or selling a given stock. Supply or demand for a given stock may not only be created due to the trader’s subjective perception of the undervaluation or overvaluation of the stock, but also for many other reasons, such as the need to raise money, modification of investment strategy, raising new capital by secondary offering, forced purchases or sales in borrowed assets, repurchases of stocks by the joint stock company itself, etc. The simultaneous action of these factors results in the constant fluctuation of the stock price and can be seen as a random variable. The next assumption of technical analysis is that stock prices fluctuate in trends. When the trend is identified in a timely manner, traders hope for above-average profits. The subject of this research is the forecasting of shortterm price movements (tertiary trend), while it is not the price level that is important, but the estimation of the magnitude of price changes. The stock price fluctuates in short-term trends and during the duration of this trend the stock price accumulates a certain gain or loss against the price at the beginning of the trend. The greater this change, the greater the likelihood of a change in this trend. The key question for us is how large the accumulated loss or profit must be in order for the trend to change with a sufficiently high probability. According to the nature of the data (daily opening and closing prices), it is proper to use the theory of Markov chains to model the probability of a trend change. Markov chains (MC) theory is described, for example, in Hillier and Lieberman (2010). MC are used for modelling processes which can be found in one of finite (countable) number of states in discrete time moments. MC is a sequence of discrete random variables x1, x2, x3, ... with the Markov property (at the time moment tn+1 the process will be in state i. It is stochastically dependent only on the state that was active at the previous time moment, i.e. at the time tn). Formally it can be described as follows (1): P(Xn+1 = xn+1 | X1 = x1, X2 = x2, … , Xn = xn) = = P(Xn+1 = xn+1 | Xn = xn) (1) Particular realizations xi are elements of a countable set S = {si}, i = 1, 2, ..., N which is called a state space. Behaviour of the described process is determined by: Vector of unconditional probabilities p(n)T = [p1(n), p2(n), ..., pN(n)], where T means transposition and pi(n) denotes probability that the process is in the moment n in the state i. Transition probability matrix P whose elements pij give conditional probability of process transition from the state i to the state j. That could be formally described as pij = P(Xn = sj |Xn-1 = si), where i = 1, 2, ... N and j = 1, 2, ... N. If we know the probability of particular states appearance at the time moment when the process starts, we can describe the process behaviour using the relations (2): pT(n) = pT(n – 1)P thus pT(n) = pT(0) P n (2) It can be derived from the relations (2) that the long-term behaviour of this stochastic process is determined by the matrix P. In order for the model to be successful, it is necessary to define the state space properly. There must be such states in the state space from which the process transforms into states with the opposite trend with a sufficiently high probability. In other words, we need to find states in which the trend is likely to change with a sufficiently high probability. Such states could be used to generate buying or selling orders. The use of MC for modelling stock market behaviour is not a new issue. Over the last decade, a number of papers have been published using MC theory to model stock market development. In some of them the state space is defined very simply. For example, Doubleday and Esunge (2011) applied the Markov chains to the DJA index and to a portfolio of selected stocks from this index. They defined a state space on daily price changes. They had tested two types of state space, with two states and with six states. Vasanthi et al. (2011) dealt with predicting the daily development of the value of stock indices. They predicted only the direction of price fluctuation, i.e. increase or decrease. In order to make the prediction they had used transition probabilities which they had EM_4_2021.indd 144 3.12.2021 11:21:51
145 4, XXIV, 2021 Finance calculated successively from the last 5 years, 3 years and 1 year. Petković et al. (2018) used a three-state model for returns analysis on the Belgrade Stock Exchange. Similar methods have been applied to other exchanges, such as Lakshmi and Manoj (2020) used MC analysis for the Indian stock market or Yavuz (2019) for the Turkish stock market. The conclusions of these works show that such a simple definition of state space cannot be used to carry out successful business strategies and are now tested more often on emerging markets. The most promising methods for successful trading seems to be the application of advanced techniques of MC analysis or a differently defined state space. Nguyen (2018) used the hidden Markov chains for monthly stock price prediction. He had tested models with two to six states. These models had been tested on S&P index. The results showed that the hidden Markov model have outperformed the B&H strategy and have yielded higher percentage returns. In the study by Huang et al. (2017) a model integrating two types of MCs was used for stock price prediction: regular and absorbing MC. The absorbing MC provides information on accumulated price changes during the length of tertiary trend. Riedlinger and Nicolau (2020) predicted the development of the FTSE 100 index one period ahead using multivariate MCs. The multivariate model enables to include more variables in the probability model. The authors assumed that stock prices could be affected by a number of variables and delays by more than one period. The work by Svoboda (2016) dealt with the fact that stock prices may be retentive more than one period in such a way that the state space was defined on the basis of the size of daily cumulative changes in the stock price. The work shows that in such a defined state space there are states in which there is a sufficiently high probability of the tertiary trend reversal. The state space in the abovementioned work is defined on the basis of multiples of the standard deviation from daily price changes. The standard deviation is calculated for the entire monitored period. However, the standard deviation calculated for the whole period does not respect one of the basic characteristics of stock markets that is changing volatility. Therefore, in this research, the state space definition is based on a moving standard deviation. It is expected that the state space determined in this way will be able to respond to changing volatility and the model will demonstrate better results. 2. Data We conduct research on stocks from the Czech stock market, which are traded on the Prague Stock Exchange (PSE). The criteria for including stock types in the research were as follows: PSE must be the main market for this stock type. The stocks must be traded on PSE long enough. Daily volumes must be high enough, i.e., fulfilling the assumption that the stock is traded by all types of investors and has sufficient liquidity. These requirements are met only by the following few companies: the telecommunications company O2 CR (O2), the KB bank (KB) and the energy company CEZ (CEZ). We have daily opening and closing prices for each stock type for a fourteen-year period, from 2 January 2006 until 2 January 2020, i.e. approx. 3,500 business days. The data source is Patria Direct. The companies regularly paid dividends in the given period. In this research, the after-tax dividend is reinvested. In the period under research, on 2016-0512, KB split its stocks 5-for-1. All data (dividends, opening and closing prices) relating to KB were recalculated in order to maintain the data continuity. On 2015-06-01, O2 was divided into two companies: O2 and CETIN. The final price of the O2 stock the day before the division of the company was CZK 177.6. For one original O2 stock, the stockholder acquired one new O2 stock and one CETIN stock. On the first day after the split, the price of the CETIN stock was CZK 133.5 and the price of the O2 stock was CZK 69.2. At the time of the division of the company the market was informed that a majority stockholder of CETIN stocks plans to get rid of minority stockholders and the stocks will later be withdrawn from the market. Maintaining data continuity is addressed as follows. CETIN stocks are sold at the price of CZK 133.5 on the first day after the division, and this income is further counted in the same way as the dividend. This means that O2 stocks are purchased for them according to business strategy. The process of the stock appreciation of the monitored stocks with the reinvestment of dividends is shown in Fig. 1. EM_4_2021.indd 145 3.12.2021 11:21:51
146 2021, XXIV, 4 Finance Special attention in Fig. 1 is drawn to a sharp increase in the appreciation of O2 stocks in the second half of 2015. That increase was caused by the end of the uncertainty that had been evident as soon as the release of the information on the majority stockholder’s actions entered the market. In autumn 2013, PPF purchased a majority stake from Telefónica. 3. Research Methodology Stock prices must first be transformed into a suitable Markov chain. The transformation is performed in terms of an appropriately defined state space. After obtaining the MC, suitable states for generating trading signals are selected based on the transition probability matrix. These generated trading signals help to create trading strategies that serve as the footing for the trading model. 3.1 State Space The definition of the state space is supported by the work Svoboda (2016). The stock space is defined on the cumulative changes in the stock price over the duration of the tertiary trend. The cumulative change in the stock price is denoted by Yt, which is interpreted as short basic indices of daily closing prices. The base period is the day of the trend change, i.e., the transition point from decline to growth or vice versa. The duration of the trend is determined by the number of consecutive rising or falling closing prices. Formally, the calculation of the cumulative price change Yt is described by (3): (3) where Pt is the final daily price at time t, Pt–1 is the final daily price at time t – 1 and Pt–2 is the final daily price at time t – 2. Based on the values of yt (yt is a percentage of Yt) a state space is defined. A set with eight states are used to sort the data. As the stock price falls, the corresponding conditions are marked Di. State D1 is the state with the smallest price drop and state D4 is the state with the highest price drop. Conditions when the stock price rises are marked Gi. The G1 state is the state with the lowest price growth and, conversely, the G4 state is the state with the highest price growth. The general state space model is defined by the following principle: D4: yt < −3Δt G1: 0 ≤ yt < 1Δt D3: −3Δt ≤ yt < −2Δt G2: 1Δt ≤ yt < 2Δt D2: −2Δt ≤ yt < −1Δt G3: 2Δt ≤ yt < 3Δt D1: −1Δt ≤ yt < 0 G4: 3Δt ≤ yt where Δt = kσt,l represents the width of the interval, σt,l is the standard deviation of daily changes in the stock price, k is the multiple of the standard deviation. The standard deviation is calculated as the moving standard deviation of length l, according to the formula (4): (4) Fig. 1: Development of capital value Source: Patria, own research EM_4_2021.indd 146 3.12.2021 11:21:52
147 4, XXIV, 2021 Finance where xt – i is the daily change of the stock price at day t – i, l s the length of the moving standard deviation (width of the sliding window) and x t,l is the moving average lengths of l at day t. The sodefined state space model (varying model) can respond to changing volatility in stock markets. Svoboda (2016) in his work states, that space model (unvarying model) was defined on an unchanging standard deviation calculated from all neighbouring values. For individual stocks, the fixed standard deviation is as follows: σO2 = 1.548, σCEZ = 1.663, σKB = 1.899. The development of a moving standard deviation for parameter l = 20 is shown in Fig. 2. The state assignment procedure for both models of the state space described above is illustrated on CEZ stocks with model parameters k = 1 and l = 20 in Tab. 1. Fig. 2: Moving standard deviation for l = 20 Source: own Date Ptxt[%] yt[%] Unvarying model Varying model σState σ20 State 2019-12-12 505.5 0.999 0.999 1.66 G10.71 G2 2019-12-11 500.5 −1.476 −1.476 1.66 D10.66 D3 2019-12-10 508.0 0.594 1.195 1.66 G10.59 G3 2019-12-09 505.0 0.198 0.598 1.66 G10.58 G2 2019-12-06 504.0 0.099 0.398 1.66 G10.57 G1 2019-12-05 503.5 0.299 0.299 1.66 G10.59 G1 2019-12-04 502.0 −0.100 −2.240 1.66 D20.60 D4 2019-12-03 502.5 −1.374 −2.142 1.66 D20.68 D4 2019-12-02 509.5 −0.779 −0.779 1.66 D10.63 D2 2019-11-29 513.5 0.588 0.588 1.66 G10.62 G1 2019-11-28 510.5 −0.293 −0.293 1.66 D10.61 D1 2019-11-27 512.0 0.999 0.999 1.66 G10.71 G2 . . . . . . Source: own Tab. 1: Procedure for assigning states (CEZ, k = 1, l = 20) EM_4_2021.indd 147 3.12.2021 11:21:52
148 2021, XXIV, 4 Finance 3.2 Transition Probability Matrix Now that the MC is available it is proposed to find the probabilities of the transition between individual states. Before the calculation was performed MC filtration was carried out. This filtering procedure is meant to reveal the consecutive identical states. By filtration, we are able to skip the states in which the stock price stagnates (respectively, they change little in the same trend). These states are not considered to be of interest in terms of trading. For illustration we show a part of the string before filtering: ... D4, G1, G1, G1, G2, D1, D1, D2, G2, D2, D2, … and after filtration ... D4, G1, G2, D1, D2, G2, D2, ... The matrix of transition probabilities P is determined for the filtered MC. The parameters k = 1.0 and l = 20 of the presented transition probabilities for both varying model and unvarying model are demonstrated in Tab. 2. These are average conditional transition probabilities calculated according to the formula (5): (5) where represents conditional probability of transition between individual states. The ΣDi and ΣGi columns indicate the likelihood of staying in the trend or changing the trend. The ni denotes the average number of occurrences of individual states is indicated. From the values calculated in Tab. 2 we can observe: For both models, the probability of trend change in individual states is high enough, the unvarying model has a slightly higher probability. The values calculated by us for the unvarying model are almost identical to the values in Svoboda (2016), the increase in the time window did not bring about changes in the behaviour of stock prices. The anomaly can be noticed at the transition from G4 to G3 in the varying model, where zero would be expected. There has been a rare case where a moving standard deviation has risen sufficiently to be attributed to a lower Gi state despite the rise in the stock price. t t + 1 D4D3D2D1G1G2G3G4ΣDiΣGin D4 Unvarying 0 0 0 0 0.450 0.334 0.123 0.093 0 1 74.0 Varying 0 0 0 0 0.538 0.312 0.138 0.012 0 1 112.7 D3 Unvarying 0.333 0 0 0 0.463 0.163 0.033 0.008 0.333 0.667 132.0 Varying 0.356 0 0 0 0.431 0.180 0.030 0.004 0.356 0.644 185.0 D2 Unvarying 0.063 0.266 0 0 0.524 0.114 0.024 0.009 0.329 0.671 308.0 Varying 0.093 0.269 0 0 0.430 0.178 0.026 0.004 0.362 0.638 381.7 D1 Unvarying 0.006 0.042 0.260 0 0.598 0.079 0.010 0.005 0.308 0.692 689.0 Varying 0.013 0.074 0.297 0 0.452 0.137 0.022 0.005 0.384 0.616 602.0 G1 Unvarying 0.005 0.013 0.076 0.594 0 0.265 0.039 0.009 0.687 0.313 668.7 Varying 0.005 0.029 0.122 0.451 0 0.303 0.077 0.012 0.608 0.392 576.7 G2 Unvarying 0.002 0.014 0.107 0.520 0 0 0.273 0.084 0.643 0.357 312.0 Varying 0.001 0.023 0.151 0.435 0 0 0.282 0.109 0.610 0.390 392.3 G3 Unvarying 0.004 0.012 0.137 0.496 0 0 0 0.351 0.649 0.351 138.7 Varying 0.002 0.025 0.168 0.402 0 0 0 0.404 0.596 0.404 200.3 G4 Unvarying 0.014 0.070 0.281 0.635 0 0 0 0 1.000 0.000 95.0 Varying 0.000 0.046 0.293 0.658 0 0 0.002 0 0.998 0.002 136.7 Source: own Tab. 2: Transition probabilities for the model for k = 1.0, l = 20 stock pij EM_4_2021.indd 148 3.12.2021 11:21:53
149 4, XXIV, 2021 Finance 3.3 Trading Strategies and Models In the following part, the term trading strategy identifies a set of rules that determine the purchase and sale of stocks. The trading model includes several trading strategies applied to selected stocks. Trading strategies are based on the following principle. Purchasing signals are gradually generated by states D3, D4 and sales signals are generated by states G3, G4. By combining buying and selling stock states, 4 trading strategies are obtained: D3–G3, D3–G4, D4–G3, D4–G4. Strategies D3–G3 imply that state D3 generates purchase orders (if we no longer hold stocks) and state G3 generates a sales order (if we hold stocks). This is in line with the conclusions of the work Svoboda (2016), where these 4 trading strategies generated the highest revenues. Trading is always carried out according to the following rules: One trade (transaction) represents the purchase and subsequent sale of a stock. It is not possible to make two purchases in a row. If a buying or a selling signal is generated on a given day, the trade is executed with the opening price from the following day. The capital is always fully invested, so it is theoretically possible to buy parts of the stocks. Transaction fees are not taken into consideration. Dividends and other income (hereinafter referred to as dividends), if we are entitled to them, are reinvested after tax. A short selling (speculation on price decrease) is not taken into account. The value of the invested capital is calculated according to the following formula (6): (6) where C0 = 1.00 s the initial value of capital (a unit of capital is invested), Cn s the value of capital after the n-th transaction, Si is the selling price in i-th transaction, di represents the net dividends (and other income) in case ex dividend day occurred during the i-th transaction, Bi is the purchase price in the i-th transaction. If the transaction fees were to be calculated it is sufficient to modify formula (6) into the following formula (7): (7) where p stands for the size of the fee (in percent). It would be very risky for a trader to invest everything in one selected stock and use one trading strategy. To minimize the risk, it is appropriate to distribute capital evenly between the analysed stocks and between individual trading strategies. Therefore, individual trading strategies will not be evaluated as it is more significant to evaluate the entire portfolio of trading strategies, which is called the trading model. The trading model includes four trading strategies, defined on the same state space, which are applied to three stocks, i.e., the invested capital is divided into 12 equal parts. The evaluation of the trading model is represented by CM and is formally determined by formula (8): where (8) According to EMH, trading in stocks following through with the above principles should not be successful and the value should not outperform the market. In other words, a passive stockholding should yield the same or a higher return. Passive stockholding can be referred to as a Buy and Hold (B&H) strategy. We will consider a trading model successful if it outperforms the B&H strategy. In this paper, the B&H strategy envisages the reinvestment of dividends. It is assumed that in the beginning of 2006 stocks were purchased and then held until the end of 2019. For the dividends paid, the stocks are purchased at current prices. By implementing the B&H strategy, the resulting value of capital for individual stocks would be CCEZ = 1.35; CKB = 2.28; CO2 = 3.79 so that the average value of capital is CB&H = 2.47. 4. Research Results and Discussion In the first place, the summary results for individual models will be presented and then one of the models will be analysed in detail. The summary results are listed in Tab. 3. For each model, the value of CM capital and the average number of realized trades n are given. A total of 80 varying state space models were analysed. EM_4_2021.indd 149 3.12.2021 11:21:53
150 2021, XXIV, 4 Finance The parameter k gradually took values from 0.5 to 2.0 with the step of 0.1. The parameter l for the length of the sliding standard deviation took values from 10 to 30 with the step of 5. An unvarying model was also calculated for each value of the parameters. Results in Tab. 3 show that on average for all parameters k there is no significant difference between the unvarying and varying model. The average value of capital varies in a narrow range between 2.19 and 2.26. The best results are obtained when the parameter of the model k is between 1.1 and 1.4. While the unvarying model has a maximum capital value of 2.67 (k = 1.4), the varying models (except l = 10) achieve higher values: 3.04 (k = 1.1, l = 15), 2.93 (k = 1.2, l = 15), 2.83 (k = 1.2, l = 25), 3.37 (k = 1.1, l = 30). Varying models combining the parameters l = 15, l = 20, l = 25 and l = 30 with the parameters k = 1.1 and k = 1.2 slightly outperform the unvarying model and outperformed the passive B&H strategy (2.47). As expected, it is also evident that the number of executed trades decreases with increasing k parameter. This is important when calculating trading fees. The Tab. 3 shows the summary results for the entire 14-year period. Results may be skewed in one successful period, while in other periods, trading models may not be successful. In order to be considered reliable, trading models should perform well for any given period. The five-year sliding yields in Tab. 4 and five-year sliding annual yields in Tab. 5 are calculated for the model with the parameters k = 1.2 and l = 25. This model belongs to the group of models that demonstrated the best results. It has average results in this group. The length of five years was chosen because the minimum recommended investment horizon for investing in stocks is five years. In addition to the total returns of the trading model, the returns of individual stocks are also monitored and compared with the returns of the B&H strategy. kl = 10 l = 15 l = 20 l = 25 l = 30 Unvarying CMn CMn CMn CMn CMn CMn 0.50 1.46 200.0 1.50 187.5 1.34 185.5 1.54 180.4 1.70 180.5 1.72 141.8 0.60 1.66 179.4 1.83 168.0 1.85 166.0 1.99 164.7 2.01 162.8 2.24 122.3 0.70 2.05 155.4 2.19 152.1 1.98 145.5 1.96 143.3 2.21 142.5 2.30 105.5 0.80 2.02 134.3 2.32 129.4 2.28 128.0 2.18 123.5 1.84 119.8 2.11 86.3 0.90 2.10 115.1 2.50 111.1 2.27 108.7 2.32 106.9 2.09 104.7 2.38 74.3 1.00 2.31 98.5 2.32 93.4 2.73 92.7 2.18 91.4 2.04 88.3 2.56 63.0 1.10 2.54 83.8 3.04 81.0 2.80 78.3 2.51 75.8 3.37 75.6 2.63 51.9 1.20 2.63 69.7 2.71 68.3 2.93 65.5 2.83 63.9 2.91 63.9 2.56 43.8 1.30 2.67 61.1 2.37 56.7 2.54 54.7 2.42 54.2 2.22 53.1 2.40 36.6 1.40 2.47 52.0 2.23 47.6 2.51 47.4 2.27 46.1 2.29 44.9 2.67 31.5 1.50 2.51 43.3 1.95 37.8 2.18 39.5 2.19 38.8 2.05 38.4 2.36 26.0 1.60 2.31 36.8 2.09 33.8 2.22 34.1 2.04 33.0 2.00 32.7 2.22 22.8 1.70 2.16 31.3 2.31 30.1 2.39 29.5 2.47 28.7 1.88 28.2 1.81 19.8 1.80 2.20 26.4 2.17 25.2 2.29 25.1 2.30 23.8 2.35 25.1 1.83 17.6 1.90 2.15 23.3 1.79 20.2 2.00 20.1 2.10 21.2 2.12 21.1 1.96 16.0 2.00 1.99 19.7 1.70 16.8 1.82 16.6 2.01 18.0 2.64 18.0 1.98 14.8 Mean 2.20 83.1 2.19 78.7 2.26 77.3 2.21 75.8 2.23 75.0 2.23 54.6 St. dev. 0.323 0.375 0.392 0.281 0.411 0.295 Source: own Tab. 3: Final value of capital EM_4_2021.indd 150 3.12.2021 11:21:53