Download MetaTrader 5

uninit reason 1

To add comments, please log in or register
Interested in Signals activity? Come and track!
yrydr
108
yrydr 2015.01.07 08:38 

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... 

Carl Schreiber
6589
Carl Schreiber 2015.01.07 09:05  

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?

yrydr
108
yrydr 2015.01.07 10:05  
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?
SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2015.01.07 11:09  
Try recompile the custom indicator and see anything wrong.
yrydr
108
yrydr 2015.01.08 10:54  
deysmacro:
Try recompile the custom indicator and see anything wrong.
Tried it as well... No errors or anything...
Gatoreye
52
Gatoreye 2015.03.29 02:29  
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?
Gatoreye
52
Gatoreye 2015.03.29 03:39  

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.

SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2015.03.29 05:49  
Try that again during weekdays or when the market opens. No point complaining when you can't test it fully.
Gatoreye
52
Gatoreye 2015.03.29 06:52  

do I sound like complaining to you?

Gatoreye
52
Gatoreye 2015.03.29 07:42  

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.

SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2015.03.29 08:16  
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.
12
To add comments, please log in or register