addLineTool() |
Top Previous Next |
addLineTool()
The addLineTool function allows you to add various eSignal line tool objects into your chart. The supported line tool types are:
Line Tool Variations
addLineTool(LineTool.MOB, x, y, name); addLineTool(LineTool.ELLIPSE, x1, x2, name); addLineTool(LineTool.HORZ, y, nThickness, Color, name); addLineTool(LineTool.VERT, x, nThickness, Color, name); addLineTool(LineTool.REGRESSION, x1, x2, nThickness, Color, name); addLineTool(LineTool.ARROW, x1, y1, x2, y2, nThickness, Color, name); addLineTool(LineTool.SEGMENT, x1, y1, x2, y2, nThickness, Color, name); addLineTool(LineTool.RAY, x1, y1, x2, y2, nThickness, Color, name); addLineTool(LineTool.EXTENDED, x1, y1, x2, y2, nThickness, Color, name); addLineTool(LineTool.CIRCLE, x1, y1, x2, y2, nThickness, Color, name);
Usage
function preMain() {
setPriceStudy(true); setStudyTitle("linetool");
}
function main() { var c;
if( getCurrentBarIndex() == 0 ) {
c = close(0);
addLineTool( LineTool.HORZ, c, 2, Color.blue, "horz1" ); addLineTool( LineTool.VERT, -34, 2, Color.blue, "vert1" ); addLineTool( LineTool.ARROW, -104, c-5, -69, c-4, 2, Color.blue, "arrow1" ); addLineTool( LineTool.SEGMENT, -104, c-4, -69, c-3, 2, Color.blue, "segment1" ); addLineTool( LineTool.RAY, -104, c-3, -69, c-2, 2, Color.blue, "ray" ); addLineTool( LineTool.EXTENDED, -104, c-2, -69, c-1, 2, Color.blue, "extended" ); addLineTool( LineTool.REGRESSION, -104, -69, 1, Color.blue, "reg1" ); addLineTool( LineTool.CIRCLE, -50, c, -34, c, 1, Color.blue, "circle1" );
}
}
|