Class to create and maintain Drawing Tools.

Hierarchy

  • DrawingTools

Constructors

Methods

  • Adds an Arrow to the chart.

    Returns

    The drawing tool object.

    Parameters

    • positionX: number

      Arrow X-position.

    • positionY: number

      Arrow Y-position.

    Returns Arrow

  • Adds Cross Line to the chart. Draws horizontal and vertical lines crossing at the selected point of the chart.

    Returns

    The drawing tool object.

    Parameters

    • xPosition: number

      X-value for the cross point.

    • yPosition: number

      Y-value for the cross point.

    Returns CrossLine

  • Adds Cycle Lines tool to the chart. Draws vertical lines corresponding to elapsed time periods between the two control points. Can be used to set up and detect intervals and cycles.

    Returns

    The drawing tool object.

    Parameters

    • startX: number

      Start point X-position.

    • startY: number

      Start point Y-position.

    • endX: number = NaN

      End point X-position.

    • endY: number = NaN

      End point Y-position.

    Returns CycleLines

  • Adds a Date Range measurement tool to the chart, which measures the date range, bar count, and total volume between two points on the chart.

    Returns

    The drawing tool object.

    Parameters

    • startX: number

      Start point X-position.

    • startY: number

      Start point Y-position.

    • endX: number = NaN

      End point X-position.

    • endY: number = NaN

      End point Y-position.

    Returns DateRange

  • Adds Elliot Wave tool to the chart. Draws a wave pattern between several control points.

    Returns

    The drawing tool object.

    Parameters

    • waveType: ElliotWaveType
    • startX: number

      Start point X-position.

    • startY: number

      Start point Y-position.

    • secondX: number = NaN

      Second point X-position.

    • secondY: number = NaN

      Second point Y-position.

    • thirdX: number = NaN

      Third point X-position.

    • thirdY: number = NaN

      Third point Y-position.

    • fourthX: number = NaN

      Fourth point X-position.

    • fourthY: number = NaN

      Fourth point Y-position.

    • fifthX: number = NaN

      Fifth point X-position.

    • fifthY: number = NaN

      Fifth point Y-position.

    • sixthX: number = NaN

      Sixth point X-position.

    • sixthY: number = NaN

      Sixth point Y-position.

    • seventhX: number = NaN

      Seventh point X-position.

    • seventhY: number = NaN

      Seventh point Y-position.

    • eighthX: number = NaN

      Eighth point X-position.

    • eighthY: number = NaN

      Eighth point Y-position.

    • ninthX: number = NaN

      Ninth point X-position.

    • ninthY: number = NaN

      Ninth point Y-position.

    Returns ElliotWave

  • Adds an Ellipse to the chart.

    Returns

    The drawing tool object.

    Parameters

    • startX: number

      Start point X-position. If radius parameters are not supplied, this is where the drawing starts. Otherwise, this is the center X-value of the ellipse.

    • startY: number

      Start point Y-position. If radius parameters are not supplied, this is where the drawing starts. Otherwise, this is the center Y-value of the ellipse.

    • radiusX: number = NaN

      Radius of the ellipse in X-direction. When both radius parameters are provided, skips the drawing phase.

    • radiusY: number = NaN

      Radius of the ellipse in Y-direction. When both radius parameters are provided, skips the drawing phase.

    Returns Ellipse

  • Adds Extended Line tool to the chart. Draws a straight line between two control points, then extends the line to the left and right edges of the chart.

    Returns

    The drawing tool object.

    Parameters

    • startX: number

      Start point X-position.

    • startY: number

      Start point Y-position.

    • endX: number = NaN

      End point X-position.

    • endY: number = NaN

      End point Y-position.

    Returns ExtendedLine

  • Adds Fibonacci Arc tool to the chart. Draws a trend line between two control points, followed by multiple arcs intersecting the line at levels 38.2%, 50.0%, 61.8% and 100%. The arcs are centered on the second control point.

    Returns

    The drawing tool object.

    Parameters

    • startX: number

      Start point X-position.

    • startY: number

      Start point Y-position.

    • endX: number = NaN

      End point X-position.

    • endY: number = NaN

      End point Y-position.

    Returns FibonacciArc

  • Adds Fibonacci Extension tool to the chart. Fibonacci Extensions are based on three chosen points on chart: the first two points determine the price move while the third point is the end of retracement against that move. Extension lines using Fibonacci ratios are then drawn based on the price moves.

    Returns

    The drawing tool object.

    Parameters

    • firstX: number

      First point X-position.

    • firstY: number

      First point Y-position.

    • secondX: number = NaN

      Second point X-position.

    • secondY: number = NaN

      Second point Y-position.

    • thirdX: number = NaN

      Third point X-position.

    • thirdY: number = NaN

      Third point X-position.

    Returns FibonacciExtension

  • Adds Fibonacci Fan tool to the chart. Draws a trend line between two control points, then several Fibonacci fan lines starting from the first point and crossing an “invisible” vertical line at the X-value of the second point based on Fibonacci levels at 38.2%, 50.0% and 61.8%.

    Returns

    The drawing tool object.

    Parameters

    • startX: number

      Start point X-position.

    • startY: number

      Start point Y-position.

    • endX: number = NaN

      End point X-position.

    • endY: number = NaN

      End point Y-position.

    Returns FibonacciFan

  • Adds Fibonacci Retracements tool to the chart. Draws a trend line between two control points, then several horizontal retracement lines based on elected price range(height) of the trendline. The retracement lines are drawn at Fibonacci levels of 38.2%, 50.0% and 61.8%.

    Returns

    The drawing tool object.

    Parameters

    • startX: number

      Start point X-position.

    • startY: number

      Start point Y-position.

    • endX: number = NaN

      End point X-position.

    • endY: number = NaN

      End point Y-position.

    Returns FibonacciRetracements

  • Adds Fibonacci Time Zones tool to the chart. Draws vertical lines corresponding to elapsed time periods based on Fibonacci number sequence. Can be used to spot potential price reversal points.

    Returns

    The drawing tool object.

    Parameters

    • startX: number

      Start point X-position.

    • startY: number

      Start point Y-position.

    • endX: number = NaN

      End point X-position.

    • endY: number = NaN

      End point Y-position.

    Returns FibonacciTimeZones

  • Adds Flat Top/Bottom tool to the chart. Draws a line between two points and another horizontal line above or below it. The area between the lines is then colored.

    Returns

    The drawing tool object.

    Parameters

    • startX: number

      Start point X-position.

    • startY: number

      Start point Y-position.

    • endX: number = NaN

      End point X-position.

    • endY: number = NaN

      End point Y-position.

    • flatYValue: number = NaN

      The price value of the flat horizontal line.

    Returns FlatTopBottom

  • Adds a Freeform Line to the chart, drawing a line freely on the chart. Pressing pointer down starts drawing while releasing it ends it.

    Returns

    The drawing tool object.

    Returns FreeformLine

  • Adds a Gann Box tool to the chart. Draws a box shape with various angle-based lines inside. Control points are placed on the corners of the box, allowing adjusting its size and shape.

    Returns

    The drawing tool object.

    Parameters

    • startX: number

      Start point X-position.

    • startY: number

      Start point Y-position.

    • endX: number = NaN

      End point X-position.

    • endY: number = NaN

      End point Y-position.

    Returns GannBox

  • Adds Gann Fan tool to the chart. Draws lines with different angles on the chart, dividing time and price into proportional sections. Gann Fan can be used to detect support and resistance levels on the chart.

    Returns

    The drawing tool object.

    Parameters

    • startX: number

      Start point X-position.

    • startY: number

      Start point Y-position.

    • endX: number = NaN

      End point X-position.

    • endY: number = NaN

      End point Y-position.

    Returns GannFan

  • Adds Head and Shoulders pattern to the chart. Appears as a baseline with three peaks.

    Returns

    The drawing tool object.

    Parameters

    • startX: number

      Start point X-position.

    • startY: number

      Start point Y-position.

    • leftShoulderX: number = NaN

      Left Shoulder point X-position.

    • leftShoulderY: number = NaN

      Left Shoulder point Y-position.

    • firstTroughX: number = NaN

      First Trough point X-position.

    • firstTroughY: number = NaN

      First Trough point Y-position.

    • headX: number = NaN

      Head point X-position.

    • headY: number = NaN

      Head point Y-position.

    • secondTroughX: number = NaN

      Second Trough point X-position.

    • secondTroughY: number = NaN

      Second Trough point Y-position.

    • rightShoulderX: number = NaN

      Right Shoulder point X-position.

    • rightShoulderY: number = NaN

      Right Shoulder point Y-position.

    • endX: number = NaN

      End point X-position.

    • endY: number = NaN

      End point Y-position.

    Returns HeadAndShoulders

  • Adds Horizontal Line to the chart. Draws a line across the whole chart.

    Returns

    The drawing tool object.

    Parameters

    • yPosition: number

      Y-position for the line.

    Returns HorizontalLine

  • Adds Horizontal Ray to the chart. Draws a straight line from a selected point to the right edge of the chart.

    Returns

    The drawing tool object.

    Parameters

    • xPosition: number

      Starting point X-value for the ray.

    • yPosition: number

      Y-position for the line.

    Returns HorizontalRay

  • Adds Linear Regression Channel tool to the chart. Calculates and draws a linear regression line between two control points. Then draws two channel lines, one above and one below the regression line based on the selected channel type.

    Returns

    The drawing tool object.

    Parameters

    • startX: number

      Start point X-position.

    • startY: number

      Start point Y-position.

    • endX: number = NaN

      End point X-position.

    • endY: number = NaN

      End point Y-position.

    Returns LinearRegressionChannel

  • Adds Parallel Channel tool to the chart. Draws a line between two points and another parallel line above or below it, thus forming a channel. The middle value of the channel is displayed with a dashed line.

    Returns

    The drawing tool object.

    Parameters

    • startX: number

      Start point X-position.

    • startY: number

      Start point Y-position.

    • endX: number = NaN

      End point X-position.

    • endY: number = NaN

      End point Y-position.

    • channelHeight: number = NaN

      The height of the channel in price values.

    Returns ParallelChannel

  • Adds Pitchfork tool to the chart. Places three control points on the chart and draws a line from the first point through the midpoint of the other points. Can be used to identify support and resistance levels for a stock's price.

    Returns

    The drawing tool object.

    Parameters

    • firstX: number

      First point X-position.

    • firstY: number

      First point Y-position.

    • secondX: number = NaN

      Second point X-position.

    • secondY: number = NaN

      Second point Y-position.

    • thirdX: number = NaN

      Third point X-position.

    • thirdY: number = NaN

      Third point X-position.

    Returns Pitchfork

  • Adds a Price Range measurement tool to the chart, which measures the price change between two points on the chart.

    Returns

    The drawing tool object.

    Parameters

    • startX: number

      Start point X-position.

    • startY: number

      Start point Y-position.

    • endX: number = NaN

      End point X-position.

    • endY: number = NaN

      End point Y-position.

    Returns PriceRange

  • Adds a Rectangle tool to the chart.

    Returns

    The drawing tool object.

    Parameters

    • startX: number

      Start point X-position.

    • startY: number

      Start point Y-position.

    • endX: number = NaN

      End point X-position.

    • endY: number = NaN

      End point Y-position.

    Returns Rectangle

  • Adds Sine Wave oscillating up and down. Two control points are used to mark the wave top and bottom peaks. Sine waves can be used to identify patterns in a market.

    Returns

    The drawing tool object.

    Parameters

    • startX: number

      Start point X-position.

    • startY: number

      Start point Y-position.

    • endX: number = NaN

      End point X-position.

    • endY: number = NaN

      End point Y-position.

    Returns SineWave

  • Adds a text to the chart.

    Returns

    The drawing tool object.

    Parameters

    • positionX: number

      Text X-position.

    • positionY: number

      Text Y-position.

    • text: string = 'Text'

    Returns PlainText

  • Adds a text box to the chart.

    Returns

    The drawing tool object.

    Parameters

    • positionX: number

      Text X-position.

    • positionY: number

      Text Y-position.

    • text: string = 'Text'

    Returns TextBox

  • Adds Trend Line tool to the chart. Draws a straight line between two control points.

    Returns

    The drawing tool object.

    Parameters

    • startX: number

      Start point X-position.

    • startY: number

      Start point Y-position.

    • endX: number = NaN

      End point X-position.

    • endY: number = NaN

      End point Y-position.

    Returns TrendLine

  • Adds a Triangle tool to the chart.

    Returns

    The drawing tool object.

    Parameters

    • firstX: number

      First point X-position.

    • firstY: number

      First point Y-position.

    • secondX: number = NaN

      Second point X-position.

    • secondY: number = NaN

      Second point Y-position.

    • thirdX: number = NaN

      Third point X-position.

    • thirdY: number = NaN

      Third point X-position.

    Returns Triangle

  • Adds Vertical Line to the chart. Draws a line across the whole chart.

    Returns

    The drawing tool object.

    Parameters

    • xPosition: number

      X-position for the line. Given as a number.

    Returns VerticalLine

  • Adds a XABCD pattern tool to the chart.

    Returns

    The drawing tool object.

    Parameters

    • startX: number

      Start X-position (X-point)

    • startY: number

      Start Y-position (X-point)

    • positionAX: number = NaN

      A-point X-position.

    • positionAY: number = NaN

      A-point Y-position.

    • positionBX: number = NaN

      B-point X-position.

    • positionBY: number = NaN

      B-point Y-position.

    • positionCX: number = NaN

      C-point X-position.

    • positionCY: number = NaN

      C-point Y-position.

    • positionDX: number = NaN

      D-point X-position.

    • positionDY: number = NaN

      D-point Y-position.

    Returns XABCDpattern

  • Disposes all current drawing tools.

    Returns void