DIAGNOSING STOCK MARKET TRENDS

Chernova Natalia
PhD, associate professor
Simon Kuznets Kharkiv National University of Economics (Ukraine)

To fully describe the current market state, the variety of indicators should be taken into account, but the final list of indicators often includes only stock prices. The stock prices perform as observable variables while the market state may be interpreted as no observable hidden one. In this way the main aim of the research is to construct a set of hidden markov models which describe the changes in the state of the stock market according to the price movements of financial instruments.

The following model will be constructed for each instrument [1]:

\[\begin{equation} \lambda=(P,B,w), \tag{1} \end{equation}\]

\(P=\{p_{ij}\}_{l \times l}\) – matrix which describes transition probabilities for trend and flat markets; \(B=\{b_{ij}\}_{l \times k}\) – matrix which describes probabilities of observing the price from a certain range in the appropriate state of the market; – vector of initial probabilities.

Then the forecast of the state will be obtained for each model. These forecasts will form the resulting forecast for the whole market.

To construct the model (1) means to obtain the estimates of its components – P, B and w. The appropriate procedures are discussed below.

Step 1. Matrix P evaluation.

The initial time series Xt of a stock are transformed into normalized ones:

\[\begin{equation} r_t=\frac{x_{t+s}-x_t}{x_t} \tag{2} \end{equation}\]

According to the above definitions of trend markets and flat market for each time period t the stage of the market is determined as follows:

\[\begin{equation} z_t=\left\{ \begin{matrix} -1, r_t<-0,01 \\ 0, r_t \in[-0,01;0,01] \\ 1, r_t>0 \\ \end{matrix} \right. \tag{3} \end{equation}\]

where “-1” states for “Bear market”, “0” states for “Flat market”, “+1” states for “Bull market”.

Step 2. Matrix B evaluation.

Let’s determine \(b_{ij}\) as probability of price movement by the value j in the state i. To calculate elements \(b_{ij}\) the three intervals for price movements are used (the intervals’ bounds depend on the standard deviation(sd) of the initial time series:

interval 1 (low movements): \([-1sd;+1sd]\);

interval 2 (medium movements): \([-2sd;-1sd]\) or \([+1sd;+2sd]\);

interval 3 (high movements): \([- \infty;-2sd]\) or \([+2sd;+\infty]\).

Step 3. Vector w evaluation.

The vector components are determined according to (3).

The hidden markov models are constructed for time series which describe the daily closing prices of stocks for time period 2016-2017.

The resulting model obtained for Adobe company are presented below (Table 1 - Table 2). As it shown in the matrix the probability of a delay is the highest for the bullish stage (92%), while the similar probabilities of preserving the bear market is lower and equals 77 %. The lowest probability of one step delay is determined for the flat stage (47%). The probabilities of escaping from the flat stage are approximately the same for the cases of bullish and bearish stages.

Table 1

Transition probabilities

BEAR FLAT BULL
BEAR 0,77 0,19 0,03
FLAT 0,24 0,47 0,29
BULL 0,01 0,07 0,92

The calculated probabilities of observing the price from a certain interval in the certain stage are presented in the Table 2.

Table 2

Matrix B

Low Medium High
BEAR 0,29 0,27 0,45
FLAT 0,55 0,29 0,16
BULL 0,68 0,19 0,13

The initial set of observations for a given week was of the form (Medium, High, Medium, High, High). The resulting sequence of stages are the following - (FLET, FLET, FLET, BULL, BULL).

Final results for all four models are shown in the Table 3.

Table 3

Results of the diagnostics of the market stage

Model Period 1 Period 2 Period 3 Period 4 Period 5
Johnson & Johnson Flat Flat Flat Bear Bear
Hewlett-Packard Flat Flat Flat Bear Bear
IBM Flat Flat Bear Flat Bear
Adobe Flat Flat Flat Bull Bull

Due to the fact that stocks are traded on the same market, we may draw a conclusion about the state of the whole market as a weighted sum of the results obtained for all individual models. Future researches should be concerned to including more initial models that describe not only stocks but also other types of financial instruments.

REFERENCES

  1. Lawrence R. Rabiner], Biing-Hwang Juang An introduction to hidden Markov models. –  ASSP Magazine, IEEE 3.1 –- 1986. –- p. 4-16.