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
SymbolRecordstructure and pass its address. - If an error occurs, data in
csmay be invalid — always check the return code.