A Step-By-Step Implementation of a Multi-Agent Currency Trading System

A Step-By-Step Implementation of a Multi-Agent Currency Trading System

Rui Pedro Barbosa, Orlando Belo
DOI: 10.4018/978-1-60960-171-3.ch014
(Individual Chapters)
No Current Special Offers


With this chapter the authors intend to demonstrate the potential practical use of intelligent agents as autonomous financial traders. The authors propose an architecture to be utilized in the creation of this type of agents, consisting of an ensemble of classification and regression models, a case-based reasoning system and an expert system. This architecture was used to implement six intelligent agents, each being responsible for trading one of the following currency pairs with a 6-hour timeframe: CHF/JPY, EUR/CHF, EUR/JPY, EUR/USD, USD/CHF and USD/JPY. These agents simulated trades during an out-of-sample period going from February of 2007 till July of 2010, having all achieved an acceptable performance. However, their strategies resulted in relatively high drawdowns, and much of their profit disappeared once the trading costs were factored into the trading simulation. In order to overcome these problems, they integrated the agents in a multi-agent system, in which agents communicate their decisions to each other before sending the market orders, and work together to eliminate redundant trades. This system averaged out the returns of the agents, thus eliminating much of the risk associated with their individual trading strategies, and also originated considerable savings in trading expenses. Their results seem to vindicate the usefulness of the proposed trading agent architecture, and also demonstrate that there is indeed a place for intelligent agents in financial markets.
Chapter Preview


The foreign exchange market, or Forex market, is the place where currency prices are set. The participants in this market can be divided in three main groups: banks, brokers and clients (Shamah, 2003). Central and commercial banks provide the bulk of liquidity, while brokers act as intermediaries for clients, which can range from multinationals to individual speculators. Trading in the Forex market is accomplished with the buying and selling of currency pairs. The price of a currency pair states the price of the base currency in terms of another currency. For example, USD/JPY is the price of the United States Dollar expressed in Japanese Yen. A price of 107.57 for the USD/JPY pair means we need 107.57 JPY to buy 1 USD. To profit from price movements in this pair, we should buy USD/JPY lots (go long) if we expect the USD to become more valuable compared to the JPY, or sell USD/JPY lots (go short) if we expect the JPY to become more valuable compared to the USD. Buying the currency pair actually means buying the base currency and selling the other currency, while selling the currency pair means selling the base currency and buying the other one. Closing an open trade is achieved by performing the opposite operation, i.e., buying the currency that was sold and selling the one that was bought. When a trade is closed, the resulting profit or loss can be expressed in pips. A pip is the smallest possible change in the price of a currency pair. For the USD/JPY pair, a pip corresponds to a price movement of 0.01.

The Forex market is quite different from any other financial market. The most remarkable differences are the nonexistence of a central marketplace and the fact that it is available 24 hours a day. Currency prices continuously rise and fall throughout the week, in reply to the constant flow of news and reports being released, and periods of high volatility are frequent. For this reason, trading currencies is always associated with a great deal of risk. The objective of our research is to implement agents that can manage this risk, and that can trade profitably in this market. We will start by devising the mechanism that the agents use to predict currency price movements. Different implementations will be tested, from using a simple standalone classification or regression model to using an ensemble of models. The practical use of these data mining models in financial time series prediction has already been extensively studied. Yao and Tan (2000) obtained empirical evidence of the usefulness of artificial neural networks in the development of profitable Forex trading strategies. Franses and Griensven (1998) reported similar results, and demonstrated that artificial neural networks can often perform better than linear models. The same conclusion was achieved by Kamruzzaman and Sarker (2003), which showed that artificial neural networks can outperform traditional time series prediction models, such as the autoregressive integrated moving average. But artificial neural networks are not the only models that have been shown to make reasonably accurate Forex predictions. Gençay (1999) compared the performance of nearest neighbour regression models with artificial neural networks using different sets of currency price data, and concluded that the nearest neighbour models performed better. Tay and Cao (2001) used different types of financial data to compare the predictive capability of both artificial neural networks and support vector machines, and concluded that the support vector machines made better predictors.

Complete Chapter List

Search this Book: