drawLineAbsolute()

ICE Data Services -

drawLineAbsolute()

 

drawLineAbsolute(x1, y1, x2, y2, Style, Thickness, Color, TagName)

 

This function is used to draw lines on the chart. Unlike the drawLineRelative() function, the lines drawn with this function will remain at the x-axis offsets that you specify. As new bars come in, the lines will remain in position as the bars shift to the left. The TagName parameter must be unique for each line object that is drawn on the chart. If, for example, you call the drawLine() functions repeatedly in your script but you always use a TagName of "1", then only one line object will appear on your chart (the last one drawn).

 

  • x1:  Starting x coordinate (bar offset)
  • y1:  Starting y coordinate (price value)
  • x2:  Ending x coordinate (bar offset)
  • y2:  Ending y coordinate (price value)
  • Style: Valid line style.
  • Thickness: Thickness in pixels.
  • Color: Valid color value.
  • TagName: A unique identifier for this text object.

 

Example:

 

//This will draw vertical lines through the most recent 10 bars from the $55 level to the $95 level

//When new bars come in, these lines remain in position (e.g., will remain in place over the

//most recent 10 bars)

 

for (x=0; x<10; x++) {

 drawLineAbsolute( -x, 55.0, -x, 95.0, PS_SOLID, 1, Color.blue, x);

}

 

Colors

Pen Styles

drawLineRelative()

clearLines()

removeLine()