An agent-based computational model for China's stock market and stock index futures market
AAn agent-based computational model for China's stock market and stock index futures market
Hai-Chuan Xu
1, 2 , Wei Zhang
1, 2 , Xiong Xiong
1, 2* , Wei-Xing Zhou
3, 4, 5 College of Management and Economics, Tianjin University, Tianjin 300072, China China Center for Social Computing and Analytics, Tianjin University, Tianjin 300072, China School of Business, East China University of Science and Technology, Shanghai 200237, China Department of Mathematics, East China University of Science and Technology, Shanghai 200237, China Research Center for Econophysics, East China University of Science and Technology, Shanghai 200237, China
Abstract:
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’ de-mands 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 con-trol, market mechanism design and arbitrage strategies analysis.
Keywords:
CSI 300 index futures; Heterogeneous beliefs; Continuous double auction; Cross market; Agent-based model
1. 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 fre-quently occurred, it is essential to grasp the law of finan-cial 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 im-portant for us to focus on and control cross-market risks. Previous studies show controversial results for the role of index futures on the spot market. Some researchers found that futures market may stabilize the spot market, while others found that index futures can shock the underlying stocks. For examples, Bae et al. and Wang et al. separate-ly analyzed South Korea’s KOSPI200 index futures, Hong Kong Hang Seng H index futures and their corre-sponding spot markets, and suggested that stock index futures increase the volatility of the spot market [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 fu-tures 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 mar-ket. 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 dif-ficult to clearly analyze the interaction effects between the futures market and spot market. Hence it is more dif-ficult to study the cross markets information and risk transmission mechanisms using traditional empirical studies or mathematical methods. Agent-based computational models, which have devel-oped rapidly in recent years, bring an alternative view * Corresponding author: [email protected] (X. Xiong). ngle 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 fluc-tuations 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 op-tions 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 inves-tors’ demand decisions. Some scholars even criticized that some of the existing agent-based computational models are toy models. In this direction, Westerhoff es-tablished an artificial stock market with heterogeneous interacting agents to consider some supervise mecha-nisms such as trading taxes, intervention from the central bank and trading suspension. He pointed out that agent-based models would help to understand the role of regu-latory 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, infor-mation transmission and risk spreading between the fu-tures market and the spot market, as well as the imple-mentation of hedging strategies.
2. 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 im-portant is that there exists a kind of spot-futures arbitra-geurs who build or close positions in both markets. Arbi-trageurs’ 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 trad-ing 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.
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. Stocks’ common value
The evolution of the stock’s common value v *i,t is given by v *i,t+ = (1+φ i +σ i, ε ε t +1 ) v *i,t (1) where φ i is the dividend growth rate of stock i , namely the random walk drift of the common value. The simula-tion 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. Parame-ters of the five stocks are set as Table 1. 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 I t = M t / M ×3000 = (Σ p i,t S i,t ) / M ×3000 (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 is that of base period. 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+ , 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. Table 1. Parameters of the five stocks
Stock No. Initial Value S.D. of Disturbance Stock Shares(100 million)
1 10 0.0007 50 2 20 0.0007 40 3 30 0.0003 60 4 40 0.0003 30 5 50 0.0005 50 • 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 or-ders whose prices are equal to or higher than the est ask price and sell limit orders whose prices are equal to or lower than best bid price are treat-ed as market orders and executed instantly. Ac-cording to the rules of the Chinese Financial Fu-tures 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 arbi-trageurs 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 require-ment 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 av-erage 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- . • There exist no transaction costs for both stocks and futures. • If the wealth of an investor is smaller than a cer-tain 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 en-ter the market.
There are seven kinds of investors in the markets. Inves-tors that trade only stocks include informed traders, unin-formed 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 trad-ers that trade only in the futures market. The spot-futures arbitrageurs trade in both stock market and futures mar-ket. The spot-futures arbitragers real-timely watch the rela-tionship 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 posi-tions 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 arbi-trage 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. 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 ˆ p it+ τ = v t+ τ (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 it+ τ will be ˆ p it+ τ = ˆ I t+ τ (1+ r ) T-d+ =(Σ v i,t+ τ S i,t ) / M ×3000× (1+ r ) T-d+ (4) b) 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 mid-point of bid and ask prices p m . The expected price is given by ˆ p it+ τ = ( a i v t +b i ˉp τ +c i p m ) / ( a i +b i +c i ) (5) 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 ˆ p it+ τ = bid + rand it ×( ask -bid ) (6) Order size
Given price p , an investor’s optimal positions de-pend on his utility function. Following the demand de-termined 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 π i ( p ) = ln(ˆ p it+ τ / p ) / (α i V it p) (7) where α i is the absolute risk averse coefficient of investor i , V it is the variance of expected return of investor i , ˆ p it+ τ 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 he investor’s current position, then the investor buys (sells). V it is estimated by the variance of past returns: V it = Σ τ j= ( r t-j − ˉ r it ) / τ i (8) ˉ r it = Σ τ j= r t-j /τ i = Σ τ j= ln( p t-j / p t-j- ) / τ i (9) 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 parame-ters are consistent with the market structure and trading rules in the Shanghai Stock Exchange and the China Fi-nancial 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 mini-mum 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 min-imum margin rate is 18%, which is the margin rate re-quired by brokers in real trading. The multiplier of fu-tures 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 ran-domly 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 fu-tures market, each one’s initial wealth is 3 million, and for each spot-futures arbitrageur it is 10 million. The or-ders submission interval for the six kinds of single-market investors obeys an exponential distribution, that is, the number of orders during one period follows the Pois-son 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 or-ders 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 capi-tal to buy 100 shares of his invested stock, he goes bank-ruptcy 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 in-vestor can’t afford one index futures contract.
3. The simulation results and the statistical properties
We employ basis, best bid-ask spread, volatility cluster-ing 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 indi-cators, 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.
Figure 1. Time series of spot-futures basis (Upper Panel: basis between IF1009 and CSI 300; Lower Panel: basis between simulated stock index and simulated index futures).
Fig. 1 shows the spot-futures basis series of the simulated data and the real data. The spot-futures basis is defined as -10010203040 Time B a s i s Basis -20-10010203040 Time B a s i s Basis = F - S (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 approach-ing. 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.
Figure 2. Distribution of spot-futures basis (Upper panel: distribution of basis between IF1009 and CSI 300; Lower panel: distribution of basis between simulated stock index and simulated index futures).
Fig. 5 calibrates the long-term memory property of real IF1009 return and the simulated index futures return. 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 long-term memory. Martens suggested that GARCH model can better de-scribe the volatility of stock index futures [13]. To exam-ine 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- + br t- + ε t (11) σ t2 = c + αε t −12 + βσ t −12 (12) Where β is coefficient of GARCH and represents the degree of volatility clustering. A larger β means higher volatility clustering. From table 2, we can find that the return series of both IF1009 and simulated futures have similar volatility clustering. They all follows an AR(2)-GARCH(1,1) process and the values of β are 0.81 and 0.90 respectively. Figure 3. Distribution of bid-ask spreads (Upper panel: IF1009; Lower panel: simulated index futures).
After comparing the spot-futures basis, the bid-ask spread, volatility clustering and autocorrelation of abso-lute 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. Bid-ask spread Bid-ask spread -10 0 10 20 30 4000.010.020.030.040.050.06
Basis D en s i t y basisGEV fit -10 0 10 20 3000.010.020.030.040.05 Basis D en s i t y basisGEV fit Table 2. AR(2)-GARCH(1,1) parameter values estimated for the return series of IF1009 and simulated futures
Series a b c α β
IF 1009 -0.047506 (0.004510)* -0.021214 (0.004602)* 1.41E-09 (3.40E-11)* 0.154731 (0.002074)* 0.816699 (0.002024)* Simulated Future -0.525263 (0.004278)* -0.234303 (0.004271)* 1.37E-09 (7.66E-11)* 0.082618 (0.002283)* 0.900256 (0.002667)*
Figure 4. Distribution of logarithmic returns (Upper panel: IF1009; Lower panel: simulated index futures).
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 set-ting: the initial value v *i, , the standard deviation of dis-turbance σ ι,ε 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 dis-turbances as in Table 3. Figure 5. Autocorrelation plots of absolute returns (Upper panel: IF1009; Lower panel: simulated index futures). Table 3. Two simulations for different standard deviations of disturbances
Stock No. Initial Value S.D. of Disturbance Simulation 1 Simulation 2
1 10 0.0005 0.0008 2 20 0.0005 0.0007 3 30 0.0007 0.0006 4 40 0.0007 0.0005 5 50 0.0003 0.0004
Figs. 6-10 show the results of the comparative experi-ments. We can find that for all statistics, namely spot-futures basis, bid-ask spread, logarithmic return and its autocorrelation, the two simulations show similar statisti-cal properties as the real market and the first results in the preceding subsection. Thus, we can conclude that the results of this cross-market model are stable and this A u t o c o rr e l a t i on A u t o c o rr e l a t i on -2 -1 0 1 2x 10 -3 IF1009 return D en s i t y IF1009 returnNormal fit -2 -1 0 1 2x 10 -3 D en s i t y Simulated futures returnNormal fit odel can reproduce the key features of the real spot market and the stock index futures market in China.
Figure 6. Time series of spot-futures basis (Upper Panel: Simulation 1; Lower Panel: Simulation 2).
Figure 7. Distribution of spot-futures basis (Upper Panel: Simulation 1; Lower Panel: Simulation 2). -10 0 10 20 3000.010.020.030.040.05 Basis D en s i t y basisGEV fit -10 0 10 20 3000.010.020.030.040.05 Basis D en s i t y basisGEV fit -20-10010203040 Time B a s i s Basis -20-10010203040 Time B a s i s Basis
Figure 8. Distribution of bid-ask spreads (Upper Panel: Simulation 1; Lower Panel: Simulation 2).
Figure 9. Distribution of logarithmic returns (Upper Panel: Simulation 1; Lower Panel: Simulation 2). -2 -1 0 1 2x 10 -3 D en s i t y Simulated futures returnNomal fit -2 -1 0 1 2x 10 -3 D en s i t y Simulated futures returnNormal fit Bid-ask spread Bid-ask spread
Figure 10. Autocorrelation plots of absolute returns (Upper Panel: Simulation 1; Lower Panel: Simulation 2).
4. Concluding remarks
According to the characteristics of CSI 300 index fu-tures market and Shanghai stock market, such as contin-uous 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 spot-futures basis distribution, bid-ask spread distribution, volatility clustering and autocorrelation of absolute re-turns, 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 exe-cution risk of trading strategies. Furthermore, what is the impact of the introduction of stock options and application of related hedging strate-gies on Chinese stock market? It will be a useful exten-sion to include stock options in our current model to ex-plore the equity markets from a systemic view.
Conflict of Interests
The authors declare that there is no conflict of interests regarding the publication of this paper.
Acknowledgment
We thank Editor Pankaj Gupta and anonymous referees for useful suggestions that helped us improve the paper substantially. This research is partly supported by NSFC (No. 71320107003, 71131007, 71271145), China Pro-gram for New Century Excellent Talents (NCET-07-0605), Program for Changjiang Scholars and Innovative Research Team (IRT1028).
References [1]
S. C. Bae, T. H. Kwon, J. W. Park, “Futures trading, spot market volatility, and market efficiency: the case of the Korean index futures markets,” Journal of Futures Markets, vol. 24(12), pp. 1195-1228, 2004. [2]
S. S. Wang, W. Li, L. T. W. Cheng, “The impact of h-share derivatives on the underlying equity market,” Review of Quantitative Finance and Accounting, vol. 32(3), pp. 235-267, 2009. [3]
X. Xiong, Z. Yu, Z. Wei et al., “The effect on volatility of stock market and stock index futures market after launching stock index options: a case of KOSPI200 index options,” Systems Engineering–Theory & Practice (in Chinese), vol. 5, pp. 785-791, 2011. [4]
E. Drimbetas, N. Sariannidis, N. Porfiris, “The effect of derivatives trading on volatility of the underlying asset: evidence from the Greek stock market,” Applied Financial Economics, vol. 17(2), pp. 139-148, 2007. [5]
D. Cumming, S. Johan, D. Li, “Exchange trading rules and stock market liquidity,” Journal of Financial Economics, vol. 99(3), pp. 651-671, 2011. [6]
D. Rittler, “Price discovery and volatility spillovers in the European Union emissions trading scheme: A high-frequency analysis,” Journal of Banking & Finance, vol. 36(3), pp. 774-785, 2012. [7]
A. N. Cappellini, “SumWEB: stock market experiment environment for natural and artificial agents,” Swarm Fest, 2004. [8]
S. Kobayashi, T. Hashimoto, “Analysis of circuit breakers using artificial stock market,” Proceedings of the 12th International Symposium on Artificial Life and Robotics (AROB07), pp. 260-263, 2007. [9]
S. Ecca, M. Marchesi, A. Setzu, “Modeling and simulation of an artificial stock option market,” Computational Economics, vol. 32(1-2), pp. 37-53, 2008. [10]
F. H. Westerhoff, “The use of agent-based financial market models to test the effectiveness of regulatory policies,” Jahrbucher Fur Nationalokonomie Und Statistik, vol. 228(2), pp. 195, 2008. [11]
C. Chiarella, G. Iori, J. Perelló, “The impact of heterogeneous trading rules on the limit order book and order flows,” Journal of Economic Dynamics and Control, vol. 33(3), pp. 525-537, 2009. [12]
M. D. Gould, M. A. Porter, S. Williams et al, “Limit order books,” Quantitative Finance, vol. 13(11), pp. 1709-1742, 2013. [13]