DRAWSEGMENT

Category: Graphical

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.

Syntax:

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.

Example:

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.

Additional Information:

  • The x coordinates typically represent the bar index in a trading chart, which is the horizontal axis showing the progression of time or trades.
  • The y coordinates are usually price levels or computed values from indicators.
  • The alpha value for transparency ranges from 0 (completely transparent) to 255 (completely opaque).
  • Using the COLOURED function enhances the visual distinction of different segments based on their significance or conditions.

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.

Related Instructions:

  • DRAWHLINE graphical
  • DRAWLINE graphical
  • DRAWVLINE graphical
  • Logo Logo
    Loading...