How to build an "windows form" to check EA parameters - page 2

 
figurelli:

This question reminds me that old Chinese Proverb ... "Four things come not back: the spoken word, the spent arrow, the past life, and the neglected opportunity."

In the same way, the lost tick at MT5 debugger, or even in no emulation mode, come not back. 

 


Thank you
 
YouTrade:

Yes I did but let me ask you something about it ...

When you debug an intraday chart you are actually stopping "time" to evaluate the variables. If the system runs on a tick basis, Even If I take too much time, the Debug will evaluate the values tick by tick or (2) next time I run the OnTick(), it will take the actual condition.

Regards,

Of course if you stop the program on a tick, then start to debug, you will miss some ticks.
 
angevoyageur:
Of course if you stop the program on a tick, then start to debug, you will miss some ticks.
Thank you
 
YouTrade:

Do y have an example ?

Using your Report you just have an option to define the size of log output.

One way to define levels is create a debug function comparing the message level and debug level, for instance: 

int debugLevel=2; // debug level, for instance critical conditions based on syslog (declare this global)

void debug(string debugMessage, int level)
{
   if (level<=debugLevel) Print(debugMessage);
}

Now you just have to insert in your code what you need debug (create the message) and the message level:

// I just want debug this part at level 4
string debugMessage=StringFormat("Contratos=%i, Etc=%i",contratos,etc);
debug(debugMessage,4);

Note that, in the example, as debugLevel=2, the message won't be print, since message level is 4. So, to print such level, you need change debugLevel to 4 or greater number.

The advantage of this approach is that you can precisely define the number of messages and debug level of each message, while using your Report you just have 4 fixed outputs, and probably this creates lots of debug messages each time you need to use it to debug.

Reason: