Yu Gu MComp
Yu Gu MComp
Yu Gu MComp
New Zealand
Yu Gu
2012
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
Abstract
Robot trading, also known as algorithmic trading, has been widely used in financial markets in
recent decades. The wide application of robot trading has brought significant benefits to
transaction efficiency. A lot of developers have designed trading robots which can simulate
their trading strategies, and they have claimed that these robots can keep making profits
continuously in the place of human traders. However, their performance is usually not as
satisfactory as human traders. Two factors could lead to this failure in trading: (1) programs
cannot simulate all human behavior; and (2) most robots are over- sensitive, which may reduce
their performance. To solve those problems, therefore, evaluating the effectiveness and
The contribution of this research includes a study of trading robots and their algorithms, trading
robot experiment design, data analysis and improvements to program design. The study
focuses on the conceptual mechanism of trading robots, which includes trading applications
This paper reports that forex trading robots are suitable for forex rates prediction. The evidence
shows that trading robots can capture the underlying “rules” of the forex market trend by using
time series, technical indicators and other factors. Traditional standards for robot trading
analysis are used to evaluate the accuracy of forecasting currency price changes when traders
are using their software for real trading. The results indicate that practical forecasting can be
completed and paper profits be obtained, by using five different trading robots. However, the
collection of sensitive analysis is incompatible with efficiency testing. Most testing results were
-2-|Page
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
collected by chart review, and the test results show that the effectiveness and sensitivity of
robot trading are both interrelated and contradictory. The more sensitive trading robots take
Further research is discussed in this paper. In future work, more data segments will be required
in the analysis, and all experimental data should be analyzed in different time frames on the
-3-|Page
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
Statement of Originality
This is to certify that the thesis is my own original work and it has been written by me. No part
of this thesis has been submitted to any other institution other than Unitec as part of any other
degree or diploma.
In addition, I certify that all information sources and literature used in the thesis are properly
indicated. Any help and assistance that I have received in my research and the preparation of
Yu Gu
03 March 2012
-4-|Page
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
Acknowledgements
First of All, I would like to express my sincere gratitude to my principal supervisor Dr. Xiaohui Zhao,
as his solid knowledge and rigorous attitude inspired me to finish this thesis with an open and
positive mind. His discussions have been very informative and useful. Without his kindness and
considerable support throughout my research journey, this work would not have been possible.
I sincerely appreciate my co-supervisor Associate Professor Leon Fourie for his guidance,
continuous support and critical evaluation of my study. I express my sincere thanks to him for
agreeing to become my supervisor when I was critically in need of his expertise and guidance.
During the entire course of the research, I have frequently consulted Associate Professor Hossein. I
am very grateful for his support in all difficult situations. His suggestions have given me a lot of
insight into this research. It has been a great privilege and joy to study under his guidance and
supervision. I am also extremely grateful to Dr. Aaron Chen, who has kindly provided me with
I would like to thank especially Margerat Fitzsimons, and my landladies Wendy and Jessica for
their support in preparing the thesis and grammar checking. I sincerely thank all the people in the
Department of computing of Unitec New Zealand, for their warm support and help.
Finally, I would like to thank my parents Mr Gu Guanda and Mrs Shen Tianqing for their love,
support, and encouragement throughout the whole period of my study in so many ways. Without
-5-|Page
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
Table of Contents
1. Introduction ...................................................................................................................................... - 1 -
1.1. Robot trading on retail foreign exchange markets ................................................................... - 2 -
1.2. Motivation ................................................................................................................................. - 3 -
1.3. Research Goals .......................................................................................................................... - 4 -
1.4. Challenges of research .............................................................................................................. - 6 -
1.5. Research Contributions ............................................................................................................. - 6 -
1.6. Thesis Structure......................................................................................................................... - 8 -
2. Background .....................................................................................................................................- 11 -
2.1. Forex elements ........................................................................................................................- 12 -
2.1.1. Expression of currency pairs ...........................................................................................- 12 -
2.1.2. Trading sessions ..............................................................................................................- 13 -
2.1.3. The calculation in foreign exchange market ...................................................................- 14 -
2.1.4. Leverage and fund management ....................................................................................- 15 -
2.2. Technical indices .....................................................................................................................- 16 -
2.2.1. Fundamental analysis ......................................................................................................- 16 -
2.2.2. Sentiment analysis ..........................................................................................................- 20 -
2.2.3. Technical analysis ............................................................................................................- 20 -
2.3. Trading robot Evaluation methods .........................................................................................- 23 -
2.3.1. Evaluation Criteria ...........................................................................................................- 24 -
3. Algorithm of Trading robot .............................................................................................................- 26 -
3.1. Working mechanisms of trading robots..................................................................................- 26 -
3.2. Rules of risk control function ..................................................................................................- 27 -
3.2.1. Maximum 30% Drawdown ..............................................................................................- 27 -
3.2.2. Maximum 2% Loss of Each Trade ....................................................................................- 28 -
3.2.3. Previews High / Low Strategy..........................................................................................- 30 -
3.2.4. ATR function ....................................................................................................................- 32 -
3.3. Algorithm of fund management function ...............................................................................- 33 -
3.4. Algorithm of market analysis function ....................................................................................- 34 -
3.4.1. Moving average crossover ..............................................................................................- 34 -
3.4.2. Triple Moving average cross over ...................................................................................- 37 -
-6-|Page
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
List of Figures
Figure 3-6 Using the simple indicators combination to capture the trend .............................. - 39 -
Figure 4-2 Relationship between the candles stick update and the forex chart window ........ - 56 -
Figure 0-5 Three White Soldiers and Three Black Crows ....................................................... - 101 -
Figure 0-6 Three Inside Up and Three Inside Down ............................................................... - 102 -
-8-|Page
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
List of Tables
-9-|Page
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
1. Introduction
The electronic foreign exchange (Forex) market is a global financial market for trading
currencies and it was established in 1971. Since then, how one currency relates to another
currency is expressed as foreign exchange, and it has naturally shifted from fixed to floating
under the continuously trading environment. Unlike other markets, the foreign exchange
market has a large trading volume, since it covers all the currency exchange transactions in the
In the past, only large investment funds could trade currencies. This trading process is called
“interbank” trading, and is established by large banks and major financial dealers. Spreads are
generated from forex trading, and are presented by the gap between bids and ask. By the wide
application of electronic forex trading, more and more retail foreign exchange brokers are
providing individual trading services for ordinary traders. “Retail foreign exchange trading is a
small segment of the large foreign exchange market.” (Wiki, 2011). Retail foreign exchange
brokers earn money from spreads. Most of them are trust companies, small banks and other
institutions. In the early 2000s, some software companies designed their own version of trading
platforms. All this software includes trading interfaces and user terminals, and provides the
Nowadays, trading robots are widely used in forex trading. Most of them are coded as
programs, and they can automatically execute the trading by following trading signals. The
greatest benefit of robot trading is the fast reaction to market sentiments. Usually, traders
-1-|Page
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
must waste time considering market sentiments and then make decisions. Trading robots can
use pre-wired thinking and save time which can be used to handle many trading opportunities.
Also, trading robots can avoid the psychological factors of human traders. There is no need to
consider such factors as greed and fear influencing the trading results in robot trading.
Robot trading, also known as algorithmic trading, has been widely used in financial markets in
recent decades. It is “the use of computer programs for entering trading orders with the
computer algorithm deciding on aspects of the order such as the timing, price, or quantity of
the order, or in many cases initiating the order without human intervention.” (Wiki, 2011). In
algorithmic trading applications, trading robots instead of humans analyze the historical data
Currently, a complex trading robot has three functions, viz., fund management, risk control and
analysis. Fund management is a part the of investment strategy. In forex trading, fund
management is used to set the capital amount for each transaction. Unlike the fund
management function, the risk control function helps traders set a stop and loss level, and it is
able to delete transactions that go in the opposite direction from the current market. The
variety of trading methods. However, most trading robots cannot capture all the market
sentiments, and the historical data cannot present all future movements.
The major factor that causes trading robots to make mistakes is the nature of the forex market.
The forex market is dynamic, and it is continuously moving within three types of market
-2-|Page
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
environments: up, down and sideways. Only real trading can make the change of price. Similar
to other financial markets, changes in the forex rate is made by traders who are buying one
currency and selling another, so historical data cannot determine future market movements.
To fix the problems of trading robots, Jamie (2008) provides two forex trading analysis methods:
fundamental analysis and technical analysis. Technical analysis is based on historical data
overview, which determines the future market movement. Fundamental analysis focuses on
economic data and forecasts the potential market fluctuation. The economic information
includes growth rates, interest rates and monetary policy, inflation, and unemployment. Jamie
(2008) believes that both methods are important in forex trading analysis. He recommends that
robot designers should pay more attention to collecting economic information, and that trading
robots should be designed with a function that has the ability to close all transactions while the
1.2. Motivation
The wide application of trading robots, including algorithmic trading, has brought considerable
benefits to transaction efficiency. With regard to the effectiveness of forex trading, Martinez
and Pappa (2009) assert that a profit system should have a high percentage of funds return
rather than numbers of profitable orders. Nevertheless, in terms of the sensitivity aspect,
Theodoros (2008) indicates that the robot should limit the number of noises, and that the total
Many designers have developed trading robots, and have also claimed that these programs can
replace human analysis and keep making profits by themselves. To evaluate the effectiveness
-3-|Page
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
and sensitivity of trading robots, it is important to grasp how these programs work. Generally,
human traders consider many market factors before they place an order. In electronic financial
trading markets, these factors can be categorized into technical index, timeframe and market
environment. In this research, I plan to investigate how these trading robots make decisions to
From a practical perspective, I particularly evaluated the effectiveness and sensitivity of trading
robots. The effectiveness of trading robots is defined as their capability to make profits through
trading, so I will focus on the accuracy of trading strategies, the reduction of the loss rate and
the increase of the total amount of the account. In regard to sensitivity, this research will
concentrate on “noise” from the testing of trading robots. In particular, Siam and Esfahanipour
(2008) indicate that trading robots should be equipped with optimization rules, a flexible policy
In order to cover the research topic, the research questions focus on the effectiveness and
sensitivity of trading robots. As the trading analysis takes into account many market factors
before they place an order, my research will target the following questions:
How can the algorithms used by trading robots be improved to enhance their
performance?
The working mechanism of trading robots: A complex trading robot has three functions, which
are fund management, risk control and analysis functions. In forex trading, the fund
management function is used to set capital of money for each transaction, the risk control
function helps traders set the support and resistance level, and the analyses function is used to
Effectiveness and sensitivity of trading robots: Two standards have been used in trading robots
evaluation. They are effectiveness and sensitivity. As algorithmic trading is one of artificial
intelligence, a trading robot can simulate human traders’ thinking under market changes.
However, in some situations, the performance of trading robots is not as satisfactory as that of
human traders. This is because of two factors: (1) computer programs cannot simulate all the
mathematical algorithms that have been integrated into trading strategies, for example, the
limitation of MQL4 programming influences the simulation of human behaviors; (2) Trading
robots generate many noises, which reduce the percentage of profitable orders, and influence
the trading performance. An effective robot should have a high percentage of funds return
rather than numbers of profitable orders. In the sensitivity aspect, trading robots should limit
the amount of noise, and the total account should be increased but not be dependent on a
profitable order percentage. Thus, the relationship between effectiveness and sensitivity in
Designing an improved robot: This research conducts several factors that can influence the
performance of trading robots. By improving those issues, the new robot can capture more
trading opportunities and increase the success rate. After the new robot has been completely
The details of trading strategies are not within the scope of this study. Instead, this work aims
to imitate the process of trading strategies using programs, and improve a variety of
implementation issues. The primary challenge of this research is the difficulty of applying
of economic events, this information is difficult to code as MQL4 to simulate human behaviors.
The second challenge is the simulation problem. In human trading, traders change their minds
while following market environment changes. It is difficult for developers to code those
complex behaviors into trading robots, and most robots cannot automatically change internal
parameters. This will certainly influence the experiment results, and reduce the effectiveness of
robots.
In addition, external factors also influence the robot trading experiment results. There are
many retail forex trading brokers using MetaTrader networking services. However, using the
same trading platform, different forex trading polices can make different experiment results.
Firstly, each broker has their own spread policy, which could influence the transaction cost, and
thus, the results in the deviation of effectiveness evaluation. Secondly, many retail forex
brokers cannot provide a complete set of historical market data. This could seriously influence
The contribution of this research includes the algorithm of trading robots, the approach for
trading robot tests, data analysis and a design for an improved program. The framework of this
-6-|Page
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
study provides basic information and a blueprint for operating procedures. In brief, each
Trading algorithm study: this study focuses on the trading robots mechanism, which
promote effectiveness and guard against sensitivity are a particular concern in this study.
Data gathering: Data gathering is the most important phase in this study. Gerald (2008)
points out that future market movement can be determined by analyzing the histrionic
data. Those data can be collected from document review, simulation tests and
further evaluate trading robots, simulation testing is necessary. Simulation testing is the
method that continuously runs the trading robot in forex trading and captures the
Development testing is more complex, since it develops the system to be used in both
real and simulated environments in order to provide all needed functions and
comprehensive performance.
Data analysis and evaluation: There are three types of data collected in this research;
the first stage of data analysis. The raw result data will be filtered and sorted to extract
the key indicators, such as profit, triggering events, trading times, frequencies, order
amounts and order size. Chart review is the second stage of trading robot evaluation. At
-7-|Page
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
this stage of the data analysis, I intend to review the working procedure, which includes
the three parts of placing an order: The pre-order procedure describes how a robot
collects historic data, organizes time and selects a technical index. The ordering
procedure indicates the monitoring of the trading process, for the purpose of reducing
possible risk. Decision marking parameters will also be important at this stage. In the
pre-order procedure, the trading robot will select some technical index to follow the
market trend. In different market environments, the trading robot will dynamically
change parameters to follow a trend. Calculations of the NMSE and gradient have been
applied in this research. They are important standards for evaluating the effectiveness
of robot trading.
Trading robot improvement: After the previous analysis stages, a general result can be
reliability and accuracy, and an improved automatic trading robot can be generated.
Compared with other trading robots, the new program improves many factors that can
reduce the performance of the robot trading. Those factors are parameter modification,
indicator modification, time frame selection and trading session selection. Furthermore,
timeframe switcher was added to this program, which can filter out more trading
Chapter 2 describes the research background of this study, and lists the details of economic
concepts and trading strategies. This chapter briefly reviews the history of robot trading and
-8-|Page
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
the basic concepts of forex elements. Additional description of trading algorithms is given in
this section, as they are essential parts of trading robots. Finally, to understand the process of
trading robots evaluation, the simple concepts of effectiveness and sensitivity evaluation are
introduced.
Chapter 3 introduces the process of forex trading and describes the working mechanism of
trading robots. Firstly, Forex transaction by human traders can be divided into three steps and
trading robots can simulate human traders’ behaviors and apply this mechanism in forex
trading. Secondly, the communication between three basic functions has been created in
trading robots. Those functions are fund management, risk control and trading strategies
function. The final stage is getting profit from robot trading. This chapter picks up several
trading robots, and explains their algorithms one by one. These algorithms have been
Chapter 4 focuses on the experiment’s creation. Before the robot test, the pre-experiment is
built for analyzing market environments. At this stage, only the value of the Hurst indicator is
greater than 0.5 and the experiment result can proceed to further evaluation. The primary
purpose of the experiment is to focus on the effectiveness and sensitivity evaluations. In the
effectiveness area, the experimental data were presented as success rate and the increase of
accounts. In the sensitivity test, the experimental data is completely conducted by chart review.
Chapter 5 analyses the experimental data that is generated from robot tests. The calculation of
the NMSE and gradient was applied in this section. They are important standards for evaluating
the effectiveness of the robot trading. To totally evaluate the effectiveness of the software, a
-9-|Page
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
concept of fund return is used in this evaluation. In the calculation of fund return, a positive
result can be considered as the robot conducts trading efficiently. To evaluate the sensitivity of
the software, noises become the most important standard. More noises generated in
experiments will lead to a higher loss in robot trading. Both effectiveness and sensitivity are
important performance indicators for robot trading. The effectiveness evaluation focuses on a
successful rate of transactions and the benefit of accounts, and the sensitivity evaluation
concentrates on the number of transactions. This section indicates that effectiveness and
Chapter 6 designs an improved trading robot. The new program includes many factors that can
reduce the performance of robot trading. Those factors are parameter modification, indicator
modification, time frame selection and trading session selection. Furthermore, timeframe
switcher has been added in this program, which can filter out more trading opportunities and
Chapter 7 is the final section which includes the discoveries of this research. The requirements
- 10 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
2. Background
“In electronic financial markets, algorithmic trading or automated trading, also known
as black-box trading or robot trading, is the use of computer programs for entering
trading orders with the computer algorithm deciding on aspects of the order (such as
the timing, price, or quantity of the order), or in many cases initiating the order
Algorithmic trading started in early 1970s in financial markets, with symbols that the New York
Stock Exchange (NYSE) adopted: Designated Order Turnaround (DOT) and the Opening
Automated Reporting System (OARS). The DOT system directly built a relationship between
traders and trading desks, and executed electronic transactions at the trading. The OARS
Algorithmic trading was adopted by NYSE because MYSE market owned a value of more than
100 million dollars, with over 15 trading portfolios of baskets of orders. With such a large
volume, computers are necessary to handle trading instead of humans. In the 1980s,
algorithmic trading was widely used in financial markets. Stock index arbitrage trading meant
that traders bought (or sold) stocks such as S&P500 futures and simultaneously bought (or sold)
a series of NYSE stocks, where the portfolio was highly relevant to the futures. The NYSE trading
robot was enacted by a computer. When the direct spread was large enough to be profitable,
In late 1980’s and 1990’s, the development of the telecom network made the financial market
completely electronic. In the U.S. stock market, decimalization changes the minimum share
- 11 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
price from 1/16 dollar to 0.01 dollars. This regulation changes market microstructure and
reduces price spread, and thus reduces market liquidity. Papadamou and Stephanides (2005)
With more and more electronic trading, more algorithmic trading strategies have become
possible. These strategies include arbitrage, statistical arbitrage, trend following and regression.
Computers can effectively implement these trading strategies by monitoring different markets
In forex trading, products are described as currency pairs, and the trading process is exchanging
one currency to another. For example, the exchange rate of the British pound and the U.S.
dollar are formed as GBP/USD. Obviously the exchange rate is constantly fluctuating, and it is
based on the stronger currency being addressed in the current currency pair.
Some currency pairs are traded by traders frequently, and are called major currency
pairs,especially if one side of those currency pairs is the U.S dollar. There are seven major
- 12 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
Other currency pairs that are traded in the forex market are called cross-currency pairs, when
the currency pair does not include the U.S. dollar. For example, GBP / JPY is one of the cross-
currency pairs.
The foreign exchange market runs continuously within networks between banks for 24 hours.
There is no physical trading location or central market. However, prices do not dramatically
fluctuate whole day. The forex market trading sessions can be categorized into four major
ones: the New York session, the London session, the Tokyo session and the Sydney session. The
It can be seen from Table 2-2 that overlaps cross every two sessions. Typically, in each overlap,
the forex trading activities are particularly busy, because transactions are being processed in
two regions of the world. This creates greater volatility in the currencies’ prices, and thus makes
more trading opportunities. In robot trading, session overlaps are usually designed in programs
so that they can assist traders in maximizing profits. Archer (2008) believes that fluctuation in
- 13 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
the forex market is different every week, and that this factor should be considered in robot
programming.
The basic calculation rules are usually performed by trading robots in forex market transactions,
and human traders do not need to understand the principles. However, it is necessary to
introduce these concepts in this research. Developers of robot programming must consider
those factors since they will influence the effectiveness and sensitivity of the trading robot.
Unlike other financial markets, the foreign exchange market is traded with exchange rates.
They are expressed as one currency relating to another, and are thus formed as currency pairs.
Babypips (2011) states that transactions in forex markets are quoted as pairs because traders
buy one currency and sell another. For example, EUR/USD is presented as the price of how
many U.S dollars should be spent to buy a Euro. Wiki (2011) shows that the base currency is
located to the left of the slash, and the counter currency is located to the right side. The table
In forex trading, the price of the exchange rates is presented as two prices. The bid price is used
for the trader to purchase the base currency and sell the counter currency, and the definition of
the ask price is the opposite. Therefore, spread is the gap between the bid and ask prices. In the
- 14 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
sensitivity evaluation, spread is the major factor that influences the performance of trading
Archer (2008) introduces the concept of leveraged transaction. It is an investment method that
uses a small amount of money to make a trade at several times the amount. The purpose of
using leverage is to obtain a greater amount of profit. In the past, the specific money that was
used to carry out forex trading was called lots. Due to the tiny daily movement of the forex
market, traders needed to trade large amounts of currency to take advantage of a forex
transaction. Archer (2008) argued that the nature of the forex market drove up the entry
In human trading, the retail forex broker requires traders to have basic funds, which are called
“margin funds”. Once those initial funds have been deposited into a dealer’s account, the
service of forex trading can be opened. Usually, the trading position is calculated as lot size
multiplied by the leverage, which can maximize the profit from the trading. However, any
related loss would be carried out several times and decrease the traders account as well. An
example is posted by Babypips (2011) and given below to show how leverage and lots work.
pips
6 The profit of this trade should be ( 0.01 / 92.78 ) * 100,000 * 19 = $204.79
Table 2-4 Leverage and Lot
From Table 2-4, profit and loss from the trading can be calculated by the following formula:
Gerald (2008) indicates that leveraged forex trading increases the profit of transaction, but also
expands the loss that is caused by analysis mistakes. Thus, fund management and risk control
become more and more important. From the profit formula, resetting the capital of the lot size
can reduce the risks that are taken by leverage. Babypips (2011) provides the formula of the
The above formula shows that regardless of how much leverage is regulated by retail brokers to
control forex trading risk, the best method is to control the capital of the lot size. Therefore,
most of the forex trading robots are programmed with fund management system, which has
Jamie (2008) indicates that there are three methods of forex trading analysis: fundamental
Jamie (2008) considered that fundamental analysis is an efficient method to evaluate the
economic, social and political factors, which focuses on money supply and demand. It is
necessary to study economics factors, because only supply and demand can determine the
- 16 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
currency price. In addition, Babypips (2011) states that fundamental analysis focuses on the
reaction to economic events. In particular, it guides traders to predict the future movements of
the Forex market. However, fundamental analysis is formed by many indicators. Jamie (2008)
provides an example, an economic report of U.S. employment data, which could have changed
the monetary policy of the Fed in America. However, John (2009) points out that many
economic events are not released as specific reports, but they could influence the reactions of
traders, which can decide the future movement of the forex market. In all, Jamie (2008)
considers there are several indicators that can be analyzed by traders: interest rates, inflation,
Jamie (2008) indicates that the interest rate is the most important factor to help traders
determine the forex market direction. Thus, it is necessary for traders to understand the
monetary policy of central banks, such as new interest rate decisions. Furthermore, John (2009)
states that inflation decides the stability of central bank monetary policies. Inflation can make
investment in products and services, but too much inflation can damage the economy. Thus, as
Babypips (2011) indicates, central banks always watch the indicators that are related to
inflation, such as CPI and PCE. Usually, moderate inflation is accepted by central banks, because
suppressing it could take the growth out of the economy. In order to keep inflation at a stable
level, Babypips (2011) points out that central banks will change interest rates that lead to lower
economic growth and inflation. But in the forex market, Jamie (2008) believes that higher
interest rates can cause a stronger currency price. He defines a new concept of interest rate
expectation, which can directly influence the movement of the forex market. Jamie (2008)
considers that the forex market is moved by the different expectations of traders. So, as
- 17 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
interest rates are not changed very often, most of traders do not focus on current interest rates,
because they have already been issued by central banks. More important is the movement of
the interest rates, which is defined as interest expectation by Babypips (2011). This web tutorial
indicates that interest rate expectation can determine the future movement of the forex
Jamie (2008) also states that most used by traders use rate differentials, which can decide the
Rate differentials = base currency interest rate – counter currency interest rate
As well as interest rates, the monetary policy of central banks can influence future movements
of the forex market. Jamie (2008) states that monetary policy is divided into contractionary and
restrictive policies. They are used to increase or reduce the capital of the money supply, and
can also make interest rates rise. Babypips (2011) believes that restrictive policy is also
increasing interest rates and reducing economy growth. Also, the difficulty of getting bank loans
will reduce the spending and investment of businesses. On the other hand, with contractionary
policy, which is opposite to restrictive policy, it is easier to borrow money or expand the supply
of funds, and this will increase spending and investment and increase economic growth.
Babypips (2011) states that enterprises will spend money with large amounts of funds, and thus
the tax will be increased for the government. This action can cause the whole society to spend,
and will tend to be a positive influence on the economy. Meanwhile, Jamie (2008) indicates
that the balance of capital flow can cause movement in the forex market as well. He provides
- 18 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
an example of the positive aspects of capital flow to a country: in the situation of more
investment from overseas, the government has to sell foreign currency to buy local currency.
This action can lead to the value of local currency increasing. The related trade flow formula
In trading robot design, programmers usually select five economic indicators as parameters in
their trading robot. However, depending on the trading environment, the selection of
parameters will be different. For example, inflation can often be represented as CPI and PCE.
The values of parameters are not expressed by economic data, instead a simple number can be
better to predict the future market trend. The following diagram shows the economic indicator
- 19 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
In theory, price should reflect all the information of the forex market. However, it is not simple
a simple matter for forex traders. The forex market does not reflect all the information, since it
also includes the behavior of traders. Babypips (2011) states that traders have their own
economic news. Jamie (2008) considers that no matter how strong the personal feelings of a
single trader, the forex market will be influenced by most of the traders’ actions. Therefore, the
market sentiment analysis contains some factors from both fundamental analysis and technical
As an interest rate expectation, market sentiment depends on the psychological state of most
of the traders. Jamie (2008) believes that sentiment indicators are not unique, since they
represent traders’ psychological states. Usually, economic data makes traders take action. Thus,
the role of sentiment indicators is to measure the importance of the economic data. In forex
robot trading, these indicators are usually used to presents the weight of specific economic
indices. The Figure 2-1 also shows the application of sentiment analysis in robot trading.
Archer (2008) considers that technical analysis is the framework that traders use to determine
forex market movement. He believes that historical data can determine current market
conditions and potential movement. In theory, the present price can reflect all the information
of the forex market, and thus trading can be made by that information.
- 20 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
Gerald (2008) indicates that technical analysis is basically following the support or resistance
level in the past chart. Traders keep watching it and determine the trading around that price
level. But Jamie (2008) believes there are many patterns which are all important for trading
Babypips (2011) has created three basic charts to present historical movements in the forex
Figure 2-2 presents the basic concept of the Japanese candlestick chart. Like the bar chart, the
Japanese candlestick indicates the market direction in the period segment. “Open” presents the
start price in the current period, “Close” presents the end of the price, and “Low” and “High”
present the highest and lowest price at this moment. The Japanese candlestick is different from
the bar chart. The reason is that it introduces the concept of “Body”, which presents current
market direction.
Moving average (MA) is based on the Dow Jones “average cost concept”. Similar to the “moving
average” principle in the statistics, it aligns with the average financial market price in each of
- 21 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
the time segments to display historical price volatility, and thus reflect the potential trends. In
fact, we calculate the average price value of a specific period when we use this indicator. As
with changes of price, the moving average can increase or decrease. There are four types of
moving average: simple moving average, exponential moving average, smoothed moving
average and linear weighted moving average. Each of them has their own algorithm, but usually
the formula of the moving average is presented as follows, because the most common
(C expresses the close price in the current period. N is present as the number of total
periods.)
2.2.3.3. MACD
Moving Average Convergence / Divergence (MACD) is a dynamic index that is following the
market trend. It is represented as a relationship between two moving averages. MACD indicator
has three parameters. The first parameter presents the time period of the faster moving
average, and the second presents the slower moving average’s period number. The third
parameter is calculating the moving average of the gap between the previous two MAs.
2.2.3.4. RSI
The Relative Strength Index Technical Indicator (RSI) is a price-following oscillator that ranges
between 0 and 100. RSI is widely useful in forex trading. It does not only assist traders to
determine the potential trend, but it also can help users distinguish the situation of oversold
and overbought.
- 22 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
There are many forex trading robots that can assist traders to determine their strategies.
However, Forextraders (2011) indicates many retail forex traders suspect robot trading
capabilities. This website tutorial believes many robots “tend to be marketed by extreme sales
pitches” and always overstate their benefits when they are used in a real trading environment.
Thus, it is necessary to evaluate the performance of those trading robots before traders decide
A three-step test approach is issued by Forextraders (2011), which provides traders with a
general concept of trading robots evaluation. The steps are described as below.
1. The backward test is the first step in robot evaluation. This often focuses on trading
robot performance that was based on the currency pairs that were selected by traders
and the historical price that was displayed in the trading platform. Forextraders (2011)
reminds traders that the backward test may create a false prediction, because the
historical data does not reflect future changes in the forex market.
2. A demo account should be created in the second stage. The trading robot is used in it so
that a real-time test result can be conducted for further evaluation. Forextraders (2011)
believes that experimental results can provide traders with a better sense than historical
evaluation.
3. The third stage is based on a situation that assumes the test results from previous
stages are satisfactory, and a micro account can be created for real-trading test.
Forextraders (2011) believe that there are many differences between simulated tests
- 23 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
and real-trading tests. Normally, a satisfactory living test result can ensure a high
Furthermore, Forextraders (2011) indicates that most robot backward test results are not
satisfactory because of the low quality of historical data in MT4. This web tutorial believes that
there is no ideal way to get accurate backward test results unless the historical price data is 100
Forex Day Trading (2011) lists several criteria of forex trading robots evaluation. This website
believes that an efficient trading robot should have some features of fast reaction, high
Jamie (2008) describes that the process of forex trading as a continuous operation,which trades
and manages accounts on the forex trading platform. Thus, trading robots can replace humans
and simulate this action automatically. Forex Day Trading (2011) indicates that, compared with
human traders, trading robots can capture more short-term trading opportunities. This is
because the default procedure of trading robots can reduce the response time, which is used by
human traders to determine the future market and place orders. Therefore, the response time
Instead of hi-speed network devices, Forex Day Trading (2011) believes that algorithm structure
is the major factor that can influence the response time. Thus, this website tutorial indicates
that the response time can be used as adjustable internal parameters for traders.
- 24 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
Success rate has been widely mentioned in forex trading, and it is considered as one of the
most important criteria for forex trading software evaluation. Forex Day Trading (2011)
indicates that the success rate focuses on the total money amount and the number of profits
orders.
The wide application of trading robots, including algorithmic trading, brings significant benefits
to trading automation and transaction efficiency. With regard to the effectiveness of trading
robots, Martinez and Pappa (2009) believe that a profitable system should have a high
percentage of profitable orders instead of trading values. Nevertheless, in the sensitivity area,
Theodoros (2008) has indicated that the robot will set a limit for each order, and the total
Martinez and Pappa (2009) indicate that high risk carried in forex trading might not be suitable
for all traders. The Foreign Exchange Market Explained (2011) believes that every forex trader
has his / her own trading methods that can help him / her to enter and exit forex trading and
determine the expected movements. A complex trading robot that is designed by experienced
traders could reduce the risks for new traders. However, even the most experienced traders
cannot determine all forex market future movements. A minimum loss should be designed for
every transaction in forex robot trading. Thus, low risk becomes an important requirement in
- 25 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
Consistent profitability is considered to be important by Marta & Brusuelas (2009). They believe
that an effective trading system should assist them to continuously benefit from forex trading.
Babypips (2011) indicates that a trading system can involve three functions: fund management,
risk control and market analysis function. These three functions share a complex relationship,
which is believed by Marta & Brusuelas (2009) to be dependent on the forex trading
mechanism.
Fund management is a part of an investment strategy. In forex trading, traders always use fund
management to set the capital for each transaction. Thus, capital size becomes more important
in the trading process. Unlike the fund management function, the risk control function will help
traders to set stop and loss levels, which can automatic close. The analysis function is used to
make forex trading strategy, as it can make decisions to capture trading opportunities. However,
most trading robots do not catch all the ever-changing market conditions. The foreign exchange
market is dynamic, and it is continuously moving with three types of market environments: up,
down and sideways. Trading robots cannot handle those complex movements by analyzing
historical data. The risk control function monitors the whole process of transaction. Once a
transaction has been cancelled, the analyze function will recalculate and search for new trading
opportunities.
- 26 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
In the human forex trading scenario, traders are always confusing the difference between risk
control and fund management function. The reason is that risk control includes some important
concepts of fund management. However, in the robot trading scenario, there is a clear
boundary, in that risk control only pays attention to how much loss can be accepted in forex
trading.
The Foreign Exchange Market Explained (2011) indicates that even the most experienced trader
cannot determine all future market movements. Therefore, the maximum drawdown is
programmed in most trading robots, where “A drawdown is the reduction of one's capital
after a series of losing trades.” (Babypips, 2011). This is usually calculated as the gap between
the initial capital and the remaining balance of the traders’ account. In other words, traders
The above example shows the reason for choosing a maximum of 30% drawdown as a basic
concept for trading robots risk control design. Babypips (2011) indicates that a 30% loss of the
total account can remain 70% money for traders, which means traders only require 43% of
trading profits of the current account, and they can make the account get back to break even. It
- 27 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
is hard to imagine a 50% loss of the initial capital, because traders must trade 100% profits of
the current account to get back to their original account balance. Babypips (2011) points out
that the more traders’ lose, the harder it is to get back to breakeven. Thus, a 30% maximum
The relationship between total loss of account and getting back to the original account balance
Pay back rate (Difficulty) of getting back to break even = Lost / (Account Size – Lost) * 100%
A 30% maximum drawdown applied to traders’ accounts can help them to limit risks, but the
loss of each trade is difficult to identify. Babypips (2011) assumes an experienced trader who
has the ability to handle 70% trades can also lose all the money in his account. The reason is he
has applied a false calculation in his risk control system. This website tutorial uses a statistical
method and indicates that a 30% loss is not evenly distributed in all the transactions. This
means that in the first 30 losses out of 100 transactions, the loss can be continued. This
However, Snellgrove (2008) notes that failure trades will tend to be averaged distributed in a
large number of transactions, so the relationship between the maximum drawdown and the
Total Loss Percentage = 100% – (1 – Lost Percentage of each trade) ^ Trades * 100%
- 28 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
Through experiments, Babypips (2011) considers that more than 20 continuous lost
transactions is rare in real forex trading. According to the above formula, a maximum 2% lost
from each trade is more acceptable for most of traders. The following examples prove this
concept.
Trades No. Account Size 2% risk Trades No. Account Size 10% risk
control control
1 $10000 $200 1 $10000 $1000
2 $9800 $196 2 $9000 $900
3 $9604 $192 3 $8100 $810
4 $9412 $188 4 $7290 $729
5 $9224 $184 5 $6561 $656
6 $9040 $181 6 $5905 $591
7 $8859 $177 7 $5314 $531
8 $8742 $175 8 $4783 $478
9 $8567 $171 9 $4305 $430
10 $8396 $168 10 $3875 $388
11 $8228 $165 11 $3487 $348
12 $8063 $161 12 $3139 $314
13 $7902 $158 13 $2825 $283
14 $7744 $155 14 $2542 $254
15 $7589 $152 15 $2288 $229
16 $7434 $149 16 $2059 $206
17 $7285 $145 17 $1853 $186
18 $7140 $142 18 $1667 $167
19 $6998 $139 19 $1500 $150
Table 3-2 Minimum 2% loss calcualtion
Table 3-2 shows a huge gap between 2% maximum on each trade and 10% maximum on each
trade. In the 10% risk control strategy, the total loss is high, up to 85% after 19 transactions.
Based on the remaining account balance after 19 transactions, the trader must increase his
account balance by 566% to compensate for the occurred loss. On the other side, a 2%
maximum strategy is more acceptable for most traders, and total drawdown is close to 30%.
Within this risk control method, traders can more easily get back to breakeven.
- 29 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
Price fluctuations in the foreign exchange market are unpredictable, and they are driven by
every possible factor. These factors include global politics, major economic events and central
banks’ rumors. This means that every trader can take action in the opposite direction of the
market movement. The “maximum 2% lost for each trading” strategy can help traders minimize
the total lost. However, Babypips (2011) is against traders applying this method in all situations.
This website tutorial recommends traders should set their stop loss according to the market
The newbie trader has an account with $500, which can use a $10,000 minimum lot size for
each trade. In this situation, he can only set a 10 pips stop for a possible loss in GBP/USD
trading. But the everyday movement of GBP/USD is over 100 pips. He could lose a potential
Thus, using equity stops, like the “maximum 2% lost for each trading” strategy, he will be close
to entry position and could take a loss in trading. Gerald (2008) indicates that the risk control
function should use technical analysis while the system is using equity stop methods.
A more sensible method to apply to the risk control function is using chart stop. Babypips (2011)
notices there are many times when the forex market cannot reach a certain price level or area.
Those price levels or areas can be called support or resistance in human technical analysis.
Gerald (2008) believes that applying stop levels beyond those areas can reduce potential risk
efficiency, because once the currency price breaks support and resistance levels, there are
- 30 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
more traders who can be attracted and take action to push the price to further movement.
This means the action of breaking those levels is unpredictable, and can tell traders that market
direction has already changed. The following diagram shows how to apply the chart stop in
Setting stops beyond support or resistance levels can clearly reduce trading risks. However, in
the robot trading environment, it is hard to define a specific support or resistance level.
Babypips (2011) indicates that there is no exact number to identify the support and resistance
area. In candlestick charts, those areas are always tested by price. As the graphics cannot be
An alternative solution is suggested by Babypips (2011), which is called “previews low / high
strategy”. They believe the previews stick’s low / high is a better stop level in the same trend.
However, the case becomes more complex in trends exchange, when the previews stick is
certainly not good for setting support and resistance level. In this situation, the technical
indicator which is called “fractals” can be used to replace the “previews low / high strategy”.
- 31 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
Another simple method to set stop loss is provided by Marta & Brusuelas (2009). They believe
that market volatility is the potential movement range. Knowing how large the volatility of a
currency pair is can assist traders to set a better stop level, and thus avoid many potential
For example, a 20 pips stop loss will fail a transaction in a small movement against you, while
the everyday fluctuation of a specific currency pair is more than 100 pips.
“One way to measure the volatility is by using Bollinger Bands. You can use Bollinger bands to
give you an idea of how volatile the market is right now.” (Babypips, 2011). The Bollinger
The above diagram indicates that Bollinger bands can provide default support and resistance
levels by using Bollinger bounce. The best application is applied in ranging markets. Traders can
set the long order when the price touches the lower band, and set the short order when the
price touches the upper band. The formula for setting the stop loss level can be represented as
below.
- 32 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
However, an exception is noted by Marta & Brusuelas (2009). The market always breakouts the
current environment when the upper and lower bands squeeze together. In this situation, the
An improved strategy is issued by Babypips (2011), called an ATR function. They believe this
indicator is more useful in both a large fluctuation and a ranging market environment.
interest-yielding value for any amount of it spent.” (Wiki, 2011). In forex trading, fund
management usually is concerned with position size configuration. Babypips (2011) believes it is
important to calculate the position size in forex trading, because like the risk control function, it
can reduce the potential risk. There are five basic elements that are provided by this website
tutorial. They are “(1) Account equity or balance. (2) Currency pair for trading. (3) The
percentage lost for risk control. (4) Stop loss in pips. (5) Conversion currency pair exchange
rates.” (Babypips, 2011). Those elements can assist traders to calculate a suitable position size
in future trading.
An example is given by Marta & Brusuelas (2009). A newbie trader applies for an account in the
forex market with 10000 dollars. For currency EUR / USD, the risk of price fluctuation should be
under 200 pips each transaction. As the previous section mentioned, 2% maximum loss for each
trade can be accepted. So in this example, a 1% loss for each trade has been applied in the risk
- 33 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
control system, which is less than 2%. The risk percentage amount in the traders’ account
$ 0.5 each pip * (10000 units for EUR / USD) / $ 1 each pip = 5000 units for EUR / USD
Therefore, the calculation for risk comfort level should be represented as the follow formula.
“A crossover describes the event price crossing through a moving average. It also refers to
one moving average crossing over another moving average of a different time period. Both of
these events are used as trading signals.” (Traderslog, 2011). When using this technical
indicator, traders have to use more than two moving averages in their trading charts. The entry
signal can be conducted where the two lines cross. This means the trend will be switched soon.
- 34 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
A suitable stop loss level can be set by the moving average as well. Babypips (2011) states that
the slower moving average line is the best support and resistance level of a risk control system.
The following diagram shows the price bounced off the MA at every time, and which one is the
The algorithm of moving average cross-over should be similar to the above descriptions. The
robot has to set an entry point while two moving average lines cross over eachother. As the
slower moving average line can be a good support or resistance level, the stop loss should be
set at this point. Thus, the robot program should obey the following rules.
- 35 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
1. The entry signal of a moving average cross over can be set while one moving average
crosses over another. If the fast line crosses over the slow line, the trading robots should
issue the long signal. On the other hand, when the fast moving average crosses under
2. For unpredictable reasons, the slower moving average line could be the support and
resistance level. When the price hits the stop level, the robot should reset the new
order at the middle of the space between the fast and lower moving averages. The
direction of the new order should be the same as the previews orders.
3. The robots must close their orders when the next crossover has been made, or when
//+------------------------------------------------------------------+
//| Main function |
//+------------------------------------------------------------------+
for(int i=0;i<OrdersTotal();i++)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES) == false) break;
if(Ordersy() ==sy() && OrderMagicNumber() == MAGICMA)
{
if(OrderType() == OP_BUY) buys++;
if(OrderType() == OP_SELL) sells++;
}
//+------------------------------------------------------------------+
//| Check for open order conditions |
//+------------------------------------------------------------------+
}
//---- buy conditions
if(Open[1] < average && Close[1] > average)
{
res=OrderSend(sy() , OP_BUY , sizeSize() , Ask , 3 , 0 , 0 ,"", MAGICMA , 0 , Blue);
return;
}
//----
}
//+------------------------------------------------------------------+
//| Check for close order conditions |
//+------------------------------------------------------------------+
if(OrderType() == OP_BUY)
{
if(Open[1] > average && Close[1] < average) OrderClose(OrderTicket() , Ordercapital() ,
Bid , 3 , White);
break;
}
if(OrderType() == OP_SELL)
{
if(Open[1] < average && Close[1] > average) OrderClose(OrderTicket() , Ordercapital() ,
Ask , 3 , White);
break;
}
The triple moving average cross over can be generated entry by the signal as well. By using this
strategy, the long and short signals are generated before the trend is defined. The third moving
average line is different from the normal moving average cross over because it is used to
confirm the trend, and thus avoid a false signal in forex trading.
According the algorithm of the moving average, the faster the time period, the closer the price
trend. Thus, the short term moving average will start to move earlier than the long-term line.
- 37 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
1. Like the normal moving average cross over, the entry signals are usually generated
2. The longest term moving average can be used to confirm the trend.
3. Using this system, the stop loss setting is dependent on the slowest moving average
line. , The robot should place the new order at the default support and resistance level
4. The robot must close the orders when the trend has changed, or when the price hits the
Babypips (2011) lists a lot of technical indicators which can be used for trading robot
programming. However, this website tutorial believes that each of these indicators is not
perfect when traders apply them to real forex trading. That means it is necessary to combine all
kinds of technical indicators together, in order to make them cooperate with each other. Gerald
(2008) suggests that the best solution is a robot which has more than three different technical
indicators. The robots will not initialize the trading until all the indicators generate a signal at
An example is provided by Babypips (2011). The application includes two technical indicators,
Bollinger bands and stochastic. In a 4-hour time frame chart, those two indicators perform
differently. The following diagram shows that one entry signal is generated at the same time by
both two indicators, which can take more than 300 pips profits in the sell orders. Later, another
opportunity is also issued by this system which can take 400 pips profits.
- 38 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
Another example is given by Gerald (2008). Two technical indicators, i.e., RSI and MACD, are
applied in this system. The picture shows that the RSI is located in the overbought zone and a
short signal is generated. The MACD also provides a dead crossover, which is a signal for short
as well. By following this signal, traders can gain at least 500 pips profit. Then a long signal is
issued after the trend changes, which can also take more than 300 pips profit. The application
Figure 3-6 Using the simple indicators combination to capture the trend
Based on th above two samples, a simple indicator combination system is created by Babypips
(2011). In this system, the robot will work on the daily chart, and thus the moving averages can
easily define the trend for further prediction. The stochastic indicator is applied in this system
- 39 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
as well, because it can assist traders in determining the entry point when the current trend is
defined. Moreover, the oversold and overbought function of stochastic can notify traders if the
price reaches the trend’s end. The RSI is used for confirmation of the entry signal, which can
avoid most of the noise and improve the success rate. The basic rules of this system are
presented below:
1. To define the current trend, two moving average lines are applied in this system. When
MA (5) crosses over MA (10), the uptrend can be considered to have started. On the
other hand, the dead cross will define the down trend in the future.
2. Stochastic (14, 3, 3) has been applied for the entry signal. Normally, the long signal will
be generated while fast KD line crosses over the lower KD line. However, an exception is
noted by Babypips (2011). The long signal will be ignored by system when the stochastic
line breaks into the overbought area. On the other hand, the short signal can be
generated by the dead cross of stochastic lines while both faster and slower lines are
3. RSI (9) is used to confirm the entry signal. Only in the situation of RSI above 50 can the
buy signal be acted. Otherwise, the system will avoid potential signals. Similar cases also
occur with the sell signal. The short action can be implemented only when the RSI is
below 50.
4. The previews high / low strategy is used by this system for setting default stop loss.
- 40 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
The Cowabunga method was developed by Pip My System (2011), which mostly improves some
issues based on the simple indicators system. The authors believe that it can help traders to
avoid noisy signals and increase the success rate. This website tutorial points out that the
original system is simple and profitable at the same time frame. But an additional time frame
The basic theory of the Cowabunga method is to follow small trends within the larger trends and
avoid fake signals. However, the real action in trading is complex. The author of the website
tutorial recommends that traders should use two different timeframes, for instance, a 15-
minute chart and a 4-hour chart. When traders determine the trend under the 15-minute chart,
the system reminds traders to review the trends in a 4-hours chart first. Thus, the main trend
will be noticed by traders, and that can give opportunities for catching the market direction.
1. To identify the trend, the cowabunga method applied four indicators in the 4-hour chart.
They are 5 EMA, 10 EMA, stochastic (10, 3, 3) and RSI (9). In the up trend, the 5 EMA
must be above the 10 EMA, and the stochastic line should be heading up and the RSI
value must be larger than 50. On the other side, to confirm the down trend, both the
EMAs and stochastic should be heading down, and the RSI value must be less than 50.
2. The 15-minute chart is used to determine the entry signal. There are five indicators that
have been applied to this trading system. They are 5 EMA, 10 EMA, stochastic (10, 3, 3),
RSI (9) and MACD (12, 26, 9). To generate the long signal, the 5 EMA should cross above
the 10 EMA, the KD indicators should head up and the RSI value needs to be greater
- 41 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
than 50. Also, the MACD value should cross over the MACD signal and it must move
from negative to positive. For short signals, the triggering condition must be opposite to
3. The stop loss setting is similar with a simple indicators combination system. The
Cowabunga method chooses the previews high / low strategy as a support and
resistances configuration.
The Dolphin method was developed by Zhang (2008), and is based on Dow’s Theory. Dow
believes that stock indexes can be divided into three trends: short term, medium term and long
term trends. These three situations exist in any financial markets, where their directions can be
different from each other. Thus, multiple time frame analysis is often deployed for forex trading
robot development.
“Multiple time frame analysis is simply the process of looking at the same pair and the same
price, but on different time frames.” (Babypips, 2011). The trading platform can provide many
time frame charts for traders’ analysis. There are many choices for them –daily, hourly, per 30
minutes, per 5 minutes and even 1 minute. That means every trader can get different ideas
from different charts. Fortunately, multiple time frame analysis can define a personal time
frame strategy to every trader. The following table presents feature of different time frames.
- 42 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
Zhang (2008) believes the long-term chart can help traders to determine the main trend.
Medium term it will assist them in predicting both the lower time frame and the higher time
frame, and short term it will issue the potential entry point. Therefore the concept of time
frame combination is provided by Babypips (2011). The suitable time frame combination is
presented below.
1-minute chart for short term, 5-minute chart for medium term, and 30-minute chart for
- 43 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
5-minute chart for short term, 30-minute chart for medium term, and 4-hour chart for
1-hour chart for short term analysis, 4-hour chart for medium term, and daily chart for
The dolphin system applies 5 major technical indicators in forex robot trading. They are MACD
(5, 34, 5), KD (8, 5, 5), MA (26, 52, 104, 360), Envelope (26 – 0.62%, 0.31%) and Time (M5 – M30
– 4H).
The time frame selection is based on trader’s habits, and thus determines their main trading
session. This means that the principle of determining the main session is decided by traders.
The trends determination is used to move to the larger time frame, and the smaller time frame
1. The principle of trend determination is based on technical indicators MA (26) and MACD
(5, 34, 5). When the price is greater than MA (26) and the MACD value is greater than
signal, the current trend is considered bullish. As the price is less than MA (26) and the
MACD value is greater than signal, the current trend is considered bullish too. If the
price is greater than MA (26) and the MACD value is less than signal, the current trend is
considered bearish. While the price is less than MA (26) and the MACD value is greater
2. The position size calculation of the dolphin system follows the formula, Comfort level =
- 44 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
3. The rule of entry point selection is based on the indicator of KD (8, 5, 5). The long signal
is generated when the value line crosses above the signal line. On the other side, the
4. This trading system uses the golden channel as a profit determination tool. When the
price hits the boundary of the golden channel, the transaction will be closed for taking
profits. The related technical indicators of the golden channel is Envelope (26 – 0.62%,
0.31%).
5. The stop loss setting is special in this trading system. Zhang (2008) believes that when
the price moves more than 9 candles in the current chart, the trend will be going to end.
Therefore, traders should close the current trading after 9 sticks are completed.
if(kd > kd_s && kdp < kdp_s && Open[pos] < upline && Open[pos] > currenttrendline[pos]
&& Open[pos] > maintrendline[pos])
{
buy[pos] = line_bottom;
}
else if(kd < kd_s && kdp > kdp_s && Open[pos] > downline && Open[pos] <
currenttrendline[pos]
&&Open[pos] < maintrendline[pos])
{
sell[pos] = line_top;
}
- 46 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
This section presents the application of forex trading robots in the forecast process between US
Dollar and other major currencies including includes JPY, GBP, NZD, EUR and AUD. During the
experiment, all kinds of technical indicators and historical data were applied to trading robots
to catch potential trading opportunities in each currency pair. In this paper, the rescaled range
analysis is used to evaluate the effectiveness and sensitivity of each trading robot in different
market environments.
The pre experiment processing is not simple, as it follows the “rescaled range analysis and
market efficiency testing”. This is a common method but is only used by a few applications,
such as “Random walk Hypothesis and efficient market hypothesis”. (Yao, 2000). Yao states
that the random walk hypothesis, presenting currency pair prices, always moves randomly and
its direction is unpredictable. The efficient market hypothesis refers to market reflection, which
can take all potential opportunities and fully reflect the new information. In the forex trading
market, some traders place orders immediately once they get economic messages from other
persons. However, other traders will wait for confirmation, unless the current trend is clear.
Yao (2000) mentions the Hurst exponent, which is a criterion of the bias in fractional Brownian
motion. He believes that that Hurst exponent could be applied in forex market historical data to
decide whether that information can be “biased random walks” following the prediction.
Before the experiment, the rescaled range analysis is introduced into the evaluation process,
and this can be used to categorize a random data series from a fractal series and a basic series.
- 47 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
The value of those random data series can be marked as Gaussian and non Gaussian. Yao
indicates that rescaled range analysis is a statistic for testing the volume of noise of each
trading robot, which can be used to determine the trend persistence and the average period’s
number for market environment cycles. The formula of noise measurement can be presented
as below.
In the above expression, R is conducted by the deviations between the maximal and minimal
prices. The expression of [X t, n] is presented as the cumulative deviation during the previews N
In the above expression, µ n is the average price in previews n periods for a specific currency
pair.
Yao (2000) states that the R / S ratio can be transferred as the formula of R / S = N ^ H. In this
expression, S is the value of standard deviation and H is the value of the Hurst exponent. Thus,
random time series. In this experiment, a computer conducts the Hurst exponent index using a
series of random numbers, whose values are very close to 0.5. The application of the H
- 48 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
exponent used in financial markets will probably results in two different events. Thus, there are
three situations to define the Hurst exponent using the above calculation.
1. H = 0.5,
2. 0 ≤ H < 0.5,
3. 0.5 < H < 1,
In the case of H = 0.5, the evaluation over the random data series cannot be considered as the
“Gaussian random walk”. (Yao, 2000). The only instruction of the evaluation is to present
“there is no persistent trend” in the forex market. When the Hurst value changes from 0.5, it
indicates that the trading robot cannot identify the strength of bullish and bearish. In the case
of 0 ≤ H < 0.5, the market environment could be an anti-persistent movement in the future. The
price volatility could be higher than ever before and the reversals could be frequent. Despite
the prevalence of reverse trading strategies in forex trading, only a few anti-persistent market
environments have been identified. For the other cases, i.e., 0.5 < H < 1, it presents the
persistent trend forces. The persistent strength depends on the distance between the value of
the Hurst exponent and 0.5. Yao (2000) indicates that bias could change suddenly, even if the
Hurst exponent points to a biased random series. Thus the data can only be estimated in a
specific time period. In this period, the lower the value of Hurst is, the more noise could be
detected by the system. On the other hand, a higher value of the Hurst exponent will indicate a
higher persistent trend, and thus will reduce the occurance of noise.
An application of the Hurst exponent was given by Yao (2000). By following this application, this
paper conducted a similar experiment for the evaluation. There were five currency pairs applied
in this study, which collected 240 daily candle datasets for the test sample from March to
The value of the Hurst exponent and correlation for five currency pairs is presented in the table
below.
The above statistical results show that the value of the H exponent for a recent 240 day forex
market environment is greater than 0.5. This means that all the five currency pair products are
fractal, and will not cause a random market environment. According to the above market
analysis, the current market environment can be applied into a trading robot experiment, and
there are no random factors that can disturb the test process.
The MetaTrader is an electronic online trading platform developed by MetaQuotes Corp. The
main application of this software is used for online forex trading. The MetaTrader terminal is a
part of the MetaTrader system, which consists of a charting system, an online transaction
function and a trading robots management function. Among them, the trading robots
- 50 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
management function has a feature of a C–like programme which is called MQL programming.
This feature allows traders to develop their own technical indicators and trading robots.
Recently, the MetaQuotes Corp has released two versions of their products. They are
MetaTrader 4 and MetaTrader 5. Compared with MetaTrader 4, the latest version has the
following improvements.
1. MetaTrader 5 has improved MQL programming features. Unlike the MQL4, the
MQL5 script has added more features of OO programming languages in the trading
robot design.
Hedge orders, which is a trading policy and allows traders to set both the long and
short transactions at the same time, are no longer applied in the fifth version,. In the
new version of this trading platform, the previews order with the opposite direction
will be offset by the current order. That means that the first in and first out policy is
applied in the MetaTrader 5 trading platform, and thus it will create more
The MetaTrader 4 trading platform is selected in this paper as the experiment resource.
The reason for giving up the higher version is most trading robots still using the hedge
strategy, which could crash in the MetaTrader 5 experiments. Also, the lack of application of
the fifth version was considered before the start of this research. Because most forex
dealers are still using the MetaTrader 4 trading platform, the older version is considered to
- 51 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
be suitable for most trading environments. In this research, the following robots are applied
in the evaluation.
To apply the above trading robots, MQL4 script must be used in the software programming.
MQL4 Book (2011) indicates that MT4 terminal is a development tool, which includes MQL4
programming editor, and can help customers design their robots. The MT4 server is a part of
the MT4 system as well, but it is always installed in the dealer’s server, that is, the connection
- 52 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
between financial institutions and traders. MQL4 Book (2011) believes that MT4 terminal has
an information system that can create a series of parameters and thus catch the market
environment and the communication between dealers and traders. This information system
can present the forex price, the regulation of order sizes, and the limitations of the stop loss
level. It can also switch between trading robots, and other statements of forex environments.
The information system updates frequently when new candle-sticks are changed by MT4
terminal. The following diagram shows the working mechanism of MT4 terminal.
The built–in tools are an important function of MT4 terminal. This package provides many kits
to improve the experiment results. These tools can assist traders in conducting technical
analysis and thus evaluate the accuracy of trading robots. The technical analysis includes
drawing stop loss level, channels and Fibonacci levels. Traders can set, cancel or modify
transactions manually in order to protect the exception caused by automatic trading. In MT4
- 53 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
terminal, stop orders can be automatically generated by the system, and the only thing traders
have to do is to monitor the market environment and the status of the networking connection.
MQL4 Book (2011) indicates that there are three types of applications that can be developed
for trading robot experiments. They are custom indicators, expert advisor (EA) and scripts.
Normally, most trading robots are programmed as EAs that allow fully automatic trading in the
MT4 environment. However, custom indicators are designed for sensitivity evaluation, which
integrated into the client terminal. Like built-in indicators, they cannot trade automatically
and are intended for implementing of analytical functions only.” (MQL4 Book, 2011).
Besides EA tests, all trading robots are designed as custom indicators for noise experiments.
The method of evaluation is a type of diagram review, which is the way to attach trading signals
to the forex chart window and notify possible entry opportunities. In this research, entry
opportunities can be presented as cross symbols. If the symbol direction is opposite to the
market movement, a noise can be confirmed by traders and this situation can be recorded for
MQL4 Book (2011) provides the criteria to distinguish custom indicators and EAs. Both EAs and
custom indicators are the scripts that are walking in the same window for several candle sticks
in a specific time period. “This is their run duration”. (MQL4 Book, 2011).
- 54 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
Both custom indicator and EAs should be attached to the chart window. Once the terminal is
following the market movement, the EAs will execute the order automatically. This action will
take real profit and loss, and thus affect the balance of accounts. By launching custom
indicators, there is no effect on order execution. Once a possible signal occurs, the program
marks the symbol on the chart and transfers it into the continuously running mode. Unlike EAs
and indicators, the script will be generated immediately once it is attached to a forex chart. It
does not need to wait for any market movement. The following diagram shows the difference
“The main principle underlying custom indicators is passing values of indicator arrays to a
client terminal (for drawing indicator lines) via exchange buffers.” (MQL4 Book, 2011). In
MQL4 programming, buffers are used to locate indicator arrays as numeric values. Normally, a
custom indicator can include eight symbols. Each symbol connects to a buffer so that the
indicator can communicate between market movement and the chart window. According to
the MQL4 programming standard, each buffer has been assigned with an index. The number of
the index can be marked from 0 to 7. The following diagram shows how the assigned index for a
custom indicator and their relationship between the candles stick update and the forex chart
window.
- 55 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
Figure 4-2 Relationship between the candles stick update and the forex chart window
The components of a custom indicator are different from EA. In most situations, the first step
should describe which window will display the indicator symbols. The MQL4 script code is
presented below.
#property indicator_chart_window
In the next step, the custom indicator should define the number of buffers, which can store the
#property indicator_buffers 3
In the above script, the custom indicator defined 3 symbols, which can display in the current
chart.
The third step shows the color of each indicator. The MQL4 script code is presented below.
The above script is about the parameter definitions. This process is setting a color for each
corresponding buffer, which means the system assigns blue, red and green to the index 1, 2 and
3. Thus, in the chart display, traders will show three indicators with three different colors.
These parameters are kinds of variables to set buffers. In the user interface, traders can modify
the value before applying this custom indicator to the chart window.
The fourth step is to identify the indicator arrays. The MQL4 script code is presented below.
This custom indicator has three indexes, so that three indicator arrays should be declared. Once
the indicator arrays are defined, an important action should be generated, as below.
Function SetIndexBuffer() is used to connect a buffer to the related array, so this custom
indicator should be coded by three script sentences for the above action. Finally, the index style
- 57 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
There are many technical indicators that are applied in financial analysis. These indicators can
help traders find potential trends and opportunities. However, each indicator has its strengths
and weaknesses. Traders should have the ability to determine which indicator can suit the
current market environment. Babypips (2011) provides a concept for the category: leading and
lagging. The leading indicator should be issued before the trend reversal or the beginning of a
strong market movement. The lagging indicator should be generated after the trend reversal or
when a strong market movement has started. In theory, Babypips (2011) identifies them as
oscillator and momentum indicators. This website tutorial believes that each indicator can have
a different effect on the entire trading system. These effects could be both positive and
negative.
To evaluate the effectiveness of a single trading robot, it is necessary to understand how its
indicators affect real trading. To realize this purpose, the indicators filter should be designed
before the experiments. The indicators filter is a kind of trading robot, which is a collection of
many technical indicators. In this trading robot, the system switches all indicators running in the
market environment one by one. The test result can be recorded by traders for an effective
evaluation. The MQL4 algorithm code of the indicators filter is presented below.
- 58 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
Start()
{
//start running indicator filter;
//declare any variables;
Switch ( indicators )
{
Case 1: //doing function MAcrosser();
Case 2: //doing function MACDcrosser ();
Case 3: //doing function AD_crosser ();
Case 4: //doing function KD_crosser ();
Case 5: //doing function SAR ();
Case 6: //doing function RSI ();
Break;
}
}
- 59 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
During the experiments, a barrier, which is called modeling quality, could affect the evaluations,.
Modeling quality will directly affect the experiment results. This is an index that is issued by
Metatrader 4. Metaquotes invented this number, and it is used by traders to measure the lower
time period while they are running a trading robot. The idea of using modeling quality is to
simulate the lower time period, and improve the test quality. “Higher quality” is always defined
as a more detailed description of a candle stick. The formula of a modeling quality calculation is
presented below.
Modeling Quality = ((0.25 * (Start Gen – Start Bar) + 0.5 * (Start GenM1 – Start Gen) + 0.9 *
Mechanical Forex (2011) states that completeness does not focus on a single time frame. This
means that 80% modeling quality within the minutes chart window should be more accurate in
a robot test. But the case of a 99% total modeling quality with only 20% maximum quality in a 1
Mechanical Forex (2011) believes that test accuracy is dependent on the robot and what
strategies traders apply in forex trading. For example, a simple trading system with trading at
the end of a day, which does not contain stop loss, trail stop and profit level, and even no
pending orders, will be able to conduct an accurate experiment result. This simple experiment
only needs limited market data, which includes open, high, low and close information at the
- 60 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
end of the day. This indicates that low modeling quality may not have a negative effect on
experiments.
On the other hand, the 99% modeling quality does not make an accurate simulation; traders
can build an experiment with an inaccurate simulation in a lower time frame. Therefore,
modeling quality has no relation to the simulation accuracy of a specific trading system. “Real
modeling quality depends on the characteristics of the system being tested and whether or
not the system is able to adequately address the limitations of the testing software being
used.” (Mechanical Forex, 2011). A trading robot should have a suitable configuration to
consider possible data loss. Sometimes, a 99% modeling quality may not bring an accurate
experiment result. The following table shows the effect of modeling quality.
The above table shows that modeling quality heavily affects the experiment results. With a 99%
modeling quality, the test results become more comfortable to traders. However, according to
the Mechanical Forex (2011) description, a high modeling quality can increase the experiment’s
accuracy, but cannot provide the real test process. Therefore, the forward test is also launched
in this research.
The robot experiments continued for 8 months. During the test, there were five currency pairs
applied in this study, which collected 240 day candle dataset for the test sample from March to
October of 2011. According to the limitation of modeling quality, both backward test and
To conduct an accurate result, I downloaded historical data from the trading server of Alpari.
This forex dealer can provide a complete dataset. The forward test is different from the
backward test. There are many limitations that may have negative effects on the experiment.
Firstly, it is impossible to continuously run a computer for 240 days. The rest time should not
count in the test process. Secondly, human activity may stop the experiment from time to time,
for example, in the holidays. Therefore, this research may not issue a 100% accurate 24-hour
experiment result.
- 62 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
- 64 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
According to Yao (2000), a profitable forex trading robot should be able to deal with a large
number of data. These data can be divided into three categories: training data, confirming data
and experiment data. Yao (2000) believe that training data should occupy a 70% weight in the
total data, set which includes data selection. Confirming data and experiment data comprise 20%
and 10% of the total data set, respectively. This theory is based on Yao (2000)’s experience and
it has already become a common regulation. With this knowledge, if the error of one robot is
the lowest compared with the other trading robots, this software can be considered the best.
When a best trained trading robot gets the best experiment result, this trading robot can be
considered suitable for future forecasting. Yao (2000) indicates that the best experiment should
separate data collection from time frame. In other words, the backward test can launch as
trading robot training, the validation can be formed as a forward test, and the testing process
can be launched in the period of the newest time frame. The purpose of this evaluation method
is to determine the internal “structure” of the current market environment. Thus we can
discover the “relationship between present, past and future observations”. (Yao, 2000).
Normally, the measurement of trading robots is defined as evaluating and comparing the
prediction capability of each robot, and this process was declared as normalized mean square
error (NMSE) by Yao (2000). He indicates that NMSE is “used to evaluate entries into the Santa
Fe Time Series Competition.” In this theory, parameter P is given as comprising pairs of targets
that can be presented as Xk. Besides target value, the predicted values are also noted by Yao
- 65 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
(2000). This parameter is presented as X~k. The NMSE is presented by the division between MSE
and its normalized value. This description can be presented as the following formula.
In the above formula, б2 presents the estimated variance of historical data, presents the
average value, and N presents the amount of a series of P. When traders predict the market
environment using the average value of historical data, the value NMSE can be calculated as 1.0.
The NMSE is communicated to R2. This is the relation measurement between predict values
pairs and the expected calculation, which is presented as NMSE = 1 – R2. The above formula
includes additional measurements of calculation between the actual value by correcting the
generated and predicted content. The values include and . These two elements are
assigned for testing configuration and the change of direction. The related expression can be
presented as below.
These data are acceptable, because the NMSE only measures the prediction level. Thus, traders
always use R2 to measure the forecast quality. As a result, the correctness of gradient can be
presented as Dstart. The backward test measurement can be presented as in the following tables.
in currency pairs
Robot 1 AUD / USD 0.0562 (1.0102) 11% 77.45%
Robot 2 AUD / USD 0.0621 (1.0121) 9% 75.55%
Robot 3 AUD / USD 0.0571 (1.0151) 21% 73.21%
Robot 4 AUD / USD 0.0554 (1.0274) 13% 76.43%
Robot 5 AUD / USD 0.0479 (1.0185) 12% 77.32%
Robot 1 NZD / USD 0.0618 (0.7991) -9% 51.75%
Robot 2 NZD / USD 0.0533 (0.8211) 12% 53.56%
Robot 3 NZD / USD 0.0624 (0.8076) 5% 57.23%
Robot 4 NZD / USD 0.0659 (0.8122) 13% 51.86%
Robot 5 NZD / USD 0.0553 (0.8111) 10% 60.53%
Robot 1 EUR / USD 0.1219 (1.3312) 9% 69.29%
Robot 2 EUR / USD 0.1125 (1.2988) 31% 68.97%
Robot 3 EUR / USD 0.1178 (1.3321) 13% 67.91%
Robot 4 EUR / USD 0.1211 (1.3219) 22% 68.40%
Robot 5 EUR / USD 0.1198 (1.3222) 6% 67.31%
Robot 1 GBP / USD 0.1311 (1.4921) -1% 77.23%
Robot 2 GBP / USD 0.1321 (1.5212) -10% 71.29%
Robot 3 GBP / USD 0.1398 (1.5123) 13% 73.81%
Robot 4 GBP / USD 0.1299 (1.5411) -15% 76.13%
Robot 5 GBP / USD 0.1291(1.5121) 7% 70.90%
Robot 1 USD / JPY 0.1101 (0.7922) 38% 33.59%
Robot 2 USD / JPY 0.1191 (0.8211) 19% 39.42%
Robot 3 USD / JPY 0.1129 (0.8321) -12% 33.76%
Robot 4 USD / JPY 0.1211 (0.8411) -9% 31.21%
Robot 5 USD / JPY 0.1198 (0.8512) -2% 35.64%
Table 5-1 Back test measurement
The effectiveness of robot trading is the number of profit orders and the financial increase
based on the forecasting outcome. Yao (2000) believes that the accuracy of the prediction or
the value of the NMSE and gradient is not important for traders. After experiment results were
gained from back and forward test, the simulations of real trading were created and possible
profits were calculated. However, this process was not real forex robot trading; Yao (2000)
The calculation of the paper profit is based on the account increase percentage. In most MT4
trading robots, the initial deposit amount is programmed in the fund management. This deposit
amount is called seed money. When the trading robot starts running, the seed money is used to
purchase another currency by following the prediction. After the experiments, the profits
should be transferred in the same currency as the seed money, and this transaction should be
calculated by the current cross rate. These results can be shown as in the above two tables. The
- 68 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
In the above formula, the money obtained presents the final amount of the trading account
after the experiments. The seed money is presenting the initial fund while robot trading is
starting. And the w presents how many weeks the robot has been trading.
“Trading is an art.” (Yao, 2011). Babypips (2011) believes that no trading robot can be perfectly
applied in every trading environment. To ensure a trading profit, the only method is selecting
the “full” advantage of each indicator when they are applied in the current trading strategies.
Therefore, the indicators filter has been designed to calculate the effect of each indicator. The
theory of the indicators filter programme is simple: apply indicators to current forex trading
one by one, and record each profit. The results of the indicators experiments can be analyzed
In the above description, using the indicator of moving average trading in EUR / USD as a
sample, if the example shows that the currency price is increasing and the initial account is
- 69 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
formed with US dollar, then the indicator is designed for the “long” action. If the robot issues
the “down” signal and the currency price is going down, then the indicator is taking the “short”
action Otherwise, the indicators filter will hold for the next signal.
The transaction cost has been considered in this evaluation. In this situation, 0.5 percentage
transaction cost had been calculated by extra account decrease. Yao (2000) believes that a
huge fund forex trading with no more than 0.5% transaction cost can have an effect on the
currency price, and thus could affect the final result of real trading. Under most forex dealers’
services, the transaction costs are calculated in spread. Therefore, the calculation of spread is
also considered in the effectiveness evaluation. The following table shows the effect of each
Yao (2000) states that the criteria can determine market movement by testing the indicators
filter. The above table provides the criteria of profit percentage. By checking the account
changes, we can determine the movement of the current currency price. The outcome of the
six different indicators depends on the testing, which can follow the example of the EUR / USD
experiments. The traders outline the six different indicators. According to the test, the profit
return can be increased by 12% annually by using the moving average; the annual return can be
achieved at 22% by using MACD; the annual return can be achieved at 11% by using KD; the
annual return can be achieved at 24% by using AD; the annual return can be achieved at 31% by
using RSI line; and the annual return can be achieved at 30% by using SAR. Therefore, in theory,
the RSI is the best choice for the currency of EUR / USD, because there is a high return from the
indicators filter experiments. At the same time, the transaction cost should be considered in
real trading, and thus the indicator of SAR which has a 0.1% spread fee with a 30% return
Basically, there are two experiments that generate effective evaluation. First, this research
created a back test model to capture the relationship between the historical data and the
future movement forecast of the trading robot. The back experiment is the simplest technical
- 71 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
test method. The MetaTrader 4 downloads the historical data and simulates the real market
movement. The trading robot can follow the simulation and forecast the past market
environment, and thus can derivate the performance. In this research, five trading robots are
applied in trading currency EUR, GBP, AUD, NZD and JPY. Thus, the output of those experiments
is fund return. In those experiments, up to 240 days of back test historical data have been used.
The result indicates that there is no apparent change of the NMSE, although five robots have
been inputted into the evaluation model. Sometimes the outputs are worse than before, which
means that the amount of the trading account could be decreased. This indicates that the
improvement of the trading robots may not have a positive effect. A reason mentioned in the
last chapter is that the low modeling quality may decrease the success rate of robot trading. In
the case of the worse performance trading robots, too many parameter inputs may cause too
much noise in the experiment. Only after improving the parameter input can the best result be
The back test experiment can generate different prediction results, which are based on the
modeling quality, and thus the forward test becomes more important and accurate. During the
chart review under the back test window, potential noise can be found by traders, which can
The trend can be divided into three levels: primary time frame, mainly trend frame and minor
time frame. This theory is developed by Charles Dow, who indicates that trends can be likened
to waves of the sea. In his idea, the moving average is the most important indicator for
smoothing out the current price chart and issuing the general direction of the market
movement. Thus, he always uses the moving average to determine the major trend. However,
- 72 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
this method has some disadvantages, because the moving average line drawing is always
behind the current movement, and there must be some delay. Dow estimates that the major
trend always persists more than one year, and the intermediate trend can persist more than
three months. Yao (2000) believes that the secondary time frame is meaningless in itself, but a
connection of three intermediate trends can confirm the major trend and fix the possible trend
reversal of a major trend. The minor time frame is usually used to set the entry point. Under
this time frame, the major trend can be ignored by traders. The robot can select possible
trading opportunities for placing orders that have the same direction as the secondary trend.
Dow’s theory indicates that time frame is the most important parameter of trading strategies.
In this paper, there are two robots that have been designed using multi time frames. Therefore,
Finally, more evaluations have emerged in this research. Sensitivity evaluation is base on chart
review, which compares the difference between the chart symbol and the trading signal. The
improvement can generate the best trading strategy for the current market environment.
The prediction results discussion includes effectiveness and sensitivity evaluation. The
effectiveness evaluation mainly focuses on the performance of each trading robot, and the
The measurement of effectiveness evaluation is show in Table 5-1 and Table 5-2. Table 5-3
presents the back test performance for each trading robot. These experiments are applied in
- 73 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
five different currency pairs. Those financial products are AUD / USD, NZD / USD, EUR / USD,
GBP / USD, and JPY / USD. The historical data were selected from 1st March to 1st October.
From the results of Table 5-1, the research finds that the NMSE level is suitable for each trading
application. However, the gradients show that all programs that are applied in JPY / USD market
are lower than 50%, which means the prediction is worse than the chances that are provided in
other financial products. No doubt that performance can be accepted for back test. Thus, the
fund return should be generated and is required for depth evaluation. In the diagram of Table
5-1, some of trading robot performances are not good, because the value of fund return is
negative. This means the system always fails the trading in the period of 240 days.
As shown in Table 5-2, the NMSE level is also suitable for each trading robot. As in Table 5-1,
the gradients value indicates that all the programs that are applied in JPY / USD currency are
lower than 50%, which also means the prediction is worse than the chances which are provided
in other financial products. In the fund return section, all trading robots get positive results,
which means the software performance can be accepted. in particular, two trading robots have
gained much higher results in fund return. The details of those two robots are presented in the
following table.
The above table shows that time frame can take more profit in forex trading, because the lower
trend time frame can confirm the major trend and fix the possible trend reversal of the major
trend. Table 5-3 shows the effect of each indicator. Those technical indicators are internal
parameters of each trading strategy, which means they can directly affect the performance of
the trading robot. The table indicates that indicator SAR can take a stable profit, especially
The sensitivity evaluation is worked as a chart review, which results in a comparison between
the trading signal and the real market direction. Therefore, the result of the experiment cannot
The above table shows the relationship between the total number of orders and noises. In
theory, the total numbers of orders depends on the sensitivity of the forex trading robots. The
higher the sensitivity of the robot, the higher the number of transactions that will be generated.
However, too frequent trading will make more false entry signals, and thus will decrease the
success rate, and consequently the number of profit orders. Furthermore, the features of the
currency pairs will affect the sensitivity of the trading robots. Babypips (2011) believes that
greater market volatility can bring more trading opportunities, improve the trading success rate
and thus increase the account. In this research, an experiment has been set up for evaluating
the relationship between market volatility and total profit. The following table presents the
- 76 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
The above table indicates that higher market volatility can improve the trading results.
According to the experiments, this research indicates that the best trading session is the
London time frame, which can provide up to 150 pips of daily volatility. The currency pair of
GBP / USD is the best product for robot trading, since it has the highest volatility in each trading
day.
To increase the sensitivity of the trading robot, two methods can be applied to software
opportunities. The following table shows an example on how to increase the number of orders
- 77 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
5 50 22
5 10 36
Table 5-7 Effect of parameters modification
From the above chart, it can be seen that decreasing the value of each parameter can
effectively increase the number of transactions, and thus improve the sensitivity of trading
Another method is entry delay, which is using a set of time to confirm the trend and then
placing the order. To apply this concept to real trading, the moving average crossover has also
been set into the test. In this experiment, I selected 90 days historical data for the backward
test, the moving average crossover was added into the MT4 terminal for chart review. The
Currency Pairs Trading immediately Delay 1 candle stick Delay 2 candle stick
(Noise Rate) (Noise Rate) (Noise Rate)
EUR / USD 21% 20% 17%
GBP / USD 12% 15% 16%
AUD / USD 33% 28% 29%
NZD / USD 35% 22% 26%
USD / JPY 44% 31% 38%
Table 5-8 Effect of entry delay
The above table shows that entry delay can have positive effects on robot trading. However,
the experiment result indicates that an overlong waiting time could also reduce the success
rate, because the trading robot misses the opportunity and places orders at the end of the
trend. Therefore, the best way to improve both the effectiveness and sensitivity of a trading
- 78 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
Yao (2000) indicates that the effectiveness and sensitivity of robot trading are both interrelated
and contradictory. The effectiveness of robot trading is the number of profit orders and
financial increase based on the forecasting outcome. The sensitivity evaluation is worked as a
chart review, from which the result is the comparison between the trading signals and real
market directions. Over sensitive trading robots can take more trading opportunities, but they
also can reduce the performance, and thus affect the trading profitability.
5.3.1. Interrelation
A more sensitive trading robot can take more chances in trading. In most market environments,
a higher fund return can be generated by many orders in a specific period. The following
The above table shows that trading opportunities are increased by changing parameters.
According to the experiment, narrowing the parameter setting will increase the sensitivity of
the moving average crossover. Following improved transaction volumes, more and more profits
are injected into the trading account, and also some noise is generated by the wrong trend
direction. In total, the fund return is increased because of huge market volatility. On the other
hand, decreasing the sensitivity of trading strategy could lose potential trading opportunities
- 79 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
5.3.2. Contradiction
The contradiction between effectiveness and sensitivity is based on the value of noise. A huge
number of noises will have a negative effect on the robot performance, and a lower fund return
could be issued. Furthermore, too many transactions will take more spread fees, which will hit
the trader’s account frequently. The following table presents the contradiction between
The above table shows that too many orders were placed by narrowing down the parameter
setting. The experiment shows that increasing the sensitivity of the moving average crossover
will cause more noises, and many of them will be opposite to the current market trend in the
side ways market environment. In total, the trading account will decrease because of low
market volatility. Besides that, too many transaction fees are caused by those noises. The
performance of the trading robot will drop, and the contradiction between effectiveness and
sensitivity is confirmed.
- 80 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
During evaluation, the relationship between effectiveness and sensitivity becomes clear. Yao
(2000) states that there is no perfect forecast model that can be found in real trading. Since
there are too many unpredictable market environments that can affect the performance of
trading robots, the improved trading robot should catch all the trends found in past trading. In
the evaluation section, this paper discovered several factors that can affect the performance of
trading robots. These factors can have both negative and positive effects. The details of those
The above table presents factors that can affect trading robot performance. Among them, the
entry delay can be ignored for improving robot design, since it has a similar percentage of
positive and negative effects. Therefore, the new program considers four elements that can
take advantages in real trading. They are indicators modified, parameters modified, time frame
In this research, the dolphin system results in the highest performance compared with the
others. The principles of trend determination are based on the technical indicators of MA (26)
and MACD (5, 34, 5). When the price is greater than MA (26) and the MACD value is larger than
the signal, and the current trend can be considered as bullish. In the case of the price being
lower than MA (26) and the MACD value larger than the signal, the primary trend can be
- 82 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
determined as bullish too. If the price is greater than MA (26) and the MACD value smaller than
the signal, the trend is bearish. While the price is smaller than MA (26) and the MACD value
larger than the signal, the current trend can be considered as bearish as well.
The above description is complex and it causes much delay when the robot is focusing on the
next time frame. In the experiments, many noises were found while the trend was in reverse.
Because of the nature of MACD, internal entry delays are unavoidable, nor are the parameters
modifiable. The only solution is changing indicators. In this paper, the indicator of Heiken Ashi is
if(mCount <= 0)
{
Mopen = Open[pos];
Mclose = Open[pos];
Mhigh = Open[pos];
Mlow = Open[pos];
mhaOpen = (tempopne + tempclose) / 2;
}
else{
mopen = iOpen(0 , mframe , mainPos);
mclose = Close[pos+1];
mhigh = High[iHighest(NULL , 0 , MODE_HIGH , mCount , pos+1)];
mlow = Low[iLowest(NULL , 0 , MODE_LOW , mCount , pos+1)];
}
tempopne = mhaOpen;
tempclose = mhaClose;
- 83 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
tempcopen = chaOpen;
tempcclose = chaClose;
maintrendline[pos] = mhaOpen;
currenttrendline[pos] = chaOpen;
currentlma[pos] = clma;
upstop[pos] = upstopline;
downstop[pos] = downstopline;
- 84 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
The experiment results of this research show that the London session should be the best for
robot trading. However, Babypips (2011) provides the concept of session overlaps, which is
usually designed in programs so that it can assist traders in getting maximal profits. The session
The parameter selection is similar to the dolphin system. They are KD (8, 5, 5), MA (26, 52, 104,
360), Envelope (26 – 0.62%, 0.31%) and Time (M5 – M30 – 4H). The description can be
presented as follows.
1. The formula of the dolphin system for the position size calculation is followed by :
2. The regulation of entry point setting is based on the indicators of KD (8, 5, 5). The buy
signal is generated when the current KD value crosses above the signal line. On the
other hand, the short signal is generated by the dead cross of the KDs.
3. This trading system uses the golden channel as the profit determination. When the price
hits the boundary of the golden channel, the transaction will be closed for taking profits.
The related technical indicators of the golden channel are Envelope (26 – 0.62%, 0.31%).
4. The stop loss setting is special in this trading system. If the price continues to move
more than 9 candles in the current chart, the trend will be ending. Therefore, traders
should enforce the closure of the current trading after 9 candle sticks are finished.
- 85 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
buy[pos] = line_bottom;
}
else if(Close[pos+1] > currenttrendline[pos] && Open[pos+1] < currenttrendline[pos] &&
Open[pos] < currenttrendline[pos]
&&Open[pos] < maintrendline[pos] && filter < f_s)
{
sell[pos] = line_top;
}
Yao (2000) believes a profitable forex trading robot should be able to deal with a large amount
of data. In this improved program, the effectiveness of a trading robot is related to these data,
which can be divided into three categories: training data, confirming data and experiment data.
The previous experiment shows that training information should occupy a 70% weighting, and
confirmation and experiment should be 20% and 10% respectively. If the error of one robot is
the lowest compared with other trading robots, this software should be considered the best.
When a best-trained trading robot gets the best experiment result, this trading robot can be
considered suitable for future forecasting. Similar to the previous evaluation, two parameters
are applied into the experiment. They are NMSE and gradient. The accuracy of the prediction or
the value of the NMSE and gradient is not a matter for traders. After experiment results are
gained from backward and forward tests, the simulations of real trading are created and
possible profits are calculated. The test results are shown in the following table.
- 87 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
According to the evaluation formula, the NMSE and gradient value are calculated as follows.
The above table presents the backward test result for each trading robot. I measured five
different currency pairs in this experiment. Those investment products are AUD / USD, NZD /
USD, EUR / USD, GBP / USD, and JPY / USD. I selected the historical data in a time series, which
is within the range of 1st October to 1st February. After testing, the experiment result shows
that the value of NMSE is acceptable for each trading robot evaluation. However, the value of
the gradient is lower than 50% in the JPY / USD currency experiment, which means the
improved robot forecast is not acceptable in JPY / USD trading. In the tests for other currency
pairs, the improved software has made better results. The backward test results indicate that
the improved program is acceptable in most market environments. Compared to other trading
robots, the new robot can generate greater fund returns. Therefore, the improvement is
successful and the new software can take more profits in future trading.
- 89 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
From the evaluation, this research has drawn the following conclusions:
1. In this research, robot designers are recommended to pay close attention to time frame
USD / JPY. Because the gradient is lower than 50% in the JPY / USD experiment, the
robot forecast is not acceptable in JPY / USD trading. In the experiments for other
currencies, in order to get better prediction results, trading robot designers should
consider five factors, viz., entry delay, indicator modification, parameter modification,
time frame setting and trading session selection. Among them, trading session selection
is the most beneficial. According to the experiment results, higher market volatility can
improve trading results. To get higher market volatility, selecting appropriate trading
sessions can help traders to avoid side-ways market environments and filter out
potential trends.
2. I have applied the random walk hypothesis and the efficient market hypothesis in the
pre experiment section. The random walk hypothesis presents currencies moves
randomly, and the markets’ directions are uncertain. The efficient market hypothesis is
referring to market reflection, which can hold all possible opportunities and fully reflect
the latest information. Both hypotheses can be presented as Hurst exponent (H). In
financial markets, the application of H exponent can output three cases. In the case of
H = 0.5, the evaluation over the random data set cannot be considered as Gaussian
random walk. In the case of 0 ≤ H < 0.5, the market movement may be opposite to the
- 90 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
current direction in the future. In the case of 0.5 < H < 1, the current trend will continue.
The trend strength depends on the deviation between Hurst exponent value and 0.5. In
the pre-experiment phase, I have tested the Hurst exponent value for all five currency
pairs. The Hurst exponent value is always in the range of 0.5 to 1, which indicates they
3. The performance measurement model is designed for analyzing trading robots’ forecast
ability, which is called as normalized mean square error (NMSE). Normally, traders
should not be concerned with NMSE. Instead, the value of paper profits is more
important, where the paper profit calculation is based on the percentage of the account
increasing. During experiments, data segments of fund return indicate that a robot
4. The sensitivity analysis is based on chart reviews, which present the correlation
between found trading signals and market trends. A greater market volatility can
produce more trading opportunities and can also increase the trading success rate, thus
increasing the account. Parameter selection increases trading opportunities, but it also
5. The effectiveness and sensitivity of robot trading is both interrelated and contradictory.
Excessive sensitivity of trading robots makes more trading opportunities, but is also
The above summaries conclude the overall discoveries of this research. However, there are
some other issues that need to be addressed. It is expected that an automatic trading robot will
- 91 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
be developed that can reduce noise yet increase trading success rates. The requirements of
1. Improved trading software should be able to work with any potential time frames. In
this research, the indicator modification only focused on the major time frame instead
of medium or minor time frames. The future work will cover more time frames.
2. In future work, more parameters will be involved in performance analysis, such as the
3. Future study should create a forward test for the improved trading robot. In this
research, the test results show that the performance of each robot in the forward test is
better than the one in the backward test. The reason is that the forward test can avoid
some potential trading noises by selecting trading sessions. Therefore, the results of
4. As the gradient value is lower than 50%, this research has ignored all evaluation results
related to Japanese currency. In the future, all experiment data should be analyzed in
- 92 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
Bibliography
Papadamoua, S.,& Stephanides, G. (2004). Improving technical trading systems by using a new MATLAB-
based genetic algorithm procedure. International Conference on Computational Methods in Sciences and
Engineering (pp. 189–197). Volos: Mathematical and Computer Modelling.
Amiri, M., Zandieh, M.,..., & Roshanaei, V. (2010). An integrated eigenvector-DEA-TOPSIS methodology
for portfolio risk evaluation in the FOREX spot market. Expert Systems with Applications: An
International Journal , Volume 37 Issue 1.
Archer, M. D. (2007). Getting Started in Forex Trading Strategies. Canada: John Wiley & Sons, Inc,
Hoboken, New Jersey.
Babypips. (2011). Best day of the week to trade. Retrieved Oct 20, 2011, from Babypips:
http://www.babypips.com/school/best-days-of-the-week-to-trade.html
Babypips. (2011). Currencies are traded in pairs. Retrieved Oct 20, 2011, from Babypisps:
http://www.babypips.com/school/currencies-are-traded-in-pairs.html
Babypips. (2011). Don’t lose your shirt. Retrieved Oct 20, 2011, from Babypips:
http://www.babypips.com/school/dont-lose-your-shirt.html
Babypips. (2011). How you make maney in forex. Retrieved Oct 20, 2011, from Babypips:
http://www.babypips.com/school/how-you-make-money-in-forex.html
Babypips. (2011). Leading vs. lagging indicators. Retrieved Oct 20, 2011, from Babypips:
http://www.babypips.com/school/leading-vs-lagging-indicators.html
Babypips. (2011). Trading sessions. Retrieved Oct 20, 2011, from Babypips:
http://www.babypips.com/school/trading-sessions.html
Bahrepour, M., Akbarzadeh, M.,...,& Naghibi, M. (2011). An adaptive ordered fuzzy time series with
application to FOREX. Expert Systems with Applications: An International Journal , Volume 38 Issue 1.
Bigalow, S. (2001). Profitable candlestick trading: pinpointing market opportunities to maximize profits.
Canada: John Wiley & Sons, Inc.
Bland, J., Meisler, J. M., & Archer, M. D. (2008). Forex Essentials in 15 Trades: The Global-View.com
Guide to Successful Currency Trading. Canada: John Wiley & Sons, Inc., Hoboken, New Jersey.
Book, M. (2011). Introduction to MQL4 programming. Retrieved Oct 20, 2011, from MQL4 Book:
http://book.mql4.com/intro
Bourhis, G., & Agostini, Y. (1998). Man-machine Cooperation for the Control of an Intelligent Powered
Wheelchair. Journal of Intelligent and Robotic Systems , 22 (3-4).
- 93 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
Briza, A., & Naval, P. (2008). Design of stock trading system for historical market data using
multiobjective particle swarm optimization of technical indicators. GECCO '08 Proceedings of the 2008
GECCO conference companion on Genetic and evolutionary computation. New York: ACM.
Chavarnakul, T., & Enke, D. (2009). A hybrid stock trading system for intelligent technical analysis-based
equivolume charting. Neurocomputing. Neurocomputing , Volume 72 Issue 16-18.
Clague, K., Rolighed, S.,...,& Ferrari, G. (2002). 10 Cool LEGO Mindstorms: Dark Side Robots, Transports,
and Creatures -- Amazing Projects You Can Build in Under an Hour. Syngress Publishing.
Cliff, D. (2006). ZIP60: an enhanced variant of the ZIP trading algorithm. CEC-EEE '06 Proceedings of the
The 8th IEEE International Conference on E-Commerce Technology and The 3rd IEEE International
Conference on Enterprise Computing, E-Commerce, and E-Services. Washington, DC: IEEE Computer
Society.
Cliff, D. (2009). ZIP60: further explorations in the evolutionary design of trader agents and online
auction-market mechanisms. IEEE Transactions on Evolutionary Computation - Special issue on
computational finance and economics , 13 (1).
Cui, W., Brabazon, A., & O’Neill, M. (2009). Efficient trade execution using a genetic algorithm in an
order book based artificial stock market. GECCO '09 Proceedings of the 11th Annual Conference
Companion on Genetic and Evolutionary Computation Conference: Late Breaking Papers. New York: ACM.
Deutch, D., & Milo, T. (2012). Type inference and type checking for queries over execution traces. The
VLDB Journal — The International Journal on Very Large Data Bases , 21 (1).
Du, Y. & Jiang, C. (2002). Formal representation and analysis of batch stock trading systems by logical
petri net workflows. ICFEM '02 Proceedings of the 4th International Conference on Formal Engineering
Methods: Formal Methods and Software Engineering. London: Springer-Verlag.
Eldawlatly, S., Jin, R., & Oweiss, K. (2009). Identifying functional connectivity in large-scale neural
ensemble recordings: A multiscale data mining approach. Neural Computation , Volume 21 Issue 2.
Emam, A. (2008). Optimal artificial neural network topology for foreign exchange forecasting. ACM-SE
46 Proceedings of the 46th Annual Southeast Regional Conference on XX. New York: ACM.
Explained, T. F. (2011). Risks of forex trading. Retrieved Oct 20, 2011, from The Foreign Exchange Market
Explained: http://www.forexmarketexplained.com/Risks_of_FOREX_Trading.html
Forex, M. (2011). Modeling quality in Metatrader 4: an almost meaningless number. Retrieved Oct 20,
2011, from Mechanical Forex: http://mechanicalforex.com/2010/12/modeling-quality-in-metatrader-4-
an-almost-meaningless-number.html
Forextraders. (2011). Evaluating automatic forex trading systems. Retrieved Oct 20, 2011, from
Forextraders: http://www.forextraders.com/automated-forex-trading/evaluating-forex-trading-
systems.html
- 94 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
Garcia, P., Caamano, P.,..., & Duro, R. (2009). A Behavior Based Architecture with Auction-Based Task
Assignment for Multi-robot Industrial Applications. IWINAC '09 Proceedings of the 3rd International
Work-Conference on The Interplay Between Natural and Artificial Computation: Part II: Bioinspired
Applications in Artificial and Natural Computation. Berlin: Springer-Verlag.
Greene, G. E. (2008). Turning Losing Forex Trades into Winners: Proven Techniques to Reverse Your
Losses. Canada: John Wiley & Sons, Inc., Hoboken, New Jersey.
Heng, C., & Chuan, S. (2011). Is genetic programming "human-competitive"? the case of experimental
double auction markets. IDEAL'11 Proceedings of the 12th international conference on Intelligent data
engineering and automated learning. Berlin: Springer-Verlag.
Henrique, C., Araujo, D., & Castro, P. (2010). Towards automated trading based on fundamentalist and
technical data. SBIA'10 Proceedings of the 20th Brazilian conference on Advances in artificial intelligence.
Berlin: Springer-Verlag.
Ho, W., Tung, W., & Quek, C. (2010). Brain-inspired evolving neuro-fuzzy system for financial forecasting
and trading of the s&p500 index. PRICAI'10 Proceedings of the 11th Pacific Rim international conference
on Trends in artificial intelligence. Berlin.
Horoi, M., & Enbody, R. (2001). Using AMDAHL's Law as a Metric to Drive Code Parallelization: Two Case
Studies. International Journal of High Performance Computing Applications , 15 (1).
Lee, J., & O, J. (2002). A multi-agent q-learning framework for optimizing stock trading systems. DEXA '02
Proceedings of the 13th International Conference on Database and Expert Systems Applications. London:
Springer-Verlag.
Marta, T.,& Brusuelas, J. (2009). orex analysis and trading: effective top – down strategies combining
fundamental position, and technical analyses. Canada: Bloomberg Press.
Martinez, L., Hora, D.,...&Pappa, G. (2009). From an artificial neural network to a stock market day-
trading system: a case study on the BM&F BOVESPA. IJCNN'09 Proceedings of the 2009 international
joint conference on Neural Networks. NJ: IEEE Press Piscataway.
Montana, G., Traintafyllopoulos, K., & Tsagaris, T. (2008). Data stream mining for market-neutral
algorithmic trading. SAC '08 Proceedings of the 2008 ACM symposium on Applied computing. New York:
ACM.
Pivtoraiko, M. (2009). Adaptive Anytime Motion Planning for Robust Robot Navigation in Natural
Environments. AT-EQUAL '09 Proceedings of the 2009 Advanced Technologies for Enhanced Quality of
Life. Washington, DC: IEEE Computer Society.
- 95 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
Popescu,D., & Sowa, M. (2008). In vitro assessment of optical properties of blood by applying the
extended Huygens-Fresnel principle to time-domain optical coherence tomography signal at 1300nm.
Journal of Biomedical Imaging , 2008.
Prelipcean, G., Moisescu, F.,...& Cioban, G. (2009). A hybrid trading system for defence procurement
applications. SMO'09 Proceedings of the 9th WSEAS international conference on Simulation, modelling
and optimization. Stevens Point: World Scientific and Engineering Academy and Society (WSEAS).
Saettele, J. (2008). Sentiment in the Forex Market: Indicators and Strategies To Profit from Crowd
Behavior and Market Extremes. Canada: Wiley Trading & Sons, Inc, Hoboken, New Jersey.
Shmilovici,A., Kahiri, Y.,...,& Hauser, S. (2009). Measuring the Efficiency of the Intraday Forex Market
with a Universal Data Compression Algorithm. Computational Economics , Volume 33 Issue 2.
Snellgrove, D. (2008). Selective Forex Trading: How to Achieve Over 100 Trades in a Row Without a Loss.
Canada: Wiley Trading & Sons, Inc, Hoboken, New Jersey.
System, P. M. (2011). So you’ve finished the school of pipsology…now what? Retrieved Oct 20, 2011,
from Pip My System: http://www.babypips.com/blogs/pip-my-
system/so_youve_finished_the_school_o.html
Tonko, M., & Nagel, H. (2000). Model-Based Stereo-Tracking of Non-Polyhedral Objects for Automatic
Disassembly Experiments. International Journal of Computer Vision - Special issue on image-based
servoing , 37 (1).
Traderslogs. (2011). Technical analysis definition. Retrieved Oct 20, 2011, from Traderslogs:
http://www.traderslog.com/category/definitions/technical_definitions/page/10/
Trading, F. D. (2011). Forex trading robot. Retrieved Oct 20, 2011, from Forex Day Trading:
http://www.forex-day-trading.com/fx-bot/forex-trading-robot
Vera, A., John, B.,...,& Freed, M. (2005). Automating human-performance modeling at the millisecond
level. Human-Computer Interaction , Volume 20 Issue 3.
Wiki. (2011). Money management. Retrieved Mar 10, 2011, from WikiLeak:
http://en.wikipedia.org/wiki/Money_management
Wiki. (2011). retail foreign exchange platform. Retrieved Oct 10, 2011, from WikiLeak:
http://en.wikipedia.org/wiki/Retail_foreign_exchange_platform
Wiki. (2011). Algorithmic trading. Retrieved Mar 10, 2011, from WikiLeak:
http://en.wikipedia.org/wiki/Algorithmic_trading
Xiao, Y. (2008). An Architecture for Guaranteeing Real-Time Databases Available Ceaselessly. FTDCS '08
Proceedings of the 2008 12th IEEE International Workshop on Future Trends of Distributed Computing
Systems. Washington, DC: IEEE Computer Society.
- 96 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
Yao, J., & Tan, C. A case study on using neural networks to perform technical forecasting of forex.
Neurocomputing, (pp. 34 (1), 79 -98).
Zhang, D. (2011). The concept of dolphin system. Retrieved Oct 20, 2011, from The concept of dolphin
system: http://hi.baidu.com/wh999/blog/item/f6b4377f9c4b990c28388aaf.html
- 97 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
Appendix
Candle Sticks
Babypips (2011) states that there are four basic candlesticks that can help traders determine
the potential movement of the forex market. They are hammer, hanging man, inverted
hammer and shooting star. The common point of the four graphs is a candle with a short body
and a long shadow. The color of the body is decided by the direction of the future market. The
difference is the direction of the shadow. In mql4 programming, the length of the body is
usually not more than one third of the shadow. The basic candlesticks are displayed in the
diagram below.
Gerald (2008) believes that candlesticks can effectively assist traders to determine the future
movement of the forex market, especially the changing of the trend. However, a single candle is
too simple and could produce too many trading signals, which can cause traders to make
mistakes when they are determining the market direction. Thus, Babypips (2011) proposes the
- 98 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
concept of candle patterns, which is a combination of patterns and composed of two or three
candlesticks.
Compared with single candlesticks, the concept of double candlesticks is more complex.
‘Engulfing’ is composed of two candles of different sized bodies. Gerald (2008) defines bullish
engulfing candles as the result of a down candle followed by a long up candle, which predicts
that a potential bullish trend could occur. A bearish engulfing is opposite to a bullish engulfing,
which is described as a short up candle followed by a long bearish candle. The engulfing candles
Another pattern of double candles was proposed by Babypips (2011), which is called Tweezer.
Tweezer is presented by two reserved candles, whose body color shows that these two candles
point in different directions. Gerald (2008) considers that the second candle could determine
the future trend of the forex market. In Tweezer candles, the length of the shadow and body
should be similar, but the body color should be different. The Tweezer candles are presented in
- 99 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
Triple candlesticks are more complex and difficult to distinguish, but Babypips (2011) considers
that they would be more accurate than the previous two types of charts. Of course, a complex
pattern will cause some delay when traders are determining the future movement of the forex
market. This web tutorial states that triple candlesticks can be categorized as the below three
types.
Bigalow (2011) believes the common point of evening and morning stars is that the first candle
should be a continuation of the previous trend. It presents a long body to determine the strong
previews trend. However, after second candle emerges, the situation indicates that there is an
indecision factor in the current market, and the trend could change. Bigalow (2011) states that
the second candle has a small body, but the direction could be either up or down. The third
candle is the confirmation of the trend reversal, which must be completed beyond the middle
point of the first candle. Evening and morning stars are presented in the following diagrams.
- 100 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
The concept of the three soldiers and crows was posted by Babypips (2011). It defines the first
candle as a reversal candle, which indicates the end of the previous trend and that the
following trend could have started. Usually, the second candle of the three white soldiers and
black crows should be longer than the first candle’s body, and the upper shadow of the second
stick should be small or nonexistent. The third candle should be a confirmation of a new trend,
which is the last candle of these triple patterns and is similar to the second stick. Compared
with the evening and morning stars, the three soldiers and crows need more delays to confirm
the next movement after the previews trend reversal, but Bigalow (2011) believes they are
more accurate. The diagram of the three white soldiers and black crows is presented below.
Bigalow (2011) posted improved patterns, which were called three inside up and down. Similar
to morning and evening stars, the first candle of this chart should be the end of the previous
- 101 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
trend. However, the second candle of three inside up and down should be started beyond the
midpoint of the previous stick. The final candle is the confirmation of the new trend and should
be completed above the opening of the first candle. The diagrams of three inside up and down
Due to the triple candle patterns being more complex and hard to categorize, it is necessary to
distinguish their advantages and disadvantages when traders are determining the future
market environment. Bigalow (2011) showed the concepts in the following table.
- 102 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
Moving Average
Marta & Brusuelas (2009) believe the moving average has three basic features, which can
effectively assist traders to determine the future price movement in the forex market. Firstly,
the moving average can track the market trend because it aligns with the average price in each
period, the resulting linear chart can express the basic trend. Secondly, compared with the
forex market price, Babypips (2011) indicates that the moving average is more stable. Usually,
the time periods decide the stable characteristics of the moving average. That means there is
no volatility while the price trend is clearing. Finally, the moving average can help traders to set
the support and resistance level for risk control. Archer (2008) believes that those support and
resistance levels can be dynamic and can be easy to program in MQL4 scripts. In total, Bigalow
(2011) indicates that moving averages have advantages and disadvantages in forex trading; the
- 103 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
MACD
Moving Average Convergence / Divergence (MACD) is a dynamic index that follows the market
trend. It is represented as a relationship between two moving averages. MACD indicator has
three parameters. The first parameter presents the time period of the faster moving average,
and the second presents the slower moving average’s period number. The third parameter
calculates the moving average of the gap between the previews two MAs. Normally, MACD
indicates the difference between the 26 and 12 periods exponential moving average. In order
Algorithm:
Parameters:
RSI
The Relative Strength Index Technical Indicator (RSI) is a price-following oscillator that ranges
between 0 and 100. When Wilder introduced the Relative Strength Index, he recommended
using a 14-day RSI. Since then, the 9-day and 25-day RSI indicators have also gained popularity.
- 104 - | P a g e
Evaluating the Effectiveness and Sensitivity of Forex Trading Robots 2012
RSI is widely used in forex trading. It does not only assists traders determine the potential trend.
Algorithm
Parameters:
- 105 - | P a g e