ChartArea.DrawEllipse
method · ChartArea · cAlgo.API
DesktopCLICloud
Draws an ellipse.
Environment behaviour
CLI — works differently. The object is created and returned, but never drawn: the CLI displays no chart.
Cloud — works differently. The object is created and returned, but never drawn: the cloud displays no chart.
Overloads
DrawEllipse(string name, DateTime time1, double y1, DateTime time2, double y2, Color color)
Draws an ellipse.
ChartEllipse DrawEllipse(string name, DateTime time1, double y1, DateTime time2, double y2, Color color)
chartArea.DrawEllipse(name: str, time1: DateTime, y1: float, time2: DateTime, y2: float, color: Color) -> ChartEllipse
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
name | string | str | The chart object name - a unique name that can be only used once for a chart area. If duplicated, the chart object will be replaced with a new one of the same name. |
time1 | DateTime | DateTime | The time value of the ellipse point 1 location on the X-axis. |
y1 | double | float | The Y-axis value of the ellipse point 1 location. |
time2 | DateTime | DateTime | The time value of the ellipse point 2 location on the X-axis. |
y2 | double | float | The Y-axis value of the ellipse point 2 location. |
color | Color | Color | The ellipse line color. |
Returns ChartEllipse — ChartEllipse.
Examples
var ellipse = Chart.DrawEllipse("ellipse", Bars.OpenTimes.Last(20), Bars.LowPrices.Last(20), Bars.OpenTimes.LastValue, Bars.HighPrices.LastValue, Color.FromArgb(80, Color.Red));
ellipse.IsFilled = true;
Print("Ellipse drawn from {0} to {1}", ellipse.Time1, ellipse.Time2);
ellipse = api.Chart.DrawEllipse("ellipse", api.Bars.OpenTimes.Last(20), api.Bars.LowPrices.Last(20), api.Bars.OpenTimes.LastValue, api.Bars.HighPrices.LastValue, Color.FromArgb(80, Color.Red))
ellipse.IsFilled = True
api.Print(f"Ellipse drawn from {ellipse.Time1} to {ellipse.Time2}")
DrawEllipse(string name, DateTime time1, double y1, DateTime time2, double y2, Color color, int thickness)
Draws an ellipse.
ChartEllipse DrawEllipse(string name, DateTime time1, double y1, DateTime time2, double y2, Color color, int thickness)
chartArea.DrawEllipse(name: str, time1: DateTime, y1: float, time2: DateTime, y2: float, color: Color, thickness: int) -> ChartEllipse
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
name | string | str | The chart object name - a unique name that can be only used once for a chart area. If duplicated, the chart object will be replaced with a new one of the same name. |
time1 | DateTime | DateTime | The time value of the ellipse point 1 location on the X-axis. |
y1 | double | float | The Y-axis value of the ellipse point 1 location. |
time2 | DateTime | DateTime | The time value of the ellipse point 2 location on the X-axis. |
y2 | double | float | The Y-axis value of the ellipse point 2 location. |
color | Color | Color | The ellipse line color. |
thickness | int | int | The ellipse line thickness. |
Returns ChartEllipse — ChartEllipse.
Examples
var ellipse = Chart.DrawEllipse("ellipse", Bars.OpenTimes.Last(20), Bars.LowPrices.Last(20), Bars.OpenTimes.LastValue, Bars.HighPrices.LastValue, Color.Red, 2);
Print("Ellipse thickness: {0}", ellipse.Thickness);
ellipse = api.Chart.DrawEllipse("ellipse", api.Bars.OpenTimes.Last(20), api.Bars.LowPrices.Last(20), api.Bars.OpenTimes.LastValue, api.Bars.HighPrices.LastValue, Color.Red, 2)
api.Print(f"Ellipse thickness: {ellipse.Thickness}")
DrawEllipse(string name, DateTime time1, double y1, DateTime time2, double y2, Color color, int thickness, LineStyle lineStyle)
Draws an ellipse.
ChartEllipse DrawEllipse(string name, DateTime time1, double y1, DateTime time2, double y2, Color color, int thickness, LineStyle lineStyle)
chartArea.DrawEllipse(name: str, time1: DateTime, y1: float, time2: DateTime, y2: float, color: Color, thickness: int, lineStyle: LineStyle) -> ChartEllipse
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
name | string | str | The chart object name - a unique name that can be only used once for a chart area. If duplicated, the chart object will be replaced with a new one of the same name. |
time1 | DateTime | DateTime | The time value of the ellipse point 1 location on the X-axis. |
y1 | double | float | The Y-axis value of the ellipse point 1 location. |
time2 | DateTime | DateTime | The time value of the ellipse point 2 location on the X-axis. |
y2 | double | float | The Y-axis value of the ellipse point 2 location. |
color | Color | Color | The ellipse line color. |
thickness | int | int | The ellipse line thickness. |
lineStyle | LineStyle | LineStyle | The ellipse line style. |
Returns ChartEllipse — ChartEllipse.
Examples
var ellipse = Chart.DrawEllipse("ellipse", Bars.OpenTimes.Last(20), Bars.LowPrices.Last(20), Bars.OpenTimes.LastValue, Bars.HighPrices.LastValue, Color.Red, 2, LineStyle.Dots);
Print("Ellipse style: {0}", ellipse.LineStyle);
ellipse = api.Chart.DrawEllipse("ellipse", api.Bars.OpenTimes.Last(20), api.Bars.LowPrices.Last(20), api.Bars.OpenTimes.LastValue, api.Bars.HighPrices.LastValue, Color.Red, 2, LineStyle.Dots)
api.Print(f"Ellipse style: {ellipse.LineStyle}")
DrawEllipse(string name, int barIndex1, double y1, int barIndex2, double y2, Color color)
Draws an ellipse.
ChartEllipse DrawEllipse(string name, int barIndex1, double y1, int barIndex2, double y2, Color color)
chartArea.DrawEllipse(name: str, barIndex1: int, y1: float, barIndex2: int, y2: float, color: Color) -> ChartEllipse
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
name | string | str | The chart object name - a unique name that can be only used once for a chart area. If duplicated, the chart object will be replaced with a new one of the same name. |
barIndex1 | int | int | The bar index of the ellipse point 1 location on the X-axis. |
y1 | double | float | The Y-axis value of the ellipse point 1 location. |
barIndex2 | int | int | The bar index of the ellipse point 2 location on the X-axis. |
y2 | double | float | The Y-axis value of the ellipse point 2 location. |
color | Color | Color | The ellipse line color. |
Returns ChartEllipse — ChartEllipse.
Examples
var index = Bars.Count - 1;
var ellipse = Chart.DrawEllipse("ellipse", index - 20, Bars.LowPrices[index - 20], index, Bars.HighPrices[index], Color.FromArgb(80, Color.Red));
ellipse.IsFilled = true;
Print("Ellipse drawn from {0} to {1}", ellipse.Time1, ellipse.Time2);
index = api.Bars.Count - 1
ellipse = api.Chart.DrawEllipse("ellipse", index - 20, api.Bars.LowPrices[index - 20], index, api.Bars.HighPrices[index], Color.FromArgb(80, Color.Red))
ellipse.IsFilled = True
api.Print(f"Ellipse drawn from {ellipse.Time1} to {ellipse.Time2}")
DrawEllipse(string name, int barIndex1, double y1, int barIndex2, double y2, Color color, int thickness)
Draws an ellipse.
ChartEllipse DrawEllipse(string name, int barIndex1, double y1, int barIndex2, double y2, Color color, int thickness)
chartArea.DrawEllipse(name: str, barIndex1: int, y1: float, barIndex2: int, y2: float, color: Color, thickness: int) -> ChartEllipse
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
name | string | str | The chart object name - a unique name that can be only used once for a chart area. If duplicated, the chart object will be replaced with a new one of the same name. |
barIndex1 | int | int | The bar index of the ellipse point 1 location on the X-axis. |
y1 | double | float | The Y-axis value of the ellipse point 1 location. |
barIndex2 | int | int | The bar index of the ellipse point 2 location on the X-axis. |
y2 | double | float | The Y-axis value of the ellipse point 2 location. |
color | Color | Color | The ellipse line color. |
thickness | int | int | The ellipse line thickness. |
Returns ChartEllipse — ChartEllipse.
Examples
var index = Bars.Count - 1;
var ellipse = Chart.DrawEllipse("ellipse", index - 20, Bars.LowPrices[index - 20], index, Bars.HighPrices[index], Color.Red, 2);
Print("Ellipse thickness: {0}", ellipse.Thickness);
index = api.Bars.Count - 1
ellipse = api.Chart.DrawEllipse("ellipse", index - 20, api.Bars.LowPrices[index - 20], index, api.Bars.HighPrices[index], Color.Red, 2)
api.Print(f"Ellipse thickness: {ellipse.Thickness}")
DrawEllipse(string name, int barIndex1, double y1, int barIndex2, double y2, Color color, int thickness, LineStyle lineStyle)
Draws an ellipse.
ChartEllipse DrawEllipse(string name, int barIndex1, double y1, int barIndex2, double y2, Color color, int thickness, LineStyle lineStyle)
chartArea.DrawEllipse(name: str, barIndex1: int, y1: float, barIndex2: int, y2: float, color: Color, thickness: int, lineStyle: LineStyle) -> ChartEllipse
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
name | string | str | The chart object name - a unique name that can be only used once for a chart area. If duplicated, the chart object will be replaced with a new one of the same name. |
barIndex1 | int | int | The bar index of the ellipse point 1 location on the X-axis. |
y1 | double | float | The Y-axis value of the ellipse point 1 location. |
barIndex2 | int | int | The bar index of the ellipse point 2 location on the X-axis. |
y2 | double | float | The Y-axis value of the ellipse point 2 location. |
color | Color | Color | The ellipse line color. |
thickness | int | int | The ellipse line thickness. |
lineStyle | LineStyle | LineStyle | The ellipse line style. |
Returns ChartEllipse — ChartEllipse.
Examples
var index = Bars.Count - 1;
var ellipse = Chart.DrawEllipse("ellipse", index - 20, Bars.LowPrices[index - 20], index, Bars.HighPrices[index], Color.Red, 2, LineStyle.Dots);
Print("Ellipse style: {0}", ellipse.LineStyle);
index = api.Bars.Count - 1
ellipse = api.Chart.DrawEllipse("ellipse", index - 20, api.Bars.LowPrices[index - 20], index, api.Bars.HighPrices[index], Color.Red, 2, LineStyle.Dots)
api.Print(f"Ellipse style: {ellipse.LineStyle}")