Detection of Repetitive Forex Chart Patterns
Detection of Repetitive Forex Chart Patterns
Abstract. Throughout the years, numerous methods have been proposed for
FOREX trading analysis and forecasting. As analysts/traders prefer to work with
historical trading data, technical analysis based methods are often used. This
paper presents an in-depth examination of technical analysis methods with an
emphasis on charting/pattern-based analysis. Our ndings indicate how to
overcome the subjectivity often associated with identication and extraction of
patterns within FOREX historical data. Based on historical facts that FOREX
chart patterns repeat over time, the proposed method improves the approach
towards identication of chart patterns as well as prediction of their recurrence
regardless of the time warping effect affecting their formation.
1 Introduction
The continuous evolution of the nance market has contributed to its increasingly
complex nature with a myriad of nancial investment opportunities offered to the traders.
However, the FOREX market has proven to be traders preferred choice with an average
volume surpassing the trillion dollar mark [1, 2]. It is precisely due to the dynamic and
volatile nature of the market and the emphasis on protability that necessitates quick
analysis and forecasting of the price fluctuation. Therefore, extensive work has been
done to dissect the FOREX data with the expectation to unearth underlying relations that
could be used for forecasting market trends and making trading decisions. Numerous
methods of technical analysis, as well as econometrics and computational nance, have
been conceptualised and incorporated into the market over the years.
While the advancement in FOREX market research provides additional insight to
the traders, analysts are often faced with the element of subjectivity as heuristics and
trading rules remains an important part of analysis. Following the three fundamental
precepts introduced in technical analysis, the proposed method focuses on charting
based methods and attempts to reduce the subjectivity in identifying the repeating chart
pattern within the FOREX trading data. This can be achieved by simplifying the
predened chart patterns used for recognition. Subsequent sections will delve into more
details on the intricacies of the Forex market in conjunction with the analysis methods
used at present.
2 FOREX Analysis
2.1 Technical Analysis
Analysis of FOREX data is often an overwhelming task driven by various external
factors and constraints such as information availability, selection of currency exchange
pair and the frequency of the data (time interval) are often dependent on the traders
knowledge and prior experience. Although its effectiveness and predictive power are
often viewed with scepticism, technical analysis has always been an important trading
technique used by 90% of the market participants [3, 4] with researchers such as Hsu
et al. [5] obtaining positive results from the studies conducted. Based heavily upon the
notion that FOREX price move in trends and that history often repeats itself [3, 4, 6],
technical analysis encompasses two main approaches, namely charting and mechanical
rules. Technical analysis methods have also been used in conjunction with Articial
Intelligence (AI) methods such as Articial Neural Network (ANN) [7, 8] and Genetic
Algorithm [9] for forecasting.
Mechanical analysis revolves around the use of trading rules which are derived
from mathematical functions by using past and present exchange rate to provide a
mathematical justication and theoretical background. There are currently six
(6) well-known groups of indicators, viz: trend, momentum, volume, volatility, cycle
and Bill Williams indicator [10, 11]. On the other hand, charting based technical
analysis revolves around the interpretation of predened patterns, which develops over
time. Potential repeatability of FOREX trends and patterns contributes to the devel-
opment of a set of predened chart patterns, which are extensively documented in the
Encyclopedia of Chart Patterns [12] and are religiously followed by chartist to analyse
and forecast market fluctuations.
3 Proposed Research
3.1 Detection of Underlying Trend
The emphasis of the proposed study is to identify and extract underlying FOREX
trends and chart patterns that are simple enough to provide adequate features for
classication. The proposed method was built on few technical analysis algorithms to
offer the benets of analysed data. Methods such as Linear Regression (LR) and
Piecewise Linear Regression (PLR) could potentially be used to identify the relation-
ship between fluctuating currency price over time. However, PLR implementation such
as proposed by [16, 17] offers a more flexible analysis whereby multiple breakpoints
are used for representing the dynamic nature of the nancial data as indicated in Fig. 1
(left) below. The PLR lines detected will determine how the data is segmented. As a
single pass using PLR on the dataset might not result in an optimal detection and
extraction of trends within the dataset, iterative detection is introduced whereby the
segments identied in the rst iteration is further processed by iterative PLR calculation
process such as shown in Fig. 1 (right) to ensure optimal trend identication.
Pattern Detection
Clustering
and Extraction
calculation process to ensure that the best PLR adaptation to represent the trend pat-
terns are extracted depending on the algorithm selected from four different ones.
Subsequent implementation for the PLR breakpoint detection and segmentation module
as depicted by the pseudocode in Fig. 4 are performed using R statistics software with
the controlling variable being the number of quantiles chosen to represent the initial
breakpoints (denoted as K). The proposed implementation offers four different algo-
rithms implemented with the number of quantiles as listed in Table 2. The stopping
condition follows Table 2 unless the PLR algorithm encounters an error or failed to
converge for ve (5) consecutive K value.
4.3 Results
The Forex trend clustering results obtained from the algorithm previously discussed in
Sect. 4.2 clearly shows that hidden repetitive patterns do exist within the FOREX
historical dataset. Using the pre-processed data as input, clusters of similar patterns are
detected using the extracted trends. As there are four different variations of the algo-
rithm, Table 3 denotes the ndings using each of the variations and Fig. 5 illustrates an
example of the clusters detected.
From the results tabulated, it is clear that the FOREX historical data does not
fluctuate at random and that the assumptions held by technical analyst hold true.
FOREX price does indeed move in trend with the detected chart patterns repeating over
time albeit with slight difference caused by time warping effect. However, the issue can
be resolved easily with the use of DTW method which ensures comparison could be
carried out seamlessly.
5 Conclusion
References
1. King, M.R., Mallo, C.: A users guide to the Triennial Central Bank Survey of foreign
exchange market activity. BIS Q. Rev., 7183 (2010)
2. Bank of International Settlements: Triennial Central Bank Survey - Foreign Exchange
Turnover in April 2013: Preliminary Global Result (2013)
3. Schulmeister, S.: Components of the protability of technical currency trading. Appl.
Financ. Econ. 18(11), 917930 (2008)
4. Neely, C.J., Weller, P.A.: Technical analysis in the foreign exchange market. Federal
Reserve Bank of St. Louis Working Paper Series 2011-001B (2011)
5. Hsu, P.H., Taylor, M.P., Wang, Z.: Technical trading: is it still beating the foreign exchange
market? J. Int. Econ. 102, 188208 (2016)
402 Y.L. Yong et al.
6. Bagheri, A., Peyhani, H.M., Akbari, M.: Financial forecasting using ANFIS networks with
quantum-behaved particle swarm optimization. Expert Syst. Appl. 41(14), 62356250
(2014)
7. Gerlein, E.A., McGinnity, M., Belatreche, A., Coleman, S.: Evaluating machine learning
classication for nancial trading: an empirical approach. Expert Syst. Appl. 54, 193207
(2016)
8. Czekalski, P., Niezabitowski, M., Styblinski, R.: ANN for FOREX forecasting and trading.
In: 20th International Conference on Control Systems and Computer Science (CSCS 2015),
pp. 322328 (2015)
9. Ozturk, M., Toroslu, I.H., Fidan, G.: Heuristic based trading system on Forex data using
technical indicator rules. Appl. Soft Comput. 43, 170186 (2016)
10. Forex indicators: The best guide to indicators world. http://forex-indicators.net/list
11. Gallo, C.: The forex market in practice: a computing approach for automated trading
strategies. Int. J. Econ. Manag. Sci. 3(169), 19 (2014)
12. Bulkowski, T.N.: Encyclopedia of Chart Patterns, 2nd edn. Wiley, New York (2005)
13. Ito, T., Hashimoto, Y.: Intraday seasonality in activities of the foreign exchange markets:
evidence from the electronic broking system. J. Jpn. Int. Econ. 20(4), 637664 (2006)
14. Person, J.L.: A Complete Guide to Technical Trading Tactics: How to Prot Using Pivot
Points, Candlesticks & Other Indicators. Wiley, New York (2004)
15. Talebi, H., Hoang, W., Gavrilova, M.L.: Multi-scale foreign exchange rates ensemble for
classication of trends in forex market. Procedia Comput. Sci. 29, 20652075 (2014)
16. Muggeo, V.M.R.: Estimating regression models with unknown break-points. Stat. Med.
22(19), 30553071 (2003)
17. Wood, S.N.: Minimizing model tting objectives that contain spurious local minima by
bootstrap restarting. Biometrics 57(1), 240244 (2001)
18. HistData. http://www.histdata.com/download-free-forex-data