Expert Advisor unwanted call of OnInit (initialization)

 

Hello,

have EA 'A' and EA 'B'.

When attach EA 'A' to symbol USDJPY and EA 'B' to symbol EURUSD, both run well.

Now go to MetaEditor and recompile EA 'B', then i see in the Experts Log ( in chronological order from top to down) :

'B' uninitialized

....

'B' initialized

'A' initialized <------ PROBLEM

So 'A' is initialized again what was not my intention as A was not recompiled. 'A' should simply proceed to run without new initialization.

In addition, Print commands within A::init missing in this case which obviously points to that A::init is NOT executed same way when attached originally.

Can anyone help how to solve this ?

 
OnInit? Sounds like an mql5 function. Did you mean init()? Also, showing your code would help. Use the Src button above.
 
In other words: Compiling Expert Advisor 'B' messes up running Expert Advisor 'A'.
 
ubzen:
OnInit? Sounds like an mql5 function. Did you mean init()? Also, showing your code would help. Use the Src button above.

Sorry, mean init. It is MT4. (sometimes work with MQL5)
 

Does Expert_A and Expert_B share any include files or anything? If they do then thats the problem.

 
ubzen:

Does Expert_A and Expert_B share any include files or anything? If they do then thats the problem.


No, they don't. One 'B' (recompiled) is very simple and includes none. Also, since included files did not changed, i see no reason why 'A' should be recompiled just including the same (unchanged) file...?
 
chinaski:
No, they don't. One 'B' (recompiled) is very simple and includes none.

I just tested and didn't get the same effect as you. I'll recommend keeping your development and live running environment separate. To do that, just copy the mt4 folder and call it something else like Mt4_Development.

Also, since included files did not changed, i see no reason why 'A' should be recompiled just including the same (unchanged) file...?

There's allot of how One think things should be and how things really are around here. I was just referencing a reason I believe it would re-initialize your other expert. What you and I believe is irrelevant. It does what it does.

 

Just checking but - your options are set like this.

 
Ickyrus:

Just checking but - your options are set like this.


Hello,

in fact, your suggestion solved this problem. Thank you!

 

your welcome

Reason: