Graphical/probuilder

STYLE

STYLE in ProBuilder sets how a returned indicator series is drawn, as a line, dotted line, histogram or points, with a width. Syntax, options and worked examples.

Syntax

probuilder
RETURN myvariable STYLE(style_type, width)

Parameters

NameTypeDefaultDescription
style_typekeywordLINEDraw style. See the options table below.
widthintegerplatform defaultLine thickness or point size.

The available style_type values are:

StyleEffect
LINEA plain continuous line. This is the default.
DOTTEDLINEA basic dotted line.
DOTTEDLINE1 to DOTTEDLINE4Dotted lines with varying dot patterns.
HISTOGRAMA series of vertical bars.
POINTA series of separate points.

How it works

STYLE runs inside a ProBuilder indicator. It attaches to a value in the RETURN line and sets how that series is plotted, which is otherwise chosen by hand in the indicator settings window. It can be combined with COLOURED for colour and AS for a series name, and each returned value can carry its own STYLE.

The width argument sets line thickness or point size. Because STYLE describes a returned series rather than drawing an object at coordinates, it differs from the DRAW commands: it changes the appearance of the indicator output itself.

Examples

Example 1, Histogram, line and dotted line together (Indicator)

probuilder
// Style three returned series differently on one indicator
i1 = LinearRegression[20](close)
i2 = LinearRegression[10](close)
diff = i2 - i1
avgdiff = ExponentialAverage[7](diff)

RETURN diff COLOURED(50,146,175,90) STYLE(HISTOGRAM,2) AS "LR difference", avgdiff COLOURED(227,247,40) STYLE(LINE,3) AS "Avg of difference", avgdiff[1] COLOURED(227,247,40) STYLE(DOTTEDLINE,1) AS "Delayed Avg of difference"

diff is drawn as a histogram, avgdiff as a solid line and its delayed value as a thin dotted line.

Example 2, A single point series (Indicator)

probuilder
// Plot closing price as points rather than a line
RETURN close STYLE(POINT, 3) AS "Close points"

The POINT style renders each value as a separate dot at size 3.

Example 3, A thick line (Indicator)

probuilder
// A wide moving-average line
ma = Average[50](close)
RETURN ma COLOURED(0, 120, 255) STYLE(LINE, 4) AS "MA50"

The width of 4 makes the moving-average line stand out.

Common errors and gotchas

  • Indicator output only. STYLE describes a returned series. It has no effect in ProScreener, ProOrder or ProBacktest, which do not plot indicator output.
  • Attach to a RETURN value. STYLE must follow a value in the RETURN line. It is not a standalone statement.
  • One style per value. In a multi-value RETURN, each value keeps its own STYLE, COLOURED and AS. A style does not carry to the next value.
  • Style versus DRAW commands. STYLE changes how a series is plotted. To place a shape at coordinates, use a DRAW command such as DRAWPOINT instead.
  • RETURN, the statement STYLE attaches to.
  • COLOURED, sets the colour of the returned series.
  • AS, names the returned series in the legend.
  • DRAWPOINT, draws points at coordinates rather than styling a series.
  • GRAPH, plots a value in a separate panel.
  • GRAPHONPRICE, plots a value over the price.
  • ExponentialAverage, a series often returned with a STYLE.
  • Average, a series often returned with a STYLE.