Skip to content

Get Symbol

GetSymbol

Returns information about a trading symbol by its name.

int GetSymbol(const std::string& symbol, SymbolRecord *cs);

Parameters

  • symbol — string containing the symbol name (e.g., "EURUSD").
  • cs — pointer to a SymbolRecord structure where the result will be stored.

Return Value

  • RET_OK — data successfully retrieved.
  • RET_NOT_FOUNT — error (symbol not found).
  • Return Codes

Example

SymbolRecord rec;
if (GetSymbol("EURUSD", &rec) == RET_OK) {
    // Use data from rec
}

Warning

  • Before calling, allocate a SymbolRecord structure and pass its address.
  • If an error occurs, data in cs may be invalid — always check the return code.