Symbol
Returns the name of the current trading symbol.
Syntax
Symbol(): string
Return Value
Returns a string
representing the current symbol name.
Description
The Symbol
method returns the name of the currently selected trading symbol. This is the identifier used for the financial instrument being traded or analyzed.
Example
// Get the current symbol name
const symbolName = this.api.Symbol();
console.log(`Current symbol: ${symbolName}`); // e.g., "EURUSD"
// Use symbol name in conditions
if (this.api.Symbol() === "EURUSD") {
// EURUSD specific logic
}
Last updated