Keywords

1 Introduction

Revealing universal law based on analyzing empirical data, as necessary and essential part, has significantly promoted the considerable progress of the study on financial markets. It is well known some stylized facts such as the fat-tailed distribution of returns, volatility clustering of returns, and slow decay of auto correlation in absolute returns etc. [1, 2] have discovered and became useful tools to judge the quality of theoretical models [3]. But, the process of discoveries and tests for new possible facts never stopped. For instance, the power law relation between skewness and kurtosis [4], the universal and stationary price formation mechanism [5], and spurious trend switching [6]. Consistent empirical findings would inspire relevant theoretical work and practical application attempts.

This paper is supposed to discuss some features about gap-filling, the interesting but easily neglected phenomena, empirically. The stock price gaps generally refer to the presence of a “vacuum” on candle chart, which resulted from the difference between the highest and lowest prices. Some scholars have long time noticed that evidences as “the market abhors a vacuum and all gaps will be filled” [7]. It is consistent with the opinion that only when a gap in the stock price be replenished in short time, and then the stock price will continue to move forward [8]. However, until now, there are only a few academic literatures on the gap which mainly focus on the similarity and difference of statistics of the trade volume in transactions period such as before, during and after the gap [9, 10]. In short, it remains as only hearsay because there are insufficient researches in price gaps in stock markets, which deserves to be attached more importance.

For systematically study on gap-filling phenomena, this paper adopts random-shuffle and de-trending technology among different markets in several countries. We attempt to answer whether a market tend to fill price gaps and whether there is a universal law in gap-filling among different markets. What we do is a statistical analysis, which is a very beginning of tremendous work. The sections of the article will be arranged as follows. In Sect. 2, a brief introduction to the gap phenomenon and our data sources will be present. In Sects. 3 and 4, a stochastic exchange process will be presented, and the results will be compared with the empirical ones. In Sect. 5, the statistical results of no trend data will be shown. In the last section, we conclude and discuss.

2 Background and Data Source

2.1 Gap and Gap-Filling Phenomena

The candlestick-graph is a style of financial chart used to describe price movements and is one of the most convenient tools to find the trend and the gap of the stock[11]. Each candlestick represents four important prices for that day: opening price, closing price, maximum price and minimum price. In Fig. 1, it is obvious to find 4 vacancies that appears between some adjacent bars that indicating the gaps.

Fig. 1
figure 1

The data is got from https://sg.finance.yahoo.com

Phenomena of gap and gap-filling.

Price gaps can be divided into up gaps and the down ones by jumping directions. To form an up gap, the lowest price must be higher than the highest price of the previous day, and a down gap is formed when the highest price is lower than the lowest price of the previous day. There are 2 up gaps on 4th May and 7th May and 2 down gaps on 14th May and 29th May in Fig. 1.

A gap is filled or closed means that the price movement cover the space at a later time. For an up gap, the lowest price on the day of filling the gap must lower or equal to the lower boundary of the gap. For a down gap, the highest price on the day of filling the gap must higher or equal to the upper boundary of the gap. In that case, the “up gap 2” was filled on 30th May; the “down gap 1” and “down gap 2” were filled on 25th May and 14th June respectively. Until the end of the period, the “up gap 1” has not closed yet.

Gaps are meaningful for providing clues about price movements. The breakup in price continuity implies that something important has happened to the fundamentals or the psychology of the crowd has triggered for one stock even the whole market. By the inception of technical analysis, these “holes” can be identified as the possibility of its profitable exploitation by traders in the stock markets [10].

2.2 Data Description

We collected all the available stock data from Shanghai stock exchange (SHSE), the main board of Shenzhen stock exchange (SZSE-1), the second board of Shenzhen stock exchange (SZSE-2), New York stock exchange (NYSE) and NASDAQ stock exchange (NASDAQ) respectively. We use backward adjusted prices to get rid of the effect of splits and dividends. These stock markets are representative markets in both China and the U.S.

Table 1 Information of empirical data

As shown in Table 1, a ten-year period is taken into consideration. The data pre-processing includes deleting missing values. Yahoo provides stock data with null values when the stock is suspended. We have deleted stocks with too many missing or abnormal values.

3 Random Shuffling

In this subsection, we will present a randomly shuffling process. As a kind of time series, price features both distribution and time-series characteristics such as volatility aggregation and time-relevant correlation. By replacing original series with a randomly distributed series, Random Shuffle would destroy the time-relevant correlation while reserving the distribution characteristic, which is a regular method broadly applied[12, 13]. Meanwhile, the gap-filling phenomenon reflects short-term correlation behavior of time series, so if there does exist inherent mechanism of gap generation and complement, we would break it by Random Shuffle. In short, by comparing the differences in statistical characteristics of time-series between real data and the randomly generated data, we can reveal that if the real data is dependent in time series and then we can find the features of gap and gap-filling in real data.

Fig. 2
figure 2

Randomly switching processing: a the original data; b calculate the daily ratios to close price on previous trade day; c randomly switch daily ratios; and, d recalculate the price data from earliest close price with the shuffling daily ratios

As shown in Fig. 2a, the process is as follows

  • Get real data and make statistics

    Figure 2 is the candlestick plot of original empirical data. There are two gaps, one is an up gap which occurred on day 2, and another one is a down gap on day 4. We define \({X_{t,open}}\), \({X_{t,close}}\), \({X_{t,high}}\) and \({X_{t,low}}\) to indicate the opening, closing price, highest and lowest price of a stock on the tth trading day respectively. For \(t \in \left[ {1,2,3,\ldots ,T} \right] \) and T represents length of the data.

  • Calculate ratios to last close

    Calculating the ratios of the four prices per day to the previous day’s closing price in turn.

    $$\begin{aligned} \begin{array}{l} {r_{t + 1,open}} = \frac{{{X_{t + 1,open}}}}{{{X_{t,close}}}},\quad {r_{t + 1,close}} = \frac{{{X_{t + 1,close}}}}{{{X_{t,close}}}},\\ {r_{t + 1,high}} = \frac{{{X_{t + 1,high}}}}{{{X_{t,close}}}},\quad {r_{t + 1,low}} = \frac{{{X_{t + 1,low}}}}{{{X_{t,close}}}}. \end{array} \end{aligned}$$
    (1)

    In this way, we can get the relative changes of the price indices of every day. As shown in Fig. 2b, this ratios are given on a daily mark as vector \({r_{t+1}}=({r_{t + 1,open}},{r_{t + 1,close}},{r_{t + 1,high}},{r_{t + 1,low}})\).

  • Randomly shuffle ratio vectors

    Keep the data of the first day, and randomly rearrange the other daily’s ratio vectors. In Fig. 2b, new \({r_2^*,r_3^*,r_4^*,r_5^*,r_6^*}\) are shuffled from old \({r_3,r_4,r_6,r_4,r_2}\) respectively. i.e. \(r_{2,open}^*=r_{3,open}\), \(r_{2,close}^*=r_{3,close}\), \(r_{2,high}^*=r_{3,high}\), and \(r_{2,low}^*=r_{3,low}\) and so on.

  • Consequently recalculate prices

    The new daily prices are recalculated from the first day’s original data and the rearranged ratios. This process should be carried out in order.

    $$\begin{aligned} \begin{array}{l} X_{t + 1,open}^* = r_{t + 1,open}^*X_{t,close}^*,\quad X_{t + 1,close}^* = r_{t + 1,close}^*X_{t,close}^*,\\ X_{t + 1,high}^* = r_{t + 1,high}^*X_{t,close}^*,\quad X_{t + 1,low}^* = r_{t + 1,low}^*X_{t,close}^* \end{array} \end{aligned}$$
    (2)

    There are no gaps in the new candlestick plot 2d. Notice that it is also possible to generate gaps by randomly adjusting the original data that do not have a gap.

If there is an internal mechanism of gap generation and filling in the time series, the stock prices before and after would have strong correlation. If we switch the price sequences randomly, it will eliminate the internal structure and see different statistics results.

4 Results of Empirical Statistics on Original Data

4.1 The Statistics of Original Data

Table 2 exhibits some meaningful statistical norms, such that (\({N_{100}}\)) the average number of gaps in the 100 trade date per stock; the average and standard deviation of \({TD_{fill}}\) and \({ND_{fill}}\) which presents the number of the trade days and natural days required to fill the gap respectively; and \({N_{unfilled}}\) is the average number of gaps that were not filled until the end of the period. Besides, \({S_{gap}}\) defined as the gap size or gap width to distinguish how big one is the gap. For an up gap, the size is \({S_{t,gap}} = \frac{{{X_{t,low}} - {X_{t - 1,high}}}}{{{X_{t - 1,close}}}}\) and for a down gap \({S_{t,gap}} = \frac{{{X_{t - 1,low}} - {X_{t,high}}}}{{{X_{t - 1,close}}}}\) respectively. There are some clear evidences that we could find from Table 2.

Table 2 Gap statistics of actual data from some stock exchanges
  1. 1.

    On average, there is a gap of about 3.5–6.8 in 100 trading days. Both kinds of gaps in the US stock exchange markets have a larger amount than Chinese markets do. The less occurrence of the gaps in Chinese markets perhaps due to the “T+1” trading rules and \(10\%\) restrictions. Besides, the number of unfilled gaps is also significantly larger in America than that in China. The proportion of down gaps in the US market is almost twice that of up gaps.

  2. 2.

    The average filling time is about 27.6 to 50.5 trading days, and both China and the U.S. have a large variance. In detail, the gap-filling time of down gaps is much longer than that of up gaps in China except SZSE-2, while it is almost the same in the U.S. This may indicate that the development of the Chinese stock market is relatively weak, and it requires more time to recover from the unexpected environment impacts.

  3. 3.

    The average gap size is between 0.9 and \(1.6\%\). No matter in up gaps or down gaps, the order is the same, NASDAQ \(\succ \) SZSE-2 \(\succ \) SHSE \(\succ \) SZSE-1 \(\succ \) NYSE.

4.2 Statistical on Shuffling Data

This paper uses randomly shuffling technology to compare how far in difference of the actual data to random series. We believe that the differences can reflect the gap-filling phenomenon. The results of statistics on shuffling data are shown in Table 3. Comparing the Table 3 to Table 2, it can be found as follows.

Table 3 Gap statistics on data from randomly shuffling process
  1. 1.

    Almost in all markets, shuffling data have more gaps than empirical data. Especially, the down gap in each market has considerable increment. The increment degree is larger in the U.S. than that in China. It indicates that the transaction behavior in the actual market would avoid the appearance of gaps, especially in the U.S.

  2. 2.

    The time to fill an up gap change significantly. Almost all the U.S. markets take more time to fill the gaps, which indicates that there is a certain phenomenon of early gap-filling. However, the situation in China is quite complicated. The average gap-filling time of down gaps in SHSE and SZSE-1 has decreased by about \(40\%\) and the gap-filling time of up gaps has increased by around \(25\%\). This may indicate that the up gaps tend to be refilled while the refilling of the down gaps is impeded. Overall, the difference on gap-filling time has been narrowed down.

  3. 3.

    Apart from NYSE, the size of the gap has been reduced to varying degrees. The overall size of the gap is slightly reduced.

5 Result of Statistics on No-trend Data

5.1 Detrending Processing

The overall trend of the stock market does have an influence on the time of gap filling. For example, an upward gap is difficult to be filled when prices are at rising trend, so as to a downward gap at down trend. We use the detrending technology to get rid of the overall trend from the individual stock by the following steps.

  • Step 1: Take the first trading day of the research period as the base period and calculate the adjustment coefficient.

  • Step 2: For the five stock markets, the adjustment coefficients are calculated respectively using its market index.

  • Step 3: Divide the daily four prices of each stock by the adjustment coefficient of the corresponding date.

5.2 Statistical Result on No Trend Data and Shuffling Data

Table 4 Gap statistics of no trend data from some stock exchanges

Table 4 shows the statistic result of no trend data and the statistics on shuffling no-trend data is shown in Table 5.

Comparing Table 4 to Table 2, we can find some changes.

Table 5 Gap statistics on data from randomly shuffling process
  1. 1.

    The average number of both kinds of gaps increases, while the changes of unfilled gaps are not significant. The increment in the U.S. is somewhat larger than China, whereas the SZSE-1 experience the sharpest increment. These may indicate that the real market will avoid the appearance of gaps.

  2. 2.

    The time to fill a gap is significantly shorter, and the difference between the up gaps and down gaps are narrow. It takes even less time to close a down gap than it does to close an up gap in SHSE and SZSE-1, which means the overall trend in these two markets hinders the refilling process.

  3. 3.

    As to the gap size, the changes in both China and the U.S. are not evident. The changes go in the smaller direction, and the order of the five markets remains the same.

Then we focus on the changes on the no-trend data after the random exchange. Comparing Table 5 to Table 4, it can be found as follows.

  1. 1.

    The changes of almost all statistics after random exchange are reduced. The total number of the gaps did not change too much, even there are less gaps in the U.S.

  2. 2.

    What ever types of up or down, time to fill an gap is changed significantly. They are almost increased after random shuffling except SZSE-2, which implies there is a certain degree of gap filling phenomena in the original detrending data.

  3. 3.

    The changes in the gap sizes are statistically insignificant.

These may indicate that the patterns in the original data series have been broken after the detrending process, so the statistic results are quite the same after the random shuffling process, which means that the gap-filling phenomenon has something to do with the overall trend.

6 Conclusions and Discussions

In this paper, we discussed a gap-filling phenomenon which does not receive much attention from academic world. Specifically, we focused on the statistic characteristics of gap and gap-filling time. Different markets were slightly different in some statistic characteristics, such as the number of gaps, the gap-filling time, the size of the gap and so on, but generally they are similar.

To reveal that the existed gap can be recovered in a specific pattern, we proposed a randomly shuffling process. After the random shuffling process, we found some significant differences in each characteristic, especially for the gap-filling time. We can reject that most of the random results are the same as the original one at a \(5\%\) significance level by Kruskal-Wallis rank sum test. In short, we found that the stock market had some internal pattern in terms of gap-filling and may recognize that this phenomena are widespread in these countries.

We use detrending technology to remove the trend of the whole market from individual stocks. We found the changes of statistics after the random exchange are reduced, which means that the gap-filling phenomenon may possibly be related to the overall trend. Moreover, regardless of the trend, the number of gaps in the U.S. market and the number of gaps that have not been filled are larger than those in China, reflecting the high activity of the U.S. stock market, which is related to China’s “T+1” trading rules and the daily \(10\%\) restrictions. Some differences between real data and no-trend data suggest that the overall trend hinders the gaps’ generation and slows down the gaps’ refilling process to a certain extent. After the detrending, the difference between the original data and the randomly exchanged data suggests that the gap-filling phenomenon may exist in the stock markets of China and the United States.

Researches about gap-filling phenomenon could have some guiding significance for stock traders. For instance, a trading strategy might be established on the possibility of a stock gap being filled in future time. Therefore, it is a subsequent research direction that to focus on the distribution of gap-filing time. Additionally, the mechanism of how a gap is generated and then filled is also a question worthy of discussion.