Skip to content

Symbols.Exists

method · Symbols · cAlgo.API

DesktopCLICloud

Defines if the specific symbol name exists in the list.

Definition

bool Exists(string symbolName)
api.Symbols.Exists(symbolName: str) -> bool

Parameters

Name C# type Python type Description
symbolName string str Name of the symbol you want to check

Returns bool

Examples

if (Symbols.Exists("XAUUSD"))
    Print("Gold price: {0}", Symbols.GetSymbol("XAUUSD").Bid);
else
    Print("XAUUSD is not available");
if api.Symbols.Exists("XAUUSD"):
    api.Print(f"Gold price: {api.Symbols.GetSymbol('XAUUSD').Bid}")
else:
    api.Print("XAUUSD is not available")