Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 281

 
Sergey Likho:

The idea is for EA A to disable EA B by condition.


So let EA A write in the file that it is time to disconnect, and let B read this information and execute the order.

 
Aleksey Vyazmikin:

So have EA A write to the file that it's time to disconnect, and B read that information and execute the order.


=)))) That's right. And if the two EAs were written by me, I would make the exchange of messages via global variables.

But if the EAs are someone else's and with closed code, it's not clear how to proceed.

 
Sergey Likho:

=)))) That's right. And if I wrote the two EAs, I would do the messaging via global variables.

But if they are someone else's and with closed code, it's not clear how to proceed.


Is it impossible to close the chart window?

As a last resort, we can change the profile where everything is the same, but there is no EA running...

 
Aleksey Vyazmikin:

Can't you close the chart window?

As a last resort, change the profile where everything is the same, but there is no EA working...

Yes, you can!

But to change the profile or to close all the charts. But in this case it would be ideal to look through all charts to know which one the Expert Advisor is sitting on and only then disable it

 
Sergey Likho:

Yes, you can!

But you have to change the profile or close all charts. But in this case it would be ideal to go through all charts, find out which one the Expert Advisor is on and disable it only

...and cycle through all charts:

- save the template

- search for lines describing the Expert Advisor in the template

- if found - delete these lines, apply the resulting template

 
Maxim Kuznetsov:

in a loop through all the charts :

- save the template

- search for lines describing the Expert Advisor in the template

- if found - delete these strings, apply this template


You can read the template only using dll.

Templates are stored in templates.

FileOpen only reads the MQL4 folder.

 
Sergey Likho:

A template can only be read using a dll.

Templates are saved in templates.

FileOpen only reads MQL4 folder.

you are not writing this EA "disabling another EA" for Market ? one call to FileCopy is affordable
 
Maxim Kuznetsov:
you are not writing this EA "disabling another EA" for Market ? one FileCopy call can be afforded

For Market )

 
Sergey Likho:

2. Check if there is an Expert running on this ChartId?

// Запущен ли советник на соответствующем чарте?
bool Is( const long Chart_ID = 0 )
{
  return(::ChartGetString(Chart_ID, CHART_EXPERT_NAME) != NULL);
}
 
fxsaber:

This code is for MQL5

Reason: