Returns from neural network enhanced technical analysis indicator : A study on crude oil futures

Article history: Received 1 December 2016 Received in revised form 12 February 2017 Accepted 12 February 2017 This paper proposes the use of neural networks on moving average trading rules to enhance the returns on trading crude oil futures contracts in Chicago Merchantile Exchange and in Bursa Derivative Malaysia. The returns on the oil futures contract on crude light oil futures from 2/1/2004 to 31/12/2013 are compared and tested for significance against the threshold control of buy-and-hold. This paper reports significant the annual mean returns. The results show that it is significantly profitable to use neural networks on technical analysis to outperform the crude oil futures markets.


Introduction
*Mainstream academic research regards stock prices as random time sequences that contain noise (Fama, 1995).In contrast, market practitioners and proponents of technical analysis believe that past patterns and trends will be repeated in the future, and the skill and knowledge to identify these trends can be gainfully used to generate abnormal returns (Andrada-Felix and Fernández-Rodríguez, 2008).Technical analysis establishes specific trading rules using specific indicators such as moving average to decipher behavioral patterns out of time-series data (Gencay and Stengos, 1998).Gencay and Stengos (1998) found that the key advantage behind the moving average rule is that it provides a means of determining the general direction or trend of a market based on historical behavior of stock prices.The added advantage of the moving average rule is the ability to capture information in non-linear timeseries prices that are usually ignored by methods that assume linearity (Lee and Mathur, 1996).
Nevertheless, some researchers have also highlighted that the existence of such abnormal returns tend to diminish over time, especially so for the last decade (Olson, 2004).Hence, to outperform financial markets, increasingly sophisticated trading rules are required (Lee and Mathur, 1996;Olson, 2004) due to increasing efficient market conditions in established markets (Fama, 1995;Black, 1971).
There is evidence from the literature that suggest the existence of time-varying volatility in financial and economic time-series data (Andrada-Felix and Fernández-Rodríguez, 2008).Many have suggested that the volatility of time series in real financial markets is non-monotone and not invariant (Andrada-Felix and Fernández-Rodríguez, 2008;Bollerslev, 1990;Zhang, 2003) and that time-varying volatility has influenced optimal portfolio configurations (Pukthuanthong- Le et al., 2007).
In view of the above notions, artificial neural networks (ANN) are currently employed in finance especially in investigations of market behavior and forecasting financial time series (Vo et al., 2015;Atsalakis and Valavanis, 2009;Bahrammirzaee, 2010;Kaastra and Boyd, 1996;Gencay and Stengos, 1998).With the capability of ANN to establish complex relationships between training variables and targets, they improve the chances to predict highly complicated and volatile trends in the markets (Wang and Gupta, 2013), ANN outperforms common technical analysis indicators and traditional statistical methods and models (Fernández-Pérez et al., 2012).The main advantage of using neural networks is the ability to map any nonlinear function to recognize patterns, classification and forecasting (Kuan and White, 1994;Kaastra and Boyd, 1996).The most commonly used neural network model for financial forecasting is the back propagation neural network (Yao et al., 1999).
In the light of the criticism that technical trading techniques are still lacking in accounting for varying volatility clustering found in most financial timeseries data (Olson, 2004), this paper introduces a neural network enhanced moving average to decipher the varying trends in the market.NNeMA determines the weights of current close price and past smoothened 20-day moving average according to Eq. 1: Extending the research of Yao et al. (1999) that employs neural network to combine moving averages, this study investigates the viability of this method fast forward to current period.Different from Yao et al. (1999), this study employs 20 days moving averages alongside with the current close prices to generate abnormal returns.This approach is chosen based on recent findings that statistical learning methods have produced better out-ofsample results than most of the single and fixed moving average rules (Andrada-Felix and Fernández-Rodríguez, 2008).
Although technical analysis was originally developed for application in the stock markets trading, its advocates argue that the approach is applicable to other asset markets (Neely et al., 1997).Heeding on this notion, this paper applies a neural network enhanced technical analysis in the context of the oil commodity.The main rationale of applying the analysis on the oil market is due to the high volatility in its prices observed in recent years.Understanding the nature of the stochastic behavior of oil fluctuations is of crucial importance for policy and decision makers, not only at national level economies but also in financial markets (Cevik and Sedik, 2014;Nazlioglu et al. 2013).In view of these factors, this study arises to propose an innovated technical indicator model using neural network to investigate the behavior of crude light oil futures (FCLO) prices traded in Chicago Mercantile Exchange (CME); soybean oil futures (FSO) traded on CME; and crude palm oil futures (FCPO) traded on CME and Bursa Derivatives Malaysia (BDM), in an attempt to decipher trends in these financial markets.
The objectives of this paper are twofold.First, it aims to predict the future prices of FCLO, FSO and FCPO using the neural network enhanced moving averages (NNeMA); and second, to determine if the abnormal returns derived from using those predicted values are significant, based on simple technical trading rules.The contribution of this study is the evaluation of the efficacy of NNeMA to generate abnormal returns, and to provide evidence of the existence of market anomalies that would support the notion on the feasibility of gaining excess returns above the threshold buy-and-hold in the long run.
This paper is structured as follows: In the following section, data analysis of FCLO, FCPO and FSO, and the trading technique methods, concentrating on neural network of current close price and 20 days moving average (NNeMA) are discussed.Section 3 discusses the results and Section 4 concludes.

