GannLevel
interface cAlgo.API Since 5.6
DesktopCLICloud
Represents a Gann Level.
Definition
public interface GannLevel
Namespace: cAlgo.API · Group: Gann
Examples
using cAlgo.API;
namespace cAlgo
{
// This sample shows how to use a chart Gann Fan levels property to modify the gann levels
public partial 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)
{
}
}
}
gannFan = api.Chart.DrawGannFan("GannFan", api.Chart.FirstVisibleBarIndex, api.Bars.ClosePrices[api.Chart.FirstVisibleBarIndex], api.Chart.LastVisibleBarIndex, api.Bars.ClosePrices[api.Chart.LastVisibleBarIndex], Color.Blue)
for level in gannFan.GannLevels:
api.Print(level.Ratio)
if level.Ratio > 4:
level.IsVisible = False
{
"AccessRights": "None",
"TimeZone": "UTC",
"IsOverlay": true
}