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

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

# ChartFibonacciRetracement (interface)

Represents the Fibonacci Retracement 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 ChartFibonacciRetracement
```

## Examples

C#:

```csharp
using cAlgo.API;

namespace cAlgo
{
    // This indicator shows how to use the Chart.DrawFibonacciRetracement method to draw a Fibonacci Retracement
    public partial class FibonacciRetracementSample : Indicator
    {
        protected override void Initialize()
        {
            var period = Chart.LastVisibleBarIndex - Chart.FirstVisibleBarIndex;

            var max = Bars.HighPrices.Maximum(period);
            var min = Bars.LowPrices.Minimum(period);

            Chart.DrawFibonacciRetracement("FibonacciRetracement", Chart.FirstVisibleBarIndex, max, Chart.LastVisibleBarIndex, min, Color.Red);
        }

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

Python:

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

from cAlgo.API import *

class Test():
    def initialize(self):
        period = api.Chart.LastVisibleBarIndex - api.Chart.FirstVisibleBarIndex
        maxValue = Functions.Maximum(api.Bars.HighPrices, period)
        minValue = Functions.Minimum(api.Bars.LowPrices, period)
        api.Chart.DrawFibonacciRetracement("FibonacciRetracement", api.Chart.FirstVisibleBarIndex, maxValue, api.Chart.LastVisibleBarIndex, minValue, Color.Red)
```

config.json:

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

## Methods

- `double CalculateY(int barIndex)` — Calculates Y-axis value corresponding the specified bar index. [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/Fibonacci/ChartFibonacciRetracement/CalculateY/index.md)
- `double CalculateY(DateTime time)` — Calculates Y-axis value corresponding the specified time value. [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/Fibonacci/ChartFibonacciRetracement/CalculateY/index.md)

## 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/Fibonacci/ChartFibonacciRetracement/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/Fibonacci/ChartFibonacciRetracement/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/Fibonacci/ChartFibonacciRetracement/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/Fibonacci/ChartFibonacciRetracement/Y2/index.md)

## Inherited members

- `IReadonlyList<FibonacciLevel> FibonacciLevels {get;}` (from ChartFibonacciBase) [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/Fibonacci/ChartFibonacciBase/FibonacciLevels/index.md)
- `bool DisplayPrices {get; set;}` (from ChartFibonacciBase) [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/Fibonacci/ChartFibonacciBase/DisplayPrices/index.md)
- `int Thickness {get; set;}` (from ChartFibonacciBase) [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/Fibonacci/ChartFibonacciBase/Thickness/index.md)
- `Color Color {get; set;}` (from ChartFibonacciBase) [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/Fibonacci/ChartFibonacciBase/Color/index.md)
- `LineStyle LineStyle {get; set;}` (from ChartFibonacciBase) [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/Fibonacci/ChartFibonacciBase/LineStyle/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)

