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 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 there, first thing first, I worked hard to develop this EA, I have 8 years of trading experience, and I come to conclusion that an EA is a must. now this EA have some (unseen) TP taking and trade management. I a Entry On cross only, if True m looking for someone that is 1- serious to make this work 2- knowlagble and having extensive trading experience 3- great experience in optimiation AFTER OPTIMIZATION this
Request to improve performance in back test of a custom indicator SMC_OSC (Smart market concept + Market sentiment oscillator). It works fine but it has a hard problem, it is extremely slow in tick-mode and I cannot use it in EA due the infinite range times it gets to back-testing. About the first section in Chart price (Smart market concept), it uses candle close pivots (on bar, no ticks) and so I think that this
I am looking for an experienced developer to design an algorithm that provides buy and sell signals based on a volume-based strategy. The strategy involves identifying high-volume candles and using subsequent price action to determine buy and sell opportunities. Here are the specific requirements: Strategy Details: High-Volume Candle Identification: Identify a high-volume red candle. Look for a green candle with low
Forex trading market opening an account for the first time, modify you system of forex , always there for everyone,you are all welcome and for info on all platforms @ lil_johnny254 there to serve you
An indicator that provides signals based on ZigZag and Moving Average needs to be converted to Java SDK in order to use it on MotiveWave platform. It is required to use this indicator with signals on the MotiveWave platform. The source code will be provided to developers who apply for this job
1. (price 10) I have an equity reporter. This equity reporter displays the maximum and minimum equity reached over a specific interval. So, if the interval is set to 24 hours, the script will generate data in the format: "Profit ATT" (profit AtThatTime) shows max./min. during the specific interval This specific report shows data in pips. It can also be set to display in price or percentages. The interval is also
Hello Guys! I want to modify/fix the indicator that uses sequential type of entries (it counts from 1 to 9) and if the conditions are met it provides an arrow (signal) with alert. The problem is that, sometimes (for unknown for me reasons) it repaints arrow signal. Like on the picture: Signal 1 - everything is correct. The signal is created. Signal 2 - everything is correct. The signal is created. Signal 3 -
I have the source code for a think or swim indicator. I would like someone procient in converting TOS code for use in MT5. Good communication skills in English is preferred. A detailed description of the indicator can be found here: https://intercom.help/simpler-trading/en/articles/6003945-about-quant-pivots
Hi, I am having trouble with my EA developer for me . i have not able to see him online to communicating with me . The EA is based on a strategy from and indicator signal . The error i get from the EA is ............ indicator is too slow, 2078 ms. rewrite the indicator, please, i need anyone who can fix it for me

프로젝트 정보

예산
40+ USD
개발자에게
36 USD
기한
 10 일