0% found this document useful (0 votes)
186 views7 pages

Event-Driven LSTM For Forex Price Prediction

The document proposes using an event-driven approach and deep learning models to predict currency price retracement points for foreign exchange trading. It develops LSTM, BiLSTM and GRU models using technical indicators as features to predict a retracement point, aiming to provide an optimal entry point. The best model achieved superior performance compared to previous studies on 15-minute EUR/GBP data.

Uploaded by

岳佳
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
186 views7 pages

Event-Driven LSTM For Forex Price Prediction

The document proposes using an event-driven approach and deep learning models to predict currency price retracement points for foreign exchange trading. It develops LSTM, BiLSTM and GRU models using technical indicators as features to predict a retracement point, aiming to provide an optimal entry point. The best model achieved superior performance compared to previous studies on 15-minute EUR/GBP data.

Uploaded by

岳佳
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Event-Driven LSTM For Forex Price Prediction

Ling Qi Matloob Khushi Josiah Poon


School of Computer Science School of Computer Science School of Computer Science
The University of Sydney The University of Sydney The University of Sydney
Sydney, Australia Sydney, Australia Sydney, Australia
[email protected] [email protected] [email protected]

Abstract— The majority of studies in the field of AI guided financial data. This includes impulse waves that set up a
financial trading focus on purely applying machine learning pattern, and corrective waves that oppose the larger trend. The
algorithms to continuous historical price and technical analysis identification of such waves helps us to discover the correct
data. However, due to non-stationary and high volatile nature of entry and exit trading points which would ultimately generate
Forex market most algorithm fail when put into real practice. the most profit. Fig. 1 is an example of a typical Elliott Wave.
We developed novel event-driven features which indicate a We can see either peak or trough point “e1” and retrace point
change of trend in direction. We then build long deep learning “e3” are the best market entry points and “e4” is the best
models to predict a retracement point providing a perfect entry market exit point.
point to gain maximum profit. We use a simple recurrent neural
network (RNN) as our baseline model and compared with short- The determination of peak or trough points within a certain
term memory (LSTM), bidirectional long short-term memory window requires future price information. We therefore
(BiLSTM) and gated recurrent unit (GRU). Our experiment introduce a moving average crossover event (“e2”), as
results show that the proposed event-driven feature selection confirmation of the form of point “e1” and consider point “e3”
together with the proposed models can form a robust prediction as our prediction target to enter the market. Point “e4” can also
system which supports accurate trading strategies with minimal be another prediction target to exit the market however we will
risk. Our best model on 15-minutes interval data for the not be covering that in this paper. Unlike other research that
EUR/GBP currency achieved RME 0.006x 𝟏𝟏𝟏𝟏−𝟑𝟑 , RMSE uses all historical data, we select data at “e2” and go back “n”
2.407x𝟏𝟏𝟏𝟏−𝟑𝟑 , MAE 1.708x𝟏𝟏𝟏𝟏−𝟑𝟑 , MAPE 0.194% outperforming timesteps as training data, while ignoring any other data which
previous studies. does not suggest a reliable trading opportunity. The selected
Keywords— Deep neural network, LSTM, GRU, Machine-
data is then compressed with more relevant information.
learning techniques, Feature engineering, Financial prediction, We developed a LSTM model to predict price at the
Foreign exchange, Technical analysis retracement point “e3”. Technical indicators are used as
features. We used four pairs of currency for experimentation.
I. INTRODUCTION A simple RNN is used as the baseline model. The result
Forex Trading (FX) is the largest financial market in the confirms the designed architecture is over performing.
world, consisting of multiple international participants
including professionals and individuals who invest and
speculate for profit due to its nature of robust liquidity. An
automated system which could predict correct entry and exit
points will help investors generate considerable profit with
minimum risk. In recent years, machine learning has been
used by many academics to study the exchange rate market.
[1] has provided a summary of research in this field from 2009
to 2015. Fig.1 Example of Elliott Waves
As a type of non-stationary time-series data, financial trading (left is an upper trend, right is a downtrend)
data is highly volatile and complex. Technical analysis can
smooth out noise and help to identify trends and has now
become more popular in trading research. In addition, based
on the "history repeating itself" theory, analysts believe The remainder of this paper is structured as follows: Section
patterns underlying historical data will repeat again in the II discusses the related work. Section III describes details of
future and being able to identify historical price movements is feature and training data selection. Section IV explains model
important for future price trend predictions. Therefore, the use architecture, followed by experiment details in Section V. Our
of historical data and technical indicators are required for
effective examination of trends that occur within desired
trading windows. Literature has shown that a vast majority of
work in this field is through historical data and technical
analysis. This can be seen in [2] where a change of direction
in the FX market was predicted by simply using the closing
price and moving average individually with the moving
average outperforming the closing price. More examples can
be found from [3], [4], [5], [6], [7].
In this paper we will use an alternate method to handle the
noisy and chaotic environment of high frequent trading data.
In 1935, R.N. Elliott introduced “Elliott Wave Theory” [8].
One of its main components is to identify different waves in Fig.2 example of ZigZag
results appear in Section VI and Section VII presents our stock chart images and proved that candlestick charts are the
conclusion. best stock chart images to predict stock prices among bar
charts, line charts and filled-line charts. This study also could
II. RELATED WORK not prevent the lagging issue that occurred in other LSTM
Forecasts on FX trends have become challenging due to stock price predictions. The authors then suggested to add
random fluctuations in price caused by market uncertainties noise-cancelling methods such as autoencoder or wavelet
such as political conditions, regulatory policy changes, transformation or add technical indicators to the image to
economic conditions, banking operations and capital achieve better performance. [20] had a similar approach to
movements. Researchers have therefore tried a few varied extract features from CNN then feed CNN outputs to a LSTM
approaches in this field. In order to gauge the direction of our memory to predict stock prices. [16] introduced a LSTM-
study and the suitability of our own algorithm in generating based agent to learn the temporal pattern in data and
reliable and valid results, we compare and discuss recent work
developed an automatic trading system based on historical
in market prediction.
price data and current market conditions. [21] is another
A. Technical analysis indicators example of using LSTM to predict stock prices.
Technical analysis (TA) indicators are commonly used
features in Forex prediction and many papers can confirm the LSTM and its variations have proven their effectiveness in
effectiveness of TA indicators in forex forecasts. [9] analysed time series forecast, they have dominated the financial time
the performance of six simple machine learning models to series forecasting domain in recent years. [22] survey shows
predict a binary classification for price movements (up and above 80 publications in the last 5 years.
down) for the USD/JPY currency pair. Nine features were
generated from raw data based on technical indicators (MA, III. FEATURE AND TRAINING DATA SELECTION
RSI and WR). [10] introduced a SVM to predict future price A. A sequence of events
trend directions, it generated seventy indicators as features
derived from technical analysis. The proposed model achieved As mentioned previously the sequence of events was derived
81% accuracy rate in forecasting future price trends. from Elliott Wave to determine peaks and troughs of a uptrend
or downtrend. We then incorporate a ZigZag indicator for
Due to the rapid growth of computational power in recent technical analysis. Zigzag is a popular technical indicator
years, a wide range of Neural Networks have been which identifies peaks and troughs by identifying the highest
implemented in forex trading prediction. However, most high or the lowest low within a certain period. Zigzag allows
papers conducting neural network research are still using traders to observe price movements holistically and avoid
historical price data and technical indicators as features for market noise from small movements. ZigZag (e1) is the first
training. In 2011, [11] forecasts FX markets by feeding price event of the sequence.
and technical indicators into a neural network system.
Similarly, [12] predicted future prices by using popular Zigzag indicators can be modified or defined using three
technical indicators – RSI, CCI, MACD and ROC. This paper parameters, the Depth, Deviation and Backstep. The “Depth”
focused more on building a trading agent to feed predicted is an integer which requires that a candidate Peak or Trough
prices into a decision module. Experiment results showed cannot have a lower low or higher high within the “Depth”
model effectiveness. [13] promoted a Convolutional Neural range of the candidate period. “Deviation” refers to the
Network (CNN) model to forecast monthly and weekly price amount of deviation (in pips) that is required to identify a new
trends. The data features they chose were still technical peak (from a trough) or a new trough (from a peak). Lastly,
indicators, however, they were used in conjunction with “Backstep” refers to the minimum number of periods required
exchange rates, commodity prices and world indices. [13] between adjacent peaks and troughs. Fig. 2 is an example of a
achieved a 65% accuracy rate for monthly price trends and ZigZag line.
60% for weekly price trends. [14] used nine indicators each ZigZag indicators are transition points in a certain time
with two different parameters together with a close price line window. It could be the perfect entry or exit trading point to
chart as input for the CNN models. [15] used moving average make a profit. However, the calculation of ZigZag requires
5 (MA5), moving average 10 (MA10), and moving average future price information [19], thus we introduced the second
20 information (MA20) line charts as input images to build a event which can confirm the ZigZag point.
CNN to predict weekly price movements. The target
movements were classified as up, down and non-movement The second event we detected is a moving average crossover
based on movement percentage threshold. More examples can event (e2). Moving average is a calculation which produces a
be seen from [16], [17], [18]. series of averages of combined price points of an instrument
over a specified time frame. There are two commonly used
B. Long Short-Term Memory (LSTM) moving averages - the simple moving average (SMA) and the
During recent years, LSTM has gained popularity in time exponential moving average (EMA). EMA is a weighted
series prediction due to its capability to remember the average of the last n prices, where the weighting decreases
previous inputs and its ability to prevent information from the exponentially with each previous price/period. EMA gives a
past being lost. [19] introduced a feature fusion LSTM-CNN greater weight to more recent prices. Its formula is as follows:
model for forecasting stock prices by taking the 𝐸𝐸𝐸𝐸𝐸𝐸 = Price(t) × 𝑘𝑘 + EMA(y) × (1 − 𝑘𝑘)
characteristics of both the chart image data and the time series
data. The proposed model firstly used a SC-CNN model to where t is today, y is yesterday, N is number of days in EMA,
2
extract hidden patterns in stock chart images, then used a ST- and 𝑘𝑘 = .
𝑁𝑁+1
LSTM model to work on close prices and trading volumes.
A moving average crossover occurs when two or more
Kim and Kim’s study tested performances on four different
moving average lines cross over each other. Amongst traders
this is interpreted as a signal that a change in trend is To reduce noise from highly volatile frequent trading data, we
occurring. In trading, the crossover point is often used as a selected all data at a crossover event (e2) and then go back n
trigger for a trading action, either to enter (buy or sell) or exit timesteps for training. Our prediction target is price at
(sell or buy) in the market. retracement point e3.
We lastly detected a retracement point (e3) which is also our The feature process and training data selection method is
prediction target. A retracement point is any temporary described in Fig. 4.
reversal in price within a major price trend. Retracement can
be a confirmation of a trend. It can also help traders identify if IV. MODEL ARCHITECTURE
the current trend is likely to continue or if a reversal is taking RNN is a generalized feedforward neural network which is
place. The right retracement point is the location for traders to capable of processing sequences of data one element at a time
enter into the market giving them the potential for good profits while retaining an internal memory. RNN’s recurrent nature
at minimum risk. In this paper we aim to predict price at the performs the same function of every input of data and uses
retracement point. outputs from the previous input together with current timestep
An example of a sequence of the above three events is shown data as an input for functions. The recurrent nature has
in Fig. 3. memory of the previous state and allows the network to learn
long-term dependencies in a sequence and take the entire
context into account when making a prediction. Fig. 5 depicts
RNN architecture.

Fig. 5 Recurrent Neural Network Architecture

Fig.3 Example of a sequence of events

B. Feature extraction Although RNN has the capability to predict sequences of data,
In addition to the above events, technical indicators are also it has the disadvantage of gradient vanishing and exploding
used as features. A technical indicator is a mathematical problems. LSTM is a modified version of RNN which
calculation based on historical price, volume, or (in the case resolves the vanishing gradient problem. LSTM architecture
of futures contracts) open interest information that aims to is composed of a cell and three gates – an input gate, an output
forecast financial market direction. Technical indicators
normally are used in conjunction with other techniques such
as the occurrence of a sequence of events to determine the
next trade action. We generated 28 technical indicators from
a TA-LIB package for our models. The 28 indicators are
derived from 6 types of indicators with different window size,
namely Moving Average Convergence Divergence
(MACD), Simple Moving Average (SMA), Relative Strength
Index (RSI), Average Directional Index (ADX), Bollinger
Band Indicator and William R Indicator (WR). All these
indicators are non-volume based due to the difficulty in
collecting reliable volume data.
C. Training data selection
In order to capture price movements of time series data, most
Fig. 6 Long Short-Term Memory Architecture
researchers chose whole continuous datasets as training data.
gate and a forget gate. Fig. 6 describes the LSTM architecture.

