Dynamic Time Warping in Financial Data – Modification of Algorithm in Context of Stock Market Similarity Analysis
Purpose: The purpose of this paper is to use Dynamic Time Warping algorithm along with two statistical tests, Fourier transform and Random permutation, to analyze the similarity of company charts based on stock market data. Design/methodology/approach: The analyzed data from the Warsaw Stock Exchange will detect the similarity between different companies at different and the same time, and between different times for the same company. The research has been carried out based on data from the Warsaw Stock Exchange for selected companies on which DTW analysis has been performed, using AAiFT (Fourier transformations) and RP (Random permutations). Findings: Obtained results indicate that it is possible to detect high similarity between charts by DTW and verify this similarity using statistical tests. Boundary conditions were indicated for the analyses performed and various analysis cases were investigated. Practical Implications: Conducted research reveals the relevance of the use of DTW in a financial context and the possibility of further development as a tool to support investing. Originality/Value: Previous analyses using the DTW method have not included the use of statistical tests in the analysis of the resulting similarity. The use of such a solution is of particular importance in stock market data, allowing the analysis and detection of similarity, along with the determination of the probability of its occurrence.