
ICAIF ’22, November 2–4, 2022, New York, NY, USA Colea et al.
Figure 2: Order book denitions
unique agent trained as a conditional generative adversarial Net-
work (CGAN) [
17
] from historical data, without the need of making
assumptions about the individual market agent strategies.
The world agent was simplistic: it was only capable of placing limit
orders which usually account for just 50% of all trading actions.
Nevertheless, it was shown in [
6
] that this model could reproduce
stylized facts as well as some form of market impact of trading -
hence, this work provides a rst attempt to a realistic and respon-
sive world model. Figure 1 shows a classic multi-agent simulator
compared to the World Model, in which all the background agents
are represented with a unique World Agent.
In this paper, we improve the design of the CGAN-based world
model by extending it to support all main market actions (i.e., mar-
ket order, add limit order, cancel order, and replace order), and we
describe it alongside another world model constructed explicitly as
a mixture of parametric distributions. Moreover, we improve the
CGAN robustness and stability by unrolling the model during the
training.
We demonstrate that both approaches presented in this paper
outperform previous work on world model construction by pro-
viding higher degree of simulation realism. We also emphasize
and experimentally demonstrate that the GAN-based model ap-
plies to dierent heterogeneous stocks, as it does not make explicit
assumptions about the data distributions.
2 BACKGROUND
In this section we introduce the readers to limit order book markets,
with a brief introduction to market structure and mechanisms.
2.1 Limit Order Book (LOB)
Financial markets oer a place for buyers and sellers to meet and
trade on dierent assets. Modern electronic markets, such as NAS-
DAQ, provide ad-hoc message protocols to facilitate trades and pro-
vides real-time information about the market order ow and state.
In particular, the ITCH [
13
] protocol provides access to anonymized
market data with highest granularity, including all the orders in the
market. The main four fundamental orders are: Market orders,Add
limit orders,Cancel orders, and Replace orders. They respectively
indicate the intention of trading a given amount of shares at any
price; the intention of trading shares at a xed limit price; a cancel-
lation of a previous limit order; and a modication to a previous
limit order (e.g., a change in the price or quantity).
Most equity markets employ a continuous-time double auction
mechanism to handle the stream of orders, and to execute a trans-
action whenever a buyer and seller agree on the price [
2
]. To store
the supply and demand for each asset, the market exchange uses
an electronic record called limit order book (LOB). The LOB keeps
record of all outstanding limit orders into dierent levels, organized
by price, and it continuously updates them according to incoming
orders. Figure 2 shows a snapshot of a LOB with the available supply
(red bars) and demand (green bars). The rst bars (L1) represent the
rst level, the second bars (L2) the second level, and so on. Each bar
keeps the outstanding orders into a queue structure. An add limit
order to buy will update the existing demand, increasing the queue
size (see Figure 2 light green); while a cancel order will decrease the
queue size, and consequently reduce supply or demand.
2.2 Articial Market properties
Realism.
Evaluating trading strategies against poorly calibrated
market models can lead to poor and misleading conclusions, po-
tentially causing severe loss when we employ these strategies on
real markets. To assess the realism of articial models, researchers
commonly evaluate their ability to reproduce statistical properties
of real markets called stylized facts [
2
,
7
,
24
]. For example, as as-
set daily returns usually have fat tail distribution and long-range
dependence, we expected the same properties (or stylized facts)
from articial markets. In Section 5 we show that our approach
outperforms existing work under a wide range of stylized facts. In
particular, we consider auto-correlations,heavy tails distribution,
and long range dependence to evaluate asset return properties. While
we consider order volumes,time to rst ll,depth and market spread
distributions, to evaluate the volumes and order ow. 1
Responsiveness.
Another desirable property of articial market
models is the responsiveness to exogenous trading orders: the model
should emulate the market reaction to new orders, providing a tool
to investigate strategies’ impact on the market. For example, the
arrival of several buy (sell) market orders commonly causes the rise
(fall) of the price. This phenomenon is called price impact, and it
desirable that a responsive model exhibit this behavior.
In section 5 we evaluate the responsiveness of our model by
simulating the arrival of a burst of buy/sell orders [1].
2.3 Generative Models and CGANs
In the last years generative models have been successfully employed
in a wide range of scenarios, ranging from images to time-series.
A generative model is any model able to learn a probability distri-
bution
𝑝model
resembling the real data distribution
𝑝data
, from a
set of real samples. Among generative models, we can identify two
major approaches: a) models that explicitly estimate the probability
density function; b) and models that implicitly learn to generate
samples without the need of an explicit density function [10].
Generative Adversarial Networks (GANs)
.GANs are power-
ful generative models that consider two adversarial neural networks,
which implicitly learn to generate data samples [
11
]. In particular,
a generator
𝐺
and a discriminator
𝐷
are trained simultaneously to
1We refer the reader to the work in [24] for a detailed introduction to stylized facts.