Style modifiers
Modifiers are bare words appended after an expression, separated by commas. They change how the series or the draw call is rendered. Several can be combined.
| Modifier | Effect |
|---|---|
COLORRED, COLORYELLOW, … | Preset colour, see the colour table below. |
COLORBBGGRR | Custom colour by hex, in blue-green-red byte order. COLOR00FFFF is yellow. |
RGBXRRGGBB | Custom colour by hex in the familiar red-green-blue order. |
LINETHICK1 … LINETHICK5 | Line width in pixels. |
DOTLINE | Draw the line dashed. |
STEPLINE | Draw the line as a step function. |
STICK | Draw as vertical bars from zero instead of a line. |
LINESTICK | Draw both the bars and the line. |
COLORSTICK | Histogram coloured by sign — the classic MACD bar. Combine with UPCOLOR / DOWNCOLOR. |
VOLSTICK | Volume-style coloured bars; accepts STICKTYPE. |
LINEAREA | Fill the area between the line and the axis. |
POINTDOT / CIRCLEDOT | Draw points instead of a connected line. |
UPDOWNDOT | Points coloured by direction; uses UPCOLOR / DOWNCOLOR. |
SINGLELINE | Treat the series as isolated segments rather than one polyline. |
LINEOVERLAY | Draw on the main pane even from a sub-pane script. |
NODRAW | Compute the output but do not draw it. |
NOTEXT, NOTITLE | Keep the drawing but hide the name in the legend. |
EXDATA | Extended data — available to alerts and scans, never drawn. |
DRAWABOVE / DRAWCENTER / DRAWBELOW | Place text and numbers above, on, or below the anchor price. |
ALIGN0 / ALIGN1 / ALIGN2 | Horizontal text alignment: left, centre, right. |
VALIGN0 / VALIGN1 / VALIGN2 | Vertical text alignment: top, middle, bottom. |
FONTSIZE8 … FONTSIZE24 | Font size in pixels for text and numbers. |
Some modifiers are function calls rather than bare words: RGB(r,g,b) and RGBA(r,g,b,a) set an arbitrary colour, UPCOLOR() / DOWNCOLOR() set the two-sided colours, CSSFONT() sets a full CSS font string, XMOVE() / YMOVE() shift the drawing in pixels, LINEDASH() sets a dash pattern, BACKGROUND() adds a text background box and CKLINE() adds a connector line.
MACD: (DIF - DEA) * 2, COLORSTICK, UPCOLOR(RGB(38,166,120)), DOWNCOLOR(RGB(239,83,80));
DRAWTEXT(CROSS(K, D), LOW, 'buy'), COLORWHITE, FONTSIZE12, VALIGN2, YMOVE(6),
BACKGROUND(RGB(38,166,120), RGB(255,255,255));