Modify MT5 ontester function to omit duplicate result values

MQL5 Indicatori Esperti

Lavoro terminato

Tempo di esecuzione 5 giorni
Feedback 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.
Feedback del dipendente
Great collaborating with you once more!

Specifiche

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;
}

Con risposta

1
Sviluppatore 1
Valutazioni
(121)
Progetti
141
23%
Arbitraggio
5
0% / 60%
In ritardo
4
3%
Caricato
2
Sviluppatore 2
Valutazioni
(81)
Progetti
99
34%
Arbitraggio
8
88% / 0%
In ritardo
0
In elaborazione
3
Sviluppatore 3
Valutazioni
(163)
Progetti
193
48%
Arbitraggio
2
50% / 50%
In ritardo
1
1%
Gratuito
4
Sviluppatore 4
Valutazioni
(4)
Progetti
6
0%
Arbitraggio
5
0% / 80%
In ritardo
2
33%
Gratuito
5
Sviluppatore 5
Valutazioni
(251)
Progetti
402
38%
Arbitraggio
82
41% / 20%
In ritardo
70
17%
In elaborazione
6
Sviluppatore 6
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
Ordini simili
I need an EA that will copy automaticcally my signals from Telegram to mt4 and i need to be able to set the % of the account that will be applied as a risk for each trades the signals can be seen https://t.me/TMHTTFREEFXBOSIGNALS on my channel
I want to develop a NinjaTrader automated strategy that has a high win rate for trading futures. So the strategy will automatically enter and exit for an account. Do you have any experience with this? If so, can you please share some past results
I need a developer that can fix a indicator i have, I have a table that looks at emas and display bullish/bearish, I have spy on the table but its not always updating and need help fixing this I have this table and the first 6 rows looks at the chart symbol and if price is above 12 ema it will sows bullish under the 5/12 ema coulmn and bullish if its above, and same under the 34/50 colmun, if price is below 50 ema
Mt5 EA 30+ USD
Hey, I would like to find out if you can assist in developing and EA that I can use for my trading system for MT5 My system is very basic, it just a hedging system. Taking two trades buy and sell exactly at 14:00 (UCT+2). Risking 1% on each trade on a 1 : 2,5 Risk Reward ratio and stop loss of 2500 points since I am only trading GER30(Dax Index) for now, please make these inputs changeable. Once the trade is on 1 : 2
A DEVELOPER HAD MADE MISTAKE IN PUTTING ONLY SELL IN MY ROBOT INSTEAD OF BUY AND SELL. i HAVE THE SOURCE CODES FOR THE FOUR ROBOTS. I want a good developer that will help me fix the mistake in the robots
Important note- We only have the .ex4 file for the EA and need to create an exact replica of that EA, along with the mql4 file which is compatible with the 1420 Mt4 version, all the functionalities, inputs, and trade entry parameters should be exactly same. Key Requirements: - - The current EA runs on 1415 MT4 version and I need it to be adapted to the current 1420 MT4 version as it is. - The new EA should open
I need an EA in MT5 that trades based on volatility with market orders. It must check and correctly process possible errors in trading operations. Entry and exits based on volatility threshold
Modificar EA 30+ USD
Es posible descompilar un EA de mt4? Tengo uno y me gustaría descompilarlo y poder tener el archivo haber como funciona de verdad. Saludos amigos programadores. espero tenga solución este problema
Required back-test specifications on XAUSD between 2003 & 2024 on 30M and between 2011 - 2024 on M5 timeframe: 1. Recovery factor >= 2 2. Profit factor >= 2 3. Win Rate above 96% 4. 120 trades minimum per year on the 30 minute timeframe. 5. 170 trades minimum per year on M5 timeframe. 6. No martingale & grid 7. Every position must have a stoploss. 8. Use a customizable Trailing Stop (customizable point of activation
Just to confirm Indicator will be able to have the following: - Ability to upload multiple levels for multiple tickers (stocks, ETFs, Futures) - Ability to change color of the lines - Ability to concatenate levels if on the same price. Example: Level 1 & Level 2 - Ability to tick or untick levels that user does not want to plot - Ability to show price values on the level (user should be able to select this in the

Informazioni sul progetto

Budget
40+ USD
Per lo sviluppatore
36 USD
Scadenze
a 10 giorno(i)