Impact of Technical Parameters For Short - and Long-Term Analysis of

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Materials Today: Proceedings 80 (2023) 1731–1736

Contents lists available at ScienceDirect

Materials Today: Proceedings


journal homepage: www.elsevier.com/locate/matpr

Impact of Technical Parameters for Short- and Long-term Analysis of


Stock Behavior
E.R. AL Silni Ahmed, S.B. Goyal ⇑
City University, Petaling Jaya 46100, Malaysia

a r t i c l e i n f o a b s t r a c t

Article history: Stock price forecasting is a type of time series problem that forecasts the future price or status of a com-
Available online 3 June 2021 pany on the basis of analysis of time respective values. As the price of stock or company varies with
respect to time, its behavior can be analyzed by different machine learning approaches. In this work,
Keywords: methodology is proposed to evaluate the stock position with variation in time using deep learning
Stock Market Price approach such as recurrent neural network (RNN). This methodology used the technical parameters to
Technical indicators evaluate the long term and short-term analysis of any stock or share. This approach also evaluates and
Co-relation analysis
gives suggestions to investors either to buy or sell any stock for long term and gives return at very
Stock Prediction
RNN
low risk. In this paper work, hybridization of co-relation analysis and deep learning approach for stock
price and long-term behavior analysis. The proposed work is termed as time lagged weight optimized
RNN (TL-WO-RNN) that is adopted in this work and effectively predict the technical parameters and
on the basis of that stock behavior is also predicted. The result analysis was performed on data from dif-
ferent sectors and such as Telecom, Powers, Manufacturing, Finance, Software sectors, etc. The result
analysis shows the effectiveness of the TL-WO-RNN algorithm as compared to existing work.
Ó 2021 Elsevier Ltd. All rights reserved.
Selection and peer-review under responsibility of the scientific committee of the International Confer-
ence on Nanoelectronics, Nanophotonics, Nanomaterials, Nanobioscience & Nanotechnology.

1. Introduction to its time series data behavior. Many researches and authors with
their rigorous efforts are able to study the time series data that
The stock market forms the fast going platform for procuring were also detected to be comprising of redundancies along with
large profits in small time interval by the majority of the big busi- the noises. The various works analyzed have explored mathemati-
nessmen in recent days. However the financial market comes cal and statistical approaches to carry out the predictive work for
enveloped with the risk of high losses while their asset investment the cost of stock prices. Certain works also assisted the advance-
in these areas as well if the judgement and analytical decision of ment in this field by designing machine learning of historical data
any individual fails that is average to bring about the misfortunes and then achieving the forecasting purpose for long term and
too. Hence there have been researches and works that are inclined short-term exchange. By properly utilizing these parameters, pre-
and dedicated towards drawing a framework that can more pre- diction of stock market can be done through the techniques per-
cisely and closely determine the expected rise and falls in the mar- taining to machine learning. Nabipour et al. [1] used the deep
ket for dropping the perceptions. From the studies it has been learning models to predict and analyze the behavior of stock price.
inferred that the in order to attain precise and most exact learning This approach was designed to reduce the market risk. In this work,
of the market behavior it is inexplicable to revise and comprehend different sector data was taken such as financial data for their
all the factors that have an effect on the market. The various factors diversification analysis. In this work, author analyzed different
are inclusive of entire technical as well as economical components machine learning algorithms and found that Recurrent Neural Net-
that bring about the decision of the time and duration of invest- work (RNN) and Long short-term memory (LSTM) outperforms
ment along with the study of returns. It was found a very typical best. But among two RNN results best output. This work also con-
task to dissect the conduct and prediction of the stock prices due sidered technical parameters but didn’t identified any relationship
among these features for future stock behaviour. Z.D. Aksßehir and
E. Kılıç [2] in this paper presented are the some bank stock of the
⇑ Corresponding author. forecast for the closing price in this research. According to linear

https://doi.org/10.1016/j.matpr.2021.05.474
2214-7853/Ó 2021 Elsevier Ltd. All rights reserved.
Selection and peer-review under responsibility of the scientific committee of the International Conference on Nanoelectronics, Nanophotonics, Nanomaterials,
Nanobioscience & Nanotechnology.
E.R. AL Silni Ahmed and S.B. Goyal Materials Today: Proceedings 80 (2023) 1731–1736

patterns are Observations show of that the stocks evolve. There for factors influence the financial market. For instance, a country’s
the different regression and decision tree methods are estimation social status, political status and economic status related to a coun-
models were created are the used. And these method are used to try. It is the need of the hour to have an accurate and automatic
created model and the used of the input variable of the used two system that will aid in the prediction of future aspects. This is
different types. In the set of the first input variable are the four because the irregular and fluctuating data has continuously
basic indicators and the techniques 46 (are the total indicator of increased in amount with the passage of time. By digging deeper
the 50). The small number of the indicator technical of due of small into the financial data, it is easier to develop a novel approach that
number, and the second set of input variable are the consist of the could aid in the prediction of stock prices as far investment and
main indicator are the 4, and the technical nature of the 29 indica- trading are concerned. Hence, the risk involved in the investment
tor (are the total indicator 33). These set of the input variable to gets lowered through this time series prediction system.
evaluate and the Trent are the used of the R2 criterion with of A close look at the trend in the individual stocks’ history could
the respect two model. These are the R2 results after then it was bring down uncertain investment choices. An in depth analysis of
found that are the model prediction had a positive effect on the the stock exchange trend, the simplest time is selected that is com-
performance. The reduced of the technical indicator are the reason. pletely suitable for purchasing and selling stocks. A number of
L. Sayavong, Z. Wu and S. Chalita [3] proposed a predictive model models exist, that combine the machine learning techniques with
of the stock forecasting in this paper. The need of the financial mar- the technical analysis for appropriate prediction of stock value
keting and the sector concerned of the adapted model on this movement
paper. And the mind of the convolution neural network (CNN)
and the Thai stock market are with, the date set after pre-
processing are the performed was the adequate training and the 2.1. Flow chart
testing. The nature in the Indian stock market in the volatile. The
convenient tool with the give people who trade are the Sharma The strategies pertaining to pricing can put forward evidence of
et al. [4] are the proposed method of the forecasting cost on the risk and also aid to minimize the risks involved with the equity
trends and the respect to the inventory of that takes into the investors. Cost-effective strategies or risk-adjusted strategies could
account the potential of the fundamental analysis of the review be developed through predictive studies. The reason being, the risk
and the machine learning. Strategies, for example, assessment level pertaining to an investment portfolio could get affected
investigation, multivariate relapse model and decomposable time through improved predictability. As a result, risk adjusted returns
arrangement model were utilized to give a system to estimating could be obtained by the investors through more accurate forecasts
and value examination. The huge demand for stock value conjec- for the pricing. The primary objective related to the present work is
tures and holes were noticed and dissected by Wei [5] in his explo- to put forward a combined machine learning approach that
ration. The examination between the various techniques accessible includes technical indicators so that future prices of specific stocks
for the forecast of neural organizations was done and broke down. could be predicted.
In the end, long haul transient memory or LSTM neural organiza- The proposed procedure includes the following steps:
tion was picked. In present scenario on neural network architec-
ture CISS compatible for multilayer which further discussed by  Extraction of Data
the researcher Yang et.al. [6]. Initial knowledge from financial sec-  Discovering technical indicators
tor is a appropriate method to attain knowledge with further for-  Figuring out relation amongst features
ward in initial phase some inferential news create more  Data classification into three kinds: holding type, selling type
attention which is also so the input of our method the news repre- and buying type
sentation output is the main concentrated area on which the each  Calculating the parameters of performance for variable features,
moment of stock price depend which is further affect the final that have variable testing and training set.
mechanism and put a weight age which are assigned to the day
some empirical analysis of historical values of the stock quantity Fig. 1 demonstrates a flow chart for the proposed algorithm so
has been done which shows between the conventional and tradi- that buying and selling status of stocks related to a company could
tional methods. be predicted.
Some network indicators of financial nature were also introduce
by kyun et. al. [7].some Indications come from the Global investors
strategies a vector auto regression model and a volatility in the 2.1.1. Data extraction
network for the non-directional and directional equity market it The historical datasheets pertaining to the extraction of techni-
is identify in the present analysis the system of simple pair corre- cal features were collected from various companies for the year
lation and system level affiliation for the national equity value was 2015–2020. This was done to appropriately model the stock mar-
considered by various machine learning approaches some network ket analysis. The yahoo finance website was primarily utilized to
indicators have been employed such as Logistic regression, carrier obtain historical dataset. In order to carry out simulation analysis,
vector machine, random forest some point is figured out by observ- the historical dataset for 10 companies was made for about three
ing affecting effectiveness of these indicators. years (2015–2020). The rise or fall of any stock or share is pre-
dicted through the datasets, hence they are important. A suitable
machine learning algorithm is employed to train the available data
2. Methodology through proper use of weight recurrent neural network that is time
lagged (TL-WO-RNN).
In the modern day world, with the advancements in technology,
it is not possible for the humans to carry out analysis and make
accurate predictions for the future. As the digital communication 2.1.2. Technical Feature extraction
system gets advanced, it is possible to accumulate large amounts A certain formula is applied to the previous prices of a stock to
of data to carry out economic and financial analysis. The analysis derive data that in combination make the technical indicator. I
of financial time series data is not easy to analyze because the sce- order to make an in depth analysis of the proposed algorithm, 10
nario of the market changes every now and then [8,9]. A number of features are figured out.
1732
E.R. AL Silni Ahmed and S.B. Goyal Materials Today: Proceedings 80 (2023) 1731–1736

time window through the CCI. The average deviation and SMA
are also calculated through the use of number of CCI periods.
The value of the indicator varies between + 200 and 200. If a
value lesser that 200 is indicated, it is a weak price action and
it represents a buy or oversold condition. If a value higher
than + 200 is indicated, it is a strong price action and it represents
a sell or overbought condition.

2.1.4.4. Linear regression indicator (LRI). Trends and track trends, for
instance, a moving average is identified through the use of linear
regression indicator. If the price is very close to the bottom of
the channel, it represents a buy condition. On the contrary, if the
price is very close to the maximum value of LRI(the upper limit),
it represents a sell condition.

2.1.4.5. Double exponential moving average (DEMA). Since the Expo-


nential Moving average or EMA gets doubled, it is given the name
double. In order to wipe out the lag and to sync it with actual data,
”EMA of EMA” is deducted from EMA that was doubled previously.
Two signal lines that have a time period value of 12 and 24 are
plotted within DEMA. When the output value of the DEMA is
Fig. 1. Flow Chart of Proposed Architecture. higher than both signal lines, it represents a buy condition. When
the value is less than both signal lines, it represents a sell
condition.
2.1.3. Moving average convergence divergence (MACD)
The relationship amongst the moving averages related to the
stock prices is represented by an indicator termed as MACD or 2.1.4.6. Weighted moving average (WMA). Two basic signals related
Moving average convergence divergence: to the 200-day WMA exist. A long signal or buy condition is repre-
sented by a condition in which the price is more that 200-day
MACD ¼ EMA26  EMA12 ð1Þ WMA. A short signal or sell condition exists when the price is less
A signal line is generated from MACD9 which determines the than the 200-day WMA.
buying and selling condition for any stock price. In MACD is below
the signal line then buying condition is taken whereas if it is above 2.1.4.7. Detrended price oscillator (DPO). In order to eliminate long
signal line then sell condition is stated. term trends, reported moving average is employed by the technical
indicator known as DPO. For appropriate verification of the over-
2.1.4. Relative strength index (RSI) sold and overbought level, this indicator is utilized.
If a new high is formed over the previous one and the previous
value becomes greater than the corresponding de-trended price, it
RSI ¼ 100  ð100=ð1 þ RSÞÞ ð2Þ results in the generation of SELL or short signal.
Where, RS = AG/AL
AG = Average gain 2.1.4.8. Envelopes trading bands (ETB). In order to produce envel-
AL = Average loss opes, the bands considering fixed deviation percentage are defined
The RSI parameter is evaluated by estimating ratio of average by the ETB that employs simple or exponential moving average,
gain and average loss. This parameter is also evaluated for period If the indicated value is less than ETB lower value, it represents
of 14 days. a weak price action and a buy condition or oversold condition. If
the indicated value is more than ETB upper/ it represents a strong
2.1.4.1. Momentum. Momentum is one of the easiest oscillators, uptrend and a sell condition or overbought condition.
which aids in the measurement of intensity or frequency related
to price changes. For a 10-day pulse line to be constructed, the 2.1.5. Feature Co-relation analysis and selection
closing price for last 10 days has to be deducted from the last For finding relationship between features Spearman, Kendall
closing. and Pearson Co-relation are evaluated. These are discussed below
At zero line cross or at 100, a signal line is plotted. respectively.
When a stock trends higher, it should be bought only at a stage Spearman Co-Relation
when the indicators goes under the 100 line cross or zero. Spearman Co-Relation coefficient r is calculated by the formula
mentioned below:
2.1.4.2. Simple moving average (SMA). The average prices related to  
r ¼ 1  ð6Rd2i Þ=n n2  1 ð3Þ
a stock for a certain time period is calculated through the use of
SMA. The arithmetic mean of T past prices Ci is termed as Simple Where,
Moving Average (SMA) di = difference between variables P and Q
The 200 day moving average is related to two fundamental sig- n = sample size
nals. A short signal or a sell condition exists when price is lesser Kendall Co-Relation
that the 200 day SMA and a long signal or a buy condition exists Kendall Co-Relation coefficient s is calculated by the formula as
when the price is>200 day SMA. given below:
s ¼ ðnc  nd Þ=ð1=2nðn  1ÞÞ ð4Þ
2.1.4.3. Commodity channel index (CCI). A comparison between the
average price and the current average price is done for a typical Where,
1733
E.R. AL Silni Ahmed and S.B. Goyal Materials Today: Proceedings 80 (2023) 1731–1736

nc = number of concordant values (if xi < xj) False Positive (FP) = If predicted value is sell but actual value is
nd = number of discordant values (if xi > xj) buy.
n = sample size False Negative (FN) = If predicted value is buy but actual value is
Pearson Co-Relation sell.
Pearson Co-Relation coefficient q is calculated by the formula as
given below: 3.1.2. Precision
E½AD  E½AE½D
q ¼ sffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
rffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ð5Þ
ðTPÞ
h i
Precision ¼  100 ð8Þ
E½A2   ðE½AÞ2 E D2  ðE½DÞ2 ðTP þ FP Þ

Where,
3.1.3. Recall
A = first element (attribute)
D = second element (attribute)
E = sum of the elements ðTP Þ
Recall ¼  100 ð9Þ
After finding Spearman, Kendall and Pearson co-relation respec- ðTP þ FN Þ
tively a list of features are gathered that satisfy the respective cor-
relation criteria. After obtaining the three individual results which
3.1.4. F_Measure
reduces the number of features using algorithm below:

Algorithm:. rows nrows(Dataset) 2  Precision  Recall


F Measure ¼  100 ð10Þ
cols ncols(Dataset) ðPrecision þ RecallÞ
Sc spearman(Dataset)
Kc kendall(Dataset) 3.2. Result analysis
Pc pearson(Dataset)
for each i in 1:cols do In this sub-section performance is evaluated on the basis of
if Scr[i] > 0 AND Kc[i] > 0 AND Pc[i] > 0 then some quantitative measures as shown in Table 2.
Selection true
3.3. Comparative performance evaluation
else
Selection false
In the above sections, the performance of proposed methodol-
end if ogy is analyzed by evaluating performance measures such as
end for RMSE, MAE. After that forecasting is performed for all the parame-
return dataset[Selection] ters included in this research work. In last the performance of
existing work is compared with existing work. In this section the
work is compared with existing work given by [1]. Nabipour
2.1.6. Stock price forecasting et al. [1] used the deep learning models to predict and analyze
The proposed time lagged weight optimized recurrent neural the behavior of stock price. This approach was designed to reduce
network works as following: the market risk. Table 3 represents the comparison results of pro-
n – number of input variables posed and existing work.
wtij – node link weight from layer i to layer j, where wtij (value
lies between [0,1])
a = node selection operator, (>0) 4. Conclusion
b = learning operator, (value lies between [0,1])
We have shown proposed time lagged optimized steps in With an application of deep learning approach, the proposed
Table 1. (Read from row 1 to row 2) model analyze the short and long term analysis. For technical
parameter evaluation historical dataset will be taken and deep
3. Result and discussions learning approach will suggest the movement of stock price. The
application of proposed methodology, the more accurate analysis
The simulation of the proposed methodology is performed will be performed which leads to least loss in future investment.
under following system requirements, The processor being used In this research work, time lagged weight optimized recurrent neu-
is Pentium Core I5-2430 M CPU @ 2.40 GHz,RAM – 4 GB,The OS uti- ral network (TL-WO-RNN), a deep learning approach, is used to
lized id 64-bit, Software: MATLAB predict the closing price of any stock on the basis of technical
parameters. Further this work was enhanced to show the buy, sell
3.1. Performance measures and hold indicators for long term investment as well as short term
investment. The method was implemented and compared with
3.1.1. Accuracy some existing work. From the result analysis following conclusions
are derived:
ðTP þ TNÞ
Accuracy ¼  100 ð7Þ  Other than historical data, technical indicators are considered to
ðTP þ TN þ FP þ FNÞ be one of the most important factors to decide the trend of stock
Where, price.
True Positive (TP) = If predicted and actual value, both are  Feature co-relation evaluates which features are co-related and
showing buy signal. helps in determining stock condition.
True Negative (TN) = If predicted and actual value, both are  Minimum error rate was observed.
showing sell signal.  Combination of technical features improves efficiency.

1734
E.R. AL Silni Ahmed and S.B. Goyal Materials Today: Proceedings 80 (2023) 1731–1736

Table 1
Proposed time lagged steps and output details.

Step 1 –Initializationfor each input value from node i to node j from Li to Lj


Node_selection function (NSF) = (min(inp_valij, wtij}))/(aij + wti);
end
Then select that node having:
NSF = max{NSFi : i = 1 . . . M, where M is number of NSF parameters}.
Then calculate the value at internal nodes that must be passed to next layer node:
P
y ¼ ni¼1 xi wt i þ bi (vi)
Step 2 – Training
Value at output layer is calculated as:
i wt j
a ¼ expð wt2s 2 Þ
s is learning rate (value lies between [0,1])
For i = 1 to size of node link (i.e length of wtij)
Output_val(i) = exp(-norm(wtij)-wti))
End for
yij ¼ aij  outij
Evaluated error :
err = mse (output_val – target_val)
If err > threshold target value or err > max_iteration, then weight update is performed.
wtij = b *(min(input, wtij)) + (1- b)* wtij;
repeat step 1 and 2
else
exit
After evaluating these parameters, prediction of technical indicators, following rules are designed and stock position is determined.
Let SELL = 0, BUY = 1, HOLD = 2, thd = threshold signal val, Pred_val = predicted value, upper_thd = upper signal value, lower_thd = lower signal line
MACD Output
If
average(pred_val) < average(thd)
MACD_out = 0
Else
MACD_out = 1
End if
For RSI Output
If
average(pred_val) > average(upper_thd)
RSI_out = 0
Elseif average (pred_val) < average(lower_thd)
RSI_out = 1
End if
MOMENTUM Output
If
average(pred_val) < average(thd)
MOMENTUM _out = 0
Else
MOMENTUM _out = 1
End if
CCI Output
If
average(pred_val) > average(upper_thd)
CCI_out = 0
Elseif average (pred_val) < average(lower_thd)
CCI _out = 1
End if
SMA Output
If
average(pred_val) < average(thd)
SMA _out = 0
Else
SMA _out = 1
End if
LRI Output
If
max(pred_val) < average(SMA _out)
LRI_out = 0
else
LRI _out = 1
End if
DEMA Output
If
average(pred_val) > average(thd(12 days)) && average(pred_val) > average(thd(24 days))
DEMA _out = 1
Else
DEMA _out = 0
End if

(continued on next page)

