Plugin.CustomSymbols
property · Plugin · cAlgo.API Since 5.3
DesktopCLICloud
Provides access to custom symbols API.
Environment behaviour
CLI — not supported. Plugins cannot run in the CLI: ctrader-cli runs cBots only.
Cloud — not supported. Plugins cannot run in the cloud: it runs cBots only.
Definition
public CustomSymbols CustomSymbols {get;}
api.CustomSymbols: CustomSymbols
Returns CustomSymbols
Examples
var customSymbol = CustomSymbols.Get("MYEURUSD") ?? CustomSymbols.Add("MYEURUSD", Symbols.GetSymbol("EURUSD"));
Print("Custom symbol {0} with ID {1}", customSymbol.Name, customSymbol.Id);
customSymbol = api.CustomSymbols.Get("MYEURUSD")
if customSymbol is None:
customSymbol = api.CustomSymbols.Add("MYEURUSD", api.Symbols.GetSymbol("EURUSD"))
api.Print(f"Custom symbol {customSymbol.Name} with ID {customSymbol.Id}")