How to draw a rectangle with a filled color
Forums › ProRealTime English forum › ProBuilder support › How to draw a rectangle with a filled color
-
-
05/19/2025 at 4:30 AM #24729105/19/2025 at 5:26 AM #247292
Try this one:
Rectangle with Color1234567DefParam DrawOnLastBarOnly=True//DrawRectangle(x1,y1,x2,y2) FillColor(R,G,B)DrawRectangle(BarIndex-75,42000,BarIndex,42150) FillColor(0,255,0)Return1 user thanked author for this post.
05/19/2025 at 7:37 AM #24729405/19/2025 at 8:28 AM #247296It is also possible to use coloured and bordercolor to fill the rectangle/triangle.
Note that if you use coloured alone, it will only color the rectangle (not filling the inside). If you add bordercolor instruction, then you will color the rectangle and fill it (with same or different color as you wish).
If you want just to fill it, then fillcolor is the best. You can also use bordercolor and fillcolor in order to have 2 diferent color for the rectangle and the filling…
Filled with COLOURED123456789DefParam DrawOnLastBarOnly=True//DrawRectangle(x1,y1,x2,y2) FillColor(R,G,B)DrawRectangle(BarIndex-75,close,BarIndex,close+30) FillColor(0,255,0)DrawRectangle(BarIndex-75,close,BarIndex,close-30) coloured(0,255,0) bordercolor("red",255)style(line,3)Return1 user thanked author for this post.
05/19/2025 at 3:36 PM #24732905/20/2025 at 6:35 AM #247353Thks for the excellent info.
Plse explain difference between coloured(0,255,0) and bordercolor(“red”,255). I notice that at https://www.prorealcode.com/prorealtime-documentation/ , bordercolor is not listed but it is found in proBuilder manual.
For the transparency, fillcolor(r, g, b, transparency), the smaller value of transparency means less transparent?05/20/2025 at 7:52 AM #247354For the 3 of them (coloured, bordercolor and fillcolor) you can use either the “color name” or R,G,B numbers and the transparency :
– (“colorname”,tansparency)
– (R,G,B,tansparency)transparency can go from 0 (completly transparent) to 255 (no transparency)
* Bordercolor instruction can only color rectangle/triangle itself (as it is a segment/line that draws the rectangle/triangle, you can add “style” instruction for the width or/and the style of the line, dotted or not…)
* fillcolor instruction can only color/fill the inside of the rectangle/triangle
* coloured instruction can do both (the color of the rectangle/triangle OR the inside filling) : if it is used alone, it will color the rectangle/triangle itself, if it is used with bordercolor (after of before it), it will color/fill the inside of the rectangle/triangle.1 user thanked author for this post.
05/21/2025 at 8:27 AM #247419 -
AuthorPosts
Find exclusive trading pro-tools on