XTB icon

XTB

Interact with XTB Trading API. Supports Account resources.

Overview

This node interacts with the XTB Trading API, specifically supporting various resources including trading operations. For the Trading resource and the Trade Transaction Status operation, it retrieves the status of a specific trade transaction based on an order number. This is useful for monitoring the progress or result of trades placed through the XTB platform.

Common scenarios include:

  • Checking whether a trade order has been executed, rejected, or is still pending.
  • Automating trade management workflows by reacting to trade status updates.
  • Integrating trade status checks into broader financial dashboards or alerting systems.

Example: After placing a trade order, you can use this node to query the status of that order by providing its order number, enabling automated follow-up actions depending on the trade outcome.

Properties

Name Meaning
Order The numeric identifier of the trade order for which to retrieve the transaction status.

Output

The node outputs a JSON array where each element corresponds to the result of querying the trade transaction status for the specified order. The structure of each JSON object depends on the response from the XTB Trading API but generally includes details about the trade's current state, such as whether it is open, closed, pending, or if any errors occurred.

If the node supports binary data output (not indicated in the provided code), it would typically represent associated files or documents related to the trade, but no such binary output is evident 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 (AccountResource, CalculationResource, etc.) to handle different API endpoints.

Troubleshooting

  • Connection Issues: Failure to connect to the XTB API WebSocket may occur due to network problems or invalid credentials. Ensure your API credentials are correct and your network allows WebSocket connections.
  • Invalid Order Number: Providing an incorrect or non-existent order number will likely result in an error or empty response. Verify the order number before querying.
  • Unknown Resource or Operation: If the resource or operation parameters are misconfigured, the node throws an error indicating an unknown resource or operation.
  • API Rate Limits: Excessive requests might be throttled by the XTB API. Implement retry logic or respect rate limits.
  • Error Handling: If "Continue On Fail" is disabled, any error during execution will stop the workflow. Enable it to capture errors as part of the output for debugging.

Links and References

Discussion