EVENT-DRIVEN BUSINESS INTELLIGENCE APPROACH FOR REAL-TIME INTEGRATION OF TECHNICAL AND FUNDAMENTAL ANALYSIS IN FOREX MARKET

Forex market is the most liquid financial market and the largest market in the world. Forex market has been analysed using two isolated approaches, technical analysis and fundamental analysis. Technical analysis attempts to predict the movement of prices by studying the historical data of the market whereas fundamental analysis concerns essentially with the overall state of the economy. Relying on one kind of analysis limits the quality of trading decisions therefore traders usually gain insight into the market by analysing many factors which may influence the market state and the price movement. This process has become increasingly challenging due to the vast and variant number of prices’ determinants and the rapid changes in the market dynamics. This study proposes an event-driven business intelligence approach to respond immediately to any change in the market status by generating trading signals based on different analyses. Targeting the value associated with the data as it arrives, different models are built to capture and process the data of three currencies against US dollar in different frequency as well as the data of nine US macroeconomic indicators. The time-series data for both technical and fundamental indicators are modelled using artificial neural network while a knowledge base model is implemented to integrate the signals generated by time-series models. The experimental results show a remarkable improvement in the quality of trading signals using real-time consideration of different analyses.


INTRODUCTION
The dynamics of financial markets have brought a big interest in wide range of researches in different disciplines and domains. Forex market is the most liquid financial market and the largest market in the world. Official reports indicate a notable continuous increase in forex liquidity year after year (BIS, 2010). This increase could be related to variety of factors such as the fact that foreign exchange is getting more important as an asset class, the increase of retail investors and the growth of electronic methods of accessing the market that have attracted more participants and traders. This growth of market liquidity and participants has brought more challenges on the level of decision making as accurate decisions are crucial in order to gain benefits. Traders and brokerage firms attempt to gain insight into the market in order to enhance their predictive capabilities of price movement by analysing all price determinants and many factors which may affect the market state. This process has become increasingly challenging, considering the vast and variant number of price determinants which formulate prices fluctuation in forex market. Basically, experts analyse forex market using two common isolated approaches, which are technical and fundamental analysis (Frankel and Froot, 1990). Technical analysis aims to capture patterns of price movement by studying historical data of the market; whereas fundamental Science Publications JCS analysis concerns essentially with overall state of economy which can be determined by several indicators (MacDonald and Marsh, 1996).
Most of forex trading platforms provide suitable collection of technical analysis tools along with data charts to facilitate better visualization of patterns embedded within data. While there is a gap in incorporating fundamental analysis in these platforms except some approaches which either require human intervention or limited to specific fundamental factors. Most traders' decisions rely essentially on technical analysis whereas fundamental analysis is mostly handled separately based on traders' experience. Even though technical indicators are able to sufficiently indicate future price direction, ignoring the influence of external factors would be risky. Thus, domain experts recommend that it is important to realize the overall situation of the market and economy during decision making process by addressing fundamentals and related factors. This could be a challenging task due to the difficulty of studying many interrelated factors and their influence on exchange rates. Moreover, due to the fact that exchange rate price fluctuation is linked to some external factors such as news and macroeconomic indicators, forex market has developed a sensitive nature to events. Cheung and Chinn (2001) showed that roughly 70% of forex traders respond to macroeconomics announcements in one minute. This indicates the importance of considering the time aspect in decision making process and the demand of real-time support of related factors analysis.
Fortunately, the rapid improvement on today's applications and technologies enables fast accessing to information, discovering knowledge and visualizing it in reasonable time and effort. In this context, Business Intelligence (BI) is considered as a one of the highest priority in IT investments and the second most important systems in IT field (Luftman and Kempaiah, 2008;Yeoh et al., 2008). BI technologies offer accurate and up-to-date analysis of businesses and their surrounding environment which assure their survival. This analysis could include studying the financial state, customers' behaviour and any other factor that could be a determinant of the market behaviour.
This study argues that if forex brokerage firms or traders attempt to right access to information of different related factors and benefit the value assigned with it as it arrives, then it is essential to utilize real-time BI capabilities. In this study, an event-driven business intelligence approach for forex trading system is proposed to access information, defined relationships among patterns, predict the next state of the market and generate trading decision signals based on technical and fundamental analysis. The process starts with preparing forex time-series data with different frequencies to build time-series models based on Artificial Neural Network (ANN) for capturing the trend of forex data in different time-frame. Similarly, other factors' data (e.g., US macroeconomics) can be analysed and included. Using experts' experience, a knowledge base can be built to contain all the rules for integrating different factors and defining a trading strategy. After constructing all the time-series models and the knowledge base, every new arriving data can be formulated as an event for further processing to create a trading signal. This criterion allows every detail to be part of the process of generating trading signals without any delay. This study is arranged to include related works, event-driven business intelligence in forex, the proposed system design and implementation and the experimental results.

Related Work
Forex market dynamics have been studied and addressed extensively from different perspectives. In information technology, the basic fact, which has been proven by many researches, is that targeting tick-by-tick data of forex market and related data facilitates at wellunderstanding of forex market behaviour and enhances the accuracy of trading decisions. Frankel and Froot (1990) argued that there are two types of analysis for forex market namely, technical analysis and fundamental analysis. Technical analysis is considered as the behavioural finance approach which concerns with the traders' reactions to the new information and their behaviour against the price movements ( Barberis and Thaler, 2002;Shleifer, 2000;Subrahmanyam, 2007). Due to the fact that traders' psychology is vital in any trading process, psychological biases in forex trading have been proven by several researches. For example, the behaviour of traders' and their expectations and beliefs toward upcoming information have been studied as vital factors for trading in forex (Frankel and Froot, 1990;Ito, 1990;MacDonald and Marsh, 1996;Oberlechner, 2001). Moreover, many other researches focused on traders' overconfidence and proved its influence in forex market (Barber and Odean, 2000;Glaser and Weber, 2007;Oberlechner and Osler, 2008). In the same context, some works proved the impact of loss aversion and herding behaviour (Kim et al., 2004;O'Connelle and Teo, 2009) and some others showed the effects of feedback trading on forex market which is also considered important in forex trading (Aguirre and Said, 1999;Bjnnes and Rime, 2005;Laopodis, 2005).

JCS
The second approach of forex market analysis is fundamental analysis or microstructure approach which concerns with economic fundamentals along with accompanied factors such as order flow and news arrivals. Several researches showed the impact of order flow (Berger et al., 2006;Evans and Lyons, 2002b;, news arrivals and macroeconomics announcements (Almeida et al., 1998;Andersen and Bollerslev, 2003;Chang and Taylor, 2003;Evans and Lyons, 2002a; and fundamentals (Evans and Lyons, 2002b; on forex trading process and the market status. The technical analysis is performed by discovering the patterns within forex data since there are many indictors which indicate the next status of the market (Liu and Xiao, 2009). This could be performed by studying time-series data of exchange rates and discovering future trends of the data. Financial instruments such as stocks, indices, prices, auctions and foreign exchange rates can be predicted as time series (Ravi et al., 2012). Considering only previous values, new values are often predicted using any prediction technique (Frank et al., 2001;Schwaerzel and Bylander, 2006;Sheta and Jong, 2001;Yao and Tan, 2000).
Statistical tools and methods have been applied efficiently to perform the prediction task. However, in the last decade, many researchers concluded that machine learning methods can outperform traditional and statistical prediction techniques (Mendes et al., 2012). This is due to the complicated nature of forex market which follows nonlinear and irregular behaviour determined by variety of determinants and factors. For decades, linear tools are used to capture regular technical indicators in forex market. However, real world events and traders behaviour do not follow uniform manner and therefore these technical indicators have difficulties to predict the status of the market. For example, the moving average or oscillators such as Relative Strength Index (RSI) and stochastics oftentimes signalize false breakouts (Chan and Teong, 1995). Thus, applying technical indicators to trace nonlinear behaviour of the market would be risky and unreliable (Chan and Teong, 1995;Emam, 2008).
The alternative option would be some other tools and methods which have the ability to overcome the nonlinearity of the market behaviour. Many data-driven machine learning techniques show remarkable capability of capturing nonlinear relations within the data and discovering unseen patterns and trends. The existing literature reveals that Artificial Neural Networks (ANN), Genetic Programming (GP) and Genetic Algorithms (GA) in particular, are widely applied for prediction task in forex market (Emam, 2008;Mendes et al., 2012;Ravi et al., 2012;Santini and Tettamanzi, 2001). Many other techniques are also sufficiently applied to forex time-series data, such as Support Vector Machines (SVM) (Cao and Tay, 2001;Huang et al., 2010; and fuzzy logic (Bahrepour et al., 2011;Castillo and Melin, 2002;Deboeck, 1994;Liu and Xiao, 2009).
On the other hand, fundamental analysis studies the market microstructure and some related factors. In this context, macroeconomic indicators have significant influence on exchange rates fluctuation. This fact has been proven by several researches (Almeida et al., 1998;Andersen and Bollerslev, 2003;Chang and Taylor, 2003;Evans and Lyons, 2004). Moreover, Cheung and Chinn (2001) showed that roughly 70% of traders respond to macroeconomics announcements in one minute. The same concepts are shown by Andersen and Bollerslev (2003) who proved that high-frequency exchange rate dynamics are linked to macroeconomic data. Studying the impact of macroeconomic announcements on United States (US) dollar against German mark, British pound, Japanese yen, Swiss franc and euro shows that bad news has more remarkable influence than good news (Andersen and Bollerslev, 2003). Evans and Lyons (2004) studied the influence of US and German macroeconomic announcements on the exchange rates of US dollar against the euro. Their study which includes thirty US and thirteen German macroeconomics announcements shows that different announcement types have quite different effects on induced transactions. They also concluded that the effects of macroeconomics remain significant for days. Andersen and Bollerslev (2003) and Evans and Lyons (2004) studied around thirty US and thirteen German macroeconomics announcements where Harada and Watanabe (2009) studied four US and five Japanese macroeconomics; All these works concluded that US macroeconomics announcements have greater impact on the market than other countries' macroeconomics especially if their currencies is paired with US dollar.
In forex, experts do not rely in just one approach to predict the following status of forex market and usually tend to apply different kind of analysis which mostly applied separately. Each analysis requires appropriate means and methods to be performed. Leveraging the most powerful tools to perform the analyses and visualizing the results would assist in gaining insight into the market. Thus, this study addresses two aspects regarding trading in forex. Firstly, integrating both Science Publications JCS technical and fundamental analysis and involving them in the decision making process. The second aspect is utilizing the recent and powerful tools to overcome the market irregularity in terms of system architecture and the applied techniques.

Event-Driven Business Intelligence for Trading in Forex
Many researches emphasize the linkage between forex high frequency dynamics and several factors that can be considered as events, such as news or macroeconomic announcements. This sensitive nature of forex market to events must be considered in any system that attempts to provide users with reasonable and successful insights into the market. In this context, BI tools offer high capabilities in different levels of decision making process including real-time decisions. Recently, BI has become increasingly essential in different domains. BI is a multi-disciplinary field and has been defined in different ways and perspectives. BI can be described as a wide range of tools for gathering, analysing and visualizing knowledge to enhance the decision making process. BI allows decision makers to tune their actions based on up-to-date information and strategy. Thus, BI could be a potential approach to be applied in forex market in order to enhance the trading decisions.
In forex market, a lot of events and factors impact the exchange rates as they occur. Realizing the up-coming events and discovering the patterns embedded with forex related data is usually done with time-consuming manner. Speeding up this process would facilitate at utilizing the value assigned with gaining insight into the market earlier than the conventional process. Thus, forex market analytical platforms require real-time access to data, discovering knowledge and taking actions.
The main aspect of real-time analytical platforms is to speed up the flow of information as well as the response to this information. Unlike traditional BI system, real-time BI system has the ability to process the information quickly and achieve competitive advantage rather than relying on only historical data (Sahay and Ranjan, 2008). Traditional BI tools do not meet the highly required tools to respond to situations and make decisions in real-time for critical timely business situations. Thus, it becomes essential not only to analyse upcoming events and transactions in real time but also making decisions and response to the analysis results in real-time and instantaneously react to up-to-the-moment changes of business processes. Robinson (2002) argues that BI tools can achieve near or real-time performance by melding analytics with operational functions and application thereby analytics becomes an integral part of business process. Nguyen et al. (2005) proposed a BI architecture following the whole business processes. This architecture includes all the processes to capture, analyse, predict and automate respond to business environment in order to decrease the response time needed for decision making. They proposed an event -driven approach as infrastructure for BI systems which apply real-time analytics on business processes and generate alerts with actionable recommendations or automatically taking actions in response of events and thereby closing the gap between business operations and analytical platforms.
Considering the rapid dynamics of forex environment and its sensitivity to events, it is essential to respond in real time. Many researchers concluded that the more the system is real-time, the more event-driven it should be (Azvine et al., 2005;2007;Sahay and Ranjan, 2008). Based on the fact that forex market is influenced by several factors which could be economic dynamics, political events or market participants' believes and strategies, these factors could be formulated as events to be captured in order to get respond directly as they occur. Addressing these factors could leads to better understanding and decisions. However it is really a challenging task since there is no clear line among those factors to be defined and mostly considering so many factors could lead to confusion. Dealing with all these factors and determinants, there are claims for more flexibility, reliability and reactivity. Rather than applying demand-driven approach, event-driven approach would be useful in terms of speeding up the reaction to events which could minimize the risk and gain more profit.
In this study, an event-driven BI framework has been proposed to generate forex trading signals based on both technical and fundamental analysis. The proposed framework consists of five main layers: data sources, data pre-processing, events processing, analytical platform and data presentation (Fig. 1).
In data Source layer, there are two types of data needed to generate trading signals which are forex data (currencies exchange rate) and fundamentals data (macroeconomics data). In our experiments, the system is provided with exchange rate data for three currencies against USD in eleven time-frames and nine US macroeconomics data which have the most presence in the previous works. All this data must be ready to proper usage of the system. The system has the property of accepting additional currencies and factors. Once the user add new currency exchange rate data or new factor, identifying the relationship would be necessary for accepting this new information. The data pre-processing layer task is to prepare data for further processes. This process is vital in machine learning techniques in both building and using phases. Mostly, Data pre-processing and data transformation must be performed as a prior stage for any learning or testing process. In order to reduce any potential noise affects or restore any missing values, normalization process must be performed before any further process. After data normalization, the transformation process must be applied to facilitate a learner training or a model re-calling. Data transformation is vital for extracting important information from the input data, rescaling them and rendering them to apply further analytics tools. Usually, data inputs are preferable to be in range of [0 to 1] so a proper transformation formula must be chosen.
The processed data is then formulated to events representing the type and the value of data. The type of data is given by ID code to indicate the source of data, (i.e., the code differentiates between exchange rate data and macroeconomic data. Moreover, it specifies the currency pair and its frequency or the macroeconomic indicator). Evens are shown as numerical array of two elements, the first for the type and the second for the value.
In event processing layer, the up-coming events are analysed by the event-processing-engine. Event processing engine is responsible for identifying the upcoming events and generate actions according to predefined conditions. Events generated by user are accompanied with data. At an earlier stage this data is pre-processed and the role of event processing engine is to take action depending on this data.
The Analytical Platform layer mainly concerns about two basic analytical tasks, which are: Time-series prediction and trading signal generation. Both exchange rates and macroeconomics data could be predicted using time-series prediction techniques. While the signal generation based on both technical and fundamental analysis would require employing expert knowledge. For Science Publications JCS this purpose, knowledge-based model has been developed to integrate both analyses. Finally, in the data representation layer, the data and the results can be viewed in two ways: Chart view and data list view which provides clear representation of data and its trends.

System Design and Implementation
The completeness and adequacy of any BI infrastructure depend on the technologies which provide continuous support of business decisions (Robinson, 2002). Due to the fact that forex market has many determinants and affected by different factors, thereby different analyses are required to be conducted to analyse the market status. Basically, traders and experts use technical and fundamental analyses to gain insight into the forex market and that is exactly what the proposed system attempts to do. Technical analysis studies the traders' reactions and their behaviour which is embedded with the exchange rates data whereas the fundamental analysis studied the economics and the political situation for the country which is announced by the government. Based on the literature, some significant macroeconomics announcements are taken in account for predicting the exchange rates beside the exchange rates data itself. Thus, both technical and fundamental analyses are considered to gain insight into the forex market. Based on the gained knowledge trading signals will be visualized to users to support their trading decisions. Forex analytics in the proposed system include three major parts: exchange rate prediction, macroeconomics prediction and trading signals generation.

Data collection and Processing
The forex data considered in this study is the exchange rates for US dollar against three major currencies which appeared in most of the previous related works. These currencies are Euro, Canadian dollar and Swiss franc. The forex data are captured and collected with different frequencies (from 1 min to one year). The historical forex data (yearly, quarterly, monthly, weekly and daily) for all currencies are collected from Federal Reserve Bank of St. Louis (FRB). Whereas the intraday forex data (four hours, 1 h, 30, 15, 5 and 1 min) are provided by online financial data vendor (OANDA). Table 1 shows the data observation date for each currency pair (CADUSD, CHFUSD and USDERU). The fundamental data considered in this study is US macroeconomic data collected from different agencies which are: Bureau of Economic Analysis (BEA), Bureau of Labour Statistics (BLS), Bureau of the Census (Census) and Employment and Training Administration (ETA) ( Table 2).
These announcements have a predefined time to be published (with different time-fames and mostly at 8:30 am EDT). Therefore, traders expect them and react based on them.

Forex Analytics
Exchange rates predictors along with macroeconomics predictors are built to forecast the future values of specific indicator. Multi-layer perceptron MLP-ANN with back-propagation algorithm is used to build both exchange rate and macroeconomic indicators predictors. Each currency pair of the three chosen currency pairs has eleven predictors to forecast eleven time-frame values from (one minute to one year). Each predictor generates a signal that indicates the trend of the exchange rate in particular time-frame. Therefore, there are eleven output exchange rate signals from all predictors of each currency pair. By consulting domain experts, a knowledge-based model has been built to generate trading signals based on nine US macroeconomics announcements. Since US macroeconomics announcements have a notable influence on exchange rate, they can also be forecasted using macroeconomic indicators predictors in order to precede one step forward.

Time-Series Predictors Implementation
Exchange rate predictors are set of MLP models which trained to perform the prediction task of exchange rate direction for the given currencies in different timeframes. Similarly, macroeconomics predictors are built based on MLP. Simply, MLP neural network with single hidden layer is chosen to perform the task of timeseries prediction for different time-frame exchange rates values and each of macroeconomic data. The sigmoid function is chosen to be the activation function for MLP models. All MLP models are trained using back-propagation algorithm with different parameters to investigate the impact of them on the training process. Each training data is provided with different dimension (lag window) defining the number of previous data observables considered to predict the next value. Before the training process, training data is transformed and normalized in range of [0 to 1] which is the range of the sigmoid function which is used as an activation function. The transformation function which is widely used in time-series prediction is: where, x t and x c are the transformed and the actual value of a given data whereas and are the maximum and the minimum values in a given series of data. Different experimental settings are provided in attempt to reach the perfect model structure where we can define the number of inputs and hidden-layer's neurons. Furthermore, some other training parameters (such as learning rate, number of iterations and so on) are also tested. Using the output of these experiments, the training parameters individually selected for each model according to their impact on training process and prediction accuracy.

Knowledge-Based Signal Generator Implementation
Basically, each signal indicates a movement of exchange rate prices. By forecasting next values, exchange rate predictors directly specify exchange rate trends. Whereas macroeconomic indicators define the overall economic situation of a given country which impact its currency exchange rate. The role of integration both analyses are difficult since there is no well-defined relationship between each macroeconomic indicators and exchange rate. In this study, the integration of both analyses is simply based on following rules:

RULE I
IF exchange-rate_signal is equal macroeconomic_signal THEN signal adopted.

RULE II
IF exchange-rate_signal differs from macroeconomic_signal THEN signal aborted. Each signal of the eleven time-frame predictors will be calculated as the following: AND signal = "HOLD where, t 1 x + and x t are the predicted and the actual value of exchange rate at time t respectively.

RULE I
The actual macroeconomic announcements have an influence on forex price fluctuation. By consulting domain experts, some trading rules could be made to enhance the decisions' quality. Table 3 shows the effects of macroeconomic announcements on the forex price movement and summarizes the trading rules which are considered when they are released. By predicting these data before its release time, useful decision could be made.
For this purpose, this study includes macroeconomics predictors. The major impact of macroeconomics announcements on the exchange rate usually comes directly after they released (Cheung and Chinn, 2001). Thus, the predicted values of macroeconomics will be provided before 1 day from its release date and adjust decisions. When new actual values are provided, the models learn and adjust according to the available data.
Based on previous signals from 10 basic factors (e change rate and 9 macroeconomic indicators), 20 basic rules can be formulated to be added to the knowledgebased trading signals generator.

Trading Signals Evaluation
After building all the models, the system is ready to be used. In this part, many experiments have been conducted to evaluate different trading strategies. Those experiments simulate trading decision for three currencies pairs in three months period from April 1st, 2011 till June 30th, 2011. At first, the signals generated by single time-frame exchange rate predictor will be evaluated. After that, the macroeconomic indicators will be considered to generate the final signals.

Trading Signals Based on Exchange Rate Data
The number of observations for each time-frame frequency and the accuracy of its equivalent predictor's signals are shown in Table 4. The results show that the higher the frequency, the lower the accuracy. This could be due to the fact that the number of observations in high frequency data is higher than the number of observations in lower frequencies data.
Moreover, the irregularity nature of financial data appears more obvious in high frequency data which makes it harder to be captured in any well-known method. In Table 4, the accuracy of each predictor is rounded to integer number since it states reasonably its meaning. The overall accuracy for each currency predictors is also presented.

Trading Signals based on Exchange Rate and Macroeconomics Indicators
The number of macroeconomics signals in the experiment period was 35 signals generated in different time as shown in Table 7. Because of the huge number of exchange rate signals, macroeconomics indicators' signals could not be noticed. Thus, the impact of these signals has been studied from the moment they have been generated until four hour later. This experiment has been set to integrate the fundamentals with the technical signals.
Before the experiment has been conducted, it worth mentioning that US macroeconomic news release time is in US Eastern Time (EDT) whereas the exchange rate data is captured in Greenwich Mean Time (GMT). To adjust the time for all the factors, macroeconomics time can be set to GMT by subtracting five hours from its release time (since EDT = GMT -5 hours). The schedule of US macroeconomic date and time during the experiment period is shown in Table 8.
Two experiments have been carried out to integrate macroeconomic signals with the exchange rate signals. 4-hour and 30-minutes data frequencies have been chosen to integrate their signals with macroeconomic signals. Table 5 shows the result of incorporating 9 US macroeconomic signals with exchange rate signals where the impact of macroeconomic has been set to affect the 30-minutes exchange rate data frequency. In Table 6, the same experiment settings have been applied but the impact of macroeconomic has been set to affect the 4hours exchange rate data frequency.
In both experiments, the results show a remarkable improvement of the accuracy but the number of signals has been decreased. This result shows the strictness which external factors could add to exchange rates signals and technical indicators' signals.      Table 8. Macroeconomic

CONCLUSION
Forex market environment and its analytics, is the subject of investigation of this study. The major aim of this study is to formulate a framework to generate more accurate signals based on different kinds of analyses and strategies. To do so, a massive theoretical study has been carried out to investigate the determinants of forex market status. This study reveals that forex market is connected with vast number of factors and determinants which add more challenges to gain insight into the market. Forex market is analysed using two common approaches: Technical and fundamental analysis. Studying the previous behaviour of the market and the reaction of traders in different point could lead to better understanding and here is where technical analysis fills in.
In machine learning field, time-series data can be predicted using only the previous values. Therefore, this mission was handled using MLP-ANN. MLPANN is a machine learning technique capable to learn and forecast new values only by studying the previous data. On the other hand, fundamental analysis is the part of science where the overall status of the market and the surrounding environment are studied. As exchange rates are connected with huge number of external factors, different factors are investigated by experts to determine their impact on forex market and how to react according to them. Among these factors, we chose to integrate macroeconomic indicators with exchange rate in the trading signal generation process. According to the literature, US macroeconomics news has major impact on the exchange rates. Therefore, we chose 9 US macroeconomic indicators to be included in further analysis. The second major part of this study is the event-driven framework formulation and implementation. The literature review indicates that using business intelligence system would facilitate at processing different kinds of information and offer a wide-range of analytical tools to discover unseen patterns in this information.
Considering the rapid change in forex environment, event-driven approach was chosen to be applied in this framework. In this point, the major argument of this research is accomplished which is: "using event-driven business intelligence system would help to gain insight into forex and facilitate at making better decisions". Subsequent to framework formulation and implementation, many experiments have been carried out to find a good trading strategy. The results showed a remarkable improvement of signals' accuracy has been achieved after integrating macroeconomic signals with exchange rate signals.