STYLE

Category: Graphical

The STYLE keyword in ProBuilder language is used to define the visual representation of the values returned by an indicator in a chart. This keyword allows users to programmatically set the style of the indicator lines, points, or histograms, which can otherwise be manually adjusted in the indicator settings window.

Syntax

RETURN myvariable STYLE(<style_type>,<width>)

The style_type parameter specifies the type of visual representation, and the width parameter defines the thickness of the lines or size of the points.

Available Styling Options

  • LINE: Draws a plain continuous line. This is the default style.
  • DOTTEDLINE: Draws a basic dotted line.
  • DOTTEDLINE1 to DOTTEDLINE4: Draws dotted lines with varying styles.
  • HISTOGRAM: Creates a histogram (a series of vertical bars).
  • POINT: Displays data as a series of points.

Example Usage

This example demonstrates how to use the STYLE keyword to style different aspects of an indicator that calculates the difference between two linear regression lines and its exponential average:

i1 = linearregression[20](close)
i2 = linearregression[10](close)
diff = i2 - i1
avgdiff = exponentialaverage[7](diff)

RETURN diff COLOURED(50,146,175,90) STYLE(HISTOGRAM,2) AS "LR difference",
       avgdiff COLOURED(227,247,40) STYLE(LINE,3) AS "Avg of difference",
       avgdiff[1] COLOURED(227,247,40) STYLE(DOTTEDLINE,1) AS "Delayed Avg of difference"

In this example, diff is styled as a histogram with a specific color and width, avgdiff as a line, and avgdiff[1] (which represents a delayed value of avgdiff) as a dotted line.

Additional Information

Using the STYLE keyword effectively allows for better visualization of data, making it easier to interpret the behavior of different indicators on a chart. Each style type can be used to highlight different aspects of data, depending on the analysis requirements.

Logo Logo
Loading...