The methodology used in this work is empirical and consists of a data analysis of the entropy of returns distributions generated by two kind of traders, i.e., algorithms that operate on data records of the above mentioned financial markets. Consequently, these traders are not agents in the sense of Agents Based Models (ABM) techniques. One of these traders is a unique trader operating in each market and named the “optimal trader”. It performs operations on recorded data in such a way it obtains a maximal return in every trade, as will be explained below at
Section 4.1.3. On the other hand, we have a number
of “noise traders” which open and close alternating long and close positions in a random, however non arbitrary way, as is explained also in
Section 4.1.3. Below, we explain how we construct the analyzed observables used in this paper in order to compare the entropy of generated returns of an optimal trader with the entropy of returns of the
“noise traders”.
4.1. Construction of the Analyzed Observables
In order to calculate entropy of returns, for the “noise” and the “optimal traders”, we consider only daily closing prices or index closing values and we focus our attention on the following events: those sub-sequences of time series where all records of the index value increases or decreases monotonically. We call those events uninterrupted daily uptrends and uninterrupted daily downtrends, respectively.
The above said is illustrated in
Figure 1, which displays the alternated succession of uninterrupted trends in an arbitrary price chart. Observe how the first trend is a decreasing one with a duration of one day, and is followed by an uptrend with duration of one day, a downtrend with a duration of one day, and then a two day uptrend, and so on.
We can define uninterrupted trends and their corresponding returns, which we call TReturns or multi-scale returns, as follows:
Definition 4 (Uninterrupted uptrend of duration k). Given a daily financial time series of n records , an uninterrupted uptrend of duration k days, is a sub-series or sub-sequence of the given time series , starting at , such as , i.e., all terms of the sub-sequence increase monotonically.
Implicitly, it has to be understood that and , i.e., all possible increasing terms of the corresponding uninterrupted uptrend are contained on it. We call the terms and the extreme values of the uninterrupted trend of duration k.
Analogously, given a financial time series, we define an uninterrupted downtrend of duration k days as follows:
Definition 5 (Uninterrupted downtrend of duration k). Given a daily time series of n terms , an uninterrupted downtrend of duration k days, is a sub-sequence of the given time series , starting at , such as , i.e., all terms of the sub-sequence are decreasing.
Also here it is understood that and , i.e., all possible increasing terms of the corresponding uninterrupted uptrend are contained in it.
We call the terms and the extreme values of the uninterrupted trend of duration k.
Given a financial time series, in our case, a daily financial time series with
n records, we can divide it in
s sub-sequences, each one being an uninterrupted trend, by following the criterion whether the elements in each sub-sequence increase or decrease monotonically. We denote these
s sub-sequences as:
where the sub-index
indicates the starting record of the corresponding trend in the financial time series under study,
denotes the duration of the trend,
. Finally,
can be “+” or “−”, denoting an uninterrupted uptrend or downtrend, respectively. The directions of next trends are determined starting at
by alternating the signs “+” and “−”.
We can construct , the vector of s positive integers that indicates the corresponding duration in days of every uninterrupted trend.
Thus, given the
trend with duration
k,
, by using this notation, we denote its corresponding extreme values as:
Definition 6 (Returns from Trends, also named TReturns or multi-scale returns)
. Given a financial time series of n prices or index values, , after constructing the corresponding s uninterrupted trends given by Equation (4), for each uninterrupted trend, we define their corresponding multi-scale return or for short, TReturn, with duration k as: Since different time scales are involved in the construction of TReturns, we also call them multi-scale returns. We will use the former name in this work.
4.1.1. Properties of TReturns
Since TReturns are a non-arbitrary shuffle of returns involving different time scales they are very interesting and worthy of study [
45]. Briefly, we restate some properties of TReturns, constructed from a given financial time series:
It is clear from the definition of TReturns that the usual positive and negative daily returns, allocated between uninterrupted returns of duration longer than one day, can be considered TReturns of duration one day respectively.
By its construction, every uninterrupted uptrend is preceded by an uninterrupted downtrend, and so on. The constructed time series of TReturns is composed of alternating positive and negative TReturns.
If the constructed TReturns data sample has an even number of records, it is composed of same number of positive and negative TReturns. If the TReturns sample has an odd number of records, the number of positive and negative TReturns differs by one unit.
The constructed sample of TReturns includes a non-arbitrary sequence of financial returns involving different time scales. For this reason, we say that TReturns are a (time-like) multi-scale variable.
The TReturns time series are at least first-order stationary. In
Section 4.1.2, we present a discussion on TReturns stationarity.
Further in this text, TReturns of the optimal trader will be defined as the absolute value of just displayed TReturns. See Definition 7 and Equation (
6).
In
Figure 2, we can observe the normalized distributions of TReturns for the different markets studied in this paper, whereas
Figure 3 displays the corresponding evolution of TReturns over time. It can be appreciated that TReturns mean value in same way as for usual daily returns, fluctuate around zero in addition, no trends are present or may be detected at a glance.
4.1.2. Discussion on TReturns stationarity
Before proceeding further, it is important to establish whether the observable TReturns can be treated as a stationary random variable or not. Returning to
Section 4.1.1,
Figure 2 and
Figure 3 show respectively the distribution of the different markets’ TReturns, and their evolution over time. We can see that TReturns are very similar to usual daily-log returns. Although due their construction, TReturns variations are bigger than those of usual daily returns and alternate their sign consecutively, as explained above in
Section 4.1.1. The later property entails important consequences related to the stationarity of TReturns distribution. Once the sign of one term of TReturns time series is known, we can know the sign of every other term; this should be reflected in long range correlations displayed by TReturns’ auto correlation function (ACF). At first sight, the later fact seems to be a problem, because ACF of time series generated by stationary random processes have no memory and must decay to zero fast. Even some statistical tests of stationarity are based in the ACF and statistical independence of a time series, as for example the Ljung-Box test [
57]. Thereby, TReturns distribution can not be strictly stationary, in fact neither usual daily log-returns are strictly stationary, because the returns’ second central moment it is not constant. Since, (1) returns mean value is constant; (2) returns variance is finite and (3) returns ACF is negligible with the exception of small intraday time scales and then corresponding autocovariance decays promptly to zero (making the autocovariance
dependent only on
h for all index value
t, the original third necessary condition required for wide sense stationarity of a stochastic process
), it is said that returns are stationary in the weak or wide sense, which is a less restrictive definition of stationarity [
58,
59].
For the case of TReturns, and although conditions (1) and (2) are fulfilled, condition (3) is not. Consequently, the TReturns variable is not weak stationary. It is interesting that TReturns alternating sign property triggers also an alternating sign behavior of ACF that causes the ACF mean value to decay fast and stay close to zero. Property that deserves a further and deeper study along with its implications on stationarity of TReturns. For example, and due to the aforementioned, TReturns distribution would not pass a stationarity test based in ACF properties, as the mentioned Ljung-Box test, however TReturns distribution may pass other stationarity tests as shown below for the case of the Dickey-Fuller test [
60].
Nevertheless, remember that there are other degrees and definitions of a stationary process, which are still less restrictive than weak stationarity. Following [
59], TReturns are compatible with the definition of stationarity up to order
or first order stationary, i.e., TReturns first central moment is constant. Again, since its second central moment depends on volatility and then cannot be constant, TReturns variable is not stationary up to order
.
Indeed, it is reasonable to accept that TReturns first central moment is constant. To motivate this, for DJIA, in
Figure 4, by using a moving average with a time window of 25 days, we show the behavior on time of the first four central moments of TReturns distribution. At a glance, no trends are detected in the evolution of
. RMS at
Figure 4 must be a multi-scale volatility measurement that deserves additional study, and can not be constant. Skewness could be handled as constant and kurtosis seems at least stationary. First moment
evolution does not show trends and fluctuates around its mean value, signaled in
Figure 4 by a straight, horizontal red line, with a value of
.
Unlike plots from
Figure 3 where TReturns duration was scaled to “real” (chronological) time, in
Figure 4, we denote the independent, horizontal variable by
to indicate that every time unit in the horizontal axis corresponds to the trend duration of the corresponding displayed TReturn, which may last from one to several days.
The Dickey-Fuller test is a type of unit root test that performs a hypothesis test on a time series with the null hypothesis that a unit root is present in an autoregressive time series model. Having a result of a small
p-value suggests that the presence of a unit root is unlikely. By rejecting the null hypothesis, it allows the conclusion that the sample data could have come from a stationary time series. We perform a Dickey-Fuller test on two time series of Returns and TReturns constructed from prices of the DJIA partitioned in sets of 25 days. By setting a significance level of 0.05, results show that for both Returns and TReturns, the time series behaves as a mostly stationary process, with the exception of three single events on the Returns where non-stationarity cannot be discarded. This is shown in
Figure 5.
From the above discussion, in our opinion, it is possible to statistically treat TReturns in same way as we treat usual daily log-returns.
4.1.3. Trader’s Operation Rules
Again, before explaining the rules that determine how traders operate, we must remind that the traders described here are not agents in the sense of simulation of agents’ methodologies (agent based simulations). They do not interact between themselves exchanging information or money or something else. The optimal trader buys and sells the index, exactly in the best moment to maximize returns, which of course is something impossible in practice; on the other hand, the noise traders alternate long and short positions, keeping them a random number of days, as will be explained below. No transaction fees are considered. So, our traders are more competing algorithms processing real data than interacting agents.
Given a financial time series of prices or financial index values, we are interested in the sub-series or sub-sequence of s successive trend durations
observed in real data. Traders operate as follows:
Definition 7 (Operational definition of the optimal trader). The optimal trader is that one that opens a long position at the beginning of an uninterrupted uptrend and closes it at the end of it, i.e., at the extreme and maximum value of this trend to immediately proceed to open a short position at the beginning of the uninterrupted downtrend and closing this short position at the lowest value of the downtrend, i.e., the extreme and minimum value of this downtrend, then the trader repeats this procedure until the end of the given financial time series. No transaction fees are considered.
Following this trading rule, the returns of the optimal trader will be:
All these TReturns are positive because the optimal trader goes long during uptrends and goes short during downtrends. Optimal trader total returns, denoted
, is only the sum of the overall of the returns (
6) as follows:
Clearly, the list of durations of observed uninterrupted trends are the time scales corresponding to every calculated TReturn.
On the other hand, noise traders open, hold and close, alternating long and short positions as follows:
Definition 8. Operational definition of a noise trader:
For every noise trader,
, a corresponding random sequence
of integers, representing random trend durations, is generated, whereis such that , where s and n are correspondingly, the number of uninterrupted trends and the number of entries of the particular financial index studied and displayed at last column of Table 1.Then, thenoise trader alternately opens and closes long and short positions on the real financial index data without any fee cost, accordingly with the records of the random sequence.
The integers belonging to the sequence, are generated following an uniform random distribution in the interval, where, is the duration in days of the longest trend observed in real data.
Here, we must say that for this study, we have chosen the simplest way of generating returns for the noise traders using the selected financial data samples. We could have generated the synthetic trends durations for the random traders using random numbers following an exponential distribution, a more realistic option [
61], or by sorting the
observed trend durations, to have
sequences of integers to generate noise traders returns. This approach will be explored in a future paper.