Well recompiling is crutchy, but solvable, but what to do in case of terminal restart...
And global variables are bad, because if terminal crashes, having previously written global variables to file, then everything will crash.
Alternatively, you can keep a handle of something.
TheXpert:
.... anything
but just don't link the EA twice to the chart, is that impossible?
I need a WARRANTY that neither I nor anyone else will do it accidentally or deliberately ;)
Just imagine: the EA receives 'external' commands to open orders. Even one extra copy is (theoretically) one extra order.
that's the question :((
No, that's the implementation details, the main problem is restarting and recompiling.
Oh, there's a topic, just need to check -- is the EA restored when restarting and recompiling, if before it crashed, for example, on division by 0?
If not, that's the way to go.
No, that's an implementation detail, the main problem is reloading and recompiling.
Recompiling should not be the problem.
The problem should not arise during recompilation.
how come? let's say we have three copies of the EA (without any tricks - just clean ones). you recompiled it. the "command" went to the terminal. the EAs started to initialize.... in what order shall they be re-initialised?
let's say we have three copies of the EA (without any tricks - just clean ones). you recompiled it. the "command" went to the terminal. the EAs started initialing.... in what order shall they be re-initialised?
let's say we have three copies of the EA (without any tricks - just clean ones). you recompiled it. the "command" went to the terminal. the EAs started initialing.... in what order shall they be re-initialised?
And you don't rule out having the same graphs? I.e. should the EA start on 2 charts with the same symbol and the same period be processed?
Then it turns out that one of them traded, but after reloading, the other one will get the right to lead and the first one will lose this right, and what difference does it make if they are the same? Use a global variable and that's it. In the inite function write a random expectation for each EA to sleep(), the one who first wakes up, counts the global variable and deletes it, at deinit restores it again. The first one to count and delete will work. In short, you generate a random number for sleep()
By the way, yes. If 2 instances of EA are unacceptable, then it doesn't matter which EA starts first.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I need to make the EA work with only "one instance". I.e. I attach it to any chart for the first time and it works. If I then accidentally or intentionally attach it again to another chart, the second attachment should recognize that it's already running and do nothing.
Leaving the label in a global variable probably won't work. If I have two EAs attached and I recompile its text, it's not clear which one will work first with its init, where this global variable could be created.
Who can suggest what? Any thoughts on how to do this?