Skip to content

ChartTypeEventArgs.Chart

property · ChartTypeEventArgs · cAlgo.API

DesktopCLICloud

Gets the chart.

Environment behaviour

Cloud — not supported. Never raised in the cloud: the events that pass it never fire there (Chart.ChartTypeChanged).

Definition

public Chart Chart {get;}
chartTypeEventArgs.Chart: Chart

Returns Chart

Examples

protected override void OnStart()
{
    Chart.ChartTypeChanged += OnChartTypeChanged;
}

private void OnChartTypeChanged(ChartTypeEventArgs args)
{
    if (args.Chart.ChartType != ChartType.Candlesticks)
        Print("Chart {0} switched to {1}", args.Chart.SymbolName, args.Chart.ChartType);
}
def on_start(self):
    api.Chart.ChartTypeChanged += self.on_chart_type_changed

def on_chart_type_changed(self, args):
    if args.Chart.ChartType != ChartType.Candlesticks:
        api.Print(f"Chart {args.Chart.SymbolName} switched to {args.Chart.ChartType}")