---
id: "M:cAlgo.API.ChartArea.DrawEllipse(System.String,System.DateTime,System.Double,System.DateTime,System.Double,cAlgo.API.Color)"
kind: "method"
type: "T:cAlgo.API.ChartArea"
url: "https://help.ctrader.com/ctrader-algo/references/Chart/ChartArea/DrawEllipse/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# ChartArea.DrawEllipse

Member of [ChartArea](https://help.ctrader.com/ctrader-algo/references/Chart/ChartArea/index.md).

## DrawEllipse(string name, DateTime time1, double y1, DateTime time2, double y2, Color color)

Draws an ellipse.

Environments: Desktop supported · CLI works differently · Cloud works differently.

- CLI: The object is created and returned, but never drawn: the CLI displays no chart.
- Cloud: The object is created and returned, but never drawn: the cloud displays no chart.

C#:

```csharp
ChartEllipse DrawEllipse(string name, DateTime time1, double y1, DateTime time2, double y2, Color color)
```

Python:

```python
chartArea.DrawEllipse(name: str, time1: DateTime, y1: float, time2: DateTime, y2: float, color: Color) -> ChartEllipse
```

### Parameters

- `name` (`string`, Python `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`, Python `DateTime`): The time value of the ellipse point 1 location on the X-axis.
- `y1` (`double`, Python `float`): The Y-axis value of the ellipse point 1 location.
- `time2` (`DateTime`, Python `DateTime`): The time value of the ellipse point 2 location on the X-axis.
- `y2` (`double`, Python `float`): The Y-axis value of the ellipse point 2 location.
- `color` (`Color`, Python `Color`): The ellipse line color.

### Returns

`ChartEllipse` — ChartEllipse.

### Examples

C#:

```csharp
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);
```

Python:

```python
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.

Environments: Desktop supported · CLI works differently · Cloud works differently.

- CLI: The object is created and returned, but never drawn: the CLI displays no chart.
- Cloud: The object is created and returned, but never drawn: the cloud displays no chart.

C#:

```csharp
ChartEllipse DrawEllipse(string name, DateTime time1, double y1, DateTime time2, double y2, Color color, int thickness)
```

Python:

```python
chartArea.DrawEllipse(name: str, time1: DateTime, y1: float, time2: DateTime, y2: float, color: Color, thickness: int) -> ChartEllipse
```

### Parameters

- `name` (`string`, Python `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`, Python `DateTime`): The time value of the ellipse point 1 location on the X-axis.
- `y1` (`double`, Python `float`): The Y-axis value of the ellipse point 1 location.
- `time2` (`DateTime`, Python `DateTime`): The time value of the ellipse point 2 location on the X-axis.
- `y2` (`double`, Python `float`): The Y-axis value of the ellipse point 2 location.
- `color` (`Color`, Python `Color`): The ellipse line color.
- `thickness` (`int`, Python `int`): The ellipse line thickness.

### Returns

`ChartEllipse` — ChartEllipse.

### Examples

C#:

```csharp
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);
```

Python:

```python
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.

Environments: Desktop supported · CLI works differently · Cloud works differently.

- CLI: The object is created and returned, but never drawn: the CLI displays no chart.
- Cloud: The object is created and returned, but never drawn: the cloud displays no chart.

C#:

```csharp
ChartEllipse DrawEllipse(string name, DateTime time1, double y1, DateTime time2, double y2, Color color, int thickness, LineStyle lineStyle)
```

Python:

```python
chartArea.DrawEllipse(name: str, time1: DateTime, y1: float, time2: DateTime, y2: float, color: Color, thickness: int, lineStyle: LineStyle) -> ChartEllipse
```

### Parameters

- `name` (`string`, Python `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`, Python `DateTime`): The time value of the ellipse point 1 location on the X-axis.
- `y1` (`double`, Python `float`): The Y-axis value of the ellipse point 1 location.
- `time2` (`DateTime`, Python `DateTime`): The time value of the ellipse point 2 location on the X-axis.
- `y2` (`double`, Python `float`): The Y-axis value of the ellipse point 2 location.
- `color` (`Color`, Python `Color`): The ellipse line color.
- `thickness` (`int`, Python `int`): The ellipse line thickness.
- `lineStyle` (`LineStyle`, Python `LineStyle`): The ellipse line style.

### Returns

`ChartEllipse` — ChartEllipse.

### Examples

C#:

```csharp
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);
```

Python:

```python
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.

Environments: Desktop supported · CLI works differently · Cloud works differently.

- CLI: The object is created and returned, but never drawn: the CLI displays no chart.
- Cloud: The object is created and returned, but never drawn: the cloud displays no chart.

C#:

```csharp
ChartEllipse DrawEllipse(string name, int barIndex1, double y1, int barIndex2, double y2, Color color)
```

Python:

```python
chartArea.DrawEllipse(name: str, barIndex1: int, y1: float, barIndex2: int, y2: float, color: Color) -> ChartEllipse
```

### Parameters

- `name` (`string`, Python `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`, Python `int`): The bar index of the ellipse point 1 location on the X-axis.
- `y1` (`double`, Python `float`): The Y-axis value of the ellipse point 1 location.
- `barIndex2` (`int`, Python `int`): The bar index of the ellipse point 2 location on the X-axis.
- `y2` (`double`, Python `float`): The Y-axis value of the ellipse point 2 location.
- `color` (`Color`, Python `Color`): The ellipse line color.

### Returns

`ChartEllipse` — ChartEllipse.

### Examples

C#:

```csharp
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);
```

Python:

```python
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.

Environments: Desktop supported · CLI works differently · Cloud works differently.

- CLI: The object is created and returned, but never drawn: the CLI displays no chart.
- Cloud: The object is created and returned, but never drawn: the cloud displays no chart.

C#:

```csharp
ChartEllipse DrawEllipse(string name, int barIndex1, double y1, int barIndex2, double y2, Color color, int thickness)
```

Python:

```python
chartArea.DrawEllipse(name: str, barIndex1: int, y1: float, barIndex2: int, y2: float, color: Color, thickness: int) -> ChartEllipse
```

### Parameters

- `name` (`string`, Python `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`, Python `int`): The bar index of the ellipse point 1 location on the X-axis.
- `y1` (`double`, Python `float`): The Y-axis value of the ellipse point 1 location.
- `barIndex2` (`int`, Python `int`): The bar index of the ellipse point 2 location on the X-axis.
- `y2` (`double`, Python `float`): The Y-axis value of the ellipse point 2 location.
- `color` (`Color`, Python `Color`): The ellipse line color.
- `thickness` (`int`, Python `int`): The ellipse line thickness.

### Returns

`ChartEllipse` — ChartEllipse.

### Examples

C#:

```csharp
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);
```

Python:

```python
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.

Environments: Desktop supported · CLI works differently · Cloud works differently.

- CLI: The object is created and returned, but never drawn: the CLI displays no chart.
- Cloud: The object is created and returned, but never drawn: the cloud displays no chart.

C#:

```csharp
ChartEllipse DrawEllipse(string name, int barIndex1, double y1, int barIndex2, double y2, Color color, int thickness, LineStyle lineStyle)
```

Python:

```python
chartArea.DrawEllipse(name: str, barIndex1: int, y1: float, barIndex2: int, y2: float, color: Color, thickness: int, lineStyle: LineStyle) -> ChartEllipse
```

### Parameters

- `name` (`string`, Python `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`, Python `int`): The bar index of the ellipse point 1 location on the X-axis.
- `y1` (`double`, Python `float`): The Y-axis value of the ellipse point 1 location.
- `barIndex2` (`int`, Python `int`): The bar index of the ellipse point 2 location on the X-axis.
- `y2` (`double`, Python `float`): The Y-axis value of the ellipse point 2 location.
- `color` (`Color`, Python `Color`): The ellipse line color.
- `thickness` (`int`, Python `int`): The ellipse line thickness.
- `lineStyle` (`LineStyle`, Python `LineStyle`): The ellipse line style.

### Returns

`ChartEllipse` — ChartEllipse.

### Examples

C#:

```csharp
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);
```

Python:

```python
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}")
```

