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

Properties

Name Description
Time1 { get; set; } Gets or sets the time value for the Andrew's Pitchfork point 1.
Time2 { get; set; } Gets or sets the time value for the Andrew's Pitchfork point 2.
Time3 { get; set; } Gets or sets the time value for the Andrew's Pitchfork point 3.
Y1 { get; set; } Gets or sets the Y-axis value for the Andrew's Pitchfork point 1.
Y2 { get; set; } Gets or sets the Y-axis value for the Andrew's Pitchfork point 2.
Y3 { get; set; } Gets or sets the Y-axis value for the Andrew's Pitchfork point 3.
Thickness { get; set; } Gets or sets the chart object lines thickness.
Color { get; set; } Gets or sets the chart object lines color.
LineStyle { get; set; } Gets or sets the chart object lines style.

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)
         {
         }
     }
 }

See Also


Last update: November 25, 2022

Comments