Pattern-Oriented Agent-Based Modeling for Financial Market Simulation

4 downloads 0 Views 185KB Size Report
use extrapolative chartists' trading rules, and long horizons investors tend to use mean reverting fundamentalists' trading rules. Generally the approaches to ...
Pattern-Oriented Agent-Based Modeling for Financial Market Simulation Chi Xu and Zheru Chi Department of Electronics and Information Engineering, The Hong Kong Polytechnic University, Hung Hom, Kowloon, Hong Kong [email protected], [email protected]

Abstract. The paper presents a pattern-oriented agent-based model to simulate the dynamics of a stock market. The model generates satisfactory market macro-level trend and volatility while the agents obey simple rules but follow the behaviors of the neighbors closely. Both the market and the agents are made to evolve in an environment where Darwin’s natural selection rules apply.

1 Introduction Although a stock exchange market is a complex system, it obeys the rules a common market supplies to all buyers and sellers. The stock market attracts a lot of investors, and some of them deal with the market profitably from intensive analysis and research into the information with which they make successful judgment towards the state and trend of the market. The intensive research for finding the right stock to buy and the right time to buy it is not fruitless. Financial practitioners use different trading and forecasting strategies, say different agents, such as short horizons investors tend to use extrapolative chartists’ trading rules, and long horizons investors tend to use mean reverting fundamentalists’ trading rules. Generally the approaches to describe such a complex market system include the efforts on analysis of previous market data and charts, and some intelligent computational finance solutions to construct agent-based models to simulate the market behaviors. The developments in the latter area focus on two aspects. The economic dynamics approaches use heterogeneous economical price-explanation models to simulate the market and generate artificial time series as outputs. The alternative approach, the econometric model, describes the market prices by fitting agent’s behavior to simulate the real-world economic relationships [1]. The financial market is a complex system, which cannot be represented by a simple mathematical or statistical model. To provide a better overview and more accurate prediction of the financial market, much effort has been put into research and development in intelligent computational finance. Intelligent computational finance employs a bottom-up approach, i.e., it uses heterogeneous or non-rational agent-based models to describe the traders who represent different opinions among market participants, and the outcome from a well constructed market simulation system reflects well tremendous trading volume in real markets. One of the benefits of using D. Liu et al. (Eds.): ISNN 2007, Part I, LNCS 4491, pp. 626–631, 2007. © Springer-Verlag Berlin Heidelberg 2007

Pattern-Oriented Agent-Based Modeling for Financial Market Simulation

627

heterogeneous or non-rational agents is that the constructed models can give better explanations of asset price movements for the empirical observations. In the heterogeneous world, the agents can form the expectations equilibrium, which is some degree of consistency between expectations and realizations [5]. Another benefit is that the evolutionary approach can play important role in construction of the models that artificial intelligence makes the models act and learn independently to adapt to changing circumstances in behavioral economics, which has many degrees of freedom, hence to clearly forecast the price or trend of the stocks in a market. The individuals often do not behave rationally, and this causes bubbles of price in the markets. This behavioral agent-based computational approach has changed the way of thinking about the financial markets, and has become an important research area in economics known as economic dynamics. The development of economic dynamics contributes to the analysis of the complex economics and finance systems like stock market. Computational tools and numerical simulation analysis can be applied with heterogeneous agent model, hence to adapt nonlinear dynamics, chaos and complex systems for analysis [9]. In the real market, it is almost impossible to identify a pacemaker among all the trading agents, although the wealthiest stock dealers play an important role in the market. Although LeBaron [7] tried to explain the market performances by distinguishing multiple short- and long-memory investors as different pattern agents in SF-ASM, he did not probe in depth about how the different agents could switch their pattern during the simulation. Our project tries to implement the model using a scheme called pattern-oriented modeling from the study of ecology [4], in which evolution is not a process designed to produce any particular species but sort of rearrangement approaching the optimal or stronger total structures in species [3]. This scheme attempts to analyze the movement of the market price and trading volume as results of a pattern-amplifying machine. The agents have simple rules in their minds, to make the profit as large as possible. The key feature of pattern-oriented modeling is that a single agent notices simply the behaviors of his neighborhoods for a large collectivity of emergence [6], because small shifts in an agent’s behavior can quickly escalate into larger movements of pushing up or drawing down the market price and generating trading volumes when the patterns are fed back to the community. Such scheme should be able to improve the performance of agent-based modeling by emphasizing on analyzing and validating the applicability of models to real problems. The more the model constructed approaches the real market, the more accurate predictive output can be obtained from the simulation. The pattern-oriented approaches should deal with the time series properties better and easier.

2 Construction of a Market The agent-based simulation platform, StarLogo from MIT Media Lab, is applied in the research. Thanks to its powerful ability in modeling the behavior of decentralized systems, we can construct the market with non-pacemaker and non-rational trading agents.

628

C. Xu and Z. Chi

2.1 Agents and Trading Rules The goal of an agent is simple: to buy and sell stocks for making money. He knows not much about the market situation but the price of the stock and how agents around him are dealing with their stocks. Hence, the movement of agents in the market is a random walk on StarLogo canvas for a possible stock trading opportunity, almost as same as an ant is looking for food. The agents are designed to carry out the trading transaction according to the simple rule of “buy low and sell high”, and the objective is to make them wealthier. For better simulation of pattern-oriented feature of mass attraction by making money among the agents, the agents are also designed to be able to sense the chemical that nearby agents issue as buying or selling stocks and they are always making efforts to approach the scent from stocks. During the setting up process of the market, each agent is assigned randomly the buying power. When the buying power is less than zero, the agent is bankrupt and driven out of the market. An agent performs purchase activity if the stock he meets has a price lower than his power. The agent sells the stock when he finds out that the stock price is twice as much as his buying power or his buying power closes to zero. The wealth wi ,t of the agent i at time t for selling a stock can be expressed as: ∞

wi ,t = E ∑{(wi ,t −s + p j ,t ) − β log ci ,t } s =1

p j ,t

c

in which, represents the price of the stock j at time t, i ,t is the consumption, performing as logarithmic utility for agent’s optimal choice and occupying a constant proportion of wealth [2], at time t that the agent i needs to maintain his life. The time 1 rate of discount β can be set to (1 + 0.27) 12 , which corresponds to an effective monthly rate of 0.02. During the trade, the agents buying power decreases when a purchase is made, and increases when a selling is made. When an agent holds the stock, he still needs to pay off the loss from his living consumptions. 2.2 Market Information According to the principle of macro economics, the stocks should maintain price trends over time if the company behind a stock is in a constant condition, so that it is possible for an agent to outperform the market by carefully selecting entry and exit points for equity investments. In addition, the market should not be a zero-sum game place, where one participant's gains result only from another participant's equivalent losses, so some stocks have been put into the market by being assigned random values, say stock prices. After the commencement of the simulation, volume of the stock being traded should be in a dynamic balance state, in which equal amount of stocks are sold and bought simultaneously. The stock price hikes when an agent made the purchase, and the cash carried by the agent descends accordingly. The necessary information that an agent needs for the stock trade can be expressed as I ( p j ,t ; chemical ; scent ) , so the stock price and chemical information are the guidance for agent’s decision to buy, sell, or hold a stock.

Pattern-Oriented Agent-Based Modeling for Financial Market Simulation

629

The aggregate demand for stocks can be given by a demand function: N

I ( p t ; chemical ; scent ) β wi ,t

i =0

pt

D ( pt ) = ∑

in which, N is the number of agent whose buying power is greater than a stock price. The stock price hikes by adding a constant to its original value when an agent makes a purchase of the stock, and price falls by subtracting a constant accordingly. 2.3 Evolution of Agent and Market The evolution conforms simply to Darwin’s theory of survival of the fittest. If an agent’s holding cash value becomes zero, he is driven out of the market. On the contrary, if agent’s wealth breaks the top limit value, he becomes a super agent who can purchase stock as twice as a normal agent. The more super agents appear in the market, the faster stock price changes.

3 Simulation Results At present stage, only two variables are measured for validation of the model. One is the average of stock price, and the other is the average of the amount that agent holds the cash. The moving trends for both stock price and cash amount hike with a gentle slope, but when the agents sell the stocks eventually at almost the same moment, the stock price falls very steeply.

Fig. 1. Time series of average stock price volatility

The cash held in agents’ hands has a steep rise corresponding to the moment that stock price descends, because agents sells out the stocks at a higher price, which means a good cross correlation exists between these two variables.

630

C. Xu and Z. Chi

Fig. 2. Time series of agent’s average buy power

4 Discussion and Future Research Our research is the first step into pattern-oriented approach to explore complex financial market system. The outcome from the experiments shows that the model behaves several macro level phenomena in real market, especially the ideal moving trend of market, and cross correlation between the market price and the cash volume in buyers’ hands. At this point, the micro level agent behavior is almost as simple as an ant who is seeking for food. If the agents do more and more complicated consideration before any decision making, the interaction between the macro level stock market might carry out different dynamics. In the mean time, our present market is lack of strong impact from social or political elements, which might bring complete different outcome from the market dynamics. The analytical research in the area of stock market is for purpose of making forecasting. During the evolution of the stock market, it is necessary to use existing data to train and testing market model, and the pattern-orientation should be strengthen, so agents are able to learn by their neighborhood faster.

References 1. Zimmermann, H.G., Neuneier, R., Grothmann, R.: Multiagent Modeling of Multiple FXMarkets by Neural Networks. IEEE Transactions on Neural Networks 12 (2001) 735-743 2. Mullainathan, S.: A Memory Based Model of Bounded Rationality, Massachusetts Institute of Technology Technical Report, Cambridge, MA (1998) 3. Dennett D.: Darwin’s Dangerous Idea, Simon & Schuster 48-60 New York, 1995 4. Grimm, V., et al.: Pattern-Oriented Modeling of Agent-Based Complex Systems: Lessons from Ecology, Science, 310 (2005) 987-991 5. Hommes C.: Heterogeneous Agent Models in Economics and Finance, Handbook of Computational Economics, North-Holland 2 (2005)

Pattern-Oriented Agent-Based Modeling for Financial Market Simulation

631

6. Johnson, S.: Emergence, the connected lives of ants, brains, cities, and software, Scribner, New York (2001) 7. LeBaron, B.: Empirical Regularities From Interacting Long- and Short-Memory Investors in an Agent-Based Stock Market, IEEE Transactions on Evolutionary Computation 5 (2001) 442-455 8. LeBaron, B.: Building the Santa Fe Artificial Stock Market (2002) 9. LeBaron, B.: Agent-based Computational Finance. The Handbook of Computational Economics II (2005)

Suggest Documents