. International Journal of Economics and Financial Issues ISSN: 2146-4138 available at http: www.econjournals.com International Journal of Economics and Financial Issues, 2016, 6(1), 87-95. International Journal of Economics and Financial Issues | Vol 6 • Issue 1 • 2016 87 Profitability of Directional Change Based Trading Strategies: The Case of Saudi Stock Market Monira Essa Aloud* Department of Management Information Systems, College of Business Administration, King Saud University, Saudi Arabia. *Email: mealoud@ksu.edu.sa ABSTRACT An event-based framework of directional changes (DC) and overshoots maps financial market (FM) price time series into the so-called intrinsic time where events are the time scale of the price time series. This allows for multi-scale analysis of financial data. In the light of this, this paper formulates DC event approach into three automated trading strategies for investments in the FMs: ZI-Directional Change Trading (DCT0), DCT1, and DCT2. The main idea is to use intrinsic time scale based on DC events to learn the size and the direction of periodic patterns from the asset price historical dataset. Using simulation models of Saudi Stock Market, we evaluate the returns of the automated DC trading strategies. The analysis revealed interesting results and evidence that the proposed strategies can indeed generate effective trading for investors with a high rate of returns. The results of this study can be used further to develop decision support systems and autonomous trading agent strategies for the FM. Keywords: Directional Changes, Financial Forecasting, Automated Trading, Financial Markets, Simulation JEL Classifications: G11, G14, G17 1. INTRODUCTION Financial markets (FMs) are institutions where the exchange of assets takes place meant for investment functions. FMs facilities trading in financial securities, commodities and other exchangeable assets depend on the type of the market. Therefore, FMs knowing into different groups, with regarding the kind of traded asset. Some examples of FMs are commodity markets, stock markets, and foreign exchange (FX) markets. For a good introductory reference to FMs, we refer the interested reader to Sharpe et al. (1995). One of the important research activities associated with FMs is to design investment trading strategies. In this paper, we propose investment automated trading strategies based on the directional change (DC) event approach Glattfelder et al. (2011); Aloud et al. (2011); Tsang (2010). Rationality is one of the major assumptions behind many economic theories regarding FMs Tsang and Martinez-Jaramillo (2004). In the past, most of the economics analysis of FMs depends on Efficient Market Hypothesis (EMH). The EMH states that FMs are assumed to be “informationally efficient” if the current market price fully reflects all the available information Fama (1965). The weak form of EMH is associated with the concept of Random Walk Hypothesis Cootner (1964) where asset returns are serially independent. That means price time series in FMs do not follow any trend or pattern. Therefore, historical price data cannot be used to predict the future changes of the asset price for investors’ opportunities. The FM literature has featured an extended debate on the effectiveness of technical analysis on analyzing price time series Grossman and Stiglitz (1980); Tirole (1982); Lo (1988); Tsang and Martinez- Jaramillo (2004); Cont (2001). Some argue that prices cannot be predictable from studying and analyzing price and market historical data. Numerous empirical studies have been conducted to examine EMH by defining the statistical properties of assets’ prices Leroy (1973); Lucas (1978) which evidently uncovered empirical evidence of various price anomalies, and therefore have confirmed positive observed evidence on the effectiveness of technical analysis for analyzing financial price time series. As a result, price time series in FMs can by studied, analyzed and hence can be predictable. Computing has revolutionized the way business is done and the domain of finance in particular. Financial transactions data are now recorded at increasing levels of detail due to advances in computer Aloud: Profitability of Directional Change Based Trading Strategies: The Case of Saudi Stock Market International Journal of Economics and Financial Issues | Vol 6 • Issue 1 • 201688 technology and data storage Dacorogna et al. (2001). Studying the FMs using a massive number of data, referred to as high-frequency data (HFD), without doubt considerably enhance the understanding of FMs behavior. The availability of large amounts of data per day has opened new opportunities for analyzing empirical data, searching for periodic patterns and hence investment opportunities by means of building automated trading systems. The analysis of HFD is nontrivial given that quoted prices/transactions are irregularly spaced in time in complicated sequence Dacorogna et al. (2001). Advances in computing and algorithms enable us to analyze data efficiently, and processing power allow for the simulation of FM behavior as result open new area for studying FMs and designing automated investment trading strategies, which is the subject of this paper. Automated trading strategies have become a hot topic in the field of FMs, and various strategies have been designed and developed aiming to maximize investors’ potential profits. It is as well-known as algorithmic trading Kim (2007). In FMs, automated trading is a general name means employing techniques to trade in assets, such as stocks, and currencies, automatically by computers which in turn involves the determination of a set of rules for order’s timing, price, type {Buy, Sell} and quantity to invest Kim (2007); Booth et al. (2014). Automated trading strategies combine diverse trading rules of technical indicators and fundamental parameters. Therefore, use artificial intelligent techniques, machine learning and data mining among others to find optimal parameters to generate those trading rules automatically from studying historical market data. Automated trading strategy is increasingly becoming the decision- making tool of preference for traders to accomplish investments efficiency. Many attempts have been made to design and develop automated investment trading strategy for the FMs Kim (2007); Booth et al. (2014). The motivation for such automated trading strategy comes from a variety of fields, ranging from financial behavior and econometric analysis to evolutionary computation, data mining, and machine learning Booth et al. (2014); Nuij et al. (2013). In the literature, the design of the automated trading strategy ranges from simple budget constrained zero- intelligence (ZI) strategy as in Duffy and Unver (2006); Gode and Sunder (1993), to intelligent strategy, such as in Cliff and Bruten (1997); Kampouridis and Tsang (2010); Tsang et al. (2002). Different automated trading strategies presume different means of identifying arbitrage opportunities in the FMs. In Aloud et al. (2012), we have constructed an automated trading strategy called ZI-DCT0 based on combining: (i) The DC event approach Aloud et al. (2011) and (ii) trend following (TF) and contrary trading (CT) investment strategies for FMs. Trading in the FMs is highly active at some time periods, but calm down at other time periods which make the flow of price changes based on physical time discontinuous. Therefore, using fixed time scales for studying the price changes in the FM runs the risk of missing arbitrage opportunities Glattfelder et al. (2011). The DC event approach captures key periodic price activities in the time series based on the trader’s profit expectations. Given a fixed threshold size of magnitude λ, the DC approach defines alternating DCs as a price move of magnitude λ in the price time series from the last price extreme. Therefore, ZI-DCT0 trader commits himself to a fixed threshold size and type of trading {TF, CT} for identifying arbitrage opportunities in the price time series. In Aloud (2015), we have derived an automated trading strategy from ZI-DCT0 called Directional Change Trading (DCT1), where ZI-DCT0 has been improved by the integration of an intelligence learning model fed by historical price dataset of EUR/USD currency pair from OANDA FX market maker. The central idea behind DCT1 is to learn from historical price dataset to determine the size and direction of periodic patterns in the price time series. Thus, the DCT1 is able to recognize the size and the direction of periodic patterns in a price time series such as DC and overshoot (OS) events from historical price dataset. This may possibly be the means of providing successful decision support systems for traders in the FMs. DCT1 employees, a mere learning mechanism from historical price dataset which avoids the complexity of intelligent artificial strategies and also the vagueness of ZI and Buy-and-Hold trading strategies where a trader place orders randomly, subject to budget constraints. The results analysis revealed interesting profit outcomes and consequently evidence that DCT1 can indeed generate a high rate of profits for investors in the FX market. In light of this, the contributions of this paper in two folds: First, to examine the profitability and efficiency of the automated DC trading strategies – ZI-DCT0 and DCT1 - in the Saudi Stock Market (SSM) (www.tadawul.com.sa). There are a number of reasons why SSM is used in this analysis. Analysis and explanations that automated trading strategies are profitability and efficiency in SSM have received very limited attention. To the best of our knowledge, this is the first study to examine the impact of automated trading strategies in SSM. The second contribution, to improve DCT1 trading rules by means of self-awareness of the trading performance during the market run, we call this new form DCT2. This paper takes a financial computational point of view for designing and developing automated investment trading strategies in the FMs. From a financial computational point of view, investment decision procedures are able to be encoded in algorithms and systems. We argue that, the effective investment decisions of a trade are determined by the trader’s computational power, in another word, we refer to this as the computational intelligence determines effective investment decisions. The rest of the paper is organized as follows. Section 2 provides a definition of the DC event approach. The ZI-DCT0 trading strategy is described in Section 3. DCT1 is depicted in Section 4 while a description of DCT2 is provided in Section 5. The experimental design, agent-based simulation, and empirical results are presented in Section 6. A summary and conclusions are provided in Section 7. 2. DC EVENT APPROACH HFD are irregularly spaced in time in a complicated sequence which makes the flow of physical time discontinuous. Serving the literature, we found three methods to handle this issue Dacorogna et al. (2001); Engle and Russell (2006). The first method employs aggregating price information by inserting prices between fixed Aloud: Profitability of Directional Change Based Trading Strategies: The Case of Saudi Stock Market International Journal of Economics and Financial Issues | Vol 6 • Issue 1 • 2016 89 and determined times which results in a loss of price details during active periods. The second method considers a price time series of price ticks and times between the price occurrence which referred to as point process (Bauwens and Hautsch, 2009). The advantage of such method is the incorporation of duration which permits analytical results to be determined. In contrast, the drawback of the point processes is that time is measured in terms of physical time units. The third methods proposed analyze price time series by DC event approach which is based on intrinsic time rather than physical time Guillaume et al. (1997); Glattfelder et al. (2011); Aloud et al. (2011); Tsang (2010). This method is used for a discontinuous time series: On the announcement of political or economic news, there tends to be a sharp rise in market trading activity in response to the news (Figure 1). Intrinsic time is described based on price events where the direction of the price trend changes from upward to downward or vice versa Aloud et al. (2011). Time flows unevenly: Any occurrence of a DC event represents a new intrinsic time, independent of the notion of physical time changes. Physical time adopts a point-based system while intrinsic time adopts the event-based system. Physical time is homogenous in which time scales equally spaced based on the chosen time unit (e.g., minutes) while intrinsic time is irregularly spaced in time since time triggers at alternating events of price DCs of size λ. The basic unit of intrinsic time is an event where event is the total price change of size λ from the last price extreme, a high or low when a downward or upward DC is to be detected, respectively Aloud et al. (2011). The time in DC event approach is a dynamic object which adapts to market activity. A DC event can take one of the two forms - a downturn event or an upturn event Tsang (2010). A downward run is a time period between a downturn DC event and the next upturn DC event, whereas an upward run is a time period between an upturn DC event and the next downturn DC event. A downturn DC event dismisses an upward run and starts a downward run, whereas an upturn event terminates a downward run and starts an upward run. A DC event is usually followed by a price OS event rather than a reverse DC event direction Glattfelder et al. (2011); Tsang (2010); Aloud et al. (2011). The OS event represents the price move beyond the DC event. An OS event can take one of two forms: A downturn OS event or an upturn OS event. Figure 1 illustrates how the price curve is composed of DC and OS events. Let us define λ as the price threshold at which the price time series is mapped. Using a price threshold of size λ, we map the price time series into a sequence of price DCs and OS. The initial condition of the sequence is as follow: the initial price p0 and last price extreme p ext is assign as initial value the asset’s price at the start of the price time series sequence p0 at time t0; the initial physical time is t0; the initial price trend mode which alterations between upward and downward run indicating the expected mode of the DC event. Algorithm 1 illustrates how to define DC and OS events during a time period T. A given price threshold of size λ discretizes the price time series into a sequence of → down turn DC event → down turn OS event → up turn DC event → up turn OS event → down turn DC event → Algorithm 1: Dissect the price time series from time t0 and measure DC and OS with a λ price threshold. Require: Initialize variables (mode is upturn event, price threshold λ (Fixed) ≥ 0, pext= p(t) at time t0) update latest ti with t if mode is upturn event then if p(t)t ≤ pext × (1 − λ) then DC event ← downturn event pext ← p(t) else pext ← max (pext, p(t)) endif else//mode is downturn event if p(t) ≥ pext × (1 + λ) then DC event ← upturn event pext ← p(t) else pext ← min (pext, p(t)) endif endif 3. ZI-DCT0 ZI-DCT0 Aloud et al. (2012) is a trading strategy derived from the DC event approach where a ZI-DCT0 trader commits himself to a fixed threshold and a trading method for studying the price times series. The trading method can be one of two forms: CT or TF trading. Despite the effectiveness of TF and CT investment methods, comparatively few works have explored Figure 1: Price movements within 24 h are shaped by directional changes (DC) points (diamond) with a threshold λ = 0.4%. A total price movement between two local values (minimum and maximum price) is decomposed into DC (solid lines) and an overshoot (dashed lines) events Aloud: Profitability of Directional Change Based Trading Strategies: The Case of Saudi Stock Market International Journal of Economics and Financial Issues | Vol 6 • Issue 1 • 201690 the application of learning and patterns detections to improve TF and CF investment methods. ZI-DCT0 has been designed based on incorporating TF and CT investment methods addicted to the DC event approach in which DC event approach serves as a learning model for detecting periodic patterns in the price time series. TF trading method is an extensively adopted investment method in FMs owing to the simplicity of the principle on which TF is based and its effectiveness Covel (2004); Fong et al. (2011); Szakmarya et al. (2010); Fong et al. (2012). TF takes a rule-based approach established on the directions of price trends, where a trader takes advantages of the price trend on the assumption that the present price trend will carry on in the same pattern. The principal of TF is that a trader will track the price trend with the hypothesis that some traders have market information prior to the general public which is reflected in the price trend Covel (2004). A TF trader places a sell order when the price is falling while a buy order is placed when the price is rising. A number of effective TF investments have been applied and examined in stock markets Fong et al. (2011), currency markets James (2003) and commodity futures’ markets Szakmarya et al. (2010). Comparable to the TF investment method is the CT method with respect to the direction of the price trend. A CT trading rule places a buy order in the expectation that the price will change in the reverse trend direction. For instance, a CT trading rule may possibly point out a buy order opportunity when the price falls by 0.03% and after that places a sell order if the price rises by 0.06%. Algorithm 2: The core trading mechanism for the ZI-DCT0. Require: Initialize variables (mode is upturn event, price threshold λ (Fixed) ≥ 0, pext= p(t) at time t0) update latest ti with t if mode is upturn event then if p(t) ≤ pext × (1 − λ) then mode ← downturn event pext ← p(t) Sell→ZI-DCT0 CT, Buy→ZI-DCT0 TF else pext ← max (pext, p(t)) endif else//mode is downturn event if p(t) ≥ pext × (1 + λ) then mode ← upturn event pext ← p(t) Buy→ZI-DCT0 CT, Sell→ZI-DCT0 TF else pext ← min (pext, p(t)) endif endif Algorithm 2 demonstrates the core trading mechanism for ZI-DCT0. Prior to trading in the market, a ZI-DCT0 will commit himself to a fixed price threshold and type of trading {TF, CT}. On every occasion of an upturn DC event (according to the used threshold), a ZI-DCT0 will determine that the price trend is on an upward run. This could mean an opportunity to buy for CT and to sell for TF. Correspondingly, a downturn DC event indicates an opportunity to sell for CT and to buy for TF. Incorporating the DC event approach as a learning model for the TF and CT investment methods will reduce the complexity of analyzing and studying the price time series. Hence, traders can capture the short-term dynamics involved in a price time series based on the trader’s expectations of the market towards an understandable depiction of the price dynamic. Therefore, ZI-DCT0 will permit the detection of fewer major periodic stable patterns in a price time series. Cautiousness in choosing an appropriate threshold is important to reflect the real price dynamic, known that, when using either a large or a small threshold, ZI-DCT0 possibly will fail to spot numerous significant patterns on the time series of prices. The results reported in Aloud et al. (2012); Aloud (2015), provide evidence of the efficiency and effective of ZI-DCT0 in studying the FM price time series and therefore generating satisfactory returns of investments in the FX market. The limitations of ZI-DCT0 is the randomness and consistent in selecting the threshold’s magnitude and the type of trading. A similar trading strategy to the ZI-DCT0 is presented by Alfi et al. (2009a, c, b) wherein a trader places an order if the price fluctuations exceed a defined threshold specified by the trader. The threshold remains constant during the trading period in the market. The core difference between ZI-DCT0 and the one introduced in Alfi et al. (2009a, c, b), is that ZI-DCT0 considers the price trend direction and the price OS. 4. DCT1 DCT1 is an intelligence investment trading strategy driven from the ZI-DCT0 where a trader commits himself to a fixed threshold and a trading method for studying the price time series using DC event approach, which is based on intrinsic time Aloud (2015). The DCT1 is capable to recognize periodic patterns in a price time series such as DC and OS events. This may possibly be the key to providing effective investment decision support for traders in the FMs. DCT1 employs a simple learning mechanism which avoids the complexity of artificial intelligent investment strategies and also the vagueness of ZI and Buy-and-Hold strategies wherein traders place orders randomly, subject to budget constraints. Prior to trading in the market, the DCT1 trading strategy involves learning from historical price dataset to identify the estimated magnitude and direction of diverse periodic patterns. Therefore, DCT1 aims to overcome two main limitations of the ZI-DCT0 which are the randomness in choosing a threshold and a trading method (CT or TF) by learning from the historical asset price dataset prior to the process of choosing a threshold and a trading method with regard to the achieved profitability. Algorithm 3 demonstrates the core trading mechanism for a DCT1 trader. A DCT1 trader will examine the achieved profitability of the asset in term of its historical price dataset by iterating through a defined number of diverse thresholds which are generated randomly within a defined range. For each threshold of magnitude λ, a DCT1 trader will examine the historical price dataset using the DC event approach in two folds: firstly as a CT and secondly as a TF trade (as described in Section 3). Consequent to the Aloud: Profitability of Directional Change Based Trading Strategies: The Case of Saudi Stock Market International Journal of Economics and Financial Issues | Vol 6 • Issue 1 • 2016 91 DCT1 trader placing an order, the rate of investment (ROI) as a performance indicator will be computed. ROI is a performance measure defined as the total investment returns over a defined period of time, divided by the cost of the investments. The ROI is expressed as a percentage and is either positive or negative, which means that correspondingly, the DCT1 trader achieves either a profit or makes a loss. At the end of the examination process, the threshold and the trading method that results in the most profitable return with reference to the ROI will be chosen for the DCT1 trader’s decision with regard to placing an order. In our previous work Aloud (2015), we evaluate the efficiency of DCT1 in terms of ROI through diverse experiments using the bid and ask prices for EUR/USD currency pairs from the OANDA trading platform over the year 2008. We compared the resulting ROI from ZI-DCT0 and DCT1. The analysis of the results revealed motivating results and evidence that the DCT1 be able to produce an effective automated trading strategy for investors with a satisfactory rate of return. This study has confirmed the feasibility and effectiveness of employing learning as part of an automated trading strategy in that DCT1 are designed to adapt to price trend directions and hence deduce periodic patterns of a different magnitude. One of the main advantages of the DCT1 design is the combination of classical TF and CT investment rules and a learning model from historical price dataset, which could significantly improve computational effectiveness and the predictability of price trend directions, and uncover the magnitude of periodic patterns. TF and CT strategies have been extensively adopted by investors in the FMs. To the best of our knowledge, no related work in the literature has investigated TF and CF investment strategies within a learning model based on the detection of periodic DC events. 5. DCT2 DCT2 is intelligence automated trading strategy driven from DCT1. A DCT1 trader chooses a threshold of fixed magnitude and type of trading based on the learning process of historical price data. During the market run, the chosen threshold and type of trading remain constant. In FMs, the dynamic of asset’s price time series is not constant and depends on market information. For illustration, on the announcement of political or economic news, there tend to be sharp changes in prices in response to the news, even during calm time periods. DCT2 aims to overcome the limitation of the consistency of using the same threshold magnitude and type of trading for DCT1 for the duration of the trader’s trading in the market. Algorithm 3: The core trading mechanism for the DCT1. Require: Initialize variables (mode = upturn Event, pext = p(t) at time t0, highest ROI = 0) Input (pn, λmin, λmax)//pn training price dataset is used to train trader to find the best investment threshold and type of trading; n length of training dataset; λminis the minimum threshold; and λmax is the maximum threshold. For (i = 0; i < 50; i + +) do//Examining 50 randomly generated thresholds Begin λ = Generate Random Threshold [λmin, λmax] For (y = 0; y < 2; y + +) do//Examining two trading types where y = 0 is CT and y = 1 is TF Begin For (t = 0; t < n; t + +) do//Loop training price dataset Begin if (mode = upturn Event) then if p(t) ≤ pext × (1 − λ) then mode ← downturn Event pext ← p(t) CT→Buy, TF→Sell else pext ← max (pext, p(t)) end if - Upturn event price examination else//mode = downturn Event if pt ≥ p ext × (1 + λ) then mode ← upturn Event pext ← p(t) CT→Sell, TF→Buy else pext ← min (pext, p(t)) end if - Downturn event price examination endif - Event Examination ROI = Evaluate()//ROI (rate of investment) is the result of evaluating the trader profit/loss for the given values of λ and y. end for - End loop training price dataset if (ROI highest ROI)then 4xDC = λ//best threshold 4xDC ω = y//best type of trading ω highest ROI = ROI endif end for - End loop trading type end for - End loop random threshold The DCT2 learning process considers the adaptation to the new market conditions throughout the trading period in the market. The adoption process of DCT2 is modeled explicitly in an endogenous way and periodically with a defined fixed periodicity. In the literature, the automated traders’ adoption process to the new condition of the market is modeled periodically with a defined fixed periodicity LeBaron (2001); Markose et al. (2003); Martinez-Jaramillo and Tsang (2009) or with a periodicity that is generated by a behavioral constraint Markose et al. (2003); Martinez-Jaramillo and Tsang (2009); Winker and Gilli (2001). We set the adaptation of the DCT2 with fixed periodicity in which DCT2 will be able to retrain every week time period of the simulation. This is because we wanted to give the DCT2 the opportunity to advance during that period and possibly perform better than the retrained DCT2 based on the status of the price time series dynamic. In an endogenous adoption way, DCT2 will take a decision to change its used threshold and method of trading based on its performance on the market in terms of wealth. More specifically, DCT2 will be modeled through a behavioral constraint which will force a DCT2 to search for new threshold and method of trading whenever his wealth falls below a threshold, which is equal to half of its initial wealth in the market. Therefore, a DCT2 trader will launch a DC event mechanism considering the Aloud: Profitability of Directional Change Based Trading Strategies: The Case of Saudi Stock Market International Journal of Economics and Financial Issues | Vol 6 • Issue 1 • 201692 most recent market and historical price information to decide on suitable threshold and method of trading. Following on, the threshold for the retraining condition is reset to half of the DCT2 trader’s current wealth. We considered that both learning and adaptation processes should be key features in designing automated trading strategies. The implementation of behavioral constraint in automated trading strategies is a critical design component given the necessity for strategy adaptation to the new conditions of the market environment as seen in LeBaron (2001); Markose et al. (2003); Martinez-Jaramillo and Tsang (2009). 6. EXPERIMENT In this section, we report on the experiments undertaken in the Agent-Based Stock Market (ABSM) that we developed. Our aim is to examine the profitability of the automated DC trading strategies in term of the agents’ ROIs which can consequently inform the design of trading strategies and decision support systems for the trading in the FMs. 6.1. Dataset In this study, we used an HFD of stock indices historical prices provided from the SSM. HFD in finance refers to a vast number of data transactions records and their associated characteristics at frequencies higher than on a daily basis Dacorogna et al. (2001). According to Dacarogna et al. “The number of observations in one single day of a liquid market is equivalent to the number of daily data within 30 years” (Dacorogna et al., 2001, p. 6). Two groups of stock indices from the SSM were chosen to evaluate the three automated DC trading strategies. These two groups are the Banks and Financial Services Indices and Telecommunication and Information Technology Indices, all of which cover the period from December 1, 2014, to May 25, 2015. Figure 2 shows the time evolution of the five stock indices over the whole test period. For each share, we use Bloomberg DataStream to obtain HFD information. The raw trading information was tick data, including bid and ask price and each record is time stamped. Each price index dataset is fed into the ABSM via the market-maker. The time-span of the price dataset is critical in the study, given that different amounts of data examination possibly will provide ratios of precision interesting to study. 6.2. ABSM In our ABSM, there is a market for one trading asset and populated with N trading agents who participate in the market by means of buying and selling stock assets. For analytical simplicity, there is one trading asset available for trading in the simulation. We focus our attention on the profitability and efficiency of the agents’ trading strategies (and consequently behavior) and for this purpose we use a dataset of high-frequency historical prices for SSM assets and feed these prices into the simulation. The prices are fed over a defined 6 months period, and hence the agents react to such information. The historical price data acts as a constant so that multiple simulation runs can be performed in which aspects of the DC automated trading strategies can be modified and systematically studied. This enables us to study and analyze the ensuing trading behavior and data generated with regard to the agent portfolio from the simulation. Each trading agent can hold at time t during the simulation run, two different types of asset: A risk-free asset (cash), and a risky asset (stock asset). Before the simulation launch, each trading agents endowed with 10,000 amounts of cash and without any assets. A trading agent invests 100% of its cash when buying, and 100% of it shares when selling. Every trading agent j has a portfolio which records the results of the agent’s transactions for the period of the simulation run. The net asset value (NAV) at time t denoted by NAVj,t signifies the current cash value of an agent j’s account. In particular, the NAVj,t is the amount of cash in the agent j’s account plus all unrealized profits and minus all unrealized losses associated with all the account’s open positions. The clearance mechanism of the market simulation is simple where every market order at time t will be totally executed while limit orders will be executed when their constraints are satisfied. A market order is an order for immediate execution in the market at the current price of the asset. In contrast, a limit order is an order in which an agent j specifies the price at which it is willing to buy or sell a number of assets. An update will take place for each agent’s portfolio that has an executable order at time t. Afterward, the simulation’s time turns from t to t+1. Therefore, the asset’s price is adjusted to the prices at time t+1 using the historical prices dataset. Hence based on the recent price of the asset, the portfolio will be updated for each agent holds an open order at time t+1. 6.3. Assumption We formulate the following six assumptions in modeling the agents’ trading mechanism in the ABSM: Figure 2: Time evolution of (left axis) five stock indices closing prices and (the right axis) the corresponding closing prices over the period from December 1, 2014, to May 25, 2015 The Banks and Financial Services Indices are: The Saudi American Bank, The Saudi British Bank, Al Rajhi Bank. The Telecommunication and Information Technology Indices are: Saudi Telecom Company and ZAIN Mobile Telecommunications Company Aloud: Profitability of Directional Change Based Trading Strategies: The Case of Saudi Stock Market International Journal of Economics and Financial Issues | Vol 6 • Issue 1 • 2016 93 • Assumption 1: We assume that the trading agents endowed with 10,000 amounts of cash and without any shares. • Assumption 2: We assume that an open order cannot be adjusted by increasing or decreasing the order size. • Assumption 3: There are two types of orders: a market order and a limit order. • Assumption 4: We restrict the quantity of open orders held by an agent j at time t to be one opened order. • Assumption 5: The market does not imply fees for the transactions. • Assumption 6: A trading agent invests 100% of its cash when buying and 100% of it shares when selling. In essence, the main reasons for these simplification assumptions is that by making these six assumptions the complexity of the automated trading strategy is reduced to a level that can be studied and analyzed within the scope of this work. Simplicity and unification the initial variable of the agents’ characteristics is a fundamental block to plainly compare the efficiency of the automated trading strategies. Hence, allocating variable quantities results in a substantial complication of the comparison analysis. The relaxation of these six assumptions does not affect the generality of the simulation results shown in our paper. Nevertheless, we are aware of the importance of the role of quantity and diversity as a choice variable. 7. RESULTS AND DISCUSSION In this section, we perform simulation experiments on the three automated DC trading strategies by fed the simulation with historical price data, and hence the agents’ trading strategies respond to such information. The simulation is fed with different stock index price data over the diverse time horizon to avoid the possibility of overlearning from past data. The learning process for the DCT1 and DCT2 traders is over a 2 months period. The results generated from the simulation run are averaged over 10 independent simulation runs, each run adopting different initial seeds provided by random number generators, and different ranges of threshold values. We performed each independent simulation run with the same parameter configuration values, but with different seeds and ranges of threshold values, to ensure that the results of the simulation are consistent; this allows us to establish the robustness and accuracy of the simulation results. One way to evaluate the performance of the automated DC trading strategies is to examine the generated trading returns. Thus, we used the ROI as a performance indicator (described in Section 4). Table 1 summarizes the performance induced by the three automated DC trading strategies over the test period from December 1, 2014, to May 25, 2015. It is very obvious from Table X that earning high ROI is highly dependent on detecting the magnitude and most importantly the direction of periodic DC and OS price events in the price time series. For illustration, the adopted trading type for ZI-DCT0, which achieved higher returns on investments than the other trading type was used by both DCT1 and DCT2 for all of the five stock indices. For the sample test period, the average ROI (4%) for the ZI-DCT0 (TF) is the lowest amongst the other strategies, while just for SABB stock index it achieved the highest ROI (16.9%). Therefore, the magnitude of the used threshold (λ) plays a vital role in detecting arbitrage opportunities and hence its impact on ROI. In general, for the majority of ROI, the trading agents made more profits than losses based on the different used thresholds. This indicates that the returns are significant but also reminds us of the importance of learning for fitting an appropriate threshold magnitude and trading type based on the asset price time series. By way of illustration, with a threshold of 5% and TF trading type, a ZI-DCT0 agent would make a loss of - 6.1% on the ZAIN index, whereas with the same threshold and trading type the ZI-DCT0 agent would make a profit on the other four stock indices. This is because the price fluctuations of ZAIN index frequently change slightly on both trend directions. This illustrates the fact that the ZI-DCT0 contrarian trader made a profit of 6.61% with a threshold of 5% as it takes advantage of the slight price trend movements. It is difficult from the experiments results to identify the most suitable threshold magnitude and type of trading for the ZI-DCT0 trader and we cannot say with any certainty that a certain threshold is a perfect match for a stock index. Instead, a threshold magnitude and type of trading must be chosen for each stock index based on many criteria, amongst which is the status of the price evolution. Learning from historical price data should be mandatory because it enables the individual to improve his wealth in relation to the price evolution. We consider learning to be of central importance in designing an automated trading strategy because in real life the dynamic changes in the FMs certainly have an influence on the evolution of the price time series and hence in the traders’ Table 1: Detailed ROI (as a percentage) performance comparison on SSM Indices over the test period from December 1, 2014, to May 25, 2015 Stock Index ZI-DCT0 (CT) (%) ZI-DCT0 (TF) (%) DCT1 (%) DCT2 (%) λ ROI λ ROI λ TT ROI λ TT ROI SABB 5 7.88 5 16.9 5.9 TF 13.6 5.9 TF 13.6 RAJHI 4 30 4 12.2 10 CT 21.3 4.2 CT 55.1 SAMBA 7 74.11 4 8.60 7.1 CT 74.11 5.9 CT 84.9 STC 7 12.7 7 2.21 4 CT 14.11 4.70 CT 79.96 ZAIN 5 6.61 6 −6.1 9 CT 10.2 8 CT 11.51 Average 6 31 5 4 8 CT 30 6 CT 58 The Banks and Financial Services indices are: SAMBA, SABB, RAJHI. The Telecommunication and Information Technology indices are: STC and ZAIN Mobile Telecommunications Company (ZAIN). The Average Reported Results are: The used threshold (Λ), ROI, and the selected type of trading method (TT). SAMBA: The Saudi American Bank, SABB: The Saudi British Bank, RAJHI: Al Rajhi Bank, STC: Saudi Telecom Company, ROI: Rate of investments, TF: Trend following, CT: Contrary trading Aloud: Profitability of Directional Change Based Trading Strategies: The Case of Saudi Stock Market International Journal of Economics and Financial Issues | Vol 6 • Issue 1 • 201694 trading strategies. Additionally, it is common for traders to adjust their trading strategy if they are not performing well with regard to their investment returns. Therefore from Table 1, we find that DCT2 achieves the best trading performance with regard to the ROI. This is a significant result as it implies that the efficiency of learning in achieving high investment returns. An important observation to highlight is that the detected DCT1 and DCT2 thresholds magnitude and type of trading for the different five stock indices are roughly similar. Thus, this confirms that financial price time series exhibits periodic patterns. This is a good starting result regarding automats’ trading strategies; though a full study through comparison with different trading strategies over different time periods and using different assets price time series will be more comprehensive, as this will show the whole picture and effectiveness of the adopted trading strategy. To summarize, the results indicate that prices in FMs exhibit “OS” and accordingly a DC trade simply makes a profit when there are price OS. The results in Table 1 draw attention to the importance of considering events in studying the price time series in FMs, rather than physical time changes owing to the long coastline of price changes based on intrinsic time. Intrinsic time enables the analyst to capture the short-term price dynamics, based on the analyst’s expectations of the market. In addition, intrinsic time reduces the complexity of real-world price time series given the small number of price points for evaluation. The computational costs (which include the cost of evaluating the price data) should not be disregarded. Therefore, it must be considered when it comes to deciding on an approach for studying the price time series in FMs. 8. CONCLUSION Asset trading in the FMs is an important decision-making problem which involves both selections of trend movement magnitude and direction. Despite the fact that many promising works have been reported for predicting prices, detecting periodic patterns, and managing trading using computational techniques, considering all of them is challenging as of their complexity. In this paper, we pioneer in formulating DC event approach into automated trading strategies and evaluate their profitability performance in the SSM. Three automated DC trading strategies are presented: ZI-DCT0, DCT1, and DCT2, which designed as a decision making support system tool for financial investors. This paper offers a plain demonstration of the definition of the DC event approach, in combination with the motivation behind introducing this approach as an automated trading strategy, its advantages and significance, and the working mechanisms. The DC event approach has the potential to become a robust foundation tool for automated investment trading in the FMs. Our study implies that being able to recognize DC and OS events in the price time series may be the key to providing effective decision support in the FMs. The simple learning mechanism employed by the automated DC trading strategies is effective for detecting arbitrage opportunities. Although, we cannot draw more generic conclusions regarding the use of other automated intelligence learning trading strategies in the FMs, our results provide evidence that a complex automated learning trading strategy may not be necessary. One of the significant features of the automated DC trading strategies is the combination of classical TF and CT investment rules with a learning model from asset’s historical prices, which can extensively advance computational effectiveness and the predictability of price trend magnitudes and directions, as well as uncover periodic patterns in the price time series. TF and CT strategies have been widely adopted by investors in FMs. To the best of our knowledge, no related work in the literature has explored TF and CF investment strategies within a learning model based on the detection of periodic DC patterns. This study has demonstrated the feasibility of employing learning from historical data as part of a trading strategy in that both DCT1 and DCT2 are designed to adapt to market price trend directions and hence deduce periodic patterns. We believe that modeling of learning in automated trading strategies in important. In DCT2, learning is triggered in two different ways: endogenously and with fixed periodicity. Future work will consider the combination of evolutionary learning techniques with a DC event approach for developing automated trading strategies for investment in the FMs. 9. ACKNOWLEDGMENTS We would like to thank the Deanship of Scientific Research and Humanities Research Center in King Saud University for their support. We would like to thank the Capital Market Authority in Saudi Arabia for providing the SSM datasets. We are very grateful to Prof. M. Fasli, Prof. E. Tsang, Prof. R. Olsen and Dr. A. Dupuis for their insightful suggestions and advice during the course of this study. We would also like to thank the anonymous reviewers for their useful comments and suggestions. REFERENCES Alfi, V., Cristelli, M., Pietronero, L., Zaccaria, A. (2009a), Minimal agent based model for financial markets I: Origin and self-organization of stylized facts. The European Physical Journal B, 67(3), 385-397. Alfi, V., Cristelli, M., Pietronero, L., Zaccaria, A. (2009b), Minimal agent based model for financial markets II: Statistical properties of the linear and multiplicative dynamics. The European Physical Journal B, 67(3), 399-417. Alfi, V., Cristelli, M., Pietronero, L., Zaccaria, A. (2009c), Mechanisms of self-organization and finite size effects in a minimal agent based model. Journal of Statistical Mechanics, 2009;03:P03016. Aloud, M. (2015), Directional-change event trading strategy: Profit- maximizing learning strategy. In: COGNI- TIVE 2015: The Seventh International Conference on Advanced Cognitive Technologies and Applications. IARIA. p123-129. Aloud, M., Tsang, E., Olsen R., Dupuis, A. (2011), A directional-change events approach for studying financial time series. Economics Papers, No 2011-28. Aloud, M., Tsang, E., Olsen, R. (2012), Modeling the FX market traders’ behavior: An agent-based approach. In: Alexandrova-Kabadjova, B., Martinez-Jaramillo, S., Garcia-Almanza, A., Tsang, E., editors. Simulation in Computational Finance and Economics: Tools and Emerging Applications. Pennsylvania: IGI Global, Hershey. Aloud: Profitability of Directional Change Based Trading Strategies: The Case of Saudi Stock Market International Journal of Economics and Financial Issues | Vol 6 • Issue 1 • 2016 95 Bauwens, L., Hautsch, N. (2009), Modeling financial high frequency data using point processes. In: Mikosch, T., Kreiay, J.P., Davis, R.A., Andersen, T.G., editors. Hand - Book of Financial Time Series. Berlin, Heidelberg: Springer. p953-979. Booth, A., Gerding, E., McGroarty, F. (2014), Automated trading with performance weighted random forests and seasonality. Expert Systems with Applications, 41, 3651-3661. Cliff, D., Bruten, J. (1997), More than Zero Intelligence Needed for Continuous Double-Auction Trading. England: Technical Reports Hewlett Packard Laboratories, HP Laboratories Bristol. p97-157. Cont, R. (2001), Empirical properties of asset returns: Stylized facts and statistical issues. Quantitative Finance, 1(2), 223-236. Cootner, P. (1964), The Random Character of Stock Market Prices. Cambridge: MIT Press. Covel, M. (2004), Trend Following: How Great Traders Make Millions in up or Down Markets. Upper Saddle River, NJ: Financial Times Prentice Hall. Dacorogna, M., Gençay, R., Müller, U., Olsen, R., Pictet, O. (2001), An Introduction to High-Frequency Finance. San Diego: Academic Press. Duffy, J., Unver, M. (2006), Asset price bubbles and crashes with near- zero - Intelligence traders. Economic Theory, 27, 537-563. Engle, R., Russell, J. (2006), Analysis of high frequency data. In: Ait Sahalia, Y., Hansen, L., editors. Handbook of Financial Econometrics. Amsterdam, Netherlands: Elsevier. Fama, E. (1965), The behavior of stock prices. Journal of Business, 38, 34-105. Fong, S., Tai, J., Si, Y.W. (2011), Trend following algorithms for technical trading in stock market. Journal of Emerging Technologies in Web Intelligence, 2, 136-145. Fong, S., Si, Y., Tai, J. (2012), Trend following algorithms in automated derivatives market trading. Expert Systems with Applications, 39(13), 11,378-11,390. Glattfelder, J., Dupuis, A., Olsen, R. (2011), Patterns in high-frequency FX data: Discovery of 12 empirical scaling laws. Quantitative Finance, 11(4), 599-614. Gode, D., Sunder, S. (1993), Allocative efficiency of markets with zero intelligence (Z1) traders: Market as a partial substitute for individual rationality. Journal of Political Economy, 101(1), 119-137. Grossman, S., Stiglitz, J. (1980), On the impossibility of informationally efficient markets. The American Economic Review, 70(3), 393-408. Guillaume, D., Dacorogna, M., Davé, R., Müller, U., Olsen, R., Pictet, O. (1997), From the bird’s eye to the microscope: A survey of new stylized facts of the intra-daily foreign exchange markets. Finance and Stochastics, 1, 95-129. James, J. (2003), Simple trend-following strategies in currency trading. Quantitative Finance, 3, 75-77. Kampouridis, M., Tsang, E. (2010), EDDIE for investment opportunities forecasting: Extending the search space of the GP. In: Proceedings of the IEEE Congress on Evolutionary Computation. Spain: Barcelona. p2019-2026. Kim, K. (2007), Electronic and Algorithmic Trading Technology: The Complete Guide. Orland: Academic Press. LeBaron, B. (2001), Evolution and time horizons in an agent-based stock market. Macroeconomic Dynamics, 5, 225-254. Leroy, S. (1973), Risk aversion and the martingale property of stock prices. International Economic Review, 14(2), 436-446. Lo, A. (1988), Stock market prices do not follow random walks: Evidence from a simple specification test. Review of Financial Studies, 1(1), 41-66. Lucas, R. (1978), Asset prices in an exchange economy. Econometrica, 46(6), 1429-1445. Markose, S., Tsang, E., Martinez, S. (2003), The red queen principle and the emergence of efficient fi- nancial markets: An agent based approach. In: Lux, T., Reitz, S., Samanodou, E., editors. Nonlinear Dynamics and Heterogeneous Interacting Agents, Lecture Notes in Economics and Mathematical Systems 550. Berlin, Heidelberg: Springer. p287-303. Martinez-Jaramillo, S., Tsang, E. (2009), An heterogeneous, endogenous and co-evolutionary GP-based financial market. IEEE Transactions on Evolutionary Computation, 13(1), 33-55. Nuij, W., Milea, V., Hogenboom, F., Frasincar, F., Kaymak, U. (2013), An automated framework for incorporating news into stock trading strategies. IEEE Transactions on Knowledge and Data Engineering, 26(4), 823-835. Sharpe, W.F., Alexander, G.J., Bailey, J.V. (1995), Investments. Upper Saddle River, New Jersey: Prentice-Hall International, Inc. Szakmarya, A., Shenb, Q., Sharmac, S. (2010), Trend-following trading strategies in commodity futures: A re-examination. Journal of Banking and Finance, 34(2), 409-426. Tirole, J. (1982), On the possibility of speculation under rational expectations. Econometrica, 50(5), 1163-1181. Tsang, E. (2010), Directional changes, definitions. Technical Report. 050 10. UK: Centre for Computational Finance and Economic Agents (CCFEA), University of Essex. Tsang, E., Martinez-Jaramillo, S. (2004), Computational finance. IEEE Computational Intelligence Society Newsletter. p 3-8. Tsang, E., Li, J., Markose, S., Er, H., Salhi, A., Iori, G. (2002), EDDIE in financial decision making. Journal of Management and Economics, 4(4), 1-10. Winker, P., Gilli, M. (2001), Indirect estimation of the parameters of agent based models of financial markets. Geneva: Technical Report, Fame Research Paper, University of Geneva.