Different drawdown results when running single test vs optimized test

 

Hey all,

I run optimized tests, selected a result that I liked and run the single test but even though the number of positions and profit was the same, the drawdown wasn't. See images. Anyone knows why it might happen?

This is how I run the single test

This is how I run the optimized test

Thanks

 
rotemy:

Anyone knows why it might happen?

There was a problem with calculating this parameter.

Forum on trading, automated trading systems and testing trading strategies

Is the MT5 Strategy Tester checking drawdown every tick? It seems to me it's not.

fxsaber, 2024.10.24 08:41

b4640, I confirm.

#include <MT4Orders.mqh> // https://www.mql5.com/ru/code/16006

#define Ask SymbolInfoDouble(_Symbol, SYMBOL_ASK)

double GetEquityDD()
{
  static double MaxEquity = AccountInfoDouble(ACCOUNT_EQUITY);
  static double MaxDD = 0;
  
  const double Equity = AccountInfoDouble(ACCOUNT_EQUITY);
  
  if (Equity > MaxEquity)
    MaxEquity = Equity;
  else
    MaxDD = MathMin(MaxDD, Equity - MaxEquity);
    
  return(MaxDD);
}

void OnTick()
{
  static const bool Init = !GetEquityDD() && OrderSend(_Symbol, OP_BUY, 1, Ask, 0, 0, 0);
  
  GetEquityDD();
}

double OnTester()
{
//  return(!NormalizeDouble(GetEquityDD() - TesterStatistics(STAT_EQUITY_DD), 2));
  return(GetEquityDD());
}


Reported.

 
Your topic has been moved to the section: Expert Advisors and Automated Trading
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
 
fxsaber #:
There was a problem with calculating this parameter.

Are you sure it is related to what I reported? is there a different way to calculate DD when doing an optimized test and a single test?

 
rotemy #:

Are you sure it is related to what I reported? is there a different way to calculate DD when doing an optimized test and a single test?

I can only guess.