GetSymbolName
Syntax
GetSymbolName(pos: number): stringParameters
Return Value
Description
Example
// Get name of first symbol
const firstSymbol = this.api.GetSymbolName(0)
console.log(`First symbol: ${firstSymbol}`)
// Print all available symbols with their indices
const symbolCount = this.api.GetAvailableSymbolCount()
for (let i = 0; i < symbolCount; i++) {
const symbolName = this.api.GetSymbolName(i)
console.log(`Index ${i}: ${symbolName}`)
}
// Find specific symbol index
const targetSymbol = 'EURUSD'
for (let i = 0; i < symbolCount; i++) {
if (this.api.GetSymbolName(i) === targetSymbol) {
console.log(`${targetSymbol} found at index ${i}`)
break
}
}Last updated