How to ensure that the EA only works on the chart where it was first dropped - page 2

 
The fact of availability of the EA should be reflected in the terminal configuration, which is where you should check for clones. By the way, you can insure against renaming, if the correct name does not appear in config, then goodbye. But I haven't worked with terminal configs, I think such things are written in chr files, but it should be checked if it is controlled in real time.
 
Then bluntly file as a locker and no problem.
 
PapaYozh:

By the way, yes. If the use of 2 instances of EAs is not allowed, then it does not matter which EA starts first.

has :(

The initial situation: two open charts on one symbol and one period. One of them has one set of indicators, the other - another.

So: I need my Expert Advisor to work only on the first chart with the first set of indicators (some of them MAY give signals to the Expert Advisor). It MAY start working in the second chart (this really needs to be thought out, but nevertheless) only after I delete the first EA and its deinit clears its backlogs.

 

Variant one, two advise on no matter what chart:

In init() you generate an identifier number, write it to a local variable and to a global variable.

In start() execute code only if value of global and local variables match.

In start() you signal with sound if variables don't match - two code instances are run.

 

Create a file in the queue file, whoever is first in the queue works, delete from the queue by deinit(REASON_REMOVE 1 Program deleted from schedule)

Maybe something like this

 
ForexTools:

it does :(

Initial situation: Two open charts on one symbol and one period. One has one set of indicators on the other - another one. Which and how many indicators - does not matter (the solution should be universal and not tied to specific names).

So: I need my Expert Advisor to work only on the first chart with the first set of indicators (some of them MAY give signals to the Expert Advisor). It MAY start working in the second chart (this really needs to be thought out, but nevertheless) only after I delete the first EA and its deinit cleans up its tails

So if one and the same espert with different parameters, you can make the magician extern and change it too, then there will be no confusion and everything is clear.
 
Techno:
So if the same espert has different parameters, you can make the magician extern and change it too, then there will be no confusion and everything will be clear.
I can see that he wants only one copy of this EA to work, regardless of the settings, etc.
 
gip:

In init() you generate an identifier number, write it to a local variable and to a global variable.

In start() you execute code only if value of global and local variables match.

not good. recompiling and two running EAs will not work - the first might be the init from the second (incorrect) chart.
 
sanyooooook:
It seems he wants only one copy of this EA to work at all, regardless of settings, etc.
The first one that was installed (when there was not a single copy) always works, and all the others that are installed later do not!
 
ForexTools:
Exactly! The very first one you put on (when there was not a single copy) always works, and all the others that come later - do not!

Well, there's the queue, the one at the till rules!)
Reason: