and volatility. In each trading session, chartist agents
trade near best bid and best ask. For this type of
agents, we use the procedure inspired by price setting
rules described in (Jacobs et al., 2004).
1. Bid price
P
Bid
t
= P
Bid
t−1
+ β
t
where P
Bid
t−1
is the best bid price in the order
book in t − 1; β
t
is a random value in the range
[1; 5]: it means that best bid price at the moment t
will be increased by value from 1 to 5 cents. P
Bid
0
is equal to the previous day closing price. If agent
gets an intention to buy stocks, she should check
our the best bid order and increase it by a certain
value β
t
in order to set up her order on the top
of the order book, decrease bid-ask spread and in-
crease own chances to realize transaction. In other
words, bidder is ready to pay up to 5 cents more
than the rest of traders.
2. Ask price
P
Ask
t
= P
Ask
t−1
− α
t
where P
Ask
t−1
is the best ask price in the order
book in t − 1; α
t
is a random value with the range
[1; 5]: it means that best ask price at the time t will
be decreased by value from 1 to 5 cents. P
Ask
0
is
previous day closing price.
This rule provides liquidity and reduce the bid-ask
spread (difference between buy/sell prices).
In the condition of double auction market, a profit-
oriented buyer sets up the price lower his limit price
because there would be a seller willing to accept this
low bid price. Similarly, a seller sets a price higher
his limit price, expecting that there would be a bidder
ready to accept a high ask price. In condition of com-
petitive market, the price comes closer to the market
equilibrium price. As long as the buyer can under-
cut a competitor and still make a profit, he will add
some insignificant amount to the last best bid price,
similarly, seller will decrease the last best ask price
by insignificant value, if it does not exceed his limit
price.
2.3 Simulations and Results
Here we describe the model of market mechanism and
agents interaction parameters we use in our experi-
ments.
As in real market, trading occur asynchronously
at discrete-time interval t = 1,2...510, that represents
a trading day of 8.5 hours at a minute granularity. At
each round a trader is picked by the system to make
a decision. A trader can have only one open position
at the time and, therefore, before issuing a new or-
der he should cancel an old one pending in the order
book. The agents send limit, market and cancel or-
ders. They also have a possibility to send a null order.
In such a way we model different trading frequencies,
and hence model realistic patterns of activity through-
out the day.
According to study realized by (Paddrik et al.,
2012a) there are around 2500 fundamentalists (buy-
ers and sellers). Due to the large number of traders,
we scale our simulations to 1/10 of the market, and
populate our artificial market by 250 fundamentalists.
In the first experiment we run two scenarios: i)
operation shock (without fundamental reasons) in the
market populated by 250 fundamentalists only (these
simulation results serve as a benchmark to study an
impact of technical traders) ii) operation shock in the
market populated by 100 fundamentalists, 50 momen-
tum agents, 50 RSI agents, and 50 SMA agents. Each
of these experiments we conduct consists of 100 runs,
where each run begins with the same initial condi-
tions (initial wealth, hold stocks, etc). In such a way,
all statistics are averaged by over 100 repetitions. The
main parameters of these experiments are detailed in
Table 2.
Flash crash can be initiated by events and prac-
tices destroying liquidity. In two scenarios we cause
a flash crash by introducing an aggressive market or-
der like in the paper of (Brewer et al., 2013). In such a
way we get an immediate effect on the market dynam-
ics. Flash crash is produced by submitting a 20-time
higher volume market order compared to average or-
der size, that can be considered as operational error
produced by a trader. Liquidity measures take about
20 best limit updates to return to their initial level (De-
gryse et al., 2005). For this reason an agent submits
a 20-times higher volume market order in the expec-
tation of matching about 20 best limits. This error
is introduced in the middle of trading day, at 255th
round.
We study the impact of this operational shock on
the market liquidity and price dynamic. In both sce-
narios, ask market order destroys bid side liquidity
and price falls rapidly. Just after this crash, bid side
contains few orders, hence the market is at its most
vulnerable and sensitive stage. High volatility period
follows the crash. Figures 1(b) and 1(d) report an in-
creasing of bid/ask spread, and consequently, a high
volatility.
In the presence of intraday technical traders,
which ignore the true value of the stock, the market
crash is deeper (for the same shock, the speculative
market loses on average 26.5%, while fundamental-
ists market declines on 12.3%) because speculative
strategies bring down the prices. Downward trend
is quickly explored by chartist, which exacerbate the
Post Flash Crash Recovery: An Agent-based Analysis
193