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

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

# ChartAndrewsPitchfork (interface)

Represents the Andrew's Pitchfork chart object. A tool that helps to identify possible support and resistance levels with the three parallel lines.

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 ChartAndrewsPitchfork
```

## Examples

C#:

```csharp
using cAlgo.API;

namespace cAlgo
{
    // This indicator shows how to draw an Andrews Pitchfork by using Chart.DrawAndrewsPitchfork method
    public partial class AndrewsPitchforkSample : Indicator
    {
        protected override void Initialize()
        {
            var barIndex1 = Chart.FirstVisibleBarIndex;
            var barIndex2 = Chart.FirstVisibleBarIndex + ((Chart.LastVisibleBarIndex - Chart.FirstVisibleBarIndex) / 5);
            var barIndex3 = Chart.FirstVisibleBarIndex + ((Chart.LastVisibleBarIndex - Chart.FirstVisibleBarIndex) / 2);

            var y1 = Bars.ClosePrices[barIndex1];
            var y2 = Bars.ClosePrices[barIndex2];
            var y3 = Bars.ClosePrices[barIndex3];

            var andrewsPitchfork = Chart.DrawAndrewsPitchfork("AndrewsPitchfork", barIndex1, y1, barIndex2, y2, barIndex3, y3, Color.Red);

            andrewsPitchfork.IsInteractive = true;
        }

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

Python:

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

from cAlgo.API import *

class Test():
    def initialize(self):
        barIndex1 = api.Chart.FirstVisibleBarIndex
        barIndex2 = api.Chart.FirstVisibleBarIndex + ((api.Chart.LastVisibleBarIndex - api.Chart.FirstVisibleBarIndex) // 5)
        barIndex3 = api.Chart.FirstVisibleBarIndex + ((api.Chart.LastVisibleBarIndex - api.Chart.FirstVisibleBarIndex) // 2)
        y1 = api.Bars.ClosePrices[barIndex1]
        y2 = api.Bars.ClosePrices[barIndex2]
        y3 = api.Bars.ClosePrices[barIndex3]
        andrewsPitchfork = api.Chart.DrawAndrewsPitchfork("AndrewsPitchfork", barIndex1, y1, barIndex2, y2, barIndex3, y3, Color.Red)
        andrewsPitchfork.IsInteractive = True
```

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/ChartAndrewsPitchfork/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/ChartAndrewsPitchfork/CalculateY/index.md)

## Properties

- `Color Color {get; set;}` — Gets or sets the chart object lines color. [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/ChartAndrewsPitchfork/Color/index.md)
- `LineStyle LineStyle {get; set;}` — Gets or sets the chart object lines style. [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/ChartAndrewsPitchfork/LineStyle/index.md)
- `int Thickness {get; set;}` — Gets or sets the chart object lines thickness. [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/ChartAndrewsPitchfork/Thickness/index.md)
- `DateTime Time1 {get; set;}` — Gets or sets the time value for the Andrew's Pitchfork point 1. [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/ChartAndrewsPitchfork/Time1/index.md)
- `DateTime Time2 {get; set;}` — Gets or sets the time value for the Andrew's Pitchfork point 2. [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/ChartAndrewsPitchfork/Time2/index.md)
- `DateTime Time3 {get; set;}` — Gets or sets the time value for the Andrew's Pitchfork point 3. [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/ChartAndrewsPitchfork/Time3/index.md)
- `double Y1 {get; set;}` — Gets or sets the Y-axis value for the Andrew's Pitchfork point 1. [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/ChartAndrewsPitchfork/Y1/index.md)
- `double Y2 {get; set;}` — Gets or sets the Y-axis value for the Andrew's Pitchfork point 2. [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/ChartAndrewsPitchfork/Y2/index.md)
- `double Y3 {get; set;}` — Gets or sets the Y-axis value for the Andrew's Pitchfork point 3. [details](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/ChartAndrewsPitchfork/Y3/index.md)

## Inherited members

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

