Skip to content

GannLevel

Summary

Represents a Gann Level.

Signature

1
public abstract interface GannLevel

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
 using cAlgo.API;
 namespace cAlgo
 {
     // This sample shows how to use a chart Gann Fan levels property to modify the gann levels
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class GannLevelSample : Indicator
     {
         protected override void Initialize()
         {
             var gannFan = Chart.DrawGannFan("GannFan", Chart.FirstVisibleBarIndex, Bars.ClosePrices[Chart.FirstVisibleBarIndex], Chart.LastVisibleBarIndex, Bars.ClosePrices[Chart.LastVisibleBarIndex], Color.Blue);
             foreach (var level in gannFan.GannLevels)
             {
                 Print(level.Ratio);
                 if (level.Ratio > 4) level.IsVisible = false;
             }
         }
         public override void Calculate(int index)
         {
         }
     }
 }

Properties

Ratio

Summary

Gets or sets the level ratio (e.g., 1.0 for 1x1, 2.0 for 2x1, 0.5 for 1x2).

Signature

1
public abstract double Ratio {get; set;}

Return Value

double

IsVisible

Summary

Defines if the level is visible.

Signature

1
public abstract bool IsVisible {get; set;}

Return Value

bool