Next Article in Journal
Participatory Guarantee Systems in Peru: Two Case Studies in Lima and Apurímac and the Role of Capacity Building in the Food Chain
Next Article in Special Issue
Enabling Effective Social Impact: Towards a Model for Impact Scaling Agreements
Previous Article in Journal
Effects of Tree Root Density on Soil Total Porosity and Non-Capillary Porosity Using a Ground-Penetrating Tree Radar Unit in Shanghai, China
Previous Article in Special Issue
Enhancing Bank Loyalty through Sustainable Banking Practices: The Mediating Effect of Corporate Image
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Pattern Matching Trading System Based on the Dynamic Time Warping Algorithm

1
Department of Industrial Engineering, Yonsei University, 50 Yonsei-ro, Seodaemun-gu, Seoul 03722, Korea
2
Department of Business Administration, Sejong University, 209 Neungdong-ro, Gwangjin-gu, Seoul 03722, Korea
*
Author to whom correspondence should be addressed.
Sustainability 2018, 10(12), 4641; https://doi.org/10.3390/su10124641
Submission received: 27 October 2018 / Revised: 22 November 2018 / Accepted: 1 December 2018 / Published: 6 December 2018
(This article belongs to the Special Issue Sustainable Financial Markets)

Abstract

:
The futures market plays a significant role in hedging and speculating by investors. Although various models and instruments are developed for real-time trading, it is difficult to realize profit by processing and trading a vast amount of real-time data. This study proposes a real-time index futures trading strategy that uses the KOSPI 200 index futures time series data. We construct a pattern matching trading system (PMTS) based on a dynamic time warping algorithm that recognizes patterns of market data movement in the morning and determines the afternoon’s clearing strategy. We adopt 13 and 27 representative patterns and conduct simulations with various ranges of parameters to find optimal ones. Our experimental results show that the PMTS provides stable and effective trading strategies with relatively low trading frequencies. Financial market investors are able to make more efficient investment strategies by using the PMTS. In this sense, the system developed in this paper contributes the efficiency of the financial markets and helps to achieve sustained economic growth.

1. Introduction

The global financial crisis of 2007–2008 (GFC) was caused by many factors but one of the main causes was the excessive expansion of financial assets including derivatives [1,2,3]. The world’s leading financial markets include major equity index futures such as the S&P 500, NASDAQ 100, DJIA, FTSE Russel 100, Nikkei 225 and KOSPI 200. Among them, the KOSPI 200 futures and options markets have been the largest trading market since prior to the GFC until the mid-2010s [4]. As a single time series data, the index futures, which generate a large amount of data as a result of large-scale transactions, have been widely used for statistical analysis [5,6]. In recent years, data mining and machine learning techniques are utilized to investigate the futures market.
Time series data is a collection of observational data that is generated chronologically from most scientific and business domains [7]. Many researchers in various fields have used time series data for their research [8,9]. Time series data in financial markets have unique characteristics compared to that in other fields such as electrocardiograms [10]. In stock price time series data, investors in equity markets show various patterns of investment. They can be categorized as investors who adopt fundamental analysis and technical analysis [11]. Fundamental analysts make investment decisions using global economic, industry and business indicators. On the other hand, assuming that the past behavior of a stock price affects the future price, technical analysts make investment decisions based on historical prices or patterns of price movement using complex indicators. Accordingly, technical analysts use pattern analysis methods to analyze stock price charts for trading decisions [12]. Many studies on technical analysis for pattern matching have been carried out [13,14,15,16,17]. This pattern analysis is a method of predicting the stock price by examining specific patterns observed in the past stock price chart and confirming the existence of similar patterns in the current stock price [18].
An algorithm for efficient pattern recognition of the time series data is needed to build a trading system based on pattern recognition. The Euclidean distance method or artificial intelligence method has been used to find a similar pattern for stock prices [19,20,21]. Hu et al. [22] proposed a model which is an investment strategy using a short- and long-term evolutionary trend algorithm. De Oliveira, Nobre and Zarate [23] also proposed a model for predicting stock prices in the Brazilian market, which combines fundamental and technical analysis using artificial neural networks. The system development includes forecasting the FX market financial time series, which combines an adaptive network-based fuzzy inference system and quantum behavioral particle gain optimization and forecasting market trends using chart patterns [11]. Patel et al. [24] also proposed a model to predict trends in financial markets by comparing four predictive models such as artificial neural networks, support vector machines, random forests and naïve-Bayes. There are also studies showing the efficiency of dynamic time warping algorithms for the problem of retrieving multi-attribute time sequences similar to financial time series data [25]. The proposed method based on the dynamic time warping algorithm predefines the pattern used as a template for pattern matching [26]. These studies have focused on optimization and efficiency in pattern recognition. However, there is a limit to a study on system trading at the optimal trading time point by checking the similarity of existing patterns in the futures market. This trading strategy requires efficient pattern recognition algorithms such as dynamic time warping [27]. Among them, only a few studies use the dynamic time warping algorithm for futures trading [28,29,30].
The purpose of this research is to construct a pattern matching trading system (PMTS) that extracts efficiently the optimized pattern of the proposed representative pattern in time series data and conducts trading to find the optimal trading exit point. For this goal, we propose an algorithm trading system that matches the time series pattern of the index futures data with the representative pattern using the naïve dynamic time warping (DTW) algorithm. As the experiment progresses, we consider various situations in futures contracts such as when margin calls are made, the liquidity and volatility increases, the trend changes for trades that enter into the calculation of the intraday trade and trades exit right before the closing of the market, to find the optimal trading exit point. Our experimental results show stable and effective trading entry and exit strategies with relatively low trading frequencies.
A number of financial instruments that are traded in financial markets exist and an enormous number of models or techniques have been developed for efficient investment strategies. Therefore, financial instruments and investment techniques as well as investors make an important contribution to the efficiency of the financial markets. It is well known that the efficiency of the financial markets have played an important role in sustaining economic growth. Financial market investors are able to make more efficient investments strategies by using the PMTS. In this sense, the system developed in this paper appears to contribute to the efficiency of the financial markets and hence play a role in sustaining economic growth.
The rest of this paper is organized as follows. Section 2 introduces the concept of futures markets, the concept of dynamic time warping algorithms and the sliding window method. In Section 3, the topics include the standardization of extracted raw daily index futures data, the dynamic trading pattern together with the dynamic time warping analysis for real-time pattern recognition and the proposed trading entry and exit simulation. Section 3.4 describes the procedure of the experiments performed and discusses the experimental results. Section 4 interprets the results and suggests the direction of future research.

2. Materials and Methods

2.1. Futures Market

The futures market is a market for futures trading, which is one of many derivatives. The value of derivatives relies on other assets called underlying assets such as commodities, stocks, bonds, indices and interest rates. In other words, it changes when the value of the underlying assets changes. Prior to the establishment of futures markets, forward contracts have been traded to avoid the risk related to the value of the underlying asset. When one does not need to have the underlying asset at the present time but needs it in the future, he or she can make a forward contract with a counter party that presents the underlying asset’s delivery price and date. Due to the credit risk inherent in the forward contract, futures markets have been established by standardizing transactions and eliminating the credit risk.
The futures market was originally designed to help market participants avoid exposure to the risk of price fluctuations. In recent years, the role of risk hedging by futures contracts has become more prominent. For instance, although KOSPI 200 index futures are recognized as a high-return investment, the primary purpose of investing in the stock index futures is to avoid the risk related to stock prices. The stock index futures’ underlying asset is a stock price index which is an intangible product and hence it cannot be acquired or delivered to the counter party of the contract. Investors in index futures have a long position when the bull market is predicted and have a short position when the bear market is predicted in the future. Accordingly, investors in index futures can realize profits in both bull and bear markets if they make a correct prediction. In other words, they should predict the direction of stock price fluctuations accurately. They can hardly make profits by responding promptly with intuitive and qualitative investment decisions based on past trading experience. Indeed, quantitative and systematized trading strategies which use existing futures investment strategies and past time series data are required for making profits. It is essential to develop a quantitative method to determine the most useful trading positions and timing of index futures to realize high returns.
An investor in a futures market is classified as a hedger who avoids risk and a speculator who seeks profit [31,32,33,34,35]. The hedger takes the position to hedge the stock price risk and rollover the position until the settlement date, whereas a speculator tends to clear his or her position whenever he or she can make profits. The futures market operates a margin system to avoid the credit risk due to the leverage effect on underlying assets. It includes the initial margin, maintenance margin and additional margin. The initial margin is at least 15% of the contract value and must be paid to enter a new futures contract. The maintenance margin is at least 10% of the contract value and must be maintained for holding a futures contract. Additional margin should be paid if the margin level is lower than the maintenance margin as the futures price fluctuates. The additional margin payment is notified by brokerage firms, which is called a margin call. If the margin call is triggered and the additional margin is not paid, the exchange arbitrarily clears the outstanding position by making a reverse trading.

2.2. Dynamic Time Warping

The dynamic time warping (DTW) algorithm is known as an efficient method to measure the similarity between two sequences of time series data (Figure 1). Intuitively, the sequences are warped in a nonlinear fashion to match each other. The DTW minimizes distortion effects due to time-dependent movement by using an elastic transformation of time series data to recognize the similar phases between different patterns along time. Even if there is a deformation relationship between two different sequences of time series data, the DTW determines the most similarities between them [7]. Since the DTW was introduced in the 1960s [36], the algorithm has been applied to spoken word recognition [37,38], gesture recognition [39], behavioral perception [40], data mining and time series clustering [25,41,42,43].
The objective of DTW is to compare two time series X = ( 𝓍 1 ,   𝓍 2 , , 𝓍 N ) ,   N and Y = ( 𝓎 1 ,   𝓎 2 , , 𝓎 M ) ,   M and calculate the minimum cumulative distance between them [44]. Various modifications of the algorithm have been proposed to speed up DTW computations such as multiscaling [45,46]. Local distance measurement is required to compare two time series that differ in length. The concept of the cost function or the distance minimization, which is the core of DTW, is applied to a dynamic programming algorithm to produce a small value when two sequences are similar and a large value when two sequences are not similar. The algorithm provides a way to optimize the alignment and to minimize cost functions or the distance.
The DTW algorithm creates a distance matrix C l N × M : c i , j = | | 𝓍 i 𝓎 j | | ,   i [ 1 : N ] , j [ 1 : M ] that represents all pairwise distances. It is called the local cost matrix for the alignment of two sequences X and Y. After generating this matrix, the algorithm uses a warping function that defines the similarity between 𝓍 i X and 𝓎 j Y , which follows the boundary condition of assigning the first and last elements of X and Y and finds the optimal alignment path to pass through. This optimal alignment path is a sequence of points of P = ( 𝓅 1 ,   𝓅 2 , , 𝓅 K ) with 𝓅 l = ( 𝓅 i , 𝓅 j ) [ 1 : N ] × [ 1 : M ] for l [ 1 : K ] that satisfies all three criteria of the boundary condition, the monotonicity condition and the step size condition. The boundary condition is the first and last values of sequences in the optimal alignment path. The monotonicity condition is sequence of points on the path placed in chronological order. The step size condition limits the long jumping warping path in time. It is generally recommended to use the formulated basic step size condition as   𝓅 l + 1 𝓅 l { ( 1 , 1 ) , ( 1 , 0 ) , ( 0 , 1 ) } . The cost function used to calculate the local cost matrix of all the bidirectional distances is:
c p ( X , Y ) = l = 1 L c ( 𝓍 n l , 𝓎 m l )
The aligned warping path with the least cost is called the P * optimal warping path. By definition, the optimal path increases exponentially as the length of X and Y increases linearly, so all possible warping paths between X and Y, which consume a large amount of computation, must be tested. This problem can be solved by O(MN) that is the time complexity of DTW algorithm [7]. The DTW distance between X and Y, DTW(X, Y), is then defined as the total cost of P * as follows:
D T W ( X , Y ) = c P * ( X , Y ) = m i n { c P ( X , Y ) , p P N × M } ,
where P N × M is the set of all possible warping paths.

2.3. Pattern Matching Trading System

This section describes the structure and characteristics of the pattern matching trading system (PMTS) used in experiments for index futures trading. The experiments determine the entry and exit of trading by matching the daily index futures time series data with fixed patterns using the DTW algorithm. Figure 2 shows an experimental procedure diagram of the pattern matching trading system. The first phase of the procedure is to collect the daily index futures data and to preprocess them for outlier processing, missing value processing and standardization of the data from KOSCOM’s Check Expert system. In the second phase, the fixed time series patterns and the collected index futures time series patterns are recognized to find similar patterns and then classified by the dynamic time warping algorithm. The third phase is to improve the performance with training data for trading entry and exit simulations with various parameters and perform the verification with testing data.
Phase 1: Data preparation for the pattern matching trading system
To conduct this experiment, 137,242 KOSPI 200 index futures data were collected every at 10 min intervals from 01/02/2001 to 12/30/2015. The collected index futures time series data are preprocessed by outlier processing and missing value processing. All extracted daily index futures data are standardized by setting the index futures data to 0 at 12:00 pm and scaling with the min-max method. The scaled data is obtained by the following equation:
f ( d ) ~ = f ( d ) m i n d d f i d f ( d ) m a x d d f i d f ( d ) m i n d d f i d f ( d )
where f ( d ) ,   d D a i l y   f u t u r e s   d a t a   s e t (dfid) is the daily index futures data.
The processed data is divided into two groups: the pattern recognition group that consists of data from 9:00 am to 12:00 pm and the trading group that consists of data after 12:00 pm. If there is no data at 9:00 am due to a delayed market opening caused by a market action or regulation, the missing data is filled with the closing price of the previous date.
Phase 2: Pattern recognition and determination of the trading position
We construct two sets of fixed patterns using two different time divisions. The time from 9:00 am to 12:00 pm is divided into three time zones (from 9 am to 10 am, from 10 am to 11 am and from 11 am to 12 pm) and a total of 27 fixed time series patterns is set up consisting of all possible combinations of three steps (upward, stable and downward) in each time zone. The 27 fixed patterns can be described by 9 representative roughness patterns as a result of eliminating the similarity in terms of macroscopic viewpoints and endpoints. In addition, the time from 9:00 am to 12:00 pm is divided into two time zones (or the first half from 9 am to 10:30 am and the second half from 10:30 am to 12:00 pm) to set up 9 representative patterns consisting of three steps and then 4 industry recommendation patterns are added to have 13 representative patterns. Figure 3 and Figure 4 below show the structure of 27 fixed patterns and 13 representative patterns, respectively.
The daily market data between 9:00 am and 12:00 pm from 01/02/2001 to 12/30/2015 are assigned to one of the fixed patterns that is the most similar to the market data by using the dynamic time warping method and then the frequency of each selected pattern is counted. At this step, the fixed patterns with a higher frequency than the filtering criteria are selected. For each selected pattern of the daily market data, the price at 12:00 pm and 3:00 pm on a day included in training period is compared. Then, “up” is assigned to the pattern if the price at 3:00 pm is higher than that at 12:00 pm and “down” is assigned to the pattern if the price at 3:00 pm is lower than that at 12:00 pm. The ratio of “up” to “down” for each pattern is calculated and used to determine the trading position in the testing period. Once a pattern from 9:00 am to 12:00 pm is selected for market data on one day that is included in a testing period, the investment strategy at 12:00 pm on that day is determined as follows:
-
Enter a long position at 12:00 pm and clear the position by taking a short position at 3:00 pm if the ratio of “up” to “down” for the selected pattern is higher than 1.
-
Enter a short position at 12:00 pm and clear the position by taking a long position at 3:00 pm if the ratio of “up” to “down” for the selected pattern is lower than 1.
The margin of the futures trading is settled at 12:00 pm when the volatility and liquidity increase. Therefore, it is a critical time to enter a position. For intraday trades, the clearing time can be used at various points in time and is not limited at 3:00 pm.
Phase 3: PMTS simulation
In the last phase, we performed PMTS simulation by applying trading rule created in Phase 2. Figure 5 shows the workflow of PMTS simulation.
As shown in this figure, we first set the sample period using a sliding window method and divide each window into training and testing periods. We use the daily index futures data at every 10 min from 9:00 am to 12:00 pm for pattern matching to the representative patterns constructed by data at every minute from 9:00 am to 12:00 pm. Then, using the DTW algorithm with various ranges of parameters, we conduct pattern matching to daily index futures data and determine the entry and exit position for the testing period. This process is repeated for all windows for the selected parameters. As a last step, we analyze the trading profit and determine the optimal parameters for PMTS. Figure 6 shows the structure of the sliding windows.
The sliding window method has been used for simulation of time series data [47,48,49,50,51]. Table 1 shows a set of 54 windows with an 18 months training period and a 3 months testing period. For example, Window1 is composed of the 18 months training period of 01/2001–06/2002 and the 3 months testing period of 07/2002–09/2002. Sliding 3 months from Window1, Window2 is set with a training period of 04/2001–09/2002 and a testing period of 10/2002–12/2002. The sliding is continued until the entire sample period is included and produces a total of 54 windows.
As a result of the PMTS execution for each window, a revenue profile for each pattern from 2:00 pm to 3:00 pm is generated. Our experiment uses a total of 7 clearing times at 10-min intervals from 14:00 to 15:00 to find the optimal clearing time.

3. Results

3.1. Data Collection and Preprocessing

The data used in the PMTS experiments are the KOSPI 200 index futures data from 2 January 2001 to 30 December 2015. The data were collected from KOSCOM, which is a subsidiary of the Korea Exchange, and in charge of financial IT. The raw data consists of daily, hourly and minutely data and open price, high price, low price, close price and volume per 1 min. If there is no market price or open price due to a market opening delay or specific market regulations, the missing data was replaced by the closing price on the previous day. When the trading volume is significantly small or large, outlier processing is performed by re-extracting the data. The raw data is normalized by min-max scaling. The market data is a 10-min unit closing price for the daily KOSPI 200 index futures data. The market data from 9:00 am to 12:00 pm is used for pattern recognition by the dynamic time warping method and the market data from 12:00 pm is used for trading (either entry or exit position). The simulation is performed with various combinations of training and testing periods: 12, 18, 24 and 36 months for the training period and 1, 2 and 3 months for the testing period. The entire sample period of 180 months from January 2001 to December 2015 provides a number of combinations of the data set. Table 2 shows the number of windows produced by a several combinations of training and testing periods.

3.2. Pattern Matching by the Dynamic Time Warping Algorithm

A self-developed program was used for the analysis in Phase 2 with daily 10-min time series data. For pattern matching of daily market data by the dynamic time warping algorithm, two sets of 27 fixed patterns and 13 fixed patterns are used as input data. The daily market data between 9:00 am and 12:00 pm are assigned to one of the fixed patterns that is the most similar to the market data and then the frequency of each selected pattern is counted. For market data included in the training period, the price at 12:00 pm is compared with the price of 10-min intervals between 14:00 and 15:00. Then, the trading position is determined by the rule explained in Phase 2 in Section 2.3.

3.3. Trading Simulation

We conduct the trading simulation with various parameters. Figure 7 shows the PMTS user interface, which displays the selected parameters for the trading simulation.
The PMTS is operated using the two input files and six parameters. The two input files consist of a fixed pattern file and a time series data file. The six input parameters used in our experiment are as follows:
  • The training period for pattern matching: 3, 6, 9, 12, 18, 24, 36, 48 and 60 months are used.
  • Testing period for trading: 1, 2 and 3 months are used.
  • Filtering criteria: a value to exclude patterns if the frequency of a pattern assigned to daily market data is below this value. Seven values of 5, 10, 15, 20, 25, 30 and 40 are used.
  • Stop-loss ratio: the rate of loss for the clearing position when the price moves against the predicted direction. 0.5% is used.
  • U/D frequency: the proportion of “up” movements in the training period to determine the trading position. Six values of 50%, 60%, 65%, 70%, 75% and 80% are used.
  • Slippage cost: the level of slippage cost, where 0.02 pt is used.
Table 3 shows the frequency of 13 representative patterns selected in each window with 18-month training and 3-month testing periods.
For example, testing is performed with patterns of rp-1, 2, 9, 10 and 13 in Window1 when the filtering criterion is 20 ea. With the U/D frequency of 50%, the “up” or “down” position determined and the frequency of “up” and “down” for this Window1 are reported in Table 4.
For example, the frequency of “up” for rp-1 at 14:00 is 25 and that of “down” is 19, so the position is determined as “U” because the proportion of “up” is lower than 50%. However, as shown in Table 5, when the 65% U/D frequency is used, it is classified as M (middle) rather than U or D because the proportion of up (57%) was not higher than 65% and was not lower than 35%, that is, it is between 35% and 65%. In the case of where M is determined, no position is taken for testing.

3.4. PMTS Results

The PMTS is conducted as follows. We first calculated the annual return of the market data clearing at 15:00 with various ranges of training and testing periods to find optimal periods. Given these optimal periods, various filtering criteria and up/down frequency input parameters are used to find optimal parameters. As a last step, we compared the annual returns clearing at every 10 min from 14:00 to 15:00 using the optimal parameters determined in the previous steps to find the optimal clearing time.
Various ranges of results are generated depending on the parameters used. With the results of the simulation as described in Section 3.3, we repeat the experiments with significant parameters to find the optimal parameters. The stop loss and slippage cost were fixed at 0.5% and 0.02 pt, respectively and other significant parameters are:
-
Training period: 12, 18, 24 and 36 months
-
Testing periods: 1, 2 and 3 months
-
Filtering criteria: 5, 10, 15 and 20 ea
-
U/D frequency: 65%, 70%, 75% and 80%
To find the optimal parameters, we compare the Sharpe ratio produced by various ranges of parameters when the trading position is cleared at every 10 min from 14:00 to 15:00. Table 6 shows the annual return, standard deviation and Sharpe ratio of the market data clearing at 15:00 that is assigned to 13 fixed patterns with a 0.02 pt slippage cost, a 0.5% stop-loss ratio, a 20 ea filter criteria, 65% U/D frequency and a combination of training periods (12, 18, 24 and 36 months) and testing periods (1, 2 and 3 months). Table 7 shows the annual return, standard deviation and Sharpe ratio of the market data clearing at 15:00 that is assigned to 13 fixed patterns with a 0.02 pt slippage cost, a 0.5% stop-loss ratio, an 18-month training period, a 3-month testing period and a combination of filtering criteria (5, 10, 15 and 20 ea) and U/D frequencies (65%, 70%, 75% and 80%). Taking the results in Table 6 and Table 7 together, the set of parameters that consists of a 0.02 pt slippage cost, a 0.5% stop-loss ratio, an 18-month training period, a 3-month testing period, 20 ea filtering criteria and 65% U/D frequency were determined to have the highest Sharpe ratio of 0.94.
We conduct the same experiments using 27 fixed patterns as in the case of using 13 fixed patterns. Table 8 shows the annual return, standard deviation and Sharpe ratio of the market data clearing at 15:00 that is assigned to 27 fixed patterns with a 0.02 pt slippage cost, a 0.5% stop-loss ratio, 10 ea filter criteria, 65% U/D frequency and a combination of training periods (12, 18, 24 and 36 months) and testing periods (1, 2 and 3 months). Table 9 shows the annual return, standard deviation and Sharpe ratio of the market data clearing at 15:00 that is assigned to 27 fixed patterns with a 0.02 pt slippage cost, a 0.5% stop-loss ratio, a 24-month training period, a 3-month testing period and a combination of filtering criteria (5, 10, 15 and 20 ea) and U/D frequencies (65%, 70%, 75% and 80%). Taking the results in Table 8 and Table 9 together, a set of parameters that consists of a 0.02 pt slippage cost, a 0.5% stop-loss ratio, a 24-month training period, a 3-month testing period, 10 ea filtering criteria and 65% U/D frequency is determined to have the highest Sharpe ratio of 0.76.
We obtained experimental results from all possible combinations of parameters at every 10 min from 14:00 to 15:00. Table 10 and Table 11 report the annual return, standard deviation and Sharpe ratio of the market data clearing at every 10 min from 14:00 to 15:00 with the selected parameters for using 13 and 27 fixed patterns, respectively. We conduct the t-test for annualized return and report p-values in parenthesis in Table 10 and Table 11. All returns reported in Table 10 and Table 11 are found to be statistically significant.
As shown in Table 6, Table 7, Table 8 and Table 9, the performance of the market data clearing at 15:00 is found to be the best. We also compare the performance of the market data in the experiments using 13 and 27 fixed patterns. The average values of the annual return, standard deviation and Sharpe ratio of the market data clearing at every 10 min from 14:00 to 15:00 are reported in the last column in Table 10 and Table 11. The average Sharpe ratio for the experiments using 13 fixed patterns (0.61) is higher than that for experiments using 27 fixed patterns (0.56). We also find that the best performance with Sharpe ratio of 0.94 is produced by the experiment using 13 fixed patterns and clearing at 15:00. In addition, we calculate the average of total profit obtained when the optimal parameters are used in an experiment using 13 and 27 patterns of clearing at every 10 min from 14:00 to 15:00 and conduct the t-test for the average of total profit. Table 12 shows the average of the total profit points with the corresponding p-value in parentheses in an experiment using 13 and 27 patterns of clearing at every 10 min from 14:00 to 15:00 with the selected parameters. All returns reported in Table 12 are found to be statistically significant. As shown in Table 12, the average total profit is the highest (9.58 pt) when the experiment uses 13 fixed patterns and clears at 15:00.
Figure 8 and Figure 9 show the average returns of the market data that are assigned to each of the 27 and 13 representative patterns for all combinations of parameters used in this study of clearing at every 10 min from 14:00 to 15:00, respectively. Most patterns show higher returns at the 15:00 clearing time.

4. Discussion

The purpose of this study is to develop a pattern matching trading system using the DTW algorithm with optimal parameters. Using KOSPI 200 index futures market data from 2001 to 2015, we conduct experiments with various ranges of parameters and find optimal parameters. Our experimental results show that the PMTS based on the DTW algorithm provides stable and effective trading strategies with relatively low trading frequencies. When financial market investors make more efficient investment strategies with the PMTS, the financial markets are more likely to be efficient. In this sense, the system developed in this paper contributes the efficiency of the financial markets and helps to achieve sustained economic growth.
A future study can be enriched by the studies presented in this paper. An interesting extension to the current study would include empirical studies using a more sophisticated DWP algorithm, such as the deepening dynamic time warping (DDTW) algorithm or the segmented dynamic time warping (SDTW) algorithm or the cluster generative statistical dynamic time warping (CSDTW) algorithm, from which better results are expected. This study could also be extended by experiments with various financial instruments such as interest rate futures contracts, options and other derivatives to find the optimal strategy.

Author Contributions

Project Administrator, K.J.O.; Software, H.K.; Validation, H.W.B.; Formal Analysis, S.H.J.; Writing-Original Draft Preparation, S.H.K.; Writing-Review & Editing, H.S.L.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Birău, F.R. Financial Derivatives-Meanings beyond Subprime Crisis Stigma. Analele Univ. Constantin Brâncuşi din Târgu Jiu: Ser. Econ. 2010, 2, 195–199. [Google Scholar]
  2. Carmassi, J.; Gros, D.; Micossi, S. The global financial crisis: Causes and cures. JCMS J. Common Mark. Stud. 2009, 47, 977–996. [Google Scholar] [CrossRef]
  3. Crotty, J. Structural causes of the global financial crisis: A critical assessment of the ‘new financial architecture’. Camb. J. Econ. 2009, 33, 563–580. [Google Scholar] [CrossRef]
  4. Ghysels, E.; Seon, J. The Asian financial crisis: The role of derivative securities trading and foreign investors in Korea. J. Int. Money Financ. 2005, 24, 607–630. [Google Scholar] [CrossRef]
  5. Caillault, É.P.; Lefebvre, A.; Bigand, A. Dynamic time warping-based imputation for univariate time series data. Pattern Recognit. Lett. 2017, in press. [Google Scholar] [Green Version]
  6. Kwon, D.; Lee, T. Hedging effectiveness of KOSPI200 index futures through VECM-CC-GARCH model. J. Korean Data Inf. Sci. Soc. 2014, 25, 1449–1466. [Google Scholar]
  7. Keogh, E.J.; Pazzani, M.J. Scaling up dynamic time warping to massive datasets. In European Conference on Principles of Data Mining and Knowledge Discovery; Springer: Berlin/Heidelberg, Germany, 1999; pp. 1–11. [Google Scholar]
  8. Agrawal, R.; Faloutsos, C.; Swami, A. Efficient similarity search in sequence databases. In International Conference on Foundations of Data Organization and Algorithms; Springer: Berlin/Heidelberg, Germany, 1993; pp. 69–84. [Google Scholar]
  9. Das, G.; Gunopulos, D.; Mannila, H. Finding similar time series. In European Symposium on Principles of Data Mining and Knowledge Discovery; Springer: Berlin/Heidelberg, Germany, 1997; pp. 88–100. [Google Scholar]
  10. Fu, T.C.; Chung, F.L.; Luk, R.; Ng, C.M. Stock time series pattern matching: Template-based vs. rule-based approaches. Eng. Appl. Artif. Intell. 2007, 20, 347–364. [Google Scholar] [CrossRef]
  11. Bagheri, A.; Peyhani, H.M.; Akbari, M. Financial forecasting using ANFIS networks with quantum-behaved particle swarm optimization. Expert Syst. Appl. 2014, 41, 6235–6250. [Google Scholar] [CrossRef]
  12. Deboeck, G. Trading on the Edge: Neural, Genetic, and Fuzzy Systems for Chaotic Financial Markets; John Wiley & Sons: Hoboken, NJ, USA, 1994; Volume 39. [Google Scholar]
  13. Leigh, W.; Modani, N.; Hightower, R. A computational implementation of stock charting: Abrupt volume increase as signal for movement in New York stock exchange composite index. Decis. Support Syst. 2004, 37, 515–530. [Google Scholar] [CrossRef]
  14. Leigh, W.; Modani, N.; Purvis, R.; Roberts, T. Stock market trading rule discovery using technical charting heuristics. Expert Syst. Appl. 2002, 23, 155–159. [Google Scholar] [CrossRef] [Green Version]
  15. Leigh, W.; Purvis, R.; 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. Decis. Support Syst. 2002, 32, 361–377. [Google Scholar] [CrossRef]
  16. Lo, A.W.; Mamaysky, H.; Wang, J. Foundations of technical analysis: Computational algorithms, statistical inference, and empirical implementation. J. Financ. 2000, 55, 1705–1765. [Google Scholar] [CrossRef]
  17. Cervelló-Royo, R.; Guijarro, F.; Michniuk, K. Stock market trading rule based on pattern recognition and technical analysis: Forecasting the DJIA index with intraday data. Expert Syst. Appl. 2015, 42, 5963–5975. [Google Scholar] [CrossRef] [Green Version]
  18. Chen, T.L.; Chen, F.Y. An intelligent pattern recognition model for supporting investment decisions in stock market. Inf. Sci. 2016, 346, 261–274. [Google Scholar] [CrossRef]
  19. Chung, F.L.; Fu, T.C.; Ng, V.; Luk, R.W. An evolutionary approach to pattern-based time series segmentation. IEEE Trans. Evol. Comput. 2004, 8, 471–489. [Google Scholar] [CrossRef]
  20. Dong, M.; Zhou, X.S. Exploring the fuzzy nature of technical patterns of US stock market. Proc. Fuzzy Syst. Knowl. Discov. 2002, 1, 324–328. [Google Scholar]
  21. Kim, S.D.; Lee, J.W.; Lee, J.; Chae, J. A two-phase stock trading system using distributional differences. In International Conference on Database and Expert Systems Applications; Springer: Berlin/Heidelberg, Germany, 2002; pp. 143–152. [Google Scholar]
  22. Hu, Y.; Feng, B.; Zhang, X.; Ngai, E.W.T.; Liu, M. Stock trading rule discovery with an evolutionary trend following model. Expert Syst. Appl. 2015, 42, 212–222. [Google Scholar] [CrossRef]
  23. De Oliveira, F.A.; Nobre, C.N.; Zárate, L.E. Applying Artificial Neural Networks to prediction of stock price and improvement of the directional prediction index–Case study of PETR4, Petrobras, Brazil. Expert Syst. Appl. 2013, 40, 7596–7606. [Google Scholar] [CrossRef]
  24. Patel, J.; Shah, S.; Thakkar, P.; Kotecha, K. Predicting stock and stock price index movement using trend deterministic data preparation and machine learning techniques. Expert Syst. Appl. 2015, 42, 259–268. [Google Scholar] [CrossRef]
  25. Kahveci, T.; Singh, A.; Gurel, A. Similarity searching for multi-attribute sequences. In Proceedings of the 14th International Conference on Scientific and Statistical Database Management, Edinburgh, UK, 24–26 July 2002; pp. 175–184. [Google Scholar] [Green Version]
  26. Berndt, D.J.; Clifford, J. Using dynamic time warping to find patterns in time series. KDD Workshop 1994, 10, 359–370. [Google Scholar]
  27. Senin, P. Dynamic Time Warping Algorithm Review; Information and Computer Science Department University of Hawaii at Manoa Honolulu: Honolulu, HI, USA, 2008; pp. 1–23. [Google Scholar]
  28. Lee, S.J.; Ahn, J.J.; Oh, K.J.; Kim, T.Y. Using rough set to support investment strategies of real-time trading in futures market. Appl. Intell. 2010, 32, 364–377. [Google Scholar] [CrossRef]
  29. Lee, S.J.; Oh, K.J.; Kim, T.Y. How many reference patterns can improve profitability for real-time trading in futures market? Expert Syst. Appl. 2012, 39, 7458–7470. [Google Scholar] [CrossRef]
  30. Tsinaslanidis, P.E. Subsequence dynamic time warping for charting: Bullish and bearish class predictions for NYSE stocks. Expert Syst. Appl. 2018, 94, 193–204. [Google Scholar] [CrossRef]
  31. Chang, E.C. Returns to speculators and the theory of normal backwardation. J. Financ. 1985, 40, 193–208. [Google Scholar] [CrossRef]
  32. Hartzmark, M.L. Returns to individual traders of futures: Aggregate results. J. Polit. Econ. 1987, 95, 1292–1306. [Google Scholar] [CrossRef]
  33. Hartzmark, M.L. Luck versus forecast ability: Determinants of trader performance in futures markets. J. Bus. 1991, 64, 49–74. [Google Scholar] [CrossRef]
  34. Leuthold, R.M.; Garcia, P.; Lu, R. The returns and forecasting ability of large traders in the frozen pork bellies futures market. J. Bus. 1994, 67, 459–473. [Google Scholar] [CrossRef]
  35. Wang, C. Investor sentiment and return predictability in agricultural futures markets. J. Futures Mark. Futures Opt. Other Deriv. Prod. 2001, 21, 929–952. [Google Scholar] [CrossRef]
  36. Bellman, R.; Kalaba, R. On adaptive control processes. IRE Trans. Autom. Control 1959, 4, 1–9. [Google Scholar] [CrossRef]
  37. Myers, C.; Rabiner, L.; Rosenberg, A. Performance tradeoffs in dynamic time warping algorithms for isolated word recognition. IEEE Trans. Acoust. Speech Signal Process. 1980, 28, 623–635. [Google Scholar] [CrossRef] [Green Version]
  38. Sakoe, H.; Chiba, S. Dynamic programming algorithm optimization for spoken word recognition. IEEE Trans. Acoust. Speech Signal Process. 1978, 26, 43–49. [Google Scholar] [CrossRef]
  39. Kuzmanic, A.; Zanchi, V. Hand shape classification using DTW and LCSS as similarity measures for vision-based gesture recognition system. In Proceedings of the International Conference on “Computer as a Tool”, Warsaw, Poland, 9–12 September 2007; pp. 264–269. [Google Scholar]
  40. Corradini, A. Dynamic time warping for off-line recognition of a small gesture vocabulary. In Proceedings of the Recognition, Analysis, and Tracking of Faces and Gestures in Real-Time Systems, Vancouver, BC, Canada, 13 July 2001; pp. 82–89. [Google Scholar] [Green Version]
  41. Niennattrakul, V.; Ratanamahatana, C.A. On clustering multimedia time series data using k-means and dynamic time warping. In Proceedings of the 2007 International Conference on Multimedia and Ubiquitous Engineering (MUE’07), Seoul, Korea, 26–28 April 2007; pp. 733–738. [Google Scholar]
  42. Bahlmann, C.; Burkhardt, H. The writer independent online handwriting recognition system frog on hand and cluster generative statistical dynamic time warping. IEEE Trans. Pattern Anal. Mach. Intell. 2004, 26, 299–310. [Google Scholar] [CrossRef]
  43. Kahveci, T.; Singh, A. Variable length queries for time series data. In Proceedings of the 17th International Conference on Data Engineering, Heidelberg, Germany, 2–6 April 2001; pp. 273–282. [Google Scholar] [Green Version]
  44. Müller, M. Dynamic time warping. In Information Retrieval for Music and Motion; Springer: Berlin/Heidelberg, Germany, 2007; pp. 69–84. [Google Scholar]
  45. Müller, M.; Mattes, H.; Kurth, F. An efficient multiscale approach to audio synchronization. In Proceedings of the 6th International Conference on Music Information Retrieval, London, UK, 11–15 September 2005; pp. 192–197. [Google Scholar]
  46. Salvador, S.; Chan, P. Toward accurate dynamic time warping in linear time and space. Intell. Data Anal. 2007, 11, 561–580. [Google Scholar] [CrossRef]
  47. Jang, G.S.; Lai, F.; Jiang, B.W.; Parng, T.M.; Chien, L.H. Intelligent stock trading system with price trend prediction and reversal recognition using dual-module neural networks. Appl. Intell. 1993, 3, 225–248. [Google Scholar] [CrossRef] [Green Version]
  48. Hwarng, H.B. Insights into neural-network forecasting of time series corresponding to ARMA (p, q) structures. Omega 2001, 29, 273–289. [Google Scholar] [CrossRef]
  49. Ahn, J.J.; Kim, D.H.; Oh, K.J.; Kim, T.Y. Applying option Greeks to directional forecasting of implied volatility in the options market: An intelligent approach. Expert Syst. Appl. 2012, 39, 9315–9322. [Google Scholar] [CrossRef]
  50. Ahn, J.J.; Byun, H.W.; Oh, K.J.; Kim, T.Y. Using ridge regression with genetic algorithm to enhance real estate appraisal forecasting. Expert Syst. Appl. 2012, 39, 8369–8379. [Google Scholar] [CrossRef]
  51. Chou, J.S.; Ngo, N.T. Time series analytics using sliding window metaheuristic optimization-based machine learning system for identifying building energy consumption patterns. Appl. Energy 2016, 177, 751–770. [Google Scholar] [CrossRef]
