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

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

# GannLevel (interface)

Represents a Gann Level.

Environments: Desktop supported · CLI supported · Cloud supported.

## Definition

```csharp
public interface GannLevel
```

Available since cAlgo.API 5.6.

## Examples

C#:

```csharp
using cAlgo.API;

namespace cAlgo
{
    // This sample shows how to use a chart Gann Fan levels property to modify the gann levels
    public partial class GannLevelSample : Indicator
    {
        protected override void Initialize()
        {
            var gannFan = Chart.DrawGannFan("GannFan", Chart.FirstVisibleBarIndex, Bars.ClosePrices[Chart.FirstVisibleBarIndex], Chart.LastVisibleBarIndex, Bars.ClosePrices[Chart.LastVisibleBarIndex], Color.Blue);

            foreach (var level in gannFan.GannLevels)
            {
                Print(level.Ratio);

                if (level.Ratio > 4) level.IsVisible = false;
            }
        }

        public override void Calculate(int index)
        {
        }
    }
}
```

Python:

```python
gannFan = api.Chart.DrawGannFan("GannFan", api.Chart.FirstVisibleBarIndex, api.Bars.ClosePrices[api.Chart.FirstVisibleBarIndex], api.Chart.LastVisibleBarIndex, api.Bars.ClosePrices[api.Chart.LastVisibleBarIndex], Color.Blue)
for level in gannFan.GannLevels:
    api.Print(level.Ratio)
    if level.Ratio > 4:
        level.IsVisible = False
```

config.json:

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

## Properties

- `bool IsVisible {get; set;}` — Defines if the level is visible. [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/Gann/GannLevel/IsVisible/index.md)
- `double Ratio {get; set;}` — Gets or sets the level ratio (e.g., 1.0 for 1x1, 2.0 for 2x1, 0.5 for 1x2). [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/Gann/GannLevel/Ratio/index.md)

