Conference PaperPDF Available

Building a Simulation Model of Foreign Exchange Market: Reproduction of Yen Dollar Market

Authors:

Abstract and Figures

The purpose of this study is to make a basic For- eign Exchange Market Model. It is important to make a simple basic model at first to understand the complex emergence of exchange rate which is caused by various factors. The model is a multi- agent-based model, consisting of dealer and spec- ulator. Both agents' action relies on market trend and their personality, either trend follower/ Con- trarian. In this paper, the simulation experiments are done by changing the ratio of Trend Follower and Contrarian. As a result, the complex fluc- tuation of exchange rate can be observed. The validity of this model is evaluated by the effect between the size of fluctuation and probability.
Content may be subject to copyright.
Building a Simulation Model of
Foreign Exchange Market
- Reproduction of Yen Dollar Market -
Ayako Usami1
Ryunosuke Tsuya 2
Takashi Iba 1
Hideki Takayasu 3
*1 Faculty of Policy Management, Keio University
*2 Research Institute at SFC, Keio University
*3 Sony Computer Science Laboratories
Abstract
The purpose of this study is to make a basic For-
eign Exchange Market Model. It is important to
make a simple basic model at first to understand
the complex emergence of exchange rate which is
caused by various factors. The model is a multi-
agent-based model, consisting of dealer and spec-
ulator. Both agents’ action relies on market trend
and their personality, either trend follower/ Con-
trarian. In this paper, the simulation experiments
are done by changing the ratio of Trend Follower
and Contrarian. As a result, the complex fluc-
tuation of exchange rate can be observed. The
validity of this model is evaluated by the effect
between the size of fluctuation and probability.
Keywords: Foreign Exchange Market, Artificial
Market, Agent-Based Simulation, Econophysics
1 Introduction
The model to be developed in this paper is Yen-
Dollar market which adopts floating exchange-rate
regime. By building a model through new ap-
proach, using multi-agent modeling and computer
simulation, an economic research from new point
of view can be achieved [1].
It should be noted that the foreign exchange
market is a special market compared to other mar-
kets. In a foreign exchange market, an amount of
money that is dealt in a day is two hundred tril-
lion yen but the actual demand does not reach 10
% of it. Most of the dealings are for speculation.
However, many studies about such a special mar-
ket have been reported recently. This leads to the
creation of a high consisting mathematical model.
As a process of this research, we will first de-
velop the basic model, and then extend it grad-
ually. Thus, the model described in this paper
is very simple and small scaled. Changing the pa-
rameter in every phase will be possible using Plat-
Box Simulator1[2]. Therefore each factor’s effect
can be calculated accurately by analyzing the sim-
ulation results [3].
2 Model
2.1 Basic Structure of the Model
There are three types of agent in this model:
Dealer and Speculator, as a market participant,
and Market agent as a wirepuller to bring suit-
able dealings. The reason for selecting Dealer and
Speculator as a market participants is because in
real market, the purpose of most dealings are for
speculation.
Dealer agent has a “Limit Order Behavior” that
decides limit order and sends it to Market agent.
Speculator agent has a “Market Order Behavior”
that decides market order and sends it to Mar-
ket agent. Market agent has a “Mediate Dealings
Behavior” that brings suitable dealings between
market order and limit order.
2.2 Flow of the Simulation
The flow of Yen Dollar market model will be as
follows.
1. Market sends a past exchange rate informa-
tion to few Dealers.
1PlatBox Simulator is a software platform to execute
and to analyze the agent-based social simulations. See our
web site (http://www.platbox. org/) for more information.
Contrarian
Contrarian
Dealer
Dealer
Limit Order
Market Order
Ꮢ႐
Dealings
Limit Order List
Past Exchange Rate Information
Figure 1: The world of Yen Dollar Market
2. Dealer calculates the short term regulation of
an exchange rate[4]. Based on the regulation,
it decides the limit order2and sends it to the
Market.
3. Market then adds the limit order to limit or-
der list one after another. When the limit or-
der list completes, Market will send the past
exchange rate information to Speculator.
4. Speculator calculates regulation of an ex-
change rate. Then decides a market order3
and sends it to the Market.
5. Market refers to the limit order list and brings
the most suitable dealing to fruition.
6. After dealing, Market adds new exchange rate
to the past exchange rate information. Then
Market receives the new limit order from
Dealer that has done its dealing. Then Mar-
ket brings dealings with Speculator’s market
order again.
7. When an exchange fluctuation goes up and
down greatly, both of expectation and anxiety
of market participants are increased. There-
fore change the number of Dealer participat-
ing in dealings.
2.3 Decision Method of Agent’s Or-
der
The decision making of Dealer and Speculator is
as follows. Among Dealer, there are Trend fol-
lower4and Contrarian5, whose ratio is set and
they decide limit order by their type and the mar-
ket trend. The trend can be referenced from an
2Limit order is an order to announce the price that a
dealer wants to have dealings beforehand.
3Market order is an order, which hit an order for selling
or buying to limited order, and make a deal.
4Trend follower is market man who gives an order which
follows the market trend.
5Contrarian is market man who gives an order that is
contrary to the market trend.
Dealer
Market
Contrarian
Limit Order
Relation
Market Order
Relation
Market Order
Behavior
Mediate Dealings
Behavior
Limit Order
Behavior
Figure 2: Class diagram of Relation and Behavior
(Yen Dollar Market model)
arbitrary moving average, which is calculated from
a past few periods decided by the parameter.
Tr =1
P
P
i=1
Ri 1
P
3P
i=2P+1
Ri
Note that Tr is an index of market trend, Pis
the period to refer the past exchange rate, and Ri
is The Exchange rate of i-th period. If there is
a sharp fluctuation, they widen the Spread. The
number of sell and buy order will be the same and
it is selected from 1-11 at random.
Within the speculator, there are Trend Follower
and Contrarian. They decide their own market or-
der depending on their type and the market trend.
The number of order is selected from 1-11 at ran-
dom.
3 Simulation Experiment
3.1 Experiment 1: Basic Settings
3.1.1 Setting
The setting of the simulation is as follows:
Number of Dealer = 20
Number of Speculator = 1
Trend Follower Dealer: Contrarian Dealer= 1
:1
Trend Follower Speculator : Contrarian Spec-
ulator = 1 : 1
Dealer’s referring past exchange rate = 15 pe-
riod
Speculator’s referring past exchange rate = 0
- 100 period
9900
9950
10000
10050
10100
10150
10200
0 10000 20000 30000 40000 50000 60000 70000 80000 90000 100000
"processed_data1/default_1_ask.csv"
Figure 3: Transaction of market price, where it
shows settled down to original exchange rate pat-
tern.
One Speculator is enough in this model. The rea-
son is because the continuous session is adopted in
this model as a form of dealings. Either Trend Fol-
lower or Contrarian will be decided in each step.
We run the simulation one hundred thousand steps
changing the random seed number in 10 patterns.
The time scale of one hundred thousand steps will
be about 8 days.
3.1.2 Result of Experiment
There are three fluctuation types. “Settle down
to original exchange rate pattern”, “Rising ex-
change rate pattern”, and “Falling exchange rate
pattern”. Graphs of those patterns are shown in
figure 3, 4, 5. The exchange rate moves little by
little every step, and occasionally very big. The
percentage which exchange rate moves in figure 3
was 20%. Figure 4 pattern was 50% and figure
5 pattern was 30%. In all of these results, lit-
tle exchange rate fluctuations appear many times
but as the range of fluctuation becomes larger, the
outbreak frequency decreases.
“Settle down to original exchange rate pattern”
shows that around 50 thousand steps, the rate
moves up and down greatly, but eventually it set-
tles down to its original rate. We see from “Falling
exchange rate pattern” that the rate sometimes
fluctuates 0.3-0.5 yen in 1500 intervals. On the
other hand there are only two times that rate fluc-
tuates 0.3-0.5 yen at figure 4. Overall, the rate
fluctuation in figure 5 is more than that in figure
4.
3.1.3 Analysis
The Agent’s strategy in this model is influenced
only by market trend and their personality. They
do not study or be influenced from fundamentals.
9900
9950
10000
10050
10100
10150
10200
0 10000 20000 30000 40000 50000 60000 70000 80000 90000 100000
"processed_data1/default_4_ask.csv"
Figure 4: Transaction of market price, where it
shows rising exchange rate pattern.
9900
9950
10000
10050
10100
10150
10200
0 10000 20000 30000 40000 50000 60000 70000 80000 90000 100000
"processed_data1/default_3_ask.csv"
Figure 5: Transaction of market price, where it
shows falling down exchange rate pattern.
Even in this very simple model, the exchange rate
fluctuated intricately and is difficult to estimate.
Also the phenomenon in real market, that there
are less outbreak frequencies as fluctuation be-
comes larger was reproduced. These show that
exchange rate fluctuates very intricately like a real
market even in the simple model without the fun-
damentals.
3.2 Experiment 2: The Ratio of
Trend Follower and Contrarian
3.2.1 Settings
The experimentation was given in two patterns,
by changing the ratio of the Trend follower and
Contrarian equals the ratio of (1) 3:2 and (2) 2:3.
The Dealer’s ratio of Trend follower and Contrar-
ian is as same as Speculator’s ratio.
3.2.2 Result of Experiment
As a result of the pattern Trend Fol-
lower:Contrarian = 3:2, shown in figure 6,
9500
10000
10500
11000
11500
12000
12500
13000
13500
14000
0 10000 20000 30000 40000 50000 60000 70000 80000 90000 100000
"processed_data/3x2/3x2_1.csv"
Figure 6: Transaction of market price (Trend fol-
lower : Contrarian = 3 : 2)
9500
10000
10500
11000
11500
12000
12500
13000
13500
14000
0 10000 20000 30000 40000 50000 60000 70000 80000 90000 100000
"processed_data/2x3/2x3_1.csv"
Figure 7: Transaction of market price (Trend fol-
lower : Contrarian = 2 : 3)
the rate fluctuation of becomes very big. The
record of exchange rate in any random number
setting had a similar result.
In the case of the pattern Trend follower: Con-
trarian = 2:3, shown in figure 7, the rate decreases.
The record of exchange rate in any random num-
ber had a similar result.
3.2.3 Analysis
Considerable result appeared just by changing the
ratio of Trend Follower and Contrarian. The rate
fluctuates big when most market men is a Trend
Follower. On the other hand, the rate gently fluc-
tuates down when many Contrarians are in the
market. That is to say, instead of following but
by always making the order that goes against the
trend, allows to the market to keeps the exchange
rate stable. Data show that there are many Trend
Followers in the U.S.A and exchange rate fluctua-
tion is a bit larger.
The another interesting point is that if the ratio
of Trend Follower or Contrarian increases, all re-
sult records become similar irrespective of random
seed number. This is caused by the power of Trend
Follower to push forward the fluctuation in one di-
rection, or the power of Contrarian to crush the
fluctuation. The result leads to our presumption
that the continual change of the Trend Follower
and Contrarian’s ratio causes the exchange rate
to be more intricate and difficult to estimate.
4 Conclusion
This research takes part in the project to research
the exchange regime, and the main stress falls on
Asian financial stability. Recently, introduction of
Asian common currency has been becoming realis-
tic, creating a meaning to study the characteristics
of each exchange rate system.
However, further studies and experimentations
are needed for higher validity and to extend other
facts into this basic model. Running the simula-
tion and analyzing the result of each parameter,
such as number of dealer and the period of past
exchange rate to get the trend, is important.
References
[1] Kiyoshi Izumi. Artificial Market: Complex
Systems Approach of Marketing Analysis.in
Japanese. Morikita Publishers, 2003
[2] Takashi Iba. “Understanding Social Complex
Systems with PlatBox Simulator”, The 5th In-
ternational Conference on Computational In-
telligence in Economics and Finance, 2006
[3] Nozomu Aoyama, Rintaro Takeda, Takashi
Iba, Hajime Ohiwa. “Simulation Development
Tools with MDA”, International Workshop on
Massively Multiagent Systems, 2004
[4] Hideki Takayasu. The Discovery of Econo-
physics. in Japanese. Koubun Company, 2004
[5] Hideki Takayasu (ed). Practical Fruits of
Econophysics. Springer-Verlag, 2004
[6] Kiyoshi Izumi and Kazuhiro Ueda “A Mar-
ket in the Computer: Construction and Eval-
uation of an Artificial Market with Agents
Having the Cognitive Mechanisms”. Journal of
Cognitive Science, 1999
[7] LaBaron Blake: “A Builder’s Guide to Agent
Based Financial Markets”. Quantitative Fi-
nance, pp.254-261, 2001
ResearchGate has not been able to resolve any citations for this publication.
Article
Full-text available
In this study, an artificial market approach, which is a new agent-based approach to investigate foreign exchange markets, is proposed. Using this approach, three emergent phenomena of markets were explained. First, in order to investigate the learning patterns of actual dealers, we held an interview with a dealer. Second, based on the field data acquired, we constructed a multiagent model of a market using genetic algorithms. Finally, the emergent phenomena of markets were analyzed using the simulation results of the model. The results showed that the interaction between the agents' forecasts and the relationship of demand and supply caused the phase transition of forecast variety. The three emergent phenomena were explained by the phase transition. This approach, therefore, integrates the fieldwork and the multiagent model, and provide quantitative explanation of the micro-macro relation in markets.
Article
Full-text available
This paper is intended to guide researchers interested in building their own agent-based financial markets. Key design questions are outlined, along with some of the major controversies about which directions to take.
Practical Fruits of Econophysics
  • Hideki Takayasu
Hideki Takayasu (ed). Practical Fruits of Econophysics. Springer-Verlag, 2004
Simulation Development Tools with MDA
  • Nozomu Aoyama
  • Rintaro Takeda
  • Takashi Iba
  • Hajime Ohiwa
Nozomu Aoyama, Rintaro Takeda, Takashi Iba, Hajime Ohiwa. " Simulation Development Tools with MDA ", International Workshop on Massively Multiagent Systems, 2004
Artificial Market: Complex Systems Approach of Marketing Analysis
  • Kiyoshi Izumi
Kiyoshi Izumi. Artificial Market: Complex Systems Approach of Marketing Analysis. in Japanese. Morikita Publishers, 2003