The forget gate investigates previous state ℎ𝑡𝑡−1 and current


input 𝑥𝑥𝑡𝑡 and determines which parts are to be discarded from
the cell. The decision is made by a sigmoid function 𝑓𝑓𝑡𝑡 which
outputs a number between 0 and 1 where 1 represents “keep”
while 0 represents “remove”. The sigmoid function formula
can be denoted as below:

Fig. 4 Algorithm for training data selection and process


𝑓𝑓𝑡𝑡 = 𝜎𝜎(𝑊𝑊𝑓𝑓 ∗ [ℎ𝑡𝑡−1 , 𝑥𝑥𝑡𝑡 ] + 𝑏𝑏𝑓𝑓 )
where 𝑊𝑊𝑓𝑓 represents weight function and 𝑏𝑏𝑓𝑓 represents bias.
The input gate decides which new information will be stored
in the cell. A sigmoid function 𝑖𝑖𝑡𝑡 with formula as below will
decide which values to be updated:

GRU is another variant of LSTM, the same as LSTM it has


the capability to solve vanishing gradient problem comes with
a standard RNN. The difference from LSTM is that GRU does
not have an output gate and it has fewer parameters. GRU has
two gates – an update gate and a reset gate which will decide
what parts of information to be sent to output. The architecture
can be denoted as Fig. 7.
Fig. 7 Gated Recurrent Unit Architecture In the reset gate, function 𝑟𝑟𝑡𝑡 decides how much past
information to forget, its formula is as below:
𝑖𝑖𝑡𝑡 = 𝜎𝜎(𝑊𝑊𝑖𝑖 ∗ [ℎ𝑡𝑡−1 , 𝑥𝑥𝑡𝑡 ] + 𝑏𝑏𝑖𝑖 )
𝑟𝑟𝑡𝑡 = 𝜎𝜎(𝑊𝑊𝑟𝑟 ∗ [ℎ𝑡𝑡−1 , 𝑥𝑥𝑡𝑡 ] + 𝑏𝑏𝑟𝑟 )
Then, a tanh function creates a vector 𝐶𝐶̃𝑡𝑡 combined with 𝑖𝑖𝑡𝑡 to
generate an update to the cell. 𝐶𝐶̃𝑡𝑡 can be denoted as below: The update gate then decides what information to remove
through function 𝑧𝑧𝑡𝑡 and what new information to add via ℎ�𝑡𝑡 ,
𝐶𝐶̃𝑡𝑡 = 𝑡𝑡𝑡𝑡𝑡𝑡ℎ(𝑊𝑊𝐶𝐶 ∗ [ℎ𝑡𝑡−1 , 𝑥𝑥𝑡𝑡 ] + 𝑏𝑏𝐶𝐶 ) finally function ℎ𝑡𝑡 generates the output.
The new cell 𝐶𝐶𝑡𝑡 is updated by information carried from the 𝑧𝑧𝑡𝑡 = 𝜎𝜎(𝑊𝑊𝑧𝑧 ∗ [ℎ𝑡𝑡−1 , 𝑥𝑥𝑡𝑡 ] + 𝑏𝑏𝑧𝑧 )
previous state and information generated from the current
state, formula is as below: ℎ�𝑡𝑡 = 𝑡𝑡𝑡𝑡𝑡𝑡ℎ(𝑊𝑊ℎ ∗ [ℎ𝑡𝑡−1 , 𝑥𝑥𝑡𝑡 ] + 𝑏𝑏ℎ )
𝐶𝐶𝑡𝑡 = 𝑓𝑓𝑡𝑡 ∗ 𝐶𝐶𝑡𝑡−1 + 𝑖𝑖𝑡𝑡 ∗ 𝐶𝐶̃𝑡𝑡 ℎ𝑡𝑡 = (1 − 𝑧𝑧𝑡𝑡 ) ∗ ℎ𝑡𝑡 + 𝑧𝑧𝑡𝑡 ∗ ℎ�𝑡𝑡
Finally, the output gate will decide what to output. A sigmoid GRU is faster to train than LSTM and more efficient.
function 𝑜𝑜𝑡𝑡 will filter through the cell state to decide which However, in general, LSTM performs better than GRU where
parts to be sent to output. To generate output ℎ𝑡𝑡 , we then long-term memory is required.
multiply 𝑜𝑜𝑡𝑡 by the cell state which comes through a tanh In this paper, the proposed LSTM is composed of an input
function to squish all values between -1 and 1. The details can layer, 2 LSTM layers with 64 hidden units on each layer
be described as below: together with a dense layer. Similarly, The BiLSTM is
𝑜𝑜𝑡𝑡 = 𝜎𝜎(𝑊𝑊𝑜𝑜 ∗ [ℎ𝑡𝑡−1 , 𝑥𝑥𝑡𝑡 ] + 𝑏𝑏𝑜𝑜 ) composed of an input layer, 2 BiLSTM layers with 64 hidden
units and a dense layer. GRU has similar structure as LSTM
ℎ𝑡𝑡 = 𝑜𝑜𝑡𝑡 ∗ tanh (𝐶𝐶𝑡𝑡 ) with one input layer, 2 recurrent layers and 64 hidden units.
BiLSTM is an upgrade version of LSTM. It runs inputs in two All three models are trained with Adam optimizer [23].
ways, one from past to future and one from future to past. The These three models inform us when is the correct time to enter
advantage of the approach is to preserve information from the market by forecasting price at the retracement point (“e3”).
both past and future. BiLSTM architecture can be denoted as As we already know whether the market is a bullish or bearish
Fig. 8. market from event “e1” and “e2”, the goal of the LSTM model
is to decide at what price we should enter the market. Such a
decision can be interpreted as a “buy” order in a bullish market
or a “sell” order in a bearish market.

Fig. 8 Bi-directional LSTM Architecture


The whole process of the designed methodology is shown in The MAE is the average of absolute error. It measures errors
Fig. 9. between paired observations. Its formula is as follows:
∑𝑛𝑛𝑖𝑖=1 |𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇 − 𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃|
𝑀𝑀𝑀𝑀𝑀𝑀 =
𝑛𝑛

The MAPE measures the size of the error in percentage terms.


It is calculated as the mean of the absolute percentage errors
of forecasts. Its formula is as follows:
|𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇 − 𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃|
∑𝑛𝑛𝑖𝑖=1
𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀 = 𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇 ∗ 100
𝑛𝑛

Fig. 9 Process of prediction system VI. RESULTS


Our experiment results are shown in Table II, Table III, Table
IV and Table V. The results show that LSTM with 30
timesteps is the best performing model for EUR/GBP, GRU
V. EXPERIMENTS with 30 timesteps is the best model for both AUD/USD and
A. Data and Features CAD/CHF. These three models are all over-performing
against the baseline RNN model with the exception of
In this paper we use four major currency pairings – GBP/USD,
GBP/USD for which RNN with 60 timesteps is the best
EUR/GBP, AUD/USD and CAD/CHF with their 15 minutes
model.
interval data from Jan 2005 to Sep 2017 for training and data
from Oct 2017 to Sep 2020 for testing. Data was extracted Fig. 10 shows the comparison of the ground truth (i.e. real
from Oanda API. The total number of sequences of events for price at retracement point) and predicted price for EUR/GBP.
each currency pair are listed in table I. The predicted values are very close to the true values and its
MAPE is only 0.194% which gives us confidence that the
The 28 features are MACD, MACD signal, MACD histogram,
model can support real trading.
SMA5, SMA10, SMA15, SMA20, SMA25, SMA30, SMA36,
RSI5, RSI14, RSI20, RSI25, ADX5, ADX10, ADX15,
ADX20, ADX25, ADX30, ADX35, Bollinger lowerband,
Bollinger middleband, Bollinger upperband, WR5, WR14, VII. DISCUSSION AND CONCLUSION
WR20 and WR25. This research is aimed at predicting future price movements
of Forex based on training data, features selected from
TABLE I. RAW DATA DETAIL historical data and technical analysis indicators utilising
Currency Number of
Number of
Training
advanced AI techniques. We built an architecture constructed
Pair rows
sequences
data
Test data of a training data selection module and a LSTM model to
(e1, e2, e3)
predict price at retracement points. The forecast of an entry
GBP/USD 397,317 2,238 1,838 400 can help traders to determine their trading strategies with
EUR/GBP 397,796 2,233 1,810 423 minimal risk.
AUD/USD 397,329 2,260 1,849 411 While the results to date show great potential for a combined
approach to develop a successful trading strategy, one of the
CAD/CHF 397,813 2,194 1,770 424 main limitations is that we predicted “e1” using ZigZag
indicators. Our ZigZag normally requires approximately an
additional 40 bars to confirm a ZigZag transition point. We
B. Evaluation Measures suggest further research on identifying ZigZag or similar price
The performance of the model was measured by standard transition points based on historical data only.
regression metrics including mean square error (MSE), root
mean squared error (RMSE), mean absolute error (MAE) and TABLE II. EXPERIMENT RESULT FOR GBP/USD
mean absolute percentage error (MAPE). MSE RMSE MAE MAPE
Model Timesteps
(𝟏𝟏𝟏𝟏−𝟑𝟑 ) (𝟏𝟏𝟏𝟏−𝟑𝟑 ) (𝟏𝟏𝟏𝟏−𝟑𝟑 ) (%)
The MSE measures the average of the squares of the errors, its
RNN 30 1.846 42.960 35.336 2.774
formula is as follows:
LSTM 30 2.435 49.351 48.357 3.749
∑𝑛𝑛𝑖𝑖=1(𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇 − 𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃)2 BiLSTM 30 1.520 38.984 37.456 2.903
𝑀𝑀𝑀𝑀𝑀𝑀 = GRU 30 6.311 79.441 78.185 6.067
𝑛𝑛 RNN 60 0.710 26.645 25.118 1.945
LSTM 60 0.853 29.200 26.617 2.075
BiLSTM 60 1.489 38.593 37.098 2.873
The RMSE is the root of MSE, its formula is as follows: GRU 60 3.324 57.658 56.723 4.401

