ITMScript · Reference
Colours and styles
The names a study may use for colour, plot style, marker style and line style, and the other spellings the language accepts.
Colours
Write a colour as color.blue, as #rrggbb or as #rrggbbaa. The swatch is the reference value color.new uses to make a see-through colour, such as color.new(color.blue, 80). The chart paints a named colour from its own light or dark palette, so the shade on a chart follows the theme.
A per-bar colour goes on plot, plotshape, fill and bgcolor. The colour of each may be a condition that picks between two colours, one for each outcome. A level's colour is one colour for the whole study. bgcolor tints by condition as before.
color.blue#2962ffcolor.green#26a69acolor.orange#ff9800color.purple#9c27b0color.red#ef5350color.cyan#00bcd4color.yellow#ffeb3bcolor.pink#e91e63color.white#ffffffcolor.gray#787b86color.black#000000color.lime#00e676color.teal#009688color.maroon#80323ccolor.navy#00227bcolor.olive#808000color.silver#b2b5becolor.aqua#00bcd4color.fuchsia#e040fb
Plot styles
The chart draws a few styles in the nearest shape it has, so each row says what you see.
The style option of plot. The width is a whole number from 1 to 8.
| Style | Draws |
|---|---|
line | A continuous line. |
histogram | Bars from the zero line to the value. |
area | A line with the space below it filled. |
columns | Bars from the zero line to the value, drawn as a histogram. |
stepline | A line that holds each value until the next bar. |
circles | A dot on each bar. |
cross | A mark on each bar, drawn as a dot. |
Marker styles
The style and location options of plotshape.
| Style | Draws |
|---|---|
triangleup | An upward marker, drawn as an arrow. |
triangledown | A downward marker, drawn as an arrow. |
arrowup | An upward arrow. |
arrowdown | A downward arrow. |
circle | A circle. |
label | A small box that holds the text. |
| Location | Puts the marker |
|---|---|
abovebar | Above the high of the bar. |
belowbar | Below the low of the bar. |
absolute | Inside the bar, with no offset above or below. |
Line styles
The style option of hline.
| Style | Draws |
|---|---|
solid | An unbroken line. |
dashed | A line of dashes. |
dotted | A line of dots. |
Other spellings
These spellings are accepted and read as the word on the right. The plan keeps the word on the right, so formatting a script prints it. Any other key or value that a statement does not read is refused, and the message lists the ones it does.
| Statement | You write | Read as |
|---|---|---|
plot | title= | label= |
plot | linewidth= | width= |
plotshape | title= | text= |
hline | title= | label= |
plot | style=plot.style_line | style=line |
plot | style=plot.style_histogram | style=histogram |
plot | style=plot.style_area | style=area |
plot | style=plot.style_columns | style=columns |
plot | style=plot.style_stepline | style=stepline |
plot | style=plot.style_circles | style=circles |
plot | style=plot.style_cross | style=cross |
plotshape | style=shape.triangleup | style=triangleup |
plotshape | style=shape.triangledown | style=triangledown |
plotshape | style=shape.arrowup | style=arrowup |
plotshape | style=shape.arrowdown | style=arrowdown |
plotshape | style=shape.circle | style=circle |
plotshape | style=shape.labelup | style=label |
plotshape | style=shape.labeldown | style=label |
plotshape | location=location.abovebar | location=abovebar |
plotshape | location=location.belowbar | location=belowbar |
plotshape | location=location.absolute | location=absolute |
hline | style=hline.style_solid | style=solid |
hline | style=hline.style_dashed | style=dashed |
hline | style=hline.style_dotted | style=dotted |
input.* | defval= | default= |
input.* | minval= | min= |
input.* | maxval= | max= |