---
id: "T:cAlgo.API.ChartEllipse"
kind: "interface"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/Shapes/ChartEllipse/"
---

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

# ChartEllipse (interface)

Represent the Ellipse chart object.

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

- CLI: Created and kept with all its properties, but never drawn: the CLI displays no chart.
- Cloud: Created and kept with all its properties, but never drawn: the cloud displays no chart.

## Definition

```csharp
public interface ChartEllipse
```

## Examples

C#:

```csharp
using cAlgo.API;

namespace cAlgo
{
    // This sample indicator draw an ellipse on chart
    public partial class ChartEllipseSample : Indicator
    {
        protected override void Initialize()
        {
            Draw();
        }

        public override void Calculate(int index)
        {
            Draw();
        }

        private void Draw()
        {
            var y1 = Bars.HighPrices[Chart.FirstVisibleBarIndex] > Bars.HighPrices[Chart.LastVisibleBarIndex] ? Bars.HighPrices[Chart.FirstVisibleBarIndex] : Bars.HighPrices[Chart.LastVisibleBarIndex];

            var y2 = Bars.LowPrices[Chart.FirstVisibleBarIndex] < Bars.LowPrices[Chart.LastVisibleBarIndex] ? Bars.LowPrices[Chart.FirstVisibleBarIndex] : Bars.LowPrices[Chart.LastVisibleBarIndex];

            var ellipse = Chart.DrawEllipse("ellipse", Chart.FirstVisibleBarIndex, y1, Chart.LastVisibleBarIndex, y2, Color.FromArgb(50, Color.Red.R, Color.Red.G, Color.Red.B));

            ellipse.IsFilled = true;
        }
    }
}
```

Python:

```python
import clr
clr.AddReference("cAlgo.API")

from cAlgo.API import *

class Test():
    def initialize(self):
        self.draw()

    def calculate(self, index):
        self.draw()

    def draw(self):
        y1 = api.Bars.HighPrices[api.Chart.FirstVisibleBarIndex] if api.Bars.HighPrices[api.Chart.FirstVisibleBarIndex] > api.Bars.HighPrices[api.Chart.LastVisibleBarIndex] else api.Bars.HighPrices[api.Chart.LastVisibleBarIndex]
        y2 = api.Bars.LowPrices[api.Chart.FirstVisibleBarIndex] if api.Bars.LowPrices[api.Chart.FirstVisibleBarIndex] < api.Bars.LowPrices[api.Chart.LastVisibleBarIndex] else api.Bars.LowPrices[api.Chart.LastVisibleBarIndex]
        ellipse = api.Chart.DrawEllipse("ellipse", api.Chart.FirstVisibleBarIndex, y1, api.Chart.LastVisibleBarIndex, y2, Color.FromArgb(50, Color.Red.R, Color.Red.G, Color.Red.B))
        ellipse.IsFilled = True
```

config.json:

```json
{
  "AccessRights": "None",
  "TimeZone": "UTC",
  "IsOverlay": true
}
```

## Properties

- `DateTime Time1 {get; set;}` — Gets or sets the value 1 on the Time line. [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/Shapes/ChartEllipse/Time1/index.md)
- `DateTime Time2 {get; set;}` — Gets or sets the value 2 on the Time line. [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/Shapes/ChartEllipse/Time2/index.md)
- `double Y1 {get; set;}` — Gets or sets the value 1 on the Y-axis. [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/Shapes/ChartEllipse/Y1/index.md)
- `double Y2 {get; set;}` — Gets or sets the value 2 on the Y-axis. [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/Shapes/ChartEllipse/Y2/index.md)

## Inherited members

- `int Thickness {get; set;}` (from ChartShape) [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/Shapes/ChartShape/Thickness/index.md)
- `LineStyle LineStyle {get; set;}` (from ChartShape) [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/Shapes/ChartShape/LineStyle/index.md)
- `Color Color {get; set;}` (from ChartShape) [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/Shapes/ChartShape/Color/index.md)
- `bool IsFilled {get; set;}` (from ChartShape) [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/Shapes/ChartShape/IsFilled/index.md)
- `string Name {get;}` (from ChartObject) [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/ChartObject/Name/index.md)
- `string Comment {get; set;}` (from ChartObject) [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/ChartObject/Comment/index.md)
- `ChartObjectType ObjectType {get;}` (from ChartObject) [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/ChartObject/ObjectType/index.md)
- `bool IsInteractive {get; set;}` (from ChartObject) [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/ChartObject/IsInteractive/index.md)
- `bool IsLocked {get; set;}` (from ChartObject) [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/ChartObject/IsLocked/index.md)
- `bool IsHidden {get; set;}` (from ChartObject) [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/ChartObject/IsHidden/index.md)
- `int ZIndex {get; set;}` (from ChartObject) [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/ChartObject/ZIndex/index.md)
- `bool IsAlive {get;}` (from ChartObject) [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/ChartObject/IsAlive/index.md)

