Modify MT5 ontester function to omit duplicate result values

MQL5 Indicadores Asesores Expertos

Trabajo finalizado

Plazo de ejecución 5 días
Comentario del Cliente
Impossible project, my mistake due to limitations of mql5 ontester function. Despite this Saad put many hours into this project. A* would always recommend.
Comentario del Ejecutor
Great collaborating with you once more!

Tarea técnica

Hello

I want my custom max forumla used in MT5 modified to check the result, if there is a return value of the same number return zero / void the result to avoid getting mutliple results of the same value similar settings.

  • The problem is i get tons of results of the same value when doing many generic testing runs on MT5 (this is expected and normal)
  • I am looking for a solution when each test / run is complete it checks that the end results value is unique and if so it allows it to pass
  • If the value is a duplicate, it voids the result to 0 (currently I export to excel and remove duplicate rows that have the same result value to manually filter this out)
  • The aim is to only have unique results in the optimisation profile when its complete, allowing for a much faster testing scheme.
  • Note that there are tons of zero values and to avoid dividing by zero errors.
input string OnTester = "------------ Custom Max ------------";        // ------------ Custom Max ------------
input int    MinTrades = 20;                                           // Minimum required trades
input double MaxEquityDrawdown = 5.0;                                  // Maximum allowed drawdown
input string OnTesterEnd = "------------ Custom Max End ------------"; // ------------ Custom Max End ------------

double OnTester(void) {
    // Get the required statistics
    int totalTrades = TesterStatistics(STAT_TRADES);
    int profitTrades = TesterStatistics(STAT_PROFIT_TRADES);
    int lossTrades = TesterStatistics(STAT_LOSS_TRADES);
    double totalProfit = TesterStatistics(STAT_PROFIT);
    double profitFactor = TesterStatistics(STAT_PROFIT_FACTOR);
    double equityDrawdownPercent = TesterStatistics(STAT_EQUITY_DDREL_PERCENT);

    // Calculate the target drawdown as 50% of the MaxEquityDrawdown
    double TargetEquityDrawdown = MaxEquityDrawdown * 0.5;

    // Check the conditions for voiding the results
    if (totalTrades < MinTrades || equityDrawdownPercent > MaxEquityDrawdown || lossTrades == 0) {
        return 0; // Void the result if not meeting trade or drawdown criteria, or no losing trades
    }

    // Calculate the trade win ratio
    double tradeWinRatio = (double)profitTrades / (double)lossTrades;

    // Adjusted drawdown impact calculation
    double drawdownImpact = 1 - fabs(equityDrawdownPercent - TargetEquityDrawdown) / TargetEquityDrawdown;
    drawdownImpact = MathMax(0, drawdownImpact); // Ensure drawdown impact is not negative


    // Apply the new formula with adjusted drawdown impact
    double finalCriterion = (totalProfit / equityDrawdownPercent) * (profitFactor / tradeWinRatio) * drawdownImpact;

    return finalCriterion;
}

Han respondido

1
Desarrollador 1
Evaluación
(119)
Proyectos
140
23%
Arbitraje
5
0% / 60%
Caducado
4
3%
Trabajando
2
Desarrollador 2
Evaluación
(76)
Proyectos
95
34%
Arbitraje
8
88% / 0%
Caducado
0
Trabajando
3
Desarrollador 3
Evaluación
(163)
Proyectos
193
48%
Arbitraje
2
50% / 50%
Caducado
1
1%
Libre
4
Desarrollador 4
Evaluación
(4)
Proyectos
6
0%
Arbitraje
5
0% / 80%
Caducado
2
33%
Libre
5
Desarrollador 5
Evaluación
(251)
Proyectos
402
38%
Arbitraje
82
41% / 20%
Caducado
70
17%
Trabaja
6
Desarrollador 6
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
Solicitudes similares
HELLO AL DISCRIBTION OF THE JOB : I HAVE MY OWN SUBJECTIVE SUPPORT AND RESISTANCE METHOD THAT BASED ON THE SMART MONEY CONCEPTS IT IS LIKE HAVING SUPPORT AND RESISTANCE ON THE BREAK OF STRUCTURE OR CHANGE OF CHARECTER that can be used by any zig zag indicator . ========================================================================================= REQUIRMENTS OF THE DEVOLPER : 1 - UNDERSTANDING THE SMC , BOS
So looking to prevent multiple trades opening at the same time and fine a way to remove the draw down spikes that i see happening when optimising and converting it mt5 and what's your budget for this
I need an experienced developer to build the Cypher pattern scanner. Cypher pattern is a Harmonic pattern which consists of 5 legs (X-A-B-C-D), I will provide rules and conditions for the pattern and Scanner. Should be able to scan multi timeframes and multi patterns, create alert based on set conditions and should draw pattern on timeframe where pattern was discovered. Dashboard to display identified pattern based
Hello Developer, I am Darshan Galani. i want to Convert Tradingview Indicator to MQ4 & MQ5 file.i also want to source code that must be easy to understand. TradingView Indicator: LuxAlgo Trendlines with Breaks
Looking for someone who can convert 170 lines of pinescript to MT5. If you do the good job then more projects are waiting for you. That's why looking for individual freelancer only. File will be shared with right candidate. Thank you
I have existing Ctrader automated strategy that I am using but will like to add and remove some features and after that I will like to convert it to mt5 ea…if this what you kindly bid now and let discuss what I need to add and remove
I am looking for someone who can convert two indicators I attached from MQL4 of Meta trader 4 to DLL format of Forex Tester version. 1.MACD_4_Colored_Hist_and_2_Lines.mq4 2.MACD_Overlay Its a pretty standard and common indicators. I want the exact functional/working replica of the indicator to converted into dll format to use in the Forex tester 4 software. (※For MACD_Overlay, Please modify default bar color to green
I am looking for an EA that allows you to make profits every month. For this, before buying, I would like to have a history over more than one year to see how the EA behaves. I don't know if you're selling EAs that are already ready for use
I have existing Ctrader automated strategy that I am using but will like to add and remove some features and after that I will like to convert it to mt5 ea…if this what you kindly bid now and let discuss what I need to add and remove
Trading robots are programs, which operate according to underlying algorithms. An algorithm is a set of actions that need to be performed in response to certain events. For example, the most common task in algo trading is the identification of the "New bar" event. When the event occurs, the robot checks the emergence of trading signals and acts accordingly. Before you decide to program or order a trading robot, you

Información sobre el proyecto

Presupuesto
40+ USD
Para el ejecutor
36 USD
Plazo límite de ejecución
a 10 día(s)