uninit reason 1

 

Hi,

I am loading a custom indicator with my EA and turn on auto trading... From time to time I get "uninit reason 1" in the log file (experts tab) for this indicator. I have checked the forum and also the code base on mql4.com and read the relevant documentation. It appears that this is not an important error thou I'd like to double check with you guys as I am also facing some other problems explained in this link. I am monitoring the errors as advised with print()s... Is this "uninit reason 1" something I need to be worried about or not?

Many thanks in advance... 

 

Not important?

In the reference you can read about Uninitialization Reason Codes:

REASON_REMOVE

1

Program has been deleted from the chart

Is there an array-out-of-range or a zero-devide?

 
gooly:

Not important?

In the reference you can read about Uninitialization Reason Codes:

REASON_REMOVE

1

Program has been deleted from thechart

Is there an array-out-of-range or a zero-devide?

Well actually IMO, uninit is not for the EA itself but for the custom indicator I use, as it is also written in the log file: "MRWPR GBPAUD, M5: uninit reason 1" and then "Custom indicator MRWPR GBPAUD, M5: removed".  This custom indicator is also loaded on the chart btw and therefore might have something related to this maybe?
 
Try recompile the custom indicator and see anything wrong.
 
deysmacro:
Try recompile the custom indicator and see anything wrong.
Tried it as well... No errors or anything...
 
i am facing the same problem, only with custom indicators. No such errors in Strategy Tester though. Is there a built in logic to automatically remove these indicators when not used for certain period of time? I think this can potentially pose problems in program logic; indicators not available in time when called for and returning false signals to the program logic to make wrong decisions. Anyone found solutions to this?
 

I was just able to duplicate this problem repeatedly. Custom indicators get removed automatically when not being accessed for 10 minutes. see below.

Here goes scenario:

1) EA first accesses all of the custom indicators during OnInit().

2) EA sits there and does nothing because there is no tick due to weekend.

3) After about 10 minutes every time, all of these custom indicators are removed automatically.

2015.03.28 20:18:11.166 Custom indicator Heiken Ashi EURUSD,Daily: removed
2015.03.28 20:18:11.166 Heiken Ashi EURUSD,Daily: uninit reason 1
2015.03.28 20:18:11.166 Custom indicator GEFellow EURUSD,Daily: removed
2015.03.28 20:18:11.166 GEFellow EURUSD,Daily: uninit reason 1
2015.03.28 20:18:11.166 Custom indicator GEStochastic EURUSD,Daily: removed
2015.03.28 20:18:11.166 GEStochastic EURUSD,Daily: uninit reason 1
2015.03.28 20:08:09.537 GATOREYE.V.2.2 EURUSD,M15: initialized
2015.03.28 20:08:09.537 GATOREYE.V.2.2 EURUSD,M15: Hrs Elapsed:  4; Hr Crosses:  0; Mn Crosses:  0; Dr Changes:  1
2015.03.28 20:08:09.508 GEStochastic EURUSD,Daily: initialized
2015.03.28 20:08:09.506 Custom indicator GEStochastic EURUSD,Daily: loaded successfully
2015.03.28 20:08:09.501 GEFellow EURUSD,Daily: initialized
2015.03.28 20:08:09.499 Custom indicator GEFellow EURUSD,Daily: loaded successfully
2015.03.28 20:08:09.494 Heiken Ashi EURUSD,Daily: initialized
2015.03.28 20:08:09.491 Custom indicator Heiken Ashi EURUSD,Daily: loaded successfully

But why? There must be some garbage collection logic in Metatrader that removes these indicators. I am sure these gets reloaded again when accessed next time but the question is will the EA wait for these indicators loaded completed when it tries to use them to make decision? If it slips thru, this is a big problem. The EA may make wrong decisions based on false signals.

Any experiences appreciated.

 
Try that again during weekdays or when the market opens. No point complaining when you can't test it fully.
 

do I sound like complaining to you?

 

Yes, I am having the same problem during weekdays too. It's been fully tested over a few months. I ran out of all resources. I just wished someone could answer why some of these custom indicators get removed by MT4.

 
Have you attached the indicator to the chart? If not, the ea would have to call the indicator, get the value and the remove the indicator.