Skip to content

ChartArea.DrawEquidistantChannel

method · ChartArea · cAlgo.API

DesktopCLICloud

Draws an equidistant channel.

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

DrawEquidistantChannel(string name, DateTime time1, double y1, DateTime time2, double y2, double channelHeight, Color color)

Draws an equidistant channel.

ChartEquidistantChannel DrawEquidistantChannel(string name, DateTime time1, double y1, DateTime time2, double y2, double channelHeight, Color color)
chartArea.DrawEquidistantChannel(name: str, time1: DateTime, y1: float, time2: DateTime, y2: float, channelHeight: float, color: Color) -> ChartEquidistantChannel

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 equidistant channel start point location on the X-axis.
y1 double float The Y-axis value of the equidistant channel start location.
time2 DateTime DateTime The time value of the equidistant channel end point location on the X-axis.
y2 double float The Y-axis value of the equidistant channel end location.
channelHeight double float The equidistant channel hight in pips.
color Color Color The color of the equidistant channel lines.

Returns ChartEquidistantChannel

Examples

var channel = Chart.DrawEquidistantChannel("channel", Bars.OpenTimes.Last(30), Bars.LowPrices.Last(30), Bars.OpenTimes.LastValue, Bars.LowPrices.LastValue, 20 * Symbol.PipSize, Color.Red);
Print("Channel height in pips: {0}", channel.ChannelHeight / Symbol.PipSize);
channel = api.Chart.DrawEquidistantChannel("channel", api.Bars.OpenTimes.Last(30), api.Bars.LowPrices.Last(30), api.Bars.OpenTimes.LastValue, api.Bars.LowPrices.LastValue, 20 * api.Symbol.PipSize, Color.Red)
api.Print(f"Channel height in pips: {channel.ChannelHeight / api.Symbol.PipSize}")

DrawEquidistantChannel(string name, DateTime time1, double y1, DateTime time2, double y2, double channelHeight, Color color, int thickness)

Draws an equidistant channel.

ChartEquidistantChannel DrawEquidistantChannel(string name, DateTime time1, double y1, DateTime time2, double y2, double channelHeight, Color color, int thickness)
chartArea.DrawEquidistantChannel(name: str, time1: DateTime, y1: float, time2: DateTime, y2: float, channelHeight: float, color: Color, thickness: int) -> ChartEquidistantChannel

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 equidistant channel start point location on the X-axis.
y1 double float The Y-axis value of the equidistant channel start location.
time2 DateTime DateTime The time value of the equidistant channel end point location on the X-axis.
y2 double float The Y-axis value of the equidistant channel end location.
channelHeight double float The equidistant channel hight in pips.
color Color Color The color of the equidistant channel lines.
thickness int int The thickness of the equidistant channel lines.

Returns ChartEquidistantChannel

Examples

var channel = Chart.DrawEquidistantChannel("channel", Bars.OpenTimes.Last(30), Bars.LowPrices.Last(30), Bars.OpenTimes.LastValue, Bars.LowPrices.LastValue, 20 * Symbol.PipSize, Color.Red, 2);
Print("Channel thickness: {0}", channel.Thickness);
channel = api.Chart.DrawEquidistantChannel("channel", api.Bars.OpenTimes.Last(30), api.Bars.LowPrices.Last(30), api.Bars.OpenTimes.LastValue, api.Bars.LowPrices.LastValue, 20 * api.Symbol.PipSize, Color.Red, 2)
api.Print(f"Channel thickness: {channel.Thickness}")

DrawEquidistantChannel(string name, DateTime time1, double y1, DateTime time2, double y2, double channelHeight, Color color, int thickness, LineStyle lineStyle)

Draws an equidistant channel.

ChartEquidistantChannel DrawEquidistantChannel(string name, DateTime time1, double y1, DateTime time2, double y2, double channelHeight, Color color, int thickness, LineStyle lineStyle)
chartArea.DrawEquidistantChannel(name: str, time1: DateTime, y1: float, time2: DateTime, y2: float, channelHeight: float, color: Color, thickness: int, lineStyle: LineStyle) -> ChartEquidistantChannel

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 equidistant channel start point location on the X-axis.
y1 double float The Y-axis value of the equidistant channel start location.
time2 DateTime DateTime The time value of the equidistant channel end point location on the X-axis.
y2 double float The Y-axis value of the equidistant channel end location.
channelHeight double float The equidistant channel hight in pips.
color Color Color The color of the equidistant channel lines.
thickness int int The thickness of the equidistant channel lines.
lineStyle LineStyle LineStyle The equidistant channel lines style.

Returns ChartEquidistantChannel

Examples

var channel = Chart.DrawEquidistantChannel("channel", Bars.OpenTimes.Last(30), Bars.LowPrices.Last(30), Bars.OpenTimes.LastValue, Bars.LowPrices.LastValue, 20 * Symbol.PipSize, Color.Red, 2, LineStyle.Dots);
Print("Channel line style: {0}", channel.LineStyle);
channel = api.Chart.DrawEquidistantChannel("channel", api.Bars.OpenTimes.Last(30), api.Bars.LowPrices.Last(30), api.Bars.OpenTimes.LastValue, api.Bars.LowPrices.LastValue, 20 * api.Symbol.PipSize, Color.Red, 2, LineStyle.Dots)
api.Print(f"Channel line style: {channel.LineStyle}")

DrawEquidistantChannel(string name, int barIndex1, double y1, int barIndex2, double y2, double channelHeight, Color color)

Draws an equidistant channel.

ChartEquidistantChannel DrawEquidistantChannel(string name, int barIndex1, double y1, int barIndex2, double y2, double channelHeight, Color color)
chartArea.DrawEquidistantChannel(name: str, barIndex1: int, y1: float, barIndex2: int, y2: float, channelHeight: float, color: Color) -> ChartEquidistantChannel

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 equidistant channel start point location on the X-axis.
y1 double float The Y-axis value of the equidistant channel start location.
barIndex2 int int The bar index of the equidistant channel end point location on the X-axis.
y2 double float The Y-axis value of the equidistant channel end location.
channelHeight double float The equidistant channel hight in pips.
color Color Color The color of the equidistant channel lines.

Returns ChartEquidistantChannel

Examples

var index = Bars.Count - 1;
var channel = Chart.DrawEquidistantChannel("channel", index - 30, Bars.LowPrices[index - 30], index, Bars.LowPrices[index], 20 * Symbol.PipSize, Color.Red);
Print("Channel height in pips: {0}", channel.ChannelHeight / Symbol.PipSize);
index = api.Bars.Count - 1
channel = api.Chart.DrawEquidistantChannel("channel", index - 30, api.Bars.LowPrices[index - 30], index, api.Bars.LowPrices[index], 20 * api.Symbol.PipSize, Color.Red)
api.Print(f"Channel height in pips: {channel.ChannelHeight / api.Symbol.PipSize}")

DrawEquidistantChannel(string name, int barIndex1, double y1, int barIndex2, double y2, double channelHeight, Color color, int thickness)

Draws an equidistant channel.

ChartEquidistantChannel DrawEquidistantChannel(string name, int barIndex1, double y1, int barIndex2, double y2, double channelHeight, Color color, int thickness)
chartArea.DrawEquidistantChannel(name: str, barIndex1: int, y1: float, barIndex2: int, y2: float, channelHeight: float, color: Color, thickness: int) -> ChartEquidistantChannel

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 equidistant channel start point location on the X-axis.
y1 double float The Y-axis value of the equidistant channel start location.
barIndex2 int int The bar index of the equidistant channel end point location on the X-axis.
y2 double float The Y-axis value of the equidistant channel end location.
channelHeight double float The equidistant channel hight in pips.
color Color Color The color of the equidistant channel lines.
thickness int int The thickness of the equidistant channel lines.

Returns ChartEquidistantChannel

Examples

var index = Bars.Count - 1;
var channel = Chart.DrawEquidistantChannel("channel", index - 30, Bars.LowPrices[index - 30], index, Bars.LowPrices[index], 20 * Symbol.PipSize, Color.Red, 2);
Print("Channel thickness: {0}", channel.Thickness);
index = api.Bars.Count - 1
channel = api.Chart.DrawEquidistantChannel("channel", index - 30, api.Bars.LowPrices[index - 30], index, api.Bars.LowPrices[index], 20 * api.Symbol.PipSize, Color.Red, 2)
api.Print(f"Channel thickness: {channel.Thickness}")

DrawEquidistantChannel(string name, int barIndex1, double y1, int barIndex2, double y2, double channelHeight, Color color, int thickness, LineStyle lineStyle)

Draws an equidistant channel.

ChartEquidistantChannel DrawEquidistantChannel(string name, int barIndex1, double y1, int barIndex2, double y2, double channelHeight, Color color, int thickness, LineStyle lineStyle)
chartArea.DrawEquidistantChannel(name: str, barIndex1: int, y1: float, barIndex2: int, y2: float, channelHeight: float, color: Color, thickness: int, lineStyle: LineStyle) -> ChartEquidistantChannel

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 equidistant channel start point location on the X-axis.
y1 double float The Y-axis value of the equidistant channel start location.
barIndex2 int int The bar index of the equidistant channel end point location on the X-axis.
y2 double float The Y-axis value of the equidistant channel end location.
channelHeight double float The equidistant channel hight in pips.
color Color Color The color of the equidistant channel lines.
thickness int int The thickness of the equidistant channel lines.
lineStyle LineStyle LineStyle The equidistant channel lines style.

Returns ChartEquidistantChannel — ChartEquidistantChannel.

Examples

var index = Bars.Count - 1;
var channel = Chart.DrawEquidistantChannel("channel", index - 30, Bars.LowPrices[index - 30], index, Bars.LowPrices[index], 20 * Symbol.PipSize, Color.Red, 2, LineStyle.Dots);
Print("Channel line style: {0}", channel.LineStyle);
index = api.Bars.Count - 1
channel = api.Chart.DrawEquidistantChannel("channel", index - 30, api.Bars.LowPrices[index - 30], index, api.Bars.LowPrices[index], 20 * api.Symbol.PipSize, Color.Red, 2, LineStyle.Dots)
api.Print(f"Channel line style: {channel.LineStyle}")