Materials and methods
In this section, the volatilities of the returns of the oil futures are investigated; where the daily close prices for CME's Crude Light Oil Futures (FCLO), CME's Soybean Oil Futures (FSO) and BMD's Crude Palm Oil Futures (FCPO) for the period 2/1/2004 to 31/12/2013 are used.The prices are collected from Bloomberg and are transformed into returns series using the natural log procedure as specified in Eq. 2: where, rt represents returns of FCLO, FCPO and FSO at period t, pt represents the close price at period t and pt-1 denotes the close price at period t-1.
The results, presented in Table 1, show that the average returns for all three tested series are between 0.03% to 0.04%.The skewness, kurtosis (from 5 to 7) and Jarque-Bera test results further validate that these series are non-normally distributed and display leptokurtic characteristics.The data analysis ascertains that volatilities in these oil futures prices appear in clusters, and therefore, require the estimation models to be dynamic in nature.These observations infer that the prices of these oil futures prices display dynamic variance characteristics.The presence of dynamically changing variance validates our research decision to use neural network to apportion different weights to the inputs, daily close prices and their 20 days moving averages.
The study tests if one or more of the technical trading rules could possibly be superior in producing greater returns than that of the passive buy-and-hold strategy.The following section summarizes the techniques used in the analysis, including that of the benchmark model, the passive buy-and-hold strategy.

Trading techniques
The trading techniques are chosen from the commonly used ones as benchmark in Brock et al. (1992), Lukac et al. (1988), Gencay and Stengos (1998) and Yao et al. (1999).The purpose of the moving averages tests used by Brock et al. (1992), Lukac et al. (1988) and Gencay and Stengos (1998) is to ascertain whether the application of fixed moving average trading rules is able to generate higher returns compared to the passive buy-and-hold strategy and, in particular, whether the Neural Network enhanced Moving Average (NNeMA) is able to outperform the most optimized moving average commonly used by Brock et al. (1992), Lukac et al. (1988) and the market practitioners and the neural network of close prices.The procedure is first, to find the most optimized moving averages for the three oil futures contracts; second, to generate forecast values using back propagation artificial neural network (ANN) from (i) input of close prices and (ii) inputs of close prices and their 20 days moving averages using Matlab; third, to generate appropriate trading signals using the forecasted output.The training period is from 2/1/2004 to 31/12/2009 while the validation period is from 2/1/2010 to 31/12/2011 and the out-of-sample period is from 2/1/2012 to 31/12/2013.A trading model should meet the following criteria to be considered robust and thus selected: (i) it should not produce huge losses or exhibit any net large losses in any of the years; (ii) the model should work well both in testing stage and in practice, and that it should adjust automatically to shifts in parameter; and (iii) it must produce abnormal returns even after accounting for transaction and slippage costs.
The following sections summarize the techniques used in the analysis, including that of the benchmark model, the passive buy-and-hold strategy.

Passive buy-and-hold strategy
The benchmark for any model is that the returns must surpass those of the passive strategy of buyand-hold (Fama, 1995).The excess return is termed as abnormal return.If the strategy can outperform the benchmark buy-and-hold for different periods of time, then the market prices are not random (Fama, 1995).

Optimal day simple moving averages (SMA) trading rule
Through a series of back tests run simultaneously on the three oil futures contracts, the most optimized moving average is determined and interestingly, the optimal length is the one most commonly used by market practitioners and by Brock et al. (1992), which is the simple 20-day simple moving average (SMA).Brock et al. (1992) referred to this SMA as SMA (C,20,0%), where C represents the closing price, 20 is computation of 20-periods moving average, and 0 refers to 0% from the simple moving average.For this paper, we back test the moving averages from 2 to 200 days for all the three oil futures and find that the most optimal moving average for all these three oil futures contract is indeed 20 days.The moving average is computed using Eq.3: where, SMA is the simple moving average, n is 20day moving-average length, and Ct is the closing price at period t.If Ct >SMAnt, then the trading strategy is to buy, otherwise, the strategy is to sell.

ANN Model using closing prices only
The second method is to use the closing prices as input into a simple one hidden layer with one hidden neuron back propagation neural network model to produce predicted prices for the next period as output.The back propagation neural network employs a training process of error back propagation which uses recursive gradient descent method that minimizes the sum of squared errors of the system by moving down the gradient error curve (Fernández-Rodríguez et al., 2000).Error back propagation makes it possible to approximate nonlinear functions.The training continues until generalization stops improving by an increase in normalized mean square error of the validation sample.The values of the weights are determined by an iterative learning process and their transformation at each successive layer is determined by a specific transfer function.As for the transformation functions, F is a logarithmic function and G is a hyperbolic tangent function (Eq.4): In this simulation, the close prices are first fed into a one-layer, one-period delay configuration neural network model.The resulting outputs are used in the trading strategy to determine the trading signal by comparing the predicted output for the next period with the actual current closing price.If the predicted output for the next period is higher than the current closing price, the signal will be processed as a buy long.The objective of this exercise is to determine whether the abnormal return from utilizing the forecast of next period's price is significantly higher than the passive buyand-hold control.If ĉt+1 > Ct, where, ĉt+1 is the predicted closing price output for the next period, and Ct is the current closing price, the trading strategy is to buy, and if otherwise, the strategy is to sell.

ANN Model using Close Prices and their 20 days moving averages
The third method is to use the close prices and their 20 days moving averages as inputs into the back propagation neural network model, using recursive gradient descent to minimize the sum of square errors to produce predicted price for the next period as output.In this simulation, the close prices and their 20 days moving averages are fed into a one-layer, one-period delay configuration neural network model.The trained neural network model that has the least NMSE between the outputs and the actual close prices in the out-of-sample period is selected for use to predict future direction.Finally, the resulting outputs are used to determine the trading signal by comparing the predicted output for the next period with the actual current closing price.If the predicted output for the next period is higher than the current close price, the signal will be to buy long.If ĉt+1 > Ct, where, ĉt+1 is the predicted close price output for the next period, and Ct is the current close price, then the trading strategy is to buy, otherwise, the course of action is to sell.

Ten-neuron ANN Model using Closing Prices only
We replicate the one-neuron ANN model using closing prices with multiple neurons, from two to fifteen neurons.The trained neural network model with ten neurons has the least normalized mean square error (NMSE) between the outputs and the actual close prices in the out-of-sample period.This ten-neuron neural network model is thus selected for use to predict future direction.According to Yao et al. (1999), a prediction that closely follows the trend of the actual target would result in a low NMSE.Thus, we use ten-neuron ANN Model to predict the next period's price.The resulting outputs are then used in the same trading strategy to determine the trading signal by comparing the predicted output for the next period with the actual current closing price.If the predicted output for the next period is higher than the current closing price, the signal will be processed as a buy long strategy.Otherwise, the strategy is to sell short.

Ten-neuron ANN Model using close prices and their 20 Days moving averages
The final method is to replicate the ten-neuron NNeMA with the closing prices and 20-day moving averages as inputs into the back propagation neural network model, using 10-neurons to generate the predicted prices for the next period as outputs.We ran tests from one to 15 neurons.Interestingly, 10neurons ANN model is selected in accordance with the earlier tests to employ the model with the least NMSE.A similar trading strategy of processing a buy long signal is applied if the predicted output for the next day is higher than the current close price.Otherwise, the strategy is to sell short.

Results and discussion
In this section, performances of the four trading models are evaluated against those of the passive buy-and-hold control strategy.The results show abnormal returns of the four trading systems are above that of passive buy-and-hold (BH) even after taking into consideration transaction costs.The results also show how the 10-neurons NNeMA20 model outperforms the other tested trading systems.It is noted in studies (Park and Irwin, 2009) and in real life trading that transaction costs account for a chunk of the trading losses and thus, it would unrealistic if transaction costs are not included in this study.The transaction costs are converted into the nearest index point(s) to account for brokerage commission including exchange and clearing fees as well as slippage.The mean returns (in average percentage per year) are produced in Tables 2, 3, and 4 respectively after deducting for the number of transactions generated by the trading systems.Even after taking into account the hefty transaction costs, the trading results do not differ much from the original results.Even after taking into consideration the transaction costs, the returns for all the NNclose and NNeMA for FCLO, FCO and FCPO are much larger than the passive buy-and-hold control strategy as shown in Table 5.Similar findings by Lukac et al. (1988), Brock et al. (1992) and Park and Irwin (2009) support the results.To compare the five models, the base prices of $33.00 for FCLO, $27.76 for FSO and RM1766 for FCPO as of at 2/1/2004 are used.The net percentage returns after transaction costs are computed by taking the gains as percentages of the base prices.Table 6 depicts the net percentage returns after transaction costs.The moving averages, neural network close outputs and neural network enhanced moving average all generate significantly higher returns than the passive control strategy of buy and hold for all these futures.Fig. 1 shows the NNeMA20 and FCLO prices over the last ten years, while Fig. 2 and Fig. 3 show the relationships between NNeMA20 and FCPO and FSO respectively.
This indicates that NNClose and NNeMA20 are robust trading models and can be used for all these markets.Both NNClose and NNeMA20 can be taken into consideration as viable trading models for the professional model trading desk of financial institutions.
The results from this study are consistent with those of Brock et al. (1992), Gencay (1998), Lukac et al. (1988), Park and Irwin (2009) and Szakmary et al. (2010) supporting the hypothesized ability of most technical indicators to make excessive return higher than the buy and hold strategy, even after transaction costs are taken into account (Brock et al., 1992, Park andIrwin, 2009).
From Table 6, it is observed that for this period of study from 2/1/2004 to 31/12/2013, 10 neurons NNeMA consistently outperform the buy-and-hold.Overall across all the different markets, 10 neurons NNeMA demonstrates the best result that the highest average return of 1,058% above the buy-and-hold's return, outperforming its nearest rival, 1 neuron NNClose by margin of 180%.This is consistent with the findings by Olson (2004) that the excessive returns of yesteryears from conventional technical trading rules like moving average tend to diminish over time and new adjustable trading systems are required.

Conclusion
From the statistical data descriptive, these oils' returns seem to follow similar properties to financial returns; that is, they are non-normal, with excess kurtosis and skewness.The results show that all the trading models are able to outperform the passive buy-and-hold strategy.This is consistent with the studies conducted by Lukac et al. (1988), Brock et al. (1992), andAndrada-Felix andFernández-Rodríguez (2008).While simple moving-average rules have outdone the other technical models ex-post, ex-ante it is extremely difficult to estimate accurately the optimal lengths to be deployed.This research introduces an algorithm trading system (NNeMA20) to high frequency traders in model trading desks worldwide.We compare NNeMA20 along with the other 3 technical trading models (MA and ANN of Closing Prices) with the passive buy-and-hold strategy With artificial intelligent algorithms, neural can the behaviour of the market, whether it is trending or ranging, and adjust the algorithms automatically according to the prevailing market condition.The main drawback that we found in this research as Kaastra and Boyd (1996) have noted is the large number of combinations of inputs and neurons and deciding on the appropriate network paradigm still involves much trial and error.Having said that, despite good preliminary results, future research can explore and find better fit for these and other world commodities with use of neural network enhanced methods like wavelets.

Fig. 1 :Fig. 2 :Fig. 3 :
Fig. 1: FCLO daily closes, MA20, 1 hidden neuron NNClose, 10 neurons NNClose and 1 neuron NNeMA20 and 10 neurons NNeMA for the out of sample period from 3/1/2012 to 31/12/2013 . The ten neurons NNClose and NNeMA have better ability to adjust quickly and they are robust in different markets and across different time frames.The ability of 10 neurons NNeMA20 to adjust according to the prevailing market condition, points a new direction for research in incremental machine learning trading systems.New adaptive new trading neurons NNeMA20 can be applied immediately on any professional model trading desk.

Table 1 :
Statistical properties of the FCLO, FCPO and FSO