Graphical/probuilder

FILLCOLOR

FILLCOLOR in ProBuilder sets the interior fill colour of a drawn object such as a rectangle or ellipse, using RGB values. Syntax, parameters and worked examples.

Syntax

probuilder
FILLCOLOR(R, G, B)

Parameters

NameTypeDefaultDescription
RintegerrequiredRed component of the fill colour, 0 to 255.
GintegerrequiredGreen component of the fill colour, 0 to 255.
BintegerrequiredBlue component of the fill colour, 0 to 255.

How it works

FILLCOLOR runs inside a ProBuilder indicator. It is not a standalone drawing instruction: it is a clause appended to a shape command such as DRAWRECTANGLE, DRAWELLIPSE or DRAWTRIANGLE, where it sets the colour that fills the interior of the shape. Pairing it with COLOURED, which sets the outline, gives a shape a distinct border and fill.

Colours are RGB components in the additive model, each 0 to 255. Unlike BACKGROUNDCOLOR, which tints the whole chart column at a bar, FILLCOLOR colours only the inside of the drawn object it is attached to.

Examples

Example 1, Rectangle with a purple fill (Indicator)

probuilder
// Green outline, purple interior, over the last five bars
R = 255
B = 255
DRAWRECTANGLE(BarIndex, close, BarIndex[5], close[5]) COLOURED(0, 200, 0) FILLCOLOR(R, 0, B)
RETURN

COLOURED draws the green border and FILLCOLOR(255, 0, 255) fills the box purple.

Example 2, Filled ellipse around a swing (Indicator)

probuilder
// Blue outline with a light interior around the recent range
DEFPARAM DrawOnLastBarOnly = true
hh = Highest[10](high)
ll = Lowest[10](low)
DRAWELLIPSE(BarIndex-10, hh, BarIndex, ll) COLOURED(0, 0, 200) FILLCOLOR(200, 220, 255)
RETURN

The ellipse is outlined in blue and filled with a pale blue interior.

Example 3, Filled triangle marker (Indicator)

probuilder
// A green-bordered triangle filled light green
DEFPARAM DrawOnLastBarOnly = true
DRAWTRIANGLE(BarIndex-5, low, BarIndex, high, BarIndex+5, low) COLOURED(0, 180, 0) FILLCOLOR(200, 255, 200)
RETURN

FILLCOLOR shades the triangle interior while COLOURED draws its edges.

Common errors and gotchas

  • Indicator only. FILLCOLOR has no effect in ProScreener, ProOrder or ProBacktest. Keep it in a ProBuilder indicator.
  • Not standalone. FILLCOLOR must be attached to a shape command. On its own it does nothing.
  • No alpha argument. FILLCOLOR takes only R, G and B. For a transparent fill, use the alpha on the shape's COLOURED clause where supported.
  • Fill versus background. To tint the whole chart column rather than a shape, use BACKGROUNDCOLOR instead.