New MetaTrader 4 platform build 1370

Andriy Moraru  
Any details on what has actually changed?
Sergey Golubev  
AwarenessForex #:

I agree @MetaQuotes @Sergey Golubev  @Carl Schreiber  @forexample

Can we get some changelog information please on what was updated?

I found one post in Russian forum:

Forum on trading, automated trading systems and testing trading strategies

New version of the MetaTrader 4 platform build 1370

MetaQuotes , 2023.01.18 15:53

...

The functionality update of the MetaTrader 4 platform was stopped many years ago and now we release only patches for crash logs.


Alain Verleyen  
memo_mqlcom #:

With 1370, renamed executables (e.g. terminal.exe -> my_terminal.exe) silently refuse to run, which breaks my backtesting automation!! This is a big blocker to me, I'm desperately looking for a workaround now.


Could anyone else try & confirm this behavior?


I also agree with others that a detailed changelog is highly desired.

Please explain how the exe file name is related to your backtesting automation ?
memo_mqlcom  
Alain Verleyen #:
Please explain how the exe file name is related to your backtesting automation ?

Sure, in a nutshell I have multiple MT4 instances running in parallel for backtesting, and another 'main' MT4 that runs my EAs for real trading. I need to keep track of the backtesting pool separately (and sometimes kill them) but Windows doesn't have a way to identify them by their full path - all I have is the executables to work with. With everything named terminal.exe, the main instance is included in the same pool and things get messed up. That's why I rename backtesting terminals differently.

Even when I use a link (shortcut) with a different name, the running executable still appears as terminal.exe. 

As far as I know there is no way, for example, to make `taskkill` to identify and kill specific terminal.exe instances in different install locations :(

I was halfway through the tests -  I wonder if there's a way to backport to older versions and disable update prompts. But even then it's a temporary workaround and I'm worried.

Thanks!

Alain Verleyen  
memo_mqlcom #:

Sure, in a nutshell I have multiple MT4 instances running in parallel for backtesting, and another 'main' MT4 that runs my EAs for real trading. I need to keep track of the backtesting pool separately (and sometimes kill them) but Windows doesn't have a way to identify them by their full path - all I have is the executables to work with. With everything named terminal.exe, the main instance is included in the same pool and things get messed up. That's why I rename backtesting terminals differently.

Even when I use a link (shortcut) with a different name, the running executable still appears as terminal.exe. 

As far as I know there is no way, for example, to make `taskkill` to identify and kill specific terminal.exe instances in different install locations :(

I was halfway through the tests -  I wonder if there's a way to backport to older versions and disable update prompts. But even then it's a temporary workaround and I'm worried.

Thanks!

I got the idea thank you. I am surprised about what you said about the identification of instance but can't really comment on it without technical details.

Is there any reason to not use MT5 which provided all what is needed for such tasks.

Anyway, if you are stick to MT4 you will have to find a solution as the change definitive for security reason.

fxsaber  
memo_mqlcom #:

Windows doesn't have a way to identify them by their full path - all I have is the executables to work with.

Форум по трейдингу, автоматическим торговым системам и тестированию торговых стратегий

Новая версия платформы MetaTrader 4 build 1370

fxsaber, 2023.01.18 16:09

Below, the code for MT5 can be converted to MT4.

  static string GetClassName( const HANDLE Handle )
  {
    string Str = NULL;

    short Buffer[MAX_PATH] = {0};

    if (user32::GetClassNameW(Handle, Buffer, ::ArraySize(Buffer)))
      Str = ::ShortArrayToString(Buffer);

    return(Str);
  }

  static int GetTerminalHandles( HANDLE &Handles[] )
  {
    ::ArrayFree(Handles);

    for (HANDLE Handle = user32::GetTopWindow(NULL); Handle; Handle = user32::GetWindow(Handle, GW_HWNDNEXT))
      if (MTTESTER::GetClassName(Handle) == "MetaQuotes::MetaTrader::5.00")
        Handles[::ArrayResize(Handles, ::ArraySize(Handles) + 1) - 1] = Handle;

    return(::ArraySize(Handles));
  }
  static string GetPathExe( const HANDLE Handle )
  {
    string Str = NULL;

    uint processId=0;

    if (user32::GetWindowThreadProcessId(Handle, processId))
    {
      const HANDLE processHandle = kernel32::OpenProcess(PROCESS_QUERY_INFORMATION, false, processId);

      if (processHandle)
      {
        short Buffer[MAX_PATH] = {0};

        uint Size = ::ArraySize(Buffer);

        if (kernel32::QueryFullProcessImageNameW(processHandle, 0, Buffer, Size))
          Str = ::ShortArrayToString(Buffer, 0, Size);

        kernel32::CloseHandle(processHandle);
      }
    }

    return(Str);
  }
memo_mqlcom  
Alain Verleyen #:

I got the idea thank you. I am surprised about what you said about the identification of instance but can't really comment on it without technical details.

Is there any reason to not use MT5 which provided all what is needed for such tasks.

Anyway, if you are stick to MT4 you will have to find a solution as the change definitive for security reason.

Thank you Alain - my backtests are indicator heavy and only a small subset of those work for MT5 - I'm stuck with MT4 for :)

Google to the rescue again, I found a way to target specific instances without needing to rename terminal.exe -- here's how, in case others need it:

WMIC Process Where "ExecutablePath='C:\\Program Files (x86)\\<specific_install_dir>\\terminal.exe'" Call Terminate   2>&1 1>NUL


I understand mine is a corner case and I don't think this change impact a lot of other people (other than those who reface and modify it of course, ha ha) :D