1 Introduction

Existing models of financial markets are often based on the interaction among heterogeneous interconnected agents. Trade decisions follow expectations and generally depend on different behavioural rules of investors: several feedback mechanisms determine both the complexity of the entire financial system and the unpredictability of prices. In the last decades, the dynamics of financial markets has stimulated important theoretical contributions by several physicists and mathematicians like Mandelbrot, Stanley, Mantegna, Bouchaud, Farmer, Sornette, Tsallis, among many others. In particular, statistical physics has provided the newborn field of Econophysics with new tools and techniques that allow to model and characterize the operativeness of trading activities. In this way, it is possible to implement in the economic analysis of financial markets, methods and concepts coming from different contexts (Mantegna and Stanley 1999; Helbing 1995, 2012), in order to describe several features, such as agents heterogeneity, psychological and imitative dynamics, emergent phenomena (Simon 1957; Tversky and Kahneman 1974; Kahneman and Tversky 1979; Barberis and Thaler 2003), which allow a realistic representation of the complexity in financial dynamics.

The consciousness about the complex nature of financial markets is not a novelty among economists (Keynes 1936; Schumpeter 2003; Von Hayek 2015; Leijonhufvud 1993). Nonetheless, during the 1970s and the 1980s, the rational expectations (Lucas 1972; Sargent and Wallace 1976) theory sustained the microeconomic approach to Macroeconomics that had, unfortunately, prevailed. Our view is that financial markets should be studied by means of a macroeconomic approach, which puts the core analysis on the relevance of informative signals and their distribution. We stress that not all the relevant information can be known by investors. Because of this incomplete information, agents try to look around in order to find useful suggestions to infer the future evolution of markets. Like in the famous Keynesian metaphor of the “beauty contest”, agents soon discover the ugly truth: one should never try to predict what will happen, but what markets think that will happen, instead. Everyday history shows that market crises are not just matter of perfect information described in models of efficiency (Fama 1970): human interactions and individual psychology cannot be ignored, as financial markets dramatically showed in many situations (Akerlof and Shiller 2010). Financial integration on a global scale is nowadays so extreme that policy-makers must learn how to set innovative policy designs (Delli Gatti et al. 2011), in a context where the current “mainstream” economics approach has not shown, yet, the ability to prevent wild market fluctuations that frequently occur.

The adoption of agent-based models (ABM) in the analysis of financial markets has also given very useful insights in understanding the extraordinary relevance of heterogeneity and interaction among agents (LeBaron 2006; Lux and Westerhoff 2009). In particular, models of traders with different informative sets and simple behavioural rules have shown a quite strong attitude to describe the complex economic dynamics (Brock and Hommes 1997a, b, 1998; Chiarella 1992; Chiarella and He 2001; Day and Huang 1990; Franke and Sethi 1998; Hommes 2001; Lux 1995, 1998; Lux and Marchesi 1999).

In this paper we put an emphasis on an emergent phenomenon involving the agents of complex systems, which has been studied within the perspective of Self-Organized-Criticality (SOC) models (Bak 1996), known as herding. Such an approach is appropriate in studies about financial markets, since the imitation process in trading assumes, at aggregate level, very peculiar features. Recent examples of this stream of literature are Bartolozzi et al. (2005), Nirei (2008) and Biondo et al. (2015), among others. Often, these models have adopted topologies like scale-free and small world networks to describe the social interaction among agents. These topologies can be further refined for a detailed and realistic description of several social systems. Consistent developments have been done, in last few years, by studying multilayer networks (Vazquez 2006; Mucha et al. 2010; De Domenico et al. 2013, 2014; Cardillo et al. 2013; Yagan and Gligor 2012; Brummitt et al. 2012; Nicosia et al. 2013; Bianconi 2013; Cellai et al. 2013; Battiston et al. 2014; Horvát and Zweig 2012; Min and Goh 2013; Lee et al. 2012; Min et al. 2014). Our model relies on these relevant advances in complex networks analysis: see, for example, Boccaletti et al. (2006, 2014) for very detailed surveys.

The first goal of this paper is to model information and transactions dynamics by means of the combined descriptive power of a SOC model and of a rudimental order book. As far as we know, such an approach has not been used yet, for trading agents. We also aim to provide a reliable framework which can further be developed in terms of several aspects, such as the order book microstructure, the techniques of portfolio optimization, and the expectations paradigms. Thus, the model will allow the analysis of the complexity of financial markets, in order to design adequate stabilization policies. Such developments will be contained in forthcoming papers: at this stage, the motivation of this paper is to show that the analysis of the informational cascades gives a reliable description of the aggregate behaviour of markets, while building the basis for the above described enhancements.

With regard to the model here presented, in our multiplex network, nodes are traders and links represent two different aspects of interaction among them in two layers: (1) the first is the informative layer, which configures the global environment of social contacts among market participants and it is built as a small-world network of investors; (2) the second is the trading layer, which represents the trading opportunities for purchases and sales and it is built as a fully connected network, (i.e., each investor, in principle, can trade with any other in the market). Differently from other models describing herding in financial markets (Alfarano et al. 2008; Kononovicius and Gontis 2013), the first layer shows the information dynamics as a composite pressure, which recalls some of the features of a Self-Organized Criticality (SOC) model of earthquakes dynamics (Olami et al. 1992); the second layer adopts a rudimental order book mechanism in order to determine the market price as the result of the matching between supply and demand of heterogeneous traders.

