Errors, bugs, questions - page 2616

 
Igor Makanu:

I see, i.e. you solve the perennial problem of data exchange between terminals

No. You need to receive data from the Tester from which the Expert Advisor is running. I know how to do this for 90% of the cases.

 
fxsaber:

I need an EA running on the Agent to be able to get the Terminal handle from which it was sent to run in the Agent.

I can't say about Agents. didn't check, but the Terminal handle can be retrieved via PID, as expected:

#define    READ_CONTROL   0x00020000
#define    bInheritHandle true

#include <WinAPI\processthreadsapi.mqh>
int OnInit()
  {
   uint process_id = GetCurrentProcessId();
   Print("process_id = ",process_id);
   HANDLE handle = OpenProcess(READ_CONTROL,bInheritHandle,process_id);	// https://docs.microsoft.com/ru-ru/windows/win32/api/processthreadsapi/nf-processthreadsapi-openprocess?redirectedfrom=MSDN
   Print("handle = ",handle);
   return(INIT_SUCCEEDED);
  }

2019.12.09 21:05:36.259 tst_Wapi (EURUSD,H1) process_id = 9280

2019.12.09 21:05:36.259 tst_Wapi (EURUSD,H1) handle = 2276

Checked the PID in Task Manager and it is the same


 
Igor Makanu:

I can't say about the agents. I haven't checked, but the terminal handle, as I assumed, can be obtained via PID:

2019.12.09 21:05:36.259 tst_Wapi (EURUSD,H1) process_id = 9280

2019.12.09 21:05:36.259 tst_Wapi (EURUSD,H1) handle = 2276

Checked PID in task manager matches

This code is good for Service, but not for Expert Advisor on Agent.

 
Igor Makanu:

I can't say about the agents. I haven't checked, but the terminal handle, as I assumed, can be obtained via PID:

2019.12.09 21:05:36.259 tst_Wapi (EURUSD,H1) process_id = 9280

2019.12.09 21:05:36.259 tst_Wapi (EURUSD,H1) handle = 2276

Checked the PID in Task Manager and it is the same

Solved the problem, Thanks.

 
Can you please tell me, in metatrader5 in MQL5/logs folder the logs for the last 7 days are saved. Is this changed somewhere in the settings or is this a terminal bug?
 

Here are 2 suggestions.

1- Make an option (button) to stop optimisation and switch to forward optimisation.

That is, it was supposed to be a quick calculator. But it counts and counts. And I am interested in forward as well, I have to wait.

Sometimes I need to count a little longer, and sometimes I need to make it brief.

I need 2 buttons - prolong optimization and stop optimization, with a switch to forward.

2- The toolbars have slid down into 2 tiers again! My daughter was little, she once said "sliding and sliding - sliding!"...)

Here too, the panels keep sliding in and out of the 2nd row. Already sick of moving them backwards (into the same row). Get it fixed already! How much space is being wasted!

 

Please check the following bug for yourself. The application has a special minimalist indicator whose only task is to read the status of the "capslock" key. It is displayed in the log and in the comment.

The sequence of actions is as follows.

  1. Compile indicator, place it on the chart and make sure that 0 ("capslock" is not enabled) is printed.
  2. Switch to ME, enable CapsLock and recompile. Return to the terminal. Check the logs to make sure that the old indicator is unloaded and new one is loaded. However, "CapsLock" status is still returned as 0.
  3. If we remove the indicator from the chart and upload it again, the capslock is recognized normally - it displays 1.

What's the miracle? When restarting by compilation some environment variables are not cleaned or something else?

Files:
CapsLock.mq5  1 kb
 
Stanislav Korotky:

Please check the following bug for yourself. The application has a special minimalist indicator whose only task is to read the status of the "capslock" key. It is displayed in the log and in the comment.

The sequence of actions is as follows.

  1. Compile indicator, place it on the chart and make sure that 0 ("capslock" is not enabled) is printed.
  2. Switch to ME, enable CapsLock and recompile. Return to the terminal. Check the logs to make sure that the old indicator is unloaded and new one is loaded. However, "CapsLock" status is still returned as 0.
  3. If we remove the indicator from the chart and upload it again, the capslock is recognized normally - it displays 1.

What's the miracle? When restarting by compilation some environment variables are not cleaned or something else?

And if so?

void OnDeinit(const int reason)
{
  if (ind != INVALID_HANDLE)
  {
    IndicatorRelease(ind);
  }
}
 
Vitaly Muzichenko:

How about this?

What does this have to do with it? I don't create an indicator from MQL code. It's hinged on the chart manually. I need it so that in the process of development, when recompilation of programs occurs frequently, they don't lose their functionality due to errors with saved context/system environment. Right now, after recompiling, I have to uninstall and re-install an inductor to get it to pick up the current state of the keyboard.

 
Stanislav Korotky:

When rebooting on compile, are some environment variables not cleared or something?

Yes, this is a bug. Indicator or EA - doesn't make any difference.