<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Portfolio Optimization and Trading Strategies: a simulation approach</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Alessio Emanuele Biondo</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Laura Mazzarino</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Damiano Rossello</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Economics and Business, University of Catania</institution>
          ,
          <country country="IT">Italy</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Department of Physics and Astronomy, University of Catania</institution>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>This paper describes a community of investors forming their expectations with heterogeneous strategies in order to optimize their portfolios by means of a Sharpe ratio maximization. Traders are distinguished according to their methodology used in forecasting. Twelve acknowledged algorithms of technical analysis have been implemented to compare portfolios performances and assess profitability of each technique.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Sharpe ratio</kwd>
        <kwd>Financial markets</kwd>
        <kwd>Portfolio performance</kwd>
        <kwd>Simulations</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>of opinions (views) of analysts about the market. Obtained results lead to more stable and
diversified optimal portfolio into the Markowitz model. This model was studied by [ 9], [10],
[11] and [12], among many others.</p>
      <p>Another way to find the optimal portfolio is based on the maximization of a portfolio
performance index, as the Sharpe ratio ([13],[14]), which is defined as a ratio of the expected portfolio
return relative to his standard deviation. Actually, it was Roy [15] who first suggested a portfolio
valuation strategy based on a risk-return index; later, Sharpe applied his idea to the Markowitz
approach by creating his famous index, which is one of the most used one, despite it is based
on unrealistic hypotheses (among which, for instance, the assumption of Gaussian-distributed
returns).</p>
      <p>Since standard deviation is not always an appropriate measure of risk, many alternatives
to the Sharpe ratio have been advanced. Among others, the Treynor ratio [16] substitutes the
standard deviation with the portfolio beta, while the Sortino ratio [17] uses the downside risk
as a risk measure, and the ratio of Bodnar and Zabolotskyy [18] replaces standard deviation
with var. Other portfolio performance indices have also been developed, such as Jensen’s alpha
[19] and many measures based on portfolios weights, as in [20], [21], [22] and [23].</p>
      <p>Financial markets can be seen as complex systems ([24], [25]) in which agents cannot be
described as copies of the representative agent [26] endowed with rational expectations ([27],
[28] and [29]), but have heterogeneous features and base their behaviour on a bounded rationality
([30], [31]) and interact with each other ([32], [33]). Agent-based models (abm) allow treatment of
complex systems by putting the evidence on the relevance of interactions and the unpredictable
sequentiality governing the system dynamics. The application of such a methodology to
Economics is called Agent-based Computational Economics (ace), defined by Tesfatsion [ 34] as
“the computational study of economic processes modelled as dynamic systems of interacting
agents”. This methodology has been fruitfully applied to the study of financial markets, as in
[35], [36], [37], [38], [39], [40], [41], [42], [43], [44] and [45], among others, as surveyed by
LeBaron [46]. It is important to mention the work of [47] in which they used an agent-based
model for a portfolio optimization. In this field, [ 48] made an experimental study to assess the
efect of complexity on asset trading.</p>
      <p>Heterogeneous expectations and behaviours are often studied in related literature, by referring
to the endogeneity of the signal followed to form expectations (i.e., between fundamentalists
-who maintain a view on an exogenous signal- and chartists -who define the expected dynamics
by inferring the trend of past prices). A vast body of references can be reported, among
which: Alfarano et al. [49] created an agent based model in which agents can switch between
fundamentalist and chartist strategies; Alfi et al. [ 50] analysed price dynamics considering the
presence of forces due to trend adverse and trend following strategies; Flaschel et al. [51] showed
how chartists tend to destabilize the economy; Lux and Marchesi [52] developed a model in
which fundamentalists, optimistic and pessimistic trend followers can switch between strategies,
thus giving rise to more instability independently of expected news; Lux and Marchesi [53]
studied the volatility clustering; Westerhof [ 54] and Chiarella et al. [55] considered multi-asset
markets, in which the interaction between them causes clustered volatility and fat tail of asset
returns; Westerhof and Reitz [ 56] estimated an heterogeneous agent model underlying the
impact of fundamentalists.</p>
      <p>The present paper proposes a model based on the Sharpe ratio maximization, in which agents
form their expectations by following heterogeneous strategies, in order to optimize their
portfolio. More precisely, we propose a set of behavioural rules of prediction widely acknowledged
in technical analysis (see [57], [58], [59], [60], [61], [62], [63], [64], [65]): three variants of the
Moving Average Convergence Divergence model - macd; the Relative Strength Index - rsi; Rate
of Change - roc; Crossover; Stochastica; Linear Forecasting; and Compound Forecasting. Finally,
we consider also fundamentals, chartists and the completely random approach, proposed in [66],
[67], [68], [69], as detailed below. All algorithms have been implemented to create portfolios
whose values have been compared in order to assess the profitability of each technique. In
literature, there are some papers that compare the performance of diferent strategies, among
others: [70],[71],[72],[73],[74],[75]. The paper is organized as follows: section two contains the
model, section three shows results of simulations; section four presents concluding remarks.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Model Description</title>
      <p>The model simulates diferent processes of expectations formation, each using a diferent
technique. Such expected values will be used in Sharpe-ratio optimization procedures by traders
in order to determine the quantities of two assets in the optimal portfolio. All common caveats
of Markowitzian optimization hold: first of all, we assume that each investor allocates all
her wealth in both assets - thus assuming that any possible decision inherent to saving has
been already taken and the investor has decided the amount of resources for financial trading;
secondly, we admit that the whole informative set consists in the available data on market
dynamics - this will have an exception for one category of investors, as it will be detailed below;
ifnally, we are not considering any interaction or imitation among traders - thus, no exchange
of information or influence is playing here.</p>
      <sec id="sec-2-1">
        <title>2.1. Performances and Sharpe-ratio</title>
        <p>The evaluation of portfolio performances is aimed to check whether given return and risk
requirements have been met by fund management. This assessment is usually operated with
reference to asset classes, i.e., major categories of assets (stocks, bonds and money market
instruments), industrial sectors for a portfolio of national equities, or countries for portfolios of
international equities. The measure of portfolio performance should be increasing with respect
to the expected return and decreasing with respect to the estimated risk. The Sharpe ratio (sr) is
one of the most discussed metrics within the class of reward-to-variability measures, as related
to the classical mean-variance model of portfolio selection. In fact, under mild assumptions, the
optimization problem of finding the maximum expected portfolio return, given a target level of
risk as measured by the variance of portfolio return, is equivalent to the maximization of sr.</p>
        <p>In the current paper we build a dynamic discrete time model where asset prices vary within
a fixed time horizon [0,  ],  &gt; 0. In term of performance evaluation, financial institutions
usually split the strategic horizon [0,  ] into sub-periods of the same length, and try to predict
the optimal sequence of portfolio weights maximizing its performance at the final date  . Then,
let us choose sr as the relevant measure of performance and use subscripts to denote any integer
sub-intervals [ −
the rate of return is  = ( −</p>
        <p>1, ] for  = 1, 2, . . . ,  .
time  ∈ [0,  ]. The market price of the th asset from time  − 1 to time  is represented by ,
− 1)/− 1 and the investment horizon [0,  ] is a sequence of
to optimal weights , with ∑︀  = 1.</p>
        <p>An sr-optimizer trader maximizes the performance, measured by means of the sr, of her
portfolio, composed by allocating, at time , the personal endowment  to two assets, according</p>
        <p>The multi-period optimization problem solved by each trader at each time step can be stated
as:
argmaxx
subject to</p>
        <p>E(r x )
sd(r x )
(1 + rx)− 1
xe
=
=

1
 = 1, . . . , 
 = 1, . . . , .</p>
        <p>
          The objective function is the sr, i.e., the ratio of the expected return of the portfolio to its
standard deviation. The control variable is x = (x)∈ , which represents the result of diferent
trading strategies to be set up for both assets at each time  and e is a vector of ones. Eq.(
          <xref ref-type="bibr" rid="ref2">2</xref>
          )
describes capital accumulation, i.e., the decision to invest the wealth’s fraction  in the asset 
at time  after the asset return  has been realized. Eq.(
          <xref ref-type="bibr" rid="ref3">3</xref>
          ) stands for no-leverage. The objective
function can be written as
︁(
︁(
E
sd


0· ((1+r1 x1)· (1+r x )) − 1
0· ((1+r1x1)· (1+r x )) − 1
︁)
︁) ,
max
x
s.t.
        </p>
        <p>√xxCmx</p>
        <p>xe
min
w
s.t.</p>
        <p>12 wCw
we
wm
traders, at each time step  ∈ [0,  ], aimed at maximizing their sr.</p>
        <p>
          The numerical implementation of problem (
          <xref ref-type="bibr" rid="ref1">1</xref>
          ) is then based on a sequence of one-time
maximization problems within the horizon,
where m is the vector of expected returns, such that  = E() and C = [ ] is the
covariance matrix of the returns r, i.e. 
The problem can be simplified as follows:
 := cov(
,
        </p>
        <p>) for each  and .

mmCC−−11e ,</p>
        <p>
          (
          <xref ref-type="bibr" rid="ref9">9</xref>
          )
(
          <xref ref-type="bibr" rid="ref10">10</xref>
          )
The switching is based on the scaling w :=  x,, where  &gt;
0 is the scaling factor, and
presuming the extra hypotheses that there is a feasible portfolio x such that xm &gt; 0 and the
obvious normalization wm = 1. The optimal solution is:
where C− 1 is the inverse of C. The quantity of each asset in the portfolio, is
 =
− 1 ,
        </p>
        <p>for  = 1, . . . ,  and  = 1, 2.</p>
        <p>Since the model designs the existence of  heterogeneous agents, we assume diferent,
subjective, probability spaces (Ω,  , P), for  = 1, 2, ...,  . More precisely, each probability
measure P pertains to trader -th and it is defined through what he expects from diferent
hypotheses on market movements. Thus, diferent traders have the diverse expectations about
future prices and fundamental values. Expectations are then used to define the probabilities
P themselves, see [77] and [78]. Ω can be considered as individual conception of the ideal
experiment associated to forecasting future prices, while actual experiments only reveal the
level of traders observation. Therefore, for each trader (based on his subjective judgment) there
is a diferent expectation</p>
        <p>m at time . In order to compute it, each trader adopts a given strategy
and make a forecast for the price for the next time step, thus obtaining the expected return.</p>
      </sec>
      <sec id="sec-2-2">
        <title>2.2. Trading strategies</title>
        <p>The basic setting is built upon nine diferent trader types, adopting the following strategies: 1)
fundamentalists; 2) chartists; 3) macd traders (in turn divided in three groups, i.e., 3.1)
macdbasic, 3.2) macd-plus, and 3.3) macd-divergence); 4) crossover traders; 5) rsi traders; 6) random
traders; 7) stochastic traders; 8) roc traders; 9) two econometric forecasting approaches, i.e.,
9.1) linear traders and 9.2) compound traders. Strategies 2), 3), 4), 5), 7) and 8) are based on
descriptions given in relevant related literature (see [57] for further details). In this paper, for
each strategy, is considered a single trader who will decide to buy if the expected price is higher
than the current market price and sell in the opposite case.</p>
        <sec id="sec-2-2-1">
          <title>2.2.1. Fundamentalists</title>
          <p>
            Fundamentalists consider the fundamental value of the asset,  , as the relevant indicator to
infer the dynamics of the price time series. Such a fundamental value is, according to their view,
the true value of the asset, which embeds the “correct” evaluation of all relevant information and
also includes the efects of the dividend yields. It is defined as an exogenous random variable
whose dynamics may be assumed as a martingale-dividend-driven. Thus, the expected price,
for a fundamentalist can be written as:
  =  − 1 + D
(
            <xref ref-type="bibr" rid="ref11">11</xref>
            )
where  0 = ¯ and D is a random variable extracted from a normal distribution with zero
mean and standard deviation   , which is assumed to follow a random walk and represent the
yearly yield of the asset. Thus the expectation of a fundamentalist is:
          </p>
          <p>
            =   + Θ
where Θ is randomly chosen in the interval (−   ,   ), in order to account for the heterogeneity
of investors. This implies that when the expected price is greater (resp., smaller) than the
observed current market price she decides to buy (resp., sell), because she is expecting that the
asset always converges to its fundamental.
(
            <xref ref-type="bibr" rid="ref12">12</xref>
            )
(
            <xref ref-type="bibr" rid="ref13">13</xref>
            )
(
            <xref ref-type="bibr" rid="ref14">14</xref>
            )
(
            <xref ref-type="bibr" rid="ref15">15</xref>
            )
(
            <xref ref-type="bibr" rid="ref16">16</xref>
            )
          </p>
        </sec>
        <sec id="sec-2-2-2">
          <title>2.2.2. Chartists</title>
          <p>The second type of investos has been designed as momentum trader. Momenutm is the name
of a very broad category of investment strategies, based on the observation of past values of
ifnancial time series. In particular, a very general definition of a momentum oscillator is given
by:</p>
          <p>=  − − 
momentum strategy is based on the sign changes of  :
where the comparison between the current market price  and the past price registered a given
 number of periods ago, −  is used to infer the future dynamics. In particular, the basic
︂{
− →
+ → −
+
buy
sell
Related literature calls "chartists” one of possible expressions of such a kind of strategy: a group
of technical analysts who found their trading decision on the observation of trends and past
dynamics of financial prices. More precisely, each of them refers to a time window, whose
length is individually heterogeneous, and compute a reference value , computed at any
 by averaging prices included in a time window of length , diferent for each chartist and
randomly chosen in the interval (2, ):
Thus, the expectation determined by the chartist is
 =</p>
          <p>1 ∑︁  .</p>
          <p>=−</p>
          <p>=  ± ( − )
less than .
where the choice of setting ± in the formula depends on whether  is respectively greater or
The set of financial oscillators is very wide and a complete survey of them goes far beyond the
scope of the present paper. Nonetheless, the model includes also other three kinds of traders
based on technical analysis adopting the so-called Moving-Average-Convergence-Divergence
(aka macd) strategy, developed by Gerald Appel. Such an oscillator combines exponential
moving averages,  , referred to diferent time intervals, .</p>
          <p>The basic computation is considered as the diference between the averages over  = 12 and
where   =  − 1 +  (︀  −  − 1︀) , with  0 =
∑︀ /, and  =  +21 .</p>
          <p>Oscillations of the two moving averages are diferent: the wider the days interval over which it
is calculated, the slower it moves. Thus the slower is used to observe the trend, whereas the
faster provides the trigger signal: when the latter crosses the former from the bottom (top),
it is a bullish (bearish) signal. Such an oscillator is used according to three diferent versions,
basically responding to the same rationale with diferent levels of refinement and data usage.
The first, henceforth named macd-basic, is:

=− 
︂{
  &gt; 0
  &lt; 0
→
→
buy
sell
︂{
  &gt;  9
  &lt;  9
→
→
buy
sell</p>
        </sec>
        <sec id="sec-2-2-3">
          <title>2.2.3. macd traders</title>
          <p>
            (
            <xref ref-type="bibr" rid="ref17">17</xref>
            )
(
            <xref ref-type="bibr" rid="ref18">18</xref>
            )
(
            <xref ref-type="bibr" rid="ref19">19</xref>
            )
(
            <xref ref-type="bibr" rid="ref20">20</xref>
            )
The second one, henceforth named macd-plus, is augmented by a third moving average,
computed over an interval of  = 9 days,  9, adopted as the trigger:
          </p>
        </sec>
        <sec id="sec-2-2-4">
          <title>2.2.4. Crossover traders</title>
          <p>The Crossover method, inspired by the triple crossover method mentioned for the first time
by R.C. Allen ([79], [80]), requires exponential moving averages for diferent time periods (d),
Finally, the third version, henceforth named macd-divergence, is based on a more detailed data
observation, which is based on divergences. In particular, in a windowed period of past days,
the original time series of the asset price and the correspondent macd time series are compared.
If either the two maximum points or the two minimum points in the interval of both series are
oriented in the same direction of the trend in the same interval, then there is not a divergence.
If, instead, a divergence exists, then it serves as a trigger. Let us indicate by   the slope of the
trend inferred by the time series and by   the slope of the line joining the two local extrema
included in the considered time window. The signalling role on the trading strategy played by
the divergence can be described as:
︂{   &lt; 0 ∧   &gt; 0
  &gt; 0 ∧   &lt; 0
→
→
buy
sell
 , as for the case of macd strategies. More precisely, this method considers three moving
averages, with  = 12,  = 20 and  = 26, calculated as above described. A buy signal will
occur in a downtrend, in which the shorter average (12 day) is bigger than both the medium (20
day) and the longer ones (26 day). A sell signal, instead, will occur in the opposite situation, in
which the longer average is the biggest one.</p>
          <p>︂{
 26 &lt; ( 20;  12)
 26 &gt; ( 20;  12)
→
→
buy
sell</p>
        </sec>
        <sec id="sec-2-2-5">
          <title>2.2.5. rsi traders</title>
          <p>
            Inspired by the Relative Strength Index, introduced by Wilder [62], our corresponding trading
strategy considers once a time window of the recent past  = 30 values of the time series to
infer possible forecasts on future dynamics. In particular, the index is computed as
(
            <xref ref-type="bibr" rid="ref21">21</xref>
            )
(22)
. The simplified strategy here adopted is based on the comparison between the
/ ↓;  ↑ = (1/) ∑︀
=1 ∀ &gt; − 1;  ↓ = (1/) ∑︀
=1  ∀ &lt; − 1;
rsi series referred to the entire original price series and the rsi series referred to the given
interval of observation. The local trend of the index within the given time window and the
global one may exhibit a divergence or not. If a divergence exists, the diference between the
two highest local peaks is added (resp. subtracted) to the current price if the trend of the global
rsi is increasing (resp. decreasing), in order to create the expectation.
2 ∈ [0, 1], always sum up to 1.
          </p>
        </sec>
        <sec id="sec-2-2-6">
          <title>2.2.7. Stochastic</title>
        </sec>
        <sec id="sec-2-2-7">
          <title>2.2.6. Random traders</title>
          <p>The role of random traders has been investigated in several contributions under the names
“zerointelligence”, “noise”, etc. They are defined as traders who decide when/how to invest at random.
For such a reason, they have been used as the representation of the lack on influence/imitation
in order to challenge the normal financial dynamics and show interesting insights to dampen
market fluctuations, i.e., reducing volatility. In the present model, random traders are the sole
group that will not use a portfolio optimization: they will simply decide whether to buy or
to sell by tossing a fair coin. The quantity of both assets to have is extracted randomly by
the algorithm governing the simulations, in such a way that both weights, 1 ∈ [0, 1] and
The stochastic oscillator, popularized by George Lane, is based on the idea that when prices rise,
closing prices tend to approach the upper end of the price range. The opposite occurs where
prices fall. We present a simplified computational version of this method, that we implement as
follow. Recent past values of prices are selected in order to compute two indexes:
 = 100 · 5 − 5
 − 5
and
days of 5 − 5. The strategy can therefore be described as:
where:  is the last price; 5 is the minimum value in the last 5 days; 5 is the maximum
value in the last 5 days; 3 is the sum of the last 3 days of  − 5; 3 is the sum of the last 3
⎨</p>
        </sec>
        <sec id="sec-2-2-8">
          <title>2.2.8. roc traders</title>
          <p>The rate of change (roc) is a ratio which assumes increasing values in cases of an upward trend
and decreasing values in cases of downward trend. It is computed as follows:
where:  is the latest close price and   is the former closing price. Once defined a given
threshold  = 0.05, roc traders’ strategy has been simply modelled as follows:
 =

 
︂{
 ≥ 1 + 
 &lt; 1 + 
→
→
buy
sell
 =  +  · 
 =  · 

(24)
(25)
(26)
(27)
(28)
(29)</p>
        </sec>
        <sec id="sec-2-2-9">
          <title>2.2.9. Econometrician forecasters</title>
          <p>Two last techniques adopt ols estimation in order to predict future prices, by means of a linear
and a compound model. In the first case, the prediction is obtained by:
where  and  indicate a constant and the growth proportion, which could be interpreted as
 = 1+ growth-rate, and  indicates time.
where  and  are, respectively, the constant and the slope of the trend-line, and  indicates
time, thus implying a constant growth.</p>
          <p>The second approach assumes, instead, that the variable grows by a constant proportion each
period. In this case, the prediction is obtained by:</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. Simulations</title>
      <p>The model has been engineered as a sort of back-testing framework in which a fictitious reality
is simulated. In Table 1 time series used for simulations are listed, each reporting the initial
date of the time series. The simulation considers all possible couples of assets and defines a
ifnancial market where traders try to get the highest gain in terms of portfolio value. For each
couple, the length of the simulation is set to the length of the shortest time-series, in such a
way that at every simulation step, traders will always have newly disclosed prices for both
assets. In such a configuration, the simulated market will operate as if investors were living
in the past, thus making the measurement of performance possible, while a sort of financial
race is run among traders, in order to discover which strategy accumulates the highest wealth.
Each trader adopts a strategy and cannot change it. At the beginning, all traders are given the
same amount of money,  = ¯ = 250. By means of their trading decision they will trade
assets, thus computing their wealth, , possibly greater or smaller than the initial endowment.
Further, traders are assumed to be marginal with respect to the market, which means that they
will always find the possibility to negotiate assets as they want. In other words, they will not
be constrained to buy and sell selected quantities. If a trader goes bankruptcy, he will not be
replaced and this will correspond to the worst outcome
(i.e., Δ = − 100%).</p>
      <p>Unlike fundamentalists, all other types of traders considered observe past values of assets to
take decisions. In particular, most of these traders are momentum traders and we assume that
they must have at least 30 data available for each asset. Instead, econometrician forecasters
operate by observing a wider time window of at least 180 data.</p>
      <sec id="sec-3-1">
        <title>3.1. Results</title>
        <p>Results reported in Table 2 show the number of times that each strategy scored the first, the
second and the third in the ranking and the amount of times they fail. Fig.1 compares how
many times the strategies have placed first and fail while Fig.2 shows how many times they
arrived in the first three positions of the 1225 rankings analysed.</p>
        <p>More in detail, stochastica strategy have been place in the top three position of the ranking
696 times, followed by the crossover strategy with 581 placements, fundamentalists with 511
and the rsi with 532. Then we find the rnd with 283 placements and macd-divergence with
258, continuing with the chartists that have been in the top three positions 237 times and
the macd-basis strategy with 231 placements. The roc with 111 times follows the macd-plus
strategy with 133 placements. At the end there are the two econometric forecasting approaches,
linear (59) and compound (37).</p>
        <p>Data show that, overall, the stochastica strategy performed the best and that the worst are,
instead, the econometric forecasting approaches.</p>
        <p>For each couple of assets, simulations give twelve vectors containing portfolio values obtained
by each strategy. The volatility of the best performing strategy has then been computed as
the standard deviation of the distribution of portfolio values associated to that strategy for all
occurrences in which it has ranked first. Fig.3 compares the volatility of all winning strategies,
thus showing that even best performing ones manifest wide variability across the distribution
of results.</p>
        <p>We carried out the same analysis considering also the intraday data, more specifically the
hourly data and data with a frequency of five minutes and one minute. All data were downloaded
using Refinitiv’s Eikon ©, and the intraday series were considered with their maximum available
length, corresponding to the last year for hourly data and the last three months for five minutes
and one minute data. For data with a frequency of five minutes and one minute, the given
threshold for the roc strategy was reduced ( = 0.01).</p>
        <p>For hourly data we found the following results,reported in Table 3, Fig. 4 and Fig. 5.</p>
        <p>Observing these results, we note that chartists reached the first position more times than the
others, but by observing the number of times in which strategies have reached the top three
and last positions, it is noted that the strategy that has performed better overall is the crossover,
which it finished in the top three 468 times and fail 397 times. The worst are confirmed to be
macd-plus and the econometrician forecasters, with compound strategy that failed 1118 times
out of 1225.</p>
        <p>For data with a frequency of 5 minutes we found the following results, reported in Table 4,</p>
        <p>The best performances are those of fundamentalists (in the top three positions 387 times and,
again, with the least number of failures 211) and once again the macd-basic strategy which
reaches the top three positions 480 times . Chartists have reached the first position several
times (206) but have failed many times (631). The worst is the compound strategy, that failed
1210 times.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Concluding remarks</title>
      <p>In this paper we presented a model testing diferent strategies, based on technical analysis, of
expectations formation and show how they afect performances of investors.</p>
      <p>The proposed approach lies on back-testing simulations over true data. Data is used with
reference to each day, as agents experience each time step ignoring the future. Thus, they
choose on the basis of their expectations only, thus making it possible to measure performance
of their portfolio investments, as in a financial race. Portfolios are obtained by considering all
possible couples of the 50 assets.</p>
      <p>Simulations have been devoted to investigate two sets of aspects. First of all, the performance
of diferent strategies has been analysed. For each couple of assets, a ranking of strategies was
identified on the basis of portfolio values. Overall, results show that there are no concordant
rankings of various strategies at diferent time lengths resolution. Thus, for instance, a winning
strategy in simulations with daily data reveals to loose if used with infra-day data. This provides
evidence that optimal strategies are more a desire of investors than an actual results. The reason
why financial success can be reached in speculative investments must depend on occasional
reasons and not on the chosen strategy. In other words, the complexity of the system prevents
any forecast and past trends, elaborated as much as algorithm and experienced traders want,
need not be replicated.</p>
      <p>Secondly, we analysed the volatility of the best performing strategy and the instability of
the market. Consequently to our first finding, we found that even best performing strategies
manifest wide variability. One can conclude that the variability of results is not simply linked
to the goodness of the adopted strategy. Something lying between the lines makes all strategies
uncertain and potentially harmful.</p>
      <p>The methodological innovation to the literature proposed in this paper is that possible
strategies of actual trading have been compared by agent-based simulations. Although here the
model is limited to portfolio composed by two assets only, further research will be dedicated to
this topic, by considering interactions and contagion among traders and a ticker multi-asset
settings to determine the weight of big traders, such as hedge funds and institutional investors,
on the overall market dynamics.
[22] M. Grinblatt, S. Titman, R. Wermers, Momentum investment strategies, portfolio
performance, and herding: A study of mutual fund behavior, The American economic review
(1995) 1088–1105.
[23] L. Zheng, Is money smart? a study of mutual fund investors’ fund selection ability, the</p>
      <p>Journal of Finance 54 (1999) 901–933.
[24] R. N. Mantegna, H. E. Stanley, Introduction to econophysics: correlations and complexity
in finance, Cambridge university press, 1999.
[25] M. Gallegati, M. G. Richiardi, Agent based models in economics and complexity., 2009.
[26] A. M. Sbordone, A. Tambalotti, K. Rao, K. J. Walsh, Policy analysis using dsge models: an
introduction, Economic policy review 16 (2010).
[27] J. F. Muth, Rational expectations and the theory of price movements, Econometrica (29)
(1961).
[28] T. J. Sargent, N. Wallace, Some unpleasant monetarist arithmetic, Federal Reserve Bank of</p>
      <p>
        Minneapolis Quarterly Review (1981).
[29] J. Lucas, Robert E., Expectations and the neutrality of money, Journal of Economic Theory
(
        <xref ref-type="bibr" rid="ref4">4</xref>
        ) (1972).
[30] H. A. Simon, A behavioral model of rational choice, The quarterly journal of economics
69 (1955) 99–118.
[31] H. A. Simon, Models of man; social and rational. (1957).
[32] A. Leijonhufvud, Information and coordination: essays in macroeconomic theory, Oxford
      </p>
      <p>University Press, USA, 1981.
[33] A. Leijonhufvud, Agent-based macro, Handbook of computational economics 2 (2006)
1625–1637.
[34] L. Tesfatsion, Agent-based computational economics: a constructive approach to economic
theory, In: Tesfatsion, L., Judd, K. (Eds.), Handbook of Computational Economics (II) (2006)
831–880.
[35] A. Beja, M. B. Goldman, On the dynamic behavior of prices in disequilibrium, The Journal
of Finance 35 (1980) 235–248.
[36] W. A. Brock, C. H. Hommes, A rational route to randomness, Econometrica: Journal of
the Econometric Society (1997) 1059–1095.
[37] W. A. Brock, C. H. Hommes, Heterogeneous beliefs and routes to chaos in a simple asset
pricing model, Journal of Economic dynamics and Control 22 (1998) 1235–1274.
[38] C. Chiarella, The dynamics of speculative behaviour, Annals of operations research 37
(1992) 101–123.
[39] C. Chiarella, X. He, et al., Asset price and wealth dynamics under heterogeneous
expectations, Quantitative Finance 1 (2001) 509–526.
[40] R. H. Day, W. Huang, Bulls, bears and market sheep, Journal of Economic Behavior &amp;</p>
      <p>Organization 14 (1990) 299–329.
[41] R. Franke, R. Sethi, Cautious trend-seeking and complex asset price dynamics, Research
in Economics 52 (1998) 61–79.
[42] C. H. Hommes, Financial markets as nonlinear adaptive evolutionary systems (2001).
[43] T. Lux, Herd behaviour, bubbles and crashes, The economic journal 105 (1995) 881–896.
[44] T. Lux, The socio-economic dynamics of speculative markets: interacting agents, chaos,
and the fat tails of return distributions, Journal of Economic Behavior &amp; Organization 33
(1998) 143–165.
[45] E. Zeeman, On the unstable behavior of stock exchanges, Journal of Mathematical</p>
      <p>
        Economics 1 (1974) 39–49.
[46] B. LeBaron, Agent-based computational finance, Handbook of computational economics
2 (2006) 1187–1233.
[47] Y. Orito, Y. Kambayashi, Y. Tsujimura, H. Yamamoto, An agent-based model for portfolio
optimization using search space splitting, in: Multi-Agent Applications with Evolutionary
Computation and Biologically Inspired Technologies: Intelligent Techniques for Ubiquity
and Optimization, IGI Global, 2011, pp. 19–34.
[48] B. I. Carlin, S. Kogan, R. Lowery, Trading complex assets, The Journal of finance 68 (2013)
1937–1960.
[49] S. Alfarano, T. Lux, F. Wagner, Estimation of agent-based models: the case of an asymmetric
herding model, Computational Economics 26 (2005) 19–49.
[50] V. Alfi, A. De Martino, L. Pietronero, A. Tedeschi, Detecting the traders’ strategies in
minority–majority games and real stock-prices, Physica A: Statistical Mechanics and its
Applications 382 (2007) 1–8.
[51] P. Flaschel, F. Hartmann, C. Malikane, C. R. Proaño, A behavioral macroeconomic model of
exchange rate fluctuations with complex market expectations formation, Computational
Economics 45 (2015) 669–691.
[52] T. Lux, M. Marchesi, Scaling and criticality in a stochastic multi-agent model of a financial
market, Nature 397 (1999) 498–500.
[53] T. Lux, M. Marchesi, Volatility clustering in financial markets: a microsimulation of
interacting agents, Int. J. Theor Appl Finance (
        <xref ref-type="bibr" rid="ref4">4</xref>
        ) (2000) 675–702.
[54] F. H. Westerhof, Multiasset market dynamics, Macroeconomic Dynamics 8 (2004) 596–616.
[55] C. Chiarella, R. Dieci, X.-Z. He, Heterogeneous expectations and speculative behavior in a
dynamic multi-asset framework, Journal of Economic Behavior &amp; Organization 62 (2007)
408–427.
[56] F. H. Westerhof, S. Reitz, Nonlinearities and cyclical behavior: the role of chartists and
fundamentalists, Studies in Nonlinear Dynamics &amp; Econometrics 7 (2003).
[57] J. Murphy, Technical Analysis of the Financial Markets: A Comprehensive Guide to Trading
      </p>
      <p>Methods and Applications, New York Institute of Finance, 1999.
[58] G. Appel, Technical analysis: power tools for active investors, Financial Times Prentice</p>
      <p>Hall, 1999.
[59] T. T.-L. Chong, W.-K. Ng, Technical analysis and the london stock exchange: testing the
macd and rsi rules using the ft30, Applied Economics Letters 15 (2008) 1111–1114.
[60] T. T.-L. Chong, S. H.-S. Cheng, E. N.-Y. Wong, A comparison of stock market eficiency of
the bric countries, Technology and Investment 1 (2010) 235–238.
[61] N. Ülkü, E. Prodan, Drivers of technical trend-following rules’ profitability in world stock
markets, International Review of Financial Analysis 30 (2013) 214–229.
[62] J. W. Wilder, New Concepts in Technical Trading Systems, Trend Research, 1978.
[63] R. A. Levy, Relative strength as a criterion for investment selection, The Journal of Finance
22 (1967) 595–610.
[64] D. Eric, G. Andjelic, S. Redzepagic, Application of macd and rsi indicators as functions of
investment strategy optimization on the financial market, Zbornik radova Ekonomskog
fakulteta u Rijeci: časopis za ekonomsku teoriju i praksu 27 (2009) 171–196.
[65] R. Rosillo, D. De la Fuente, J. A. L. Brugos, Technical analysis and the spanish stock
exchange: testing the rsi, macd, momentum and stochastic rules using spanish market
companies, Applied Economics 45 (2013) 1541–1550.
[66] A. E. Biondo, A. Pluchino, A. Rapisarda, The beneficial role of random strategies in social
and financial systems, Journal of Statistical Physics 151 (2013) 607–622.
[67] A. E. Biondo, A. Pluchino, A. Rapisarda, D. Helbing, Are random trading strategies more
successful than technical ones?, PloS one 8 (2013) e68344. URL: https://doi.org/10.1371/
journal.pone.0068344.
[68] A. E. Biondo, A. Pluchino, A. Rapisarda, D. Helbing, Reducing financial avalanches by
random investments, Phys. Rev. E 88 (2013) 062814. URL: https://link.aps.org/doi/10.1103/
PhysRevE.88.062814. doi:10.1103/PhysRevE.88.062814.
[69] A. E. Biondo, A. Pluchino, A. Rapisarda, Micro and macro benefits of random investments
in financial markets, Contemporary Physics 55 (2014) 318–334.
[70] N. H. Hung, Various moving average convergence divergence trading strategies: a
comparison, Investment management and financial innovations (2016) 363–369.
[71] E. Pätäri, M. Vilska, Performance of moving average trading strategies over varying stock
market conditions: the finnish evidence, Applied Economics 46 (2014) 2851–2872.
[72] Y.-C. Chiang, M.-C. Ke, T. L. Liao, C.-D. Wang, Are technical trading strategies still
profitable? evidence from the taiwan stock index futures market, Applied Financial
Economics 22 (2012) 955–965.
[73] D. Vezeris, T. Kyrgos, C. Schinas, Take profit and stop loss trading strategies comparison
in combination with an macd trading system, Journal of Risk and Financial Management
11 (2018) 56.
[74] W. Brock, J. Lakonishok, B. LeBaron, Simple technical trading rules and the stochastic
properties of stock returns, The Journal of finance 47 (1992) 1731–1764.
[75] C. A. Ellis, S. A. Parbery, Is smarter better? a comparison of adaptive, and simple moving
average trading strategies, Research in International Business and Finance 19 (2005)
399–411.
[76] D. Li, W.-L. Ng, Optimal dynamic portfolio selection: Multiperiod mean-variance
formulation, Mathematical finance 10 (2000) 387–406.
[77] R. Jefrey, Subjective probability: The real thing, Cambridge University Press, 2004.
[78] P. Whittle, Uncertainty, intuition and expectation, in: Probability via Expectation, Springer,
1992, pp. 1–12.
[79] R. C. Allen, How to Build a Fortune in Commodities, Windsor Books, Brightwaters, NY,
1972.
[80] R. C. Allen, How to Use the 4-Day, 9-Day and 18-Day Moving Averages to Earn Larger
Profits from Commodities, Best Books, 1974.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>H.</given-names>
            <surname>Markowitz</surname>
          </string-name>
          ,
          <article-title>Portfolio selection</article-title>
          ,
          <source>Journal of Finance</source>
          ,
          <volume>7</volume>
          (
          <year>1952</year>
          )
          <fpage>77</fpage>
          -
          <lpage>91</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>V.</given-names>
            <surname>Chopra</surname>
          </string-name>
          , W. Ziemba,
          <article-title>The efect of errors in means, variances, and covariances on optimal portfolio choice</article-title>
          ,
          <source>The Journal of Portfolio Management</source>
          ,
          <volume>19 2</volume>
          (
          <issue>1993</issue>
          )
          <fpage>6</fpage>
          -
          <lpage>11</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>W.</given-names>
            <surname>Sharpe</surname>
          </string-name>
          ,
          <article-title>Capital asset prices: a theory of market equilibrium under condition of risk</article-title>
          ,
          <source>Journal of Finance</source>
          ,
          <volume>19</volume>
          (
          <year>1964</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>J.</given-names>
            <surname>Lintner</surname>
          </string-name>
          ,
          <article-title>The valuation of risk assets and the selection of risky investments in stock portfolios and capital budgets</article-title>
          ,
          <source>Review of Economics and Statistics</source>
          ,
          <volume>47</volume>
          (
          <year>1965</year>
          )
          <fpage>13</fpage>
          -
          <lpage>37</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>J.</given-names>
            <surname>Mossin</surname>
          </string-name>
          ,
          <article-title>Equilibrium in a capital asset market</article-title>
          ,
          <source>Econometrica</source>
          <volume>34</volume>
          (
          <year>1966</year>
          )
          <fpage>768</fpage>
          -
          <lpage>783</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>J.</given-names>
            <surname>Tobin</surname>
          </string-name>
          ,
          <article-title>Liquidity preference as behavior towards risk, The review of economic studies 25 (</article-title>
          <year>1958</year>
          )
          <fpage>65</fpage>
          -
          <lpage>86</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>F.</given-names>
            <surname>Black</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Litterman</surname>
          </string-name>
          ,
          <article-title>Global portfolio optimization</article-title>
          ,
          <source>Journal of Fixed Income</source>
          (
          <year>1991</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>F.</given-names>
            <surname>Black</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Litterman</surname>
          </string-name>
          , Global portfolio optimization,
          <source>Financial Analysts Journal</source>
          (
          <year>1992</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>J.</given-names>
            <surname>Walters</surname>
          </string-name>
          ,
          <article-title>The black-litterman model in detail (</article-title>
          <year>2011</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <surname>Satchell</surname>
            ,
            <given-names>Scowcroft,</given-names>
          </string-name>
          <article-title>A demystification of the black-litterman model: Managing quantitative and traditional portfolio construction</article-title>
          ,
          <source>The Journal of Asset Management</source>
          (
          <year>2000</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>A.</given-names>
            <surname>Meucci</surname>
          </string-name>
          ,
          <article-title>Beyond black-litterman in practice: A five-step recipe to input views on nonnormal markets</article-title>
          , Working paper (
          <year>2006</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>T.</given-names>
            <surname>Idzorek</surname>
          </string-name>
          ,
          <article-title>A step-by-step guide to the black-litterman model, incorporating user-specified confidence levels</article-title>
          , Working paper (
          <year>2005</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>W. F.</given-names>
            <surname>Sharpe</surname>
          </string-name>
          , Mutual fund performance,
          <source>The Journal of business 39</source>
          (
          <year>1966</year>
          )
          <fpage>119</fpage>
          -
          <lpage>138</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>W. F.</given-names>
            <surname>Sharpe</surname>
          </string-name>
          ,
          <article-title>The sharpe ratio</article-title>
          ,
          <source>Journal of portfolio management 21</source>
          (
          <year>1994</year>
          )
          <fpage>49</fpage>
          -
          <lpage>58</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <surname>A. D. Roy</surname>
          </string-name>
          ,
          <article-title>Safety first and the holding of assets, Econometrica: Journal of the econometric society (</article-title>
          <year>1952</year>
          )
          <fpage>431</fpage>
          -
          <lpage>449</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>J. L.</given-names>
            <surname>Treynor</surname>
          </string-name>
          ,
          <article-title>How to rate management of investment funds</article-title>
          ,
          <source>Harvard Business Review</source>
          <volume>43</volume>
          (
          <year>1965</year>
          )
          <fpage>63</fpage>
          -
          <lpage>75</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <given-names>L.</given-names>
            <surname>Sortino</surname>
          </string-name>
          ,
          <string-name>
            <surname>F.</surname>
          </string-name>
          <article-title>A. anf Price, Performance measurement in a downside risk framework</article-title>
          ,
          <source>Journal of Investing</source>
          <volume>3</volume>
          (
          <year>1994</year>
          )
          <fpage>59</fpage>
          -
          <lpage>64</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [18]
          <string-name>
            <given-names>T.</given-names>
            <surname>Bodnar</surname>
          </string-name>
          , T. Zabolotskyy,
          <article-title>Maximization of the sharpe ratio of an asset portfolio in the context of risk minimization</article-title>
          ,
          <source>Economic Annals-XXI</source>
          (
          <year>2013</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          [19]
          <string-name>
            <surname>M. C.</surname>
          </string-name>
          <article-title>Jensen, The performance of mutual funds in the period 1945-1964,</article-title>
          <source>The Journal of ifnance 23</source>
          (
          <year>1968</year>
          )
          <fpage>389</fpage>
          -
          <lpage>416</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          [20]
          <string-name>
            <given-names>B.</given-names>
            <surname>Cornell</surname>
          </string-name>
          ,
          <article-title>Asymmetric information and portfolio performance measurement</article-title>
          ,
          <source>Journal of Financial Economics</source>
          <volume>7</volume>
          (
          <year>1979</year>
          )
          <fpage>381</fpage>
          -
          <lpage>390</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          [21]
          <string-name>
            <given-names>T. E.</given-names>
            <surname>Copeland</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Mayers</surname>
          </string-name>
          ,
          <article-title>The value line enigma (1965-1978): A case study of performance evaluation issues</article-title>
          ,
          <source>Journal of Financial Economics</source>
          <volume>10</volume>
          (
          <year>1982</year>
          )
          <fpage>289</fpage>
          -
          <lpage>321</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>