research article generating moving average trading rules...

11
Research Article Generating Moving Average Trading Rules on the Oil Futures Market with Genetic Algorithms Lijun Wang, 1,2 Haizhong An, 1,2,3 Xiaohua Xia, 4 Xiaojia Liu, 1,2 Xiaoqi Sun, 1,2 and Xuan Huang 1,2 1 School of Humanities and Economic Management, China University of Geosciences, Beijing 100083, China 2 Key Laboratory of Carrying Capacity Assessment for Resource and Environment, Ministry of Land and Resources, Beijing 100083, China 3 Lab of Resources and Environmental Management, China University of Geosciences, Beijing 100083, China 4 Institute of China’s Economic Reform and Development, Renmin University of China, Beijing 100872, China Correspondence should be addressed to Haizhong An; [email protected] Received 19 February 2014; Revised 4 May 2014; Accepted 7 May 2014; Published 26 May 2014 Academic Editor: Wei Chen Copyright © 2014 Lijun Wang et al. is is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. e crude oil futures market plays a critical role in energy finance. To gain greater investment return, scholars and traders use technical indicators when selecting trading strategies in oil futures market. In this paper, the authors used moving average prices of oil futures with genetic algorithms to generate profitable trading rules. We defined individuals with different combinations of period lengths and calculation methods as moving average trading rules and used genetic algorithms to search for the suitable lengths of moving average periods and the appropriate calculation methods. e authors used daily crude oil prices of NYMEX futures from 1983 to 2013 to evaluate and select moving average rules. We compared the generated trading rules with the buy-and-hold (BH) strategy to determine whether generated moving average trading rules can obtain excess returns in the crude oil futures market. rough 420 experiments, we determine that the generated trading rules help traders make profits when there are obvious price fluctuations. Generated trading rules can realize excess returns when price falls and experiences significant fluctuations, while BH strategy is better when price increases or is smooth with few fluctuations. e results can help traders choose better strategies in different circumstances. 1. Introduction Energy is vital for economic development. Household activ- ities, industrial production, and infrastructure investments all consume energy directly or indirectly, no matter in developing or developed countries [1]. Issues pertaining to energy trade [2], energy efficiency [3], energy policy [46], energy consumption [7], and energy finance [8] have received more importance in recent years. Crude oil futures market is a crucial part of energy finance within the scope of the global energy market. Traders and researchers employ technical analysis tools to identify gainful trading rules in financial markets. Accordingly, moving average indicators are commonly used in technical analysis to actualize greater returns. is paper attempts to answer whether in real life an investor can use moving average technical trading rules to obtain excess returns through searching for profitable moving average trading rules with genetic algorithms in the crude oil futures market. Genetic algorithms are widely used in social sciences [9, 10], especially in certain complex issues where it is difficult to conduct precise calculations. It is a trend to apply physical or mathematical methods in energy and resource economics [1116]. Researchers have applied genetic algorithms to the prediction of coal production-environmental pollution [17], the internal selection and market selection behavior in the market [18], the crude oil demand forecast [19], the mini- mization of fuel costs and gaseous emissions of electric power generation [20], and the Forex trading system [21]. With respect to the financial technical analysis issues, scholars use Hindawi Publishing Corporation Mathematical Problems in Engineering Volume 2014, Article ID 101808, 10 pages http://dx.doi.org/10.1155/2014/101808

Upload: others

Post on 06-Mar-2020

20 views

Category:

Documents


0 download

TRANSCRIPT

Research ArticleGenerating Moving Average Trading Rules on the Oil FuturesMarket with Genetic Algorithms

Lijun Wang12 Haizhong An123 Xiaohua Xia4 Xiaojia Liu12

Xiaoqi Sun12 and Xuan Huang12

1 School of Humanities and Economic Management China University of Geosciences Beijing 100083 China2 Key Laboratory of Carrying Capacity Assessment for Resource and Environment Ministry of Land and ResourcesBeijing 100083 China

3 Lab of Resources and Environmental Management China University of Geosciences Beijing 100083 China4 Institute of Chinarsquos Economic Reform and Development Renmin University of China Beijing 100872 China

Correspondence should be addressed to Haizhong An ahz369163com

Received 19 February 2014 Revised 4 May 2014 Accepted 7 May 2014 Published 26 May 2014

Academic Editor Wei Chen

Copyright copy 2014 Lijun Wang et al This is an open access article distributed under the Creative Commons Attribution Licensewhich permits unrestricted use distribution and reproduction in any medium provided the original work is properly cited

The crude oil futures market plays a critical role in energy finance To gain greater investment return scholars and traders usetechnical indicators when selecting trading strategies in oil futures market In this paper the authors used moving average prices ofoil futures with genetic algorithms to generate profitable trading rulesWe defined individuals with different combinations of periodlengths and calculation methods as moving average trading rules and used genetic algorithms to search for the suitable lengths ofmoving average periods and the appropriate calculation methods The authors used daily crude oil prices of NYMEX futures from1983 to 2013 to evaluate and select moving average rules We compared the generated trading rules with the buy-and-hold (BH)strategy to determine whether generated moving average trading rules can obtain excess returns in the crude oil futures marketThrough 420 experiments we determine that the generated trading rules help traders make profits when there are obvious pricefluctuations Generated trading rules can realize excess returns when price falls and experiences significant fluctuations while BHstrategy is better when price increases or is smooth with few fluctuations The results can help traders choose better strategies indifferent circumstances

1 Introduction

Energy is vital for economic development Household activ-ities industrial production and infrastructure investmentsall consume energy directly or indirectly no matter indeveloping or developed countries [1] Issues pertaining toenergy trade [2] energy efficiency [3] energy policy [4ndash6] energy consumption [7] and energy finance [8] havereceived more importance in recent years Crude oil futuresmarket is a crucial part of energy finance within the scopeof the global energy market Traders and researchers employtechnical analysis tools to identify gainful trading rules infinancial markets Accordingly moving average indicatorsare commonly used in technical analysis to actualize greaterreturns This paper attempts to answer whether in real life

an investor can use moving average technical trading rules toobtain excess returns through searching for profitablemovingaverage trading rules with genetic algorithms in the crude oilfutures market

Genetic algorithms are widely used in social sciences[9 10] especially in certain complex issues where it is difficultto conduct precise calculations It is a trend to apply physicalor mathematical methods in energy and resource economics[11ndash16] Researchers have applied genetic algorithms to theprediction of coal production-environmental pollution [17]the internal selection and market selection behavior in themarket [18] the crude oil demand forecast [19] the mini-mization of fuel costs and gaseous emissions of electric powergeneration [20] and the Forex trading system [21] Withrespect to the financial technical analysis issues scholars use

Hindawi Publishing CorporationMathematical Problems in EngineeringVolume 2014 Article ID 101808 10 pageshttpdxdoiorg1011552014101808

2 Mathematical Problems in Engineering

genetic algorithms to search best trading rules and profitabletechnical indicators when making investment decisions [22ndash25] Genetic algorithms are combined with other tools suchas the agent-based model [26] fuzzy math theory [27] andneural networks [28] There are also some studies that haveused genetic algorithms to forecast the price trends in thefinancial market [29 30] or the exchange rate of the foreignexchange market [31] As there are a vast number of technicaltrading rules and technical indicators available in the crudeoil futuresmarket it is impractical to use ergodic calculationsor certain other accurate calculation methods Thereforeusing genetic algorithms is a feasible way to resolve this issue

Moving average indicators have been widely used instudies of stocks and futures markets [32ndash37] Two movingaverages of different lengths are compared to forecast theprice trends in different markets Short moving averagesare more sensitive to price changes than long ones If ashort moving average price is higher than a long periodmoving average price traders will believe the price will riseand take long positions When the short moving averageprice falls and crosses with the long one opposite tradingactivities will be taken [38] Allen and Karjalainen (AK) [39]used genetic algorithms to identify technical trading rules instock markets with daily prices of the SampP 500 The movingaverage price was used as one of the many indicators of thetechnical rules Other indicators such as the mean valueand maximum value are also used when making investmentdecisions Wang [40] conducted similar research on spot andfutures markets using genetic programing while How [41]applied AKrsquos method to different cap stocks to determinethe relevance of size William comparing different technicalrules and artificial neural network (ANN) rules regarding oilfutures market determined that the ANN is a good tool thuscasting doubt on the efficiency of the oil market [38] All ofthese studies combine moving average indicators with otherindicators to generate trading rules However in this paperwe utilize moving averages to generate trading rules whichmay be a simple and efficient approach

The performance of a moving average trading rule isaffected significantly by the period lengths [42] Thereforefinding optimal lengths of the two periods above is a centralissue in technical analysis literature A variety of lengthshave been tried in existing research projects [43ndash48] In theexisting research most of moving average rules use fixedmoving average period lengths and single moving averagecalculation method However it is better to use variablelengths for different investment periods [49 50] and there aredifferent types ofmoving average calculationmethod that canbe used in technical analysis

In this paper considering that the optimal length of themoving average periods and the best calculationmethodmayvary from one occasion to another we use genetic algorithmsto determine the suitable length of themoving average periodand the appropriate method Six moving average calculationmethods are considered in this paper and genetic algorithmscan help us find out the best method and appropriate periodlengths for different circumstances Accordingly we are ableto present the most suitable moving average trading rules fortraders in the crude oil futures market

2 Data and Method

21 Data We use the daily prices of the crude oil futurecontract 1 for the period 1983 to 2013 from the NewYorkMercantile Exchange (Data Source httpwwweiagovdnavpetpet pri fut s1 dhtm) We select 20 groups of sam-ple data each containing 1000 daily prices In the 1000 dailyprices a 500-day price series is used to train trading rulesin every generation The following 200 prices are used toselect the best generated trading rule from all generationsand the last 300 daily prices are used to determine whetherthe generated rule can acquire excess returns The first groupbegins in 1985 the last group ends in 2013 and each 1000-day price series with a step of 300 is selected We must alsoinclude 500 more daily prices before each sample series tocalculate themoving prices for the sample periodThus everyindependent experiment requires a 1500-day price seriesThedata we use are presented in Figure 1

22 Method Moving average trading rules facilitatedecision-making for traders by comparing two movingaverages of different periods In this way traders can predictthe price trend by analyzing the volatility of the movingaverage pricesThere are six moving average indictors usuallyused in technical analysis simple moving average (SMA)weighted moving average (WMA) exponential movingaverage (EMA) adaptive moving average (AMA) typicalprice moving average (TPMA) and triangular movingaverage (TMA) The calculation methods of moving averageindicators are presented in Table 1

To use a moving average trading rule in the oil futuresmarket at least three parameters must be set to establish atrading strategy These parameters include the lengths of twomoving average periods and the choice of themoving averagemethod from the above six typesOther researchers have useddifferent lengths of sample periods in their studies In thispaper we use genetic algorithms to determine appropriatelengths of the moving average period According to existingliterature the long period is generally between 20 and 200days (very few studies use periods longer than 200 days)[38 39] and the short period is generally no longer than 60days

If the long average price is lower than the short averageprice a trader will take a long position It follows thatin opposite situations opposite strategies will be adoptedNoting the price volatility in the futures market taking along position when the short average price exceeds the longaverage price by at least one standard deviation in the shortperiodmay be a good rule Conversely taking a short positionmay also be a good ruleTherefore we designed the two rulesin our initial trading rules The detailed calculation methodsof the six moving averages are presented in Figure 2

A 17-binary string is used to represent a trading rulein which a seven-binary substring represents (M-N) (119872 isthe long period length and 119873 is the short period length)a six-binary substring is 119873 (119873 belongs to the range of 1to 64) a three-binary substring represents the calculationmethod of average prices In this paper the range of 119872to 119873 is 5 to 132 The last binary determines whether to

Mathematical Problems in Engineering 3

Table 1 Details of the six moving average indicators

Indicator Calculation method (119901 denotes price)

SMA SMA (119896) =1119899

119899minus1

sum

119894=0

119901119896minus119894

WMA WMA(119896) =sum119899minus1

119894=0(119899 minus 119894)119901

119896minus119894

sum119899minus1

119894=0(119899 minus 119894)

EMAEMA(119896) = EMA(119896 minus 1) + SC (119901

119896minus EMA (119896 minus 1))

where SC = 2(1 + 119899)

AMA

AMA(119896) = AMA(119896 minus 1) + SSC119896

2

(119901119896minus AMA (119896 minus 1))

where SSC119896= ER119896(fastSC minus slowSC) + slowSC

fastSC = 2(1 + 2)

slowSC = 2(1 + 30)

ER119896=

1003816100381610038161003816119901119896 minus 119901119896minus1198991003816100381610038161003816

sum119896

119894=119896minus119899+1

1003816100381610038161003816119901119894 minus 119901119894minus11003816100381610038161003816

TPMA TPMA(119896) =(high + low + close)

3

where high = max(119901119898 119901119898minus1 119901

119898minus119899+1) low = min(119901

119898 119901119898minus1 119901

119898minus119899+1) close = 119901

119898

TMA TMA(119896) = 1119899

119899minus1

sum

119894=0

SAM(119896 minus 119894)

200days

200days

200days

200days 300days

300days

300days

300days

500days

500days

500days 500days

500days

500days

500days 500days

March 29 1985April 4 1983

March 29 1985

June 11 1986

August 21 1987

March 10 2009 February 26 2013

February 26 2013

August 13 1991

June 4 1990

March 27 1989Period 1

Period 2

Period 3

Period 21

Auxiliary data calculate the moving average prices in the training periodTraining data evaluate and select the generated trading rules in each generation

Selection data test the best individual in every generation identify the best trading rule in a trailTest data test the generated moving average trading rule to actualize excess return

Periods 4 5 20

Figure 1 Data selection

change trading strategies only when there is more than onestandard deviation difference between two moving averageprices The structure of trading rules is presented in Figure 2The fitness of a trading rule is calculated according to theprofit it canmake in the crude oil futures market To comparegenerated trading rules with the BH (buy-and-hold takingthe long position throughout the period) strategy the profitof a generated rule is the excess return rate that exceeds theBH strategy

The calculation method of the return rate references AKrsquosmethod The difference is that we allow a trader to hold aposition for a long time and we do not calculate the returnevery day Consider

Ra = Ral + Ras + Rf minus Rbh

Ral =sum119899

119894=1((119875out minus 119875in) 119875in lowast (1 minus 119888) (1 + 119888))

Rm

Ras =sum119898

119894=1((119875out minus 119875in) 119875in lowast (1 minus 119888) (1 + 119888))

Rm

Rbh =(119875begin minus 119875end)

119875beginlowast(1 minus 119888) (1 + 119888)

Rm

(1)

Ra is the excess return rate of a long position strategythat is the sum of the return of the long position and short

4 Mathematical Problems in Engineering

Seven-binary Six-binary ree-binary One-binary

Decimal x Decimal y Decimal z Boolean sd

1 SMA

2 WMA

3 EMA

4 AMA

5 TPMA

6 TMA

Each string represents a trading ruleTake a long position if the moving average price (using method I)of M-days is lower than that of N-days and take a short position inthe opposite case If the sd is 1 keep out of the market to earn therisk free return until the difference between the two movingaverages exceeds the standard deviation of N-days prices

Method I = mod ((z + 1) 6) (1ndash6)

Short period N = y + 1 (1sim64) Long period M = N+ x + 5 (6ndash196) Marker sd = 0 or 1

Binary to decimalor boolean

Figure 2 Structure of trading rules

position Rf is the risk free return when out of market andRbh is the return rate of the BH strategy in the sample periodRm is the margin ratio of the futures market The parameter119888 denotes the one-way transaction cost rate 119875in and 119875outrepresent the opening price and closing price of a position(long or short) respectively 119875begin is the price of the first dayin a whole period and 119875end is the price of the last day As weignore the amount of change in the everyday margin and thedeadline of the contract a trader canmaintain his strategy bytaking new positions when a contract nears its closing date

The fitness value is a number between 0 and 2 calculatedthrough nonlinear conversion according to Ra The fitnessvalue calculation selection crossover and mutation of indi-viduals are implemented using the GA toolbox of Sheffieldin the Matlab platform In every generation to avoid theoverfitting of training data the best trading rule in everygeneration will be tested in a selection sample period (the200-day price series) Only when the fitness value is higherthan the best value in the last generation or when the twovalues are almost the same (119891lastminus119891now lt 005) can the tradingrule be marked as the best thus far In every generation 90percent of the population will be selected to form a newgeneration while the other 10 percent will be randomlygenerated Accordingly the evolution of individuals usinggenetic algorithms in a single independent experiment canbe summarized as follows

Step 1 (initialize population) Randomly create an initialpopulation of 20 moving average trading rules

Step 2 (evaluate individuals) The fitness of every individualis calculated in the evaluation step The program calculatesthe moving average prices in two different scales during thetraining period using the auxiliary data and determines thepositions on each trading day The excess return rate of everyindividual is then calculated Finally the fitness value of eachindividual is calculated according to the excess return rate

Step 3 (remember the best trading rule) Select the rule withthe highest fitness value and evaluate it for the selection

period to obtain its return rate If it is better than or notinferior to the current best rule it will be marked as the besttrading rule If its return rate is lower than or less than 005higher than the current rate we retain the current rule as thebest one

Step 4 (generate new population) Selecting 18 individualsaccording to their fitness values the same individual couldbe selected more than once Therefore randomly create 2additional trading rules With a probability of 07 performa recombination operation to generate a new populationAccordingly all the recombination rules will be mutated witha probability of 005

Step 5 Return to Step 2 and repeat 50 times

Step 6 (test the best trading rule) Test the best trading rule asidentified by the above programThis will generate the returnrate and indicate whether genetic algorithms can help tradersactualize excess returns during this sample period

3 Results

Because in this paper we have not considered the amount ofassets we assume the margin ratio to be 005 In fact as theparameter has no significant effect on our experiment resultsthe return rate is increased twenty times With 20 trials ineach period 420 independent experiments are conducted todetermine useful moving average trading rules in the crudeoil futures market The prices we used for the 21 periods areshown in Figure 3

Based on previous studies [39 40 51] and on the decisionto select an intermediate value for this study the transactioncost rate is set at 01 for the 420 experiments The risk freereturn rate is 2 which is based primarily on the short-termtreasury bond rate [41]

Of the 420 trials 226 earn profits With an average returnrate of 1446 it is concluded that genetic algorithms canfacilitate traders to obtain returns in the crude oil futures

Mathematical Problems in Engineering 5

8503 89030

20

40(1)

8606 900510

20

30(2)

8708 91070

50(3)

8810 92100

50(4)

9001 93120

50(5)

9103 950210

20

30(6)

9205 960510

20

30(7)

9308 970710

20

30(8)

9410 980910

20

30(9)

9512 991210

20

30(10)

9703 01020

20

40(11)

9805 02040

20

40(12)

9907 03070

20

40(13)

0010 04090

50

100(14)

0112 05120

50

100(15)

0303 07020

50

100(16)

0405 08050

100

200(17)

0508 09070

100

200(18)

0610 10090

100

200(19)

0712 11120

100

200(20)

0903 13020

100

200(21)

Figure 3 Sample data

market However moving average trading rules identified bygenetic algorithms do not result in excess returns as thereare only 8 periods in which generated trading rules resultedin traders receiving excess returns Given that the price ofcrude oil futures increased many times during the sampleperiod we further contend that genetic algorithms are helpfulin investments

For a better understanding we divide the 21 periods into4 categories according to the results (see the last column ofTable 2)

Category 1 (periods 2 3 and 9) In these periods generatedtrading rules not only help traders obtain returns but alsohelp them to realize excess returns Generated trading rulesgenerate more profits than the BH strategy in periods 3and 9 In period 2 the BH strategy loses money whilethe generated trading rules as determined by the genetic

algorithms result in profitsThus the generated trading rulesare far superior to the BH strategy in this period A commonfeature of these three periods inCategory 1 is that the crude oilprices fell during the test period and experienced significantfluctuations

Category 2 (periods 5 8 12 16 and 18) Generated movingaverage trading rules fail to generate profits during these fiveperiods Even so the generated rules performed better thanthe BH strategy as they significantly reduced losses In theseperiods prices declined smoothly experiencing some smallfluctuations during the process

Category 3 (periods 1 6 7 10 11 14 15 and 17) In theseeight sample data periods genetic algorithms help tradersto identify suitable moving average trading rules Howeverthe traders failed to obtain excess returns While prices

6 Mathematical Problems in Engineering

Table 2 Results of experiment

Period 119876119886 119876 Rbh 119877 119877119886 Classification1 3 12 3768 0663 minus3105 32 20 20 minus2946 2899 5845 13 15 16 5299 7717 2419 14 1 6 0647 minus0862 minus1510 45 20 11 minus7185 minus0097 7088 26 1 12 4976 0808 minus4168 37 5 11 5240 1854 minus3386 38 10 9 minus1175 minus0357 0818 29 19 12 minus5610 0691 6301 110 0 16 16338 6943 minus9396 311 1 13 2740 0127 minus2613 312 15 11 minus1420 minus0576 0844 213 0 7 4343 minus2296 minus6640 414 0 14 14069 3141 minus10928 315 7 8 2287 0273 minus2014 316 12 9 minus0715 minus0092 0622 217 0 20 26227 21037 minus5190 318 20 3 minus9746 minus4131 5615 219 0 0 3512 minus6091 minus9603 420 1 10 2968 minus0193 minus3161 421 7 6 minus0162 minus1092 minus0930 4119876119886 is the number of generated trading rules receiving positive excess returns compared with the BH strategy in the 20 trials 119876 is the number of generatedtrading rules acquiring returns in the test periods Rbh is the return rate of the BH strategy 119877 is the average return rate of the 20 trials in each period 119877119886 isthe average excess return rate of 20 trials in each period

steadily increase in these periods there are also some minorfluctuations which cause the genetic algorithms to be inferiorto the BH strategy in these periods

Category 4 (periods 4 13 19 20 and 21) Genetic algorithmtrading rules demonstrate poor performance in these fiveperiods In period 21 the BH strategy yields negative returnsOur genetic trading rules yield more severe losses TheBH strategy is considered superior to the generated tradingrules in the other four periods as the BH strategy yieldssome returns While there are no significant changes in theprices level in these periods the prices are in volatile statesthroughout the five periods Slight price changes with noapparent trends render the generated trading rules helplessin predicting price changes and providing returns

We use genetic algorithms to search goodmoving averagetrading rules for traders in the crude oil market Table 3which shows the average number of 119872 and 119873 for everyperiod indicates that the value of long period (119872) has aclose relationship with the volatility of the prices in thesample period A large 119872 is set in periods with significantfluctuations and a small 119872 is selected for periods in whichprice is relatively stable

The distribution of 119872 is shown in Figure 4 The valueof Probability is very small and 119872 does not follow normaldistributionThefigure presents a typical fat tail characteristicwith a kurtosis of 236 Compared with normal distributionthere are more values located in the tails of the distribution in

our results Only in half of the 420 experiments119872 is between70 days and 130 days The values are decentralized and webelieve it is more scientific to choose the best lengths of thetwo periods using a training process that we have used in thispaper in actual investment

Among the six moving average calculation methodsAMA and TMA are used more often than the other four(see Table 4) as more than half of the generated movingaverage trading rules use AMA or TMA A small number ofgenerated trading rules use WMA and EMA while TPMAand SMA which are easy to calculate are frequently used insome periods such as periods 1 2 3 12 19 and 21

The selection of calculationmethod is associated with theprice trends and volatility Figure 5 shows that TPMA is used31 times in the 60 independent experiments in periods 2 3and 9 (Category 1) Different from the overall proportionTPMA is the most popular calculation method when pricefalls during the period and experienced significant fluctua-tions AMA is the most popular method in the other threecategories EMA is never used inCategories 1 and 4 Howeverit takes a 24 proportion in Category 2 more than TMASMA TPMA and WMA The proportions of TMA andSMA have no significant differences in different categoriesIn category 4 prices change with no apparent trends No onemethod has obvious advantage over the others

The results of 20 experiments in the same period indicatehigh consistency on the value sd (Table 5) When pricesfluctuate such as in periods 1 2 7 8 13 19 and 20 then not

Mathematical Problems in Engineering 7

Table 3 The average value of119872 and119873 in each period

Period 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 AvgAvg (119872) 104 108 65 121 101 59 51 55 143 107 140 131 118 81 78 96 160 119 112 101 71 101Avg (119873) 24 36 15 45 29 29 26 16 47 37 36 43 44 47 22 18 53 24 19 31 40 32

Table 4 Calculation methods of moving average price in each period

Method Period1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Count

SMA 7 4 1 4 3 3 7 4 10 1 2 1 13 6 3 69WMA 1 1 1 5 3 2 1 3 6 23EMA 1 4 7 2 2 15 31AMA 1 1 20 15 14 8 8 2 9 4 18 16 18 2 1 8 145TPMA 8 19 12 2 3 2 6 2 1 3 9 67TMA 2 4 3 1 8 11 11 2 13 2 19 1 1 7 85

opening positions until one average price exceeds another byat least one standard deviation is the best option When theprice is relatively stable an investment decision should bemade immediately as long as the two moving averages cross

4 Discussion

This paper attempts to generate moving average tradingrules in the oil futures market using genetic algorithmsDifferent from other studies we use only moving averages astechnical indicators to identify usefulmoving average tradingrules without any other complex technical analysis tools orindicators Moving average trading rules are easy for tradersto operate and they are straightforward regardless of thesituation To identify the best trading rules in the crude oilfutures market we use genetic algorithms to select all theparameters in the moving average trading rules dynamicallyrather than doing so in a fixed manner

According to our genetic calculations using geneticalgorithms to find out the best lengths of the two movingaverage periods is advocated because the generated lengthsdiffer from each other in different price trends Static movingaverage trading rules with fixed period lengths cannot adaptto complex fluctuations of price in different periods Atraining process however which takes dynamic features ofprice fluctuations into consideration can help traders find outthe optimal lengths of the two moving periods of a tradingrule

Among the six moving average methods the AMA andTMAare themost popular among the generated trading rulesas these two methods have the ability to adapt to the pricetrendsThe AMA can change the weights of the current priceaccording to the volatility in the last several days As theTMA is the average of the SMA it more accurately reflectsthe price level However the selection of best moving averagecalculation method is affected by price trends Traders canchoose methods more scientifically according to the pricetrends and fluctuations Based on our experiment resultsTPMA is an optimal choice when price experiences a declineprocess with significant fluctuations and generating moving

average trading rules are outstanding compared with BHstrategy in these occasions Although EMA takes a verysmall proportion in the total 420 experiments it is alsoan applicable method other than AMA when price fallssmoothly

For the periods in which the price volatility is apparentdecisions will not be made until the difference betweenthe two averages exceeds the standard deviation of theshort sample prices thereby reducing the transaction riskHowever this method is not suitable for a period in whichthe price is relatively stable In these situations hesitationmaysometimes cause traders tomiss possible profit opportunities

As a whole generated moving average trading rules canhelp traders make profits in the long term However geneticalgorithms cannot guarantee access to additional revenuein every period as they are only useful in acquiring excessreturns in special situations The generated moving averagetrading rules demonstrate outstanding performance whenthe crude oil futures price falls with significant fluctuationsThe BH strategy will lose on these occasions while thegenerated trading rule can help traders foresee a decline inprice and reduce losses Our trading rules also yield positivereturns during the fluctuations by the timely changing ofpositions

When the price falls smoothly with few fluctuations inthe process generated trading rules can yield excess returnscompared to the BH strategy Although genetic algorithmscannot help traders receive positive returns during theseperiods the algorithms can help traders reduce loss bychanging positions with the change of price trends Whenthe price is stable or rising smoothly the generated rulesmay generate returns However they cannot generate morereturns than the BH strategy Limited returns cannot affordthe transaction costsWhen the price falls the generated rulesmay be superior to the BH strategy Genetic algorithms canalso help tradersmake profits in the process of price increaseswith small fluctuations In these periods the BH strategy isbetter than generated trading rules because the transactionsin the process generate transaction costs and may miss someprofit opportunities Generated moving average trading rules

8 Mathematical Problems in Engineering

Table 5 Numbers of trading rules in which sd = 1

Period 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 CountCount 19 19 20 0 5 3 13 12 0 2 0 0 13 2 0 2 0 1 20 19 0 150

0

4

8

12

16

20

24

28

32

20 40 60 80 100 120 140 160 180

Mean 1009833Median 1020000Maximum 1940000Minimum 6000000Std dev 4443764Skewness 0011466Kurtosis 2361692

Jarque-Bera 7139346Probability 0028165

Series MSample 1 420Observations 420

Figure 4 Distribution of119872

0 02 04 06 08 1

Cat

egor

y 1

Cat

egor

y 2

Cat

egor

y 3

Cat

egor

y 4

SMAWMAEMA

AMATPMATMA

Figure 5 Proportions of methods in different categories

have poor performance if there are no notable trends in theprice change In these periods moving average indicatorscannot find profit opportunities because the volatility is toosmall The trends of price changes are delayed by the movingaveragemethodTherefore when a decision ismade the pricetrend must also change and as a result there is no doubt thatthe trader will experience deficits

Using genetic algorithms moving average trading rulesdo help traders to gain returns in the actual futures market

We also identified the best lengths for the two periods withrespect to moving average rules and recommend the movingaverage calculation method for the crude oil futures marketTechnical trading rules with only moving average indicatorsgenerated by genetic algorithms demonstrate no sufficientadvantages compared to the BH strategy because the overallprice increased during the 30-year period Nevertheless gen-erated moving trading rules are beneficial for traders undercertain circumstances especially when there are significantchanges in prices

In this paper we search best trading rules according to thereturn rate of each one without regard to asset conditions andopen interest which proves to be the greatest limitation of thestudy To improve the accuracy of the results a simulationwith actual assets is recommended Accordingly we willundertake this endeavor in a subsequent research

5 Concluding Remarks

We conclude that the genetic algorithms identify bettertechnical rules that allow traders to actualize profits fromtheir investmentsWhile we have no evidence to demonstratethat generated trading rules result in greater returns thandoes the BH strategy our conclusion is consistent with theefficient market hypothesis While generated trading rulesfacilitate traders in realizing excess returns with respect totheir investing activities under specific circumstances theycannot at least by usingmoving average trading rules ensuremore long-term excess returns than the BH strategy Withrespect to the selection of two periods finding out optimallengths using genetic algorithms is helpful for making moreprofits Of the six moving average indicators AMA and TMAare the most popular moving average calculation methodsfor the crude oil futures market in total while TPMA is an

Mathematical Problems in Engineering 9

outstanding method in some occasion When the crude oilprices demonstrate notable volatility a trader is advised towait until the difference of the two moving averages exceedsthe standard deviation of the short period and vice versa

Based on the above analysis it is better to use BH strategywhen the price increases or is stable However generatedmoving average trading rules are better than BH strategywhen crude oil futures price decreases With respect to themoving average calculation method it is advocated to useTPMA when price falls with significant fluctuations andAMA when price falls smoothly although TPMA is not apopularmethod overallWe propose variablemoving averagetrading rules generated by training processes rather thanstatic moving average trading rules in the crude oil futuresmarkets

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Authorsrsquo Contribution

Model design was done by Haizhong An Lijun Wangand Xuan Huang program development and experimentsperformance were done by Xiaojia Liu and Lijun Wang dataanalysis was done by Haizhong An Xiaohua Xia and XiaoqiSun paper composition was done by Lijun Wang XiaohuaXia and Xiaojia Liu and literature retrieval and manuscriptediting were done by Xiaojia Liu Xuan Huang and XiaoqiSun

Acknowledgments

This research was partly supported by the NSFC (China)(Grant no 71173199) and Humanities and the Social Sciencesplanning funds project under the Ministry of Education ofthe PRC (Grant no 10YJA630001) The authors would like toacknowledge valuable suggestions fromWei Fang XiaoliangJia and Qier An

References

[1] Z M Chen and G Q Chen ldquoDemand-driven energy require-ment of world economy 2007 a multi-region input-outputnetwork simulationrdquo Communications in Nonlinear Science andNumerical Simulation vol 18 no 7 pp 1757ndash1774 2013

[2] G Wu L-C Liu and Y-M Wei ldquoComparison of Chinarsquos oilimport risk results based on portfolio theory and a diversifica-tion index approachrdquo Energy Policy vol 37 no 9 pp 3557ndash35652009

[3] X H Xia G T Huang G Q Chen B Zhang Z M Chenand Q Yang ldquoEnergy security efficiency and carbon emissionof Chinese industryrdquo Energy Policy vol 39 no 6 pp 3520ndash35282011

[4] X H Xia and G Q Chen ldquoEnergy abatement in Chineseindustry cost evaluation of regulation strategies and allocationalternativesrdquo Energy Policy vol 45 pp 449ndash458 2012

[5] N Cui Y Lei andW Fang ldquoDesign and impact estimation of areform program of Chinarsquos tax and fee policies for low-grade oiland gas resourcesrdquo Petroleum Science vol 8 no 4 pp 515ndash5262011

[6] Y L Lei N Cui and D Y Pan ldquoEconomic and socialeffects analysis of mineral development in China and policyimplicationsrdquo Resources Policy vol 38 pp 448ndash457 2013

[7] Z M Chen and G Q Chen ldquoAn overview of energy consump-tion of the globalized world economyrdquo Energy Policy vol 39 no10 pp 5920ndash5928 2011

[8] N Nomikos and K Andriosopoulos ldquoModelling energy spotprices empirical evidence from NYMEXrdquo Energy Economicsvol 34 no 4 pp 1153ndash1169 2012

[9] G B Ning Z J Zhen P Wang Y Li and H X Yin ldquoEconomicanalysis on value chain of taxi fleet with battery-swappingmodeusingmultiobjective genetic algorithmrdquoMathematical Problemsin Engineering vol 2012 Article ID 175912 15 pages 2012

[10] S Chai Y B Li J Wang and C Wu ldquoA genetic algorithmfor task scheduling on NoC using FDH cross efficiencyrdquoMathematical Problems in Engineering vol 2013 Article ID708495 16 pages 2013

[11] G Q Chen and B Chen ldquoResource analysis of the Chinesesociety 1980ndash2002 based on exergy Part 1 fossil fuels and energymineralsrdquo Energy Policy vol 35 no 4 pp 2038ndash2050 2007

[12] Z Chen G Chen X Xia and S Xu ldquoGlobal network ofembodied water flow by systems input-output simulationrdquoFrontiers of Earth Science vol 6 no 3 pp 331ndash344 2012

[13] Z M Chen and G Q Chen ldquoEmbodied carbon dioxideemission at supra-national scale a coalition analysis for G7BRIC and the rest of the worldrdquo Energy Policy vol 39 no 5pp 2899ndash2909 2011

[14] H Z An X-Y Gao W Fang X Huang and Y H Ding ldquoTherole of fluctuating modes of autocorrelation in crude oil pricesrdquoPhysica A vol 393 pp 382ndash390 2014

[15] X-Y GaoH-Z AnH-H Liu andY-HDing ldquoAnalysis on thetopological properties of the linkage complex network betweencrude oil future price and spot pricerdquo Acta Physica Sinica vol60 no 6 Article ID 068902 2011

[16] X-Y Gao H Z An and W Fang ldquoResearch on fluctuation ofbivariate correlation of time series based on complex networkstheoryrdquo Acta Physica Sinica vol 61 no 9 Article ID 0989022012

[17] S Yu and Y-M Wei ldquoPrediction of Chinarsquos coal production-environmental pollution based on a hybrid genetic algorithm-system dynamics modelrdquo Energy Policy vol 42 pp 521ndash5292012

[18] S Geisendorf ldquoInternal selection and market selection in eco-nomic genetic algorithmsrdquo Journal of Evolutionary Economicsvol 21 no 5 pp 817ndash841 2011

[19] R Tehrani and F Khodayar ldquoA hybrid optimized artificialintelligent model to forecast crude oil using genetic algorithmrdquoAfrican Journal of Business Management vol 5 pp 13130ndash131352011

[20] A M Elaiw X Xia and A M Shehata ldquoMinimization of fuelcosts and gaseous emissions of electric power generation bymodel predictive controlrdquo Mathematical Problems in Engineer-ing vol 2013 Article ID 906958 15 pages 2013

[21] L Mendes P Godinho and J Dias ldquoA Forex trading systembased on a genetic algorithmrdquo Journal of Heuristics vol 18 no4 pp 627ndash656 2012

10 Mathematical Problems in Engineering

[22] M C Roberts ldquoTechnical analysis and genetic programmingconstructing and testing a commodity portfoliordquo Journal ofFutures Markets vol 25 no 7 pp 643ndash660 2005

[23] J-Y Potvin P Soriano and V Maxime ldquoGenerating tradingrules on the stock markets with genetic programmingrdquo Com-puters and Operations Research vol 31 no 7 pp 1033ndash10472004

[24] A Esfahanipour and S Mousavi ldquoA genetic programmingmodel to generate risk-adjusted technical trading rules in stockmarketsrdquo Expert Systems with Applications vol 38 no 7 pp8438ndash8445 2011

[25] M A H Dempster T W Payne Y Romahi and G W PThompson ldquoComputational learning techniques for intradayFX trading using popular technical indicatorsrdquo IEEE Transac-tions on Neural Networks vol 12 no 4 pp 744ndash754 2001

[26] T Nakashima Y Yokota Y Shoji and H Ishibuchi ldquoA geneticapproach to the design of autonomous agents for futurestradingrdquo Artificial Life and Robotics vol 11 no 2 pp 145ndash1482007

[27] A Ghandar Z Michalewicz M Schmidt T-D To and RZurbrugg ldquoComputational intelligence for evolving tradingrulesrdquo IEEE Transactions on Evolutionary Computation vol 13no 1 pp 71ndash86 2009

[28] W L Tung and C Quek ldquoFinancial volatility trading usinga self-organising neural-fuzzy semantic network and optionstraddle-based approachrdquo Expert Systems with Applications vol38 no 5 pp 4668ndash4688 2011

[29] C-H Cheng T-L Chen and L-Y Wei ldquoA hybrid model basedon rough sets theory and genetic algorithms for stock priceforecastingrdquo Information Sciences vol 180 no 9 pp 1610ndash16292010

[30] P-C Chang C-Y Fan and J-L Lin ldquoTrend discovery infinancial time series data using a case based fuzzy decision treerdquoExpert Systems with Applications vol 38 no 5 pp 6070ndash60802011

[31] G A Vasilakis K A Theofilatos E F Georgopoulos AKarathanasopoulos and S D Likothanassis ldquoA genetic pro-gramming approach for EURUSD exchange rate forecastingand tradingrdquo Computational Economics vol 42 no 4 pp 415ndash431 2013

[32] I A Boboc and M C Dinica ldquoAn algorithm for testing theefficient market hypothesisrdquo PLoS ONE vol 8 no 10 ArticleID e78177 2013

[33] W Cheung K S K Lam and H F Yeung ldquoIntertemporalprofitability and the stability of technical analysis evidencesfrom the Hong Kong stock exchangerdquo Applied Economics vol43 no 15 pp 1945ndash1963 2011

[34] H Dewachter and M Lyrio ldquoThe economic value of technicaltrading rules a nonparametric utility-based approachrdquo Interna-tional Journal of Finance and Economics vol 10 no 1 pp 41ndash622005

[35] A Fernandez-Perez F Fernandez-Rodrıguez and S Sosvilla-Rivero ldquoExploiting trends in the foreign exchange marketsrdquoApplied Economics Letters vol 19 no 6 pp 591ndash597 2012

[36] M Metghalchia J Marcucci and Y-H Chang ldquoAre movingaverage trading rules profitable Evidence from the EuropeanstockmarketsrdquoApplied Economics vol 44 no 12 pp 1539ndash15592012

[37] C J Neely P A Weller and J M Ulrich ldquoThe adaptive mar-kets hypothesis evidence from the foreign exchange marketrdquoJournal of Financial and Quantitative Analysis vol 44 no 2 pp467ndash488 2009

[38] W E Shambora and R Rossiter ldquoAre there exploitable ineffi-ciencies in the futures market for oilrdquo Energy Economics vol29 no 1 pp 18ndash27 2007

[39] F Allen and R Karjalainen ldquoUsing genetic algorithms to findtechnical trading rulesrdquo Journal of Financial Economics vol 51no 2 pp 245ndash271 1999

[40] J Wang ldquoTrading and hedging in SampP 500 spot and futuresmarkets using genetic programmingrdquo Journal of Futures Mar-kets vol 20 no 10 pp 911ndash942 2000

[41] J HowM Ling and P Verhoeven ldquoDoes size matter A geneticprogramming approach to technical tradingrdquo QuantitativeFinance vol 10 no 2 pp 131ndash140 2010

[42] F Wang P L H Yu and D W Cheung ldquoCombining technicaltrading rules using particle swarm optimizationrdquo Expert Sys-tems with Applications vol 41 no 6 pp 3016ndash3026 2014

[43] J Andrada-Felix and F Fernandez-Rodrıguez ldquoImprovingmoving average trading rules with boosting and statisticallearningmethodsrdquo Journal of Forecasting vol 27 no 5 pp 433ndash449 2008

[44] T T-L Chong and W-K Ng ldquoTechnical analysis and theLondon stock exchange testing the MACD and RSI rules usingthe FT30rdquoApplied Economics Letters vol 15 no 14 pp 1111ndash11142008

[45] I Cialenco andA Protopapadakis ldquoDo technical trading profitsremain in the foreign exchange market Evidence from 14 cur-renciesrdquo Journal of International Financial Markets Institutionsand Money vol 21 no 2 pp 176ndash206 2011

[46] A E Milionis and E Papanagiotou ldquoDecomposing the predic-tive performance of themoving average trading rule of technicalanalysis the contribution of linear andnon-linear dependenciesin stock returnsrdquo Journal of Applied Statistics vol 40 no 11 pp2480ndash2494 2013

[47] Y S Ni J T Lee and Y C Liao ldquoDo variable length movingaverage trading rules matter during a financial crisis periodrdquoApplied Economics Letters vol 20 no 2 pp 135ndash141 2013

[48] V Pavlov and S Hurn ldquoTesting the profitability of moving-average rules as a portfolio selection strategyrdquo Pacific-BasinFinance Journal vol 20 no 5 pp 825ndash842 2012

[49] C Chiarella X-Z He and C Hommes ldquoA dynamic analysisof moving average rulesrdquo Journal of Economic Dynamics ampControl vol 30 no 9-10 pp 1729ndash1753 2006

[50] X-Z He and M Zheng ldquoDynamics of moving average rules ina continuous-time financialmarketmodelrdquo Journal of EconomicBehavior and Organization vol 76 no 3 pp 615ndash634 2010

[51] C Neely P Weller and R Dittmar Is Technical Analysis in theForeign Exchange Market Profitable A Genetic ProgrammingApproach Cambridge University Press 1997

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

2 Mathematical Problems in Engineering

genetic algorithms to search best trading rules and profitabletechnical indicators when making investment decisions [22ndash25] Genetic algorithms are combined with other tools suchas the agent-based model [26] fuzzy math theory [27] andneural networks [28] There are also some studies that haveused genetic algorithms to forecast the price trends in thefinancial market [29 30] or the exchange rate of the foreignexchange market [31] As there are a vast number of technicaltrading rules and technical indicators available in the crudeoil futuresmarket it is impractical to use ergodic calculationsor certain other accurate calculation methods Thereforeusing genetic algorithms is a feasible way to resolve this issue

Moving average indicators have been widely used instudies of stocks and futures markets [32ndash37] Two movingaverages of different lengths are compared to forecast theprice trends in different markets Short moving averagesare more sensitive to price changes than long ones If ashort moving average price is higher than a long periodmoving average price traders will believe the price will riseand take long positions When the short moving averageprice falls and crosses with the long one opposite tradingactivities will be taken [38] Allen and Karjalainen (AK) [39]used genetic algorithms to identify technical trading rules instock markets with daily prices of the SampP 500 The movingaverage price was used as one of the many indicators of thetechnical rules Other indicators such as the mean valueand maximum value are also used when making investmentdecisions Wang [40] conducted similar research on spot andfutures markets using genetic programing while How [41]applied AKrsquos method to different cap stocks to determinethe relevance of size William comparing different technicalrules and artificial neural network (ANN) rules regarding oilfutures market determined that the ANN is a good tool thuscasting doubt on the efficiency of the oil market [38] All ofthese studies combine moving average indicators with otherindicators to generate trading rules However in this paperwe utilize moving averages to generate trading rules whichmay be a simple and efficient approach

The performance of a moving average trading rule isaffected significantly by the period lengths [42] Thereforefinding optimal lengths of the two periods above is a centralissue in technical analysis literature A variety of lengthshave been tried in existing research projects [43ndash48] In theexisting research most of moving average rules use fixedmoving average period lengths and single moving averagecalculation method However it is better to use variablelengths for different investment periods [49 50] and there aredifferent types ofmoving average calculationmethod that canbe used in technical analysis

In this paper considering that the optimal length of themoving average periods and the best calculationmethodmayvary from one occasion to another we use genetic algorithmsto determine the suitable length of themoving average periodand the appropriate method Six moving average calculationmethods are considered in this paper and genetic algorithmscan help us find out the best method and appropriate periodlengths for different circumstances Accordingly we are ableto present the most suitable moving average trading rules fortraders in the crude oil futures market

2 Data and Method

21 Data We use the daily prices of the crude oil futurecontract 1 for the period 1983 to 2013 from the NewYorkMercantile Exchange (Data Source httpwwweiagovdnavpetpet pri fut s1 dhtm) We select 20 groups of sam-ple data each containing 1000 daily prices In the 1000 dailyprices a 500-day price series is used to train trading rulesin every generation The following 200 prices are used toselect the best generated trading rule from all generationsand the last 300 daily prices are used to determine whetherthe generated rule can acquire excess returns The first groupbegins in 1985 the last group ends in 2013 and each 1000-day price series with a step of 300 is selected We must alsoinclude 500 more daily prices before each sample series tocalculate themoving prices for the sample periodThus everyindependent experiment requires a 1500-day price seriesThedata we use are presented in Figure 1

22 Method Moving average trading rules facilitatedecision-making for traders by comparing two movingaverages of different periods In this way traders can predictthe price trend by analyzing the volatility of the movingaverage pricesThere are six moving average indictors usuallyused in technical analysis simple moving average (SMA)weighted moving average (WMA) exponential movingaverage (EMA) adaptive moving average (AMA) typicalprice moving average (TPMA) and triangular movingaverage (TMA) The calculation methods of moving averageindicators are presented in Table 1

To use a moving average trading rule in the oil futuresmarket at least three parameters must be set to establish atrading strategy These parameters include the lengths of twomoving average periods and the choice of themoving averagemethod from the above six typesOther researchers have useddifferent lengths of sample periods in their studies In thispaper we use genetic algorithms to determine appropriatelengths of the moving average period According to existingliterature the long period is generally between 20 and 200days (very few studies use periods longer than 200 days)[38 39] and the short period is generally no longer than 60days

If the long average price is lower than the short averageprice a trader will take a long position It follows thatin opposite situations opposite strategies will be adoptedNoting the price volatility in the futures market taking along position when the short average price exceeds the longaverage price by at least one standard deviation in the shortperiodmay be a good rule Conversely taking a short positionmay also be a good ruleTherefore we designed the two rulesin our initial trading rules The detailed calculation methodsof the six moving averages are presented in Figure 2

A 17-binary string is used to represent a trading rulein which a seven-binary substring represents (M-N) (119872 isthe long period length and 119873 is the short period length)a six-binary substring is 119873 (119873 belongs to the range of 1to 64) a three-binary substring represents the calculationmethod of average prices In this paper the range of 119872to 119873 is 5 to 132 The last binary determines whether to

Mathematical Problems in Engineering 3

Table 1 Details of the six moving average indicators

Indicator Calculation method (119901 denotes price)

SMA SMA (119896) =1119899

119899minus1

sum

119894=0

119901119896minus119894

WMA WMA(119896) =sum119899minus1

119894=0(119899 minus 119894)119901

119896minus119894

sum119899minus1

119894=0(119899 minus 119894)

EMAEMA(119896) = EMA(119896 minus 1) + SC (119901

119896minus EMA (119896 minus 1))

where SC = 2(1 + 119899)

AMA

AMA(119896) = AMA(119896 minus 1) + SSC119896

2

(119901119896minus AMA (119896 minus 1))

where SSC119896= ER119896(fastSC minus slowSC) + slowSC

fastSC = 2(1 + 2)

slowSC = 2(1 + 30)

ER119896=

1003816100381610038161003816119901119896 minus 119901119896minus1198991003816100381610038161003816

sum119896

119894=119896minus119899+1

1003816100381610038161003816119901119894 minus 119901119894minus11003816100381610038161003816

TPMA TPMA(119896) =(high + low + close)

3

where high = max(119901119898 119901119898minus1 119901

119898minus119899+1) low = min(119901

119898 119901119898minus1 119901

119898minus119899+1) close = 119901

119898

TMA TMA(119896) = 1119899

119899minus1

sum

119894=0

SAM(119896 minus 119894)

200days

200days

200days

200days 300days

300days

300days

300days

500days

500days

500days 500days

500days

500days

500days 500days

March 29 1985April 4 1983

March 29 1985

June 11 1986

August 21 1987

March 10 2009 February 26 2013

February 26 2013

August 13 1991

June 4 1990

March 27 1989Period 1

Period 2

Period 3

Period 21

Auxiliary data calculate the moving average prices in the training periodTraining data evaluate and select the generated trading rules in each generation

Selection data test the best individual in every generation identify the best trading rule in a trailTest data test the generated moving average trading rule to actualize excess return

Periods 4 5 20

Figure 1 Data selection

change trading strategies only when there is more than onestandard deviation difference between two moving averageprices The structure of trading rules is presented in Figure 2The fitness of a trading rule is calculated according to theprofit it canmake in the crude oil futures market To comparegenerated trading rules with the BH (buy-and-hold takingthe long position throughout the period) strategy the profitof a generated rule is the excess return rate that exceeds theBH strategy

The calculation method of the return rate references AKrsquosmethod The difference is that we allow a trader to hold aposition for a long time and we do not calculate the returnevery day Consider

Ra = Ral + Ras + Rf minus Rbh

Ral =sum119899

119894=1((119875out minus 119875in) 119875in lowast (1 minus 119888) (1 + 119888))

Rm

Ras =sum119898

119894=1((119875out minus 119875in) 119875in lowast (1 minus 119888) (1 + 119888))

Rm

Rbh =(119875begin minus 119875end)

119875beginlowast(1 minus 119888) (1 + 119888)

Rm

(1)

Ra is the excess return rate of a long position strategythat is the sum of the return of the long position and short

4 Mathematical Problems in Engineering

Seven-binary Six-binary ree-binary One-binary

Decimal x Decimal y Decimal z Boolean sd

1 SMA

2 WMA

3 EMA

4 AMA

5 TPMA

6 TMA

Each string represents a trading ruleTake a long position if the moving average price (using method I)of M-days is lower than that of N-days and take a short position inthe opposite case If the sd is 1 keep out of the market to earn therisk free return until the difference between the two movingaverages exceeds the standard deviation of N-days prices

Method I = mod ((z + 1) 6) (1ndash6)

Short period N = y + 1 (1sim64) Long period M = N+ x + 5 (6ndash196) Marker sd = 0 or 1

Binary to decimalor boolean

Figure 2 Structure of trading rules

position Rf is the risk free return when out of market andRbh is the return rate of the BH strategy in the sample periodRm is the margin ratio of the futures market The parameter119888 denotes the one-way transaction cost rate 119875in and 119875outrepresent the opening price and closing price of a position(long or short) respectively 119875begin is the price of the first dayin a whole period and 119875end is the price of the last day As weignore the amount of change in the everyday margin and thedeadline of the contract a trader canmaintain his strategy bytaking new positions when a contract nears its closing date

The fitness value is a number between 0 and 2 calculatedthrough nonlinear conversion according to Ra The fitnessvalue calculation selection crossover and mutation of indi-viduals are implemented using the GA toolbox of Sheffieldin the Matlab platform In every generation to avoid theoverfitting of training data the best trading rule in everygeneration will be tested in a selection sample period (the200-day price series) Only when the fitness value is higherthan the best value in the last generation or when the twovalues are almost the same (119891lastminus119891now lt 005) can the tradingrule be marked as the best thus far In every generation 90percent of the population will be selected to form a newgeneration while the other 10 percent will be randomlygenerated Accordingly the evolution of individuals usinggenetic algorithms in a single independent experiment canbe summarized as follows

Step 1 (initialize population) Randomly create an initialpopulation of 20 moving average trading rules

Step 2 (evaluate individuals) The fitness of every individualis calculated in the evaluation step The program calculatesthe moving average prices in two different scales during thetraining period using the auxiliary data and determines thepositions on each trading day The excess return rate of everyindividual is then calculated Finally the fitness value of eachindividual is calculated according to the excess return rate

Step 3 (remember the best trading rule) Select the rule withthe highest fitness value and evaluate it for the selection

period to obtain its return rate If it is better than or notinferior to the current best rule it will be marked as the besttrading rule If its return rate is lower than or less than 005higher than the current rate we retain the current rule as thebest one

Step 4 (generate new population) Selecting 18 individualsaccording to their fitness values the same individual couldbe selected more than once Therefore randomly create 2additional trading rules With a probability of 07 performa recombination operation to generate a new populationAccordingly all the recombination rules will be mutated witha probability of 005

Step 5 Return to Step 2 and repeat 50 times

Step 6 (test the best trading rule) Test the best trading rule asidentified by the above programThis will generate the returnrate and indicate whether genetic algorithms can help tradersactualize excess returns during this sample period

3 Results

Because in this paper we have not considered the amount ofassets we assume the margin ratio to be 005 In fact as theparameter has no significant effect on our experiment resultsthe return rate is increased twenty times With 20 trials ineach period 420 independent experiments are conducted todetermine useful moving average trading rules in the crudeoil futures market The prices we used for the 21 periods areshown in Figure 3

Based on previous studies [39 40 51] and on the decisionto select an intermediate value for this study the transactioncost rate is set at 01 for the 420 experiments The risk freereturn rate is 2 which is based primarily on the short-termtreasury bond rate [41]

Of the 420 trials 226 earn profits With an average returnrate of 1446 it is concluded that genetic algorithms canfacilitate traders to obtain returns in the crude oil futures

Mathematical Problems in Engineering 5

8503 89030

20

40(1)

8606 900510

20

30(2)

8708 91070

50(3)

8810 92100

50(4)

9001 93120

50(5)

9103 950210

20

30(6)

9205 960510

20

30(7)

9308 970710

20

30(8)

9410 980910

20

30(9)

9512 991210

20

30(10)

9703 01020

20

40(11)

9805 02040

20

40(12)

9907 03070

20

40(13)

0010 04090

50

100(14)

0112 05120

50

100(15)

0303 07020

50

100(16)

0405 08050

100

200(17)

0508 09070

100

200(18)

0610 10090

100

200(19)

0712 11120

100

200(20)

0903 13020

100

200(21)

Figure 3 Sample data

market However moving average trading rules identified bygenetic algorithms do not result in excess returns as thereare only 8 periods in which generated trading rules resultedin traders receiving excess returns Given that the price ofcrude oil futures increased many times during the sampleperiod we further contend that genetic algorithms are helpfulin investments

For a better understanding we divide the 21 periods into4 categories according to the results (see the last column ofTable 2)

Category 1 (periods 2 3 and 9) In these periods generatedtrading rules not only help traders obtain returns but alsohelp them to realize excess returns Generated trading rulesgenerate more profits than the BH strategy in periods 3and 9 In period 2 the BH strategy loses money whilethe generated trading rules as determined by the genetic

algorithms result in profitsThus the generated trading rulesare far superior to the BH strategy in this period A commonfeature of these three periods inCategory 1 is that the crude oilprices fell during the test period and experienced significantfluctuations

Category 2 (periods 5 8 12 16 and 18) Generated movingaverage trading rules fail to generate profits during these fiveperiods Even so the generated rules performed better thanthe BH strategy as they significantly reduced losses In theseperiods prices declined smoothly experiencing some smallfluctuations during the process

Category 3 (periods 1 6 7 10 11 14 15 and 17) In theseeight sample data periods genetic algorithms help tradersto identify suitable moving average trading rules Howeverthe traders failed to obtain excess returns While prices

6 Mathematical Problems in Engineering

Table 2 Results of experiment

Period 119876119886 119876 Rbh 119877 119877119886 Classification1 3 12 3768 0663 minus3105 32 20 20 minus2946 2899 5845 13 15 16 5299 7717 2419 14 1 6 0647 minus0862 minus1510 45 20 11 minus7185 minus0097 7088 26 1 12 4976 0808 minus4168 37 5 11 5240 1854 minus3386 38 10 9 minus1175 minus0357 0818 29 19 12 minus5610 0691 6301 110 0 16 16338 6943 minus9396 311 1 13 2740 0127 minus2613 312 15 11 minus1420 minus0576 0844 213 0 7 4343 minus2296 minus6640 414 0 14 14069 3141 minus10928 315 7 8 2287 0273 minus2014 316 12 9 minus0715 minus0092 0622 217 0 20 26227 21037 minus5190 318 20 3 minus9746 minus4131 5615 219 0 0 3512 minus6091 minus9603 420 1 10 2968 minus0193 minus3161 421 7 6 minus0162 minus1092 minus0930 4119876119886 is the number of generated trading rules receiving positive excess returns compared with the BH strategy in the 20 trials 119876 is the number of generatedtrading rules acquiring returns in the test periods Rbh is the return rate of the BH strategy 119877 is the average return rate of the 20 trials in each period 119877119886 isthe average excess return rate of 20 trials in each period

steadily increase in these periods there are also some minorfluctuations which cause the genetic algorithms to be inferiorto the BH strategy in these periods

Category 4 (periods 4 13 19 20 and 21) Genetic algorithmtrading rules demonstrate poor performance in these fiveperiods In period 21 the BH strategy yields negative returnsOur genetic trading rules yield more severe losses TheBH strategy is considered superior to the generated tradingrules in the other four periods as the BH strategy yieldssome returns While there are no significant changes in theprices level in these periods the prices are in volatile statesthroughout the five periods Slight price changes with noapparent trends render the generated trading rules helplessin predicting price changes and providing returns

We use genetic algorithms to search goodmoving averagetrading rules for traders in the crude oil market Table 3which shows the average number of 119872 and 119873 for everyperiod indicates that the value of long period (119872) has aclose relationship with the volatility of the prices in thesample period A large 119872 is set in periods with significantfluctuations and a small 119872 is selected for periods in whichprice is relatively stable

The distribution of 119872 is shown in Figure 4 The valueof Probability is very small and 119872 does not follow normaldistributionThefigure presents a typical fat tail characteristicwith a kurtosis of 236 Compared with normal distributionthere are more values located in the tails of the distribution in

our results Only in half of the 420 experiments119872 is between70 days and 130 days The values are decentralized and webelieve it is more scientific to choose the best lengths of thetwo periods using a training process that we have used in thispaper in actual investment

Among the six moving average calculation methodsAMA and TMA are used more often than the other four(see Table 4) as more than half of the generated movingaverage trading rules use AMA or TMA A small number ofgenerated trading rules use WMA and EMA while TPMAand SMA which are easy to calculate are frequently used insome periods such as periods 1 2 3 12 19 and 21

The selection of calculationmethod is associated with theprice trends and volatility Figure 5 shows that TPMA is used31 times in the 60 independent experiments in periods 2 3and 9 (Category 1) Different from the overall proportionTPMA is the most popular calculation method when pricefalls during the period and experienced significant fluctua-tions AMA is the most popular method in the other threecategories EMA is never used inCategories 1 and 4 Howeverit takes a 24 proportion in Category 2 more than TMASMA TPMA and WMA The proportions of TMA andSMA have no significant differences in different categoriesIn category 4 prices change with no apparent trends No onemethod has obvious advantage over the others

The results of 20 experiments in the same period indicatehigh consistency on the value sd (Table 5) When pricesfluctuate such as in periods 1 2 7 8 13 19 and 20 then not

Mathematical Problems in Engineering 7

Table 3 The average value of119872 and119873 in each period

Period 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 AvgAvg (119872) 104 108 65 121 101 59 51 55 143 107 140 131 118 81 78 96 160 119 112 101 71 101Avg (119873) 24 36 15 45 29 29 26 16 47 37 36 43 44 47 22 18 53 24 19 31 40 32

Table 4 Calculation methods of moving average price in each period

Method Period1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Count

SMA 7 4 1 4 3 3 7 4 10 1 2 1 13 6 3 69WMA 1 1 1 5 3 2 1 3 6 23EMA 1 4 7 2 2 15 31AMA 1 1 20 15 14 8 8 2 9 4 18 16 18 2 1 8 145TPMA 8 19 12 2 3 2 6 2 1 3 9 67TMA 2 4 3 1 8 11 11 2 13 2 19 1 1 7 85

opening positions until one average price exceeds another byat least one standard deviation is the best option When theprice is relatively stable an investment decision should bemade immediately as long as the two moving averages cross

4 Discussion

This paper attempts to generate moving average tradingrules in the oil futures market using genetic algorithmsDifferent from other studies we use only moving averages astechnical indicators to identify usefulmoving average tradingrules without any other complex technical analysis tools orindicators Moving average trading rules are easy for tradersto operate and they are straightforward regardless of thesituation To identify the best trading rules in the crude oilfutures market we use genetic algorithms to select all theparameters in the moving average trading rules dynamicallyrather than doing so in a fixed manner

According to our genetic calculations using geneticalgorithms to find out the best lengths of the two movingaverage periods is advocated because the generated lengthsdiffer from each other in different price trends Static movingaverage trading rules with fixed period lengths cannot adaptto complex fluctuations of price in different periods Atraining process however which takes dynamic features ofprice fluctuations into consideration can help traders find outthe optimal lengths of the two moving periods of a tradingrule

Among the six moving average methods the AMA andTMAare themost popular among the generated trading rulesas these two methods have the ability to adapt to the pricetrendsThe AMA can change the weights of the current priceaccording to the volatility in the last several days As theTMA is the average of the SMA it more accurately reflectsthe price level However the selection of best moving averagecalculation method is affected by price trends Traders canchoose methods more scientifically according to the pricetrends and fluctuations Based on our experiment resultsTPMA is an optimal choice when price experiences a declineprocess with significant fluctuations and generating moving

average trading rules are outstanding compared with BHstrategy in these occasions Although EMA takes a verysmall proportion in the total 420 experiments it is alsoan applicable method other than AMA when price fallssmoothly

For the periods in which the price volatility is apparentdecisions will not be made until the difference betweenthe two averages exceeds the standard deviation of theshort sample prices thereby reducing the transaction riskHowever this method is not suitable for a period in whichthe price is relatively stable In these situations hesitationmaysometimes cause traders tomiss possible profit opportunities

As a whole generated moving average trading rules canhelp traders make profits in the long term However geneticalgorithms cannot guarantee access to additional revenuein every period as they are only useful in acquiring excessreturns in special situations The generated moving averagetrading rules demonstrate outstanding performance whenthe crude oil futures price falls with significant fluctuationsThe BH strategy will lose on these occasions while thegenerated trading rule can help traders foresee a decline inprice and reduce losses Our trading rules also yield positivereturns during the fluctuations by the timely changing ofpositions

When the price falls smoothly with few fluctuations inthe process generated trading rules can yield excess returnscompared to the BH strategy Although genetic algorithmscannot help traders receive positive returns during theseperiods the algorithms can help traders reduce loss bychanging positions with the change of price trends Whenthe price is stable or rising smoothly the generated rulesmay generate returns However they cannot generate morereturns than the BH strategy Limited returns cannot affordthe transaction costsWhen the price falls the generated rulesmay be superior to the BH strategy Genetic algorithms canalso help tradersmake profits in the process of price increaseswith small fluctuations In these periods the BH strategy isbetter than generated trading rules because the transactionsin the process generate transaction costs and may miss someprofit opportunities Generated moving average trading rules

8 Mathematical Problems in Engineering

Table 5 Numbers of trading rules in which sd = 1

Period 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 CountCount 19 19 20 0 5 3 13 12 0 2 0 0 13 2 0 2 0 1 20 19 0 150

0

4

8

12

16

20

24

28

32

20 40 60 80 100 120 140 160 180

Mean 1009833Median 1020000Maximum 1940000Minimum 6000000Std dev 4443764Skewness 0011466Kurtosis 2361692

Jarque-Bera 7139346Probability 0028165

Series MSample 1 420Observations 420

Figure 4 Distribution of119872

0 02 04 06 08 1

Cat

egor

y 1

Cat

egor

y 2

Cat

egor

y 3

Cat

egor

y 4

SMAWMAEMA

AMATPMATMA

Figure 5 Proportions of methods in different categories

have poor performance if there are no notable trends in theprice change In these periods moving average indicatorscannot find profit opportunities because the volatility is toosmall The trends of price changes are delayed by the movingaveragemethodTherefore when a decision ismade the pricetrend must also change and as a result there is no doubt thatthe trader will experience deficits

Using genetic algorithms moving average trading rulesdo help traders to gain returns in the actual futures market

We also identified the best lengths for the two periods withrespect to moving average rules and recommend the movingaverage calculation method for the crude oil futures marketTechnical trading rules with only moving average indicatorsgenerated by genetic algorithms demonstrate no sufficientadvantages compared to the BH strategy because the overallprice increased during the 30-year period Nevertheless gen-erated moving trading rules are beneficial for traders undercertain circumstances especially when there are significantchanges in prices

In this paper we search best trading rules according to thereturn rate of each one without regard to asset conditions andopen interest which proves to be the greatest limitation of thestudy To improve the accuracy of the results a simulationwith actual assets is recommended Accordingly we willundertake this endeavor in a subsequent research

5 Concluding Remarks

We conclude that the genetic algorithms identify bettertechnical rules that allow traders to actualize profits fromtheir investmentsWhile we have no evidence to demonstratethat generated trading rules result in greater returns thandoes the BH strategy our conclusion is consistent with theefficient market hypothesis While generated trading rulesfacilitate traders in realizing excess returns with respect totheir investing activities under specific circumstances theycannot at least by usingmoving average trading rules ensuremore long-term excess returns than the BH strategy Withrespect to the selection of two periods finding out optimallengths using genetic algorithms is helpful for making moreprofits Of the six moving average indicators AMA and TMAare the most popular moving average calculation methodsfor the crude oil futures market in total while TPMA is an

Mathematical Problems in Engineering 9

outstanding method in some occasion When the crude oilprices demonstrate notable volatility a trader is advised towait until the difference of the two moving averages exceedsthe standard deviation of the short period and vice versa

Based on the above analysis it is better to use BH strategywhen the price increases or is stable However generatedmoving average trading rules are better than BH strategywhen crude oil futures price decreases With respect to themoving average calculation method it is advocated to useTPMA when price falls with significant fluctuations andAMA when price falls smoothly although TPMA is not apopularmethod overallWe propose variablemoving averagetrading rules generated by training processes rather thanstatic moving average trading rules in the crude oil futuresmarkets

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Authorsrsquo Contribution

Model design was done by Haizhong An Lijun Wangand Xuan Huang program development and experimentsperformance were done by Xiaojia Liu and Lijun Wang dataanalysis was done by Haizhong An Xiaohua Xia and XiaoqiSun paper composition was done by Lijun Wang XiaohuaXia and Xiaojia Liu and literature retrieval and manuscriptediting were done by Xiaojia Liu Xuan Huang and XiaoqiSun

Acknowledgments

This research was partly supported by the NSFC (China)(Grant no 71173199) and Humanities and the Social Sciencesplanning funds project under the Ministry of Education ofthe PRC (Grant no 10YJA630001) The authors would like toacknowledge valuable suggestions fromWei Fang XiaoliangJia and Qier An

References

[1] Z M Chen and G Q Chen ldquoDemand-driven energy require-ment of world economy 2007 a multi-region input-outputnetwork simulationrdquo Communications in Nonlinear Science andNumerical Simulation vol 18 no 7 pp 1757ndash1774 2013

[2] G Wu L-C Liu and Y-M Wei ldquoComparison of Chinarsquos oilimport risk results based on portfolio theory and a diversifica-tion index approachrdquo Energy Policy vol 37 no 9 pp 3557ndash35652009

[3] X H Xia G T Huang G Q Chen B Zhang Z M Chenand Q Yang ldquoEnergy security efficiency and carbon emissionof Chinese industryrdquo Energy Policy vol 39 no 6 pp 3520ndash35282011

[4] X H Xia and G Q Chen ldquoEnergy abatement in Chineseindustry cost evaluation of regulation strategies and allocationalternativesrdquo Energy Policy vol 45 pp 449ndash458 2012

[5] N Cui Y Lei andW Fang ldquoDesign and impact estimation of areform program of Chinarsquos tax and fee policies for low-grade oiland gas resourcesrdquo Petroleum Science vol 8 no 4 pp 515ndash5262011

[6] Y L Lei N Cui and D Y Pan ldquoEconomic and socialeffects analysis of mineral development in China and policyimplicationsrdquo Resources Policy vol 38 pp 448ndash457 2013

[7] Z M Chen and G Q Chen ldquoAn overview of energy consump-tion of the globalized world economyrdquo Energy Policy vol 39 no10 pp 5920ndash5928 2011

[8] N Nomikos and K Andriosopoulos ldquoModelling energy spotprices empirical evidence from NYMEXrdquo Energy Economicsvol 34 no 4 pp 1153ndash1169 2012

[9] G B Ning Z J Zhen P Wang Y Li and H X Yin ldquoEconomicanalysis on value chain of taxi fleet with battery-swappingmodeusingmultiobjective genetic algorithmrdquoMathematical Problemsin Engineering vol 2012 Article ID 175912 15 pages 2012

[10] S Chai Y B Li J Wang and C Wu ldquoA genetic algorithmfor task scheduling on NoC using FDH cross efficiencyrdquoMathematical Problems in Engineering vol 2013 Article ID708495 16 pages 2013

[11] G Q Chen and B Chen ldquoResource analysis of the Chinesesociety 1980ndash2002 based on exergy Part 1 fossil fuels and energymineralsrdquo Energy Policy vol 35 no 4 pp 2038ndash2050 2007

[12] Z Chen G Chen X Xia and S Xu ldquoGlobal network ofembodied water flow by systems input-output simulationrdquoFrontiers of Earth Science vol 6 no 3 pp 331ndash344 2012

[13] Z M Chen and G Q Chen ldquoEmbodied carbon dioxideemission at supra-national scale a coalition analysis for G7BRIC and the rest of the worldrdquo Energy Policy vol 39 no 5pp 2899ndash2909 2011

[14] H Z An X-Y Gao W Fang X Huang and Y H Ding ldquoTherole of fluctuating modes of autocorrelation in crude oil pricesrdquoPhysica A vol 393 pp 382ndash390 2014

[15] X-Y GaoH-Z AnH-H Liu andY-HDing ldquoAnalysis on thetopological properties of the linkage complex network betweencrude oil future price and spot pricerdquo Acta Physica Sinica vol60 no 6 Article ID 068902 2011

[16] X-Y Gao H Z An and W Fang ldquoResearch on fluctuation ofbivariate correlation of time series based on complex networkstheoryrdquo Acta Physica Sinica vol 61 no 9 Article ID 0989022012

[17] S Yu and Y-M Wei ldquoPrediction of Chinarsquos coal production-environmental pollution based on a hybrid genetic algorithm-system dynamics modelrdquo Energy Policy vol 42 pp 521ndash5292012

[18] S Geisendorf ldquoInternal selection and market selection in eco-nomic genetic algorithmsrdquo Journal of Evolutionary Economicsvol 21 no 5 pp 817ndash841 2011

[19] R Tehrani and F Khodayar ldquoA hybrid optimized artificialintelligent model to forecast crude oil using genetic algorithmrdquoAfrican Journal of Business Management vol 5 pp 13130ndash131352011

[20] A M Elaiw X Xia and A M Shehata ldquoMinimization of fuelcosts and gaseous emissions of electric power generation bymodel predictive controlrdquo Mathematical Problems in Engineer-ing vol 2013 Article ID 906958 15 pages 2013

[21] L Mendes P Godinho and J Dias ldquoA Forex trading systembased on a genetic algorithmrdquo Journal of Heuristics vol 18 no4 pp 627ndash656 2012

10 Mathematical Problems in Engineering

[22] M C Roberts ldquoTechnical analysis and genetic programmingconstructing and testing a commodity portfoliordquo Journal ofFutures Markets vol 25 no 7 pp 643ndash660 2005

[23] J-Y Potvin P Soriano and V Maxime ldquoGenerating tradingrules on the stock markets with genetic programmingrdquo Com-puters and Operations Research vol 31 no 7 pp 1033ndash10472004

[24] A Esfahanipour and S Mousavi ldquoA genetic programmingmodel to generate risk-adjusted technical trading rules in stockmarketsrdquo Expert Systems with Applications vol 38 no 7 pp8438ndash8445 2011

[25] M A H Dempster T W Payne Y Romahi and G W PThompson ldquoComputational learning techniques for intradayFX trading using popular technical indicatorsrdquo IEEE Transac-tions on Neural Networks vol 12 no 4 pp 744ndash754 2001

[26] T Nakashima Y Yokota Y Shoji and H Ishibuchi ldquoA geneticapproach to the design of autonomous agents for futurestradingrdquo Artificial Life and Robotics vol 11 no 2 pp 145ndash1482007

[27] A Ghandar Z Michalewicz M Schmidt T-D To and RZurbrugg ldquoComputational intelligence for evolving tradingrulesrdquo IEEE Transactions on Evolutionary Computation vol 13no 1 pp 71ndash86 2009

[28] W L Tung and C Quek ldquoFinancial volatility trading usinga self-organising neural-fuzzy semantic network and optionstraddle-based approachrdquo Expert Systems with Applications vol38 no 5 pp 4668ndash4688 2011

[29] C-H Cheng T-L Chen and L-Y Wei ldquoA hybrid model basedon rough sets theory and genetic algorithms for stock priceforecastingrdquo Information Sciences vol 180 no 9 pp 1610ndash16292010

[30] P-C Chang C-Y Fan and J-L Lin ldquoTrend discovery infinancial time series data using a case based fuzzy decision treerdquoExpert Systems with Applications vol 38 no 5 pp 6070ndash60802011

[31] G A Vasilakis K A Theofilatos E F Georgopoulos AKarathanasopoulos and S D Likothanassis ldquoA genetic pro-gramming approach for EURUSD exchange rate forecastingand tradingrdquo Computational Economics vol 42 no 4 pp 415ndash431 2013

[32] I A Boboc and M C Dinica ldquoAn algorithm for testing theefficient market hypothesisrdquo PLoS ONE vol 8 no 10 ArticleID e78177 2013

[33] W Cheung K S K Lam and H F Yeung ldquoIntertemporalprofitability and the stability of technical analysis evidencesfrom the Hong Kong stock exchangerdquo Applied Economics vol43 no 15 pp 1945ndash1963 2011

[34] H Dewachter and M Lyrio ldquoThe economic value of technicaltrading rules a nonparametric utility-based approachrdquo Interna-tional Journal of Finance and Economics vol 10 no 1 pp 41ndash622005

[35] A Fernandez-Perez F Fernandez-Rodrıguez and S Sosvilla-Rivero ldquoExploiting trends in the foreign exchange marketsrdquoApplied Economics Letters vol 19 no 6 pp 591ndash597 2012

[36] M Metghalchia J Marcucci and Y-H Chang ldquoAre movingaverage trading rules profitable Evidence from the EuropeanstockmarketsrdquoApplied Economics vol 44 no 12 pp 1539ndash15592012

[37] C J Neely P A Weller and J M Ulrich ldquoThe adaptive mar-kets hypothesis evidence from the foreign exchange marketrdquoJournal of Financial and Quantitative Analysis vol 44 no 2 pp467ndash488 2009

[38] W E Shambora and R Rossiter ldquoAre there exploitable ineffi-ciencies in the futures market for oilrdquo Energy Economics vol29 no 1 pp 18ndash27 2007

[39] F Allen and R Karjalainen ldquoUsing genetic algorithms to findtechnical trading rulesrdquo Journal of Financial Economics vol 51no 2 pp 245ndash271 1999

[40] J Wang ldquoTrading and hedging in SampP 500 spot and futuresmarkets using genetic programmingrdquo Journal of Futures Mar-kets vol 20 no 10 pp 911ndash942 2000

[41] J HowM Ling and P Verhoeven ldquoDoes size matter A geneticprogramming approach to technical tradingrdquo QuantitativeFinance vol 10 no 2 pp 131ndash140 2010

[42] F Wang P L H Yu and D W Cheung ldquoCombining technicaltrading rules using particle swarm optimizationrdquo Expert Sys-tems with Applications vol 41 no 6 pp 3016ndash3026 2014

[43] J Andrada-Felix and F Fernandez-Rodrıguez ldquoImprovingmoving average trading rules with boosting and statisticallearningmethodsrdquo Journal of Forecasting vol 27 no 5 pp 433ndash449 2008

[44] T T-L Chong and W-K Ng ldquoTechnical analysis and theLondon stock exchange testing the MACD and RSI rules usingthe FT30rdquoApplied Economics Letters vol 15 no 14 pp 1111ndash11142008

[45] I Cialenco andA Protopapadakis ldquoDo technical trading profitsremain in the foreign exchange market Evidence from 14 cur-renciesrdquo Journal of International Financial Markets Institutionsand Money vol 21 no 2 pp 176ndash206 2011

[46] A E Milionis and E Papanagiotou ldquoDecomposing the predic-tive performance of themoving average trading rule of technicalanalysis the contribution of linear andnon-linear dependenciesin stock returnsrdquo Journal of Applied Statistics vol 40 no 11 pp2480ndash2494 2013

[47] Y S Ni J T Lee and Y C Liao ldquoDo variable length movingaverage trading rules matter during a financial crisis periodrdquoApplied Economics Letters vol 20 no 2 pp 135ndash141 2013

[48] V Pavlov and S Hurn ldquoTesting the profitability of moving-average rules as a portfolio selection strategyrdquo Pacific-BasinFinance Journal vol 20 no 5 pp 825ndash842 2012

[49] C Chiarella X-Z He and C Hommes ldquoA dynamic analysisof moving average rulesrdquo Journal of Economic Dynamics ampControl vol 30 no 9-10 pp 1729ndash1753 2006

[50] X-Z He and M Zheng ldquoDynamics of moving average rules ina continuous-time financialmarketmodelrdquo Journal of EconomicBehavior and Organization vol 76 no 3 pp 615ndash634 2010

[51] C Neely P Weller and R Dittmar Is Technical Analysis in theForeign Exchange Market Profitable A Genetic ProgrammingApproach Cambridge University Press 1997

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Mathematical Problems in Engineering 3

Table 1 Details of the six moving average indicators

Indicator Calculation method (119901 denotes price)

SMA SMA (119896) =1119899

119899minus1

sum

119894=0

119901119896minus119894

WMA WMA(119896) =sum119899minus1

119894=0(119899 minus 119894)119901

119896minus119894

sum119899minus1

119894=0(119899 minus 119894)

EMAEMA(119896) = EMA(119896 minus 1) + SC (119901

119896minus EMA (119896 minus 1))

where SC = 2(1 + 119899)

AMA

AMA(119896) = AMA(119896 minus 1) + SSC119896

2

(119901119896minus AMA (119896 minus 1))

where SSC119896= ER119896(fastSC minus slowSC) + slowSC

fastSC = 2(1 + 2)

slowSC = 2(1 + 30)

ER119896=

1003816100381610038161003816119901119896 minus 119901119896minus1198991003816100381610038161003816

sum119896

119894=119896minus119899+1

1003816100381610038161003816119901119894 minus 119901119894minus11003816100381610038161003816

TPMA TPMA(119896) =(high + low + close)

3

where high = max(119901119898 119901119898minus1 119901

119898minus119899+1) low = min(119901

119898 119901119898minus1 119901

119898minus119899+1) close = 119901

119898

TMA TMA(119896) = 1119899

119899minus1

sum

119894=0

SAM(119896 minus 119894)

200days

200days

200days

200days 300days

300days

300days

300days

500days

500days

500days 500days

500days

500days

500days 500days

March 29 1985April 4 1983

March 29 1985

June 11 1986

August 21 1987

March 10 2009 February 26 2013

February 26 2013

August 13 1991

June 4 1990

March 27 1989Period 1

Period 2

Period 3

Period 21

Auxiliary data calculate the moving average prices in the training periodTraining data evaluate and select the generated trading rules in each generation

Selection data test the best individual in every generation identify the best trading rule in a trailTest data test the generated moving average trading rule to actualize excess return

Periods 4 5 20

Figure 1 Data selection

change trading strategies only when there is more than onestandard deviation difference between two moving averageprices The structure of trading rules is presented in Figure 2The fitness of a trading rule is calculated according to theprofit it canmake in the crude oil futures market To comparegenerated trading rules with the BH (buy-and-hold takingthe long position throughout the period) strategy the profitof a generated rule is the excess return rate that exceeds theBH strategy

The calculation method of the return rate references AKrsquosmethod The difference is that we allow a trader to hold aposition for a long time and we do not calculate the returnevery day Consider

Ra = Ral + Ras + Rf minus Rbh

Ral =sum119899

119894=1((119875out minus 119875in) 119875in lowast (1 minus 119888) (1 + 119888))

Rm

Ras =sum119898

119894=1((119875out minus 119875in) 119875in lowast (1 minus 119888) (1 + 119888))

Rm

Rbh =(119875begin minus 119875end)

119875beginlowast(1 minus 119888) (1 + 119888)

Rm

(1)

Ra is the excess return rate of a long position strategythat is the sum of the return of the long position and short

4 Mathematical Problems in Engineering

Seven-binary Six-binary ree-binary One-binary

Decimal x Decimal y Decimal z Boolean sd

1 SMA

2 WMA

3 EMA

4 AMA

5 TPMA

6 TMA

Each string represents a trading ruleTake a long position if the moving average price (using method I)of M-days is lower than that of N-days and take a short position inthe opposite case If the sd is 1 keep out of the market to earn therisk free return until the difference between the two movingaverages exceeds the standard deviation of N-days prices

Method I = mod ((z + 1) 6) (1ndash6)

Short period N = y + 1 (1sim64) Long period M = N+ x + 5 (6ndash196) Marker sd = 0 or 1

Binary to decimalor boolean

Figure 2 Structure of trading rules

position Rf is the risk free return when out of market andRbh is the return rate of the BH strategy in the sample periodRm is the margin ratio of the futures market The parameter119888 denotes the one-way transaction cost rate 119875in and 119875outrepresent the opening price and closing price of a position(long or short) respectively 119875begin is the price of the first dayin a whole period and 119875end is the price of the last day As weignore the amount of change in the everyday margin and thedeadline of the contract a trader canmaintain his strategy bytaking new positions when a contract nears its closing date

The fitness value is a number between 0 and 2 calculatedthrough nonlinear conversion according to Ra The fitnessvalue calculation selection crossover and mutation of indi-viduals are implemented using the GA toolbox of Sheffieldin the Matlab platform In every generation to avoid theoverfitting of training data the best trading rule in everygeneration will be tested in a selection sample period (the200-day price series) Only when the fitness value is higherthan the best value in the last generation or when the twovalues are almost the same (119891lastminus119891now lt 005) can the tradingrule be marked as the best thus far In every generation 90percent of the population will be selected to form a newgeneration while the other 10 percent will be randomlygenerated Accordingly the evolution of individuals usinggenetic algorithms in a single independent experiment canbe summarized as follows

Step 1 (initialize population) Randomly create an initialpopulation of 20 moving average trading rules

Step 2 (evaluate individuals) The fitness of every individualis calculated in the evaluation step The program calculatesthe moving average prices in two different scales during thetraining period using the auxiliary data and determines thepositions on each trading day The excess return rate of everyindividual is then calculated Finally the fitness value of eachindividual is calculated according to the excess return rate

Step 3 (remember the best trading rule) Select the rule withthe highest fitness value and evaluate it for the selection

period to obtain its return rate If it is better than or notinferior to the current best rule it will be marked as the besttrading rule If its return rate is lower than or less than 005higher than the current rate we retain the current rule as thebest one

Step 4 (generate new population) Selecting 18 individualsaccording to their fitness values the same individual couldbe selected more than once Therefore randomly create 2additional trading rules With a probability of 07 performa recombination operation to generate a new populationAccordingly all the recombination rules will be mutated witha probability of 005

Step 5 Return to Step 2 and repeat 50 times

Step 6 (test the best trading rule) Test the best trading rule asidentified by the above programThis will generate the returnrate and indicate whether genetic algorithms can help tradersactualize excess returns during this sample period

3 Results

Because in this paper we have not considered the amount ofassets we assume the margin ratio to be 005 In fact as theparameter has no significant effect on our experiment resultsthe return rate is increased twenty times With 20 trials ineach period 420 independent experiments are conducted todetermine useful moving average trading rules in the crudeoil futures market The prices we used for the 21 periods areshown in Figure 3

Based on previous studies [39 40 51] and on the decisionto select an intermediate value for this study the transactioncost rate is set at 01 for the 420 experiments The risk freereturn rate is 2 which is based primarily on the short-termtreasury bond rate [41]

Of the 420 trials 226 earn profits With an average returnrate of 1446 it is concluded that genetic algorithms canfacilitate traders to obtain returns in the crude oil futures

Mathematical Problems in Engineering 5

8503 89030

20

40(1)

8606 900510

20

30(2)

8708 91070

50(3)

8810 92100

50(4)

9001 93120

50(5)

9103 950210

20

30(6)

9205 960510

20

30(7)

9308 970710

20

30(8)

9410 980910

20

30(9)

9512 991210

20

30(10)

9703 01020

20

40(11)

9805 02040

20

40(12)

9907 03070

20

40(13)

0010 04090

50

100(14)

0112 05120

50

100(15)

0303 07020

50

100(16)

0405 08050

100

200(17)

0508 09070

100

200(18)

0610 10090

100

200(19)

0712 11120

100

200(20)

0903 13020

100

200(21)

Figure 3 Sample data

market However moving average trading rules identified bygenetic algorithms do not result in excess returns as thereare only 8 periods in which generated trading rules resultedin traders receiving excess returns Given that the price ofcrude oil futures increased many times during the sampleperiod we further contend that genetic algorithms are helpfulin investments

For a better understanding we divide the 21 periods into4 categories according to the results (see the last column ofTable 2)

Category 1 (periods 2 3 and 9) In these periods generatedtrading rules not only help traders obtain returns but alsohelp them to realize excess returns Generated trading rulesgenerate more profits than the BH strategy in periods 3and 9 In period 2 the BH strategy loses money whilethe generated trading rules as determined by the genetic

algorithms result in profitsThus the generated trading rulesare far superior to the BH strategy in this period A commonfeature of these three periods inCategory 1 is that the crude oilprices fell during the test period and experienced significantfluctuations

Category 2 (periods 5 8 12 16 and 18) Generated movingaverage trading rules fail to generate profits during these fiveperiods Even so the generated rules performed better thanthe BH strategy as they significantly reduced losses In theseperiods prices declined smoothly experiencing some smallfluctuations during the process

Category 3 (periods 1 6 7 10 11 14 15 and 17) In theseeight sample data periods genetic algorithms help tradersto identify suitable moving average trading rules Howeverthe traders failed to obtain excess returns While prices

6 Mathematical Problems in Engineering

Table 2 Results of experiment

Period 119876119886 119876 Rbh 119877 119877119886 Classification1 3 12 3768 0663 minus3105 32 20 20 minus2946 2899 5845 13 15 16 5299 7717 2419 14 1 6 0647 minus0862 minus1510 45 20 11 minus7185 minus0097 7088 26 1 12 4976 0808 minus4168 37 5 11 5240 1854 minus3386 38 10 9 minus1175 minus0357 0818 29 19 12 minus5610 0691 6301 110 0 16 16338 6943 minus9396 311 1 13 2740 0127 minus2613 312 15 11 minus1420 minus0576 0844 213 0 7 4343 minus2296 minus6640 414 0 14 14069 3141 minus10928 315 7 8 2287 0273 minus2014 316 12 9 minus0715 minus0092 0622 217 0 20 26227 21037 minus5190 318 20 3 minus9746 minus4131 5615 219 0 0 3512 minus6091 minus9603 420 1 10 2968 minus0193 minus3161 421 7 6 minus0162 minus1092 minus0930 4119876119886 is the number of generated trading rules receiving positive excess returns compared with the BH strategy in the 20 trials 119876 is the number of generatedtrading rules acquiring returns in the test periods Rbh is the return rate of the BH strategy 119877 is the average return rate of the 20 trials in each period 119877119886 isthe average excess return rate of 20 trials in each period

steadily increase in these periods there are also some minorfluctuations which cause the genetic algorithms to be inferiorto the BH strategy in these periods

