Skip to content

ChartArea.DrawFibonacciRetracement

method · ChartArea · cAlgo.API

DesktopCLICloud

Draws a Fibonacci retracement.

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

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

Draws a Fibonacci retracement.

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

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 Fibonacci retracement start point location on the X-axis.
y1 double float The Y-axis value of the Fibonacci retracement start point location.
time2 DateTime DateTime The time value of the Fibonacci retracement end point location on the X-axis.
y2 double float The Y-axis value of the Fibonacci retracement end point location.
color Color Color The Fibonacci retracement lines color.

Returns ChartFibonacciRetracement — ChartFibonacciRetracement.

Examples

var retracement = Chart.DrawFibonacciRetracement("retracement", Bars.OpenTimes.Last(50), Bars.HighPrices.Last(50), Bars.OpenTimes.LastValue, Bars.LowPrices.LastValue, Color.Red);
Print("Fibonacci retracement levels: {0}", retracement.FibonacciLevels.Count);
retracement = api.Chart.DrawFibonacciRetracement("retracement", api.Bars.OpenTimes.Last(50), api.Bars.HighPrices.Last(50), api.Bars.OpenTimes.LastValue, api.Bars.LowPrices.LastValue, Color.Red)
api.Print(f"Fibonacci retracement levels: {retracement.FibonacciLevels.Count}")

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

Draws a Fibonacci retracement.

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

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

Returns ChartFibonacciRetracement — ChartFibonacciRetracement.

Examples

var retracement = Chart.DrawFibonacciRetracement("retracement", Bars.OpenTimes.Last(50), Bars.HighPrices.Last(50), Bars.OpenTimes.LastValue, Bars.LowPrices.LastValue, Color.Red, 2);
Print("Fibonacci retracement thickness: {0}", retracement.Thickness);
retracement = api.Chart.DrawFibonacciRetracement("retracement", api.Bars.OpenTimes.Last(50), api.Bars.HighPrices.Last(50), api.Bars.OpenTimes.LastValue, api.Bars.LowPrices.LastValue, Color.Red, 2)
api.Print(f"Fibonacci retracement thickness: {retracement.Thickness}")

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

Draws a Fibonacci retracement.

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

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

Returns ChartFibonacciRetracement — ChartFibonacciRetracement.

Examples

var retracement = Chart.DrawFibonacciRetracement("retracement", Bars.OpenTimes.Last(50), Bars.HighPrices.Last(50), Bars.OpenTimes.LastValue, Bars.LowPrices.LastValue, Color.Red, 2, LineStyle.Dots);
Print("Fibonacci retracement style: {0}", retracement.LineStyle);
retracement = api.Chart.DrawFibonacciRetracement("retracement", api.Bars.OpenTimes.Last(50), api.Bars.HighPrices.Last(50), api.Bars.OpenTimes.LastValue, api.Bars.LowPrices.LastValue, Color.Red, 2, LineStyle.Dots)
api.Print(f"Fibonacci retracement style: {retracement.LineStyle}")

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

Draws a Fibonacci retracement.

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

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

Returns ChartFibonacciRetracement — ChartFibonacciRetracement.

Examples

var index = Bars.Count - 1;
var retracement = Chart.DrawFibonacciRetracement("retracement", index - 50, Bars.HighPrices[index - 50], index, Bars.LowPrices[index], Color.Red);
Print("Fibonacci retracement levels: {0}", retracement.FibonacciLevels.Count);
index = api.Bars.Count - 1
retracement = api.Chart.DrawFibonacciRetracement("retracement", index - 50, api.Bars.HighPrices[index - 50], index, api.Bars.LowPrices[index], Color.Red)
api.Print(f"Fibonacci retracement levels: {retracement.FibonacciLevels.Count}")

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

Draws a Fibonacci retracement.

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

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

Returns ChartFibonacciRetracement — ChartFibonacciRetracement.

Examples

var index = Bars.Count - 1;
var retracement = Chart.DrawFibonacciRetracement("retracement", index - 50, Bars.HighPrices[index - 50], index, Bars.LowPrices[index], Color.Red, 2);
Print("Fibonacci retracement thickness: {0}", retracement.Thickness);
index = api.Bars.Count - 1
retracement = api.Chart.DrawFibonacciRetracement("retracement", index - 50, api.Bars.HighPrices[index - 50], index, api.Bars.LowPrices[index], Color.Red, 2)
api.Print(f"Fibonacci retracement thickness: {retracement.Thickness}")

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

Draws a Fibonacci retracement.

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

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

Returns ChartFibonacciRetracement — ChartFibonacciRetracement.

Examples

var index = Bars.Count - 1;
var retracement = Chart.DrawFibonacciRetracement("retracement", index - 50, Bars.HighPrices[index - 50], index, Bars.LowPrices[index], Color.Red, 2, LineStyle.Dots);
Print("Fibonacci retracement style: {0}", retracement.LineStyle);
index = api.Bars.Count - 1
retracement = api.Chart.DrawFibonacciRetracement("retracement", index - 50, api.Bars.HighPrices[index - 50], index, api.Bars.LowPrices[index], Color.Red, 2, LineStyle.Dots)
api.Print(f"Fibonacci retracement style: {retracement.LineStyle}")