KEY POINTS FOR REALISTIC AGENT-BASED FINANCIAL
MARKET SIMULATIONS
Iryna Veryzhenko, Philippe Mathieu
LIFL, UMR CNRS-USTL 8022, Lille, France
Olivier Brandouy
Sorbonne Graduate Business School, Paris, France
Keywords:
Multi-agent systems, Artificial market, Market microstructure, Agents interactions.
Abstract:
The purpose of this paper is to define software engineering abstractions that provide a generic framework
for stock market simulations. We demonstrate a series of key points and principles that has governed the
development of an Agent-Based financial market in the form of an API. The simulator architecture is presented.
During artificial market construction we have faced the whole variety of agent-based modeling issues and
solved them : local interaction, distributed knowledge and resources, heterogeneous environments, agents
autonomy, artificial intelligence, speech acts, discrete scheduling and simulation. Our study demonstrates that
the choices made for agent-based modeling in this context deeply impact the resulting market dynamics and
proposes a series of advances regarding the main limits the existing platforms actually meet.
1 INTRODUCTION
Multi-agent modeling is actively applied to financial
market simulation, due to its possibility to reflect
all complexities and automation of financial markets.
Agent-based computational simulations (Woolridge,
2002) may contribute to the advances in finance. Ex-
amples of multi-agent and machine learning tools, ap-
plied in financial topics, are Bayesian learning, that
can be used by agents to incorporate all available in-
formation into the decision making process (Mitchell,
1997), and techniques for tracking a moving parame-
ter (Cesa-Bianchi and Lugosi, 2001), that are useful in
estimating the possibly changing fundamental value
of a stock. On the other hand, financial market is an
important implementation area of agent-based model-
ing and machine learning, since agent objectives and
interactions are clearly defined. For this reason, fi-
nancial market environment can help to answer some
modeling issues related to agent engineering or test
robustness of existing behavioral models.
At the present there are large number of vari-
ous agent-based frameworks, with varying function-
ality and architecture, addressing different problems.
There are two major approaches to agent-based finan-
cial market simulations. The first one is realization
of specific market type, with special agents behavior,
trading instruments and rules. The other way of
simulator realization is to design the general envi-
ronment with flexible settings and functionality, that
can accept heterogeneous agents populations. We list
just some of such models, that bellow to these two
approaches, and that point out some design questions.
Altreva Adaptive Modeler is a tool for creating
agent-based market simulation models for a specific
problem : stock price forecasting (Witkam, 2003).
The author, among other questions, describes a prob-
lem of a memory limitation during the framework
processing. JLM market simulator is another tool
that investors can use to create a market model using
their own inputs. The authors (Jacobs Levy Equity
Management, Inc.) conclude that it is not an easy
task to build a complex asynchronous simulation with
reasonably realistic properties. The first complexity
is a diversity of agents behavior (for instance, there
are only mean-variance investors in JLM), the other
one is specification of user’s trading strategies,
that does not require the user’s programming skills
(Jacobs et al., 2004). Ascape is a general agent-based
framework, developed at Brookings Institute in the
90s (Inchiosa and Parker, 2002), that is actively used
in financial market modeling. Its’ developers discuss
74
Veryzhenko I., Mathieu P. and Brandouy O..
KEY POINTS FOR REALISTIC AGENT-BASED FINANCIAL MARKET SIMULATIONS.
DOI: 10.5220/0003156200740083
In Proceedings of the 3rd International Conference on Agents and Artificial Intelligence (ICAART-2011), pages 74-83
ISBN: 978-989-8425-41-6
Copyright
c
2011 SCITEPRESS (Science and Technology Publications, Lda.)
a design possibilities to express the same basic
modeling ideas in one way and have them tested
in many different environments and configurations.
Most of present artificial market platforms suffer
from a lack of flexibility and must be viewed as
software rather than as APIs, in a mean that they are
oriented for specific problem solving, but cannot be
used to explore a wide range of financial issues due
to some structural choices made by the developer
during the coding phase.
In this paper we present the ArTificial Open
Market API (here-after ATOM, see http://atom.
univ-lille1.fr) and focus attention on the im-
portant issues of agent-based stock market design.
Among others, we make a specific point on the ability
of this new, generic architecture to overcome some
issues mentioned previously. During the stock mar-
ket simulation we model individual market entities
(agents, banks, participants), interactions between
them, the behaviors and the decision-making process,
global constraints in the interaction process, environ-
ment rules and external infrastructure. This frame-
work allows to run large scale experiments under a
variety of scenarios and conditions, to describe not
only what have happened in the market or the gener-
ated price patterns, but also to investigate in fine grain
the reasons through which interactions, strategies and
rules, made it happen. Our financial market model
is close to Influence Reaction Model for Simulation
(IRM4S) (Michel, 2007), (Ferber and Muller, 1996),
moreover, we show how existing models of the inter-
actions between system entities (markets infrastruc-
ture, agents, banks) fit Interaction Movement Com-
putation (MIC
) abstract autonomous agents model
(Gouaich et al., 2005). In our modeling, we move in
the direction of a growing complexity, in the mean of
agents intelligence (from zero-intelligent to cognitive
traders) and their interactions (from individual inde-
pendent behavior to the competitive interactions). We
run series of validation tests in order to show the abil-
ity of ATOM to replicate real market features.
2 THE ARTIFICIAL TRADING
OPEN MARKET API
ATOM is an environment for Agent-Based simula-
tions of stock markets. At the present moment, it is re-
alized based on the architecture close to the Euronext-
NYSE Stock Exchange one. Agent-Based artificial
stock markets aim at matching orders sent by vir-
tual traders to fix quotation prices. Price formation
is ruled by a negotiation system between sellers and
buyers based on an asynchronous, double auction
mechanism structured in an order book (see Figure
1). ATOM is developed as large scale experimental
Figure 1: Double auction market with human and artificial
traders.
platform with heterogeneous agents populations. It
is concrete implementation of MAS abstract design
issues: agent autonomy and its behavior (strategy),
each agent asses her position and makes decisions
individually; price history and orders sets are emer-
gent phenomenon of market activities; allowance of
distributed simulations with many computers inter-
acting through a network as well as local-host, ex-
tremely fast simulations; possibility to design experi-
ments mixing human beings and artificial traders.
2.1 Distinctive Features
Five distinctive aspects of ATOM can be highlighted:
1. ATOM can use various kind of sophisticated
agents with their own behaviors and intelligence
(see section 4), including portfolio optimizers
as this platform provides the multi-assets (multi-
orderbook) organisation. In addition, ATOM con-
tains all variety of the Euronext-Nyse orders:
limit, market, stop-limit,iceberg, etc.
2. Thousands of agents can evolve simultaneously,
creating a truly heterogeneous population. Once
designed, agents evolve by themselves, learn-
ing and adapting to their (financial) environment.
100,000 agents have been employed simultane-
ously for technical analysis evaluation research
(Brandouy and Mathieu, 2007).
3. ATOM can combine human-beings and artificial
traders on a single market using its network ca-
pabilities. This feature support a wide variety
of configurations: from ”experimental finance”
classrooms with students, to competing strategies
run independently and distantly by several banks
or research labs. The scheduler can be set so to
allow human agents to freeze the market during
their decision process or not (see above, section
3.4).
KEY POINTS FOR REALISTIC AGENT-BASED FINANCIAL MARKET SIMULATIONS
75
4. ATOM serves as a ”replay-engine”, meaning
that it is possible to re-execute whole trading
log file with following information: identifica-
tion of order book, that corresponds to stock
identity, agents identification, the platform time
stamp fixed at the very moment orders arrive to
a given order-book, prices resulting from the or-
ders. ATOM takes less than 5 seconds to replay
an entire day of trading, that contains 400,000
activities. This tool is extremely important for
policy-oriented experiments focusing on the tech-
nical features of the market microstructure (tick
size, price fixing protocol) and its influence on the
price dynamic.
5. Agents can be viewed as simple nutshells in cer-
tain cases: they only execute actions predefine by
third party, meaning that their behavior is defined
(controlled) by experimenter. These agents are
called ”Hollow Agents”. For example, a human
trader can act through such agents. By definition,
”Hollow Agents” do not have any artificial intel-
ligence and can be assimilated to human-machine
wrappers.
3 ARTIFICIAL MARKET DESIGN
ISSUES
Artificial Stock Market is environment to express all
classical notions used in multi-agent systems. First
of all, the environment in which agents evolve, as
well as their behaviors and own dynamics, commu-
nication or interactions. ASM, like any other MAS,
are suited for the study of various emergents phe-
nomena. Using the so-called ”vowels” approach (Ri-
cordel and Demazeau, 2001), the definition of AEIO
(A Agents, E Environment, I Interactions, O Organiza-
tion) is straightforward. Nevertheless, if one wants to
build an efficient platform, several issues can be iden-
tified and must be precisely and strictly regulated.
3.1 Entities Organization
During the system modeling we employed many
MAS design principles, for example, modularity and
encapsulation, that suggest dividing the system into
different sub-organizations, with the agents involved
in the organization parts. The architecture can be
viewed as a system with interacting components: i)
Agents, and their behaviors, ii) Markets is defined in
terms of microstructure and iii) Bank reflects inter-
mediaries and monetary financial institutions iv) the
Artificial Economic World provides economical indi-
cators. Depending upon the researcher targets, the Ar-
tificial Economic World can be plugged or not in the
simulations.
Based on the Gaia methodology (Zambonelli
et al., 2003) for MAS design, we link each system
entity with the sets of Roles. Thus, Market is respon-
sible for the generating of market scenarios and price
path, it presents set of constraints, rules, regulations,
leading participants to activities. Agents may play
roles of buyer or seller with different trading objec-
tives. The agents directly initialize transactions. Bank
component represents all intermediaries, that main-
tain information exchange between buyers and sell-
ers. At the same time, Bank can be considered as
the special type of buyer or seller, that has unlimited
wealth, hence take active part in stock trading. We
propose to consider Bank as trading and intermedi-
ary agent. Artificial Economic World provides exter-
nal information about perspective corporates devel-
opment, dividends and coupons changes, tax police
modification. This information influences agent deci-
sions. Artificial market architecture (system elements
and interaction between them) is presented on the Fig-
ure 2. Thanks to its high modularity and its ability to
trader
trader
trader
trader
P
r
o
f
i
t
a
d
j
u
s
t
m
e
n
t
Bank
Economic World
trader
trader
Market: order routing system and price forming
O
r
d
e
r
s
f
l
o
w
news
Digital certificate
taxes
Figure 2: Market organizations and interactions.
mimic real-world environments, it can also serve as a
research tool in Portfolio Management, Algorithmic
Trading or Risk Management among others.
From a pure technological point of view, ATOM
can also be viewed as an order-flow replay engine. It
means that bankers can test their algorithmic-trading
strategies using historical data without modifying the
existing price series or backtest the impact of their
trading-agents in totally new price motions or market
regimes generated by artificial traders.
It is hardly possible to describe the complex algo-
rithmic structures that are necessary for the realiza-
tion of such multi-agent platforms; therefore we have
chosen to introduce three of difficulties one must face
while developing an ASM : i) the management of or-
ders’ ID, ii) the scheduling system, and iii) the in-
troduction of a human-being in the simulation loop
ICAART 2011 - 3rd International Conference on Agents and Artificial Intelligence
76
(here-after ”human-in-the-loop” problem).
3.2 A Unique Identity for Orders
In its simplest form, an order is a triplet of direc-
tion (purchase or sale), a quantity and a price. Usu-
ally this type of order is called a ”Limit Order”. In
the Euronext-NYSE system, several other orders are
used (see ”EURONEXT” Rule Book at http://www.
euronext.com). Once constructed by an agent, the
order is sent to the order-book. It is then ranked in the
corresponding auction-queue (”Bid” or ”Ask” if it is
an order to ”Buy”, respectively to ”Sell”) where are
stacked the other pending orders using a ”price-then-
time” priority rule. As soon as two pending orders can
be matched, they are processed as a ”deal”, which de-
livers a new price. Notice that the clearing mechanism
implies that cash is transferred from the buyer to the
seller and stocks from the seller to the buyer.
For various reasons, financial institutions need to
proceed again an historical record of orders (for ex-
ample, for the optimization of algorithmic trading
methods). Such historical records collect the expres-
sion of human behaviors in specific circumstances.
The first difficulty of order-flow replaying is exact in-
terpretation of the order flow as it is expressed in the
real-world. If order set consists of only ”Limit Or-
ders”, it could be perfectly reproducible. Unfortu-
nately, issued orders can be modified or deleted. It
implies one must be able to identify clearly reference
between an ”Update” or a ”Delete” and previously is-
sued orders. Thus, a generic platform has to use a
unique ID for orders. This is particularly important
in situations when several possible identification keys
for orders potentially coexists : in the replay-engine
situation (real-world orders ID and time stamps), in
the Agent-Based platform mixing human beings and
artificial traders situation (orders ID, platform time-
stamp) or in any combination of these states. To our
knowledge, this is neither the case for the Genoa Ar-
tificial Stock Market (see (Raberto et al., 2003)) nor
in the Santa-Fe ASM for example (see (Le Baron,
2002)). How should an ASM deal with this issue?
A first idea would be to use the time-stamp im-
printed on each order. This information is partic-
ularly important if one wants to work on the time-
distribution of orders. Unfortunately this idea is tech-
nically irrelevant. The time-stamp of standard operat-
ing systems is given using the third decimal places of
seconds. However, it is perfectly possible to process
several orders in one out of one thousand second. The
time stamp is therefore necessary, but can be under no
circumstances used as an ID.
Agents, human-beings or artificial traders, do not
have to fix orders’ ID. This task is up to the order-
book itself. The order-book must stamp orders dur-
ing acceptance, mainly to avoid fraudulent manipula-
tions from agents. One platform-ID refers to one or-
der. This latter must be different from any other pos-
sible identification number indicated in the order file
or corresponding to a time-stamp. This means that the
platform can handle three different identifiers, which
makes its structure rather complex. Nevertheless, this
additional complexity is mandatory if one wants to be
able to use the ASM as a replay-engine and with arti-
ficial agents as well.
3.3 The Scheduling System
The scheduler is a particularly critical element in all
multi-agents systems. This component manages the
very moment and situations in which agents have
word (act), hence provides us complete control of
agents actions. The scheduling system aims at avoid-
ing possible biases in the simulation. However, this
fundamental component in MAS systems is seldom
discussed.
Outside the Computer Science community, it is
often believed that using independent processes for
each agent is a guarantee of autonomy. This is defi-
nitely not the case. Using threads consists in letting
the operating system scheduler decide which agent
will have the word at the next step in the simulation.
Another delusion is to believe that threads will al-
low agents to work in parallel: using a single proces-
sor, there is necessarily one and only one single pro-
cess running at each time step. Parallelism is simply
simulated by the operating system. Nevertheless,the
main disadvantage of this approach is that the system
scheduler does neither exclusively consider agents
nor even the MAS application itself; it also manages
all applications running on the computer. Therefore,
except on specialized real-time systems, there is no
chance to observe agents solicited exactly at the same
(relative) moment when two executions of the same
simulation are processed. Results cannot be repro-
duced perfectly and the developer loses command on
the code execution. It is therefore mandatory to code
a specific scheduler to avoid these shortcomings.
3.3.1 When Can the Agents Express their
Intentions?
One should not desire performing a loop in the sim-
ulation that keeps the word order among agents un-
changed. This would introduce biases in the simula-
tion : the first chosen agent would have systematically
a priority over other agents; the last one might wait a
KEY POINTS FOR REALISTIC AGENT-BASED FINANCIAL MARKET SIMULATIONS
77
long time before being allowed to express its inten-
tions. Performing a uniform randomization of agent’s
word would lead to the same issues as well. In this last
case, a few agents can theoretically stay unselected
for a long time and even be ignored by the system.
Simulations in ATOM are organized as ”round ta-
ble discussions” and are grounded on an equitably
random scheduler. Within every ”round table discus-
sion”, agents are randomly interrogated using a uni-
formly distributed order. This latter feature ensures
that each of them has an equal possibility of express-
ing its intentions. Notice that the API offers a ran-
dom generator that is shared by all agents. The re-
producibility of experiments is therefore guaranteed :
one can either use a seed during the initialization of an
experiment, or use ATOM in the ”replay-engine” con-
figuration since, as mentioned before, any simulation
delivers a record of all the orders.
3.3.2 How Do the Agents Proceed?
In real life, investors do not share the same attitudes.
Different agents may have different time scales - some
can make decisions every day and others every month
of every second. Time scale of traders is a critical
component in agent-based simulations. It affects such
aspect of the simulation as repeatability (replaying) of
the experiments. In ATOM this problem is solved in
such way: a possibility to express an intention does
not necessarily imply that a new order is issued. Since
agents are autonomous, they always have the possibil-
ity to decline this opportunity. Developing an agent
that sends twice less orders than any other agent can
be made in programming her behaviour such as she
will decline word on odd turns (keep unchanged po-
sition), while others accept it each time they have the
possibility to do so. Let consider that one trading day
contains 2000 ticks (rounds), thus an agent that trade
once per day due to her strategy will accept a possibil-
ity to act only once over 2000. An agent trading once
per month will accept a possibility to send an order
once over 2000 × 22 (22 business days).
Moreover, if an agent would been allowed to send
several orders when interrogated, this would lead to
an equity problem similar to the one described before.
To overcome this issue, we introduce ”one order to
each book” rule: agents are just allowed to send at
most one single order to a given order book (i.e. one
order at most per stock) within the same ”round table
discussion”. However, if an agent plans to issue sev-
eral orders concerning the same stock (thus, the same
order book), she must act as a finite state automata.
Each time she is allowed to express herself, she will
change her state and send a new order. Developers
can use this technique to set up various experiments
without sacrificing a fair equity between agents or a
perfect reproducibility of their protocols.
However, notice that agents have the possibility to
send several orders within the same ”round table dis-
cussion” : this ability is simply constrained by the
”one order to each book” rule. If the ASM is set-
tled such as it runs a multi-stock experiment, an agent
can therefore rebalance her portfolio using one order
per category of stocks she holds. The proper system
scheduler provides this possibility.
3.4 Human in the Loop
Current situation, when software agents are com-
monly used to replace human agents in making de-
cision and taking action in the electronic trading, re-
quires software solution to place human and artifi-
cial agents together in order to obtain advanced in-
teraction. ATOM can include human-beings in the
simulation loop. This is an important feature that
is seldom offered in multi-agent artificial stock mar-
kets, if simply possible with respect to the algorithmic
choices made in other platforms. A human agent is
an interface allowing for human-machine interaction.
Through this interface one can create and send orders.
Notice that human agents do not have any artificial
intelligence: they just embed human intelligence in a
formalism that is accepted by the system.
To allow the introduction of human in the loop,
ATOM has been designed to deal with communica-
tions over the network. Human agents can be run
on different machines and the system allows client-
server configurations. This approach is particularly
fruitful for a pedagogic use of the platform during
Finance class for example. In this latter case, sev-
eral students have their own trading interface on their
computers. In other terms, each of them runs a human
agent linked to the ATOM server through the network.
However, the presence of human agents does not alter
the way the scheduler operates.
Two kinds of human agents can co-exist in
ATOM: Modal Human Agents (MHA) and Non
Modal Human agent (NMH).
MHA can stop the scheduling system. As long as
human-entity does not express her intentions (to
issue a new order or to stay unchanged), the simu-
lation is temporary frozen. In a classroom, this as-
pect is particularly important and leaves time for
students to estimate current position and to make
decision.
NMH cannot freeze the simulation, which means
that human agents compete in real time with ar-
tificial traders. Even if human agents can have a
hard time in this situation, it remains realistic in a
ICAART 2011 - 3rd International Conference on Agents and Artificial Intelligence
78
financial world where algorithmic trading is more
and more frequent.
In this section we have presented three major tech-
nical points that characterize ATOM and should also
concern many ASM. Even if other important techni-
cal issues could not be mentioned in this article, we
have stressed that the development of artificial stock
market platforms put forward a series of complex is-
sues in terms of computer science. In the next section,
we introduce some additional elements relative to the
artificial intelligence of virtual agents that can be run
in our platform. This question is of main concern for
computer scientists and for financial researchers alike.
4 ARTIFICIAL TRADERS:
FROM BASIC REACTIVE
AGENTS TO HIGHLY
SOPHISTICATED ENTITIES
Artificial agents, market participants, comply with ba-
sic agent-based modeling concepts (Wooldridge and
Jennings, 1995).
Autonomy means that an agent is not passive sub-
ject to a global, external flow of control in its ac-
tions. An agent has own objectives, abilities to
accept information, then to analyze it and based
on these results to make decision about further ac-
tions.
Proactivity means that the agents act in order to
achieve its objectives or goals. In terms of artifi-
cial financial market, agents trade (set up the buy
and sell orders) to maximize their wealth.
Many ASM can run large populations of homoge-
neous, respectively heterogeneous artificial traders.
This is also the case for ATOM, moreover it allows
facilities which are not available in other platforms.
Generally speaking, artificial traders are character-
ized by their a) available set of actions (buy, sell) and
possibility to switch between these activities (from
buyer to seller) b) decision making rules, for instance,
buyers cannot buy at a price higher than their buyer
value and sellers cannot sell for a price below their
seller cost c) scheduling of action: how often agent is
able to send the orders in respond to market request,
some agent participate one time per hour, while oth-
ers trade every minute d) information consideration,
in the mean which information agent requires from
market or external word in order to make decision and
what kind of information she shares for others e) pos-
sibility to describe status in mean of number of assets
and available cash or current budget. Agents hetero-
geneity is driven by different combinations of these
properties. For example, the following types of agents
can be implemented:
Zero Intelligence Traders (ZIT). This behavior is
merely based on stochastic choices: there are equal
possibilities to send ask or bid order, ZIT do not ob-
serve and do not ask any information to set up prices
and quantities, that are random variable. Concerning
scheduling, such traders respond to every market re-
quest. This kind of behavior has been popularized in
economics by (Gode and Sunder, 1993). Despite their
extreme simplicity, these agents are widely used be-
cause more sophisticated forms of rationality appear
to be useless to explain the emergence of the main
financial stylized facts at the intraday level.
Technical Traders. ”Chartists” are a specific popu-
lation of technical traders. These agents try to identify
patterns in past prices (using charts or statistical sig-
nals) that could be used to predict future prices and
henceforth send appropriate orders. One can find an
example of such behavior in (Arthur, 1994). From a
software engineering perspective, these agents need
to have some feedback from the market and some
kind of learning process as well (reinforcement learn-
ing for large sets of rules is generally used). At the
same time, technical traders ignore the actual nature
of the company, currency or commodity. This lead
to some complex algorithmic issues. For example, if
one considers a population of a few thousand Tech-
nical Traders, it is highly desirable to avoid that each
agent compute the same indicators, or simply store
themselves the whole price series.
Sophisticated Intelligence Traders (SIT). Several
kinds of SIT can evolve in ATOM:
i) Cognitive Agents generally have a full artifi-
cial intelligence, although it can be designed to be
rather minimal (usual features to develop such agents
are memory, information analysis processes, expecta-
tions, strategies and learning capacities). For exam-
ple, an agent buying at a specific price and sending
immediately a ”stop order” to short her position if the
price drops under θ% times the current price, will fall
in this category. Agents using strategic order split-
ting (see for example (Tkatch and Alam, 2009)) or ex-
ploiting sophisticated strategies (for instance, (Bran-
douy et al., 2009)) can also be considered as Cogni-
tive Agents.
ii) Evolutionary Agents are the ultimate form of
SIT; they outperform Cognitive Agents in terms of
KEY POINTS FOR REALISTIC AGENT-BASED FINANCIAL MARKET SIMULATIONS
79
complexity since they are able to evolve with their en-
vironment. These agents can also generate new rules
or strategies (this can require genetic algorithms for
example).
iii) Mean-Variance Agents are investors trading
over several order books, hence refer to portfolio op-
timisation aspects. When an investor wants to reopti-
mize her portfolio, she chooses and ”ideal” portfolio
from a mean-variance efficient frontier (Markowitz,
1952), that is based on analysis of internal and exter-
nal information. The choice of portfolio depends on
the trader’s risk aversion. These agents send buy and
sell orders in order to get closer to ”ideal” portfolio.
Such population of the agents is heterogeneous due
to their initial cash available, reoptimization (trading)
frequency and risk aversion.
Each and every of these agents can be imple-
mented in ATOM. Notice again that if each kind of
agents can be mixed with others, ATOM also allows
for human beings to be added into any artificial stock
market through a HMI.
5 VALIDATION TESTS
As mentioned previously (see section 2), every ASM
should succeed in processing perfectly a given order
flow collected from a real-world stock market at a spe-
cific date. The result is obtained confronting prices
delivered by the market at this date and the prices
generated by the ASM using the same set of orders.
It should also generate relevant ”stylized facts” with
regard to their real-world counterpart : these stylized
facts are statistical characteristics of financial time se-
ries that prove to be systematically observed in vari-
ous contexts (different assets, periods of time, coun-
tries).
This section presents how ATOM fulfill this re-
quirements, moreover, performance tests are consid-
ered.
5.1 Performance Test
We run several experiments to demonstrate running
time for realistic price series generation and existing
order-flow execution.
To demonstrate ATOM price fixing ability, we use
a group of heterogeneous agents. The population con-
sists of Zero Intelligence Traders (ZIT) and Technical
Simple Moving Average Traders (in the equal propor-
tions), described in the section 4. Number of fixing
prices is 10
5 1
. Number of agents varies from 10 to
1
On the Euronext Stock Exchange the number of fixed
10
5
. Results are introduced in the Figure 3(a). It takes
about 12 minutes to run 10
5
agents for price fixing.
To test running time of replaying engine, we use
real market order flow. The same agents population is
used to read all variety of orders (limit, market, stop-
limit, iceberg, etc.) and send them to order book. It is
up to the market to fix price in a proper way (accord-
ing to a fixing protocol). Number of orders vary from
100 to 10
5
. It takes 2 minutes to replay 10
5
orders
(see figure 3(b)).
0e+00 2e+04 4e+04 6e+04 8e+04 1e+05
0 200 400 600
Number of Agents
Time
(a) Price fixing time.
0e+00 2e+04 4e+04 6e+04 8e+04 1e+05
0 20 40 60 80 100 120
Number of Orders
Time
(b) Orders flow execution time.
Figure 3: Results of the performance testing.
5.2 ATOM Reality-check
In this section, we report a series of tests conducted
to check whether ATOM can generate financial dy-
namics in line with the ones of the Euronext-NYSE
stock-exchange or not. The first series of test is de-
voted to the ability of ATOM at generating unbiased
prices when it deals with a real-world order-flow.
Figure 4(a) and Figure 4(b) report results of the
first reality-check (top Figures report results pro-
duced with the ATOM data, bottom Figures be-
ing those based on Euronext-NYSE data). We ran
ATOM with a Hollow Agent reading the entire set
of 83616 orders concerning the French blue-chip
France-Telecom (FTE) recorded on June 26th 2008
between H9.02’.14”.813”’ and H17.24’.59”.917”’.
As mentioned previously, handling time in simula-
tions is particularly complex and may lead to unsolv-
able dilemma. We cannot guarantee an exact match-
ing of waiting times but rather a coherent distribution
of these values delivered by the simulator engine with
regard to the observed waiting times.
Notice that ATOM performs rather decently in sat-
isfying the first reality check procedure.
prices for different stocks varies from 1000 to 5000 per day
ICAART 2011 - 3rd International Conference on Agents and Artificial Intelligence
80
17.8 18.0 18.2
Simulated Time
Price
800 1600 2400 3200 4000 4800 5600 6400 7200 8000 8800 9600 10400
17.8 18.0 18.2
Physical Time
Price
10:00 12:00 14:00 16:00
(a) Prices: ATOM vs. Euronext-NYSE.
0 5000 15000 25000
Simulated Time
Volume
800 1600 2400 3200 4000 4800 5600 6400 7200 8000 8800 9600 10400
0 5000 15000 25000
Physical Time
Volume
10:00 12:00 14:00 16:00
(b) Volumes: ATOM vs. Euronext-NYSE.
Figure 4: Results of the ”Reality Check” procedure.
5.3 Stylized Facts
The second subset of tests focuses on ATOM abil-
ity to generate realistic artificial prices when popu-
lated with artificial agents. We ran a series of sim-
ulations to verify if ATOM can generate major styl-
ized facts that are usually reported in the literature
(see for example (Cont, 2001)). For the sake of sim-
plicity and space-saving, we only report in a picto-
rial form of the classical departure from Normality of
asset returns at the intraday level (Figures 5(a) and
5(b)). Notice again that these statistics are reported
on the left-hand Figures when based on ATOM prices
and on the right hand when based on Euronext-Nyse
data. ATOM produces stylized facts, quantitative as
return
Frequency
−0.5 0.0 0.5
0.0 0.5 1.0 1.5 2.0
(a) Departure from Nor-
mality, ATOM.
return
Frequency
−0.002 −0.001 0.000 0.001 0.002
0 500 1000 1500
(b) Departure from
Normality, Euronext-
NYSE.
Figure 5: Stylized facts, ATOM vs. Euronext-NYSE.
well as qualitative, that is quite difficult task for most
of artificial market platforms. Even if some artificial
markets are able to reproduce the main stylized facts
such as the non Gaussian return distribution or volatil-
ity clustering, the corresponding quantitative charac-
teristics (basic statistics) do not fit real ones. ATOM
can be easily calibrated to match specific quantitative
market features (moments). This calibration facility
is described in detail in the paper (Veryzhenko et al.,
2010).
6 POSSIBLE INTERACTIONS
WITHIN ATOM
There are two important points of interaction in the
financial market:
Who is interacting with whom: market-market,
agent-market, agent-agent, agent-external world,
etc.
What are the results of interaction: monetary pay-
offs, the commodity, money. Let’s consider, agent
A interacts with agent B, provides information to
agent C and pays money to agent B.
In this paper we consider only the first issue. Exist-
ing empirical studies of stock markets pay attention
to the market-market relation. We observe the long-
run linkages and co-movements between the markets,
such as Canadian, Mexican and United States. At
this moment, such interaction is not developed in
ATOM, but can be realized due to possibility to incor-
porate the different market micristuctures in the Mar-
kets modular.
It is well-known facts that market’s infrastructure
and rules is an important impact to the strategies of
participants and profitability of these strategies, that
is agent-market interaction. Traders submit orders de-
pending on the state of the order book or best quotes.
These orders may result in a change in the best prices.
The state of the market changes over time. The sub-
mission of an order is then dependent on the state of
the market at the time of the submittal. A feedback
loop is formed: a trader submits orders which affect
the state of the market which affects the decisions of
the trader on what order to submit. This kind of inter-
actions is observed in the ATOM, through Euronext
Stock Exchange sets of rules and agents behavior, in
other worlds, interaction between Markets and Agents
modulars. It exactly relies to MIC
, where the envi-
ronment defines actions sets of autonomous agents to
achieve their goals. Moreover, existing models of ad-
vance traders interactions fit well MIC
architecture.
Agents interact with one another in order to achieve
either a common or individual objectives. Let’s con-
sider some of existing ”agent-agent” interaction ap-
proaches.
i) The simplest agent-agent interactions is ”com-
munication” through environment, in the term of
stock market, through market microstructure or-
ganization. In such interactions, agent have dif-
KEY POINTS FOR REALISTIC AGENT-BASED FINANCIAL MARKET SIMULATIONS
81
ferent access to external information and differ-
ent interpretation of it, they estimate own sta-
tus and made decision about perspective bid-ask
prices and don’t share the trading strategy. In this
way, agent i sends her bid and ask orders with
their prices β
i
and α
i
respectively, with bid-ask
spread α
i
β
i
. A trade can be concluded be-
tween agents i and j, if β
i
> α
j
, and one chooses
agents propose the maximal bid and minimal ask
price. In order to keep agents equality and to
avoid the biases in the internal information ac-
cess, agents should be informed about book or-
der changes simultaneously. Following notifica-
tion method is realized in ATOM: all orders, as in-
fluences, are collected in the order book, once, all
agents have sent their orders, price is fixed as re-
action. This model fits IRM4S concept. As result,
the strategies influence general system state (price
formation) through ”collection of influences” (or-
der book), at the same time, agents use current
environment information (historical price) for fur-
ther decisions, in other worlds, the agents can also
interact through the common variable of the past
price history, but they are not directly affected by
the actions of others.
ii) More complex communication model has been
introduced by Cont and Bouchaud (Bouchaud and
Potter, 2000) (a special case of Ising Model).
Agents have three choices of market action: buy,
sell, unchanged. They can form coalitions with
other agents who share the choice of action. N
agents are assumed to be located at the vertices of
a random graph, and agent i is linked to agent j
with a probability p
i j
. A coalition is simply the
ensemble of connected agents (a cluster) with a
given action 4Θ. Agents in a cluster share the
same actions and do not trade among themselves.
iii) In the MIC
model two agent considered
as interaction when perceptions of an agent are
influenced by the emissions of another. Let’s
consider adaptive populations model of Lux and
Marchesi (Lux and Marchsi, 1999), where agents
are divided into two groups: fundamentalist and
noise(chartist) traders. Fundamentalist traders be-
lieve that stocks have a fundamental price p
f
.
Consequently, they sell stocks if the price p(t)
is higher that fundamental price and buy in the
opposite case. Noise traders rely on chart anal-
ysis techniques and use behavior of other agents
as information sources. Moreover, noise traders
are divided into an optimistic and a pessimistic
group. When the stock price rises, optimistic
noise traders will buy additional shares while pes-
simistic noise traders will start selling. The impor-
tant feature of this model is possibility to switch
strategy between optimistic and pessimistic pat-
terns, moreover between the noise and the fun-
damentalist agents groups, based on the profit
difference in such groups. Generally speaking,
agents can move between trading groups (noise,
fundamentalists) after the computation of trad-
ing outputs in the mean of profit, as result, they
change calculation or decision-making technique,
this rule relies to MIC
scheme. Cross-group
movements change the traders group proportion,
hence change the market state, that is influenced
also by individuals’ behavior (market price dy-
namic depends on agents strategies).
iv) The direct interaction is introduced by Kirman
(Kirman, 1993), an influence opinion formation
model. Agent’s may hold one of two views. In
each time step, two agents may randomly meet,
and there is a fixed probability that one agent may
convince the other one to follow his opinion. In
addition, there is also a small probability that an
agent changes his opinion independently. Ap-
plied to a financial market setting, one may there-
fore observe such interaction, like in the previous
model, between technical traders and fundamen-
talist, that drive the market dynamics. Note that
agents may change rules due to direct interactions
with other agents, but switching probabilities are
independent of the performance of the rules.
This is only some agent interaction models, that
are realized or can be developed under ATOM
API, this possibility is provided in the Agents
components, where populations of agents and
their relations are defined. Agent-economic world
is an important interaction, when agent seek the
asset portfolios management. This is one of the
flexibilities proposed in the ATOM API. Several
assets can be traded at each time step by any-kind
of agent, using sophisticated or extremely basic
strategies (such as optimal, respectively naive di-
versification). In this case, agents should use in-
formation about the state of the artificial econ-
omy at a given time horizon. All these informa-
tion are provided by the Artificial Economic World
component, which adds the possibility of describ-
ing the complete set of temporal dimensions in
the system (past, present, future). In this latter
case, agents could eventually use past prices for
the computation of co-moments among assets and
future values for expected returns and volatility,
or they accept these ”news” from Artificial Eco-
nomic World as parameters, in order to employ
mean-variance rebalancing theory.
ICAART 2011 - 3rd International Conference on Agents and Artificial Intelligence
82
7 CONCLUSIONS
The recent financial crisis has stressed the need for
new research tools that can deal with the high level
of complexity of the economic world. Agent based
methods propose a powerful alternative to traditional
approaches developed in finance. Among others, Ar-
tificial Stock Markets offer a completely controlled
environment to test new regulations, new exchange
structures or new investment strategies.
We showed that to build a realistic artificial stock
market platform is a difficult task, but can be easily
realized using main MAS concepts: agents behaviour,
environment etc. We also discussed a series of soft-
ware engineering and architecture design issues aris-
ing when the ultimate goal is to develop a complete
API for market simulation. The purpose of the cur-
rent work is to provide a polymorphic platform: it
therefore can be used for a wide range of large scale
experiments, including or not artificial agents, sophis-
ticated behaviors, communication over the network...
The possibility to employ well known MAS ab-
stract models in the financial market modeling has
been considered. We have presented how these no-
tions have governed the development of the ATOM
(ArTifical Open Market) API.
REFERENCES
Arthur, B. (1994). Inductive reasoning and bounded ratio-
nality : the el-farol problem. American Economic Re-
view, 84:406–417.
Bouchaud, J.-P. and Potter, M. (2000). Theory of Financial
Risk. Cambridge University Press.
Brandouy, O. and Mathieu, P. (2007). A conceptual frame-
work for the evaluation of agent-base trading and tech-
nical analysis. Artificial Markets Modeling. Methods
and Applications. Lecture Notes in Economics and
Mathematical Systems, 599:63–79.
Brandouy, O., Mathieu, P., and Veryzhenko, I. (2009). Ex-
post optimal strategy for the trading of a single finan-
cial asset. SSRN eLibrary.
Cesa-Bianchi, N. and Lugosi, G. (2001). Worst-case bounds
for the logarithmic loss of predictors. Machine Learn-
ing, 43:247264.
Cont, R. (2001). Empirical properties of asset returns: styl-
ized facts and statistical issues. Quantitative Finance,
1:223–236.
Ferber, J. and Muller, J.-P. (1996). Influences and reaction:
a model of situated multiagent systems. Second Inter-
national Conference on Multiagent Systems ICMAS-
96, pages 72–79.
Gode, D. K. and Sunder, S. (1993). Allocative efficiency
of market with zero-intelligence traders: Market as a
partial substitute for individual rationality. Journal of
Political Economy, 101(1):119–137.
Gouaich, A., Michel, F., and Guiraud, Y. (2005). Mic :
A deployment environment for autonomous agents.
E4MAS 2004, LNAI 3374, Springer-Verlag, pages
109–126.
Inchiosa, M. E. and Parker, M. T. (2002). Overcoming
design and development challenges in agent-based
modeling using ascape. In Adaptive Agents, Intelli-
gence, and Emergent Human Organization: Captur-
ing Complexity through Agent-Based Modeling, num-
ber 3, pages 7304–7308, 317 Paseo de Peralta, Santa
Fe.
Jacobs, B. I., Levy, K. N., and Markowitz, H. M. (2004).
Financial market simulation. The Journal of Portfolio
Management, 30th Anniversary Issue:142–151.
Kirman, A. (1993). Ants, rationality, and recruitment.
Quarterly Journal of Economics, 108:137–156.
Le Baron, B. (2002). Building the santa fe artificial stock
market. Working Paper, Brandeis University.
Lux, T. and Marchsi, M. (1999). Scaling and criticality in
a stochastich multi-agent model of a financial market.
Nature, 397:498–500.
Markowitz, H. (1952). Portfolio selection. The Journal of
Finance, 7(1):77–91.
Michel, F. (2007). The irm4s model: The influence/reaction
principle for multi-agent based simulation. AA-
MAS’07. Sixth International Joint Conference on Au-
tonomous Agents and Multiagent Systems, pages 908–
910.
Mitchell, T. M., editor (1997). Machine Learning.
WCB/McGraw-Hill, New York, NY.
Raberto, M., Cincotti, S., Focardi, S., and Marchesi, M.
(2003). Traders’ long-run wealth in an artificial finan-
cial market. Computational Economics, 22:255–272.
Ricordel, P.-M. and Demazeau, Y. (2001). Volcano, a
vowels-oriented multi-agent platform. In CEEMAS,
pages 253–262.
Tkatch, I. and Alam, Z. S. (2009). Strategic order splitting
in automated markets. SSRN eLibrary.
Veryzhenko, I., Brandouy, O., and Mathieu, P. (2010).
Agent’s minimal intelligence calibration for realis-
tic market dynamics. Progress in Artificial Eco-
nomics Computational and Agent-Based Models. Lec-
ture Notes in Economics and Mathematical Systems
645, pages 3–14.
Witkam, J. (2003). Altreva adaptive modeler.
http://www.altreva.com.
Wooldridge, M. and Jennings, N. (1995). Intelligent agents:
Theory and practice. The Knowledge Engineering Re-
view, 10(2):115–152.
Woolridge, M. (2002). Introduction to Multiagent Systems.
Introduction to Multiagent Systems., New York, NY,
USA.
Zambonelli, F., Jennings, N. R., and Wooldridge., M.
(2003). Developing multiagent systems: The gaia
methodology. In ACM Transactions on Software En-
gineering Methodology, 12(3)(3):317–370.
KEY POINTS FOR REALISTIC AGENT-BASED FINANCIAL MARKET SIMULATIONS
83