ArticlePDF Available

Improving Stock Trend Prediction using LSTM Neural Network Trained on a Complex Trading Strategy

Authors:

Abstract and Figures

Technical analysis in stock trading addresses the crucial matter of making optimal trading decisions promptly. Predicting directional movement in the target market using technical indicators is quite common. Besides its many other applications, machine learning helps to solve the algorithmic trading problem of determining optimal trading positions, and some types of deep neural networks have been proven as up-and-coming methods for forecasting the returns of the stock market. The current work presents the idea of training a neural network on a new trading strategy, named, Unified Trading Strategy (UTS) that integrates technical indicators from three well-known categories referred to as leading, lagging, and volatility. The trained network serves as an excellent alternative to the classical technical analysis model by simplifying the process of finding potential events of effective trade with better performance and reusability.
Content may be subject to copyright.
10 VII July 2022
https://doi.org/10.22214/ijraset.2022.45961
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue VII July 2022- Available at www.ijraset.com
4361
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 |
Improving Stock Trend Prediction using LSTM
Neural Network Trained on a Complex Trading
Strategy
S. Z. Mahfooz1, Iftikhar Ali2, Muhammad N. Khan3
1Department of Computer Science & Engineering, 2Department of Mathematics, 3Department of Chemical Engineering, University
of Hafr Al Batin, Kingdom of Saudi Arabia.
Abstract: Technical analysis in stock trading addresses the crucial matter of making optimal trading decisions promptly.
Predicting directional movement in the target market using technical indicators is quite common. Besides its many other
applications, machine learning helps to solve the algorithmic trading problem of determining optimal trading positions, and
some types of deep neural networks have been proven as up-and-coming methods for forecasting the returns of the stock market.
The current work presents the idea of training a neural network on a new trading strategy, named, Unified Trading Strategy
(UTS) that integrates technical indicators from three well-known categories referred to as leading, lagging, and volatility. The
trained network serves as an excellent alternative to the classical technical analysis model by simplifying the process of finding
potential events of effective trade with better performance and reusability.
Keywords: Automated stock trading; Trend prediction; Stock market; Unified trading strategy; LSTM neural network
I. INTRODUCTION
Historical data in financial trading contains latent temporal features that may preserve economic patterns and market trends.
Traditional methods of technical analysis utilize charting and mathematical tools to detect latently profitable patterns from historical
data [1]. The financial technical indicators use specific mathematical and statistical methods to reflect the more profound
connotation of the available stock data in forecasting future trends [2]. There exist many automated trading systems that help to
monitor and manage trades. Real-time trading systems [3], simulators [4], and recommendation systems [5] help investors to reduce
the risk and maximize profit in stock trading. Algorithm-based technical indicators use calculations of past price data to trace all
oversold or overbought conditions of markets. Short-term and long-term traders have several options for analyzing securities to
decide their entry and exit points. Some traders may prefer to formulate custom strategies and indicators for better trading ideas. It
helps them work with a greater degree of flexibility and increases the chances of successful trading. A suitable process also helps to
fine-tune entry and exit levels by overcoming the lagging that results from the usage of past price data.
Many machine learning models capture nonlinear characters in data without prior knowledge [6]. Since the 1990s, automated
trading systems based on machine learning and technical indicators have been employed to predict stocks, foreign exchange, and
commodity futures markets [710]. Various neural networks have been applied for forecasting the stock market returns. Multi-
Layered Feed Forward Network with backpropagation algorithm [11], Adaptive Neuro-Fuzzy Inference System [12], Radial Basis
Function Network [13], and Long Short Term Memory (LSTM) [14] have outperformed other machine learning techniques such as
SVM [15] and Random Forest [16]. LSTM and basic stock market data, including OHLC (Open, High, Low, and Close) prices used
for market prediction, have shown improvement over the traditional methods with few exceptions [17,18]. LSTM have been applied
extensively for investigating stock markets [19], econometrics [20], and financial market predictions [21].
LSTM model being well-suited to time series data has been used to predict stock future price values after observing historic prices
[22-23]. LSTM model with its feature of sequence prediction can be added with additional methods to predict stock market trends
for automated trading [24-25]. We developed a method that uses LSTM to solve a classification problem whether a set of price
values will form an uptrend or a downtrend. The model is trained to learn the patterns of up/down trends and it generates buy/sell
signal as its output.
For training the LSTM model over different patterns of market trends, our trading strategy uses multiple technical indicators to
validate existing trends in stock data. The trained LSTM model finally mimic the behavior of these technical indicators and become
able to automatically generate buy/sell signals.
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue VII July 2022- Available at www.ijraset.com
4362
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 |
In this research work, a new trading strategy called Unified Trading Strategy (UTS) has been developed that utilizes the
performance and efficiency of well-known technical indicators. UTS validated trend data is used to train an LSTM model to
automate the detection of patterns that take over the trends. Our results show that the developed trading strategy and the trained
neural network model are finally able to generate buy/sell signals for automated trading that outperforms the manual stock trading.
We try to evaluate how a LSTM based recognizer behaves compared to the traditional algorithm-based system.
The rest of this paper is arranged as follows: The second part describes the methodology of the proposed model, and the third part is
composed of experimental work and results. Finally, the fourth part provides the conclusion and future directions.
II. METHODOLOGY
Technical indicators are used for chart analysis to detect patterns in price charts. They also offer price analysis to predict future price
action. Depending on the functionality, a technical indicator may be lagging, leading, or volatile. Moving Average (MA) and
Moving Average Convergence Divergence (MACD) are lagging indicators, also known as trend indicators. Leading indicators like
RSI (Relative Strength Index) try to predict future price trends by calculating the price rate changes. They are also referred to as
momentum-based indicators. Average Directional Movement Index (ADX) and Average True Range (ATR) are examples of
volatility-based indicators [26] that measure the volatility level of the price. Many financial prediction models use these naïve
trading signals for feature engineering. Our strategy applies one or more indicators from three different categories of technical
indicators. It follows an algorithm to search and select common trend signals. A total of five technical indicators, including Average
Directional Index (ADX), Exponential Moving Averages (EMA), Moving Average Convergence Divergence (MACD), Triple
Exponential Average (TRIX), and Relative Strength Index (RSI), are considered by UTS. A short description of these indicators is
given below.
1) Exponential Moving Average (EMA: is widely used in trading practices. It smooths the effects of price changes by giving more
weight to the latest data. Our model uses a smoothing factor N=9 to calculate EMA as given below:
=
+ 󰇡1
󰇢 ( 1 )
2) Moving Average Convergence-Divergence (MACD): is calculated by subtracting the 26-day EMA from the 12-day EMA. A
signal line is then calculated by taking a 9-day EMA of MACD. The MACD line crossing above the signal line is a buy signal,
and if it is crossing below the signal line, it indicates a sell signal. MACD is a trend-following indicator that reveals changes in
momentum, duration, and direction of a stock trend.
 = 12 26 ( 2 )
3) The Relative Strength Index (RSI): is a momentum indicator. The RSI value is measured in a range from 0 to 100. A high”
value above 70 indicates overbought underlying security. A low worth less than 30 means that it is oversold. The RSI at each
time step is calculated as:
= 100
( 3 )
Where,
AG and AL are simple average-gains and average-losses over 9-day period.
4) Average Directional Index (ADX): works together with a Minus Directional Indicator (-DI) and a Plus Directional Indicator
(+DI). The directional movement indicators are used to detect stock trends, typically used to determine entry and exit points.
The ADX is derived from the smoothed averages between +DI and DI. It measures the strength of the trend over time. Using
all three indicators together, we can determine both the direction and strength of the movement. The value of ADX ranges
between 0 and 100. A reading below 20 indicate trend weakness, and all readings above 40 are considered vital.
5) Triple Exponential Average (TRIX): is a momentum oscillator representing the percent rate of change of a triple exponentially
smoothed moving average. Given below are the steps involved in the calculations of the nine days TRIX.
= 9   ( 4 )
= 9 ( 5 )
= 9 ( 6 )
=(,,)
, ( 7 )
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue VII July 2022- Available at www.ijraset.com
4363
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 |
When the stock market index increases its value compared to its previous performance, it is referred to as an uptrend, and a
relatively decreasing market index exhibits a downtrend movement [27]. A buy signal is expected when security is believed to be
overbought, i.e., trading above its fair or intrinsic value. On the other hand, a sell signal results from an oversold market that has
fallen sharply. A trading strategy is a set of predetermined rules that decides how to approach stock trading to achieve profitable
returns. UTS is a trend-following strategy that works on a breakout model, buying strength, and selling weakness. The following
points help to understand the methodology of UTS, which is also illustrated in Fig. 1.
Technical Indicators (TI’s) are applied on close prices of available historical data. Each of these TI’s try to determine and mark a
trend.
a) A trend period may be determined by some TI’s early, and others may observe it late or may not observe it at all. The algorithm
scans adjacent days around a trend period to search and count several TI’s, marking this period as a potential trend.
b) To validate an uptrend or a downtrend, we set the minimum number of TI’s to confirm this trend.
c) The average of days marked by different TI’s is selected as the start day of the trend.
d) Sideways are ignored. Only uptrends and downtrends are marked alternatively.
The significant and consistent price change serves as a good feature for the trend period. This change is calculated by taking the
difference of prices of consecutive days. A positive change in prices represents an increase (buy-signals), and a negative change
indicates a decrease in prices (sell-signals). This increase and decrease serve as class labels for the regression method determining
the directional movement. We use these features to train our LSTM model.
Fig 1. Methodology of Unified Trading Strategy (UTS)
The LSTM model as a machine learning-based model can estimate the predictive power of traditional indicators in different market
situations. Also, compared to the other models, the feature detection is excellent by using LSTM models. They are Recurrent Neural
Networks (RNNs) designed to tackle the problem of vanishing or blowing up gradients. It is carried out by introducing long short-
term memory in RNN, where only necessary information is allowed in the evaluations. Equations 8 to 14 illustrate the structure of
LSTM and its architecture is given in Fig. 2. =(+) ( 8 )
=(+) ( 9 )
=(+) ( 10 )
=(+) ( 11 )
= + ( 12 )
= () ( 13 )
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue VII July 2022- Available at www.ijraset.com
4364
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 |
=() ( 14 )
Where, : input gate, how much of the new information will be let through the memory cell
: forget gate, responsible for information should be thrown away from memory cell.
: output gate, how much of the information will be passed to expose to the next time step.
: self-recurrent which is equal to standard RNN
 : internal memory of the memory cell
