How To Write Some Output To The File Before Crash ?

Back to topics list To post a new topic, please log in or register
avatar
23
mideel 2015.01.18 15:07
 

I'm trying to make a new EA with recursive function and every time I back tested it, its always " Meta Trader has stopped working ".

I don't know in which part is the problem.

I put some of print statements for debugging but I couldn't see it because it crashed.

I also couldn't find some output in the tester directory, usually all of the print() output would go there if Meta Trader didn't crash.

Also, is this cause by infinite loop or run out of memory or can be other reasons ?

avatar
20
PeterBocan 2015.01.18 15:12 #
 
Your recursion is very dangerous, takes up all the processing power of the CPU. You must stop it somewhere.
avatar
165
DeepThought 2015.01.18 15:37 #
 
mideel:

I'm trying to make a new EA with recursive function and every time I back tested it, its always " Meta Trader has stopped working ".

I don't know in which part is the problem.

I put some of print statements for debugging but I couldn't see it because it crashed.

I also couldn't find some output in the tester directory, usually all of the print() output would go there if Meta Trader didn't crash.

Also, is this cause by infinite loop or run out of memory or can be other reasons ?

Instead of the Print statement, You may send the log to a custom text file and flush it after every write. This is the way I create trace logs to isolate a problem.

Or you may use and catch the standard Windows debug output https://forum.mql4.com/61971

avatar
2017
gooly 2015.01.18 18:58 #
 

Why don't you write it in the Comment(..).

If you EA stops working without disappearing from your screen you can see what the EA has done last.

Beside that I guess you have an endless loop by e.g. not changing the checked(?) variable..

Back to topics list  

To add comments, please log in or register