Download MetaTrader 5
To add comments, please log in or register
Use MQL5 Cloud Network. Test robots at a super speed!
Route206
211
Route206 2015.07.26 19:33 

I throw a lot of info on the chart in my EAs and would like to organize that a little better.
To separate values I now go about it as follows:

string text;
text=StringConcatenate("tic= ",tic,"    tac= ",tac,"    toe= ",toe);
Comment(text);

I basically thow in a bunch of spaces. This has the disadvantage that with multiple lines, things are not aligned because of the different values of tic/tac/toe on each line (e.g. 2.01 and 2.0009 on the next line)
Hence I tried:

string text;
text=StringConcatenate("tic= ",tic,"\ttac= ",tac,"\ttoe= ",toe);
Comment(text);

hoping that like \n for a new line, \t would give me tab, which would better that just a bunch of random spaces between brackets.

Unfortunately: no success. Everything is glued together.

any ideas?

tx

JC
1394
JC 2015.07.26 19:42  
Route206:

Unfortunately: no success. Everything is glued together.

any ideas?

It's very likely that MT4 is using the Win32 TextOut() or ExtTextOut() functions rather than TabbedTextOut(), and therefore including tab characters isn't going to have any effect. If you want tabulated text, you are almost certainly going to have to use multiple chart objects (OBJ_LABEL) instead of Comment().
JC
1394
JC 2015.07.26 19:47  
jjc:
It's very likely that MT4 is using the Win32 TextOut() or ExtTextOut() functions rather than TabbedTextOut(), and therefore including tab characters isn't going to have any effect. If you want tabulated text, you are almost certainly going to have to use multiple chart objects (OBJ_LABEL) instead of Comment().
... for comparison and general background, the reason why dotted or dashed lines in an MT4 indicator have to be 1 pixel wide, with all lines of 2 or more pixel-widths being solid, is almost certainly that MT4 is passing on a restriction in the antediluvian Win32 CreatePen() function.
Route206
211
Route206 2015.07.27 06:12  
jjc:
... for comparison and general background, the reason why dotted or dashed lines in an MT4 indicator have to be 1 pixel wide, with all lines of 2 or more pixel-widths being solid, is almost certainly that MT4 is passing on a restriction in the antediluvian Win32 CreatePen() function.
Thanks! I wish I could say that I fully understood, but I'm afraid that is not the case. The long and short of it though is that with Comment() it won't work now nor ever, correct? I like Comment() as it is simple and straightforward, chart objects are not my thing...
whroeder1
13627
whroeder1 2015.07.27 11:34  
Route206:
text=StringConcatenate("tic= ",tic,"    tac= ",tac,"    toe= ",toe);

I basically thow in a bunch of spaces. This has the disadvantage that with multiple lines, things are not aligned because of the different values of tic/tac/toe on each line

So control your conversions with StringFormat.
JD4
1101
JD4 2015.07.27 17:22  
I did some checking yesterday, (not on this comp so can't look up history) and think I remember seeing when people tried using the \ style stuff, they enclosed it in single quotes.
JC
1394
JC 2015.07.27 18:06  
WHRoeder:
So control your conversions with StringFormat.

As I understand it, an example of route206's issue would be that the following numbers are not properly right-aligned (because of the proportional font which MT4 is using):

Comment(" 111.11\r\n8888.88");

 Similarly, attempts to use special space characters such as 0xA0, 0x2000, 0x2001 etc are unsuccessful, because all the space characters in the typeface are the same width, and different to the width of the numbers:

Comment("\x00A0111.11\r\n8888.88");

The only way to get the alignment which route206 wants is to pad with zeroes, or another character of the same width such as _

Comment("0111.11\r\n8888.88");
Comment("_111.11\r\n8888.88");

...or to use chart objects instead of Comment()

/
To add comments, please log in or register