Figure 1. (A) Euclidean distance approach, (B) DWP (Nonlinear alignment) approach.
Figure 1. (A) Euclidean distance approach, (B) DWP (Nonlinear alignment) approach.
Sustainability 10 04641 g001
Figure 2. Process of PMTS.
Figure 2. Process of PMTS.
Sustainability 10 04641 g002
Figure 3. Structures of the initial 27 patterns (ip# as initial pattern).
Figure 3. Structures of the initial 27 patterns (ip# as initial pattern).
Sustainability 10 04641 g003
Figure 4. Structures of the representative 13 patterns (rp-# as representative pattern).
Figure 4. Structures of the representative 13 patterns (rp-# as representative pattern).
Sustainability 10 04641 g004
Figure 5. Workflow of the PMTS.
Figure 5. Workflow of the PMTS.
Sustainability 10 04641 g005
Figure 6. Structures of the sliding windows.
Figure 6. Structures of the sliding windows.
Sustainability 10 04641 g006
Figure 7. PMTS user interface.
Figure 7. PMTS user interface.
Sustainability 10 04641 g007
Figure 8. Average return from the experiment with 27 patterns by clearing time.
Figure 8. Average return from the experiment with 27 patterns by clearing time.
Sustainability 10 04641 g008
Figure 9. Average return from the experiment with 13 patterns by clearing time.
Figure 9. Average return from the experiment with 13 patterns by clearing time.
Sustainability 10 04641 g009
Table 1. Training and testing data set of 54 windows for the trading simulation.
Table 1. Training and testing data set of 54 windows for the trading simulation.
Period (mm/yyyy~mm/yyyy)
Training (18 Months)Testing (3 Months) Training (18 Months)Testing (3 Months)
Window 101/2001~06/200207/2002~09/2002Window 2810/2007~03/200904/2009~06/2009
Window 204/2001~09/200210/2002~12/2002Window 2901/2008~06/200907/2009~09/2009
Window 307/2001~12/200201/2003~03/2003Window 3004/2008~09/200910/2009~12/2009
Window 410/2001~03/200304/2003~06/2003Window 3107/2008~12/200901/2010~03/2010
Window 501/2002~06/200307/2003~09/2003Window 3210/2008~03/201004/2010~06/2010
Window 604/2002~09/200310/2003~12/2003Window 3301/2009~06/201007/2010~09/2010
Window 707/2002~12/200301/2004~03/2004Window 3404/2009~09/201010/2010~12/2010
Window 810/2002~03/200404/2004~06/2004Window 3507/2009~12/201001/2011~03/2011
Window 901/2003~06/200407/2004~09/2004Window 3610/2009~03/201104/2011~06/2011
Window 1004/2003~09/200410/2004~12/2004Window 3701/2010~06/201107/2011~09/2011
Window 1107/2003~12/200401/2005~03/2005Window 3804/2010~09/201110/2011~12/2011
Window 1210/2003~03/200504/2005~06/2005Window 3907/2010~12/201101/2012~03/2012
Window 1301/2004~06/200507/2005~09/2005Window 4010/2010~03/201204/2012~06/2012
Window 1404/2004~09/200510/2005~12/2005Window 4101/2011~06/201207/2012~09/2012
Window 1507/2004~12/200501/2006~03/2006Window 4204/2011~09/201210/2012~12/2012
Window 1610/2004~03/200604/2006~06/2006Window 4307/2011~12/201201/2013~03/2013
Window 1701/2005~06/200607/2006~09/2006Window 4410/2011~03/201304/2013~06/2013
Window 1804/2005~09/200610/2006~12/2006Window 4501/2012~06/201307/2013~09/2013
Window 1907/2005~12/200601/2007~03/2007Window 4604/2012~09/201310/2013~12/2013
Window 2010/2005~03/200704/2007~06/2007Window 4707/2012~12/201301/2014~03/2014
Window 2101/2006~06/200707/2007~09/2007Window 4810/2012~03/201404/2014~06/2014
Window 2204/2006~09/200710/2007~12/2007Window 4901/2013~06/201407/2014~09/2014
Window 2307/2006~12/200701/2008~03/2008Window 5004/2013~09/201410/2014~12/2014
Window 2410/2006~03/200804/2008~06/2008Window 5107/2013~12/201401/2015~03/2015
Window 2501/2007~06/200807/2008~09/2008Window 5210/2013~03/201504/2015~06/2015
Window 2604/2007~09/200810/2008~12/2008Window 5301/2014~06/201507/2015~09/2015
Window 2707/2007~12/200801/2009~03/2009Window 5404/2014~09/201510/2015~12/2015
Table 2. Number of windows produced by the training and testing period between 2001 and 2015.
Table 2. Number of windows produced by the training and testing period between 2001 and 2015.
Training Period
Month12182436
Testing Period1168162156144
284817872
356545248
Table 3. Frequency of representative patterns for each window.
Table 3. Frequency of representative patterns for each window.
Representative Pattern (rp)
12345678910111213
Window 1446181071281878738929
Window 2475569512101585748734
Window 35055611515131491616535
Window 45257510618131389564638
Window 5495958620111195543541
Window 65456410717111293532644
Window 75752799141213102492540
Window 8625688914121599463433
Window 9545786111381899572431
Window 105258951111822110533423
Window 114861104912824107603720
Window 12456493915822108587915
Window 13386885817520105629917
Window 143467761022518110618918
Window 154069761122618107559918
Window 16417378924614104558919
Window 1740705101022712108528623
Window 184174799221013101516429
Window 19397461012241210102484429
Window 2037777111317131096504334
Window 21397581112181410102434332
Window 2241717101518141099397334
Window 234467981620141096419332
Window 24436211101417131199439530
Window 25485910916131215934710629
Window 2649559714161016944710933
Window 274253971515914925711838
Window 284055851312111898579738
Window 293859751581119985411839
Window 303967731681120985511636
Window 3137717310912221005612635
Window 3239737311913251025012627
Window 334373838101227975013725
Window 344769948131224955513821
Window 355066975171123945913917
Window 3652597851710191015611920
Window 37525297616101411053101024
Window 3851491374158111135911727
Window 3954481174171011114598726
Window 4051501264161010113607729
Window 4149481174141211109573541
Window 4246521084171211105575642
Window 435353108521101295576440
Window 44485679820121594575437
Window 4538567910181213103546441
Window 463462599211015102529439
Window 47326955823715111539530
Window 48316753924818107577429
Window 49237253824917113536629
Window 50267244727616113525730
Window 51317134629717102569826
Window 52327254727715100556730
Window 5338627682871597546930
Window 543658106725516102527837
Table 4. Up or down position determined and the frequency of up and down for Window1 with 18-month training and 3-month testing periods and 50% U/D frequency.
Table 4. Up or down position determined and the frequency of up and down for Window1 with 18-month training and 3-month testing periods and 50% U/D frequency.
Clearing Time
14:0014:1014:2014:3014:4014:5015:00
rp-1U25222223212628
D19222221231816
UDUUUUDUU
rp-2U26282526282928
D35333635333233
UDDDDDDDD
rp-9U38404039413942
D40383839373935
UDDUUUUUU
rp-10U39473938363632
D34263435373741
UDUUUUDDD
rp-13U10991010118
D19202019191820
UDDDDDDDD
Table 5. Up or down position determined and the frequency of up and down for Window1 with 18-month training and 3-month testing periods and 65% U/D frequency.
Table 5. Up or down position determined and the frequency of up and down for Window1 with 18-month training and 3-month testing periods and 65% U/D frequency.
Clearing Time
14:0014:1014:2014:3014:4014:5015:00
rp-1U25222223212628
D19222221231816
UDMMMMMMM
rp-2U26282526282928
D35333635333233
UDMMMMMMM
rp-9U38404039413942
D40383839373935
UDMMMMMMM
rp-10U39473938363632
D34263435373741
UDMMMMMMM
rp-13U10991010118
D19202019191820
UDDDDDDMD
Table 6. Performance achieved from an experiment using 13 patterns with various combinations of training and testing periods.
Table 6. Performance achieved from an experiment using 13 patterns with various combinations of training and testing periods.
Performance(Training Period, Testing Period)
(12,1)(12,2)(12,3)(18,1)(18,2)(18,3)(24,1)(24,2)(24,3)(36,1)(36,2)(36,3)
Annualized return16.6216.4518.4819.5916.9919.1718.1318.6719.3817.8116.5018.43
StDev31.3222.9121.4930.6323.1018.8329.2722.1020.8831.4223.8821.72
Sharpe ratio0.480.650.790.590.670.940.570.780.860.520.630.78
Slippage Cost: 0.02 pt, Stop loss: 0.5%, Filter Criteria: 20, U/D Frequency: 65%, 15:00 exit.
Table 7. Performance achieved from an experiment using 13 patterns with various combinations of filtering criteria and up/down frequencies.
Table 7. Performance achieved from an experiment using 13 patterns with various combinations of filtering criteria and up/down frequencies.
Performance(Filtering Criteria, Up/Down Frequency (%))
(5,65)(5,70)(5,75)(5,80)(10,65)(10,70)(10,75)(10,80)(15,65)(15,70)(15,75)(15,80)(20,65)(20,70)(20,75)(20,80)
Annualized return18.831.300.630.6918.270.910.120.3219.170.690.060.0919.170.25−0.030.00
StDev18.634.592.642.2619.184.371.871.6719.533.630.700.6518.833.290.230.00
Sharpe ratio0.93−0.04−0.33−0.360.87−0.14−0.74−0.710.90−0.22−2.07−2.160.94−0.38−6.530.00
Slippage Cost: 0.02 pt, Stop loss: 0.5%, Training period: 18, Testing period: 3, 15:00 exit.
Table 8. Performance achieved from an experiment using 27 patterns with various combinations of training and testing periods.
Table 8. Performance achieved from an experiment using 27 patterns with various combinations of training and testing periods.
Performance(Training Period, Testing Period)
(12,1)(12,2)(12,3)(18,1)(18,2)(18,3)(24,1)(24,2)(24,3)(36,1)(36,2)(36,3)
Annualized return17.2016.9117.8117.2616.0616.5018.4218.6518.6618.6318.0318.48
StDev36.3626.9225.8633.2126.4022.6531.8725.1122.6834.3926.7623.87
Sharpe ratio0.430.570.630.470.550.660.530.680.760.500.620.71
Slippage Cost: 0.02 pt, Stop loss: 0.5%, Filter Criteria: 10, U/D Frequency: 65%, 15:00 exit.
Table 9. Performance achieved from an experiment using 27 patterns with various combinations of filtering criteria and up/down frequencies.
Table 9. Performance achieved from an experiment using 27 patterns with various combinations of filtering criteria and up/down frequencies.
Performance(Filtering Criteria, Up/Down Frequency (%))
(5,65)(5,70)(5,75)(5,80)(10,65)(10,70)(10,75)(10,80)(15,65)(15,70)(15,75)(15,80)(20,65)(20,70)(20,75)(20,80)
Annualized return18.541.260.250.0918.661.090.01−0.1117.800.99−0.010.0018.251.20−0.030.00
StDev21.784.922.592.0422.684.101.700.9022.513.671.070.0022.913.881.010.00
Sharpe ratio0.78−0.05−0.48−0.690.76−0.10−0.88−1.790.72−0.14−1.420.000.73−0.08−1.520.00
Slippage Cost: 0.02 pt, Stop loss: 0.5%, Training period: 24, Testing period: 3, 15:00 exit.
Table 10. Performance achieved from an experiment using 13 patterns of clearing at every 10 min from 14:00 to 15:00.
Table 10. Performance achieved from an experiment using 13 patterns of clearing at every 10 min from 14:00 to 15:00.
Trading Exit Time14:0014:1014:2014:3014:4014:5015:00Avg.
Annualized return7.24
(0.0153)
11.42
(0.0002)
13.07
(0.0000)
13.80
(0.0000)
17.65
(0.0000)
18.05
(0.0000)
19.17
(0.0000)
14.34
StDev21.0520.4118.7821.3323.1524.6118.8321.17
Sharpe Ratio0.270.490.620.580.700.670.940.61
Slippage Cost: 0.02 pt, Stop loss: 0.5%, Training period: 18, Testing period: 3, Filter Criteria: 20, U/D Frequency: 65%.
Table 11. Performance achieved from an experiment using 27 patterns of clearing at every 10 min from 14:00 to 15:00.
Table 11. Performance achieved from an experiment using 27 patterns of clearing at every 10 min from 14:00 to 15:00.
Trading Exit Time14:0014:1014:2014:3014:4014:5015:00Avg.
Annualized return7.25
(0.0098)
10.93
(0.0004)
12.72
(0.0002)
13.39
(0.0000)
15.52
(0.0000)
17.64
(0.0000)
18.66
(0.0000)
13.73
StDev19.3120.4022.8819.1822.1323.4022.6821.43
Sharpe Ratio0.300.460.490.620.630.690.760.56
Slippage Cost: 0.02 pt, Stop loss: 0.5%, Training period: 24, Testing period: 3, Filter Criteria: 10, U/D Frequency: 65%.
Table 12. Average of total profit in an experiment using 13 and 27 patterns of clearing at every 10 min from 14:00 to 15:00.
Table 12. Average of total profit in an experiment using 13 and 27 patterns of clearing at every 10 min from 14:00 to 15:00.
Avg. of Total Profit (pt)14:0014:1014:2014:3014:4014:5015:00Avg.
13 pattern 13.62
(0.0153)
5.71
(0.0002)
6.53
(0.0000)
6.90
(0.0000)
8.83
(0.0000)
9.02
(0.0000)
9.58
(0.0000)
7.17
27 pattern 23.63
(0.0098)
5.46
(0.0004)
6.36
(0.0002)
6.69
(0.0000)
7.76
(0.0000)
8.82
(0.0000)
9.33
(0.0000)
6.87
1 Slippage Cost: 0.02 pt, Stop loss: 0.5%, Training period: 18, Testing period: 3, Filter Criteria: 20, U/D Frequency: 65%. 2 Slippage Cost: 0.02 pt, Stop loss: 0.5%, Training period: 24, Testing period: 3, Filter Criteria: 10, U/D Frequency: 65%.

Share and Cite

MDPI and ACS Style

Kim, S.H.; Lee, H.S.; Ko, H.J.; Jeong, S.H.; Byun, H.W.; Oh, K.J. Pattern Matching Trading System Based on the Dynamic Time Warping Algorithm. Sustainability 2018, 10, 4641. https://doi.org/10.3390/su10124641

AMA Style

Kim SH, Lee HS, Ko HJ, Jeong SH, Byun HW, Oh KJ. Pattern Matching Trading System Based on the Dynamic Time Warping Algorithm. Sustainability. 2018; 10(12):4641. https://doi.org/10.3390/su10124641

Chicago/Turabian Style

Kim, Sang Hyuk, Hee Soo Lee, Han Jun Ko, Seung Hwan Jeong, Hyun Woo Byun, and Kyong Joo Oh. 2018. "Pattern Matching Trading System Based on the Dynamic Time Warping Algorithm" Sustainability 10, no. 12: 4641. https://doi.org/10.3390/su10124641

APA Style

Kim, S. H., Lee, H. S., Ko, H. J., Jeong, S. H., Byun, H. W., & Oh, K. J. (2018). Pattern Matching Trading System Based on the Dynamic Time Warping Algorithm. Sustainability, 10(12), 4641. https://doi.org/10.3390/su10124641

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop