Specialization and herding behavior of trading firms in a financial market

Agent-based models of financial markets usually make assumptions about agent's preferred stylized strategies. Empirical validations of these assumptions have not been performed so far on a full-market scale. Here we present a comprehensive study of the resulting strategies followed by the firms which are members of the Spanish Stock Exchange. We are able to show that they can be characterized by a resulting strategy and classified in three well-defined groups of firms. Firms of the first group have a change of inventory of the traded stock which is positively correlated with the synchronous stock return whereas firms of the second group show a negative correlation. Firms of the third group have an inventory variation uncorrelated with stock return. Firms tend to stay in the same group over the years indicating a long term specialization in the strategies controlling their inventory variation. We detect a clear asymmetry in the Granger causality between inventory variation of firms and stock return. We also detect herding in the buying and selling activity of firms. The herding properties of the two groups are markedly different and consistently observed over a four-year period of trading. Firms of the second group herd much more frequently than the ones of the first group. Our results can be used as an empirical basis for agent-based models of financial markets.

Introduction -The modeling of complex systems [1,2] benefits from the study of agent based models. A particular interesting system is the financial market. Despite many agent based models have been investigated [3,4,5,6,7,8,9,10], only in few cases [11,12,13,14,15,16,17] an empirical investigation of agent strategies has been possible due to the lack of accessible data. The detection of empirical regularities in the investment strategy and herding behavior of large organizations may turn out to be a key advance in the design of empirically grounded agent based models of financial markets.
Complexity in financial markets emerges from the interaction at different levels of many individuals and organizations. There are institutional and individual investors taking investment decisions and their decisions are in most cases executed by financial and brokerage firms which are allowed to trade in a specific market. Recent studies have empirically shown that the dynamics of institutional and individual trading can show detectable statistical regularities in investment decisions down to a daily or intradaily time horizon [16]. Broad classes of investment strategies such as the momentum [18] and the contrarian [19] strategies have been empirically investigated, most frequently at quarterly intervals, by considering specialized databases allowing to track the investment decisions of large investors [11] and of both large and individual investors [13,14,15,16]. Momentum investors are buying stocks that were past winners. A contrarian strategy consists of buying stocks that have been loosers (or selling short stocks that have been winners). Empirical investigations on different markets have shown that institutional investors are preferentially momentum investors whereas individual investors usually prefer a contrarian strategy. Proprietary trading data obtained from the Korean Stock Exchange [14] and from NASDAQ [16] have shown that stock returns have some ability to forecast inventory variation of groups of investors whereas the evidence of return predictability on the basis of investor inventory variation is negligible both at a daily and intradaily time horizon.
In the present study we empirically investigate the presence of detectable resulting investment strategies at the level of firms entitled to trade in a financial market. The investigated market is the Spanish Stock Market. In this market, firms are credit entities and investment firms which are members of the stock exchange and are entitled to trade in the market. The firms trading in this market include banks, investment banks, financial management companies and brokerage firms among others. We empirically show that, although a firm may act on behalf of many individuals and institutions having different strategies, firms self-organize in groups with various degrees of specialization to the extent that in most cases it is possible to characterize a firm with a specific resulting strategy. We use a classification of firms in three groups to study the set of time intervals which are statistically indicating a collective action of the firms of a group with respect to the inventory variation of a given stock. In this way we are able to detect distinct herding characteristics of groups of firms characterized by different strategies. Our results are consistently observed over a four-year time period and can be used as empirical bases for an agent based models of financial markets. Inventory variation in a financial market -The activity of a market participant with respect to a given asset is well represented by the inventory variation which is the value exchanged as a buyer minus the value exchanged as a seller in a given time interval. In this article we investigate the inventory variation of financial firms exchanging a financial asset at the Spanish Stock Market (Bolsas y Mercados Españoles, BME) during the years 2001 through 2004. In 2004 the BME was the eight in the world in market capitalization. Our database corresponds to the electronic open market SIBE (Sistema de Interconexión Bursátil Electrónico) and allows us to follow each transaction performed by all the firms registered at BME. We have focused our investigation on Telefónica (TEF), Banco Bilbao Vizcaya Argentaria (BBVA), Banco Santander Central Hispano (SAN) and Repsol (REP) stocks, which are 4 highly capitalized stocks of BME and on the most active firms which have traded at least 200 trading days with at least 1000 trans-actions per year during the period 2001-2004. We investigate the market dynamics by focusing on the trading of each selected stock separately for each available calendar year. By doing so we have 4 × 4 distinct sets of results. The number of active firms is around 70 with a minimum and maximum value equal to 54 and 82, respectively. The homogeneity of obtained results for these sets is providing us indication about the general validity of them.
We first consider daily inventory variation of the investigated stock. Let v i (t) indicate the inventory variation of firm i during the day t. For each investigated set, we have a multivariate time series of the inventory variation of the most active firms. We investigate the statistical properties of this set by considering its correlation coefficient matrix, which shows both positive and negative sta- To assess if the detected correlations are carrying information about the market dynamics we perform a one factor or principal component analysis in which filtering of the components is done with the help of methods [20] based on random matrix theory (RMT). Particular attention has to be paid to spurious correlation due to the buy-sell counterparts present in each transaction. Even taking into account this consideration, we find that the first eigenvalue of the correlation matrix is not compatible with the null hypothesis of uncorrelated random inventory variables (see Fig. 1) and is therefore carrying information about the collective dynamics of firms.
To elucidate the nature of this information we investigate the time profile of the factor associated with the first eigenvalue [21]: we find that there is a statistical significant correlation of this factor with the price return time series (see figure 2a and 2b) suggesting that the dynamics of the inventory variation can be succesfully described by the one factor model v i (t) = γ i r(t) + ε i (t) where γ i is proportional to the correlation between price return and inventory variation ρ[v i (t), r(t)] and ε i (t) is a zero mean white noise term describing the idiosyncratic part of the strategy of the firm. We find that many firms are significantly correlated (or anticorrelated) with price return and that correlations with price return are heterogeneous and depend on specific features of the trading firms like, for example, its size. Figure 2c shows that there are at least two groups of firms which are quite distinct with respect to their trading action. The firms characterized by a positive value of γ i greater than the 2σ statistical uncertainty are categorized by us as trending firms. Conversely, when the correlation ρ[v i (t), r(t)] is negative and less then the −2σ statistical uncertainty, the firms are categorized as reversing firms. We address the remaining firms as the uncategorized ones. Table I indicates that about 50% of the firms are reversing whereas firms with trending strategy are observed approximately in the 10% of the cases. The rest, around 40%, remains uncategorized. Finally, Figure 2c also indicates a significant correlation between the strategy and size of the firm: in particular we find that BME is composed by  [20] where each time series is replaced by an uncorrelated random inventory time series. The solid red line is the averaged spectral density obtained by shuffling independently the buyers and the sellers, in such a way to maintain the same number of purchases and sales for each firm as in the real data. Other shuffling experiments give similar results. In the inset we show the first (empty circles) and second (filled squares) eigenvalue of the 4 x 4 investigated sets. The dashed blue line again indicates the threshold expected by the RMT, and the solid red line is the upper threshold expected by the shuffling experiment. The first eigenvalue is well above the thresholds obtained with RMT and shuffling methods for all the investigated sets.
few large trending firms and many reversing firms with a very heterogeneous size. As Table I indicates, the percent categorization over the four years is rather stable but what about to the behavior of a specific firm? In other words which is the probability that a firm categorized in a given group will remain in the same group or will move to some other group next year? We have computed the probability P (Y |X) of a firm being in group X in a given year and moving to group Y during the next year. We have averaged these probabilities over the 3 changes of year present in our database. For the group of reversing firms (X = R), these probabilities are P (R|R) = 71%, P (U |R) = 16%, P (T |R) = 2% and P (E|R) = 10%, where T indicates trending firms, U uncategorized ones and E indicates that the firm has exit from the set of active firms. For the trending group we analogously obtain P (R|T ) = 3%, P (U |T ) = 34%, P (T |T ) = 44% and P (E|T ) = 18% whereas for the uncategorized firms we estimate P (R|U ) = 19%, P (U |U ) = 62%, P (T |U ) = 7% and P (E|U ) = 12%. These probabilities show that a firm usually tends to preferentially stay in the same group over the years indicating a long term specialization. This behavior is more pronounced for reversing firms (P (R|R) = 71%) and less pronounced for trending firms (P (T |T ) = 44%). Uncategorized firms are showing an intermediate behavior. The probability to move from reversing to trending firms, or viceversa, is rather low suggesting that such a change might occur only through successive changes which include a period of time spent in the uncategorized group. From this last group firms may move to trending and reversing group of firm with a probability P (R|U ) = 19% and P (T |U ) = 7% respectively. These results, obtained for Telefónica, are representative of the other stocks of our sample. In summary a specialization of trading firms is present and rather stable over the years although some dynamics among groups is observed from year to year.
The price return r(t) of the traded stock acts as a common factor for all the firms. Our one-factor model predicts that the cross correlation ρ[v i (t), v j (t)] between the inventory variation of two firms is significantly pos- itive when both firms i and j are trending or reversing firms, whereas the cross correlation is significantly negative when the two firms belong one to the first and the the other to the second group. When one of the firms belongs to the third group the cross correlation is not significantly different from zero. In order to illustrate how well the model reproduce the empirical data, we show in The approximately block structure of the matrix indicates that the proposed model gives a good basic description of data. Moreover it can be shown [22], that the correlation matrix of the model is composed by a large eigenvalue λ 1 ∼ γ 2 i and N − 1 small eigenvalues, similarly to what is seen in Fig. 1 for empirical data.
The correlation between inventory variation and price return raises the question of the causality relation between these two variables. This problem has been investigated in ref. [16] by studying a specialized proprietary database of institutions and individuals trading in Nasdaq 100 stocks from 1/2000 to 2/2001. Here we investigate the same problem for the two groups of firms characterized by a trending or reversing resulting strategy. Specifically, we investigate inventory variation and price return time series sampled at a 15 minute time horizon. The high frequency autocorrelation of price return shows that linear autocorrelation has a time scale strictly shorter that 15 minutes therefore confirming a weak form of market efficiency [23]. Trending firms are characterized by an autocorrelation of v(t) which is significantly positively correlated up to a few trading hours. Conversely, reversing firms have v i (t) negatively autocorrelated on a time scale of 15 minutes. Thus few large trending firms act on a long time scale in order to build a position by splitting large orders [24,25,26,27] to minimize their market impact [28], whereas a population of many reversing firms of different size primarily act on a short time scale.
The investigation of the high frequency lagged cross correlation between r(t) and v i (t) provide us information about the causality direction between the two variables. Fig. 4 shows that inventory variation in the future v i (t) is correlated with price return in the near past r(t + τ ) (τ < 0), whereas v i (t) is not significantly correlated with r(t + τ ) in the near future (τ > 0). Moreover, as shown in figure 4, the larger is the synchronous correlation ρ[v i (t), r(t)], the larger is the cumulated effect on future inventory variation τ <0 ρ[v i (t), r(t + τ )]. However, since there is no significant correlation between the present inventory variation and the future return, the cumulated effect disappears for τ > 0. This result indicates that firms of both groups are "following" the price (in different directions) rather than pushing it in a given direction.
Degree of common behavior of group of firms.
of the group is the number of buying firms divided by the number of firms of the group which are active in the specific time interval (buying or selling). This herding indicator is a simplified version of the herding measure introduced in Ref. [11] to quantify the herding of institutional investors in selecting a basket of stocks. Differently than in Ref. [11] here we limit our investigation to the univariate case of the investment in a single stock. We infer that herding is associated to the observation of a high value (buy herding) or low value (sell herding) of h by evaluating the probability to observe a number of buying (selling) firms equal or larger than the empirically detected one under a binomial null hypothesis. Specifically, we infer that herding is present when the probability of the observed number of buying or selling firms is smaller than 5% under the null binomial hypothesis. We estimate h for the three groups of stocks at different time horizons ranging from 15 minutes to 5 trading days. A selection of the results obtained are summarized in Table II for the one day and 15 minutes time horizon respectively. By analyzing Table II we note that firms characterized by a reversing resulting strategy present herding in a significant fraction of time intervals. Specifically the percent of herding intervals averaged over four years ranges from 32.6% for the 15 minutes time horizon to 66.4% for the 1 day time horizon. The percent of herding time intervals is much less pronounced for firms with a trending resulting strategy. For this group we observe a percent of herding intervals of a few percent for the time horizon both of 15 minutes (4.3%) and 1 trading day (6.3%). The uncategorized firms present an intermediate behavior.
An illustration of the occurrence of the herding time intervals estimated for the one day time horizon is provided in Fig. 5 where we show the time evolution of daily closure stock price of Telefónica during the time period 2001-2004. Each panel refers to a different group of firms. The herding days of reversing firms are highly frequent and approximately uniformly distributed over the investigated time period. The prevalence over long periods of time of the kind of observed herding (buying or selling) is related to the prevalence of a bull or bear market phase. The herding days detected for the trending firms are much less frequent and their occurrence is less uniformely distributed in time.
The herding measure we use is deliberately simple and it needs additional validation to prevent the possibility that the detected herding intervals do not imply a significant change of the group inventory variation. In fact, for example, we could imagine the possibility that several firms are just net buying each a small amount of value of the traded stock whereas the remaining few firms are selling the traded stock for an amount corresponding to a much larger value. In this case, with our methodology we would infer buy herding in the presence of a net sell from the considered group of firms. We therefore need to complement our herding estimation with additional indicators. We quantify the degree of common action of firms in a group with respect to the exchanged value of the traded stock by considering the buy ratio b used by Grinblatt and Keloharju in their study of investment behavior of private and institutional Finnish investors [15]. Specifically, for each time interval and for each group we compute The buy ratio b is varying between zero and one. Low values of b are indicating time intervals when firms of the  The first three lines refer to the 1 day time horizon whereas the last three lines refer to the 15 minutes time horizon. The dispersion of mean value is plus or minus one standard deviation. Number in parenthesis is the number of records of the considered set. The presence of symbols ⊕, △, and ♦ for each group of firms and for each time horizon select the pairs of unconditional and conditional mean values which does not pass a t-test assuming the null hypothesis that the two sets of data providing unconditional and conditional mean values originates from the same normal statistics. These pairs of mean values are statistically distinct at a 99% confidence level. considered group are mostly selling whereas high values close to one are indicating that firms are mostly buying. In addition to the buy ratio we also consider a last indicator used to quantify the degree of activity of various firms belonging to each group in a specific time interval. This is done by adapting the "effective" number indicator originally proposed to quantify the amount of stocks significantly present in a portfolio [29]. We consider where and N is the number of firms in the considered group. This indicator is ranging from the value N ef f = 1 when only one firm is responsible for the group inventory variation to the value N ef f = N which is indicating that all firms are contributing equally to the inventory variation of the group of firms.
To validate the herding behavior observed in Table II we present in Table III Table III shows that the mean value of b is, as expected, very close to 0.5 when the average is performed unconditionally over all intervals. Differently, when the average is computed conditioning on buying or selling herding intervals (as detected by h of Eq. (1)) one obtains mean values of b higher or smaller than 0.5 respectively. The Table also shows the values of < N ef f /N > computed both unconditional and conditioning over the herding intervals. To assess the statistical reliability of the differences observed between the unconditional mean values and the conditional ones we perform a t-test at a 99% confidence threshold of the null hypothesis that the unconditional and conditional means both originates from the same set of normal data. In Table III we label with symbols ⊕ and △ the rejection of this null hypothesis when we compare the unconditional mean of the buy ratio b with the one obtained conditioning to buying (⊕) and selling (△) herding days. Analogously, we label with symbols and ♦ the rejection of the null hypothesis related to the the comparison between the unconditional mean of N ef f /N and the mean estimated conditioning to buying ( ) and selling (♦) herding days.
The results summarized in Table III show that the differences between the unconditional mean values of the buy ratio b and the conditional ones are statistically significant in all cases with the important exception of the uncategorized group investigated at the one day time horizon. Therefore for reversing and trending firms the buy ratio observed during herding is different from 0.5 in a statistical significant way and it is fully supporting the herding hypothesis. For the values of N ef f /N we observe that a statistically robust difference between the unconditional mean values and the conditional ones is observed only for a 15 minutes time horizon for the reversing and uncategorized group. However, also in these cases the difference between the unconditional and conditional values is almost negligible. In fact for this variable, in all cases, the values computed conditionally are very close to or statistically indistinguishable from the values computed unconditionally. This result indicates that during herding intervals the relative activity ω i of various firms of each group is, on average, not too far from the unconditional value reflecting the size heterogeneity of the group. By summarizing the results obtained about < b > and < N ef f /N > and their statistical validation we conclude that our herding indicator selects herding intervals which are in average characterized by values of a buy ratio which are supporting the herding hypothesis. We also note that the set of herding intervals is characterized by the same relative activity of the firms of the three groups observed unconditionally.
The values of < N ef f /N > of Table III show that < N ef f /N > is higher for a longer time interval. Moreover, for each time interval < N ef f /N > is higher for trending firms. This result is consistent with the observation that the group of firms with a resulting trending strategy is the most homogeneous one with respect to the size of firms as shown in Fig. 2c.
Our herding indicator is therefore validated and the results obtained show that the herding behavior of firms with a resulting reversing strategy is markedly different from the herding behavior of firms with a trending strategy.
Conclusion -Our results show that a large number of firms trading a financial asset in a financial market are characterized by a well defined resulting strategy. Specifically we detect financial firms that can be classified as trending or reversing firms. In the Spanish Stock Market trending firms are few large financial firms whereas many firms, which are heterogeneous in size, are reversing firms. These findings indicate that most financial firms highly specialize their trading activity. Each resulting strategy most probably reflects the most common or the most prominent investment strategy of major clients of the financial firm.
We also show that trending and reversing firms present a caracteristic pattern of herding behavior both at daily and at intradaily time horizons. Reversing firms are herding quite frequently and uniformly in time whereas trending firms are herding rarely. However, when herding is present the involvement of firms of the group is more pronounced and uniform in trending rather than in reversing firms.
Market dynamics can therefore be seen as the interplay of at least two classes of traders, different in size and responding to the price changes in different ways. It is possible that the fluctuation of price returns, i.e. the market volatility, is significantly affected by the fluctuations in the relative trading intensity of the two groups. Our results open up the possibility of setting up agent based models of financial firms trading in a financial market. These models can now be empirically grounded in the type of resulting strategies characterizing the dynamics of real firms.