stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Fantastic Debugger for Empty4
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=644
Page 1 of 1
Author:  f-trader [ Sun Jun 24, 2012 9:32 am ]
Post subject:  Fantastic Debugger for Empty4

I thought the Print() function would be enough for me to debug , but recently
an EA crashed my Empty4 hundreds of times in strategy tester and forward testing ....
and the whole Journal was gone before I had a chance to see my Print log.

What I needed was a simple tool to debug which keeps the log even when Empty4 crashes.

I found it.
It is free and I just tested it ..... and that´s why I call it "fantastic".

Here you can download it for free ( registration is needed there, but that is no problem ).
https://www.fx1.net/wiki/
Go to LogViewer2 , it is better than the MT4Logger if you have Empty4 crashes because it
keeps the LogView window after a crash.

They have other helpfull tools like Mt4Ticker which has been shared in this forum already.

Edit:
Unfortunately after posting this first comment, on further backtests on other Empty4-platforms,
my Ea crashed them (although it didn´t on another, so that is driving me crazy) and
the log-window is gone too.

Sometimes Empty4 crashes without popping up a window where I can decide to send the crash-report to Microsoft or not.
And sometimes it gives that popup window. That is good because at that point in time
the Logviewer window is there and I can export the log to Notepad with 1 click.

Now, what to do when that nice popup window doesn´t appear and the Empty4 just is blown away together with the Logview-window ?

Solution: Decreasing the speed of the backtest in strategy tester.
This allows to export the log to Notepad before the next tick is simulated.
The next tick will blow away Empty4 and the Logviewer-window, but I still have the Notepad file
and can see all my comments for debugging.

Just discovered that Logviewer writes a log file into the Empty4 folder which survives the crash.
Author:  f-trader [ Sun Jun 24, 2012 10:18 am ]
Post subject:  Re: Fantastic Debugger for Empty4

Here is an example how the Logviewer window looks like:
Debugger.jpg
Author:  garyfritz [ Sun Jun 24, 2012 3:32 pm ]
Post subject:  Re: Fantastic Debugger for Empty4

You can also just do FileWrite() operations. I keep an editor open on the file so I can reload it every time I run the EA/indicator.
Author:  f-trader [ Sun Jun 24, 2012 4:39 pm ]
Post subject:  Re: Fantastic Debugger for Empty4

garyfritz wrote:You can also just do FileWrite() operations. I keep an editor open on the file so I can reload it every time I run the EA/indicator.
I never coded FileWrite() operations and would have to learn it first.

Using such an easy tool like this one is very convenient for me.
Author:  garyfritz [ Sun Jun 24, 2012 8:08 pm ]
Post subject:  Re: Fantastic Debugger for Empty4

Add code like this to your EA or indi:

Global variable:

int handle;

In your init():

handle = FileOpen("myfile.csv", FILE_WRITE, ","); // opens a file under experts\files

In deinit();

FileClose(handle);

Where you want to print something:

FileWrite(handle, "foo = ",foo,", bar = ",bar," and other stuff = ",otherstuff);
FileFlush(handle); // not required but it makes sure everything gets written out to the file
Author:  NeoTrader [ Sun Jun 24, 2012 8:40 pm ]
Post subject:  Re: Fantastic Debugger for Empty4

hi gary,
garyfritz wrote:Add code like this to your EA or indi:
Global variable:
int handle;
In your init():
handle = FileOpen("myfile.csv", FILE_WRITE, ","); // opens a file under experts\files
In deinit();
FileClose(handle);
Where you want to print something:
FileWrite(handle, "foo = ",foo,", bar = ",bar," and other stuff = ",otherstuff);
FileFlush(handle); // not required but it makes sure everything gets written out to the file
Nice Idea... will put it to my arsenal... Thanks..

happy Sunday,

NeoTrader

-
All times are UTC Page 1 of 1