Is it possible to insert ASCII, unicode, or special characters into a thinkScript string?

marketstreet

marketstreet

New member
Can I add up-and-down arrows or other non-standard characters to chart labels?

I'm writing a multi time frame study which uses the AddLabel function to plot a set of minimal color-coded labels in the top left corner of the chart. To preserve chart real estate and make the data as intuitive and easy to analyze as possible, instead of text words, I wish to use up-&-down arrows ( ↑↓ ) to indicate when that aggregation period's candle meets certain conditions.

The time frame labels will appear simply as H D W M Q Y followed by the appropriate characters.

Now, I can copy-&-paste a unicode arrow directly into the AddLabel string, which looks perfect on my Mac; but for Windows users, any special character renders as either a question mark (? ?) or blank boxes ([] []).

The label's text is written into a string ("only text goes in this string") and is not generated using an operator of the thinkscript language itself, so I cannot just insert html/ascii/unicode/alt code instructions directly because it will render identically as text. I am writing this study for a group of non-technical trader friends and I do not have access to Windows at home, so I cannot test this on my own. Have you attempted this or found a solution that will render across operating systems? Thank you for your time.

Code:
#Example:
AddLabel(oneHour, "<<<insert character here>>>", color.UPTICK);
-

AddLabel(oneHour, "↑↓", color.UPTICK);
#Renders "??" or "[][]" on Windows

AddLabel(oneHour, "&uarr;", color.UPTICK);
#Renders "&uarr;" on Mac (and I assume any OS)

AddLabel(oneHour, "^ v ', `.", color.UPTICK);
#I've tried many standard character substitutes, but they are unnatural and confusing.
 

Top