Category 4 (periods 4 13 19 20 and 21) Genetic algorithmtrading rules demonstrate poor performance in these fiveperiods In period 21 the BH strategy yields negative returnsOur genetic trading rules yield more severe losses TheBH strategy is considered superior to the generated tradingrules in the other four periods as the BH strategy yieldssome returns While there are no significant changes in theprices level in these periods the prices are in volatile statesthroughout the five periods Slight price changes with noapparent trends render the generated trading rules helplessin predicting price changes and providing returns

We use genetic algorithms to search goodmoving averagetrading rules for traders in the crude oil market Table 3which shows the average number of 119872 and 119873 for everyperiod indicates that the value of long period (119872) has aclose relationship with the volatility of the prices in thesample period A large 119872 is set in periods with significantfluctuations and a small 119872 is selected for periods in whichprice is relatively stable

The distribution of 119872 is shown in Figure 4 The valueof Probability is very small and 119872 does not follow normaldistributionThefigure presents a typical fat tail characteristicwith a kurtosis of 236 Compared with normal distributionthere are more values located in the tails of the distribution in

our results Only in half of the 420 experiments119872 is between70 days and 130 days The values are decentralized and webelieve it is more scientific to choose the best lengths of thetwo periods using a training process that we have used in thispaper in actual investment

Among the six moving average calculation methodsAMA and TMA are used more often than the other four(see Table 4) as more than half of the generated movingaverage trading rules use AMA or TMA A small number ofgenerated trading rules use WMA and EMA while TPMAand SMA which are easy to calculate are frequently used insome periods such as periods 1 2 3 12 19 and 21

The selection of calculationmethod is associated with theprice trends and volatility Figure 5 shows that TPMA is used31 times in the 60 independent experiments in periods 2 3and 9 (Category 1) Different from the overall proportionTPMA is the most popular calculation method when pricefalls during the period and experienced significant fluctua-tions AMA is the most popular method in the other threecategories EMA is never used inCategories 1 and 4 Howeverit takes a 24 proportion in Category 2 more than TMASMA TPMA and WMA The proportions of TMA andSMA have no significant differences in different categoriesIn category 4 prices change with no apparent trends No onemethod has obvious advantage over the others

The results of 20 experiments in the same period indicatehigh consistency on the value sd (Table 5) When pricesfluctuate such as in periods 1 2 7 8 13 19 and 20 then not

Mathematical Problems in Engineering 7

Table 3 The average value of119872 and119873 in each period

Period 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 AvgAvg (119872) 104 108 65 121 101 59 51 55 143 107 140 131 118 81 78 96 160 119 112 101 71 101Avg (119873) 24 36 15 45 29 29 26 16 47 37 36 43 44 47 22 18 53 24 19 31 40 32

Table 4 Calculation methods of moving average price in each period

Method Period1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Count

SMA 7 4 1 4 3 3 7 4 10 1 2 1 13 6 3 69WMA 1 1 1 5 3 2 1 3 6 23EMA 1 4 7 2 2 15 31AMA 1 1 20 15 14 8 8 2 9 4 18 16 18 2 1 8 145TPMA 8 19 12 2 3 2 6 2 1 3 9 67TMA 2 4 3 1 8 11 11 2 13 2 19 1 1 7 85

opening positions until one average price exceeds another byat least one standard deviation is the best option When theprice is relatively stable an investment decision should bemade immediately as long as the two moving averages cross

4 Discussion

This paper attempts to generate moving average tradingrules in the oil futures market using genetic algorithmsDifferent from other studies we use only moving averages astechnical indicators to identify usefulmoving average tradingrules without any other complex technical analysis tools orindicators Moving average trading rules are easy for tradersto operate and they are straightforward regardless of thesituation To identify the best trading rules in the crude oilfutures market we use genetic algorithms to select all theparameters in the moving average trading rules dynamicallyrather than doing so in a fixed manner

According to our genetic calculations using geneticalgorithms to find out the best lengths of the two movingaverage periods is advocated because the generated lengthsdiffer from each other in different price trends Static movingaverage trading rules with fixed period lengths cannot adaptto complex fluctuations of price in different periods Atraining process however which takes dynamic features ofprice fluctuations into consideration can help traders find outthe optimal lengths of the two moving periods of a tradingrule

Among the six moving average methods the AMA andTMAare themost popular among the generated trading rulesas these two methods have the ability to adapt to the pricetrendsThe AMA can change the weights of the current priceaccording to the volatility in the last several days As theTMA is the average of the SMA it more accurately reflectsthe price level However the selection of best moving averagecalculation method is affected by price trends Traders canchoose methods more scientifically according to the pricetrends and fluctuations Based on our experiment resultsTPMA is an optimal choice when price experiences a declineprocess with significant fluctuations and generating moving

average trading rules are outstanding compared with BHstrategy in these occasions Although EMA takes a verysmall proportion in the total 420 experiments it is alsoan applicable method other than AMA when price fallssmoothly

For the periods in which the price volatility is apparentdecisions will not be made until the difference betweenthe two averages exceeds the standard deviation of theshort sample prices thereby reducing the transaction riskHowever this method is not suitable for a period in whichthe price is relatively stable In these situations hesitationmaysometimes cause traders tomiss possible profit opportunities

As a whole generated moving average trading rules canhelp traders make profits in the long term However geneticalgorithms cannot guarantee access to additional revenuein every period as they are only useful in acquiring excessreturns in special situations The generated moving averagetrading rules demonstrate outstanding performance whenthe crude oil futures price falls with significant fluctuationsThe BH strategy will lose on these occasions while thegenerated trading rule can help traders foresee a decline inprice and reduce losses Our trading rules also yield positivereturns during the fluctuations by the timely changing ofpositions

When the price falls smoothly with few fluctuations inthe process generated trading rules can yield excess returnscompared to the BH strategy Although genetic algorithmscannot help traders receive positive returns during theseperiods the algorithms can help traders reduce loss bychanging positions with the change of price trends Whenthe price is stable or rising smoothly the generated rulesmay generate returns However they cannot generate morereturns than the BH strategy Limited returns cannot affordthe transaction costsWhen the price falls the generated rulesmay be superior to the BH strategy Genetic algorithms canalso help tradersmake profits in the process of price increaseswith small fluctuations In these periods the BH strategy isbetter than generated trading rules because the transactionsin the process generate transaction costs and may miss someprofit opportunities Generated moving average trading rules

8 Mathematical Problems in Engineering

Table 5 Numbers of trading rules in which sd = 1

Period 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 CountCount 19 19 20 0 5 3 13 12 0 2 0 0 13 2 0 2 0 1 20 19 0 150

0

4

8

12

16

20

24

28

32

20 40 60 80 100 120 140 160 180

Mean 1009833Median 1020000Maximum 1940000Minimum 6000000Std dev 4443764Skewness 0011466Kurtosis 2361692

Jarque-Bera 7139346Probability 0028165

Series MSample 1 420Observations 420

Figure 4 Distribution of119872

0 02 04 06 08 1

Cat

egor

y 1

Cat

egor

y 2

Cat

egor

y 3

Cat

egor

y 4

SMAWMAEMA

AMATPMATMA

Figure 5 Proportions of methods in different categories

have poor performance if there are no notable trends in theprice change In these periods moving average indicatorscannot find profit opportunities because the volatility is toosmall The trends of price changes are delayed by the movingaveragemethodTherefore when a decision ismade the pricetrend must also change and as a result there is no doubt thatthe trader will experience deficits

Using genetic algorithms moving average trading rulesdo help traders to gain returns in the actual futures market

We also identified the best lengths for the two periods withrespect to moving average rules and recommend the movingaverage calculation method for the crude oil futures marketTechnical trading rules with only moving average indicatorsgenerated by genetic algorithms demonstrate no sufficientadvantages compared to the BH strategy because the overallprice increased during the 30-year period Nevertheless gen-erated moving trading rules are beneficial for traders undercertain circumstances especially when there are significantchanges in prices

In this paper we search best trading rules according to thereturn rate of each one without regard to asset conditions andopen interest which proves to be the greatest limitation of thestudy To improve the accuracy of the results a simulationwith actual assets is recommended Accordingly we willundertake this endeavor in a subsequent research

5 Concluding Remarks

We conclude that the genetic algorithms identify bettertechnical rules that allow traders to actualize profits fromtheir investmentsWhile we have no evidence to demonstratethat generated trading rules result in greater returns thandoes the BH strategy our conclusion is consistent with theefficient market hypothesis While generated trading rulesfacilitate traders in realizing excess returns with respect totheir investing activities under specific circumstances theycannot at least by usingmoving average trading rules ensuremore long-term excess returns than the BH strategy Withrespect to the selection of two periods finding out optimallengths using genetic algorithms is helpful for making moreprofits Of the six moving average indicators AMA and TMAare the most popular moving average calculation methodsfor the crude oil futures market in total while TPMA is an

Mathematical Problems in Engineering 9

outstanding method in some occasion When the crude oilprices demonstrate notable volatility a trader is advised towait until the difference of the two moving averages exceedsthe standard deviation of the short period and vice versa

Based on the above analysis it is better to use BH strategywhen the price increases or is stable However generatedmoving average trading rules are better than BH strategywhen crude oil futures price decreases With respect to themoving average calculation method it is advocated to useTPMA when price falls with significant fluctuations andAMA when price falls smoothly although TPMA is not apopularmethod overallWe propose variablemoving averagetrading rules generated by training processes rather thanstatic moving average trading rules in the crude oil futuresmarkets

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Authorsrsquo Contribution

Model design was done by Haizhong An Lijun Wangand Xuan Huang program development and experimentsperformance were done by Xiaojia Liu and Lijun Wang dataanalysis was done by Haizhong An Xiaohua Xia and XiaoqiSun paper composition was done by Lijun Wang XiaohuaXia and Xiaojia Liu and literature retrieval and manuscriptediting were done by Xiaojia Liu Xuan Huang and XiaoqiSun

Acknowledgments

This research was partly supported by the NSFC (China)(Grant no 71173199) and Humanities and the Social Sciencesplanning funds project under the Ministry of Education ofthe PRC (Grant no 10YJA630001) The authors would like toacknowledge valuable suggestions fromWei Fang XiaoliangJia and Qier An

References

[1] Z M Chen and G Q Chen ldquoDemand-driven energy require-ment of world economy 2007 a multi-region input-outputnetwork simulationrdquo Communications in Nonlinear Science andNumerical Simulation vol 18 no 7 pp 1757ndash1774 2013

[2] G Wu L-C Liu and Y-M Wei ldquoComparison of Chinarsquos oilimport risk results based on portfolio theory and a diversifica-tion index approachrdquo Energy Policy vol 37 no 9 pp 3557ndash35652009

[3] X H Xia G T Huang G Q Chen B Zhang Z M Chenand Q Yang ldquoEnergy security efficiency and carbon emissionof Chinese industryrdquo Energy Policy vol 39 no 6 pp 3520ndash35282011

[4] X H Xia and G Q Chen ldquoEnergy abatement in Chineseindustry cost evaluation of regulation strategies and allocationalternativesrdquo Energy Policy vol 45 pp 449ndash458 2012

[5] N Cui Y Lei andW Fang ldquoDesign and impact estimation of areform program of Chinarsquos tax and fee policies for low-grade oiland gas resourcesrdquo Petroleum Science vol 8 no 4 pp 515ndash5262011

[6] Y L Lei N Cui and D Y Pan ldquoEconomic and socialeffects analysis of mineral development in China and policyimplicationsrdquo Resources Policy vol 38 pp 448ndash457 2013

[7] Z M Chen and G Q Chen ldquoAn overview of energy consump-tion of the globalized world economyrdquo Energy Policy vol 39 no10 pp 5920ndash5928 2011

[8] N Nomikos and K Andriosopoulos ldquoModelling energy spotprices empirical evidence from NYMEXrdquo Energy Economicsvol 34 no 4 pp 1153ndash1169 2012

[9] G B Ning Z J Zhen P Wang Y Li and H X Yin ldquoEconomicanalysis on value chain of taxi fleet with battery-swappingmodeusingmultiobjective genetic algorithmrdquoMathematical Problemsin Engineering vol 2012 Article ID 175912 15 pages 2012

[10] S Chai Y B Li J Wang and C Wu ldquoA genetic algorithmfor task scheduling on NoC using FDH cross efficiencyrdquoMathematical Problems in Engineering vol 2013 Article ID708495 16 pages 2013

[11] G Q Chen and B Chen ldquoResource analysis of the Chinesesociety 1980ndash2002 based on exergy Part 1 fossil fuels and energymineralsrdquo Energy Policy vol 35 no 4 pp 2038ndash2050 2007

[12] Z Chen G Chen X Xia and S Xu ldquoGlobal network ofembodied water flow by systems input-output simulationrdquoFrontiers of Earth Science vol 6 no 3 pp 331ndash344 2012

[13] Z M Chen and G Q Chen ldquoEmbodied carbon dioxideemission at supra-national scale a coalition analysis for G7BRIC and the rest of the worldrdquo Energy Policy vol 39 no 5pp 2899ndash2909 2011

[14] H Z An X-Y Gao W Fang X Huang and Y H Ding ldquoTherole of fluctuating modes of autocorrelation in crude oil pricesrdquoPhysica A vol 393 pp 382ndash390 2014

[15] X-Y GaoH-Z AnH-H Liu andY-HDing ldquoAnalysis on thetopological properties of the linkage complex network betweencrude oil future price and spot pricerdquo Acta Physica Sinica vol60 no 6 Article ID 068902 2011

[16] X-Y Gao H Z An and W Fang ldquoResearch on fluctuation ofbivariate correlation of time series based on complex networkstheoryrdquo Acta Physica Sinica vol 61 no 9 Article ID 0989022012

[17] S Yu and Y-M Wei ldquoPrediction of Chinarsquos coal production-environmental pollution based on a hybrid genetic algorithm-system dynamics modelrdquo Energy Policy vol 42 pp 521ndash5292012

[18] S Geisendorf ldquoInternal selection and market selection in eco-nomic genetic algorithmsrdquo Journal of Evolutionary Economicsvol 21 no 5 pp 817ndash841 2011

[19] R Tehrani and F Khodayar ldquoA hybrid optimized artificialintelligent model to forecast crude oil using genetic algorithmrdquoAfrican Journal of Business Management vol 5 pp 13130ndash131352011

[20] A M Elaiw X Xia and A M Shehata ldquoMinimization of fuelcosts and gaseous emissions of electric power generation bymodel predictive controlrdquo Mathematical Problems in Engineer-ing vol 2013 Article ID 906958 15 pages 2013

[21] L Mendes P Godinho and J Dias ldquoA Forex trading systembased on a genetic algorithmrdquo Journal of Heuristics vol 18 no4 pp 627ndash656 2012

10 Mathematical Problems in Engineering

[22] M C Roberts ldquoTechnical analysis and genetic programmingconstructing and testing a commodity portfoliordquo Journal ofFutures Markets vol 25 no 7 pp 643ndash660 2005

[23] J-Y Potvin P Soriano and V Maxime ldquoGenerating tradingrules on the stock markets with genetic programmingrdquo Com-puters and Operations Research vol 31 no 7 pp 1033ndash10472004

[24] A Esfahanipour and S Mousavi ldquoA genetic programmingmodel to generate risk-adjusted technical trading rules in stockmarketsrdquo Expert Systems with Applications vol 38 no 7 pp8438ndash8445 2011

[25] M A H Dempster T W Payne Y Romahi and G W PThompson ldquoComputational learning techniques for intradayFX trading using popular technical indicatorsrdquo IEEE Transac-tions on Neural Networks vol 12 no 4 pp 744ndash754 2001

[26] T Nakashima Y Yokota Y Shoji and H Ishibuchi ldquoA geneticapproach to the design of autonomous agents for futurestradingrdquo Artificial Life and Robotics vol 11 no 2 pp 145ndash1482007

[27] A Ghandar Z Michalewicz M Schmidt T-D To and RZurbrugg ldquoComputational intelligence for evolving tradingrulesrdquo IEEE Transactions on Evolutionary Computation vol 13no 1 pp 71ndash86 2009

[28] W L Tung and C Quek ldquoFinancial volatility trading usinga self-organising neural-fuzzy semantic network and optionstraddle-based approachrdquo Expert Systems with Applications vol38 no 5 pp 4668ndash4688 2011

[29] C-H Cheng T-L Chen and L-Y Wei ldquoA hybrid model basedon rough sets theory and genetic algorithms for stock priceforecastingrdquo Information Sciences vol 180 no 9 pp 1610ndash16292010

[30] P-C Chang C-Y Fan and J-L Lin ldquoTrend discovery infinancial time series data using a case based fuzzy decision treerdquoExpert Systems with Applications vol 38 no 5 pp 6070ndash60802011

[31] G A Vasilakis K A Theofilatos E F Georgopoulos AKarathanasopoulos and S D Likothanassis ldquoA genetic pro-gramming approach for EURUSD exchange rate forecastingand tradingrdquo Computational Economics vol 42 no 4 pp 415ndash431 2013

[32] I A Boboc and M C Dinica ldquoAn algorithm for testing theefficient market hypothesisrdquo PLoS ONE vol 8 no 10 ArticleID e78177 2013

[33] W Cheung K S K Lam and H F Yeung ldquoIntertemporalprofitability and the stability of technical analysis evidencesfrom the Hong Kong stock exchangerdquo Applied Economics vol43 no 15 pp 1945ndash1963 2011

[34] H Dewachter and M Lyrio ldquoThe economic value of technicaltrading rules a nonparametric utility-based approachrdquo Interna-tional Journal of Finance and Economics vol 10 no 1 pp 41ndash622005

[35] A Fernandez-Perez F Fernandez-Rodrıguez and S Sosvilla-Rivero ldquoExploiting trends in the foreign exchange marketsrdquoApplied Economics Letters vol 19 no 6 pp 591ndash597 2012

[36] M Metghalchia J Marcucci and Y-H Chang ldquoAre movingaverage trading rules profitable Evidence from the EuropeanstockmarketsrdquoApplied Economics vol 44 no 12 pp 1539ndash15592012

[37] C J Neely P A Weller and J M Ulrich ldquoThe adaptive mar-kets hypothesis evidence from the foreign exchange marketrdquoJournal of Financial and Quantitative Analysis vol 44 no 2 pp467ndash488 2009

[38] W E Shambora and R Rossiter ldquoAre there exploitable ineffi-ciencies in the futures market for oilrdquo Energy Economics vol29 no 1 pp 18ndash27 2007

[39] F Allen and R Karjalainen ldquoUsing genetic algorithms to findtechnical trading rulesrdquo Journal of Financial Economics vol 51no 2 pp 245ndash271 1999

[40] J Wang ldquoTrading and hedging in SampP 500 spot and futuresmarkets using genetic programmingrdquo Journal of Futures Mar-kets vol 20 no 10 pp 911ndash942 2000

[41] J HowM Ling and P Verhoeven ldquoDoes size matter A geneticprogramming approach to technical tradingrdquo QuantitativeFinance vol 10 no 2 pp 131ndash140 2010

[42] F Wang P L H Yu and D W Cheung ldquoCombining technicaltrading rules using particle swarm optimizationrdquo Expert Sys-tems with Applications vol 41 no 6 pp 3016ndash3026 2014

[43] J Andrada-Felix and F Fernandez-Rodrıguez ldquoImprovingmoving average trading rules with boosting and statisticallearningmethodsrdquo Journal of Forecasting vol 27 no 5 pp 433ndash449 2008

[44] T T-L Chong and W-K Ng ldquoTechnical analysis and theLondon stock exchange testing the MACD and RSI rules usingthe FT30rdquoApplied Economics Letters vol 15 no 14 pp 1111ndash11142008

[45] I Cialenco andA Protopapadakis ldquoDo technical trading profitsremain in the foreign exchange market Evidence from 14 cur-renciesrdquo Journal of International Financial Markets Institutionsand Money vol 21 no 2 pp 176ndash206 2011

[46] A E Milionis and E Papanagiotou ldquoDecomposing the predic-tive performance of themoving average trading rule of technicalanalysis the contribution of linear andnon-linear dependenciesin stock returnsrdquo Journal of Applied Statistics vol 40 no 11 pp2480ndash2494 2013

[47] Y S Ni J T Lee and Y C Liao ldquoDo variable length movingaverage trading rules matter during a financial crisis periodrdquoApplied Economics Letters vol 20 no 2 pp 135ndash141 2013

[48] V Pavlov and S Hurn ldquoTesting the profitability of moving-average rules as a portfolio selection strategyrdquo Pacific-BasinFinance Journal vol 20 no 5 pp 825ndash842 2012

[49] C Chiarella X-Z He and C Hommes ldquoA dynamic analysisof moving average rulesrdquo Journal of Economic Dynamics ampControl vol 30 no 9-10 pp 1729ndash1753 2006

[50] X-Z He and M Zheng ldquoDynamics of moving average rules ina continuous-time financialmarketmodelrdquo Journal of EconomicBehavior and Organization vol 76 no 3 pp 615ndash634 2010

[51] C Neely P Weller and R Dittmar Is Technical Analysis in theForeign Exchange Market Profitable A Genetic ProgrammingApproach Cambridge University Press 1997

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

4 Mathematical Problems in Engineering

Seven-binary Six-binary ree-binary One-binary

Decimal x Decimal y Decimal z Boolean sd

1 SMA

2 WMA

3 EMA

4 AMA

5 TPMA

6 TMA

Each string represents a trading ruleTake a long position if the moving average price (using method I)of M-days is lower than that of N-days and take a short position inthe opposite case If the sd is 1 keep out of the market to earn therisk free return until the difference between the two movingaverages exceeds the standard deviation of N-days prices

Method I = mod ((z + 1) 6) (1ndash6)

Short period N = y + 1 (1sim64) Long period M = N+ x + 5 (6ndash196) Marker sd = 0 or 1

Binary to decimalor boolean

Figure 2 Structure of trading rules

position Rf is the risk free return when out of market andRbh is the return rate of the BH strategy in the sample periodRm is the margin ratio of the futures market The parameter119888 denotes the one-way transaction cost rate 119875in and 119875outrepresent the opening price and closing price of a position(long or short) respectively 119875begin is the price of the first dayin a whole period and 119875end is the price of the last day As weignore the amount of change in the everyday margin and thedeadline of the contract a trader canmaintain his strategy bytaking new positions when a contract nears its closing date

The fitness value is a number between 0 and 2 calculatedthrough nonlinear conversion according to Ra The fitnessvalue calculation selection crossover and mutation of indi-viduals are implemented using the GA toolbox of Sheffieldin the Matlab platform In every generation to avoid theoverfitting of training data the best trading rule in everygeneration will be tested in a selection sample period (the200-day price series) Only when the fitness value is higherthan the best value in the last generation or when the twovalues are almost the same (119891lastminus119891now lt 005) can the tradingrule be marked as the best thus far In every generation 90percent of the population will be selected to form a newgeneration while the other 10 percent will be randomlygenerated Accordingly the evolution of individuals usinggenetic algorithms in a single independent experiment canbe summarized as follows

Step 1 (initialize population) Randomly create an initialpopulation of 20 moving average trading rules

Step 2 (evaluate individuals) The fitness of every individualis calculated in the evaluation step The program calculatesthe moving average prices in two different scales during thetraining period using the auxiliary data and determines thepositions on each trading day The excess return rate of everyindividual is then calculated Finally the fitness value of eachindividual is calculated according to the excess return rate

Step 3 (remember the best trading rule) Select the rule withthe highest fitness value and evaluate it for the selection

period to obtain its return rate If it is better than or notinferior to the current best rule it will be marked as the besttrading rule If its return rate is lower than or less than 005higher than the current rate we retain the current rule as thebest one

Step 4 (generate new population) Selecting 18 individualsaccording to their fitness values the same individual couldbe selected more than once Therefore randomly create 2additional trading rules With a probability of 07 performa recombination operation to generate a new populationAccordingly all the recombination rules will be mutated witha probability of 005

Step 5 Return to Step 2 and repeat 50 times

Step 6 (test the best trading rule) Test the best trading rule asidentified by the above programThis will generate the returnrate and indicate whether genetic algorithms can help tradersactualize excess returns during this sample period

3 Results

Because in this paper we have not considered the amount ofassets we assume the margin ratio to be 005 In fact as theparameter has no significant effect on our experiment resultsthe return rate is increased twenty times With 20 trials ineach period 420 independent experiments are conducted todetermine useful moving average trading rules in the crudeoil futures market The prices we used for the 21 periods areshown in Figure 3

Based on previous studies [39 40 51] and on the decisionto select an intermediate value for this study the transactioncost rate is set at 01 for the 420 experiments The risk freereturn rate is 2 which is based primarily on the short-termtreasury bond rate [41]

Of the 420 trials 226 earn profits With an average returnrate of 1446 it is concluded that genetic algorithms canfacilitate traders to obtain returns in the crude oil futures

Mathematical Problems in Engineering 5

8503 89030

20

40(1)

8606 900510

20

30(2)

8708 91070

50(3)

8810 92100

50(4)

9001 93120

50(5)

9103 950210

20

30(6)

9205 960510

20

30(7)

9308 970710

20

30(8)

9410 980910

20

30(9)

9512 991210

20

30(10)

9703 01020

20

40(11)

9805 02040

20

40(12)

9907 03070

20

40(13)

0010 04090

50

100(14)

0112 05120

50

100(15)

0303 07020

50

100(16)

0405 08050

100

200(17)

0508 09070

100

200(18)

0610 10090

100

200(19)

0712 11120

100

200(20)

0903 13020

100

200(21)

Figure 3 Sample data

market However moving average trading rules identified bygenetic algorithms do not result in excess returns as thereare only 8 periods in which generated trading rules resultedin traders receiving excess returns Given that the price ofcrude oil futures increased many times during the sampleperiod we further contend that genetic algorithms are helpfulin investments

For a better understanding we divide the 21 periods into4 categories according to the results (see the last column ofTable 2)

Category 1 (periods 2 3 and 9) In these periods generatedtrading rules not only help traders obtain returns but alsohelp them to realize excess returns Generated trading rulesgenerate more profits than the BH strategy in periods 3and 9 In period 2 the BH strategy loses money whilethe generated trading rules as determined by the genetic

algorithms result in profitsThus the generated trading rulesare far superior to the BH strategy in this period A commonfeature of these three periods inCategory 1 is that the crude oilprices fell during the test period and experienced significantfluctuations

Category 2 (periods 5 8 12 16 and 18) Generated movingaverage trading rules fail to generate profits during these fiveperiods Even so the generated rules performed better thanthe BH strategy as they significantly reduced losses In theseperiods prices declined smoothly experiencing some smallfluctuations during the process

Category 3 (periods 1 6 7 10 11 14 15 and 17) In theseeight sample data periods genetic algorithms help tradersto identify suitable moving average trading rules Howeverthe traders failed to obtain excess returns While prices

6 Mathematical Problems in Engineering

Table 2 Results of experiment

Period 119876119886 119876 Rbh 119877 119877119886 Classification1 3 12 3768 0663 minus3105 32 20 20 minus2946 2899 5845 13 15 16 5299 7717 2419 14 1 6 0647 minus0862 minus1510 45 20 11 minus7185 minus0097 7088 26 1 12 4976 0808 minus4168 37 5 11 5240 1854 minus3386 38 10 9 minus1175 minus0357 0818 29 19 12 minus5610 0691 6301 110 0 16 16338 6943 minus9396 311 1 13 2740 0127 minus2613 312 15 11 minus1420 minus0576 0844 213 0 7 4343 minus2296 minus6640 414 0 14 14069 3141 minus10928 315 7 8 2287 0273 minus2014 316 12 9 minus0715 minus0092 0622 217 0 20 26227 21037 minus5190 318 20 3 minus9746 minus4131 5615 219 0 0 3512 minus6091 minus9603 420 1 10 2968 minus0193 minus3161 421 7 6 minus0162 minus1092 minus0930 4119876119886 is the number of generated trading rules receiving positive excess returns compared with the BH strategy in the 20 trials 119876 is the number of generatedtrading rules acquiring returns in the test periods Rbh is the return rate of the BH strategy 119877 is the average return rate of the 20 trials in each period 119877119886 isthe average excess return rate of 20 trials in each period

steadily increase in these periods there are also some minorfluctuations which cause the genetic algorithms to be inferiorto the BH strategy in these periods

Category 4 (periods 4 13 19 20 and 21) Genetic algorithmtrading rules demonstrate poor performance in these fiveperiods In period 21 the BH strategy yields negative returnsOur genetic trading rules yield more severe losses TheBH strategy is considered superior to the generated tradingrules in the other four periods as the BH strategy yieldssome returns While there are no significant changes in theprices level in these periods the prices are in volatile statesthroughout the five periods Slight price changes with noapparent trends render the generated trading rules helplessin predicting price changes and providing returns

We use genetic algorithms to search goodmoving averagetrading rules for traders in the crude oil market Table 3which shows the average number of 119872 and 119873 for everyperiod indicates that the value of long period (119872) has aclose relationship with the volatility of the prices in thesample period A large 119872 is set in periods with significantfluctuations and a small 119872 is selected for periods in whichprice is relatively stable

The distribution of 119872 is shown in Figure 4 The valueof Probability is very small and 119872 does not follow normaldistributionThefigure presents a typical fat tail characteristicwith a kurtosis of 236 Compared with normal distributionthere are more values located in the tails of the distribution in

our results Only in half of the 420 experiments119872 is between70 days and 130 days The values are decentralized and webelieve it is more scientific to choose the best lengths of thetwo periods using a training process that we have used in thispaper in actual investment

Among the six moving average calculation methodsAMA and TMA are used more often than the other four(see Table 4) as more than half of the generated movingaverage trading rules use AMA or TMA A small number ofgenerated trading rules use WMA and EMA while TPMAand SMA which are easy to calculate are frequently used insome periods such as periods 1 2 3 12 19 and 21

The selection of calculationmethod is associated with theprice trends and volatility Figure 5 shows that TPMA is used31 times in the 60 independent experiments in periods 2 3and 9 (Category 1) Different from the overall proportionTPMA is the most popular calculation method when pricefalls during the period and experienced significant fluctua-tions AMA is the most popular method in the other threecategories EMA is never used inCategories 1 and 4 Howeverit takes a 24 proportion in Category 2 more than TMASMA TPMA and WMA The proportions of TMA andSMA have no significant differences in different categoriesIn category 4 prices change with no apparent trends No onemethod has obvious advantage over the others

The results of 20 experiments in the same period indicatehigh consistency on the value sd (Table 5) When pricesfluctuate such as in periods 1 2 7 8 13 19 and 20 then not

Mathematical Problems in Engineering 7

Table 3 The average value of119872 and119873 in each period

Period 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 AvgAvg (119872) 104 108 65 121 101 59 51 55 143 107 140 131 118 81 78 96 160 119 112 101 71 101Avg (119873) 24 36 15 45 29 29 26 16 47 37 36 43 44 47 22 18 53 24 19 31 40 32

Table 4 Calculation methods of moving average price in each period

Method Period1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Count

SMA 7 4 1 4 3 3 7 4 10 1 2 1 13 6 3 69WMA 1 1 1 5 3 2 1 3 6 23EMA 1 4 7 2 2 15 31AMA 1 1 20 15 14 8 8 2 9 4 18 16 18 2 1 8 145TPMA 8 19 12 2 3 2 6 2 1 3 9 67TMA 2 4 3 1 8 11 11 2 13 2 19 1 1 7 85

opening positions until one average price exceeds another byat least one standard deviation is the best option When theprice is relatively stable an investment decision should bemade immediately as long as the two moving averages cross

4 Discussion

This paper attempts to generate moving average tradingrules in the oil futures market using genetic algorithmsDifferent from other studies we use only moving averages astechnical indicators to identify usefulmoving average tradingrules without any other complex technical analysis tools orindicators Moving average trading rules are easy for tradersto operate and they are straightforward regardless of thesituation To identify the best trading rules in the crude oilfutures market we use genetic algorithms to select all theparameters in the moving average trading rules dynamicallyrather than doing so in a fixed manner

According to our genetic calculations using geneticalgorithms to find out the best lengths of the two movingaverage periods is advocated because the generated lengthsdiffer from each other in different price trends Static movingaverage trading rules with fixed period lengths cannot adaptto complex fluctuations of price in different periods Atraining process however which takes dynamic features ofprice fluctuations into consideration can help traders find outthe optimal lengths of the two moving periods of a tradingrule

Among the six moving average methods the AMA andTMAare themost popular among the generated trading rulesas these two methods have the ability to adapt to the pricetrendsThe AMA can change the weights of the current priceaccording to the volatility in the last several days As theTMA is the average of the SMA it more accurately reflectsthe price level However the selection of best moving averagecalculation method is affected by price trends Traders canchoose methods more scientifically according to the pricetrends and fluctuations Based on our experiment resultsTPMA is an optimal choice when price experiences a declineprocess with significant fluctuations and generating moving

average trading rules are outstanding compared with BHstrategy in these occasions Although EMA takes a verysmall proportion in the total 420 experiments it is alsoan applicable method other than AMA when price fallssmoothly

For the periods in which the price volatility is apparentdecisions will not be made until the difference betweenthe two averages exceeds the standard deviation of theshort sample prices thereby reducing the transaction riskHowever this method is not suitable for a period in whichthe price is relatively stable In these situations hesitationmaysometimes cause traders tomiss possible profit opportunities

As a whole generated moving average trading rules canhelp traders make profits in the long term However geneticalgorithms cannot guarantee access to additional revenuein every period as they are only useful in acquiring excessreturns in special situations The generated moving averagetrading rules demonstrate outstanding performance whenthe crude oil futures price falls with significant fluctuationsThe BH strategy will lose on these occasions while thegenerated trading rule can help traders foresee a decline inprice and reduce losses Our trading rules also yield positivereturns during the fluctuations by the timely changing ofpositions

When the price falls smoothly with few fluctuations inthe process generated trading rules can yield excess returnscompared to the BH strategy Although genetic algorithmscannot help traders receive positive returns during theseperiods the algorithms can help traders reduce loss bychanging positions with the change of price trends Whenthe price is stable or rising smoothly the generated rulesmay generate returns However they cannot generate morereturns than the BH strategy Limited returns cannot affordthe transaction costsWhen the price falls the generated rulesmay be superior to the BH strategy Genetic algorithms canalso help tradersmake profits in the process of price increaseswith small fluctuations In these periods the BH strategy isbetter than generated trading rules because the transactionsin the process generate transaction costs and may miss someprofit opportunities Generated moving average trading rules

8 Mathematical Problems in Engineering

Table 5 Numbers of trading rules in which sd = 1

Period 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 CountCount 19 19 20 0 5 3 13 12 0 2 0 0 13 2 0 2 0 1 20 19 0 150

0

4

8

12

16

20

24

28

32

20 40 60 80 100 120 140 160 180

Mean 1009833Median 1020000Maximum 1940000Minimum 6000000Std dev 4443764Skewness 0011466Kurtosis 2361692

Jarque-Bera 7139346Probability 0028165

Series MSample 1 420Observations 420

Figure 4 Distribution of119872

0 02 04 06 08 1

Cat

egor

y 1

Cat

egor

y 2

Cat

egor

y 3

Cat

egor

y 4

SMAWMAEMA

AMATPMATMA

Figure 5 Proportions of methods in different categories

have poor performance if there are no notable trends in theprice change In these periods moving average indicatorscannot find profit opportunities because the volatility is toosmall The trends of price changes are delayed by the movingaveragemethodTherefore when a decision ismade the pricetrend must also change and as a result there is no doubt thatthe trader will experience deficits

Using genetic algorithms moving average trading rulesdo help traders to gain returns in the actual futures market

We also identified the best lengths for the two periods withrespect to moving average rules and recommend the movingaverage calculation method for the crude oil futures marketTechnical trading rules with only moving average indicatorsgenerated by genetic algorithms demonstrate no sufficientadvantages compared to the BH strategy because the overallprice increased during the 30-year period Nevertheless gen-erated moving trading rules are beneficial for traders undercertain circumstances especially when there are significantchanges in prices

In this paper we search best trading rules according to thereturn rate of each one without regard to asset conditions andopen interest which proves to be the greatest limitation of thestudy To improve the accuracy of the results a simulationwith actual assets is recommended Accordingly we willundertake this endeavor in a subsequent research

5 Concluding Remarks

We conclude that the genetic algorithms identify bettertechnical rules that allow traders to actualize profits fromtheir investmentsWhile we have no evidence to demonstratethat generated trading rules result in greater returns thandoes the BH strategy our conclusion is consistent with theefficient market hypothesis While generated trading rulesfacilitate traders in realizing excess returns with respect totheir investing activities under specific circumstances theycannot at least by usingmoving average trading rules ensuremore long-term excess returns than the BH strategy Withrespect to the selection of two periods finding out optimallengths using genetic algorithms is helpful for making moreprofits Of the six moving average indicators AMA and TMAare the most popular moving average calculation methodsfor the crude oil futures market in total while TPMA is an

Mathematical Problems in Engineering 9

outstanding method in some occasion When the crude oilprices demonstrate notable volatility a trader is advised towait until the difference of the two moving averages exceedsthe standard deviation of the short period and vice versa

Based on the above analysis it is better to use BH strategywhen the price increases or is stable However generatedmoving average trading rules are better than BH strategywhen crude oil futures price decreases With respect to themoving average calculation method it is advocated to useTPMA when price falls with significant fluctuations andAMA when price falls smoothly although TPMA is not apopularmethod overallWe propose variablemoving averagetrading rules generated by training processes rather thanstatic moving average trading rules in the crude oil futuresmarkets

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Authorsrsquo Contribution

Model design was done by Haizhong An Lijun Wangand Xuan Huang program development and experimentsperformance were done by Xiaojia Liu and Lijun Wang dataanalysis was done by Haizhong An Xiaohua Xia and XiaoqiSun paper composition was done by Lijun Wang XiaohuaXia and Xiaojia Liu and literature retrieval and manuscriptediting were done by Xiaojia Liu Xuan Huang and XiaoqiSun

Acknowledgments

This research was partly supported by the NSFC (China)(Grant no 71173199) and Humanities and the Social Sciencesplanning funds project under the Ministry of Education ofthe PRC (Grant no 10YJA630001) The authors would like toacknowledge valuable suggestions fromWei Fang XiaoliangJia and Qier An

References

[1] Z M Chen and G Q Chen ldquoDemand-driven energy require-ment of world economy 2007 a multi-region input-outputnetwork simulationrdquo Communications in Nonlinear Science andNumerical Simulation vol 18 no 7 pp 1757ndash1774 2013

[2] G Wu L-C Liu and Y-M Wei ldquoComparison of Chinarsquos oilimport risk results based on portfolio theory and a diversifica-tion index approachrdquo Energy Policy vol 37 no 9 pp 3557ndash35652009

[3] X H Xia G T Huang G Q Chen B Zhang Z M Chenand Q Yang ldquoEnergy security efficiency and carbon emissionof Chinese industryrdquo Energy Policy vol 39 no 6 pp 3520ndash35282011

[4] X H Xia and G Q Chen ldquoEnergy abatement in Chineseindustry cost evaluation of regulation strategies and allocationalternativesrdquo Energy Policy vol 45 pp 449ndash458 2012

[5] N Cui Y Lei andW Fang ldquoDesign and impact estimation of areform program of Chinarsquos tax and fee policies for low-grade oiland gas resourcesrdquo Petroleum Science vol 8 no 4 pp 515ndash5262011

[6] Y L Lei N Cui and D Y Pan ldquoEconomic and socialeffects analysis of mineral development in China and policyimplicationsrdquo Resources Policy vol 38 pp 448ndash457 2013

[7] Z M Chen and G Q Chen ldquoAn overview of energy consump-tion of the globalized world economyrdquo Energy Policy vol 39 no10 pp 5920ndash5928 2011

[8] N Nomikos and K Andriosopoulos ldquoModelling energy spotprices empirical evidence from NYMEXrdquo Energy Economicsvol 34 no 4 pp 1153ndash1169 2012

[9] G B Ning Z J Zhen P Wang Y Li and H X Yin ldquoEconomicanalysis on value chain of taxi fleet with battery-swappingmodeusingmultiobjective genetic algorithmrdquoMathematical Problemsin Engineering vol 2012 Article ID 175912 15 pages 2012

[10] S Chai Y B Li J Wang and C Wu ldquoA genetic algorithmfor task scheduling on NoC using FDH cross efficiencyrdquoMathematical Problems in Engineering vol 2013 Article ID708495 16 pages 2013

[11] G Q Chen and B Chen ldquoResource analysis of the Chinesesociety 1980ndash2002 based on exergy Part 1 fossil fuels and energymineralsrdquo Energy Policy vol 35 no 4 pp 2038ndash2050 2007

[12] Z Chen G Chen X Xia and S Xu ldquoGlobal network ofembodied water flow by systems input-output simulationrdquoFrontiers of Earth Science vol 6 no 3 pp 331ndash344 2012

[13] Z M Chen and G Q Chen ldquoEmbodied carbon dioxideemission at supra-national scale a coalition analysis for G7BRIC and the rest of the worldrdquo Energy Policy vol 39 no 5pp 2899ndash2909 2011

[14] H Z An X-Y Gao W Fang X Huang and Y H Ding ldquoTherole of fluctuating modes of autocorrelation in crude oil pricesrdquoPhysica A vol 393 pp 382ndash390 2014

[15] X-Y GaoH-Z AnH-H Liu andY-HDing ldquoAnalysis on thetopological properties of the linkage complex network betweencrude oil future price and spot pricerdquo Acta Physica Sinica vol60 no 6 Article ID 068902 2011

[16] X-Y Gao H Z An and W Fang ldquoResearch on fluctuation ofbivariate correlation of time series based on complex networkstheoryrdquo Acta Physica Sinica vol 61 no 9 Article ID 0989022012

[17] S Yu and Y-M Wei ldquoPrediction of Chinarsquos coal production-environmental pollution based on a hybrid genetic algorithm-system dynamics modelrdquo Energy Policy vol 42 pp 521ndash5292012

[18] S Geisendorf ldquoInternal selection and market selection in eco-nomic genetic algorithmsrdquo Journal of Evolutionary Economicsvol 21 no 5 pp 817ndash841 2011

[19] R Tehrani and F Khodayar ldquoA hybrid optimized artificialintelligent model to forecast crude oil using genetic algorithmrdquoAfrican Journal of Business Management vol 5 pp 13130ndash131352011

[20] A M Elaiw X Xia and A M Shehata ldquoMinimization of fuelcosts and gaseous emissions of electric power generation bymodel predictive controlrdquo Mathematical Problems in Engineer-ing vol 2013 Article ID 906958 15 pages 2013

[21] L Mendes P Godinho and J Dias ldquoA Forex trading systembased on a genetic algorithmrdquo Journal of Heuristics vol 18 no4 pp 627ndash656 2012

10 Mathematical Problems in Engineering

[22] M C Roberts ldquoTechnical analysis and genetic programmingconstructing and testing a commodity portfoliordquo Journal ofFutures Markets vol 25 no 7 pp 643ndash660 2005

[23] J-Y Potvin P Soriano and V Maxime ldquoGenerating tradingrules on the stock markets with genetic programmingrdquo Com-puters and Operations Research vol 31 no 7 pp 1033ndash10472004

[24] A Esfahanipour and S Mousavi ldquoA genetic programmingmodel to generate risk-adjusted technical trading rules in stockmarketsrdquo Expert Systems with Applications vol 38 no 7 pp8438ndash8445 2011

[25] M A H Dempster T W Payne Y Romahi and G W PThompson ldquoComputational learning techniques for intradayFX trading using popular technical indicatorsrdquo IEEE Transac-tions on Neural Networks vol 12 no 4 pp 744ndash754 2001

[26] T Nakashima Y Yokota Y Shoji and H Ishibuchi ldquoA geneticapproach to the design of autonomous agents for futurestradingrdquo Artificial Life and Robotics vol 11 no 2 pp 145ndash1482007

[27] A Ghandar Z Michalewicz M Schmidt T-D To and RZurbrugg ldquoComputational intelligence for evolving tradingrulesrdquo IEEE Transactions on Evolutionary Computation vol 13no 1 pp 71ndash86 2009

[28] W L Tung and C Quek ldquoFinancial volatility trading usinga self-organising neural-fuzzy semantic network and optionstraddle-based approachrdquo Expert Systems with Applications vol38 no 5 pp 4668ndash4688 2011

[29] C-H Cheng T-L Chen and L-Y Wei ldquoA hybrid model basedon rough sets theory and genetic algorithms for stock priceforecastingrdquo Information Sciences vol 180 no 9 pp 1610ndash16292010

[30] P-C Chang C-Y Fan and J-L Lin ldquoTrend discovery infinancial time series data using a case based fuzzy decision treerdquoExpert Systems with Applications vol 38 no 5 pp 6070ndash60802011

[31] G A Vasilakis K A Theofilatos E F Georgopoulos AKarathanasopoulos and S D Likothanassis ldquoA genetic pro-gramming approach for EURUSD exchange rate forecastingand tradingrdquo Computational Economics vol 42 no 4 pp 415ndash431 2013

[32] I A Boboc and M C Dinica ldquoAn algorithm for testing theefficient market hypothesisrdquo PLoS ONE vol 8 no 10 ArticleID e78177 2013

[33] W Cheung K S K Lam and H F Yeung ldquoIntertemporalprofitability and the stability of technical analysis evidencesfrom the Hong Kong stock exchangerdquo Applied Economics vol43 no 15 pp 1945ndash1963 2011

[34] H Dewachter and M Lyrio ldquoThe economic value of technicaltrading rules a nonparametric utility-based approachrdquo Interna-tional Journal of Finance and Economics vol 10 no 1 pp 41ndash622005

[35] A Fernandez-Perez F Fernandez-Rodrıguez and S Sosvilla-Rivero ldquoExploiting trends in the foreign exchange marketsrdquoApplied Economics Letters vol 19 no 6 pp 591ndash597 2012

[36] M Metghalchia J Marcucci and Y-H Chang ldquoAre movingaverage trading rules profitable Evidence from the EuropeanstockmarketsrdquoApplied Economics vol 44 no 12 pp 1539ndash15592012

[37] C J Neely P A Weller and J M Ulrich ldquoThe adaptive mar-kets hypothesis evidence from the foreign exchange marketrdquoJournal of Financial and Quantitative Analysis vol 44 no 2 pp467ndash488 2009

[38] W E Shambora and R Rossiter ldquoAre there exploitable ineffi-ciencies in the futures market for oilrdquo Energy Economics vol29 no 1 pp 18ndash27 2007

[39] F Allen and R Karjalainen ldquoUsing genetic algorithms to findtechnical trading rulesrdquo Journal of Financial Economics vol 51no 2 pp 245ndash271 1999

[40] J Wang ldquoTrading and hedging in SampP 500 spot and futuresmarkets using genetic programmingrdquo Journal of Futures Mar-kets vol 20 no 10 pp 911ndash942 2000

[41] J HowM Ling and P Verhoeven ldquoDoes size matter A geneticprogramming approach to technical tradingrdquo QuantitativeFinance vol 10 no 2 pp 131ndash140 2010

[42] F Wang P L H Yu and D W Cheung ldquoCombining technicaltrading rules using particle swarm optimizationrdquo Expert Sys-tems with Applications vol 41 no 6 pp 3016ndash3026 2014

[43] J Andrada-Felix and F Fernandez-Rodrıguez ldquoImprovingmoving average trading rules with boosting and statisticallearningmethodsrdquo Journal of Forecasting vol 27 no 5 pp 433ndash449 2008

[44] T T-L Chong and W-K Ng ldquoTechnical analysis and theLondon stock exchange testing the MACD and RSI rules usingthe FT30rdquoApplied Economics Letters vol 15 no 14 pp 1111ndash11142008

[45] I Cialenco andA Protopapadakis ldquoDo technical trading profitsremain in the foreign exchange market Evidence from 14 cur-renciesrdquo Journal of International Financial Markets Institutionsand Money vol 21 no 2 pp 176ndash206 2011

[46] A E Milionis and E Papanagiotou ldquoDecomposing the predic-tive performance of themoving average trading rule of technicalanalysis the contribution of linear andnon-linear dependenciesin stock returnsrdquo Journal of Applied Statistics vol 40 no 11 pp2480ndash2494 2013

[47] Y S Ni J T Lee and Y C Liao ldquoDo variable length movingaverage trading rules matter during a financial crisis periodrdquoApplied Economics Letters vol 20 no 2 pp 135ndash141 2013

[48] V Pavlov and S Hurn ldquoTesting the profitability of moving-average rules as a portfolio selection strategyrdquo Pacific-BasinFinance Journal vol 20 no 5 pp 825ndash842 2012

[49] C Chiarella X-Z He and C Hommes ldquoA dynamic analysisof moving average rulesrdquo Journal of Economic Dynamics ampControl vol 30 no 9-10 pp 1729ndash1753 2006

[50] X-Z He and M Zheng ldquoDynamics of moving average rules ina continuous-time financialmarketmodelrdquo Journal of EconomicBehavior and Organization vol 76 no 3 pp 615ndash634 2010

[51] C Neely P Weller and R Dittmar Is Technical Analysis in theForeign Exchange Market Profitable A Genetic ProgrammingApproach Cambridge University Press 1997

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Mathematical Problems in Engineering 5

8503 89030

20

40(1)

8606 900510

20

30(2)

8708 91070

50(3)

8810 92100

50(4)

9001 93120

50(5)

9103 950210

20

30(6)

9205 960510

20

30(7)

9308 970710

20

30(8)

9410 980910

20

30(9)

9512 991210

20

30(10)

9703 01020

20

40(11)

9805 02040

20

40(12)

9907 03070

20

40(13)

0010 04090

50

100(14)

0112 05120

50

100(15)

0303 07020

50

100(16)

0405 08050

100

200(17)

0508 09070

100

200(18)

0610 10090

100

200(19)

0712 11120

100

200(20)

0903 13020

100

200(21)

Figure 3 Sample data

market However moving average trading rules identified bygenetic algorithms do not result in excess returns as thereare only 8 periods in which generated trading rules resultedin traders receiving excess returns Given that the price ofcrude oil futures increased many times during the sampleperiod we further contend that genetic algorithms are helpfulin investments

For a better understanding we divide the 21 periods into4 categories according to the results (see the last column ofTable 2)

Category 1 (periods 2 3 and 9) In these periods generatedtrading rules not only help traders obtain returns but alsohelp them to realize excess returns Generated trading rulesgenerate more profits than the BH strategy in periods 3and 9 In period 2 the BH strategy loses money whilethe generated trading rules as determined by the genetic

algorithms result in profitsThus the generated trading rulesare far superior to the BH strategy in this period A commonfeature of these three periods inCategory 1 is that the crude oilprices fell during the test period and experienced significantfluctuations

Category 2 (periods 5 8 12 16 and 18) Generated movingaverage trading rules fail to generate profits during these fiveperiods Even so the generated rules performed better thanthe BH strategy as they significantly reduced losses In theseperiods prices declined smoothly experiencing some smallfluctuations during the process

Category 3 (periods 1 6 7 10 11 14 15 and 17) In theseeight sample data periods genetic algorithms help tradersto identify suitable moving average trading rules Howeverthe traders failed to obtain excess returns While prices

6 Mathematical Problems in Engineering

Table 2 Results of experiment

Period 119876119886 119876 Rbh 119877 119877119886 Classification1 3 12 3768 0663 minus3105 32 20 20 minus2946 2899 5845 13 15 16 5299 7717 2419 14 1 6 0647 minus0862 minus1510 45 20 11 minus7185 minus0097 7088 26 1 12 4976 0808 minus4168 37 5 11 5240 1854 minus3386 38 10 9 minus1175 minus0357 0818 29 19 12 minus5610 0691 6301 110 0 16 16338 6943 minus9396 311 1 13 2740 0127 minus2613 312 15 11 minus1420 minus0576 0844 213 0 7 4343 minus2296 minus6640 414 0 14 14069 3141 minus10928 315 7 8 2287 0273 minus2014 316 12 9 minus0715 minus0092 0622 217 0 20 26227 21037 minus5190 318 20 3 minus9746 minus4131 5615 219 0 0 3512 minus6091 minus9603 420 1 10 2968 minus0193 minus3161 421 7 6 minus0162 minus1092 minus0930 4119876119886 is the number of generated trading rules receiving positive excess returns compared with the BH strategy in the 20 trials 119876 is the number of generatedtrading rules acquiring returns in the test periods Rbh is the return rate of the BH strategy 119877 is the average return rate of the 20 trials in each period 119877119886 isthe average excess return rate of 20 trials in each period

steadily increase in these periods there are also some minorfluctuations which cause the genetic algorithms to be inferiorto the BH strategy in these periods

Category 4 (periods 4 13 19 20 and 21) Genetic algorithmtrading rules demonstrate poor performance in these fiveperiods In period 21 the BH strategy yields negative returnsOur genetic trading rules yield more severe losses TheBH strategy is considered superior to the generated tradingrules in the other four periods as the BH strategy yieldssome returns While there are no significant changes in theprices level in these periods the prices are in volatile statesthroughout the five periods Slight price changes with noapparent trends render the generated trading rules helplessin predicting price changes and providing returns

We use genetic algorithms to search goodmoving averagetrading rules for traders in the crude oil market Table 3which shows the average number of 119872 and 119873 for everyperiod indicates that the value of long period (119872) has aclose relationship with the volatility of the prices in thesample period A large 119872 is set in periods with significantfluctuations and a small 119872 is selected for periods in whichprice is relatively stable

The distribution of 119872 is shown in Figure 4 The valueof Probability is very small and 119872 does not follow normaldistributionThefigure presents a typical fat tail characteristicwith a kurtosis of 236 Compared with normal distributionthere are more values located in the tails of the distribution in

our results Only in half of the 420 experiments119872 is between70 days and 130 days The values are decentralized and webelieve it is more scientific to choose the best lengths of thetwo periods using a training process that we have used in thispaper in actual investment

Among the six moving average calculation methodsAMA and TMA are used more often than the other four(see Table 4) as more than half of the generated movingaverage trading rules use AMA or TMA A small number ofgenerated trading rules use WMA and EMA while TPMAand SMA which are easy to calculate are frequently used insome periods such as periods 1 2 3 12 19 and 21

The selection of calculationmethod is associated with theprice trends and volatility Figure 5 shows that TPMA is used31 times in the 60 independent experiments in periods 2 3and 9 (Category 1) Different from the overall proportionTPMA is the most popular calculation method when pricefalls during the period and experienced significant fluctua-tions AMA is the most popular method in the other threecategories EMA is never used inCategories 1 and 4 Howeverit takes a 24 proportion in Category 2 more than TMASMA TPMA and WMA The proportions of TMA andSMA have no significant differences in different categoriesIn category 4 prices change with no apparent trends No onemethod has obvious advantage over the others

The results of 20 experiments in the same period indicatehigh consistency on the value sd (Table 5) When pricesfluctuate such as in periods 1 2 7 8 13 19 and 20 then not

Mathematical Problems in Engineering 7

Table 3 The average value of119872 and119873 in each period

Period 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 AvgAvg (119872) 104 108 65 121 101 59 51 55 143 107 140 131 118 81 78 96 160 119 112 101 71 101Avg (119873) 24 36 15 45 29 29 26 16 47 37 36 43 44 47 22 18 53 24 19 31 40 32

Table 4 Calculation methods of moving average price in each period

Method Period1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Count

SMA 7 4 1 4 3 3 7 4 10 1 2 1 13 6 3 69WMA 1 1 1 5 3 2 1 3 6 23EMA 1 4 7 2 2 15 31AMA 1 1 20 15 14 8 8 2 9 4 18 16 18 2 1 8 145TPMA 8 19 12 2 3 2 6 2 1 3 9 67TMA 2 4 3 1 8 11 11 2 13 2 19 1 1 7 85

opening positions until one average price exceeds another byat least one standard deviation is the best option When theprice is relatively stable an investment decision should bemade immediately as long as the two moving averages cross

4 Discussion

This paper attempts to generate moving average tradingrules in the oil futures market using genetic algorithmsDifferent from other studies we use only moving averages astechnical indicators to identify usefulmoving average tradingrules without any other complex technical analysis tools orindicators Moving average trading rules are easy for tradersto operate and they are straightforward regardless of thesituation To identify the best trading rules in the crude oilfutures market we use genetic algorithms to select all theparameters in the moving average trading rules dynamicallyrather than doing so in a fixed manner

According to our genetic calculations using geneticalgorithms to find out the best lengths of the two movingaverage periods is advocated because the generated lengthsdiffer from each other in different price trends Static movingaverage trading rules with fixed period lengths cannot adaptto complex fluctuations of price in different periods Atraining process however which takes dynamic features ofprice fluctuations into consideration can help traders find outthe optimal lengths of the two moving periods of a tradingrule

Among the six moving average methods the AMA andTMAare themost popular among the generated trading rulesas these two methods have the ability to adapt to the pricetrendsThe AMA can change the weights of the current priceaccording to the volatility in the last several days As theTMA is the average of the SMA it more accurately reflectsthe price level However the selection of best moving averagecalculation method is affected by price trends Traders canchoose methods more scientifically according to the pricetrends and fluctuations Based on our experiment resultsTPMA is an optimal choice when price experiences a declineprocess with significant fluctuations and generating moving

average trading rules are outstanding compared with BHstrategy in these occasions Although EMA takes a verysmall proportion in the total 420 experiments it is alsoan applicable method other than AMA when price fallssmoothly

For the periods in which the price volatility is apparentdecisions will not be made until the difference betweenthe two averages exceeds the standard deviation of theshort sample prices thereby reducing the transaction riskHowever this method is not suitable for a period in whichthe price is relatively stable In these situations hesitationmaysometimes cause traders tomiss possible profit opportunities

As a whole generated moving average trading rules canhelp traders make profits in the long term However geneticalgorithms cannot guarantee access to additional revenuein every period as they are only useful in acquiring excessreturns in special situations The generated moving averagetrading rules demonstrate outstanding performance whenthe crude oil futures price falls with significant fluctuationsThe BH strategy will lose on these occasions while thegenerated trading rule can help traders foresee a decline inprice and reduce losses Our trading rules also yield positivereturns during the fluctuations by the timely changing ofpositions

When the price falls smoothly with few fluctuations inthe process generated trading rules can yield excess returnscompared to the BH strategy Although genetic algorithmscannot help traders receive positive returns during theseperiods the algorithms can help traders reduce loss bychanging positions with the change of price trends Whenthe price is stable or rising smoothly the generated rulesmay generate returns However they cannot generate morereturns than the BH strategy Limited returns cannot affordthe transaction costsWhen the price falls the generated rulesmay be superior to the BH strategy Genetic algorithms canalso help tradersmake profits in the process of price increaseswith small fluctuations In these periods the BH strategy isbetter than generated trading rules because the transactionsin the process generate transaction costs and may miss someprofit opportunities Generated moving average trading rules

8 Mathematical Problems in Engineering

Table 5 Numbers of trading rules in which sd = 1

Period 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 CountCount 19 19 20 0 5 3 13 12 0 2 0 0 13 2 0 2 0 1 20 19 0 150

0

4

8

12

16

20

24

28

32

20 40 60 80 100 120 140 160 180

Mean 1009833Median 1020000Maximum 1940000Minimum 6000000Std dev 4443764Skewness 0011466Kurtosis 2361692

Jarque-Bera 7139346Probability 0028165

Series MSample 1 420Observations 420

Figure 4 Distribution of119872

0 02 04 06 08 1

Cat

egor

y 1

Cat

egor

y 2

Cat

egor

y 3

Cat

egor

y 4

SMAWMAEMA

AMATPMATMA

Figure 5 Proportions of methods in different categories

have poor performance if there are no notable trends in theprice change In these periods moving average indicatorscannot find profit opportunities because the volatility is toosmall The trends of price changes are delayed by the movingaveragemethodTherefore when a decision ismade the pricetrend must also change and as a result there is no doubt thatthe trader will experience deficits

Using genetic algorithms moving average trading rulesdo help traders to gain returns in the actual futures market

We also identified the best lengths for the two periods withrespect to moving average rules and recommend the movingaverage calculation method for the crude oil futures marketTechnical trading rules with only moving average indicatorsgenerated by genetic algorithms demonstrate no sufficientadvantages compared to the BH strategy because the overallprice increased during the 30-year period Nevertheless gen-erated moving trading rules are beneficial for traders undercertain circumstances especially when there are significantchanges in prices

In this paper we search best trading rules according to thereturn rate of each one without regard to asset conditions andopen interest which proves to be the greatest limitation of thestudy To improve the accuracy of the results a simulationwith actual assets is recommended Accordingly we willundertake this endeavor in a subsequent research

5 Concluding Remarks

We conclude that the genetic algorithms identify bettertechnical rules that allow traders to actualize profits fromtheir investmentsWhile we have no evidence to demonstratethat generated trading rules result in greater returns thandoes the BH strategy our conclusion is consistent with theefficient market hypothesis While generated trading rulesfacilitate traders in realizing excess returns with respect totheir investing activities under specific circumstances theycannot at least by usingmoving average trading rules ensuremore long-term excess returns than the BH strategy Withrespect to the selection of two periods finding out optimallengths using genetic algorithms is helpful for making moreprofits Of the six moving average indicators AMA and TMAare the most popular moving average calculation methodsfor the crude oil futures market in total while TPMA is an

Mathematical Problems in Engineering 9

outstanding method in some occasion When the crude oilprices demonstrate notable volatility a trader is advised towait until the difference of the two moving averages exceedsthe standard deviation of the short period and vice versa

Based on the above analysis it is better to use BH strategywhen the price increases or is stable However generatedmoving average trading rules are better than BH strategywhen crude oil futures price decreases With respect to themoving average calculation method it is advocated to useTPMA when price falls with significant fluctuations andAMA when price falls smoothly although TPMA is not apopularmethod overallWe propose variablemoving averagetrading rules generated by training processes rather thanstatic moving average trading rules in the crude oil futuresmarkets

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Authorsrsquo Contribution

Model design was done by Haizhong An Lijun Wangand Xuan Huang program development and experimentsperformance were done by Xiaojia Liu and Lijun Wang dataanalysis was done by Haizhong An Xiaohua Xia and XiaoqiSun paper composition was done by Lijun Wang XiaohuaXia and Xiaojia Liu and literature retrieval and manuscriptediting were done by Xiaojia Liu Xuan Huang and XiaoqiSun

Acknowledgments

This research was partly supported by the NSFC (China)(Grant no 71173199) and Humanities and the Social Sciencesplanning funds project under the Ministry of Education ofthe PRC (Grant no 10YJA630001) The authors would like toacknowledge valuable suggestions fromWei Fang XiaoliangJia and Qier An

References

[1] Z M Chen and G Q Chen ldquoDemand-driven energy require-ment of world economy 2007 a multi-region input-outputnetwork simulationrdquo Communications in Nonlinear Science andNumerical Simulation vol 18 no 7 pp 1757ndash1774 2013

[2] G Wu L-C Liu and Y-M Wei ldquoComparison of Chinarsquos oilimport risk results based on portfolio theory and a diversifica-tion index approachrdquo Energy Policy vol 37 no 9 pp 3557ndash35652009

[3] X H Xia G T Huang G Q Chen B Zhang Z M Chenand Q Yang ldquoEnergy security efficiency and carbon emissionof Chinese industryrdquo Energy Policy vol 39 no 6 pp 3520ndash35282011

[4] X H Xia and G Q Chen ldquoEnergy abatement in Chineseindustry cost evaluation of regulation strategies and allocationalternativesrdquo Energy Policy vol 45 pp 449ndash458 2012

[5] N Cui Y Lei andW Fang ldquoDesign and impact estimation of areform program of Chinarsquos tax and fee policies for low-grade oiland gas resourcesrdquo Petroleum Science vol 8 no 4 pp 515ndash5262011

[6] Y L Lei N Cui and D Y Pan ldquoEconomic and socialeffects analysis of mineral development in China and policyimplicationsrdquo Resources Policy vol 38 pp 448ndash457 2013

[7] Z M Chen and G Q Chen ldquoAn overview of energy consump-tion of the globalized world economyrdquo Energy Policy vol 39 no10 pp 5920ndash5928 2011

[8] N Nomikos and K Andriosopoulos ldquoModelling energy spotprices empirical evidence from NYMEXrdquo Energy Economicsvol 34 no 4 pp 1153ndash1169 2012

[9] G B Ning Z J Zhen P Wang Y Li and H X Yin ldquoEconomicanalysis on value chain of taxi fleet with battery-swappingmodeusingmultiobjective genetic algorithmrdquoMathematical Problemsin Engineering vol 2012 Article ID 175912 15 pages 2012

[10] S Chai Y B Li J Wang and C Wu ldquoA genetic algorithmfor task scheduling on NoC using FDH cross efficiencyrdquoMathematical Problems in Engineering vol 2013 Article ID708495 16 pages 2013

[11] G Q Chen and B Chen ldquoResource analysis of the Chinesesociety 1980ndash2002 based on exergy Part 1 fossil fuels and energymineralsrdquo Energy Policy vol 35 no 4 pp 2038ndash2050 2007

[12] Z Chen G Chen X Xia and S Xu ldquoGlobal network ofembodied water flow by systems input-output simulationrdquoFrontiers of Earth Science vol 6 no 3 pp 331ndash344 2012

[13] Z M Chen and G Q Chen ldquoEmbodied carbon dioxideemission at supra-national scale a coalition analysis for G7BRIC and the rest of the worldrdquo Energy Policy vol 39 no 5pp 2899ndash2909 2011

[14] H Z An X-Y Gao W Fang X Huang and Y H Ding ldquoTherole of fluctuating modes of autocorrelation in crude oil pricesrdquoPhysica A vol 393 pp 382ndash390 2014

[15] X-Y GaoH-Z AnH-H Liu andY-HDing ldquoAnalysis on thetopological properties of the linkage complex network betweencrude oil future price and spot pricerdquo Acta Physica Sinica vol60 no 6 Article ID 068902 2011

[16] X-Y Gao H Z An and W Fang ldquoResearch on fluctuation ofbivariate correlation of time series based on complex networkstheoryrdquo Acta Physica Sinica vol 61 no 9 Article ID 0989022012

[17] S Yu and Y-M Wei ldquoPrediction of Chinarsquos coal production-environmental pollution based on a hybrid genetic algorithm-system dynamics modelrdquo Energy Policy vol 42 pp 521ndash5292012

[18] S Geisendorf ldquoInternal selection and market selection in eco-nomic genetic algorithmsrdquo Journal of Evolutionary Economicsvol 21 no 5 pp 817ndash841 2011

[19] R Tehrani and F Khodayar ldquoA hybrid optimized artificialintelligent model to forecast crude oil using genetic algorithmrdquoAfrican Journal of Business Management vol 5 pp 13130ndash131352011

[20] A M Elaiw X Xia and A M Shehata ldquoMinimization of fuelcosts and gaseous emissions of electric power generation bymodel predictive controlrdquo Mathematical Problems in Engineer-ing vol 2013 Article ID 906958 15 pages 2013

[21] L Mendes P Godinho and J Dias ldquoA Forex trading systembased on a genetic algorithmrdquo Journal of Heuristics vol 18 no4 pp 627ndash656 2012

10 Mathematical Problems in Engineering

[22] M C Roberts ldquoTechnical analysis and genetic programmingconstructing and testing a commodity portfoliordquo Journal ofFutures Markets vol 25 no 7 pp 643ndash660 2005

[23] J-Y Potvin P Soriano and V Maxime ldquoGenerating tradingrules on the stock markets with genetic programmingrdquo Com-puters and Operations Research vol 31 no 7 pp 1033ndash10472004

[24] A Esfahanipour and S Mousavi ldquoA genetic programmingmodel to generate risk-adjusted technical trading rules in stockmarketsrdquo Expert Systems with Applications vol 38 no 7 pp8438ndash8445 2011

[25] M A H Dempster T W Payne Y Romahi and G W PThompson ldquoComputational learning techniques for intradayFX trading using popular technical indicatorsrdquo IEEE Transac-tions on Neural Networks vol 12 no 4 pp 744ndash754 2001

[26] T Nakashima Y Yokota Y Shoji and H Ishibuchi ldquoA geneticapproach to the design of autonomous agents for futurestradingrdquo Artificial Life and Robotics vol 11 no 2 pp 145ndash1482007

[27] A Ghandar Z Michalewicz M Schmidt T-D To and RZurbrugg ldquoComputational intelligence for evolving tradingrulesrdquo IEEE Transactions on Evolutionary Computation vol 13no 1 pp 71ndash86 2009

[28] W L Tung and C Quek ldquoFinancial volatility trading usinga self-organising neural-fuzzy semantic network and optionstraddle-based approachrdquo Expert Systems with Applications vol38 no 5 pp 4668ndash4688 2011

[29] C-H Cheng T-L Chen and L-Y Wei ldquoA hybrid model basedon rough sets theory and genetic algorithms for stock priceforecastingrdquo Information Sciences vol 180 no 9 pp 1610ndash16292010

[30] P-C Chang C-Y Fan and J-L Lin ldquoTrend discovery infinancial time series data using a case based fuzzy decision treerdquoExpert Systems with Applications vol 38 no 5 pp 6070ndash60802011

[31] G A Vasilakis K A Theofilatos E F Georgopoulos AKarathanasopoulos and S D Likothanassis ldquoA genetic pro-gramming approach for EURUSD exchange rate forecastingand tradingrdquo Computational Economics vol 42 no 4 pp 415ndash431 2013

[32] I A Boboc and M C Dinica ldquoAn algorithm for testing theefficient market hypothesisrdquo PLoS ONE vol 8 no 10 ArticleID e78177 2013

[33] W Cheung K S K Lam and H F Yeung ldquoIntertemporalprofitability and the stability of technical analysis evidencesfrom the Hong Kong stock exchangerdquo Applied Economics vol43 no 15 pp 1945ndash1963 2011

[34] H Dewachter and M Lyrio ldquoThe economic value of technicaltrading rules a nonparametric utility-based approachrdquo Interna-tional Journal of Finance and Economics vol 10 no 1 pp 41ndash622005

[35] A Fernandez-Perez F Fernandez-Rodrıguez and S Sosvilla-Rivero ldquoExploiting trends in the foreign exchange marketsrdquoApplied Economics Letters vol 19 no 6 pp 591ndash597 2012

[36] M Metghalchia J Marcucci and Y-H Chang ldquoAre movingaverage trading rules profitable Evidence from the EuropeanstockmarketsrdquoApplied Economics vol 44 no 12 pp 1539ndash15592012

[37] C J Neely P A Weller and J M Ulrich ldquoThe adaptive mar-kets hypothesis evidence from the foreign exchange marketrdquoJournal of Financial and Quantitative Analysis vol 44 no 2 pp467ndash488 2009

[38] W E Shambora and R Rossiter ldquoAre there exploitable ineffi-ciencies in the futures market for oilrdquo Energy Economics vol29 no 1 pp 18ndash27 2007

[39] F Allen and R Karjalainen ldquoUsing genetic algorithms to findtechnical trading rulesrdquo Journal of Financial Economics vol 51no 2 pp 245ndash271 1999

[40] J Wang ldquoTrading and hedging in SampP 500 spot and futuresmarkets using genetic programmingrdquo Journal of Futures Mar-kets vol 20 no 10 pp 911ndash942 2000

[41] J HowM Ling and P Verhoeven ldquoDoes size matter A geneticprogramming approach to technical tradingrdquo QuantitativeFinance vol 10 no 2 pp 131ndash140 2010

[42] F Wang P L H Yu and D W Cheung ldquoCombining technicaltrading rules using particle swarm optimizationrdquo Expert Sys-tems with Applications vol 41 no 6 pp 3016ndash3026 2014

[43] J Andrada-Felix and F Fernandez-Rodrıguez ldquoImprovingmoving average trading rules with boosting and statisticallearningmethodsrdquo Journal of Forecasting vol 27 no 5 pp 433ndash449 2008

[44] T T-L Chong and W-K Ng ldquoTechnical analysis and theLondon stock exchange testing the MACD and RSI rules usingthe FT30rdquoApplied Economics Letters vol 15 no 14 pp 1111ndash11142008

[45] I Cialenco andA Protopapadakis ldquoDo technical trading profitsremain in the foreign exchange market Evidence from 14 cur-renciesrdquo Journal of International Financial Markets Institutionsand Money vol 21 no 2 pp 176ndash206 2011

[46] A E Milionis and E Papanagiotou ldquoDecomposing the predic-tive performance of themoving average trading rule of technicalanalysis the contribution of linear andnon-linear dependenciesin stock returnsrdquo Journal of Applied Statistics vol 40 no 11 pp2480ndash2494 2013

[47] Y S Ni J T Lee and Y C Liao ldquoDo variable length movingaverage trading rules matter during a financial crisis periodrdquoApplied Economics Letters vol 20 no 2 pp 135ndash141 2013

[48] V Pavlov and S Hurn ldquoTesting the profitability of moving-average rules as a portfolio selection strategyrdquo Pacific-BasinFinance Journal vol 20 no 5 pp 825ndash842 2012

[49] C Chiarella X-Z He and C Hommes ldquoA dynamic analysisof moving average rulesrdquo Journal of Economic Dynamics ampControl vol 30 no 9-10 pp 1729ndash1753 2006

[50] X-Z He and M Zheng ldquoDynamics of moving average rules ina continuous-time financialmarketmodelrdquo Journal of EconomicBehavior and Organization vol 76 no 3 pp 615ndash634 2010

[51] C Neely P Weller and R Dittmar Is Technical Analysis in theForeign Exchange Market Profitable A Genetic ProgrammingApproach Cambridge University Press 1997

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

6 Mathematical Problems in Engineering

Table 2 Results of experiment

Period 119876119886 119876 Rbh 119877 119877119886 Classification1 3 12 3768 0663 minus3105 32 20 20 minus2946 2899 5845 13 15 16 5299 7717 2419 14 1 6 0647 minus0862 minus1510 45 20 11 minus7185 minus0097 7088 26 1 12 4976 0808 minus4168 37 5 11 5240 1854 minus3386 38 10 9 minus1175 minus0357 0818 29 19 12 minus5610 0691 6301 110 0 16 16338 6943 minus9396 311 1 13 2740 0127 minus2613 312 15 11 minus1420 minus0576 0844 213 0 7 4343 minus2296 minus6640 414 0 14 14069 3141 minus10928 315 7 8 2287 0273 minus2014 316 12 9 minus0715 minus0092 0622 217 0 20 26227 21037 minus5190 318 20 3 minus9746 minus4131 5615 219 0 0 3512 minus6091 minus9603 420 1 10 2968 minus0193 minus3161 421 7 6 minus0162 minus1092 minus0930 4119876119886 is the number of generated trading rules receiving positive excess returns compared with the BH strategy in the 20 trials 119876 is the number of generatedtrading rules acquiring returns in the test periods Rbh is the return rate of the BH strategy 119877 is the average return rate of the 20 trials in each period 119877119886 isthe average excess return rate of 20 trials in each period

steadily increase in these periods there are also some minorfluctuations which cause the genetic algorithms to be inferiorto the BH strategy in these periods

Category 4 (periods 4 13 19 20 and 21) Genetic algorithmtrading rules demonstrate poor performance in these fiveperiods In period 21 the BH strategy yields negative returnsOur genetic trading rules yield more severe losses TheBH strategy is considered superior to the generated tradingrules in the other four periods as the BH strategy yieldssome returns While there are no significant changes in theprices level in these periods the prices are in volatile statesthroughout the five periods Slight price changes with noapparent trends render the generated trading rules helplessin predicting price changes and providing returns

We use genetic algorithms to search goodmoving averagetrading rules for traders in the crude oil market Table 3which shows the average number of 119872 and 119873 for everyperiod indicates that the value of long period (119872) has aclose relationship with the volatility of the prices in thesample period A large 119872 is set in periods with significantfluctuations and a small 119872 is selected for periods in whichprice is relatively stable

The distribution of 119872 is shown in Figure 4 The valueof Probability is very small and 119872 does not follow normaldistributionThefigure presents a typical fat tail characteristicwith a kurtosis of 236 Compared with normal distributionthere are more values located in the tails of the distribution in

our results Only in half of the 420 experiments119872 is between70 days and 130 days The values are decentralized and webelieve it is more scientific to choose the best lengths of thetwo periods using a training process that we have used in thispaper in actual investment

Among the six moving average calculation methodsAMA and TMA are used more often than the other four(see Table 4) as more than half of the generated movingaverage trading rules use AMA or TMA A small number ofgenerated trading rules use WMA and EMA while TPMAand SMA which are easy to calculate are frequently used insome periods such as periods 1 2 3 12 19 and 21

The selection of calculationmethod is associated with theprice trends and volatility Figure 5 shows that TPMA is used31 times in the 60 independent experiments in periods 2 3and 9 (Category 1) Different from the overall proportionTPMA is the most popular calculation method when pricefalls during the period and experienced significant fluctua-tions AMA is the most popular method in the other threecategories EMA is never used inCategories 1 and 4 Howeverit takes a 24 proportion in Category 2 more than TMASMA TPMA and WMA The proportions of TMA andSMA have no significant differences in different categoriesIn category 4 prices change with no apparent trends No onemethod has obvious advantage over the others

The results of 20 experiments in the same period indicatehigh consistency on the value sd (Table 5) When pricesfluctuate such as in periods 1 2 7 8 13 19 and 20 then not

Mathematical Problems in Engineering 7

Table 3 The average value of119872 and119873 in each period

Period 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 AvgAvg (119872) 104 108 65 121 101 59 51 55 143 107 140 131 118 81 78 96 160 119 112 101 71 101Avg (119873) 24 36 15 45 29 29 26 16 47 37 36 43 44 47 22 18 53 24 19 31 40 32

Table 4 Calculation methods of moving average price in each period

Method Period1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Count

SMA 7 4 1 4 3 3 7 4 10 1 2 1 13 6 3 69WMA 1 1 1 5 3 2 1 3 6 23EMA 1 4 7 2 2 15 31AMA 1 1 20 15 14 8 8 2 9 4 18 16 18 2 1 8 145TPMA 8 19 12 2 3 2 6 2 1 3 9 67TMA 2 4 3 1 8 11 11 2 13 2 19 1 1 7 85

opening positions until one average price exceeds another byat least one standard deviation is the best option When theprice is relatively stable an investment decision should bemade immediately as long as the two moving averages cross

4 Discussion

This paper attempts to generate moving average tradingrules in the oil futures market using genetic algorithmsDifferent from other studies we use only moving averages astechnical indicators to identify usefulmoving average tradingrules without any other complex technical analysis tools orindicators Moving average trading rules are easy for tradersto operate and they are straightforward regardless of thesituation To identify the best trading rules in the crude oilfutures market we use genetic algorithms to select all theparameters in the moving average trading rules dynamicallyrather than doing so in a fixed manner

According to our genetic calculations using geneticalgorithms to find out the best lengths of the two movingaverage periods is advocated because the generated lengthsdiffer from each other in different price trends Static movingaverage trading rules with fixed period lengths cannot adaptto complex fluctuations of price in different periods Atraining process however which takes dynamic features ofprice fluctuations into consideration can help traders find outthe optimal lengths of the two moving periods of a tradingrule

Among the six moving average methods the AMA andTMAare themost popular among the generated trading rulesas these two methods have the ability to adapt to the pricetrendsThe AMA can change the weights of the current priceaccording to the volatility in the last several days As theTMA is the average of the SMA it more accurately reflectsthe price level However the selection of best moving averagecalculation method is affected by price trends Traders canchoose methods more scientifically according to the pricetrends and fluctuations Based on our experiment resultsTPMA is an optimal choice when price experiences a declineprocess with significant fluctuations and generating moving

average trading rules are outstanding compared with BHstrategy in these occasions Although EMA takes a verysmall proportion in the total 420 experiments it is alsoan applicable method other than AMA when price fallssmoothly

For the periods in which the price volatility is apparentdecisions will not be made until the difference betweenthe two averages exceeds the standard deviation of theshort sample prices thereby reducing the transaction riskHowever this method is not suitable for a period in whichthe price is relatively stable In these situations hesitationmaysometimes cause traders tomiss possible profit opportunities

As a whole generated moving average trading rules canhelp traders make profits in the long term However geneticalgorithms cannot guarantee access to additional revenuein every period as they are only useful in acquiring excessreturns in special situations The generated moving averagetrading rules demonstrate outstanding performance whenthe crude oil futures price falls with significant fluctuationsThe BH strategy will lose on these occasions while thegenerated trading rule can help traders foresee a decline inprice and reduce losses Our trading rules also yield positivereturns during the fluctuations by the timely changing ofpositions

When the price falls smoothly with few fluctuations inthe process generated trading rules can yield excess returnscompared to the BH strategy Although genetic algorithmscannot help traders receive positive returns during theseperiods the algorithms can help traders reduce loss bychanging positions with the change of price trends Whenthe price is stable or rising smoothly the generated rulesmay generate returns However they cannot generate morereturns than the BH strategy Limited returns cannot affordthe transaction costsWhen the price falls the generated rulesmay be superior to the BH strategy Genetic algorithms canalso help tradersmake profits in the process of price increaseswith small fluctuations In these periods the BH strategy isbetter than generated trading rules because the transactionsin the process generate transaction costs and may miss someprofit opportunities Generated moving average trading rules

8 Mathematical Problems in Engineering

Table 5 Numbers of trading rules in which sd = 1

Period 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 CountCount 19 19 20 0 5 3 13 12 0 2 0 0 13 2 0 2 0 1 20 19 0 150

0

4

8

12

16

20

24

28

32

20 40 60 80 100 120 140 160 180

Mean 1009833Median 1020000Maximum 1940000Minimum 6000000Std dev 4443764Skewness 0011466Kurtosis 2361692

Jarque-Bera 7139346Probability 0028165

Series MSample 1 420Observations 420

Figure 4 Distribution of119872

0 02 04 06 08 1

Cat

egor

y 1

Cat

egor

y 2

Cat

egor

y 3

Cat

egor

y 4

SMAWMAEMA

AMATPMATMA

Figure 5 Proportions of methods in different categories

have poor performance if there are no notable trends in theprice change In these periods moving average indicatorscannot find profit opportunities because the volatility is toosmall The trends of price changes are delayed by the movingaveragemethodTherefore when a decision ismade the pricetrend must also change and as a result there is no doubt thatthe trader will experience deficits

Using genetic algorithms moving average trading rulesdo help traders to gain returns in the actual futures market

We also identified the best lengths for the two periods withrespect to moving average rules and recommend the movingaverage calculation method for the crude oil futures marketTechnical trading rules with only moving average indicatorsgenerated by genetic algorithms demonstrate no sufficientadvantages compared to the BH strategy because the overallprice increased during the 30-year period Nevertheless gen-erated moving trading rules are beneficial for traders undercertain circumstances especially when there are significantchanges in prices

In this paper we search best trading rules according to thereturn rate of each one without regard to asset conditions andopen interest which proves to be the greatest limitation of thestudy To improve the accuracy of the results a simulationwith actual assets is recommended Accordingly we willundertake this endeavor in a subsequent research

5 Concluding Remarks

We conclude that the genetic algorithms identify bettertechnical rules that allow traders to actualize profits fromtheir investmentsWhile we have no evidence to demonstratethat generated trading rules result in greater returns thandoes the BH strategy our conclusion is consistent with theefficient market hypothesis While generated trading rulesfacilitate traders in realizing excess returns with respect totheir investing activities under specific circumstances theycannot at least by usingmoving average trading rules ensuremore long-term excess returns than the BH strategy Withrespect to the selection of two periods finding out optimallengths using genetic algorithms is helpful for making moreprofits Of the six moving average indicators AMA and TMAare the most popular moving average calculation methodsfor the crude oil futures market in total while TPMA is an

Mathematical Problems in Engineering 9

outstanding method in some occasion When the crude oilprices demonstrate notable volatility a trader is advised towait until the difference of the two moving averages exceedsthe standard deviation of the short period and vice versa

Based on the above analysis it is better to use BH strategywhen the price increases or is stable However generatedmoving average trading rules are better than BH strategywhen crude oil futures price decreases With respect to themoving average calculation method it is advocated to useTPMA when price falls with significant fluctuations andAMA when price falls smoothly although TPMA is not apopularmethod overallWe propose variablemoving averagetrading rules generated by training processes rather thanstatic moving average trading rules in the crude oil futuresmarkets

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Authorsrsquo Contribution

Model design was done by Haizhong An Lijun Wangand Xuan Huang program development and experimentsperformance were done by Xiaojia Liu and Lijun Wang dataanalysis was done by Haizhong An Xiaohua Xia and XiaoqiSun paper composition was done by Lijun Wang XiaohuaXia and Xiaojia Liu and literature retrieval and manuscriptediting were done by Xiaojia Liu Xuan Huang and XiaoqiSun

Acknowledgments

This research was partly supported by the NSFC (China)(Grant no 71173199) and Humanities and the Social Sciencesplanning funds project under the Ministry of Education ofthe PRC (Grant no 10YJA630001) The authors would like toacknowledge valuable suggestions fromWei Fang XiaoliangJia and Qier An

References

[1] Z M Chen and G Q Chen ldquoDemand-driven energy require-ment of world economy 2007 a multi-region input-outputnetwork simulationrdquo Communications in Nonlinear Science andNumerical Simulation vol 18 no 7 pp 1757ndash1774 2013

[2] G Wu L-C Liu and Y-M Wei ldquoComparison of Chinarsquos oilimport risk results based on portfolio theory and a diversifica-tion index approachrdquo Energy Policy vol 37 no 9 pp 3557ndash35652009

[3] X H Xia G T Huang G Q Chen B Zhang Z M Chenand Q Yang ldquoEnergy security efficiency and carbon emissionof Chinese industryrdquo Energy Policy vol 39 no 6 pp 3520ndash35282011

[4] X H Xia and G Q Chen ldquoEnergy abatement in Chineseindustry cost evaluation of regulation strategies and allocationalternativesrdquo Energy Policy vol 45 pp 449ndash458 2012

[5] N Cui Y Lei andW Fang ldquoDesign and impact estimation of areform program of Chinarsquos tax and fee policies for low-grade oiland gas resourcesrdquo Petroleum Science vol 8 no 4 pp 515ndash5262011

[6] Y L Lei N Cui and D Y Pan ldquoEconomic and socialeffects analysis of mineral development in China and policyimplicationsrdquo Resources Policy vol 38 pp 448ndash457 2013

[7] Z M Chen and G Q Chen ldquoAn overview of energy consump-tion of the globalized world economyrdquo Energy Policy vol 39 no10 pp 5920ndash5928 2011

[8] N Nomikos and K Andriosopoulos ldquoModelling energy spotprices empirical evidence from NYMEXrdquo Energy Economicsvol 34 no 4 pp 1153ndash1169 2012

[9] G B Ning Z J Zhen P Wang Y Li and H X Yin ldquoEconomicanalysis on value chain of taxi fleet with battery-swappingmodeusingmultiobjective genetic algorithmrdquoMathematical Problemsin Engineering vol 2012 Article ID 175912 15 pages 2012

[10] S Chai Y B Li J Wang and C Wu ldquoA genetic algorithmfor task scheduling on NoC using FDH cross efficiencyrdquoMathematical Problems in Engineering vol 2013 Article ID708495 16 pages 2013

[11] G Q Chen and B Chen ldquoResource analysis of the Chinesesociety 1980ndash2002 based on exergy Part 1 fossil fuels and energymineralsrdquo Energy Policy vol 35 no 4 pp 2038ndash2050 2007

[12] Z Chen G Chen X Xia and S Xu ldquoGlobal network ofembodied water flow by systems input-output simulationrdquoFrontiers of Earth Science vol 6 no 3 pp 331ndash344 2012

[13] Z M Chen and G Q Chen ldquoEmbodied carbon dioxideemission at supra-national scale a coalition analysis for G7BRIC and the rest of the worldrdquo Energy Policy vol 39 no 5pp 2899ndash2909 2011

[14] H Z An X-Y Gao W Fang X Huang and Y H Ding ldquoTherole of fluctuating modes of autocorrelation in crude oil pricesrdquoPhysica A vol 393 pp 382ndash390 2014

[15] X-Y GaoH-Z AnH-H Liu andY-HDing ldquoAnalysis on thetopological properties of the linkage complex network betweencrude oil future price and spot pricerdquo Acta Physica Sinica vol60 no 6 Article ID 068902 2011

[16] X-Y Gao H Z An and W Fang ldquoResearch on fluctuation ofbivariate correlation of time series based on complex networkstheoryrdquo Acta Physica Sinica vol 61 no 9 Article ID 0989022012

[17] S Yu and Y-M Wei ldquoPrediction of Chinarsquos coal production-environmental pollution based on a hybrid genetic algorithm-system dynamics modelrdquo Energy Policy vol 42 pp 521ndash5292012

[18] S Geisendorf ldquoInternal selection and market selection in eco-nomic genetic algorithmsrdquo Journal of Evolutionary Economicsvol 21 no 5 pp 817ndash841 2011

[19] R Tehrani and F Khodayar ldquoA hybrid optimized artificialintelligent model to forecast crude oil using genetic algorithmrdquoAfrican Journal of Business Management vol 5 pp 13130ndash131352011

[20] A M Elaiw X Xia and A M Shehata ldquoMinimization of fuelcosts and gaseous emissions of electric power generation bymodel predictive controlrdquo Mathematical Problems in Engineer-ing vol 2013 Article ID 906958 15 pages 2013

[21] L Mendes P Godinho and J Dias ldquoA Forex trading systembased on a genetic algorithmrdquo Journal of Heuristics vol 18 no4 pp 627ndash656 2012

10 Mathematical Problems in Engineering

[22] M C Roberts ldquoTechnical analysis and genetic programmingconstructing and testing a commodity portfoliordquo Journal ofFutures Markets vol 25 no 7 pp 643ndash660 2005

[23] J-Y Potvin P Soriano and V Maxime ldquoGenerating tradingrules on the stock markets with genetic programmingrdquo Com-puters and Operations Research vol 31 no 7 pp 1033ndash10472004

[24] A Esfahanipour and S Mousavi ldquoA genetic programmingmodel to generate risk-adjusted technical trading rules in stockmarketsrdquo Expert Systems with Applications vol 38 no 7 pp8438ndash8445 2011

[25] M A H Dempster T W Payne Y Romahi and G W PThompson ldquoComputational learning techniques for intradayFX trading using popular technical indicatorsrdquo IEEE Transac-tions on Neural Networks vol 12 no 4 pp 744ndash754 2001

[26] T Nakashima Y Yokota Y Shoji and H Ishibuchi ldquoA geneticapproach to the design of autonomous agents for futurestradingrdquo Artificial Life and Robotics vol 11 no 2 pp 145ndash1482007

[27] A Ghandar Z Michalewicz M Schmidt T-D To and RZurbrugg ldquoComputational intelligence for evolving tradingrulesrdquo IEEE Transactions on Evolutionary Computation vol 13no 1 pp 71ndash86 2009

[28] W L Tung and C Quek ldquoFinancial volatility trading usinga self-organising neural-fuzzy semantic network and optionstraddle-based approachrdquo Expert Systems with Applications vol38 no 5 pp 4668ndash4688 2011

[29] C-H Cheng T-L Chen and L-Y Wei ldquoA hybrid model basedon rough sets theory and genetic algorithms for stock priceforecastingrdquo Information Sciences vol 180 no 9 pp 1610ndash16292010

[30] P-C Chang C-Y Fan and J-L Lin ldquoTrend discovery infinancial time series data using a case based fuzzy decision treerdquoExpert Systems with Applications vol 38 no 5 pp 6070ndash60802011

[31] G A Vasilakis K A Theofilatos E F Georgopoulos AKarathanasopoulos and S D Likothanassis ldquoA genetic pro-gramming approach for EURUSD exchange rate forecastingand tradingrdquo Computational Economics vol 42 no 4 pp 415ndash431 2013

[32] I A Boboc and M C Dinica ldquoAn algorithm for testing theefficient market hypothesisrdquo PLoS ONE vol 8 no 10 ArticleID e78177 2013

[33] W Cheung K S K Lam and H F Yeung ldquoIntertemporalprofitability and the stability of technical analysis evidencesfrom the Hong Kong stock exchangerdquo Applied Economics vol43 no 15 pp 1945ndash1963 2011

[34] H Dewachter and M Lyrio ldquoThe economic value of technicaltrading rules a nonparametric utility-based approachrdquo Interna-tional Journal of Finance and Economics vol 10 no 1 pp 41ndash622005

[35] A Fernandez-Perez F Fernandez-Rodrıguez and S Sosvilla-Rivero ldquoExploiting trends in the foreign exchange marketsrdquoApplied Economics Letters vol 19 no 6 pp 591ndash597 2012

[36] M Metghalchia J Marcucci and Y-H Chang ldquoAre movingaverage trading rules profitable Evidence from the EuropeanstockmarketsrdquoApplied Economics vol 44 no 12 pp 1539ndash15592012

[37] C J Neely P A Weller and J M Ulrich ldquoThe adaptive mar-kets hypothesis evidence from the foreign exchange marketrdquoJournal of Financial and Quantitative Analysis vol 44 no 2 pp467ndash488 2009

[38] W E Shambora and R Rossiter ldquoAre there exploitable ineffi-ciencies in the futures market for oilrdquo Energy Economics vol29 no 1 pp 18ndash27 2007

[39] F Allen and R Karjalainen ldquoUsing genetic algorithms to findtechnical trading rulesrdquo Journal of Financial Economics vol 51no 2 pp 245ndash271 1999

[40] J Wang ldquoTrading and hedging in SampP 500 spot and futuresmarkets using genetic programmingrdquo Journal of Futures Mar-kets vol 20 no 10 pp 911ndash942 2000

[41] J HowM Ling and P Verhoeven ldquoDoes size matter A geneticprogramming approach to technical tradingrdquo QuantitativeFinance vol 10 no 2 pp 131ndash140 2010

[42] F Wang P L H Yu and D W Cheung ldquoCombining technicaltrading rules using particle swarm optimizationrdquo Expert Sys-tems with Applications vol 41 no 6 pp 3016ndash3026 2014

[43] J Andrada-Felix and F Fernandez-Rodrıguez ldquoImprovingmoving average trading rules with boosting and statisticallearningmethodsrdquo Journal of Forecasting vol 27 no 5 pp 433ndash449 2008

[44] T T-L Chong and W-K Ng ldquoTechnical analysis and theLondon stock exchange testing the MACD and RSI rules usingthe FT30rdquoApplied Economics Letters vol 15 no 14 pp 1111ndash11142008

[45] I Cialenco andA Protopapadakis ldquoDo technical trading profitsremain in the foreign exchange market Evidence from 14 cur-renciesrdquo Journal of International Financial Markets Institutionsand Money vol 21 no 2 pp 176ndash206 2011

[46] A E Milionis and E Papanagiotou ldquoDecomposing the predic-tive performance of themoving average trading rule of technicalanalysis the contribution of linear andnon-linear dependenciesin stock returnsrdquo Journal of Applied Statistics vol 40 no 11 pp2480ndash2494 2013

[47] Y S Ni J T Lee and Y C Liao ldquoDo variable length movingaverage trading rules matter during a financial crisis periodrdquoApplied Economics Letters vol 20 no 2 pp 135ndash141 2013

[48] V Pavlov and S Hurn ldquoTesting the profitability of moving-average rules as a portfolio selection strategyrdquo Pacific-BasinFinance Journal vol 20 no 5 pp 825ndash842 2012

[49] C Chiarella X-Z He and C Hommes ldquoA dynamic analysisof moving average rulesrdquo Journal of Economic Dynamics ampControl vol 30 no 9-10 pp 1729ndash1753 2006

[50] X-Z He and M Zheng ldquoDynamics of moving average rules ina continuous-time financialmarketmodelrdquo Journal of EconomicBehavior and Organization vol 76 no 3 pp 615ndash634 2010

[51] C Neely P Weller and R Dittmar Is Technical Analysis in theForeign Exchange Market Profitable A Genetic ProgrammingApproach Cambridge University Press 1997

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Mathematical Problems in Engineering 7

Table 3 The average value of119872 and119873 in each period

Period 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 AvgAvg (119872) 104 108 65 121 101 59 51 55 143 107 140 131 118 81 78 96 160 119 112 101 71 101Avg (119873) 24 36 15 45 29 29 26 16 47 37 36 43 44 47 22 18 53 24 19 31 40 32

Table 4 Calculation methods of moving average price in each period

Method Period1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Count

SMA 7 4 1 4 3 3 7 4 10 1 2 1 13 6 3 69WMA 1 1 1 5 3 2 1 3 6 23EMA 1 4 7 2 2 15 31AMA 1 1 20 15 14 8 8 2 9 4 18 16 18 2 1 8 145TPMA 8 19 12 2 3 2 6 2 1 3 9 67TMA 2 4 3 1 8 11 11 2 13 2 19 1 1 7 85

opening positions until one average price exceeds another byat least one standard deviation is the best option When theprice is relatively stable an investment decision should bemade immediately as long as the two moving averages cross

4 Discussion

This paper attempts to generate moving average tradingrules in the oil futures market using genetic algorithmsDifferent from other studies we use only moving averages astechnical indicators to identify usefulmoving average tradingrules without any other complex technical analysis tools orindicators Moving average trading rules are easy for tradersto operate and they are straightforward regardless of thesituation To identify the best trading rules in the crude oilfutures market we use genetic algorithms to select all theparameters in the moving average trading rules dynamicallyrather than doing so in a fixed manner

According to our genetic calculations using geneticalgorithms to find out the best lengths of the two movingaverage periods is advocated because the generated lengthsdiffer from each other in different price trends Static movingaverage trading rules with fixed period lengths cannot adaptto complex fluctuations of price in different periods Atraining process however which takes dynamic features ofprice fluctuations into consideration can help traders find outthe optimal lengths of the two moving periods of a tradingrule

Among the six moving average methods the AMA andTMAare themost popular among the generated trading rulesas these two methods have the ability to adapt to the pricetrendsThe AMA can change the weights of the current priceaccording to the volatility in the last several days As theTMA is the average of the SMA it more accurately reflectsthe price level However the selection of best moving averagecalculation method is affected by price trends Traders canchoose methods more scientifically according to the pricetrends and fluctuations Based on our experiment resultsTPMA is an optimal choice when price experiences a declineprocess with significant fluctuations and generating moving

average trading rules are outstanding compared with BHstrategy in these occasions Although EMA takes a verysmall proportion in the total 420 experiments it is alsoan applicable method other than AMA when price fallssmoothly

For the periods in which the price volatility is apparentdecisions will not be made until the difference betweenthe two averages exceeds the standard deviation of theshort sample prices thereby reducing the transaction riskHowever this method is not suitable for a period in whichthe price is relatively stable In these situations hesitationmaysometimes cause traders tomiss possible profit opportunities

As a whole generated moving average trading rules canhelp traders make profits in the long term However geneticalgorithms cannot guarantee access to additional revenuein every period as they are only useful in acquiring excessreturns in special situations The generated moving averagetrading rules demonstrate outstanding performance whenthe crude oil futures price falls with significant fluctuationsThe BH strategy will lose on these occasions while thegenerated trading rule can help traders foresee a decline inprice and reduce losses Our trading rules also yield positivereturns during the fluctuations by the timely changing ofpositions

When the price falls smoothly with few fluctuations inthe process generated trading rules can yield excess returnscompared to the BH strategy Although genetic algorithmscannot help traders receive positive returns during theseperiods the algorithms can help traders reduce loss bychanging positions with the change of price trends Whenthe price is stable or rising smoothly the generated rulesmay generate returns However they cannot generate morereturns than the BH strategy Limited returns cannot affordthe transaction costsWhen the price falls the generated rulesmay be superior to the BH strategy Genetic algorithms canalso help tradersmake profits in the process of price increaseswith small fluctuations In these periods the BH strategy isbetter than generated trading rules because the transactionsin the process generate transaction costs and may miss someprofit opportunities Generated moving average trading rules

8 Mathematical Problems in Engineering

Table 5 Numbers of trading rules in which sd = 1

Period 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 CountCount 19 19 20 0 5 3 13 12 0 2 0 0 13 2 0 2 0 1 20 19 0 150

0

4

8

12

16

20

24

28

32

20 40 60 80 100 120 140 160 180

Mean 1009833Median 1020000Maximum 1940000Minimum 6000000Std dev 4443764Skewness 0011466Kurtosis 2361692

Jarque-Bera 7139346Probability 0028165

Series MSample 1 420Observations 420

Figure 4 Distribution of119872

0 02 04 06 08 1

Cat

egor

y 1

Cat

egor

y 2

Cat

egor

y 3

Cat

egor

y 4

SMAWMAEMA

AMATPMATMA

Figure 5 Proportions of methods in different categories

have poor performance if there are no notable trends in theprice change In these periods moving average indicatorscannot find profit opportunities because the volatility is toosmall The trends of price changes are delayed by the movingaveragemethodTherefore when a decision ismade the pricetrend must also change and as a result there is no doubt thatthe trader will experience deficits

Using genetic algorithms moving average trading rulesdo help traders to gain returns in the actual futures market

We also identified the best lengths for the two periods withrespect to moving average rules and recommend the movingaverage calculation method for the crude oil futures marketTechnical trading rules with only moving average indicatorsgenerated by genetic algorithms demonstrate no sufficientadvantages compared to the BH strategy because the overallprice increased during the 30-year period Nevertheless gen-erated moving trading rules are beneficial for traders undercertain circumstances especially when there are significantchanges in prices

In this paper we search best trading rules according to thereturn rate of each one without regard to asset conditions andopen interest which proves to be the greatest limitation of thestudy To improve the accuracy of the results a simulationwith actual assets is recommended Accordingly we willundertake this endeavor in a subsequent research

5 Concluding Remarks

We conclude that the genetic algorithms identify bettertechnical rules that allow traders to actualize profits fromtheir investmentsWhile we have no evidence to demonstratethat generated trading rules result in greater returns thandoes the BH strategy our conclusion is consistent with theefficient market hypothesis While generated trading rulesfacilitate traders in realizing excess returns with respect totheir investing activities under specific circumstances theycannot at least by usingmoving average trading rules ensuremore long-term excess returns than the BH strategy Withrespect to the selection of two periods finding out optimallengths using genetic algorithms is helpful for making moreprofits Of the six moving average indicators AMA and TMAare the most popular moving average calculation methodsfor the crude oil futures market in total while TPMA is an

Mathematical Problems in Engineering 9

outstanding method in some occasion When the crude oilprices demonstrate notable volatility a trader is advised towait until the difference of the two moving averages exceedsthe standard deviation of the short period and vice versa

Based on the above analysis it is better to use BH strategywhen the price increases or is stable However generatedmoving average trading rules are better than BH strategywhen crude oil futures price decreases With respect to themoving average calculation method it is advocated to useTPMA when price falls with significant fluctuations andAMA when price falls smoothly although TPMA is not apopularmethod overallWe propose variablemoving averagetrading rules generated by training processes rather thanstatic moving average trading rules in the crude oil futuresmarkets

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Authorsrsquo Contribution

Model design was done by Haizhong An Lijun Wangand Xuan Huang program development and experimentsperformance were done by Xiaojia Liu and Lijun Wang dataanalysis was done by Haizhong An Xiaohua Xia and XiaoqiSun paper composition was done by Lijun Wang XiaohuaXia and Xiaojia Liu and literature retrieval and manuscriptediting were done by Xiaojia Liu Xuan Huang and XiaoqiSun

Acknowledgments

This research was partly supported by the NSFC (China)(Grant no 71173199) and Humanities and the Social Sciencesplanning funds project under the Ministry of Education ofthe PRC (Grant no 10YJA630001) The authors would like toacknowledge valuable suggestions fromWei Fang XiaoliangJia and Qier An

References

[1] Z M Chen and G Q Chen ldquoDemand-driven energy require-ment of world economy 2007 a multi-region input-outputnetwork simulationrdquo Communications in Nonlinear Science andNumerical Simulation vol 18 no 7 pp 1757ndash1774 2013

[2] G Wu L-C Liu and Y-M Wei ldquoComparison of Chinarsquos oilimport risk results based on portfolio theory and a diversifica-tion index approachrdquo Energy Policy vol 37 no 9 pp 3557ndash35652009

[3] X H Xia G T Huang G Q Chen B Zhang Z M Chenand Q Yang ldquoEnergy security efficiency and carbon emissionof Chinese industryrdquo Energy Policy vol 39 no 6 pp 3520ndash35282011

[4] X H Xia and G Q Chen ldquoEnergy abatement in Chineseindustry cost evaluation of regulation strategies and allocationalternativesrdquo Energy Policy vol 45 pp 449ndash458 2012

[5] N Cui Y Lei andW Fang ldquoDesign and impact estimation of areform program of Chinarsquos tax and fee policies for low-grade oiland gas resourcesrdquo Petroleum Science vol 8 no 4 pp 515ndash5262011

[6] Y L Lei N Cui and D Y Pan ldquoEconomic and socialeffects analysis of mineral development in China and policyimplicationsrdquo Resources Policy vol 38 pp 448ndash457 2013

[7] Z M Chen and G Q Chen ldquoAn overview of energy consump-tion of the globalized world economyrdquo Energy Policy vol 39 no10 pp 5920ndash5928 2011

[8] N Nomikos and K Andriosopoulos ldquoModelling energy spotprices empirical evidence from NYMEXrdquo Energy Economicsvol 34 no 4 pp 1153ndash1169 2012

[9] G B Ning Z J Zhen P Wang Y Li and H X Yin ldquoEconomicanalysis on value chain of taxi fleet with battery-swappingmodeusingmultiobjective genetic algorithmrdquoMathematical Problemsin Engineering vol 2012 Article ID 175912 15 pages 2012

[10] S Chai Y B Li J Wang and C Wu ldquoA genetic algorithmfor task scheduling on NoC using FDH cross efficiencyrdquoMathematical Problems in Engineering vol 2013 Article ID708495 16 pages 2013

[11] G Q Chen and B Chen ldquoResource analysis of the Chinesesociety 1980ndash2002 based on exergy Part 1 fossil fuels and energymineralsrdquo Energy Policy vol 35 no 4 pp 2038ndash2050 2007

[12] Z Chen G Chen X Xia and S Xu ldquoGlobal network ofembodied water flow by systems input-output simulationrdquoFrontiers of Earth Science vol 6 no 3 pp 331ndash344 2012

[13] Z M Chen and G Q Chen ldquoEmbodied carbon dioxideemission at supra-national scale a coalition analysis for G7BRIC and the rest of the worldrdquo Energy Policy vol 39 no 5pp 2899ndash2909 2011

[14] H Z An X-Y Gao W Fang X Huang and Y H Ding ldquoTherole of fluctuating modes of autocorrelation in crude oil pricesrdquoPhysica A vol 393 pp 382ndash390 2014

[15] X-Y GaoH-Z AnH-H Liu andY-HDing ldquoAnalysis on thetopological properties of the linkage complex network betweencrude oil future price and spot pricerdquo Acta Physica Sinica vol60 no 6 Article ID 068902 2011

[16] X-Y Gao H Z An and W Fang ldquoResearch on fluctuation ofbivariate correlation of time series based on complex networkstheoryrdquo Acta Physica Sinica vol 61 no 9 Article ID 0989022012

[17] S Yu and Y-M Wei ldquoPrediction of Chinarsquos coal production-environmental pollution based on a hybrid genetic algorithm-system dynamics modelrdquo Energy Policy vol 42 pp 521ndash5292012

[18] S Geisendorf ldquoInternal selection and market selection in eco-nomic genetic algorithmsrdquo Journal of Evolutionary Economicsvol 21 no 5 pp 817ndash841 2011

[19] R Tehrani and F Khodayar ldquoA hybrid optimized artificialintelligent model to forecast crude oil using genetic algorithmrdquoAfrican Journal of Business Management vol 5 pp 13130ndash131352011

[20] A M Elaiw X Xia and A M Shehata ldquoMinimization of fuelcosts and gaseous emissions of electric power generation bymodel predictive controlrdquo Mathematical Problems in Engineer-ing vol 2013 Article ID 906958 15 pages 2013

[21] L Mendes P Godinho and J Dias ldquoA Forex trading systembased on a genetic algorithmrdquo Journal of Heuristics vol 18 no4 pp 627ndash656 2012

10 Mathematical Problems in Engineering

[22] M C Roberts ldquoTechnical analysis and genetic programmingconstructing and testing a commodity portfoliordquo Journal ofFutures Markets vol 25 no 7 pp 643ndash660 2005

[23] J-Y Potvin P Soriano and V Maxime ldquoGenerating tradingrules on the stock markets with genetic programmingrdquo Com-puters and Operations Research vol 31 no 7 pp 1033ndash10472004

[24] A Esfahanipour and S Mousavi ldquoA genetic programmingmodel to generate risk-adjusted technical trading rules in stockmarketsrdquo Expert Systems with Applications vol 38 no 7 pp8438ndash8445 2011

[25] M A H Dempster T W Payne Y Romahi and G W PThompson ldquoComputational learning techniques for intradayFX trading using popular technical indicatorsrdquo IEEE Transac-tions on Neural Networks vol 12 no 4 pp 744ndash754 2001

[26] T Nakashima Y Yokota Y Shoji and H Ishibuchi ldquoA geneticapproach to the design of autonomous agents for futurestradingrdquo Artificial Life and Robotics vol 11 no 2 pp 145ndash1482007

[27] A Ghandar Z Michalewicz M Schmidt T-D To and RZurbrugg ldquoComputational intelligence for evolving tradingrulesrdquo IEEE Transactions on Evolutionary Computation vol 13no 1 pp 71ndash86 2009

[28] W L Tung and C Quek ldquoFinancial volatility trading usinga self-organising neural-fuzzy semantic network and optionstraddle-based approachrdquo Expert Systems with Applications vol38 no 5 pp 4668ndash4688 2011

[29] C-H Cheng T-L Chen and L-Y Wei ldquoA hybrid model basedon rough sets theory and genetic algorithms for stock priceforecastingrdquo Information Sciences vol 180 no 9 pp 1610ndash16292010

[30] P-C Chang C-Y Fan and J-L Lin ldquoTrend discovery infinancial time series data using a case based fuzzy decision treerdquoExpert Systems with Applications vol 38 no 5 pp 6070ndash60802011

[31] G A Vasilakis K A Theofilatos E F Georgopoulos AKarathanasopoulos and S D Likothanassis ldquoA genetic pro-gramming approach for EURUSD exchange rate forecastingand tradingrdquo Computational Economics vol 42 no 4 pp 415ndash431 2013

[32] I A Boboc and M C Dinica ldquoAn algorithm for testing theefficient market hypothesisrdquo PLoS ONE vol 8 no 10 ArticleID e78177 2013

[33] W Cheung K S K Lam and H F Yeung ldquoIntertemporalprofitability and the stability of technical analysis evidencesfrom the Hong Kong stock exchangerdquo Applied Economics vol43 no 15 pp 1945ndash1963 2011

[34] H Dewachter and M Lyrio ldquoThe economic value of technicaltrading rules a nonparametric utility-based approachrdquo Interna-tional Journal of Finance and Economics vol 10 no 1 pp 41ndash622005

[35] A Fernandez-Perez F Fernandez-Rodrıguez and S Sosvilla-Rivero ldquoExploiting trends in the foreign exchange marketsrdquoApplied Economics Letters vol 19 no 6 pp 591ndash597 2012

[36] M Metghalchia J Marcucci and Y-H Chang ldquoAre movingaverage trading rules profitable Evidence from the EuropeanstockmarketsrdquoApplied Economics vol 44 no 12 pp 1539ndash15592012

[37] C J Neely P A Weller and J M Ulrich ldquoThe adaptive mar-kets hypothesis evidence from the foreign exchange marketrdquoJournal of Financial and Quantitative Analysis vol 44 no 2 pp467ndash488 2009

[38] W E Shambora and R Rossiter ldquoAre there exploitable ineffi-ciencies in the futures market for oilrdquo Energy Economics vol29 no 1 pp 18ndash27 2007

[39] F Allen and R Karjalainen ldquoUsing genetic algorithms to findtechnical trading rulesrdquo Journal of Financial Economics vol 51no 2 pp 245ndash271 1999

[40] J Wang ldquoTrading and hedging in SampP 500 spot and futuresmarkets using genetic programmingrdquo Journal of Futures Mar-kets vol 20 no 10 pp 911ndash942 2000

[41] J HowM Ling and P Verhoeven ldquoDoes size matter A geneticprogramming approach to technical tradingrdquo QuantitativeFinance vol 10 no 2 pp 131ndash140 2010

[42] F Wang P L H Yu and D W Cheung ldquoCombining technicaltrading rules using particle swarm optimizationrdquo Expert Sys-tems with Applications vol 41 no 6 pp 3016ndash3026 2014

[43] J Andrada-Felix and F Fernandez-Rodrıguez ldquoImprovingmoving average trading rules with boosting and statisticallearningmethodsrdquo Journal of Forecasting vol 27 no 5 pp 433ndash449 2008

[44] T T-L Chong and W-K Ng ldquoTechnical analysis and theLondon stock exchange testing the MACD and RSI rules usingthe FT30rdquoApplied Economics Letters vol 15 no 14 pp 1111ndash11142008

[45] I Cialenco andA Protopapadakis ldquoDo technical trading profitsremain in the foreign exchange market Evidence from 14 cur-renciesrdquo Journal of International Financial Markets Institutionsand Money vol 21 no 2 pp 176ndash206 2011

[46] A E Milionis and E Papanagiotou ldquoDecomposing the predic-tive performance of themoving average trading rule of technicalanalysis the contribution of linear andnon-linear dependenciesin stock returnsrdquo Journal of Applied Statistics vol 40 no 11 pp2480ndash2494 2013

[47] Y S Ni J T Lee and Y C Liao ldquoDo variable length movingaverage trading rules matter during a financial crisis periodrdquoApplied Economics Letters vol 20 no 2 pp 135ndash141 2013

[48] V Pavlov and S Hurn ldquoTesting the profitability of moving-average rules as a portfolio selection strategyrdquo Pacific-BasinFinance Journal vol 20 no 5 pp 825ndash842 2012

[49] C Chiarella X-Z He and C Hommes ldquoA dynamic analysisof moving average rulesrdquo Journal of Economic Dynamics ampControl vol 30 no 9-10 pp 1729ndash1753 2006

[50] X-Z He and M Zheng ldquoDynamics of moving average rules ina continuous-time financialmarketmodelrdquo Journal of EconomicBehavior and Organization vol 76 no 3 pp 615ndash634 2010

[51] C Neely P Weller and R Dittmar Is Technical Analysis in theForeign Exchange Market Profitable A Genetic ProgrammingApproach Cambridge University Press 1997

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

8 Mathematical Problems in Engineering

Table 5 Numbers of trading rules in which sd = 1

Period 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 CountCount 19 19 20 0 5 3 13 12 0 2 0 0 13 2 0 2 0 1 20 19 0 150

0

4

8

12

16

20

24

28

32

20 40 60 80 100 120 140 160 180

Mean 1009833Median 1020000Maximum 1940000Minimum 6000000Std dev 4443764Skewness 0011466Kurtosis 2361692

Jarque-Bera 7139346Probability 0028165

Series MSample 1 420Observations 420

Figure 4 Distribution of119872

0 02 04 06 08 1

Cat

egor

y 1

Cat

egor

y 2

Cat

egor

y 3

Cat

egor

y 4

SMAWMAEMA

AMATPMATMA

Figure 5 Proportions of methods in different categories

have poor performance if there are no notable trends in theprice change In these periods moving average indicatorscannot find profit opportunities because the volatility is toosmall The trends of price changes are delayed by the movingaveragemethodTherefore when a decision ismade the pricetrend must also change and as a result there is no doubt thatthe trader will experience deficits

Using genetic algorithms moving average trading rulesdo help traders to gain returns in the actual futures market

We also identified the best lengths for the two periods withrespect to moving average rules and recommend the movingaverage calculation method for the crude oil futures marketTechnical trading rules with only moving average indicatorsgenerated by genetic algorithms demonstrate no sufficientadvantages compared to the BH strategy because the overallprice increased during the 30-year period Nevertheless gen-erated moving trading rules are beneficial for traders undercertain circumstances especially when there are significantchanges in prices

In this paper we search best trading rules according to thereturn rate of each one without regard to asset conditions andopen interest which proves to be the greatest limitation of thestudy To improve the accuracy of the results a simulationwith actual assets is recommended Accordingly we willundertake this endeavor in a subsequent research

5 Concluding Remarks

We conclude that the genetic algorithms identify bettertechnical rules that allow traders to actualize profits fromtheir investmentsWhile we have no evidence to demonstratethat generated trading rules result in greater returns thandoes the BH strategy our conclusion is consistent with theefficient market hypothesis While generated trading rulesfacilitate traders in realizing excess returns with respect totheir investing activities under specific circumstances theycannot at least by usingmoving average trading rules ensuremore long-term excess returns than the BH strategy Withrespect to the selection of two periods finding out optimallengths using genetic algorithms is helpful for making moreprofits Of the six moving average indicators AMA and TMAare the most popular moving average calculation methodsfor the crude oil futures market in total while TPMA is an

Mathematical Problems in Engineering 9

outstanding method in some occasion When the crude oilprices demonstrate notable volatility a trader is advised towait until the difference of the two moving averages exceedsthe standard deviation of the short period and vice versa

Based on the above analysis it is better to use BH strategywhen the price increases or is stable However generatedmoving average trading rules are better than BH strategywhen crude oil futures price decreases With respect to themoving average calculation method it is advocated to useTPMA when price falls with significant fluctuations andAMA when price falls smoothly although TPMA is not apopularmethod overallWe propose variablemoving averagetrading rules generated by training processes rather thanstatic moving average trading rules in the crude oil futuresmarkets

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Authorsrsquo Contribution

Model design was done by Haizhong An Lijun Wangand Xuan Huang program development and experimentsperformance were done by Xiaojia Liu and Lijun Wang dataanalysis was done by Haizhong An Xiaohua Xia and XiaoqiSun paper composition was done by Lijun Wang XiaohuaXia and Xiaojia Liu and literature retrieval and manuscriptediting were done by Xiaojia Liu Xuan Huang and XiaoqiSun

Acknowledgments

This research was partly supported by the NSFC (China)(Grant no 71173199) and Humanities and the Social Sciencesplanning funds project under the Ministry of Education ofthe PRC (Grant no 10YJA630001) The authors would like toacknowledge valuable suggestions fromWei Fang XiaoliangJia and Qier An

References

[1] Z M Chen and G Q Chen ldquoDemand-driven energy require-ment of world economy 2007 a multi-region input-outputnetwork simulationrdquo Communications in Nonlinear Science andNumerical Simulation vol 18 no 7 pp 1757ndash1774 2013

[2] G Wu L-C Liu and Y-M Wei ldquoComparison of Chinarsquos oilimport risk results based on portfolio theory and a diversifica-tion index approachrdquo Energy Policy vol 37 no 9 pp 3557ndash35652009

[3] X H Xia G T Huang G Q Chen B Zhang Z M Chenand Q Yang ldquoEnergy security efficiency and carbon emissionof Chinese industryrdquo Energy Policy vol 39 no 6 pp 3520ndash35282011

[4] X H Xia and G Q Chen ldquoEnergy abatement in Chineseindustry cost evaluation of regulation strategies and allocationalternativesrdquo Energy Policy vol 45 pp 449ndash458 2012

[5] N Cui Y Lei andW Fang ldquoDesign and impact estimation of areform program of Chinarsquos tax and fee policies for low-grade oiland gas resourcesrdquo Petroleum Science vol 8 no 4 pp 515ndash5262011

[6] Y L Lei N Cui and D Y Pan ldquoEconomic and socialeffects analysis of mineral development in China and policyimplicationsrdquo Resources Policy vol 38 pp 448ndash457 2013

[7] Z M Chen and G Q Chen ldquoAn overview of energy consump-tion of the globalized world economyrdquo Energy Policy vol 39 no10 pp 5920ndash5928 2011

[8] N Nomikos and K Andriosopoulos ldquoModelling energy spotprices empirical evidence from NYMEXrdquo Energy Economicsvol 34 no 4 pp 1153ndash1169 2012

[9] G B Ning Z J Zhen P Wang Y Li and H X Yin ldquoEconomicanalysis on value chain of taxi fleet with battery-swappingmodeusingmultiobjective genetic algorithmrdquoMathematical Problemsin Engineering vol 2012 Article ID 175912 15 pages 2012

[10] S Chai Y B Li J Wang and C Wu ldquoA genetic algorithmfor task scheduling on NoC using FDH cross efficiencyrdquoMathematical Problems in Engineering vol 2013 Article ID708495 16 pages 2013

[11] G Q Chen and B Chen ldquoResource analysis of the Chinesesociety 1980ndash2002 based on exergy Part 1 fossil fuels and energymineralsrdquo Energy Policy vol 35 no 4 pp 2038ndash2050 2007

[12] Z Chen G Chen X Xia and S Xu ldquoGlobal network ofembodied water flow by systems input-output simulationrdquoFrontiers of Earth Science vol 6 no 3 pp 331ndash344 2012

[13] Z M Chen and G Q Chen ldquoEmbodied carbon dioxideemission at supra-national scale a coalition analysis for G7BRIC and the rest of the worldrdquo Energy Policy vol 39 no 5pp 2899ndash2909 2011

[14] H Z An X-Y Gao W Fang X Huang and Y H Ding ldquoTherole of fluctuating modes of autocorrelation in crude oil pricesrdquoPhysica A vol 393 pp 382ndash390 2014

[15] X-Y GaoH-Z AnH-H Liu andY-HDing ldquoAnalysis on thetopological properties of the linkage complex network betweencrude oil future price and spot pricerdquo Acta Physica Sinica vol60 no 6 Article ID 068902 2011

[16] X-Y Gao H Z An and W Fang ldquoResearch on fluctuation ofbivariate correlation of time series based on complex networkstheoryrdquo Acta Physica Sinica vol 61 no 9 Article ID 0989022012

[17] S Yu and Y-M Wei ldquoPrediction of Chinarsquos coal production-environmental pollution based on a hybrid genetic algorithm-system dynamics modelrdquo Energy Policy vol 42 pp 521ndash5292012

[18] S Geisendorf ldquoInternal selection and market selection in eco-nomic genetic algorithmsrdquo Journal of Evolutionary Economicsvol 21 no 5 pp 817ndash841 2011

[19] R Tehrani and F Khodayar ldquoA hybrid optimized artificialintelligent model to forecast crude oil using genetic algorithmrdquoAfrican Journal of Business Management vol 5 pp 13130ndash131352011

[20] A M Elaiw X Xia and A M Shehata ldquoMinimization of fuelcosts and gaseous emissions of electric power generation bymodel predictive controlrdquo Mathematical Problems in Engineer-ing vol 2013 Article ID 906958 15 pages 2013

[21] L Mendes P Godinho and J Dias ldquoA Forex trading systembased on a genetic algorithmrdquo Journal of Heuristics vol 18 no4 pp 627ndash656 2012

10 Mathematical Problems in Engineering

[22] M C Roberts ldquoTechnical analysis and genetic programmingconstructing and testing a commodity portfoliordquo Journal ofFutures Markets vol 25 no 7 pp 643ndash660 2005

[23] J-Y Potvin P Soriano and V Maxime ldquoGenerating tradingrules on the stock markets with genetic programmingrdquo Com-puters and Operations Research vol 31 no 7 pp 1033ndash10472004

[24] A Esfahanipour and S Mousavi ldquoA genetic programmingmodel to generate risk-adjusted technical trading rules in stockmarketsrdquo Expert Systems with Applications vol 38 no 7 pp8438ndash8445 2011

[25] M A H Dempster T W Payne Y Romahi and G W PThompson ldquoComputational learning techniques for intradayFX trading using popular technical indicatorsrdquo IEEE Transac-tions on Neural Networks vol 12 no 4 pp 744ndash754 2001

[26] T Nakashima Y Yokota Y Shoji and H Ishibuchi ldquoA geneticapproach to the design of autonomous agents for futurestradingrdquo Artificial Life and Robotics vol 11 no 2 pp 145ndash1482007

[27] A Ghandar Z Michalewicz M Schmidt T-D To and RZurbrugg ldquoComputational intelligence for evolving tradingrulesrdquo IEEE Transactions on Evolutionary Computation vol 13no 1 pp 71ndash86 2009

[28] W L Tung and C Quek ldquoFinancial volatility trading usinga self-organising neural-fuzzy semantic network and optionstraddle-based approachrdquo Expert Systems with Applications vol38 no 5 pp 4668ndash4688 2011

[29] C-H Cheng T-L Chen and L-Y Wei ldquoA hybrid model basedon rough sets theory and genetic algorithms for stock priceforecastingrdquo Information Sciences vol 180 no 9 pp 1610ndash16292010

[30] P-C Chang C-Y Fan and J-L Lin ldquoTrend discovery infinancial time series data using a case based fuzzy decision treerdquoExpert Systems with Applications vol 38 no 5 pp 6070ndash60802011

[31] G A Vasilakis K A Theofilatos E F Georgopoulos AKarathanasopoulos and S D Likothanassis ldquoA genetic pro-gramming approach for EURUSD exchange rate forecastingand tradingrdquo Computational Economics vol 42 no 4 pp 415ndash431 2013

[32] I A Boboc and M C Dinica ldquoAn algorithm for testing theefficient market hypothesisrdquo PLoS ONE vol 8 no 10 ArticleID e78177 2013

[33] W Cheung K S K Lam and H F Yeung ldquoIntertemporalprofitability and the stability of technical analysis evidencesfrom the Hong Kong stock exchangerdquo Applied Economics vol43 no 15 pp 1945ndash1963 2011

[34] H Dewachter and M Lyrio ldquoThe economic value of technicaltrading rules a nonparametric utility-based approachrdquo Interna-tional Journal of Finance and Economics vol 10 no 1 pp 41ndash622005

[35] A Fernandez-Perez F Fernandez-Rodrıguez and S Sosvilla-Rivero ldquoExploiting trends in the foreign exchange marketsrdquoApplied Economics Letters vol 19 no 6 pp 591ndash597 2012

[36] M Metghalchia J Marcucci and Y-H Chang ldquoAre movingaverage trading rules profitable Evidence from the EuropeanstockmarketsrdquoApplied Economics vol 44 no 12 pp 1539ndash15592012

[37] C J Neely P A Weller and J M Ulrich ldquoThe adaptive mar-kets hypothesis evidence from the foreign exchange marketrdquoJournal of Financial and Quantitative Analysis vol 44 no 2 pp467ndash488 2009

[38] W E Shambora and R Rossiter ldquoAre there exploitable ineffi-ciencies in the futures market for oilrdquo Energy Economics vol29 no 1 pp 18ndash27 2007

[39] F Allen and R Karjalainen ldquoUsing genetic algorithms to findtechnical trading rulesrdquo Journal of Financial Economics vol 51no 2 pp 245ndash271 1999

[40] J Wang ldquoTrading and hedging in SampP 500 spot and futuresmarkets using genetic programmingrdquo Journal of Futures Mar-kets vol 20 no 10 pp 911ndash942 2000

[41] J HowM Ling and P Verhoeven ldquoDoes size matter A geneticprogramming approach to technical tradingrdquo QuantitativeFinance vol 10 no 2 pp 131ndash140 2010

[42] F Wang P L H Yu and D W Cheung ldquoCombining technicaltrading rules using particle swarm optimizationrdquo Expert Sys-tems with Applications vol 41 no 6 pp 3016ndash3026 2014

[43] J Andrada-Felix and F Fernandez-Rodrıguez ldquoImprovingmoving average trading rules with boosting and statisticallearningmethodsrdquo Journal of Forecasting vol 27 no 5 pp 433ndash449 2008

[44] T T-L Chong and W-K Ng ldquoTechnical analysis and theLondon stock exchange testing the MACD and RSI rules usingthe FT30rdquoApplied Economics Letters vol 15 no 14 pp 1111ndash11142008

[45] I Cialenco andA Protopapadakis ldquoDo technical trading profitsremain in the foreign exchange market Evidence from 14 cur-renciesrdquo Journal of International Financial Markets Institutionsand Money vol 21 no 2 pp 176ndash206 2011

[46] A E Milionis and E Papanagiotou ldquoDecomposing the predic-tive performance of themoving average trading rule of technicalanalysis the contribution of linear andnon-linear dependenciesin stock returnsrdquo Journal of Applied Statistics vol 40 no 11 pp2480ndash2494 2013

[47] Y S Ni J T Lee and Y C Liao ldquoDo variable length movingaverage trading rules matter during a financial crisis periodrdquoApplied Economics Letters vol 20 no 2 pp 135ndash141 2013

[48] V Pavlov and S Hurn ldquoTesting the profitability of moving-average rules as a portfolio selection strategyrdquo Pacific-BasinFinance Journal vol 20 no 5 pp 825ndash842 2012

[49] C Chiarella X-Z He and C Hommes ldquoA dynamic analysisof moving average rulesrdquo Journal of Economic Dynamics ampControl vol 30 no 9-10 pp 1729ndash1753 2006

[50] X-Z He and M Zheng ldquoDynamics of moving average rules ina continuous-time financialmarketmodelrdquo Journal of EconomicBehavior and Organization vol 76 no 3 pp 615ndash634 2010

[51] C Neely P Weller and R Dittmar Is Technical Analysis in theForeign Exchange Market Profitable A Genetic ProgrammingApproach Cambridge University Press 1997

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Mathematical Problems in Engineering 9

outstanding method in some occasion When the crude oilprices demonstrate notable volatility a trader is advised towait until the difference of the two moving averages exceedsthe standard deviation of the short period and vice versa

Based on the above analysis it is better to use BH strategywhen the price increases or is stable However generatedmoving average trading rules are better than BH strategywhen crude oil futures price decreases With respect to themoving average calculation method it is advocated to useTPMA when price falls with significant fluctuations andAMA when price falls smoothly although TPMA is not apopularmethod overallWe propose variablemoving averagetrading rules generated by training processes rather thanstatic moving average trading rules in the crude oil futuresmarkets

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Authorsrsquo Contribution

Model design was done by Haizhong An Lijun Wangand Xuan Huang program development and experimentsperformance were done by Xiaojia Liu and Lijun Wang dataanalysis was done by Haizhong An Xiaohua Xia and XiaoqiSun paper composition was done by Lijun Wang XiaohuaXia and Xiaojia Liu and literature retrieval and manuscriptediting were done by Xiaojia Liu Xuan Huang and XiaoqiSun

Acknowledgments

This research was partly supported by the NSFC (China)(Grant no 71173199) and Humanities and the Social Sciencesplanning funds project under the Ministry of Education ofthe PRC (Grant no 10YJA630001) The authors would like toacknowledge valuable suggestions fromWei Fang XiaoliangJia and Qier An

References

[1] Z M Chen and G Q Chen ldquoDemand-driven energy require-ment of world economy 2007 a multi-region input-outputnetwork simulationrdquo Communications in Nonlinear Science andNumerical Simulation vol 18 no 7 pp 1757ndash1774 2013

[2] G Wu L-C Liu and Y-M Wei ldquoComparison of Chinarsquos oilimport risk results based on portfolio theory and a diversifica-tion index approachrdquo Energy Policy vol 37 no 9 pp 3557ndash35652009

[3] X H Xia G T Huang G Q Chen B Zhang Z M Chenand Q Yang ldquoEnergy security efficiency and carbon emissionof Chinese industryrdquo Energy Policy vol 39 no 6 pp 3520ndash35282011

[4] X H Xia and G Q Chen ldquoEnergy abatement in Chineseindustry cost evaluation of regulation strategies and allocationalternativesrdquo Energy Policy vol 45 pp 449ndash458 2012

[5] N Cui Y Lei andW Fang ldquoDesign and impact estimation of areform program of Chinarsquos tax and fee policies for low-grade oiland gas resourcesrdquo Petroleum Science vol 8 no 4 pp 515ndash5262011

[6] Y L Lei N Cui and D Y Pan ldquoEconomic and socialeffects analysis of mineral development in China and policyimplicationsrdquo Resources Policy vol 38 pp 448ndash457 2013

[7] Z M Chen and G Q Chen ldquoAn overview of energy consump-tion of the globalized world economyrdquo Energy Policy vol 39 no10 pp 5920ndash5928 2011

[8] N Nomikos and K Andriosopoulos ldquoModelling energy spotprices empirical evidence from NYMEXrdquo Energy Economicsvol 34 no 4 pp 1153ndash1169 2012

[9] G B Ning Z J Zhen P Wang Y Li and H X Yin ldquoEconomicanalysis on value chain of taxi fleet with battery-swappingmodeusingmultiobjective genetic algorithmrdquoMathematical Problemsin Engineering vol 2012 Article ID 175912 15 pages 2012

[10] S Chai Y B Li J Wang and C Wu ldquoA genetic algorithmfor task scheduling on NoC using FDH cross efficiencyrdquoMathematical Problems in Engineering vol 2013 Article ID708495 16 pages 2013

[11] G Q Chen and B Chen ldquoResource analysis of the Chinesesociety 1980ndash2002 based on exergy Part 1 fossil fuels and energymineralsrdquo Energy Policy vol 35 no 4 pp 2038ndash2050 2007

[12] Z Chen G Chen X Xia and S Xu ldquoGlobal network ofembodied water flow by systems input-output simulationrdquoFrontiers of Earth Science vol 6 no 3 pp 331ndash344 2012

[13] Z M Chen and G Q Chen ldquoEmbodied carbon dioxideemission at supra-national scale a coalition analysis for G7BRIC and the rest of the worldrdquo Energy Policy vol 39 no 5pp 2899ndash2909 2011

[14] H Z An X-Y Gao W Fang X Huang and Y H Ding ldquoTherole of fluctuating modes of autocorrelation in crude oil pricesrdquoPhysica A vol 393 pp 382ndash390 2014

[15] X-Y GaoH-Z AnH-H Liu andY-HDing ldquoAnalysis on thetopological properties of the linkage complex network betweencrude oil future price and spot pricerdquo Acta Physica Sinica vol60 no 6 Article ID 068902 2011

[16] X-Y Gao H Z An and W Fang ldquoResearch on fluctuation ofbivariate correlation of time series based on complex networkstheoryrdquo Acta Physica Sinica vol 61 no 9 Article ID 0989022012

[17] S Yu and Y-M Wei ldquoPrediction of Chinarsquos coal production-environmental pollution based on a hybrid genetic algorithm-system dynamics modelrdquo Energy Policy vol 42 pp 521ndash5292012

[18] S Geisendorf ldquoInternal selection and market selection in eco-nomic genetic algorithmsrdquo Journal of Evolutionary Economicsvol 21 no 5 pp 817ndash841 2011

[19] R Tehrani and F Khodayar ldquoA hybrid optimized artificialintelligent model to forecast crude oil using genetic algorithmrdquoAfrican Journal of Business Management vol 5 pp 13130ndash131352011

[20] A M Elaiw X Xia and A M Shehata ldquoMinimization of fuelcosts and gaseous emissions of electric power generation bymodel predictive controlrdquo Mathematical Problems in Engineer-ing vol 2013 Article ID 906958 15 pages 2013

[21] L Mendes P Godinho and J Dias ldquoA Forex trading systembased on a genetic algorithmrdquo Journal of Heuristics vol 18 no4 pp 627ndash656 2012

10 Mathematical Problems in Engineering

[22] M C Roberts ldquoTechnical analysis and genetic programmingconstructing and testing a commodity portfoliordquo Journal ofFutures Markets vol 25 no 7 pp 643ndash660 2005

[23] J-Y Potvin P Soriano and V Maxime ldquoGenerating tradingrules on the stock markets with genetic programmingrdquo Com-puters and Operations Research vol 31 no 7 pp 1033ndash10472004

[24] A Esfahanipour and S Mousavi ldquoA genetic programmingmodel to generate risk-adjusted technical trading rules in stockmarketsrdquo Expert Systems with Applications vol 38 no 7 pp8438ndash8445 2011

[25] M A H Dempster T W Payne Y Romahi and G W PThompson ldquoComputational learning techniques for intradayFX trading using popular technical indicatorsrdquo IEEE Transac-tions on Neural Networks vol 12 no 4 pp 744ndash754 2001

[26] T Nakashima Y Yokota Y Shoji and H Ishibuchi ldquoA geneticapproach to the design of autonomous agents for futurestradingrdquo Artificial Life and Robotics vol 11 no 2 pp 145ndash1482007

[27] A Ghandar Z Michalewicz M Schmidt T-D To and RZurbrugg ldquoComputational intelligence for evolving tradingrulesrdquo IEEE Transactions on Evolutionary Computation vol 13no 1 pp 71ndash86 2009

[28] W L Tung and C Quek ldquoFinancial volatility trading usinga self-organising neural-fuzzy semantic network and optionstraddle-based approachrdquo Expert Systems with Applications vol38 no 5 pp 4668ndash4688 2011

[29] C-H Cheng T-L Chen and L-Y Wei ldquoA hybrid model basedon rough sets theory and genetic algorithms for stock priceforecastingrdquo Information Sciences vol 180 no 9 pp 1610ndash16292010

[30] P-C Chang C-Y Fan and J-L Lin ldquoTrend discovery infinancial time series data using a case based fuzzy decision treerdquoExpert Systems with Applications vol 38 no 5 pp 6070ndash60802011

[31] G A Vasilakis K A Theofilatos E F Georgopoulos AKarathanasopoulos and S D Likothanassis ldquoA genetic pro-gramming approach for EURUSD exchange rate forecastingand tradingrdquo Computational Economics vol 42 no 4 pp 415ndash431 2013

[32] I A Boboc and M C Dinica ldquoAn algorithm for testing theefficient market hypothesisrdquo PLoS ONE vol 8 no 10 ArticleID e78177 2013

[33] W Cheung K S K Lam and H F Yeung ldquoIntertemporalprofitability and the stability of technical analysis evidencesfrom the Hong Kong stock exchangerdquo Applied Economics vol43 no 15 pp 1945ndash1963 2011

[34] H Dewachter and M Lyrio ldquoThe economic value of technicaltrading rules a nonparametric utility-based approachrdquo Interna-tional Journal of Finance and Economics vol 10 no 1 pp 41ndash622005

[35] A Fernandez-Perez F Fernandez-Rodrıguez and S Sosvilla-Rivero ldquoExploiting trends in the foreign exchange marketsrdquoApplied Economics Letters vol 19 no 6 pp 591ndash597 2012

[36] M Metghalchia J Marcucci and Y-H Chang ldquoAre movingaverage trading rules profitable Evidence from the EuropeanstockmarketsrdquoApplied Economics vol 44 no 12 pp 1539ndash15592012

[37] C J Neely P A Weller and J M Ulrich ldquoThe adaptive mar-kets hypothesis evidence from the foreign exchange marketrdquoJournal of Financial and Quantitative Analysis vol 44 no 2 pp467ndash488 2009

[38] W E Shambora and R Rossiter ldquoAre there exploitable ineffi-ciencies in the futures market for oilrdquo Energy Economics vol29 no 1 pp 18ndash27 2007

[39] F Allen and R Karjalainen ldquoUsing genetic algorithms to findtechnical trading rulesrdquo Journal of Financial Economics vol 51no 2 pp 245ndash271 1999

[40] J Wang ldquoTrading and hedging in SampP 500 spot and futuresmarkets using genetic programmingrdquo Journal of Futures Mar-kets vol 20 no 10 pp 911ndash942 2000

[41] J HowM Ling and P Verhoeven ldquoDoes size matter A geneticprogramming approach to technical tradingrdquo QuantitativeFinance vol 10 no 2 pp 131ndash140 2010

[42] F Wang P L H Yu and D W Cheung ldquoCombining technicaltrading rules using particle swarm optimizationrdquo Expert Sys-tems with Applications vol 41 no 6 pp 3016ndash3026 2014

[43] J Andrada-Felix and F Fernandez-Rodrıguez ldquoImprovingmoving average trading rules with boosting and statisticallearningmethodsrdquo Journal of Forecasting vol 27 no 5 pp 433ndash449 2008

[44] T T-L Chong and W-K Ng ldquoTechnical analysis and theLondon stock exchange testing the MACD and RSI rules usingthe FT30rdquoApplied Economics Letters vol 15 no 14 pp 1111ndash11142008

[45] I Cialenco andA Protopapadakis ldquoDo technical trading profitsremain in the foreign exchange market Evidence from 14 cur-renciesrdquo Journal of International Financial Markets Institutionsand Money vol 21 no 2 pp 176ndash206 2011

[46] A E Milionis and E Papanagiotou ldquoDecomposing the predic-tive performance of themoving average trading rule of technicalanalysis the contribution of linear andnon-linear dependenciesin stock returnsrdquo Journal of Applied Statistics vol 40 no 11 pp2480ndash2494 2013

[47] Y S Ni J T Lee and Y C Liao ldquoDo variable length movingaverage trading rules matter during a financial crisis periodrdquoApplied Economics Letters vol 20 no 2 pp 135ndash141 2013

[48] V Pavlov and S Hurn ldquoTesting the profitability of moving-average rules as a portfolio selection strategyrdquo Pacific-BasinFinance Journal vol 20 no 5 pp 825ndash842 2012

[49] C Chiarella X-Z He and C Hommes ldquoA dynamic analysisof moving average rulesrdquo Journal of Economic Dynamics ampControl vol 30 no 9-10 pp 1729ndash1753 2006

[50] X-Z He and M Zheng ldquoDynamics of moving average rules ina continuous-time financialmarketmodelrdquo Journal of EconomicBehavior and Organization vol 76 no 3 pp 615ndash634 2010

[51] C Neely P Weller and R Dittmar Is Technical Analysis in theForeign Exchange Market Profitable A Genetic ProgrammingApproach Cambridge University Press 1997

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

10 Mathematical Problems in Engineering

[22] M C Roberts ldquoTechnical analysis and genetic programmingconstructing and testing a commodity portfoliordquo Journal ofFutures Markets vol 25 no 7 pp 643ndash660 2005

[23] J-Y Potvin P Soriano and V Maxime ldquoGenerating tradingrules on the stock markets with genetic programmingrdquo Com-puters and Operations Research vol 31 no 7 pp 1033ndash10472004

[24] A Esfahanipour and S Mousavi ldquoA genetic programmingmodel to generate risk-adjusted technical trading rules in stockmarketsrdquo Expert Systems with Applications vol 38 no 7 pp8438ndash8445 2011

[25] M A H Dempster T W Payne Y Romahi and G W PThompson ldquoComputational learning techniques for intradayFX trading using popular technical indicatorsrdquo IEEE Transac-tions on Neural Networks vol 12 no 4 pp 744ndash754 2001

[26] T Nakashima Y Yokota Y Shoji and H Ishibuchi ldquoA geneticapproach to the design of autonomous agents for futurestradingrdquo Artificial Life and Robotics vol 11 no 2 pp 145ndash1482007

[27] A Ghandar Z Michalewicz M Schmidt T-D To and RZurbrugg ldquoComputational intelligence for evolving tradingrulesrdquo IEEE Transactions on Evolutionary Computation vol 13no 1 pp 71ndash86 2009

[28] W L Tung and C Quek ldquoFinancial volatility trading usinga self-organising neural-fuzzy semantic network and optionstraddle-based approachrdquo Expert Systems with Applications vol38 no 5 pp 4668ndash4688 2011

[29] C-H Cheng T-L Chen and L-Y Wei ldquoA hybrid model basedon rough sets theory and genetic algorithms for stock priceforecastingrdquo Information Sciences vol 180 no 9 pp 1610ndash16292010

[30] P-C Chang C-Y Fan and J-L Lin ldquoTrend discovery infinancial time series data using a case based fuzzy decision treerdquoExpert Systems with Applications vol 38 no 5 pp 6070ndash60802011

[31] G A Vasilakis K A Theofilatos E F Georgopoulos AKarathanasopoulos and S D Likothanassis ldquoA genetic pro-gramming approach for EURUSD exchange rate forecastingand tradingrdquo Computational Economics vol 42 no 4 pp 415ndash431 2013

[32] I A Boboc and M C Dinica ldquoAn algorithm for testing theefficient market hypothesisrdquo PLoS ONE vol 8 no 10 ArticleID e78177 2013

[33] W Cheung K S K Lam and H F Yeung ldquoIntertemporalprofitability and the stability of technical analysis evidencesfrom the Hong Kong stock exchangerdquo Applied Economics vol43 no 15 pp 1945ndash1963 2011

[34] H Dewachter and M Lyrio ldquoThe economic value of technicaltrading rules a nonparametric utility-based approachrdquo Interna-tional Journal of Finance and Economics vol 10 no 1 pp 41ndash622005

[35] A Fernandez-Perez F Fernandez-Rodrıguez and S Sosvilla-Rivero ldquoExploiting trends in the foreign exchange marketsrdquoApplied Economics Letters vol 19 no 6 pp 591ndash597 2012

[36] M Metghalchia J Marcucci and Y-H Chang ldquoAre movingaverage trading rules profitable Evidence from the EuropeanstockmarketsrdquoApplied Economics vol 44 no 12 pp 1539ndash15592012

[37] C J Neely P A Weller and J M Ulrich ldquoThe adaptive mar-kets hypothesis evidence from the foreign exchange marketrdquoJournal of Financial and Quantitative Analysis vol 44 no 2 pp467ndash488 2009

[38] W E Shambora and R Rossiter ldquoAre there exploitable ineffi-ciencies in the futures market for oilrdquo Energy Economics vol29 no 1 pp 18ndash27 2007

[39] F Allen and R Karjalainen ldquoUsing genetic algorithms to findtechnical trading rulesrdquo Journal of Financial Economics vol 51no 2 pp 245ndash271 1999

[40] J Wang ldquoTrading and hedging in SampP 500 spot and futuresmarkets using genetic programmingrdquo Journal of Futures Mar-kets vol 20 no 10 pp 911ndash942 2000

[41] J HowM Ling and P Verhoeven ldquoDoes size matter A geneticprogramming approach to technical tradingrdquo QuantitativeFinance vol 10 no 2 pp 131ndash140 2010

[42] F Wang P L H Yu and D W Cheung ldquoCombining technicaltrading rules using particle swarm optimizationrdquo Expert Sys-tems with Applications vol 41 no 6 pp 3016ndash3026 2014

[43] J Andrada-Felix and F Fernandez-Rodrıguez ldquoImprovingmoving average trading rules with boosting and statisticallearningmethodsrdquo Journal of Forecasting vol 27 no 5 pp 433ndash449 2008

[44] T T-L Chong and W-K Ng ldquoTechnical analysis and theLondon stock exchange testing the MACD and RSI rules usingthe FT30rdquoApplied Economics Letters vol 15 no 14 pp 1111ndash11142008

[45] I Cialenco andA Protopapadakis ldquoDo technical trading profitsremain in the foreign exchange market Evidence from 14 cur-renciesrdquo Journal of International Financial Markets Institutionsand Money vol 21 no 2 pp 176ndash206 2011

[46] A E Milionis and E Papanagiotou ldquoDecomposing the predic-tive performance of themoving average trading rule of technicalanalysis the contribution of linear andnon-linear dependenciesin stock returnsrdquo Journal of Applied Statistics vol 40 no 11 pp2480ndash2494 2013

[47] Y S Ni J T Lee and Y C Liao ldquoDo variable length movingaverage trading rules matter during a financial crisis periodrdquoApplied Economics Letters vol 20 no 2 pp 135ndash141 2013

[48] V Pavlov and S Hurn ldquoTesting the profitability of moving-average rules as a portfolio selection strategyrdquo Pacific-BasinFinance Journal vol 20 no 5 pp 825ndash842 2012

[49] C Chiarella X-Z He and C Hommes ldquoA dynamic analysisof moving average rulesrdquo Journal of Economic Dynamics ampControl vol 30 no 9-10 pp 1729ndash1753 2006

[50] X-Z He and M Zheng ldquoDynamics of moving average rules ina continuous-time financialmarketmodelrdquo Journal of EconomicBehavior and Organization vol 76 no 3 pp 615ndash634 2010

[51] C Neely P Weller and R Dittmar Is Technical Analysis in theForeign Exchange Market Profitable A Genetic ProgrammingApproach Cambridge University Press 1997

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of