∑𝑛𝑛𝑖𝑖=1(𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇 − 𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃)2 TABLE III. EXPERIMENT RESULT FOR EUR/GBP


𝑅𝑅𝑅𝑅𝑅𝑅𝑅𝑅 = �
𝑛𝑛
Model Timesteps
MSE RMSE MAE MAPE Our results in this paper outperform previous results by Zeng
(𝟏𝟏𝟏𝟏−𝟑𝟑 ) (𝟏𝟏𝟏𝟏−𝟑𝟑 ) (𝟏𝟏𝟏𝟏−𝟑𝟑 ) (%)
and Khushi [24] they reported their lowest RMSE 1.65x10-3
RNN 30 0.032 5.628 4.456 0.503 whereas our lowest RMSE in this paper is 0.006x10-3.
LSTM 30 0.006 2.407 1.708 0.194
BiLSTM 30 0.168 12.962 12.701 1.440
GRU 30 0.151 12.273 11.343 1.277
ACKNOWLEDGMENT
RNN 60 0.075 8.684 7.270 0.817 Many thanks to Dr. Matloob Khushi and Dr. Saqib Ayyubi for
LSTM 60 0.006 2.536 1.957 0.222 their guidance and explanation of financial events. Also
BiLSTM 60 0.076 8.705 8.434 0.957 thanks to Ken Pang, Zhuoyang Li, YewShien Lee, Yuan Zeng
GRU 60 0.135 11.612 10.548 1.187 and Jimmy Yue for sharing their knowledge.
TABLE IV. EXPERIMENT RESULT FOR AUD/USD REFERENCES
MSE RMSE MAE MAPE [1] R. C. Cavalcante, R. C. Brasileiro, V. L.F. Souzab, J. P. Nobrega and
Model Timesteps
(𝟏𝟏𝟏𝟏−𝟑𝟑 ) (𝟏𝟏𝟏𝟏−𝟑𝟑 ) (𝟏𝟏𝟏𝟏−𝟑𝟑 ) (%) A. L.I. Oliveira, “Computational Intelligence and Financial Markets: A
RNN 30 0.530 23.030 20.406 2.875 Survey and Future Directions”, Vol. 55, pp. 194-211, August 2016.
LSTM 30 0.568 23.835 22.481 3.149 [2] S. Galeshchuk and S. Mukherjee, “Deep networks for predicting
BiLSTM 30 4.821 69.433 68.646 9.566 direction of change in foreign exchange rates” in Intelligent Systems in
GRU 30 0.201 14.162 13.588 1.929 Accounting, Finance and Management, Vol. 24, Issue 4, pp. 97--147,
RNN 60 1.061 32.578 31.106 4.377 March 2017.
LSTM 60 0.345 18.585 16.365 2.291 [3] U. Gudelek, A. Boluk and M. Ozbayoglu, “A deep learning based stock
BiLSTM 60 6.603 81.263 80.897 11.320 trading model with 2-D CNN trend detection'” in 2017 IEEE
GRU 60 0.298 17.270 16.626 2.351 Symposium Series on Computational Intelligence (SSCI), pp. 1-8,
November 2017.
TABLE V. EXPERIMENT RESULT FOR CAD/CHF [4] H. Gunduz, Y. Yaslan and Z. Cataltepe, “Intraday prediction of Borsa
Istanbul using convolutional neural networks and feature correlations”
MSE RMSE MAE MAPE in Knowledge-Based Systems, Vol. 137, pp. 138-148, December 2017.
Model Timesteps
(𝟏𝟏𝟏𝟏−𝟑𝟑 ) (𝟏𝟏𝟏𝟏−𝟑𝟑 ) (𝟏𝟏𝟏𝟏−𝟑𝟑 ) (%)
[5] O. Sezer and A. M. Ozbayoglu, “Algorithmic financial trading with
RNN 30 0.089 9.450 7.388 1.023
deep convolutional neural networks: Time series to image conversion
LSTM 30 0.092 9.570 8.537 1.167 approach” in Applied Soft Computing, Vol. 70, pp. 525-538,
BiLSTM 30 0.225 15.011 14.312 1.931 September 2018.
GRU 30 0.027 5.247 4.264 0.583
[6] H. S. Sim, H. I. Kim and J. J. Ahn, “Is Deep Learning for Image
RNN 60 0.183 13.543 12.030 1.641 Recognition Applicable to Stock Market Prediction?” in Complexity,
LSTM 60 0.154 12.396 11.088 1.514 Vol. 2019, article ID 4324878, February 2019.
BiLSTM 60 0.032 5.674 4.858 0.651
[7] J. Yao and CL. Tan, “A case study on using neural networks to perform
GRU 60 0.032 5.661 4.340 0.603
technical forecasting of forex” in Neurocomputing, Vol. 34, Issue 1-4,
pp. 79-98, September 2000.
[8] R.N. Elliott, “R.N. Elliot's Masterworks”, 1994
[9] Gerlein E. A., McGinnity M., Belatreche A. and Coleman S.,
“Evaluating machine learning classification for financial trading: an
empirical approach” in Expert Systems with Applications, Vol. 54, pp.
193-207, July 2016
[10] Dingli A. and Fournier K. S., “Financial time series forecasting - a
machine learning approach”, International Journal of Machine
Learning and Computing, Vol. 14, No. 1/2/3, September 2017
[11] A. Baasher and M. Fakhr, “Forex trend classification using machine
learning techniques” in Proceedings of the 11th WSEAS International
Conference on Applied Computer Science, 2011, pp.41-47.
[12] S. A. Alves, W. Caarls and P. M. V. Lima, “Weightless Neural Network
for High Frequency Trading” in 2018 International Joint Conference
on Neural Networks (IJCNN), pp. 1-7, July 2018.
[13] A. Dingli and K. S. Fournier, “Financial time series forecasting - a deep
Fig. 10 Real Prices vs Predicted Prices – EUR/GBP learning approach”, International Journal of Machine Learning and
Computing, Vol. 7, No. 5, October 2017.
[14] Sim H. S. et al., “Is deep learning for image recognition applicable to
stock market prediction” in Complexity, vol. 2019, article id 4324878,
The main contributions of this paper are 1) We developed a February 2019
method to select training data based on a sequence of events [15] Tsai Y. C. et al., “Predict forex trend via convolutional neural
derived from Elliott Wave to reduce noise from frequent time networks” in Journal of Intelligent Systems, 29(1) pp. 941-958,
series trading data. 2) Our LSTM and GRU models are September 2018
outperforming the baseline RNN model for three currency [16] J. Wu, C. Wang, L. Xiong and H. Sun, “Quantitative trading on stock
pairs – EUR/GBP, AUD/USD and CAD/CHF. These results market based on deep reinforcement learning” in 2019 International
show a significant increase of MAPE - 159% for EUR/GBP, Joint Conference on Neural Networks (IJCNN), pp. 1-8, July 2019.
49% for AUD/USD and 75% for CAD/CHF. 3) In addition to [17] M. Zhu and L. Wang, “Intelligent trading using support vector
regression and multilayer perceptrons optimized with genetic
entry price point prediction, we tested and determined what algorithms” in The 2010 International Joint Conference on Neural
was the best number of timesteps to use to capture an Networks (IJCNN), pp. 1-5, July 2010.
underlying price pattern. Results have shown currency [18] J. Kamruzzaman, R. Sarker and I. Ahmad, “SVM based models for
pairings perform differently with different timesteps. predicting foreign currency exchange rates”, Third IEEE International
Experiment results have also shown great potential to build a Conference on Data Mining, December 2003.
RoboTrading (Robotic Trading) platform. [19] Kim t. and Kim H. Y., “Forecasting stock prices with a feature fusion
LSTM-CNN model using different representations of the same data” in
PLoS One, 14(2), February 2019
[20] H. Shin, I. Ra and Y. Choi, "A Deep Multimodal Reinforcement
Learning System Combined with CNN and LSTM for Stock
Trading", 2019 International Conference on Information and
Communication Technology Convergence (ICTC), Jeju Island, Korea
(South), pp. 7-11, October 2019
[21] J. Cao et al., “Financial time series forecasting model based on
CEEMDAN and LSTM” in Physica A: Statistica Mechanics and its
Applications, vol. 519, pp. 127-139, April 2019
[22] Sezer et al., “Financial time series forecasting with deep learning: A
systematic literature review: 2005-2019” in Applied Soft Coputing
Journal, 90, February 2020
[23] Kingma D. P. and Ba J. Adam: “A method for stochastic optimization”,
Computer Science, 2014
[24] Z. Zeng and M. Khushi, "Wavelet Denoising and Attention-based
RNN- ARIMA Model to Predict Forex Price," 2020 International Joint
Conference on Neural Networks (IJCNN), Glasgow, United Kingdom,
2020, pp. 1-7, doi: 10.1109/IJCNN48605.2020.9206832.

You might also like