ChartArea.DrawGannFan
method · ChartArea · cAlgo.API Since 5.6
DesktopCLICloud
Draws a Gann fan.
Environment behaviour
CLI — works differently. The object is created and returned, but never drawn: the CLI displays no chart.
Cloud — works differently. The object is created and returned, but never drawn: the cloud displays no chart.
Overloads
DrawGannFan(string name, DateTime time1, double y1, DateTime time2, double y2, Color color)
Draws a Gann fan.
ChartGannFan DrawGannFan(string name, DateTime time1, double y1, DateTime time2, double y2, Color color)
chartArea.DrawGannFan(name: str, time1: DateTime, y1: float, time2: DateTime, y2: float, color: Color) -> ChartGannFan
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
name | string | str | The chart object name - a unique name that can be only used once for a chart area. If duplicated, the chart object will be replaced with a new one of the same name. |
time1 | DateTime | DateTime | The time value of the Gann fan start point location on the X-axis. |
y1 | double | float | The Y-axis value of the Gann fan start point location. |
time2 | DateTime | DateTime | The time value of the Gann fan end point location on the X-axis. |
y2 | double | float | The Y-axis value of the Gann fan end point location. |
color | Color | Color | The Gann fan lines color. |
Returns ChartGannFan — ChartGannFan.
Examples
var gannFan = Chart.DrawGannFan("gannFan", Bars.OpenTimes.Last(30), Bars.LowPrices.Last(30), Bars.OpenTimes.LastValue, Bars.HighPrices.LastValue, Color.Blue);
Print("Gann fan levels: {0}", gannFan.GannLevels.Count);
gannFan = api.Chart.DrawGannFan("gannFan", api.Bars.OpenTimes.Last(30), api.Bars.LowPrices.Last(30), api.Bars.OpenTimes.LastValue, api.Bars.HighPrices.LastValue, Color.Blue)
api.Print(f"Gann fan levels: {gannFan.GannLevels.Count}")
DrawGannFan(string name, DateTime time1, double y1, DateTime time2, double y2, Color color, int thickness)
Draws a Gann fan.
ChartGannFan DrawGannFan(string name, DateTime time1, double y1, DateTime time2, double y2, Color color, int thickness)
chartArea.DrawGannFan(name: str, time1: DateTime, y1: float, time2: DateTime, y2: float, color: Color, thickness: int) -> ChartGannFan
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
name | string | str | The chart object name - a unique name that can be only used once for a chart area. If duplicated, the chart object will be replaced with a new one of the same name. |
time1 | DateTime | DateTime | The time value of the Gann fan start point location on the X-axis. |
y1 | double | float | The Y-axis value of the Gann fan start point location. |
time2 | DateTime | DateTime | The time value of the Gann fan end point location on the X-axis. |
y2 | double | float | The Y-axis value of the Gann fan end point location. |
color | Color | Color | The Gann fan lines color. |
thickness | int | int | The Gann fan lines thickness. |
Returns ChartGannFan — ChartGannFan.
Examples
var gannFan = Chart.DrawGannFan("gannFan", Bars.OpenTimes.Last(30), Bars.LowPrices.Last(30), Bars.OpenTimes.LastValue, Bars.HighPrices.LastValue, Color.Blue, 2);
Print("Gann fan thickness: {0}", gannFan.Thickness);
gannFan = api.Chart.DrawGannFan("gannFan", api.Bars.OpenTimes.Last(30), api.Bars.LowPrices.Last(30), api.Bars.OpenTimes.LastValue, api.Bars.HighPrices.LastValue, Color.Blue, 2)
api.Print(f"Gann fan thickness: {gannFan.Thickness}")
DrawGannFan(string name, DateTime time1, double y1, DateTime time2, double y2, Color color, int thickness, LineStyle lineStyle)
Draws a Gann fan.
ChartGannFan DrawGannFan(string name, DateTime time1, double y1, DateTime time2, double y2, Color color, int thickness, LineStyle lineStyle)
chartArea.DrawGannFan(name: str, time1: DateTime, y1: float, time2: DateTime, y2: float, color: Color, thickness: int, lineStyle: LineStyle) -> ChartGannFan
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
name | string | str | The chart object name - a unique name that can be only used once for a chart area. If duplicated, the chart object will be replaced with a new one of the same name. |
time1 | DateTime | DateTime | The time value of the Gann fan start point location on the X-axis. |
y1 | double | float | The Y-axis value of the Gann fan start point location. |
time2 | DateTime | DateTime | The time value of the Gann fan end point location on the X-axis. |
y2 | double | float | The Y-axis value of the Gann fan end point location. |
color | Color | Color | The Gann fan lines color. |
thickness | int | int | The Gann fan lines thickness. |
lineStyle | LineStyle | LineStyle | The Gann fan lines style. |
Returns ChartGannFan — ChartGannFan.
Examples
var gannFan = Chart.DrawGannFan("gannFan", Bars.OpenTimes.Last(30), Bars.LowPrices.Last(30), Bars.OpenTimes.LastValue, Bars.HighPrices.LastValue, Color.Blue, 2, LineStyle.Dots);
Print("Gann fan style: {0}", gannFan.LineStyle);
gannFan = api.Chart.DrawGannFan("gannFan", api.Bars.OpenTimes.Last(30), api.Bars.LowPrices.Last(30), api.Bars.OpenTimes.LastValue, api.Bars.HighPrices.LastValue, Color.Blue, 2, LineStyle.Dots)
api.Print(f"Gann fan style: {gannFan.LineStyle}")
DrawGannFan(string name, int barIndex1, double y1, int barIndex2, double y2, Color color)
Draws a Gann fan.
ChartGannFan DrawGannFan(string name, int barIndex1, double y1, int barIndex2, double y2, Color color)
chartArea.DrawGannFan(name: str, barIndex1: int, y1: float, barIndex2: int, y2: float, color: Color) -> ChartGannFan
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
name | string | str | The chart object name - a unique name that can be only used once for a chart area. If duplicated, the chart object will be replaced with a new one of the same name. |
barIndex1 | int | int | The bar index of the Gann fan start point location on the X-axis. |
y1 | double | float | The Y-axis value of the Gann fan start point location. |
barIndex2 | int | int | The Y-axis value of the Gann fan end point location. |
y2 | double | float | The Y-axis value of the Gann fan end point location. |
color | Color | Color | The Gann fan lines color. |
Returns ChartGannFan — ChartGannFan.
Examples
var index = Bars.Count - 1;
var gannFan = Chart.DrawGannFan("gannFan", index - 30, Bars.LowPrices[index - 30], index, Bars.HighPrices[index], Color.Blue);
Print("Gann fan levels: {0}", gannFan.GannLevels.Count);
index = api.Bars.Count - 1
gannFan = api.Chart.DrawGannFan("gannFan", index - 30, api.Bars.LowPrices[index - 30], index, api.Bars.HighPrices[index], Color.Blue)
api.Print(f"Gann fan levels: {gannFan.GannLevels.Count}")
DrawGannFan(string name, int barIndex1, double y1, int barIndex2, double y2, Color color, int thickness)
Draws a Gann fan.
ChartGannFan DrawGannFan(string name, int barIndex1, double y1, int barIndex2, double y2, Color color, int thickness)
chartArea.DrawGannFan(name: str, barIndex1: int, y1: float, barIndex2: int, y2: float, color: Color, thickness: int) -> ChartGannFan
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
name | string | str | The chart object name - a unique name that can be only used once for a chart area. If duplicated, the chart object will be replaced with a new one of the same name. |
barIndex1 | int | int | The bar index of the Gann fan start point location on the X-axis. |
y1 | double | float | The Y-axis value of the Gann fan start point location. |
barIndex2 | int | int | The Y-axis value of the Gann fan end point location. |
y2 | double | float | The Y-axis value of the Gann fan end point location. |
color | Color | Color | The Gann fan lines color. |
thickness | int | int | The Gann fan lines thickness. |
Returns ChartGannFan — ChartGannFan.
Examples
var index = Bars.Count - 1;
var gannFan = Chart.DrawGannFan("gannFan", index - 30, Bars.LowPrices[index - 30], index, Bars.HighPrices[index], Color.Blue, 2);
Print("Gann fan thickness: {0}", gannFan.Thickness);
index = api.Bars.Count - 1
gannFan = api.Chart.DrawGannFan("gannFan", index - 30, api.Bars.LowPrices[index - 30], index, api.Bars.HighPrices[index], Color.Blue, 2)
api.Print(f"Gann fan thickness: {gannFan.Thickness}")
DrawGannFan(string name, int barIndex1, double y1, int barIndex2, double y2, Color color, int thickness, LineStyle lineStyle)
Draws a Gann fan.
ChartGannFan DrawGannFan(string name, int barIndex1, double y1, int barIndex2, double y2, Color color, int thickness, LineStyle lineStyle)
chartArea.DrawGannFan(name: str, barIndex1: int, y1: float, barIndex2: int, y2: float, color: Color, thickness: int, lineStyle: LineStyle) -> ChartGannFan
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
name | string | str | The chart object name - a unique name that can be only used once for a chart area. If duplicated, the chart object will be replaced with a new one of the same name. |
barIndex1 | int | int | The bar index of the Gann fan start point location on the X-axis. |
y1 | double | float | The Y-axis value of the Gann fan start point location. |
barIndex2 | int | int | The Y-axis value of the Gann fan end point location. |
y2 | double | float | The Y-axis value of the Gann fan end point location. |
color | Color | Color | The Gann fan lines color. |
thickness | int | int | The Gann fan lines thickness. |
lineStyle | LineStyle | LineStyle | The Gann fan lines style. |
Returns ChartGannFan — ChartGannFan.
Examples
var index = Bars.Count - 1;
var gannFan = Chart.DrawGannFan("gannFan", index - 30, Bars.LowPrices[index - 30], index, Bars.HighPrices[index], Color.Blue, 2, LineStyle.Dots);
Print("Gann fan style: {0}", gannFan.LineStyle);
index = api.Bars.Count - 1
gannFan = api.Chart.DrawGannFan("gannFan", index - 30, api.Bars.LowPrices[index - 30], index, api.Bars.HighPrices[index], Color.Blue, 2, LineStyle.Dots)
api.Print(f"Gann fan style: {gannFan.LineStyle}")