Self terminating EA - Error "array out of range"
-
From time to time the EA decides by itself to quit. It just disappears from the chart. As far as I can see, this usually happens after opening a position.
Does somebody else know this effect? -
is some error in log? or can you post shared example where it happened?
-
@miro1360 This EA is for small & easy tests.
https://fxdreema.com/shared/Hc1GUdqN
I started 4 instances of this Test EA yesterday evening. Only 1 of them "survived" until this morning. Log just says:...
2017.09.15 01:54:00.404 Experts expert 170914_OpenPosisGroupIDonlyForCheckOpen_v8 (EURUSD,M1) removed
...
2017.09.15 06:05:04.158 Experts expert 170914_OpenPosisGroupIDonlyForCheckOpen_v8 (EURUSD,M1) removed
...
2017.09.15 08:52:02.566 Experts expert 170914_OpenPosisGroupIDonlyForCheckOpen_v8 (EURUSD,M1) removed
... -
Sorry, I saw this question, but I forgot to answer to it

It's hard to say why this happens. In my backtest I see many pending orders that expire quickly, maybe the broker doesn't like that. Do you have more error messages?
-
@fxDreema
Now I come up with some new error messages: (was quite busy the last time)It is still a big problem, that my EAs keep terminating themselves without any visible reason! Tried different ways of building my EA. Tried different MetaTraders with three different Brokers. On some the EA runs longer, on some shorter. But 75% of them die!
Do you see a solution?
The EA terminates itself right in the second, it creates a position.
Tab Journal says: "170914_OpenPosisGroupIDonlyForCheckOpen_v8 (EURUSD,M1) removed"
Tab Experts says at the same second: "array out of range in '170914_OpenPosisGroupIDonlyForCheckOpen_v8.mq5' (3605,41)
And Line 3605 is: UpdateEventValues(EGV_OrderList[OrdersTotal()-1],"new","");