Professional Documents
Culture Documents
Abstract
A new methodology based on state space reconstruction techniques has been developed
for trading in financial markets. The methodology has been tested using 18 high-frequency
foreign exchange time series. The results are in apparent contradiction with the effi-
cient market hypothesis which states that no profitable information about future move-
ments can be obtained by studying the past prices series. In our (off-line) analysis positive gain
may be obtained in all those series. The trading methodology is quite general and may be
adapted to other financial time series. Finally, the steps for its on-line application are
discussed.
r 2005 Elsevier B.V. All rights reserved.
0378-4371/$ - see front matter r 2005 Elsevier B.V. All rights reserved.
doi:10.1016/j.physa.2005.01.047
ARTICLE IN PRESS
464 F. Strozzi, J.M. Zaldı´var / Physica A 353 (2005) 463–479
1. Introduction
2.1. Data
In this case, we have normalised our time series following the same approach as
discussed in [11], i.e., we consider the logarithmic middle price ym ; which can be
calculated as follows:
logðpbid Þ þ logðpask Þ
ym ¼ , (1)
2
where pbid and pask are the bid and ask prices of the US Dollar with respect to some
currency, respectively. In order to compare the different data sets analysed, we have
normalised data sets between d and 1 þ d and obtained a normalised logarithmic
middle price y as follows:
ym ymin
m
y¼ þd. (2)
ymax
m y min
m
The d value ð1:0 103 Þ is necessary to avoid division by zero when changing from
one currency to the another. In order to compare these series we have generated a set
of random walk time series using the random number generation utilities in
MATLAB with the same number of points (17 568, one point each half hour for 366
days) as the financial time series and we have afterwards normalised them in the
same way.
Carrying out a similar analysis as in Refs. [4,5], it is possible to see, Fig. 1, that the
probability distribution functions found in our high-frequency foreign exchange
financial time series exhibits a fat—tailed distribution which is in disagreement with
the Gaussian distribution (blue circles) and in agreement with previous studies [4,5]
(for a detailed discussion on the implications of these distribution functions the
reader is referred to above mentioned references).
In order to analyse the high-frequency currency exchange time series we have used
the theory of embedding. State space reconstruction techniques, introduced in Refs.
[12,13], shown that it is possible to reconstruct the state space of a dynamical system
using time delay embedding vectors of the original measurements, i.e., fsðtÞ; sðt
DtÞ; sðt 2DtÞ; . . . ; sðt ðd E 1ÞDtÞg: This implies that it is necessary to calculate to
embedding parameters: time delay, Dt (the lag between data when reconstructing the
state space), and embedding dimension, d E (the dimension of the space required to
unfold the dynamics). Although there have been numerous proposals the selection of
the embedding dimension [14,15] and for the choice of time delay [16,17], they all are
presented with the assumption of stationarity, which in our case does not hold.
Furthermore, in the context of nonstationarity, the notion of a ‘‘correct’’
embedding or delay is inappropriate as has been demonstrated in Ref. [18]. Instead it
becomes important to remember that a sufficiently large embedding be chosen which
ARTICLE IN PRESS
466 F. Strozzi, J.M. Zaldı´var / Physica A 353 (2005) 463–479
Fig. 1. Probability distribution functions of the first difference, i.e., yðt þ 1Þ yðtÞ; for the 18 normalised
high-frequency foreign exchange time series compared with a normalised random walk (Gaussian
distribution) time series, blue circles.
will ‘‘contain’’ the relevant dynamics (as it may change from one dimensionality to
another) as well as account the effects of noise, which tend to inflate dimension. In
Ref. [19] the approach to ‘‘overembed’’ the time series to capture the dynamics as its
dimension changes have been justified. Similar considerations govern the choice of
the time delay. As the system changes from one dimension to another the effects of
the time delay are changed. Thus a so-called ‘‘optimal’’ time delay in one embedding,
becomes less so as the relevant dimension changes [20].
As the main interest in this work is one step ahead prediction, we have considered
that the optimal embedding parameters are those that produce a maximum gain and,
hence, analysed our time series using this approach. However, one has to remember
that these parameters would not be optimal when confronted with the same series for
other years or when other function should be optimised.
t ! 1: In our case as financial time series are transient [11], we need a local
measure, not a global one, that reflects the actual status of the system. In this sense,
we have been using the divergence of a dynamical system for the characterisation
and analysis of chemical transient reactors [21–23]. The divergence of the flow, which
is locally equivalent to the trace of the Jacobian, measures the rate of change of an
infinitesimal state space volume V ðtÞ following an orbit xðtÞ: Furthermore,
Liouville’s theorem [24] states that
Z t
V ðtÞ ¼ V ð0Þ exp divfF½xðtÞ
g dt , (3)
0
where
Inserting Eq. (7) into (6) and regrouping the terms we obtain
Hence, when h ! 0
V_ ðtÞ
div½JðxÞ
¼ . (9)
V ðtÞ
Furthermore, the divergence is preserved under state space reconstruction [25] and
therefore it will reflect the local properties of our underlying dynamical system.
State space volume at time t may be calculated, assuming that the time step from
one point to another in the time series is short enough that the Jacobian of the
system has not substantially changed, using the determinant between close points in
ARTICLE IN PRESS
468 F. Strozzi, J.M. Zaldı´var / Physica A 353 (2005) 463–479
state space as
2 3
sðtÞ sðt DtÞ 0 0
6 7
6 0 sðt DtÞ sðt 2DtÞ 0 7
V ðtÞ ¼ det6
6
7.
7
4 5
0 0 sðt ðd E 1ÞDtÞ sðt d E DtÞ
(10)
Due to volume contraction in state space, characteristic of dissipative systems, V ðtÞ
could rapidly tend to zero and produce artefacts when introduced as denominator in
Eq. (9), for this reason we have used separately V ðtÞ and DV ðtÞ ¼ V ðtÞ V ðt DtÞ
avoiding the need to divide the two small numbers.
Over the years, investors have developed many different indicators which attempt
to measure the velocity or the acceleration of price movements and are used to
Fig. 2. (a) Sinusoidal function; (b) first derivative; (c) state space volume; (d) state space volume change
(green funds in currency2 ; red funds in currency1 ). Reconstruction parameters: Dt ¼ 2; d E ¼ 1:
ARTICLE IN PRESS
F. Strozzi, J.M. Zaldı´var / Physica A 353 (2005) 463–479 469
Fig. 3. Exchanges between currency1 and currency2 for the sinusoidal function following the trading
strategy defined in Section 2.3 and starting with 100 units in currency1 :
determine a trading strategy. These indicators are grouped together under the
heading of momentum. Some of the more popular indicators are: rate of change
(ROC), relative-strength indicator (RSI), moving average convergence–divergence
(MACD), and stochastic oscillator [8,9]. All these indicators try to infer the future
behaviour of the financial time series.
In this work, we have assumed, as a first approximation, that we can exchange our
assets at no cost. This is clearly not realistic but it has been used to develop the
trading strategy by considering that the number of transaction is not important.
Furthermore, we have only tested one-step prediction, i.e., t þ 1; based on all
available information at time t: However, as we are more interested in assessing if
forecasting is possible, we have performed our calculations with the complete data
set rather than attempting to develop an on-line forecasting strategy. Therefore, in a
strict sense our results are not real-time forecasts.
As forecasting strategy, we apply the following simple rule, if the variation of state
space volume decreases, i.e., DV ðtÞ4DV ðt 1Þ; we change all our assets into
currency2 at t þ 1: On the contrary, we exchange all our assets into currency1 : The
meaning of this strategy is to detect if the volume has a positive acceleration. We will
then consider this acceleration as a measure of the strength of the stock exchange.
The net ‘‘profit’’, also called return, with this trading strategy is evaluated using the
ARTICLE IN PRESS
470 F. Strozzi, J.M. Zaldı´var / Physica A 353 (2005) 463–479
Fig. 4. Gain–loss function for the considered time delays (between 2 and 400) and embedded dimensions
(between 1 and 15) for the sinusoidal function.
yðt þ 1Þ yðtÞ
g¼ . (11)
yðtÞ
This function represents the rate of gain or loss incurred in one time step. The total
gain–loss is calculated for all the time series as
X
n
G¼ gi . (12)
i¼d E Dt
It means the sum of all the possible gain or loss over the complete time series period.
Therefore, in this strategy if DV ðtÞ4DV ðt 1Þ; we will change all our assets into
currency2 at t þ 1; if we are confronted for the first time to a decrease in DV ; if not
then no action is performed. As we will see later on, this strategy for real financial
time series produces a considerable amount of transactions since our DV is
oscillating around zero. In case of transaction costs this strategy would fail.
However, we are interested in testing the predictability and therefore transaction
costs are not the main issue of this work.
ARTICLE IN PRESS
F. Strozzi, J.M. Zaldı´var / Physica A 353 (2005) 463–479 471
Table 1
Best parameters and predictability results without transaction costs for the currency exchange time series
considered
P
Currency %gain topt d opt
E
gopt
%gain refers to the number of times in which there was a net gain for all combinations of reconstruction
parameters, i.e., (t between 2 and 400 and d E between 1 and 15). topt and d opt
E indicate, respectively, the
optimum time delays and embedding dimensions for state space reconstruction in the sense of higher
P opt
gain–loss function, i.e. g :
Fig. 5. (a) DEM—US dollar normalised time series; (b) first derivative; (c) state space volume; (d) state
space volume change. Reconstruction parameters: Dt ¼ 36; d E ¼ 1:
function of the time delay and embedding dimension, see Fig. 4. As can be seen at
low embedding dimensions and time delays we are able to predict correctly the
behaviour of the time series. However, as we start to increase the dimension and the
time delay our prediction capabilities start to fail and our gain–loss function became
negative.
Fig. 6. Exchanges between DEM and USD following the trading strategy defined in Section 2.2 and
starting with 100 units in USD.
the level of predictability, we have tested the gain–loss function, Eq. (12), for values
of time delay between 2 and 400 and embedding dimensions between 1 and 15. These
values have been selected in agreement with our previous analysis using non-linear
time series methods for this high frequency data set [11]. This analysis is reminiscent
of a similar approach developed in Ref. [26] using RQA analysis to derive
embeddings and delays.
Table 1 summarises the results for each foreign currency. In the first column the
percentage of values, for which a positive value for the gain–loss function is
obtained, are represented. As can be seen a mean value of 65% of positive
predictions is obtained. Furthermore, the optimum time delay and embedding
dimension are represented, as well as the optimal gain–loss function that oscillated
between 14 and 667. A similar result, but with lower G values, max. 0.02, was
obtained in Ref. [7] using a simple rule, antipersistance, for the dollar–yen exchange
time series. However, as we have normalised the time series to occupy the whole
range of values between 0.01 and 1.001, these really high values of gain cannot be
considered as representative of the real-time series. Results using real-time series [27]
produced a net gain of around 25%, i.e., mean gain G 0:25; which is still quite high
in comparison with literature values. Furthermore, one should notice that in some
cases, i.e., BEF, DEM, DKK, FRF, SGD and XEU, the optimum reconstruction
ARTICLE IN PRESS
474 F. Strozzi, J.M. Zaldı´var / Physica A 353 (2005) 463–479
Fig. 7. Detail with the first 2000 points in Fig. 6 showing more clearly the transactions dynamics.
parameter values are found using an embedding dimension of one, which in practical
terms means we are calculating averaged derivatives and accelerations on the time
series. In this sense typical instruments of technical analysis [8,9] using by chartists
are justified.
Figs. 5–9 show two examples, corresponding to the DEM and ITL, of the results
obtained using the optimal reconstruction parameters. As can be seen there is a net
gain even though both time series have a completely different behaviour from the
point of view of currency exchange, i.e., one series is increasing the other decreasing.
Notice that due to the normalisation steps we have expanded the time series to cover
the whole range. From this point of view the results are not clearly representative of
the real time series since in each one the range of the change has its own values.
With this trading strategy, it is clear that there is no limitation in the number of
transactions to perform, see Figs. 6, 7 and 9. Therefore, once transactions costs are
included it seems evident that it will be difficult to obtain a net gain. For this reason,
we have developed a modified strategy in which we use the value of the state space
volume to decide if a transaction should be performed or not, i.e., jV j4limit: By
reducing the number of transactions it is possible to obtain a net gain even though
assuming a realistic trading cost in each transaction [27].
Fig. 10 shows the gain surface for the case of the ZAR. As can be seen optimal
gains are confined in a region of low time delays and decreasing embedding
ARTICLE IN PRESS
F. Strozzi, J.M. Zaldı´var / Physica A 353 (2005) 463–479 475
Fig. 8. (a) ITL—US dollar normalised time series; (b) first derivative; (c) state space volume; (d) state
space volume change. Reconstruction parameters: Dt ¼ 176; d E ¼ 11:
dimensions as the time delay increases. This approach is similar to [26] in the sense
that we define our optimum reconstruction parameters as a function of some
indicator of the time series. In our case the net gain, whereas in Ref. [26] they use
number of recurrences or percentage of determinism. Furthermore, this approach
may be also used in dynamical systems analysis to determine optimal time delays and
embedding dimensions given a time series of observations.
Fig. 9. Exchanges between ITL and USD (logarithmic scale) following the trading strategy defined in
Section 2.2 and starting with 100 units in USD.
non-parametric
P sign (or median) test [25] to accept or reject such a null hypothesis to
%gain and gopt values. The sign test states that the hypothesis to have pthe
ffiffiffi same
median is rejected at 5% level of significance if jnmedian =n 1=2j41= n; where
nmedian refers to the number of observation lower than the median of the random
walk time series and n is the total number of observations. If we apply the testP to the
%gain, we obtain a value for the left-hand side of 0.33 whereas applying it to gopt
we obtain 0.39, which are both bigger than 0.24, right-hand side of the inequality.
4. Conclusions
EMH considers that financial markets are impossible to forecast. However, recent
research [7] has shown that this is not true. Even though, net gain using simple
strategies, i.e., persistence, antipersistence, etc., is small to justify these strategies to
be employed in practice. In this work, we have demonstrated that it is possible, to
obtain a net gain using information about the past of our time series with a trading
strategy based on state space reconstruction and the calculation of a local dynamical
property. However, to test correctly the EMH, the forecasting should be done in
real-time since in real markets investors’ current and future forecast of payoffs affect
ARTICLE IN PRESS
F. Strozzi, J.M. Zaldı´var / Physica A 353 (2005) 463–479 477
Fig. 10. Gain–loss surface for the considered time delays (2–400) and embedded dimensions (1–15) for the
ZAR.
their current and future trades which in turns affect returns, i.e., there is a feedback
mechanism which has not been considered. Furthermore, the analysis presented in
this work is not completely blind in the sense that we only use past information. This
is due to the fact that we have used the complete time series to obtain optimal values
of reconstruction parameters for showing that there are values for which a net gain is
possible. Of course, being our financial time series not stationary, there is no
guarantee that the optimal parameters we have obtain for 1996 would be those which
will produce an optimal gain in another years. However, the high percentage of net
gain cases indicates that is not difficult to find an adequate combination and update
it iteratively on real-time as new data values become available, by optimizing time
delay and embedding dimension using a window of past data.
Furthermore, if investors start to apply this forecasting methodology the
temporary forecastability that exists according to the EMH will quickly disappear
and, hence, the EMH will hold. In this sense, by applying more sophisticated trading
strategies the financial markets will become more efficient.
Finally, we may conclude that in terms of prediction power, high-frequency
foreign exchange time series have a different behaviour from a random walk, i.e., are
more predictable. In this sense we may say that a certain amount of determinism is
embedded in the analysed financial time series that made their prediction more
accurate that a random walk.
ARTICLE IN PRESS
478 F. Strozzi, J.M. Zaldı´var / Physica A 353 (2005) 463–479
Table 2
Best parameters and predictability results without transaction costs for the random walk time series
considered
P
Currency %gain topt d opt
E
gopt
%gain refers to the number of times in which there was a net gain for all combinations of reconstruction
parameters, i.e., (t between 2 and 400 and d E between 1 and 15). topt and d opt
E indicate, respectively, the
optimum time delays and embedding
P opt dimensions for state space reconstruction in the sense of higher
gain–loss function, i.e. g :
Acknowledgements
The authors gratefully acknowledge Prof. J. Zbilut for comments and suggestions
on a previous version of this manuscript, Drs. J. Gallego and E. Gutiérrez for useful
discussions; Mr. Piero Cavaleri—Director of the LIUC Library—who purchased the
data sets; and to Olsen & Associates, which are the source of the data sets analysed.
References
[1] E.F. Fama, Efficient capital markets, a review of theory and empirical work, J. Financ. 25 (1970)
383–414.
[2] L. Bachelier, Theory of speculation, in: P. Cootner (Ed.), The Random Character of Stock Market
Prices, MIT Press, Cambridge, 1964.
[3] A. Timmermann, C.W.J. Granger, Efficient market hypothesis and forecasting, Int. J. Forecasting 20
(2004) 15–27.
[4] R.N. Mantegna, H.E. Stanley, An Introduction to Econophysics, Cambridge University Press,
Cambridge, 2000.
ARTICLE IN PRESS
F. Strozzi, J.M. Zaldı´var / Physica A 353 (2005) 463–479 479
[5] N.F. Johnson, P. Jefferies, P. Ming Hui, Financial Market Complexity, Oxford University Press,
Oxford, 2003.
[6] F. Lillo, J.D. Farmer, R.N. Mantegna, Master curve for price-impact function, Nature 421 (2003)
129–130.
[7] T. Ohira, N. Sazuka, K. Marumo, T. Shimizu, M. Takayasu, H. Takayasu, Predictability of currency
market exchange, Physica A 308 (2002) 368–374.
[8] M. Pring, Introduction to Technical Analysis, McGraw-Hill, New York, 1997.
[9] Reuters Ltd., An Introduction to Technical Analysis, Wiley, Singapore, 1999.
[10] Olsen & Associates, Research Institute for Applied Economics, http://www.olsen.ch/.
[11] F. Strozzi, J.M. Zaldivar, J.P. Zbilut, Application of nonlinear time series analysis techniques to
high-frequency currency exchange data, Physica A 312 (2002) 520–538.
[12] N. Packard, J. Crutchfield, D. Farmer, R. Shaw, Geometry from a time series, Phys. Rev. Lett. 45
(1980) 712–715.
[13] F. Takens, in: A. Rand, L.S. Young (Eds.), Dynamical Systems and Turbulence, Warwick 1980,
Lecture Notes in Mathematics, vol. 898, Springer, Berlin, 1981, pp. 366–381.
[14] M.B. Kennel, R. Brown, H.D.I. Abarbanel, Determining embedding dimension for phase-space
reconstruction using a geometrical construction, Phys. Rev. A 45 (1992) 3403–3411.
[15] L. Cao, Practical method for determining the minimum embedding dimension of a scalar time series,
Physica D 110 (1997) 43–50.
[16] A.I. Mees, P.E. Rapp, L.S. Jennings, Singular value decomposition and embedding dimension, Phys.
Rev. A 36 (1987) 340.
[17] A. Fraser, H. Swinney, Independent coordinates for strange attractors from mutual information,
Phys. Rev. A 33 (1986) 1134–1140.
[18] P. Grassberger, T. Schreiber, C. Schaffrath, Nonlinear time sequence analysis, Int. J. Bifurcat. Chaos
1 (1991) 521–547.
[19] R. Hegger, H. Kantz, L. Matassini, Denoising human speech signals using chaos like features, Phys.
Rev. Lett. 84 (2000) 3197–3200.
[20] J.P. Zbilut, J.M. Zaldı́var, F. Strozzi, Recurrence quantification based-Liapunov exponents for
monitoring divergence in experimental data, Phys. Lett. A 297 (2002) 173–181.
[21] F. Strozzi, J.M. Zaldı́var, A. Kronberg, K.R. Westerterp, On-line runaway prevention in chemical
reactors using chaos theory techniques, AIChE J. 45 (1999) 2394–2408.
[22] J.M. Zaldı́var, J. Bosch, F. Strozzi, J.P. Zbilut, Early warning detection of runaway initiation using
non-linear approaches, Commun. Nonlinear Sci. Numer. Simulation 10 (2005) 299–311.
[23] J. Bosch, F. Strozzi, J.P. Zbilut, J.M. Zaldı́var, On line application of the divergence criterion for
runaway detection in isoperibolic batch reactors: simulated and experimental results, Comput. Chem.
Eng. 28 (2004) 527–544.
[24] V.I. Arnold, Ordinary Differential Equations, MIT Press, Cambridge, 1973.
[25] T.W. Anderson, J.D. Finn, The New Statistical Analysis of Data, second ed., Springer, New York,
1997.
[26] J. Zbilut, C.L. Webber, Embeddings and delays as derived from quantification of recurrence plots,
Phys. Lett. A 171 (1992) 199–203.
[27] F. Strozzi, J.M. Zaldı́var, Towards a non-linear trading strategy for financial time series, Chaos
Soliton Fract., 2005, submitted for publication.