Skip to content

CustomSymbolNewChartEventArgs.Chart

property · CustomSymbolNewChartEventArgs · cAlgo.API Since 5.3

DesktopCLICloud

Chart that is newly opened or switched to custom symbol.

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

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

Returns Chart

Examples

protected override void OnStart()
{
    var customSymbol = CustomSymbols.Add("EURUSD.custom", Symbols.GetSymbol("EURUSD"));
    customSymbol.NewChart += OnCustomSymbolNewChart;
}

private void OnCustomSymbolNewChart(CustomSymbolNewChartEventArgs args)
{
    args.Chart.DrawStaticText("info", "Custom symbol chart", VerticalAlignment.Top, HorizontalAlignment.Left, Color.Gray);
}
def on_start(self):
    customSymbol = api.CustomSymbols.Add("EURUSD.custom", api.Symbols.GetSymbol("EURUSD"))
    customSymbol.NewChart += self.on_custom_symbol_new_chart

def on_custom_symbol_new_chart(self, args):
    args.Chart.DrawStaticText("info", "Custom symbol chart", VerticalAlignment.Top, HorizontalAlignment.Left, Color.Gray)