Thus, the model accounts for different informative sets, imitation and prospective utility of agents, whose orders are placed in the order book and consequently executed. Different market mechanisms have been studied in the literature dealing with the market microstructure (Garman 1976; Kyle 1985; Glosten 1994; Biais et al. 1997; O’Hara 1997; Hasbrouck 2007). The order book here presented considers just limit orders. Moreover, the order quantity is always set at one share per transaction. A comparison between the behaviour of an isolated one-asset market and of the corresponding two-assets version (with different correlation degrees) is presented. Despite our toy-model is very simplified from different points of view, it presents some novelties with respect to the existing literature.

First, in order to highlight the specific role played by the information spreading in determining actual trading choices and, more generally, by the awareness in consumer behaviour (Biondo et al. 2013a, b, c, 2014, 2015), we focus on imitation. In a large part of the ABM literature related to financial markets, traders are distinguished in two heterogeneous groups, namely fundamentalists and chartists. The difference derives from the rationale behind trading activities: the former decide by referring to a fundamental value (i.e. the supposed true value of an asset); instead, the latter, by following the trend. The imitative behaviour of a trader has often been modeled by a change of group: e.g., a fundamentalist imitating a chartist would become a chartists. As initially proposed in Biondo et al. (2015), in the present model the imitation refers only to the trading decision, no matter which group the trader belongs to. Indeed, it is reasonable to presume that agents do not necessarily transform their “behavioural root” because of a single trading decision.

Second, the model dynamics shows self-organized criticality features, by exhibiting herding as an emergent phenomenon deriving from the information cascades among agents (Bikhchandani et al. 1992).

Third, a very elementary dividends dynamics is introduced as the main determinant of the fundamental value of assets, which is in our model a sluggish variable instead of being assumed as a constant, as it frequently happens in related literature.

Fourth, by considering information and trading ideally separated, this model combines together the influence of contagion in the information diffusion and the orders matching within the expressive potential of multilayer networks.

Summarizing, this paper aims to provide a simple model in order to describe the following complex aspects of real financial markets: (a) the interactive dynamics that constitutes the informative set of traders; (b) the impact of information timing on the execution of orders; (c) the endogenous formation of the price series, generated by means of a truly operating order book mechanism for limit orders placement; (d) the occurrence of individual imitation and herding among agents due to informational cascades; (e) the role played by the correlation among two separate asset markets (in the most elementary setting in which the second market is just an extension of the first one) in widening aggregate returns fluctuations.

The paper is organized as follows: Sect. 2 contains the description of the multilayer model when a single-asset order book is addressed; in Sect. 3 a generalization of the multilayer model to the case with two correlated assets, is considered and discussed; finally, Sect. 4 presents some conclusion remarks.

Fig. 1
figure 1

The two-layers configuration of the ML-CFP model. The upper layer (or informative layer) is a 2D Small World square lattice with N traders, connected by means of short and long-range links. The lower layer (or trading layer) is a fully connected network where each trader is connected to all the others. In both layers, different colors represent different levels of information: the brighter a trader is, the more informed she is. Initial levels of information are distributed randomly

2 The ML-CFP Model: One Asset

The model here presented extends the basic network framework contained in Biondo et al. (2015). Several improvements have been applied in terms of the pricing of orders, the individual status settings, the imitation definition, the existence of the order book. In particular, the main update regards the introduction of a second layer, devoted to very simplified order book mechanism where, at the beginning, only one asset will be considered. In such a way, this order-book-driven Multi-Layer Contagion-Financial-Pricing model (ML-CFP henceforth) results in a two-layers network, as depicted in Fig. 1. More precisely, it is a multiplex, since the nodes (traders) are the same in both the layers. The edges are, instead, representative of two different activities involving traders: in the first layer—the informative one—they stand for the information transmission; in the second layer—the trading one—they are intended as the transactions possibilities. In particular, the social network that constitutes the first layer is a Small World (SW) network populated by heterogeneous traders \(A_i\) (with \(i=1,\ldots ,N\)). With respect to its first version, introduced in Watts and Strogatz (1998), we consider here a two-dimensional regular square lattice (with open boundary conditions and an average degree \(\langle k\rangle =4\)), where each node has been rewired with a probability \(p=0.02\). Notice that, once the network is built, its topology remains always the same for all simulations. In the second layer, instead, we adopted a complete graph, so that the trading network is fully connected and gives each agent the opportunity to trade with anyone else (see below for details).

The model operation follows a basilar info-trading dynamics, made of 2-phases at each time-step t, which allows each trader to acquire information by means of her linked neighbours in the first layer and then to set desired orders and possibly to negotiate transactions with all other traders. In fact, the order book mechanism is equivalent to consider a fully connected network for transactions.

2.1 The Informative Layer

Each market participant receives, uniformly at each time step, a global informative pressure. This represent the common environment that traders live in everyday, which characterizes the climate of markets. A real variable \(I_i(t)\) \((i=1,2,\ldots ,N)\), associated to each investor, represents individual information at time t, as a sort of container of news resulting from her involvement in the market. At the beginning of simulations, i.e. \(t=0\), the informative level of each trader is set at random, in such a way that \(I_i(t) \in [0,I_{th}]\), where \(I_{th}\) is the activation threshold, which will be referred to below, assumed equal to 1 for all agents.

At any time-step \(t > 0\), the information accumulated by each trader is increased by a quantity \(\delta I_i\), different for each agent and randomly extracted within the interval \([0,(I_{th}-I_{max}(t))]\), where \(I_{max}(t)= max \{I_i(t)\}\) is the maximum value of the agents’ information at time t. This process may cause a given trader \(A_k\) surpasses her activation threshold value at a given time \(t=t_{av}\). In this case, the agent becomes active and transmits information to other traders linked to her (i.e., her neighbours in the network) about her status and order. Such a transmission, in turn, may cause other activations if some of the neighbours overcome their threshold too: in this case they are activated. They will imitate both the status and price of the first agent and, also, transmit the same information to their neighbours, and so on. This is the way the herding avalanche emerges and all involved traders imitate the same decision, while the others act independently. Thus, in our model the term contagion is referred to the informational cascade that may occur among market participants. In part of the literature about interbank markets, the same term is instead used with other meanings, e.g., default-driven contagion, illiquidity-contagion.

For the provided description of the informative pressure, our model is closely comparable to the one by Olami et al. (1992), which is devoted to resemble the energy transmission in earthquake dynamics. Thus, traders receive two kinds of signal: a global one, which reaches all agents, and an individual one, which starts from active traders and involve their neighbours. This process of information spreading is engineered in such a way that whenever a trader \(A_k\) overcomes her activation threshold, \(I_{th}\), she empties her collector and the level of information of each of her neighbours is correspondingly increased. It, then, evolves according to:

$$\begin{aligned} I_k > I_{th} \Rightarrow \left\{ \begin{array}{l} I_k \rightarrow 0, \\ I_{nn} \rightarrow I_{nn} + \frac{\alpha }{N_{nn}} I_k, \end{array} \right. \end{aligned}$$
(1)

where: nn denotes the set of nearest-neighbours of the active agent \(A_k\), \(I_{nn}\) is the level of information of each of them, \(N_{nn}\) is their number, and the parameter \(\alpha \) accounts for asymmetries of information and/or partial communication. In particular, to set \(\alpha =1\) would mean that a perfect and complete transmission exists. Instead, we believe that it is realistic to presume that part of the information content is lost during communications among market participants, especially in financial markets where the communication (almost always) relies on the word of mouth. Thus, we always set \(\alpha <1\) in all simulations. Further, we also assume that information is not perfectly replicable. This is equivalent to assume that it is (at least partially) a rival good. Thus, the amount of information that a trader can transmit is actually divided among her nearest-neighbours: to communicate with others, especially in a very dynamic context, is time-consuming. Therefore, if a conversation must be repeated with, for example, four people, then either it must last four times the length of a one-to-one speech or, conversely, it must be assumed that (in a given fixed time) a trader “splits” her information in as many parts as the number of her neighbours. Since we did not want to embed in the model any consideration for the time spent by each trader in interpersonal dialogues, we opted for the latter choice. Finally, two remarks about a couple of very unlike cases. First, in case that two traders become active at the same time and, simultaneously, both of them transmit their information to a common nearest-neighbour, all the above-illustrated dynamics remains true, with the sole exception that the recipient trader will perceive just the signal of one of them, chosen randomly. Second, in case that two linked traders, who are reciprocally nearest-neighbour of each other, become active at the same time and, simultaneously, transmit to each other their information exactly when both are, instead, transmitting, then that “inopportune” informative stream is lost and their accumulation will start at the time immediately successive, as explained above.

2.2 The Trading Layer

Possibly triggered by the herding process occurring in the informative layer, at each time step, investors put their orders in the order book: these transactions happen in the trading layer, which resembles the clearing house for negotiations where demand and supply match and the next market price is determined.

For the sake of simplicity, the model does not include any formal portfolio analysis: traders \(A_i\) (with \(i=1,\ldots ,N\)) are simply endowed, at the beginning of each simulation, with the same initial quantity of money \(M_i=M\) (\(\forall i\)) and the same initial quantity of shares \(Q_i=Q\) (\(\forall i\)). The total wealth \(W_i\) of each trader is then defined as: \(W_i=M_i+Q_i\cdot p_t\), where \(p_t\) is the market price of the asset at time t. Finally, notice that money serves just for transactions regulation.

As a first operative hypothesis, let us imagine that the trading layer is autonomous and independent of the informative layer. In this case, the status setting and price formation phases for an individual agent is not affected by the behaviour of other traders. As in many other contributions existing in related literature, we consider the existence of two concurrent methodological approaches to trading decisions: market participants are divided in two groups, namely fundamentalists and chartists.

Fundamentalists due their name to the fact that they presume the existence of a fundamental value, \(FV_t\), of the asset. Such a fundamental value represents, for these traders, the “correct” value of the asset. Therefore they think that the market price will always tend to it. In related literature, it is quite common to assume that the fundamental value is fixed. In our model, it is a sluggish variable, whose time variation happens every \(t_f\) time-steps according to:

$$\begin{aligned} FV_{t+t_f}=FV_{t}+\mathbb {D}_{t} \end{aligned}$$
(2)

where \(FV_0=0\) and \(\mathbb {D}_{t}\) is a random variable extracted from a normal distribution with zero mean and standard deviation \(\sigma _f\). We simplistically assume that such a variable represents the yearly yield of the asset, which is assumed to follow a random walk. From a very simplified perspective, one could also interpret it as the dividend value, which could be either positive or negative (in case of profits or losses, respectively).

The fundamental value is then used by each fundamentalist in order to build her personal opinion: her fundamental price, \(p^{F}_{t}\), is

$$\begin{aligned} p^{F}_t=p_0 + FV_{t}+ \Theta \end{aligned}$$
(3)

where \(p_0\) is the initial global asset price and \(\Theta \) is randomly chosen in the interval \((-\theta , \theta )\), in order to account for the heterogeneity of investors. Thus, fundamentalists form their expected price for the asset according to

$$\begin{aligned} E[p_{t+1}]=p_t+\phi (p^{F}_t - p_t) + \epsilon \end{aligned}$$
(4)

where the parameter \(\phi \) describes the expected speed of convergence to the fundamental price and \(\epsilon \) is a stochastic noise term, randomly chosen in the interval \((-\sigma , \sigma )\). The value of \(\phi \) is constant and equal for all fundamentalists.

Chartists’s name descends from the relevance of price charts in their behavioural choice. In particular, they build a past reference value \(PRV_t\), computed at any t by averaging prices included in a time window of length T, different for each chartist and randomly chosen in the interval \((2,T_{max})\):

$$\begin{aligned} PRV_t=\frac{1}{T} \sum _{j=t-T}^{t} p_j. \end{aligned}$$
(5)

Then, the expected price for the next time-step is determined by each chartist as

$$\begin{aligned} E[p_{t+1}]=p_t+\frac{\kappa }{T} (p_t - PRV_t) + \epsilon \end{aligned}$$
(6)

where \(\kappa \) describes the expected speed of convergence to the past reference value and \(\epsilon \) is defined as in Eq. (4). The value of \(\kappa \) is constant and equal for all chartists.

Once the expectations have been determined, their comparison with the current market price induces the trading decision of each agent. More precisely:

  • if \(E[p_{t+1}] > p_{t} + \tau \) traders will expect a rise in the market price and decide to buy the asset, and their status \(S_i\) will be bidder;

  • if \(E[p_{t+1}] < p_{t} - \tau \) traders will expect a fall in the market price and they will decide to sell the asset, and their status will be asker;

  • if \(p_t - \tau< E[p_{t+1}] < p_{t} + \tau \), traders will decide to hold on, without doing nothing.

where the threshold parameter \(\tau \) has been introduced so that expectations must be sufficiently strong in order to induce a behavioural choice.

2.3 Order Book Operations

Let us describe the operativeness of the elementary limit order book included in the model in order to establish the priority in negotiations and regulate transactions.

When active, according to her expectations, each trader sets her order in the book by setting also the preferred price for the transaction. Such price will be a function of the expectations that inspired the status of the trader. If the trader is a bidder, her chosen bid price will be extracted (with uniform probability) from a range whose minimum is the best ask and the maximum is the trader’s expectation. The economic intuition behind this procedure is twofold. Consider first the minimum: since the best ask is the lowest willingness to accept that the bidder is facing, it would not be convenient to set a bid price lower than that, because in such a case no asker would sell. Then, consider the maximum: the expectation of the bidder is the highest price that the asset is going to assume in her opinion, thus no bidder would pay more than that. Conversely, if the trader is an asker, the chosen ask price will be extracted (with uniform probability) from a range, whose minimum is the expected price and the maximum is the expected price plus twice the difference between the current price and the expected one. Here, the rationale for the minimum is basically that no asker would ever sell at a price lower than the worst scenario that she can predict, whereas the maximum is determined as a chance to exploit the potential willingness to pay of possible bidders. Once the individual price has been set, each trader posts her order in the book and the negotiations may (possibly) start.

The interaction between the trading and the informative layer may now play a role: actually, if a herding avalanche is going on, all the traders involved in it, no matter whether fundamentalists or chartists, will imitate both the status and the price of the agent who was firstly activated and started the avalanche itself. Indeed, when a frantic contagion starts in true financial markets, this is exactly what happens: if a trader gets involved in the herding, no matter which her expectation or status was, she will obey to the market!

Both sides (buy and sell orders) of the book are ranked accordingly with their associated prices. Bid prices are ranked in decreasing order of willingness to pay: in such a way, the trader who has set the highest bid price (namely the best-bid, \(p^B_{best}\)) will be the top of the list and will have the priority in transactions. Conversely, ask prices are ranked in increasing order of willingness to accept: the trader with the lowest willingness to accept (who sets the so-called best-ask, \(p^A_{best}\)) will be the top of the list and will have the priority in transaction execution. Then, in this very simplified toy-model of order book, the matching is done by simply comparing the best ask and the best bid. The number of transactions \(N_T\) that actually does occur between askers (whose total number is \(N_a\)) and bidders (whose total number is \(N_b\)) strictly depends on such a comparison: actually, only if \(p^B_{best} \ge p^A_{best}\) best-ask we have \(N_T>0\), i.e. a given number of transactions occur. Notice that when a transaction is executed, it is negotiated at the best ask, which is the desired price set by the seller, also in case the best bid is greater, i.e., the buyer is willing to pay even more. After the first transaction, occurring among traders who posted their own order at the best price, both from the demand or the supply side, transactions continue following the order in the book (ascending for the ask list and descending for the bid list) until the bid price is greater than the ask price and all the transactions are regulated at the ask price. Finally, the new global asset price will be \(p_{t+1} = p_L\), where \(p_L\) is the ask price of the last negotiated transaction.

Notice that no short-selling or borrowing activities are allowed. Therefore, a feasibility check is always executed before an order is posted in the book. For example, if a bidder (respectively an asker) has not money (assets) to buy (to sell), she will not be allowed to post any order. Finally, recall that for the sake of simplicity, only 1-share transactions are allowed. As in other prototypical models of order book (Chiarella and Iori 2002), the reliability of the mechanism is firstly checked by the simplest operativeness. In a forthcoming paper, this restriction will be relaxed.

2.4 Simulations Results

We now turn to present simulation results of the ML-CFP model with one asset, aimed to see the model at work. Since we present here the dual layer version with order book of the CFP model firstly introduced in Biondo et al. (2015), the first step is the validation of the model by ensuring that this new enriched version can replicate the most relevant stylized facts of financial markets, as described in Chakraborti et al. (2009). In particular, we will focus on the fat tails of the returns density functions (PDFs), the absence of autocorrelation in returns series, and the existence of volatility clustering, i.e., the positive autocorrelation of the absolute values of the returns series.

Consider a network of \(N=900\) traders, equally divided in 450 fundamentalists and 450 chartists. The (typical) initial setup for the values of the control parameters of the model is the following: \(p_0=500\) (initial price), \(\alpha =0.95\) (level of conservation of information), \(\sigma _f=2\) (standard deviation of the normal distribution for the fundamental value \(FV_t\)), \(t_f=10\) (time increment for \(FV_t\)), \(\Theta =30\) (range of variation for the fundamentalists’ heterogeneity), \(\phi =0.5\) (sensitivity parameter for fundamentalists), \(T_{max}=100\) (maximum extension of the window for chartists), \(\kappa =2\) (sensitivity parameter for chartists), \(\sigma =30\) (maximum intensity of the stochastic noise for the expectation values), \(\tau =15\) (sensitivity threshold for the status setting), \(M=40{,}000\) (initial quantity of money) and \(Q=200\) (initial quantity of the asset).

In the top panel of Fig. 2 we show a typical time evolution of the market price. After a transient of 5000 time-steps, which is needed for the system to enter in the SOC regime (i.e., the system approaches the critical state and power-law distributed avalanches appear in the informative layer), agents start to trade and the values of the asset price are plotted for the next 10,000 time-steps, starting from the initial price \(p_0=500\).

Fat tails distribution of returns Sometimes, very strong fluctuations are visible in the price series (and, consequently in the returns series), due to the effects of herding avalanches. It is well known that financial returns distributions are non-Gaussian curves and that, in particular, they exhibit so-called fat tails, proving that extreme events exist and are not bounded within any fixed standard deviation. These events, of course, affect the volatility of the price, as emerges from the normalized returns time series, reported in the middle panel. Consequently, the PDFs of normalized returns, plotted in the bottom panel of Fig. 2, shows the asymmetric fat tails characteristic of financial markets, a sort of signature of the presence of extreme events. In panel (a) of Fig. 3 we present also the QQ-plot of the simulated returns obtained from the ML-CFP price series. This kind of graph compares quantiles of a distribution with quantiles of a Gaussian. The straight line \(y=x\) is the test benchmark, since it represents the case of a distribution that behaves normally. The cross shapes curve, clearly deviating from linearity, confirms the presence of fat tails and therefore of a non-Gaussian behaviour. On the other hand, the distribution is just slightly leptokurtic, as visible from the comparison with a Gaussian curve with zero mean and unitary variance. This is probably a consequence of the strong approximation adopted in the ML-CFP model, where only one asset is considered and the orders are limited to one. Under these conditions, the system evidently is able to self-organize itself, maintaining a dynamical balance between purchase orders and sales.

Fig. 2
figure 2

Top panel Typical time series for the market price. Middle panel Normalized returns of the same price series. Bottom panel Probability density distribution (PDF) of the normalized returns compared with a Gaussian distribution of unitary variance

Fig. 3
figure 3

Stylized facts of simulated data: 1 asset. a Q–Q plot of simulated returns PDF clearly shows that the model generates price series whose returns are evidently fat tailed. b The autocorrelation function of simulated returns and of their absolute values shows that the model generates uncorrelated returns whose volatility is clustered, i.e., the ACF of absolute returns slowly decays towards zero remaining positive for all considered lags

Absence of auto-correlations of returns The absence of autocorrelations of returns is sometimes referred to as the absence of simple arbitrage possibilities: i.e., on average, it is not possible to predict the price variation from t to \(t+1\). Thus, profits may derive just from risky investments. Such a feature is documented for true financial time series by Pagan (1996) and in Cont et al. (1997), among others. In panel (b) of Fig. 3, the plot of the autocorrelation function (ACF) gives evidence that the simulated returns series does exhibit absence of autocorrelation.

Volatility clustering The third important fact that validates the presented model is the circumstance that absolute returns exhibit a long-range slowly decaying autocorrelation function. This property of financial time series has been named “volatility clustering” and described in Mandelbrot (1963), and it means that the size of the variations in the returns is autocorrelated: high volatility is followed by high volatility and low volatility is followed by low volatility. In panel (b) of Fig. 3, where we have shown the ACF of returns (see above), we also plot the ACF of absolute values of the same simulated returns series, showing that a persistent autocorrelation exists and that it decays quite slowly, exactly as it reported for true markets in related literature.

Fig. 4
figure 4

Left column From top to bottom, final distributions of the asset quantity, money and wealth of all traders. Central and right columns The same distributions are plotted separately for fundamentalists and chartists

Final distributions In Fig. 4 we plot the final distributions of the asset quantity, money and wealth for all the traders (left column) and, separately, for the fundamentalists (central column) and chartists (right column). The initial values of the three quantities, equal for all the traders, are also reported as dashed vertical lines. Recall that the presented model is a closed system, then, this will naturally separate traders in winners and losers. As one could expect, the final distributions appear to be widespread around their initial values but, in terms of money and asset quantity, the trading dynamics seems to balance well between gains and losses. The only source of asymmetry is the small difference between the average number of buyers and sellers that changes its sign for fundamentalists and chartists, leading the former group to slightly favor purchases and the latter to slightly favor sales. This, in turn, induces fundamentalists to sell their assets, thus increasing their money, and chartists to buy new assets, thus decreasing money. These two variables and the fluctuations in the asset price, evidently compensate in producing a similar final wealth distribution for the two groups.

Table 1 Simulations Scenarios

Robustness of the results In order to test the robustness of the results, we initially performed 10 repetitions of the dynamics with the same simulation setup adopted up to now, but with different initial conditions, averaging some interesting final quantities. For example, we considered the average number of extreme events during the whole time period, identified by the occurrence of normalized returns whose value exceed three standard deviations: in this case we found 29 events of this type. We also calculated the average number of askers and bidders during the same period, which were, respectively, \(N_a=229.61\) and \(N_b=220.42\). Furthermore, over an average number of transactions equal to \(N_T=88.65\), the average numbers of buyers and sellers were, respectively, 52.02 and 52.49 for fundamentalists, and 51.2 and 50.75 for chartists, indicating a strong average equilibrium among the competing forces in the market.

All these values, together with the actual setup of the global control parameters, are reported (in bold) in column A of Table 1. In columns from B to L, the same quantities have been calculated in different scenarios (averaging again over 10 realizations), each one with a different value of a single global control parameter (in italics). As visible comparing all these scenarios with the first one, the simulation results are quite robust and remain substantially unchanged if one varies the relative proportion of fundamentalists and chartists (B–C), the initial asset endowment (D), the initial money quantity (E), the initial value of the asset price (F) or the sensitivity parameter for the expectation prices of chartists (G).

On the other hand, they are quite sensitive with respect to variations in other control parameters, like the sensitivity parameter for the expectation prices of fundamentalists (H), the sensitivity threshold for the status setting (I) or the maximum intensity of the stochastic noise (L): in these cases, the observed equilibrium between bidders and askers can become unstable and, typically, one of the two trading groups, fundamentalists or chartists, start to buy the asset much more than the other one, thus generating a spiral effect that leads fundamentalists or chartists to spend all its money thus being pushed, in fact, out of the market. In this respect, it is worth noticing that in this model we did not add any dynamics that affects the composition of the population of investors. Therefore, should a category vanish, the simulations would continue by means of transactions due to the heterogeneity within the surviving group. A control for the population dynamics will be added in the next release of the model. Such an augmentation will also allow to induce a natural selection among traders, who will die when gone out of money or assets.

3 The ML-CFP Model: Two Assets

In this section we generalize ML-CFP model by considering an order book with two assets, aiming to explore how the presence of correlations among the assets could affect the features observed in the previous section. In order to implement such a generalization, we only need to modify the dynamics of the trading layer, while the informative layer rules remain unchanged (since the exchange of information in this layer can be considered as regarding both the assets). Then, we will show the compliance to the stylized facts and, finally, the simulation exercise with its results.

3.1 The Trading Layer

In this generalized version of order book, traders \(A_i\) (with \(i=1,\ldots ,N\)) are endowed, at the beginning of each simulation (i.e. at t \(=\) 0), with an equally valued portfolio, composed by the same initial quantity of money \(M_i(0)=M\) (\(\forall i\)) and the same initial quantities of the two assets \(Q_{1i}(0)=Q_{1}\) and \(Q_{2i}(0)=Q_2\) (\(\forall i\)). At each time step, the total wealth of each trader is therefore defined as: \(W_i(t)=M_i(t)+Q_{1i}(t)\cdot p_{1}(t)+Q_{2i}(t)\cdot p_{2}(t)\), where \(p_{1}(t)\) and \(p_{2}(t)\) are the market prices of the two assets at time t. At \(t=0\), of course, all traders will have the same initial wealth \(W_i(0)=M_i(0)+Q_1\cdot p_{1}(0)+Q_2(t)\cdot p_{2}(0)\), being \(p_1(0)\) and \(p_2(0)\) the initial asset prices.

Two groups of traders do exist in the market, as in the mono-asset case: fundamentalists and chartists, with unchanged behavioural attitudes. Fundamentalists presume the existence of a fundamental value for each asset, \(F_{V_1}\) for asset 1 and \(F_{V_2}\) for asset 2, as:

$$\begin{aligned}&{F_V}_1{(t+t_f)}={{F_V}_1}{(t)}+{D_1}{(t)}\end{aligned}$$
(7)
$$\begin{aligned}&{F_V}_2{(t+t_f)}={{F_V}_2}{(t)} +{D_2}{(t)} \end{aligned}$$
(8)

where \({F_{V_1}}{(0)}=0\) and \({F_{V_2}}{(0)}=0\), while \({D_1}{(t)}\) and \({D_2}{(t)}\) are random variables extracted from two normal distributions with zero mean and standard deviations \({\sigma _{1}}_f\) and \({\sigma _{2}}_f\), respectively. Individual fundamental prices, \({p_{F}}_1(t)\) and \({p_{F}}_2(t)\), are computed as:

$$\begin{aligned}&{p_F}_1(t)={p_1}(0) + {F_V}_1(t)+ \Theta \end{aligned}$$
(9)
$$\begin{aligned}&{p_F}_2(t)={p_2}(0) + {F_V}_2(t)+ \Theta \end{aligned}$$
(10)

where \(\Theta \) is a parameter randomly chosen in the interval \((-\theta , \theta )\), in order to account for the heterogeneity of investors. Finally, personal expected prices for the two assets are:

$$\begin{aligned}&E[p_1{(t+1)}]=p_1(t)+\phi \cdot [{p_{F}}_1(t) - p_1(t)] + \epsilon \end{aligned}$$
(11)
$$\begin{aligned}&E[p_2{(t+1)}]=p_2(t)+\phi \cdot [{p_{F}}_2(t) - p_2(t)] + \epsilon \end{aligned}$$
(12)

where all parameters are defined as the mono-asset case.

Chartists consider, in this case, two past reference values \({P_{RV}}_1(t)\) and \({P_{RV}}_2(t)\), computed at any t by averaging the previous prices over a time window of length T, different for each chartist (supposed equal for both assets) and randomly chosen in the interval \((2,T_{max})\):

$$\begin{aligned}&{P_{RV}}_1(t)=\frac{1}{T} \sum _{j=t-T}^{t} {p_1(j)} \end{aligned}$$
(13)
$$\begin{aligned}&{P_{RV}}_2(t)=\frac{1}{T} \sum _{j=t-T}^{t} {p_2(j)} \end{aligned}$$
(14)

Then, the expected prices of each chartist are

$$\begin{aligned}&E[p_1{(t+1)}]=p_1(t)+\frac{\kappa }{T} \cdot [p_1(t) - {P_{RV}}_1(t) ] + \epsilon \end{aligned}$$
(15)
$$\begin{aligned}&E[p_2{(t+1)}]=p_2(t)+\frac{\kappa }{T} \cdot [p_2(t) - {P_{RV}}_2(t) ] + \epsilon \end{aligned}$$
(16)

where all parameters have the same meaning as in the single asset case.

The phases of the status, price, and quantity settings are totally homologous to the mono asset case. Now, if \({p_L}_1\) and \({p_L}_2\) are, respectively, the ask prices of the last transactions occurred in the two order books, the new global asset prices for the two assets will be determined as

$$\begin{aligned}&{p_1}(t+1) = {p_L}_1 + \delta \cdot \omega _2\end{aligned}$$
(17)
$$\begin{aligned}&{p_2}(t+1) = {p_L}_2 + \delta \cdot \omega _1 \end{aligned}$$
(18)

where \(\omega _1\) and \(\omega _2\) are the market imbalances for the two assets, defined as

$$\begin{aligned}&\left\{ \begin{array}{ll} \omega _1= {N_b}_1 - {N_T}_1&{}\quad {\textit{if}}\ \ {N_b}_1 \ge {N_a}_1 > 0 \\ \omega _1= -({N_a}_1 - {N_T}_1) &{}\quad {\textit{if}}\ \ 0< {N_b}_1 < {N_a}_1 \end{array} \right. \end{aligned}$$
(19)
$$\begin{aligned}&\left\{ \begin{array}{ll} \omega _2= {N_b}_2 - {N_T}_2&{}\quad {\textit{if}}\ \ {N_b}_2 \ge {N_a}_2 > 0 \\ \omega _2= -({N_a}_2 - {N_T}_2)&{}\quad {\textit{if}}\ \ 0< {N_b}_2 < {N_a}_2 \end{array} \right. \end{aligned}$$
(20)

while \(\delta \) is a parameter which quantifies the degree of correlation between the two asset prices. In such a way, we introduce a feedback mechanism that, according to the unsatisfied side of the market (i.e. either bidders or askers who could not trade for missing counterparts) for a given asset, do influence the price of the other asset, which receives a proportional shift \(\delta \cdot \omega \). Thus, for example, in case of an excess of demand for, say, asset 2 (i.e. bidders are greater in number than askers and therefore some of them cannot trade the asset 2 at the desired price), the price of asset 1 will be increased proportionally to the excess itself. Conversely, if askers are greater in number than bidders for asset 2, the price of asset 1 is decreased proportionally to the excess of supply. Of course, the same happens by inverting the labels of the two assets.

3.2 Simulations Results

Consider, also in this case, a network of \(N=900\) traders, with \(50\%\) of fundamentalists and \(50\%\) of chartists. The (typical) initial setup for the values of the control parameters of the model is the following: \(p_1(0)=p_2(0)=500\) (initial asset prices), \(\alpha =0.95\) (level of conservation of information), \({\sigma _1}_f={\sigma _2}_f=1\) (standard deviations of the normal distribution for the fundamental values \({F_V}_1(t)\) and \({F_V}_2(t)\)), \(t_f=10\) (time increment for \({F_V}_1(t)\) and \({F_V}_2(t)\)), \(\Theta =30\) (range of variation for the fundamentalists’ heterogeneity), \(\phi =0.5\) (sensitivity parameter for fundamentalists), \(T_{max}=100\) (maximum extension of the window for chartists), \(\kappa =2.0\) (sensitivity parameter for chartists), \(\sigma =30\) (maximum intensity of the stochastic noise for the expectation values), \(\tau =15\) (sensitivity threshold for the status setting), \(M=40000\) (initial quantity of money) and \(Q_1=Q_2=200\) (initial endowment of the two assets).

Fig. 5
figure 5

Top panel Simulated time series of market prices of the two assets (\(p_1(t)\) and \(p_2(t)\)) in presence of correlations (\(\delta =0.03\)) and of the weighted average price p(t) (\(1+2\)). The initial price is also indicated as an horizontal dashed line. Middle panel Normalized returns of the weighted average price series. Bottom panel Corresponding probability distribution (PDF). A Gaussian distribution of unitary variance (full line) is also reported for comparison

In the top panel of Fig. 5 we show a typical time evolution of the two global asset prices \(p_1(t)\) and \(p_2(t)\), and of the weighted average price p(t) defined as

$$\begin{aligned} p(t) = p_1(t) \cdot \beta _1 + p_2(t) \cdot \beta _2 \end{aligned}$$
(21)

where the weights \(\beta _1=Q_1/(Q_1+Q_2)\) and \(\beta _2=Q_2/(Q_1+Q_2)\) are fixed by the initial endowment of the two assets. According to our parameter’s choice, \(\beta _1=\beta _2=0.5\), therefore p(t) is simply the average of \(p_1(t)\) and \(p_2(t)\). We also set \(\delta =0.03\) in Eqs. (17) and (18) to study the effect of correlations between the two assets.

In this panel we plot the first 10,000 time-steps after a transient of 5000 time-steps, starting from the common initial price (500), which is highlighted by an horizontal dashed line. The fluctuations of the two prices \(p_1(t)\) and \(p_2(t)\), due to the effect of the herding avalanches, characterize the whole time series. Furthermore, the time evolutions of both the prices appear to be strongly coupled: reversals in the price values can be observed at 2000 and 6500 time-steps, where sudden price falls of, respectively, \(p_2\) and \(p_1\), take place. Such a dynamics, due to the presence of prices correlation, induces in turn a higher volatility in the weighted average price p(t), as shown in the time series of normalized returns shown in the middle panel. As a consequence, fat tails appear in the corresponding PDF of the bottom left panel, thus confirming the presence of extreme events. Notice that, at variance with the analogous PDF of the model with only one asset (shown in the bottom panel of Fig. 2), here the central part of the distribution also deviates from a Gaussian behavior (a Gaussian curve is plotted as full line for comparison).

We can now to test the compliance of these results with the above-mentioned stylized facts. Immediately after we will look to the details of the final distributions of assets, money and wealth.

Fig. 6
figure 6

Stylized facts of simulated data: 2 assets. a: Q–Q plot of simulated returns PDF clearly shows that the model generates price series whose returns are evidently fat tailed. b The autocorrelation function of simulated returns and of their absolute values shows that the model generates uncorrelated returns whose volatility is clustered, i.e., the ACF of absolute returns slowly decays towards zero remaining positive for all considered lags

Fat tails distribution of returns Such a feature is successfully replicated by the model, as already said commenting the bottom left panels of Fig. 5. Further, in panel (a) of Fig. 6 we show the QQ-plot of the normalized returns. As in the 1-asset case, previously described, the cross shapes curves clearly deviates from linearity, thus confirming the presence of fat tails.

Absence of auto-correlations of returns The model confirms its compliance also with regard to this second stylized fact. In fact, as it is shown in the panel (b) of Fig. 6, the simulated returns series does exhibit absence of autocorrelation, since the ACF curve oscillates around the zero line (also plotted for comparison).

Volatility clustering Finally, in the same panel (b) of Fig. 6, we also report the ACF of the absolute values of the normalized returns (i.e. the volatility clustering). Its behavior shows that a persistent autocorrelation does exist, since the curve decays quite slowly staying above zero for any lag size, that is the evidence of the compliance of the model to the third stylized fact.

Fig. 7
figure 7

Final distributions of asset quantity, money and wealth for, respectively, fundamentalists (left column) and chartists (right column). The initial values of the three quantities, equal for all the traders, are also reported as dashed vertical lines

Final distributions Let us now look to the microscopic details of some interesting quantities as they appear at the end of the simulation presented in Fig. 5. In Fig. 7, the final distributions of asset quantity, money and wealth for, respectively, fundamentalists (left column) and chartists (right column), are plotted. The initial values of the three quantities, equal for all the traders, are also reported as dashed vertical lines. As one could see, fundamentalists accumulate a great quantity of asset 1, while mainly tend to sell asset 2: as a consequence, at the end of the simulation all of them have less money with respect to the beginning, but their total wealth stay always above the initial value. On the other hand, chartists mainly tend to sell asset 1, while have a quite neutral behaviour with respect to asset 2: in such a way, many of them increase their initial capital in terms of money, even if their total wealth always remain well below the initial value. Such a scenario is consistent with the details about the average percentage of fundamentalists and chartists who buy or sell, calculated over the whole simulation. In this respect, at a first sight, the situation does appear quite equilibrated: actually, for fundamentalists, we have \(26\%\) of buyers and \(24\%\) of sellers, while, for chartists, \(25\%\) of buyers and \(26\%\) of sellers. However, although very small, in the long term these slight discrepancies account for the different attitude of the two kind of traders and, in turn, for their different wealth and portfolio.

Finally, as in the 1-asset version of the model, also in this case we tested the robustness of the results by performing 10 repetitions of the dynamics with different scenarios of the control parameters. Again, we found that the main features of the model remain substantially unchanged—from a statistical point of view—with respect to the variation of some parameters (as the relative proportion of fundamentalists and chartists, the initial asset endowment, the initial money quantity, the initial value of the asset price and the sensitivity parameter for the expectation prices of chartists), while they are more sensitive to the others (like the sensitivity parameter for the expectation prices of fundamentalists, the sensitivity threshold for the status setting and the maximum intensity of the stochastic noise).

4 Conclusions

In this paper we have presented a multilayer order-book model of financial market with an informative contagion dynamics. The model is inspired by self-organized criticality phenomena and, despite it relies on simplifying assumptions about assets and orders, as described above, it shows significative compliance to the most acknowledged statistical features of real financial markets. This result allows concluding that the characterization of the informative dynamics among traders can fruitfully help explaining the aggregate behaviour of markets. This conclusion is also supported by a reinforcing effect played by existing correlations among assets. In order to show it, two different global settings have been discussed: a mono-asset and a two-assets setting.

The model showed robust compliance to most acknowledged stylized facts observed in true financial markets, such as fat tailed distribution, absence of autocorrelation and volatility clustering for the returns time series. These statistical regularities are correctly generated by the model in all configuration. Therefore, this version generalizes and complete the previous release described in Biondo et al. (2015), by means of several advances above described.

Nonetheless, at the present stage, this model can still be improved and it is currently being studied as a basis for forthcoming updates. In particular, it was build in order to provide a reliable framework to be developed with several refinements regarding portfolio analysis, assets volatility, and market configuration. Further, from a policy perspective, the presented framework will reveal very useful in order to build possible interventions aimed to stabilize market fluctuations. In previous studies, the presence of a small percentage of random traders in the market, has shown to have a decisive role in dampening financial fluctuations (see Biondo et al. 2013a for details). One of the first extensions of this model will embed such a third kind of traders in the community of investors, while setting a more appropriate portfolio analysis for fundamentalists and chartists.