Data Window in MT4

 

Hi Guys,

Does anybody know if it is possible to display EA variables in the Data Window in MT4?

This would be unbelievably useful but looking through through the documentation it looks like only MT4 coded tools (indicators etc;) can only be displayed!

thanks

 

this window will only display indicator buffers. This is useful when writing indicators or to explore what exactly a (possibly closed source) indicator does with its buffers when you try to make an EA for it.


For your EA variables you are restricted to using Print() or Comment() (or for a more powerful alternative to Print() for debugging purposes look here: http://www.forexfactory.com/showthread.php?p=3866205#post3866205).

Also there is a print() function in the common_functions.mqh (<- google it) that simulates a Print() with the help of the Comment() function, this print() will then go to the upper left of the chart and scroll the lines like a text console.

The fastest way to just display some status information is to do the following: Write a function ShowStatus()

void ShowStatus(){
  string out;
  out = "Current value of foo: " + DoubleToStr(GetFoo(), 4) + "\n";
  out = out + "Current value of baz: " + DoubleToStr(GetBaz(), 4) + "\n";
  out = out + "Current value of foobaz: " + foobaz + "\n";
  Comment(out);
}


int start(){
  ... 
  ...
  ...
  ShowStatus();
  return(0);
}

and call this at the end of every tick as shown above.

 
7bit:

this window will only display indicator buffers. This is useful when writing indicators or to explore what exactly a (possibly closed source) indicator does with its buffers when you try to make an EA for it.


For your EA variables you are restricted to using Print() or Comment() (or for a more powerful alternative to Print() for debugging purposes look here: https://www.mql5.com/go?link=https://www.forexfactory.com/showthread.php?p=3866205[hash]post3866205).

Also there is a print() function in the common_functions.mqh (<- google it) that simulates a Print() with the help of the Comment() function, this print() will then go to the upper left of the chart and scroll the lines like a text console.

The fastest way to just display some status information is to do the following: Write a function ShowStatus()

and call this at the end of every tick as shown above.


thanks 7bit - sorry only just read this. Yep, I regularly use print & comment and thanks for the link - but it would still be great to throw all variables in to the data window - no extra coding hassle of log files, void functions etc;
 
sd59:

but it would still be great to throw all variables in to the data window
not possible.
Reason: