Cannot repeat this: Stringo states: "Divide by zero in the EA stops your EA permanently."

 

Stringo states that divide by zero stops EA...

I cannot get this to happen.

.

ref: 'How to terminate an EA after it's done its job?'

stringo 2008.06.17 11:16
Divide by zero in the EA stops your EA permanently. See https://docs.mql4.com/runtime/errors

.

2008.06.27 20:26:24 divideByZero GBPUSD,H1: zero divide
2008.06.27 20:26:24 divideByZero GBPUSD,H1: zero divide
2008.06.27 20:26:24 divideByZero GBPUSD,H1: zero divide
2008.06.27 20:26:23 divideByZero GBPUSD,H1: zero divide
2008.06.27 20:26:22 divideByZero GBPUSD,H1: zero divide
2008.06.27 20:26:11 divideByZero GBPUSD,H1: zero divide
2008.06.27 20:26:05 divideByZero GBPUSD,H1: zero divide
... CUT OUT...

2008.06.27 20:21:58 divideByZero GBPUSD,H1: zero divide
2008.06.27 20:21:46 divideByZero GBPUSD,H1: zero divide
2008.06.27 20:20:39 divideByZero GBPUSD,H1: zero divide
2008.06.27 20:20:32 divideByZero GBPUSD,H1: zero divide
2008.06.27 20:19:21 divideByZero GBPUSD,H1: zero divide
2008.06.27 20:19:20 divideByZero GBPUSD,H1: zero divide
2008.06.27 20:18:45 divideByZero GBPUSD,H1: zero divide
2008.06.27 20:18:44 divideByZero GBPUSD,H1: initialized
2008.06.27 20:18:44 divideByZero GBPUSD,H1: zero divide
2008.06.27 20:18:42 divideByZero GBPUSD,H1: loaded successfully
.

please see attached file

.

BWT: support - the input form is still flaky... SRC -> paste code -> INSERT and result is nothing.

.

Thank you

Files:
 

1. I guess something was lost in the translation. "Your code is stopped dead in its tracks by divide by zero, until it is called again by a higher authority."

2. The output above does not contain any printing from your code, since your code was stopped by the divide by zero fault.


19:45:15 divideByZeroMod EURJPYm,M30: loaded successfully

Init called
19:45:34 divideByZeroMod EURJPYm,M30: INIT divides by zero. GetLastError()=0
19:45:34 divideByZeroMod EURJPYm,M30: zero divide
19:45:34 divideByZeroMod EURJPYm,M30: initialized

Start called
19:45:34 divideByZeroMod EURJPYm,M30: START divides by zero. GetLastError()=4013
19:45:34 divideByZeroMod EURJPYm,M30: zero divide
(will repeat with each tick)

Indicator manually removed
19:46:51 divideByZeroMod EURJPYm,M30: DEINIT divides by zero. GetLastError()=4013
19:46:51 divideByZeroMod EURJPYm,M30: zero divide
19:46:51 divideByZeroMod EURJPYm,M30: deinitialized
19:46:51 divideByZeroMod EURJPYm,M30: uninit reason 1
19:46:51 divideByZeroMod EURJPYm,M30: removed

Files:
 

No dissagreement at all. What troubles is like what happens with 99.9% of .ru answers... brevity = not care || not know || superiority

There suggestion as a method to stop EA is obvious but totally eroneous because the code is not marked as stopped in the Terminal.

Look at the scenario whereby I naively use there suggestion since they have categorically stated method to stop EA (brevity dictates that they fail to give whole story - assuming they know):

1. I put the code 'somewhere' in EA - this 'somewhere' quite justifiably might possibly be deep in EA.

2. Does EA stop - of course it does not! Not in any normal sense of the meaning.

3. It keeps plodding along until circumstances push execution path back to that 'somewhere' and only then will it stop and go no further (but start() still recalled next tic - of course!)

Tell me then, just how much damage possibly done [and also possibly over and over again] prior to this 'somewhere' ever getting hit again?

Critical Errors ... do not such things generally mean: no more execution... permanently?

Would never use such a technique, global flag(s) and start() preamble code checks for such items as stop flags, weekends, money issues etc, work good enough for me.

Sensible [and simple] Terminal design would be to flag EA status as stopped - an almost cosmetic code change would suffice. (err, maybe not in their instance)

Look, one is constantly amazed at the lack of compSci nous that they demonstrate on a far too regular basis.

 

brev·i·ty (brv-t)

n.
1. The quality or state of being brief in duration.
2. Concise expression; terseness.

-------

Divide by zero may be ephemeral. It is logged, life goes on.

 

Such composure is laudable indeed!

Especially your ability to maintain a centered philosophic deamour as your buggy code and/or environment now and then has an episodic moment.

Life may go on... but will the depth of one's depleted account do likewise.

Sounds all "This is the way of design"ish to me.

 
According to my interpretation of the doumentation for runtime errors, it is working as designed.
 

"I guess something was lost in the translation"

the end

 
i recall 0 divide was stopping EA indeed in some older builds, but now it doesn't work any more like that
 
That is possible, too.
 

I've inspected sources.

I am sorry. Described behavior was long time ago.

Only 4 errors stop EA

ERR_CANNOT_LOAD_LIBRARY 4018 At calling of an imported function, loading error of dll or ex4 library occurred
ERR_CANNOT_CALL_FUNCTION 4019 At calling of an imported function, it was found out that dll or ex4 library did not contain the called function
ERR_DLL_CALLS_NOT_ALLOWED 4017 At calling of an imported dll function, it was found out that dll imports were not allowed
ERR_EXTERNAL_CALLS_NOT_ALLOWED 4020 At calling of an ex4 function, it was found out that external ex4 imports were not allowed

Reason: