drawLineAbsolute()
Previous Top Next
drawLineAbsolute( x1, y1, x2, y2, style, thickness, color, tagID )
The drawLineAbsolute function allows you to draw line objects at any location on your chart. Any line object created with drawLineAbsolute will remain at its designated relative offset from the most current bar. So, a line object drawn with drawLineAbsolute at a bar index of -10 will always remain 10 bars back from the most current bar.
Parameters
x1 |
the starting bar index for the line |
y1 |
the starting series value for the line |
x2 |
the ending bar index for the line |
y2 |
the ending series value for the line |
style |
see Pen Styles below |
thickness |
integer value assigning line thickness |
color |
color to use when drawing the line |
tagID |
a unique identifier for this line object or null |
Pen Styles
PS_SOLID |
draw a solid line |
PS_DOT |
draw a dotted line |
PS_DASH |
draw a dashed line |
PS_DASHDOT |
draw a dash-dot line |
PS_DASHDOTDOT |
draw a dash-dot-dot line |
Usage
//draw a line from the high 20 bars ago to the high 5 bars ago. draw it as a solid
//line with a thickness of 2 and a color of teal. assign a tagID of 105 so we can
//identify it later if we need to remove it.
drawLineAbsolute( -20, high(-20), -5, high(-5), PS_SOLID, 2, Color.teal, 105 );