Modify MT5 ontester function to omit duplicate result values

Работа завершена

Время выполнения 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
Оценка
(281)
Проекты
352
29%
Арбитраж
37
27% / 65%
Просрочено
10
3%
Загружен
2
Разработчик 2
Оценка
(161)
Проекты
208
61%
Арбитраж
10
80% / 0%
Просрочено
0
Свободен
Опубликовал: 1 пример
3
Разработчик 3
Оценка
(170)
Проекты
203
47%
Арбитраж
5
20% / 60%
Просрочено
3
1%
Свободен
4
Разработчик 4
Оценка
(4)
Проекты
6
0%
Арбитраж
5
0% / 80%
Просрочено
2
33%
Свободен
5
Разработчик 5
Оценка
(298)
Проекты
478
40%
Арбитраж
105
40% / 24%
Просрочено
82
17%
Загружен
Опубликовал: 2 примера
6
Разработчик 6
Оценка
Проекты
0
0%
Арбитраж
0
Просрочено
0
Свободен
Похожие заказы
I need an AI based mt5 EA which self learns and improves on its previous mistakes. The EA must be able to utilize numerous trade set ups like; 1. CRT, 2. liquidity sweep reversal at selected higher timeframe where a candle sweeps previous candle high and closes lower or sweeps previous candle low and closes higher, 3. SMC where it trades on OB, CHoCH, BOS. 4. Support and resistance. It should trade any currency pair
i need some tradingview strategy that i want to use as a tester, i have something that i am working on currently and i need someone that can provide me with tradingview strategies that doesn't have a win rate, the one with 1:1 RR it need to have low win rate like 10% or 5% profitability, i am not paying $30 for,i dont have up to that for this cause i only want to use it as a test, if anyone have any to send me please
hello i need help building a ea bot for mt5 and i have started on claude but i will need someone if a incredible experience to make my ideas come to live. please contact so we can schedule a quick call and i can share anything that concerns you for the task
I am looking for someone with real experience developing strategies, indicators, or trading tools for Quantower . The strategy itself is relatively simple. The main issue is that I need to use some of Quantower's functions and API capabilities to program the strategy, but there is limited documentation available for some of the functionality, and I do not have enough time to fully understand the API and implement
I am looking for an experienced MQL5 developer who can BOTH research trading strategies and develop a commercial-quality MetaTrader 5 Expert Advisor. This is NOT simply a coding job. The developer is free to choose the trading logic, indicators, entry method, exit method, timeframe architecture and strategy type. I do not require the EA to copy or resemble any existing commercial EA. My priority is: ROBUST LONG-TERM
A developer will create an AI assisted EA forex watch-list scanner (not an auto-trader) designed to surface PDL/PDH bounces on M15, with coding in Python/MQL5. This will strictly be a market intelligence and scanning tool (no automatic order placement) and EA primary function will be a delivery of visual dashboard UI, 2-phased alerts (warning vs. execution), and multi-channel notification. 1. Project Overview &
Hello, please make me a simple MT5 Expert Advisor for XAUUSD on M15 timeframe. TRADING LOGIC: - BUY when EMA(10) crosses UP EMA(30) - SELL when EMA(10) crosses DOWN EMA(30) TRADING HOURS: - Only trade between 19:00 - 22:00 WIB / Jakarta time RISK SETTINGS: - Lot size: 0.01 - Stop Loss: 70 points - Take Profit: 150 - 300 points - Max 1 open position Please deliver .ex5 file ready to use. Thank you
Gods Plan v8 30 - 500 USD
//+------------------------------------------------------------------+ //| GODS PLAN V8.mq5 | //| Tebogo | //| tebogophago298@gmail.com | //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| Expert initialization function |
I’m looking to purchase an existing, proven Trend-Following EA for MT5 . I am NOT looking to develop a new EA from scratch , so please read the requirements carefully before applying. The EA should follow a market-structure/trend-following approach similar to this: Identify a clear Break of Structure (BOS) to confirm the trend direction. Wait for a pullback/retracement instead of chasing the initial breakout. Enter
I am looking for an experienced MQL5 developer to create a fully automatic MT5 Expert Advisor (EA) for frequent small-profit trades. My current manual strategy is simple: I watch short-term price movement, enter when price starts moving strongly up or down, and close once a small profit is achieved. I want an EA that can identify these movements and automatically repeat this process throughout the day. Main

Информация о проекте

Бюджет
40+ USD
Сроки выполнения
до 10 дн.