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
DRAWPOINT(x, y, size) COLOURED(R, G, B, a) BORDERCOLOR(R, G, B, a)Parameters
| Name | Type | Default | Description |
|---|---|---|---|
x | integer | required | Bar index where the point is drawn. |
y | price | required | Price or vertical value at which the point appears. |
size | integer | platform default | Optional point size, up to a maximum of 5. |
R, G, B (COLOURED) | integer | platform default | Fill colour components, 0 to 255. |
a (COLOURED) | integer | full | Fill alpha (opacity), 0 to 100. |
R, G, B (BORDERCOLOR) | integer | platform default | Border 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)
// 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
RETURNThe point appears at the low of each bar where the 14-period RSI turns up through 50.
Example 2, Dot every new high (Indicator)
// 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
RETURNPoints accumulate across history, marking each fresh high.
Example 3, Single point on the last bar (Indicator)
// One marker on the current close only
DEFPARAM DrawOnLastBarOnly = true
DRAWPOINT(BarIndex, close, 5) COLOURED(0, 100, 255, 100) BORDERCOLOR(255, 255, 255)
RETURNWith DrawOnLastBarOnly = true, only the current bar is dotted.
Common errors and gotchas
- Indicator only.
DRAWPOINThas no effect in ProScreener, ProOrder or ProBacktest. Keep it in a ProBuilder indicator. - Alpha scale differs. For
DRAWPOINTtheCOLOUREDalpha runs 0 to 100, not 0 to 255 as in many other drawing instructions. - Size cap. The
sizeargument tops out at 5. Larger values are clamped. - X is a bar index. Passing a price into
xmisplaces the point horizontally. UseBarIndex.
Related instructions
DRAWARROWUP, an upward arrow marker at a bar.DRAWARROWDOWN, a downward arrow marker at a bar.DRAWTEXT, a text label at a bar and price.DRAWELLIPSE, a larger circular shape.COLOURED, sets the fill colour and transparency.DrawOnLastBarOnly, restricts drawing to the last bar.BarIndex, supplies the x coordinate.STYLE, styles a returned series as points instead of drawing objects.
