http://dx.doi.org/10.4236/ti.2012.33025 Published Online August 2012 (http://www.SciRP.org/journal/ti)
Genetic Algorithm for Arbitrage with More than
Three Currencies
Adrián Fernández-Pérez , Fernando Fernández-Rodríguez , Simón Sosvilla-Rivero
1 1 2
1 Department of Quantitative Methods, University of Las Palmas de Gran Canaria, Las Palmas de Gran Canaria, Spain
Department of Quantitative Methods, Complutense University of Madrid, Madrid, Spain
2
Email: adrian.fernandez102@alu.ulpgc.es, ffernandez@dmc.ulpgc.es, sosvilla@ccee.ucm.es
Received June 19, 2012; revised July 20, 2012; accepted July 27, 2012
ABSTRACT
We develop a genetic algorithm that is able to find the optimal sequence of exchange rates that maximizes arbitrage
profits with more than three currencies, being both the triangular arbitrage and the direct exchange rate two special
cases of the proposed algorithm. Applying the algorithm to the most traded currencies, we find average profits ranking
from 4.5083% to 0.3162% for changing 1 USD for EUR with respect to the direct exchange rate, for different transac-
tion costs, during the period October 2000-April 2012. Our results also suggest that the arbitrage profits increased just
after the subprime crisis in summer of 2007 and that they are higher when the market is less liquid.
Keywords: Arbitrage; Foreign Exchange Market; Genetic Algorithm
1. Introduction follow the methodology developed in Reference [2] for
automatic selection.
Triangular arbitrage is a widely used tool in foreign ex-
change (FX) markets. It is based on exploiting an arbitrage
opportunity resulting from a pricing discrepancy among
three currencies. FX traders with many years of experi-
ence are able to find triangular arbitrage opportunities at
a glance, by comparing the prices of three currencies
simultaneously. However, it is very unlikely that, at first
glance, they could be able to find arbitrage opportunities
when they come into play more than three currencies.
Moreover, even if they are able to find triangular arbi-
trage opportunities at any given time, the profits from
triangular arbitrage based on only three currencies could
be lower than those obtained from arbitrating with more
than three currencies.
The GA starts with a large number of randomly gener-
ated chromosomes designed to encode potential solutions
to the problem. Suppose that we begin by considering a
sequence of exchange rates taken at random with a
maximum of 5 currencies{ x 1 , x 2 , x 3 , x 4 , x 5 }, encoding the
sequence by means of vectors formed by natural numbers
between 0 and 6, where 0 means no currency and where
1 = Australian Dollar (AUD), 2 = Euro (EUR), 3 = Swiss
Franc (CHF), 4 = Japanese Yen (JPY), 5= United States
Dollar (USD), and 6 = Pound Sterling (GBP). Since the
EUR/USD is the most traded rate, we seek for a sequence
that allows us to exchange 1 USD for EUR. For instance,
vector { x 1 , x 2 , x 3 , x 4 , x 5 } = {3, 6, 2, 5, 4} means the fol-
lowing sequence of currencies {CHF, GBP, EUR, USD,
JPY}, or the following sequence of exchange rates (as-
suming that we exchange USD to EUR): {CHF/USD,
GBP/CHF, EUR/GBP, USD/EUR, JPY/USD, EUR/JPY}.
Next, the following objective function evaluates each
potential solution, assigning each chromosome a fitness
value, ranking chromosomes from best to worst:
We develop a fast genetic algorithm (GA) that is able to
find the optimal sequence of exchange rates that maxi-
mizes arbitrage profits with more than three currencies, be-
ing both the triangular arbitrage and the direct exchange
rate two special cases of the proposed algorithm.
2. A GA for Arbitrage with More than Three
Currencies
Max x max f d d ,0
i
where f is the final amount of EUR that we obtain using
the sequence suggested by chromosome { x 1 , x 2 , x 3 , x 4 , x 5 }
and d is the amount of EUR that we obtain using the di-
rect EUR/USD exchange rate. To keep our analysis real-
istic, every time we use an exchange rate, we apply a
GAs are a class of adaptive search and optimization
technique based on the principles of natural evolution,
initially developed in Reference [1]. In our strategy, we
1 The 0.05% transaction costs include bid-ask spread, commissions and
transaction cost k ·0.05%, k = {1, 5, 10, 15} 1 , where the
fixed costs of using the trading platform.
Copyright (c) 2012 SciRes. TI