Skip to content

ChartArea.FindObject

method · ChartArea · cAlgo.API

DesktopCLICloud

Finds the chart object of the specified name.

Definition

ChartObject FindObject(string objectName)
chartArea.FindObject(objectName: str) -> ChartObject

Parameters

Name C# type Python type Description
objectName string str The name of the object.

Returns ChartObject — ChartObject.

Examples

// Draw a horizontal line.
Chart.DrawHorizontalLine("hLine", Symbol.Ask, Color.Red);

// Find the line that was drawn.
var obj = Chart.FindObject("hLine");
Print("Found object with name {0}", obj.Name);
api.Chart.DrawHorizontalLine("hLine", api.Symbol.Ask, Color.Red)
obj = api.Chart.FindObject("hLine")
if obj is not None:
    api.Print(f"Found object with name {obj.Name}")