Errors, bugs, questions - page 2603

 
When you change the names of the symbols at the broker (added suffixes) all the chart settings with the old symbols (which no longer exist and need to be transferred to the new names) are lost! Irrevocably, along with the expert indicators. Bullshit.
 

In 2204, the profile with EAs is loaded without them.

The sluggish loading of EAs has not been fixed either. True, now the terminal doesn't hang, just the EA is gone for a long time.

 
I need help here. I need CTRL+C and CTRL+V combination of keys in in inactive window of the Tester in Options tab. I have only found the following

Forum on trading, automated trading systems and testing trading strategies

Can you tell me how to start script programmatically when terminals change TF or open

Egor, 2008.11.16 09:28

The script may be run by additionally updating the "keyboard input-state table" in the required thread.

I've got to try it in MQL, maybe you can help me:

    if ( h != NULL)
    {
        HWND child = :: FindWindowEx( h,NULL,"Edit", NULL);

        UINT lparam_Ctrl1 = :: MapVirtualKey( VK_CONTROL, 0) << 16 | 1 ;
        UINT lparam_A1 = :: MapVirtualKey((int)'A', 0) << 16 | 1 ;

        UINT lparam_A2 = 1 << 31 | 1 << 30 | :: MapVirtualKey((int)'A', 0) << 16 | 1 ;
        UINT lparam_Ctrl2 = 1 << 31 | 1 << 30 | :: MapVirtualKey( VK_CONTROL, 0) << 16 | 1 ;

        DWORD pid;
        DWORD tid = GetWindowThreadProcessId( child, & pid);
        HANDLE hProc = OpenProcess( PROCESS_QUERY_INFORMATION | SYNCHRONIZE, FALSE, pid);
        //Ctrl + A

        AttachThreadInput( GetCurrentThreadId(), tid, TRUE);

        LRESULT pl1_Ctrl = :: PostMessage( child, WM_KEYDOWN, VK_CONTROL, lparam_Ctrl1 );
        WaitForInputIdle( hProc, INFINITE);

        BYTE state[256];
        GetKeyboardState( state);
        state[ VK_CONTROL] = 0x80;
        SetKeyboardState( state);

        LRESULT pl1_A = :: PostMessage( child, WM_KEYDOWN, (int)'A', lparam_A1 );
        WaitForInputIdle( hProc, INFINITE);

        LRESULT pl2_A = :: PostMessage( child, WM_KEYUP, (int)'A', lparam_A2);
        WaitForInputIdle( hProc, INFINITE);

        LRESULT pl2_Ctrl = :: PostMessage( child, WM_KEYUP, VK_CONTROL, lparam_Ctrl2);        
        WaitForInputIdle( hProc, INFINITE);
/*
        GetKeyboardState(state);
        state[VK_CONTROL] = 0x0;
        SetKeyboardState(state);
*/

        AttachThreadInput( GetCurrentThreadId(), tid, FALSE);

    }

I haven't been able to implement it. I really need it for a multi-tester.

 
fxsaber:
Please help. I need to send combinations of keys CTRL+C and CTRL+V in inactive window of the Tester in the tab Settings. I have only found the following

It has not been possible to implement. Needed badly for a multitester.

You cannot send a copy-paste command to an inactive window. First, open the tester window and activate the settings tab
 

There's something wrong with the tips. EA file:

Alt+G sends here:


Editor 2200

 
Slava:
It is impossible to send a copy-paste command to an inactive window. First, you must open the tester window and activate the settings tab

All actions to automate the tester can be done via PostMessage, which is a great convenience. As the tester can be minimised, etc.

But getting and importing settings is an exception to this convenience. Is it possible to organise some mechanism to help automate the work with settings from your side?

 

Can you tell me which way to stop the tester or optimiser from code?

For example, the tester should load an external file. If the file is not found, show a message that the file is forgotten, and stop the tester or optimiser from running idly.

 
Igor Makanu: MT4 build 1220 was most likely the last update of MT4, who earlier from admins wrote that ME for terminals 4/5 are the same, which means there will be no more new 32 bit ME

And if any new bugs are found will they stay that way?

 
. ... Rick D. ... .:

And if any new bugs are found, will they stay that way?

Fixing bugs and developing are different things.
 
. ... Rick D. ... .:

Any tips on how to stop tester or optimizer from code?

For example, the Expert Advisor needs to download an external file. If the file is not found, display a message that the file is forgotten and stop the idle runs of the tester or optimizer.

Forum on trading, automated trading systems and strategy testing

Features of mql5 language, subtleties and tricks

fxsaber, 2019.11.06 16:57

Sometimes in genetic optimization the first few thousand passes are enough to already understand the outcome more or less.

When you automatically run a lot of optimizations, you want it all to work faster. That is why we will need a mechanism to interrupt optimization.

#include <fxsaber\MultiTester\MTTester.mqh>  // https://www.mql5.com/ru/code/26132

// Выключает Оптимизацию ( и одиночный проход)
bool OptimizationStop( void )
{
  return(!MTTESTER::IsReady() && MTTESTER::ClickStart(false));
}


Application.

// Демонстрация прерывания Оптимизации.

sinput int inAmountPasses = 20; // Через сколько проходов закончить
input int Range = 0; // 0..10000

double OnTester()
{
  int Data[];
  
  return(FrameAdd(NULL, 0, 0, Data)); // Сгенерировали TesterPass
}

void OnTesterPass()
{
  static int Amount = 0;
  
  ulong Pass;
  string Name;
  long ID;
  double Value;
  int Data[];

  while (FrameNext(Pass, Name, ID, Value, Data))
    if (++Amount > inAmountPasses)
    {
      OptimizationStop(); // Как достигли нужного количества проходов, выключили оптимизатор.
      
      break;
    }
}
Reason: