Skip to content

ChartAndrewsPitchfork

interface cAlgo.API

DesktopCLICloud

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

Environment behaviour

CLI — works differently. Created and kept with all its properties, but never drawn: the CLI displays no chart.

Cloud — works differently. Created and kept with all its properties, but never drawn: the cloud displays no chart.

Definition

public interface ChartAndrewsPitchfork

Namespace: cAlgo.API · Group: Drawings · Implements: ChartObject

Examples

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)
        {
        }
    }
}
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
{
  "AccessRights": "None",
  "TimeZone": "UTC",
  "IsOverlay": true
}

Methods

Name Description
CalculateY 2 overloadsDesktopCLIClouddouble Calculates Y-axis value corresponding the specified bar index.

Properties

Name Description
ColorDesktopCLICloudColor Gets or sets the chart object lines color.
LineStyleDesktopCLICloudLineStyle Gets or sets the chart object lines style.
ThicknessDesktopCLICloudint Gets or sets the chart object lines thickness.
Time1DesktopCLICloudDateTime Gets or sets the time value for the Andrew's Pitchfork point 1.
Time2DesktopCLICloudDateTime Gets or sets the time value for the Andrew's Pitchfork point 2.
Time3DesktopCLICloudDateTime Gets or sets the time value for the Andrew's Pitchfork point 3.
Y1DesktopCLIClouddouble Gets or sets the Y-axis value for the Andrew's Pitchfork point 1.
Y2DesktopCLIClouddouble Gets or sets the Y-axis value for the Andrew's Pitchfork point 2.
Y3DesktopCLIClouddouble Gets or sets the Y-axis value for the Andrew's Pitchfork point 3.

Inherited members

From ChartObject: Name, Comment, ObjectType, IsInteractive, IsLocked, IsHidden, ZIndex, IsAlive

See also