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 [,,]. 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 []. 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 [,]. 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 []. Many researchers in various fields have used time series data for their research [,]. Time series data in financial markets have unique characteristics compared to that in other fields such as electrocardiograms []. 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 []. 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 []. Many studies on technical analysis for pattern matching have been carried out [,,,,]. 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 [].
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 [,,]. Hu et al. [] proposed a model which is an investment strategy using a short- and long-term evolutionary trend algorithm. De Oliveira, Nobre and Zarate [] 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 []. Patel et al. [] 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 []. The proposed method based on the dynamic time warping algorithm predefines the pattern used as a template for pattern matching []. 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 []. Among them, only a few studies use the dynamic time warping algorithm for futures trading [,,].
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 [,,,,]. 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 []. Since the DTW was introduced in the 1960s [], the algorithm has been applied to spoken word recognition [,], gesture recognition [], behavioral perception [], data mining and time series clustering [,,,].
Figure 1.
(A) Euclidean distance approach, (B) DWP (Nonlinear alignment) approach.
The objective of DTW is to compare two time series and and calculate the minimum cumulative distance between them []. Various modifications of the algorithm have been proposed to speed up DTW computations such as multiscaling [,]. 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 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 and , 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 with for 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 . The cost function used to calculate the local cost matrix of all the bidirectional distances is:
The aligned warping path with the least cost is called the 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 []. The DTW distance between X and Y, DTW(X, Y), is then defined as the total cost of as follows:
where 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.
Figure 2.
Process of PMTS.
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:
where (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.
Figure 3.
Structures of the initial 27 patterns (ip# as initial pattern).
Figure 4.
Structures of the representative 13 patterns (rp-# as representative pattern).
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.
Figure 5.
Workflow of the PMTS.
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.
Figure 6.
Structures of the sliding windows.
The sliding window method has been used for simulation of time series data [,,,,]. 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.
Table 1.
Training and testing data set of 54 windows for the trading simulation.
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.
Table 2.
Number of windows produced by the training and testing period between 2001 and 2015.
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.
Figure 7.
PMTS user interface.
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.
Table 3.
Frequency of representative patterns for each window.
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.
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.
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.
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.
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.
Table 6.
Performance achieved from an experiment using 13 patterns with various combinations of training and testing periods.
Table 7.
Performance achieved from an experiment using 13 patterns with various combinations of filtering criteria and up/down frequencies.
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.
Table 8.
Performance achieved from an experiment using 27 patterns with various combinations of training and testing periods.
Table 9.
Performance achieved from an experiment using 27 patterns with various combinations of filtering criteria and up/down frequencies.
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.
Table 10.
Performance achieved from an experiment using 13 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.
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.
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.
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.
Figure 8.
Average return from the experiment with 27 patterns by clearing time.
Figure 9.
Average return from the experiment with 13 patterns by 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
- 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]
- 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]
- 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]
- 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]
- Caillault, É.P.; Lefebvre, A.; Bigand, A. Dynamic time warping-based imputation for univariate time series data. Pattern Recognit. Lett. 2017, in press. [Google Scholar]
- 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]
- 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]
- 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]
- 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]
- 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]
- 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]
- 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]
- 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]
- 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]
- 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]
- 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]
- 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]
- 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]
- 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]
- 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]
- 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]
- 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]
- 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]
- 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]
- 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]
- Berndt, D.J.; Clifford, J. Using dynamic time warping to find patterns in time series. KDD Workshop 1994, 10, 359–370. [Google Scholar]
- 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]
- 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]
- 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]
- 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]
- Chang, E.C. Returns to speculators and the theory of normal backwardation. J. Financ. 1985, 40, 193–208. [Google Scholar] [CrossRef]
- Hartzmark, M.L. Returns to individual traders of futures: Aggregate results. J. Polit. Econ. 1987, 95, 1292–1306. [Google Scholar] [CrossRef]
- Hartzmark, M.L. Luck versus forecast ability: Determinants of trader performance in futures markets. J. Bus. 1991, 64, 49–74. [Google Scholar] [CrossRef]
- 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]
- 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]
- Bellman, R.; Kalaba, R. On adaptive control processes. IRE Trans. Autom. Control 1959, 4, 1–9. [Google Scholar] [CrossRef]
- 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]
- 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]
- 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]
- 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]
- 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]
- 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]
- 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]
- Müller, M. Dynamic time warping. In Information Retrieval for Music and Motion; Springer: Berlin/Heidelberg, Germany, 2007; pp. 69–84. [Google Scholar]
- 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]
- Salvador, S.; Chan, P. Toward accurate dynamic time warping in linear time and space. Intell. Data Anal. 2007, 11, 561–580. [Google Scholar] [CrossRef]
- 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]
- 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]
- 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]
- 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]
- 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]
© 2018 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).