Optimizing the Performance of the Fractal Adaptive Moving Average Strategy: The Case of EUR/USD

Most technical analysis tools focus traditionally on the simple and exponential moving average technique. This study looks at the performance of an optimized fractal adaptive moving average strategy over different frequency intervals, where the Euro/US Dollar currency pair is analyzed due to the increased correlation between the Euro Index and EUR/USD, and the Dollar Index and EUR/USD over the last year compared to the last 15 years. The optimized strategy is evaluated against a buy-and-hold strategy over the 20002015 period, using annualized returns, annualized risk and Sharpe performance measure. Due to the existence of different number of long and short trades in every trading scenario, this paper proposes the use of a new measure called the Sharpe/Total trades ratio which takes into account the number of trades when evaluating the different trading strategies. Findings strongly support the use of the adaptive fractal moving average model over the naïve buy-and-hold strategy where the former yielded higher annualized returns, lower annualized risk, a higher Sharpe value, although it was subject to more trades than the buy-and-hold strategy. The best market timing strategy occurred when using 131 daily fractal data with a Sharpe/Total trades ratio of 0.31%.


Introduction
Most if not all decisions made in financial markets by investors have considered the use of techniques like fundamental analysis and technical analysis, whether the period of investing is for a short time or long period, or whether it is an active or passive trading strategy.For instance, Dimson et al. (2002) showed that many global asset classes in the twentieth century produced spectacular gains in wealth for individuals who bought and held those assets for generation-long holding periods, but the assets also went through regular and painful drawdowns like 2008.All of the G-7 countries have experienced at least one period where stocks lost 75% of their value.Conversely, Faber (2013) found that, using an out-sampling testing comparison between a timing model and a buy-and-hold strategy from 2006-2012, the timing strategy beat the buy and hold by over two percentage points per year, with much less volatility and most importantly to many investors, lower drawdowns.Taylor and Allen (2002), after conducting a survey with chief foreign exchange dealers in the UK, found that 90 percent of respondents placed some weight on technical analysis, with a skew towards relying on technical analysis as opposed to fundamental analysis.Similarly, Lui and Mole (1998), after conducting a survey with foreign dealers in Hong Kong, found that technical analysis is considered slightly more useful in forecasting trends than fundamental analysis, but significantly more useful in predicting turning points.More importantly, moving average (MA) and/or other trend-following systems are the most useful technical technique.One of the main reasons such tools are used widely is due to the fact that people adjust less by staying close to their anchors (here being the investment tools they used more frequently) as proposed in Epley and Gilovich (2006), where they confirmed that adjustment to other techniques is indeed an effortful operation.
While existing literature about the success of trend following systems is abundant, Zweig and Goldfischer (1986) and Hayes (2000) provide a good review of pioneer systems like the Dow Theory, which upon which today's Dow Jones Industrial Average is based from.The existence of technical analysis based systems, with particular reference to the moving average, can be traced back to Tintner (1935) and Cowles (1933).Perhaps the most cited long term measurement of trend among technical analysts is the 200 day MA.Spiegel (2013), using a percentage price oscillator approach with 1% up and down variation, testing the long run MA on the Dow Jones Industrial Average (DJIA) over the 1886-2006 period, and found the market timing strategy to outperform a buy-and-hold strategy.Similar results were held for the Nasdaq Composite Index.Overall, the uses of the MA technique resulted in annual excess return of 4% (adjusted for transaction costs) with 25% less volatility, when comparing the market timing and buy and hold strategies.Using a similar approach, Faber (2013) tested the a 10 month MA for the S&P500 market index over the 1901-2012 period and found the market timing strategy to outperform a buy-and-hold of the index in terms of returns, volatility and Sharpe performance measurements.The use of the MA strategy had fewer instances of both large gains and large losses, with correspondingly higher occurrences of small gains and losses.Basically, the technical analysis tool signaled when an investor should be long a riskier asset class (equity) with upside potentials, and when to be out and sitting in cash (lower risk asset class).Alternatively stated, the MA strategy avoids the far left tail of big losses while sacrificing the far right tail of big gains.
A popular use for moving averages is to develop simple trading systems based on moving average crossovers.A trading system using two moving averages would give a buy signal when the shorter (faster) moving average advances above the longer (slower) moving average.A sell signal would be given when the shorter moving average crosses below the longer moving average.The speed of the systems and the number of signals generated will depend on the length of the moving averages.Shorter moving average systems will be faster, generate more signals and be more prone for early entry.However, they will also generate more false signals than systems with longer moving averages.Gurrib (2015) optimized a simple moving average strategy using daily ETF funds data against a simple buy and hold strategy, and find higher absolute returns and risk for the buy-and-hold strategy, particularly during correction waves of the last fifteen years.While the optimized double cross over strategy resulted in a relatively lower risk and returns, the market timing strategy still outperformed the naïve buy-and-hold strategy, with a relatively higher Sharpe performance measure.Although Todea and Zoicas-Ienciu (2011) finds consistent positive returns when using the moving average crossover strategy, the study did not adjust for risk.While Kaufman and Chaikin (1991) find several price-volume crossover patterns to be significant in forecasting stock or commodity prices, Anghel (2013) finds the moving crossover strategy to produce consistent excess returns and lower risk when compared with a buy-and-hold strategy for companies on the Bucharest Stock Exchange.This paper adds further contribution to the existing literature, by not only testing for the fractal adaptive moving average using a price crossover strategy, but also robust testing its performance over different time intervals, and comparing the results with a naïve buy-and-hold strategy.This paper is the first one to introduce a performance measure which accounts for the number of trades in a strategy due to the fact that different strategy might end up with different number of long and short trades.The aim of this paper is to test the use of an optimized fractal adaptive moving average crossover trading strategy for the Euro/ US dollar currency pair, and whether it outperform the naïve buy-and-hold strategy.The rest of the paper provides some background to the study, lays the framework on the data and research methodology, conducts the analysis, before ending with some conclusive remarks.

Literature Review
While the concept of fractured dimensions was emphasized in Mandelbrot (1967) where he initiated the coastline paradox, its applications range from characterizing turbulence (Mandelbrot, 1982), urban growth (Chen, 2011), human physiology (King et al., 2009) medicine (Losa, 2006) and more importantly in our case, market trends (Peters, 1991;Mandelbrot, 2004).Mandelbrot (1967) suggests that the smaller the increment of measurement, the longer the measured length becomes such that if one were to measure a stretch of coastline with a yardstick, one would get a shorter result than if the same stretch were measured with a one-foot ruler.This is due to the fact that one would be laying the ruler along a more curvilinear route than that followed by the yardstick.The empirical evidence suggests a rule which that the measured length increases without limit as the measurement scale decreases towards zero.Essentially, he used Richardson's law that the measured length of various geographic borders was a function of the measurement a scale G which is raised to the power of 1-D, where D is the dimension of the coastline, for instance.Applied in the context of financial market prices, if a stock price series looks smooth, it should have a dimension close to 1, and the more volatile the stock prices, the closer the dimension is to 2. In short, the fractal dimension D is a measure of how completely a fractal appears to fill space as one zooms in, where the fractal is a fragmented shape that can be split into parts, which is at least similar to a reduced size of the original.The fractal dimension provides a statistical index of complexity comparing how detail in a pattern changes with the scale at which it is measured.The feature of self-similarity defines a fractal shape and is well existent in financial markets, where one can easily be misguided by the similarity that exists in price movements across different time frames.Similarly, various finance theories such as the stochastic Wiener process which charts Brownian motion-used in the Black Scholes Option Pricing Model, are backed by the concept of fractals.
Using the concept of fractal dimension, Ehlers (2010) developed a method of identifying the D for stocks, simply by averaging the measured fractal dimension over different scales.The fractal dimension is then adopted into the Fractal Adaptive Moving Average (FRAMA) model.Traditionally, the dimension of a shape is uncovered by covering the shape with a number of similar small objects that are various sizes and comparing how many of each fit across the surface.For instance, if a square is broken into 25 similar sub squares then a magnification factor of 5 is needed to reveal the original shape, such that a square can be broken into N2 self-similar copies and to reveal the original shape, a magnification factor of N is needed.Similarly, a line segment can be broken down into N self-similar parts and a magnification factor of N will reveal the original shape.Alternatively stated, the dimension of an object is the exponential of the number of self-similar pieces with a magnification factor of N which a shape can be fragmented into.Due to the fact that prices on a stock chart are homogeneously spaced, Ehlers (2010) used the average slope of the price curve as an estimation of the number of self-similar pieces, and is calculated as follows: where, for the 1 st half of the period under analysis; for the 2 nd half of the period under analysis; for the whole the period under analysis.
N is the period under analysis and D is the dimension value.The lower the dimension value, the closer the price graph is to a straight line, suggesting strong trend presence.Alternatively, higher values of D suggest more complex fractals which are usually witnessed in volatility geared markets.As part of adding value to the traditional exponential moving average (EMA) method, Ehlers (2010) made use of the dynamic D to adjust the alpha of the EMA such that there is a quicker reaction in a trending market and a conversely slower reaction time to more volatile markets where traditional moving average techniques results usually in lots of whipsawed trades.The FRAMA model is provided as follows: (2) where α= e W(D-1) .The FRAMA model is similar to the EMA model, except for the fact that α adapts to dynamic, by continuously adapting to changes in the fractal dimensions.It is important to note that Ehlers (2010) set the W value to be -4.6 under the assumptions that the FRAMA moves between a fast moving average of 1 day and a slow moving average of 198 days.The value of FRAMA t-1 is set to the closing price initially.The higher the value of D, the slower the EMA (higher N value) and the lower the D, the faster the EMA (lower N value).The lower the D, the closer the stock chart is to a straight line and the stronger the trend.Higher D values tend to support charts operating within channels.Alternatively stated, the smoothing factor, α, which is used like in the EMA series is lower when D is higher and vice versa, meaning that a higher D results in a lower weighting factor of the last price in the EMA series, such that N tends to be large and the EMA resulting in a slow EMA.

Data Assumptions
All entry and exit prices are on the day of the signal at the close.
The frequency of data is set to minute wise, hourly, daily, weekly and monthly.
The effect of discounts due to bulk trading and taxes are ignored.
All orders occur at market prices.Limit and stop order options are not allowed at this stage.
Annualized return and annualized standard deviation of daily returns would be used as measurements of risk and return.The Sharpe ratio would then be used to compare the performance of the fractal based strategy with the buy-and-hold strategy.Due different strategies yielding different number of long and short trades, and the fact that their Sharpe values are compared for selection purposes, this study proposes the use of a new ratio which will allow for better comparisons among the different trading strategies as follows: The Sharpe to Total Trades ratio adjusts for the number of total trades, and does not discriminate between long and short trades since both would usually have the same trading costs.A higher value of the ratio suggests comparatively a better trading strategy when comparing excess return, risk and number of trades.In regards to Assumption 3, Wilcox and Crittenden (2005) argue that trend following systems still work well in the equities market after adjusting for taxes.Further, it is expected in this current paper, that any optimized strategy based on moving averages of shorter durations would result in more trading transactions, creating sufficient losses for the investor to benefit from during taxation times.Further, more transactions would result in more discounts from the trading platforms offered by brokers.Assumption 4 is maintained at this stage to prevent any subjectivity from the trader's beliefs what about are the boundaries of prices that could be entered as limit or stop orders.The time window under analysis is set from 4th January 2000 till the 25th June 2015.FXCM trading station is used to obtain the daily, minute wise, weekly, monthly data.

Research Findings
The currency index depicts the evolution of a currency relative to the entire forex where the index of the currencies is a simple arithmetic average of the variation in each pair.While a currency pair, say the EUR/USD, is trending when the value of one of the two currencies increases by reference to the other, the most interesting trend is when the Euro (EUR) and the Dollar (USD) are in opposing trends such that the movement of the EUR/USD is the result of the combined variation of the two currencies.An index value of 100 is set at the start of the period under consideration.For consistency purposes, the Japanese yen, British pound and Swiss Francs are used against the US dollar and Euro in the calculation of both the Dollar and Euro Index.Figure 1 shows the performance of the EUR/USD, the Dollar and Euro indices for the period January 2000-June 2015.While the EUR/USD had a closing value of 1.02469 at the beginning of the period and a value 1.12064 at the end, its value trended upwards to reach a maximum of 1.59918 in April 2008, before generally experiencing lower highs to reach a low value of 1.12064 by the 25th June 2015.Noticeably, the EUR/USD has been falling constantly around May 2014, attributable mostly to a stronger Dollar index, accompanied by a Euro currency dropping in value against other major global currencies.Although not reported here, the correlation coefficient between the EUR/USD and the Dollar Index for the last 15 years, using daily data, was -0.94, compared to a value of 0.88 for the EUR/USD and the Euro Index, showing the dollar had a stronger negative relationship on the currency pair.
Those relationships became stronger when looking at the correlation between the three variables for the May 2014-June 2015 period.While the Dollar Index had a strong correlation value of -0.97 against the EUR/USD, the Euro Index had a strong positive correlation value of 0.95 against the EUR/USD.The correlation between the Dollar Index and Euro Index changed from -0.70 for the last 15 years to -0.85 over the last year, suggesting the EUR/USD is more affected by both currencies than before.Due to the coverage of various moving average (MA) techniques in existing literature, and with various studies having mixed findings regarding their superiority among each other, it important to start the analysis by carrying out a simple correlation analysis over different time frames, over different moving averages, with different data ranging from opening, high, low to closing values of the EUR/USD.Gurrib (2015) provides a good overview of the importance of changing the number of periods in the models whereby increasing the number of periods results in the latest data added in the calculation in having a subdued effect on the moving average calculation.This would result in greater smoothing of the moving average data series.A 1 day MA would almost faultlessly reflect the more volatile and everyday currency pair value while a longer period MA, say 100, would be flatter and indicate a long-run and more stable state.While the number of periods is important, the frequency in the data interval is also critical in determining the behavior of the MA dataset, whether the interval is daily, weekly, monthly or quarterly.Gurrib (2015) found that a daily MA tracks the currency pair values more closely, compared to a higher data interval like the monthly or quarterly series, where the quarterly interval MA series is less prone to the daily fluctuations of the prices resulting in a smoother MA series.
For the purpose of this study, the simple moving average (SMA) and exponential moving average (EMA), which are the most commonly covered moving averages in existing literature, are analysed together with the fractal adaptive moving average (FRAMA).The Open, High, Low, and Close (OHLC) values of the EUR/USD are used over the minute wise, daily, weekly, and monthly frequencies.Lag periods of 10, 100 and 200 are selected to provide an overview of the change in Pearson product-moment correlation coefficient values over different frequency intervals over a set time period.Results suggest an EMA model with a lag period of 10 is superior to the SMA and FRAMA for all the OHLC values.As the frequency interval is increased to monthly, correlation values drop.Importantly, correlations between EMA and OHLC are nearing zero values at higher frequency intervals, and correlations between SMA and OHLC turned negative at higher intervals.For the monthly data, only SMA is calculated from 2009 due to time frame under analysis.As part of the selection process, minute wise data is discarded for later analysis due to high correlation values among all variables.Further, although open prices have the highest correlations with FRAMA models, closing prices are used to be consistent with the use of the closing price in the FRAMA model.Daily frequency is used henceforth since they reflect less noise in the correlations when the frequency interval changes across different lag periods.
As part of the initial process towards a robust trading strategy, the FRAMA model is tested over the three respective lag periods used in the initial part of the study, i.e. 10, 100, 200 days.The annualized return and annualized risk are calculated, followed by the Sharpe performance measure.The risk free rate is based on a 30 year Treasury bond yield at 4.42% p.a.The return over the whole period and the number of short and long trades are also calculated.On any given day, if the value of /   is greater than the value of   , and the value of /  −1 is less than the value of  −1 , a buy (long) trade is initiated.Similarly, if the value of /   is less than the value of   , and the value of /  −1 is greater than the value of  −1 , a sell (short) trade is initiated.If none of these conditions are met, the previous day trading strategy (long or short) is held.Findings are reported in Table 1.Findings tend to support that the shorter the lag period under consideration, the lesser the number of trades.However, the annualized return was the highest with the longest lag period of 200 although all of the annualized returns were valued around 24%. Annualized risk was stable under all three scenarios around 11%.With the highest annualized return and stable risk, the Sharpe performance measure was the highest for the longest lag period used among the three.However, due to the small incremental increase in the return for the 200 period case, it is important to investigate further lag period to detect any possible change in the trend of the return over different lag periods since the use of a longer lag period reduces the availability of data within a specific time frame analysis.This will also shed further light if the number of extra trades can be justified for such an incremental return.
Trading strategies with lag intervals of 25, 50, 75, 125, 150 and 175 are also tested to shed further light on any such possible relationship between annualized return and lag period under the FRAMA model.
As the lag period is increased from 10 to 200, the annualized return increases by a small increment of 0.5% overall.
The annualized risk still remained stable over the other different lag periods, resulting in a higher Sharpe value when using the longest lag period in the trading strategy.The number of trades tends to increase in a similar fashion as the annualized return, with an additional 70 trades when using the 200 days FRAMA model compared to the 10 days FRAMA model.Noticeably too, the number of trades dropped to 303 long and 302 short trades when using the 125 lag period, accompanied with a Sharpe measure of 1.781 and annualized return of 24.6%.Due to the fall in the annualized risk from 11.4% to 11.3% when comparing lag periods 75,100 and 125, it is interesting to investigate if the drop persists at other lag periods between 125 and 150, while sustaining the relatively high return of 24.6%.
Due to the fact the annualized returns and total number of trades can be two distinct decision making factors, the use of a relative ratio between them allows the comparison which model has a relatively higher annualized return to trade value.In a similar fashion, since the Sharpe measure takes into account both the risk and return factors, the Sharpe to Total Trades ratio as per equation ( 1) is used to allow for comparison between the model having different Sharpe values relative to the total number of trades.The annualized return/ total trades and Sharpe/total trades ratios reported higher values when using the 135 lag period model.While the Annualized return/ total trades increased from 0.041% to 0.042%, together with an increase in the Sharpe measurement value from 0.297% to 0.3%, it is important to acknowledge a drop in the number of trades on both the long and short sides, when comparing the 130 lag model to the 135 counterpart.As part of robust testing, lag periods between 130-137 are tested in regards to the total number of trades, annualized risk and returns, Annualized return/ total trades and the Sharpe/total trades values.Figure 2 provides a graphical representation of the results.Findings tend to support the optimal lag number occurs when using the 131 day FRAMA model, with 291 long and 292 short trades over the January 2000 to June 2015 period.While the annualized return was not the highest among all, the annualized return/ total trades, which factors in the total number of trades, resulted in 0.042%.Similarly, the Sharpe/total trades ratio was the highest at 0.305%.The declining trend in the Sharpe/total trades values as the lag period is increased can be attributed to higher number of trades, accompanied with relatively similar annualized risk and returns.A comparison with a naïve buy and hold strategy over the 15 year period, would have resulted in an annualized return of 0.84% p.a. and an annualized risk of 12.34%.In both instances, the fractal adaptive based model yielded a higher annualized return of 24.53% and a lower annualized risk 11.32%.Assuming that a naïve buy and hold strategy is based on a long and a short trade, the Sharpe/Total trades ratio would have been -14.5% compared with the optimized FRAMA model yielding 0.305%.

Conclusive Remarks
The emergence of behavioral finance can be explained through many facets, including the use of technical analysis techniques such as the moving average.The use of historical representations during the time in which investors make decisions, whether informed or not, whether short run or long run remains valid.This paper adds to the existing literature by demonstrating that a moving average technique based on adaptive fractals can yield superior annualized returns, lower annualized risk, and a relatively higher Sharpe ratio.The paper sets the tone initially by comparing the strength of the relationship between the FRAMA model with open, high, low and closing values of the EUR/USD currency pair, compared with the widely used EMA and SMA model.Minute-wise, daily, weekly and monthly data are tested and the FRAMA model tends to hold a leading hand particularly for the closing EUR/USD values under the daily frequency interval.This paper also introduces the Sharpe to Total Trades ratio which takes into account the fact that different trading strategies are compared while having different number of long and short transactions.The Sharpe to Total Trades ratio extends on the existing Sharpe measure by adjusting it to the number of total trades.The optimized FRAMA model in the study is based on daily data using 131 lags.The annualized return of the market timing strategy yielded 24.53%, an annualized risk of 11.32%, a total number of 583 trades, and a Sharpe/total trades value of 0.305% compared with a buy-and-hold strategy which yielded a negative Sharpe/total trades value of -14.5%.One important area of future research would be to relax the assumption that the fractal adaptive moving average model moves between a fast moving average of 1 day and a slow moving average of 198 days, and as such test other daily boundaries.

Figure 1 .
Figure 1.Performance of the EUR/USD, Dollar index and Euro index Note.Figure 1 shows the performance of the Euro/USD, the dollar index and Euro index during 2000-2015.

Figure 2 .
Figure 2. Optimized FRAMA model Note. Figure 2 shows the Number of long and short trades, and the Sharpe/total trades ratio of the optimized FRAMA model.

Table 1 .
Risk and return for FRAMA models with lag periods of 10, 100 and 200 Table1shows the risk and return profiles for the FRAMA model under different lag periods of 10, 100 and 200 days.