XTB icon

XTB

Interact with XTB Trading API. Supports Account resources.

Overview

This node integrates with the XTB Trading API to retrieve various types of trading-related data. Specifically, for the MarketData resource and the Get Trading Hours operation, it fetches the trading hours information for specified market symbols. This is useful for traders or automated systems that need to know when particular markets or instruments are open for trading.

Common scenarios include:

  • Scheduling trades or alerts only during active trading hours.
  • Displaying market open/close times in dashboards.
  • Avoiding order submissions outside valid trading periods.

Example: A user wants to check the trading hours for a list of forex pairs before placing orders to ensure they trade only during active sessions.

Properties

Name Meaning
Symbols The market symbols (e.g., currency pairs, stock tickers) for which to get trading hours.

Output

The node outputs an array of JSON objects, each representing the trading hours details for one of the requested symbols. The exact structure depends on the API response but typically includes fields such as symbol identifier, opening time, closing time, and possibly timezone or session details.

No binary data output is produced by this operation.

Dependencies

  • Requires an active connection to the XTB Trading API via a WebSocket manager.
  • Needs an API authentication token credential configured in n8n to authorize requests.
  • Uses the @sharplygroup/xtb-api-js library internally to interact with the XTB API.

Troubleshooting

  • Connection errors: If the node cannot connect to the XTB API, verify that the API key credential is correctly set up and has necessary permissions.
  • Invalid symbols: Providing incorrect or unsupported symbols may result in empty or error responses. Double-check symbol names.
  • API limits or downtime: The XTB API might throttle requests or be temporarily unavailable; handle such errors gracefully.
  • NodeOperationError: Generic errors thrown if the resource or operation name is unknown or if the API returns an error. Ensure correct resource ("marketData") and operation ("getTradingHours") selections.

Links and References

Discussion