12.07.2015 Views

financial market simulation based on intelligent agents – case study

financial market simulation based on intelligent agents – case study

financial market simulation based on intelligent agents – case study

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Volume VI/ Issue 3(17)/ Fall 2011FINANCIAL MARKET SIMULATION BASED ON INTELLIGENTAGENTS – CASE STUDYMarek SPIŠÁKspisak@opf.slu.czRoman ŠPERKAroman.sperka@gmail.comSilesian University in Opava, Czech RepublicSchool of Business Administrati<strong>on</strong> in Karvina, Department of informaticsAbstract:We implement an agent-<str<strong>on</strong>g>based</str<strong>on</strong>g> <str<strong>on</strong>g>financial</str<strong>on</strong>g> <str<strong>on</strong>g>market</str<strong>on</strong>g> model <str<strong>on</strong>g>simulati<strong>on</strong></str<strong>on</strong>g> in which <strong>agents</strong> follow technical andfundamental trading rules to determine their speculative investment positi<strong>on</strong>s. We c<strong>on</strong>sider direct interacti<strong>on</strong>sbetween speculators due to which they may decide to change their trading behaviour. For instance, if atechnical trader meets a fundamental trader and they realize that fundamental trading has been more profitablethan technical trading in the recent past, the probability that the technical trader switches to fundamentaltrading rules is relatively high. In particular the influence of transacti<strong>on</strong> costs is studied, which can beincreased by the off-<str<strong>on</strong>g>market</str<strong>on</strong>g> regulati<strong>on</strong> (for example in the form of taxes) <strong>on</strong> <str<strong>on</strong>g>market</str<strong>on</strong>g> stability, the overall volumeof trade and other <str<strong>on</strong>g>market</str<strong>on</strong>g> characteristics.Keywords: agent-<str<strong>on</strong>g>based</str<strong>on</strong>g>, <str<strong>on</strong>g>financial</str<strong>on</strong>g> <str<strong>on</strong>g>market</str<strong>on</strong>g>, netLogo, direct interacti<strong>on</strong>s, technical and fundamental analysis,<str<strong>on</strong>g>simulati<strong>on</strong></str<strong>on</strong>g>JEL Classificati<strong>on</strong>: G12; G14; G15; C63; C881. Introducti<strong>on</strong>This paper describes a multi-agent model of the transacti<strong>on</strong> costs influence <strong>on</strong> the <str<strong>on</strong>g>financial</str<strong>on</strong>g><str<strong>on</strong>g>market</str<strong>on</strong>g>. The transacti<strong>on</strong> costs <strong>on</strong> the <str<strong>on</strong>g>financial</str<strong>on</strong>g> <str<strong>on</strong>g>market</str<strong>on</strong>g> are mainly the costs of the obtaining and theinterpreting of the informati<strong>on</strong>, the time required for decisi<strong>on</strong> making, various types of fees, etc.Transacti<strong>on</strong> costs according to (Burian 2010) are often viewed as negative phenomena, but there are<strong>case</strong>s where the increase in the transacti<strong>on</strong> costs can be viewed positively and can c<strong>on</strong>tribute to thestability of the <str<strong>on</strong>g>market</str<strong>on</strong>g>. The increase in the transacti<strong>on</strong> costs may also occur in the form of n<strong>on</strong>-<str<strong>on</strong>g>market</str<strong>on</strong>g>regulati<strong>on</strong> such as the taxes. In the early seventies the Nobel laureate in the ec<strong>on</strong>omics James Tobindrafted the regulati<strong>on</strong> of currency <str<strong>on</strong>g>market</str<strong>on</strong>g>s. Tobin suggested that all short-term transacti<strong>on</strong>s should betaxed at a low fixed rate (the proposal was later identified as the so-called Tobin tax). The resultsaccording to Tobin would avoid short-term currency speculati<strong>on</strong> and stabilize the <str<strong>on</strong>g>market</str<strong>on</strong>g>. Currencyspeculati<strong>on</strong> can lead to the sudden withdrawal of the currency from the circulati<strong>on</strong> in order toartificially increase the price. The c<strong>on</strong>sequence for the ec<strong>on</strong>omy of the countries that use this currencymay be a temporary reducti<strong>on</strong> in liquidity, problems in obtaining loans and other phenomena that canlead to the reduced growth or even to the recessi<strong>on</strong>.Tobin tax was never implemented. Against introducing a Tobin tax, however there are numberof arguments. First, it would be very difficult to implement, since it would have to be introduced insync throughout the world, because otherwise the <str<strong>on</strong>g>market</str<strong>on</strong>g> would be relocated to the tax-free exchange.Another argument is to reduce the volume. Finally, some authors argue that <str<strong>on</strong>g>financial</str<strong>on</strong>g> speculators,whose activity would be substantially reduced, are doing useful work, for example, they seek newpossibilities to invest in emerging <str<strong>on</strong>g>market</str<strong>on</strong>g>s. There are also opini<strong>on</strong>s that stability problems can besolved by improving the macroec<strong>on</strong>omic policies of central banks.The model described here, however, need not be interpreted as a model for the introducti<strong>on</strong> oftaxes, but in general, as a model of the transacti<strong>on</strong> costs influence <strong>on</strong> the <str<strong>on</strong>g>market</str<strong>on</strong>g>. The aim of the modeldescribed in this article is to explore the dependence <str<strong>on</strong>g>market</str<strong>on</strong>g> stability to the extent of transacti<strong>on</strong> costs.This paper is structured as follows. Secti<strong>on</strong> 2 briefly informs about the behaviour <strong>on</strong> real<str<strong>on</strong>g>financial</str<strong>on</strong>g> <str<strong>on</strong>g>market</str<strong>on</strong>g>s and introduces the agent-<str<strong>on</strong>g>based</str<strong>on</strong>g> methods for modelling and <str<strong>on</strong>g>simulati<strong>on</strong></str<strong>on</strong>g>. In secti<strong>on</strong> 3the original agent-<str<strong>on</strong>g>based</str<strong>on</strong>g> model of <str<strong>on</strong>g>financial</str<strong>on</strong>g> <str<strong>on</strong>g>market</str<strong>on</strong>g> is presented. In secti<strong>on</strong> 4 we enhance the originalmodel with transacti<strong>on</strong> costs. Secti<strong>on</strong> 5 presents the original <str<strong>on</strong>g>simulati<strong>on</strong></str<strong>on</strong>g> results of the agent-<str<strong>on</strong>g>based</str<strong>on</strong>g>model of <str<strong>on</strong>g>financial</str<strong>on</strong>g> <str<strong>on</strong>g>market</str<strong>on</strong>g>.249


Journal of Applied Ec<strong>on</strong>omic Sciences2. The Use of Agent-<str<strong>on</strong>g>based</str<strong>on</strong>g> Methods for Modelling and Simulati<strong>on</strong> the Behaviour of RealFinancial MarketsThe behaviour of real <str<strong>on</strong>g>financial</str<strong>on</strong>g> <str<strong>on</strong>g>market</str<strong>on</strong>g>s shows some significant deviati<strong>on</strong>s from the efficient<str<strong>on</strong>g>market</str<strong>on</strong>g>hypothesis, which argues that the <str<strong>on</strong>g>market</str<strong>on</strong>g> price reflects all informati<strong>on</strong> <strong>on</strong> the fair value oftraded assets and should not deviate from it. In fact, the <str<strong>on</strong>g>market</str<strong>on</strong>g> price often differs from the fair valueof assets, which is reflected especially in the so-called <str<strong>on</strong>g>market</str<strong>on</strong>g> bubbles (Ilie 2011). Market bubble is anartificial overvaluati<strong>on</strong> of assets due to excessive demand, or <strong>on</strong> the other hand it is the <str<strong>on</strong>g>market</str<strong>on</strong>g>collapse due to the oversupply of the assets. Efficient-<str<strong>on</strong>g>market</str<strong>on</strong>g> hypothesis is according to (Schleifer2000) <str<strong>on</strong>g>based</str<strong>on</strong>g> <strong>on</strong> three basic assumpti<strong>on</strong>s: the investors are able to rate the assets with unlimitedrati<strong>on</strong>ality. If some investors are not rati<strong>on</strong>al, their purchases are random and therefore they canceleach other out, and finally the influence of irrati<strong>on</strong>al investors <strong>on</strong> the price of the assets is eliminatedby rati<strong>on</strong>al <strong>agents</strong>. (Burian 2010).The model described in this article is <str<strong>on</strong>g>based</str<strong>on</strong>g> <strong>on</strong> the agent-<str<strong>on</strong>g>based</str<strong>on</strong>g> model of <str<strong>on</strong>g>financial</str<strong>on</strong>g> <str<strong>on</strong>g>market</str<strong>on</strong>g>(Westerhoff, 2009), which, like many similar models (Brock and Hommes 1997, 1998; G<strong>on</strong>çalves2003; Kirman 1991, 1993; Lux 1998; Lux and Marchesi 1999) describes some typical characteristicsof the real <str<strong>on</strong>g>market</str<strong>on</strong>g>. An agent-<str<strong>on</strong>g>based</str<strong>on</strong>g> model is a computerized <str<strong>on</strong>g>simulati<strong>on</strong></str<strong>on</strong>g> of a number of decisi<strong>on</strong>makers(<strong>agents</strong>) and instituti<strong>on</strong>s, which interact through prescribed rules (Vymetal and Sperka, (2011).The <strong>agents</strong> can be as diverse as needed - from c<strong>on</strong>sumers to policy-makers and Wall Streetprofessi<strong>on</strong>als - and the instituti<strong>on</strong>al structure can include everything from banks to the government.Such models do not rely <strong>on</strong> the assumpti<strong>on</strong> that the ec<strong>on</strong>omy will move towards a predeterminedequilibrium state, as other models do. Instead, at any given time, each agent acts according to itscurrent situati<strong>on</strong>, the state of the world around it and the rules governing its behaviour. An individualc<strong>on</strong>sumer, for example, might decide whether to save or spend <str<strong>on</strong>g>based</str<strong>on</strong>g> <strong>on</strong> the rate of inflati<strong>on</strong>, his or hercurrent optimism about the future, and behavioural rules deduced from psychology experiments. Thecomputer keeps track of the many agent interacti<strong>on</strong>s, to see what happens over time. Agent-<str<strong>on</strong>g>based</str<strong>on</strong>g><str<strong>on</strong>g>simulati<strong>on</strong></str<strong>on</strong>g>s can handle a far wider range of n<strong>on</strong>linear behaviour than c<strong>on</strong>venti<strong>on</strong>al equilibriummodels. Policy-makers can thus simulate an artificial ec<strong>on</strong>omy under different policy scenarios andquantitatively explore their c<strong>on</strong>sequences.The cure for macroec<strong>on</strong>omic theory, however, may have been worse than the disease. Duringthe last quarter of the twentieth century, ‘rati<strong>on</strong>al expectati<strong>on</strong>s’ emerged as the dominant paradigm inec<strong>on</strong>omics. This approach assumes that humans have perfect access to informati<strong>on</strong> and adapt instantlyand rati<strong>on</strong>ally to new situati<strong>on</strong>s, maximizing their l<strong>on</strong>g-run pers<strong>on</strong>al advantage. Of course real peopleoften act <strong>on</strong> the basis of overc<strong>on</strong>fidence, fear and peer pressure - topics that behavioural ec<strong>on</strong>omics isnow addressing. (Farmer and Foley 2009)But there is a still larger problem. Even if rati<strong>on</strong>al expectati<strong>on</strong>s are a reas<strong>on</strong>able model ofhuman behaviour, the mathematical machinery is cumbersome and requires drastic simplificati<strong>on</strong>s toget tractable results. The equilibrium models that were developed, such as those used by the USFederal Reserve, by necessity stripped away most of the structure of a real ec<strong>on</strong>omy. There are nobanks or derivatives, much less sub-prime mortgages or credit default swaps - these introduce toomuch n<strong>on</strong>linearity and complexity for equilibrium methods to handle. Agent-<str<strong>on</strong>g>based</str<strong>on</strong>g> models could helpto evaluate policies designed to foster ec<strong>on</strong>omic recovery.We may use agent-<str<strong>on</strong>g>based</str<strong>on</strong>g> methods in the <strong>case</strong> of the <str<strong>on</strong>g>financial</str<strong>on</strong>g> <str<strong>on</strong>g>market</str<strong>on</strong>g>, which is a relativelybalanced <str<strong>on</strong>g>market</str<strong>on</strong>g> (supply roughly coincides with the demand) with bubbles and busts. Furthermore, inc<strong>on</strong>trast to the efficient-<str<strong>on</strong>g>market</str<strong>on</strong>g> hypothesys assumpti<strong>on</strong>s is more realistic to assume that (Burian 2010):• Agents are limited <strong>on</strong>ly rati<strong>on</strong>al. They do not have all informati<strong>on</strong> or they are not able tointerpret it correctly.• Agents are heterogeneous. They react with varying sensitivity to the reports of the <str<strong>on</strong>g>market</str<strong>on</strong>g>developments and affect them differently str<strong>on</strong>g random factors that influence their decisi<strong>on</strong>s.• Agents make decisi<strong>on</strong>s influenced by the opini<strong>on</strong>s of their close colleagues.The model, which we describe in this paper, is <str<strong>on</strong>g>based</str<strong>on</strong>g> <strong>on</strong> these assumpti<strong>on</strong>s.250


Journal of Applied Ec<strong>on</strong>omic Sciences6. C<strong>on</strong>clusi<strong>on</strong>The agent <str<strong>on</strong>g>financial</str<strong>on</strong>g> model which was implemented (Westerhoff 2009) has (in ourparameterizati<strong>on</strong>) tendency to stabilize itself in a l<strong>on</strong>g term – if the fundamental trading rules areoverbearing the trading method, although the bubbles and the crashes occur, their values are going tobe smaller because the price is targeting near the fundamental value and the volatility is going to beless too.Once there is introduced the transacti<strong>on</strong> cost influence <strong>on</strong> the price – the price is going up to thebubble while technical traders are overtaking the <str<strong>on</strong>g>market</str<strong>on</strong>g>, but the price starts to be falling according tothe technical analysis growth. In this moment volatility falls down and the <str<strong>on</strong>g>market</str<strong>on</strong>g> stabilizes. Theproblem is the value of the transacti<strong>on</strong> costs – as was seen in very last <str<strong>on</strong>g>simulati<strong>on</strong></str<strong>on</strong>g>, if is too high, thesystem destabilizes and the price grows without limit.7. AcknowledgmentsThis work was supported by grant of Silesian University no. SGS/24/2010: The Usage of BI andBPM Systems to Efficiency Management Support.8. References[1] Brock, W. and Hommes, C. 1997. A rati<strong>on</strong>al route to randomness. Ec<strong>on</strong>ometrica, Vol. 65, pp.1059-1095.[2] Brock, W. and Hommes, C. 1998. Heterogeneous beliefs and routes to chaos in a simple assetpricing model. Journal of Ec<strong>on</strong>omic Dynamics C<strong>on</strong>trol, vol. 22, pp. 1235-1274.[3] Burian, J. 2010. Multiagentní model transakčních nákladů na finančních trzích. VŠE Praha.Available from: < http://www.eldar.cz/h<strong>on</strong>za/articles/burian_ace_fin_<str<strong>on</strong>g>market</str<strong>on</strong>g>_tc.doc>.[4] Farmer, J.D. and Foley, D. The ec<strong>on</strong>omy needs agent-<str<strong>on</strong>g>based</str<strong>on</strong>g> modelling. Nature Opini<strong>on</strong>: MacmillanPublishers Limited [<strong>on</strong>line]. 6th August 2009, Vol 460. Available from: http://www2.ec<strong>on</strong>.iastate.edu/tesfatsi/Ec<strong>on</strong>omyNeedsABM.NatureAug2009.FarmerFoley.pdf.[5] G<strong>on</strong>çalves C. P. 2003. Artificial Financial Market Model. Available from: http://ccl.northwestern.edu/netlogo/models/community/Artificial Financial Market Model.[6] Ilie, D. (2011) New fr<strong>on</strong>tiers in credit risk analysis. Journal of Applied Ec<strong>on</strong>omic Sciences, vol.VI, Issue 1(15)/Spring 2011, ISSN: 1843-6110.[7] Kirman, A. 1991. Epidemics of opini<strong>on</strong> and speculative bubbles in <str<strong>on</strong>g>financial</str<strong>on</strong>g> <str<strong>on</strong>g>market</str<strong>on</strong>g>s. In: Taylor,M. (ed.): M<strong>on</strong>ey and <str<strong>on</strong>g>financial</str<strong>on</strong>g> <str<strong>on</strong>g>market</str<strong>on</strong>g>s. Blackwell: Oxford, pp. 354-368.[8] Kirman, A. 1993. Ants, rati<strong>on</strong>ality, and recruitment. Quarterly Journal of Ec<strong>on</strong>omics, Vol. 108, pp.137-156.[9] Lux, T. 1998. The socio-ec<strong>on</strong>omic dynamics of speculative <str<strong>on</strong>g>market</str<strong>on</strong>g>s: interacting <strong>agents</strong>, chaos, andthe fat tails of return distributi<strong>on</strong>s. Journal of Ec<strong>on</strong>omic Behavior and Organizati<strong>on</strong>, vol. 33, 143-165.[10] Lux, T. and Marchesi, M. 1999. Scaling and criticality in a stochastich multi-agent model of a<str<strong>on</strong>g>financial</str<strong>on</strong>g> <str<strong>on</strong>g>market</str<strong>on</strong>g>. Nature, vol. 397, pp. 498-500.[11] Shleifer, A. 2000. Inneficient Markets, An Introducti<strong>on</strong> to Behavioral Finance. Oxford UniversityPress.[12] Vymetal, D. and Sperka, R. 2011. Agent-<str<strong>on</strong>g>based</str<strong>on</strong>g> Simulati<strong>on</strong> in Decisi<strong>on</strong> Support Systems.Distance learning, <str<strong>on</strong>g>simulati<strong>on</strong></str<strong>on</strong>g> and communicati<strong>on</strong> 2011. Proceedings. ISBN 978-80-7231-695-3.[13] Westerhoff, F. 2009. A simple agent-<str<strong>on</strong>g>based</str<strong>on</strong>g> <str<strong>on</strong>g>financial</str<strong>on</strong>g> <str<strong>on</strong>g>market</str<strong>on</strong>g> model: direct interacti<strong>on</strong>s andcomparis<strong>on</strong>s of trading profits. Working Paper No. 61. [Online] Bamberg University (BERGWorking Paper Series <strong>on</strong> Government and Growth), January 2009.[14] Wilensky, U. 1999. NetLogo. [Online] Center for C<strong>on</strong>nected Learning and Computer-BasedModeling, Northwestern University, Evanst<strong>on</strong>, IL., 1999. http://ccl.northwestern.edu/netlogo.256

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!