Detecting Nasdaq Composite Index Trends with OFNs

The chapter presents a novel way of describing changes in the stock index and the identiﬁcation of potential trends. The authors already used a similar approach to describe the stock exchange index [16]; this chapter is a continuation and another application of work on this issue. The method for detecting patterns in a trend by means of linguistic variables is described. The use of computational operations on numbers in the Ordered Fuzzy Number (OFN) notation [40–42] enables us to set the values of linguistic variables and thus conduct fuzziﬁcation of the input. By using one OFN number it is possible to store ﬁve parameters of index quotations (open, high, low, and close values as well as a change direction). The OFN numbers are conveyed into a linguistic form. In order to ﬁnd trend sequence similarity the following applies: sequence identity with the input frame expressed as a percentage, frame size, the level of threshold conformity with the frame (threshold), and how often the pattern is present (frequency). A dedicated computer program to detect patterns is implemented. The program used data from the index Nasdaq Composite from the years 2006-2016. The results represent a further step to develop effective methods of rule-based forecasting.


Introduction
In comparison to existing methods, more accurate forecasting methods can be obtained using a rule-based forecasting (RBF), a technique combining data extrapolation [7,13,14,25,26,[43][44][45], time series [28,29,44,45], and elements of expert systems [5-7, 22, 23, 34, 37, 46]. The four most important methods of extrapolation were used: linear regression, random walk, and Brown's exponential smoothing, as well as Holt's exponential smoothing. In order to create rules some information from the literature, surveys, and knowledge of several experts was adapted [17, 19-21, 36, 38, 39]. The rules were calibrated using 80 time series. In contrast, the validation needed another 40 series. In the opinion of the authors, RBF has been successfully applied by combining domain expertise with statistical methods. This has been confirmed by many studies in the recent literature, where rule-based forecasting is a fast-growing technology. It is worth mentioning a few examples from a very comprehensive literature such as M. Adya, J.S. Armstrong, and F. Collopy [1-3, 8, 9], who publish in the International Journal of Forecasting, a magazine that inspires other authors associated with the RBF methods. In this chapter time series of index data were preliminarily fuzzified [30,33] to check the proposed methods of detecting trends [18]. Trends identified in the sequence of literals are then used to develop trend prediction rules. Therefore fuzzy logic [12,13,16,35] was used to develop linguistic data input. Data for the study were quotations of the Nasdaq Composite index from the years 2006-2016. Figure 11.1 shows the data in an illustrative manner. Table 11.1 contains Nasdaq index data for a single trading day. Daily data are: opening, maximum, minimum, and closing values as well as the percentage change

Application of OFN Notation for the Fuzzy Observation of NASDAQ Composite
Data from November this year for the NASDAQ Composite are presented in Table 11.1. Quotations are given in a widely used format for this type of time series. Subsequent letters of the alphabet represent values for consecutive trading days. Figure 11.2 shows an OHLC (open, high, low, close) chart of the Nasdaq Composite index for one month. The graph shows the following attributes for each of the daily quotations: opening, closing, highest, and lowest value. These attributes, along with the change parameter are shown in Table 11.1. In addition, decrease in quotation is   Fig. 11.2 show a decrease in quotations on specified days. Another four quotations-D, E, F, G-show an increase in the value of the Nasdaq Composite. A very large spread between the minimum and maximum value, and between the opening and closing are on H; these are decreasing quotations. This is followed by increases to date S with only two days of drops (J and N) in the range. Point P is interesting, because the opening value is virtually level with the closing value, despite some fluctuations of the Nasdaq Composite value during the trading day. It is essential that P be located near the top of the local peak. Then visualizations T and W demonstrate declines from the local peak. As the chart above may not be unambiguous in terms of the trend interpretation the authors introduce the logic of Ordered Fuzzy Numbers [14,24,30] in order to interpret the quotations. Table 11.2 shows the OFN characteristic points with the Nasdaq Composite quotation parameters as listed in Table 11.2. Figure 11.4 is an OHLC chart with Nasdaq index parameters. In the considered single day there has been an increase in quotations. The translation of data from Fig. 11.4 on the OFN is presented in Table 11.3. The resulting fuzzy number is interpreted graphically in Fig. 11.3. The arrow of fuzzy numbers is directed towards   Figure 11.5 shows the fuzzy number stretched on the same values as in Fig. 11.3. However, the direction of the OFN here is the opposite. Chart 2.6 depicts the decrease in quotations for a single day of trading. It should be noted that the equivalent of the index's downward movement is a negative direction of the OFN (Fig. 11.6).

Ordered Fuzzy Number Formulas
Nasdaq Composite index values R 1 ÷ R m relate to a single trading day. Fuzzy observation in OFN notation is performed on a set of R. The observation is for one dependent and four independent attributes. For each day the number R i ∈ {R 1 ÷ R m } is created of the four required values. Symbols of time are, respectively, t i , the day of the measurement, whereas t O P E N , t M I N , t t M AX i t C L O SE are, respectively, quotations of opening, minimum, maximum, and close value (Table 11.4). The OFN arrangement (order) is synonymous with the measurement time of t movement intensity, where t ∈ {t O P E N , t M I N , t t M AX , t C L O SE }. The measurements must be performed in a specific order. The OFN order in Fig. 11.3 is the direction of index changes for one trading day. The default direction of OFN R is positive (Fig. 11.2).

Definition 1 On a given day t i , the set forming fuzzy observation of the Nasdaq Composite index, is provided as
and the opposite case is The NASDAQ was launched in the 1970 s and was the first fully electronic securities trading system in the world. The stock market traded shares of companies mainly related to modern technology (IT). The Nasdaq Composite is one of the three major US indices, next to the Dow Jones Average and the S&P500 [47][48][49][50]. As for 2016, listed on the NASDAQ are approximately 3,000 companies, including Apple, Google, Microsoft, and Intel. The Nasdaq composite index is an aggregate of the common stocks listed on the NASDAQ stock market. The formula for aggregating fuzzy observation of subaggregate S m for n component companies of the index is as follows.

Definition 2 Fuzzy observation of index Nasdaq Composite at the time t i is a set of
where n ≤ 3000 and w i ∈ {w 1 , . . . w n } is a vector of the individual companies' impact, default w i = 1.
The weight of each company in the index is where j ∈ [1, m] Definition 3 If a subaggregate Sm of the Nasdaq Composite aggregate with a certain number n of (e.g., sector-related) companies has a different direction of the OFN from the direction of the main index, then it can be assumed that it is a predictor of trend change. This includes the rule: IF N asdaqComposite is positive AND S m is negative THEN Possible change is true (11.6)

Conclusions
Investing in the stock market is associated with high risk. This is due to the lack of ideal solutions for the analysis of market data and predictions in short-and long-term changes in indices, major stock market indicators. Processes occurring on the stock markets have nonlinear chaotic characteristics, making it difficult to study them. The technical analysis often uses expert knowledge and expert rules to detect and use recognizable trends [43]. One can base investment strategy on trends that will bring profits during the boom and limit losses when a market is in decline. Expert knowledge and rules can be transferred to digital form. Currently, there are many methods for identifying trends on the stock exchange [16,50]. Many of them are unattractive due to their complicated structure. An interesting alternative to describing the phenomenon of the trend is the application of fuzzy numbers and fuzzy logic [4,10,11,31,32]. The chapter presents Ordered Fuzzy Numbers, which use five specific index parameters as well as index analysis methods to identify the occurrence of a trend. Ordered Fuzzy Number notation made it possible to replace up to five attributes (open, close, high, low, change) describing the index quotes with a single OFN. In addition, the use of OFNs lets one quickly detect changes in the trend, which is very important in short-term investments. The authors previously proposed similar solutions based on research WIG20 [16]; there are also other works on similar solutions and financial investment [27,28]. The authors intend to carry out further research in this area in order to find more versatile and accurate prediction models to identify market trends.
Open Access This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made. The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.