Scalper Deriv EA
Optimization Guide
Optimization Guide
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 any 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.
The goal of the following step-by-step optimization guide is to give the traders the tools to find a set file that suits their own unique profit objectives and risk management specifications, ensuring the best results when using the Scalper Deriv EA.
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 (Percentage on the balance): 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.
Maximum simultaneous open positions: Maximum open positions to be handled simultaneously.
News Filter
Avoid trading during high-impact news: Whether the EA is allowed to operate in high-impact news periods.
Block trades X minutes before news: Time (in minutes) to stop EA's operation before a high-impact news period.
Block trades X minutes after news: Time (in minutes) to stop EA's operation after a high-impact news period.
Trading Hours
Enable trading only during specified hours: Whether the EA is allowed to operate in a user-customized period.
Start of trading session (hh:mm): Specified time to start trading operations (in hours and minutes).
End of trading session (hh:mm): Specified time to finish trading operations (in hours and minutes).
Introduction to 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 set file for a day, optimize with data from the last 10 days.
For a weekly set file, optimize with data from the last 10 weeks.
For a monthly set file, 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.
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 yellow box should be selected and optimized. Below is a description of each of these parameters, showing the range of values used for optimization.
Input Parameters
Profit per cycle (1 = 1%)
Current Value: 1.6
Optimization Range: Start: 0.1
Step: 0.1
Stop: 3
Type of position
Current Value: Only Buy
Optimization Range: Options: Only Buy, Only Sell, Both.
Factor TP (min 0.5, max 20)
Current Value: 17.7
Optimization Range: Start: 0.5
Step: 0.1
Stop: 20.0
Factor A (min 0.5, max 10)
Current Value: 3.0
Optimization Range: Start: 0.5
Step: 0.1
Stop: 10.0
Input Parameters
Factor B (min 0.5, max 20)
Current Value: 4.9
Optimization Range: Start: 0.5
Step: 0.1
Stop: 20.0
Factor C (min 0.5, max 30)
Current Value: 11.4
Optimization Range: Start: 0.5
Step: 0.1
Stop: 30.0
Fractal (min 2, max 200)
Current Value: 40
Optimization Range: Start: 5
Step: 5
Stop: 200
Initial Setup:
Select the Expert Advisor (Scalper Deriv\Scalper Deriv.ex5) and the symbol (XAUUSD). This is just an example; you can select any symbol.
Configure the timeframe (M1) and the date range (Last year, 2024.01.01 - 2025.07.23). You can select any timeframe; M1 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:100). You can select any initial deposit and leverage values.
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.
Input Parameters Setup:
Adjust the input parameters using the start, step, and stop values indicated above.
Start the Optimization:
 Click the "Start" button to begin the optimization.
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 set file for your trading strategy.Â
Key Metrics
Pass: The number of optimization iterations completed. Each pass represents a unique combination of input parameters tested during the optimization process.
Result: The overall performance score for each pass. This is often based on the selected optimization criteria, such as balance or drawdown.
Profit: The total profit generated by the EA during the optimization period.
Total trades: The total number of trades executed by the EA in each pass.
Expected payoff: The average profit per trade, calculated as total profit divided by the number of trades.
Drawdown %: The maximum drawdown percentage experienced during the optimization period. This indicates the largest peak-to-trough decline in the account balance.
ProfitPerCycle: The profit per cycle setting used in the pass.
TypePosition: The type of trades executed (Only Buy, Only Sell, or Both).
Factor TP, Factor A, Factor B, Factor C: The values of these parameters used in each pass.
FractalMaxMin: The fractal parameter setting used in the pass.
To select the best set file, follow these steps:
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.
Check Stability: Ensure the selected pass shows consistent performance across different metrics. High profit with extremely high drawdown may not be desirable.
Review Trade Frequency: Ensure the total number of trades is reasonable. Too few trades might indicate insufficient data, while too many trades could mean signal over-optimization.
Analyze Expected Payoff: Higher expected payoff indicates more efficient trading. Select passes with a good balance between expected payoff and drawdown.
Consistency of Parameters: Ensure the selected set file has consistent and logical parameter values. Extreme values may suggest overfitting.
Plot the Balance/Equity Curves: In the Settings tab, select "Every tick" as the modelin type for a more realistic analysis, and disable the optimization algorithm by selecting "Disabled". Now, doble-click the desired pass from the Optimization Results tab to plot the Balance/Equity curves. See the results in the Graph tab.
Analyze the Metrics: To observe metrics such the Equity Drawdown Relative Percentage, click on the Backtest tab for a good risk selection criteria.
Export the Setfile: Once you identify the best pass, export the set file for use in live trading or further testing. In MetaTrader 5, click on the Inputs tab and right-click on the inputs of the desired pass, then select "Save" to save it as a set file.
Example
In the provided image, the forth pass, labeled as "0,53", has a profit of 8,986.03 and a drawdown of 31.75%. Despite the moderate profit, the drawdown is relatively low, suggesting a moderate-conservative risk strategy. Compare it with other passes to find a balance that fits your risk tolerance.
By plotting the balance/equity curves, you can get a good overview of the pass's behavior throughout the optimization period, as can be seen in the image below:
Finally, the equity drawdown relative percentage for this pass is 40.81%, which suggests a low-moderate risk strategy.
By carefully analyzing the optimization results, the plot of the balance/equity curves, and the backtest results, you can identify the most robust and profitable set files for your Scalper Deriv EA. This process helps ensure your trading strategy is both effective and sustainable.
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 set file, you can enhance your trading strategy and achieve more consistent results. Remember, the key is to balance profitability and risk management.
For a comprehensive tutorial on how to optimize your Scalper Deriv EA, watch our detailed video 👉