The DRAWSEGMENT function in ProBuilder language is used to draw a line segment between two specified points on a chart. This function is particularly useful for visualizing relationships or marking specific areas on a chart based on calculated coordinates.
DRAWSEGMENT(x1, y1, x2, y2) COLOURED(R, G, B, a)
The parameters x1 and y1 represent the x and y coordinates of the starting point of the line segment, while x2 and y2 represent the x and y coordinates of the ending point. The COLOURED function is optional and allows you to specify the color of the line segment using RGB color codes and an alpha value (a) for transparency.
DRAWSEGMENT(10, 50, 100, 50) COLOURED(255, 0, 0, 150)
This example draws a semi-transparent red horizontal line segment from the point (10, 50) to (100, 50) on the chart.
This function is versatile and can be used in various contexts, such as highlighting support/resistance levels, drawing trend lines, or visualizing statistical calculations like linear regressions on trading charts.