I have an indicator shown in a separate window and I want to place a text label in the window. The code I have is:
The problem is with the string "indi_label".
I have a print statement for the string which shows as :
This is a snapshot of where the text label goes in the indicator window:
Any ideas why the string has been cut short please?
I've tried StringInit(indi_label,200,0) but this has no effect.
I think the maximum of characters should not exceed 63 characters. Similar as an object name in ObjectCreate. See the note: https://docs.mql4.com/objects/objectcreate
I think the maximum of characters should not exceed 63 characters. Similar as an object name in ObjectCreate. See the note: https://docs.mql4.com/objects/objectcreate
This is what I originally thought so I used StringInit which I have used in other EA's for strings much longer than 63 characters and this has worked fine. It does not work here!
Also the line of code I have to print the string indi_label is:
String indi_label; indi_label = "----- Number of data for symbol = " +(string)i + " Total data = " + (string)num_data + " Percentage = " + DoubleToStr(perc,0) + "%"; Print(indi_label);
So I assign the whole string to indi_label which prints out as shown above - so the length of the string doesn't seem a problem.
Still confused!
This is what I originally thought so I used StringInit which I have used in other EA's for strings much longer than 63 characters and this has worked fine. It does not work here!
Also the line of code I have to print the string indi_label is:
So I assign the whole string to indi_label which prints out as shown above - so the length of the string doesn't seem a problem.
Still confused!
OK sorry I shouldn't confuse 'Print' with a string object but I still don't know why StringInit does not work?
This is what I originally thought so I used StringInit which I have used in other EA's for strings much longer than 63 characters and this has worked fine. It does not work here!
Also the line of code I have to print the string indi_label is:
So I assign the whole string to indi_label which prints out as shown above - so the length of the string doesn't seem a problem.
Still confused!
The problem aren't StringInit() or your string "indi_label" which contains the whole text but if you use longer string than 63 characters in the ObjectSetText() function then the function uses only 63 characters.
I also have this problem. It's very annoying such a short character limit, as well as the limit in the Experts log :-/ Is there a work around other than splitting the string and using two objects placed one next to the other?
I ended up using two objects.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I have an indicator shown in a separate window and I want to place a text label in the window. The code I have is:
The problem is with the string "indi_label".
I have a print statement for the string which shows as :
This is a snapshot of where the text label goes in the indicator window:
Any ideas why the string has been cut short please?
I've tried StringInit(indi_label,200,0) but this has no effect.