Combination Method between Fuzzy Logic and Neural Network Models to Predict Amman Stock Exchange

The purpose of this paper is to consider the potential in the projection of Fuzzy logic and Neural networks, also to make some combination between models to address implementation issues in the prediction of index and prices for Amman stock exchange in different models, where the previous researchers have to demonstrate the differences between these measures. We have used in this research Amman stock Exchange index prices data as a sample set to compare the different application models, where predicting the stock market was very difficult since it depends on nonstationary financial data, in addition to the most of the models are nonlinear systems. These papers draw an existing academic and practitioner in literature review as a combination of these models and compare them, the facilities of the development of conceptual methods and the research proposition are the basis for serving this combination. Hence, the present and recent papers can serve the further researchers into addressing contemporary barriers in the direction of these researchers. The authors show in this paper the Fuzzy logic and Neural networks, in addition to time series analysis through these models, utilized of RSI, OS, MACD, and OBV, then using MSE, MAPE, and RMSE. The research implication represents of too much data for the period of study, also this paper is conceptual in its nature, the paper highlights in finding that the implementation challenges, and how these challenges can facilitate the trader decision in the stock market. The results of the analysis show that the ANFIS is the better model to achieve prediction of stock market more than others. When are MAPE and RMSE the best more than simulating the errors in other methods? Also the fuzzy-neural models as the results of table show that more prominent in fuzzy-neural models ,while it appears that in MSE as medium, MAD posses How to cite this paper: Alalaya, M.M., Al Rawashdeh, H.A. and Alkhateb, A. (2018) Combination Method between Fuzzy Logic and Neural Network Models to Predict Amman Stock Exchange. Open Journal of Business and Management, 6, 632-650. https://doi.org/10.4236/ojbm.2018.63048 Received: January 26, 2018 Accepted: June 19, 2018 Published: June 22, 2018 Copyright © 2018 by authors and Scientific Research Publishing Inc. This work is licensed under the Creative Commons Attribution International License (CC BY 4.0). http://creativecommons.org/licenses/by/4.0/ Open Access M. M. Alalaya et al. DOI: 10.4236/ojbm.2018.63048 633 Open Journal of Business and Management less amount than other models in all table testing fuzzy-neural models, therefore, it becomes superior in stock prediction.

For the trader it provides a good place for profit-making, but it is very risky, therefore their decision is critical, and must be taken correctly and at the right time, enhance, the experience shows that high profits are in other hand is very risky implication, which should be filtered in order to have good financial decision, thus this process need to develop models where can trader identify and state one of these in use.In so far in this paper proposes to have simple inference indicator models, to simplify the complicity to the stock market environment, therefore the paper take account of this field Fuzzy Logic and dual time series; to perform among the compression good decision in trading the stock assets.In this paper, section one includes the objectives of this research, and introduction to the subject of study, where section two discussed the literature review concepts related to Fuzzy, such as Fuzzy time series, and dual time series, causality in the stock market and the equivalent ANFIs structure as a brief notes.Section three introduced the data and methodology.Section IV includes the models of the study .wheresection five represents the implementation results of the combination techniques which used in this paper, and the empirical results.Were section six concluded the results of the study and gives a brief conclusion in order to simplify the computations of fuzzy time series.

2: Literature Review:
2 -1: Recent studies: According to its high profits, stock market expected returns, where the trading process in this field is very risky, due to the decision which related to process in stock trading, it is an important process and very critical, because it must be a decision should be in a correct and on the right time.Therefore from the recent investment experience showed that the higher risk accompanied with higher expected returns [1].Many models have been used in recent studies, and some of them has been developed over the years, in order to understand, also to have the accurate prediction of the stock market, some of them belong to the stochastic models; such as Garch, Arch, and volatility models [2].Also many various artificial intelligence techniques as the models which used by [3], another researcher as [4], have environment, their study based on inputs from technical analysis [5],employed in his research an exchange rate forecasting model, depends on wavelet transform time series analysis to predict the stock market, it seems that Chan.T on his study based on multi scale wavelet decomposition to provide the application of Fuzzy models [6].compare in this study the results of his analysis by the application of the Neural network, Garch-m model, E-Garch model Fuzzy logic model is derived from Fuzzy set theory and the main purpose aims of how to deal with imprecise information which provides a mechanism for the decision system, and this model manipulating imprecise concepts for the analyzed process.The network will produce three cases of outputs; buy, or sell a stock.or keep.This based on the information which serves the indicator.The Fuzzy set theory was introduced by[7]A,B, when the questions cannot be solved by the two-valued logic of traditional set theory, therefore it differs from the traditional theory.The solution can be reached by using membership function in Fuzzy logic, the Fuzzy set theory has been used in many fields as a control theory, decision analysis, artificial intelligence, management, and economics.The Fuzzy set used to capture uncertainty and vagueness work in our day to day ventures, Where time -series models have utilized the Fuzzy set theory to solve various domain forecasting problems, therefore in this study we utilized of the Fuzzy dual -factor time series to forecasting ASE index returns as a part of this paper, also the future trading volume as a determinant of prices in different momentum phases.Again, back to a Fuzzy logic system which is subjective and depends on heuristic processes .and the choices of membership functions, which have to be developed heuristically, and the results of this process is fixed and still depends on trial and error.In addition to that, the process cannot be yield the best forecast.([8]) A,B , saw that much Fuzzy logic and genetic algorithms significantly improve the analysis methods; they built their opinion according to these technologies are for the most part complementary and synergistic, in the same time that they are complementary, follows from the observations and use neural networks for market forecasting, and used for curve fitting.Were Fuzzylogic deals with imprecision and uncertainty, and genetic algorithms are used to reach the optimization, many numerous facts about Fuzzy logic and market forecasting and trading rules with applications, and merging the technologies which allow for exploitation for tolerance for imprecision , the partial truth is to achieve tractability, low solution cost, and robustness.
[9] applied the neuro-Fuzzy model to predict future values of the largest government-owned bank, he used the profitability ratios (R.O.A. R.O.E, and P. E, with the closing prices for the current prior three months.then he compared the output of the model of Fuzzy logic with basic back propagation algorithm.He concluded that the neuro-Fuzzy model was able to recognize the general characteristics of the stock market better than the back propagation algorithm.
[10], utilized of neural network modified to predict the stock price index, the method used aimed to use globally searched future dieselization to reduce the dimensionally of future space, mitigate the limitations gradient descent, and illuminates irrelevant factors.Neural network used by [11], their paper aimed to predict Istanbul stock exchange market index value, in their method they have investigated the index by different methods of neural network, in their study they have shown that preference of neural network, and finally that this model can let one ahead in forecasting stock prices.Stock market prediction models usually belong to two categories.Fundamentals annual analysis involves global economic conditions, such as budget, company information, conditions as environments around the stock market, where technical analysis involves technical indicators like William -R%, MACD, RSI, The stock status can be classified by fuzzy logic, neural network, and SVM.Many methods can be used to predict stock exchange index or prices, [12] decided that neural network has emerged as one of these tools to predict the market, the aim of this is critical to analyze the alternative tools which are based on the neural network.This can be fluctuation to the investor belief, where the stock indices are chaotic in its nature.The stock market index represents the directional movement of the economy, and to predict stock indices, this process requires ample information about the nitty-gritty of the market happing.
[13]has decided on his research that many findings are of an on-going project, he used neural network modeling and learning techniques to search for and decode nonlinear regularities in asset price movements.Where [14],Used Markov models approach to forecast the financial market; these models are used to recognize the pattern of a dynamic financial system.
[15]), have in their research a new methodology with moving average autoregressive exogenous (ARX) to create an automatic stock market forecasting and portfolio selection mechanism.

-: Fuzzy times series and fuzzy logic:
In fuzzy time series models, one factor to forecast enrollment is simplified the complex problem, but not give good and accuracy time series forecasting, multiple factors can be used to derive better performance.In this research to have more accuracy performance of forecasting for Amman stock exchange, we follow the [16],which proposed by using two factors which influence the future stock index, instead of trading volume[17,] used the following equation: - Where: VR (t) : Stock trading volume.V up : the trading volume when stock index closes up.V Downimp : the trading volume when stock index closes down.In this model, we have two factors separately integrated the process by a dual factor linear forecasting equation.The dual factor is : ).In main summarized for this model by [18], this leads to detailed by the algorithm.The dual factor forecast in proposed by [18].
Below diagram shows how the forecasting processes through fuzzy dual time series, figure (1).According to Song and Chisoms model which consist of six steps, first step is to define the partition of universe of discourse ,second step is to define the fuzzy set for the observation ,where the fifth step is forecast and sixth step is defuzzify forecast result.This fuzzy time series model employ one factor to forecast enrolment, to improve the forecasting process as shown in figure (1), the two forecasting factors which proposed by [19], instead of stock trading volume ,we use technical analysis indicator of stock trading volume ,in this figure two forecasting approach to deal with the two forecast factor separately linear forecasting.In general we crystallize the proposed model in to detailed algorithm.

-4: measurements:
Enhance; the model should be proposed the methodology with a hidden Markov model or fuzzy logic to improve the accuracy and effectiveness of the stock market price movement where the problem of the fuzzy system is of eliciting IF then rules from a raw input and output data.Two steps are proceeds for this:-A: Specification of output relations IF.

Inference
Defuzzification Fuzzification B: Clustering algorithm which used to recognized and categorized data also model construction and used for data comparison.The subtractive clustering is a good technique for generating fuzzy inference systems which drawn up.By detecting clusters in input-output trading data.In cluster, the data point is estimated depends on the distance of this data point potential which can be measured as: Where a = 4  2 X i = represent ith data point, R a is the vector consists of positive constant, and it is the types sphere cluster radius in data space.C : Stochastic oscillator ( SO ):-This indicator indicates to the relation between the stock last closing price and to the stocks trading, it plotted with a range of 0 to 100, the overbought condition decided by this indicator about 80 and oversold analysis this indicator contains two variable as follows: Where: %D is the moving average of %K used to formulate the idea of the momentum, Rmax (not) represented the momentum down the trading period, and Rmin (nt) is the momentum down the trading period.When Stochastic oscillator increases above 80, then sell should be, if (SO ) lied between 20 -80 Which implies normal state then should and when 80 below 20 implied oversold then by.D: On -Balance Volume (OBV): This measurement tool reflects the movement in the volume of stocks.It is calculated by total volume for the trading period and assigning it whether positive or negative there are 4 cases of measurement as:- When prices today's close is greater Than yesterday close then: OB V = yesterday -Today's volume.
 When today close is equal to yesterday then: OB V = yesterday's OB V results of this indicator of trading rules can be determined as following:--If the line is down warded then sell.
-And when the line is upward then bay finally the MACD indicators use in long-term 26 weeks data and in shortrun 12 weeks.The fuzzy rules are a combination of the rules the 4 indicators combination also extracted from the expert from the trading expert; as:  When MACD is high and Rsi low and so is low and O B V is high then buy.if MACD is low RSI is high and so is high and O B V is low then buy.When MACD is low, RSI is med so is high and O B V is low then sells.

-5: Causality in stock markets:
Recent researchers are focused on the volume of trading stock to make price movement, therefore they focused on the contemporaneous relationship between trading volume and stock returns and they have decided that its dynamic relationship, the regressive of the dual time series known as a functional form which contains a mutual influencing factors.
The functional form of causality: Where: V t : represents the future trading volume, Ii is the future index of the stock market.

3: Methodology and data:
The data collection from previous record of Amman stock exchange of financial and banking sector for the period under investigation , the major variable of this study used as a time series of prices of stock exchange ,from reports of ASE and central bank of Jordan , for exogenous variables in the study both previous records and stock market indexes which from 1/2010 to 12/2016 with record data 265.
The purpose of this study is to predict Amman stock exchange stock price through index and trading volume, which has the most influential factor in (A S E), enhance; we use the classical statistical methods the artificial intelligence model to simulate the results of interaction s through those influential variables.We use the fuzzy neural network to simulate the complex interactions in stock's environment. The second type is the derived data which comes from combining and transforming technical, or the third type of data is the fundamental data, such as returns which can be expressed as: The third type of data is fundamental which related to the interstice value of category the fundamental data category included: Trade balance:  ndexes of industries and companies. Interest rates:  Net profit margin.

-1: The time series model:
When we matched the time Series and the pattern templates, we can through this method identifying the existing of Elliott waves, this method proposed by ([16]In their method, the amplitude-distance between two points can be performed as: Where: (A, C) are listed in the point in the time series and templates, SpA, CPA are considered as (P1PS) in P.
This proffered to be considered as horizontal distortions of pattern against templates, and the temporal distance can be performed us (TD): The SPTA and CTA: represents the time coordinate of the sequence points.Other models such as; Black -Litter man studied the active portfolios with views, The Black -Letterman optimized portfolios, resembling portfolios of real market participants.Type four is the volatility and stability and government policies which measure the risk of an investment and described the variability of a stock market.
The two models which are used in his research are categorized as a fuzzy neural network which depends or based on fuzzy loge model and time series, and the equivalent ANFIE model.And wavelet with their modifications; first step we normalized the data.The forecasting model comes from different categories of information data as below in figure .(5).In normalization of data according to the primary needs of the fuzzy system, which implies should cover the domain of variables.Thus upper limits and lower limits of the variables input data should be modified of stock price and index of the market to avoid the problem of sensitivity of Gaussian member function, the normalized data can be written as the following:

……………….(11)
We can notice in the equation that increases to the maximum twenty percent, and.Decline minimum to twenty percent this can be considered to cover the domain changes in prediction period.

In p u t c as h f lo w e f f ic in ie c y t an d p re v io u s d ail y s to c k 
……………(13) Input 2 = ts(t-1) was able to forecast with R equal in ASE ( 0.893) by 342 primary modeling data for the whole data 570 data, then we have applied the mean absolute percentage error (MAPE) which can be expressed as: Where: N: is the total number of data records, P: represents forecasted output, m is actual output.This indicator uses to comprises of two exponential moving Averages which help to measure momentum in the security .when the MACD is the positive signal this can suggest upward momentum when it is negative it is down warded momentum.This can be calculated as: 1-A /2day EMA of closing Prices.2-A / 26 day EMA of closing prices 3-Subtract the longer EMA in (2).4-Ag day of the MACD line gotten as the following equation:: ……………………(15) Where: y denoted to yesterday, n: is the number of day in EMA, l(equal to) = 2/(N+1) And t represents today.The trading rule of MACD to be used in the fuzzy inference system as results signal;


If MACD above the line than buying.If MACD below the line, then sell, 2: RSI (Relative strength, index): It is considered whether the set is overbought or oversold.

5: Empirical Results of the Study.
5 -1 : Analyses of ASE data using indicators.We have used MAT lab software to analyze the data set during this period, The MACD during the whole of study period below the trigger line, and the other results of other indicators RSI and stochastic oscillator, and OBV, the numerical value indicates that all of-of them hold drown downtrend, therefore the values which appear in table (2) was the value results from the inference system.Which reveals a sell, hence, low with numerical value?When we have a look during the study period to the price movements, it shows that the price increased in the summer season and slipped down in autumn and winter season.The results during the winter season and at the end of the year indicate that buying would have been profitable, while price movements in this period indicate to buy.The MACD was above the trigger line value of 10.And RSI was about 101, with the stochastic oscillator of 101, with OBV which up word trend, enhance, these results of fuzzy inference system reveling to buy. 5 -2: MPE, MSE, RMSE with different models results of ASE during (2010)(2011)(2012)(2013)(2014)(2015)(2016).
MPE, MSE, RMSE with different models results of ASE during (2010-2016).We have applied the mean absolute percentage error, (MAPE) mean squared Error (MSE) and the root of the mean squared error.As three measures to evaluate the different models which performance in our paper and detailed above in the text.Table (3) shows the result of the financial sector of ASE during the study period.3) which shows the combination of combining the fuzzy logic, neural network, then wavelet for the ASE stock market prices of financial sector, and simulate the errors between proposed models.The result of comparison shows that the model of ANFIS and wavelet in MSE, RMSE measures out performs the other model.The previous day stock price input was able to predict the future stock price, with determinant coefficient 0.9134, the whole range of data 265, the prediction can be can be accounted as equal to on-head forcast.After denormalizating operation the predicted results are stated in table ( 4 ).The results of table shows that more prominent in fuzzy-neural models, while it is appear that in MSE as medium, and MAD posses less amount than other models in all table testing fuzzy-neural models ,therefore it becomes superior in stock prediction.RSI:: this indicator compares the magnitude of recent gains to recent losses, as attempts have oversold conditions of assets MACD: this indicator gives us a sign of fast and moving average of closing prices this measure reflects the buying and selling conditions volume which provides clues as intensity of given price movement in market timing strategy an over bough volume and over .The evaluation basis in this paper which applied as a measure is (MAPE) the absolute percentage error, which appears as the following formula: Also, we can use the actual predict value s and the mean value we can use the following formula: Where: y t and I t represent the actual and predicted values the .smallervalue of the error is the closer of predicted values to the actual values, the other measure is MSE (mean Squared error which follows the below formula: Where it and yt are the actual and predicted values.The third measure used in this paper is RMSE (root mean squared error) which can be formed as:

-3: The simulating method results.
We have used the simulating method to analysis the stock indexes of the financial sector by using three models   In figure ( 7) ,( 8) and ( 9),the input functions of training error after trained 360 days with265 data chosen in testing ,with 4 input variables, and two fuzzification variables, give us sign that after a very iteration model training, that fuzzy neural models are superior at the end of 360 days training domain and error amount of the model is too small or sometimes medium.

Section six: Concluded remarks:
Much recent paper applying a linear combination of the significant technical index, as a consequent to predict the stock market index and prices.our paper is under the same consideration , is an attempt work to predict the ASE index and price movement , but after give an explanation about the fuzzy logic and neural network theory, and literature survey to predict the long-term goals of the trend index and price variation , without searching the details of influential factors, such as political disorder ,micro and macroeconomic variables.
The fuzzy system used as input information of our results are derived from technical indicators analysis results and sometimes from charts the inputs generated by the experiments of indicators to have an efficient predicting future price movements in the stock market ,therefore we have chosen in our paper the moving average convergence/divergence (MACD) on Balance volume (OBV) stochastic oscillator (SO) and relative strength index (RSI), these indicators beyond other measures can mimics the behavior of technical trades, and the strategic decision in stock market trader decision.In our viewpoint combination of more measures such as MSE and MAPE beyond other in fuzzy logic, and the neural network is more reliable to predict the index and price movement stock market.
The paper mapped these indicators to keep the fuzzy inference as simple as we could, to give easy method for trader prediction as a results two variables to predict the actual stock market data, due to the satisfactory results through the analysis of ASE .recommendationover bough and over soled are combined with other information indicators to give good decision.
Where this paper demonstrate the immense capabilities of fuzzy logic and neural network architecture such as ANFIS in implementing time series prediction as task to predict the stock prices direction for ASE, in order to give high performance decision which optimizing profits for the investor in other hands not only linear combination have been used in this paper also the nonlinear system modeling with a combination a conventional method used such as ANFIS These combinations of the quantitative method are utilized in this paper in order to give a suitable and successful method to predict the price movements in the stock Market and minimize the risk of investment.The future researcher can fly high in this filled by using other quantitative methods, and developed new index more reliable to predict the Prince moment in stock markets.
4 -2: Design of Fuzzy logic -Based stock prediction: The technical indices' are used along domain expertise with the definition of the rule of the fuzzy system.Moving Average Convergence.(MACD) divergence.
number of days, most analysis; Used a-15 days RSI, RSI is an average of N-days up closes / average of N days down closes.If RSI increases to above 70 then sell..If RSI is between 30 and 70 then hold, If RSI decreased below 30 then buy.3: Stochastic oscillator (SO): Indicates overbought/oversold conditions on a scale of 0-100%.Oscillator readings below 20% are considered oversold.Oscillator readings above 80% are considered overbought.Based on observation that in a b up trend, closing prices for periods tend to concentrate in the higher part of the period's range.As prices fall in a b down trend, closing prices tend to be near the extreme low of the period range.The calculations produce two lines, %K and %D which indicate overbought/oversold areas of a chart.Divergence between the stochastic lines and the price action of the underlying instrument gives a powerful trading signal.I had used this one before, but I was not familiar with it so it did not help me.I feel like this one along with the RSI could be a good combination.(9) %D is a 3-day simple moving average of %K If both lines have topped in the upper zone (above 80% mark) and then the indicator.The f0ll0wing diagram indicates to design of Fuzzy logic -Based stock prediction summarized all measurement.Figure (6) : the design of Fuzzy logic-based stock prediction measurements.Source: Acheme, O, Ijegwa.Vinecent, Rebeca.Folorunce, o Olusola, issac.Computer and information science.vol.7,No.3, pp.4,2014.

Figure ( 8
): RMSE for ASE ( financial sector )2015 by train data errorSource : author analyses results using Mat LAB software.

Figure ( 9
) :RMSE for ASE (financial sector ) 2015 by check data errorSource : author results drown by check data error for ASE data.
The data of each index or trading volume included 570 data which are formed in daily periods.570data input variable sets are tested with the selected model ANFIS We use the following formula:

table ( 5
) shows the results.More experiments to improve the proposed model which used, but the period is used long with reduplicated Algorithms, the results of the simulated method are in the table (5) with half your moving windows of data.