Empirical evidence of memory effects

The analyses presented in this paper are carried out on the high frequency (tick-by-tick i.e. we have a record of the price for every operation), time series of the price of 9 stocks of the London Stock Exchange in 2002 (251 trading days). The analyzed stocks are: AstraZeNeca (AZN), British Petroleum (BP), GlaxoSmithKline (GSK), Heritage Financial Group (HBOS), Royal Bank of Scotland Group (RBS), Rio Tinto (RIO), Royal Dutch Shell (SHEL), Unilever (ULVR), Vodafone Group (VOD).

The price of these stocks is measured in ticks. A tick is the minimum change of the price. The time is measured in seconds. We choose to adopt the physical time because we believe that investors perceive this one. We checked that the results are different as we analyze the data with the time in ticks or in seconds. A measure of the time in ticks would make difficult to compare and aggregate the results for different stocks. In fact, while the physical time of trading does not change from stock to stock the number of operations per day can be very different.

We measure the conditional probability of a bounce p(b|b prev ) given b prev previous bounces. This is the probability that the price bounces on a local maximum or minimum given b prev previous bounces. Practically, we record if the price, when is within the stripe of a support or resistance, bounces or crosses it for every day of trading and for every stock. We assume that all the supports or resistances detected in different days of the considered year are statistically equal. As a result we obtain the bounce frequency for the total year (where N is the total number of events for a specific number of previous bounces). Now we can estimate p(b|b prev ) with the method of the Bayesian inference52,53: we infer p(b|b prev ) from the number of bounces and from the total number of trials N assuming that is a realization of a Bernoulli process because when the price is contained into the stripe of a previous local minimum or maximum it can only bounce on it or cross it (see Supporting Information for further details on the modeling of bounce events).

Using this framework we can evaluate the expected value and the variance of p(b|b prev ) using the Bayes theorem (see Supporting Information for mathematical details of the derivation)

In fig. 1 and fig. 2 the conditional probabilities are shown for different time scales. The data of the stocks have been compared to the time series of the shuffled returns of the price. In this way we can compare the stock data with a time series with the same statistical properties but without any memory effect. As shown in the graphs, the probabilities of bounce of the shuffled time series are nearly 1 = 2 while the probabilities of bounce of the stock data are well above 1 = 2. For the shuffled series the probability is in almost all cases larger than 1 = 2, this small bias towards a value larger than 1 = 2 is due to the finiteness of the stripe. A similar bias would be observed also for a series generated by a Random-Walk. However, we observe that this is intrinsic asymmetry is at least one order of magnitude smaller than the effect measured in the non-shuffled case. In addition to this, it is noticeable that the probability of bounce rises up as b prev increases. Conversely, the probability of bounce of the shuffled time series is nearly constant. The increase of p(b|b prev ) of the stocks with b prev can be interpreted as the growth of the investors' trust on the support or the resistance as the number of bounces grows. The more the number of previous bounces on a certain price level the stronger the trust that the support or the resistance cannot be broken soon. As we outlined above, a feedback effect holds and an increase of the investors' trust on a support or a resistance entails a decrease of the probability of crossing that level of price.

Figure 1 Graphs of the conditional probability of bounce on a resistance/support given the occurrence of b prev previous bounces. Time scales: T = 45 (panel (a) and (c)) and 60 seconds (panel (b) and (d)). The data are obtained aggregating the result of the 9 stocks considered. The data of the stocks are shown as red circles while the data of the time series of the shuffled returns of the price are shown as black circles. The graphs in the left refer to the resistances while the ones on the right refer to the supports. Full size image

Figure 2 Graphs of the conditional probability of bounce on a resistance/support given the occurrence of b prev previous bounces. Time scales: T = 90 (panel (a) and (c)) and 180 seconds (panel (b) and (d)). The data are obtained aggregating the result of the 9 stocks considered. The data of the stocks are shown as red circles while the data of the time series of the shuffled returns of the price are shown as black circles. The graphs in the left refer to the resistances while the ones on the right refer to the supports. Full size image

We have performed a χ2 test to verify if the hypothesis of growth of p(b|b prev ) is statistically meaningful. The independence test (p(b|b prev ) = c) is performed both on the stock data and on the data of the shuffled time series and we compute

Then we compute the p-value associated to a χ2 distribution with 3 degrees of freedom. We choose a significance level . If the independence hypothesis is rejected while if it is accepted. The results are shown in table 1. The results show that there is a clear increase of the investors' memory on the supports/resistances as the number of previous bounces increases for the time scales of 45, 60 and 90 seconds. Conversely, this memory do not increase from the statistical significancy point of view at the time scale of 180 seconds.

Table 1 The table shows the p-values for the stock data and for the time series of the shuffled returns for different time scale and for the supports and resistances. Up to the 60–90 seconds timescale we find that the increase of p(b|b prev ) with respect to b prev is statistically significant Full size table

As a further proof of the statistical significance of the memory effect observed, we perform a Kolmogorov-Smirnov test (see Ref. 54) in order to assess whether the bounce frequencies estimated from the reshuffled series are compatible with the posterior distribution found for bounce frequency. We indeed find that reshuffled events are statistically different from empirical values (details on the implementation of the Kolmogorov-Smirnov test are discussed in Supporting Information).

We consider the slope of the weighted linear fit of p(b|b prev ) (shown in figures 1 and 2) at different time scales in order to study how the memory effect changes with the time scale considered. The slopes are shown in fig. 3, resistances in the left graph, supports in the right graph. The best fit lines of p(b|b prev ) are always upward sloping and decrease as the time scale increases. There are differences between resistances and supports as far as higher timescales are concerned. In particular, the slopes relative to the resistances decay slower that the slopes relative to the supports. While the former are statistically different from 0 on all time scale investigated the latter tends to 0 for scales above 150 s.

Figure 3 Graphs of the slope of the best fit line of p(b|b prev ) at different time scales ranging from 1 to 180 s in the case of resistances (panel (a)) and supports (panel (b)). The slopes of the original data are compared with the slopes of the shuffled data. Full size image

In summary this analysis shows that the memory effect decreases as the time scale increases. We find that it disappears at the time scale larger than 180 s–180 s is the maximum scale we investigate – for resistances and 150 s for supports.

Distribution of local minima/maxima

We study the distribution of supports and resistances in order to assess whether the price is more likely to bounce on some particular levels rather than on others. It is possible in principle that round values of the price (e.g. 100 £) are favored levels for psychological reasons. We produced a histogram of the local maxima/minima for every stock and time scale. The histogram of the local minima relative to VOD at the time scale of 60 seconds is shown in fig. 4 as an example. We find no evidence of highly preferred prices in any of the histograms produced. As a further proof, we also compare in that figure the histogram of support and resistance levels with the price level histogram and we do not observe any anomaly.

Figure 4 Histogram of the resistance price levels (panel (a)) and supports (panel (b)) of VOD for the 251 trading days of 2002 for the time scale 60 s. Both resistance and support levels are compared with the histogram of price levels for this time scale. We do not observe significant excess around round numbers or anomalies with respect to the histogram of the price levels. We find similar results, i.e. absence of anomalies in the histogram for supports and resistances, for all stocks and all time scales investigated. Full size image

Long memory of the price and antipersistency

The analysis of the conditional probability p(b|b prev ) proves the existence of a long memory in the price time series.

However, it is a well-known results that stock prices exhibit deviations from a purely diffusion especially at short time scales. We indeed find that the mean of the Hurst exponent 〈H〉 is always less than the value of 0.5 and therefore there is an anticorrelation effect of the price increments for the 9 stocks analyzed. The Hurst exponent is estimated via the detrended fluctuation method55,56. It is useful to recall what the Hurst exponent provides about the autocorrelation of the time series:

if H < 0.5 one has negative correlation and antipersistent behavior

if H = 0.5 one has no correlation

if H > 0.5 one has positive correlation and persistent behavior

Therefore the anticorrelation of the price increments might lead to an increase of the bounces and therefore it could mimic a memory of the price on a support or resistance. We perform an analysis of the bounces on a antipersistent fractional random walk to verify if the memory effect depends on the antipersistent nature of the price in the time scale of the day. We choose a fractional random walk with the Hurst exponent H = 〈H stock 〉 = 0.44 given by the average over the H exponents of the different stocks. The result is shown in fig. 5. The conditional probabilities p(b|b prev ) are very close to 0.5 and it is clear that p(b|b prev ) is almost constant as expected. These two results prove that the memory effect of the price does not depend on its antipersistent features, or at least the antipersistency is not able to explain the pattern observed in figs. 1 and 2.

Figure 5 Graph of the conditional probability of bounce on a resistance/support given the occurrence of b prev previous bounces for a fractional random walk (we used the average daily Hurst exponent equal to 0.44). The red circles refers to supports, the black ones to resistances. The persistency deriving from a Hurst exponent smaller than 0.5 is not able to explain the probability of bounce observed in Figs. 1 and 2. Full size image

Features of the bounces

In this section we want to describe two statistical features of the bounces as a sort of Stylized Facts of these two figures of technical trading techniques: the time τ occurring between two consecutive bounces and the maximum distance δ of the price from the support or the resistance between two consecutive bounces.

The time of recurrence τ is defined as the time between an exit of the price from the stripe centered on the support or resistance and the return of the price in the same stripe, as shown in fig. 6 panel a. We study the distribution of τ for different time scales (45, 60, 90 and 180 seconds). We point out that, being τ measured in terms of the considered time scale, we can compare the four histograms. We find that a power law fit describes well the histograms of τ and, as an example, in fig. 6 panel b we report the histogram for the time scale 60 seconds.

Figure 6 Statistical features of bounces. Panel (a): Sketch of the price showing how we defined τ, the time between two bounces and δ, the maximum distance between the price and the support or resistance level between two bounces. Panel (b) Histogram for τ at the time scales of 60 seconds. We obtain the histograms aggregating the data from all the 9 stocks analyzed. We do not make any difference between supports and resistances in this analysis. The histogram of τ is well-fitted by a power law at all time scales. The exponent results to be dependent on the time scale considered. In this specific case (60 seconds) we find N ~ τ−0.56. Panel (c) Histogram of δ at the time scale of 60 seconds. As in the previous panel, we obtain the histograms by aggregating the data from all the 9 stocks. We do not make any difference between supports and resistances in this analysis. The price difference δ is measured in price ticks. Differently from the previous case we find that the decay is compatible with an exponentially truncated power law at all time scales. In this specific case (60 seconds) we find N ~ δ−0.61 exp(−0.03 δ). Full size image

We instead call δ the maximum distance reached by the price before the next bounce. We show in fig. 6 panel a, how the maximum distance δ is defined. We study the distribution of δ for different time scales (45, 60, 90 and 180 seconds). In this case a power law fit does not describe accurately the histogram of δ and instead the behavior appears to be compatible at all scales with an exponentially truncated power law as shown in Fig. 6 panel c.