Skip to content

CustomSymbolNewChartEventArgs.CustomSymbol

property · CustomSymbolNewChartEventArgs · cAlgo.API Since 5.3

DesktopCLICloud

Gets 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 CustomSymbol CustomSymbol {get;}
customSymbolNewChartEventArgs.CustomSymbol: CustomSymbol

Returns CustomSymbol

Examples

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

private void OnCustomSymbolNewChart(CustomSymbolNewChartEventArgs args)
{
    Print("Chart opened for custom symbol {0}, pip digits: {1}", args.CustomSymbol.Name, args.CustomSymbol.PipDigits);
}
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):
    api.Print(f"Chart opened for custom symbol {args.CustomSymbol.Name}, pip digits: {args.CustomSymbol.PipDigits}")