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
FILLCOLOR(R, G, B)Parameters
| Name | Type | Default | Description |
|---|---|---|---|
R | integer | required | Red component of the fill colour, 0 to 255. |
G | integer | required | Green component of the fill colour, 0 to 255. |
B | integer | required | Blue 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)
// 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)
RETURNCOLOURED draws the green border and FILLCOLOR(255, 0, 255) fills the box purple.
Example 2, Filled ellipse around a swing (Indicator)
// 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)
RETURNThe ellipse is outlined in blue and filled with a pale blue interior.
Example 3, Filled triangle marker (Indicator)
// 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)
RETURNFILLCOLOR shades the triangle interior while COLOURED draws its edges.
Common errors and gotchas
- Indicator only.
FILLCOLORhas no effect in ProScreener, ProOrder or ProBacktest. Keep it in a ProBuilder indicator. - Not standalone.
FILLCOLORmust be attached to a shape command. On its own it does nothing. - No alpha argument.
FILLCOLORtakes only R, G and B. For a transparent fill, use the alpha on the shape'sCOLOUREDclause where supported. - Fill versus background. To tint the whole chart column rather than a shape, use
BACKGROUNDCOLORinstead.
Related instructions
COLOURED, sets the outline colour of the same shape.BACKGROUNDCOLOR, tints the whole chart background per bar.ColorBetween, shades the area between two series.DRAWRECTANGLE, a shape whose interiorFILLCOLORfills.DRAWELLIPSE, a shape whose interiorFILLCOLORfills.DRAWTRIANGLE, a shape whose interiorFILLCOLORfills.DrawOnLastBarOnly, restricts drawing to the last bar.BarIndex, supplies the x coordinates of the shape.
