Journal of Intelligence and Information Systems (지능정보연구)
- Volume 25 Issue 1
- /
- Pages.63-83
- /
- 2019
- /
- 2288-4866(pISSN)
- /
- 2288-4882(eISSN)
DOI QR Code
Development of a Stock Trading System Using M & W Wave Patterns and Genetic Algorithms
M&W 파동 패턴과 유전자 알고리즘을 이용한 주식 매매 시스템 개발
- Yang, Hoonseok (Graduate School of Business IT, Kookmin University) ;
- Kim, Sunwoong (Graduate School of Business IT, Kookmin University) ;
- Choi, Heung Sik (Graduate School of Business IT, Kookmin University)
- Received : 2018.11.13
- Accepted : 2019.03.07
- Published : 2019.03.31
Abstract
Investors prefer to look for trading points based on the graph shown in the chart rather than complex analysis, such as corporate intrinsic value analysis and technical auxiliary index analysis. However, the pattern analysis technique is difficult and computerized less than the needs of users. In recent years, there have been many cases of studying stock price patterns using various machine learning techniques including neural networks in the field of artificial intelligence(AI). In particular, the development of IT technology has made it easier to analyze a huge number of chart data to find patterns that can predict stock prices. Although short-term forecasting power of prices has increased in terms of performance so far, long-term forecasting power is limited and is used in short-term trading rather than long-term investment. Other studies have focused on mechanically and accurately identifying patterns that were not recognized by past technology, but it can be vulnerable in practical areas because it is a separate matter whether the patterns found are suitable for trading. When they find a meaningful pattern, they find a point that matches the pattern. They then measure their performance after n days, assuming that they have bought at that point in time. Since this approach is to calculate virtual revenues, there can be many disparities with reality. The existing research method tries to find a pattern with stock price prediction power, but this study proposes to define the patterns first and to trade when the pattern with high success probability appears. The M & W wave pattern published by Merrill(1980) is simple because we can distinguish it by five turning points. Despite the report that some patterns have price predictability, there were no performance reports used in the actual market. The simplicity of a pattern consisting of five turning points has the advantage of reducing the cost of increasing pattern recognition accuracy. In this study, 16 patterns of up conversion and 16 patterns of down conversion are reclassified into ten groups so that they can be easily implemented by the system. Only one pattern with high success rate per group is selected for trading. Patterns that had a high probability of success in the past are likely to succeed in the future. So we trade when such a pattern occurs. It is a real situation because it is measured assuming that both the buy and sell have been executed. We tested three ways to calculate the turning point. The first method, the minimum change rate zig-zag method, removes price movements below a certain percentage and calculates the vertex. In the second method, high-low line zig-zag, the high price that meets the n-day high price line is calculated at the peak price, and the low price that meets the n-day low price line is calculated at the valley price. In the third method, the swing wave method, the high price in the center higher than n high prices on the left and right is calculated as the peak price. If the central low price is lower than the n low price on the left and right, it is calculated as valley price. The swing wave method was superior to the other methods in the test results. It is interpreted that the transaction after checking the completion of the pattern is more effective than the transaction in the unfinished state of the pattern. Genetic algorithms(GA) were the most suitable solution, although it was virtually impossible to find patterns with high success rates because the number of cases was too large in this simulation. We also performed the simulation using the Walk-forward Analysis(WFA) method, which tests the test section and the application section separately. So we were able to respond appropriately to market changes. In this study, we optimize the stock portfolio because there is a risk of over-optimized if we implement the variable optimality for each individual stock. Therefore, we selected the number of constituent stocks as 20 to increase the effect of diversified investment while avoiding optimization. We tested the KOSPI market by dividing it into six categories. In the results, the portfolio of small cap stock was the most successful and the high vol stock portfolio was the second best. This shows that patterns need to have some price volatility in order for patterns to be shaped, but volatility is not the best.
투자자들은 기업의 내재가치 분석, 기술적 보조지표 분석 등 복잡한 분석보다 차트(chart)에 나타난 그래프(graph)의 모양으로 매매 시점을 찾는 직관적인 방법을 더 선호하는 편이다. 하지만 패턴(pattern) 분석 기법은 IT 구현의 난이도 때문에 사용자들의 요구에 비해 전산화가 덜 된 분야로 여겨진다. 최근에는 인공지능(artificial intelligence, AI) 분야에서 신경망을 비롯한 다양한 기계학습(machine learning) 기법을 사용하여 주가의 패턴을 연구하는 사례가 많아졌다. 특히 IT 기술의 발전으로 방대한 차트 데이터를 분석하여 주가 예측력이 높은 패턴을 발굴하는 것이 예전보다 쉬워졌다. 지금까지의 성과로 볼 때 가격의 단기 예측력은 높아졌지만, 장기 예측력은 한계가 있어서 장기 투자보다 단타 매매에서 활용되는 수준이다. 이외에 과거 기술력으로 인식하지 못했던 패턴을 기계적으로 정확하게 찾아내는 데 초점을 맞춘 연구도 있지만 찾아진 패턴이 매매에 적합한지 아닌지는 별개의 문제이기 때문에 실용적인 부분에서 취약할 수 있다. 본 연구는 주가 예측력이 있는 패턴을 찾으려는 기존 연구 방법과 달리 패턴들을 먼저 정의해 놓고 확률기반으로 선택해서 매매하는 방법을 제안한다. 5개의 전환점으로 정의한 Merrill(1980)의 M&W 파동 패턴은 32가지의 패턴으로 시장 국면 대부분을 설명할 수 있다. 전환점만으로 패턴을 분류하기 때문에 패턴 인식의 정확도를 높이기 위해 드는 비용을 줄일 수 있다. 32개 패턴으로 만들 수 있는 조합의 수는 전수 테스트가 불가능한 수준이다. 그래서 최적화 문제와 관련한 연구들에서 가장 많이 사용되고 있는 인공지능 알고리즘(algorithm) 중 하나인 유전자 알고리즘(genetic algorithm, GA)을 이용하였다. 그리고 미래의 주가가 과거를 반영한다 해도 같게 움직이지 않기 때문에 전진 분석(walk-forward analysis, WFA)방법을 적용하여 과최적화(overfitting)의 실수를 줄이도록 하였다. 20종목씩 6개의 포트폴리오(portfolio)를 구성하여 테스트해 본 결과에 따르면 패턴 매매에서 가격 변동성이 어느 정도 수반되어야 하며 패턴이 진행 중일 때보다 패턴이 완성된 후에 진입, 청산하는 것이 효과적임을 확인하였다.
Keywords