Trading Strategies based on Pattern Recognition in Stock Futures Market using Dynamic Time Warping Algorithm Lee, Suk Jun, Jeong, Suk Jae, First Author Universtiy of Arizona, sukjunlee@email.arizona.edu *,Corresponding Author Business School, Kwangwoon University, sjjeong@kw.ac.kr Abstract Traditional technical analysis is forecasting the up and down trends in the stock market. However, it is difficult to apply technical analysis directly because it relies on human experience to select optimal strategies for individual stocks. Thus, a stock market trading system has been developed to apply optimal investment strategies by many traders given various market situations. Many pattern recognition methodologies have been used to develop successful strategies in this trading system, and the various strategies were generated using an expanded technical analysis. The aim of this study is to construct a pattern-recognition-based trading system (PRTS) for providing suitable investment strategies in the stock futures market. The PRTS uses a dynamic time warping (DTW) algorithm to recognize various market patterns and provides investment strategies using diverse technical indicators for the market. Through empirical studies, we show that DTW yields an efficient PRTS for various market conditions. Keywords: Stock futures market, Pattern recognition, Trading system, Technical analysis, Dynamic time warping, Technical indicator. Introduction Traditionally, technical analysis has been used to analyze the top and bottom trends in stock market. However, it is not convenient to directly apply technical analysis because it relies on human experience to select the proper strategies for individual stocks. Thus, a stock market trading system was developed to apply optimal investment strategies given various market conditions. Many pattern recognition methodologies were proposed to develop successful strategies for the trading system, and the various trading strategies were created using an improved technical analysis. In analyzing the stock market, many investors have a great interest in observing the patterns of stock prices and believe them to be a crucial factor ([], [], [], []). In the market, these patterns, that is, ascending, descending, and flat pattern, are understood as the particular forms of the stock prices movement. Thus, technical analysis studies aimed at predicting such stock patterns have been performed with great vigor ([], [6], [7], [8]). Investors who rely on technical analysis used stock charts to determine when to conduct trades ([9]). This method is called pattern analysis, and it relies on studying previous stock price charts and identifying certain shapes while fitting them into current stock movements and attempting to predict patterns in stock prices. Static (i.e., Euclidean distance) and artificial intelligence methods have been used to develop a stock prediction system by analyzing stock price patterns ([0], [], [], [], [], []). However, studies applying dynamic time warping methods to predict stock prices and develop trading strategies have not been reported, to date. The aim of this study is the construction of a pattern-recognition-based trading system (PRTS) for the stock futures market. The PRTS employs a dynamic time warping (DTW) algorithm to measure similarities among various patterns and provides investment strategies using technical indicators. DTW is known to be valuable for pattern recognition between two time series ([6]) and is used in many domains, for example, speech processing ([7]), and robotics ([8]). Through empirical studies, we show that DTW yields an efficient PRTS in various situations in the market. The rest of the paper is organized as follows. Section briefly reviews the stock futures market, technical analysis, and the DTW algorithm. Section describes the PRTS construction procedure, particularly with respect to the pattern base generation procedure. In Section, empirical studies are described to illustrate the PRTS construction procedure and verify its efficiency in various market situations. Finally, the concluding remarks are presented in Section. Journal of Convergence Information Technology(JCIT) Volume7, Number0, June 0 doi:0.6/jcit.vol7.issue0. 8
. Research background The futures market is a pillar of the financial market in which traders exchange standardized futures contracts ([]). Investors trade contracts to buy or sell specific quantities of financial instruments such as cash and derivative instruments or commodities like soybeans, gold and oil at a specific price, with delivery scheduled for a specific time in the future. The stock futures market treats stock price movements as product commodities. Here, investors can make a marginal profit by buying a contract to long a stock (i.e., take a buying position) when a bull market is expected; conversely, they may buy a contract to short a stock (take a selling position) when a bear market is expected. Thus, trading hinges on the directions of stock price fluctuations, giving investors an opportunity to accrue profits in either bull or bear markets. In the futures market, the most crucial virtue of a proper investment strategy is to analyze market changes accurately, because the stock market is affected by many highly interrelated economic, political and even psychological factors, each interacting in a very complex manner ([9]). Thus, technical analysis is popularly used to predict movements in the futures market. A technical analysis examines the historical data on stock prices (opening, high, low, and closing prices) and volume movements and is used to forecast future price movements. The analyst assumes that history will repeat itself and tries to identify typical patterns which have appeared in the past and so forecast what is likely to recur in the future ([0], []). Although no a standard for technical analysis has ever been established, many market participants have used technical indicators to make buying and selling decisions ([]). For further detail on the use of technical indicators, see [0], [], [] and the Appendix in this study. The DTW algorithm, originally introduced by [], is one of many techniques used to recognize the various patterns mentioned above. DTW is used to measure the similarity between two time sequences (patterns). To derive this algorithm, following [], it is assumed that there are two time series (i.e., patterns), a reference pattern R ( r, r,..., r i,..., rn ) and a test pattern T ( t, t,..., t j,..., tm ), with lengths n and m, respectively. To align these two patterns, we build a n m matrix, where each matrix element ( i, j) can be characterized by the distance D ( r i, t j ) between the two points r i and t j using the Euclidean distance formula D( ri, t j ) ( ri t j ). Each matrix element ( i, j) thus corresponds to an alignment between the points r i and t j. Figure, adapted from [6], provides a depiction of this concept. A warping path W is a sequence of adjacent elements from the pattern matrix. The k th element of W is defined as w k ( i, j) k. Thus, we have W ( w, w,..., w k,..., wk ), where max( n, m) K n m. m wk T j w w w i n R Figure. An example of a warping path (adapted from [6]) 86
Here, several constraints on W are employed (e.g., boundary conditions, continuity and monotonicity). The first set of constraints is simply w (, ) and w K ( n, m). In other words, W must start and finish at diagonally opposite corners of the matrix. The second set of constraints is given by w k ( a, b) and w k ( a', b' ), where a a' and b b', which restricts the allowable steps in W to contiguous cells (including diagonally contiguous cells). The final set of constraints states that if w k ( a, b), then w k ( a', b' ), where a a' 0 and b b' 0, which requires the points in W to be monotonically spaced in time. There are exponentially many warping paths that satisfy the above conditions. However, the warping path that minimizes the warping cost is calculated. K DTW(R,T) min w k k () K The term K is included to compensate for the fact that warping paths may have different lengths. This minimum-cost path can be found very efficiently using dynamic programming to evaluate the following recurrence, which defines the cumulative distance D C ( i, j) as the distance D(i, j) found in the current cell and the minimum of the cumulative distances of the adjacent elements: D (i, j) D(r, t ) min{d (i, j ),D (i, j),d (i, j )} () C i j C C C The Euclidian distance between two patterns can be seen as a special case of DTW in which the k element of W is constrained such that wk (i, j) k, i j k. Note that this distance is only defined in the special case where the two patterns have the same length. th. Methodology This section provides a detailed description of the PRTS construction procedure. Input data for the PRTS consist of the open, high, low, close prices and the Korea Composite Stock Price Index (KOSPI 00) volume index. Hereinafter, the return rate is defined as the yearly profit rate, expressed as a ratio of the current capital value to the initial capital value after one year of trading. The yearly profit is defined as the yearly gross profit minus transaction costs and slippages, in which the yearly gross profit is the yearly short position minus the yearly long position. Figure shows the overall procedure for developing the PRTS. Pattern Recognition-Based System Phase Pattern recognition process A new pattern DTW algorithm Distance ing Real-time Trading Phase Trend-wise Input Data Generation Reference Pattern Base Base Base Base Base Base Base Figure. PRTS architecture Phase : Trend-wise input data generation In this phase, we generate input data for various market conditions, that is, the trends and patterns previously used by [], who assumed that the trends are defined by distinctive data behavior over a 87
certain period. In this study, the trends are denominated as reference patterns, that is, the short-term ascending pattern (), short-term descending pattern (), long-term ascending pattern (), long-term descending pattern (), flat-top pattern (), and flat-bottom pattern () (see Table for detailed descriptions following []. The input data for each pattern are the various indicators that are calculated using the opening, high, low and closing prices and trading volume. It is then necessary to select indicators that yield the best profitability for each pattern period when the indicators are applied to the specific pattern periods using a specific trading strategy. The trading strategies for each indicator are used to yield the indicator return rates (see Appendix in [] for specific trading strategies designed for each indicator). The trend-wise input data are the profitable indicators for each pattern, and the patterns with the indicators are stored in a reference pattern base. The reference pattern base also includes the six pattern bases (i.e., the,,,,, and bases) consisting of the profitable indicators in each pattern period. Table. Description of the six patterns (modified from []) Pattern Description Short-term Ascending Pattern () Short-term Descending Pattern () Long-term Ascending Pattern () Long-term Descending Pattern () Flat Top Pattern () Flat Bottom Pattern () Daily closing prices fall continuously for two to three weeks. Continuous rise of daily closing prices for over 6 months. Continuous fall of daily closing prices for over 6 months. After an ascending pattern, daily closing prices remain unmoved. After a descending pattern, daily closing prices remain unmoved. After a descending pattern, daily closing prices remain unmoved. Phase : Pattern recognition modeling process In this phase, for real-time trading, a distance (similarity) is calculated using the DTW algorithm to find patterns similar to the reference patterns. An important role of the DTW in analyzing the reference pattern base is to find a reference pattern similar to a new pattern. For example, if a new pattern is recognized in this process, the DTW calculates the cumulative distance between periods of each reference pattern and period of the new pattern using Equation (). The trading strategy for the reference pattern with the minimum cumulative distance is used as the nearest neighborhood reference pattern for trading during the period of the new pattern. In other words, a trading strategy based on the indicators in each pattern base is applied in the period of the new pattern. In this study, the distances in the overall and half periods for each of the six reference pattern bases were calculated, and a trading strategy based on the indicators for each pattern base was then applied to the new pattern most closely matched the pattern base. At the end of Section, we discuss the selection of the reference patterns.. Empirical studies and results The Korean futures market, which opened in 996 and has since followed the KOSPI 00, has moved dramatically (see Figure ). Thus, investors and traders have developed increasingly powerful strategies to make investment decisions, because in a market characterized by various patterns, human behavior can only be analyzed to a limited extent. To determine these strategies, we propose the PRTS, using as an empirical example for its development the KOSPI 00 index data during the period from January, 000 to December 0, 00. The training period is January, 000 to December 8, 007, and the testing period is January, 008 to December 0, 00. We used the same real-time data at 0- minute time intervals introduced by [], who presented the 0-minute time interval as an appropriate frequency according to the return rate of various time interval data (e.g., 0-, 0- and 60-minute and daily interval data). 88
00 0 00 0 00 0 Figure. Overall flow of the KOSPI 00 from Jan., 000 to Dec. 0, 00 (YYYY-MM-DD) For construction of the PRTS with the training period data, trend-wise input data are generated at Phase. For this, the periods of six patterns characterized by their own distinctive features are comprehensively created with the help of futures market experts based on Table in this study (see Table ). Table. The six reference patterns selected in the training period from Jan., 000 to Dec. 8, 007 Patterns Period of reference patterns Starting date Ending date Dec. 6, 000 Jul., 000 Apr. 0, 00 Apr., 00 Apr. 8, 00 Sep., 000 Jan., 00 Sep., 000 Apr., 00 Apr. 0, 00 Dec. 0, 00 Dec., 000 In generating the trend-wise input data, the application of the trading strategies for 6 indicators for each of the six patterns allowed us to choose five out of the 6 indicators. The five indicators chosen for each of the six patterns are those that generated the highest profit. In the process of selecting the top five indicators, the top % and bottom % of oscillators were deliberately excluded from the selection set due to possible strong indicator dependence in a given period ([]). Note that the top five indicators were selected through trial and error, and the return rate of each indicator was calculated using the system trading tool Tradestation 000i. As a default condition for the trading system, the initial capital was set at,000,000 (equal to US$,000), the interest rate at.00%, the transaction cost at 0,000, and the slippage at,000 where is the Korean won and the slippage cost is an additional amount set to prevent missed trades. Table lists the top five indicators for each of the six patterns. For example, for the, the selection of the top five indicators was made as, in descending order:,, William s%r,, and. These indicators are used as the trend-wise input data for the. 89
Table. The top five indicators and theirs return rates (%) for the six patterns using system trading Patterns (-.) (-.) (-.00) (-0.) (-9.7) (-6.7) (-0.7) (-.0) (-.) (-.00) EOM (-86.) VROC (-8.7) (-7.00) (-.) (-.00) (-68.) (-66.7) (-90.) N (-76.7) (-66.00) (-.0) (-8.7) (-.7) N (-.0) (-.) (-9.00) (-7.7) (-7.7) (-69.00) (-6.7) For the implementation and experimentation in Phase, ten starting points were randomly selected from the testing period of January, 008 to December 0, 00, as shown in Figure. If the trading starting point of a new pattern was determined, then the reference pattern base was activated. Distance (similarity) between the historical periods of a new pattern those corresponding to the historical period of the indicators in each of the six pattern bases were calculated using Equation (). Note that the pattern matching period is divided into two periods, that is, the half and overall periods of the six patterns, and the real-time trading periods were also determined by these two periods. The overall trading periods for each pattern were 0 (), 0 (), 77 (), (), 76 (), and 6 () days. 00 80 60 0 May, 008 Nov., 009 May 6, 00 0 00 Apr. 0, 009 Aug., 00 80 60 Jul. 7, 008 Nov. 7, 008 Jul., 009 Feb., 00 0 0 Jan. 0, 009 00 Figure. The starting points of ten new patterns randomly selected from January, 008 to December 0, 00 (YYYY-MM-DD) Table reports the distances between the historical periods of the new ten time sequences and the historical periods of the indicators in each of the six patterns for the half periods. As shown in table, the rank of indicators in each of the time sequence is different, and it means that suitable indicators have to be used as various market conditions. 90
Table. Distances between the top five indicators in each of the six patterns and new ten time sequences for the half period (a) (b) (c) (d) (e) (f) (.970) (.097) (.08) (.89) (.880) (.879) (.) (.) (.978) (.66) (.0) (.096) (.6990) (.9) (.89) (.70) (.98) (.67) (.600) (.0989) (7.769) (.6) (6.0) (.) (.777) (6.0) (.69) (.08) (8.66) (.7) (8.76) (6.87) (.9) (7.89) (8.9) (.80) (9.78) (7.00) (8.68) (8.89) (.70) (.77) (.890) (6.0) (8.080) (6.) (6.7) (0.090) (.80) (6.8) (.999) (.98) (.70) (8.096) (8.986) (8.06) (6.68) (7.8) (8.988) (.60) (.670) (6.768) (.008) (8.778) (9.709) (8.76) (8.9) (.797) (7.6) (8.99) (7.6) (9.676) (9.90) (0.796) (9.7) (8.87) (9.099) (9.660) (8.80) (9.887) (0.990) (.0870) (0.08) (.9) (.908) (9.9870) (.68) (9.00) (.6) (7.660) (.97) (0.878) (.6) (6.999) (8.60) VROC (96.690) EOM (96.998) (0.) (09.000) (6.7000) (.7) (6.69) (9.8) (.700) (0.) VROC VROC VROC VROC VROC EOM EOM EOM (9.9) (90.97) (69.000) (9.079) (9.78) (9.690) (99.600) (9.6000) EOM EOM EOM EOM EOM VROC VROC VROC (9.0689) (9.87) (8.80) (9.06) (96.8) (.966) (0.88) (98.77) (.000) (06.000) (9.0) (0.67) (07.900) (7.00) (6.96) (99.000) (7.668) (.8000) (9.6790) (08.900) (.6) (0.8) (.000) (07.08) (9.9000) (7.0) (.00) (8.9000) (.000) (.000) (6.78) (8.69) N (86.066) (87.6) (9.67) (99.) (09.99) EOM (.800) VROC (9.7) (9.00) (0.) (0.9769) N N (8.6680) (0.) (6.989) (7.67) (77.869) (79.776) (8.67) (7.69) (88.7079) N (87.) (96.666) (00.88) (0.000) (0.) (0.6870) N (0.80) (.8) (99.789) N (06.0) (.0) (9.689) N (88.0068) (97.80) (00.79) (0.776) (8.8) N (8.60) (88.88) (97.68) N (8.077) (86.8779) (87.89) (99.) (86.0799) (89.98) (90.6) (97.89) (78.8) N (8.878) (8.07) (99.808) (90.80) (96.8) (99.90) (06.) (0.0) (.776) (.790) (.9) (0.868) (.9) (0.009) (0.006) (.96) (.8) (9.676) (6.08) (.9) (.796) (8.876) (7.807) (8.8) (0.6) (9.86) (.07) N N (.69) (.08) (8.89) (.88) (.009) (0.0) (.0868) (.86) (0.678) (7.788) N N N N N (.) (60.) (6.96) (6.090) (.966) (.97) (6.0) (7.60) (6.688) (.78) N N N (7.69) (70.778) (7.88) (7.0) (7.7) (70.8077) (70.79) (77.78) (7.) (7.78) (9.6880) (.907) (6.9090) (.) (6.798) (.0) (.8) (.770) (9.9) (6.878) (6.907) (.098) (8.760) (8.) (7.78) (7.) (9.8) (0.88) (8.90) (.98) (9.98) (9.68) (9.06) (.6) (0.9) (.0) (.9886) (6.800) (.8697) (6.97) (0.0) (6.7) (.6) (6.89) (0.) (0.998) (9.879) (.9) (.) (.7) (.6708) (6.778) (7.) (9.87) (0.77) (9.066) (0.0) (.7688) (6.) (.7) 9
Table shows the distances between the historical periods of the new ten time sequences and the historical periods of the indicators in each of the six patterns for the overall periods. The table describes the different rank of indicators in each of the time sequence, and it also means that proper indicators have to be used as various market conditions. Table. Distances between the top five indicators in each of the six patterns and new ten time sequences for the overall period (a) (b) (c) (d) (e) (f) (.7) (0.69) (.7) (.77) (.7) (.) (.80) (.6887) (.80) (.0760) (.76) (.67) (.) (.878) (.7) (.9) (.76) (.79) (6.66) (9.080) (.6) (.) (.9) (.670) (7.60) (8.99) (8.69) (9.88) (6.07) (7.0) (6.8) (.008) (.96) (.78) (6.878) (.680) (.976) (.8) (.907) (.70) (0.809) (.98) (.80) (7.689) (.8) (0.76) (.7) (0.099) (0.078) (60.600) (.006) (.07) (.6) (.70) (.69) (8.07) (8.60) (9.6) (.8) (.9) (7.990) (9.79) (6.69) (8.) (9.6) (6.) (.07) (6.9) (8.698) (0.876) (7.069) (.6) (.77) (8.99) (9.0) (9.097) (.) (.768) (7.76) (7.678) (.888) (9.99) (9.) (.70) (0.669) (7.800) (8.89) EOM (6.00) (09.00) (8.600) (.0000) (.000) (0.00) (6.88) (.66) VROC (9.707) (9.6000) EOM (0.) (8.879) (67.066) (.670) (6.78) (7.08) (0.060) (.090) VROC VROC EOM VROC VROC VROC (86.988) (8.800) (6.900) (.96) (.80) (.9706) (.700) (.900) EOM VROC VROC VROC (07.9) (89.) (8.66) (.800) (8.00) (.6) (.00) (9.700) EOM EOM EOM EOM (6.768) (0.08) (86.80) (9.90) (9.78) (.00) (.60) (.7) EOM (.000) (7.6668) (.) (90.099) (8.7867) (8.) (90.9) (90.96) (7.9768) (7.700) (0.7668) (.96) (0.968) (7.) (7.88) (.068) (7.) N (78.8) (98.77) (0.79) (06.668) (.00) VROC (.00) EOM (.9) (9.089) (.00) N N (6.766) (8.69) (9.70) (.08) (.86) (8.00) (6.966) (0.996) N N N (7.7) (90.0) (.980) (.80) (.96) (.) (77.668) (70.77) N N N (7.878) (9.09) (7.0) (.098) (76.780) (60.7708) (86.6) (7.698) (96.697) (0.8) (68.90) (7.786) (0.9) (06.8) (.768) (0.97) N (0.) (7.8) (8.8) (7.77) (0.078) (0.86) (.7) (0.8696) (.97) N (.600) (.66) (9.0) (.999) N (6.9) (79.98) (00.9) (.09) (.608) N (.8) (8.60) (.8096) (9.) (07.8) (.8) (.70) (.80) N (.99) (8.7706) (.09) (7.60) (.87) (6.86) (8.6) (.6689) N N (.08) (6.890) (.6) (.9) (.0) (.89) (.976) (6.00) N N N (7.6) (8.7) (6.0) (6.899) (.6) (.078) (.) (.9) (.6) (.890) (.6) (9.78) (0.608) (6.69) (6.7) (.) N (.77) (.887) (6.776) (.00) (0.0) (.) (8.999) (.9) (9.8) (.7608) (6.) (8.99) (.8) (.96) (9.9) (6.7) (.8) (7.000) (.) (6.9) (9.796) (.676) (.6) (.867) (.8) 9
(.968) (.98) (0.809) (.076) (8.78) (.7) (8.788) (60.00) (0.69) (.7) (6.690) (.7) (9.9) (6.0) (.77) (.786) (.7) (.7) (.) (9.798) (.) (0.) (.88) (.80) (.8) (.70) (.6887) (.9) (6.9) (.006) Table 6 illustrates the return rate of ranking indicators in the new time sequences for each of the six patterns. Although there are the several negative return rates, on the whole, we found more positive return rates than negative. This result indicates that the DTW is useful for pattern recognition between the new patterns and the indicators in each of the pattern bases. Table 6. Return rates (%) of the five indicators for the new time sequences in each of the six pattern bases (a) The new time sequences (Return rate (%)) of indicators (b) of indicators (c) of indicators EOM VROC (d) of indicators N (e) of indicators N (f) of indicators -9. 8.00 -.00.00. -.00. 6..00 -.00-7.00 79.00-8.7. -7.0 0.00 -.7.0. 7.00.0 0.7 6.7 7.7 0.7-7.00 0.0 -.0 7.7-6.00-8.0-6.0-0.00 -.00..7.0 -.0 -. 6..0 -..00 -.00 0.00.00.0.0-0.00-0.0 The new time sequences (Return rate (%)) 8.00 0.0-9.00 -.00 -.7 -.0 7.00 6.0 -.0-0. 7.00 0.0-8.7.. -6.00 -.00. -.00 -.7 8. 7.7 89.00 8.00 7..0.00-9.7.7 7..7-9. -8.0 0. 67. -.7-6.00 6.7. -.0 -.0-6.0 -.0. 7.0-69.00 -. -.0 -.0 8.0 The new time sequences (Return rate (%)) 97.00 8.0 0. -9.7-8. -6. -9. -0.00-0.0 6.00 7. 9.7 6.00.7 -.00 0.00 08.0. 7.7 0.00 9.0 7.00.00-9. 8.0 -.0 -.00 0.7 7.7 6.0 6.0 -.00-6.00-8.00 -.7 -.0 -.7-7.00 8.00.7 9.7-77.00 7.7-6.0-6. 6.0.00.7.0-60.0 The new time sequences (Return rate (%)) 6.0.0 -.. -9.0-6.00 -.7 -.7-7. -7..7 6..7-9.0 -.7-6..7 7. -0.0 -. -0.7 6.7 -.7 -.0 7. 8.0 -.7.7 8.0 7. 9. 0.7-7. 7.00-8. -8.00-0. -78.0-07. -9.00.7.0 -.0-9.00 -.7-9.00 70.0 -.7 -. 6.00 The new time sequences (Return rate (%)) -.00 -.0 -.0 6.00-0.7 -.00 0.00 -.0 -.7 0..7 0.00-0.00-9. -.0 -. 8.00-8.00 6.7.0 7.0 0.7-6. -87. 0.0 -.00.0 -. -6.00 7. -0.7 -.7 -.7-9. -.7 -.00 -.7-8. 6.7 90.00 7.7-69.00 9.00-8.7-9.0 8.00.0 8.7-6.0 -.0 The new time sequences (Return rate (%)) 0. 6. -8.0 8..7 -. -. -. 9.7 -.00.7 -.7.0. 70.7 9.7-6.. -9.7 -. 0.00-8.7 -.00-0.7.00 70.0.0 7.00-0.0-6.7 0. 67. -.7.00 0.7.7-9..00-9.7 8.00 -.0 -.7 70. 6. 8.0 -.0 -. 79.0 -.7-0.00 9
Table 7 describes the average return rates and of the combination of indicators in each of the six pattern bases. The combinations of indicators were made by adding in one nearest indicator at a time. For example, if is designated as the number of combinations of indicators in each pattern base, it would signify that only the nearest indicator was used, and indicates that the two nearest indicators form the combination in each pattern base, and so on. The Sharpe ratio was employed for practical selection of the half and overall periods, and it is important for evaluating PRTS performance. The Sharpe ratio is defined as the ratio of the expected difference between the return rate of a given portfolio and the risk-free asset over the standard deviation of the difference ([6]). Here, the return rate of a risk-free asset used for the Sharpe ratio calculation was the three-year Treasury bill (with an average return rate of.% from 008 to 00). Table 7. (%) and as portfolio indicators for each of the six pattern bases in the half and overall periods (a) Half period Patterns Number of the combination of indicators Measure of portfolio base 7.0 0.6 0.6 0..0 0.7 9.0 0.06.0 0.0 0.7 0.8. 0..7 0.0 0. 0. 0.7 0.0 8.0 0.. 0. 6.8 0. 6.60 0..08 0.6 9.80 0.0.9 0.0. -0.0 6.7 0..8-0.0 0.9 0. 6.09 0.0 -.97-0..9 0.0.69-0.09.0 0.0.00 0.0.8 0.0-7.6-0.6.7 0.0 (b) Overall period Patterns base Measure of portfolio Number of the combination of indicators.60 0. 7. 0.07. 0.6 8.0 0.0.68 0. 7. 0.6 8.89 0.9. 0. 6. 0.67.8 0. 8.78 0. 6.9 0.67. 0.06 0.88 0. 7.90 0.79-6. -0.7 8.99 0. 6.6 0.08.9-0. 9. 0..66 0. -.9-0.68-0. -0.. -0.0.69-0.09.0 0.0.00 0.0-6.9-0.66-7.6-0.6.7 0.0 Figure visually depicts the average return rates and for each of the six patterns. As shown in Figure (a) and (b), the average return rates with the second combination for each of the six patterns are over 0% in both the half and overall periods, which is twice that of the open market interest rate (%). However, the average return rate for the half period is better than that for the overall period. With the third combination, each of the six patterns in the half period show positive profits (see Figure (a)), but the in the overall period yields a negative profit (see Figure (a)). In the fourth and fifth combinations, two patterns ( and ) among the six patterns in the overall period have negative average return rates, whereas the patterns in the half period have only one negative average return rate. As shown in Figure (c) and (d), at the fourth combination, the of two patterns (i.e., and ) for the half period decline to below zero, whereas the of four patterns (i.e.,,,, and ) for the overall period decline below zero. These results indicate that the PRTS pattern matching trading using similarities over the half period is superior to that based on the overall period. 9
(a) Average return rate for half period 0 (b) Average return rate for overall period 0 0 0 0 0 0 0 0 0-0 -0-0 (c) Sharpe ratio for the half period 0.8-0 (d) Sharpe ratio for the overall period 0.8 0.6 0.6 0. 0. 0. 0-0. 0. 0-0. -0. -0. -0.6-0.6-0.8-0.8 Figure. Features of average return rates and for the six patterns used as portfolio indicators in the half and overall periods. Concluding remarks This study demonstrates the usefulness of the DTW algorithm in constructing a PRTS for the stock futures market. In particular, it should be emphasized that the developed PRTS, using the DTW algorithm, yields profit in various market situations. To demonstrate this algorithm, we changed the size of the pattern recognition periods, that is, one-half and overall, in the period of each reference pattern. We found that using the half period led to an average return rate of over 0 % when a combination of two of the top five indicators was used for the overall period of pattern recognition. Note that the average return rate was higher than the open market interest rate (%). Moreover, the descending degree of the Sharpe ratio in the half period was smaller than in the overall period, demonstrating the greatest stability. This study developed stable and profitable trading strategies using the DTW algorithm and various technical indicators in the stock futures market. The development of a more elaborate procedure for a PRTS may require the use of more advanced technical indicators and different patterns. 6. References [] Shih, M-L., Hsiao, S-H., and Chen, F-S., The Association of China Stock Index with Japan and US, Journal of Convergence Information Technology, vol., no., pp.-, 008. [] Chiu, D-Y., and Chian, S-Y., Exploring Stock Market Dynamism in Multi-nations with Genetic Algorithm, Support Vector Regression, and Optimal Technical Analysis, International Journal of Digital Content Technology and its Applications, vol., no., pp.-, 0. [] Chen, M., and Lin, H., Order Imbalance, Individual Stock Returns and Volatility: Evidence from China, Journal of Convergence Information Technology, vol. 7, no., pp.0-07, 0. [] Yang, C., Yan, W., and Liang, H., Optimization of Measuring Investor Sentiment, Journal of Convergence Information Technology, vol. 7, no. 6, pp.7-77, 0. 9
[] Lo, A. W., Mamaysky, H., and Wang, J., Foundations of technical analysis: Computational algorithms, statistical inference, and empirical implementation, Journal of Finance, vol., no., pp.70-770, 000. [6] Leigh, W., Modani, N., and Hightower, R., A computational implementation of stock charting: Abrupt volume increase as signal for movement in New York stock exchange composite index, Decision Support Systems, vol. 7, no., pp.-0, 00. [7] Leigh, W., Modani, N., Purvis, R., and Roberts, T., Stock market trading rule discovery using technical charting heuristics, Expert Systems with Applications, vol., no., pp.-9, 00. [8] Leigh, W., Purvis, R., and Ragusa, J. M., Forecasting the NYSE composite index with technical analysis, pattern recognizer, neural network, and genetic algorithm: A case study in romantic decision support, Decision Support Systems, vol., no., pp.6-77, 00. [9] Deboeck, G. J., Trading on the Edge, Wiley, Canada, 99. [0] Kim, S. D., Lee, J. W., Lee, J. W. and Chae, J. S., A two-phase stock trading system using distributional differences, Lecture Notes in Computer Science, vol., pp.-, 00. [] Chung, F-L., Fu, T-C., Ng, V., and Luk, R. W. P., An evolutionary approach to pattern-based time series segmentation, IEEE Transactions on Evolutionary Computation, vol. 8, no., pp.7-89, 00. [] Kim, H. J., and Shin, K. S., A hybrid approach based on neural networks and genetic algorithms for detecting temporal patterns in stock markets, Applied Soft Computing, vol. 7, no., pp.69-76, 007. [] Choudhry, R., and Garg, K., A hybrid machine learning system for stock market forecasting, World Academy of Science, Engineering and Technology, vol. 9, pp.-8, 008. [] Li, S. T., and Kuo, S. C., Knowledge discovery in financial investment for forecasting and trading strategy through wavelet-based SOM networks, Expert Systems with Applications, vol., pp.9-9, 008. [] Lee, S. J., Ahn, J. J., Oh, K. J., and Kim, T. Y., Using rough set to support investment strategies of real-time trading in futures market, Applied Intelligence, vol., pp.6-77, 00. [6] Keogh, E. J., and Pazzani, M. J., Derivative dynamic time warping, In Proceeding of the First SIAM International Conference on Data Mining, pp.-, 00. [7] Rabiner, L., and Juang, B-H., Fundamentals of Speech Recognition, Prentice Hall, New Jersey, 99. [8] Schmill, M., Oates, T., and Cohen, P. R. Learned models for continuous planning, In Proceeding of the Seventh International Workshop on Artificial Intelligence and Statistics, 999. [9] Zhou, X. S., and Dong, M., Can fuzzy logic make technical analysis 0/0?, Financial Analyst Journal, vol. 60, no., pp.-7, 00. [0] Murphy, J. J., Technical Analysis of the Futures Markets: A comprehensive guide to trading methods and applications, Prentice-Hall, New York, 986. [] Murphy, J. J., Technical Analysis of the Financial Markets, Paramus, New Jersey, 999. [] Tanaka-Yamawaki, M., and Tokuoka, S., Adaptive use of technical indicators for the prediction of intra-day stock prices, PHYSICA A, vol. 8, pp.-, 007. [] Colby, R. W., The Encyclopedia of Technical Market Indicators, McGraw-Hill, New York, 00. [] Bellman, R., Dynamic Programming, Princeton University Press, New Jersey, 97 [] Pruitt, G., and Hill, J. R., Building Wining Trading Systems with Tradestation, Wiley, New Jersey, 00. [6] Sharpe, W. F., The Sharpe ratio, Journal of Portfolio Management, vol., pp.9-8, 99. 96