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
評価
(121)
プロジェクト
141
23%
仲裁
5
0% / 60%
期限切れ
4
3%
取り込み中
2
開発者 2
評価
(81)
プロジェクト
99
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
類似した注文
Hello Everyone, Herewith sending the existing Trading view Indicator, and required the same Indicator with all display into MT5. Trading view Indicator Screen shot attached for more reference. Price is negotiable
Hello there, I need a professional mt4 developer who can perfectly help me to backtest my mt4 trading strategy on these trading pairs, XAUUSD H1 PEPPERSTONE 1:200 LEVERAGE. The strategy would be provided once you bid to this task
GIOVA 30 - 50 USD
I need a skillful programmer that can Automate my trading indicator into an EA . System has 2 indicators. One of the Indicator is to know the Direction of Trend on H1 and the second indicator is to be use to enter trade on M5 in line with the H1 Trend The EA must have 1. TP and SL, 2. Trailing Stop Loss, 3. ability to add more trade when there is signal in line with H1
Hello, I am looking for a professional who can assist me with the following tasks: Create a used replica of my trading setup from TradingView. Copy and configure this setup in my Tradovate account. This is exactly what I need. Your assistance would be greatly appreciated this is exactly what i want https://youtu.be/WOMA8Ift9r8?si=PPf0CHNrZkZ0InHN
Hello, i need professionalthat can help me handle this, I want used replica to of my trading From trading view And copy to my tradovate this is exactly i need https://youtu.be/WOMA8Ift9r8?si=PPf0CHNrZkZ0InHN
I need to Convert the TradingView Indicator to the MT5 Indicator with some custom padding. This EA is done(open source) on TradingView and must be created identically for MT5 from the start(so will not have bugs). The name of the indicator on TradingView is Smart Money Concept done by LuxAlgo, this indicator must be converted and work identically in MT5 Indicator additional requirements: -Non-repaint - Must work on
need a skilled programmer to input parameters in existing indicator. Adding timeframes in the indicator. I have source code file for this indicator. More details will be provided upon selection of job
I would like to have indicator that can alert/popup when there is 3 bullish/bearish candle in a row. For example ; 1st candle bullish 2nd bullish and when the 3rd close as bullish then the indicator popup/alert on chart. Same colour candlestick. Can extend to 5 or more candlestick can be setting
Strategy To Be Used 1. Order Blocks (4HR, Daily And Weekly) 2. FVG (For Entry) 3. Fibonacci Levels (TP) 4. HH/LL ( SL) Works in 1HR & 4HR (TF) Risk to reward minimum 2:1 (Default) Winrate 53.21% (Accuracy) tested on Live account of 1000$ May 14th to May 31st You can change the risk per trade percent Per day DD Limit *it should takes multiple entries at the same price point when the price touches weekly/ daily
Find a good Indicator 30 - 100 USD
As the title says, I need to find an Indicator with the function of scanning Accurate SMC signals on backtest with a nice control panel and can report signals to phone/email. Includes source code and export license for business. Please send Demo or pictures

プロジェクト情報

予算
40+ USD
開発者用
36 USD
締め切り
最高 10 日