Class to create and maintain Drawing Tools.

Hierarchy

  • DrawingTools

Constructors

Methods

  • Adds an Arrow to the chart.

    Parameters

    • positionX: number

      Arrow X-position.

    • positionY: number

      Arrow Y-position.

    Returns Arrow

    The drawing tool object.

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

    Parameters

    • xPosition: number

      X-value for the cross point.

    • yPosition: number

      Y-value for the cross point.

    Returns CrossLine

    The drawing tool object.

  • 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.

    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

    The drawing tool object.

  • 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.

    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

    The drawing tool object.

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

    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

    The drawing tool object.

  • Adds an Ellipse to the chart.

    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

    The drawing tool object.

  • 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.

    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

    The drawing tool object.

  • 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.

    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

    The drawing tool object.

  • 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.

    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

    The drawing tool object.

  • 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%.

    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

    The drawing tool object.

  • 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%.

    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

    The drawing tool object.

  • 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.

    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

    The drawing tool object.

  • 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.

    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

    The drawing tool object.

  • 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 FreeformLine

    The drawing tool object.

  • 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.

    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

    The drawing tool object.

  • 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.

    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

    The drawing tool object.

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

    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

    The drawing tool object.

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

    Parameters

    • yPosition: number

      Y-position for the line.

    Returns HorizontalLine

    The drawing tool object.

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

    Parameters

    • xPosition: number

      Starting point X-value for the ray.

    • yPosition: number

      Y-position for the line.

    Returns HorizontalRay

    The drawing tool object.

  • 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.

    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

    The drawing tool object.

  • 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.

    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

    The drawing tool object.

  • 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.

    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

    The drawing tool object.

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

    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

    The drawing tool object.

  • Adds a Rectangle tool to the chart.

    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

    The drawing tool object.

  • 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.

    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

    The drawing tool object.

  • Adds a text to the chart.

    Parameters

    • positionX: number

      Text X-position.

    • positionY: number

      Text Y-position.

    • text: string = 'Text'

    Returns PlainText

    The drawing tool object.

  • Adds a text box to the chart.

    Parameters

    • positionX: number

      Text X-position.

    • positionY: number

      Text Y-position.

    • text: string = 'Text'

    Returns TextBox

    The drawing tool object.

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

    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

    The drawing tool object.

  • Adds a Triangle tool to the chart.

    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

    The drawing tool object.

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

    Parameters

    • xPosition: number

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

    Returns VerticalLine

    The drawing tool object.

  • Adds a XABCD pattern tool to the chart.

    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

    The drawing tool object.

  • Disposes all current drawing tools.

    Returns void