Appendix C. Customizing Study Hints

When constructing a new study, it might be useful to add hints to inputs (and the study itself) to be shown in the Edit Studies and Strategies window. This might be especially useful when you have many inputs in calculation; so this is a means of quickly getting an idea of their purpose.

Hints need to be placed in study script before the declarations; a special section is added for this purpose. To declare hints, use the pound sign (#) and command hint. Here is an example:

#hint: <b>Hints</b> \n This study demonstrates hints. \n <li>And hints for inputs as well.</li>
#hint length: <b>Nothing</b> depends on this parameter.

input price = close;
input length = 12;

plot Data = price;

This example script will define two hints: one for the study itself and one for its input length. Note that to add a hint to an input, you need to specify its name after #hint and add a colon (in the example script above it looks like #hint length:). For the study hint, you just use the command and prepend a colon (#hint:).

As you can see, there are also options for text formatting. Use the <b></b> tag to conclude the part of text you wish to display in bold. To add a line break, use the escape sequence \n. And, finally, use the <li></li> tags to break down the description into the list.

Adding hints is also a means of defining default values for Thermo Mode visualization. However, in this case, you will need to use the thermo command instead of hint. For example:

#thermo plot : Data
#thermo input : length
#thermo minValue : 10
#thermo maxValue : 50
#thermo minColor : 0, 0, 255
#thermo maxColor : 255, 255, 255

input length = 35;
plot Data = Average(close, length);

When Thermo Mode is enabled, this example script will plot Simple Moving Average of Close price with user-defined parameters, i.e., set the Data plot as the one for Thermo visualization, use the length parameter as the lookback period, set lower and upper limits for lookback range equal to 10 and 50, respectively, and color lowest values blue, highest values, white. Consider adding thermo hints to a study with several inputs and plots to explicitly define which input and plot will be used in Thermo Mode.