scieee AI-readable full text Open interactive document viewer

Algorithmic Trading Strategies: Automating and Back-testing the Perfect Order Strategy

Pereira, Otavio Silva

Abstract

The evolution of technology alongside the development of new techniques of algorithmic trading over the past 30 decades (Narang, 2009) allowed global financial markets to achieve higher transaction volume and execution efficiency (Kissell, 2006). In this context, those who fail to adapt to this reality may not survive in financial markets in the future (Chan, 2009). For that, as an attempt to participate in the ongoing automated trading evolution, the present study aims to back-test the Perfect Order Strategy (Lien, 2015) in some selected FX pairs through a fully automated trading system. As a part of the methodology process, the author developed the referred automated trading system through the use of different algorithmic techniques, trading, and risk management models available in the literature, see (Basso, 2019; Leshik & Cralle, 2011; Narang, 2009; Neely et al., 2014; Wilder Jr., 1978). Although the strategy had a positive return at the end of the tests, it performed below the S&P500 index over the same period. Moreover, the results from the back-test showed that the strategy was able to identify trends in its early stages reasonably. In turn, the automated trading system and the advantages that an algorithm execution-based system brought to the strategy played an important role in controlling losses and, therefore, protecting the investment capital. However, the procedures for establishing the stop-loss limit order and the take-profit target showed a flaw and were responsible, in part, for the poor performance of the strategy. Indeed, we are confident that further research in general, particularly in the stop-loss and take-profit target procedures, could improve the strategy's overall performance.

Full text

i ALGORITHM I C TRADI NG STRATEGIES Otavio Silva Pereira Automating and Back-testing the Perfect Order Strategy Dissertation presented as partial requirement for obtaining the Master’s Degree in Statistics and Informat ion Management i NOVA Information Management School Instituto Superior de Estatística e Gestão de Informação Universidade Nova de Lisboa ALGORITHMIC TRADING STRATEGIES: AUTOMATING AND BACKTESTING THE PERFECT ORDER STARTEGY by Otavio Silva Pereira Dissertation presented as partial requirement for obtaining the Master’s degree in Information Management, with a specialization in Information Management Supervisor: Prof. Dr. Jorge Miguel Ventura Bravo November 2021 ii ACKNOWLEDGEMENTS To my father and mother, Wellington Geraldo Lima Pereira (In Memoriam), Maria Lúcia Silva Pereira, who taught me the values of work, honesty, and ethics. To my beloved wife, Marija Mihajlovic Pereira, and my dear children Danilo and Marko, who, without them, life would be meaningless. To my thesis adviser, Dr. Jorge Miguel Ventura Bravo, for his patience, time, and energy spent with me. The completion of this study could not have been possible without his expertise and support. To my professors and colleagues for sharing their knowledge and experience. To NOVA Information Management School staff and board of directors, who provided the structure and conditions for completion of this work. Finally, to my closest friends for their encouragement and support. iii ABSTRACT The evolution of technology alongside the development of new techniques of algorithmic trading over the past 30 decades (Narang, 2009) allowed global financial markets to achieve higher transaction volume and execution efficiency (Kissell, 2006). In this context, those who fail to adapt to this reality may not survive in financial markets in the future (Chan, 2009). For that, as an attempt to participate in the ongoing automated trading evolution, the present study aims to back-test the Perfect Order Strategy (Lien, 2015) in some selected FX pairs through a fully automated trading system. As a part of the methodology process, the author developed the referred automated trading system through the use of different algorithmic techniques, trading, and risk management models available in the literature, see (Basso, 2019; Leshik & Cralle, 2011; Narang, 2009; Neely et al., 2014; Wilder Jr., 1978). Although the strategy had a positive return at the end of the tests, it performed below the S&P500 index over the same period. Moreover, the results from the back-test showed that the strategy was able to identify trends in its early stages reasonably. In turn, the automated trading system and the advantages that an algorithm execution-based system brought to the strategy played an important role in controlling losses and, therefore, protecting the investment capital. However, the procedures for establishing the stop-loss limit order and the take-profit target showed a flaw and were responsible, in part, for the poor performance of the strategy. Indeed, we are confident that further research in general, particularly in the stop-loss and take-profit target procedures, could improve the strategy's overall performance. KEYWORDS Algorithmic Trading Strategies; Foreign Exchange Markets; Automated Trading Systems; Quantitative Trading iv INDEX 1. Introduction .................................................................................................................. 1 2. Literature review .......................................................................................................... 3 2.1. Algorithms and Algorithmic Trading Strategies .................................................... 3 The benefit of deep thought .................................................................................... 4 The measurement and Mismeasurement of Risk.................................................... 4 Disciplined Implementation ..................................................................................... 4 2.2. Algorithms and the financial markets ................................................................... 4 2.3. Understanding a basic structure of an Algorithmic trading system ..................... 5 2.3.1. Alpha Models .................................................................................................. 6 2.3.2. Risk Models................................................................................................... 10 2.3.3. Transaction Cost Models .............................................................................. 11 2.3.4. Portfolio Construction Models ..................................................................... 12 2.4. Foreign Exchange Markets .................................................................................. 12 2.5. Position Sizing and Risk Allocation ...................................................................... 13 2.6. Technical Indicators ............................................................................................. 14 2.6.1. Moving Average Indicator ............................................................................ 14 2.6.2. Average Directional Index Indicator ............................................................. 14 3. Methodology .............................................................................................................. 16 3.1. Hardware, Software, and the Programming Language ....................................... 16 3.2. The Data and the Assets ...................................................................................... 16 3.3. The Automated Trading System .......................................................................... 17 3.3.1. The Alpha Model Algorithm ......................................................................... 18 3.3.2. The Risk Model Algorithm ............................................................................ 22 3.3.3. The Execution Model Algorithm ................................................................... 25 3.3.4. The Position Management Algorithm .......................................................... 26 3.4. The Back-Testing .................................................................................................. 26 4. Results and Discussion ................................................................................................ 28 4.1. Back-Testing GBP/USD ........................................................................................ 28 4.2. Back-Testing EUR/USD ........................................................................................ 34 4.3. Back-testing AUD/USD ........................................................................................ 39 4.4. Back-Testing NZD/USD ........................................................................................ 45 4.5. Back-Testing USD/CHF ......................................................................................... 50 4.6. Back-Testing USD/CAD ........................................................................................ 55 v 4.7. Back-Testing USD/JPY .......................................................................................... 60 4.8. Summary Of Empirical Results Discussion........................................................... 65 5. Conclusions, study limitations, and future research .................................................. 68 REFERENCES .................................................................................................................... 69 Appendix A – GBP/USD Back-testing Execution Log ....................................................... 72 Annex I – The automated trade system algorithm ......................................................... 83 vi LIST OF FIGURES Figure 2.4.1– Basic Structure of an Algorithmic Trading System ............................................... 5 Figure 2.4.2– A Taxonomy of Theory-Driven Alpha Models ...................................................... 7 Figure 2.3.3– GBPUSD Daily Chart with Moving Averages (MA 50 & MA 200) Indicator .......... 8 Figure 2.4.4– Taxonomy of Theory-Driven Models .................................................................. 10 Figure 2.6.1 – The trade Tripod ................................................................................................ 13 Figure 3.3.1 – The Automated Trading System Diagram ......................................................... 18 Figure 3.3.2 – Perfect Order Strategy Buy Model Sample ....................................................... 19 Figure 3.3.3 – Perfect Order Strategy Sell Model Sample ........................................................ 20 Figure 3.3.4 – Signal Conditions 1 and 2 .................................................................................. 20 Figure 3.3.5 – Signal Confirmation Vector ............................................................................... 20 Figure 3.3.6 – Alpha Model Algorithm (lines 133 to 146) ........................................................ 21 Figure 3.3.7 – Alpha Model Algorithm (lines 148 to 164) ........................................................ 22 Figure 3.3.8 – Check for Open Positions .................................................................................. 23 Figure 3.3.9 – Setting the Stop-loss Limit price for a long position algorithm ........................ 23 Figure 3.3.10 – Trade lot-sizing algorithm for a long position algorithm ................................ 25 Figure 3.3.11 – Execution Model for a Buy Order Algorithm ................................................... 25 Figure 3.3.12 – Position Management Algorithm .................................................................... 26 Figure 3.4.1 – Strategy Tester Settings for USD/CHF Back-testing .......................................... 27 Figure 4.1.1– GBP/USD Range between Stop-loss Prices and Entry Prices of Rejected Signals .......................................................................................................................................... 30 Figure 4.1.2 – GBP/USD Position Information (in pips)............................................................ 31 Figure 4.1.3 – GBP/USD Absolute and Maximum Drawdown Balances .................................. 32 Figure 4.2.1– Distribution of EUR/USD Distance between Stop-loss Prices and Entry Prices of Rejected Trades ................................................................................................................ 35 Figure 4.2.2 – EUR/USD Position Information (in pips) ............................................................ 36 Figure 4.3.1 – AUD/USD Distance between Stop-loss Prices and Entry Prices of Rejected Trades ............................................................................................................................... 41 Figure 4.3.2 – AUD/USD Position Information (in pips) ........................................................... 42 Figure 4.3.3– AUD/USD Balance and Equity Evolution ............................................................ 43 Figure 4.4.1 – NZD/USD Distance between Stop-loss Prices and Entry Prices of Rejected Trades ............................................................................................................................... 47 Figure 4.4.2– NZD/USD Position Information (in pips) ............................................................ 48 Figure 4.4.3– NZD/USD Balance and Equity Evolution............................................................. 48 vii Figure 4.5.1– USD/CHF Distance between Stop-loss Prices and Entry Prices of Rejected Trades ............................................................................................................................... 52 Figure 4.5.2 – USD/CHF Position Information (in pips) ............................................................ 53 Figure 4.6.1 – USD/CAD Distance between Stop-loss Prices and Entry Prices of Rejected Trades ............................................................................................................................... 56 Figure 4.6.2 – USD/CAD Position Information (in pips) ........................................................... 57 Figure 4.7.1 – USD/JPY Distance between Stop-loss Prices and Entry Prices of Rejected Trades ............................................................................................................................... 61 Figure 4.7.2 – USD/JPY Position Information (in pips) ............................................................. 62 Figure 4.7.3 – USD/JPY Balance and Equity Evolution ............................................................. 63 viii LIST OF TABLES Table 4.1.1 – GBP/USD Signals emitted by the Alpha Model .................................................. 29 Table 4.1.2 – GBP/USD Distance between Stop-loss Prices and Entry Prices of Rejected Trades ............................................................................................................................... 30 Table 4.1.3 – GBP/USD Position Reward-Risk ratio (in pips) ................................................... 31 Table 4.1.4 – GBP/USD Transactions Report............................................................................ 34 Table 4.2.1 – EUR/USD Signals Triggered by the Alpha Model ................................................ 35 Table 4.2.2 – EUR/USD Distance between Stop-loss Prices and Entry Prices of Rejected Trades ............................................................................................................................... 35 Table 4.2.3 – EUR/USD Position Risk-Reward ratio (in pips) ................................................... 36 Table 4.2.4 – EUR/USD Transactions Report ............................................................................ 39 Table 4.3.1– AUD/USD Signals Triggered by the Alpha Model ................................................ 40 Table 4.3.2– AUD/USD Distance between Stop-loss Prices and Entry Prices of Rejected Trades .......................................................................................................................................... 40 Table 4.3.3– AUD/USD Position Risk-Reward ratio (in pips) .................................................... 41 Table 4.3.4– AUD/USD Transactions Report ............................................................................ 44 Table 4.4.1– NZD/USD Signals Triggered by the Alpha Model ................................................ 45 Table 4.4.2– NZD/USD Distance between Stop-loss Prices and Entry Prices of Rejected Trades .......................................................................................................................................... 46 Table 4.4.3 – NZD/USD Position Reward-risk ratio (in pips) .................................................... 47 Table 4.4.4 – NZD/USD Transactions Report ........................................................................... 50 Table 4.5.1 – USD/CHF Signals Triggered by the Alpha Model ................................................ 51 Table 4.5.2 – USD/CHF Distance between Stop-loss Prices and Entry Prices of Rejected Trades ............................................................................................................................... 51 Table 4.5.3 – USD/CHF Position Risk-Reward ratio (in pips) .................................................... 52 Table 4.5.4 – USD/CHF Transactions Report ............................................................................ 55 Table 4.6.1 – USD/CAD Signals Triggered by the Model .......................................................... 56 Table 4.6.2 – USD/CAD Distance between Stop-loss Prices and Entry Prices of Rejected Trades ............................................................................................................................... 56 Table 4.6.3 – USD/CAD Position Risk-Reward ratio (in pips) ................................................... 57 Table 4.6.4 – USD/CAD Transactions Report ........................................................................... 60 Table 4.7.1 – USD/JPY Signals Triggered by the Alpha Model ................................................. 60 Table 4.7.2 – USD/JPY Distance between Stop-loss Prices and Entry Prices of Rejected Trades .......................................................................................................................................... 61 Table 4.7.3 – USD/JPY Position Risk-Reward ratio (in pips) ..................................................... 62 6 2.3.1. Alpha Models Alpha models may be the main model of a trading strategy algorithm and where the research process is focused. Because they hold as core premise that no instrument is inherently good or bad they have projected to time the selection and/or sizing of portfolio holdings (Narang, 2009). A few synonyms for an alpha model are forecasts, factors, alphas, models, strategies, estimators, or predictors. All successful alpha models are developed in a way that allows them to predict the future well enough that, after allowing for them to lose money in a few trades, they can still be profitable in the long run. Narang continuously stated that “…of the various parts of a quants strategy, the alpha model is the optimist, focused on making money by predicting the future.” (Narang, 2009, pp. 22). 2.3.1.1. Types of Alpha Models: Theory Driven and Data Driven For a trader seeking alpha, there are a small number of basic trading strategies available that can be implemented in several ways. Understanding the perspectives quantitative traders take on science is an important element in understanding quantitative trading strategies (Narang, 2009). Theoretical and empirical are the two major branches of science. The theoretical branch tries to make sense of the world around them by hypothesizing why it is the way it is. The empirical branch believes that enough data from the environment is enough to predict future patterns of behavior, even if there is no hypothesis to rationalize the behavior in an intuitive way (Narang, 2009). Narang points that most of the quantitative traders are theory-driven and most of what they do can be fit into one of five categories of phenomena: trend, reversion, value/yield, growth, and quality, which can be understood by examining price-related data or fundamental data. Perceiving the inputs to a strategy is paramount to understanding the strategy itself. Trend and mean reversion trading strategies rely on price-related data while value/yield, growth, and quality trading strategies are based on fundamental data (Narang, 2009). Traders who seek to predict prices and to profit from such predictions are likely to be using one of two kinds of phenomena. The first idea, trend following or momentum, is that, once started, an trend will continue, and the second idea, which we call counter-trend or mean reversion, is that the trend will, anywhere in the future, reverse (Narang, 2009). 7 Trend Reversion Yield Growth Quality Phenomenon Price Fundamental Alpha Input Return Category Figure 2.3.2– A Taxonomy of Theory-Driven Alpha Models Trend Following Trend following happens to be the oldest of all quantitative trading strategies. Ed Seykota built the first computerized version of the mechanical trend-following strategy that Richard Donchian created some years earlier, utilizing punch cards on an IBM mainframe in 1970. (Narang, 2009) Trend following strategies are based on the theory that asset prices from time to time move in the same direction for a period sufficiently long that a trader can identify this trend and ride it. The economic theory that supports the existence of trends is based on the understanding of consensusbuilding among market participants (Narang, 2009). An alternative explanation of the motive trends that happen is known as the greater fools’ theory. The idea is that, by the simple fact that traders believe in trend, they tend to start buying any asset whose price is going up and selling any asset whose price is going down, which itself perpetuates the trend (Narang, 2009). As trend followers tend to search for a meaningful move in a given direction in an instrument, one way to identify a trend for trading purposes, for instance, is to use a moving average crossover indicator. This tool compares the average price of the index over a shorter period (i.e., 50 days – the red line showed in figure 3) to that of a longer period (i.e., 200 days – the blue line shown in Figure 2.3.3) (Narang, 2009). When the shorter-term average price crosses downward the longer-term average price, the index is said to be in a negative trend. On the opposite way, when the shorterterm average price crosses upward the longer-term average, the index is in a positive trend. Figure 2.3.3 gives us examples of a few entries a trader could have used the average crossover strategy. 8 Figure 2.3.3– GBPUSD Daily Chart with Moving Averages (MA 50 & MA 200) Indicator Mean Reversion Traders practicing mean reversion strategies, also known as contrarians, believe that exists a center of gravity around which prices fluctuate. With this theory, a trader could identify both this center of gravity and the range around this center to warrant making a trade. One of the rationales behind this theory is that exists short-term imbalances among buyers and sellers due to liquidity (Narang, 2009). Because short-term oscillations occur around longer-term trend, trend and mean reversion strategies are not always at odds with other. Mean reversion traders, after identifying the current equilibrium point of the oscillation, must determine the amount of divergence from that equilibrium is enough to make a trade feasible (Narang, 2009). Statistical arbitrage, which bets on the convergence of the prices of similar assets whose prices have diverged, is probably the best example of a mean reversion strategy. Trend and mean reversion strategies, although they are theoretically opposite ideas, represent a large portion of all quantitative trading because they seem to work well in different timeframes. While trends occur in higher horizons, reversions tend to happen over short-term horizons (Narang, 2009). 2.3.1.2. Strategies Utilizing Fundamental Data Value/Yield Although this idea is used in other markets, value strategies, also known as earning yield, are usually associated with equity trading. The main idea of values strategies is that the higher the yield, the cheaper the instrument. Of the many metrics used to define value, price-to-earning (P/E) is one of the most common of them. To avoid division by zero, which could cause a dramatic error in the algorithm, quantitative traders, however, tend to invert the ratio, keeping prices in the denominator (Narang, 2009). One of the most popular value strategies among currencies quantitative traders is the carry trade strategy. The logic of this strategy is to purchase the currency of one country with higher short-term 9 yields against a short position in the currency of a country with relatively low short-term yields (Narang, 2009). Growth The goal of growth strategies is to search predictions based on an asset’s expected or historically observed level of economic growth. The gross domestic product (GDP) of a country or the earning growth of a company are good examples of that. The theory behind this idea is that, ceteris paribus, it is better to sell assets that are experiencing slow or negative growth or sell assets that are experiencing slow or negative growth (Narang, 2009). Quality Investors that pursue this quality strategy believe that, ceteris paribus, it is preferable to go long on assets that are of high quality to their portfolios and/or to go short on poor quality assets. The idea of this strategy is that, on one side, capital safety is important, and, on the other side, neither growth nor value strategies can identify this concept (Narang, 2009). 2.3.1.3. Data-Driven Alpha Models The premise of Data mining is that data will most predict price movement based on some patterns recognizable through analytical techniques. One advantage of this technique is when compared with theory-driven strategies, data mining is technically more challenging and far less widely practiced. Another advantage is that data-driven strategies can identify behaviors whether they have been identified before by some theory or not. This means that these models can see events without having to understand why they happen (Narang, 2009). Data-driven alpha models work better in short-term time horizons (i.e., minutes or less). This happens because, at this timescale, the quantity of data available can be so vast that the researcher has a better chance of finding statistically significant results in his testing (Narang, 2009). The quantitative trader willing to practice this strategy, however, should be aware of two shortcomings. The first one is that the researcher must carefully decide what data to feed the model. The amount of data searching the algorithms, if not chosen well, could be so enormous that a huge and expensive hardware structure would be necessary to predict anything in time to make the trade. The second problem is that the generation of alphas with the use of data-mining alone could lead to false signals that act like “traps for data miners.” (Narang, 2009). 10 Trend Reversion Yield Growth Quality Short Term Medium Term Long Term Intrinsic Relative Liquid Iliquid Phenomenon Time Horizon Bet Structure Instruments High Frequency Implementation Price Fundamental Alpha Input Return Category Figure 2.3.4– Taxonomy of Theory-Driven Models 2.3.2. Risk Models An attentive trader should not worry only about the avoidance of risk or reduction of loss. In addition to these goals, the intentional selection and sizing of exposures to improve the quality and consistency of returns are most essential for its survival in the financial markets. Risk exposures will most likely not produce profits over the long run; however, they can seriously undermine the returns of a strategy over time. Furthermore, any attempt to forecast these risk exposures should be avoided simply because they cannot be predicted successfully. What matters is the ability to understand and measure several exposures and to be intentional about the selection of such exposures (Narang, 2009). The author continues “… the key to understand risk exposures as they relate to quant trading strategies is that risk exposures are those that are not intentionally sought out by the nature of whatever forecast the quant is making in the alpha model.” (Narang, 2009, pp. 56) The idea is that alpha models and risk models should present opposite perspectives. For example, if alpha models present a high probability forecast, risk models would largely control the size of desirable exposures or deal with undesirable types of exposures (Narang, 2009) 11 Risk management involves some knowledge on the monetary amount the trader is willing to risk in addition to the amount it is aiming to profit. Without the sense of it, traders hold on losing positions longer than they should of close profitable positions too soon (Lien, 2015). The result, continues Lien, (2015), is that the trader ends up with a negative profit/loss relation (P/L), although he may have had more winning positions than losing positions. From the many types of risk models available, there are three main ways that a trader can have their approach in risk management. Authors, such as Basso (2019), Lien (2015), and Narang (2009), defend that position size limiting, risk-reward ratio, and stop-loss order represents a high degree of importance for risk management. Limiting the size or eliminating it can work as an alternative to just accepting a given type of exposure. The trader, now in the role of a risk manager, should determine which of these courses of action is appropriate for each kind of exposure and feed the risk model to assess if the trade is worth taking or not (Narang, 2009). How size is limited can be mainly approached by constraint or penalty forms. Hard constraints, as the name suggests, are set to establish a fixed position in terms of risk (Basso, 2019). For example, no position should be larger than 3% of the account balance, however, because the distance from the entry price to the stop-loss order price vary from trade to trade, the contract size of the position is adjusted so the risk does not increase. The penalty function work in a way that will allow a position to be greater than 3% but will impose heavier penalties to allow that. These penalties through research can be determined either from the data or from theory (Narang, 2009). Setting a risk-reward ratio to trading strategies is a powerful tool to keep a positive profit and loss ratio and to prevent traders from opening positions that ultimately are not worth the risk. It allows the strategy to have an exact amount of how much profit the trade should achieve against the amount risked opening the position (Lien, 2015). Thus, the risk-reward ratio varies from strategy to strategy, but as a ‘rule of thumb’, according to Lien (2015), it should be no less than 1:2. Finally, Stop-loss orders, alongside with risk size limiting and risk-reward ratio, are essencial to control your losses, in line with position risk size. Setting the limit to your losses avoids the common predicament of being in a scenario where strategies have a high probability of profitable trades but a loss large enough to give all the profit back to the market (Basso, 2019). Thus, the author suggests that it is a good habit to move the stop-loss order to the break-even level as soon as the position has profited by the same amount initially risked for the trade. She also points that some strategies choose to close a portion of the position once profit equals the amount risked. Managing risk daily basis not only can reduce the volatility of the return of a strategy, but also, and far more important, can reduce the likelihood of large losses. In many cases, the failures of some quantitative traders are directed associated with failures to manage risk (Narang, 2009). 2.3.3. Transaction Cost Models Narang describes a transaction cost model as “a way of quantifying the cost of making a trade of a given size so that this information can be used in conjunction with the alpha and risk models to 12 determine the best portfolio to hold.” The model will decide if the cost of opening a position is worth it or not. Furthermore, on one hand, if the cost of transacting is underestimated, the algorithm could be led to make too many trades that would have insufficient benefit. On the other hand, overestimating the cost of transacting could lead the algorithm to miss trading opportunities or to hold positions too long (Narang, 2009). Transaction cost models can be explained in two basic types: flat, linear, piecewise-linear, and quadratic. A flat transaction cost model means that the cost of trading is constant no matter the size of the order. A linear transaction cost model means that the cost grows on the same scale as that of the transaction size (Narang, 2009). 2.3.4. Portfolio Construction Models The decision to allocate assets in a portfolio is based on an equilibrium of considerations of expected return, risk, and transaction costs. Quantitative portfolio construction models are defined by a rulebased portfolio construction model, which is based on heuristics defined by the quantitative trader, and optimized portfolio construction models such as the Markowitz (1952) modern portfolio theory and the Tobin (1958) two-fund separation theorem, which utilizes step-by-step sets of rules designed to get the user from a starting point to the desired point (Narang, 2009). 2.4. FOREIGN EXCHANGE MARKETS The world’s financial markets are vast, in terms of both the size and diversity of products they incorporate. Generally speaking, the financial market can be broken down into four main categories, namely: i) capital markets; ii) foreign exchange markets; iii) money markets; and iv) derivative markets (Johnson, 2010). For the sake of simplicity, this work will focus its attention only on foreign exchange markets. Foreign exchange markets, at their most basic level, are over-the-counter markets with no central exchange and clearing house where orders are matched. Foreign exchange dealers and markets makers around the planet are linked to each other around the clock creating one cohesive market (Lien, 2015). As the largest and fasted markets in the world, foreign exchange markets allow traders to operate 24-hour per day, 6-days per week in a market with an average daily volume of transactions of $6,6 trillion U.S. dollars (Bank for International Settlement, 2019). Johnson (2010) gives us a sight of the potentiality of the forex markets when he states that “…it’s 24-hour nature offers traders instant access to the markets at all hours of the day for immediate response to global developments. Different times of the day will offer different trading opportunities, as the global financial centers around the world are all actively involved in foreign exchange “ (Lien, 2015, pp. 21 ). 13 As these markets became accessible to trade by individual retail investors around twenty years ago, and because they present such attractive characteristics, foreign exchange markets exploded in popularity (Lien, 2015). 2.5. POSITION SIZING AND RISK ALLOCATION The establishment of the volume of trade, along with the Buy/Sell Engine, which is the entry-level and the stop-loss size, and the maximum risk allocation for a trade, makes up the structural tripod for risk management in trading operations (Basso, 2019). Figure 2.5.1 – The trade Tripod Among different forms available of calculating it, Basso (2019) provides two popular techniques to calculate the volume for a single trade. The first one uses the monetary value of the risk of the trade has a divisor, which is the difference between the current bid/ask price and the stop-loss limit price stablished for that single trade – see formula (1). The second technique utilizes the Average True Range (ATR) indicator, which measures the volatility of a specific asset in a given period – see formula (2). (1) ( 2 ) Where, currentBalance is the monetary value of the equity in the account at the moment of the trade, riskPercentage is the current portfolio risk in percentage allocated to a single position, stopLoss is the monetary risk on the upcoming trade, and ATR is the average True Range indicator value. 14 Concerning risk allocation, there is no consensus in the literature for the definition of a fixed value corresponding to a maximum risk, in percentages, to allocate in a single trade. (Narang, 2009), suggests the amount of 3% of the current portfolio equity, allowing the automated system to raise the risk allocation to 5% if the alpha model emits a strong signal. Basso (2019), on the other hand, proposes that maximum risks could vary from 0.5% to 2% of the account balance, depending on the trader’s appetite for risk. 2.6. TECHNICAL INDICATORS Over time, although traders have been developing and using technical indicators to aid them in the prediction of price movements in the various markets, the topic has received significantly less attention in the literature (Neely et al., 2014). Technical indicators are heuristic or pattern-based signals that rely on past price, volume patterns, or/and open interest of an asset to identify price trends believed to persist into the future; see James (2021) and Neely et al. (2014) for recent surveys. 2.6.1. Moving Average Indicator As one of the first trading tools ever invented (Narang, 2009), and because of its simplicity and intuitive appeal (Guo et al., 2017), the moving average (MA) is one of the most popular technical indicators (Zhu & Zhou, 2009). The MA is a technical analysis tool that smooths out price data over a specific period by creating a constantly updated average price (Cory, 2021). The common moving average formula is given by (3) (4) Where MA is the moving average value, Pn is the price of an asset at period n-1, and n is the number of total periods. 2.6.2. Average Directional Index Indicator Created by (Wilder Jr., 1978), the Average Directional Index (ADX) is a trend-following technical analysis indicator that some traders use to determine the strength, or the magnitude, of a trend (Mitchell, 2021), but not the actual direction of the later. It is used together with an positive directional indicator (DI+) and a negative directional indicator (DI-), which identifies if there is a trend 15 (Gurrib, 2018). See formula (5). For a better understanding of the formula, see Wilder Jr. (1978) and Gurrib (2018, pp. 62-63). (5) (6) (7) (8) (9) (10) Where n is the period set to the ADX, DX is the directional index, DI(±) is the positive and negative directional indicator, DM(±) is the directional movements, and TR is the True Range indicator. 22 Figure 3.3.7 – Alpha Model Algorithm (lines 148 to 164) 3.3.2. The Risk Model Algorithm The risk model of our trading system has in its core the role to access risks to the potential trade and to set the attributes, i.e., the lot size and stop-loss price, that the execution model will use to fill the entry orders. Once the alpha model confirms the entry signal, the risk model function is then called to verify if the potential trade fulfills three basic conditions: i) it certifies that there are no open positions; ii) it verifies that the stop-loss price is valid, and iii) it calculates the volume, or lot size, for the potential trade. If these conditions are met, the Risk model will return ‘buy_order_approved’ value for long signals and ‘sell_order_approved’ value for short signals, and ‘tradeRejected’ if the Risk model rejects one of the conditions. In the first condition, the model certifies that there is no open position at the time the Alpha model triggers a buy or sell signal. This simple action is a measure to prevent the trading system to open multiple positions and do not overtrade, which could overleverage the account creating margin level risk which could ultimately lead the broker to close positions and jeopardize the account balance. Furthermore, because the strategy aims to identify a trend in its beginning (Lien, 2015) and it does not foresee additions to the first trade, the trading system should emit one signal per trend and hold one open position at a time. This simple verification also prevents the algorithm from opening additional trades from unexpected true-false signals. For instance, if the system already has an open long position and, for any unknown reason, the alpha model triggers a short signal, the risk model will reject this new signal. See Code 4.3.1.3 (Check for Open Positions below). 23 Figure 3.3.8 – Check for Open Positions Once the Risk model clears the first condition, the function sets the stop-loss limit price for the potential trade. The author states that the stop-loss for the entry is the lower price of the fiftieth bar of the alignment of the Moving Averages (Lien, 2015). During this process, the model reads the lower price of the fifth daily bar for a buy order and verifies if the stop-loss limit price is valid as shown in Figure 3.3.10 (Setting the Stop-loss Limit price for a long position algorithm). Figure 3.3.9 – Setting the Stop-loss Limit price for a long position algorithm There are several ways to check if the stop-loss condition is valid. One way to verify the validity of the condition is to confirm that the value attributed to the variable that holds the stop-loss price is higher than zero. A negative value will cause the broker to reject the order. Another way is to certify that the stop-loss price in a buying order is lower than the entry price and higher than the entry price in a selling order. In case the condition returns false, the Risk model rejects the trade. Finally, the third and last condition is where the Risk model evaluates the lot size for the trade. (Basso, 2019) provides a simple but powerful formula to assist us in this purpose. The formula, as shown in formula 5, is based on the risk in percentage that the trading system is allowed to take in a single trade. This mechanism allows the Risk model to adjust the volume size for a particular trade based on the current balance account at the time of that trade. The logic behind it is that, according to the author, in one hand, at the pace the automated system profits from the strategy and the account balance growth, the system updates the lot size for future trades to maintain the growth rate, and on the other hand, when the systems fail to take profits and loses money, the system than lower the risk it takes for the next trades to adjust to the reality of the smaller account balance (Basso, 2019). (5) To calculate the volume of the current trade the trading system makes use of three variables: i) the amount of money the system is allowed to risk in a single trade (moneyRisk), 24 ii) the size, or range, of the stop-loss in pips (SLpips), and iii) the value of a pip for a standard lot size at the moment of that specific trade (pipValue). The risk in the monetary unit is the product of the multiplication of the risk allowed per trade in percentage (riskSize%) and the current account balance (accountBalance). Thus, the risk in percentage is a constant value that the manager of the automated trading system previously set. Code 4.3.2.4 “Trade lot-sizing algorithm for a long position” shows how this is done in lines 203 and 204 of the algorithm. After evaluating the risk in monetary units for the trade, the system calculates the value of a pip and the stop-loss size through a set of simple rules (see-through lines 205 and 227 in Code 4.3.2.4). To calculate the value of a pip, the Risk model first needs to identify the currency pair that it is going to back-test. Because the currency of the account used in the back-testing is in the U.S. dollar, the value of a pip for one standard lot will be $10 for any currency pair that has the U.S. dollar as the quoted currency (Chen, 2021). For the currency pairs where the U.S dollar is the base, the value of a pip is $10 divided by the last ask quote, for longs, or the last bid quote, for shorts. In the case of pairs where the quoted currency is Japanese Yen (JPY), such as the USD/JPY pair, it is necessary to multiply the result of the division by 100 to adjust the value (see-through lines 206 and 218 in Code 4.3.2.4). Finally, the stop-loss in pips is the difference of entry price and the stop-loss price for long positions or the difference between the stop-loss price and the entry price for short positions. The system then multiplies this value for 10.000 for any currency pair other pair that has JPY as the quoted currency, which in this case the value is multiplied by 100 (see-through lines 220 and 227 in Code 4.3.2.4) 25 Figure 3.3.10 – Trade lot-sizing algorithm for a long position algorithm With the risk in monetary units, the stop-loss size, and the value of a pip values stored, the model will then use it to calculate the volume for the very next trade. Afterward, the risk model returns the type order approved string to the main function (see Figure 3.3.11 (Trade lot-sizing algorithm for a long position algorithm) which, in its turn, will call the Execution Model to proceed with the order execution. 3.3.3. The Execution Model Algorithm The function of the Execution model in our automated trading system is to fill the trading orders and send them to the broker to execute them. Once the Risk model approves the transaction, the model updates the last quote for the currency pair it is trading, adds to the order the stop-loss limit price that the strategy determined and the Risk model validated, and sends the order to the broker, which in his turn executes it. Figure 4.3.12 (Execution Model for a Buy Order Algorithm), through lines 292 and 315, shows how this is done if the system is executing a long order. With a position open and with the rule that the system will have one open trade per time, the automated system will enter in standby mode, and the Position Management mode will take over the system while the position is open. Figure 3.3.11 – Execution Model for a Buy Order Algorithm 26 3.3.4. The Position Management Algorithm Once the position is open, it will remain open until one of two conditions are met. The first condition is triggered when the forex pair quote hits the stop-loss limit order. In this case, the broker is responsible for closing the trade because it accepted the stop-loss limit order the Execution model filled at the trading order. The second condition follows a demand of the strategy. The author states that “the trade remains open until the conditions are no longer valid.” (Lien, 2015). By conditions no longer being valid we, understand that when the Moving Averages are no longer aligned. This alignment is lost when the MA(10) crosses downward the MA(20) in a long position or when the MA(10) crosses upward the MA(20) in a short position. The only function of the Position Management module is to verify, at every new daily candle, if the Moving Averages are aligned. This Module is an adaptation of the trading system that Narang (2009) suggested making viable the position management condition of the Strategy. Once this condition returns false, the module closes the trade at market price; see Figure 3.3.13 (Position Management Algorithm). Finally, with no open position being held, the automated trading system calls the Alpha Model to search the asset for a new trend and the cycle begins. Figure 3.3.12 – Position Management Algorithm 3.4. THE BACK-TESTING To execute the back-testing on the currency pairs detailed in section 4.2 of this chapter, the author of this work used the “Strategy Tester” function, or tool, available in MetaTrader 5 trading platform software. For each selected FX symbol, the tester executed the strategy with the following settings:  Strategy: Perfect Order Strategy  Period tested from January, 1st, 2005 to December, 31st, 2020  Timeframe: Daily  Delays: 40ms  Modeling: every tick  Initial Deposit: 100.000 USD 27  Leverage: 1:100 Figure 3.4.1 (Strategy Tester Settings for USD/CHF Back-testing) details all inputs used in the execution of the back-testing of the strategy. Once the execution is done, the tool generates a Log report where the Strategy tester tool reports every single event that occurred during the back-testing, both from the automated trading system and from the tool itself. We can look at it as the “back-end” part of the project where we can verify how the algorithm behaved during the tests. The complete log reports of every selected currency pair are available in attachments of this research. After the automated trading system finished the back-testing, the results are presented in Chapter 5 “Results and Discussion” where we examine and discuss several metrics and resulted from the backtesting. We split the analysis into three branches. In the first branch, we look at the data such as the number of bars and ticks available for the test and to the signals the Alpha Model has generated, in particular to the rejected signals and the motives that brought the trading system or rejected them. In the second branch, we examine the profit or loss of each trade, the size of risk (stop-loss size) the system took in each one of them, and the reward-risk ratio resulting from these trades. Finally, in the third branch, we go over the overall results of the back-testing. We look at performance metrics such as total net profit, gross profit and loss, balance absolute and relative drawdown, equity absolute and relative drawdown, position holding time, among other indicators. Figure 3.4.1 – Strategy Tester Settings for USD/CHF Back-testing At the end of Chapter 5, we analyze the combined overall results of back-tested symbols. On one side, we point to factors where the strategy showed strength and on the other side, we look at aspects and events where the strategy was weak and failed to profit. With this information in hand, we offer the reader particular insights into the Perfect Order strategy that could be useful to improve it through further research. 28 4. RESULTS AND DISCUSSION For the back-testing of the samples, we analyzed the performance of the Perfect Order Strategy in two distinct vectors. In the first vector, we go through the overall aspects of the signals, risk assessment, and execution. We investigate each signal that the Alpha models emitted, trying to understand the reasons that provoked the Risk model to reject some of these signals or trades that passed through all the assessments, yet the broker rejected them. Furthermore, we also inspected additional data such as stop-loss placement for both approved and rejected signals. The second vector explores the overall results that the strategy could deliver for each currency pair tested. We go through main metrics such as the gross profit, the gross loss, net return, and absolute and maximum drawdown from the account balance and equity perspective. Moreover, among other indicators, we look at the strategy’s win ratio, the holding time of the positions, and consecutive wins and losses. Lastly, before going through the back-testing results, as stated in the Methodology chapter, all seven currency pairs tested used daily data available from January 1st, 2005, to December 31st, 2020. The number of bars and ticks available for each sample may vary from pair to pair due to trading volume. Thus, in an attempt to maintain coherence and keep this text clean, the outputs of the back-testing are available in a separate electronic supplementary repository. The output of the back-testing for the GBP/USD pair, however, is available in Appendix A as an example for the reader. 4.1. BACK-TESTING GBP/USD For the pair GBP/USD, the automated trading system processed 4.436 daily bars, containing the open, the low, the high, and the close prices of each trading day, and a total of 250.559.363 ticks to back-test the strategy. During this period, the alpha model emitted 56 entry signals, of which 28 were signals to open buy positions and 28 were signals to open sell positions. From the total of entry signals that the strategy generated, the risk model rejected 24 of them (42,857%). Table 4.1.1 (GBP/USD List of signals emitted by the Alpha Model) shows each date the Alpha Model triggered an entry signal. The sole reason for these rejections was that the Risk model set price levels for the stop-loss limit order for these trades were above the entry price, in case of longs positions, and below the entry price, in case of shorts positions. Table 4.1.2 (GBP/USD Rejected Signals), and Figure 4.1.1 (GBP/USD Distance between Stop-loss Prices and Entry Prices of Rejected Trades) below details the rejected trades events with each entry price, stop-loss limit order prices, and distance between them. The range between the stop-loss price and entry price was 696 pips, varying from negative three pips and negative 699 pips, resulting in an average of 99,5 pips. i date signal status Commentary i date signal status Commentary 1 09/03/2005 buy approved 29 10/10/2013 buy rejected SL rejected 2 12/07/2005 sell approved 30 01/11/2013 buy rejected SL rejected 29 i date signal status Commentary i date signal status Commentary 3 18/11/2005 sell approved 31 05/12/2013 buy approved 4 25/05/2006 buy rejected SL rejected 32 06/01/2014 buy rejected SL rejected 5 09/08/2006 buy approved 33 03/02/2014 buy rejected SL rejected 6 08/09/2006 buy rejected SL rejected 34 25/02/2014 buy approved Invalid Volume 7 15/11/2006 buy rejected SL rejected 35 11/04/2014 buy approved 8 04/12/2006 buy approved 36 25/06/2014 buy approved 9 26/01/2007 buy rejected SL rejected 37 24/10/2014 buy approved 10 30/04/2007 buy rejected SL rejected 38 07/11/2014 sell approved 11 06/07/2007 buy approved 39 25/03/2015 sell approved 12 19/08/2008 sell approved 40 28/12/2015 sell approved 13 14/10/2008 sell approved 41 29/02/2016 sell approved 14 17/12/2008 sell rejected SL rejected 42 13/04/2016 sell rejected SL rejected 15 07/01/2009 sell rejected SL rejected 43 15/07/2016 sell rejected SL rejected 16 28/01/2009 sell rejected SL rejected 44 15/08/2016 sell approved 17 17/02/2009 sell rejected SL rejected 45 10/10/2016 sell approved 18 06/04/2009 sell rejected SL rejected 46 10/01/2017 sell approved 19 20/05/2009 sell approved 47 16/03/2017 sell rejected SL rejected 20 21/10/2010 buy rejected SL rejected 48 22/09/2017 buy approved 21 10/11/2010 buy rejected SL rejected 49 08/12/2017 buy approved 22 18/04/2011 buy approved 50 09/01/2018 buy approved 23 12/10/2011 sell rejected SL rejected 51 06/04/2018 buy rejected SL rejected 24 09/12/2011 sell approved 52 07/11/2018 sell rejected SL rejected 25 26/12/2011 sell rejected SL rejected 53 05/12/2018 sell approved 26 20/12/2012 buy approved 54 30/07/2019 sell approved 27 22/03/2013 sell approved 55 17/01/2020 buy approved 28 05/06/2013 sell rejected SL rejected 56 11/11/2020 buy approved Table 4.1.1 – GBP/USD Signals emitted by the Alpha Model Type EP SL Diff. Buy 1,8691 1,8791 -0,01000 Buy 1,8764 1,8956 -0,01920 Buy 1,8958 1,9005 -0,00470 Buy 1,9634 1,9694 -0,00600 Buy 1,9967 1,997 -0,00030 Sell 1,5577 1,4878 -0,06990 Sell 1,4905 1,4551 -0,03540 Sell 1,4152 1,4025 -0,01270 Sell 1,57839 1,57631 -0,00208 Sell 1,52658 1,50178 -0,02480 Buy 1,58395 1,58875 -0,00480 Buy 1,59809 1,60059 -0,00250 Sell 1,55901 1,54911 -0,00990 Sell 1,56266 1,55448 -0,00818 Sell 1,5315 1,51455 -0,01695 Buy 1,59529 1,6154 -0,02011 Buy 1,60434 1,61502 -0,01068 30 Type EP SL Diff. Buy 1,64128 1,64597 -0,00469 Buy 1,64305 1,64743 -0,00438 Sell 1,42722 1,41707 -0,01015 Sell 1,33384 1,30177 -0,03207 Sell 1,22862 1,2195 -0,00912 Buy 1,40016 1,40119 -0,00103 Sell 1,3095 1,283 -0,02650 Table 4.1.2 – GBP/USD Distance between Stop-loss Prices and Entry Prices of Rejected Trades Figure 4.1.1– GBP/USD Range between Stop-loss Prices and Entry Prices of Rejected Signals Excluded the trades in which the stop-loss limit order prices were invalid, the risk model approved 32 entry signals or 57,143% of the total signal that the strategy generated. However, because the maximum lot size allowed by the broker is 50 contracts per trade and because the risk model calculated a volume of 351,11 contracts for this particular trade, the broker rejected the trading order that the execution model filled on February 25th, 2014 We remind that the position size of a trade is the ratio between the maximum monetary risk allowed by the trading system per trade and the product of the pip value of that currency pair and the difference between the distance of the stop-loss limit order price and entry price for that particular trade, in the decimal form3. Based on data displayed in Table 4.1.3 (GBP/USD Position Risk-Reward ratio (in pips)) below, which measures the ratio of the trading result by the risk taken in pip size for that trade, we can observe that the highest risk-reward earned was 10,99 earned per monetary unit risked, and the lowest was of negative 1,04. The average risk-reward ratio of this back-test sample was 0,24. It means that for every 1 point risked in a single trade; the automated trading system managed to profit, on average, 0,243 cents. 3 See formula 1 in Item 2.6. “Position Sizing And Risk Allocation” 31 Type P&L SL Size RR Type P&L SL Size RR buy - 226,30 223,00 - 1,01 sell - 97,70 97,60 - 1,00 sell - 46,00 46,00 - 1,00 sell 604,10 176,70 3,42 sell - 253,80 253,00 - 1,00 sell - 216,20 321,00 - 0,67 buy - 192,00 335,00 - 0,57 sell 309,40 48,70 6,35 buy - 256,00 530,00 - 0,48 sell - 450,20 450,20 - 1,00 buy 194,00 108,00 1,80 sell - 176,50 176,50 - 1,00 sell 82,00 506,00 0,16 sell - 66,20 551,30 - 0,12 sell 2 726,00 248,00 10,99 sell - 149,50 149,40 - 1,00 sell - 5,00 466,00 - 0,01 buy - 206,20 206,00 - 1,00 buy - 12,10 11,80 - 1,03 buy - 33,00 33,00 - 1,00 sell - 101,60 101,50 - 1,00 buy - 83,60 82,70 - 1,01 buy - 167,20 166,90 - 1,00 sell 101,00 135,70 0,74 sell - 5,00 4,80 - 1,04 sell - 6,10 265,90 - 0,02 buy - 102,70 102,60 - 1,00 buy - 41,10 41,10 - 1,00 buy 54,00 230,20 0,23 buy 350,70 359,40 0,98 buy 54,10 64,80 0,83 Table 4.1.3 – GBP/USD Position Reward-Risk ratio (in pips) The strategy delivered a total of 4.475,3 pips in profits and lost 2.894 pips over the period tested. The trade that returned the highest loss was 450,2 pips, and the trade with the highest return was 2.726 pips. The data presents an average of pips earned per trade was of 51,01 and a standard deviation of 527,71. Moreover, the back-test for GBP/USD showed that from the 31 orders the execution model filled and executed, the stop-loss sizes vary from 4,8 pips to 551,3 pips. The stop-loss size samples present a mean of 209,45 pips, a standard deviation of 161,8 pips, and a range of 546,5 pips. Figure 4.1.2 – GBP/USD Position Information (in pips) According to data, the strategy generated 51.968,07$ in gains and 39.852,1$ in losses, resulting in a net profit of 12.115 $, or a 12,12% return over the initial trading capital. The absolute balance drawdown of the account was 7.896,38$, or 7,896%, while the absolute equity drawdown was 8.922,38$ or 8.922%. Moreover, the simulation reached the maximal balance drawdown of 38 Time Deal Symbol Type Direction Volume Price Order Commission Swap Profit Balance 2006.12.11 03:09:29 7 EURUSD sell out 1,37 1,31392 7 0,00 0,00 -1 956,36 95 348,84 2007.03.02 00:00:00 8 EURUSD buy in 2,41 1,31800 8 0,00 0,00 0,00 95 348,84 2007.03.05 12:33:59 9 EURUSD sell out 2,41 1,31010 9 0,00 0,00 -1 903,90 93 444,94 2007.03.23 00:00:30 10 EURUSD buy in 2,12 1,33260 10 0,00 0,00 0,00 93 444,94 2007.05.11 00:00:00 11 EURUSD sell out 2,12 1,34770 11 0,00 0,00 3 201,20 96 646,14 2007.07.17 00:00:00 12 EURUSD buy in 1,06 1,37770 12 0,00 0,00 0,00 96 646,14 2007.08.03 00:00:00 13 EURUSD sell out 1,06 1,37010 13 0,00 0,00 - 805,60 95 840,54 2007.09.25 00:00:30 14 EURUSD buy in 0,76 1,40810 14 0,00 0,00 0,00 95 840,54 2007.12.11 00:01:00 15 EURUSD sell out 0,76 1,47200 15 0,00 0,00 4 856,40 100 696,94 2008.03.03 00:04:00 16 EURUSD buy in 0,48 1,52140 16 0,00 0,00 0,00 100 696,94 2008.05.01 00:01:30 17 EURUSD sell out 0,48 1,56190 17 0,00 0,00 1 944,00 102 640,94 2008.10.13 00:00:30 18 EURUSD sell in 1,92 1,35710 18 0,00 0,00 0,00 102 640,94 2008.10.13 15:05:52 19 EURUSD buy out 1,92 1,36781 19 0,00 0,00 -2 056,32 100 584,62 2009.02.05 00:00:00 20 EURUSD sell in 0,59 1,28340 20 0,00 0,00 0,00 100 584,62 2009.03.17 00:01:00 21 EURUSD buy out 0,59 1,29720 21 0,00 0,00 - 814,20 99 770,42 2009.07.27 00:00:00 22 EURUSD buy in 1,63 1,42317 22 0,00 0,00 0,00 99 770,42 2009.07.29 13:30:14 23 EURUSD sell out 1,63 1,41090 23 0,00 0,00 -2 000,01 97 770,41 2009.10.20 00:00:00 24 EURUSD buy in 0,95 1,49662 24 0,00 0,00 0,00 97 770,41 2009.10.28 12:30:27 25 EURUSD sell out 0,95 1,47605 25 0,00 0,00 -1 954,15 95 816,26 2010.05.04 00:00:00 26 EURUSD sell in 0,85 1,31884 26 0,00 0,00 0,00 95 816,26 2010.06.22 00:00:00 27 EURUSD buy out 0,85 1,23255 27 0,00 0,00 7 334,65 103 150,91 2012.05.31 00:00:00 28 EURUSD sell in 0,82 1,23676 28 0,00 0,00 0,00 103 150,91 2012.06.07 15:25:25 29 EURUSD buy out 0,82 1,26188 29 0,00 0,00 -2 059,84 101 091,07 2012.07.10 00:00:00 30 EURUSD sell in 0,65 1,23135 30 0,00 0,00 0,00 101 091,07 2012.08.07 00:00:00 31 EURUSD buy out 0,65 1,23991 31 0,00 0,00 - 556,40 100 534,67 2012.12.21 00:00:00 32 EURUSD buy in 1,11 1,32474 32 0,00 0,00 0,00 100 534,67 2013.01.03 20:08:15 33 EURUSD sell out 1,11 1,30656 33 0,00 0,00 -2 017,98 98 516,69 2013.01.24 00:00:00 34 EURUSD buy in 4,74 1,33112 34 0,00 0,00 0,00 98 516,69 2013.02.18 00:00:00 35 EURUSD sell out 4,74 1,33484 35 0,00 0,00 1 763,28 100 279,97 2013.09.25 00:00:00 36 EURUSD buy in 1,51 1,34710 36 0,00 0,00 0,00 100 279,97 2013.11.07 14:30:35 37 EURUSD sell out 1,51 1,33376 37 0,00 0,00 -2 014,34 98 265,63 2014.08.18 00:00:00 38 EURUSD sell in 11,63 1,33913 38 0,00 0,00 0,00 98 265,63 2014.10.20 00:00:00 39 EURUSD buy out 11,63 1,27561 39 0,00 0,00 73 873,76 172 139,39 2014.11.06 00:00:00 40 EURUSD sell in 2,1 1,24746 40 0,00 0,00 0,00 172 139,39 2014.11.27 00:00:00 41 EURUSD buy out 2,1 1,25077 41 0,00 0,00 - 695,10 171 444,29 2015.03.05 00:01:00 42 EURUSD sell in 1,14 1,10772 42 0,00 0,00 0,00 171 444,29 2015.03.31 00:00:00 43 EURUSD buy out 1,14 1,08336 43 0,00 0,00 2 777,04 174 221,33 2016.11.23 00:00:00 44 EURUSD sell in 2,54 1,06220 44 0,00 0,00 0,00 174 221,33 2016.12.05 19:51:29 45 EURUSD buy out 2,54 1,07592 45 0,00 0,00 -3 484,88 170 736,45 2016.12.23 00:00:00 46 EURUSD sell in 8,29 1,04326 46 0,00 0,00 0,00 170 736,45 2016.12.23 23:59:59 47 EURUSD buy out 8,29 1,04755 47 0,00 0,00 -3 556,41 167 180,04 2017.03.10 00:00:00 48 EURUSD sell in 6,7 1,05737 48 0,00 0,00 0,00 167 180,04 2017.03.10 15:31:54 49 EURUSD buy out 6,7 1,06236 49 0,00 0,00 -3 343,30 163 836,74 2018.01.22 00:00:00 50 EURUSD buy in 3,84 1,22728 50 0,00 0,00 0,00 163 836,74 2018.02.16 00:00:00 51 EURUSD sell out 3,84 1,25062 51 0,00 0,00 8 962,56 172 799,30 2018.08.13 00:01:00 52 EURUSD sell in 1,73 1,13714 52 0,00 0,00 0,00 172 799,30 2018.08.21 19:56:05 53 EURUSD buy out 1,73 1,15716 53 0,00 0,00 -3 463,46 169 335,84 2018.10.26 00:00:00 54 EURUSD sell in 2,1 1,13731 54 0,00 0,00 0,00 169 335,84 2018.11.28 00:01:30 55 EURUSD buy out 2,1 1,12945 55 0,00 0,00 1 650,60 170 986,44 2019.05.16 00:00:00 56 EURUSD sell in 6,72 1,12005 56 0,00 0,00 0,00 170 986,44 2019.06.03 00:00:02 57 EURUSD buy out 6,72 1,12661 57 0,00 0,00 -4 408,32 166 578,12 2019.08.01 00:00:00 58 EURUSD sell in 2,98 1,10686 58 0,00 0,00 0,00 166 578,12 2019.08.05 00:00:01 59 EURUSD buy out 2,98 1,11870 59 0,00 0,00 -3 528,32 163 049,80 2019.08.28 00:00:00 60 EURUSD sell in 18,74 1,10893 60 0,00 0,00 0,00 163 049,80 2019.09.13 00:00:02 61 EURUSD buy out 18,74 1,11136 61 0,00 0,00 -4 553,82 158 495,98 2019.10.03 00:00:00 62 EURUSD sell in 46,62 1,09588 62 0,00 0,00 0,00 158 495,98 2019.10.03 00:00:01 63 EURUSD buy out 46,62 1,09666 63 0,00 0,00 -3 636,36 154 859,62 2020.07.22 00:00:00 64 EURUSD buy in 2,23 1,15277 64 0,00 0,00 0,00 154 859,62 2020.09.14 00:00:00 65 EURUSD sell out 2,23 1,18338 65 0,00 0,00 6 826,03 161 685,65 2020.11.20 00:00:00 66 EURUSD buy in 4,09 1,18757 66 0,00 0,00 0,00 161 685,65 2020.12.30 23:59:59 67 EURUSD sell out 4,09 1,22939 67 0,00 0,00 17 104,38 178 790,03 39 Table 4.2.4 – EUR/USD Transactions Report 4.3. BACK-TESTING AUD/USD For the back-testing of EUR/USD pair, the trading system processed 4.144 daily bars, containing the open, the low, the high, and the close prices of each trading day, and a total of 208.478.112 ticks. During this period, the alpha model emitted 60 entry signals, of which 30 signals were to open buy positions and 30 signals were to open sell positions. From the total of signals that the model triggered, the risk model rejected 20 of them or 33,3% of the total, and the broker rejected two trades due to the stop-loss size being higher than the limit authorized – i.e., on 2013/08/08, a trade filled with 1904,4 contracts, and on 2019/05/13 a trade filled with 51,47 contracts. Table 4.3.1 (AUD/USD Signals Triggered by the Alpha Model) details the dates each signal was triggered. It also shows if the risk model accepted or rejected the signals and the reasons for it. i date signal status Commentary i date signal status Commentary 1 26/10/2005 sell rejected SL rejected 31 13/05/2013 sell approved 2 31/03/2006 sell rejected SL rejected 32 08/08/2013 sell approved Invalid Volume 3 01/08/2006 buy approved 33 05/09/2013 sell rejected SL rejected 4 12/09/2006 buy rejected SL rejected 34 27/01/2014 sell approved 5 08/11/2006 buy rejected SL rejected 35 26/06/2014 buy approved 6 04/12/2006 buy approved 36 13/11/2014 sell rejected SL rejected 7 08/01/2007 buy rejected SL rejected 37 02/02/2015 sell approved 8 27/03/2007 buy approved 38 17/03/2015 sell approved 9 13/06/2007 buy approved 39 14/04/2015 sell approved 10 31/10/2007 buy approved 40 21/07/2015 sell approved 11 07/03/2008 buy rejected SL rejected 41 31/08/2015 sell approved 12 25/04/2008 buy approved 42 08/10/2015 sell rejected SL rejected 13 04/07/2008 buy approved 43 12/04/2016 buy approved 14 13/10/2008 sell approved 44 17/08/2016 buy approved 15 25/11/2008 sell approved 45 26/07/2017 buy approved 16 09/02/2009 sell rejected SL rejected 46 08/02/2018 buy rejected SL rejected 17 17/06/2009 buy rejected SL rejected 47 03/05/2018 sell approved 18 29/07/2009 buy approved 48 25/06/2018 sell approved 19 20/11/2009 buy rejected SL rejected 49 15/08/2018 sell approved 20 22/04/2009 buy rejected SL rejected 50 12/10/2018 sell rejected SL rejected 21 11/06/2010 sell rejected SL rejected 51 04/01/2019 sell approved 22 25/10/2010 buy approved 52 13/03/2019 sell approved 23 10/11/2010 buy approved 53 13/05/2019 sell approved Invalid Volume 24 03/01/2011 buy approved 54 26/06/2019 sell rejected SL rejected 25 08/02/2011 buy approved 55 12/08/2019 sell approved 26 06/04/2011 buy approved 56 16/10/2019 sell rejected SL rejected 27 07/12/2011 sell approved 57 02/03/2020 sell approved 28 28/12/2011 sell approved 58 19/08/2020 buy approved 29 27/12/2012 buy rejected SL rejected 59 24/11/2020 buy rejected SL rejected 30 17/01/2013 buy approved 60 10/12/2020 buy approved 40 Table 4.3.1– AUD/USD Signals Triggered by the Alpha Model Table 4.3.2 (AUD/USD Stop-loss Placement of the Rejected Trades) details the rejected trades events with each entry price, the stop-loss limit order prices, and the distance between them. The main reason for these rejections, as seen in table 4.3.1, was that the prices that the strategy set for the stop-loss limit order for these trades were above entry price, in case of longs positions, and below the entry price in case of short positions. The range between the stop-loss price and entry price was 354 pips, varying from 0 pip and negative 354 pips, with a mean at 43,1 pips. See Graph 4.3.1 (Distribution of AUD/USD Distance between Stop-loss Prices and Entry Prices of Rejected Trades). Type EP SL Diff. Sell 0,7564 0,7515 -0,0049 Sell 0,7146 0,7136 -0,001 Buy 0,7514 0,7683 -0,0169 Buy 0,7729 0,7729 0 Buy 0,7792 0,7852 -0,006 Buy 0,9268 0,9303 -0,0035 Sell 0,672 0,6366 -0,0354 Buy 0,79233 0,79666 -0,00433 Buy 0,91941 0,92342 -0,00401 Buy 0,92688 0,93101 -0,00413 Sell 0,84845 0,8476 -0,00085 Buy 1,0374 1,04722 -0,00982 Sell 0,91623 0,89783 -0,0184 Sell 0,8709 0,86268 -0,00822 Sell 0,72047 0,70844 -0,01203 Buy 0,78247 0,79874 -0,01627 Sell 0,71213 0,70864 -0,00349 Sell 0,69514 0,69085 -0,00429 Sell 0,67516 0,67491 -0,00025 Buy 0,72871 0,72882 -0,00011 Table 4.3.2– AUD/USD Distance between Stop-loss Prices and Entry Prices of Rejected Trades 41 Figure 4.3.1 – AUD/USD Distance between Stop-loss Prices and Entry Prices of Rejected Trades From Table 4.3.3 (AUD/USD Position Risk-Reward ratio (in pips)) below, one can observe that the highest risk-reward earned was 4,96 earned per monetary unit risked, and the lowest was negative 1.02. The automated trading system lost, on average, 0.29 points for every 1 point risked in a single trade. Type P&L SL Size RR Type P&L SL Size RR sell -29 139 - 0,21 buy -131,4 131,4 -1,00 sell -68 147 - 0,46 sell -13 13 -1,00 sell 108 140 0,77 buy -130,8 178,2 -0,73 sell -37 37 - 1,00 buy -67,2 66,1 -1,02 sell -268,7 268 - 1,00 buy -122,2 122,1 -1,00 sell 88 121 0,73 buy 4,1 110 0,04 sell -60,1 60 - 1,00 buy -39,2 160,7 -0,24 buy 71 925 0,08 sell -87,9 87,8 -1,00 buy -26,1 26 - 1,00 sell -36,4 36,4 -1,00 sell 111,6 167 0,67 sell -31,9 31,8 -1,00 sell -51,2 50,5 - 1,01 buy -97,2 97,2 -1,00 sell -128,9 128,9 - 1,00 buy -16 15,9 -1,01 sell -239,3 239,3 - 1,00 buy -15 199,5 -0,08 sell -172,9 172,8 - 1,00 buy -75,9 75,9 -1,00 sell 243,5 55,2 4,41 buy -11,9 11,9 -1,00 buy -54 89,5 - 0,60 buy -23 23 -1,00 buy -75,4 75,3 - 1,00 buy -155,6 154,8 -1,01 sell -72,9 72,8 - 1,00 sell 43,4 134,1 0,32 buy 762 299 2,55 sell 238,9 48,2 4,96 Table 4.3.3– AUD/USD Position Risk-Reward ratio (in pips) The strategy delivered a total of 1.670,5 pips in profits and 2.338,1 pips in losses over the period tested, resulting in a net return of negative 667,6 pips. The trade that returned the highest loss was 42 268.7 pips, and the trade with the highest return was 762 pips. The average of pips lost per trade was 17,568 and a standard deviation of 164,95 pips. Moreover, the back-test for AUD/USD showed that from the 40 orders the execution model filled and executed, the stop-loss sizes vary from 11.9 pips to 925 pips. The stop-loss size samples present a mean of 103.6 pips, a standard deviation of 148.3 pips, and a range of 913.1 pips. See Figure 4.3.2 (AUD/USD Position Information (in pips)). Figure 4.3.2 – AUD/USD Position Information (in pips) The strategy generated 24.408,27 $ in gains and 45.047,71 $ in losses, resulting in a net loss of 20.639,44 $ or a negative 20,6% return over the initial trading capital. The absolute balance drawdown of the account was 28.270,82 $, or 28,3%, while the absolute equity drawdown was 29,421,07 $ or 29,4%. Moreover, the simulation reached the maximal balance drawdown of 28.458,02 $ or 28,4%, and a maximal equity drawdown of 41.081,91 or 36,8%. The information is available on Figure 4.3.3 (AUD/USD Balance and Equity Evolution) below. Table 4.3.4 (AUD/USD Transactions Report) below details each transaction the trading system accomplished during the test. Of the 38 trades that the algorithm executed, 20 trades were longs, and 18 were shorts. However, nine trades resulted in profits, and the remaining 29 trades resulted in losses. From these losses, the stop-loss limit order that the risk module set closed 19 trades, and the position management module closed prematurely six trades due to the trend condition no longer being valid. This result shows that the strategy had a win ratio over the back-testing period of 23,7%. 43 Figure 4.3.3– AUD/USD Balance and Equity Evolution The maximal holding time of a position was of 1.224 hours, while the trade with the minimal holding duration of 4:15:29. The average duration of the trades was 258:26:17. The largest loss in trade was 2.005,4 $, with an average loss of 1.553,37$. The most considerable profit taken in trade was 7.743,3$, with an average profit of 2.712,03$. Finally, the number of consecutive trades with profit in the test was 2, totalizing 7.631.38$, and the number of consecutive losses was 11, totalizing negative 14.832,05$. See Appendix C of the supplementary electronic repository of this work for the complete output of the back-testing. Time Deal Symbol Type Direction Volume Price Order Commission Swap Profit Balance 2005.01.01 00:00:00 1 balance 0,00 0,00 100 000,00 100 000,00 2006.08.01 00:02:00 2 AUDUSD buy in 1.44 0,76570 2 0,00 0,00 0,00 100 000,00 2006.08.24 00:01:00 3 AUDUSD sell out 1.44 0,76280 3 0,00 0,00 - 417,60 99 582,40 2006.12.04 00:00:00 4 AUDUSD buy in 1.35 0,79080 4 0,00 0,00 0,00 99 582,40 2006.12.22 00:00:00 5 AUDUSD sell out 1.35 0,78400 5 0,00 0,00 - 918,00 98 664,40 2007.03.27 00:02:30 6 AUDUSD buy in 1.41 0,81020 6 0,00 0,00 0,00 98 664,40 2007.05.07 00:00:30 7 AUDUSD sell out 1.41 0,82100 7 0,00 0,00 1 522,80 100 187,20 2007.06.13 00:04:30 8 AUDUSD buy in 5.42 0,84050 8 0,00 0,00 0,00 100 187,20 2007.06.13 11:59:59 9 AUDUSD sell out 5.42 0,83680 9 0,00 0,00 -2 005,40 98 181,80 2007.10.31 00:00:00 10 AUDUSD buy in 0.73 0,92030 10 0,00 0,00 0,00 98 181,80 2007.11.12 04:37:32 11 AUDUSD sell out 0.73 0,89343 11 0,00 0,00 -1 961,51 96 220,29 2008.04.25 00:00:30 12 AUDUSD buy in 1.59 0,93920 12 0,00 0,00 0,00 96 220,29 2008.06.12 00:01:30 13 AUDUSD sell out 1.59 0,94800 13 0,00 0,00 1 399,20 97 619,49 2008.07.04 00:09:00 14 AUDUSD buy in 3.25 0,96010 14 0,00 0,00 0,00 97 619,49 2008.07.07 15:18:34 15 AUDUSD sell out 3.25 0,95409 15 0,00 0,00 -1 953,25 95 666,24 2008.10.13 00:00:00 16 AUDUSD sell in 0.21 0,67940 16 0,00 0,00 0,00 95 666,24 2008.11.11 00:00:30 17 AUDUSD buy out 0.21 0,67230 17 0,00 0,00 149,10 95 815,34 2008.11.25 00:00:30 18 AUDUSD sell in 7.37 0,65500 18 0,00 0,00 0,00 95 815,34 2008.11.25 15:14:49 19 AUDUSD buy out 7.37 0,65761 19 0,00 0,00 -1 923,57 93 891,77 2009.07.29 00:00:00 20 AUDUSD buy in 1.12 0,82659 20 0,00 0,00 0,00 93 891,77 2009.08.24 00:00:00 21 AUDUSD sell out 1.12 0,83775 21 0,00 0,00 1 249,92 95 141,69 2010.10.25 00:00:00 22 AUDUSD buy in 3.77 0,98509 22 0,00 0,00 0,00 95 141,69 2010.10.27 02:30:38 23 AUDUSD sell out 3.77 0,97997 23 0,00 0,00 -1 930,24 93 211,45 2010.11.10 00:00:00 24 AUDUSD buy in 1.45 1,00257 24 0,00 0,00 0,00 93 211,45 2010.11.12 07:04:38 25 AUDUSD sell out 1.45 0,98968 25 0,00 0,00 -1 869,05 91 342,40 2011.01.03 00:00:00 26 AUDUSD buy in 0.76 1,02260 26 0,00 0,00 0,00 91 342,40 44 Time Deal Symbol Type Direction Volume Price Order Commission Swap Profit Balance 2011.01.05 13:51:36 27 AUDUSD sell out 0.76 0,99867 27 0,00 0,00 -1 818,68 89 523,72 2011.02.08 00:00:00 28 AUDUSD buy in 1.04 1,01365 28 0,00 0,00 0,00 89 523,72 2011.02.11 12:02:14 29 AUDUSD sell out 1.04 0,99636 29 0,00 0,00 -1 798,16 87 725,56 2011.04.06 00:00:00 30 AUDUSD buy in 3.18 1,03236 30 0,00 0,00 0,00 87 725,56 2011.05.16 00:00:00 31 AUDUSD sell out 3.18 1,05671 31 0,00 0,00 7 743,30 95 468,86 2011.12.07 00:00:00 32 AUDUSD sell in 2.13 1,02375 32 0,00 0,00 0,00 95 468,86 2011.12.08 00:00:00 33 AUDUSD buy out 2.13 1,02915 33 0,00 0,00 -1 150,20 94 318,66 2011.12.28 00:00:00 34 AUDUSD sell in 2.51 1,01430 34 0,00 0,00 0,00 94 318,66 2011.12.30 16:51:35 35 AUDUSD buy out 2.51 1,02184 35 0,00 0,00 -1 892,54 92 426,12 2013.01.17 00:00:00 36 AUDUSD buy in 2.54 1,05655 36 0,00 0,00 0,00 92 426,12 2013.01.18 11:25:24 37 AUDUSD sell out 2.54 1,04926 37 0,00 0,00 -1 851,66 90 574,46 2013.05.13 00:00:00 38 AUDUSD sell in 0.61 1,00073 38 0,00 0,00 0,00 90 574,46 2013.07.23 00:00:00 39 AUDUSD buy out 0.61 0,92453 39 0,00 0,00 4 648,20 95 222,66 2014.01.27 00:00:00 40 AUDUSD sell in 1.45 0,86932 40 0,00 0,00 0,00 95 222,66 2014.01.29 02:06:38 41 AUDUSD buy out 1.45 0,88246 41 0,00 0,00 -1 905,30 93 317,36 2014.06.26 00:00:00 42 AUDUSD buy in 14.36 0,94031 42 0,00 0,00 0,00 93 317,36 2014.06.30 14:19:16 43 AUDUSD sell out 14.36 0,93901 43 0,00 0,00 -1 866,80 91 450,56 2015.02.02 00:00:30 44 AUDUSD sell in 1.03 0,77545 44 0,00 0,00 0,00 91 450,56 2015.02.26 00:00:00 45 AUDUSD buy out 1.03 0,78853 45 0,00 0,00 -1 347,24 90 103,32 2015.03.17 00:00:00 46 AUDUSD sell in 2.73 0,76405 46 0,00 0,00 0,00 90 103,32 2015.03.18 20:00:42 47 AUDUSD buy out 2.73 0,77077 47 0,00 0,00 -1 834,56 88 268,76 2015.04.14 00:00:00 48 AUDUSD sell in 1.45 0,75883 48 0,00 0,00 0,00 88 268,76 2015.04.16 03:16:30 49 AUDUSD buy out 1.45 0,77105 49 0,00 0,00 -1 771,90 86 496,86 2015.07.21 00:00:00 50 AUDUSD sell in 1.57 0,73680 50 0,00 0,00 0,00 86 496,86 2015.08.14 00:00:30 51 AUDUSD buy out 1.57 0,73639 51 0,00 0,00 64,37 86 561,23 2015.08.31 00:01:00 52 AUDUSD sell in 1.08 0,71504 52 0,00 0,00 0,00 86 561,23 2015.09.21 00:01:30 53 AUDUSD buy out 1.08 0,71896 53 0,00 0,00 - 423,36 86 137,87 2016.04.12 00:00:00 54 AUDUSD buy in 1.96 0,75974 54 0,00 0,00 0,00 86 137,87 2016.05.03 17:06:41 55 AUDUSD sell out 1.96 0,75095 55 0,00 0,00 -1 722,84 84 415,03 2016.08.17 00:00:00 56 AUDUSD buy in 4.64 0,76976 56 0,00 0,00 0,00 84 415,03 2016.08.17 08:20:40 57 AUDUSD sell out 4.64 0,76612 57 0,00 0,00 -1 688,96 82 726,07 2017.07.26 00:14:30 58 AUDUSD buy in 5.2 0,79405 58 0,00 0,00 0,00 82 726,07 2017.07.26 04:29:59 59 AUDUSD sell out 5.2 0,79086 59 0,00 0,00 -1 658,80 81 067,27 2018.05.03 00:00:00 60 AUDUSD sell in 1.67 0,74916 60 0,00 0,00 0,00 81 067,27 2018.05.22 03:37:59 61 AUDUSD buy out 1.67 0,75888 61 0,00 0,00 -1 623,24 79 444,03 2018.06.25 00:02:30 62 AUDUSD sell in 9.99 0,74384 62 0,00 0,00 0,00 79 444,03 2018.07.09 04:34:36 63 AUDUSD buy out 9.99 0,74544 63 0,00 0,00 -1 598,40 77 845,63 2018.08.15 00:00:00 64 AUDUSD sell in 0.78 0,72390 64 0,00 0,00 0,00 77 845,63 2018.09.25 00:00:30 65 AUDUSD buy out 0.78 0,72540 65 0,00 0,00 - 117,00 77 728,63 2019.01.04 00:02:30 66 AUDUSD sell in 2.05 0,70017 66 0,00 0,00 0,00 77 728,63 2019.01.04 17:25:42 67 AUDUSD buy out 2.05 0,70776 67 0,00 0,00 -1 555,95 76 172,68 2019.03.13 00:01:30 68 AUDUSD sell in 12.8 0,70801 68 0,00 0,00 0,00 76 172,68 2019.03.13 21:58:05 69 AUDUSD buy out 12.8 0,70920 69 0,00 0,00 -1 523,20 74 649,48 2019.08.12 00:00:00 70 AUDUSD sell in 6.27 0,67803 70 0,00 0,00 0,00 74 649,48 2019.08.13 00:00:01 71 AUDUSD buy out 6.27 0,68033 71 0,00 0,00 -1 442,10 73 207,38 2020.03.02 00:00:00 72 AUDUSD sell in 0.95 0,64643 72 0,00 0,00 0,00 73 207,38 2020.03.03 17:00:05 73 AUDUSD buy out 0.95 0,66199 73 0,00 0,00 -1 478,20 71 729,18 2020.08.19 00:00:00 74 AUDUSD buy in 1.07 0,72424 74 0,00 0,00 0,00 71 729,18 2020.09.21 00:00:30 75 AUDUSD sell out 1.07 0,72858 75 0,00 0,00 464,38 72 193,56 2020.12.10 00:00:00 76 AUDUSD buy in 3 0,74454 76 0,00 0,00 0,00 72 193,56 2020.12.30 23:59:59 77 AUDUSD sell out 3 0,76843 77 0,00 0,00 7 167,00 79 360,56 Table 4.3.4– AUD/USD Transactions Report 45 4.4. BACK-TESTING NZD/USD For the strategy test on the NZD/USD pair, the trading system processed 4.143 daily bars, containing the open, the low, the high, and the close prices of each trading day, and a total of 173.714.967 ticks. During this period, the alpha model emitted 62 entry signals, of which 36 signals were to open buy positions and 26 signals were to open sell positions. From the total of signals that the model triggered, the risk model rejected 22 of them or 35,53% over the total, and the broker rejected two trades due to the stop-loss size being higher than the limit authorized. On January 18th, 2013, an order was filled with 50,72 contracts, and on September 7th, 2020, an order was filled with 273,6 contracts. Notwithstanding, the automated trade system was able to fill and execute 38 trades. Table 4.4.1 (NZD/USD Signals Triggered by the Alpha Model) details the dates each signal was triggered. It also shows the trades the Risk model accepted or rejected and the reasons for it. i date signal status Commentary i date signal status Commentary 1 04/01/2005 buy rejected SL rejected 32 18/02/2013 buy approved 2 28/02/2005 buy rejected SL rejected 33 17/04/2013 buy rejected SL rejected 3 05/01/2006 sell rejected SL rejected 34 13/05/2013 buy rejected SL rejected 4 01/02/2006 sell approved 35 03/07/2013 sell approved 5 27/06/2006 sell approved 36 12/03/2014 buy approved 6 05/12/2006 buy approved 37 15/05/2014 buy approved 7 02/02/2007 buy rejected SL rejected 38 03/07/2014 buy approved 8 28/03/2007 buy approved 39 14/10/2014 sell rejected SL rejected 9 12/06/2007 buy approved 40 11/12/2014 sell approved 10 17/12/2007 buy rejected SL rejected 41 28/01/2015 sell approved 11 17/01/2008 buy rejected SL rejected 42 17/03/2015 sell rejected SL rejected 12 11/02/2008 buy rejected SL rejected 43 11/06/2015 sell rejected SL rejected 13 06/08/2008 sell approved 44 18/08/2015 sell approved 14 14/10/2008 sell approved 45 04/04/2016 buy approved 15 05/02/2009 sell approved 46 23/06/2016 buy approved 16 02/03/2009 sell approved 47 12/08/2016 buy approved 17 28/07/2009 buy approved 48 19/04/2017 sell rejected SL rejected 18 25/11/2009 buy rejected SL rejected 49 05/05/2017 sell approved 19 02/06/2010 sell rejected SL rejected 50 08/08/2017 buy rejected SL rejected 20 14/06/2010 sell rejected SL rejected 51 24/04/2018 buy rejected SL rejected 21 13/10/2010 buy approved 52 18/07/2018 sell approved 22 09/11/2010 buy approved 53 15/08/2018 sell approved 23 24/01/2010 buy rejected SL rejected 54 14/09/2018 sell approved 24 02/02/2011 buy approved 55 12/10/2018 sell rejected SL rejected 25 04/05/2011 buy rejected SL rejected 56 06/03/2018 buy rejected SL rejected 26 03/06/2011 buy approved 57 27/03/2019 buy approved 27 08/07/2011 buy approved 58 19/08/2019 sell approved 28 28/12/2011 sell approved 59 30/09/2019 sell approved 29 06/11/2012 buy approved 60 18/03/2020 sell approved 30 14/12/2012 buy approved 61 07/09/2020 buy approved Invalid Volume 31 18/01/2013 buy approved Invalid Volume 62 13/11/2020 buy approved Table 4.4.1– NZD/USD Signals Triggered by the Alpha Model 46 The main reason for these rejections, as seen in table 4.4.1, was that the prices that the strategy set for the SL limit order for the trades were above entry price, in case of longs positions, and below the entry price, in case of short positions. Table 4.4.2 (NZD/USD Stop-loss Placement of the Rejected Trades) details the rejected trades events with each entry price, the stop-loss limit order prices, and the distance between them. The distance between the stop-loss price and entry price was 191,8 pips, varying from 3 pips and negative 194,8 pips, with a mean at 63,7 pips. See Graph 4.4.1 (Distribution of NZD/USD Distance between Stop-loss Prices and Entry Prices of Rejected Trades). i Type EP SL Diff. 1 Buy 0,7144 0,7193 -0,0049 2 Buy 0,7216 0,7219 -0,0003 3 Sell 0,6865 0,6835 -0,003 4 Buy 0,6828 0,6921 -0,0093 5 Buy 0,7689 0,7718 -0,0029 6 Buy 0,7698 0,7725 -0,0027 7 Buy 0,7879 0,7898 -0,0019 8 Buy 0,72623 0,74299 -0,01676 9 Sell 0,6754 0,67415 -0,00125 10 Sell 0,69024 0,67102 -0,01922 11 Buy 0,75864 0,76709 -0,00845 12 Buy 0,79866 0,80023 -0,00157 13 Buy 0,84926 0,85141 -0,00215 14 Buy 0,82902 0,8485 -0,01948 15 Sell 0,78883 0,78728 -0,00155 16 Sell 0,73681 0,73579 -0,00102 17 Sell 0,71972 0,71677 -0,00295 18 Sell 0,70406 0,69739 -0,00667 19 Buy 0,7363 0,74607 -0,00977 20 Buy 0,71516 0,73262 -0,01746 21 Sell 0,65179 0,64844 -0,00335 22 Buy 0,68 0,68347 -0,00347 Table 4.4.2– NZD/USD Distance between Stop-loss Prices and Entry Prices of Rejected Trades From Table 4.4.3 (NZD/USD Position Risk-Reward ratio (in pips)) below, one can observe that the strategy's highest risk-reward earned by the strategy was 4,08 earned per point risked and the lowest was of negative -1.03. The average risk-reward ratio of this back-test sample was negative 0,36 pips. It means that the automated trading system managed to lose, on average, 0,36 cents for every 1$ risked in a single trade. 47 Figure 4.4.1 – NZD/USD Distance between Stop-loss Prices and Entry Prices of Rejected Trades Type P&L SL Size RR Type P&L SL Size RR sell -9 9 - 1,00 sell -99,2 98,6 -1,00 sell -146 179 - 0,82 buy 160,3 83 -1,00 buy 18,8 220,1 0,09 buy -41,5 41,5 -0,73 buy 183 141 1,30 buy -48,9 48,9 -1,02 buy -47 47 - 1,00 sell -7,8 7,6 -1,00 sell 401,5 138 2,91 sell -98,2 262,9 0,04 sell 357 283 1,26 sell -66,3 66,1 -0,24 sell -176,1 175 - 1,01 buy -9,2 223,5 -1,00 sell -212,3 212,1 - 1,00 buy -194,4 194,4 -1,00 buy -78,4 77,9 - 1,01 buy 97,8 94,1 -1,00 buy -94,1 94,1 - 1,00 sell -19,7 19,7 -1,00 buy -239,7 239,3 - 1,00 sell -53,4 53,4 -1,01 buy -168 167,5 - 1,00 sell -146,2 193,8 -0,08 buy -94,9 94,8 - 1,00 sell -29 29 -1,00 buy -88,6 88,6 - 1,00 buy -82,5 82,1 -1,00 sell -52,3 52,2 - 1,00 sell 44,7 48,5 -1,00 buy -80,3 80,2 - 1,00 sell -17,9 17,8 -1,01 buy -122,2 122,2 - 1,00 sell -19,6 380,9 0,32 buy -128,8 128,7 - 1,00 buy 361,9 88,6 4,96 Table 4.4.3 – NZD/USD Position Reward-risk ratio (in pips) The strategy delivered a total of 1.625 pips in profits and 2.671,5 pips in losses over the period tested, resulting in a net return of negative 1.046,5 pips. The trade that returned the highest loss was 239,7 pips, while the trade with the highest return was 401,5 pips. The average of pips lost per trade was 27,54 and a standard deviation of 146,78 pips. Moreover, the back-test for NZD/USD showed that from the 38 orders the execution model filled and executed, the stop-loss sizes vary from 7,6 pips to 380,9 pips. The stop-loss size samples presented a mean of 120,634 pips, a standard deviation of 85,38 pips, and a range of 373,3 pips. See Figure 4.4.2 (NZD/USD Position Information (in pips)). 54 The largest profit-taken in trade was 6.235,2$, with an average profit of 2.132,42 $. The most significant loss in trade was -2.135,56$ with an average loss of -1.792,59 $. The position's maximal holding time was 840 hours, while the trade with the minimal holding duration of 43 minutes and 44 seconds. The average duration of the trades was 278:36:28. Finally, the number of consecutive trades with profit in the test was 2, totalizing 5.973,97$, and the number of consecutive losses was 6, totalizing -9.057,74$. See Appendix C of the supplementary electronic repository of this work for the complete output of the back-testing. Time Deal Symbol Type Direction Volume Price Order Commission Swap Profit Balance 2005.01.01 00:00:00 1 balance 0,00 0,00 100 000,00 100 000,00 2005.06.15 00:01:00 2 USDCHF buy in 0.69 1,27830 2 0,00 0,00 0,00 100 000,00 2005.07.25 00:01:00 3 USDCHF sell out 0.69 1,29810 3 0,00 4,36 1 052,46 101 056,82 2005.11.15 00:01:00 4 USDCHF buy in 2.3 1,31770 4 0,00 0,00 0,00 101 056,82 2005.11.28 19:40:36 5 USDCHF sell out 2.3 1,30583 5 0,00 4,54 -2 090,70 98 970,66 2007.04.25 00:01:00 6 USDCHF sell in 3.05 1,20120 6 0,00 0,00 0,00 98 970,66 2007.04.26 13:34:45 7 USDCHF buy out 3.05 1,20906 7 0,00 - 53,18 -1 982,78 96 934,70 2007.09.18 00:01:00 8 USDCHF sell in 7.94 1,18700 8 0,00 0,00 0,00 96 934,70 2007.10.12 00:00:00 9 USDCHF buy out 7.94 1,18170 9 0,00 -1 227,63 3 561,14 99 268,21 2007.11.01 00:03:30 10 USDCHF sell in 1.56 1,15860 10 0,00 0,00 0,00 99 268,21 2007.12.07 00:00:00 11 USDCHF buy out 1.56 1,12970 11 0,00 - 350,33 3 990,79 102 908,67 2008.01.24 00:00:30 12 USDCHF sell in 1.28 1,09110 12 0,00 0,00 0,00 102 908,67 2008.02.07 19:28:59 13 USDCHF buy out 1.28 1,10860 13 0,00 - 114,99 -2 020,57 100 773,11 2008.03.04 00:02:00 14 USDCHF sell in 0.42 1,04170 14 0,00 0,00 0,00 100 773,11 2008.04.10 00:00:00 15 USDCHF buy out 0.42 1,00120 15 0,00 - 113,58 1 698,96 102 358,49 2008.10.14 00:00:00 16 USDCHF buy in 11.09 1,13800 16 0,00 0,00 0,00 102 358,49 2008.10.14 00:43:44 17 USDCHF sell out 11.09 1,13583 17 0,00 0,00 -2 118,74 100 239,75 2009.06.12 00:00:01 18 USDCHF sell in 1.11 1,07110 18 0,00 0,00 0,00 100 239,75 2009.06.15 09:32:39 19 USDCHF buy out 1.11 1,09050 19 0,00 - 7,20 -1 974,69 98 257,86 2009.07.23 00:00:00 20 USDCHF sell in 1.72 1,06670 20 0,00 0,00 0,00 98 257,86 2009.07.28 17:12:28 21 USDCHF buy out 1.72 1,07894 21 0,00 - 33,68 -1 951,25 96 272,93 2009.10.21 00:00:30 22 USDCHF sell in 1.86 1,01210 22 0,00 0,00 0,00 96 272,93 2009.10.27 15:02:41 23 USDCHF buy out 1.86 1,02260 23 0,00 - 77,43 -1 909,84 94 285,66 2010.05.06 00:00:00 24 USDCHF buy in 0.57 1,11773 24 0,00 0,00 0,00 94 285,66 2010.06.15 00:00:00 25 USDCHF sell out 0.57 1,14265 25 0,00 3,80 1 243,11 95 532,57 2010.10.11 00:00:00 26 USDCHF sell in 0.99 0,96030 26 0,00 0,00 0,00 95 532,57 2010.10.22 17:45:16 27 USDCHF buy out 0.99 0,97890 27 0,00 - 93,74 -1 881,09 93 557,74 2010.12.30 00:00:00 28 USDCHF sell in 0.79 0,94408 28 0,00 0,00 0,00 93 557,74 2011.01.05 16:14:34 29 USDCHF buy out 0.79 0,96637 29 0,00 - 23,58 -1 822,19 91 711,97 2011.02.03 00:01:00 30 USDCHF sell in 2.23 0,94033 30 0,00 0,00 0,00 91 711,97 2011.02.03 14:49:28 31 USDCHF buy out 2.23 0,94809 31 0,00 0,00 -1 825,23 89 886,74 2011.03.03 00:00:00 32 USDCHF sell in 1.74 0,92354 32 0,00 0,00 0,00 89 886,74 2011.03.08 08:45:25 33 USDCHF buy out 1.74 0,93309 33 0,00 - 39,38 -1 780,86 88 066,50 2011.04.21 00:00:00 34 USDCHF sell in 1.8 0,88821 34 0,00 0,00 0,00 88 066,50 2011.05.18 00:00:30 35 USDCHF buy out 1.8 0,88046 35 0,00 - 359,46 1 584,40 89 291,44 2011.06.06 00:00:00 36 USDCHF sell in 0.82 0,83483 36 0,00 0,00 0,00 89 291,44 2011.06.15 18:42:15 37 USDCHF buy out 0.82 0,85303 37 0,00 - 61,60 -1 749,53 87 480,31 2012.06.04 00:00:00 38 USDCHF buy in 1.3 0,96587 38 0,00 0,00 0,00 87 480,31 2012.06.07 14:18:40 39 USDCHF sell out 1.3 0,95285 39 0,00 1,36 -1 776,36 85 705,31 2012.07.10 00:00:00 40 USDCHF buy in 0.69 0,97538 40 0,00 0,00 0,00 85 705,31 2012.08.07 00:00:00 41 USDCHF sell out 0.69 0,96878 41 0,00 3,92 - 470,08 85 239,15 2012.12.27 00:00:00 42 USDCHF sell in 7.08 0,91309 42 0,00 0,00 0,00 85 239,15 2012.12.27 18:28:27 43 USDCHF buy out 7.08 0,91530 43 0,00 0,00 -1 709,47 83 529,68 2013.12.18 00:00:00 44 USDCHF sell in 3.86 0,88479 44 0,00 0,00 0,00 83 529,68 2013.12.18 10:54:26 45 USDCHF buy out 3.86 0,88862 45 0,00 0,00 -1 663,68 81 866,00 2014.02.26 00:00:00 46 USDCHF sell in 5.5 0,88690 46 0,00 0,00 0,00 81 866,00 2014.02.26 14:30:27 47 USDCHF buy out 5.5 0,88954 47 0,00 0,00 -1 632,30 80 233,70 2014.09.02 00:00:00 48 USDCHF buy in 2.49 0,91965 48 0,00 0,00 0,00 80 233,70 2014.10.21 00:00:00 49 USDCHF sell out 2.49 0,94317 49 0,00 25,84 6 209,36 86 468,90 2014.11.07 00:00:00 50 USDCHF buy in 0.98 0,97286 50 0,00 0,00 0,00 86 468,90 2014.11.17 03:32:35 51 USDCHF sell out 0.98 0,95572 51 0,00 1,61 -1 757,54 84 712,97 2015.11.10 00:01:30 52 USDCHF buy in 0.86 1,00407 52 0,00 0,00 0,00 84 712,97 55 Time Deal Symbol Type Direction Volume Price Order Commission Swap Profit Balance 2015.12.09 20:07:37 53 USDCHF sell out 0.86 0,98439 53 0,00 4,93 -1 719,32 82 998,58 2016.02.02 00:00:00 54 USDCHF buy in 2.21 1,01940 54 0,00 0,00 0,00 82 998,58 2016.02.03 17:00:12 55 USDCHF sell out 2.21 1,01175 55 0,00 0,43 -1 671,02 81 327,99 2016.11.24 00:00:00 56 USDCHF buy in 1 1,01583 56 0,00 0,00 0,00 81 327,99 2017.01.09 00:00:30 57 USDCHF sell out 1 1,01700 57 0,00 8,67 115,04 81 451,70 2019.08.15 00:00:00 58 USDCHF sell in 2.65 0,97262 58 0,00 0,00 0,00 81 451,70 2019.08.16 00:00:01 59 USDCHF buy out 2.65 0,97864 59 0,00 - 18,99 -1 630,12 79 802,59 2020.12.02 00:00:00 60 USDCHF sell in 0.98 0,89917 60 0,00 0,00 0,00 79 802,59 2020.12.30 23:59:59 61 USDCHF buy out 0.98 0,88153 61 0,00 - 216,18 1 961,05 81 547,46 Table 4.5.4 – USD/CHF Transactions Report 4.6. BACK-TESTING USD/CAD For the back-test of the USD/CAD pair strategy, the trading system processed 4.145 daily bars, containing the open, the low, the high, and the close prices of each trading day, and a total of 200.562.391 ticks. During this period, the alpha model emitted 42 entry signals, of which 24 signals were to open buy positions and 18 signals were to open sell positions. From the total of signals that the model triggered, the risk model rejected 10 of them or 23,8% over the total, and the broker rejected one trade due to the stop-loss size being higher than the limit authorized – i.e., on June 4th, 2017, a trade filled with 96,68 contracts. Excluding the rejections, the automated trade system could fill and execute 31 trades. Table 4.6.1 (USD/CAD Signals Triggered by the Alpha Model) details the dates each signal was triggered. It also shows if the risk model accepted or rejected the signals and the reasons for it. i date signal status Commentary i date signal status Commentary 1 21/09/2005 sell approved 22 07/10/2011 buy approved 2 13/12/2005 sell approved 23 01/12/2011 buy rejected SL rejected 3 08/03/2006 sell rejected SL rejected 24 21/12/2011 buy rejected SL rejected 4 01/05/2006 sell approved 25 04/05/2013 buy approved 5 06/09/2006 sell rejected SL rejected 26 05/06/2013 buy rejected SL rejected 6 28/12/2006 buy approved 27 02/07/2013 buy approved 7 18/06/2007 sell rejected SL rejected 28 09/09/2013 buy rejected SL rejected 8 11/07/2007 sell approved 29 03/12/2013 buy approved 9 20/09/2007 sell approved 30 02/01/2014 buy approved 10 25/06/2008 buy rejected SL rejected 31 12/12/2014 buy approved 11 06/08/2008 buy approved 32 27/07/2015 buy approved 12 15/09/2008 buy approved 33 29/09/2015 buy approved 13 14/10/2008 buy approved 34 23/11/2015 buy approved 14 27/11/2008 buy rejected SL rejected 35 17/11/2016 buy approved 15 05/08/2009 sell approved 36 01/05/2017 buy approved 16 15/10/2009 sell approved 37 03/08/2017 sell approved 17 07/01/2010 sell approved 38 01/09/2017 sell approved 18 15/03/2010 sell approved 39 04/06/2017 buy approved Invalid Volume 19 22/12/2010 sell rejected SL rejected 40 06/01/2020 sell approved 20 07/01/2011 sell approved 41 20/03/2020 buy approved 21 08/04/2011 sell approved 42 04/05/2020 buy approved 56 Table 4.6.1 – USD/CAD Signals Triggered by the Model The main reason for these rejections, as seen in table Figure 4.6.1 (Distances between Stop-loss Prices and Entry Prices of Rejected Trades for USD/CAD), was that the prices that the strategy set for the SL limit order for the trades were above entry price, in case of longs positions, and below the entry price, in case of short positions. Table 4.6.2 (USD/CAD Stop-loss Placement of the Rejected Trades) shows the rejected trades events with each entry price, the stop-loss limit order prices, and the distance between them. The distance between the stop-loss price and entry price was 242,8 pips, varying from negative 4,5 pips and negative 247,3 pips, with a mean at negative 98,1 pips. See Graph 4.6.1 (Distances between Stop-loss Prices and Entry Prices of Rejected Trades for USD/CAD). Type EP SL Diff. Sell 1,1497 1,1397 -0,01 Sell 1,1222 1,1057 -0,0165 Sell 1,0679 1,0633 -0,0046 Buy 1,0125 1,0166 -0,0041 Buy 1,2324 1,2526 -0,0202 Sell 1,01724 1,00937 -0,00787 Buy 1,01907 1,0438 -0,02473 Buy 1,01947 1,0263 -0,00683 Sell 0,9885 0,98692 -0,00158 Buy 1,03406 1,03451 -0,00045 Buy 1,04053 1,05161 -0,01108 Table 4.6.2 – USD/CAD Distance between Stop-loss Prices and Entry Prices of Rejected Trades Figure 4.6.1 – USD/CAD Distance between Stop-loss Prices and Entry Prices of Rejected Trades 57 From Table 4.6.3 (USD/CAD Position Risk-Reward ratio (in pips)), one can observe that the highest risk-reward earned by the strategy was 6,69 earned per point risked, and the lowest was of negative -1.02. The average risk-reward ratio of this back-test sample was negative 0,42 pips. It means that for everyone monetary unit risked in a single trade, the automated trading system lost, on average, 0,42 monetary units. Type P&L SL Size RR Type P&L SL Size RR sell - 145,90 145 - 1,01 buy - 27,40 27 - 1,01 sell - 82,50 82 - 1,01 buy - 39,90 39 - 1,02 sell - 79,00 229 - 0,34 buy - 2,50 122 - 0,02 buy 30,00 165 0,18 buy -30,5 30,5 -1,00 sell - 69,50 69 - 1,01 buy 933,6 139,6 6,69 sell 304,00 229 1,33 buy -88,9 88,9 -1,00 buy 79,00 217 0,36 buy -179 178,7 -1,00 buy - 92,00 91 - 1,01 buy -40,5 39,6 -1,02 buy 480,00 515 0,93 buy -63 63 -1,00 sell - 202,50 202 - 1,00 buy -145,3 248,3 -0,59 sell - 385,00 385 - 1,00 sell -4,6 4,6 -1,00 sell - 252,60 252 - 1,00 sell 1,1 60,8 0,02 sell - 121,10 121 - 1,00 sell -88,5 133,9 -0,66 sell - 40,50 40 - 1,00 buy -513,7 723,5 -0,71 sell - 116,00 116 - 1,00 buy -58,8 58,7 -1,00 buy - 25,90 26 - 1,01 Table 4.6.3 – USD/CAD Position Risk-Reward ratio (in pips) The strategy delivered a total of 1.827,7 pips in profits and 2,895,1 pips in losses over the period tested, resulting in a net return of negative 1.067,4 pips. The trade that returned the highest loss was 513,7 pips, while the trade with the highest profit was 933,6. The average of pips lost per trade was negative 34,43 pips and a standard deviation of 243,7 pips. Moreover, the back-test for USD/CAD showed that from the 31 orders the execution model filled and executed, the stop-loss sizes vary from 4,6 pips to 723,5 pips. The stop-loss size samples presented a mean of 156,23 pips, a standard deviation of 150,79 pips, and a range of 718,9 pips. See Graph 4.6.2 – NZD/USD Position Information (in pips). Figure 4.6.2 – USD/CAD Position Information (in pips) 58 The strategy generated 14.834,42 $ in gains and 40.296,91 $ in losses, resulting in a net loss of 25.462,49 $ or a negative 26,27 return over the initial trading capital. The absolute balance drawdown of the account was 25.462,49 $, or negative 25,46%, while the absolute equity drawdown was 25.462,49 $ or 25,46%. Moreover, the simulation reached the maximal balance drawdown of 25.462,49 $ or 25,46% and a maximal equity drawdown of 28.889,31 or 27,93%. See Figure 4.6.3 (USD/CAD Balance and Equity Evolution). Graph 4.6.1 – USD/CAD Balance and Equity Evolution Table 4.6.4 (USD/CAD Transactions Report below) details each transaction the trading system accomplished during the test. Of the 31 trades that the algorithm executed, 17 trades were longs, and 14 trades were shorts. However, five trades resulted in profits, and the remaining 26 trades resulted in losses. From these losses, the stop-loss limit order that the risk module set closed 20 trades, and the position management module closed prematurely five trades due to the trend condition no longer being valid. This result shows that the strategy had a win ratio over the backtesting period of 15,6%. The largest profit-taken in trade was 9.729,55$, with an average profit of 2.966,88$. The most significant loss in trade was 2.079,99$ with an average loss of 1.549,88$. The position's maximal holding time was 1.176 hours, while the trade with the minimal holding duration of 2:01:24. The average duration of the trades was 267:03:35. Finally, the number of consecutive trades with profit in the test was two, totaling 3.019,72$, and the number of consecutive losses was 11, totaling 18.007,25$. See Appendix C of the supplementary electronic repository of this work for the complete output of the back-testing. Time Deal Symbol Type Direction Volume Price Order Commission Swap Profit Balance 2005.01.01 00:00:00 1 balance 0,00 0,00 100 000,00 100 000,00 2005.09.21 00:01:00 2 USDCAD sell in 1.61 1,16950 2 0,00 0,00 0,00 100 000,00 2005.10.05 21:17:27 3 USDCAD buy out 1.61 1,18409 3 0,00 - 96,20 -1 983,79 97 920,01 2005.12.13 00:01:00 4 USDCAD sell in 2.75 1,15110 4 0,00 0,00 0,00 97 920,01 59 Time Deal Symbol Type Direction Volume Price Order Commission Swap Profit Balance 2005.12.15 14:58:24 5 USDCAD buy out 2.75 1,15935 5 0,00 - 47,76 -1 956,92 95 915,33 2006.05.01 00:02:00 6 USDCAD sell in 0.94 1,11750 6 0,00 0,00 0,00 95 915,33 2006.05.24 00:01:00 7 USDCAD buy out 0.94 1,12540 7 0,00 - 97,34 - 659,85 95 158,14 2006.12.28 00:00:30 8 USDCAD buy in 1.34 1,16190 8 0,00 0,00 0,00 95 158,14 2007.02.15 00:00:30 9 USDCAD sell out 1.34 1,16490 9 0,00 44,70 345,09 95 547,93 2007.07.11 00:00:00 10 USDCAD sell in 2.92 1,05430 10 0,00 0,00 0,00 95 547,93 2007.07.11 12:04:04 11 USDCAD buy out 2.92 1,06125 11 0,00 0,00 -1 912,27 93 635,66 2007.09.20 00:02:00 12 USDCAD sell in 0.83 1,01490 12 0,00 0,00 0,00 93 635,66 2007.11.20 00:00:30 13 USDCAD buy out 0.83 0,98450 13 0,00 - 251,89 2 562,93 95 946,70 2008.08.06 00:01:30 14 USDCAD buy in 0.92 1,04350 14 0,00 0,00 0,00 95 946,70 2008.08.29 00:19:30 15 USDCAD sell out 0.92 1,05140 15 0,00 17,41 691,27 96 655,38 2008.09.15 00:01:00 16 USDCAD buy in 2.26 1,06420 16 0,00 0,00 0,00 96 655,38 2008.09.19 15:29:36 17 USDCAD sell out 2.26 1,05500 17 0,00 10,15 -1 970,81 94 694,72 2008.10.14 00:00:00 18 USDCAD buy in 0.42 1,14660 18 0,00 0,00 0,00 94 694,72 2008.11.11 00:11:00 19 USDCAD sell out 0.42 1,19460 19 0,00 7,77 1 687,59 96 390,08 2009.08.05 00:00:00 20 USDCAD sell in 1.02 1,07304 20 0,00 0,00 0,00 96 390,08 2009.08.11 11:46:25 21 USDCAD buy out 1.02 1,09329 21 0,00 - 28,44 -1 889,25 94 472,39 2009.10.15 00:02:30 22 USDCAD sell in 0.5 1,02440 22 0,00 0,00 0,00 94 472,39 2009.10.26 17:05:39 23 USDCAD buy out 0.5 1,06290 23 0,00 - 21,59 -1 811,08 92 639,72 2010.01.07 00:00:00 24 USDCAD sell in 0.76 1,03241 24 0,00 0,00 0,00 92 639,72 2010.01.22 15:52:52 25 USDCAD buy out 0.76 1,05767 25 0,00 - 55,05 -1 815,08 90 769,59 2010.03.15 00:00:00 26 USDCAD sell in 1.52 1,01715 26 0,00 0,00 0,00 90 769,59 2010.03.26 14:19:34 27 USDCAD buy out 1.52 1,02926 27 0,00 - 97,06 -1 788,39 88 884,14 2011.01.07 00:00:00 28 USDCAD sell in 4.4 0,99657 28 0,00 0,00 0,00 88 884,14 2011.01.20 14:01:35 29 USDCAD buy out 4.4 1,00062 29 0,00 - 288,57 -1 780,90 86 814,67 2011.04.08 00:00:00 30 USDCAD sell in 1.44 0,95878 30 0,00 0,00 0,00 86 814,67 2011.04.18 16:57:40 31 USDCAD buy out 1.44 0,97038 31 0,00 - 59,96 -1 721,39 85 033,32 2011.10.07 00:00:00 32 USDCAD buy in 6.87 1,03804 32 0,00 0,00 0,00 85 033,32 2011.10.07 13:00:36 33 USDCAD sell out 6.87 1,03545 33 0,00 0,00 -1 718,41 83 314,91 2013.03.20 00:00:00 34 USDCAD buy in 6.29 1,02731 34 0,00 0,00 0,00 83 314,91 2013.03.20 11:09:38 35 USDCAD sell out 6.29 1,02457 35 0,00 0,00 -1 682,13 81 632,78 2013.07.02 00:00:00 36 USDCAD buy in 4.36 1,04970 36 0,00 0,00 0,00 81 632,78 2013.07.10 20:20:41 37 USDCAD sell out 4.36 1,04571 37 0,00 26,50 -1 663,60 79 995,68 2013.12.03 00:00:00 38 USDCAD buy in 1.39 1,06422 38 0,00 0,00 0,00 79 995,68 2013.12.26 08:00:00 39 USDCAD sell out 1.39 1,06397 39 0,00 22,99 - 32,66 79 986,01 2014.01.02 00:00:00 40 USDCAD buy in 5.58 1,06463 40 0,00 0,00 0,00 79 986,01 2014.01.02 15:14:29 41 USDCAD sell out 5.58 1,06158 41 0,00 0,00 -1 603,18 78 382,83 2014.12.12 00:00:00 42 USDCAD buy in 1.29 1,15201 42 0,00 0,00 0,00 78 382,83 2015.02.19 00:00:00 43 USDCAD sell out 1.29 1,24537 43 0,00 58,98 9 670,57 88 112,38 2015.07.27 00:05:00 44 USDCAD buy in 2.59 1,30407 44 0,00 0,00 0,00 88 112,38 2015.07.28 18:26:30 45 USDCAD sell out 2.59 1,29518 45 0,00 1,59 -1 777,75 86 336,22 2015.09.29 00:00:30 46 USDCAD buy in 1.29 1,33971 46 0,00 0,00 0,00 86 336,22 2015.10.01 17:00:00 47 USDCAD sell out 1.29 1,32181 47 0,00 3,10 -1 746,92 84 592,40 2015.11.23 00:03:00 48 USDCAD buy in 5.69 1,33293 48 0,00 0,00 0,00 84 592,40 2015.11.24 19:07:29 49 USDCAD sell out 5.69 1,32888 49 0,00 3,41 -1 734,13 82 861,68 2016.11.17 00:00:00 50 USDCAD buy in 3.54 1,34491 50 0,00 0,00 0,00 82 861,68 2016.11.21 17:36:59 51 USDCAD sell out 3.54 1,33861 51 0,00 4,19 -1 666,06 81 199,81 2017.05.01 00:01:30 52 USDCAD buy in 0.89 1,36587 52 0,00 0,00 0,00 81 199,81 2017.05.22 00:00:30 53 USDCAD sell out 0.89 1,35134 53 0,00 10,94 - 956,95 80 253,80 2017.08.03 00:15:00 54 USDCAD sell in 43.87 1,25715 54 0,00 0,00 0,00 80 253,80 2017.08.03 02:16:24 55 USDCAD buy out 43.87 1,25761 55 0,00 0,00 -1 604,65 78 649,15 2017.09.01 00:16:00 56 USDCAD sell in 3.23 1,24783 56 0,00 0,00 0,00 78 649,15 2017.09.28 00:00:00 57 USDCAD buy out 3.23 1,24772 57 0,00 - 354,99 28,48 78 322,64 2020.01.06 00:00:00 58 USDCAD sell in 1.52 1,29861 58 0,00 0,00 0,00 78 322,64 2020.01.22 00:00:00 59 USDCAD buy out 1.52 1,30746 59 0,00 - 93,22 -1 028,87 77 200,55 2020.03.20 00:00:00 60 USDCAD buy in 0.31 1,45050 60 0,00 0,00 0,00 77 200,55 2020.04.08 00:00:00 61 USDCAD sell out 0.31 1,39913 61 0,00 2,98 -1 138,19 76 065,34 2020.05.04 00:00:00 62 USDCAD buy in 3.65 1,40872 62 0,00 0,00 0,00 76 065,34 2020.05.05 15:04:38 63 USDCAD sell out 3.65 1,40284 63 0,00 2,07 -1 529,90 74 537,51 60 Table 4.6.4 – USD/CAD Transactions Report 4.7. BACK-TESTING USD/JPY For back-testing the USD/JPY pair, the trading system processed 4.143 daily bars, containing the open, the low, the high, and the close prices of each trading day, and a total of 230.699.349 ticks. During this period, the alpha model emitted 51 entry signals, of which 22 signals were to open buy positions and 29 were to open sell positions. From the total of signals that the model triggered, the risk model rejected 13 of them or 25,5% over the total. Excluding the rejections, the automated trade system was able to fill and execute 38 trades. Table 4.7.1 (USD/JPY Signals Triggered by the Alpha Model) shows the dates each signal was triggered. It also shows if the risk model accepted or rejected the signals and the reason for it. i date signal status Commentary i date signal status Commentary 1 05/01/2005 sell rejected SL rejected 27 30/09/2014 buy approved 2 25/01/2005 sell approved 28 06/11/2014 buy approved 3 20/06/2005 buy approved 29 07/01/2015 buy rejected SL rejected 4 05/10/2005 buy approved 30 06/03/2015 buy approved 5 19/10/2006 buy rejected SL rejected 31 29/05/2015 buy approved 6 06/06/2007 buy approved 32 12/08/2015 buy approved 7 13/11/2007 sell approved 33 17/02/2016 sell approved 8 24/01/2008 sell approved 34 25/03/2016 sell rejected SL rejected 9 07/03/2008 sell approved 35 12/05/2016 sell rejected SL rejected 10 03/12/2008 sell approved 36 21/06/2016 sell approved 11 26/01/2009 sell approved 37 10/08/2016 sell rejected SL rejected 12 02/10/2009 sell approved 38 27/09/2016 sell approved 13 27/11/2009 sell approved 39 06/01/2017 buy rejected SL rejected 14 26/08/2010 sell approved 40 14/07/2017 buy approved 15 08/10/2010 sell approved 41 14/09/2017 sell rejected SL rejected 16 13/05/2011 sell rejected SL rejected 42 26/09/2018 buy approved 17 13/06/2011 sell approved 43 08/11/2018 buy approved 18 20/07/2011 sell approved 44 17/06/2019 sell approved 19 01/11/2011 sell rejected SL rejected 45 12/08/2019 sell approved 20 20/03/2012 buy approved 46 29/01/2020 buy rejected SL rejected 21 12/09/2012 sell approved 47 20/02/2020 buy approved 22 02/01/2013 buy approved 48 24/07/2020 sell approved 23 18/03/2013 buy rejected SL rejected 49 23/09/2020 sell approved 24 16/04/2013 buy rejected SL rejected 50 28/10/2020 sell approved 25 17/05/2013 buy approved 51 01/12/2020 sell approved 26 04/12/2013 buy approved Table 4.7.1 – USD/JPY Signals Triggered by the Alpha Model 61 The sole reason for these rejections, as seen in table Graph 4.7.1 - Distances between Stop-loss Prices and Entry Prices of Rejected Trades for USD/JPY, was that the prices that the strategy set for the SL limit order for the trades were above entry price, in case of longs positions, and below the entry price, in case of short positions. Table 4.7.2 (USD/JPY Stop-loss Placement of the Rejected Trades) shows the rejected trades events with each entry price, the stop-loss limit order prices, and the distance between them. The distance between the stop-loss price and entry price was 193,2 pips, varying from negative 7,3 pips and negative 200,5 pips, with a mean at negative 0,823 pips. See Graph 4.7.1 (Distances between Stop-loss Prices and Entry Prices of Rejected Trades for USD/JPY). Type EP SL Diff. Sell 104,46 104,25 -0,21 Buy 118,92 119,25 -0,33 Sell 80,988 80,915 -0,073 Sell 78,107 76,282 -1,825 Buy 94,896 95,962 -1,066 Buy 96,582 98,587 -2,005 Buy 118,402 118,862 -0,46 Sell 112,819 111,753 -1,066 Sell 108,391 107,495 -0,896 Sell 101,849 101,567 -0,282 Buy 115,378 116,037 -0,659 Sell 110,475 109,271 -1,204 Buy 109,186 109,82 -0,634 Table 4.7.2 – USD/JPY Distance between Stop-loss Prices and Entry Prices of Rejected Trades Figure 4.7.1 – USD/JPY Distance between Stop-loss Prices and Entry Prices of Rejected Trades In Table 4.7.3 (USD/JPY Position Risk-Reward ratio (in pips)) below, one can observe that the highest risk-reward earned by the strategy was 3,56 earned per point risked, and the lowest was negative 62 1,03. The automated trading system managed to lose, on average, 0,52 monetary units for every monetary unit risked in a single trade. Type P&L SL Size RR Type P&L SL Size RR sell -36 36 - 1,00 buy 213,20 125 1,70 buy -51 51 - 1,00 buy - 120,00 120 - 1,00 buy 122,00 148 0,82 buy 479,80 598 0,80 buy - 139,00 139 - 1,00 buy -102,1 102 -1,00 buy - 9,00 9 - 1,00 buy -103 332,3 -0,31 sell - 208,00 523 - 0,40 buy -113,8 113,7 -1,00 sell - 128,30 128 - 1,00 sell 140,3 119 1,18 sell 79,00 282 0,28 sell -253 252,9 -1,00 sell - 32,00 278 - 0,12 sell -176,9 176,2 -1,00 sell - 290,60 289 - 1,01 buy -20,5 20,5 -1,00 sell - 178,00 178 - 1,00 buy -81 80,9 -1,00 sell - 272,60 271,9 - 1,00 buy -94,3 94,3 -1,00 sell - 132,40 132 - 1,00 sell -23,2 23,2 -1,00 sell - 22,20 127,3 - 0,17 sell -110,6 110,6 -1,00 sell - 9,50 9,4 - 1,01 buy -182,1 177 -1,03 sell - 41,40 41,3 - 1,00 sell 18,2 50,4 0,36 buy - 143,40 143,3 - 1,00 sell -55,8 55,8 -1,00 sell -73,2 73,2 - 1,00 sell -106,6 106,5 -1,00 buy 543,2 152,4 3,56 sell -48,4 48,3 -1,00 buy -169,2 169,2 - 1,00 Table 4.7.3 – USD/JPY Position Risk-Reward ratio (in pips) The strategy delivered a total of 1.595,7 pips in profits and 3.527,1 pips in losses over the period tested, resulting in a net return of negative 1.931,4 pips. The trade that returned the highest loss was 290,6 pips, while the trade with the highest profit was 543,2 pips. The average of pips lost per trade was negative 49,52 pips and a standard deviation of 166,98 pips. Moreover, the back-test for USD/JPY showed that from the 39 orders the execution model filled and executed, the stop-loss sizes vary from 9 pips to 598,4 pips. The stop-loss size samples presented a mean of 150,98 pips, a standard deviation of 125,64 pips, and a range of 589,4 pips. See Graph 4.7.2 – NZD/JPY Position Information (in pips). Figure 4.7.2 – USD/JPY Position Information (in pips) The strategy generated 12.377,81$ in gains and 49.459,78$ in losses, resulting in a net loss of 37.081,97$ or a negative 37,1% return over the initial trading capital. The absolute balance drawdown of the account was 37.081,97$, or negative 37,1%, while the absolute equity drawdown was 37.081,97$ or 37,1%. Moreover, the simulation reached the maximal balance drawdown of 63 37.081,97$ or 37,1%, and a maximal equity drawdown of 41.741,29 or 39,9%. Figure 4.7.3 (USD/JPY Balance and Equity Evolution) displays the information below. Table 4.7.4 (USD/JPY Transactions Report) details each trading system's transaction accomplished during the test. Of the 39 trades that the algorithm executed, 17 trades were longs, and 22 were shorts. Nevertheless, six trades resulted in profits, and the remaining 33 trades resulted in losses. From these losses, the stop-loss limit order that the risk module set closed 29 trades, and the position management module closed prematurely three trades due to the trend condition no longer being valid. This result shows that the strategy had a win ratio over the back-testing period of 15,8%. Figure 4.7.3 – USD/JPY Balance and Equity Evolution The most significant profit-taking in trade was 5.069,46$, with an average profit of 2.062,97$. The most considerable loss in trade was 2.351,37$, with an average loss of 1.498,78$. The position's maximal holding time was 1.272 hours, while the trade with the minimal holding duration of less than two seconds. The average duration of the trades was 259:48:22 hours. Finally, the number of consecutive trades with profit in the test was 1, totalizing 5.069,46$, and the number of consecutive losses was 12, totalizing 16.160,57$. See Appendix C of the supplementary electronic repository of this work for the complete output of the back-testing. Time Deal Symbol Type Direction Volume Price Order Commission Swap Profit Balance 2005.01.01 00:00:00 1 balance 0,00 0,00 100 000,00 100 000,00 2005.01.25 00:01:00 2 USDJPY sell in 5.7 102,660 2 0,00 0,00 0,00 100 000,00 2005.01.25 07:41:33 3 USDJPY buy out 5.7 103,020 3 0,00 0,00 -1 991,85 98 008,15 2005.06.20 00:01:00 4 USDJPY buy in 4.19 108,950 4 0,00 0,00 0,00 98 008,15 2005.06.21 16:49:40 5 USDJPY sell out 4.19 108,440 5 0,00 0,19 -1 970,58 96 037,76 2005.10.05 00:01:00 6 USDJPY buy in 1.48 114,350 6 0,00 0,00 0,00 96 037,76 2005.12.19 00:01:00 7 USDJPY sell out 1.48 115,570 7 0,00 4,62 1 562,34 97 604,72 2007.01.24 00:00:00 8 USDJPY buy in 1.71 121,710 8 0,00 0,00 0,00 97 604,72 2007.01.25 06:01:34 9 USDJPY sell out 1.71 120,320 9 0,00 0,21 -1 975,48 95 629,45 2007.06.06 00:00:30 10 USDJPY buy in 25.79 121,380 10 0,00 0,00 0,00 95 629,45 2007.06.06 00:58:13 11 USDJPY sell out 25.79 121,290 11 0,00 0,00 -1 913,68 93 715,77 70 Guo, X., Leung, T. L., Shek, H., & Wong, S. P.-S. (2017). Quantitative trading: Algorithms, analytics, data, models, optimization. CRC Press. Gurrib, I. (2018). Performance of the Average Directional Index as a market timing tool for the most actively traded USD based currency pairs. Banks and Bank Systems, 13(3), 58–70. James, C. (2021). Technical Indicator. Investopedia. https://www.investopedia.com/terms/t/technicalindicator.asp Johnson, B. (2010). Algorithmic trading & DMA: an introduction to direct access trading strategies. 4Myeloma Press. Kissell, R. (2006). The Expanded Implementation Shortfall: Understanding Transaction Cost Components. The Journal of Trading, 1(3), 6–16. Leshik, E., & Cralle, J. (2011). An Introduction to Algorithmic Trading: Basic to Advanced Strategies. John Wiley and Sons. Lien, K. (2015). Day trading and swing trading the currency market: Technical and fundamental strategies to profit from market moves (Third edition). Wiley. Markowitz, H. (1952, March). Portfolio Selection. The Journal of Finance, 7(1), 77–91. Mitchell, C. (2021). Average Directional Index (ADX). Invesopedia. https://www.investopedia.com/terms/a/adx.asp MQL5 Reference. (2021). MQL5. https://www.mql5.com/en/docs Mukerji, P., Chung, C., Walsh, T., & Xiong, B. (2019). The Impact of Algorithmic Trading in a Simulated Asset Market. Journal of Risk and Financial Management, 12(68), 11. Narang, R. K. (2009). Inside the black box: The simple truth about quantitative trading (1st ed.). John Wiley & Sons. Neely, C. J., Rapach, D. E., Tu, J., & Zhou Guofu. (2014, July). Forecasting the Equity Risk Premium: The Role ofTechnical Indicators. Management Science, 60(7), 1617–1859. Tobin, J. (1958, February). Liquidity Preference as Behavior Towards Risk. The Review of Economic Studies, 25(2), 65–86. 71 Treleaven, P., Galas, M., & Lalchand, V. (2013, November). Review Articles: Algorithmic Trading Review. Communications of the ACM, 56(11), 76–85. Wilder Jr., J. weeles. (1978). New Concepts in Technical trading Systems. Trend Research. Zhu, Y., & Zhou, G. (2009). Technical analysis: An asset allocation perspective on the use of moving averages. Journal of Financial Economics, 92, 519–544. 72 APPENDIX A – GBP/USD BACK-TESTING EXECUTION LOG EL 0 11:44:41.594 Tester Cloud servers switched off DS 0 11:45:04.746 Core 1 agent process started on 127.0.0.1:3000 ME 0 11:45:04.746 Core 1 connecting to 127.0.0.1:3000 RQ 0 11:45:05.250 Core 1 connected JK 0 11:45:05.259 Core 1 authorized (agent build 2940) QS 0 11:45:05.266 Tester GBPUSD,Daily (BDSwissGlobal-Server01): testing of Experts\masters_project\perfect_order_v6.1.ex5 from 2005.01.01 00:00 to 2020.12.31 00:00 RL 0 11:45:05.271 Core 1 common synchronization completed JF 3 11:45:05.288 Tester GBPUSD: custom settings for the symbol applied from file 'MQL5\Profiles\Tester\Symbols\GBPUSD.txt' PG 0 11:45:08.808 Tester quality of analyzed history is 92% ER 0 11:45:11.528 Core 1 MetaTester 5 started on 127.0.0.1:3000 PE 0 11:45:11.528 Core 1 initialization finished KQ 0 11:45:11.528 Core 1 login (build 2940) FH 0 11:45:11.528 Core 1 4372 bytes of account info loaded RO 0 11:45:11.528 Core 1 1470 bytes of tester parameters loaded PH 0 11:45:11.528 Core 1 3772 bytes of input parameters loaded CM 0 11:45:11.528 Core 1 481 bytes of symbols list loaded (79 symbols) GD 0 11:45:11.528 Core 1 expert file added: Experts\masters_project\perfect_order_v6.1.ex5. 43280 bytes loaded OM 0 11:45:11.528 Core 1 19973 Mb available, 249 blocks set for ticks generating MO 0 11:45:11.528 Core 1 calculate profit in pips, initial deposit 100000, leverage 1:100 KK 0 11:45:11.528 Core 1 successfully initialized ML 0 11:45:11.528 Core 1 44 Kb of total initialization data received KG 0 11:45:11.528 Core 1 Intel Core i5-4590 @ 3.30GHz, 32695 MB QL 0 11:45:11.528 Core 1 GBPUSD: symbol to be synchronized JG 0 11:45:11.528 Core 1 GBPUSD: symbol synchronized, 3720 bytes of symbol info received GS 0 11:45:11.528 Core 1 GBPUSD: load 27 bytes of history data to synchronize in 0:00:00.003 GM 0 11:45:11.528 Core 1 GBPUSD: history synchronized from 2004.01.01 to 2020.12.31 IF 0 11:45:11.528 Core 1 GBPUSD,Daily: history cache allocated for 4436 bars and contains 262 bars from 2004.01.01 00:00 to 2004.12.31 00:00 HF 0 11:45:11.528 Core 1 GBPUSD,Daily: history begins from 2004.01.01 00:00 LF 0 11:45:11.528 Core 1 GBPUSD,Daily (BDSwissGlobal-Server01): every tick generating HR 0 11:45:11.528 Core 1 GBPUSD,Daily: testing of Experts\masters_project\perfect_order_v6.1.ex5 from 2005.01.01 00:00 to 2020.12.31 00:00 started with inputs: KL 0 11:45:11.528 Core 1 riskSize=0.02 EF 0 11:45:11.528 Core 1 fastMA1=10 OR 0 11:45:11.528 Core 1 fastMA2=20 NP 0 11:45:11.528 Core 1 midMA=50 FK 0 11:45:11.528 Core 1 slowMA1=100 FP 0 11:45:11.528 Core 1 slowMA2=200 HP 0 11:45:11.528 Core 1 adxPeriod=14 ND 0 11:45:23.736 Core 1 2005.03.09 00:01:00 buySignal GR 0 11:45:23.736 Core 1 2005.03.09 00:01:00 buy_order_approved EF 0 11:45:23.736 Core 1 2005.03.09 00:01:00 market buy 0.9 GBPUSD sl: 1.90780 (1.92970 / 1.93010 / 1.92970) PF 0 11:45:23.736 Core 1 2005.03.09 00:01:00 deal #2 buy 0.9 GBPUSD at 1.93010 done (based on order #2) RL 0 11:45:23.736 Core 1 2005.03.09 00:01:00 deal performed [#2 buy 0.9 GBPUSD at 1.93010] LQ 0 11:45:23.736 Core 1 2005.03.09 00:01:00 order performed buy 0.9 at 1.93010 [#2 buy 0.9 GBPUSD at 1.93010] JG 0 11:45:23.736 Core 1 2005.03.09 00:01:00 CTrade::OrderSend: market buy 0.90 GBPUSD sl: 1.90780 [done at 1.93010] NH 0 11:45:23.736 Core 1 2005.03.09 00:01:00 Execution result: done at 1.93010 CD 0 11:45:23.736 Core 1 2005.03.09 00:01:00 Execution Module initialization complete. JM 0 11:45:23.736 Core 1 2005.03.21 09:27:28 stop-loss triggered #2 buy 0.9 GBPUSD 1.93010 sl: 1.90780 [#3 sell 0.9 GBPUSD at 1.90780] KL 0 11:45:23.736 Core 1 2005.03.21 09:27:28 deal #3 sell 0.9 GBPUSD at 1.90747 done (based on order #3) LL 0 11:45:23.736 Core 1 2005.03.21 09:27:28 deal performed [#3 sell 0.9 GBPUSD at 1.90747] CF 0 11:45:23.736 Core 1 2005.03.21 09:27:28 order performed sell 0.9 at 1.90747 [#3 sell 0.9 GBPUSD at 1.90780] JD 0 11:45:23.736 Core 1 2005.07.12 00:01:00 sellSignal IP 0 11:45:23.736 Core 1 2005.07.12 00:01:00 sell_order_approved LE 0 11:45:23.736 Core 1 2005.07.12 00:01:00 market sell 4.26 GBPUSD sl: 1.76230 (1.75770 / 1.75810 / 1.75770) PI 0 11:45:23.736 Core 1 2005.07.12 00:01:00 deal #4 sell 4.26 GBPUSD at 1.75770 done (based on order #4) LE 0 11:45:23.736 Core 1 2005.07.12 00:01:00 deal performed [#4 sell 4.26 GBPUSD at 1.75770] NL 0 11:45:23.736 Core 1 2005.07.12 00:01:00 order performed sell 4.26 at 1.75770 [#4 sell 4.26 GBPUSD at 1.75770] HL 0 11:45:23.736 Core 1 2005.07.12 00:01:00 CTrade::OrderSend: market sell 4.26 GBPUSD sl: 1.76230 [done at 1.75770] KL 0 11:45:23.736 Core 1 2005.07.12 00:01:00 Execution result: done at 1.75770 EI 0 11:45:23.736 Core 1 2005.07.12 00:01:00 Execution Module initialization complete. QI 0 11:45:23.736 Core 1 2005.07.12 04:03:32 stop-loss triggered #4 sell 4.26 GBPUSD 1.75770 sl: 1.76230 [#5 buy 4.26 GBPUSD at 1.76230] KD 0 11:45:23.736 Core 1 2005.07.12 04:03:32 deal #5 buy 4.26 GBPUSD at 1.76230 done 73 (based on order #5) RM 0 11:45:23.736 Core 1 2005.07.12 04:03:32 deal performed [#5 buy 4.26 GBPUSD at 1.76230] DS 0 11:45:23.736 Core 1 2005.07.12 04:03:32 order performed buy 4.26 at 1.76230 [#5 buy 4.26 GBPUSD at 1.76230] EP 0 11:45:23.736 Core 1 2005.11.18 00:01:00 sellSignal FE 0 11:45:23.736 Core 1 2005.11.18 00:01:00 sell_order_approved LQ 0 11:45:23.736 Core 1 2005.11.18 00:01:00 market sell 0.76 GBPUSD sl: 1.74380 (1.71850 / 1.71890 / 1.71850) CE 0 11:45:23.736 Core 1 2005.11.18 00:01:00 deal #6 sell 0.76 GBPUSD at 1.71850 done (based on order #6) IH 0 11:45:23.736 Core 1 2005.11.18 00:01:00 deal performed [#6 sell 0.76 GBPUSD at 1.71850] OI 0 11:45:23.736 Core 1 2005.11.18 00:01:00 order performed sell 0.76 at 1.71850 [#6 sell 0.76 GBPUSD at 1.71850] CG 0 11:45:23.736 Core 1 2005.11.18 00:01:00 CTrade::OrderSend: market sell 0.76 GBPUSD sl: 1.74380 [done at 1.71850] GQ 0 11:45:23.736 Core 1 2005.11.18 00:01:00 Execution result: done at 1.71850 JM 0 11:45:23.736 Core 1 2005.11.18 00:01:00 Execution Module initialization complete. HE 0 11:45:23.736 Core 1 2005.12.05 18:47:40 stop-loss triggered #6 sell 0.76 GBPUSD 1.71850 sl: 1.74380 [#7 buy 0.76 GBPUSD at 1.74380] NK 0 11:45:23.736 Core 1 2005.12.05 18:47:40 deal #7 buy 0.76 GBPUSD at 1.74388 done (based on order #7) QI 0 11:45:23.736 Core 1 2005.12.05 18:47:40 deal performed [#7 buy 0.76 GBPUSD at 1.74388] LO 0 11:45:23.736 Core 1 2005.12.05 18:47:40 order performed buy 0.76 at 1.74388 [#7 buy 0.76 GBPUSD at 1.74380] MP 0 11:45:23.736 Core 1 2006.05.25 00:01:00 buySignal DD 0 11:45:23.736 Core 1 2006.05.25 00:01:00 Type: Buy | EP: 1.8691 | SL: 1.8791 | Diff: -0.01000000000000001 KH 0 11:45:23.736 Core 1 2006.05.25 00:01:00 tradeRejected: SL incompatible with trade JP 0 11:45:23.736 Core 1 2006.08.09 00:01:00 buySignal CE 0 11:45:23.736 Core 1 2006.08.09 00:01:00 buy_order_approved PQ 0 11:45:23.736 Core 1 2006.08.09 00:01:00 market buy 0.56 GBPUSD sl: 1.87310 (1.90630 / 1.90660 / 1.90630) JQ 0 11:45:23.736 Core 1 2006.08.09 00:01:00 deal #8 buy 0.56 GBPUSD at 1.90660 done (based on order #8) PP 0 11:45:23.736 Core 1 2006.08.09 00:01:00 deal performed [#8 buy 0.56 GBPUSD at 1.90660] DE 0 11:45:23.736 Core 1 2006.08.09 00:01:00 order performed buy 0.56 at 1.90660 [#8 buy 0.56 GBPUSD at 1.90660] ED 0 11:45:23.736 Core 1 2006.08.09 00:01:00 CTrade::OrderSend: market buy 0.56 GBPUSD sl: 1.87310 [done at 1.90660] RE 0 11:45:23.736 Core 1 2006.08.09 00:01:00 Execution result: done at 1.90660 QQ 0 11:45:23.736 Core 1 2006.08.09 00:01:00 Execution Module initialization complete. DL 0 11:45:23.736 Core 1 2006.08.28 00:01:00 market sell 0.56 GBPUSD, close #8 (1.88740 / 1.88770 / 1.88740) CD 0 11:45:23.736 Core 1 2006.08.28 00:01:00 deal #9 sell 0.56 GBPUSD at 1.88740 done (based on order #9) HI 0 11:45:23.736 Core 1 2006.08.28 00:01:00 deal performed [#9 sell 0.56 GBPUSD at 1.88740] HH 0 11:45:23.736 Core 1 2006.08.28 00:01:00 order performed sell 0.56 at 1.88740 [#9 sell 0.56 GBPUSD at 1.88740] GP 0 11:45:23.736 Core 1 2006.08.28 00:01:00 CTrade::OrderSend: market sell 0.56 position #8 GBPUSD [done at 1.88740] IP 0 11:45:23.736 Core 1 2006.08.28 00:01:00 Execution result: done at 1.88740 DN 0 11:45:23.736 Core 1 2006.09.08 00:01:00 buySignal QN 0 11:45:23.736 Core 1 2006.09.08 00:01:00 Type: Buy | EP: 1.8764 | SL: 1.8956 | Diff: -0.01920000000000011 FM 0 11:45:23.736 Core 1 2006.09.08 00:01:00 tradeRejected: SL incompatible with trade NO 0 11:45:23.736 Core 1 2006.11.15 00:00:00 buySignal IJ 0 11:45:23.736 Core 1 2006.11.15 00:00:00 Type: Buy | EP: 1.8958 | SL: 1.9005 | Diff: -0.004700000000000149 NM 0 11:45:23.736 Core 1 2006.11.15 00:00:00 tradeRejected: SL incompatible with trade OL 0 11:45:23.736 Core 1 2006.12.04 00:00:00 buySignal FJ 0 11:45:23.736 Core 1 2006.12.04 00:00:00 buy_order_approved RN 0 11:45:23.736 Core 1 2006.12.04 00:00:00 market buy 0.35 GBPUSD sl: 1.93050 (1.98320 / 1.98350 / 1.98320) RJ 0 11:45:23.736 Core 1 2006.12.04 00:00:00 deal #10 buy 0.35 GBPUSD at 1.98350 done (based on order #10) CD 0 11:45:23.736 Core 1 2006.12.04 00:00:00 deal performed [#10 buy 0.35 GBPUSD at 1.98350] LJ 0 11:45:23.736 Core 1 2006.12.04 00:00:00 order performed buy 0.35 at 1.98350 [#10 buy 0.35 GBPUSD at 1.98350] KH 0 11:45:23.736 Core 1 2006.12.04 00:00:00 CTrade::OrderSend: market buy 0.35 GBPUSD sl: 1.93050 [done at 1.98350] EQ 0 11:45:23.736 Core 1 2006.12.04 00:00:00 Execution result: done at 1.98350 HM 0 11:45:23.736 Core 1 2006.12.04 00:00:00 Execution Module initialization complete. QK 0 11:45:23.736 Core 1 2006.12.26 00:27:00 market sell 0.35 GBPUSD, close #10 (1.95790 / 1.95820 / 1.95790) JH 0 11:45:23.736 Core 1 2006.12.26 00:27:00 deal #11 sell 0.35 GBPUSD at 1.95790 done (based on order #11) NF 0 11:45:23.736 Core 1 2006.12.26 00:27:00 deal performed [#11 sell 0.35 GBPUSD at 1.95790] LO 0 11:45:23.736 Core 1 2006.12.26 00:27:00 order performed sell 0.35 at 1.95790 [#11 sell 0.35 GBPUSD at 1.95790] IO 0 11:45:23.736 Core 1 2006.12.26 00:27:00 CTrade::OrderSend: market sell 0.35 position #10 GBPUSD [done at 1.95790] 74 QL 0 11:45:23.736 Core 1 2006.12.26 00:27:00 Execution result: done at 1.95790 PK 0 11:45:23.736 Core 1 2007.01.26 00:00:00 buySignal QN 0 11:45:23.736 Core 1 2007.01.26 00:00:00 Type: Buy | EP: 1.9634 | SL: 1.9694 | Diff: -0.006000000000000005 PQ 0 11:45:23.736 Core 1 2007.01.26 00:00:00 tradeRejected: SL incompatible with trade FK 0 11:45:23.736 Core 1 2007.04.30 00:00:00 buySignal EO 0 11:45:23.736 Core 1 2007.04.30 00:00:00 Type: Buy | EP: 1.9967 | SL: 1.997 | Diff: -0.0002999999999997449 FP 0 11:45:23.736 Core 1 2007.04.30 00:00:00 tradeRejected: SL incompatible with trade DH 0 11:45:23.736 Core 1 2007.07.06 00:00:00 buySignal QN 0 11:45:23.736 Core 1 2007.07.06 00:00:00 buy_order_approved DI 0 11:45:23.736 Core 1 2007.07.06 00:00:00 market buy 1.71 GBPUSD sl: 2.00090 (2.01150 / 2.01170 / 2.01150) CI 0 11:45:23.736 Core 1 2007.07.06 00:00:00 deal #12 buy 1.71 GBPUSD at 2.01170 done (based on order #12) PK 0 11:45:23.736 Core 1 2007.07.06 00:00:00 deal performed [#12 buy 1.71 GBPUSD at 2.01170] IM 0 11:45:23.736 Core 1 2007.07.06 00:00:00 order performed buy 1.71 at 2.01170 [#12 buy 1.71 GBPUSD at 2.01170] IL 0 11:45:23.736 Core 1 2007.07.06 00:00:00 CTrade::OrderSend: market buy 1.71 GBPUSD sl: 2.00090 [done at 2.01170] KM 0 11:45:23.736 Core 1 2007.07.06 00:00:00 Execution result: done at 2.01170 GJ 0 11:45:23.736 Core 1 2007.07.06 00:00:00 Execution Module initialization complete. KF 0 11:45:23.736 Core 1 2007.08.07 00:00:30 market sell 1.71 GBPUSD, close #12 (2.03110 / 2.03130 / 2.03110) DM 0 11:45:23.736 Core 1 2007.08.07 00:00:30 deal #13 sell 1.71 GBPUSD at 2.03110 done (based on order #13) NS 0 11:45:23.736 Core 1 2007.08.07 00:00:30 deal performed [#13 sell 1.71 GBPUSD at 2.03110] QR 0 11:45:23.736 Core 1 2007.08.07 00:00:30 order performed sell 1.71 at 2.03110 [#13 sell 1.71 GBPUSD at 2.03110] IL 0 11:45:23.736 Core 1 2007.08.07 00:00:30 CTrade::OrderSend: market sell 1.71 position #12 GBPUSD [done at 2.03110] HI 0 11:45:23.736 Core 1 2007.08.07 00:00:30 Execution result: done at 2.03110 DH 0 11:45:23.736 Core 1 2008.08.19 00:00:00 sellSignal GM 0 11:45:23.736 Core 1 2008.08.19 00:00:00 sell_order_approved GI 0 11:45:23.736 Core 1 2008.08.19 00:00:00 market sell 0.38 GBPUSD sl: 1.91220 (1.86160 / 1.86180 / 1.86160) RM 0 11:45:23.736 Core 1 2008.08.19 00:00:00 deal #14 sell 0.38 GBPUSD at 1.86160 done (based on order #14) ES 0 11:45:23.736 Core 1 2008.08.19 00:00:00 deal performed [#14 sell 0.38 GBPUSD at 1.86160] ER 0 11:45:23.736 Core 1 2008.08.19 00:00:00 order performed sell 0.38 at 1.86160 [#14 sell 0.38 GBPUSD at 1.86160] FO 0 11:45:23.736 Core 1 2008.08.19 00:00:00 CTrade::OrderSend: market sell 0.38 GBPUSD sl: 1.91220 [done at 1.86160] LI 0 11:45:23.736 Core 1 2008.08.19 00:00:00 Execution result: done at 1.86160 KF 0 11:45:23.736 Core 1 2008.08.19 00:00:00 Execution Module initialization complete. OM 0 11:45:23.736 Core 1 2008.09.24 00:00:00 market buy 0.38 GBPUSD, close #14 (1.85320 / 1.85340 / 1.85320) FN 0 11:45:23.736 Core 1 2008.09.24 00:00:00 deal #15 buy 0.38 GBPUSD at 1.85340 done (based on order #15) LP 0 11:45:23.736 Core 1 2008.09.24 00:00:00 deal performed [#15 buy 0.38 GBPUSD at 1.85340] CF 0 11:45:23.736 Core 1 2008.09.24 00:00:00 order performed buy 0.38 at 1.85340 [#15 buy 0.38 GBPUSD at 1.85340] MH 0 11:45:23.736 Core 1 2008.09.24 00:00:00 CTrade::OrderSend: market buy 0.38 position #14 GBPUSD [done at 1.85340] HD 0 11:45:23.736 Core 1 2008.09.24 00:00:00 Execution result: done at 1.85340 KL 0 11:45:23.736 Core 1 2008.10.14 00:00:30 sellSignal LH 0 11:45:23.736 Core 1 2008.10.14 00:00:30 sell_order_approved DM 0 11:45:23.736 Core 1 2008.10.14 00:00:30 market sell 0.77 GBPUSD sl: 1.76580 (1.74100 / 1.74120 / 1.74100) EQ 0 11:45:23.736 Core 1 2008.10.14 00:00:30 deal #16 sell 0.77 GBPUSD at 1.74100 done (based on order #16) LO 0 11:45:23.736 Core 1 2008.10.14 00:00:30 deal performed [#16 sell 0.77 GBPUSD at 1.74100] PF 0 11:45:23.736 Core 1 2008.10.14 00:00:30 order performed sell 0.77 at 1.74100 [#16 sell 0.77 GBPUSD at 1.74100] QK 0 11:45:23.736 Core 1 2008.10.14 00:00:30 CTrade::OrderSend: market sell 0.77 GBPUSD sl: 1.76580 [done at 1.74100] RE 0 11:45:23.736 Core 1 2008.10.14 00:00:30 Execution result: done at 1.74100 HQ 0 11:45:23.736 Core 1 2008.10.14 00:00:30 Execution Module initialization complete. DP 0 11:45:23.736 Core 1 2008.12.05 00:03:00 market buy 0.77 GBPUSD, close #16 (1.46820 / 1.46840 / 1.46820) OK 0 11:45:23.736 Core 1 2008.12.05 00:03:00 deal #17 buy 0.77 GBPUSD at 1.46840 done (based on order #17) GE 0 11:45:23.736 Core 1 2008.12.05 00:03:00 deal performed [#17 buy 0.77 GBPUSD at 1.46840] EK 0 11:45:23.736 Core 1 2008.12.05 00:03:00 order performed buy 0.77 at 1.46840 [#17 buy 0.77 GBPUSD at 1.46840] FL 0 11:45:23.736 Core 1 2008.12.05 00:03:00 CTrade::OrderSend: market buy 0.77 position #16 GBPUSD [done at 1.46840] DP 0 11:45:23.736 Core 1 2008.12.05 00:03:00 Execution result: done at 1.46840 DQ 0 11:45:23.736 Core 1 2008.12.17 00:01:00 sellSignal NQ 0 11:45:23.736 Core 1 2008.12.17 00:01:00 Type: Sell | EP: 1.5577 | SL: 1.4878 | Diff: -0.06990000000000007 NM 0 11:45:23.736 Core 1 2008.12.17 00:01:00 tradeRejected: SL incompatible with trade 75 QP 0 11:45:23.736 Core 1 2009.01.07 00:01:30 sellSignal NF 0 11:45:23.736 Core 1 2009.01.07 00:01:30 Type: Sell | EP: 1.4905 | SL: 1.4551 | Diff: -0.03539999999999988 KL 0 11:45:23.736 Core 1 2009.01.07 00:01:30 tradeRejected: SL incompatible with trade FS 0 11:45:23.736 Core 1 2009.01.28 00:00:00 sellSignal GG 0 11:45:23.736 Core 1 2009.01.28 00:00:00 Type: Sell | EP: 1.4152 | SL: 1.4025 | Diff: -0.01269999999999993 LL 0 11:45:23.736 Core 1 2009.01.28 00:00:00 tradeRejected: SL incompatible with trade KR 0 11:45:29.839 Core 1 2010.02.17 00:00:00 sellSignal MG 0 11:45:29.839 Core 1 2010.02.17 00:00:00 Type: Sell | EP: 1.57839 | SL: 1.57631 | Diff: -0.002080000000000082 KJ 0 11:45:29.839 Core 1 2010.02.17 00:00:00 tradeRejected: SL incompatible with trade LM 0 11:45:29.839 Core 1 2010.04.05 00:00:00 sellSignal KE 0 11:45:29.839 Core 1 2010.04.05 00:00:00 Type: Sell | EP: 1.52658 | SL: 1.50178 | Diff: -0.02479999999999993 NI 0 11:45:29.839 Core 1 2010.04.05 00:00:00 tradeRejected: SL incompatible with trade EL 0 11:45:29.839 Core 1 2010.05.20 00:00:30 sellSignal RH 0 11:45:29.839 Core 1 2010.05.20 00:00:30 sell_order_approved IN 0 11:45:29.839 Core 1 2010.05.20 00:00:30 market sell 0.5 GBPUSD sl: 1.49160 (1.44500 / 1.44525 / 1.44500) OR 0 11:45:29.839 Core 1 2010.05.20 00:00:30 deal #18 sell 0.5 GBPUSD at 1.44500 done (based on order #18) FL 0 11:45:29.839 Core 1 2010.05.20 00:00:30 deal performed [#18 sell 0.5 GBPUSD at 1.44500] FF 0 11:45:29.839 Core 1 2010.05.20 00:00:30 order performed sell 0.5 at 1.44500 [#18 sell 0.5 GBPUSD at 1.44500] ID 0 11:45:29.839 Core 1 2010.05.20 00:00:30 CTrade::OrderSend: market sell 0.50 GBPUSD sl: 1.49160 [done at 1.44500] OE 0 11:45:29.839 Core 1 2010.05.20 00:00:30 Execution result: done at 1.44500 LQ 0 11:45:29.839 Core 1 2010.05.20 00:00:30 Execution Module initialization complete. LS 0 11:45:29.839 Core 1 2010.06.09 00:00:00 market buy 0.5 GBPUSD, close #18 (1.44522 / 1.44550 / 1.44522) GH 0 11:45:29.839 Core 1 2010.06.09 00:00:00 deal #19 buy 0.5 GBPUSD at 1.44550 done (based on order #19) CF 0 11:45:29.839 Core 1 2010.06.09 00:00:00 deal performed [#19 buy 0.5 GBPUSD at 1.44550] FL 0 11:45:29.839 Core 1 2010.06.09 00:00:00 order performed buy 0.5 at 1.44550 [#19 buy 0.5 GBPUSD at 1.44550] LM 0 11:45:29.839 Core 1 2010.06.09 00:00:00 CTrade::OrderSend: market buy 0.50 position #18 GBPUSD [done at 1.44550] GS 0 11:45:29.839 Core 1 2010.06.09 00:00:00 Execution result: done at 1.44550 QI 0 11:45:29.839 Core 1 2010.10.21 00:00:00 buySignal KL 0 11:45:29.839 Core 1 2010.10.21 00:00:00 Type: Buy | EP: 1.58395 | SL: 1.58875 | Diff: -0.004800000000000137 MN 0 11:45:29.839 Core 1 2010.10.21 00:00:00 tradeRejected: SL incompatible with trade PN 0 11:45:29.839 Core 1 2010.11.10 00:00:00 buySignal HM 0 11:45:29.839 Core 1 2010.11.10 00:00:00 Type: Buy | EP: 1.59809 | SL: 1.60059 | Diff: -0.002499999999999947 LM 0 11:45:29.839 Core 1 2010.11.10 00:00:00 tradeRejected: SL incompatible with trade CO 0 11:45:29.839 Core 1 2011.04.18 00:00:00 buySignal RK 0 11:45:29.839 Core 1 2011.04.18 00:00:00 buy_order_approved EM 0 11:45:29.839 Core 1 2011.04.18 00:00:00 market buy 19.78 GBPUSD sl: 1.63130 (1.63188 / 1.63248 / 1.63188) CI 0 11:45:29.839 Core 1 2011.04.18 00:00:00 deal #20 buy 19.78 GBPUSD at 1.63248 done (based on order #20) IG 0 11:45:29.839 Core 1 2011.04.18 00:00:00 deal performed [#20 buy 19.78 GBPUSD at 1.63248] OJ 0 11:45:29.839 Core 1 2011.04.18 00:00:00 order performed buy 19.78 at 1.63248 [#20 buy 19.78 GBPUSD at 1.63248] RK 0 11:45:29.839 Core 1 2011.04.18 00:00:00 CTrade::OrderSend: market buy 19.78 GBPUSD sl: 1.63130 [done at 1.63248] EQ 0 11:45:29.839 Core 1 2011.04.18 00:00:00 Execution result: done at 1.63248 LM 0 11:45:29.839 Core 1 2011.04.18 00:00:00 Execution Module initialization complete. DD 0 11:45:29.839 Core 1 2011.04.18 00:14:16 stop-loss triggered #20 buy 19.78 GBPUSD 1.63248 sl: 1.63130 [#21 sell 19.78 GBPUSD at 1.63130] KF 0 11:45:29.839 Core 1 2011.04.18 00:14:16 deal #21 sell 19.78 GBPUSD at 1.63127 done (based on order #21) DH 0 11:45:29.839 Core 1 2011.04.18 00:14:16 deal performed [#21 sell 19.78 GBPUSD at 1.63127] HJ 0 11:45:29.839 Core 1 2011.04.18 00:14:16 order performed sell 19.78 at 1.63127 [#21 sell 19.78 GBPUSD at 1.63130] NI 0 11:45:35.942 Core 1 2011.10.12 00:00:00 sellSignal PI 0 11:45:35.942 Core 1 2011.10.12 00:00:00 Type: Sell | EP: 1.55901 | SL: 1.54911 | Diff: -0.00990000000000002 LE 0 11:45:35.942 Core 1 2011.10.12 00:00:00 tradeRejected: SL incompatible with trade PH 0 11:45:35.942 Core 1 2011.12.09 00:00:00 sellSignal CL 0 11:45:35.942 Core 1 2011.12.09 00:00:00 sell_order_approved DI 0 11:45:35.942 Core 1 2011.12.09 00:00:00 market sell 2.25 GBPUSD sl: 1.57242 (1.56227 / 1.56261 / 1.56227) CM 0 11:45:35.942 Core 1 2011.12.09 00:00:00 deal #22 sell 2.25 GBPUSD at 1.56227 done (based on order #22) KS 0 11:45:35.942 Core 1 2011.12.09 00:00:00 deal performed [#22 sell 2.25 GBPUSD at 1.56227] NR 0 11:45:35.942 Core 1 2011.12.09 00:00:00 order performed sell 2.25 at 1.56227 [#22 sell 2.25 GBPUSD at 1.56227] EO 0 11:45:35.942 Core 1 2011.12.09 00:00:00 CTrade::OrderSend: market sell 2.25 GBPUSD sl: 1.57242 [done at 1.56227] KI 0 11:45:35.942 Core 1 2011.12.09 00:00:00 Execution result: done at 1.56227 76 OE 0 11:45:35.942 Core 1 2011.12.09 00:00:00 Execution Module initialization complete. KL 0 11:45:35.942 Core 1 2011.12.09 12:16:05 stop-loss triggered #22 sell 2.25 GBPUSD 1.56227 sl: 1.57242 [#23 buy 2.25 GBPUSD at 1.57242] QS 0 11:45:35.942 Core 1 2011.12.09 12:16:05 deal #23 buy 2.25 GBPUSD at 1.57243 done (based on order #23) DM 0 11:45:35.942 Core 1 2011.12.09 12:16:05 deal performed [#23 buy 2.25 GBPUSD at 1.57243] MS 0 11:45:35.942 Core 1 2011.12.09 12:16:05 order performed buy 2.25 at 1.57243 [#23 buy 2.25 GBPUSD at 1.57242] GF 0 11:45:35.942 Core 1 2011.12.26 08:00:00 sellSignal RS 0 11:45:35.942 Core 1 2011.12.26 08:00:00 Type: Sell | EP: 1.56266 | SL: 1.55448 | Diff: -0.008180000000000298 GN 0 11:45:35.942 Core 1 2011.12.26 08:00:00 tradeRejected: SL incompatible with trade CN 0 11:45:42.046 Core 1 2012.12.20 00:00:00 buySignal RL 0 11:45:42.046 Core 1 2012.12.20 00:00:00 buy_order_approved CO 0 11:45:42.046 Core 1 2012.12.20 00:00:00 market buy 1.34 GBPUSD sl: 1.60845 (1.62496 / 1.62514 / 1.62496) CK 0 11:45:42.046 Core 1 2012.12.20 00:00:00 deal #24 buy 1.34 GBPUSD at 1.62514 done (based on order #24) KE 0 11:45:42.046 Core 1 2012.12.20 00:00:00 deal performed [#24 buy 1.34 GBPUSD at 1.62514] EK 0 11:45:42.046 Core 1 2012.12.20 00:00:00 order performed buy 1.34 at 1.62514 [#24 buy 1.34 GBPUSD at 1.62514] JN 0 11:45:42.046 Core 1 2012.12.20 00:00:00 CTrade::OrderSend: market buy 1.34 GBPUSD sl: 1.60845 [done at 1.62514] PS 0 11:45:42.046 Core 1 2012.12.20 00:00:00 Execution result: done at 1.62514 LK 0 11:45:42.046 Core 1 2012.12.20 00:00:00 Execution Module initialization complete. HJ 0 11:45:42.046 Core 1 2012.12.27 18:01:35 stop-loss triggered #24 buy 1.34 GBPUSD 1.62514 sl: 1.60845 [#25 sell 1.34 GBPUSD at 1.60845] JF 0 11:45:42.046 Core 1 2012.12.27 18:01:35 deal #25 sell 1.34 GBPUSD at 1.60842 done (based on order #25) KD 0 11:45:42.046 Core 1 2012.12.27 18:01:35 deal performed [#25 sell 1.34 GBPUSD at 1.60842] FM 0 11:45:42.046 Core 1 2012.12.27 18:01:35 order performed sell 1.34 at 1.60842 [#25 sell 1.34 GBPUSD at 1.60845] RL 0 11:45:42.046 Core 1 2013.03.22 00:00:00 sellSignal MI 0 11:45:42.046 Core 1 2013.03.22 00:00:00 sell_order_approved NN 0 11:45:42.046 Core 1 2013.03.22 00:00:00 market sell 45.74 GBPUSD sl: 1.51762 (1.51714 / 1.51730 / 1.51714) LM 0 11:45:42.046 Core 1 2013.03.22 00:00:00 deal #26 sell 45.74 GBPUSD at 1.51714 done (based on order #26) JO 0 11:45:42.046 Core 1 2013.03.22 00:00:00 deal performed [#26 sell 45.74 GBPUSD at 1.51714] JE 0 11:45:42.046 Core 1 2013.03.22 00:00:00 order performed sell 45.74 at 1.51714 [#26 sell 45.74 GBPUSD at 1.51714] QI 0 11:45:42.046 Core 1 2013.03.22 00:00:00 CTrade::OrderSend: market sell 45.74 GBPUSD sl: 1.51762 [done at 1.51714] OJ 0 11:45:42.046 Core 1 2013.03.22 00:00:00 Execution result: done at 1.51714 MR 0 11:45:42.046 Core 1 2013.03.22 00:00:00 Execution Module initialization complete. NS 0 11:45:42.046 Core 1 2013.03.22 00:03:27 stop-loss triggered #26 sell 45.74 GBPUSD 1.51714 sl: 1.51762 [#27 buy 45.74 GBPUSD at 1.51762] ER 0 11:45:42.046 Core 1 2013.03.22 00:03:27 deal #27 buy 45.74 GBPUSD at 1.51764 done (based on order #27) RP 0 11:45:42.046 Core 1 2013.03.22 00:03:27 deal performed [#27 buy 45.74 GBPUSD at 1.51764] CE 0 11:45:42.046 Core 1 2013.03.22 00:03:27 order performed buy 45.74 at 1.51764 [#27 buy 45.74 GBPUSD at 1.51762] FD 0 11:45:42.046 Core 1 2013.06.05 00:00:00 sellSignal CQ 0 11:45:42.046 Core 1 2013.06.05 00:00:00 Type: Sell | EP: 1.5315 | SL: 1.51455 | Diff: -0.01695000000000002 RQ 0 11:45:42.046 Core 1 2013.06.05 00:00:00 tradeRejected: SL incompatible with trade KH 0 11:45:42.046 Core 1 2013.10.10 00:00:00 buySignal FO 0 11:45:42.046 Core 1 2013.10.10 00:00:00 Type: Buy | EP: 1.59529 | SL: 1.6154 | Diff: -0.02011000000000007 KP 0 11:45:42.046 Core 1 2013.10.10 00:00:00 tradeRejected: SL incompatible with trade HH 0 11:45:42.046 Core 1 2013.11.01 00:00:00 buySignal ML 0 11:45:42.046 Core 1 2013.11.01 00:00:00 Type: Buy | EP: 1.60434 | SL: 1.61502 | Diff: -0.0106799999999998 HO 0 11:45:42.046 Core 1 2013.11.01 00:00:00 tradeRejected: SL incompatible with trade II 0 11:45:42.046 Core 1 2013.12.05 00:00:00 buySignal LM 0 11:45:42.046 Core 1 2013.12.05 00:00:00 buy_order_approved EK 0 11:45:42.046 Core 1 2013.12.05 00:00:00 market buy 2.1 GBPUSD sl: 1.62766 (1.63784 / 1.63792 / 1.63784) KK 0 11:45:42.046 Core 1 2013.12.05 00:00:00 deal #28 buy 2.1 GBPUSD at 1.63792 done (based on order #28) IH 0 11:45:42.046 Core 1 2013.12.05 00:00:00 deal performed [#28 buy 2.1 GBPUSD at 1.63792] EM 0 11:45:42.046 Core 1 2013.12.05 00:00:00 order performed buy 2.1 at 1.63792 [#28 buy 2.1 GBPUSD at 1.63792] RM 0 11:45:42.046 Core 1 2013.12.05 00:00:00 CTrade::OrderSend: market buy 2.10 GBPUSD sl: 1.62766 [done at 1.63792] OR 0 11:45:42.046 Core 1 2013.12.05 00:00:00 Execution result: done at 1.63792 HJ 0 11:45:42.046 Core 1 2013.12.05 00:00:00 Execution Module initialization complete. GH 0 11:45:42.046 Core 1 2013.12.13 12:38:35 stop-loss triggered #28 buy 2.1 GBPUSD 1.63792 sl: 1.62766 [#29 sell 2.1 GBPUSD at 1.62766] EJ 0 11:45:42.046 Core 1 2013.12.13 12:38:35 deal #29 sell 2.1 GBPUSD at 1.62765 done (based on order #29) RE 0 11:45:42.046 Core 1 2013.12.13 12:38:35 deal performed [#29 sell 2.1 GBPUSD at 77 1.62765] RO 0 11:45:42.046 Core 1 2013.12.13 12:38:35 order performed sell 2.1 at 1.62765 [#29 sell 2.1 GBPUSD at 1.62766] QM 0 11:45:42.046 Core 1 2014.01.06 00:00:00 buySignal OH 0 11:45:42.046 Core 1 2014.01.06 00:00:00 Type: Buy | EP: 1.64128 | SL: 1.64597 | Diff: -0.004690000000000083 EJ 0 11:45:42.046 Core 1 2014.01.06 00:00:00 tradeRejected: SL incompatible with trade KR 0 11:45:42.046 Core 1 2014.02.03 00:00:00 buySignal QI 0 11:45:42.046 Core 1 2014.02.03 00:00:00 Type: Buy | EP: 1.64305 | SL: 1.64743 | Diff: -0.004379999999999828 GI 0 11:45:42.046 Core 1 2014.02.03 00:00:00 tradeRejected: SL incompatible with trade OS 0 11:45:42.046 Core 1 2014.02.25 00:00:00 buySignal NG 0 11:45:42.046 Core 1 2014.02.25 00:00:00 buy_order_approved OM 2 11:45:42.046 Core 1 2014.02.25 00:00:00 failed market buy 351.11 GBPUSD sl: 1.66556 [Invalid volume] ML 0 11:45:42.046 Core 1 2014.02.25 00:00:00 CTrade::OrderSend: market buy 351.11 GBPUSD sl: 1.66556 [invalid volume] QQ 0 11:45:42.046 Core 1 2014.02.25 00:00:00 Execution result: invalid volume NG 0 11:45:42.046 Core 1 2014.02.25 00:00:00 Execution Module initialization complete. LQ 0 11:45:42.046 Core 1 2014.04.11 00:00:00 buySignal IE 0 11:45:42.046 Core 1 2014.04.11 00:00:00 buy_order_approved MQ 0 11:45:42.046 Core 1 2014.04.11 00:00:00 market buy 0.92 GBPUSD sl: 1.65536 (1.67833 / 1.67838 / 1.67833) EQ 0 11:45:42.046 Core 1 2014.04.11 00:00:00 deal #30 buy 0.92 GBPUSD at 1.67838 done (based on order #30) RS 0 11:45:42.046 Core 1 2014.04.11 00:00:00 deal performed [#30 buy 0.92 GBPUSD at 1.67838] QE 0 11:45:42.046 Core 1 2014.04.11 00:00:00 order performed buy 0.92 at 1.67838 [#30 buy 0.92 GBPUSD at 1.67838] PE 0 11:45:42.046 Core 1 2014.04.11 00:00:00 CTrade::OrderSend: market buy 0.92 GBPUSD sl: 1.65536 [done at 1.67838] IJ 0 11:45:42.046 Core 1 2014.04.11 00:00:00 Execution result: done at 1.67838 OR 0 11:45:42.046 Core 1 2014.04.11 00:00:00 Execution Module initialization complete. ON 0 11:45:42.046 Core 1 2014.05.21 00:00:00 market sell 0.92 GBPUSD, close #30 (1.68378 / 1.68388 / 1.68378) KE 0 11:45:42.046 Core 1 2014.05.21 00:00:00 deal #31 sell 0.92 GBPUSD at 1.68378 done (based on order #31) EK 0 11:45:42.046 Core 1 2014.05.21 00:00:00 deal performed [#31 sell 0.92 GBPUSD at 1.68378] LJ 0 11:45:42.046 Core 1 2014.05.21 00:00:00 order performed sell 0.92 at 1.68378 [#31 sell 0.92 GBPUSD at 1.68378] RD 0 11:45:42.046 Core 1 2014.05.21 00:00:00 CTrade::OrderSend: market sell 0.92 position #30 GBPUSD [done at 1.68378] CF 0 11:45:42.046 Core 1 2014.05.21 00:00:00 Execution result: done at 1.68378 ML 0 11:45:42.046 Core 1 2014.06.25 00:00:00 buySignal PJ 0 11:45:42.046 Core 1 2014.06.25 00:00:00 buy_order_approved FN 0 11:45:42.046 Core 1 2014.06.25 00:00:00 market buy 3.27 GBPUSD sl: 1.69195 (1.69836 / 1.69843 / 1.69836) IM 0 11:45:42.046 Core 1 2014.06.25 00:00:00 deal #32 buy 3.27 GBPUSD at 1.69843 done (based on order #32) DD 0 11:45:42.046 Core 1 2014.06.25 00:00:00 deal performed [#32 buy 3.27 GBPUSD at 1.69843] RJ 0 11:45:42.046 Core 1 2014.06.25 00:00:00 order performed buy 3.27 at 1.69843 [#32 buy 3.27 GBPUSD at 1.69843] GH 0 11:45:42.046 Core 1 2014.06.25 00:00:00 CTrade::OrderSend: market buy 3.27 GBPUSD sl: 1.69195 [done at 1.69843] FQ 0 11:45:42.046 Core 1 2014.06.25 00:00:00 Execution result: done at 1.69843 NM 0 11:45:42.046 Core 1 2014.06.25 00:00:00 Execution Module initialization complete. DK 0 11:45:42.046 Core 1 2014.07.24 00:00:00 market sell 3.27 GBPUSD, close #32 (1.70384 / 1.70397 / 1.70384) II 0 11:45:42.046 Core 1 2014.07.24 00:00:00 deal #33 sell 3.27 GBPUSD at 1.70384 done (based on order #33) EF 0 11:45:42.046 Core 1 2014.07.24 00:00:00 deal performed [#33 sell 3.27 GBPUSD at 1.70384] EN 0 11:45:42.046 Core 1 2014.07.24 00:00:00 order performed sell 3.27 at 1.70384 [#33 sell 3.27 GBPUSD at 1.70384] RO 0 11:45:42.046 Core 1 2014.07.24 00:00:00 CTrade::OrderSend: market sell 3.27 position #32 GBPUSD [done at 1.70384] RM 0 11:45:42.046 Core 1 2014.07.24 00:00:00 Execution result: done at 1.70384 MD 0 11:45:48.150 Core 1 2014.10.24 00:00:00 sellSignal NP 0 11:45:48.150 Core 1 2014.10.24 00:00:00 sell_order_approved EF 0 11:45:48.150 Core 1 2014.10.24 00:00:00 market sell 2.2 GBPUSD sl: 1.61252 (1.60276 / 1.60292 / 1.60276) DJ 0 11:45:48.150 Core 1 2014.10.24 00:00:00 deal #34 sell 2.2 GBPUSD at 1.60276 done (based on order #34) KD 0 11:45:48.150 Core 1 2014.10.24 00:00:00 deal performed [#34 sell 2.2 GBPUSD at 1.60276] PN 0 11:45:48.150 Core 1 2014.10.24 00:00:00 order performed sell 2.2 at 1.60276 [#34 sell 2.2 GBPUSD at 1.60276] RL 0 11:45:48.150 Core 1 2014.10.24 00:00:00 CTrade::OrderSend: market sell 2.20 GBPUSD sl: 1.61252 [done at 1.60276] GL 0 11:45:48.150 Core 1 2014.10.24 00:00:00 Execution result: done at 1.60276 LI 0 11:45:48.150 Core 1 2014.10.24 00:00:00 Execution Module initialization complete. PI 0 11:45:48.150 Core 1 2014.10.27 15:07:19 stop-loss triggered #34 sell 2.2 GBPUSD 1.60276 sl: 1.61252 [#35 buy 2.2 GBPUSD at 1.61252] RG 0 11:45:48.150 Core 1 2014.10.27 15:07:19 deal #35 buy 2.2 GBPUSD at 1.61253 done (based on order #35) HM 0 11:45:48.150 Core 1 2014.10.27 15:07:19 deal performed [#35 buy 2.2 GBPUSD at 78 1.61253] DP 0 11:45:48.150 Core 1 2014.10.27 15:07:19 order performed buy 2.2 at 1.61253 [#35 buy 2.2 GBPUSD at 1.61252] CP 0 11:45:48.150 Core 1 2014.11.07 00:00:00 sellSignal HE 0 11:45:48.150 Core 1 2014.11.07 00:00:00 sell_order_approved FQ 0 11:45:48.150 Core 1 2014.11.07 00:00:00 market sell 1.19 GBPUSD sl: 1.60107 (1.58340 / 1.58350 / 1.58340) RE 0 11:45:48.150 Core 1 2014.11.07 00:00:00 deal #36 sell 1.19 GBPUSD at 1.58340 done (based on order #36) EK 0 11:45:48.150 Core 1 2014.11.07 00:00:00 deal performed [#36 sell 1.19 GBPUSD at 1.58340] FJ 0 11:45:48.150 Core 1 2014.11.07 00:00:00 order performed sell 1.19 at 1.58340 [#36 sell 1.19 GBPUSD at 1.58340] NG 0 11:45:48.150 Core 1 2014.11.07 00:00:00 CTrade::OrderSend: market sell 1.19 GBPUSD sl: 1.60107 [done at 1.58340] NQ 0 11:45:48.150 Core 1 2014.11.07 00:00:00 Execution result: done at 1.58340 LN 0 11:45:48.150 Core 1 2014.11.07 00:00:00 Execution Module initialization complete. EE 0 11:45:48.150 Core 1 2015.02.09 00:00:00 market buy 1.19 GBPUSD, close #36 (1.52265 / 1.52299 / 1.52265) PF 0 11:45:48.150 Core 1 2015.02.09 00:00:00 deal #37 buy 1.19 GBPUSD at 1.52299 done (based on order #37) JH 0 11:45:48.150 Core 1 2015.02.09 00:00:00 deal performed [#37 buy 1.19 GBPUSD at 1.52299] FN 0 11:45:48.150 Core 1 2015.02.09 00:00:00 order performed buy 1.19 at 1.52299 [#37 buy 1.19 GBPUSD at 1.52299] GP 0 11:45:48.150 Core 1 2015.02.09 00:00:00 CTrade::OrderSend: market buy 1.19 position #36 GBPUSD [done at 1.52299] LL 0 11:45:48.150 Core 1 2015.02.09 00:00:00 Execution result: done at 1.52299 OD 0 11:45:48.150 Core 1 2015.03.25 00:00:00 sellSignal PP 0 11:45:48.150 Core 1 2015.03.25 00:00:00 sell_order_approved LF 0 11:45:48.150 Core 1 2015.03.25 00:00:00 market sell 0.7 GBPUSD sl: 1.51648 (1.48438 / 1.48454 / 1.48438) IJ 0 11:45:48.150 Core 1 2015.03.25 00:00:00 deal #38 sell 0.7 GBPUSD at 1.48438 done (based on order #38) NE 0 11:45:48.150 Core 1 2015.03.25 00:00:00 deal performed [#38 sell 0.7 GBPUSD at 1.48438] RO 0 11:45:48.150 Core 1 2015.03.25 00:00:00 order performed sell 0.7 at 1.48438 [#38 sell 0.7 GBPUSD at 1.48438] GL 0 11:45:48.150 Core 1 2015.03.25 00:00:00 CTrade::OrderSend: market sell 0.70 GBPUSD sl: 1.51648 [done at 1.48438] GL 0 11:45:48.150 Core 1 2015.03.25 00:00:00 Execution result: done at 1.48438 JH 0 11:45:48.150 Core 1 2015.03.25 00:00:00 Execution Module initialization complete. NK 0 11:45:48.150 Core 1 2015.04.24 00:01:30 market buy 0.7 GBPUSD, close #38 (1.50584 / 1.50600 / 1.50584) KP 0 11:45:48.150 Core 1 2015.04.24 00:01:30 deal #39 buy 0.7 GBPUSD at 1.50600 done (based on order #39) EQ 0 11:45:48.150 Core 1 2015.04.24 00:01:30 deal performed [#39 buy 0.7 GBPUSD at 1.50600] OD 0 11:45:48.150 Core 1 2015.04.24 00:01:30 order performed buy 0.7 at 1.50600 [#39 buy 0.7 GBPUSD at 1.50600] NF 0 11:45:48.150 Core 1 2015.04.24 00:01:30 CTrade::OrderSend: market buy 0.70 position #38 GBPUSD [done at 1.50600] MK 0 11:45:48.150 Core 1 2015.04.24 00:01:30 Execution result: done at 1.50600 RN 0 11:45:54.253 Core 1 2015.12.28 00:05:00 sellSignal MJ 0 11:45:54.253 Core 1 2015.12.28 00:05:00 sell_order_approved MO 0 11:45:54.253 Core 1 2015.12.28 00:05:00 market sell 4.56 GBPUSD sl: 1.49495 (1.49008 / 1.49038 / 1.49008) DO 0 11:45:54.253 Core 1 2015.12.28 00:05:00 deal #40 sell 4.56 GBPUSD at 1.49008 done (based on order #40) PM 0 11:45:54.253 Core 1 2015.12.28 00:05:00 deal performed [#40 sell 4.56 GBPUSD at 1.49008] PD 0 11:45:54.253 Core 1 2015.12.28 00:05:00 order performed sell 4.56 at 1.49008 [#40 sell 4.56 GBPUSD at 1.49008] CI 0 11:45:54.253 Core 1 2015.12.28 00:05:00 CTrade::OrderSend: market sell 4.56 GBPUSD sl: 1.49495 [done at 1.49008] NK 0 11:45:54.253 Core 1 2015.12.28 00:05:00 Execution result: done at 1.49008 IS 0 11:45:54.253 Core 1 2015.12.28 00:05:00 Execution Module initialization complete. RR 0 11:45:54.253 Core 1 2016.02.05 00:00:00 market buy 4.56 GBPUSD, close #40 (1.45877 / 1.45914 / 1.45877) DM 0 11:45:54.253 Core 1 2016.02.05 00:00:00 deal #41 buy 4.56 GBPUSD at 1.45914 done (based on order #41) MG 0 11:45:54.253 Core 1 2016.02.05 00:00:00 deal performed [#41 buy 4.56 GBPUSD at 1.45914] KI 0 11:45:54.253 Core 1 2016.02.05 00:00:00 order performed buy 4.56 at 1.45914 [#41 buy 4.56 GBPUSD at 1.45914] LJ 0 11:45:54.253 Core 1 2016.02.05 00:00:00 CTrade::OrderSend: market buy 4.56 position #40 GBPUSD [done at 1.45914] NF 0 11:45:54.253 Core 1 2016.02.05 00:00:00 Execution result: done at 1.45914 GS 0 11:45:54.253 Core 1 2016.02.29 00:00:30 sellSignal HF 0 11:45:54.253 Core 1 2016.02.29 00:00:30 sell_order_approved HR 0 11:45:54.253 Core 1 2016.02.29 00:00:30 market sell 0.56 GBPUSD sl: 1.43059 (1.38557 / 1.38610 / 1.38557) FR 0 11:45:54.253 Core 1 2016.02.29 00:00:30 deal #42 sell 0.56 GBPUSD at 1.38557 done (based on order #42) LH 0 11:45:54.253 Core 1 2016.02.29 00:00:30 deal performed [#42 sell 0.56 GBPUSD at 1.38557] CI 0 11:45:54.253 Core 1 2016.02.29 00:00:30 order performed sell 0.56 at 1.38557 [#42 sell 0.56 GBPUSD at 1.38557] 79 KF 0 11:45:54.253 Core 1 2016.02.29 00:00:30 CTrade::OrderSend: market sell 0.56 GBPUSD sl: 1.43059 [done at 1.38557] PF 0 11:45:54.253 Core 1 2016.02.29 00:00:30 Execution result: done at 1.38557 LO 0 11:45:54.253 Core 1 2016.02.29 00:00:30 Execution Module initialization complete. QG 0 11:45:54.253 Core 1 2016.03.10 17:58:54 stop-loss triggered #42 sell 0.56 GBPUSD 1.38557 sl: 1.43059 [#43 buy 0.56 GBPUSD at 1.43059] EM 0 11:45:54.253 Core 1 2016.03.10 17:58:54 deal #43 buy 0.56 GBPUSD at 1.43059 done (based on order #43) FD 0 11:45:54.253 Core 1 2016.03.10 17:58:54 deal performed [#43 buy 0.56 GBPUSD at 1.43059] FJ 0 11:45:54.253 Core 1 2016.03.10 17:58:54 order performed buy 0.56 at 1.43059 [#43 buy 0.56 GBPUSD at 1.43059] JI 0 11:45:54.253 Core 1 2016.04.13 00:00:30 sellSignal FI 0 11:45:54.253 Core 1 2016.04.13 00:00:30 Type: Sell | EP: 1.42722 | SL: 1.41707 | Diff: -0.01014999999999988 HE 0 11:45:54.253 Core 1 2016.04.13 00:00:30 tradeRejected: SL incompatible with trade LH 0 11:46:00.356 Core 1 2016.07.15 00:00:00 sellSignal QN 0 11:46:00.356 Core 1 2016.07.15 00:00:00 Type: Sell | EP: 1.33384 | SL: 1.30177 | Diff: -0.03207000000000004 JD 0 11:46:00.356 Core 1 2016.07.15 00:00:00 tradeRejected: SL incompatible with trade IK 0 11:46:00.356 Core 1 2016.08.15 00:01:30 sellSignal JN 0 11:46:00.356 Core 1 2016.08.15 00:01:30 sell_order_approved OJ 0 11:46:00.356 Core 1 2016.08.15 00:01:30 market sell 1.39 GBPUSD sl: 1.30960 (1.29195 / 1.29245 / 1.29195) FJ 0 11:46:00.356 Core 1 2016.08.15 00:01:30 deal #44 sell 1.39 GBPUSD at 1.29195 done (based on order #44) RP 0 11:46:00.356 Core 1 2016.08.15 00:01:30 deal performed [#44 sell 1.39 GBPUSD at 1.29195] GQ 0 11:46:00.356 Core 1 2016.08.15 00:01:30 order performed sell 1.39 at 1.29195 [#44 sell 1.39 GBPUSD at 1.29195] RN 0 11:46:00.356 Core 1 2016.08.15 00:01:30 CTrade::OrderSend: market sell 1.39 GBPUSD sl: 1.30960 [done at 1.29195] HN 0 11:46:00.356 Core 1 2016.08.15 00:01:30 Execution result: done at 1.29195 NG 0 11:46:00.356 Core 1 2016.08.15 00:01:30 Execution Module initialization complete. OO 0 11:46:00.356 Core 1 2016.08.18 11:30:15 stop-loss triggered #44 sell 1.39 GBPUSD 1.29195 sl: 1.30960 [#45 buy 1.39 GBPUSD at 1.30960] HE 0 11:46:00.356 Core 1 2016.08.18 11:30:15 deal #45 buy 1.39 GBPUSD at 1.30960 done (based on order #45) EL 0 11:46:00.356 Core 1 2016.08.18 11:30:15 deal performed [#45 buy 1.39 GBPUSD at 1.30960] PR 0 11:46:00.356 Core 1 2016.08.18 11:30:15 order performed buy 1.39 at 1.30960 [#45 buy 1.39 GBPUSD at 1.30960] GQ 0 11:46:00.356 Core 1 2016.10.10 00:00:00 sellSignal HS 0 11:46:00.356 Core 1 2016.10.10 00:00:00 sell_order_approved HP 0 11:46:00.356 Core 1 2016.10.10 00:00:00 market sell 0.44 GBPUSD sl: 1.29459 (1.23946 / 1.23996 / 1.23946) QD 0 11:46:00.356 Core 1 2016.10.10 00:00:00 deal #46 sell 0.44 GBPUSD at 1.23946 done (based on order #46) KJ 0 11:46:00.356 Core 1 2016.10.10 00:00:00 deal performed [#46 sell 0.44 GBPUSD at 1.23946] OK 0 11:46:00.356 Core 1 2016.10.10 00:00:00 order performed sell 0.44 at 1.23946 [#46 sell 0.44 GBPUSD at 1.23946] HP 0 11:46:00.356 Core 1 2016.10.10 00:00:00 CTrade::OrderSend: market sell 0.44 GBPUSD sl: 1.29459 [done at 1.23946] FP 0 11:46:00.356 Core 1 2016.10.10 00:00:00 Execution result: done at 1.23946 LL 0 11:46:00.356 Core 1 2016.10.10 00:00:00 Execution Module initialization complete. CD 0 11:46:00.356 Core 1 2016.11.07 00:00:30 market buy 0.44 GBPUSD, close #46 (1.24558 / 1.24608 / 1.24558) KG 0 11:46:00.356 Core 1 2016.11.07 00:00:30 deal #47 buy 0.44 GBPUSD at 1.24608 done (based on order #47) PN 0 11:46:00.356 Core 1 2016.11.07 00:00:30 deal performed [#47 buy 0.44 GBPUSD at 1.24608] PP 0 11:46:00.356 Core 1 2016.11.07 00:00:30 order performed buy 0.44 at 1.24608 [#47 buy 0.44 GBPUSD at 1.24608] MQ 0 11:46:00.356 Core 1 2016.11.07 00:00:30 CTrade::OrderSend: market buy 0.44 position #46 GBPUSD [done at 1.24608] HO 0 11:46:00.356 Core 1 2016.11.07 00:00:30 Execution result: done at 1.24608 NJ 0 11:46:06.460 Core 1 2017.01.10 00:00:00 sellSignal QO 0 11:46:06.460 Core 1 2017.01.10 00:00:00 sell_order_approved KK 0 11:46:06.460 Core 1 2017.01.10 00:00:00 market sell 1.61 GBPUSD sl: 1.23064 (1.21570 / 1.21620 / 1.21570) CK 0 11:46:06.460 Core 1 2017.01.10 00:00:00 deal #48 sell 1.61 GBPUSD at 1.21570 done (based on order #48) GQ 0 11:46:06.460 Core 1 2017.01.10 00:00:00 deal performed [#48 sell 1.61 GBPUSD at 1.21570] DP 0 11:46:06.460 Core 1 2017.01.10 00:00:00 order performed sell 1.61 at 1.21570 [#48 sell 1.61 GBPUSD at 1.21570] JM 0 11:46:06.460 Core 1 2017.01.10 00:00:00 CTrade::OrderSend: market sell 1.61 GBPUSD sl: 1.23064 [done at 1.21570] NO 0 11:46:06.460 Core 1 2017.01.10 00:00:00 Execution result: done at 1.21570 EH 0 11:46:06.460 Core 1 2017.01.10 00:00:00 Execution Module initialization complete. LN 0 11:46:06.460 Core 1 2017.01.12 10:45:32 stop-loss triggered #48 sell 1.61 GBPUSD 1.21570 sl: 1.23064 [#49 buy 1.61 GBPUSD at 1.23064] GD 0 11:46:06.460 Core 1 2017.01.12 10:45:32 deal #49 buy 1.61 GBPUSD at 1.23065 done (based on order #49) RO 0 11:46:06.460 Core 1 2017.01.12 10:45:32 deal performed [#49 buy 1.61 GBPUSD at 1.23065] EQ 0 11:46:06.460 Core 1 2017.01.12 10:45:32 order performed buy 1.61 at 1.23065 [#49 86 return "tradeRejected: SL incompatible with trade"; } //Calculating the contract size double balance = NormalizeDouble(AccountInfoDouble(ACCOUNT_BALANCE), ACCOUNT_CURRENCY_DIGITS); double moneyRisk = balance * riskSize; //- Calculating the value of 1 basis point (1 pip) double pipValue = 0.0; // if(_Symbol == "EURUSD" || _Symbol == "GBPUSD" || _Symbol == "NZDUSD" || _Symbol == "AUDUSD") pipValue = 10.0; else if(_Symbol == "USDCAD" || _Symbol == "USDCHF") pipValue = NormalizeDouble(10/ask, _Digits); else if(_Symbol == "USDJPY") pipValue = NormalizeDouble((10/ask)*100, _Digits); else { Print(_Symbol, " is not an tradable Asset. Select a new asset."); return "tradeRejected: invalid asset."; } // Adjusting base values for setting the Stop-loss double SLpips = 0.0; // if(_Symbol != "USDJPY") { SLpips = NormalizeDouble((ask - stopLoss) * 10000, 1); } else SLpips = NormalizeDouble((ask - stopLoss) * 100, 1); lotSize = NormalizeDouble(moneyRisk / (SLpips * pipValue), 2); ArrayFree(barInfo); // return "buy_order_approved"; } //--- If signal is a Sell else if(signalReceived == "sellSignal") { // Setting the Stop-loss MqlRates barInfo[]; CopyRates(_Symbol, _Period, 0, 10, barInfo); ArraySetAsSeries(barInfo, true); // stopLoss = barInfo[5].high; double bid = NormalizeDouble(SymbolInfoDouble(_Symbol, SYMBOL_BID), _Digits); // Double check if a stop-loss value was attributed if(stopLoss <= 0 || stopLoss <= bid) { if(fileHandle != INVALID_HANDLE) { write_file("Sell,” bid, stopLoss, NormalizeDouble(stopLoss - bid, _Digits)); } else Print("Operation FileOpen failed, error ,”GetLastError()); return "tradeRejected: SL incompatible with trade"; } //Calculating the contract size double balance = NormalizeDouble(AccountInfoDouble(ACCOUNT_BALANCE), ACCOUNT_CURRENCY_DIGITS); double moneyRisk = balance * riskSize; //- Calculating the value of 1 basis point (1 pip) double pipValue = 0.0; if(_Symbol == "EURUSD" || 87 _Symbol == "GBPUSD" || _Symbol == "NZDUSD" || _Symbol == "AUDUSD") pipValue = 10.0; else if(_Symbol == "USDCAD" || _Symbol == "USDCHF") pipValue = NormalizeDouble(10/bid, _Digits); else if(_Symbol == "USDJPY") pipValue = NormalizeDouble((10/bid)*100, _Digits); else { Print(_Symbol, " is not an tradable Asset. Select a new asset."); return "tradeRejected: invalid asset."; } // Adjusting base values for setting the Stop-loss double SLpips = 0.0; if(_Symbol != "USDJPY") { SLpips = NormalizeDouble((stopLoss - bid) * 10000, 1); } else SLpips = NormalizeDouble((stopLoss - bid) * 100, 1); lotSize = NormalizeDouble(moneyRisk / (SLpips * pipValue), 2); ArrayFree(barInfo); // return "sell_order_approved"; } else return "tradeRejected"; } void execution_model(string execute_trade) { //--- If trade is a BUY if(execute_trade == "buy_order_approved") { trader.Buy(lotSize, _Symbol, SYMBOL_ASK, stopLoss, 0, "sp: " + IntegerToString(SYMBOL_SPREAD)); // Check trade request status Print("Execution result: ,” trader.ResultRetcodeDescription()); } //--- Execute a SELL order if(execute_trade == "sell_order_approved") { trader.Sell(lotSize, _Symbol, SYMBOL_BID, stopLoss, 0, "sp: " + IntegerToString(SYMBOL_SPREAD)); // Check trade request status Print("Execution result: ,” trader.ResultRetcodeDescription()); } Print("Execution Module initialization complete."); } void position_management() { //---Reading and handling Indicators data 88 int MA1Handle, MA2Handle; // Get handle for indicators MA1Handle = iMA(_Symbol, _Period, fastMA1, 0, MODE_SMA, PRICE_CLOSE); MA2Handle = iMA(_Symbol, _Period, fastMA2, 0, MODE_SMA, PRICE_CLOSE); // check for errors if((MA1Handle == INVALID_HANDLE)|| (MA2Handle == INVALID_HANDLE)) { Alert("Unable to get handle. ERROR ,” GetLastError()); ResetLastError(); } // Copy data and check for errors int bars = 3; double MA1Array[], MA2Array[]; if(!CopyBuffer(MA1Handle, 0, 0, bars, MA1Array) || !CopyBuffer(MA2Handle, 0, 0, bars, MA2Array)) { Alert("Unable to copy data. ERROR ,” GetLastError()); ResetLastError(); } // Sort arrays ArraySetAsSeries(MA1Array, true); ArraySetAsSeries(MA2Array, true); // If position is a buy if(trader.RequestType() == ORDER_TYPE_BUY) { if(MA1Array[1] < MA2Array[1]) { trader.PositionClose(trader.RequestSymbol()); Print("Execution result: ,” trader.ResultRetcodeDescription()); } } // If position is a sell else if(trader.RequestType() == ORDER_TYPE_SELL) { //--- Test if condition holds if(MA1Array[1] > MA2Array[1]) { trader.PositionClose(trader.RequestSymbol()); Print("Execution result: ,” trader.ResultRetcodeDescription()); } } } void write_file(string type, double EP, double SL, double Diff) { FileWrite(fileHandle, type, DoubleToString(EP), DoubleToString(SL), DoubleToString(Diff)); } bool new_candle() { /*Returns true whenever there is a new candle in the current chart time frame. Otherwise, returns false.*/ MqlRates barInfo[]; CopyRates(_Symbol, _Period, 0, 1, barInfo); // Capture the time of the current bar static datetime timeStampLastCheck; datetime timeStampCurrentCandle; timeStampCurrentCandle = barInfo[0].time; 89 // Verify the event of a new bar if(timeStampLastCheck != timeStampCurrentCandle) { timeStampLastCheck = timeStampCurrentCandle; return true; } else return false; } Page | i