GetOrderSymbol

Returns the symbol (currency pair) of the currently selected order.

Syntax

GetOrderSymbol(): string

Return Value

Returns a string representing the symbol (currency pair) of the selected order.

Description

The GetOrderSymbol method returns the financial instrument symbol (currency pair) on which the currently selected order was executed. Examples of symbols include "EURUSD", "GBPJPY", etc.

Before using this method, you must first select an order using the SelectOrder method.

Example

// Select an order by ticket number
if (this.api.SelectOrder(12345, EOrderSelectMode.SELECT_ORDER_BY_TICKET)) {
  // Get the order symbol
  const symbol = this.api.GetOrderSymbol();

  console.log(`Order #12345 was executed on ${symbol}`);
}

Notes

  • An order must be selected first using SelectOrder before calling this method.

Last updated