ChartGannSquareFixed.CalculateY
method · ChartGannSquareFixed · cAlgo.API Since 5.8
DesktopCLICloud
Calculates Y-axis value corresponding the specified bar index.
Environment behaviour
CLI — works differently. Created and kept with all its properties, but never drawn: the CLI displays no chart.
Cloud — works differently. Created and kept with all its properties, but never drawn: the cloud displays no chart.
Overloads
| Signature | Description |
|---|---|
CalculateY(int barIndex, GannLevel level) | Calculates Y-axis value corresponding the specified bar index. |
CalculateY(DateTime time, GannLevel level) | Calculates Y-axis value corresponding the specified time value. |
CalculateY(int barIndex, GannLevel level)
Calculates Y-axis value corresponding the specified bar index.
double CalculateY(int barIndex, GannLevel level)
chartGannSquareFixed.CalculateY(barIndex: int, level: GannLevel) -> float
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
barIndex | int | int | Index of the bar. |
level | GannLevel | GannLevel | Level to get Y-axis value for. |
Returns double — Y-axis value
Examples
var gannSquare = Chart.DrawGannSquareFixed("gannSquareFixed", Bars.OpenTimes.Last(30), Bars.LowPrices.Last(30), Bars.OpenTimes.Last(10), Bars.HighPrices.Last(10), Color.Blue);
foreach (var level in gannSquare.GannLevels)
Print("Gann {0} ray value at the last bar: {1}", level.Ratio, gannSquare.CalculateY(Bars.Count - 1, level));
gannSquare = api.Chart.DrawGannSquareFixed("gannSquareFixed", api.Bars.OpenTimes.Last(30), api.Bars.LowPrices.Last(30), api.Bars.OpenTimes.Last(10), api.Bars.HighPrices.Last(10), Color.Blue)
for level in gannSquare.GannLevels:
api.Print(f"Gann {level.Ratio} ray value at the last bar: {gannSquare.CalculateY(api.Bars.Count - 1, level)}")
CalculateY(DateTime time, GannLevel level)
Calculates Y-axis value corresponding the specified time value.
double CalculateY(DateTime time, GannLevel level)
chartGannSquareFixed.CalculateY(time: DateTime, level: GannLevel) -> float
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
time | DateTime | DateTime | The time. |
level | GannLevel | GannLevel | Level to get Y-axis value for. |
Returns double — Y-axis value
Examples
var gannSquare = Chart.DrawGannSquareFixed("gannSquareFixed", Bars.OpenTimes.Last(30), Bars.LowPrices.Last(30), Bars.OpenTimes.Last(10), Bars.HighPrices.Last(10), Color.Blue);
var level = gannSquare.GannLevels[0];
Print("Gann {0} ray value at {1}: {2}", level.Ratio, Bars.OpenTimes.LastValue, gannSquare.CalculateY(Bars.OpenTimes.LastValue, level));
gannSquare = api.Chart.DrawGannSquareFixed("gannSquareFixed", api.Bars.OpenTimes.Last(30), api.Bars.LowPrices.Last(30), api.Bars.OpenTimes.Last(10), api.Bars.HighPrices.Last(10), Color.Blue)
level = gannSquare.GannLevels[0]
api.Print(f"Gann {level.Ratio} ray value at {api.Bars.OpenTimes.LastValue}: {gannSquare.CalculateY(api.Bars.OpenTimes.LastValue, level)}")