1735
E.R. AL Silni Ahmed and S.B. Goyal Materials Today: Proceedings 80 (2023) 1731–1736

WMA Output
If
average(pred_val) < average(thd)
WMA_out = 0
else
WMA _out = 1
End if
DPO Output
If
average(pred_val) > max(DPO)
DPO_out = 0
else
DPO _out = 1
End if
ETB Output
If
average(pred_val) < average(lower_thd)
WMA_out = 1
Elseif average(pred_val) > average(upper_thd)
WMA _out = 0
End if
Stock position is predicted as below:
For features selection
if count(SELL) > count(BUY)
Final_out = 0
else
Final_out = 1
end if
else
Final_out = 2
end if.

Declaration of Competing Interest


Table 2
Classification Performance Evaluation.
The authors declare that they have no known competing finan-
Accuracy Precision Recall F_Score
cial interests or personal relationships that could have appeared
Finance 0.96 0.967391 0.988889 0.978022 to influence the work reported in this paper.
Telecomm 0.915 0.917582 0.988166 0.951567
Manufacturing 0.905 0.870968 0.642857 0.739726
Power 0.945 0.964286 0.97006 0.967164
References
Software 0.955 0.942857 0.992481 0.967033
Bank 0.8 0.865385 0.876623 0.870968 [1] Mojtaba Nabipour, Pooyan Nayyeri, Hamed Jabani, Shahab and Amir Mosavi.
Average 0.913333 0.921411 0.909846 0.912413 Predicting Stock Market Trends Using Machine Learning and Deep Learning
Algorithms Via Continuous and Binary Data; a Comparative Analysis. IEEE
Access, 8, 150199- 150212 (2020).
[2] Z. D. Aksßehir and E. Kılıç. Prediction of Bank Stocks Price with Reduced Technical
Indicators. 4th International Conference on Computer Science and Engineering
(UBMK), Samsun, Turkey, pp. 206-210 (2019).
[3] L. Sayavong, Z. Wu and S. Chalita. Research on Stock Price Prediction Method
Table 3 Based on Convolutional Neural Network. International Conference on Virtual
Comparative Analysis for Stock Price Forecasting. Reality and Intelligent Systems (ICVRIS), Jishou, China, pp. 173-176 (2019).
[4] V. Sharma, R. Khemnar, R. Kumari, B.R. Mohan, Time series with sentiment
Accuracy F_Score analysis for stock price prediction, in: 2nd International Conference on
Proposed 0.913 0.91 Intelligent Communication and Computational Techniques (ICCT), 2019, pp.
Existing (RNN) 0.901 0.902 178–181.
[5] D. Wei. Prediction of Stock Price Based on LSTM Neural Network. International
Existing (LSTM) 0.898 0.899
Conference on Artificial Intelligence and Advanced Manufacturing (AIAM),
Dublin, Ireland, pp. 544-547 (2019).
[6] L. Yang et al. Explainable Text-Driven Neural Network for Stock Prediction. 5th
IEEE International Conference on Cloud Computing and Intelligence Systems
 On the prediction behaviour of the proposed work will deter- (CCIS), Nanjing, China, pp. 441-445 (2018).
mine the stock position for buy, sell or hold. [7] Tae Kyun, Leeab Joon, Hyung Chob Deuk, Sin Kwonb. Global stock market
investment strategies based on financial network indicators using machine
learning techniques. Expert Systems with Applications (2018).
[8] B.M. Henrique, V.A. Sobreiro, H. Kimura, Stock price prediction using support
vector regression on daily and up to the minute prices, J. Finance Data Sci. 4 (3)
CRediT authorship contribution statement (2018) 183–201.
[9] Feng Zhou, Hao-min Zhou, Zhihua Yang, Lihua Yang.EMD2FNN: A strategy
combining empirical mode decomposition and factorization machine based
E.R. AL Silni Ahmed: Conceptualization, Methodology, Soft- neural network for stock market trend prediction. Expert Systems with
ware, Visualization, Writing - original draft. S.B. Goyal: Data cura- Applications (2018).
tion, Supervision, Software, Validation, Writing - review & editing.

1736

You might also like