Contents lists available at ScienceDirect

Simulation Modelling Practice and Theory

journal homepage: www.elsevier.com/locate/simpat

ENMX: An elastic network model to predict the FOREX market

evolution

Antonio V. Contreras

a

, Antonio Llanes

⁎,b

, Alberto Pérez-Bernabeu

c

, Sergio Navarro

d

,

Horacio Pérez-Sánchez

b

, Jose J. López-Espín

c

, José M. Cecilia

b

a

Universidad Católica de Murcia (UCAM), Murcia 30107, Spain

b

Bioinformatics and High Performance Computing (BIO-HPC) Research Group, Universidad Católica de Murcia (UCAM), Murcia 30107, Spain

c

Center of Operations Research, Miguel Hernández University, Elche Campus, Spain

d

Artiﬁcial Intelligence Talentum, S.L., Campus Universitario de Espinardo, Ediﬁcio CEEIM, Murcia 30100, Spain

ARTICLE INFO

Keywords:

FOREX prediction

Market prediction

Elastic network model

Pseudo-Voigt proﬁle

Bio-inspired methods

ABSTRACT

The foreign exchange (FOREX) market is a ﬁnancial market in which participants, such as in-

ternational banks, companies or private investors, can both invest in and speculate on exchange

rates. This market is considered one of the largest ﬁnancial markets in the world in terms of

trading volume. Indeed, the just-in-time price prediction for a currency pair exchange rate (e.g.

EUR/USD) provides valuable information for companies and investors as they can take diﬀerent

actions to improve their business. This paper introduces a new algorithm, inspired by the be-

haviour of macromolecules in dissolution, to model the evolution of the FOREX market, called

the ENMX (elastic network model for FOREX market) algorithm. This algorithm allows the

system to escape from a potential local minimum, so it can reproduce the unstable nature of the

FOREX market, allowing the simulation to get away from equilibrium. ENMX introduces several

novelties in the simulation of the FOREX market. First, ENMX enables the user to simulate the

market evolution of up to 21 currency pairs, connected, and thus emulating behaviour of the real-

world FOREX market. Second, the interaction between investors and each particular quotation,

which may introduce slight deviations from the quotation prices, is represented by a random

movement. We analyse diﬀerent probability distributions like Gaussian and Pseudo-Voigt, the

latter showing better behaviour distributions, to model the variations in quotation prices. Finally,

the ENMX algorithm is also compared to traditional econometric approaches such as the VAR

model and a driftless random walk, using a classical statistical and a proﬁtability measure. The

results show that the ENMX outperforms both models in terms of quality by a wide margin.

1. Introduction

The foreign exchange (FOREX) market is one of the major ﬁnancial markets in the world. It is a global marketplace for investing in

exchange rates, which moves up to 5.1 trillion US dollars (USD) per day according to the Bank for International Settlements (BIS)

[45]. Traditionally, this market has been reserved for the institutional investor but the emergence of new technologies has demo-

cratized the FOREX market and opened it to the general public. Indeed, both the high liquidity and the ﬂexibility of the schedule (the

market trades continuously 24 hours per day, ﬁve days a week) make the FOREX market very attractive for the private investor. The

https://doi.org/10.1016/j.simpat.2018.04.008

Received 2 November 2017; Received in revised form 27 April 2018; Accepted 30 April 2018

⁎

Corresponding author.

E-mail addresses: avicente2@alu.ucam.edu (A.V. Contreras), allanes@ucam.edu (A. Llanes), alberto.perezb@umh.es (A. Pérez-Bernabeu),

snavarro@aitalentum.com (S. Navarro), hperez@ucam.edu (H. Pérez-Sánchez), jlopez@umh.es (J.J. López-Espín), jmcecilia@ucam.edu (J.M. Cecilia).

Simulation Modelling Practice and Theory 86 (2018) 1–10

Available online 02 May 2018

1569-190X/ © 2018 Elsevier B.V. All rights reserved.

T

diﬃculty involved in manipulating the price makes it even more attractive because it is very complicated for banks or large funds to

take control of the price. In addition, the high volume of the contracts and the availability of datasets comprising historical time series

provide an interesting framework for scientiﬁc and ﬁnancial research [1].

Regarding the theoretical frameworks that have been applied to this market, we may highlight the eﬃcient market hypothesis

(EMH) introduced by Fama [2,3] and Samuelson [4] in an environment of acceptance of the eﬃciency of capital markets [5]. Since

there are several eﬃciency market deﬁnitions, it is sensible to use the Fama deﬁnition, which postulates that a market is eﬃcient if it

fully reﬂects all available information. Under this assumption, all investors have the same information being rational, they rapidly

assimilate any new information to determine asset prices or returns and hence adjust prices accordingly. Thus, excess proﬁts com-

pared to the riskiness of a stock would be zero. Due to the fact that whether individuals optimize past and currently available

information, the new information, which is unpredictable, causes changes in the price of assets in the market [6].

Furthermore, Fama introduced a classiﬁcation of EMH based on three forms of eﬃciency: weak, semi-strong and strong [2]. The

weak form of EMH posits that the current prices of ﬁnancial assets include all the historical ﬁnancial information. Due to this fact,

only unpredictable new information would cause changes meaning that random walk is the best predictor of both asset prices and

returns. The semi-strong form defends that the prices of ﬁnancial assets incorporate the weak form of EMH plus all the information

that is publicly available on the market at any moment. The strong form of EMH embraces the weak and semi-strong forms of EMH, as

well as private information available and which is incorporated into current prices immediately. Both the weak and semi-strong form

of market eﬃciency have been tested by several authors. However the results concerning the validity of these eﬃciency forms were

split depending on the assumptions made. On the other hand, testing the strong form has received less attention. Few studies of the

strong form found evidence rejecting the eﬃciency of the markets analysed. All this is studied in-depth in [7,8].

In this paper, and based on previous dissertations [9,10], we propose the elastic network model algorithm for the FOREX market

(i.e., ENMX) within the framework of the weak form of the EMH. This model is inspired by the biomolecule movements widely used

to study large-scale dynamics in several structural biological scenarios [11]. In particular, it is based on an elastic network model

(ENM) and normal mode analysis [12] to simulate the currencies trading in the FOREX market as biomolecule motions, which, in

light of the random character of the FOREX market, is a reasonable assumption. Diﬀerent probability distributions, such as Gaussian

and Pseudo-Voigt, are analysed to model the interaction between investors and each particular quotation, the latter being particularly

suitable for modelling variations in quotation prices. To test the validity of ENMX, its out-of-sample forecasting accuracy was

compared with two diﬀerent econometric models; i.e. vector autoregression (VAR) and the random walk (RW). The root mean square

error (RMSE) metric was used to compare them in terms of quality as it is one of the most representative accuracy forecasting metrics

in the econometric sphere. Moreover, the proﬁt factor (PF) [13] was compared between these competing models in order to assess the

proﬁtability of each model.

The rest of the paper is structured as follows. Section 2 shows the main studies related with forecasting exchange rates. Section 3

introduces the elastic network model, probability distribution and the ENMX algorithm. Finally, Section 4 provides a detailed ex-

perimental evaluation of ENMX before we end the paper with some conclusions and suggestions for future work.

2. Related work

The literature on forecasting exchange rates shows two diﬀerent trends in FOREX market simulation: time series and machine

learning techniques. The time series techniques, in particular, have been widely studied. The work by Meese and Rogoﬀ[14] com-

pares the forecasting accuracy between various macroeconomic structural models that establish the long run relationship between

exchange rates and fundamentals. In their empirical analysis, they conclude that a driftless random walk that does not use any type of

information of fundamental economic variables performed as eﬃciently as these structural models. Nevertheless, other researchers

that have tackled this issue have found empirical evidence that fundamentals beat random walk [15–17]. Due to the fact that

depending on data, methodology and the economic theories assumed that is used in the previous studies, the discussion about

fundamentals is not clarifying. We refer the reader to [18] for a recent survey of the relationship between exchange rates and

fundamentals. Among the main econometric models used to deal with time series information, we may highlight vector auto-

regression (VAR) models [19], which linearly model the interactions between a set of endogenous variables trough their own past.

Speciﬁcally, for the FOREX market, we may highlight the contribution of Meese and Rogoﬀ[14], Sarantis and Stewart [17], Liu et al.

[20] and Redl [21] that used the VAR approach. Moreover, additional econometric techniques have been applied in order to forecast

exchange rates. Other time series models that have also addressed this issue are mainly error correction models [22,23], GARCH

models [24] and Markov switching models [25,26].

As regards artiﬁcial intelligence techniques, the goal of machine learning is to “teach”the computer to recognize patterns that

always make prices move up or down. Applying machine learning in ﬁnancial markets means it is necessary not only to solve a

problem in data bases, but also deal with artiﬁcial intelligence in order to learn how to decide at each moment. Several authors have

attempted to model ﬁnancial markets through a variety of techniques, such as Neural Networks [27,28], Support Vector Machines

[29], and Fuzzy Neural Networks [30]. Also genetic algorithms have been implemented to forecast the behaviour of markets [31,32].

The use of elastic network models together with normal model analysis has demonstrated their ability to accurately predict bio-

molecule motions and has become a methodology widely used to study large-scale dynamics in several structural biology scenarios.

Motivated by the characteristics of these models, which include simplicity and a high degree of accuracy, and thus we can ﬁnd use

cases recently developed with experimental data in diﬀerent scenarios with success, being one of them ﬁnancial markets [33].

A.V. Contreras et al. Simulation Modelling Practice and Theory 86 (2018) 1–10

2

3. Methods

This section introduces the elastic network model for simulating the FOREX market (ENMX). First, the structure of the ENMX

model is described. Then, we discuss the distribution probability required to perform the stochastic simulation. The section ends with

a full description of the algorithm.

3.1. The elastic network model for FOREX market simulation

Our main aim was to develop a model that could explain ﬁnancial markets. The market is seen to be dynamic, due to the random

behaviour of the quotation prices of exchange rates, which results from interactions between investors and the market itself. We

propose that this random behaviour can be modelled in the same fashion as the molecular movements described by Brownian

motions in [34,35]. Therefore, an Elastic Network Model (ENMX) was proposed, based on the ideas used for the description of the

behaviour of macromolecules in dissolution [36–38]. Traditionally, under this framework Brownian motions are assumed to follow a

Gaussian distribution. Nevertheless, the validity of this distribution was tested comparing with a Pseudo-Voigt proﬁle. Results on

Section 4 conﬁrmed that Pseudo-Voigt proﬁle better ﬁtted to the data analyzed. Hence, ENMX model is based on a Pseudo-Voigt

distribution that captures the typical currency deviations present in the FOREX market.

The decision to choose the FOREX market as the target ﬁnancial market object is mainly due to the nature of data. Since it is a

continuous market, it is the one that best supports modelling from random motion and also it generated large data sets that grow

continuously. The way of proceeding has been, ﬁrst, to characterize the system through functions that reproduce its behaviour

appropriately. This process can be separated into two parts, characterization of the market into price and characterization, diﬀer-

entiating the behaviour and particular volatility of each price and the potential which is assigned to each state. The characterization

of the exchange rate is based on ﬁnding a function that adequately reproduces the movements of each of them. For this, the histogram

of each quote was ﬁrst analyzed using the complete history of the data. It is tested by comparing the distribution that best ﬁts the

histogram of the series analyzed. Furthermore, a Jarque–Bera test is used to test whether data follow a Gaussian distribution and the

results in terms of both accuracy and proﬁtability are compared with the Pseudo-Voigt and Gaussian distribution function. This is

explained in detail in Section 4.

A description of the ENMX model follows. Each network element (node) represents a currency. Edges connecting elements are

related with their interactions, and distance between nodes (currencies) corresponds to the price quotation of each currency pair. This

elastic network implies that a shock or ﬂuctuation in one of the currencies causes an eﬀect on the other. Indeed, this can be justiﬁed

by the decisions that monetary authorities took in order to adjust the economy aﬀected by these shocks. Such decisions aﬀect the

whole ﬁnancial system and thus the FOREX market could be seen as a fully connected graph. Fig. 1 represents the description of the

ENMX model.

In an analogy with the Brownian motion of macromolecules and their internal ﬂuctuations, it is accepted that the molecule

evolves towards an equilibrium state (steady state). But such steady state changes over time due to the random movements exerted to

Fig. 1. Depiction of the elastic network model used for the FOREX market.

A.V. Contreras et al. Simulation Modelling Practice and Theory 86 (2018) 1–10

3

the elements in the macromolecular model (we can refer to them as atoms or beads). Springs connecting either atoms or beads model

the eﬀect that the ﬂuctuation in an element directly causes in a neighbouring atom/bead, and therefore this is transmitted along the

whole macromolecular chain. This is translated in our ENMX model in the way that a change in, for instance, the Euro (EUR) or

American dollar (USD) aﬀects immediately the other currencies. Therefore these ﬂuctuations inﬂuence the market. This is the

reasoning why we focus on the potential energy of the system for representing the evolution of the molecule/market towards the

steady state.

The ENMX model uses the Hookean potential [39] to regulate the interaction between the quotation prices. They are the elements

of an elastic network model that characterize the potential of a spring. Thus, the system could be seen as spring-bound particles

whose elongation represents the quotation price of the spring. The particles represent each coin, and therefore the spring that connect

two of these represents the relative price between them, and the elastic spring constant represents the volatility of the quotation.

Due to the fact that Hookean potential requires for an equilibrium quotation, we used a dynamic method that best represented the

ﬂuctuating behaviour of the stock market. An equilibrium quotation was found through a trend method consisting of dividing the

historical data into intervals (both hourly, daily, monthly and yearly frequency), making a linear adjustment of them and then

inferring what point would be the next in the evolution of the system. Each of the trends obtained for the diﬀerent time intervals was

used with diﬀerent weight distributions in a linear combination to obtain the equilibrium quotation, x

equilibrium

.

3.2. Characterization of Pseudo-Voigt distribution

Since the representations of exchange rates diﬀer, it was decided to work with quotation moments in 5 min intervals in order to

reduce the market volatility associated with small periods of time. Although Gaussian and Lorentzian distributions have been widely

used in similar problems in the experiments using these distributions to adjust the histograms of quotation moments; they had

problems adjusting the tails of the generated histograms. In the search for a better adapted function, our interest was aroused by the

Voigt [40] proﬁle, which is widely used in spectroscopy and diﬀraction. Using a Voigt distribution; in this case can be considered a

natural approach as it is deﬁned as the convolution of both distributions mentioned above.

Indeed, a Voigt function can be deﬁned as the convolution of a Gaussian proﬁle and a Lorentzian proﬁle:

∫

=′−′′

−∞

+∞

V

xLxGxxdx() ( ) ( ) (1)

where G(x) is the Gaussian proﬁle.

=

−

G

xσπ

() exp

2

x

σ

2

22

(2)

and L(x) is the Lorentzian proﬁle centred in zero:

=+

Lx γ

πx γ

() ()

22 (3)

The Lorentzian function, also called Cauchy distribution, is a continuous probability distribution which is very common in physics

discipline. In its expression, γis the scale parameter which speciﬁes the half-width at half-maximum and is also equal to half the

interquartile range. When

=γ1

,

the centred Lorentzian function coincides with the Student’st-distribution with one degree of

freedom.

Regarding the form of Lorenztian density function, it is worth noting the similarities that it maintains with the density function of

the standard normal distribution: ﬂared shape, symmetric and centred at the origin. The only diﬀerence between both distributions

lies in that the density function of the Lorentzian proﬁle has heavier tails (greater dispersion) than the normal one.

However, because of the high computational cost of the convolution operation, it is often not possible to use the Voigt proﬁle. In

this work, a Pseudo-Voigt [41] function is proposed to adjust this process since, substituting the convolution operation by a linear

combination, involves a lower computational cost. Thus, a Pseudo-Voigt proﬁle is a linear combination of Gaussian and Lorentzian

function, which provides better results that both distributions individually.

=⋅ + − ⋅

P

Vx ηLx ηGx() () (1 ) (

)

(4)

There are diﬀerent options available for calculating the ηparameter. A simple formula with a precision of 99% is described by Ida

et al. in [41]:

=− +

η

ff ff ff1.36603( / ) 0.47719( / ) 0.11116( / )

LL L

2

3

(5)

where f

L

and f

G

are the total amplitude at half the maximum, FWHM (full wide half maximum) of the corresponding distributions,

with ==

f

γf σ ln2, 2 2 (2)

LG and =+ + + + +

f

fAffBffCffDfff[]

,

GG

LGL GL GLL

54 3223 45

1/5 being ===ABC2.69269, 2.42843, 4.4716

3

and =D0.0784

2

.

Following these results, we studied the equilibrium quotations by making sample averages from the previous month or linear

combinations between the sample mean and the last months, days, hours, etc. Better results were obtained in those cases than using

the overall data, but the problem was that, in the end, the equilibrium quotation was a constant value, which, after a ﬁnite number of

evolutionary steps, reached a steady state.

All trajectories simulated tended to the static equilibrium quotation after a while. To avoid this, a dynamic method was proposed

A.V. Contreras et al. Simulation Modelling Practice and Theory 86 (2018) 1–10

4

since it better represented the ﬂuctuating nature of the stock market. This new method was similar to the previous one described but

adding the current value, and also updating each iteration of the method. Thus, although the system tended to an equilibrium

quotation as before, this quote was diﬀerent every time, which ensured that the system did not reach a static situation.

3.3. The algorithm

The ENMX algorithm is an optimization algorithm based on the Monte Carlo method, speciﬁcally on the annealing algorithm

[42]. The annealing algorithm assigns a non-null probability to movement away from a local minimum of potential, in order to attain

at an absolute minimum [43]. This method is better suited to simulating the behaviour of the changing stock market than the

traditional Monte Carlo approach, as the latter assumes that the evolution of the model would tend to evolve to a static situation, so it

would not represent well the dynamic nature of the FOREX market. Moreover, the repeated use of this method generates a Markov

chain which actually ﬁts better with the FOREX market as the time series generated by currencies exchanges always meets the

Markov property.

In short, the algorithm provides a new quote, following the distribution functions of each quote. Then, it assigns a potential

depending on the distance to the equilibrium quotation and the ENM algorithm accepts the new potential if the potential of the new

state is less than that of the previous step; or if this is not the case, it assigns a certain probability of acceptance instead of rejecting it.

This procedure generates times series or trajectories through chained simulations.

With that in mind, the ENMX baselines are the following:

1. Starting from the initial quotation, q

0

, the ENM algorithm calculates the overall market potential (V

0

). This is done by adding the

square diﬀerence between q

0

and the equilibrium quotation potential of the 21 currencies (α).

∑

=⋅−

=

V

kq q()

α

αα equilibrium α

0

1

21

0, ,

2

(6)

2. A new state of the system, q

1

, is proposed in which each currency varies according to a pseudo-random number, r, which is

obtained according to the optimal Pseudo-Voigt distribution for each one. Since the Pseudo-Voigt indicates the probability of

obtaining each moment by simply adding the pseudo-random number obtained at the current price:

=+

q

qr

αα

α

1, 0,

(7)

3. The potential of the new state obtained, q

1

, is calculated in the same way as in the state q

0

;

∑

=⋅−

=

V

kq q()

α

αα equilibrium α

1

1

21

1, ,

2

(8)

4. Now, the ENM algorithm evaluates whether the new state is acceptable by applying the annealing algorithm, so that three cases

are distinguished:

(a) V

1

≤V

0

: the new state (q

1

) is better than the previous one (q

0

). Thus, the algorithm would retain the state q

1

with a prob-

ability of 100%, overwriting q

0

, for the new iteration of the method, (q

0

←q

1

).

(b) V

1

>V

0

: the probability of acceptance (P

accept

)ofq

1

is not 100%, but the annealing algorithm assigns a probability of se-

lection:

=

−−

P

exp

accept

VV

E

10

0

(9)

In this way, a random number, uis launched between 0 and 1 with a uniform probability distribution, and if the condition

u≤P

a

ccept is satisﬁed, the ENM algorithm accepts q

1

by overwriting q

0

as in the previous case.

(c) V

1

>V

0

and also u>P

a

ccept: The state q

1

is discarded, remaining with q

0

for the next iteration.

5. Using the q

0

obtained in the previous section, the process is repeated.

In this way, repeating the algorithm creates a time series or trajectory similar to that which the exchange rate would present. Even

so, the trajectory is obtained by a stochastic method, which cannot be expected to reproduce the behaviour of the real exchange

rate step by step, although it is possible to expect both values to be similar.

4. Results and discussion

4.1. Data sets and historical data representation

The dataset was obtained from OANDA [44],aﬁnancial services company specializing in the FOREX market, which it provides

access to the FOREX market to small and medium investors. The experiments were carried out with up to 7 currencies as shown in

Table 1, with up to 21 currency pairs in total that are obtained by the combining these 7 currencies. These data sets were recorded

A.V. Contreras et al. Simulation Modelling Practice and Theory 86 (2018) 1–10

5

every 5 min uninterruptedly for 24 h a day, except on weekends because the market is closed.

The procedure to characterize the probability distribution of each currency pair begins with the creation of histograms of mo-

ments using the historical data. As regards the use of Pseudo-Voigt distribution instead of Gaussian distribution, the histogram of the

series studied was helpful to test for the distribution that best ﬁts them. Then, Gaussian, Lorentzian and Pseudo-Voigt distributions

were tested and compared.

Diﬀerent tests were used to contrast how Voigt and Pseudo-Voigt distribution ﬁt to the dataset. Graphs

−

PP

and −

Q

Qindicated

than both functions have satisfactory properties for simulating the process (in most cases, better than the Gaussian and Lorentzian

functions individually). Fig. 2 shows the histogram which compares the three proﬁles and the dataset. Concerning the three prob-

ability distributions, it was veriﬁed that a Gaussian function was not the best option because the tails of the generated histogram were

fatter, while Lorentzian distribution underestimated the probability near the central peak, and in addition, the tails were too wide.

The histogram developed conﬁrm, then, that Pseudo-Voigt proﬁle provided a better ﬁt than the other distributions.

4.2. Experimental results

From this point onwards, diﬀerent experiments were carried out to analyze the ENMX model for developing FOREX market

predictions. Firstly, Jarque–Bera (JB) test [46] was applied in order to assess whether the historical data follows a Gaussian dis-

tribution. JB test null hypothesis assumes that the data have a coeﬃcient of skewness equal to 0 and kurtosis equal to 3. These values

correspond to both, skewness and kurtosis, for the Gaussian distribution respectively. Table 2 shows the JB test for the 21 historical

quotation prices. In all cases, the null hypothesis was strongly rejected at 1%, which means that the distribution of the series does not

have the typical skewness and kurtosis for the Gaussian distribution, based on the third and fourth central moments respectively.

Therefore, the JB test brought evidence against the Gaussian distribution as the best density function for the data we are dealing with.

Secondly, the overall quality impact were analyzed using the Gaussian and Pseudo-Voigt probability distributions on the ENMX

model. The dataset available ran from 01.01.2015 (23:00 h) to 07.28.2017 (18:00 h), so that the frequency of the data analyzed have

a spread of 5 min. The forecasting strategy adopted was the followed by many researchers; e.g. [14], who were among the pioneers

whose works used this methodology. Firstly, a subsample within the dataset was selected for the purpose of model identiﬁcation and

parameter optimization. This period was from 01.01.2015 (23:00 h) to 07.28.2017 (17:00 h). Secondly, the forecasting strategy of

sequential estimations was used to generate the remaining observations. In other words, we predict from 1 to 12 out-of-sample

horizons. In addition, both the average and the median for the out-of-sample horizons were computed.

As previously explained, the most representative currency pairs in the FOREX market are selected to perform the comparative

evaluation. Table 1 shows these selected currencies, reaching up to twenty-one currency pairs that stem from all possible combi-

nations between them. Table 3 shows the predicted horizons and the corresponding out-of sample period. Lastly, Table 4 summarizes

the results obtained on the competing models. The forecasting accuracy was evaluated by the mean square error (MSE) computed

Table 1

Currencies and abbreviations.

Currency Abbreviation

Euro EUR

American dollar USD

Canadian dollar CAD

New Zealand dollar NZD

Australian dollar AUD

British pound GBP

Japanese yen JPY

Fig. 2. Adjusting curves to the EURUSD histogram.

A.V. Contreras et al. Simulation Modelling Practice and Theory 86 (2018) 1–10

6

Table 2

Results on JB test.

Variable JB statistic P-value

AUDCAD 7350.03 0.00

AUDJPY 6327.19 0.00

AUDNZD 5748.19 0.00

AUDUSD 196.61 0.00

CADJPY 10,585.99 0.00

EURAUD 6183.51 0.00

EURCAD 65.67 0.00

EURGBP 18,494.97 0.00

EURJPY 9003.26 0.00

EURNZD 4181.47 0.00

EURUSD 626.51 0.00

GBPAUD 14,848.74 0.00

GBPCAD 14,629.16 0.00

GBPJPY 18,710.78 0.00

GBPNZD 14,341.81 0.00

GBPUSD 19,755.24 0.00

NZDCAD 16,713.00 0.00

NZDJPY 15,946.59 0.00

NZDUSD 3300.06 0.00

USDCAD 1563.60 0.00

USDJPY 10,685.82 0.00

Table 3

Horizons predicted.

Forecast horizons Out of sample period

=H

1

07.28.2017 17:05

=H

2

07.28.2017 17:10

=H3

07.28.2017 17:15

=H

4

07.28.2017 17:20

=H5

07.28.2017 17:25

=H6

07.28.2017 17:30

=H

7

07.28.2017 17:35

=H8

07.28.2017 17:40

=H9

07.28.2017 17:45

=H10

07.28.2017 17:50

=H11 07.28.2017 17:55

=H1

2

07.28.2017 18:00

=H

1

to =H1

2

Average

=H

1

to =H1

2

Median

Table 4

Forecasting accuracy and proﬁtability results on Gaussian and Pseudo Voigt probability distributions.

Forecast horizons Gaussian Pseudo-Voigt

RMSE PF RMSE PF

=H

1

0.00142 3.183 0.00138 3.791

=H

2

0.00247 4.871 0.00243 4.871

=H3

0.00384 3.644 0.00376 3.680

=H

4

0.00532 4.396 0.00519 4.396

=H5

0.00591 4.478 0.00577 4.478

=H6

0.00643 5.225 0.00626 5.225

=H

7

0.00734 4.909 0.00711 4.909

=H8

0.00741 4.504 0.00720 4.504

=H9

0.00696 3.946 0.00675 3.946

=H10

0.00514 7.017 0.00502 7.017

=H11 0.00510 7.423 0.00496 7.423

=H1

2

0.00522 6.097 0.00512 6.097

Average 0.00521 4.974 0.00508 5.028

Median 0.00527 4.688 0.00515 4.688

A.V. Contreras et al. Simulation Modelling Practice and Theory 86 (2018) 1–10

7

across the twenty-one currency pair combinations and proﬁtability was measured by the proﬁt factor (PF) [13], which are deﬁned as

follows:

̂

∑

=−

=++

R

MSE nyy

1{}

Hi

n

it H it H

1,,

2

where nis the number of currency pairs analysed and Hthe forecast horizon predicted.

̂

++

yandy

it H it H,,

are the actual and forecast

values respectively.

=

P

Fgross profits

gross losses

where a value greater than one implies that total proﬁts exceed total losses.

The Pseudo-Voigt proﬁle outperforms Gaussian distribution by a wide margin. As regards of forecasting accuracy, Pseudo-Voigt

distribution performs better in all of the horizons predicted (from one to twelve steps). In addition, the mean and the median of RMSE

for Gaussian distribution is slightly greater supporting the evidence in favour of Pseudo-Voigt proﬁle. Proﬁtability results show that

Pseudo-Voigt distribution is, at least, as well as Gaussian distribution and strictly better, working with shorter horizons (one and three

step). The average of PF is slightly higher by roughly 1%. The median for all horizons analyzed is equal to both probability dis-

tributions.

In conclusion, results for both testing normality of data by Jarque–Bera test and quality results in terms of accuracy and prof-

itability, shown that Pseudo-Voigt is the distribution that better ﬁtted historical data. Thus, Pseudo-Voigt proﬁle is proposed as an

alternative distribution for the ENMX model.

4.2.1. Comparison with econometric models

With previous results in mind, we compare both the forecasting accuracy and the proﬁtability results between our proposal ENMX

and two diﬀerent econometric models, the simple random walk (RW) and vector autoregressive (VAR) model. First of all, the

structure of the VAR model was deﬁned by the methodology proposed by Luetkepohl [47]. It is focused on Schwarz lag length

criterion with the purpose of minimizing collinearity. The optimal lag length obtained by this criterion was 7 so a stationary un-

restricted VAR(7) model was estimated. The procedure for comparing these models was in the same way as in the previous section.

Results are summarizing in Table 5.

Concerning forecasting accuracy, results showed that ENMX outperformed both VAR model and the driftless random walk on all

the forecast horizons studied. The average RMSE over steps one to twelve for the ENMX model is reduced by practically 15% with

respect to VAR and RW model. Moreover, the median for ENMX model is roughly reduced by 18%. On the other hand, the proﬁt-

ability for ENMX was clearly larger than the competing models over the shorter horizons of one to ﬁve steps (except three step).

Furthermore, ENMX model strongly outperformed both VAR model and random walk showing a higher proﬁt factor (15% and 70%

respectively) on average. The median over steps one to twelve was outperformed for ENMX model by roughly 10% with respect to

VAR model and 70% to RW model. Hence, it is summarized that the ENMX model is the best model in terms of both accuracy and

proﬁtability on average and median.

5. Conclusions and future work

The FOREX market is one of the main ﬁnancial market over the world. This market operates continuously, so that the high volume

of contracts and the availability of datasets comprising historical time series provide an interesting framework for scientiﬁc and

ﬁnancial research. This paper presents a bioinspired algorithm for predicting the FOREX market, entitled the ENMX (elastic network

Table 5

Forecast accuracy and proﬁtability results from the competing models.

Forecast horizons ENMX VAR RW

RMSE PF RMSE PF RMSE PF

=H

1

0.00138 3.791 0.00144 2.374 0.00151 2.374

=H

2

0.00243 4.871 0.00267 3.911 0.00278 1.841

=H3

0.00376 3.680 0.00410 4.275 0.00416 1.604

=H

4

0.00519 4.396 0.00586 3.596 0.00589 1.679

=H5

0.00577 4.478 0.00653 4.105 0.00659 1.385

=H6

0.00626 5.225 0.00726 6.281 0.00734 6.281

=H

7

0.00711 4.909 0.00825 5.581 0.00831 1.271

=H8

0.00720 4.504 0.00825 4.877 0.00831 1.068

=H9

0.00675 3.946 0.00761 4.283 0.00765 1.059

=H10

0.00502 7.017 0.00632 4.656 0.00636 1.043

=H11 0.00496 7.423 0.00618 3.804 0.00620 1.092

=H1

2

0.00512 6.097 0.00585 3.212 0.00586 3.212

Average 0.00508 5.028 0.00586 4.246 0.00592 1.992

Median 0.00515 4.688 0.00625 4.190 0.00628 1.495

A.V. Contreras et al. Simulation Modelling Practice and Theory 86 (2018) 1–10

8

model for FOREX market) algorithm. It is inspired by the behaviour of macromolecules in dissolution and enables accurately re-

produces the unstable nature of the FOREX market by allowing the simulation to go beyond the equilibrium. Moreover, ENMX is

capable of simulating up to 21 currency pairs at once, all of them connected, as really happens in the FOREX market arena. For the

diﬀerent probability distributions analysed, the Pseudo-Voigt best represented the variations in quotation prices. The experimental

