Mannila, ; R. Agrawal, C. Faloutsos, A. Swami, Time series data in financial markets have unique Fu, F. Chung, R. Luk, C. Ng, In stock price time series data, investors in equity markets show various They can be categorized as investors who adopt fundamental analysis and Fundamental analysts make investment On the other hand, assuming that Accordingly, technical analysts use pattern analysis methods to analyze stock price charts for Many studies on technical analysis for pattern matching have This pattern analysis is a method of Chen, F.
Chen, An algorithm for efficient pattern recognition of the time series data is needed to build a trading The Euclidean distance method or artificial intelligence Dong, Zhou, Hu et al. De Oliveira, Nobre, and Zarate, also proposed a The system development includes forecasting the FX Bagheri et al. Patel et al. There are also studies showing the efficiency of dynamic time Kahveci, A. Singh, and A. Gurel, The proposed method based on the Berndt and Clifford, These studies have focused on optimization and efficiency in pattern However, there is a limit to a study on system trading at the optimal trading time point This trading strategy requires Senin, Among The purpose of this research is to construct a pattern matching trading system PMTS that For this goal, we propose an algorithm As the experiment progresses, we Our experimental results show stable and effective trading entry and exit strategies with relatively Investor communities that have sustained financial markets are able to In this sense, the system developed in this The rest of this paper is organized as follows.
Section 2 introduces the concept of futures In Section 3, the topics include the standardization of extracted raw daily index futures data, the Section 3. Section 4 interprets the results The futures market is a market for futures trading, which is one of many derivatives. The value In other words, it changes when the value of the underlying assets Prior to the establishment of futures markets, forward contracts have been traded to avoid When one does not need to have the underlying Due to the credit risk The futures market was originally designed to help market participants avoid exposure to the In recent years, the role of risk hedging by futures contracts has become Investors Accordingly, investors in index futures can realize In other words, they should They are not able to realize efficient yields Indeed, quantitative and systematized trading strategies which use existing futures It is An investor in a futures market is classified as a hedger who avoids risk and a speculator who The hedger The It includes the initial margin, maintenance margin, and additional margin.
Additional margin should be paid if the margin level is lower than the maintenance The additional margin payment is notified by brokerage If the margin call is triggered and the additional margin is not The dynamic time warping DTW algorithm is known as an efficient method to measure the Intuitively, the sequences are warped in a The DTW minimizes distortion effects due to time-dependent Even if there is a deformation relationship between two Keogh and Pazzani, Various modifications of the algorithm have been proposed to speed up DTW computations It is more efficient to use the local The concept of the cost function or the distance The algorithm provides a way to optimize the alignment and to minimize cost functions or the It is called the local cost matrix for the alignment of two After generating this matrix, the algorithm uses a warping function that defines This The boundary condition is the first and last values of The monotonicity condition is sequence of points on the The step size condition limits the long jumping warping path in The cost function used to calculate the local cost matrix of all the bidirectional By 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 Figure 2 shows an experimental procedure diagram of the pattern matching trading The first phase of the procedure is to collect the daily index futures data and to preprocess In the second phase, the fixed time series patterns and the The third phase is to improve the performance with The collected index futures time series data are All extracted daily index futures The processed data is divided into two groups: the pattern recognition group that consists of If there is We construct two sets of fixed patterns using two different time divisions.
The time from The 27 fixed In addition, the time from am to The figure below The daily market data between am and pm from to are assigned to At this step, the fixed For each selected pattern of Once a pattern from am to pm is selected for market data on one day The margin of the futures trading is settled at pm when the volatility and liquidity Therefore, it is a critical time to enter a position.
For intraday trades, the clearing time can As shown in this figure, we first set the sample period using a sliding window method and Then, using the DTW algorithm with various This process is repeated for all windows for the As a last step, we analyze the trading profit and determine the optimal The sliding window method has been used for simulation of time series data Hwarng, ; Jang et al. Table 1 shows a set of 54 windows with an 18 For example, Window1 is composed of the 18 Sliding 3 months from Window1, Window2 is set with a training period of The sliding is continued until the entire sample period is included 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 Our experiment uses a total of 7 clearing times at minute intervals Korea Exchange and in charge of financial IT. The raw data consists of daily, hourly, and minutely If there is no When the trading volume is significantly The raw data is normalized The market data from am to pm is used for pattern recognition by the The simulation is performed with various combinations of training and testing The entire sample period of months from January to December provides a Table 2 shows the number of windows produced by a Table 2.
Number of windows produced by the training and testing period between and A self-developed program was used for the analysis in Phase 2 with daily minute time series For pattern matching of daily market data by the dynamic time warping algorithm, two sets of The daily market data between For market data included in the training Then, the trading position is determined by the rule explained in Phase 2 in Section 2.
We conduct the trading simulation with various parameters. Figure 7 shows the PMTS user The PMTS is operated using the two input files and six parameters. The two input files consist The six input parameters used in our experiment are The training period for pattern matching: 3, 6, 9, 12, 18, 24, 36, 48, and 60 months are used. Filtering criteria: a value to exclude patterns if the frequency of a pattern assigned to daily Stop-loss ratio: the rate of loss for the clearing position when the price moves against the Table 3 shows the frequency of 13 representative patterns selected in each window with For example, testing is performed with patterns of rp-1, 2, 9, 10 and 13 in Window1 when the Table 4.
Up or down position determined and the frequency of up and down for Window1 with However, as In the case of where M is determined, no position is taken for testing. Table 5. The PMTS is conducted as follows. We first calculated the annual return of the market data Given As a last step, we compared the annual returns clearing at every 10 minutes Various ranges of results are generated depending on the parameters used. With the results of The stop loss and slippage cost were fixed at 0.
To find the optimal parameters, we compare the Sharpe ratio produced by various ranges of Table 6 Table 7 shows the annual return, standard deviation, and Sharpe ratio of the market data clearing at that is assigned to 13 fixed patterns with a 0. Taking the results in Table 6 and Table 7 together, the set of parameters that consists of a 0.
Table 6. Performance achieved from an experiment using 13 patterns with various combinations of Slippage Cost: 0.
Pattern Matching Trading System Based on the Dynamic Time Warping Algorithm
Table 7. We conduct the same experiments using 27 fixed patterns as in the case of using 13 fixed Table 8 shows the annual return, standard deviation, and Sharpe ratio of the market data Table 9 shows the annual return, standard Taking the results in Table 8 and Table 9 together, a set of parameters that consists of Table 8. Performance achieved from an experiment using 27 patterns with various combinations of StDev Table 9. We obtained experimental results from all possible combinations of parameters at every 10 Table 10 and Table 11 report the annual return, standard deviation, and Sharpe ratio of the market data clearing at every 10 minutes from to with the selected Table Performance achieved from an experiment using 13 patterns of clearing at every 10 Annualized return 7.
Performance achieved from an experiment using 27 patterns of clearing at every 10 As shown in Table 6-Table 9, the performance of the market data clearing at is found to be We also compare the performance of the market data in the experiments using 13 and 27 The average values of the annual return, standard deviation, and Sharpe ratio of the The average Sharpe ratio for the experiments using 13 fixed patterns 0.
We also find that the best performance with Sharpe ratio of 0. Table 12 Average of total profit in an experiment using 13 and 27 patterns of clearing at every 10 As shown in Table 12, the average total profit is the highest 9. Figure 8 and Figure 9 show the average returns of the market data that are assigned to each of Most patterns show higher returns at The purpose of this study is to develop a pattern matching trading system using the DTW A number of financial instruments that are traded in financial markets exist, and an enormous Therefore, Investor communities that have sustained financial markets are able A future study can be enriched by the studies presented in this paper.
An interesting extension This study could also be extended by experiments Carmassi, J. The global financial crisis: Causes and cures.
Short-term stock market price trend prediction using a comprehensive deep learning system
Crotty, J. Ghysels, E. The Asian financial crisis: The role of derivative securities trading and foreign Journal of international Money and Finance , 24 4 , Dynamic time warping-based imputation for univariate time Kwon, D. Keogh, E. Scaling up dynamic time warping to massive datasets. In European Conference Springer, Berlin, Heidelberg, , Aug; Senin, P. Dynamic time warping algorithm review. Information and Computer Science Department Agrawal, R. Efficient similarity search in sequence databases.
In International Das, G. Finding similar time series. In European Symposium on Principles Fu, T. Stock time series pattern matching: Template-based vs. Engineering Applications of Artificial Intelligence , 20 3 , Bagheri, A. Expert Systems with Applications , 41 14 , Patel, J. Predicting stock and stock price index movement using trend Expert Systems with Applications , Deboeck, G. Trading on the edge: neural, genetic, and fuzzy systems for chaotic financial markets.
John Leigh, W. A computational implementation of stock charting: abrupt Decision Support. Stock market trading rule discovery using technical Forecasting the NYSE composite index with technical analysis, Lo, A. Foundations of technical analysis: Computational algorithms, The journal of finance , 55 4 , Chen, T.
An intelligent pattern recognition model for supporting investment decisions in Chung, F. An evolutionary approach to pattern-based time series IEEE transactions on evolutionary computation , 8 5 , Dong, M. Exploring the fuzzy nature of technical patterns of US stock market. Proceedings of. Kim, S. A two-phase stock trading system using distributional differences. Hu, Y.
Stock trading rule discovery with an evolutionary Expert Systems with Applications , 42 1 , Applying Artificial Neural Networks to prediction of stock Lee, S. Using rough set to support investment strategies of real-time Applied Intelligence , 32 3 , How many reference patterns can improve profitability for real-time Expert Systems with Applications , 39 8 , Berndt, D.
Using dynamic time warping to find patterns in time series.
OATD: Coelho, Mariana Sátiro - Patterns in financial markets: Dynamic time warping
In KDD workshop, Bellman, R. On adaptive control processes. Myers, C. Performance tradeoffs in dynamic time warping algorithms for Sakoe, H. Dynamic programming algorithm optimization for spoken word recognition.
Kuzmanic, A. The International Conference on" Computer Corradini, A. Izakian, H. Fuzzy clustering of time series data using dynamic time warping distance. Engineering Applications of Artificial Intelligence , 39 , — Kamdar, T. On creating adaptive Web servers using Weblog Mining.

Lafuente-Rego, B. Robust fuzzy clustering based on quantile autocovariances. Statistical Papers. Lai, R. Evolving and clustering fuzzy decision tree for financial time series data forecasting. Expert Systems with Applications , 36 2 , — Liu, Q. Overnight returns of stock indexes: Evidence from ETFs and futures. Maharaj, E. Time series clustering and classification. Wavelet-based fuzzy clustering of time series. Journal of Classification , 27 2 , — McBratney, A. Application of fuzzy sets to climatic classification. Agricultural and Forest Meteorology , 35 1—4 , — Menardi, G.
Double clustering for rating mutual funds. Electronic Journal of Applied Statistical Analysis , 8 1 , 44— Nair, B. Clustering stock price time series data to generate stock trading recommendations: An empirical study. Expert Systems with Applications , 70 , 20— Nakagawa, K. Stock price prediction using k-medoids clustering with indexing dynamic time warping.
Electronics and Communications in Japan , , 3—8. Okeke, F. Linear mixture model approach for selecting fuzzy exponent value in fuzzy c-means algorithm. Ecological Informatics , 1 1 , — Pattarin, F. Clustering financial time series: An application to mutual funds style analysis. Piccardi, C. Clustering financial time series by network community analysis.
International Journal of Modern Physics C , 22 01 , 35— Rahmanishamsi, J. A copula based ICA algorithm and its application to time series clustering. Journal of Classification , 35 2 , — Ratanamahatana, C. Everything you know about dynamic time warping is wrong. In Third workshop on mining temporal and sequential data. Rechenthin, M. Stock chatter: Using stock sentiment to predict price direction.
Algorithmic Finance , 2 3—4 , — Velichko, V. Automatic recognition of words. International Journal of Man-Machine Studies , 2 3 , — Vilar, J. Quantile autocovariances: A powerful tool for hard and soft partitional clustering of time series. Fuzzy Sets and Systems , , 38— Classifying time series data: A nonparametric approach. Journal of classification , 26 1 , 3— Wedel, M. A fuzzy clusterwise regression approach to benefit segmentation. International Journal of Research in Marketing , 6 4 , — Xie, X. A validity measure for fuzzy clustering.
Yang, C. Clustering of financial instruments using jump tail dependence coefficient. Download references. The authors thank Editor-in-Chief, and the referees for their useful comments and suggestions which helped to improve the quality and presentation of this manuscript. You can also search for this author in PubMed Google Scholar. Correspondence to Riccardo Massari.
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. Reprints and Permissions.
Explanation and Code Implementation
Trimmed fuzzy clustering of financial time series based on dynamic time warping. Ann Oper Res Download citation. Published : 18 July Search SpringerLink Search. Abstract In finance, cluster analysis is a tool particularly useful for classifying stock market multivariate time series data related to daily returns, volatility daily stocks returns, commodity prices, volume trading, index, enhanced index tracking portfolio, and so on.