User Guide to Optimize the Scalper Deriv Expert Advisor

17 May 2024, 22:11
Antonio Simon Del Vecchio
0
218

Introduction

Scalper Deriv is an expert advisor (EA) designed to capitalize on price fluctuations by analyzing multiple timeframes simultaneously, with M1 (1 minute) being the primary one. It can be used on any symbol, with any leverage, and initial capital. Its strategy is based on Price Action and a mathematical model that decomposes the market into waves. Based on the behavior of these waves, market entry is decided.

Discover more about Scalper Deriv EA and boost your trading strategies today!

Input Parameters

  • Profit per cycle (1 = 1%): Defines the percentage of profit sought when reaching the take profit (TP). For example, with a balance of 1000 and a "profit per cycle" of 1, the profit will be 10 (1% of 1000) upon reaching the TP.
  • Type of position: Defines whether the trades will be buy, sell, or both.
  • Factor TP (min 0.5, max 20): This abstract parameter of the mathematical model defines the distance of the TP. The smaller the number, the closer the TP will be.
  • Factor A, B, C (min 0.5, max 30): Define the frequency of trades. The smaller the values, the higher the frequency of trades.
  • Fractal (min 2, max 200): Number of candles in the M1 timeframe considered to identify the last relevant high and low.
  • General Stop Loss: Maximum percentage of loss to close all positions with a loss. For example, if it's set to 50 and the balance is 1000, when the total profit reaches -500, all positions with a loss will be closed.

Input Parameters

Optimization Process

Introduction to the Fast Genetic Based Optimization Algorithm

Optimization is an essential process for improving the performance of any Expert Advisor (EA). The Fast Genetic Based Algorithm is an advanced technique that utilizes principles of genetics and evolution to search for the best parameter combinations. This algorithm significantly speeds up the optimization process, allowing for the efficient and effective exploration of a wide range of configurations.

This method mimics natural selection, combining and mutating input parameters to find optimal settings that maximize the EA's performance. It is especially useful when dealing with a large number of variables and potential combinations, as is the case with the Scalper Deriv EA.

Modeling Selection

For versions above 1.02, it is recommended to use "1 minute OHLC" for a faster optimization process.

Optimization Period

Apply the 10 to 1 principle:

  • For obtaining a setfile for a day, optimize with data from the last 10 days.
  • For a weekly setfile, optimize with data from the last 10 weeks.
  • For a monthly setfile, optimize with data from the last 10 months.

Optimization: Criteria Selection

Funded Accounts or Prop Firms

For users operating with funded accounts or prop firms, it's crucial to maintain strict control over risk and drawdown. Therefore, it is recommended to select one of the following optimization criteria:

  • Drawdown min: Minimizes drawdown to maintain account stability.
  • Complex Criterion max: Balances profit-seeking with drawdown control.

Additionally, set the "General Stop Loss" parameter below 5. This ensures that the EA will automatically close all positions if the drawdown approaches 5%, thus protecting the account from excessive losses.

Regular Accounts

For users with regular accounts who want to maximize profits, even if it means taking on higher risk, they may consider the following optimization criteria:

  • Balance Max: This criterion maximizes the account balance, seeking high returns in a short period, with associated risks.
  • Profit Factor Max: This criterion maximizes the profit factor, which is the ratio between gross profit and gross loss. A high profit factor indicates a more profitable and stable strategy over time.

In this case, users may opt for a more flexible "General Stop Loss" value, depending on their risk tolerance and performance objectives.

Settings

Explanation of the Inputs Tab

The Inputs tab in MetaTrader 5's Strategy Tester allows you to configure and optimize the parameters of the Expert Advisor (EA). In this example, only the parameters within the red box should be selected and optimized. Below is a description of each of these parameters, explaining their purpose and the range of values used for optimization.

Input Parameters

1. Profit per cycle (1 = 1%)

   - Description: Defines the percentage of profit sought when reaching the take profit (TP). For example, if the balance is 1000 and the "profit per cycle" is 1, the profit will be 10 (1% of 1000) when the TP is reached.

   - Current Value: 0.19

   - Optimization Range:

     - Start: 0.1

     - Step: 0.1

     - Stop: 3

2. Type of position

   - Description: Defines the type of trades the EA will execute (buy, sell, or both).

   - Current Value: Only Sell

   - Optimization Range:

     - Options: Only Buy, Only Sell, Both

3. Factor TP (min 0.5, max 20)

   - Description: This abstract parameter from the mathematical model defines the distance of the TP. The lower the number, the closer the TP will be.

   - Current Value: 6.1

   - Optimization Range:

     - Start: 0.5

     - Step: 0.1

     - Stop: 20

4. Factor A (min 0.5, max 10)

   - Description: Defines the frequency of trades. The lower the value, the higher the frequency of trades.

   - Current Value: 8.2

   - Optimization Range:

     - Start: 0.5

     - Step: 0.1

     - Stop: 10

5. Factor B (min 0.5, max 20)

   - Description: Defines the frequency of trades. The lower the value, the higher the frequency of trades.

   - Current Value: 6.0

   - Optimization Range:

     - Start: 0.5

     - Step: 0.1

     - Stop: 20

6. Factor C (min 0.5, max 30)

   - Description: Defines the frequency of trades. The lower the value, the higher the frequency of trades.

   - Current Value: 29.8

   - Optimization Range:

     - Start: 0.5

     - Step: 0.1

     - Stop: 30

7. Fractal (min 2, max 200)

   - Description: Number of candles in the M1 timeframe considered to identify the last relevant high and low.

   - Current Value: 168

   - Optimization Range:

     - Start: 2

     - Step: 1

     - Stop: 200


Steps for Optimization

1. Initial Setup:

   - Select the Expert Advisor (Scalper Deriv\Scalper Deriv.ex5) and the symbol (Volatility 10 Index). This is just an example; you can select any symbol.

   - Configure the timeframe (M5) and the date range (Last year, 2024.01.01 - 2024.05.16). You can select any timeframe; M5 is just part of the example. The date range should consider the 10 to 1 principle.

   - Select the modeling type ("1 minute OHLC") for a faster optimization.

   - Set the initial deposit (1000 USD) and leverage (1:500). You can select any initial deposit and leverage values.

2. Optimization Algorithm Setup:

   - Choose the optimization algorithm ("Fast genetic based algorithm").

   - Select the appropriate optimization criteria:

     - For funded accounts: It is not recommended to select Balance Max. Use criteria like Drawdown min or Complex Criterion max.

     - For regular accounts: Any optimization criterion can be selected, but Complex Criterion max is recommended.

3. Input Parameters Setup:

   - Adjust the input parameters using the start, step, and stop values indicated above.

4. Start the Optimization:

   - Click the "Start" button to begin the optimization.

Inputs Tab

Interpretation of Optimization Results

At the end of the optimization process, you will see a results window similar to the one shown below. Understanding this output is crucial for selecting the best setfile for your trading strategy.

Results

Key Metrics

1. Pass: The number of optimization iterations completed. Each pass represents a unique combination of input parameters tested during the optimization process.

2. Result: The overall performance score for each pass. This is often based on the selected optimization criteria, such as balance or drawdown.

3. Profit: The total profit generated by the EA during the optimization period.

4. Total trades: The total number of trades executed by the EA in each pass.

5. Expected payoff: The average profit per trade, calculated as total profit divided by the number of trades.

6. Drawdown %: The maximum drawdown percentage experienced during the optimization period. This indicates the largest peak-to-trough decline in the account balance.

7. ProfitPerCycle: The profit per cycle setting used in the pass.

8. TypePosition: The type of trades executed (Only Buy, Only Sell, or Both).

9. Factor TP, Factor A, Factor B, Factor C: The values of these parameters used in each pass.

10. FractalMaxMin: The fractal parameter setting used in the pass.

Steps to Select the Best Setfile

1. Evaluate the Criteria: Focus on passes with the best balance between high profit and low drawdown. The selected criteria (e.g., balance, drawdown) should guide this evaluation.

2. Check Stability: Ensure the selected pass shows consistent performance across different metrics. High profit with extremely high drawdown may not be desirable.

3. Review Trade Frequency: Ensure the total number of trades is reasonable. Too few trades might indicate insufficient data, while too many trades could signal over-optimization.

4. Analyze Expected Payoff: Higher expected payoff indicates more efficient trading. Select passes with a good balance between expected payoff and drawdown.

5. Consistency of Parameters: Ensure the selected setfile has consistent and logical parameter values. Extreme values may suggest overfitting.

6. Export Setfile: Once you identify the best pass, export the setfile for use in live trading or further testing. In MetaTrader 5, right-click on the desired pass and select "Save as Setfile".


Example

In the provided image, the pass with the highest result is "Pass 0,160" with a profit of 29,879.91 and a drawdown of 30.61%. Despite the high profit, the drawdown is relatively high, suggesting a higher risk strategy. Compare it with other passes to find a balance that fits your risk tolerance.

By carefully analyzing the optimization results, you can identify the most robust and profitable setfiles for your Scalper Deriv EA. This process helps ensure your trading strategy is both effective and sustainable.


Conclusion

Understanding and analyzing the optimization results is crucial for maximizing the performance of your Scalper Deriv EA. By following this guide and selecting the best setfile, you can enhance your trading strategy and achieve more consistent results. Remember, the key is to balance profitability and risk management.


Additional Resources

For a comprehensive tutorial on how to optimize your Scalper Deriv EA, watch our YouTube tutorial

Explore all of our Expert Advisors and enhance your trading experience by visiting our MQL5 profile.

For trading, we recommend using this broker.