Categories
Forex System Design

How to Read a Simulation Report

Introduction

When the developer performs the trading strategy design, it evaluates through a historical simulation process to overview its results under certain conditions. However, once finished the simulation, the software delivers a series of data that could confuse the developer with a broad kind of information provided by the report.

In this educational article, we will present the main elements of the historical simulation report.

Essential Data of the Historical Simulation Report

Within the wide variety of platforms that allow historical simulations, there is a set of essential data that the software provides at the end of the simulation process. These data are grouped into three large blocks: Performance Summary, Equity Chart, and Trades List.

The following figure shows the example of a report of a historical simulation performed in Strategy Tester of MetaTrader 4.

The report presents three blocks, which are detailed as follows.

Performance Data Summary

This section provides summarized statistical data from the historical simulation of the trading strategy. The key performance indicators are as follows:

  • Total Net Profit: This is the financial result of all trades executed during the simulation period. This value corresponds to the difference between the “Gross Profit” and the “Gross Loss.” A reading above zero is indicative of a trading strategy with positive mathematical expectation.
  • Maximal Drawdown: This is the highest local maximum loss expressed in the deposit currency and percentage of the deposit. In general terms, this value should be as low as possible. The criterion of maximum permissible drawdown will depend on the risk target of the trading strategy developer.
  • Total Trades: Corresponds to the total number of trades executed during the historical simulation. The developer might consider this value to assess the level of aggressiveness of the strategy. Also, it can use it to value the strategy in terms of its operational costs. For example, a strategy with a high number of trades could be more aggressive for a conservative investor. In turn, it implies a high operational cost in terms of paying commissions.
  • Percentage of Trades Winners: This is the number of profitable trading positions divided by the total number of positions. 
  • Profit Factor: This is the relationship between Gross Profit and Gross Loss. A reading lower than 1 suggests that the strategy generates more losses than gains. On the contrary, if it is greater than 1, then the strategy provides more profit than losses for each currency unit invested.
  • Sharpe Ratio: Some historical simulation platforms of trading strategies provide the Sharpe Ratio. This indicator represents the expected return on a risk-adjusted investment of an asset. In general, investors tend to consider as risk-free return the rate of the United States Treasury bond. A reading of less than 1 suggests that the trading strategy provides more volatile results. In other words, the developer could assume that the trading system is riskier than another with a ratio greater than 1.

Balance Curve

The balance curve chart presents the cumulative result of the trading strategy using a line chart. The information provided in this chart represents the result of the strategy execution under conditions and parameters in which the developer carried out the historical simulation.

Considering the investor’s objectives, the developer could improve its performance by optimizing the initial parameters.

List of Trades

This section of the report shows in detail each trade that the strategy performed during the simulation period. This list usually shows the following data:

  • Date of entry.
  • Type of order (buy, sell).
  • Entry price.
  • Size of the position.
  • Date of close.
  • Closing price.
  • Profit or loss of the trade.
  • Profits and losses accumulated or Balance.

 

Conclusions

The historical simulation process provides an overview of trading strategy behavior according to the developer’s parameters initially defined. This information is reflected in the simulation report, which provides a wide variety of information about the strategy’s performance under predetermined conditions.

Within the information provided at the end of the historical simulation, there are key data that the developer should not fail to value these are: Total Net Profit, Maximal Drawdown, Total Trades, Percentage of Trades Winners, Profit Factor, and Sharpe Ratio, which some simulation software does not provide it. However, the lack of availability of this data is not a limitation for assessing the strategy’s performance but will depend greatly on the criteria and experience of the developer of the trading strategy.

The developer can use this information to confirm that the trading strategy is proceeding as specified initially. Also, it can use this data to understand the strategy’s behavior during each trade.

This information is also important to spot potential improvements in the strategy. For instance, you could detect that several large losses may be trimmed with a better stop-loss replacement. You could also find out that a good portion of the trades was closed at a less than optimal level. The developer may conclude that the system would greatly improve with a better take-profit algorithm.

Also, the information gathered from the simulation may help improve the entries. For instance, you could find out that there are large losses at the beginning of the trade most of the time. That could signal the entries flag too quickly, or you may notice that the strategy would benefit from early entries to improve profits.

Finally, according to the developer’s objectives and the information analysis, the developer could attempt to adjust and optimize the needed parameters that could improve the strategy’s performance.

Suggested Readings

  • Pardo, R.; The Evaluation and Optimization of Trading Strategies; John Wiley & Sons; 2nd Edition (2008).

 

 

 

Categories
Forex Education

Getting Started with your First Historical Simulation

Introduction

In the previous section, we learned the steps to create a trading strategy. At this stage of the trading strategy development, we will focus on the strategy’s simulation process using historical data.

What is the Historical Simulation?

The simulation is defined as a mathematical representation that describes a system or process, making it possible to generate forecasts of such a system.

As the years have advanced, computational technologies have evolved to allow many processes simultaneously performed.  Compared to what a processor could do 40 years ago, a mere smartphone outruns any of them. In this context, the trading strategies simulation has also done so, moving from the simulation using printed paper charts to the current computer systems we observe today.

By running a historical simulation on a trading strategy, the developer should be able to estimate the gains and losses the strategy would have generated under historic market conditions within a given period.

However, while the benefit of executing a historical simulation enables one to estimate the profits and losses and whether the strategy is profitable or not, this statement should be analyzed by the developer throughout the trading strategy developing process.

Getting Started

Once the developer has completed a trading strategy, including entry and exit rules, as well as the definition of risk management and position sizing, it is necessary to formulate the rules of the strategy using a computer language. This way, the trading simulation software will execute the rules algorithm and apply it to the study’s financial dataset.

Several programming languages are able to carry out the trading strategy simulation, such as MQL4 of MetaTrader, Easy Language of Trade Station, or Python. However, for this educational article, we will continue to use the MetaTrader MQL4 language.

First Steps in the Simulator

MetaTrader 4 offers its Strategy Tester to simulate trading strategies. In the following figure, we observe the Strategy Tester terminal, in which we can develop a historical simulation of any trading strategy under study. 

The figure highlights that Strategy Tester has a user-friendly and intuitive interface for the developer, who can select the Expert Advisor that will contain the trading strategy to simulate. Similarly, the user can choose both the financial market, the timeframe, and the date span in which the simulation should run.

Running the First Simulation in Strategy Tester

In this example, we will continue using a moving-average-crossover-based trading strategy. To recap, this strategy is based on the following rules:

  • A buy position will be opened when the 5-hour weighted moving average (LWMA) crosses above the 55-hour simple moving average (SMA). 
  • A sell position will be activated when the 5-hour LWMA crosses below the 55-hour SMA.
  • The buy position will be closed when the LWMA 5-hour has crossed below the SMA 20-hour.
  • The sell position will be closed when the LWMA 5-hour has crossed over the SMA 20-hour.
  • The position sizing will be a constant 0.1-lot.
  • Only one trade at a time is allowed.

The criteria for the execution of the historical simulation are as follows:

  • Market to simulate: GBPUSD pair.
  • Timeframe: 1 hour.
  • Simulation range: from January/02/2014 to October/02/2020.

From the simulation’s execution, we observe the following result provided by the Strategy Tester at the end of the simulation.

From the above figure, we note that the balance line was reduced by $2,230.63 from the initial balance of $10,000, reaching a final balance of $7,769.37. This result leads us to conclude that the average-crossover strategy is not profitable. However, this is just a preliminary result.  It is still possible that we could make this strategy profitable through an optimization process, where we will assess what parameter values perform the best.  We could also add stop-loss and take-profit targets that statistically boost the system into profitable territory.

Conclusions

In this educational article, we have seen the first steps to perform a historical simulation. This process provides the developer with an overview of the strategy’s performance in a given financial market under certain conditions. We highlight that the performance conditions could repeat in the future. For this reason, once evaluated the strategy feasibility in terms of profitability, the developer should test the trading strategy during a specific period with paper money in real-time.

On the other hand, the profitable or non-profitable result is just a snapshot of the strategy’s performance. During the optimization process, the developer will investigate the parameters that provide higher profitability or lower risk for the investor.

The next educational article will review the simulator’s information in detail once the historical simulation has been executed.

Suggested Readings

  • Jaekle, U., Tomasini, E.; Trading Systems: A New Approach to System Development and Portfolio Optimisation; Harriman House Ltd.; 1st Edition (2009).
  • Pardo, R.; The Evaluation and Optimization of Trading Strategies; John Wiley & Sons; 2nd Edition (2008).