Skip to content

ChartManager.ActiveFrame

property · ChartManager · cAlgo.API

DesktopCLICloud

Returns current active frame if any otherwise null.

Environment behaviour

CLI — not supported. Available to plugins only, and plugins cannot run in the CLI.

Cloud — not supported. Available to plugins only, and plugins cannot run in the cloud.

Definition

Frame ActiveFrame {get;}
api.ChartManager.ActiveFrame: Frame

Returns Frame

Examples

if (ChartManager.ActiveFrame is ChartFrame chartFrame)
    Print("Active chart: {0} {1}", chartFrame.Symbol.Name, chartFrame.TimeFrame);
activeFrame = api.ChartManager.ActiveFrame
if activeFrame is not None and isinstance(activeFrame.__implementation__, ChartFrame):
    chartFrame = ChartFrame(activeFrame)
    api.Print(f"Active chart: {chartFrame.Symbol.Name} {chartFrame.TimeFrame}")