Modify MT5 ontester function to omit duplicate result values

MQL5 指标 专家

工作已完成

执行时间5 天
客户反馈
Impossible project, my mistake due to limitations of mql5 ontester function. Despite this Saad put many hours into this project. A* would always recommend.
员工反馈
Great collaborating with you once more!

指定

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

反馈

1
开发者 1
等级
(137)
项目
162
22%
仲裁
7
29% / 43%
逾期
4
2%
繁忙
2
开发者 2
等级
(91)
项目
112
37%
仲裁
8
88% / 0%
逾期
0
工作中
3
开发者 3
等级
(163)
项目
193
48%
仲裁
2
50% / 50%
逾期
1
1%
空闲
4
开发者 4
等级
(4)
项目
6
0%
仲裁
5
0% / 80%
逾期
2
33%
空闲
5
开发者 5
等级
(253)
项目
408
38%
仲裁
86
43% / 19%
逾期
70
17%
已载入
6
开发者 6
等级
项目
0
0%
仲裁
0
逾期
0
空闲
相似订单
I want an Expert advisor that takes trade on price crossing the upper limit or lower limit of the marked range. It needs to mark the range on daily basis and place a buy and sell order simultaneously Buy Condition Price crosses the upper level of marked range Sell condition Price crosses the lower level of marked range Re-Entry Condition i will tell the programmer In that Expert Advisor I want to add some below
Hey I am looking for someone to help with the testing of my 1000+ robots, you will be asked to always run testing for 30 expert advisors within 24/7 and you will have to provide results from the testing of each EA, let me know if you can help thanks
Check it 30 - 100 USD
please check the file before the bid, i need a developer who is sure to be work with this type of job, check the file attached before apply to this job, then we can discuss more about requirements. please apply only if you can do it, i don't want leave bad feedbacks
Hello, I need an EA or indicator for MT4 that can calculate the difference in pips between the closing price of the first 5 second candle and my actual trade entry price on the opened MT4 trade . EXAMPLE: BUY TRADE: When I open a EURUSD buy trade at 14:30:07 with a fill at 1.0860 and the price at 14:30:05 was at 1.0855 then the script should show me -5.0 pips on the MT4 chart. SELL TRADE: When I open a EURUSD sell
Hi, I'm looking for a coder to develop an automated trading robot for the MetaTrader 5 platform, capable of executing orders according to a defined strategy. The robot must allow for the configuration of: Distances between orders Lot sizes Levels of profits and losses (in pips and in currency) Recording performances in 2 dashboards Manual closure of all positions The Expert Advisor must successfully pass the MQL5
Telegram To MT5 EA 40 - 50 USD
I'm in need of Telegram to MT5 EA copier. The copier should be able to open telesignals directly on MT5 terminal. Message me if you can create the EA as described. Regards
Hey I am looking for someone to help with the testing of my 1000+ robots, you will be asked to always run testing for 30 expert advisors within 24/7 and you will have to provide results from the testing of each EA, let me know if you can help thanks
I need an expert to test robots 24/7 and the best ones come to real servers to work with real money. If we have good success, I increase the risk to 10-20% and the capital. a) 30x Forex robot installation. b) 30x Forex robot settings adjustment. c) 30x Forex robot is tested 24/7 for success. d) 30x Forex robot is provided by the client. e) 30x Forex robot is tested for functions to see if it works on MT4 or MT5. f)
Hello, how are you? I would like to create a robot (another version of a robot I already have) I currently have the source code but would like to have another robot that belongs to me but with different settings, if I provide you with the source code with all the settings are you able to remake me another robot with modifications? and if so what would be your price
EA indicador Velas 30 - 50 USD
Necesito crear un EA basado en un indicador que da señal de entrada y que tenga los siguientes parametros 1. Entrar Buy o Sell en la siguiente vela de la señal dependiendo la Flecha 2. El TP para BUY sera apenas cierre en vela verde sin importar los pips que saque de ganancias puede ser que sea 1 pip o 10 o incluso salir en perdida, no importa 2. El TP para Sell sera apenas cierre en vela roja sin importar los pips

项目信息

预算
40+ USD
开发人员
36 USD
截止日期
 10 天