How to get "error" information from the journal? - page 2

 
GumRai:


I already gave an example a few posts back, which you dismissed.

Make sure that the print() when there is an error includes a string that is easily identifiable.

Then when you open the log file, use edit/find to locate that string, so at the same time finds the error report.


GumRai:
If you know that you will have a lot of entries in the log file to sort through, it may be an idea to put something like "xyz" in the print() and then use Edit/Find to locate the print statements

Man it's not about this.You dismissed my posts too.The problem is not that i can't see the error, it is the fact that there are over 10.000 journal entries,you want me to search manually in all of them ? + how does a random "xyz" will associat with the error code.The error will show stuffs like error code 1, error code 2, how do you think i will associate those in any form with a text identifier.The solution would be, as i said like 2 times now, some kind of code that checks if any error happened and print that to the journal, or better, if multiple errors happened count how many.I dont know if such thing is possible that's why i`m asking, i guess i wasnt very clear with specifying my problem or idk, but any help will be appreciated :) .

 
Proximus:

Man it's not about this.You dismissed my posts too.The problem is not that i can't see the error, it is the fact that there are over 10.000 journal entries,you want me to search manually in all of them ? + how does a random "xyz" will associat with the error code.The error will show stuffs like error code 1, error code 2, how do you think i will associate those in any form with a text identifier.The solution would be, as i said like 2 times now, some kind of code that checks if any error happened and print that to the journal, or better, if multiple errors happened count how many.I dont know if such thing is possible that's why i`m asking, i guess i wasnt very clear with specifying my problem or idk, but any help will be appreciated :) .


How are you searching manually when you are using Edit/find?

If you have 10,000 entries and a particular string only appears 3 times, it will take 3 clicks of the mouse to locate them.

If you are only interested in entries that contain the word "error", then use find to locate the word "error"

 
GumRai:


How are you searching manually when you are using Edit/find?

If you have 10,000 entries and a particular string only appears 3 times, it will take 3 clicks of the mouse to locate them.

If you are only interested in entries that contain the word "error", then use find to locate the word "error"

1) Yes this is why i need to automate the stuff, i`m sure mq4 lets you develop a little code which can do this inside the EA

2) That doesn't matter.

3) What if there are like 900 error logs? What if i want to group different types of errors, like if i get error nr 1 and error 4056,since error nr 1 is not that bad error, but it lies hidden inside the many many error nr 1 strings.What if i want to count them?

In fact let's change my request cos i see you guys don't get it, what i`m asking.So my new request is how to count different types or errors from the journal?

Ex: error nr .1 x 10 pieces

error nr. 4056 x 200 pieces

error nr. 4020 x 500 pieces

Like this, how to make it happen for the EA to show me how many errors have happened from a certain type?

 
Proximus:

1) Yes this is why i need to automate the stuff, i`m sure mq4 lets you develop a little code which can do this inside the EA

2) That doesn't matter.

3) What if there are like 900 error logs? What if i want to group different types of errors, like if i get error nr 1 and error 4056,since error nr 1 is not that bad error, but it lies hidden inside the many many error nr 1 strings.What if i want to count them?

In fact let's change my request cos i see you guys don't get it, what i`m asking.So my new request is how to count different types or errors from the journal?

Ex: error nr .1 x 10 pieces

error nr. 4056 x 200 pieces

error nr. 4020 x 500 pieces

Like this, how to make it happen for the EA to show me how many errors have happened from a certain type?

If you have one error fix it . . . if you have many fix them all . . . if you have 2000 errors in your log you have serious problems, there is no need to go searching, fix any errors you have.
 
RaptorUK:
If you have one error fix it . . . if you have many fix them all . . . if you have 2000 errors in your log you have serious problems, there is no need to go searching, fix any errors you have.

Yes thats the point after all, but you know when you have 2000 trades in log it always spams it full with order modification/close/opening data, and you can hardly see the error message between all that useless spam.Thats why i need to develop somekind of error catcher code which would notify me if even 1 error has appeared.
 
Proximus:
Yes thats the point after all, but you know when you have 2000 trades in log it always spams it full with order modification/close/opening data, and you can hardly see the error message between all that useless spam.Thats why i need to develop somekind of error catcher code which would notify me if even 1 error has appeared.

No, just Print("MyEANameError: ", Error, . . . . . ) then search for MyEANameError and you will find all your errors . . .
 

Proximus just doesn't seem to be comprehending Raptor.

I wrote this test code

 for(int line=1;line<=10000;line++)
      {
      if(line==5000)
         {
         Print("HeeHee, I'm line number 5,000 - you'll never find me!");
         continue;
         }
      Print("This is line ",line);
      }

So I now have a log with 10,000 lines of Print()

Using Edit/Find, HeeHee is not going to appear in any other line of code

and simply clicking on find next, a millisecond later

It's a simple as that, just using the default Notepad

 
Man you really dont understand me
Proximus:

1) Yes this is why i need to automate the stuff, i`m sure mq4 lets you develop a little code which can do this inside the EA

2) That doesn't matter.

3) What if there are like 900 error logs? What if i want to group different types of errors, like if i get error nr 1 and error 4056,since error nr 1 is not that bad error, but it lies hidden inside the many many error nr 1 strings.What if i want to count them?

In fact let's change my request cos i see you guys don't get it, what i`m asking.So my new request is how to count different types or errors from the journal?

Ex: error nr .1 x 10 pieces

error nr. 4056 x 200 pieces

error nr. 4020 x 500 pieces

Like this, how to make it happen for the EA to show me how many errors have happened from a certain type?

Please read my reply.So the idea is to catch different types of errors, and/or count them.I want to know how many are there and the types of it because it is easier to count the errors type by type than search in notepad.Imagine a situation where there are 10 errors and 10 different hiding inbetween the lines or there are hundreds or errors, each is different, so if i search of lets say error number 4025 how do i know that there is an error number 4000 also? I`m obviously not going to search for all error codes.So isnt it easier if there were a counting machine which counts all errors grouped by type and prints it out occasionally.

+10.000 lines are not enough, i`m not sure exactly how many of them the MT4 keeps but i`m sure its not enough for me.I usually make nowadays backtests with 5000-7000 trades or more, 1 line for orderopen,3-4 lines for trailstops ordermodify, and 1 line for orderclose =thats 6 lines /trade * 7000 trades =thats ~42000 lines or mode and i`m sure the MT4 journal doesnt keep that many in it :)

So yeah the counting method would be more effective!

RaptorUK:
No, just Print("MyEANameError: ", Error, . . . . . ) then search for MyEANameError and you will find all your errors . . .

This isnt the solution either, what is in the variable "Error"? Also how to test if an error has happened? And maybe,if possible, how to differentiate different types of errors? With code obviously.Thanks!
 

I hope I'm not stating the obvious, and apologies if I am!

I suspect everyone responding has assumed you are aware, but the MT journal is simply a number of files, one per day, of which the last few lines of the latest file are displayed in the GUI.

The files (for back testing) live in MetaTrader Install Folder/tester/logs

You can search through then using any tools available to you - eg dos command Findstr to extract the files...

cd MetaTrader Folder/tester/logs

Findstr some_text *.log

Findstr some_text *.log > small_log.txt


Again, Apologies if I am stating the obvious and you are actually after something else!?

 
ydrol:

Again, Apologies if I am stating the obvious and you are actually after something else!?


No need to apologize, but I understood, that OP was not interested in finding and fixing errors, but rather in their statistics.
Reason: