Technical Indicators For Forex Forecasting
Technical Indicators For Forex Forecasting
Technical Indicators For Forex Forecasting
A Preliminary Study
Abstract. Traders and economists are often at odds with regards to the ap-
proach taken towards Forex financial market forecasting. Methods originating
from the Artificial Intelligence (AI) area of study have been used extensively
throughout the years in predicting the trading pattern as it is deemed to be ro-
bust enough to handle the uncertainty associated with Forex trading time series
data. Herein this paper, the effects of different input types, in particular: close
price as well as various technical indicators derived from the close price are in-
vestigated to determine its effects on the Forex trend predicted by an intelligent
machine learning module.
1 Introduction
Financial markets encompasses a huge variety of markets such as: Stock Markets,
Commodity Markets, Money Markets, Derivatives Markets, Futures Markets, Insur-
ance Markets, and Foreign Exchange Markets (Forex). However, most traders gravitate
towards the Stock Market and Foreign Exchange. With an average daily trading value
of 3.2 trillion [1], it is a fast paced and dynamic market where traders often watch
every little movement like a hawk. With the advancement of research in the application
of Artificial Intelligence in computational finance, it has been slowly been adopted in
to assist traders in making informed decisions while trading. Numerous publications
have attempted to construct an accurate model for Forex time series prediction. Most
of these works focus on time series prediction with various AI models, or some hybrid
combinations as well as statistical techniques, such as moving average. While the
introduction of AI models in Forex prediction have increased dramatically as it has
been adopted by the traders, these methods inevitably have their own limitations at
different stages of its prediction pipeline. Herein, the investigation focuses on finding
the most efficient input parameter to produce a more accurate prediction of the Forex
time series data from an intelligent machine learning module such as implemented by
Tiong, Ngo and Lee [14], [15] which will be further discussed in Section 3.
2 Forex Trading
2.1 Background
Market analysis has been extremely
e crucial in the attempt to forecast the future trrad-
ing patterns to prevent losss and generate profit. However, Forex forecasting is noot a
straight forward and easy taskt to accomplish as it is constantly affected by variious
external factors such as: poolitical stability, economic events, terms of trade, econom mic
performance and etc. All the aforementioned factors contribute to establishing the
complex and volatile naturee of Forex prediction and the challenge presented has m made
it one of the hottest topics in research community. There are currently 5 major schoools
of thoughts which contribu ute to different analysis method applied to the Forex tiime
series data, namely: Random Walk Analysis, Efficient Market Hypothesis, Technnical
Analysis, Fundamental Anaalysis, and Sentiment Analysis as shown in Fig 1.
The Random Walk Anaalysis was popularized by the Burton Malkiel in his boook,
“A Random Walk Down Wall W Street” [2]. The theory works under the premises tthat
the Forex price is defined by b the random walk theory whereby the fluctuation of ex-
change price is random and d unpredictable given prior values. It was the same founnda-
tion on which Eugene Famaa build his theory of Efficient Market Hypothesis [3] whhich
takes a slightly different appproach states that the effect of all the known informattion
are already reflected on the price of the stocks/currency. On the contrary, technnical
analyst / chartist believe thaat the analysis of historical Forex data reveals a pattern tthat
is constantly repeating itself which can be beneficial for forecasting [4]–[6]. Funnda-
mental Analysis and Sentiment Analysis endeavors to explain the fluctuating prrice
from the angle of cause and d effect. While Fundamental Analysis views the fluctuattion
of currency price with relaation to the supply and demand of the currency due too its
popularity, social, economic and political factors; Sentiment Analysis concentratess on
the trader’s own gut feeling g or personal opinion of how the market would perform.
Technical Indicators for Forex Forecasting 89
There are currently two different approaches in performing technical analysis for
the Forex time series data, namely: soft computing and hard computing. Hard compu-
ting refers to the more traditional approach to computing which often require the ana-
lytical model to be precisely stated and extensive computation time. Soft computing
on the other hand, offers the flexibility of dealing with uncertainty and imprecisions.
Mochón, Quintana, Sáez and Isasi [7] gave a good overview on the use of soft compu-
ting techniques applied in the finance world. Along with the research conducted in the
recent years [8], [9], soft computing techniques such as machine learning, neural net-
work, evolutionary computing, and support vector machines have been gaining pop-
ularity within the Forex market research community compared to hard computing
techniques such as: MARS and CART as mentioned by Abraham [10].
Referring to Equation (1) and (2), it can be observed that traders would often use
the most familiar moving average such as SMA 10, 30, 50, 100 and 200. What makes
the aforesaid value of SMA so special? As it happens, the reason the makes it a good
practice to pay attention to the movements of the SMA values mentioned as most
traders react to these SMAs. The more traders anticipating movements and bounce of
a particular SMA, it affects the trading pattern and the anticipated movement would
likely happen.
∑
, (1)
where m denotes the time period window defined, n is the nth data of the exchange
price and Pi is the applied price (closing price).
, (2)
1 (3)
where Pi denotes the current exchange price, n is the nth data of the exchange price and
EMAn is the EMA value of the nth price index. α is the decay factor which can be calcu-
lated as: 2/(m+1) whereby m is the time period window defined.
12 26 (4)
9 (5)
3 Proposed Research
3.1 Algorithm
Utilizing the algorithm previously proposed by Tiong, Ngo and Lee [14], [15], the
effects of different input data on the prediction results generated are investigated. The
proposed prediction algorithm focuses on prediction of two of the main Forex trend
observed by traders; uptrend and downtrend as depicted in Fig 2. Going back to the
basis of technical analysis adhered to by most of the analyst, the trend patterns are
predicted to reoccur and the prediction of trend development is carried out throughout
2 main stages: Data Analysis Stage as well as the Training and Learning Stage.
(a) (b)
In order to obtain the clustering results, the input data provided will have to go
through the process of feature selection, pattern analysis and segmentation as shown
in Fig 3. As the input data used is essentially a streaming input of Forex time series
data, it needs to be pre-processed and analyzed in detail. The raw Forex time series
data are segmented with the aid of Linear regression Line (LRL) prior to feature
extraction. The features that have been selected to represent the pattern trends for
clustering are as listed in Table 1. Further illustration of the feature point (A - E)
noted in Table 1 with reference to its precise location in the graph is depicted in Fig 4.
With the features selected, Linear Regression Line (LRL) will be employed to identi-
fy the trend of the input data. After the segmentation has been performed on the data,
K-means clustering is used to cluster the data.
FEATURE 2 Distance between first turning point and changing point B–C
FEATURE 5 Distance between second turning point and ending point D–E
AI algorithms have always played a crucial role with the research focusing on
the prediction of financial market. In depth studies have been conducted into the im-
plementation of Artificial Neural Network in forecasting the Forex market trend
[16]–[20]. As previous research proved to produce reasonable results, ANN has been
implemented to train and learn data and DTW to predict data with the algorithm as
shown in Fig 5. More specifically, the Multilayer Perceptron Neural Network has been
utilized in the training and learning the patterns obtained from the previous stage.
3.2 Dataset
In order to investigate the effects of the different input data on the prediction model,
different data inputs were tested on the system. The dataset used are the historical
data downloaded from HistData website [21] for EUR/USD and AUD/USD. The
time period chosen for testing purposes are from: 2 Jan 2012 to 29 June 2012. As the
downloaded dataset is in minutes, it is pre-processed to have the time interval of 30
minutes. The original research involves using the raw close price as input. Herein,
the performance is compared against the input of SMA10, SMA30, SMA50,
SMA100, EMA10, EMA30, EMA50 and EMA100. The full description of the data
used for testing are summarized as shown in Table 2. The full dataset are the segre-
gated in the ratio of 7:3 where 70% of the data are used for training and 30% are
used for testing.
Technical Indicators for Forex Forecasting 93
Currency dataset EUR/USD and AUD/USD data (Date/Time, open, high low and close)
4 Results
The Forex trend predicted by the DTW algorithm as previously discussed in Section
3.1 provides us with a new time series to be compared against the original segmented
Forex time series data. Table 3 clearly shows an example of comparison between the
two different time series for 5 segments. The data exhibited in Table 3 is derived from
AUD/USD original time series data where the actual/original data (indicated by the
dashed line) can be seen to be compared against the partial (indicated by the solid
line) and predicted data (indicated by the dotted line). As the results obtained are in
the form of time series data, the Mean Absolute Error (MAE) measurement have been
chosen in the analyses of the prediction results obtained. Table 4 below denotes the
MAE results gathered for both the AUD/USD and EUR/USD currency. It can be ob-
served that using the close price alone produces results with the highest MAE com-
pared to SMA10, SMA30, SMA 50, SMA100, EMA10, EMA30, EMA50 and
EMA100.
Segment 1
94 Y.L. Yong et al.
Table 3. (Continued)
Segment 2
Segment 3
Segment 4
Technical Indicators for Forex Forecasting 95
Table 3. (Continued)
Segment 5
Comparing both the moving averages, it can be observed that while the faster mov-
ing average allows for faster response to the Forex price fluctuation, it is ultimately
the slower moving average which encapsulates more data and normalizes noises more
effectively and produces a smaller MAE result up to a certain extend. This is due to
the fact that the data are more intensively normalized with the slow moving average
and therefore affects the prediction result as can be seen from Table 3.
Table 4. MAE Result for Currency AUD/USD and EUR/USD
Dataset
Currency Close
SMA 10 SMA 30 SMA 50 SMA 100 EMA 10 EMA 30 EMA 50 EMA 100
Price
AUD/USD 0.1073 0.0484 0.0336 0.0217 0.0367 0.0538 0.0360 0.0360 0.0363
EUR/USD 0.0953 0.0617 0.0390 0.0337 0.0295 0.0603 0.0341 0.0413 0.0361
5 Conclusion
In conclusion, the type of input data used for Forex price forecasting is a crucial com-
ponent which cannot be taken lightly. Our experiments have proven that technical
indicators as implemented by most technical analyst can and should be incorporated
more in the research of Forex price forecasting. This signifies that by incorporating
more of the trading rules and fundamental technical analysis as performed by the tech-
nical analyst in the initial stage of the forecasting algorithm will contribute in increas-
ing the accuracy of the Forex price prediction. Further research looking into the fusion
of different technical indicators is also a possibility that could be carried out.
References
1. Dunis, C.L., Laws, J., Schilling, U.: Currency trading in volatile markets: Did neural
networks outperform for the EUR/USD during the financial crisis 2007–2009? J. Deriv.
Hedge Funds. 18(1), 2–41 (2012)
2. Malkiel, B.: A Random Walk Down Wall Street. W.W. Norton & Company Inc., New York
(1973)
3. Fama, E.F.: Efficient Capital Markets: A Review of Theory and Empirical Work. J.
Finance. 25(2), 383–417 (1970)
4. Abdullah, M.H.L.B., Ganapathy, V.: Neural network ensemble for financial trend
prediction. In: TENCON 2000, pp. 157–161 (2000)
5. Schulmeister, S.: Components of the Profitability of Technical Currency Trading. Appl.
Financ. Econ. 18(11), 917–930 (2008)
6. Neely, C.J., Weller, P.A.: Technical Analysis in the Foreign Exchange Market. Federal
Reserve Bank of St. Louis Working Paper Series 2011-001 (2011)
7. Mochón, A., Quintana, D., Sáez, Y., Isasi, P.: Soft Computing Techniques Applied to
Finance. Appl. Intell. 29(2), 111–115 (2008)
8. Vanstone, B., Tan, C.: A Survey of the Application of Soft Computing to Investment and
Financial Trading. Inf. Technol. Pap. 13 (2003)
9. De Brito, R.F.B., Oliveira, A.L.I.: Sliding window-based analysis of multiple foreign
exchange trading systems by using soft computing techniques. In: IEEE International Joint
Conference on Neural Networks (IJCNN), pp. 4251–4258 (2014)
10. Abraham, A.: Analysis of hybrid soft and hard computing techniques for forex monitoring
systems. In: Proceedings of the 2002 IEEE International Conference on Fuzzy Systems,
pp. 1616–1622 (2002)
11. Canelas, A., Neves, R., Horta, N.: A new SAX-GA methodology applied to investment
strategies optimization. In: Proceedings of The Fourteenth International Conference on
Genetic And Evolutionary Computation Conference, pp. 1055–1062 (2012)
12. Canelas, A., Neves, R., Horta, N.: A SAX-GA Approach to Evolve Investment Strategies
on Financial Markets Based on Pattern Discovery Techniques. Expert Syst. Appl. 40(5),
1579–1590 (2013)
13. Canelas, A., Neves, R., Horta, N.: Multi-dimensional pattern discovery in financial time
series using SAX-GA With extended robustness. In: Proceeding of The Fifteenth Annual
Conference Companion on Genetic and Evolutionary Computation Conference Compa-
nion, pp. 179–180 (2013)
Technical Indicators for Forex Forecasting 97
14. Tiong, L.C.O., Ngo, D.C.L. Ngo, Lee, Y.: Forex trading prediction using linear regression
line, artificial neural network and dynamic time warping algorithms. In: Proc. Fourth Int.
Conf. Comput. Informatics, pp. 71–77 (2013)
15. Tiong, L.C.O., Ngo, D.C.L. Ngo, Lee, Y.: Forex prediction using support vector machine
and dynamic time warping. In: Proceeding of Thirteenth International Conference on
Electronics, Information and Communications (ICEIC), pp. 141–142 (2014)
16. Choi, J.H., Lee, M.K., Rhee, M.W.: Trading S&P 500 stock index futures using a neural
network. In: Proceedings of the Third Annual International Conference on Artificial
Intelligence Applications on Wall Street, pp. 63–72 (1995)
17. Quah, T.S., Srinivasan, B.: Improving Returns on Stock Investment Through Neural
Network Selection. Expert Syst. Appl. 17(4), 295–301 (1999)
18. Yao, J., Tan, C.L.: A Case Study on using Neural Networks to Perform Technical
Forecasting of Forex. Neurocomputing 34(1), 79–98 (2000)
19. Emam, A.: Optimal Artificial Neural Network Topology for Foreign Exchange Forecast-
ing. In: Proceedings of the 46th Annual Southeast Regional Conference on XX, pp. 63–68
(2008)
20. Sher, G.I.: Forex trading using geometry sensitive neural networks. In: Proceedings of The
Fourteenth International Conference on Genetic and Evolutionary Computation
Conference Companion, pp. 1533–1534 (2012)
21. HistData.com. http://www.histdata.com/download-free-forex-data