How I Optimize my EAs: New Set Files Twice a Year with Monthly Performance Assessments


Winning in the forex market is one of the toughest challenges out there. It’s a constant battle against large participants like institutional traders, banks, and others whose primary objective is to take your money and everyone else’s.

Given this, while I strive to provide honest and well-designed EAs that have the potential to generate decent profits if the market conditions are favorable, I cannot make any promises or guarantees regarding their performance.

If you review my general advice on using all my EAs, you will gain a better understanding of the philosophy behind them:

Advice: None of my EAs are miracle products capable of predicting the market. Instead, they are honest, well-coded expert advisors designed to win more than they lose. They do not employ martingale or grid strategies, which means their results won’t consistently show an upward profit curve; there may be ups and downs. Success with them requires patience and discipline. My general recommendation is to test all the provided set files in your strategy tester. If you discover any interesting results, consider making a purchase. I regularly optimize all my EAs and release new set files twice a year. Additionally, at the end of each month, I assess the performance of all the provided set files and offer new suggestions based on the symbols that have performed the best over the last 2-3 months. I advise you to trade only with the best-performing set files, limiting your risk to 0.5% or 1% per symbol, rather than using all of them.

How I Optimize my EAs: New Set Files Twice a Year with Monthly Performance Assessments

Around May and November each year, I begin optimizing all my EAs to prepare updated set files for their users. Below, I outline the step-by-step process I follow to produce effective and potentially profitable set files for various popular trading instruments.

For this optimization guide, I’ll use the EURUSD optimization of the Heiken Ashi EA MT5 as an example.

Step 1: Opening the Strategy Tester

Start by opening the Strategy Tester in the MT5 terminal (MT5 >> View >> Strategy Tester). Note: If you’re aiming for meaningful optimizations and reliable backtesting results, always use the MT5 Strategy Tester. It is significantly superior to the MT4 version in terms of accuracy and functionality.

Step 2: Selecting the Expert Advisor for Optimization

Click the Single icon at the top-left corner of the Strategy Tester options (1) to test and optimize a specific expert advisor (EA). For this example, I’ll be working with the Heiken Ashi EA MT5.

Step 3: Configuring the Strategy Tester for Backtesting

Go to the Settings tab of the Strategy Tester (2) and select the parameters needed for an initial backtest of the EURUSD symbol with the Heiken Ashi EA MT5. This step ensures the Strategy Tester downloads and uses the best possible historical tick data for subsequent optimizations.

Step 4: Adjusting the Backtest Settings

In the Settings tab, configure the following options:

  • Select the Heiken Ashi EA MT5 in the Expert field (3).
  • Choose the EURUSD symbol (4).
  • Pick the appropriate Timeframe (5). Note: For my EAs, the timeframe is not crucial as they include timeframe-specific settings internally.
  • Set a Custom Period in the Date field (6). For this example, I’ll use 1st January 2024 to 31st December 2024 to optimize for the entire year and prepare a set file for use in 2025.
  • Leave the Forward Optimization option set to No (7) for now.
  • Adjust the Delay to 50ms (8).
  • Choose Every tick based on real ticks for the Modelling quality (9).
  • Set your starting Balance (10), Currency (11), and Leverage (12).
  • Ensure the Optimization field is set to Disabled (13).

Step 5: Loading Previous Set Files and Running the Backtest

  • Navigate to the Inputs tab in the Strategy Tester (14).
  • Right-click in the white area at the top (16) and load an older, previously optimized set file for the symbol you want to test—in this case, EURUSD.
  • Once the set file is loaded, click the Start button at the bottom-right corner to begin the backtest (16).

You can always find my latest optimized set files and up-to-date recommendations for the current running month in the Backtests & Set Files blogs for all my EAs. Here are the links:

Heiken Ashi EA MT4/5: https://www.mql5.com/en/blogs/post/745696

Japanese Candlestick Patterns EA MT4/5: https://www.mql5.com/en/blogs/post/745873

Matrix Arrow EA MT4/5: https://www.mql5.com/en/blogs/post/745695

Moving Average EA MT4/5: https://www.mql5.com/en/blogs/post/745753

RSI EA MT4/5: https://www.mql5.com/en/blogs/post/745685

Step 6: Preparing Settings for Optimization

  • After completing the backtest for the previous EURUSD set file, return to the Settings tab (17) to configure the optimization settings.
  • Keep the Expert, Symbol, Timeframe, and Date fields unchanged (18).
  • Set Forward Testing to 1/4 (19), which divides the optimization period into two parts:
    • The first 9 months of 2024 will be used to optimize the selected parameters.
    • The last 3 months (October, November, and December) will serve as the forward testing period to validate the optimized results.

Step 7: Choosing Optimization Parameters

  • Select 1-minute OHLC modelling quality (20) to significantly reduce optimization time to a few hours. If you were to use the ‘Every tick based on real ticks’ method, optimization could take over 3 days on an i7 8-core computer.
  • Choose ‘Fast genetic based algorithm’ in the Optimization field (21) for relatively quick yet effective optimization.
  • Leave the Optimization Factor set to the default ‘Balance max’ (22), as it aligns with the goal of producing a profitable set file. However, you can explore other factors, such as ‘Profit factor max’ or ‘Drawdown min’, if you have specific objectives for your strategy.
  • The Delays, Deposit, and Leverage fields remain unchanged.

Step 8: Loading the Optimization Set File

  • Navigate to the Inputs tab and right-click on the white area at the top to select Load (23). Choose the optimization set file containing the preset parameters and steps you want to optimize.
  • You can find these ‘Optimization Set Files’ in the ‘Backtests & Set Files’ blogs for all my EAs, using the links provided earlier.

Step 9: Configuring Optimization Parameters

  • To illustrate how optimization parameters and steps work, let’s review the Moving Average (MA) indicator filter as an example (24), which can be used with the Heiken Ashi EA.
  • To optimize whether the MA Filter should be used, tick the box for the ‘Use MA Filter’ setting on the left. Then, in the Start, Step, and Stop columns on the right, specify the range:
  • Since this is a binary setting (True/False), the optimization will test both options and determine if enabling or disabling the filter yields better results.
  • For the ‘MA Timeframe’ setting, select timeframes between 1 hour and 4 hours, as these are typically the most effective filtering periods based on experience.
  • Limiting the steps here avoids overly complex optimizations.
  • For the ‘MA Filter Period’, start with a value of 7 and increase in steps of 7, up to 49 (7, 14, 21, 28, 35, 42, and 49), resulting in 7 steps.
  • At the far right of the Inputs tab, you can see the number of steps being tested for each variable. These are multiplied together, as displayed at the bottom right of the tab, resulting in the total number of optimization combinations (24).

Testing Start and End Hours

Starting the Optimization

  • Once all parameters are set, click the green ‘Start’ button at the bottom-right corner of the strategy tester (26) to begin the optimization.

Step 10: Reviewing Optimization Results and Preparing for Backtests

  • Once the optimization is complete, two new tabs will appear at the bottom of the strategy tester:

    • Optimization Results (27)
    • Forward Results (28)
  • Before analyzing these results, we need to adjust some settings to perform checking backtests and identify the best set files:

    1. Go to the Settings tab (29).
    2. Set Forward to No (30) to disable forward testing temporarily.
    3. Change the Modelling option to Every tick based on real ticks (31) for maximum accuracy during backtesting.
    4. Set the Optimization field back to Disabled (32).

These changes ensure that the subsequent backtests provide precise and reliable results for the selected set files.

Step 11: Testing the Best Optimization Results

Now that the optimization is complete, the next step is to identify the most promising settings using the ‘Every tick based on real ticks’ modelling to ensure trustworthy results. Here’s how to proceed:

  1. Access Forward Results

    • Navigate to the Forward Results tab (33).
    • Review the Forward and Backtest columns in the upper-left corner of the tab to find the best-performing combinations of results.
  2. Analyze Forward and Backtest Results

    • Start with the best results in the Forward column, as these represent the last three months of the non-optimized period.
    • Confirm these results by checking the corresponding values in the Backtest column. Look for pairs where both Forward and Backtest results indicate strong performance.
    • Example: In this guide, I skip the first two rows where the forward results are strong, but the backtest results are weak (2507.81 & 497.23 and 2480.11 & 382.28). Instead, I consider the third row, which shows a more balanced combination:
      • Forward result: 2356.46
      • Backtest result: 1589.10 (34).
  3. Check Drawdown

    • Review the Drawdown % column, which displays the approximate maximum drawdown during the forward testing period. Avoid rows with a drawdown exceeding 30%, as they indicate higher risk.
    • To verify the drawdown for the backtest result, right-click the row and select Back Test Results to view detailed statistics for the first nine optimized months. Skip any rows with a drawdown exceeding 30% during this period as well.
  4. Run a Full-Year Test

    • If the results meet your criteria, you can test the entire 12-month period (January–December 2024).
    • Double-click the blue row (34) or right-click it and select Run Single Test to begin testing.

This process ensures that you select optimization results with the best potential for consistent performance in the upcoming trading period.

Step 12: Reviewing the Test Results

After running the test for the row with a 2356.46 Forward result and a 1589.10 Backtest result, I review the generated Chart for its performance.

The chart reveals the following:

  • Poor performance in the initial months: The first months show suboptimal results, with minimal or no profit.
  • Rally in the forward testing months: A noticeable improvement occurs during the forward testing period, with a significant rally.
  • Inconsistent growth: Despite the rally, the chart exhibits considerable ups and downs, lacking the uniformity that would indicate steady performance.

This lack of consistency suggests that this set of parameters might not be ideal for achieving reliable and sustained profitability in live trading.

Step 13: Searching for the Best Growth Curve

I continue testing other interesting rows from the Forward Results tab, systematically evaluating each one for potential profitability. My goal is to identify a chart with the following characteristics:

  • Consistent growth: A smooth and steady upward curve with small ups and downs.
  • Attractive maximum drawdown: Typically within the range of 20-28%, which is manageable and indicates balanced risk.

When I find a chart that meets these criteria, it signifies a promising set of parameters to use as a starting point for creating a reliable and profitable set file for live trading.

Step 14: Verifying the Drawdown Values

Once I find a chart with a consistent growth curve and manageable drawdowns, I proceed to the Backtest tab of the strategy tester (35) to perform a final evaluation.

  1. I focus on the Relative Drawdown and Maximal Drawdown values (36).
  2. If both metrics fall within my acceptable range of 20-28%, I consider these settings a strong candidate for the final set file.

This set file will represent the optimized parameters for the selected EA and symbol and will be published in the Backtests & Set Files blog of my EA for the community to use.

Step 15: Finalizing and Saving the Best Set File

After testing multiple rows with promising Forward and Backtest results, I identify the best candidate based on the following criteria:

  • The most uniform growth curve in the chart.
  • The lowest and most attractive maximum drawdown in the Backtest tab.

Once I’ve selected the optimal settings:

  1. I navigate to the Inputs tab of the strategy tester.
  2. I right-click on the white area within the tab and select Save (37).
  3. This action saves the settings as a set file, which will be included in the published optimized set files for the Heiken Ashi EA on this symbol for the coming months.

These finalized set files, alongside other set files for various instruments, will be made available in the Backtests & Set Files blog of the EA.

Conclusion: A Step-by-Step Guide to EA Optimizations

This detailed guide explained the step-by-step process I follow to optimize my EAs and create the set files that I publish twice a year. These optimizations are typically performed in May-June and November-December each year.

After completing the optimization process, I evaluate the performance of the provided set files monthly. Based on the results, I publish new recommendations for the best-performing symbols over the last 2-3 months.

For optimal results, I strongly recommend:

  • Trading only with the best-performing set files.
  • Limiting your risk to 0.5% or 1% per symbol.
  • Avoid using all available set files simultaneously to minimize exposure.

You can always find my latest set files and recommendations in the Backtests & Set Files blog, linked below:

Heiken Ashi EA MT4/5: https://www.mql5.com/en/blogs/post/745696

Japanese Candlestick Patterns EA MT4/5: https://www.mql5.com/en/blogs/post/745873

Matrix Arrow EA MT4/5: https://www.mql5.com/en/blogs/post/745695

Moving Average EA MT4/5: https://www.mql5.com/en/blogs/post/745753

RSI EA MT4/5: https://www.mql5.com/en/blogs/post/745685

If you have any questions, feel free to contact me through my MQL5.com profile page at https://www.mql5.com/en/users/eleanna74 or via email at: info@juvenille-emperor.com.

Check all my products:

✔️ Local Trade Copier EA MT4©: https://www.mql5.com/en/market/product/68950

✔️ Local Trade Copier EA MT5©: https://www.mql5.com/en/market/product/68951

✔️ Matrix Arrow Indicator MT4©: https://www.mql5.com/en/market/product/69726

✔️ Matrix Arrow Indicator MT5©: https://www.mql5.com/en/market/product/69725

✔️ Matrix Arrow EA MT4©: https://www.mql5.com/en/market/product/70812

✔️ Matrix Arrow EA MT5©: https://www.mql5.com/en/market/product/70813

✔️ Heiken Ashi EA MT4©: https://www.mql5.com/en/market/product/45283

✔️ Heiken Ashi EA MT5©: https://www.mql5.com/en/market/product/64877

✔️ Japanese Candlestick Patterns EA ΜΤ4©: https://www.mql5.com/en/market/product/45732

✔️ Japanese Candlestick Patterns EA ΜΤ5©: https://www.mql5.com/en/market/product/45800

✔️ RSI EA MT4©: https://www.mql5.com/en/market/product/45228

✔️ RSI EA MT5©: https://www.mql5.com/en/market/product/67625

✔️ Moving Average EA ΜΤ4©: https://www.mql5.com/en/market/product/45633

✔️ Moving Average EA ΜΤ5©: https://www.mql5.com/en/market/product/47673

✔️ Colossus EA MT5©: https://www.mql5.com/en/market/product/64856

✔️ Manual Trade Panel EA MT4©: https://www.mql5.com/en/market/product/72964

✔️ Manual Trade Panel EA MT5©: https://www.mql5.com/en/market/product/72965

✔️ Signal Multiplier EA MT4©: https://www.mql5.com/en/market/product/68556

✔️ Signal Multiplier EA MT5©: https://www.mql5.com/en/market/product/68816

✔️ Currency Strength Indicator for MT4©: https://www.mql5.com/en/market/product/74444

✔️ Currency Strength Indicator for MT5©: https://www.mql5.com/en/market/product/74454

✔️ Currency Strength Trade Panel EA MT4©: https://www.mql5.com/en/market/product/74366

✔️ Currency Strength Trade Panel EA MT5©: https://www.mql5.com/en/market/product/74367

✔️ Price Action Indicator MT4©: https://www.mql5.com/en/market/product/75519

✔️ Price Action Indicator MT5©: https://www.mql5.com/en/market/product/75520

✔️ Price Action Trade Panel EA MT4©: https://www.mql5.com/en/market/product/75582

✔️ Price Action Trade Panel EA MT5©: https://www.mql5.com/en/market/product/75583

✔️ Orca EA MT4©: https://www.mql5.com/en/market/product/45362

✔️ Orca EA MT5©: https://www.mql5.com/en/market/product/45363

✔️ Basket EA MT4©: https://www.mql5.com/en/market/product/45192

✔️ Basket EA MT5©: https://www.mql5.com/en/market/product/72782

✔️ Partial Closure EA MT4©: https://www.mql5.com/en/market/product/82356

✔️ Partial Closure EA MT5©: https://www.mql5.com/en/market/product/82357



Source link

Leave a Comment