Graphical/probuilder

DRAWPOINT

DRAWPOINT in ProBuilder draws a marker point at a bar index and price, with an optional size, COLOURED fill and BORDERCOLOR border. Syntax, parameters and examples.

Syntax

probuilder
DRAWPOINT(x, y, size) COLOURED(R, G, B, a) BORDERCOLOR(R, G, B, a)

Parameters

NameTypeDefaultDescription
xintegerrequiredBar index where the point is drawn.
ypricerequiredPrice or vertical value at which the point appears.
sizeintegerplatform defaultOptional point size, up to a maximum of 5.
R, G, B (COLOURED)integerplatform defaultFill colour components, 0 to 255.
a (COLOURED)integerfullFill alpha (opacity), 0 to 100.
R, G, B (BORDERCOLOR)integerplatform defaultBorder colour components, 0 to 255.

How it works

DRAWPOINT runs inside a ProBuilder indicator. It places a single marker at the coordinate (x, y), where x is a bar index and y is a price. The optional size controls how large the point is, up to 5. COLOURED sets the fill and BORDERCOLOR sets the outline, so a point can have a contrasting rim.

Because DRAWPOINT marks one condition at one bar, it is often called inside an IF block that fires only when a signal occurs, rather than on every bar. When many historical markers are wanted, no DrawOnLastBarOnly is needed, but for a single current marker it can be set.

Examples

Example 1, Mark an RSI crossover (Indicator)

probuilder
// Green point with a cyan border where RSI crosses above 50
irsi = RSI[14]
IF irsi CROSSES OVER 50 THEN
    DRAWPOINT(BarIndex, low, 5) COLOURED(0, 255, 0, 50) BORDERCOLOR(0, 255, 255)
ENDIF
RETURN

The point appears at the low of each bar where the 14-period RSI turns up through 50.

Example 2, Dot every new high (Indicator)

probuilder
// A red dot at each bar that prints a new 20-bar high
IF high >= Highest[20](high) THEN
    DRAWPOINT(BarIndex, high, 3) COLOURED(200, 0, 0, 80)
ENDIF
RETURN

Points accumulate across history, marking each fresh high.

Example 3, Single point on the last bar (Indicator)

probuilder
// One marker on the current close only
DEFPARAM DrawOnLastBarOnly = true
DRAWPOINT(BarIndex, close, 5) COLOURED(0, 100, 255, 100) BORDERCOLOR(255, 255, 255)
RETURN

With DrawOnLastBarOnly = true, only the current bar is dotted.

Common errors and gotchas

  • Indicator only. DRAWPOINT has no effect in ProScreener, ProOrder or ProBacktest. Keep it in a ProBuilder indicator.
  • Alpha scale differs. For DRAWPOINT the COLOURED alpha runs 0 to 100, not 0 to 255 as in many other drawing instructions.
  • Size cap. The size argument tops out at 5. Larger values are clamped.
  • X is a bar index. Passing a price into x misplaces the point horizontally. Use BarIndex.