Skip to content

ChartAndrewsPitchfork

Summary

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

Signature

1
public abstract interface ChartAndrewsPitchfork

Namespace

cAlgo.API

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 using cAlgo.API;
 namespace cAlgo
 {
     // This indicator shows how to draw an Andrews Pitchfork by using Chart.DrawAndrewsPitchfork method
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public 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)
         {
         }
     }
 }
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
 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

See Also

Methods

CalculateY (2)

CalculateY (1 of 2)

Summary

Calculates Y-axis value corresponding the specified bar index.

Signature

1
public abstract double CalculateY(int barIndex)

Parameters

Name Type Description
barIndex int Index of the bar.

Return Value

double

CalculateY (2 of 2)

Summary

Calculates Y-axis value corresponding the specified time value.

Signature

1
public abstract double CalculateY(DateTime time)

Parameters

Name Type Description
time DateTime The time.

Return Value

double

Properties

Time1

Summary

Gets or sets the time value for the Andrew's Pitchfork point 1.

Signature

1
public abstract DateTime Time1 {get; set;}

Return Value

DateTime

Time2

Summary

Gets or sets the time value for the Andrew's Pitchfork point 2.

Signature

1
public abstract DateTime Time2 {get; set;}

Return Value

DateTime

Time3

Summary

Gets or sets the time value for the Andrew's Pitchfork point 3.

Signature

1
public abstract DateTime Time3 {get; set;}

Return Value

DateTime

Y1

Summary

Gets or sets the Y-axis value for the Andrew's Pitchfork point 1.

Signature

1
public abstract double Y1 {get; set;}

Return Value

double

Y2

Summary

Gets or sets the Y-axis value for the Andrew's Pitchfork point 2.

Signature

1
public abstract double Y2 {get; set;}

Return Value

double

Y3

Summary

Gets or sets the Y-axis value for the Andrew's Pitchfork point 3.

Signature

1
public abstract double Y3 {get; set;}

Return Value

double

Thickness

Summary

Gets or sets the chart object lines thickness.

Signature

1
public abstract int Thickness {get; set;}

Return Value

int

Related Tutorials

Color

Summary

Gets or sets the chart object lines color.

Signature

1
public abstract Color Color {get; set;}

Return Value

Color

LineStyle

Summary

Gets or sets the chart object lines style.

Signature

1
public abstract LineStyle LineStyle {get; set;}

Return Value

LineStyle