: hidden state
: final output
Moreover, xt is input at time t and U, V, W are weight matrices.
Fig 1. Architecture of Long Short-term Memory (LSTM)
III. EXPERIMENT AND RESULTS
The input features for training our DNN model are generated from the dataset for 120 different US stocks collected from Yahoo
Finance [28]. UTS marks the days for up and downtrends, and the change in price for the marked days is calculated. The output is of
binary type as for uptrends and downtrends, the difference in prices is positive or negative, respectively. The objective of adapting
changes instead of values is to offer a fair comparison across different stocks and periods. It confirms that our model learns a
generalized pattern for predicting any stock using historical data, which is the essence of technical analysis.
The proposed model is implemented in Python by using the deep learning library Keras [29]. Model’s hyper-parameters candidate
and optimal sets are shown in Table I. Different candidate sets were tested including number of hidden units, parameter initializer,
activation type, dropout rate, and optimization type. The example of the optimal hyper-parameter values is shown in the last column.
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue VII July 2022- Available at www.ijraset.com
4365
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 |
Table I: LSTM model hyper-parameters candidate and optimal sets
Hyper-parameter name Hyper-parameter values Example of optimal hyper-
parameter values
# of hidden units {16, 32, 64, 128} 32
initializer {normal, he_normal,
glorot_normal} normal
Type of activation {tanh, relu,sigmoid} tanh
Dropout rate {0.0, 0.2, 0.3, 0.4} 0.0
Type of optimization {SGD, Adagrad, Adam} SGD
Total 4,656 features extracted from trend periods (predicted by UTS) are fed sequentially to the model consisting of an LSTM layer
connected with an output layer using 32 connections. LSTM layer is optimized and it finally used tanh as its activation function. As
our features are labelled by 1 for uptrend signals and 0 for downtrend signals, we used sigmoid function (Equation. 15) as an
activation function at the output layer, and the loss function is set to binary cross-entropy. This function receives the output from the
previous layer and generates a probability value between [0,1].
() =
( 15 )
A fraction of all total signals that are not a part of the training set is used to test the model. Table II is a binary confusion matrix that
is used as evaluation metrics for measuring the performance of the LSTM model. True positive (TP) in a confusion matrix indicates
cases wherein both actual label and predicted label are correctly positive (i.e., buy signal). False positive (FP) indicates cases
wherein the actual label is negative (i.e., sell signal) but the model prediction is incorrectly positive. False negative (FN) indicates
the cases when the actual label is positive but the predicted label is incorrectly negative (i.e., sell signal). Finally, true negative (TN)
indicates cases wherein both actual label and predicted label are correctly negative.
Table II: Confusion matrix for the LSTM model evaluation
Predictive positive Predictive negative
Actual positive
1093
True Positive
7
False Negative
Actual negative
11
False Positive
1089
True Negative
The values of Precision (Equation. 16) and Recall (Equation. 17) can express the performance of a binary classifier model or more
accurately, we can use f1-score (Equation. 18) that represent the harmonic mean of precision and recall. For above confusion matrix,
the value of f1-score is 0.99 (1 is the best).
 =
(16)
 =
(17)
f1-Score =


 (18)
The changes in close prices for the new stock are fed to the trend prediction model that marks the days as potential candidates for
buy and sell opportunities. The model generates an output between [0,1] for each set of values. The threshold values are selected to
sort out buy/sell signals depending upon the volatility of a stock. Typically, all the values greater than 0.70 represent buy signs, and
all values less than 0.30 indicate sell signals. Rest of the values represent a range i.e., one of the three ways a market can be biased.
The performance of a trading system is assessed on existing historical data from a stock market for a specific time. The analysis
resulting from a single instrument (stock or others) should not be trusted entirely, as the selection of trading data may be biased to
show a trading strategy looks profitable. The choice of multiple stocks having diverse patterns features an ideal assessment. This
research forms a test bench (Table III) composed of 8 stocks from different sectors, profiles, and volatilities.
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue VII July 2022- Available at www.ijraset.com
4366
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 |
For the sake of generality, all the algorithm parameters remain unchanged over the entire test bench. Regarding the trading horizon,
the ten years (2010 to 2019) data is collected to represent the set of economic phenomena for the selected markets. It less likely
contains significant market regime shifts that may harm the stability of a trading strategy.
Table III. Performance assessment testbench
Stock Symbol Company Name Sector
SPY S&P 500 ETF Trust
Trading Index
DIA Dow Jones Industrial Average ETF Trust
AAPL Apple Inc.
Technology
MSFT Microsoft Corporation
MCD McDonald’s Corporation
Consumer Cyclical
NKE NIKE, Inc.
PG The Procter & Gamble Company Consumer Defensive
JNJ Johnson & Johnson Healthcare
Some Key Performance Indicators (KPI’s) are selected to assess the trading model accurately. Fig. 3. presents a list of these
performance indicators employed to quantify the performance of the proposed trading system.
Fig 3. Quantitative performance assessment indicators
These performance indicators provide information about the performance and analysis of the trading system's strengths and
weaknesses. We compare the performance of both the unified strategy and the trained model with the Buy and Hold (B& H)
strategy.
The calculations of performance indicators in Table IV seem appropriate to analyze the trading policies and the trained model
accurately. LSTM based model trained on UTS delivered higher risk-adjusted measurements for all stocks as indicated by the
Sharpe ratio [30] and profit factor. Sharpe ratio was introduced by Sharpe in 1996. It is called reward-to-variability ratio that
determines the performance of an investment. It is defined as follows:
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue VII July 2022- Available at www.ijraset.com
4367
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 |
=
Where µ represents the expected return, is the standard deviation of return, and risk-free rate of return. Profit factor is the ratio
of total number of winning trades to the total number of losing trades for a specific trading period. It is a simple performance metric
to assess the efficiency of a trading algorithm. It is defined as follows:
  = 
