APPLICATION OF FUZZY TIME SERIES WITH FIBONACCI RETRACEMENT FOR FORECASTING STOCK PRICE PT. BANK RAKYAT INDONESIA

ABSTRACT


INTRODUCTION
Stock is one of the long-term financial instruments traded on the Indonesian capital market. Stock can be defined as securities that indicate the ownership of a person or legal entity to the company issuing the shares. Good stocks for long-term investment are stocks that have good fundamentals and large market capitalization. Data from the Indonesia Stock Exchange (IDX) shows that the banking sector is one of the sectors experiencing very significant growth. The banking sector has an essential role in mediating the economy between those who have excess funds and those who need funds. [1] PT Bank Rakyat Indonesia is one of the largest state-owned banks in Indonesia, which is listed on the Indonesia Stock Exchange (IDX) and continuously records a profit every year. Bank BRI is a state-owned bank (State-Owned Enterprise) that consistently focuses on funding the MSME sector (Micro, Small, and Medium Enterprises). [2].
In investing in stocks, investors need to know the risk management that can affect the ups and downs of a stock. Forecasting is an analysis to predict everything related to the production, supply, demand, and use of technology in an industry or business. The usefulness of forecasting is making decisions based on considerations of what will happen when the decision is implemented. [3] One of the forecasting methods for time series data is fuzzy time series. Fuzzy time series is one of the soft computing methods that has been used and applied in time series data analysis. The primary purpose of fuzzy time series is to predict time series data that can be widely used on any real-time data, including capital market data [4][5][6][7].
Fuzzy time series method has been implemented to predict TSMC and TAIEX stock prices by applying stock analysis theory to improve forecasting accuracy. Stock analysis theory is divided into two, namely fundamental analysis and technical analysis. Fundamental analysis is an analysis that includes how the company's performance and the condition of macroeconomic variables both at home and abroad. In comparison, technical analysis tries to predict future stock prices by utilizing historical stock data in the past. [8][9][10] One method of technical analysis is using Fibonacci retracement. A Fibonacci retracement is an analytical tool used by stock and forex traders to approach technical analysis. This indicator is the result of the development of the ratio comparison on the Fibonacci number series. The results can be used to consider buying and selling shares. This analysis technique is used by taking a line to unite the two extreme points (highest point and lowest point) contained on the price chart. Then, the trader can divide the vertical distance between the two points based on the Fibonacci comparison. The comparisons used are 23.6%, 38.2%, 61.8%, and also 100% [11][12][13]

RESEARCH METHODS
Fuzzy time series is a development model of the Song and Chissom models by examining the distribution of data in linguistic values and applying stock analysis theory to the fuzzy time series model. Fuzzy time series with stock analysis theory improves forecasting accuracy, and the predicted target is the stock price [14 -15] There are several forecasting steps using the fuzzy time series method, namely: Step one: Dividing the set of universes = [ , ]. One method of determining the effective interval length is the average-based method, the basis for the length of the interval, as evidenced in Table 1.
The second step: Making 1 , 2 , … , a fuzzy set where the linguistic variables are determined by the state of the universe. The definition of a fuzzy set for the universe is: The value of indicates the degree of membership of the fuzzy set where ∈ [0,1], 1 ≤ ≤ , and 1 ≤ ≤ . The value of the degree of membership of is determined based on the rules as below: Rule 1: If historical data is included , then the membership degree value for is 1, +1 is 0.5 and if not and +1 , it is declared zero. Rule 2: If historical data is included in , 1 ≤ ≤ then the value of the degree of membership for is 1, −1 and +1 is 0.5 and if not , −1 and +1 , then it is declared zero. Rule 3: If historical data is included ,then the membership degree value for is 1, −1 is 0.5 and if not and −1 , it is declared zero. Suppose there is a 1 finite 7 interval for the stock price interval, so that the defined 1 fuzzy set is finite 7 . So, the linguistic variables are 1 (very low price), 2 (low price), 3 (low enough price), 4 (normal price), 5 (high enough price), 6 (high price), 6 (high price), and 7 (very high price). The fuzzy set equation formed is as follows: (2) Fuzzy logic relation is based on the fuzzification of historical data. If the fuzzification of stock prices builds a fuzzy logical relation → with and are called the current state and the following state, respectively, of fuzzy logic relations.
The third step: Forming a group of FLR (Fuzzy Logical Relationship) so that the multiplication between the vectors of each observation is obtained. FLR can be divided into groups, where the FLR which has the current state (current state) the same is inserted into the same FLR.
As an example: → → as the current state, and as the current state. So, and are in a group FLR.
(3) Information: : frequency of occurrence → i : order of occurrence → The sum of the weights of each FLR must be standardized to obtain a column vector. where: The fifth step: Calculating the center of the distribution of linguistic values, with the equation: where: : vector size (1 × ) at time t : center of distribution of linguistic values : linguistic value membership function : observation value The linguistic distribution center vector is , generated by each linguist.
Sixth step: After that, it goes into the defuzzification process, were in the fourth and fifth steps that, the weighted vector and the center vector of the distribution of linguistic values are obtained, and the two vectors are multiplied to get the initial estimate. The defuzzification process is defined by the equation:

Forecasting Model Accuracy Measure
The assessment of the accuracy of the forecasting results in this study uses the Mean Absolute Percentage Error (MAPE).
where: ∶ many observations : -th actual value ̅ ∶ -th forecasting value The graph in Figure 1 is the stock price graph of PT. Bank Rakyat Indonesia Tbk (BBRI) in the period from October 1, 2021 to March 31, 2022 as for the complete data can be seen in Appendix 1. Based on the graph data, it can be known that the lowest share price is Rp. 3900 and the highest share price is Rp. 4730. From the pattern of the chart, BBRI stock price data tend to have data that is horizontal or trend with a distance or range of 830 and an average or mean value of Rp. 4285.76.

Formation of the effective interval using the average basis
The formation of the active interval is calculated by finding the average difference in the data. That is equal to 45.85 ( = 125). Then the number of intervals obtained is 41 with an interval length equal to 20.  After that, 830 is divided by 20 and the value is 41.5. The number of intervals must be an odd number, so it is rounded to 41.

Fuzzification process
The fuzzification stage based on the effective interval obtained can be determined by the linguistic value with the number of intervals formed. From each of these interval classes, a fuzzy linguistic set will be defined , with 1 ≤ ≤ 41. The results of the fuzzification of BBRI shares are presented in Table 5. The results of the fuzzification of BBRI stock for 01/10/2021 is defined to 1 because data will enter into a linguistic value that has a membership degree value equal to 1 which indicates the true value.

Formation of fuzzy logic relationship
The formation of fuzzy logic relationship (FLR) and FLR Group is identified based on fuzzified historical data previously. In Table 6, fuzzy logic relationship or FLR is formed based on present historical data ( − 1) with historical data of the present ( ).

Forming FLRG and weighting
FLRG is done by fuzzy grouping sets that have the same current state and then grouping them into one group in the next state.  Table 7 presents all FLR groups forming a vector generated FLRG of dimension 41 for each linguistic. Each FLR in the same FLRG must be given a weight, and the weighting can increase the accuracy of the forecast.  The sum of the weights of each FLR must be standardized to obtain a weighted vector. In summary, the weighted vectors are presented in Table 8.
In the next step, after the weighted vector is formed for each linguistic value from the observations, the linguistic distribution center value is calculated. The central vector of linguistic distribution can be generated by any linguistic value. In Table 9, it can be seen that the observation value of the linguistic value membership function divided by the number of observations, then the center of the distribution of with 1 ≤ ≤ 41 will be obtained.

Defuzzification of BRI's stock price
Defuzzification serves to change the fuzzy output into a firm value based on a representatively determined membership function. The result of defuzzification is obtained by multiplying the weighted vector with the center vector of the linguistic distribution. The formation of the active interval is calculated by finding the average of the data differences. The number of intervals must be an odd number, then rounded to 41. Table 10 shows the intervals formed on observations with interval lengths equal to 20.   Table  11.  Table 11 shows the results of forecasting using fuzzy time series and Fibonacci forecast of BBRI's stock price. After going through the process of FLRG and weighting and obtained the result of forecasting the price of BBRI shares for the next period, which is the period of April 1, 2022 amounting to 4660.46 in Rupiah exchange rate. As for the actual price of BBRI shares in the period of April 1, it is Rp. 4730.

Figure 3. Comparison graph of actual and forecasting value
Furthermore, from the prediction, a comparison chart was obtained between the BBRI stock price data or the actual data with the data of the prediction using the Fibonacci method. In Figure 3, it can be seen that the forecasting data pattern fluctuates following the actual data pattern.

Calculating MAPE
The purpose of calculating the MAPE value (mean absolute percentage) is to determine the level of accuracy in forecasting by measuring the accuracy of forecasting results. The level of accuracy of forecasting results against actual data is presented in Table 12. In principle, forecasting is done by comparing the results of forecasting with the reality that happened. In the forecasting process with the level of forecasting, there is an error size that indicates the accuracy of the model. One of the most commonly used error measures is MAPE. Then, based on the data in Table 12, the MAPE value for Fibonacci is 1.034%.

CONCLUSIONS
Based on the results of the analysis and discussion of the research that has been done, several conclusions were obtained. The following are some conclusions from this study.