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
Оценка
(125)
Проекты
146
23%
Арбитраж
5
0% / 60%
Просрочено
4
3%
Работает
2
Разработчик 2
Оценка
(81)
Проекты
100
34%
Арбитраж
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
Оценка
(251)
Проекты
402
38%
Арбитраж
82
41% / 20%
Просрочено
70
17%
Загружен
6
Разработчик 6
Оценка
Проекты
0
0%
Арбитраж
0
Просрочено
0
Свободен
Похожие заказы
Create a script 30+ USD
I'm looking for someone who can create a script for the order manager. I want to close all open positions on e.g. gold with 1 click on the button and leave 1 most profitable position with a stop at 0
i want devloper to create indicator i have the script from https://usethinkscript.com/ i want to be create in mt4 # DESCRIPTION # This study plots H1, H2, etc. and L1, L2, etc. labels above or below # those signal bars based on Al Brooks' description of the setups. # DECLARATIONS declare upper ; # USER INPUTS input resetCountOnDTorDB = yes ; input barsBack = 10 ; # DEFINITIONS AND CALCULATIONS ## Variable List def
Specification: I need a developer that will add senses to these four indicators and it should be one indicator in a whole: 1. William’s percentage range 2. Macd 3. Moving Average 4. Parabolic Sar I will send the images of the sense to be added to the four indicators above. You will help me and add the new job into my existing indicator. You will also show me a trial version before we commit fund. thank you
I need an indicator for my secand chart tf i need experinced developer to built stochastulic indicator for my secand tf indicator. So bet for it have a great day
Hi, I need someone to backtest my ninja trader strategy with ongoing management. If you're expert in the field, just send me a message and let's talk about it and I'll give you detail overview of the straegy
Hello, How are you doing? I need a developer who can convert my tradingview script to ninjatrader. The source code and requirements will be sent via inbox. Kindly bid if this is what you can do. Thanks
I need to combine other external arrow indicators (Buffer) into a new single arrow indicator. The new single arrow indicator must be non repainted, no laggaged and no disappeared . Kindy see the requirements attached the file
I work in trading with Trading View and I want to have a bot at the same time that will look for American stocks only with time intervals between 1 minute and 5 minutes that the bot will find for me in the graph of the same stock the candles of a hanging man, a sinkhole candle and the evening star because these three symbolize a serious trend reversal in addition That the bot knew according to the graph the
So the new indicator will be done by modifying a mq4 file which is called “ chaos zone exit ” this is a indicator mirror by the “ choas visual average ” so you will need both indicators to use the “chaos zone exit”. Now there are two lines on the “chaos zone exit” one with super smoother period 96 and Super smoother period 14 . Now the changes I would like is for when the super smoother period line 96 is above
I am looking for an expert NinjaTrader developer to help me backtest a custom trading strategy I've developed. The ideal candidate will have extensive experience in trading, particularly with backtesting and strategy evaluation on the NinjaTrader platform. Your expertise will be crucial to the success of this project. Key Requirements: Custom Strategy Backtesting: Develop and backtest a unique trading strategy based

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

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