results showed that the ENMX algorithm predicted values on the FOREX market more accurately than traditional econometric

approaches such as VAR and the driftless random walk.

The ENMX model is still in a relatively early stage of development, and we acknowledge that a relatively simple variant of the

algorithm was tested. But, with many other types of improvements still to be explored, this ﬁeld seems to oﬀer a promising and

potentially fruitful area of research. On the algorithm side, the Pseudo-Voigt function provided very good results so it might also be

interesting to evaluate other distribution function. On the hardware side, a computational bottleneck is to be expected whenever real-

time response is required. The use of Graphics Processing Units (GPUs) may oﬀer a good environment to enhance our simulations to

improve performance with unprecedented gains possible where parallelism is called to play a decisive role. Furthermore, the EMH

could be tested by assuming an asset/pricing model based on theories of exchange rate determination such as portfolio balance model

or uncovered interest parity model. Moreover, both another metrics as median absolute deviation (MAD) and econometric models as

Markov Switching and GARCH models may provide a more robust analysis on the forecasting accuracy of the ENMX model. Finally,

we have focused only on returns as most commercial rankings do. However, we see very interesting to implement risk measures to the

model in future works. Under this framework, the analysis of the risk-adjusted model proposed will be carried out with the purpose of

exploring strategies that lead to abnormal returns in a real world setting.

Acknowledgments

This work is supported by the Spanish MINECO under grants TIN2016-78799-P, TIN2016-80565-R and CTQ2017-87974-R (AEI/

FEDER, UE), and the Industrial Ph.D. program of the International Doctorate School at the Catholic University of San Antonio of

Murcia (UCAM). This research was partially supported by the supercomputing infrastructure of Poznan Supercomputing Center, by

the e-infrastructure program of the Research Council of Norway, and the supercomputer center of UiT - the Arctic University of

Norway. The authors also thankfully acknowledge the computer resources and the technical support provided by the Plataforma

Andaluza de Bioinformática of the University of Málaga. Powered@NLHPC: This research was partially supported by the super-

computing infrastructure of the NLHPC (ECM-02). Finally, we want to thank the anonymous reviewers for their valuable comments.

References

[1] A.K. Nassirtoussi, S. Aghabozorgi, T.Y. Wah, D.C.L. Ngo, Text mining of news-headlines for FOREX market prediction: a multi-layer dimension reduction

algorithm with semantics and sentiment, Expert Syst. Appl. 42 (2015) 306–324.

[2] E.F. Fama, Eﬃcient capital markets: a review of theory and empirical work, J. Finance 25 (1970) 383–417.

[3] E.F. Fama, The behavior of stock-market prices, J. Bus. 38 (1965) 34–105.

[4] P.A. Samuelson, et al., Proof that Properly Anticipated Prices Fluctuate Randomly, (1965).

[5] P. Makovskỳ, Modern approaches to eﬃcient market hypothesis of forex–the central european case, Procedia Econ. Finance 14 (2014) 397–406.

[6] K. Cuthbertson, D. Nitzsche, Quantitative Financial Economics: Stocks, Bonds and Foreign Exchange, John Wiley & Sons, 2005.

[7] A.G. Ţiţan, The eﬃcient market hypothesis: review of specialized literature and empirical research, Procedia Econ. Finance 32 (2015) 442–449.

[8] A. Degutis, L. Novickyte, The eﬃcient market hypothesis: a critical review of literature and methodology, Ekonomika 93 (2014) 7.

[9] A.J.S. García, Simulación del Mercado Forex: Aplicación de Modelado Macromolecular, (2015) Dissertation.

[10] J.F. García, Desarrollo de métodos de prediccin para el mercado Forex basados en la aplicación de tcnicas de Montecarlo, (2015) Dissertation.

[11] M. Karplus, J.A. McCammon, Molecular dynamics simulations of biomolecules, Nat. Struct. Mol. Biol. 9 (2002) 646–652.

[12] E. Fuglebakk, N. Reuter, K. Hinsen, Evaluation of protein elastic network models based on an analysis of collective motions, J. Chem. Theory Comput. 9 (2013)

5618–5628.

[13] G.M. Caporale, L. Gil-Alana, A. Plastun, Searching for ineﬃciencies in exchange rate dynamics, Comput. Econ. 49 (2017) 405–432.

[14] R.A. Meese, K. Rogoﬀ, Empirical exchange rate models of the seventies: do they ﬁt out of sample? J. Int. Econ. 14 (1983) 3–24.

[15] W.T. Woo, The monetary approach to exchange rate determination under rational expectations: the dollar-deutschmark rate, J. Int. Econ. 18 (1985) 1–16.

[16] G.J. Schinasi, P.A.V.B. Swamy, The out-of-sample forecasting performance of exchange rate models when coeﬃcients are allowed to change, J. Int. Money

Finance 8 (1989) 375–390.

[17] N. Sarantis, C. Stewart, Structural, var and bvar models of exchange rate determination: a comparison of their forecasting performance, J Forecast 14 (1995)

201–215.

[18] M. Manzur, Exchange rate economics is always and everywhere controversial, Appl. Econ. 50 (2018) 216–232.

[19] C.A. Sims, Macroeconomics and reality, Econometrica (1980) 1–48.

[20] T.R. Liu, M.E. Gerlow, S.H. Irwin, The performance of alternative var models in forecasting exchange rates, Int. J. Forecast. 10 (1994) 419–433.

