RESEARCH ON FUTURES TREND TRADING STRATEGY BASED ON SHORT TERM CHART PATTERN

. The main task of this paper is to examine a short term trend trading strategy in futures market based on chart pattern recognition, time series and computational analysis. Speci ﬁ cations of historical data for technical analysis and equations for futures pro ﬁ t-ability calculations together with position size measurement are also discussed in the paper. A contribution of this paper lies in a novel chart pattern related to fractal formation and chaos theory and its application to short term up-trend trading. Trading strategy was tested with historical data of the most active futures contracts. The results have given signi ﬁ cantly better and stable returns compared to the change of market benchmark (CRB index). The results of experimental research related to the size of trading portfolio and trade execution slippage are also discussed in the paper. The proposed strategy can be attractive for futures market participants and be applied as a decision support tool in technical analysis.


Introduction
In recent years the application of trading algorithms and computational analysis in financial markets has attracted attention of many scientists and researchers. The interest in high frequency trading, online trading algorithms and time series analysis shows an increasing belief that new computation techniques can be helpful for decision making processes in fi nancial markets (Schmidt, Mohr et al. 2010;Izumi, Toriumi et al. 2009;Dempster, Lemmans 2006;Ehlers 2004;Koutroumanidis, Ioannou et al. 2011). Because of raising uncertainty in fi nancial markets (Belinskaja, Galiniene 2010;Girdzijauskas, Streimikiene 2010) and growing demand for hedging businesses (Stepien 2009) trading volume from equity and currency markets increasingly move to derivatives markets (Acworth 2011). The need for computational analysis of futures markets is in a great demand.
A well-known key concept is being often discussed when analysing fi nancial markets: the Effi cient Market Hypothesis (EMH). EMH asserts that the market is effi cient and whenever new information comes up the market absorbs it by correcting itself (Mockus, Raudys 2010). Prices refl ect all publicly available information and analysis of historical information is unfruitful. Therefore according to the Effi cient Market Hypothesis it is impossible to get better returns in the market than the market index itself (e.g. S&P500 index for stocks or CRB index for commodities). There are a lot of well-known publications that partly confi rm this hypothesis (Uri, Jones 1990;Kan, O'Callaghan 2007;McCauley 2008). However there are also published reports with opposite statement, that EM hypothesis is far from the truth (Warwick 1996;Jarret, Schilling 2008;Simutis, Masteika 2006;Atsalakis, Valavanis 2009;Lee 2010) and show weak-form effi ciency of economies (Nurunnabi 2012). The fact that some market participants (high frequency traders or hedge funds) can consistently beat the market is a good indication that the EM hypothesis may not be just right. For scientists it is diffi cult to prove the real profi tability of high frequency traders. Usually the information about profi table algorithms is kept secret and not published by practitioners. Despite the shortage of hard evidences about the profi tability of trading algorithms there are some research papers claiming that the application of momentum trend trading can give some useful information for market participants (Miffre, Rallis 2007;Szakmary 2010;Harris, Yilmaz 2009). Strategies based on chart patterns and momentum trend following techniques can beat the market (Friesen, Weller et al. 2009;Leigh, Paz et al. 2002;Lee, Oh et al. 2012;Williams, B. M., Williams, J. G. 2004). In this paper we try to reinforce these statements. A contribution of this paper lies in a modifi ed chart pattern related to fractal formation and chaos theory and its application to short term up-trend trading strategy. The paper presents the details of making computational analysis and applying ranking techniques in futures markets. The proposed short term trend trading strategy based on chart pattern might be interesting for futures market participants and hedge funds. Trading strategy was tested with historical data of the most active futures contracts in USA markets. The results clearly contradict statements of Effi cient Market Hypothesis and give signifi cantly more stable and better returns if compared to the change of market average (CRB index). The paper is organized as follows: Section 2 provides the basic concept of the proposed short term trading strategy. Section 3 explains the details of experimental investigations. Experimental results are evaluated in section 4 and the main conclusions of the research are presented in Section 5.

Basic concept of short term trend trading strategy
Short term trend trading strategy is based on up-trend following system and continuous chart pattern. Chart pattern is an indicator of technical analysis mostly applied for interpretation and market forecast (Liu, Kwong 2007). There are two types of patterns in technical analysis, reversal and continuation (Bulkowski 2005;Kirkpatrick II, Dahlquist 2010). A reversal pattern signals that a prior trend will reverse upon completion of the S. Masteika, A. V. Rutkauskas. Research on futures trend trading strategy based on short term chart pattern pattern. A continuation pattern signals that a trend will continue once the pattern is triggered.
The proposed continuous chart pattern relates to a fractal pattern and chaos theory, broadly discussed by Benoit B. Mandelbrot (Mandelbrot 2006;Mandelbrot et al. 2010) and developed as a trading tool by Ph.D. Bill M. Williams (Williams, B. M., Williams, J. G. 2004). Fractal formation is built from chart bars. Fractal helps to determine a possibility of further continuous movement in the market. The following fi gure shows some fractal formations.
A fractal defi nition presented by B. M. Williams is as follows: "A Fractal must have two preceding and two following bars with lower highs (higher lows in a down move). In a buy Fractal, we are interested only in the bars' high. In a sell Fractal, we are interests only in the bars' low" (Williams, B. M., Williams, J. G. 2004). Fig. 1 variety of fractal patterns can be unlimited as long as there are two preceding and two following chart bars with lower highs. Time horizon for fractal to make a formation is inaccurate. Uncertainty also increases because of no clear rules for stop or market exit orders are present. Maybe therefore fractals are often suggested to use in conjunction with other forms of technical analysis, like moving averages, Elliott Waves analysis or MACD indicator (Williams 1998). These shortages together with a lack of fractal signal strength measurement constitute inaccuracies when trying to build a computerized trading system. The easiest way to overcome these problems is to do back test analysis with only a pre-selected particular contract. But such a way makes quantitative analysis limited and inaccurate to ever changing fi nancial instruments and behavior of the market. Generalizing, classical fractals might be as a good decision support tool, but not as a basic indicator itself. Therefore a decision to search for a novel more accurate, determined and at the same time still conformable with trend trading and chaos theory chart pattern was made.

Chart pattern for trading strategy
Proposed short term chart pattern is composed from 3 consecutive chart bars and uses only the latest data for decision making. A fractal occurs when there is a pattern with the highest high in the middle and one lower high on each side, as it can be seen in some examples in Fig. 2.
Trading strategy opens a long position when current price (i) tops the second bar's (i-1) highest price. An open price is set as the second bar's (i-1) high level plus a tick size. Tick size is a minimal price increment. Each contract has a different tick size because of the contract size. Tick size can have a decimal or fractional number format. Most of the time decimal number format is used because of standardization of data sets, e.g. CSI data format. If current price bar (i) opens higher than (i-1) and forms a gap, a buy signal is identifi ed as an opening price.

Signal strength and contracts ranking
Most of the time back-test analysis is implemented only with historical data from preselected particular contract. This approach can be applied but is static, subjective and lacks fl exibility to all the time changing instruments and their behavior in the markets (trendy market is changed by consolidated, reversal, choppy and etc.). Research results can often be predetermined in advance by taking only a particular contract or the most suitable time period for analysis. In order to avoid such subjectivity when doing quantitative analysis ranking techniques of contracts and the quality of signals must be considered (Masteika 2010).
Proposed short term trading strategy is searching for futures contracts with the biggest two day's price increase where the lowest price of the last bar is higher than the one a month ago, i.e. the lowest price of the period i is greater than the lowest price of the period i-20. The quality of the contract and its rank for the trade is measured using the following equation: In the equation (1) R represents the rank of a particular contract and C-the closing price of the period i. The biggest increase in price of a particular contract during the period between i-4 and i-2 also means the best quality and the highest rank. If the chart pattern is formed with several contracts at a time, the one with the highest rank is chosen for a trade.

Experimental research
The effi ciency of the proposed short term trend trading strategy was tested with historical data collected from automated electronic futures exchanges. The daily time series were collected from exchanges like GLOBEX, ECBOT, NYMEX, CFE, ICE and ICE-NYBOT from 1991 till 2011. CSI UA software developed by CSI Commodity Systems Inc. was chosen as the primary instrument collecting the data.
The most active and liquid contracts from each sector of futures market were included in experimental research. In general, futures are grouped into following sectors: Energies, Metals, Grains, Financials (Interest rates), Indices, Currencies, Softs and Meats (Kleinman 2004;Lambert 2010). These sectors are often visualized as Heat Maps. Fig. 3 presents an example of such a Heat map in futures industry.
Heat map or sector analysis is applied when classifying contracts and implementing quantitative analysis based on ranking techniques. Table 1 presents the most active contracts in each sector.  Table  1 are the most liquid and all together take the biggest part of trading activity in the North American futures markets, therefore were chosen for back test analysis.

Continuous futures data series
Futures historical data faces different problems with data gaps if compared to stock or Forex markets. The data set must be specifi ed in the fi rst place when doing computational calculations and back test analysis (Rutkauskas, Ramanauskas 2009). The differences appear because of short-lived contracts. Futures contracts are standardized contract between two parties to exchange a specifi ed asset of standardized quantity and quality for a price agreed today (the futures price) but with delivery occurring at a specifi ed future date (delivery date) (Kolb, Overdahl 2006). For example the most active contract for DowJones Index Mini_Sized (DJIA) in July, 2011 is YMU11, i.e. Sept. 11. Around mid-September most activity will roll over to the December contract YMZ11 and afterwards the YMU11 contract will expire. The problem with historical data series arises trying to calculate long-term profi tability of trading strategies based on quantitative analysis. There are several methods to generate continuous futures data series, like Forward adjusted; proportionally adjusted; Gann series; perpetual series or backward adjusted series (Masteika et al. 2012). Taking into account the strengths and weaknesses of different methods backward adjusted data series were taken in experimental research. Backward adjusted data uses actual prices of the most recent contract with a backward correction of price discontinuities for successive earlier active delivery months. This adjustment requires applying recalculation of the earlier contract prices with respect to the price of the current (or later) contract (Pelletier 2011). After applying the method of backward data adjustment the problem with negative prices was resolved by adding a fi xed amount of points to make non-negative values. This fi x of the data was necessary only with Soybean meal contract.
A roll over timing. All methods for making continuous data series are depended on evaluation of particular place where the contracts should be switched from one to an-  (Pelletier 2011). When generating continuous data series the simplest way is to use a calendar date for a roll over, for example the day before contract's expiration date. But when expiration date approaches open interest and so trading volume decreases and liquidity also lowers. In real trading low liquidity associates with bigger spreads between bid and ask prices. Bigger spreads impact trade execution slippage, especially with larger transactions. In order to make qualitative quantitative analysis with minimum distortions and smallest commissions when changing the contracts a roll over timing was linked to open interest and volume.
In experimental research confi rmation signal (roll on a second consecutive trigger) also was applied because of possible sudden but not approved increase in volume or open interest. The methods chosen have allowed historical data to roll on between futures contracts on the most liquid trading days with the lowest risk of execution slippage.

Contracts specifi cations
Contracts specifi cations necessary for calculations are detailed in this section. The main inadequacies between back testing futures and stocks or currencies appear because of different margin requirements, full point values and tick sizes when trading derivatives. For example one percent change in a price of Soybean Oil contract generates different percentage change in account value if compared with 1% change in a price of DJIA Index Mini contract. As we can see from the following table OIMR (Overnight Initial margin requirements) and Full Point values as well as Tick sizes and commissions for each contract differ. Table 2 shows specifi cations of futures applied for risk, profi tability and position size calculations when back testing the strategy. For example Full point value and OIMR were applied when calculating position sizes and risks. Exchanges calculate Full Point Value considering the size of a contract, unit of measuring, tick size, market fl uctuations and the total value of the contract. Margin requirements are being mostly expressed in currency of the traded product and based on SPAN margin algorithm. The SPAN margin algorithm defi nes a standard set of market outcome scenarios with a one day time horizon. In our research OIMR values presented in Table 2 were taken from Interactive Brokers LLC data base on the 25 th of July, 2011. OIMR can be also explained as a margin deposit for end of day trading. Tick size was necessary defi ning exact price for opening and closing positions. Currency and commissions were applied evaluating the costs of making a trade with different contracts. Commission charges presented in Table  2

Profi t/loss and position size calculations
One of the most diffi cult tasks trading and back testing futures markets is to understand how each contract is quoted, what the full point value or multiplier of each contract is and also how to calculate profi t, loss or position size of a trade. In order to make a trade margin deposit must be considered in the fi rst place. Margin deposit is paid for each contract when opening position on future contract. The margin is a little part of a full contract value. For example with a margin of 7% around 14 contracts can be acquired paying no more than a full value of one contract. This gives a leverage that makes trading futures more risky and also profi table. The simplest way to make calculations is with a contract where the full point value equals to 1. Then each $1 change in contract price represents $1 profi t/loss per contract. But most of the time futures have point value different than 1, see Table 2: Full Point values. If, for example, point value is 5, as trading with DJIA Index mini, each point change in a price of the contract represents $5 profi t/loss in equity. When position is closed the margin is back deposited and profi t/loss calculated. Profi t/loss is calculated multiplying the number of contracts by full point value and by the difference between sell and buy prices. The successive equation presents the profi t/loss calculations used in computational analysis taking also into consideration commission charges and interest on margin paid: In the equation (2) P c and P o represents closing and opening prices of a particular contract. FPV shows the Full Point value of a particular contract i (see: Table 2). The variable Comm shows the value of commissions for a trade. The variable Comm is multiplied by 2 because there is a commission charge both for opening and closing order. The variable N represents the number of contracts and Int shows the value of interest paid on margin.
Successful futures market traders risk as little of their money, as possible. It is common in the industry that larger capitalized futures traders tend to risk rarely more than 1% per trade. Smaller size traders let's say with an account smaller than 250k tend to risk no more than 2-5% of their total equity per trade (Schwager, Jack 2008). Let's take an example and say that initial equity is set to $200'000 and investor wants to invest up to 5% of equity per single trade and margin deposit (OIMR) is $5'000 (as with DJIA Index mini at 25/07/11). Therefore investor's appropriate position size should be $200'000 * 5% = $10'000. Which means that trading DJIA Index mini contract with such an amount of money no more than 2 contracts can be purchased per trade ($10'000/$5'000 = 2). The following equation is applied doing experimental research when evaluating the size of a single trade: 2 100 .
In the equation (3) the calculation of position size -PS is presented. The variable Ie shows the size of initial capital and Rr (Risk ratio) -the percentage size of risk taken if compared to total equity. Rr depends on the size of initial equity and also on the for-wardness toward risk taking. For example if a trader can afford to risk a half of total equity on a single trade Rr coeffi cient equals to 50. The variable Comm shows the amount of commissions required for a trade. OIMR is overnight initial margin requirements for opening position with a particular contract i. OIMR values (see Table 2) can change accordingly to market volatility and should be rechecked when opening new positions.

Experimental results
The strategy was back tested and calculations were carried out applying software of technical computing-MatLab 2010, developed by The MathWorks, Inc. Experimental results of the strategy are presented in the following Figures.
Trading strategy based on short term chart pattern was back-tested using initial account balance of 1 million U.S. dollars (USD). Overall the charts in Fig. 4 show positive results. Trading strategy had been back tested applying several different risk ratios while the initial account balance and other parameters were left unchanged. As it was stated earlier in the paper conservative approach says that only 1 or 2 percent of total account balance should be risked per trade. Less conservative investors tend to risk larger sums. As Fig. 4 shows a small change in risk ratio generates a prominently different outcome. When risk ratio is 1 percent, account balance is almost multiplied by 4 at the end of testing period. However, when risk ratio is 1.25%, account balance stops at 6 million USD. When the risk ratio is at 1.5%, account balance increases to over 8 million USD. Additionally, the profi tability still has room to grow considering the possibility to use a bigger risk ratio per trade. For example smaller funds accept the rule to trade with 3-5% of the total capital on one position, not mentioning private investors trading over 20 or even 50% of the total capital per trade. It is clear that the greater the risk ratio the bigger account balance fl uctuations can be.  The results of trading strategy and account balance fl uctuations have been also compared to the change of market average (CRB index). CRB Index is often applied as a track of collective trend changes of the commodities markets. As we can see in Fig. 5 the chart of account balance, applying 1.5% risk ratio, gives more stable results if compared to CRB Index changes. Financial crisis and the market crash, when CRB Index was tumbling nearly 50%, hadn't impacted a lot the overall performance of the strategy. This chart shows that the strategy is effective and immune to various market fl uctuations.
The results presented in Figs. 4 and 5 were achieved trading 15 different futures with the highest rank at a time. Additional research showed that the number of different futures traded at a time plays a huge role on overall performance of the strategy, see Fig. 6.
The chart lines in Fig. 6 show difference between the results trading different number of futures. For example '1 contract' in Fig. 6a, b means that only one future was traded at a time, no matter if it was a commodity, stock index, currency, fi nancials or etc. '2 contracts' means that only two open positions of different futures with the highest rank were in portfolio; '3 contracts'-only three different positions possible and so on. As we can see in Fig. 6a, all experiments at the end of the period show positive results. The best results were received trading 15 and 20 different contracts at a time. It can be simply explained by a bigger amount of capital used. Nevertheless this research and the charts in Fig. 6b show that it is less risky to start applying the strategy with greater diversifi cation, i.e. from 8 futures and above. Zoomed research and Fig. 6b shows that bigger diversifi cation gives steadier increase in total balance and visa versus the diversifi cation of up till 5 futures generates quite plane and even down trend results. In general, an experiment showed that portfolio diversifi cation is necessary with this strategy and 15 futures is optimal amount for this data set.
Considering that trading costs consist of commissions and also possible trade execution slippage additional research on the impact of trade execution slippage was done. The results of the research are graphically presented in the following fi gure. The chart lines in Fig. 7a show an impact of trade execution slippage on total account balance. The impact of slippage is obvious and even infl uences overall profi tability of the strategy. As for example if there was a constant 8 tick's slippage per trade account would turn to negative. Since calculations were done with Rr ratio of 1.5% it was interesting to see if bigger risk ratios could compensate the negative effect of the slippage. The research has shown that up till 5 ticks the negative effect can be compensated by taking bigger risks, e.g. Rr = 3%; 5% or even higher. But starting from size of 6 ticks an increase in risk ratio doesn't help and even worsens situation. As we can see in Fig   balance. This show that the proposed strategy can be profi table only when the size of the slippage is small one, i.e. less than 5 ticks. The problem with slippage is important therefore such technologies as high frequency trading (HFT) or special order types like Iceberg, Hidden, Fill or Kill (FOK), Immediate or Cancel (IOC), Limit if Touched (LIT) and etc. should be considered when using this strategy.

Conclusions
Recent series of volume records and new all-time high trading activity in futures market were the main driving forces for this research. The main goal of this paper was to present the strategy and quantitative research results based on short term chart pattern and technical analysis. The paper also reviewed the most active automated North American   futures exchanges. General futures contract grouping and the most active contracts in each group were fi ltered as well. Specifi cations of contracts necessary for computational and technical analysis were identifi ed. The issues related to profi tability and position size calculations in futures markets were also discussed in this paper.
Preliminary experimental tests have shown that the proposed chart pattern and trading strategy outperforms the market average (CRB Index). Experimental research has showed rather stable results if compared to overall market fl uctuations during back test period. Research has proved that applying the strategy diversifi cation and strict control on order execution slippage are necessary.
The conclusion can be made that the proposed strategy gives some promising results and can be attractive for hedge funds or futures market participants trading short term strategies, especially when volatility in markets increases. Despite of good preliminary results more extensive tests with the proposed methodology should be done (different markets, down trend and short selling opportunities) to evaluate more precisely the whole domain of possible applications of this strategy.