An agent-based computational model for China's stock market and stock index futures market

This study presents an agent-based computational cross-market model for Chinese equity market structure, which includes both stocks and CSI 300 index futures. In this model, we design several stocks and one index futures to simulate this structure. This model allows heterogeneous investors to make investment decisions with restrictions including wealth, market trading mechanism, and risk management. Investors' demands and order submissions are endogenously determined. Our model successfully reproduces several key features of the Chinese financial markets including spot-futures basis distribution, bid-ask spread distribution, volatility clustering and long memory in absolute returns. Our model can be applied in cross-market risk control, market mechanism design and arbitrage strategies analysis.


Introduction
On April 16, 2010, CSI 300 index futures succeeded in listing on the China Financial Futures Exchange, which are the first index futures in China and provide a new hedge tool for Chinese financial market practitioners. However, the leverage properties of stock index futures, as well as their hedging strategies which may lead to market shocks, will increase the systemic risk, such as South Korea's stock index futures market manipulation in 2006 and Dow Jones Industrial Average's intraday flash crash caused by the E-mini futures contracts. Under the background that serious financial risk events frequently occurred, it is essential to grasp the law of financial risks and then do a good job in risk control and mechanism design, so that we can develop stock index futures and other derivatives successfully. Considering the co-movement between stock index futures market and its underlying stock market, risk management in a single market is not sufficient. It is critically more important for us to focus on and control cross-market risks.  [1,2]. Xiong et al. confirmed that derivatives can bring risk to stock market from the view of market manipulation [3]. In contrast, Drimbetas et al. argued that stock index futures reduce the stock volatility based on the analysis on the Greek financial market [4]. These studies show that different results are obtained under different samples and different time intervals. However, due to the limitation of empirical study, the impact mechanisms and transmission channels of cross-market risk are unknown. Recently, scholars have pointed out that the trading mechanisms would affect the role of stock index futures on spot market. Based on 42 stock exchanges, Cumming et al. found that the trading mechanisms have significant influence on market liquidity [5]. Ritter suggested that futures market have spillover effects on the spot market and thus stock index futures take the role of information diffusion to stock market [6]. However, due to the complexity of the market micro-structure and investors' behavior, it is difficult to clearly analyze the interaction effects between the futures market and spot market. Hence it is more difficult to study the cross markets information and risk transmission mechanisms using traditional empirical studies or mathematical methods.
Agent-based computational models, which have developed rapidly in recent years, bring an alternative view angle for the research on the complicated relationships of cross markets. Several famous agent-based computation finance (ACF) labs have done some preliminary studies on the pricing of derivatives and the risk formation using agent-based computational models. Cappellini developed an artificial market called SumWEB where stock market and stock index futures market coexist, which provided a basic platform for studying cross-market arbitrage and price manipulation behaviors [7]. Kobayashi and Hashinoto suggested that the market circuit-breaker would do a good job in controlling excessive price fluctuations and stabilizing the market [8]. Ecca, Marches and Setzu established an agent-based computational model which includes an artificial stock market and an artificial stock options market. They concluded that options would reduce the price volatility of the underlying stock [9].
However, the models above still stay far away from real market when talking about trading mechanisms or investors' demand decisions. Some scholars even criticized that some of the existing agent-based computational models are toy models. In this direction, Westerhoff established an artificial stock market with heterogeneous interacting agents to consider some supervise mechanisms such as trading taxes, intervention from the central bank and trading suspension. He pointed out that agentbased models would help to understand the role of regulatory policies [10]. Given that it is still a single-market model, it goes no further on the spot-future cross-market interactions.
We design and develop an agent-based computational model with spot-futures cross-market structure which coincides with the main characteristics of the Chinese stock market and the CSI index futures market. This model can be useful in analyzing asset pricing, information transmission and risk spreading between the futures market and the spot market, as well as the implementation of hedging strategies.

The Model
In this model, there exists a stock market where several stocks are traded and a stock index futures market where one stock index future is available. For each market, there are three types of investor, namely informed traders, uninformed traders and noise traders. What is more important is that there exists a kind of spot-futures arbitrageurs who build or close positions in both markets. Arbitrageurs' behaviors lead to the co-movement between the two markets. For each type of traders, the investment demands are endogenously determined, and are subject to constraints from wealth, risk management level and trading mechanisms in the market, which is largely in line with the present trading mechanisms of the Chinese stock market and the stock index futures market.

Assets
In the artificial markets, we assume that there are five stocks and one stock index futures whose underlying asset is the stock index, which is constructed based on these five stocks' prices.

1) Stocks' common value
The evolution of the stock's common value v * i,t is given by where φ i is the dividend growth rate of stock i, namely the random walk drift of the common value. The simulation time t corresponds with some time interval in the real world, say, 5 seconds. We set the growth rate to be zero due to the extremely short time interval, which means φ i = 0. We assume ε t ∈N(0,1). σ ι,ε >0 stands for the standard deviation in this diffusion process. Parameters of the five stocks are set as Table 1.

2) Stock Index
The unit of the stock index is called "point", and the base period value of the index is 3000 points. The stock index is calculated using the weighted composite price index method, which is showed as follows (2) where M t is the market value of index stocks at period t, which is the sum of current stock price p i,t multiplied by the number of shares outstanding S i,t , and M 0 is that of base period.

3) Index futures' common value
The common value of stock index futures will be calculated according to the futures' theoretical value, that is, v F,t = I t (1+r) T-d+1 , where I t is the current index, T is the expiration date, and d is the days that the stock index future has been listed.

Markets
• There are two markets, a stock market which contains five stocks and a stock index futures market which contains one index futures. Both markets adopt continuous double auction trading mechanism and the T+0 rule, considering the need of high-frequency trading. Investors can place limit orders or market orders. Buy limit orders whose prices are equal to or higher than the best ask price and sell limit orders whose prices are equal to or lower than best bid price are treated as market orders and executed instantly. According to the rules of the Chinese Financial Futures Exchange, limit orders have certain life time, that is, unexecuted limit orders will be cleared at the end of the day.
• The simulation time t is similar to a five-second interval in real world, and there may be several transactions or no transaction during the time.
• Short selling is not allowed in the stock market, but is allowed in the futures market. Thus arbitrageurs can only engage in positive arbitrage, that is, they can only buy stocks and sell futures.
• The stock index future market claims margin, and settles balance of each margin account after the market close every day. Once the investor's equity is less than the minimum margin requirement for holding positions, his positions will be forced to close one by one the next day, until his equity is no less than the required minimum margin.
• The transaction price of the market p i,t is the average price of the several transactions during t, and if no transaction is done, the price is equal to that of last time, namely p i,t = p i,t-1 .
• There exist no transaction costs for both stocks and futures.
• If the wealth of an investor is smaller than a certain amount, he will be identified as bankrupt and exit the market. Another investor who is the same with the former one in investor type, initial wealth and stocks or futures investment will enter the market.

Traders structure and their behaviors
There are seven kinds of investors in the markets. Investors that trade only stocks include informed traders, uninformed traders and noise traders. For each of them, they are designed to randomly choose one stock and invest on it permanently. Also there are three similar types of traders that trade only in the futures market. The spot-futures arbitrageurs trade in both stock market and futures market.
The spot-futures arbitragers real-timely watch the relationship between the stock index and the price of the stock index futures. Once the futures price is higher than the upper boundary of the no-arbitrage range and reaches the arbitrageur's expected profit point, he will take positions and buy stock portfolios and sell futures in the same time. He will close the position (sell stock portfolios and buy futures) once the futures price falls back to the arbitrage caps, otherwise he will hold the positions to due. The arbitrageurs seek the immediate execution of their orders, thus they only place market orders. To realize risk-free arbitrage, the spot-futures arbitrageurs allocate their wealth between stock portfolios and futures, and keep the ratio of the margin for the whole assets within a specific range keeping the account safe.
The heterogeneous expectations and order submission size for six kinds of single-market traders are described as follows.

1) Trader's expectation on asset price
Since the expectations of the three types of investors who trade only in the stock market are similar to those who trade only in the futures market, we talk about them together and remove the subscript that stands for the asset number for simplicity. Assume that all the investors know the current common value of a stock, while there is divergence in the futures common value. a) Informed trader i accurately know the common value of the stock in the following τ periods when he enters the market, and the expected price is (3) However, as for informed traders in futures market, they cannot accurately know v t+τ as they are not able to predict I t+τ accurately. Here we assume that they learn ˆI t+τ through stock's common value, their expected price ˆp i t+τ will be Uninformed traders cannot know the future common value v t+τ , but they know current common value v t . They obtain their expected prices by mixing three sources, including the current common value v t , τperiod average transaction prices ˉp τ and current midpoint of bid and ask prices p m . The expected price is given by c) The expected price of nosie trader i is randomly chosen within the five levels from the bid and ask prices in the order book, which is given by

2) Order size
Given price p, an investor's optimal positions depend on his utility function. Following the demand determined in [11], we assume that investors are absolutely risk averse, namely they make their investment decision by maximizing CARA utility function, and their optimal positions is where α i is the absolute risk averse coefficient of investor i, V i t is the variance of expected return of investor i, ˆp i t+τ is expected price at period t+τ i , which is different for different types of investors, p is the order submission price. If the demand quantity π i (p) is larger (smaller) than the investor's current position, then the investor buys (sells). V i t is estimated by the variance of past returns:

Parameter Settings
The evolution of common value of the five stocks has been described. Here we only specify parameter settings on the markets and the investors. Most of these parameters are consistent with the market structure and trading rules in the Shanghai Stock Exchange and the China Financial Futures Exchange.
Every simulation will run 54758 steps, corresponding to 19 days. Namely, each day contains 2882 steps and each step stands for five seconds. The risk-free interest rate in our model is 8%, which is close to the annual lending interest rates in China. The order book is cleared every day in both stock market and futures market. The minimum order size required in the stock market is 100 shares as in the real market. The tick size is 0.01 Chinese Yuan for stocks and 0.2 Chinese Yuan for the futures. The minimum margin rate is 18%, which is the margin rate required by brokers in real trading. The multiplier of futures contract in our model is 300 Chinese Yuan per point, which is also consistent with the IF1009 contract.
For the three types of investors in the stock market, each investor permanently invests on one stock which is randomly selected before the program begins. The initial positions are allocated randomly between the range [300, 1500], and the initial cash is equal to the initial values of all his stocks. For the three types of investors in the futures market, each one's initial wealth is 3 million, and for each spot-futures arbitrageur it is 10 million. The orders submission interval for the six kinds of singlemarket investors obeys an exponential distribution, that is, the number of orders during one period follows the Poisson distribution. At the same time, for these six types of single-market investors, the order submission interval is equal to the order life. If they find limit orders submitted before are still unexecuted or not fully executed when they reenter the market, they will cancel the former orders first and then place new orders. For uninformed traders, the variables a i , b i and c i that represent the weights when forecasting prices are randomly chosen from [0, 1]. The capital safety ratio for futures investors, which is the wealth share for futures investment, is no more than 60%. As for arbitrageurs' ex ante expected profits for every futures contract, which should be enough to compensate the execution costs when trading in both two markets, we set them randomly in the range [10,20], which are equivalent to [50, 100] index futures' tick sizes. Each investor's wealth will be updated at the end of every period. If one's wealth is less than the capital to buy 100 shares of his invested stock, he goes bankruptcy and exits the market, while a new investor with the same initial settings as the former one will enter the market. So it is in the futures market when a futures investor can't afford one index futures contract.

The first results
We employ basis, best bid-ask spread, volatility clustering and autocorrelation of returns as well as other key indicators of market features to compare the agent-based computational cross-market model with the 5-second high-frequency data of IF1009 contracts from August 20th, 2010 to September 15th, 2010. Among these indicators, volatility clustering and autocorrelation of returns are common stylized facts in financial markets that adopt continuous double auction trading mechanism [12]. At the same time, they are fundamental for the calibration of agent-based computational models.  (10) We can find that the two groups of basis have similar downward trends which reflect the convergence of stock index and index futures as the maturity date is approaching. Further, the distributions of spot-futures basis are shown in Fig. 2. Similar to the basis between IF1009 and CSI 300, the basis from our simulated model can also be well fitted by the general extreme value distribution.
The distributions of bid-ask spreads are shown in Fig. 3. Both the spreads of IF1009 and that of our simulated futures decreases similarly and the magnitudes of each statistics are roughly identical.
The distributions of logarithmic returns are shown in Fig.  4, where both IF1009 and the simulated futures show the same properties of leptokurtic and fat tails.  Autocorrelation function plots of absolute returns can be used to verify long-term memory. We can also see that Both IF1009 and our simulated futures have similar longterm memory.
Martens suggested that GARCH model can better describe the volatility of stock index futures [13]. To examine the volatility clustering of real data and simulation data, we conduct the test using GARCH(1,1) model, which is shown as follows r t =ar t-1 +br t-2 +ε t (11) σ t 2 = c +αε t−1 Where β is coefficient of GARCH and represents the degree of volatility clustering. A larger β means higher  After comparing the spot-futures basis, the bid-ask spread, volatility clustering and autocorrelation of absolute return, we figure that our agent-based computational model can reproduce the key features of the real spot market and the stock index futures market in China.

More experiments
Further, we carry out more computational experiments to clarify whether the simulation results are stable and whether the parameter settings of the five stocks would affect the outcomes of the model.
There are three parameters for stock common value setting: the initial value v * i,0 , the standard deviation of disturbance σ ι,ε and stock shares in the market. It is easy to understand that the initial value will have no obvious impact on the simulation results. In addition, stock shares in our model are only used to calculate the weights for stock index, so what may affect the outcomes of the model, if any, are disturbances' standard deviations, not the weights, intrinsically. In view of this, we design two extra simulations for different standard deviations of disturbances as in Table 3.

Concluding remarks
According to the characteristics of CSI 300 index futures market and Shanghai stock market, such as continuous double auction trading mechanism, investor types and investment strategies, we build up an agent-based computational model with spot-futures cross-market structure. By analyzing the key properties including spotfutures basis distribution, bid-ask spread distribution, volatility clustering and autocorrelation of absolute returns, and then comparing them with those of real market data, we show that our model can successfully reproduce the Chinese financial markets' features. Thus, the model can be applied to studies such as inherent risk diffusion, critical factors of cross-market risk conduction, trading mechanisms, reasonability of investor structure, and execution risk of trading strategies.
Furthermore, what is the impact of the introduction of stock options and application of related hedging strategies on Chinese stock market? It will be a useful extension to include stock options in our current model to explore the equity markets from a systemic view.