Table IV. Performance assessment on different stocks
Stock Strategy Sharpe Ratio Profit Factor
AAPL B& H 1.00
UTS 1.37 14.39
LSTM 1.76 15.51
DIA B& H 0.93
UTS 1.25 15.20
LSTM 1.98 8.33
SPY B& H 0.93
UTS 1.25 15.20
LSTM 1.98 8.33
JNJ B& H 0.71
UTS 0.88 3.10
LSTM 1.53 16.57
MCD B& H 0.77
UTS 1.18 9.05
LSTM 1.56 12.00
NKE B& H 1.14
UTS 1.35 8.31
LSTM 1.45 11.27
MSFT B& H 0.92
UTS 1.12 4.32
LSTM 1.89 7.98
PG B& H 0.58
UTS 0.96 5.55
LSTM 3.30 12.39
The results of percent profit and CAGR (Fig. 4(a-b)) strengthen the observation that the proposed forecast-based strategy and LSTM
model consistently deliver significant excess returns over the market index.
The graphs of annual volatility, max drawdown, total net profit in Fig. 4(c) & (e) show that the trained model can self-adapt during
both bullish and bearish stock markets. The UTS algorithm can be ranked second as its overall performance is better than the buy-
and-hold trading strategy.
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue VII July 2022- Available at www.ijraset.com
4368
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 |
Fig 4. Forecasted performance assessment (a) Percent profitable (b) CAGR (%) (c) Annual volatility(d) Maximum Drawdown (e)
Total net Profit
AAPL
DIA
SPY
JNJ
MCD
NKE
MSFT
PG
0 10 20 30 40 50 60 70 80 90 100 110 120
Percent Profitable (%)
Stock
LTSM
UTS
B and H
AAPL
DIA
SPY
JNJ
MCD
NKE
MSFT
PG
0 10 20 30 40
CAGR (%)
Stock
LTSM
UTS
B and H
AAPL
DIA
SPY
JNJ
MCD
NKE
MSFT
PG
0 10 20 30 40
Annual Volatility (%)
Stock
LTSM
UTS
B and H
AAPL
DIA
SPY
JNJ
MCD
NKE
MSFT
PG
0 10 20 30 40
Max Drawdown (%)
Stock
LTSM
UTS
B and H
AAPL
DIA
SPY
JNJ
MCD
NKE
MSFT
PG
0 10000 20000 30000 40000 50000 60000 70000 80000 90000
Total Net Proft ($)
Stock
LTSM
UTS
B and H
(
b
)
(
c
)
(
e
)
(
d
)
(
a
)
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue VII July 2022- Available at www.ijraset.com
4369
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 |
Besides the computation of given performance indicators, Fig 5 & 6 respectively provides extra insights with a graphical
representation of stocks' annual returns resulting from each trading strategy. The proposed LSTM trading model trained with UTS
leads with all positive returns that is an evidence of a profitable trading system. It attempts to properly handle both bull and bear
markets with different levels of volatility.
2010 2011 2012 2013 2014 2015 2016 2017 2018
2019
-0.5
-0.4
-0.3
-0.2
-0.1
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1.0
Annual Returns
Year (-)
Buy&Hold
UTS
LSTM
2010 2011 2012 2013 2014 2015 2016 2017 2018
-0.2
-0.1
0.0
0.1
0.2
0.3
0.4
0.5
0.6
Annual Returns
Year (-)
Buy&Hold
UTS
LSTM
0.0
0.1
0.2
0.3
0.4
0.5
An nu al R etu rns
Buy&Hold
UTS
LSTM
0.0
0.1
0.2
0.3
0.4
0.5
An nu al R eturns
Buy&Hold
UTS
LSTM
Fig 5. Stocks annual returns for (a) AAPL (b) DIA (c) SPY and (d) JNJ over a span of 2010-2019.
(a) AAPL (b) DIA
(c) SPY (d) JNJ
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue VII July 2022- Available at www.ijraset.com
4370
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 |
2010 2011 2012 2013 2014 2015 2016 2017 2018 2019
2020
-0.3
-0.2
-0.1
0.0
0.1
0.2
0.3
0.4
0.5
Annual Returns
Year (-)
Buy&Hold
UTS
LSTM
2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020
-0.3
-0.2
-0.1
0.0
0.1
0.2
0.3
0.4
0.5
Annual Returns
Year (-)
Buy&Hold
UTS
LSTM
2010 2011 2012 2013 2014 2015 2016 2017 2018 2019
-0.3
-0.2
-0.1
0.0
0.1
0.2
0.3
0.4
0.5
Annual Returns
Year (-)
Buy&Hold
UTS
LSTM
2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020
-0.3
-0.2
-0.1
0.0
0.1
0.2
0.3
0.4
0.5
Annual Returns
Year (-)
Buy&Hold
UTS
LSTM
Fig 6. Stocks annual returns for (a) MCD (b) NKE (c) MSFT and (d) PG over a span of 2010-2019.
IV. CONCLUSION & FUTURE DIRECTIONS
The paper introduced a unified trading strategy that can blend the distinctive features of individual indicators from different
categories. The research work also employed an LSTM neural network model trained over the trend signals generated by the
designed trading strategy. The model learns the characteristics of the unified trading strategy and becomes able to provide insight
into the future movements of any input security prices. The trained model efficiently exploits the correlation between stock patterns
and future trends. Our results show that the designed LSTM neural network learns behavior of a complex trading strategy and
outperforms the benchmark or traditional trading algorithms in forecasting of the market trends.
Any system that can exploit the potential of diverse methods in technical analysis may serve as a reliable mode for significant profit.
A hybrid model for prediction is possible by incorporating the proposed unified trading strategy to the sentiment analysis of news
articles, social media, and corporate reports. Furthermore, new research directions may formulate advance metrics to measure the
performance and robustness of the prediction models.
(a) MCD (b) NKE
(c) MSFT (d) PG
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue VII July 2022- Available at www.ijraset.com
4371
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 |
REFERENCES
[1] Lo, A.W.; Mamaysky, H.; Wang, J.; Acampora, R.; Allen, F.; Berger, S.; Epstein, M.; Jegadeesh, N.; Kao, E.; Sanzone, D.; et al. NBER WORKING PAPER
SERIES Foundations of Technical Analysis: Computational Algorithms, Statistical Interference, and Empricial Implementation. J. Finance 2000, 4, 17061715.
[2] Lai, T. L., & Xing, H. (2008). Statistical models and methods for financial markets. New York: Springer.
[3] Chen, Y.; Wang, X. A hybrid stock trading system using genetic network programming and mean conditional value-at-risk. Eur. J. Oper. Res. 2015, 240, 861
871, doi:10.1016/J.EJOR.2014.07.034.
[4] Jacobs, B. I., Levy, K. N., & Markowitz, H. M. (2004). Financial market simulation. The Journal of Portfolio Management, 30(5), 142-152.
[5] Wang, W.; Mishra, K.K. A novel stock trading prediction and recommendation system. Comput. Sci. Multimed. Tools Appl. 2017, 77, 42034215,
doi:10.1007/S11042-017-4587-Z.
[6] Atsalakis, G.S.; Valavanis, K.P. Surveying stock market forecasting techniques Part II: Soft computing methods. Expert Syst. Appl. 2009, 36, 59325941,
doi:10.1016/J.ESWA.2008.07.006.
[7] Huang, B., Huan, Y., Xu, L. D., Zheng, L., & Zou, Z. (2019). Automated trading systems statistical and machine learning methods and hardware
implementation: a survey. Enterprise Information Systems, 13(1), 132-144.
[8] Borch, C. (2022). Machine learning, knowledge risk, and principal-agent problems in automated trading. Technology in Society, 101852
[9] Kim, K.J. Financial time series forecasting using support vector machines. Neurocomputing 2003, 55, 307319, doi:10.1016/S0925-2312(03)00372-2.
[10] Han, H., Teng, J., Xia, J., Wang, Y., Guo, Z., & Li, D. (2021). Predict high-frequency trading marker via manifold learning. Knowledge-Based Systems, 213,
106662.
[11] Ramani, P.; Murarka, P.D. Stock Price Prediction using Multi-Layer Feed Forward Neural Network. Int. J. Information, Commun. Comput. Technol. 2013, 1.
[12] Esfahanipour, A., & Aghamiri, W. (2010). Adapted neuro-fuzzy inference system on indirect approach TSK fuzzy rule base for stock market analysis. Expert
Systems with Applications, 37(7), 4742-4748
[13] Guo, Z., Wang, H., Yang, J., & Miller, D. J. (2015). A stock market forecasting model combining two-directional two-dimensional principal component
analysis and radial basis function neural network. PloS one, 10(4), e0122385.
[14] Kim, T., & Kim, H. Y. (2019). Forecasting stock prices with a feature fusion LSTM-CNN model using different representations of the same data. PloS one,
14(2), e0212320.
[15] Chen, Y.; Hao, Y. A feature weighted support vector machine and K-nearest neighbor algorithm for stock market indices prediction. Expert Syst. Appl. 2017,
80, 340355, doi:10.1016/J.ESWA.2017.02.044.
[16] Park, H. J., Kim, Y., & Kim, H. Y. (2022). Stock market forecasting using a multi-task approach integrating long short-term memory and the random forest
framework. Applied Soft Computing, 114, 108106.
[17] Jiang, W. (2021). Applications of deep learning in stock market prediction: recent progress. Expert Systems with Applications, 184, 115537
[18] Kumbure, M. M., Lohrmann, C., Luukka, P., & Porras, J. (2022). Machine learning techniques and data for stock market forecasting: a literature review. Expert
Systems with Applications, 116659
[19] Baillie, R.T. Long memory processes and fractional integration in econometrics. J. Econom. 1996, 73, 559, doi:10.1016/0304-4076(95)01732-1.
[20] Sadique, S.; Silvapulle, P. Long-term memory in stock market returns: international evidence. Int. J. Financ. Econ. 2001, 6, 5967, doi:10.1002/IJFE.143.
[21] Fischer, T.; Krauss, C. Deep learning with long short-term memory networks for financial market predictions. Eur. J. Oper. Res. 2018, 270, 654669,
doi:10.1016/J.EJOR.2017.11.054.
[22] Yadav, A., Jha, C. K., & Sharan, A. (2020). Optimizing LSTM for time series prediction in Indian stock market. Procedia Computer Science, 167, 2091-2100.
[23] Cao, J., Li, Z., & Li, J. (2019). Financial time series forecasting model based on CEEMDAN and LSTM. Physica A: Statistical Mechanics and its
Applications, 519, 127-139.
[24] Zhao, Z., Rao, R., Tu, S., & Shi, J. (2017, November). Time-weighted LSTM model with redefined labeling for stock trend prediction. In 2017 IEEE 29th
international conference on tools with artificial intelligence (ICTAI) (p. 1210-1217). IEEE.
[25] Rundo, F. (2019). Deep LSTM with reinforcement learning layer for financial trend prediction in FX high frequency trading systems. Applied Sciences, 9(20),
4460.
[26] Adam, K., Marcet, A., & Nicolini, J. P. (2016). Stock market volatility and learning. The Journal of finance, 71(1), 33-82.
[27] Suresh, A. A Study on Fundamental and Technical Analysis. Int. J. Mark. Financ. Serv. Manag. Res. 2013, 2, 4459.
[28] YAHOO Yahoo Finance - Stock Market Live, Quotes, Business & Finance News 2022.
[29] KERAS Keras: the Python deep learning API Available online: https://keras.io/ (accessed on Jan 20, 2022).
[30] Sharpe, W. F. (1998). The sharpe ratio. Streetwisethe Best of the Journal of Portfolio Management, 169-185.
... Unified Trading Strategy benefits from the features of multiple indicators and it helps to automate stock trading by providing potential opportunities of buying and selling shares in stock market [24]. Five different technical indicators, including EMA, ADX, MACD, RSI, and TRIX are simultaneously applied on the stock data and if three or more technical indicators are able to mark a potential trend, UTS generate buy/sell signals accordingly. ...
... Five different technical indicators, including EMA, ADX, MACD, RSI, and TRIX are simultaneously applied on the stock data and if three or more technical indicators are able to mark a potential trend, UTS generate buy/sell signals accordingly. The marked up/down trends and corresponding buy/sell signals are generated under the combined influence of collaborated technical indicators [24]. ...
... Later, the same neural network model works as stand-alone system to predict buy and sell signals. We adopt the default configuration of the neural network model [24]. The overall strategy is depicted through Fig. 2. 3. Mark trend days based on the output of each indicator. ...
Article
Full-text available
In this article we evaluate the deployment of a smart trading system that exploits the features of different technical indicators for intelligent stock trading. Depending on their behaviors, these indicators help in trading under various market conditions. Our smart trading system uses a unified trading strategy that selects five indicators from three well-known categories referred as leading, lagging, and volatility indicators. The trading system looks for common trend signals from at least three indicators within a certain period of time. Collectively generated signals from the technical indicators are used to train a neural network model. The trained neural network model is then used to produce buy and sell signals for trading in stocks. The system is efficient and convenient to use for both individual traders and fund managers. We tested the model on actual data collected from Saudi Stock Exchange and New York Stock Exchange. The performance of the model was checked in terms of percentage returns. The results of the proposed trading model were compared with the benchmark trading strategy. The deployed smart trading system is efficient to produce significant returns over the longer and shorter timeframes.
... Unified Trading Strategy benefits from the features of multiple indicators and it helps to automate stock trading by providing potential opportunities of buying and selling shares in stock market [24]. Five different technical indicators, including EMA, ADX, MACD, RSI, and TRIX are simultaneously applied on the stock data and if three or more technical indicators are able to mark a potential trend, UTS generate buy/sell signals accordingly. ...
... Five different technical indicators, including EMA, ADX, MACD, RSI, and TRIX are simultaneously applied on the stock data and if three or more technical indicators are able to mark a potential trend, UTS generate buy/sell signals accordingly. The marked up/down trends and corresponding buy/sell signals are generated under the combined influence of collaborated technical indicators [24]. ...
... Later, the same neural network model works as stand-alone system to predict buy and sell signals. We adopt the default configuration of the neural network model [24]. The overall strategy is depicted through Fig. 2. 3. Mark trend days based on the output of each indicator. ...
Article
Full-text available
In this article we evaluate the deployment of a smart trading system that exploits the features of different technical indicators for intelligent stock trading. Depending on their behaviors, these indicators help in trading under various market conditions. Our smart trading system uses a unified trading strategy that selects five indicators from three well-known categories referred as leading, lagging, and volatility indicators. The trading system looks for common trend signals from at least three indicators within a certain period of time. Collectively generated signals from the technical indicators are used to train a neural network model. The trained neural network model is then used to produce buy and sell signals for trading in stocks. The system is efficient and convenient to use for both individual traders and fund managers. We tested the model on actual data collected from Saudi Stock Exchange and New York Stock Exchange. The performance of the model was checked in terms of percentage returns. The results of the proposed trading model were compared with the benchmark trading strategy. The deployed smart trading system is efficient to produce significant returns over the longer and shorter timeframes.
... Meanwhile, the implementation of deep learning became possible with the help of modern computing resources, like powerful machines, advanced algorithms, and availability of larger datasets. It served many disciplines and solved complex problems in computer vision, healthcare, stock trading, social networks, and real-world problems from numerous branches of engineering (Mahfooz et al., 2023;Mahfooz et al., 2022;Zhong et al., 2021). In chemical engineering, the use of DNN is highly valuable for solving complex problems. ...
Article
Full-text available
Accurate vapor-liquid equilibria (VLE) calculations of carbon dioxide and hydrogen sulfide mixtures are critical to gas processing and the affordable, safe design of flow assurance technologies. Inaccurate VLE predictions can lead to inaccurate gas hydrate phase equilibria predictions and ensuing safety and economic risks. This research paper explores the potential incorporation of Deep Neural Networks (DNNs) to support conventional expert systems within the context of predicting VLE. It facilitates more flexible and data-driven approaches that are required due to the growing intricacy and dynamic character of chemical processes. Moreover, various cubic and non-cubic equation of state (EoS) models (such as SRK, PR, CPA, SAFT, and PC-SAFT) were also examined to compare predicted VLE for various mixtures of CO2 and H2S. Prior to the comparison of DNN-predicted VLE with EOS models, binary interaction parameters were optimized for all EOS with the available experimental phase equilibria measurements. Model accuracies were compared and analyzed for various binary systems containing CO2/H2S + other associative and non-associative components. The absolute average deviation in vapor and liquid phase composition/bubble pressure was calculated and compared for all five-state EOS with DNN predictions. The DNN and equation of states with BIP gave a reliable illustration of the phase behavior of CO2/H2S-containing systems compared to others as indicated by the lower AADP values. By contrasting the applied DNN model with conventional techniques, we explore the promising channel for future research directions and industry applications, as well as an opportunity for innovation and field advancement for modern expert systems.
... The relationship between economic growth and stock trading is also dynamic and influenced by many factors. Stock market performance can provide valuable insights into the state of the economy and can impact consumer behaviour and corporate financing [16][17]. Companies that invest in research and development to create new products and applications using technology can stimulate economic growth through innovation. ...
Article
Remittances are one of the largest sources of financial inflow for developing countries and it imparts a considerable importance to economic growth. The purpose of our study is to analyse the impact of foreign workers' remittances on GDP and in succession on economic growth. We processed annual time series data over the period 1980-2019. ADF unit root test was used to check the stationarity of variables. To check the short run and long run relationship between foreign workers' remittances and GDP of Pakistan, ARDL (bounds) test was applied. As a result of our analysis, we found a significant positive relationship between remittances and economic growth of Pakistan. Our results provide thoughtful guidelines to policy makers who can use these insights to decide relevant and favourable policies and legislations.
Article
Full-text available
Options trading is a process of speculating the strike price of an underlying security or index on the expiration date. To finalize the options contract, a trader pays a small percentage as premium. This paper is to maximmize the profits of trader and minimize their loses which is generally manual based process, but this research paper helps integrates finance with technology. It fills the gap between the implementation of deep learning and algorithm trading, with option trading. We have named this model as Option Trading Prediction Model (OTP). This paper can be referred to develop an option trading tool or platform. The paper contains the information in the following manner, Introduction, describes an overview of Model Features, followed by an overview of Evaluation which includes data collection and preprocessing. Later on, discusses Model training and about the modelling and prediction.
Article
Full-text available
In this literature review, we investigate machine learning techniques that are applied for stock market prediction. A focus area in this literature review is the stock markets investigated in the literature as well as the types of variables used as input in the machine learning techniques used for predicting these markets. We examined 138 journal articles published between 2000 and 2019. The main contributions of this review are: 1) an extensive examination of the data, in particular, the markets and stock indices covered in the predictions, as well as the 2173 unique variables used for stock market predictions, including technical indicators, macro-economic variables, and fundamental indicators, and 2) an in-depth review of the machine learning techniques and their variants deployed for the predictions. In addition, we provide a bibliometric analysis of these journal articles, highlighting the most influential works and articles.
Article
Full-text available
Long Short Term Memory (LSTM) is among the most popular deep learning models used today. It is also being applied to time series prediction which is a particularly hard problem to solve due to the presence of long term trend, seasonal and cyclical fluctuations and random noise. The performance of LSTM is highly dependent on choice of several hyper-parameters which need to be chosen very carefully, in order to get good results. Being a relatively new model, there are no established guidelines for configuring LSTM. In this paper this research gap was addressed. A dataset was created from the Indian stock market and an LSTM model was developed for it. It was then optimized by comparing stateless and stateful models and by tuning for the number of hidden layers.
Article
Full-text available
High-frequency trading is a method of intervention on the financial markets that uses sophisticated software tools, and sometimes also hardware, with which to implement high-frequency negotiations, guided by mathematical algorithms, that act on markets for shares, options, bonds, derivative instruments, commodities, and so on. HFT strategies have reached considerable volumes of commercial traffic, so much so that it is estimated that they are responsible for most of the transaction traffic of some stock exchanges, with percentages that, in some cases, exceed 70% of the total. One of the main issues of the HFT systems is the prediction of the medium-short term trend. For this reason, many algorithms have been proposed in literature. The author proposes in this work the use of an algorithm based both on supervised Deep Learning and on a Reinforcement Learning algorithm for forecasting the short-term trend in the currency FOREX (FOReign EXchange) market to maximize the return on investment in an HFT algorithm. With an average accuracy of about 85%, the proposed algorithm is able to predict the medium-short term trend of a currency cross based on the historical trend of this and by means of correlation data with other currency crosses using techniques known in the financial field with the term arbitrage. The final part of the proposed pipeline includes a grid trading engine which, based on the aforementioned trend predictions, will perform high frequency operations in order to maximize profit and minimize drawdown. The trading system has been validated over several financial years and on the EUR/USD cross confirming the high performance in terms of Return of Investment (98.23%) in addition to a reduced drawdown (15.97 %) which confirms its financial sustainability.
Article
Full-text available
Forecasting stock prices plays an important role in setting a trading strategy or determining the appropriate timing for buying or selling a stock. We propose a model, called the feature fusion long short-term memory-convolutional neural network (LSTM-CNN) model, that combines features learned from different representations of the same data, namely, stock time series and stock chart images, to predict stock prices. The proposed model is composed of LSTM and a CNN, which are utilized for extracting temporal features and image features. We measure the performance of the proposed model relative to those of single models (CNN and LSTM) using SPDR S&P 500 ETF data. Our feature fusion LSTM-CNN model outperforms the single models in predicting stock prices. In addition, we discover that a candlestick chart is the most appropriate stock chart image to use to forecast stock prices. Thus, this study shows that prediction error can be efficiently reduced by using a combination of temporal and image features from the same data rather than using these features separately.
Article
Full-text available
Automated trading, which is also known as algorithmic trading, is a method of using a predesigned computer program to submit a large number of trading orders to an exchange. It is substantially a real-time decision-making system which is under the scope of Enterprise Information System (EIS). With the rapid development of telecommunication and computer technology, the mechanisms underlying automated trading systems have become increasingly diversified. Considerable effort has been exerted by both academia and trading firms towards mining potential factors that may generate significantly higher profits. In this paper, we review studies on trading systems built using various methods and empirically evaluate the methods by grouping them into three types: technical analyses, textual analyses and high-frequency trading. Then, we evaluate the advantages and disadvantages of each method and assess their future prospects.
Article
Present-day securities trading is dominated by fully automated algorithms. These algorithmic systems are characterized by particular forms of knowledge risk (adverse effects relating to the use or absence of certain forms of knowledge) and principalagent problems (goal conflicts and information asymmetries arising from the delegation of decision-making authority). Moreover, where automated trading systems used to be based on human-defined rules, increasingly, machine-learning (ML) techniques are being adopted to produce machine-generated strategies. Drawing on 213 interviews with market participants involved in automated trading, this study compares the forms of knowledge risk and principal-agent relations characterizing both human-defined and ML-based automated trading systems. It demonstrates that ML-based automated trading leads to a change in knowledge risks, particularly concerning dramatically changing market settings, and that it is characterized by a lack of insight into how and why trading rules are being produced by the ML systems. This not only intensifies but also reconfigures principal-agent problems in financial markets.
Article
Numerous studies have adopted deep learning (DL) in financial market forecasting models owing to its superior performance. The DL models require as many relevant input variables as possible to improve performance because they learn high-level features from these inputs. However, as the number of input variables increases, the number of parameters also increases, leaving the model prone to overfitting. We propose a novel stock-market prediction framework (LSTM–Forest) integrating long short-term memory and random forest (RF) to address this issue. We also develop a multi-task model that predicts stock market returns and classifies return directions to improve predictability and profitability. Our model is interpretable because it can identify key variables using the variable importance analysis from RF. We used three global stock indices and 43 financial technical indicators to verify the proposed methods experimentally. The root mean squared errors of LSTM–Forest with multi-task (LFM) in predicting returns from S&P500, SSE, and KOSPI200 were 25.53%, 22.75%, and 16.29% lower, respectively, than those of the baseline RF model. The model’s balanced accuracy in forecasting the daily return direction increased by 7.37, 1.68, and 3.79 points, respectively. Furthermore, our multi-task model outperforms our single-task model and previous DL approaches. In the trading test, LFM produced the highest profits—even compared with the long-only strategy when transaction costs were considered. The proposed framework is readily extensible to other tasks and fields that contend with high-dimensionality problems.
Article
Stock market prediction has been a classical yet challenging problem, with the attention from both economists and computer scientists. With the purpose of building an effective prediction model, both linear and machine learning tools have been explored for the past couple of decades. Lately, deep learning models have been introduced as new frontiers for this topic and the rapid development is too fast to catch up. Hence, our motivation for this survey is to give a latest review of recent works on deep learning models for stock market prediction. We not only category the different data sources, various neural network structures, and common used evaluation metrics, but also the implementation and reproducibility. Our goal is to help the interested researchers to synchronize with the latest progress and also help them to easily reproduce the previous studies as baselines. Based on the summary, we also highlight some future research directions in this topic.
Article
The unique nature of capital market instruments forces investors to depend strongly on fundamental factors in their investment decisions. These fundamental factors relate to the overall economy or a specific industry or a company. The performance of the securities that represent the company can be said to depend on the performance of the company itself. However, as companies are a part of industrial and business sector, which in turn are a part of overall economy, so even the economic and industry factors can affect the investment decision. The selection of an investment will start with fundamental analysis. Fundamental analysis examines the economic environment, industry performance and company performance before making an investment decision.
Article
High-frequency trading (HFT) has continuously evolved and dominated trading in the past decades. However, HFT trading marker prediction is a rarely investigated problem in Fintech literature. In this study, we first propose a novel manifold learning based HFT trading marker prediction model: M-SCAN to handle this challenge. Our study takes advantage of manifold embeddings of HFT data and seeks potential markers among the outliers in density-based clustering. We further propose HFT trading marker evaluation algorithms to validate the prediction effectiveness besides unveiling trading marker discovery via visualization. Our results demonstrate locally linear embedding (LLE) outperforms its peers in capturing trading markers in terms of accuracy and complexity for its local data structure keeping mechanism in embedding though different stocks may demonstrate their model preference under M-SCAN. Our studies also propose novel entropy and variance concentration ratios (VCR) to quantify HFT data and show that a high-entropy dataset is more likely to have better trading marker prediction than a low-entropy one. To the best of our knowledge, it is the first study in HFT trading marker prediction and will inspire coming studies in this area.