Open EA Input-Settings, press OK, and the OnInit() executes TWICE - page 2

 
Looks like no-one thought this important enough to make the b625 cut <HUGE SIGH>
 
ballenoz:
The secret to industrial-strength code is that it actually works <g>.


I have encountered this problem with the double init() and deinit(). It has really messed up some of my EAs. I class this as a serious problem. Can anyone advise on the best way to escalate this with MetaQuotes?
 
ballenoz:
Looks like no-one thought this important enough to make the b625 cut <HUGE SIGH>


Yes, it is really annoying as I have some EAs that open trades in init

I really thought that it would be sorted in 625, but no!

 
Open EA Input-Settings, press OK, and the OnInit() executes TWICE

No such thing happened to me because I put a timer for my EA to let the terminal propagate and settles down properly on first and subsequent run.

Even when I change chart TF too.


Actually, what I see that the newer build terminal have this first initialization for mql5 codes, and then second initialization for mql4 codes propagation.

First initialization, prepares things, second initialization, fills data required.

My theory from observation though.


If EA runs even it is on first initialization, all numbers would be wrong, so, let my EA run after second initialization and all numbers are correct as expected. :)

 

My observations on build 625 are OnInit() executes all its code:

  • Once when you are loading the EA and click OK in any of the properties tabs.
  • Once if you recompile the EA while EA is loaded.
  • Once if you change the chart TF while EA is loaded.
  • Once if you bring up the EA's properties again after it is loaded and click OK on the "about" tab.
  • Once if you bring up the EA's properties again after it is loaded and click OK in the "common" tab.
  • TWICE if you bring up the EA's properties again after it is loaded and click OK in the "inputs" tab.
 

I received an answer of the Service Desk about this issue, that it should be fixed in build 628, available on Metaquotes-Demo server.

If someone can check that and confirm, it would be great. Thank you.

 
angevoyageur:


If someone can check that and confirm, it would be great. Thank you.


available to download from a zip file

 
The double OnInit() issue appears to be fixed in build 628
 
SDC:
The double OnInit() issue appears to be fixed in build 628

tnx 4 the info
 

You're welcome, its good to see MQ are ironing out these problems.

Reason: