Triangle Class

A triangle is a chart pattern used in technical analysis. Like trendlines, triangles may be drawn on charts by using a drawing tool or by using EasyLanguage code.

The Triangle class draws a triangle by connecting the specified vertices with lines. The triangle's appearance can customized using the Triangle's properties (see below).

The Triangle's vertices can be DTPoints, BNPoints, or XYPoints. Triangle vertices specified as BNPoints or DTPoints will maintain their positions relative to the bars on the chart. Triangle vertices specified as XYPoints, on the other hand, will maintain their position relative to the chart's borders. Example code is provided below that illustrates all three ways of specifying a Triangle's vertices .

Namespace: elsystem.drawingobjects

Properties

   Additional properties, methods, and events are described in the classes listed under Inheritance Hierarchy (see below).

  Name Type Description
Public property Alert object Gets the PriceAlert associated with the Triangle.
Public property FillColor object Gets or sets the fill color. See Color.
Public property FillPattern enum Gets or sets the fill pattern. See FillPattern.
Public property FirstVertex object Gets the Triangle's first vertex as a DOPoint.
Public property Label object Gets or sets the Triangle's label as a DrawingObjectLabel.
Public property SecondVertex object Gets the Triangle's second vertex as a DOPoint.
Public property Style enum Gets or sets the Triangle's border style. See StyleType.
Public property ThirdVertex object Gets the Triangle's third vertex as a DOPoint.
Public property V1V2ExtLeft bool Gets or sets a Boolean property that indicates whether the line segment that connects the first vertex to the second vertex is extended to the left.
Public property V1V2ExtRight bool Gets or sets a Boolean property that indicates whether the line segment that connects the first vertex to the second vertex is extended to the right.
Public property V1V3ExtLeft bool Gets or sets a Boolean property that indicates whether the line segment that connects the first vertex to the third vertex is extended to the left.
Public property V1V3ExtRight bool Gets or sets a Boolean property that indicates whether the line segment that connects the first vertex to the third vertex is extended to the right.
Public property V2V3ExtLeft bool Gets or sets a Boolean property that indicates whether the line segment that connects the second vertex to the third vertex is extended to the left.
Public property V2V3ExtRight bool Gets or sets a Boolean property that indicates whether the line segment that connects the second vertex to the third vertex is extended to the right.
Public property Weight enum Gets or sets the Triangle's border weight. See Weight.
Methods
  Name Description
Public property Create() Initializes a new instance of the Triangle class.
Public property Create(DTPoint, DTPoint, DTPoint) Initializes a new instance of the Triangle class. The vertices are specified as DTPoints.
Public property Create(BNPoint, BNPoint, BNPoint) Initializes a new instance of the Triangle class. The vertices are specified as BNPoints.
Public property Create(XYPoint, XYPoint, XYPoint) Initializes a new instance of the Triangle class. The vertices are specified as XYPoints.
Public property SetFirstVertex(DTPoint) Sets the Triangle's first vertex as a DTPoint.
Public property SetFirstVertex(BNPoint) Sets the Triangle's first vertex as a BNPoint.
Public property SetFirstVertex(XYPoint) Sets the Triangle's first vertex as an XYPoint.
Public property SetSecondVertex(DTPoint) Sets the Triangle's second vertex as a DTPoint.
Public property SetSecondVertex(BNPoint) Sets the Triangle's second vertex as a BNPoint.
Public property SetSecondVertex(XYPoint) Sets the Triangle's second vertex as an XYPoint.
Public property SetThirdVertex(DTPoint) Sets the Triangle's third vertex as a DTPoint.
Public property SetThirdVertex(BNPoint) Sets the Triangle's third vertex as a BNPoint.
Public property SetThirdVertex(XYPoint) Sets the Triangle's third vertex as an XYPoint.
Example

The following example shows...  

Import Example

Displays triangles on a chart.

  1. Click on the Import Example link to import the example into TradeStation.   
  2. Go to the TradeStation platform and create a chart window.  Use the Insert - Indicator menu sequence and Add !Ex_Triangle to the window.
  3. To review or modify the example code, go to the TradeStation Development Environment and open indicator !Ex_Triangle in the EasyLanguage Editor.