EasyLanguage Object Reference
Ellipse Class
Draws an ellipse of a specified size on a chart at a specified location. Appearance may altered using appropriate properties. An ellipse is a non-analytical drawing tool used to highlight specific portions of a chart.
Note that the points that define an ellipse are relative to left-side and right-side corners of an imaginary rectangle that bounds the ellipse.
The following code snippet shows how to add an ellipse to a chart at specific X-Y coordinates using XYPoint. Alternatively, the dimensions could be given using BNPoint or DTPoint.
myEllipse = Ellipse.create(XYPoint.Create(150,50),XYPoint.Create(250,100));
DrawingObjects.Add(myEllipse);
Alternatively, you can use BNPoint to draw an ellispse between specified bar numbers or DTPoint to draw between date-time positions, so that the ellipse will scroll with the bars:
If (Currentbar = 70) then
Begin
{draw an ellipse from the current bar to the 40th bar back}
MyBNEllipse = Ellipse.Create(BNPoint.Create(CurrentBar + MaxBarsBack, Highest(High, 40)), BNPoint.Create(CurrentBar - 40 + MaxBarsBack, Lowest(Low, 40)));
DrawingObjects.Add(MyBNEllipse);
End;
If (LastBarOnChart = True) then
Begin
{draw an ellipse from the last bar on the chart to the 50th bar ago}
MyDTEllipse = Ellipse.Create(DTPoint.Create(BarDateTime[0], Highest(High, 50)), DTPoint.Create(BarDateTime[49], Lowest(Low, 50)));
DrawingObjects.Add(MyDTEllipse);
End;
Properties allow custom formatting (width, style, color, etc.). In this example, the Color property (which describes line color of the rectangle, not the fill color) is inherited from DrawingObject .
myEllipse.Color = elsystem.drawing.Color.Cyan;
myEllipse.FillPattern = FillPattern.pattern1;
To use this in an analysis technique, be sure that it is setup as described in About Drawing Objects.
Namespace: elsystem.drawingobjects
|
Name |
Description |
|
Create(DTPoint, DTPoint) |
Initializes a new instance of the Ellipse class. The first parameter is a DTPoint object representing the starting point of a hidden rectangle that contains the ellipse; the second parameter is a DTPoint object representing the end point. |
|
Create(DTPoint, DTPoint, int) |
Initializes a new instance of the Ellipse class. The first parameter is a DTPoint object representing the starting point of a hidden rectangle that contains the ellipse; the second parameter is a DTPoint object representing the end point, and the third parameter is an integer representing the data number (data1 - 50). |
|
Create(BNPoint, BNPoint) |
Initializes a new instance of the Ellipse class. The first parameter is a BNPoint object representing the starting point of a hidden rectangle that contains the ellipse; the second parameter is a BNPoint object representing the end point. |
|
Create(BNPoint, BNPoint, int) |
Initializes a new instance of the Ellipse class. The first parameter is a BNPoint object representing the starting point of a hidden rectangle that contains the ellipse; the second parameter is a BNPoint object representing the end point, and the third parameter is an integer representing the data number (data1 - 50). |
|
Create(XYPoint, XYPoint) |
Initializes a new instance of the Ellipse class. The first parameter is a XYPoint object representing the starting point of a rectangle that contains the ellipse; the second parameter is a XYPoint object representing the end point. |
|
Create(XYPoint, XYPoint, int) |
Initializes a new instance of the Ellipse class. The first parameter is a XYPoint object representing the starting point of a hidden rectangle that contains the ellipse; the second parameter is a XYPoint object representing the end point, and the third parameter is an integer representing the data number (data1 - 50). |
|
SetEndPoint(DTPoint) |
Sets the Ellipse end point using a DTPoint object. |
|
SetEndPoint(BNPoint) |
Sets the Ellipse end point using a BNPoint object. |
|
SetEndPoint(XYPoint) |
Sets the Ellipse end point using a XYPoint object. |
|
SetStartPoint(DTPoint) |
Sets the Ellipse start point using a DTPoint object. |
|
SetStartPoint(BNPoint) |
Sets the Ellipse start point using a BNPoint object. |
|
SetStartPoint(XYPoint) |
Sets the Ellipse start point using a XYPoint object. |