XTB icon

XTB

Interact with XTB Trading API. Supports Account resources.

Overview

This node interacts with the XTB Trading API to retrieve trade-related data. Specifically, for the "Trade" resource and the "Get Trade Records" operation, it fetches trade records associated with specified order numbers. This is useful in scenarios where users want to analyze or monitor specific trades by their order IDs, such as reviewing past trades, auditing trading activity, or integrating trade data into other workflows.

Practical examples include:

  • Fetching detailed trade records for a list of order IDs to generate reports.
  • Monitoring specific trades for compliance or performance analysis.
  • Integrating trade history into dashboards or alerting systems.

Properties

Name Meaning
Orders The order number(s) for which to retrieve the trade records. This is a required numeric input specifying the trade orders to query.

Output

The node outputs an array of JSON objects representing the trade records corresponding to the requested order numbers. Each object contains detailed information about a trade, such as trade identifiers, status, timestamps, prices, volumes, and other relevant trade metadata as provided by the XTB Trading API.

If the node supports binary data output (not explicitly shown in the code), it would typically represent any associated files or attachments related to trades, but this is not indicated here.

Dependencies

  • Requires an active connection to the XTB Trading API via a WebSocket manager.
  • Needs valid API credentials (an API key or authentication token) configured in n8n to authenticate requests.
  • Depends on the external @sharplygroup/xtb-api-js library for interacting with the XTB API.
  • Uses internal resource classes that wrap API operations for different resources including Trade.

Troubleshooting

  • Connection Issues: If the node fails to connect, verify that the API credentials are correct and that the XTB API service is reachable.
  • Invalid Order Numbers: Providing invalid or non-existent order numbers may result in empty responses or errors. Ensure the order numbers exist and are correctly formatted.
  • API Rate Limits: Excessive requests might trigger rate limiting; consider adding delays or batching requests.
  • Error Handling: If the node throws errors during execution, enabling "Continue On Fail" can help process remaining items while logging errors for problematic inputs.
  • Unknown Resource Error: This error occurs if an unsupported resource name is used; ensure the resource parameter is set to "trade" for this operation.

Links and References

Discussion