[21] C. Redl, Noisy news and exchange rates: a svar approach, J. Int. Money Finance 58 (2015) 150–171.

[22] N.L. Joseph, Cointegration, error-correction models, and forecasting using realigned foreign exchange rates, J. Forecast. 14 (1995) 499–522.

[23] A. Trapletti, A. Geyer, F. Leisch, Forecasting exchange rates using cointegration models and intra-day data, J. Forecast. 21 (2002) 151–166.

[24] N. Meade, A comparison of the accuracy of short term foreign exchange forecasting methods, Int. J. Forecast. 18 (2002) 67–83.

[25] C. Engel, J.D. Hamilton, Long swings in the dollar: are they in the data and do markets know it? Am. Econ. Rev. (1990) 689–713.

[26] N.P. Bollen, S.F. Gray, R.E. Whaley, Regime switching in foreign exchange rates:: evidence from currency option prices, J. Econom. 94 (2000) 239–276.

[27] J. Yao, C.L. Tan, A case study on using neural networks to perform technical forecasting of forex, Neurocomputing 34 (2000) 79–98.

[28] J. Kamruzzaman, R.A. Sarker, Forecasting of currency exchange rates using ann: a case study, Neural Networks and Signal Processing, 2003. Proceedings of the

2003 International Conference on, 1 IEEE, 2003, pp. 793–797.

[29] J. Kamruzzaman, R.A. Sarker, I. Ahmad, Svm based models for predicting foreign currency exchange rates, Data Mining, 2003, ICDM 2003. Third IEEE

International Conference on, IEEE, 2003, pp. 557–560.

[30] R.J. Kuo, C. Chen, Y. Hwang, An intelligent stock trading decision support system through integration of genetic algorithm based fuzzy neural network and

artiﬁcial neural network, Fuzzy Sets Syst. 118 (2001) 21–45.

[31] C. Neely, P. Weller, R. Dittmar, Is technical analysis in the foreign exchange market proﬁtable? a genetic programming approach, J. Financ. Quant. Anal. 32

(1997) 405–426.

A.V. Contreras et al. Simulation Modelling Practice and Theory 86 (2018) 1–10

9

[32] S. Bhattacharyya, O.V. Pictet, G. Zumbach, Knowledge-intensive genetic discovery in foreign exchange markets, IEEE Trans. Evol. Comput. 6 (2002) 169–181.

[33] J.R. López-Blanco, P. Chacón, New generation of elastic network models, Curr. Opin. Struct. Biol. 37 (2016) 46–53.

[34] D.L. Ermak, J. McCammon, Brownian dynamics with hydrodynamic interactions, J. Chem. Phys. 69 (1978) 1352–1360.

[35] A.A. Benítez, J.G.H. Cifre, F.G.D. Baños, J.G. de la Torre, Prediction of solution properties and dynamics of rnas by means of Brownian dynamics simulation of

coarse-grained models: Ribosomal 5s rna and phenylalanine transfer rna, BMC Biophys. 8 (2015) 11.

[36] J.L. Cascales, S. Navarro, J.G. de La Torre, Deformation, orientation, and scattering from polymer chains in shear ﬂow. A Brownian dynamics simulation study,

Macromolecules 25 (1992) 3574–3580.

[37] H.P. Sánchez, J.G. de la Torre, F.D. Baños, Transient electric birefringence of wormlike macromolecules in electric ﬁelds of arbitrary strength: a computer

simulation study, J. Chem. Phys. 122 (2005) 124902.

[38] J.G. de la Torre, J.G.H. Cifre, A. Ortega, R.R. Schmidt, M.X. Fernandes, H.E.P. Sánchez, R. Pamies, Simuﬂex: algorithms and tools for simulation of the

conformation and dynamics of ﬂexible molecules and nanoparticles in dilute solution, J. Chem. Theory Comput. 5 (2009) 2606–2618.

[39] I. Bahar, A.R. Atilgan, B. Erman, Direct evaluation of thermal ﬂuctuations in proteins using a single-parameter harmonic potential, Fold Des. 2 (1997) 173–181.

[40] H.D. Rocco, A. Cruzado, The voigt proﬁle as a sum of a gaussian and a lorentzian functions, when the weight coeﬃcient depends only on the widths ratio, Acta

Phys. Pol. A 122 (2012).

[41] T. Ida, M. Ando, H. Toraya, Extended pseudo-voigt function for approximating the voigt proﬁle, J. Appl. Crystallogr. 33 (2000) 1311–1316.

[42] P.J.V. Laarhoven, E.H. Aarts, Simulated Annealing, Simulated Annealing: Theory and Applications, Springer, 1987, pp. 7–15.

[43] V. Černỳ, Thermodynamical approach to the traveling salesman problem: an eﬃcient simulation algorithm, J. Optim. Theory Appl. 45 (1985) 41–51.

[44] OANDA Corp, https://www.oanda.com/lang/en/solutions-for-business/historical-rates/main.html, 2017.

[45] Bank for International Settlements, https://www.bis.org/, 2018.

[46] C.M. Jarque, A.K. Bera, A test for normality of observations and regression residuals, Int. Stat. Rev./Rev. Int. Stat. (1987) 163–172.

[47] H. Luetkepohl, Econometric Analysis with Vector Autoregressive Models, Handbook of Computational Econometrics, (2009), pp. 281–319.

A.V. Contreras et al. Simulation Modelling Practice and Theory 86 (2018) 1–10

10